diff --git a/.gitignore b/.gitignore index 57328941..b300d946 100644 --- a/.gitignore +++ b/.gitignore @@ -5,10 +5,9 @@ web_example/target/ web_example/static/web_example.d web_example/static/web_example.js web_example/static/web_example.wasm - # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html Cargo.lock - +.gdb_history # These are backup files generated by rustfmt **/*.rs.bk diff --git a/Cargo.toml b/Cargo.toml index 060cedc7..81a95a19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/emoon/bgfx-sys" documentation = "https://docs.rs/bgfx-sys/0.14/bgfx-sys" readme = "readme.md" name = "bgfx-sys" -version = "0.15.0" +version = "0.16.0" edition = "2018" build = "build.rs" diff --git a/bgfx/.github/workflows/main.yml b/bgfx/.github/workflows/main.yml index 2c55b275..316e4cbf 100644 --- a/bgfx/.github/workflows/main.yml +++ b/bgfx/.github/workflows/main.yml @@ -14,25 +14,25 @@ jobs: fail-fast: true matrix: include: [ - { config: Debug, platform: Win32, bindir: 'win32_vs2019' }, - { config: Debug, platform: x64, bindir: 'win64_vs2019' }, - { config: Release, platform: Win32, bindir: 'win32_vs2019' }, - { config: Release, platform: x64, bindir: 'win64_vs2019' }, + { config: Debug, platform: Win32, bindir: 'win32_vs2022' }, + { config: Debug, platform: x64, bindir: 'win64_vs2022' }, + { config: Release, platform: Win32, bindir: 'win32_vs2022' }, + { config: Release, platform: x64, bindir: 'win64_vs2022' }, ] name: msvc-${{ matrix.config }}-${{ matrix.platform }} - runs-on: windows-2019 + runs-on: windows-2022 steps: - name: Checkout bgfx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: bgfx - name: Checkout bx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bx path: bx - name: Checkout bimg - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bimg path: bimg @@ -42,8 +42,8 @@ jobs: shell: cmd run: | cd bgfx - ..\bx\tools\bin\windows\genie.exe --with-tools --with-combined-examples --with-shared-lib vs2019 - msbuild ".build/projects/vs2019/bgfx.sln" /m /v:minimal /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }} + ..\bx\tools\bin\windows\genie.exe --with-tools --with-combined-examples --with-shared-lib vs2022 + msbuild ".build/projects/vs2022/bgfx.sln" /m /v:minimal /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }} - name: Check shell: cmd run: | @@ -58,22 +58,22 @@ jobs: matrix: include: [ { msystem: MINGW64, project: 'mingw-gcc', bindir: 'win64_mingw-gcc' }, - { msystem: CLANG64, project: 'mingw-clang', bindir: 'win64_mingw-clang' }, +# { msystem: CLANG64, project: 'mingw-clang', bindir: 'win64_mingw-clang' }, ] name: mingw-${{ matrix.msystem }} - runs-on: windows-latest + runs-on: windows-2022 steps: - name: Checkout bgfx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: bgfx - name: Checkout bx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bx path: bx - name: Checkout bimg - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bimg path: bimg @@ -105,20 +105,20 @@ jobs: { config: debug, binsuffix: Debug }, { config: release, binsuffix: Release }, ] - name: linux-${{ matrix.config }}64 - runs-on: ubuntu-22.04 + name: linux-gcc-${{ matrix.config }}64 + runs-on: ubuntu-24.04 steps: - name: Checkout bgfx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: bgfx - name: Checkout bx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bx path: bx - name: Checkout bimg - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bimg path: bimg @@ -126,7 +126,7 @@ jobs: run: | sudo apt install libgl-dev cd bgfx - make -j$(nproc) linux-${{ matrix.config }}64 + make -j$(nproc) linux-gcc-${{ matrix.config }}64 - name: Check run: | cd bgfx @@ -134,42 +134,6 @@ jobs: ".build/linux64_gcc/bin/geometryc${{ matrix.binsuffix}}" --version ".build/linux64_gcc/bin/shaderc${{ matrix.binsuffix}}" --version ".build/linux64_gcc/bin/texturec${{ matrix.binsuffix}}" --version - wasm: - strategy: - fail-fast: true - matrix: - config: [ debug, release] - name: wasm-${{ matrix.config }} - runs-on: ubuntu-22.04 - steps: - - name: Checkout bgfx - uses: actions/checkout@v3 - with: - path: bgfx - - name: Checkout bx - uses: actions/checkout@v3 - with: - repository: bkaradzic/bx - path: bx - - name: Checkout bimg - uses: actions/checkout@v3 - with: - repository: bkaradzic/bimg - path: bimg - - name: Prepare - run: | - docker pull emscripten/emsdk - docker run --rm emscripten/emsdk which emcc em++ emar - cd bgfx - EMSCRIPTEN=/emsdk/upstream/emscripten ../bx/tools/bin/linux/genie --with-examples --gcc=wasm gmake - - name: Build - run: > - docker run --rm -u $(id -u):$(id -g) -v $(pwd):/bgfx emscripten/emsdk - make -C /bgfx/bgfx wasm-${{ matrix.config }} -j$(nproc) EMSCRIPTEN=/emsdk/upstream/emscripten - - name: Check - run: | - cd bgfx - ls -lash ".build/wasm/bin" osx: strategy: fail-fast: true @@ -178,34 +142,34 @@ jobs: { config: debug, binsuffix: Debug }, { config: release, binsuffix: Release }, ] - name: osx-x64-${{ matrix.config }} - runs-on: macos-latest + name: osx-arm64-${{ matrix.config }} + runs-on: macos-14 steps: - name: Checkout bgfx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: bgfx - name: Checkout bx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bx path: bx - name: Checkout bimg - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bimg path: bimg - name: Build run: | cd bgfx - make -j$(sysctl -n hw.physicalcpu) osx-x64-${{ matrix.config }} + make -j$(sysctl -n hw.physicalcpu) osx-arm64-${{ matrix.config }} - name: Check run: | cd bgfx - ls -lash ".build/osx-x64/bin" - ".build/osx-x64/bin/geometryc${{ matrix.binsuffix}}" --version - ".build/osx-x64/bin/shaderc${{ matrix.binsuffix}}" --version - ".build/osx-x64/bin/texturec${{ matrix.binsuffix}}" --version + ls -lash ".build/osx-arm64/bin" + ".build/osx-arm64/bin/geometryc${{ matrix.binsuffix}}" --version + ".build/osx-arm64/bin/shaderc${{ matrix.binsuffix}}" --version + ".build/osx-arm64/bin/texturec${{ matrix.binsuffix}}" --version android: strategy: fail-fast: true @@ -214,7 +178,7 @@ jobs: { platform: arm64 }, ] name: android-${{ matrix.platform }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: nttld/setup-ndk@v1 id: setup-ndk @@ -222,16 +186,16 @@ jobs: ndk-version: r25b add-to-path: false - name: Checkout bgfx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: bgfx - name: Checkout bx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bx path: bx - name: Checkout bimg - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: bkaradzic/bimg path: bimg diff --git a/bgfx/3rdparty/cgltf/cgltf.h b/bgfx/3rdparty/cgltf/cgltf.h index af24c65e..36fd644e 100644 --- a/bgfx/3rdparty/cgltf/cgltf.h +++ b/bgfx/3rdparty/cgltf/cgltf.h @@ -1,7 +1,7 @@ /** * cgltf - a single-file glTF 2.0 parser written in C99. * - * Version: 1.13 + * Version: 1.14 * * Website: https://github.com/jkuhlmann/cgltf * @@ -63,9 +63,14 @@ * By passing null for the output pointer, users can find out how many floats are required in the * output buffer. * + * `cgltf_accessor_unpack_indices` reads in the index data from an accessor. Assumes that + * `cgltf_load_buffers` has already been called. By passing null for the output pointer, users can + * find out how many indices are required in the output buffer. Returns 0 if the accessor is + * sparse or if the output component size is less than the accessor's component size. + * * `cgltf_num_components` is a tiny utility that tells you the dimensionality of * a certain accessor type. This can be used before `cgltf_accessor_unpack_floats` to help allocate - * the necessary amount of memory. `cgltf_component_size` and `cgltf_calc_size` exist for + * the necessary amount of memory. `cgltf_component_size` and `cgltf_calc_size` exist for * similar purposes. * * `cgltf_accessor_read_float` reads a certain element from a non-sparse accessor and converts it to @@ -75,7 +80,7 @@ * * `cgltf_accessor_read_uint` is similar to its floating-point counterpart, but limited to reading * vector types and does not support matrix types. The passed-in element size is the number of uints - * in the output buffer, which should be in the range [1, 4]. Returns false if the passed-in + * in the output buffer, which should be in the range [1, 4]. Returns false if the passed-in * element_size is too small, or if the accessor is sparse. * * `cgltf_accessor_read_index` is similar to its floating-point counterpart, but it returns size_t @@ -197,6 +202,7 @@ typedef enum cgltf_type typedef enum cgltf_primitive_type { + cgltf_primitive_type_invalid, cgltf_primitive_type_points, cgltf_primitive_type_lines, cgltf_primitive_type_line_loop, @@ -328,15 +334,6 @@ typedef struct cgltf_accessor_sparse cgltf_component_type indices_component_type; cgltf_buffer_view* values_buffer_view; cgltf_size values_byte_offset; - cgltf_extras extras; - cgltf_extras indices_extras; - cgltf_extras values_extras; - cgltf_size extensions_count; - cgltf_extension* extensions; - cgltf_size indices_extensions_count; - cgltf_extension* indices_extensions; - cgltf_size values_extensions_count; - cgltf_extension* values_extensions; } cgltf_accessor_sparse; typedef struct cgltf_accessor @@ -398,6 +395,8 @@ typedef struct cgltf_texture cgltf_sampler* sampler; cgltf_bool has_basisu; cgltf_image* basisu_image; + cgltf_bool has_webp; + cgltf_image* webp_image; cgltf_extras extras; cgltf_size extensions_count; cgltf_extension* extensions; @@ -419,9 +418,6 @@ typedef struct cgltf_texture_view cgltf_float scale; /* equivalent to strength for occlusion_texture */ cgltf_bool has_transform; cgltf_texture_transform transform; - cgltf_extras extras; - cgltf_size extensions_count; - cgltf_extension* extensions; } cgltf_texture_view; typedef struct cgltf_pbr_metallic_roughness @@ -511,6 +507,11 @@ typedef struct cgltf_anisotropy cgltf_texture_view anisotropy_texture; } cgltf_anisotropy; +typedef struct cgltf_dispersion +{ + cgltf_float dispersion; +} cgltf_dispersion; + typedef struct cgltf_material { char* name; @@ -525,6 +526,7 @@ typedef struct cgltf_material cgltf_bool has_emissive_strength; cgltf_bool has_iridescence; cgltf_bool has_anisotropy; + cgltf_bool has_dispersion; cgltf_pbr_metallic_roughness pbr_metallic_roughness; cgltf_pbr_specular_glossiness pbr_specular_glossiness; cgltf_clearcoat clearcoat; @@ -536,6 +538,7 @@ typedef struct cgltf_material cgltf_emissive_strength emissive_strength; cgltf_iridescence iridescence; cgltf_anisotropy anisotropy; + cgltf_dispersion dispersion; cgltf_texture_view normal_texture; cgltf_texture_view occlusion_texture; cgltf_texture_view emissive_texture; @@ -850,7 +853,7 @@ cgltf_size cgltf_component_size(cgltf_component_type component_type); cgltf_size cgltf_calc_size(cgltf_type type, cgltf_component_type component_type); cgltf_size cgltf_accessor_unpack_floats(const cgltf_accessor* accessor, cgltf_float* out, cgltf_size float_count); -cgltf_size cgltf_accessor_unpack_indices(const cgltf_accessor* accessor, cgltf_uint* out, cgltf_size index_count); +cgltf_size cgltf_accessor_unpack_indices(const cgltf_accessor* accessor, void* out, cgltf_size out_component_size, cgltf_size index_count); /* this function is deprecated and will be removed in the future; use cgltf_extras::data instead */ cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras* extras, char* dest, cgltf_size* dest_size); @@ -950,8 +953,8 @@ static int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, jsmntok_t #ifndef CGLTF_CONSTS -static const cgltf_size GlbHeaderSize = 12; -static const cgltf_size GlbChunkHeaderSize = 8; +#define GlbHeaderSize 12 +#define GlbChunkHeaderSize 8 static const uint32_t GlbVersion = 2; static const uint32_t GlbMagic = 0x46546C67; static const uint32_t GlbMagicJsonChunk = 0x4E4F534A; @@ -1045,7 +1048,7 @@ static cgltf_result cgltf_default_file_read(const struct cgltf_memory_options* m fclose(file); return cgltf_result_out_of_memory; } - + cgltf_size read_size = fread(file_data, 1, file_size, file); fclose(file); @@ -1153,7 +1156,7 @@ cgltf_result cgltf_parse(const cgltf_options* options, const void* data, cgltf_s // JSON chunk: length uint32_t json_length; memcpy(&json_length, json_chunk, 4); - if (GlbHeaderSize + GlbChunkHeaderSize + json_length > size) + if (json_length > size - GlbHeaderSize - GlbChunkHeaderSize) { return cgltf_result_data_too_short; } @@ -1167,10 +1170,10 @@ cgltf_result cgltf_parse(const cgltf_options* options, const void* data, cgltf_s json_chunk += GlbChunkHeaderSize; - const void* bin = 0; + const void* bin = NULL; cgltf_size bin_size = 0; - if (GlbHeaderSize + GlbChunkHeaderSize + json_length + GlbChunkHeaderSize <= size) + if (GlbChunkHeaderSize <= size - GlbHeaderSize - GlbChunkHeaderSize - json_length) { // We can read another chunk const uint8_t* bin_chunk = json_chunk + json_length; @@ -1178,7 +1181,7 @@ cgltf_result cgltf_parse(const cgltf_options* options, const void* data, cgltf_s // Bin chunk: length uint32_t bin_length; memcpy(&bin_length, bin_chunk, 4); - if (GlbHeaderSize + GlbChunkHeaderSize + json_length + GlbChunkHeaderSize + bin_length > size) + if (bin_length > size - GlbHeaderSize - GlbChunkHeaderSize - json_length - GlbChunkHeaderSize) { return cgltf_result_data_too_short; } @@ -1564,6 +1567,9 @@ cgltf_result cgltf_validate(cgltf_data* data) { cgltf_accessor* accessor = &data->accessors[i]; + CGLTF_ASSERT_IF(data->accessors[i].component_type == cgltf_component_type_invalid, cgltf_result_invalid_gltf); + CGLTF_ASSERT_IF(data->accessors[i].type == cgltf_type_invalid, cgltf_result_invalid_gltf); + cgltf_size element_size = cgltf_calc_size(accessor->type, accessor->component_type); if (accessor->buffer_view) @@ -1577,7 +1583,7 @@ cgltf_result cgltf_validate(cgltf_data* data) { cgltf_accessor_sparse* sparse = &accessor->sparse; - cgltf_size indices_component_size = cgltf_calc_size(cgltf_type_scalar, sparse->indices_component_type); + cgltf_size indices_component_size = cgltf_component_size(sparse->indices_component_type); cgltf_size indices_req_size = sparse->indices_byte_offset + indices_component_size * sparse->count; cgltf_size values_req_size = sparse->values_byte_offset + element_size * sparse->count; @@ -1643,43 +1649,48 @@ cgltf_result cgltf_validate(cgltf_data* data) for (cgltf_size j = 0; j < data->meshes[i].primitives_count; ++j) { + CGLTF_ASSERT_IF(data->meshes[i].primitives[j].type == cgltf_primitive_type_invalid, cgltf_result_invalid_gltf); CGLTF_ASSERT_IF(data->meshes[i].primitives[j].targets_count != data->meshes[i].primitives[0].targets_count, cgltf_result_invalid_gltf); - if (data->meshes[i].primitives[j].attributes_count) + CGLTF_ASSERT_IF(data->meshes[i].primitives[j].attributes_count == 0, cgltf_result_invalid_gltf); + + cgltf_accessor* first = data->meshes[i].primitives[j].attributes[0].data; + + CGLTF_ASSERT_IF(first->count == 0, cgltf_result_invalid_gltf); + + for (cgltf_size k = 0; k < data->meshes[i].primitives[j].attributes_count; ++k) { - cgltf_accessor* first = data->meshes[i].primitives[j].attributes[0].data; + CGLTF_ASSERT_IF(data->meshes[i].primitives[j].attributes[k].data->count != first->count, cgltf_result_invalid_gltf); + } - for (cgltf_size k = 0; k < data->meshes[i].primitives[j].attributes_count; ++k) + for (cgltf_size k = 0; k < data->meshes[i].primitives[j].targets_count; ++k) + { + for (cgltf_size m = 0; m < data->meshes[i].primitives[j].targets[k].attributes_count; ++m) { - CGLTF_ASSERT_IF(data->meshes[i].primitives[j].attributes[k].data->count != first->count, cgltf_result_invalid_gltf); + CGLTF_ASSERT_IF(data->meshes[i].primitives[j].targets[k].attributes[m].data->count != first->count, cgltf_result_invalid_gltf); } + } - for (cgltf_size k = 0; k < data->meshes[i].primitives[j].targets_count; ++k) - { - for (cgltf_size m = 0; m < data->meshes[i].primitives[j].targets[k].attributes_count; ++m) - { - CGLTF_ASSERT_IF(data->meshes[i].primitives[j].targets[k].attributes[m].data->count != first->count, cgltf_result_invalid_gltf); - } - } + cgltf_accessor* indices = data->meshes[i].primitives[j].indices; - cgltf_accessor* indices = data->meshes[i].primitives[j].indices; + CGLTF_ASSERT_IF(indices && + indices->component_type != cgltf_component_type_r_8u && + indices->component_type != cgltf_component_type_r_16u && + indices->component_type != cgltf_component_type_r_32u, cgltf_result_invalid_gltf); - CGLTF_ASSERT_IF(indices && - indices->component_type != cgltf_component_type_r_8u && - indices->component_type != cgltf_component_type_r_16u && - indices->component_type != cgltf_component_type_r_32u, cgltf_result_invalid_gltf); + CGLTF_ASSERT_IF(indices && indices->type != cgltf_type_scalar, cgltf_result_invalid_gltf); + CGLTF_ASSERT_IF(indices && indices->stride != cgltf_component_size(indices->component_type), cgltf_result_invalid_gltf); - if (indices && indices->buffer_view && indices->buffer_view->buffer->data) - { - cgltf_size index_bound = cgltf_calc_index_bound(indices->buffer_view, indices->offset, indices->component_type, indices->count); + if (indices && indices->buffer_view && indices->buffer_view->buffer->data) + { + cgltf_size index_bound = cgltf_calc_index_bound(indices->buffer_view, indices->offset, indices->component_type, indices->count); - CGLTF_ASSERT_IF(index_bound >= first->count, cgltf_result_data_too_short); - } + CGLTF_ASSERT_IF(index_bound >= first->count, cgltf_result_data_too_short); + } - for (cgltf_size k = 0; k < data->meshes[i].primitives[j].mappings_count; ++k) - { - CGLTF_ASSERT_IF(data->meshes[i].primitives[j].mappings[k].variant >= data->variants_count, cgltf_result_invalid_gltf); - } + for (cgltf_size k = 0; k < data->meshes[i].primitives[j].mappings_count; ++k) + { + CGLTF_ASSERT_IF(data->meshes[i].primitives[j].mappings[k].variant >= data->variants_count, cgltf_result_invalid_gltf); } } } @@ -1688,7 +1699,20 @@ cgltf_result cgltf_validate(cgltf_data* data) { if (data->nodes[i].weights && data->nodes[i].mesh) { - CGLTF_ASSERT_IF (data->nodes[i].mesh->primitives_count && data->nodes[i].mesh->primitives[0].targets_count != data->nodes[i].weights_count, cgltf_result_invalid_gltf); + CGLTF_ASSERT_IF(data->nodes[i].mesh->primitives_count && data->nodes[i].mesh->primitives[0].targets_count != data->nodes[i].weights_count, cgltf_result_invalid_gltf); + } + + if (data->nodes[i].has_mesh_gpu_instancing) + { + CGLTF_ASSERT_IF(data->nodes[i].mesh == NULL, cgltf_result_invalid_gltf); + CGLTF_ASSERT_IF(data->nodes[i].mesh_gpu_instancing.attributes_count == 0, cgltf_result_invalid_gltf); + + cgltf_accessor* first = data->nodes[i].mesh_gpu_instancing.attributes[0].data; + + for (cgltf_size k = 0; k < data->nodes[i].mesh_gpu_instancing.attributes_count; ++k) + { + CGLTF_ASSERT_IF(data->nodes[i].mesh_gpu_instancing.attributes[k].data->count != first->count, cgltf_result_invalid_gltf); + } } } @@ -1736,10 +1760,15 @@ cgltf_result cgltf_validate(cgltf_data* data) cgltf_size values = channel->sampler->interpolation == cgltf_interpolation_type_cubic_spline ? 3 : 1; - CGLTF_ASSERT_IF(channel->sampler->input->count * components * values != channel->sampler->output->count, cgltf_result_data_too_short); + CGLTF_ASSERT_IF(channel->sampler->input->count * components * values != channel->sampler->output->count, cgltf_result_invalid_gltf); } } + for (cgltf_size i = 0; i < data->variants_count; ++i) + { + CGLTF_ASSERT_IF(!data->variants[i].name, cgltf_result_invalid_gltf); + } + return cgltf_result_success; } @@ -1786,12 +1815,6 @@ static void cgltf_free_extensions(cgltf_data* data, cgltf_extension* extensions, data->memory.free_func(data->memory.user_data, extensions); } -static void cgltf_free_texture_view(cgltf_data* data, cgltf_texture_view* view) -{ - cgltf_free_extensions(data, view->extensions, view->extensions_count); - cgltf_free_extras(data, &view->extras); -} - void cgltf_free(cgltf_data* data) { if (!data) @@ -1813,15 +1836,6 @@ void cgltf_free(cgltf_data* data) { data->memory.free_func(data->memory.user_data, data->accessors[i].name); - if(data->accessors[i].is_sparse) - { - cgltf_free_extensions(data, data->accessors[i].sparse.extensions, data->accessors[i].sparse.extensions_count); - cgltf_free_extensions(data, data->accessors[i].sparse.indices_extensions, data->accessors[i].sparse.indices_extensions_count); - cgltf_free_extensions(data, data->accessors[i].sparse.values_extensions, data->accessors[i].sparse.values_extensions_count); - cgltf_free_extras(data, &data->accessors[i].sparse.extras); - cgltf_free_extras(data, &data->accessors[i].sparse.indices_extras); - cgltf_free_extras(data, &data->accessors[i].sparse.values_extras); - } cgltf_free_extensions(data, data->accessors[i].extensions, data->accessors[i].extensions_count); cgltf_free_extras(data, &data->accessors[i].extras); } @@ -1923,61 +1937,13 @@ void cgltf_free(cgltf_data* data) { data->memory.free_func(data->memory.user_data, data->materials[i].name); - if(data->materials[i].has_pbr_metallic_roughness) - { - cgltf_free_texture_view(data, &data->materials[i].pbr_metallic_roughness.metallic_roughness_texture); - cgltf_free_texture_view(data, &data->materials[i].pbr_metallic_roughness.base_color_texture); - } - if(data->materials[i].has_pbr_specular_glossiness) - { - cgltf_free_texture_view(data, &data->materials[i].pbr_specular_glossiness.diffuse_texture); - cgltf_free_texture_view(data, &data->materials[i].pbr_specular_glossiness.specular_glossiness_texture); - } - if(data->materials[i].has_clearcoat) - { - cgltf_free_texture_view(data, &data->materials[i].clearcoat.clearcoat_texture); - cgltf_free_texture_view(data, &data->materials[i].clearcoat.clearcoat_roughness_texture); - cgltf_free_texture_view(data, &data->materials[i].clearcoat.clearcoat_normal_texture); - } - if(data->materials[i].has_specular) - { - cgltf_free_texture_view(data, &data->materials[i].specular.specular_texture); - cgltf_free_texture_view(data, &data->materials[i].specular.specular_color_texture); - } - if(data->materials[i].has_transmission) - { - cgltf_free_texture_view(data, &data->materials[i].transmission.transmission_texture); - } - if (data->materials[i].has_volume) - { - cgltf_free_texture_view(data, &data->materials[i].volume.thickness_texture); - } - if(data->materials[i].has_sheen) - { - cgltf_free_texture_view(data, &data->materials[i].sheen.sheen_color_texture); - cgltf_free_texture_view(data, &data->materials[i].sheen.sheen_roughness_texture); - } - if(data->materials[i].has_iridescence) - { - cgltf_free_texture_view(data, &data->materials[i].iridescence.iridescence_texture); - cgltf_free_texture_view(data, &data->materials[i].iridescence.iridescence_thickness_texture); - } - if (data->materials[i].has_anisotropy) - { - cgltf_free_texture_view(data, &data->materials[i].anisotropy.anisotropy_texture); - } - - cgltf_free_texture_view(data, &data->materials[i].normal_texture); - cgltf_free_texture_view(data, &data->materials[i].occlusion_texture); - cgltf_free_texture_view(data, &data->materials[i].emissive_texture); - cgltf_free_extensions(data, data->materials[i].extensions, data->materials[i].extensions_count); cgltf_free_extras(data, &data->materials[i].extras); } data->memory.free_func(data->memory.user_data, data->materials); - for (cgltf_size i = 0; i < data->images_count; ++i) + for (cgltf_size i = 0; i < data->images_count; ++i) { data->memory.free_func(data->memory.user_data, data->images[i].name); data->memory.free_func(data->memory.user_data, data->images[i].uri); @@ -2225,8 +2191,6 @@ static cgltf_ssize cgltf_component_read_integer(const void* in, cgltf_component_ return *((const uint16_t*) in); case cgltf_component_type_r_32u: return *((const uint32_t*) in); - case cgltf_component_type_r_32f: - return (cgltf_ssize)*((const float*) in); case cgltf_component_type_r_8: return *((const int8_t*) in); case cgltf_component_type_r_8u: @@ -2244,8 +2208,6 @@ static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_typ return *((const uint16_t*) in); case cgltf_component_type_r_32u: return *((const uint32_t*) in); - case cgltf_component_type_r_32f: - return (cgltf_size)((cgltf_ssize)*((const float*) in)); case cgltf_component_type_r_8u: return *((const uint8_t*) in); default: @@ -2629,7 +2591,7 @@ cgltf_size cgltf_animation_channel_index(const cgltf_animation* animation, const return (cgltf_size)(object - animation->channels); } -cgltf_size cgltf_accessor_unpack_indices(const cgltf_accessor* accessor, cgltf_uint* out, cgltf_size index_count) +cgltf_size cgltf_accessor_unpack_indices(const cgltf_accessor* accessor, void* out, cgltf_size out_component_size, cgltf_size index_count) { if (out == NULL) { @@ -2637,6 +2599,7 @@ cgltf_size cgltf_accessor_unpack_indices(const cgltf_accessor* accessor, cgltf_u } index_count = accessor->count < index_count ? accessor->count : index_count; + cgltf_size index_component_size = cgltf_component_size(accessor->component_type); if (accessor->is_sparse) { @@ -2646,6 +2609,10 @@ cgltf_size cgltf_accessor_unpack_indices(const cgltf_accessor* accessor, cgltf_u { return 0; } + if (index_component_size > out_component_size) + { + return 0; + } const uint8_t* element = cgltf_buffer_view_data(accessor->buffer_view); if (element == NULL) { @@ -2653,18 +2620,29 @@ cgltf_size cgltf_accessor_unpack_indices(const cgltf_accessor* accessor, cgltf_u } element += accessor->offset; - if (accessor->component_type == cgltf_component_type_r_32u && accessor->stride == sizeof(cgltf_uint)) + if (index_component_size == out_component_size && accessor->stride == out_component_size) { - memcpy(out, element, index_count * sizeof(cgltf_uint)); + memcpy(out, element, index_count * index_component_size); + return index_count; } - else - { - cgltf_uint* dest = out; - for (cgltf_size index = 0; index < index_count; index++, dest++, element += accessor->stride) + // The component size of the output array is larger than the component size of the index data, so index data will be padded. + switch (out_component_size) + { + case 2: + for (cgltf_size index = 0; index < index_count; index++, element += accessor->stride) + { + ((uint16_t*)out)[index] = (uint16_t)cgltf_component_read_index(element, accessor->component_type); + } + break; + case 4: + for (cgltf_size index = 0; index < index_count; index++, element += accessor->stride) { - *dest = (cgltf_uint)cgltf_component_read_index(element, accessor->component_type); + ((uint32_t*)out)[index] = (uint32_t)cgltf_component_read_index(element, accessor->component_type); } + break; + default: + break; } return index_count; @@ -2675,7 +2653,7 @@ cgltf_size cgltf_accessor_unpack_indices(const cgltf_accessor* accessor, cgltf_u #define CGLTF_ERROR_LEGACY -3 #define CGLTF_CHECK_TOKTYPE(tok_, type_) if ((tok_).type != (type_)) { return CGLTF_ERROR_JSON; } -#define CGLTF_CHECK_TOKTYPE_RETTYPE(tok_, type_, ret_) if ((tok_).type != (type_)) { return (ret_)CGLTF_ERROR_JSON; } +#define CGLTF_CHECK_TOKTYPE_RET(tok_, type_, ret_) if ((tok_).type != (type_)) { return ret_; } #define CGLTF_CHECK_KEY(tok_) if ((tok_).type != JSMN_STRING || (tok_).size == 0) { return CGLTF_ERROR_JSON; } /* checking size for 0 verifies that a value follows the key */ #define CGLTF_PTRINDEX(type, idx) (type*)((cgltf_size)idx + 1) @@ -2702,12 +2680,13 @@ static int cgltf_json_to_int(jsmntok_t const* tok, const uint8_t* json_chunk) static cgltf_size cgltf_json_to_size(jsmntok_t const* tok, const uint8_t* json_chunk) { - CGLTF_CHECK_TOKTYPE_RETTYPE(*tok, JSMN_PRIMITIVE, cgltf_size); + CGLTF_CHECK_TOKTYPE_RET(*tok, JSMN_PRIMITIVE, 0); char tmp[128]; int size = (size_t)(tok->end - tok->start) < sizeof(tmp) ? (int)(tok->end - tok->start) : (int)(sizeof(tmp) - 1); strncpy(tmp, (const char*)json_chunk + tok->start, size); tmp[size] = 0; - return (cgltf_size)CGLTF_ATOLL(tmp); + long long res = CGLTF_ATOLL(tmp); + return res < 0 ? 0 : (cgltf_size)res; } static cgltf_float cgltf_json_to_float(jsmntok_t const* tok, const uint8_t* json_chunk) @@ -2889,6 +2868,11 @@ static void cgltf_parse_attribute_type(const char* name, cgltf_attribute_type* o if (us && *out_type != cgltf_attribute_type_invalid) { *out_index = CGLTF_ATOI(us + 1); + if (*out_index < 0) + { + *out_type = cgltf_attribute_type_invalid; + *out_index = 0; + } } } @@ -3221,6 +3205,31 @@ static int cgltf_parse_json_material_mappings(cgltf_options* options, jsmntok_t return i; } +static cgltf_primitive_type cgltf_json_to_primitive_type(jsmntok_t const* tok, const uint8_t* json_chunk) +{ + int type = cgltf_json_to_int(tok, json_chunk); + + switch (type) + { + case 0: + return cgltf_primitive_type_points; + case 1: + return cgltf_primitive_type_lines; + case 2: + return cgltf_primitive_type_line_loop; + case 3: + return cgltf_primitive_type_line_strip; + case 4: + return cgltf_primitive_type_triangles; + case 5: + return cgltf_primitive_type_triangle_strip; + case 6: + return cgltf_primitive_type_triangle_fan; + default: + return cgltf_primitive_type_invalid; + } +} + static int cgltf_parse_json_primitive(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_primitive* out_prim) { CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); @@ -3237,9 +3246,7 @@ static int cgltf_parse_json_primitive(cgltf_options* options, jsmntok_t const* t if (cgltf_json_strcmp(tokens+i, json_chunk, "mode") == 0) { ++i; - out_prim->type - = (cgltf_primitive_type) - cgltf_json_to_int(tokens+i, json_chunk); + out_prim->type = cgltf_json_to_primitive_type(tokens+i, json_chunk); ++i; } else if (cgltf_json_strcmp(tokens+i, json_chunk, "indices") == 0) @@ -3475,7 +3482,7 @@ static cgltf_component_type cgltf_json_to_component_type(jsmntok_t const* tok, c } } -static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_accessor_sparse* out_sparse) +static int cgltf_parse_json_accessor_sparse(jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_accessor_sparse* out_sparse) { CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); @@ -3489,7 +3496,7 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co if (cgltf_json_strcmp(tokens+i, json_chunk, "count") == 0) { ++i; - out_sparse->count = cgltf_json_to_int(tokens + i, json_chunk); + out_sparse->count = cgltf_json_to_size(tokens + i, json_chunk); ++i; } else if (cgltf_json_strcmp(tokens+i, json_chunk, "indices") == 0) @@ -3522,14 +3529,6 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co out_sparse->indices_component_type = cgltf_json_to_component_type(tokens + i, json_chunk); ++i; } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) - { - i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sparse->indices_extras); - } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) - { - i = cgltf_parse_json_unprocessed_extensions(options, tokens, i, json_chunk, &out_sparse->indices_extensions_count, &out_sparse->indices_extensions); - } else { i = cgltf_skip_json(tokens, i+1); @@ -3565,14 +3564,6 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co out_sparse->values_byte_offset = cgltf_json_to_size(tokens + i, json_chunk); ++i; } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) - { - i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sparse->values_extras); - } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) - { - i = cgltf_parse_json_unprocessed_extensions(options, tokens, i, json_chunk, &out_sparse->values_extensions_count, &out_sparse->values_extensions); - } else { i = cgltf_skip_json(tokens, i+1); @@ -3584,14 +3575,6 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co } } } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) - { - i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sparse->extras); - } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) - { - i = cgltf_parse_json_unprocessed_extensions(options, tokens, i, json_chunk, &out_sparse->extensions_count, &out_sparse->extensions); - } else { i = cgltf_skip_json(tokens, i+1); @@ -3649,8 +3632,7 @@ static int cgltf_parse_json_accessor(cgltf_options* options, jsmntok_t const* to else if (cgltf_json_strcmp(tokens+i, json_chunk, "count") == 0) { ++i; - out_accessor->count = - cgltf_json_to_int(tokens+i, json_chunk); + out_accessor->count = cgltf_json_to_size(tokens+i, json_chunk); ++i; } else if (cgltf_json_strcmp(tokens+i, json_chunk, "type") == 0) @@ -3705,7 +3687,7 @@ static int cgltf_parse_json_accessor(cgltf_options* options, jsmntok_t const* to else if (cgltf_json_strcmp(tokens + i, json_chunk, "sparse") == 0) { out_accessor->is_sparse = 1; - i = cgltf_parse_json_accessor_sparse(options, tokens, i + 1, json_chunk, &out_accessor->sparse); + i = cgltf_parse_json_accessor_sparse(tokens, i + 1, json_chunk, &out_accessor->sparse); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { @@ -3777,6 +3759,8 @@ static int cgltf_parse_json_texture_transform(jsmntok_t const* tokens, int i, co static int cgltf_parse_json_texture_view(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_texture_view* out_texture_view) { + (void)options; + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); out_texture_view->scale = 1.0f; @@ -3801,7 +3785,7 @@ static int cgltf_parse_json_texture_view(cgltf_options* options, jsmntok_t const out_texture_view->texcoord = cgltf_json_to_int(tokens + i, json_chunk); ++i; } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "scale") == 0) + else if (cgltf_json_strcmp(tokens + i, json_chunk, "scale") == 0) { ++i; out_texture_view->scale = cgltf_json_to_float(tokens + i, json_chunk); @@ -3813,28 +3797,12 @@ static int cgltf_parse_json_texture_view(cgltf_options* options, jsmntok_t const out_texture_view->scale = cgltf_json_to_float(tokens + i, json_chunk); ++i; } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) - { - i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_texture_view->extras); - } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { ++i; CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); - if(out_texture_view->extensions) - { - return CGLTF_ERROR_JSON; - } - int extensions_size = tokens[i].size; - out_texture_view->extensions_count = 0; - out_texture_view->extensions = (cgltf_extension*)cgltf_calloc(options, sizeof(cgltf_extension), extensions_size); - - if (!out_texture_view->extensions) - { - return CGLTF_ERROR_NOMEM; - } ++i; @@ -3849,7 +3817,7 @@ static int cgltf_parse_json_texture_view(cgltf_options* options, jsmntok_t const } else { - i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_texture_view->extensions[out_texture_view->extensions_count++])); + i = cgltf_skip_json(tokens, i + 1); } if (i < 0) @@ -3886,11 +3854,11 @@ static int cgltf_parse_json_pbr_metallic_roughness(cgltf_options* options, jsmnt if (cgltf_json_strcmp(tokens+i, json_chunk, "metallicFactor") == 0) { ++i; - out_pbr->metallic_factor = + out_pbr->metallic_factor = cgltf_json_to_float(tokens + i, json_chunk); ++i; } - else if (cgltf_json_strcmp(tokens+i, json_chunk, "roughnessFactor") == 0) + else if (cgltf_json_strcmp(tokens+i, json_chunk, "roughnessFactor") == 0) { ++i; out_pbr->roughness_factor = @@ -3903,13 +3871,11 @@ static int cgltf_parse_json_pbr_metallic_roughness(cgltf_options* options, jsmnt } else if (cgltf_json_strcmp(tokens+i, json_chunk, "baseColorTexture") == 0) { - i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, - &out_pbr->base_color_texture); + i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_pbr->base_color_texture); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "metallicRoughnessTexture") == 0) { - i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, - &out_pbr->metallic_roughness_texture); + i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_pbr->metallic_roughness_texture); } else { @@ -4353,6 +4319,37 @@ static int cgltf_parse_json_anisotropy(cgltf_options* options, jsmntok_t const* return i; } +static int cgltf_parse_json_dispersion(jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_dispersion* out_dispersion) +{ + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + int size = tokens[i].size; + ++i; + + + for (int j = 0; j < size; ++j) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "dispersion") == 0) + { + ++i; + out_dispersion->dispersion = cgltf_json_to_float(tokens + i, json_chunk); + ++i; + } + else + { + i = cgltf_skip_json(tokens, i + 1); + } + + if (i < 0) + { + return i; + } + } + + return i; +} + static int cgltf_parse_json_image(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_image* out_image) { CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); @@ -4360,11 +4357,11 @@ static int cgltf_parse_json_image(cgltf_options* options, jsmntok_t const* token int size = tokens[i].size; ++i; - for (int j = 0; j < size; ++j) + for (int j = 0; j < size; ++j) { CGLTF_CHECK_KEY(tokens[i]); - if (cgltf_json_strcmp(tokens + i, json_chunk, "uri") == 0) + if (cgltf_json_strcmp(tokens + i, json_chunk, "uri") == 0) { i = cgltf_parse_json_string(options, tokens, i + 1, json_chunk, &out_image->uri); } @@ -4444,7 +4441,7 @@ static int cgltf_parse_json_sampler(cgltf_options* options, jsmntok_t const* tok = cgltf_json_to_int(tokens + i, json_chunk); ++i; } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "wrapT") == 0) + else if (cgltf_json_strcmp(tokens + i, json_chunk, "wrapT") == 0) { ++i; out_sampler->wrap_t @@ -4494,7 +4491,7 @@ static int cgltf_parse_json_texture(cgltf_options* options, jsmntok_t const* tok out_texture->sampler = CGLTF_PTRINDEX(cgltf_sampler, cgltf_json_to_int(tokens + i, json_chunk)); ++i; } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "source") == 0) + else if (cgltf_json_strcmp(tokens + i, json_chunk, "source") == 0) { ++i; out_texture->image = CGLTF_PTRINDEX(cgltf_image, cgltf_json_to_int(tokens + i, json_chunk)); @@ -4556,6 +4553,34 @@ static int cgltf_parse_json_texture(cgltf_options* options, jsmntok_t const* tok } } } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "EXT_texture_webp") == 0) + { + out_texture->has_webp = 1; + ++i; + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + int num_properties = tokens[i].size; + ++i; + + for (int t = 0; t < num_properties; ++t) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "source") == 0) + { + ++i; + out_texture->webp_image = CGLTF_PTRINDEX(cgltf_image, cgltf_json_to_int(tokens + i, json_chunk)); + ++i; + } + else + { + i = cgltf_skip_json(tokens, i + 1); + } + if (i < 0) + { + return i; + } + } + } else { i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_texture->extensions[out_texture->extensions_count++])); @@ -4746,6 +4771,11 @@ static int cgltf_parse_json_material(cgltf_options* options, jsmntok_t const* to out_material->has_anisotropy = 1; i = cgltf_parse_json_anisotropy(options, tokens, i + 1, json_chunk, &out_material->anisotropy); } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "KHR_materials_dispersion") == 0) + { + out_material->has_dispersion = 1; + i = cgltf_parse_json_dispersion(tokens, i + 1, json_chunk, &out_material->dispersion); + } else { i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_material->extensions[out_material->extensions_count++])); @@ -4905,7 +4935,7 @@ static int cgltf_parse_json_meshopt_compression(cgltf_options* options, jsmntok_ else if (cgltf_json_strcmp(tokens+i, json_chunk, "count") == 0) { ++i; - out_meshopt_compression->count = cgltf_json_to_int(tokens+i, json_chunk); + out_meshopt_compression->count = cgltf_json_to_size(tokens+i, json_chunk); ++i; } else if (cgltf_json_strcmp(tokens+i, json_chunk, "mode") == 0) @@ -6561,6 +6591,7 @@ static int cgltf_fixup_pointers(cgltf_data* data) { CGLTF_PTRFIXUP(data->textures[i].image, data->images, data->images_count); CGLTF_PTRFIXUP(data->textures[i].basisu_image, data->images, data->images_count); + CGLTF_PTRFIXUP(data->textures[i].webp_image, data->images, data->images_count); CGLTF_PTRFIXUP(data->textures[i].sampler, data->samplers, data->samplers_count); } diff --git a/bgfx/3rdparty/cgltf/cgltf_write.h b/bgfx/3rdparty/cgltf/cgltf_write.h index be22b888..8677a9aa 100644 --- a/bgfx/3rdparty/cgltf/cgltf_write.h +++ b/bgfx/3rdparty/cgltf/cgltf_write.h @@ -1,7 +1,7 @@ /** * cgltf_write - a single-file glTF 2.0 writer written in C99. * - * Version: 1.13 + * Version: 1.14 * * Website: https://github.com/jkuhlmann/cgltf * @@ -86,6 +86,8 @@ cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size si #define CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING (1 << 14) #define CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE (1 << 15) #define CGLTF_EXTENSION_FLAG_MATERIALS_ANISOTROPY (1 << 16) +#define CGLTF_EXTENSION_FLAG_MATERIALS_DISPERSION (1 << 17) +#define CGLTF_EXTENSION_FLAG_TEXTURE_WEBP (1 << 18) typedef struct { char* buffer; @@ -153,7 +155,6 @@ typedef struct { context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \ cgltf_write_texture_transform(context, &info.transform); \ } \ - cgltf_write_extras(context, &info.extras); \ cgltf_write_line(context, "}"); } #define CGLTF_WRITE_NORMAL_TEXTURE_INFO(label, info) if (info.texture) { \ @@ -165,7 +166,6 @@ typedef struct { context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \ cgltf_write_texture_transform(context, &info.transform); \ } \ - cgltf_write_extras(context, &info.extras); \ cgltf_write_line(context, "}"); } #define CGLTF_WRITE_OCCLUSION_TEXTURE_INFO(label, info) if (info.texture) { \ @@ -177,12 +177,11 @@ typedef struct { context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \ cgltf_write_texture_transform(context, &info.transform); \ } \ - cgltf_write_extras(context, &info.extras); \ cgltf_write_line(context, "}"); } #ifndef CGLTF_CONSTS -static const cgltf_size GlbHeaderSize = 12; -static const cgltf_size GlbChunkHeaderSize = 8; +#define GlbHeaderSize 12 +#define GlbChunkHeaderSize 8 static const uint32_t GlbVersion = 2; static const uint32_t GlbMagic = 0x46546C67; static const uint32_t GlbMagicJsonChunk = 0x4E4F534A; @@ -361,6 +360,21 @@ static int cgltf_int_from_component_type(cgltf_component_type ctype) } } +static int cgltf_int_from_primitive_type(cgltf_primitive_type ctype) +{ + switch (ctype) + { + case cgltf_primitive_type_points: return 0; + case cgltf_primitive_type_lines: return 1; + case cgltf_primitive_type_line_loop: return 2; + case cgltf_primitive_type_line_strip: return 3; + case cgltf_primitive_type_triangles: return 4; + case cgltf_primitive_type_triangle_strip: return 5; + case cgltf_primitive_type_triangle_fan: return 6; + default: return -1; + } +} + static const char* cgltf_str_from_alpha_mode(cgltf_alpha_mode alpha_mode) { switch (alpha_mode) @@ -456,7 +470,7 @@ static void cgltf_write_asset(cgltf_write_context* context, const cgltf_asset* a static void cgltf_write_primitive(cgltf_write_context* context, const cgltf_primitive* prim) { - cgltf_write_intprop(context, "mode", (int) prim->type, 4); + cgltf_write_intprop(context, "mode", cgltf_int_from_primitive_type(prim->type), 4); CGLTF_WRITE_IDXPROP("indices", prim->indices, context->data->accessors); CGLTF_WRITE_IDXPROP("material", prim->material, context->data->materials); cgltf_write_line(context, "\"attributes\": {"); @@ -493,7 +507,7 @@ static void cgltf_write_primitive(cgltf_write_context* context, const cgltf_prim context->extension_flags |= CGLTF_EXTENSION_FLAG_DRACO_MESH_COMPRESSION; if (prim->attributes_count == 0 || prim->indices == 0) { - context->required_extension_flags |= CGLTF_EXTENSION_FLAG_DRACO_MESH_COMPRESSION; + context->required_extension_flags |= CGLTF_EXTENSION_FLAG_DRACO_MESH_COMPRESSION; } cgltf_write_line(context, "\"KHR_draco_mesh_compression\": {"); @@ -647,6 +661,11 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_ANISOTROPY; } + if (material->has_dispersion) + { + context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_DISPERSION; + } + if (material->has_pbr_metallic_roughness) { const cgltf_pbr_metallic_roughness* params = &material->pbr_metallic_roughness; @@ -662,7 +681,7 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater cgltf_write_line(context, "}"); } - if (material->unlit || material->has_pbr_specular_glossiness || material->has_clearcoat || material->has_ior || material->has_specular || material->has_transmission || material->has_sheen || material->has_volume || material->has_emissive_strength || material->has_iridescence || material->has_anisotropy) + if (material->unlit || material->has_pbr_specular_glossiness || material->has_clearcoat || material->has_ior || material->has_specular || material->has_transmission || material->has_sheen || material->has_volume || material->has_emissive_strength || material->has_iridescence || material->has_anisotropy || material->has_dispersion) { cgltf_write_line(context, "\"extensions\": {"); if (material->has_clearcoat) @@ -714,7 +733,7 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater { cgltf_write_floatarrayprop(context, "attenuationColor", params->attenuation_color, 3); } - if (params->attenuation_distance < FLT_MAX) + if (params->attenuation_distance < FLT_MAX) { cgltf_write_floatprop(context, "attenuationDistance", params->attenuation_distance, FLT_MAX); } @@ -782,6 +801,13 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater CGLTF_WRITE_TEXTURE_INFO("anisotropyTexture", params->anisotropy_texture); cgltf_write_line(context, "}"); } + if (material->has_dispersion) + { + cgltf_write_line(context, "\"KHR_materials_dispersion\": {"); + const cgltf_dispersion* params = &material->dispersion; + cgltf_write_floatprop(context, "dispersion", params->dispersion, 0.f); + cgltf_write_line(context, "}"); + } cgltf_write_line(context, "}"); } @@ -815,15 +841,23 @@ static void cgltf_write_texture(cgltf_write_context* context, const cgltf_textur CGLTF_WRITE_IDXPROP("source", texture->image, context->data->images); CGLTF_WRITE_IDXPROP("sampler", texture->sampler, context->data->samplers); - if (texture->has_basisu) + if (texture->has_basisu || texture->has_webp) { cgltf_write_line(context, "\"extensions\": {"); + if (texture->has_basisu) { context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_BASISU; cgltf_write_line(context, "\"KHR_texture_basisu\": {"); CGLTF_WRITE_IDXPROP("source", texture->basisu_image, context->data->images); cgltf_write_line(context, "}"); } + if (texture->has_webp) + { + context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_WEBP; + cgltf_write_line(context, "\"EXT_texture_webp\": {"); + CGLTF_WRITE_IDXPROP("source", texture->webp_image, context->data->images); + cgltf_write_line(context, "}"); + } cgltf_write_line(context, "}"); } cgltf_write_extras(context, &texture->extras); @@ -1058,14 +1092,11 @@ static void cgltf_write_accessor(cgltf_write_context* context, const cgltf_acces cgltf_write_sizeprop(context, "byteOffset", (int)accessor->sparse.indices_byte_offset, 0); CGLTF_WRITE_IDXPROP("bufferView", accessor->sparse.indices_buffer_view, context->data->buffer_views); cgltf_write_intprop(context, "componentType", cgltf_int_from_component_type(accessor->sparse.indices_component_type), 0); - cgltf_write_extras(context, &accessor->sparse.indices_extras); cgltf_write_line(context, "}"); cgltf_write_line(context, "\"values\": {"); cgltf_write_sizeprop(context, "byteOffset", (int)accessor->sparse.values_byte_offset, 0); CGLTF_WRITE_IDXPROP("bufferView", accessor->sparse.values_buffer_view, context->data->buffer_views); - cgltf_write_extras(context, &accessor->sparse.values_extras); cgltf_write_line(context, "}"); - cgltf_write_extras(context, &accessor->sparse.extras); cgltf_write_line(context, "}"); } cgltf_write_extras(context, &accessor->extras); @@ -1258,6 +1289,9 @@ static void cgltf_write_extensions(cgltf_write_context* context, uint32_t extens if (extension_flags & CGLTF_EXTENSION_FLAG_TEXTURE_BASISU) { cgltf_write_stritem(context, "KHR_texture_basisu"); } + if (extension_flags & CGLTF_EXTENSION_FLAG_TEXTURE_WEBP) { + cgltf_write_stritem(context, "EXT_texture_webp"); + } if (extension_flags & CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH) { cgltf_write_stritem(context, "KHR_materials_emissive_strength"); } @@ -1270,6 +1304,9 @@ static void cgltf_write_extensions(cgltf_write_context* context, uint32_t extens if (extension_flags & CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING) { cgltf_write_stritem(context, "EXT_mesh_gpu_instancing"); } + if (extension_flags & CGLTF_EXTENSION_FLAG_MATERIALS_DISPERSION) { + cgltf_write_stritem(context, "KHR_materials_dispersion"); + } } cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size size, const cgltf_data* data) diff --git a/bgfx/3rdparty/dear-imgui/imgui.cpp b/bgfx/3rdparty/dear-imgui/imgui.cpp index b1cf3790..06dc5413 100644 --- a/bgfx/3rdparty/dear-imgui/imgui.cpp +++ b/bgfx/3rdparty/dear-imgui/imgui.cpp @@ -1,33 +1,36 @@ -// dear imgui, v1.89.9 +// dear imgui, v1.91.4 // (main code and documentation) // Help: -// - Read FAQ at http://dearimgui.com/faq -// - Newcomers, read 'Programmer guide' below for notes on how to setup Dear ImGui in your codebase. +// - See links below. // - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that. -// Read imgui.cpp for details, links and comments. +// - Read top of imgui.cpp for more details, links and comments. // Resources: -// - FAQ http://dearimgui.com/faq -// - Homepage https://github.com/ocornut/imgui -// - Releases & changelog https://github.com/ocornut/imgui/releases -// - Gallery https://github.com/ocornut/imgui/issues/6478 (please post your screenshots/video there!) -// - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there) -// - Getting Started https://github.com/ocornut/imgui/wiki/Getting-Started -// - Glossary https://github.com/ocornut/imgui/wiki/Glossary -// - Issues & support https://github.com/ocornut/imgui/issues -// - Tests & Automation https://github.com/ocornut/imgui_test_engine - -// Getting Started? -// - Read https://github.com/ocornut/imgui/wiki/Getting-Started -// - For first-time users having issues compiling/linking/running/loading fonts: -// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above. - +// - FAQ ........................ https://dearimgui.com/faq (in repository as docs/FAQ.md) +// - Homepage ................... https://github.com/ocornut/imgui +// - Releases & changelog ....... https://github.com/ocornut/imgui/releases +// - Gallery .................... https://github.com/ocornut/imgui/issues?q=label%3Agallery (please post your screenshots/video there!) +// - Wiki ....................... https://github.com/ocornut/imgui/wiki (lots of good stuff there) +// - Getting Started https://github.com/ocornut/imgui/wiki/Getting-Started (how to integrate in an existing app by adding ~25 lines of code) +// - Third-party Extensions https://github.com/ocornut/imgui/wiki/Useful-Extensions (ImPlot & many more) +// - Bindings/Backends https://github.com/ocornut/imgui/wiki/Bindings (language bindings, backends for various tech/engines) +// - Glossary https://github.com/ocornut/imgui/wiki/Glossary +// - Debug Tools https://github.com/ocornut/imgui/wiki/Debug-Tools +// - Software using Dear ImGui https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui +// - Issues & support ........... https://github.com/ocornut/imgui/issues +// - Test Engine & Automation ... https://github.com/ocornut/imgui_test_engine (test suite, test engine to automate your apps) + +// For first-time users having issues compiling/linking/running/loading fonts: +// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above. +// Everything else should be asked in 'Issues'! We are building a database of cross-linked knowledge there. + +// Copyright (c) 2014-2024 Omar Cornut // Developed by Omar Cornut and every direct or indirect contributors to the GitHub. // See LICENSE.txt for copyright and licensing details (standard MIT License). // This library is free but needs your support to sustain development and maintenance. // Businesses: you can support continued development via B2B invoiced technical support, maintenance and sponsoring contracts. -// PLEASE reach out at contact AT dearimgui DOT com. See https://github.com/ocornut/imgui/wiki/Sponsors +// PLEASE reach out at omar AT dearimgui DOT com. See https://github.com/ocornut/imgui/wiki/Funding // Businesses: you can also purchase licenses for the Dear ImGui Automation/Test Engine. // It is recommended that you don't modify imgui.cpp! It will become difficult for you to update the library. @@ -60,7 +63,7 @@ CODE // [SECTION] INCLUDES // [SECTION] FORWARD DECLARATIONS // [SECTION] CONTEXT AND MEMORY ALLOCATORS -// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO) +// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO, ImGuiPlatformIO) // [SECTION] MISC HELPERS/UTILITIES (Geometry functions) // [SECTION] MISC HELPERS/UTILITIES (String, Format, Hash functions) // [SECTION] MISC HELPERS/UTILITIES (File functions) @@ -74,8 +77,10 @@ CODE // [SECTION] RENDER HELPERS // [SECTION] INITIALIZATION, SHUTDOWN // [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!) +// [SECTION] ID STACK // [SECTION] INPUTS -// [SECTION] ERROR CHECKING +// [SECTION] ERROR CHECKING, STATE RECOVERY +// [SECTION] ITEM SUBMISSION // [SECTION] LAYOUT // [SECTION] SCROLLING // [SECTION] TOOLTIPS @@ -89,7 +94,7 @@ CODE // [SECTION] PLATFORM DEPENDENT HELPERS // [SECTION] METRICS/DEBUGGER WINDOW // [SECTION] DEBUG LOG WINDOW -// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, STACK TOOL) +// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, ID STACK TOOL) */ @@ -138,7 +143,7 @@ CODE - CTRL+X, CTRL+C, CTRL+V: Use OS clipboard. - CTRL+Z, CTRL+Y: Undo, Redo. - ESCAPE: Revert text to its original value. - - On OSX, controls are automatically adjusted to match standard OSX text editing shortcuts and behaviors. + - On OSX, controls are automatically adjusted to match standard OSX text editing 2ts and behaviors. - KEYBOARD CONTROLS - Basic: @@ -178,8 +183,8 @@ CODE - Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + run examples/libs/synergy/uSynergy.c (on your console/tablet/phone app) in order to share your PC mouse/keyboard. - See https://github.com/ocornut/imgui/wiki/Useful-Extensions#remoting for other remoting solutions. - - On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the ImGuiConfigFlags_NavEnableSetMousePos flag. - Enabling ImGuiConfigFlags_NavEnableSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs Dear ImGui to move your mouse cursor along with navigation movements. + - On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the io.ConfigNavMoveSetMousePos flag. + Enabling io.ConfigNavMoveSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs Dear ImGui to move your mouse cursor along with navigation movements. When enabled, the NewFrame() function may alter 'io.MousePos' and set 'io.WantSetMousePos' to notify you that it wants the mouse cursor to be moved. When that happens your backend NEEDS to move the OS or underlying mouse cursor on the next frame. Some of the backends in examples/ do that. (If you set the NavEnableSetMousePos flag but don't honor 'io.WantSetMousePos' properly, Dear ImGui will misbehave as it will see your mouse moving back & forth!) @@ -358,7 +363,7 @@ CODE To decide whether to dispatch mouse/keyboard inputs to Dear ImGui to the rest of your application, you should read the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags! - Please read the FAQ and example applications for details about this! + Please read the FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" about this. HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE @@ -425,7 +430,124 @@ CODE When you are not sure about an old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files. You can read releases logs https://github.com/ocornut/imgui/releases for more details. - - 2023/08/25 (1.89.9) - Clipper: Renamed IncludeRangeByIndices() (also called ForceDisplayRangeByIndices() before 1.89.6) to IncludeItemsByIndex(). Kept inline redirection function. Sorry! + - 2024/10/18 (1.91.4) - renamed ImGuiCol_NavHighlight to ImGuiCol_NavCursor (for consistency with newly exposed and reworked features). Kept inline redirection enum (will obsolete). + - 2024/10/14 (1.91.4) - moved ImGuiConfigFlags_NavEnableSetMousePos to standalone io.ConfigNavMoveSetMousePos bool. + moved ImGuiConfigFlags_NavNoCaptureKeyboard to standalone io.ConfigNavCaptureKeyboard bool (note the inverted value!). + kept legacy names (will obsolete) + code that copies settings once the first time. Dynamically changing the old value won't work. Switch to using the new value! + - 2024/10/10 (1.91.4) - the typedef for ImTextureID now defaults to ImU64 instead of void*. (#1641) + this removes the requirement to redefine it for backends which are e.g. storing descriptor sets or other 64-bits structures when building on 32-bits archs. It therefore simplify various building scripts/helpers. + you may have compile-time issues if you were casting to 'void*' instead of 'ImTextureID' when passing your types to functions taking ImTextureID values, e.g. ImGui::Image(). + in doubt it is almost always better to do an intermediate intptr_t cast, since it allows casting any pointer/integer type without warning: + - May warn: ImGui::Image((void*)MyTextureData, ...); + - May warn: ImGui::Image((void*)(intptr_t)MyTextureData, ...); + - Won't warn: ImGui::Image((ImTextureID)(intptr_t)MyTextureData), ...); + - note that you can always define ImTextureID to be your own high-level structures (with dedicated constructors) if you like. + - 2024/10/03 (1.91.3) - drags: treat v_min==v_max as a valid clamping range when != 0.0f. Zero is a still special value due to legacy reasons, unless using ImGuiSliderFlags_ClampZeroRange. (#7968, #3361, #76) + - drags: extended behavior of ImGuiSliderFlags_AlwaysClamp to include _ClampZeroRange. It considers v_min==v_max==0.0f as a valid clamping range (aka edits not allowed). + although unlikely, it you wish to only clamp on text input but want v_min==v_max==0.0f to mean unclamped drags, you can use _ClampOnInput instead of _AlwaysClamp. (#7968, #3361, #76) + - 2024/09/10 (1.91.2) - internals: using multiple overlayed ButtonBehavior() with same ID will now have io.ConfigDebugHighlightIdConflicts=true feature emit a warning. (#8030) + it was one of the rare case where using same ID is legal. workarounds: (1) use single ButtonBehavior() call with multiple _MouseButton flags, or (2) surround the calls with PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag() + - 2024/08/23 (1.91.1) - renamed ImGuiChildFlags_Border to ImGuiChildFlags_Borders for consistency. kept inline redirection flag. + - 2024/08/22 (1.91.1) - moved some functions from ImGuiIO to ImGuiPlatformIO structure: + - io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn + changed 'void* user_data' to 'ImGuiContext* ctx'. Pull your user data from platform_io.ClipboardUserData. + - io.SetClipboardTextFn -> platform_io.Platform_SetClipboardTextFn + same as above line. + - io.PlatformOpenInShellFn -> platform_io.Platform_OpenInShellFn (#7660) + - io.PlatformSetImeDataFn -> platform_io.Platform_SetImeDataFn + - io.PlatformLocaleDecimalPoint -> platform_io.Platform_LocaleDecimalPoint (#7389, #6719, #2278) + - access those via GetPlatformIO() instead of GetIO(). + some were introduced very recently and often automatically setup by core library and backends, so for those we are exceptionally not maintaining a legacy redirection symbol. + - commented the old ImageButton() signature obsoleted in 1.89 (~August 2022). As a reminder: + - old ImageButton() before 1.89 used ImTextureId as item id (created issue with e.g. multiple buttons in same scope, transient texture id values, opaque computation of ID) + - new ImageButton() since 1.89 requires an explicit 'const char* str_id' + - old ImageButton() before 1.89 had frame_padding' override argument. + - new ImageButton() since 1.89 always use style.FramePadding, which you can freely override with PushStyleVar()/PopStyleVar(). + - 2024/07/25 (1.91.0) - obsoleted GetContentRegionMax(), GetWindowContentRegionMin() and GetWindowContentRegionMax(). (see #7838 on GitHub for more info) + you should never need those functions. you can do everything with GetCursorScreenPos() and GetContentRegionAvail() in a more simple way. + - instead of: GetWindowContentRegionMax().x - GetCursorPos().x + - you can use: GetContentRegionAvail().x + - instead of: GetWindowContentRegionMax().x + GetWindowPos().x + - you can use: GetCursorScreenPos().x + GetContentRegionAvail().x // when called from left edge of window + - instead of: GetContentRegionMax() + - you can use: GetContentRegionAvail() + GetCursorScreenPos() - GetWindowPos() // right edge in local coordinates + - instead of: GetWindowContentRegionMax().x - GetWindowContentRegionMin().x + - you can use: GetContentRegionAvail() // when called from left edge of window + - 2024/07/15 (1.91.0) - renamed ImGuiSelectableFlags_DontClosePopups to ImGuiSelectableFlags_NoAutoClosePopups. (#1379, #1468, #2200, #4936, #5216, #7302, #7573) + (internals: also renamed ImGuiItemFlags_SelectableDontClosePopup into ImGuiItemFlags_AutoClosePopups with inverted behaviors) + - 2024/07/15 (1.91.0) - obsoleted PushButtonRepeat()/PopButtonRepeat() in favor of using new PushItemFlag(ImGuiItemFlags_ButtonRepeat, ...)/PopItemFlag(). + - 2024/07/02 (1.91.0) - commented out obsolete ImGuiModFlags (renamed to ImGuiKeyChord in 1.89). (#4921, #456) + - commented out obsolete ImGuiModFlags_XXX values (renamed to ImGuiMod_XXX in 1.89). (#4921, #456) + - ImGuiModFlags_Ctrl -> ImGuiMod_Ctrl, ImGuiModFlags_Shift -> ImGuiMod_Shift etc. + - 2024/07/02 (1.91.0) - IO, IME: renamed platform IME hook and added explicit context for consistency and future-proofness. + - old: io.SetPlatformImeDataFn(ImGuiViewport* viewport, ImGuiPlatformImeData* data); + - new: io.PlatformSetImeDataFn(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data); + - 2024/06/21 (1.90.9) - BeginChild: added ImGuiChildFlags_NavFlattened as a replacement for the window flag ImGuiWindowFlags_NavFlattened: the feature only ever made sense for BeginChild() anyhow. + - old: BeginChild("Name", size, 0, ImGuiWindowFlags_NavFlattened); + - new: BeginChild("Name", size, ImGuiChildFlags_NavFlattened, 0); + - 2024/06/21 (1.90.9) - io: ClearInputKeys() (first exposed in 1.89.8) doesn't clear mouse data, newly added ClearInputMouse() does. + - 2024/06/20 (1.90.9) - renamed ImGuiDragDropFlags_SourceAutoExpirePayload to ImGuiDragDropFlags_PayloadAutoExpire. + - 2024/06/18 (1.90.9) - style: renamed ImGuiCol_TabActive -> ImGuiCol_TabSelected, ImGuiCol_TabUnfocused -> ImGuiCol_TabDimmed, ImGuiCol_TabUnfocusedActive -> ImGuiCol_TabDimmedSelected. + - 2024/06/10 (1.90.9) - removed old nested structure: renaming ImGuiStorage::ImGuiStoragePair type to ImGuiStoragePair (simpler for many languages). + - 2024/06/06 (1.90.8) - reordered ImGuiInputTextFlags values. This should not be breaking unless you are using generated headers that have values not matching the main library. + - 2024/06/06 (1.90.8) - removed 'ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft', was mostly unused and misleading. + - 2024/05/27 (1.90.7) - commented out obsolete symbols marked obsolete in 1.88 (May 2022): + - old: CaptureKeyboardFromApp(bool) + - new: SetNextFrameWantCaptureKeyboard(bool) + - old: CaptureMouseFromApp(bool) + - new: SetNextFrameWantCaptureMouse(bool) + - 2024/05/22 (1.90.7) - inputs (internals): renamed ImGuiKeyOwner_None to ImGuiKeyOwner_NoOwner, to make use more explicit and reduce confusion with the default it is a non-zero value and cannot be the default value (never made public, but disclosing as I expect a few users caught on owner-aware inputs). + - inputs (internals): renamed ImGuiInputFlags_RouteGlobalLow -> ImGuiInputFlags_RouteGlobal, ImGuiInputFlags_RouteGlobal -> ImGuiInputFlags_RouteGlobalOverFocused, ImGuiInputFlags_RouteGlobalHigh -> ImGuiInputFlags_RouteGlobalHighest. + - inputs (internals): Shortcut(), SetShortcutRouting(): swapped last two parameters order in function signatures: + - old: Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0); + - new: Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0, ImGuiID owner_id = 0); + - inputs (internals): owner-aware versions of IsKeyPressed(), IsKeyChordPressed(), IsMouseClicked(): swapped last two parameters order in function signatures. + - old: IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0); + - new: IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0); + - old: IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0); + - new: IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0); + for various reasons those changes makes sense. They are being made because making some of those API public. + only past users of imgui_internal.h with the extra parameters will be affected. Added asserts for valid flags in various functions to detect _some_ misuses, BUT NOT ALL. + - 2024/05/16 (1.90.7) - inputs: on macOS X, Cmd and Ctrl keys are now automatically swapped by io.AddKeyEvent() as this naturally align with how macOS X uses those keys. + - it shouldn't really affect you unless you had custom shortcut swapping in place for macOS X apps. + - removed ImGuiMod_Shortcut which was previously dynamically remapping to Ctrl or Cmd/Super. It is now unnecessary to specific cross-platform idiomatic shortcuts. (#2343, #4084, #5923, #456) + - 2024/05/14 (1.90.7) - backends: SDL_Renderer2 and SDL_Renderer3 backend now take a SDL_Renderer* in their RenderDrawData() functions. + - 2024/04/18 (1.90.6) - TreeNode: Fixed a layout inconsistency when using an empty/hidden label followed by a SameLine() call. (#7505, #282) + - old: TreeNode("##Hidden"); SameLine(); Text("Hello"); // <-- This was actually incorrect! BUT appeared to look ok with the default style where ItemSpacing.x == FramePadding.x * 2 (it didn't look aligned otherwise). + - new: TreeNode("##Hidden"); SameLine(0, 0); Text("Hello"); // <-- This is correct for all styles values. + with the fix, IF you were successfully using TreeNode("")+SameLine(); you will now have extra spacing between your TreeNode and the following item. + You'll need to change the SameLine() call to SameLine(0,0) to remove this extraneous spacing. This seemed like the more sensible fix that's not making things less consistent. + (Note: when using this idiom you are likely to also use ImGuiTreeNodeFlags_SpanAvailWidth). + - 2024/03/18 (1.90.5) - merged the radius_x/radius_y parameters in ImDrawList::AddEllipse(), AddEllipseFilled() and PathEllipticalArcTo() into a single ImVec2 parameter. Exceptionally, because those functions were added in 1.90, we are not adding inline redirection functions. The transition is easy and should affect few users. (#2743, #7417) + - 2024/03/08 (1.90.5) - inputs: more formally obsoleted GetKeyIndex() when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is set. It has been unnecessary and a no-op since 1.87 (it returns the same value as passed when used with a 1.87+ backend using io.AddKeyEvent() function). (#4921) + - IsKeyPressed(GetKeyIndex(ImGuiKey_XXX)) -> use IsKeyPressed(ImGuiKey_XXX) + - 2024/01/15 (1.90.2) - commented out obsolete ImGuiIO::ImeWindowHandle marked obsolete in 1.87, favor of writing to 'void* ImGuiViewport::PlatformHandleRaw'. + - 2023/12/19 (1.90.1) - commented out obsolete ImGuiKey_KeyPadEnter redirection to ImGuiKey_KeypadEnter. + - 2023/11/06 (1.90.1) - removed CalcListClipping() marked obsolete in 1.86. Prefer using ImGuiListClipper which can return non-contiguous ranges. + - 2023/11/05 (1.90.1) - imgui_freetype: commented out ImGuiFreeType::BuildFontAtlas() obsoleted in 1.81. prefer using #define IMGUI_ENABLE_FREETYPE or see commented code for manual calls. + - 2023/11/05 (1.90.1) - internals,columns: commented out legacy ImGuiColumnsFlags_XXX symbols redirecting to ImGuiOldColumnsFlags_XXX, obsoleted from imgui_internal.h in 1.80. + - 2023/11/09 (1.90.0) - removed IM_OFFSETOF() macro in favor of using offsetof() available in C++11. Kept redirection define (will obsolete). + - 2023/11/07 (1.90.0) - removed BeginChildFrame()/EndChildFrame() in favor of using BeginChild() with the ImGuiChildFlags_FrameStyle flag. kept inline redirection function (will obsolete). + those functions were merely PushStyle/PopStyle helpers, the removal isn't so much motivated by needing to add the feature in BeginChild(), but by the necessity to avoid BeginChildFrame() signature mismatching BeginChild() signature and features. + - 2023/11/02 (1.90.0) - BeginChild: upgraded 'bool border = true' parameter to 'ImGuiChildFlags flags' type, added ImGuiChildFlags_Border equivalent. As with our prior "bool-to-flags" API updates, the ImGuiChildFlags_Border value is guaranteed to be == true forever to ensure a smoother transition, meaning all existing calls will still work. + - old: BeginChild("Name", size, true) + - new: BeginChild("Name", size, ImGuiChildFlags_Border) + - old: BeginChild("Name", size, false) + - new: BeginChild("Name", size) or BeginChild("Name", 0) or BeginChild("Name", size, ImGuiChildFlags_None) + **AMEND FROM THE FUTURE: from 1.91.1, 'ImGuiChildFlags_Border' is called 'ImGuiChildFlags_Borders'** + - 2023/11/02 (1.90.0) - BeginChild: added child-flag ImGuiChildFlags_AlwaysUseWindowPadding as a replacement for the window-flag ImGuiWindowFlags_AlwaysUseWindowPadding: the feature only ever made sense for BeginChild() anyhow. + - old: BeginChild("Name", size, 0, ImGuiWindowFlags_AlwaysUseWindowPadding); + - new: BeginChild("Name", size, ImGuiChildFlags_AlwaysUseWindowPadding, 0); + - 2023/09/27 (1.90.0) - io: removed io.MetricsActiveAllocations introduced in 1.63. Same as 'g.DebugMemAllocCount - g.DebugMemFreeCount' (still displayed in Metrics, unlikely to be accessed by end-user). + - 2023/09/26 (1.90.0) - debug tools: Renamed ShowStackToolWindow() ("Stack Tool") to ShowIDStackToolWindow() ("ID Stack Tool"), as earlier name was misleading. Kept inline redirection function. (#4631) + - 2023/09/15 (1.90.0) - ListBox, Combo: changed signature of "name getter" callback in old one-liner ListBox()/Combo() apis. kept inline redirection function (will obsolete). + - old: bool Combo(const char* label, int* current_item, bool (*getter)(void* user_data, int idx, const char** out_text), ...) + - new: bool Combo(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), ...); + - old: bool ListBox(const char* label, int* current_item, bool (*getting)(void* user_data, int idx, const char** out_text), ...); + - new: bool ListBox(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), ...); + - 2023/09/08 (1.90.0) - commented out obsolete redirecting functions: + - GetWindowContentRegionWidth() -> use GetWindowContentRegionMax().x - GetWindowContentRegionMin().x. Consider that generally 'GetContentRegionAvail().x' is more useful. + - ImDrawCornerFlags_XXX -> use ImDrawFlags_RoundCornersXXX flags. Read 1.82 Changelog for details + grep commented names in sources. + - commented out runtime support for hardcoded ~0 or 0x01..0x0F rounding flags values for AddRect()/AddRectFilled()/PathRect()/AddImageRounded() -> use ImDrawFlags_RoundCornersXXX flags. Read 1.82 Changelog for details + - 2023/08/25 (1.89.9) - clipper: Renamed IncludeRangeByIndices() (also called ForceDisplayRangeByIndices() before 1.89.6) to IncludeItemsByIndex(). Kept inline redirection function. Sorry! - 2023/07/12 (1.89.8) - ImDrawData: CmdLists now owned, changed from ImDrawList** to ImVector. Majority of users shouldn't be affected, but you cannot compare to NULL nor reassign manually anymore. Instead use AddDrawList(). (#6406, #4879, #1878) - 2023/06/28 (1.89.7) - overlapping items: obsoleted 'SetItemAllowOverlap()' (called after item) in favor of calling 'SetNextItemAllowOverlap()' (called before item). 'SetItemAllowOverlap()' didn't and couldn't work reliably since 1.89 (2022-11-15). - 2023/06/28 (1.89.7) - overlapping items: renamed 'ImGuiTreeNodeFlags_AllowItemOverlap' to 'ImGuiTreeNodeFlags_AllowOverlap', 'ImGuiSelectableFlags_AllowItemOverlap' to 'ImGuiSelectableFlags_AllowOverlap'. Kept redirecting enums (will obsolete). @@ -510,7 +632,7 @@ CODE - Backend writing to io.MouseHoveredViewport -> backend should call io.AddMouseViewportEvent() [Docking branch w/ multi-viewports only] note: for all calls to IO new functions, the Dear ImGui context should be bound/current. read https://github.com/ocornut/imgui/issues/4921 for details. - - 2022/01/10 (1.87) - inputs: reworked keyboard IO. Removed io.KeyMap[], io.KeysDown[] in favor of calling io.AddKeyEvent(). Removed GetKeyIndex(), now unecessary. All IsKeyXXX() functions now take ImGuiKey values. All features are still functional until IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Read Changelog and Release Notes for details. + - 2022/01/10 (1.87) - inputs: reworked keyboard IO. Removed io.KeyMap[], io.KeysDown[] in favor of calling io.AddKeyEvent(). Removed GetKeyIndex(), now unnecessary. All IsKeyXXX() functions now take ImGuiKey values. All features are still functional until IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Read Changelog and Release Notes for details. - IsKeyPressed(MY_NATIVE_KEY_XXX) -> use IsKeyPressed(ImGuiKey_XXX) - IsKeyPressed(GetKeyIndex(ImGuiKey_XXX)) -> use IsKeyPressed(ImGuiKey_XXX) - Backend writing to io.KeyMap[],io.KeysDown[] -> backend should call io.AddKeyEvent() (+ call io.SetKeyEventNativeData() if you want legacy user code to stil function with legacy key codes). @@ -890,7 +1012,7 @@ CODE Q: How can I easily use icons in my application? Q: How can I load multiple fonts? Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic? - >> See https://www.dearimgui.com/faq and https://github.com/ocornut/imgui/edit/master/docs/FONTS.md + >> See https://www.dearimgui.com/faq and https://github.com/ocornut/imgui/blob/master/docs/FONTS.md Q&A: Concerns ============= @@ -905,10 +1027,10 @@ CODE ============== Q: How can I help? - A: - Businesses: please reach out to "contact AT dearimgui.com" if you work in a place using Dear ImGui! + A: - Businesses: please reach out to "omar AT dearimgui DOT com" if you work in a place using Dear ImGui! We can discuss ways for your company to fund development via invoiced technical support, maintenance or sponsoring contacts. This is among the most useful thing you can do for Dear ImGui. With increased funding, we sustain and grow work on this project. - Also see https://github.com/ocornut/imgui/wiki/Sponsors + >>> See https://github.com/ocornut/imgui/wiki/Funding - Businesses: you can also purchase licenses for the Dear ImGui Automation/Test Engine. - If you are experienced with Dear ImGui and C++, look at the GitHub issues, look at the Wiki, and see how you want to help and can help! - Disclose your usage of Dear ImGui via a dev blog post, a tweet, a screenshot, a mention somewhere etc. @@ -944,7 +1066,7 @@ CODE #endif // [Windows] OS specific includes (optional) -#if defined(_WIN32) && defined(IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) +#if defined(_WIN32) && defined(IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) && defined(IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) #define IMGUI_DISABLE_WIN32_FUNCTIONS #endif #if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) @@ -959,9 +1081,11 @@ CODE #else #include #endif -#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) // UWP doesn't have all Win32 functions +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP || WINAPI_FAMILY == WINAPI_FAMILY_GAMES) +// The UWP and GDK Win32 API subsets don't support clipboard nor IME functions #define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS #define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS +#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS #endif #endif @@ -1001,6 +1125,7 @@ CODE #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant // some standard header variations use #define NULL 0 #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access #elif defined(__GNUC__) // We disable -Wpragmas because GCC doesn't provide a has_warning equivalent and some forks/patches may not follow the warning/version association. #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind @@ -1015,27 +1140,30 @@ CODE #endif // Debug options -#define IMGUI_DEBUG_NAV_SCORING 0 // Display navigation scoring preview when hovering items. Display last moving direction matches when holding CTRL +#define IMGUI_DEBUG_NAV_SCORING 0 // Display navigation scoring preview when hovering items. Hold CTRL to display for all candidates. CTRL+Arrow to change last direction. #define IMGUI_DEBUG_NAV_RECTS 0 // Display the reference navigation rectangle for each window // When using CTRL+TAB (or Gamepad Square+L/R) we delay the visual a little in order to reduce visual noise doing a fast switch. static const float NAV_WINDOWING_HIGHLIGHT_DELAY = 0.20f; // Time before the highlight and screen dimming starts fading in static const float NAV_WINDOWING_LIST_APPEAR_DELAY = 0.15f; // Time before the window list starts to appear +static const float NAV_ACTIVATE_HIGHLIGHT_TIMER = 0.10f; // Time to highlight an item activated by a shortcut. + // Window resizing from edges (when io.ConfigWindowsResizeFromEdges = true and ImGuiBackendFlags_HasMouseCursors is set in io.BackendFlags by backend) static const float WINDOWS_HOVER_PADDING = 4.0f; // Extend outside window for hovering/resizing (maxxed with TouchPadding) and inside windows for borders. Affect FindHoveredWindow(). static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER = 0.04f; // Reduce visual noise by only highlighting the border after a certain time. static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 0.70f; // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certain time, unless mouse moved. // Tooltip offset -static const ImVec2 TOOLTIP_DEFAULT_OFFSET = ImVec2(16, 10); // Multiplied by g.Style.MouseCursorScale +static const ImVec2 TOOLTIP_DEFAULT_OFFSET_MOUSE = ImVec2(16, 10); // Multiplied by g.Style.MouseCursorScale +static const ImVec2 TOOLTIP_DEFAULT_OFFSET_TOUCH = ImVec2(0, -20); // Multiplied by g.Style.MouseCursorScale +static const ImVec2 TOOLTIP_DEFAULT_PIVOT_TOUCH = ImVec2(0.5f, 1.0f); // Multiplied by g.Style.MouseCursorScale //------------------------------------------------------------------------- // [SECTION] FORWARD DECLARATIONS //------------------------------------------------------------------------- static void SetCurrentWindow(ImGuiWindow* window); -static void FindHoveredWindow(); static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags); static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window); @@ -1048,13 +1176,17 @@ static void WindowSettingsHandler_ReadLine(ImGuiContext*, ImGuiSetti static void WindowSettingsHandler_ApplyAll(ImGuiContext*, ImGuiSettingsHandler*); static void WindowSettingsHandler_WriteAll(ImGuiContext*, ImGuiSettingsHandler*, ImGuiTextBuffer* buf); -// Platform Dependents default implementation for IO functions -static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx); -static void SetClipboardTextFn_DefaultImpl(void* user_data_ctx, const char* text); -static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatformImeData* data); +// Platform Dependents default implementation for ImGuiPlatformIO functions +static const char* Platform_GetClipboardTextFn_DefaultImpl(ImGuiContext* ctx); +static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext* ctx, const char* text); +static void Platform_SetImeDataFn_DefaultImpl(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data); +static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext* ctx, const char* path); namespace ImGui { +// Item +static void ItemHandleShortcut(ImGuiID id); + // Navigation static void NavUpdate(); static void NavUpdateWindowing(); @@ -1070,11 +1202,11 @@ static bool NavScoreItem(ImGuiNavItemData* result); static void NavApplyItemToResult(ImGuiNavItemData* result); static void NavProcessItem(); static void NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flags, ImGuiNavMoveFlags move_flags); +static ImGuiInputSource NavCalcPreferredRefPosSource(); static ImVec2 NavCalcPreferredRefPos(); static void NavSaveLastChildNavWindowIntoParent(ImGuiWindow* nav_window); static ImGuiWindow* NavRestoreLastChildNavWindow(ImGuiWindow* window); static void NavRestoreLayer(ImGuiNavLayer layer); -static void NavRestoreHighlightAfterMove(); static int FindWindowFocusIndex(ImGuiWindow* window); // Error Checking and Debug Tools @@ -1082,6 +1214,7 @@ static void ErrorCheckNewFrameSanityChecks(); static void ErrorCheckEndFrameSanityChecks(); static void UpdateDebugToolItemPicker(); static void UpdateDebugToolStackQueries(); +static void UpdateDebugToolFlashStyleColor(); // Inputs static void UpdateKeyboardInputs(); @@ -1091,14 +1224,16 @@ static void UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt); // Misc static void UpdateSettings(); -static bool UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect); +static int UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_hovered, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect); static void RenderWindowOuterBorders(ImGuiWindow* window); static void RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, bool handle_borders_and_resize_grips, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size); static void RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& title_bar_rect, const char* name, bool* p_open); static void RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col); static void RenderDimmedBackgrounds(); +static void SetLastItemDataForWindow(ImGuiWindow* window, const ImRect& rect); // Viewports +const ImGuiID IMGUI_VIEWPORT_DEFAULT_ID = 0x11111111; // Using an arbitrary constant instead of e.g. ImHashStr("ViewportDefault", 0); so it's easier to spot in the debugger. The exact value doesn't matter. static void UpdateViewportsNewFrame(); } @@ -1146,61 +1281,65 @@ static ImGuiMemFreeFunc GImAllocatorFreeFunc = FreeWrapper; static void* GImAllocatorUserData = NULL; //----------------------------------------------------------------------------- -// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO) +// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO, ImGuiPlatformIO) //----------------------------------------------------------------------------- ImGuiStyle::ImGuiStyle() { - Alpha = 1.0f; // Global alpha applies to everything in Dear ImGui. - DisabledAlpha = 0.60f; // Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha. - WindowPadding = ImVec2(8,8); // Padding within a window - WindowRounding = 0.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended. - WindowBorderSize = 1.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested. - WindowMinSize = ImVec2(32,32); // Minimum window size - WindowTitleAlign = ImVec2(0.0f,0.5f);// Alignment for title bar text - WindowMenuButtonPosition= ImGuiDir_Left; // Position of the collapsing/docking button in the title bar (left/right). Defaults to ImGuiDir_Left. - ChildRounding = 0.0f; // Radius of child window corners rounding. Set to 0.0f to have rectangular child windows - ChildBorderSize = 1.0f; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. Other values not well tested. - PopupRounding = 0.0f; // Radius of popup window corners rounding. Set to 0.0f to have rectangular child windows - PopupBorderSize = 1.0f; // Thickness of border around popup or tooltip windows. Generally set to 0.0f or 1.0f. Other values not well tested. - FramePadding = ImVec2(4,3); // Padding within a framed rectangle (used by most widgets) - FrameRounding = 0.0f; // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets). - FrameBorderSize = 0.0f; // Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested. - ItemSpacing = ImVec2(8,4); // Horizontal and vertical spacing between widgets/lines - ItemInnerSpacing = ImVec2(4,4); // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label) - CellPadding = ImVec2(4,2); // Padding within a table cell. CellPadding.y may be altered between different rows. - TouchExtraPadding = ImVec2(0,0); // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! - IndentSpacing = 21.0f; // Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2). - ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1). - ScrollbarSize = 14.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar - ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar - GrabMinSize = 12.0f; // Minimum width/height of a grab box for slider/scrollbar - GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. - LogSliderDeadzone = 4.0f; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero. - TabRounding = 4.0f; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs. - TabBorderSize = 0.0f; // Thickness of border around tabs. - TabMinWidthForCloseButton = 0.0f; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected. - ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right. - ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text. - SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line. - SeparatorTextBorderSize = 3.0f; // Thickkness of border in SeparatorText() - SeparatorTextAlign = ImVec2(0.0f,0.5f);// Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center). - SeparatorTextPadding = ImVec2(20.0f,3.f);// Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y. - DisplayWindowPadding = ImVec2(19,19); // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows. - DisplaySafeAreaPadding = ImVec2(3,3); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows. - MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. - AntiAliasedLines = true; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. - AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering). - AntiAliasedFill = true; // Enable anti-aliased filled shapes (rounded rectangles, circles, etc.). - CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. - CircleTessellationMaxError = 0.30f; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry. + Alpha = 1.0f; // Global alpha applies to everything in Dear ImGui. + DisabledAlpha = 0.60f; // Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha. + WindowPadding = ImVec2(8,8); // Padding within a window + WindowRounding = 0.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended. + WindowBorderSize = 1.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested. + WindowMinSize = ImVec2(32,32); // Minimum window size + WindowTitleAlign = ImVec2(0.0f,0.5f);// Alignment for title bar text + WindowMenuButtonPosition = ImGuiDir_Left; // Position of the collapsing/docking button in the title bar (left/right). Defaults to ImGuiDir_Left. + ChildRounding = 0.0f; // Radius of child window corners rounding. Set to 0.0f to have rectangular child windows + ChildBorderSize = 1.0f; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. Other values not well tested. + PopupRounding = 0.0f; // Radius of popup window corners rounding. Set to 0.0f to have rectangular child windows + PopupBorderSize = 1.0f; // Thickness of border around popup or tooltip windows. Generally set to 0.0f or 1.0f. Other values not well tested. + FramePadding = ImVec2(4,3); // Padding within a framed rectangle (used by most widgets) + FrameRounding = 0.0f; // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets). + FrameBorderSize = 0.0f; // Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested. + ItemSpacing = ImVec2(8,4); // Horizontal and vertical spacing between widgets/lines + ItemInnerSpacing = ImVec2(4,4); // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label) + CellPadding = ImVec2(4,2); // Padding within a table cell. Cellpadding.x is locked for entire table. CellPadding.y may be altered between different rows. + TouchExtraPadding = ImVec2(0,0); // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! + IndentSpacing = 21.0f; // Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2). + ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1). + ScrollbarSize = 14.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar + ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar + GrabMinSize = 12.0f; // Minimum width/height of a grab box for slider/scrollbar + GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. + LogSliderDeadzone = 4.0f; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero. + TabRounding = 4.0f; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs. + TabBorderSize = 0.0f; // Thickness of border around tabs. + TabMinWidthForCloseButton = 0.0f; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected. + TabBarBorderSize = 1.0f; // Thickness of tab-bar separator, which takes on the tab active color to denote focus. + TabBarOverlineSize = 2.0f; // Thickness of tab-bar overline, which highlights the selected tab-bar. + TableAngledHeadersAngle = 35.0f * (IM_PI / 180.0f); // Angle of angled headers (supported values range from -50 degrees to +50 degrees). + TableAngledHeadersTextAlign = ImVec2(0.5f,0.0f);// Alignment of angled headers within the cell + ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right. + ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text. + SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line. + SeparatorTextBorderSize = 3.0f; // Thickness of border in SeparatorText() + SeparatorTextAlign = ImVec2(0.0f,0.5f);// Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center). + SeparatorTextPadding = ImVec2(20.0f,3.f);// Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y. + DisplayWindowPadding = ImVec2(19,19); // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows. + DisplaySafeAreaPadding = ImVec2(3,3); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows. + MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. + AntiAliasedLines = true; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. + AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering). + AntiAliasedFill = true; // Enable anti-aliased filled shapes (rounded rectangles, circles, etc.). + CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. + CircleTessellationMaxError = 0.30f; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry. // Behaviors - HoverStationaryDelay = 0.15f; // Delay for IsItemHovered(ImGuiHoveredFlags_Stationary). Time required to consider mouse stationary. - HoverDelayShort = 0.15f; // Delay for IsItemHovered(ImGuiHoveredFlags_DelayShort). Usually used along with HoverStationaryDelay. - HoverDelayNormal = 0.40f; // Delay for IsItemHovered(ImGuiHoveredFlags_DelayNormal). " - HoverFlagsForTooltipMouse = ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort; // Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using mouse. - HoverFlagsForTooltipNav = ImGuiHoveredFlags_NoSharedDelay | ImGuiHoveredFlags_DelayNormal; // Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using keyboard/gamepad. + HoverStationaryDelay = 0.15f; // Delay for IsItemHovered(ImGuiHoveredFlags_Stationary). Time required to consider mouse stationary. + HoverDelayShort = 0.15f; // Delay for IsItemHovered(ImGuiHoveredFlags_DelayShort). Usually used along with HoverStationaryDelay. + HoverDelayNormal = 0.40f; // Delay for IsItemHovered(ImGuiHoveredFlags_DelayNormal). " + HoverFlagsForTooltipMouse = ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_AllowWhenDisabled; // Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using mouse. + HoverFlagsForTooltipNav = ImGuiHoveredFlags_NoSharedDelay | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_AllowWhenDisabled; // Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using keyboard/gamepad. // Default theme ImGui::StyleColorsDark(this); @@ -1210,30 +1349,31 @@ ImGuiStyle::ImGuiStyle() // Important: This operation is lossy because we round all sizes to integer. If you need to change your scale multiples, call this over a freshly initialized ImGuiStyle structure rather than scaling multiple times. void ImGuiStyle::ScaleAllSizes(float scale_factor) { - WindowPadding = ImFloor(WindowPadding * scale_factor); - WindowRounding = ImFloor(WindowRounding * scale_factor); - WindowMinSize = ImFloor(WindowMinSize * scale_factor); - ChildRounding = ImFloor(ChildRounding * scale_factor); - PopupRounding = ImFloor(PopupRounding * scale_factor); - FramePadding = ImFloor(FramePadding * scale_factor); - FrameRounding = ImFloor(FrameRounding * scale_factor); - ItemSpacing = ImFloor(ItemSpacing * scale_factor); - ItemInnerSpacing = ImFloor(ItemInnerSpacing * scale_factor); - CellPadding = ImFloor(CellPadding * scale_factor); - TouchExtraPadding = ImFloor(TouchExtraPadding * scale_factor); - IndentSpacing = ImFloor(IndentSpacing * scale_factor); - ColumnsMinSpacing = ImFloor(ColumnsMinSpacing * scale_factor); - ScrollbarSize = ImFloor(ScrollbarSize * scale_factor); - ScrollbarRounding = ImFloor(ScrollbarRounding * scale_factor); - GrabMinSize = ImFloor(GrabMinSize * scale_factor); - GrabRounding = ImFloor(GrabRounding * scale_factor); - LogSliderDeadzone = ImFloor(LogSliderDeadzone * scale_factor); - TabRounding = ImFloor(TabRounding * scale_factor); - TabMinWidthForCloseButton = (TabMinWidthForCloseButton != FLT_MAX) ? ImFloor(TabMinWidthForCloseButton * scale_factor) : FLT_MAX; - SeparatorTextPadding = ImFloor(SeparatorTextPadding * scale_factor); - DisplayWindowPadding = ImFloor(DisplayWindowPadding * scale_factor); - DisplaySafeAreaPadding = ImFloor(DisplaySafeAreaPadding * scale_factor); - MouseCursorScale = ImFloor(MouseCursorScale * scale_factor); + WindowPadding = ImTrunc(WindowPadding * scale_factor); + WindowRounding = ImTrunc(WindowRounding * scale_factor); + WindowMinSize = ImTrunc(WindowMinSize * scale_factor); + ChildRounding = ImTrunc(ChildRounding * scale_factor); + PopupRounding = ImTrunc(PopupRounding * scale_factor); + FramePadding = ImTrunc(FramePadding * scale_factor); + FrameRounding = ImTrunc(FrameRounding * scale_factor); + ItemSpacing = ImTrunc(ItemSpacing * scale_factor); + ItemInnerSpacing = ImTrunc(ItemInnerSpacing * scale_factor); + CellPadding = ImTrunc(CellPadding * scale_factor); + TouchExtraPadding = ImTrunc(TouchExtraPadding * scale_factor); + IndentSpacing = ImTrunc(IndentSpacing * scale_factor); + ColumnsMinSpacing = ImTrunc(ColumnsMinSpacing * scale_factor); + ScrollbarSize = ImTrunc(ScrollbarSize * scale_factor); + ScrollbarRounding = ImTrunc(ScrollbarRounding * scale_factor); + GrabMinSize = ImTrunc(GrabMinSize * scale_factor); + GrabRounding = ImTrunc(GrabRounding * scale_factor); + LogSliderDeadzone = ImTrunc(LogSliderDeadzone * scale_factor); + TabRounding = ImTrunc(TabRounding * scale_factor); + TabMinWidthForCloseButton = (TabMinWidthForCloseButton != FLT_MAX) ? ImTrunc(TabMinWidthForCloseButton * scale_factor) : FLT_MAX; + TabBarOverlineSize = ImTrunc(TabBarOverlineSize * scale_factor); + SeparatorTextPadding = ImTrunc(SeparatorTextPadding * scale_factor); + DisplayWindowPadding = ImTrunc(DisplayWindowPadding * scale_factor); + DisplaySafeAreaPadding = ImTrunc(DisplaySafeAreaPadding * scale_factor); + MouseCursorScale = ImTrunc(MouseCursorScale * scale_factor); } ImGuiIO::ImGuiIO() @@ -1262,11 +1402,14 @@ ImGuiIO::ImGuiIO() FontAllowUserScaling = false; DisplayFramebufferScale = ImVec2(1.0f, 1.0f); - MouseDoubleClickTime = 0.30f; - MouseDoubleClickMaxDist = 6.0f; - MouseDragThreshold = 6.0f; - KeyRepeatDelay = 0.275f; - KeyRepeatRate = 0.050f; + // Keyboard/Gamepad Navigation options + ConfigNavSwapGamepadButtons = false; + ConfigNavMoveSetMousePos = false; + ConfigNavCaptureKeyboard = true; + ConfigNavEscapeClearFocusItem = true; + ConfigNavEscapeClearFocusWindow = false; + ConfigNavCursorVisibleAuto = true; + ConfigNavCursorVisibleAlways = false; // Miscellaneous options MouseDrawCursor = false; @@ -1281,15 +1424,29 @@ ImGuiIO::ImGuiIO() ConfigDragClickToInputText = false; ConfigWindowsResizeFromEdges = true; ConfigWindowsMoveFromTitleBarOnly = false; + ConfigScrollbarScrollByPage = true; ConfigMemoryCompactTimer = 60.0f; + ConfigDebugIsDebuggerPresent = false; + ConfigDebugHighlightIdConflicts = true; ConfigDebugBeginReturnValueOnce = false; ConfigDebugBeginReturnValueLoop = false; + ConfigErrorRecovery = true; + ConfigErrorRecoveryEnableAssert = true; + ConfigErrorRecoveryEnableDebugLog = true; + ConfigErrorRecoveryEnableTooltip = true; + + // Inputs Behaviors + MouseDoubleClickTime = 0.30f; + MouseDoubleClickMaxDist = 6.0f; + MouseDragThreshold = 6.0f; + KeyRepeatDelay = 0.275f; + KeyRepeatRate = 0.050f; + // Platform Functions // Note: Initialize() will setup default clipboard/ime handlers. BackendPlatformName = BackendRendererName = NULL; BackendPlatformUserData = BackendRendererUserData = BackendLanguageUserData = NULL; - PlatformLocaleDecimalPoint = '.'; // Input (NB: we already have memset zero the entire structure!) MousePos = ImVec2(-FLT_MAX, -FLT_MAX); @@ -1377,7 +1534,7 @@ void ImGuiIO::ClearEventsQueue() g.InputEventsQueue.clear(); } -// Clear current keyboard/mouse/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons. +// Clear current keyboard/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons. void ImGuiIO::ClearInputKeys() { #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO @@ -1385,12 +1542,26 @@ void ImGuiIO::ClearInputKeys() #endif for (int n = 0; n < IM_ARRAYSIZE(KeysData); n++) { + if (ImGui::IsMouseKey((ImGuiKey)(n + ImGuiKey_KeysData_OFFSET))) + continue; KeysData[n].Down = false; KeysData[n].DownDuration = -1.0f; KeysData[n].DownDurationPrev = -1.0f; } KeyCtrl = KeyShift = KeyAlt = KeySuper = false; KeyMods = ImGuiMod_None; + InputQueueCharacters.resize(0); // Behavior of old ClearInputCharacters(). +} + +void ImGuiIO::ClearInputMouse() +{ + for (ImGuiKey key = ImGuiKey_Mouse_BEGIN; key < ImGuiKey_Mouse_END; key = (ImGuiKey)(key + 1)) + { + ImGuiKeyData* key_data = &KeysData[key - ImGuiKey_KeysData_OFFSET]; + key_data->Down = false; + key_data->DownDuration = -1.0f; + key_data->DownDurationPrev = -1.0f; + } MousePos = ImVec2(-FLT_MAX, -FLT_MAX); for (int n = 0; n < IM_ARRAYSIZE(MouseDown); n++) { @@ -1398,7 +1569,6 @@ void ImGuiIO::ClearInputKeys() MouseDownDuration[n] = MouseDownDurationPrev[n] = -1.0f; } MouseWheel = MouseWheelH = 0.0f; - InputQueueCharacters.resize(0); // Behavior of old ClearInputCharacters(). } // Removed this as it is ambiguous/misleading and generally incorrect to use with the existence of a higher-level input queue. @@ -1432,7 +1602,7 @@ static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventT // - bool down: Is the key down? use false to signify a key release. // - float analog_value: 0.0f..1.0f // IMPORTANT: THIS FUNCTION AND OTHER "ADD" GRABS THE CONTEXT FROM OUR INSTANCE. -// WE NEED TO ENSURE THAT ALL FUNCTION CALLS ARE FULLFILLING THIS, WHICH IS WHY GetKeyData() HAS AN EXPLICIT CONTEXT. +// WE NEED TO ENSURE THAT ALL FUNCTION CALLS ARE FULFILLING THIS, WHICH IS WHY GetKeyData() HAS AN EXPLICIT CONTEXT. void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value) { //if (e->Down) { IMGUI_DEBUG_LOG_IO("AddKeyEvent() Key='%s' %d, NativeKeycode = %d, NativeScancode = %d\n", ImGui::GetKeyName(e->Key), e->Down, e->NativeKeycode, e->NativeScancode); } @@ -1440,9 +1610,19 @@ void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value) if (key == ImGuiKey_None || !AppAcceptingEvents) return; ImGuiContext& g = *Ctx; - IM_ASSERT(ImGui::IsNamedKeyOrModKey(key)); // Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API. + IM_ASSERT(ImGui::IsNamedKeyOrMod(key)); // Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API. IM_ASSERT(ImGui::IsAliasKey(key) == false); // Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events. - IM_ASSERT(key != ImGuiMod_Shortcut); // We could easily support the translation here but it seems saner to not accept it (TestEngine perform a translation itself) + + // MacOS: swap Cmd(Super) and Ctrl + if (g.IO.ConfigMacOSXBehaviors) + { + if (key == ImGuiMod_Super) { key = ImGuiMod_Ctrl; } + else if (key == ImGuiMod_Ctrl) { key = ImGuiMod_Super; } + else if (key == ImGuiKey_LeftSuper) { key = ImGuiKey_LeftCtrl; } + else if (key == ImGuiKey_RightSuper){ key = ImGuiKey_RightCtrl; } + else if (key == ImGuiKey_LeftCtrl) { key = ImGuiKey_LeftSuper; } + else if (key == ImGuiKey_RightCtrl) { key = ImGuiKey_RightSuper; } + } // Verify that backend isn't mixing up using new io.AddKeyEvent() api and old io.KeysDown[] + io.KeyMap[] data. #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO @@ -1521,7 +1701,7 @@ void ImGuiIO::AddMousePosEvent(float x, float y) return; // Apply same flooring as UpdateMouseInputs() - ImVec2 pos((x > -FLT_MAX) ? ImFloorSigned(x) : x, (y > -FLT_MAX) ? ImFloorSigned(y) : y); + ImVec2 pos((x > -FLT_MAX) ? ImFloor(x) : x, (y > -FLT_MAX) ? ImFloor(y) : y); // Filter duplicate const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_MousePos); @@ -1547,12 +1727,36 @@ void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down) if (!AppAcceptingEvents) return; + // On MacOS X: Convert Ctrl(Super)+Left click into Right-click: handle held button. + if (ConfigMacOSXBehaviors && mouse_button == 0 && MouseCtrlLeftAsRightClick) + { + // Order of both statements matterns: this event will still release mouse button 1 + mouse_button = 1; + if (!down) + MouseCtrlLeftAsRightClick = false; + } + // Filter duplicate const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_MouseButton, (int)mouse_button); const bool latest_button_down = latest_event ? latest_event->MouseButton.Down : g.IO.MouseDown[mouse_button]; if (latest_button_down == down) return; + // On MacOS X: Convert Ctrl(Super)+Left click into Right-click. + // - Note that this is actual physical Ctrl which is ImGuiMod_Super for us. + // - At this point we want from !down to down, so this is handling the initial press. + if (ConfigMacOSXBehaviors && mouse_button == 0 && down) + { + const ImGuiInputEvent* latest_super_event = FindLatestInputEvent(&g, ImGuiInputEventType_Key, (int)ImGuiMod_Super); + if (latest_super_event ? latest_super_event->Key.Down : g.IO.KeySuper) + { + IMGUI_DEBUG_LOG_IO("[io] Super+Left Click aliased into Right Click\n"); + MouseCtrlLeftAsRightClick = true; + AddMouseButtonEvent(1, true); // This is just quicker to write that passing through, as we need to filter duplicate again. + return; + } + } + ImGuiInputEvent e; e.Type = ImGuiInputEventType_MouseButton; e.Source = ImGuiInputSource_Mouse; @@ -1610,6 +1814,13 @@ void ImGuiIO::AddFocusEvent(bool focused) g.InputEventsQueue.push_back(e); } +ImGuiPlatformIO::ImGuiPlatformIO() +{ + // Most fields are initialized with zero + memset(this, 0, sizeof(*this)); + Platform_LocaleDecimalPoint = '.'; +} + //----------------------------------------------------------------------------- // [SECTION] MISC HELPERS/UTILITIES (Geometry functions) //----------------------------------------------------------------------------- @@ -1800,7 +2011,7 @@ const char* ImStreolRange(const char* str, const char* str_end) return p ? p : str_end; } -const ImWchar* ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin) // find beginning-of-line +const char* ImStrbol(const char* buf_mid_line, const char* buf_begin) // find beginning-of-line { while (buf_mid_line > buf_begin && buf_mid_line[-1] != '\n') buf_mid_line--; @@ -1912,33 +2123,39 @@ int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) void ImFormatStringToTempBuffer(const char** out_buf, const char** out_buf_end, const char* fmt, ...) { - ImGuiContext& g = *GImGui; va_list args; va_start(args, fmt); - if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0) - { - const char* buf = va_arg(args, const char*); // Skip formatting when using "%s" - *out_buf = buf; - if (out_buf_end) { *out_buf_end = buf + strlen(buf); } - } - else - { - int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args); - *out_buf = g.TempBuffer.Data; - if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; } - } + ImFormatStringToTempBufferV(out_buf, out_buf_end, fmt, args); va_end(args); } +// FIXME: Should rework API toward allowing multiple in-flight temp buffers (easier and safer for caller) +// by making the caller acquire a temp buffer token, with either explicit or destructor release, e.g. +// ImGuiTempBufferToken token; +// ImFormatStringToTempBuffer(token, ...); void ImFormatStringToTempBufferV(const char** out_buf, const char** out_buf_end, const char* fmt, va_list args) { ImGuiContext& g = *GImGui; if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0) { const char* buf = va_arg(args, const char*); // Skip formatting when using "%s" + if (buf == NULL) + buf = "(null)"; *out_buf = buf; if (out_buf_end) { *out_buf_end = buf + strlen(buf); } } + else if (fmt[0] == '%' && fmt[1] == '.' && fmt[2] == '*' && fmt[3] == 's' && fmt[4] == 0) + { + int buf_len = va_arg(args, int); // Skip formatting when using "%.*s" + const char* buf = va_arg(args, const char*); + if (buf == NULL) + { + buf = "(null)"; + buf_len = ImMin(buf_len, 6); + } + *out_buf = buf; + *out_buf_end = buf + buf_len; // Disallow not passing 'out_buf_end' here. User is expected to use it. + } else { int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args); @@ -2031,11 +2248,18 @@ ImFileHandle ImFileOpen(const char* filename, const char* mode) // Previously we used ImTextCountCharsFromUtf8/ImTextStrFromUtf8 here but we now need to support ImWchar16 and ImWchar32! const int filename_wsize = ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0); const int mode_wsize = ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, NULL, 0); - ImVector buf; - buf.resize(filename_wsize + mode_wsize); - ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, (wchar_t*)&buf[0], filename_wsize); - ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, (wchar_t*)&buf[filename_wsize], mode_wsize); - return ::_wfopen((const wchar_t*)&buf[0], (const wchar_t*)&buf[filename_wsize]); + + // Use stack buffer if possible, otherwise heap buffer. Sizes include zero terminator. + // We don't rely on current ImGuiContext as this is implied to be a helper function which doesn't depend on it (see #7314). + wchar_t local_temp_stack[FILENAME_MAX]; + ImVector local_temp_heap; + if (filename_wsize + mode_wsize > IM_ARRAYSIZE(local_temp_stack)) + local_temp_heap.resize(filename_wsize + mode_wsize); + wchar_t* filename_wbuf = local_temp_heap.Data ? local_temp_heap.Data : local_temp_stack; + wchar_t* mode_wbuf = filename_wbuf + filename_wsize; + ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, filename_wbuf, filename_wsize); + ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, mode_wbuf, mode_wsize); + return ::_wfopen(filename_wbuf, mode_wbuf); #else return fopen(filename, mode); #endif @@ -2267,6 +2491,32 @@ int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_e } return bytes_count; } + +const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_text_curr) +{ + while (in_text_curr > in_text_start) + { + in_text_curr--; + if ((*in_text_curr & 0xC0) != 0x80) + return in_text_curr; + } + return in_text_start; +} + +int ImTextCountLines(const char* in_text, const char* in_text_end) +{ + if (in_text_end == NULL) + in_text_end = in_text + strlen(in_text); // FIXME-OPT: Not optimal approach, discourage use for now. + int count = 0; + while (in_text < in_text_end) + { + const char* line_end = (const char*)memchr(in_text, '\n', in_text_end - in_text); + in_text = line_end ? line_end + 1 : in_text_end; + count++; + } + return count; +} + IM_MSVC_RUNTIME_CHECKS_RESTORE //----------------------------------------------------------------------------- @@ -2360,18 +2610,16 @@ void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& //----------------------------------------------------------------------------- // std::lower_bound but without the bullshit -static ImGuiStorage::ImGuiStoragePair* LowerBound(ImVector& data, ImGuiID key) +ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key) { - ImGuiStorage::ImGuiStoragePair* first = data.Data; - ImGuiStorage::ImGuiStoragePair* last = data.Data + data.Size; - size_t count = (size_t)(last - first); - while (count > 0) + ImGuiStoragePair* in_p = in_begin; + for (size_t count = (size_t)(in_end - in_p); count > 0; ) { size_t count2 = count >> 1; - ImGuiStorage::ImGuiStoragePair* mid = first + count2; + ImGuiStoragePair* mid = in_p + count2; if (mid->key < key) { - first = ++mid; + in_p = ++mid; count -= count2 + 1; } else @@ -2379,29 +2627,28 @@ static ImGuiStorage::ImGuiStoragePair* LowerBound(ImVectorkey; + ImGuiID rhs_v = ((const ImGuiStoragePair*)rhs)->key; + return (lhs_v > rhs_v ? +1 : lhs_v < rhs_v ? -1 : 0); } // For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once. void ImGuiStorage::BuildSortByKey() { - struct StaticFunc - { - static int IMGUI_CDECL PairComparerByID(const void* lhs, const void* rhs) - { - // We can't just do a subtraction because qsort uses signed integers and subtracting our ID doesn't play well with that. - if (((const ImGuiStoragePair*)lhs)->key > ((const ImGuiStoragePair*)rhs)->key) return +1; - if (((const ImGuiStoragePair*)lhs)->key < ((const ImGuiStoragePair*)rhs)->key) return -1; - return 0; - } - }; - ImQsort(Data.Data, (size_t)Data.Size, sizeof(ImGuiStoragePair), StaticFunc::PairComparerByID); + ImQsort(Data.Data, (size_t)Data.Size, sizeof(ImGuiStoragePair), PairComparerByID); } int ImGuiStorage::GetInt(ImGuiID key, int default_val) const { - ImGuiStoragePair* it = LowerBound(const_cast&>(Data), key); - if (it == Data.end() || it->key != key) + ImGuiStoragePair* it = ImLowerBound(const_cast(Data.Data), const_cast(Data.Data + Data.Size), key); + if (it == Data.Data + Data.Size || it->key != key) return default_val; return it->val_i; } @@ -2413,16 +2660,16 @@ bool ImGuiStorage::GetBool(ImGuiID key, bool default_val) const float ImGuiStorage::GetFloat(ImGuiID key, float default_val) const { - ImGuiStoragePair* it = LowerBound(const_cast&>(Data), key); - if (it == Data.end() || it->key != key) + ImGuiStoragePair* it = ImLowerBound(const_cast(Data.Data), const_cast(Data.Data + Data.Size), key); + if (it == Data.Data + Data.Size || it->key != key) return default_val; return it->val_f; } void* ImGuiStorage::GetVoidPtr(ImGuiID key) const { - ImGuiStoragePair* it = LowerBound(const_cast&>(Data), key); - if (it == Data.end() || it->key != key) + ImGuiStoragePair* it = ImLowerBound(const_cast(Data.Data), const_cast(Data.Data + Data.Size), key); + if (it == Data.Data + Data.Size || it->key != key) return NULL; return it->val_p; } @@ -2430,8 +2677,8 @@ void* ImGuiStorage::GetVoidPtr(ImGuiID key) const // References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer. int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) { - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) + ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key); + if (it == Data.Data + Data.Size || it->key != key) it = Data.insert(it, ImGuiStoragePair(key, default_val)); return &it->val_i; } @@ -2443,16 +2690,16 @@ bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) float* ImGuiStorage::GetFloatRef(ImGuiID key, float default_val) { - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) + ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key); + if (it == Data.Data + Data.Size || it->key != key) it = Data.insert(it, ImGuiStoragePair(key, default_val)); return &it->val_f; } void** ImGuiStorage::GetVoidPtrRef(ImGuiID key, void* default_val) { - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) + ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key); + if (it == Data.Data + Data.Size || it->key != key) it = Data.insert(it, ImGuiStoragePair(key, default_val)); return &it->val_p; } @@ -2460,13 +2707,11 @@ void** ImGuiStorage::GetVoidPtrRef(ImGuiID key, void* default_val) // FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame) void ImGuiStorage::SetInt(ImGuiID key, int val) { - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) - { + ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key); + if (it == Data.Data + Data.Size || it->key != key) Data.insert(it, ImGuiStoragePair(key, val)); - return; - } - it->val_i = val; + else + it->val_i = val; } void ImGuiStorage::SetBool(ImGuiID key, bool val) @@ -2476,24 +2721,20 @@ void ImGuiStorage::SetBool(ImGuiID key, bool val) void ImGuiStorage::SetFloat(ImGuiID key, float val) { - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) - { + ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key); + if (it == Data.Data + Data.Size || it->key != key) Data.insert(it, ImGuiStoragePair(key, val)); - return; - } - it->val_f = val; + else + it->val_f = val; } void ImGuiStorage::SetVoidPtr(ImGuiID key, void* val) { - ImGuiStoragePair* it = LowerBound(Data, key); - if (it == Data.end() || it->key != key) - { + ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key); + if (it == Data.Data + Data.Size || it->key != key) Data.insert(it, ImGuiStoragePair(key, val)); - return; - } - it->val_p = val; + else + it->val_p = val; } void ImGuiStorage::SetAllInt(int v) @@ -2501,6 +2742,7 @@ void ImGuiStorage::SetAllInt(int v) for (int i = 0; i < Data.Size; i++) Data[i].val_i = v; } +IM_MSVC_RUNTIME_CHECKS_RESTORE //----------------------------------------------------------------------------- // [SECTION] ImGuiTextFilter @@ -2568,15 +2810,15 @@ void ImGuiTextFilter::Build() bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const { - if (Filters.empty()) + if (Filters.Size == 0) return true; if (text == NULL) - text = ""; + text = text_end = ""; for (const ImGuiTextRange& f : Filters) { - if (f.empty()) + if (f.b == f.e) continue; if (f.b[0] == '-') { @@ -2684,8 +2926,6 @@ void ImGuiTextIndex::append(const char* base, int old_size, int new_size) //----------------------------------------------------------------------------- // [SECTION] ImGuiListClipper -// This is currently not as flexible/powerful as it should be and really confusing/spaghetti, mostly because we changed -// the API mid-way through development and support two ways to using the clipper, needs some rework (see TODO) //----------------------------------------------------------------------------- // FIXME-TABLE: This prevents us from using ImGuiListClipper _inside_ a table cell. @@ -2696,54 +2936,6 @@ static bool GetSkipItemForListClipping() return (g.CurrentTable ? g.CurrentTable->HostSkipItems : g.CurrentWindow->SkipItems); } -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS -// Legacy helper to calculate coarse clipping of large list of evenly sized items. -// This legacy API is not ideal because it assumes we will return a single contiguous rectangle. -// Prefer using ImGuiListClipper which can returns non-contiguous ranges. -void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end) -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (g.LogEnabled) - { - // If logging is active, do not perform any clipping - *out_items_display_start = 0; - *out_items_display_end = items_count; - return; - } - if (GetSkipItemForListClipping()) - { - *out_items_display_start = *out_items_display_end = 0; - return; - } - - // We create the union of the ClipRect and the scoring rect which at worst should be 1 page away from ClipRect - // We don't include g.NavId's rectangle in there (unless g.NavJustMovedToId is set) because the rectangle enlargement can get costly. - ImRect rect = window->ClipRect; - if (g.NavMoveScoringItems) - rect.Add(g.NavScoringNoClipRect); - if (g.NavJustMovedToId && window->NavLastIds[0] == g.NavJustMovedToId) - rect.Add(WindowRectRelToAbs(window, window->NavRectRel[0])); // Could store and use NavJustMovedToRectRel - - const ImVec2 pos = window->DC.CursorPos; - int start = (int)((rect.Min.y - pos.y) / items_height); - int end = (int)((rect.Max.y - pos.y) / items_height); - - // When performing a navigation request, ensure we have one item extra in the direction we are moving to - // FIXME: Verify this works with tabbing - const bool is_nav_request = (g.NavMoveScoringItems && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav); - if (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up) - start--; - if (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down) - end++; - - start = ImClamp(start, 0, items_count); - end = ImClamp(end + 1, start, items_count); - *out_items_display_start = start; - *out_items_display_end = end; -} -#endif - static void ImGuiListClipper_SortAndFuseRanges(ImVector& ranges, int offset = 0) { if (ranges.Size - offset <= 1) @@ -2793,15 +2985,6 @@ static void ImGuiListClipper_SeekCursorAndSetupPrevLine(float pos_y, float line_ } } -static void ImGuiListClipper_SeekCursorForItem(ImGuiListClipper* clipper, int item_n) -{ - // StartPosY starts from ItemsFrozen hence the subtraction - // Perform the add and multiply with double to allow seeking through larger ranges - ImGuiListClipperData* data = (ImGuiListClipperData*)clipper->TempData; - float pos_y = (float)((double)clipper->StartPosY + data->LossynessOffset + (double)(item_n - data->ItemsFrozen) * clipper->ItemsHeight); - ImGuiListClipper_SeekCursorAndSetupPrevLine(pos_y, clipper->ItemsHeight); -} - ImGuiListClipper::ImGuiListClipper() { memset(this, 0, sizeof(*this)); @@ -2838,6 +3021,7 @@ void ImGuiListClipper::Begin(int items_count, float items_height) data->Reset(this); data->LossynessOffset = window->DC.CursorStartPosLossyness.y; TempData = data; + StartSeekOffsetY = data->LossynessOffset; } void ImGuiListClipper::End() @@ -2848,7 +3032,7 @@ void ImGuiListClipper::End() ImGuiContext& g = *Ctx; IMGUI_DEBUG_LOG_CLIPPER("Clipper: End() in '%s'\n", g.CurrentWindow->Name); if (ItemsCount >= 0 && ItemsCount < INT_MAX && DisplayStart >= 0) - ImGuiListClipper_SeekCursorForItem(this, ItemsCount); + SeekCursorForItem(ItemsCount); // Restore temporary buffer and fix back pointers which may be invalidated when nesting IM_ASSERT(data->ListClipper == this); @@ -2872,6 +3056,17 @@ void ImGuiListClipper::IncludeItemsByIndex(int item_begin, int item_end) data->Ranges.push_back(ImGuiListClipperRange::FromIndices(item_begin, item_end)); } +// This is already called while stepping. +// The ONLY reason you may want to call this is if you passed INT_MAX to ImGuiListClipper::Begin() because you couldn't step item count beforehand. +void ImGuiListClipper::SeekCursorForItem(int item_n) +{ + // - Perform the add and multiply with double to allow seeking through larger ranges. + // - StartPosY starts from ItemsFrozen, by adding SeekOffsetY we generally cancel that out (SeekOffsetY == LossynessOffset - ItemsFrozen * ItemsHeight). + // - The reason we store SeekOffsetY instead of inferring it, is because we want to allow user to perform Seek after the last step, where ImGuiListClipperData is already done. + float pos_y = (float)((double)StartPosY + StartSeekOffsetY + (double)item_n * ItemsHeight); + ImGuiListClipper_SeekCursorAndSetupPrevLine(pos_y, ItemsHeight); +} + static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper) { ImGuiContext& g = *clipper->Ctx; @@ -2926,7 +3121,8 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper) bool affected_by_floating_point_precision = ImIsFloatAboveGuaranteedIntegerPrecision(clipper->StartPosY) || ImIsFloatAboveGuaranteedIntegerPrecision(window->DC.CursorPos.y); if (affected_by_floating_point_precision) clipper->ItemsHeight = window->DC.PrevLineSize.y + g.Style.ItemSpacing.y; // FIXME: Technically wouldn't allow multi-line entries. - + if (clipper->ItemsHeight == 0.0f && clipper->ItemsCount == INT_MAX) // Accept that no item have been submitted if in indeterminate mode. + return false; IM_ASSERT(clipper->ItemsHeight > 0.0f && "Unable to calculate item height! First item hasn't moved the cursor vertically!"); calc_clipping = true; // If item height had to be calculated, calculate clipping afterwards. } @@ -2935,6 +3131,9 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper) const int already_submitted = clipper->DisplayEnd; if (calc_clipping) { + // Record seek offset, this is so ImGuiListClipper::Seek() can be called after ImGuiListClipperData is done + clipper->StartSeekOffsetY = (double)data->LossynessOffset - data->ItemsFrozen * (double)clipper->ItemsHeight; + if (g.LogEnabled) { // If logging is active, do not perform any clipping @@ -2955,9 +3154,27 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper) data->Ranges.push_back(ImGuiListClipperRange::FromPositions(nav_rect_abs.Min.y, nav_rect_abs.Max.y, 0, 0)); // Add visible range + float min_y = window->ClipRect.Min.y; + float max_y = window->ClipRect.Max.y; + + // Add box selection range + ImGuiBoxSelectState* bs = &g.BoxSelectState; + if (bs->IsActive && bs->Window == window) + { + // FIXME: Selectable() use of half-ItemSpacing isn't consistent in matter of layout, as ItemAdd(bb) stray above ItemSize()'s CursorPos. + // RangeSelect's BoxSelect relies on comparing overlap of previous and current rectangle and is sensitive to that. + // As a workaround we currently half ItemSpacing worth on each side. + min_y -= g.Style.ItemSpacing.y; + max_y += g.Style.ItemSpacing.y; + + // Box-select on 2D area requires different clipping. + if (bs->UnclipMode) + data->Ranges.push_back(ImGuiListClipperRange::FromPositions(bs->UnclipRect.Min.y, bs->UnclipRect.Max.y, 0, 0)); + } + const int off_min = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up) ? -1 : 0; const int off_max = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down) ? 1 : 0; - data->Ranges.push_back(ImGuiListClipperRange::FromPositions(window->ClipRect.Min.y, window->ClipRect.Max.y, off_min, off_max)); + data->Ranges.push_back(ImGuiListClipperRange::FromPositions(min_y, max_y, off_min, off_max)); } // Convert position ranges to item index ranges @@ -2982,7 +3199,7 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper) clipper->DisplayStart = ImMax(data->Ranges[data->StepNo].Min, already_submitted); clipper->DisplayEnd = ImMin(data->Ranges[data->StepNo].Max, clipper->ItemsCount); if (clipper->DisplayStart > already_submitted) //-V1051 - ImGuiListClipper_SeekCursorForItem(clipper, clipper->DisplayStart); + clipper->SeekCursorForItem(clipper->DisplayStart); data->StepNo++; if (clipper->DisplayStart == clipper->DisplayEnd && data->StepNo < data->Ranges.Size) continue; @@ -2992,7 +3209,7 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper) // After the last step: Let the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), // Advance the cursor to the end of the list and then returns 'false' to end the loop. if (clipper->ItemsCount < INT_MAX) - ImGuiListClipper_SeekCursorForItem(clipper, clipper->ItemsCount); + clipper->SeekCursorForItem(clipper->ItemsCount); return false; } @@ -3052,13 +3269,14 @@ const ImVec4& ImGui::GetStyleColorVec4(ImGuiCol idx) return style.Colors[idx]; } -ImU32 ImGui::GetColorU32(ImU32 col) +ImU32 ImGui::GetColorU32(ImU32 col, float alpha_mul) { ImGuiStyle& style = GImGui->Style; - if (style.Alpha >= 1.0f) + alpha_mul *= style.Alpha; + if (alpha_mul >= 1.0f) return col; ImU32 a = (col & IM_COL32_A_MASK) >> IM_COL32_A_SHIFT; - a = (ImU32)(a * style.Alpha); // We don't need to clamp 0..255 because Style.Alpha is in 0..1 range. + a = (ImU32)(a * alpha_mul); // We don't need to clamp 0..255 because alpha is in 0..1 range. return (col & ~IM_COL32_A_MASK) | (a << IM_COL32_A_SHIFT); } @@ -3070,7 +3288,8 @@ void ImGui::PushStyleColor(ImGuiCol idx, ImU32 col) backup.Col = idx; backup.BackupValue = g.Style.Colors[idx]; g.ColorStack.push_back(backup); - g.Style.Colors[idx] = ColorConvertU32ToFloat4(col); + if (g.DebugFlashStyleColorIdx != idx) + g.Style.Colors[idx] = ColorConvertU32ToFloat4(col); } void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col) @@ -3080,7 +3299,8 @@ void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col) backup.Col = idx; backup.BackupValue = g.Style.Colors[idx]; g.ColorStack.push_back(backup); - g.Style.Colors[idx] = col; + if (g.DebugFlashStyleColorIdx != idx) + g.Style.Colors[idx] = col; } void ImGui::PopStyleColor(int count) @@ -3088,7 +3308,7 @@ void ImGui::PopStyleColor(int count) ImGuiContext& g = *GImGui; if (g.ColorStack.Size < count) { - IM_ASSERT_USER_ERROR(g.ColorStack.Size > count, "Calling PopStyleColor() too many times: stack underflow."); + IM_ASSERT_USER_ERROR(0, "Calling PopStyleColor() too many times!"); count = g.ColorStack.Size; } while (count > 0) @@ -3102,34 +3322,39 @@ void ImGui::PopStyleColor(int count) static const ImGuiDataVarInfo GStyleVarInfo[] = { - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, Alpha) }, // ImGuiStyleVar_Alpha - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, DisabledAlpha) }, // ImGuiStyleVar_DisabledAlpha - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowPadding) }, // ImGuiStyleVar_WindowPadding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowRounding) }, // ImGuiStyleVar_WindowRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowBorderSize) }, // ImGuiStyleVar_WindowBorderSize - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowMinSize) }, // ImGuiStyleVar_WindowMinSize - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowTitleAlign) }, // ImGuiStyleVar_WindowTitleAlign - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ChildRounding) }, // ImGuiStyleVar_ChildRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ChildBorderSize) }, // ImGuiStyleVar_ChildBorderSize - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, PopupRounding) }, // ImGuiStyleVar_PopupRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, PopupBorderSize) }, // ImGuiStyleVar_PopupBorderSize - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, FramePadding) }, // ImGuiStyleVar_FramePadding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, FrameRounding) }, // ImGuiStyleVar_FrameRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, FrameBorderSize) }, // ImGuiStyleVar_FrameBorderSize - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ItemSpacing) }, // ImGuiStyleVar_ItemSpacing - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ItemInnerSpacing) }, // ImGuiStyleVar_ItemInnerSpacing - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, IndentSpacing) }, // ImGuiStyleVar_IndentSpacing - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, CellPadding) }, // ImGuiStyleVar_CellPadding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ScrollbarSize) }, // ImGuiStyleVar_ScrollbarSize - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ScrollbarRounding) }, // ImGuiStyleVar_ScrollbarRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabMinSize) }, // ImGuiStyleVar_GrabMinSize - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabRounding) }, // ImGuiStyleVar_GrabRounding - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, TabRounding) }, // ImGuiStyleVar_TabRounding - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ButtonTextAlign) }, // ImGuiStyleVar_ButtonTextAlign - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, SelectableTextAlign) }, // ImGuiStyleVar_SelectableTextAlign - { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, SeparatorTextBorderSize) },// ImGuiStyleVar_SeparatorTextBorderSize - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, SeparatorTextAlign) }, // ImGuiStyleVar_SeparatorTextAlign - { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, SeparatorTextPadding) }, // ImGuiStyleVar_SeparatorTextPadding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, Alpha) }, // ImGuiStyleVar_Alpha + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, DisabledAlpha) }, // ImGuiStyleVar_DisabledAlpha + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, WindowPadding) }, // ImGuiStyleVar_WindowPadding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, WindowRounding) }, // ImGuiStyleVar_WindowRounding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, WindowBorderSize) }, // ImGuiStyleVar_WindowBorderSize + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, WindowMinSize) }, // ImGuiStyleVar_WindowMinSize + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, WindowTitleAlign) }, // ImGuiStyleVar_WindowTitleAlign + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, ChildRounding) }, // ImGuiStyleVar_ChildRounding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, ChildBorderSize) }, // ImGuiStyleVar_ChildBorderSize + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, PopupRounding) }, // ImGuiStyleVar_PopupRounding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, PopupBorderSize) }, // ImGuiStyleVar_PopupBorderSize + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, FramePadding) }, // ImGuiStyleVar_FramePadding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, FrameRounding) }, // ImGuiStyleVar_FrameRounding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, FrameBorderSize) }, // ImGuiStyleVar_FrameBorderSize + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, ItemSpacing) }, // ImGuiStyleVar_ItemSpacing + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, ItemInnerSpacing) }, // ImGuiStyleVar_ItemInnerSpacing + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, IndentSpacing) }, // ImGuiStyleVar_IndentSpacing + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, CellPadding) }, // ImGuiStyleVar_CellPadding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, ScrollbarSize) }, // ImGuiStyleVar_ScrollbarSize + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, ScrollbarRounding) }, // ImGuiStyleVar_ScrollbarRounding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, GrabMinSize) }, // ImGuiStyleVar_GrabMinSize + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, GrabRounding) }, // ImGuiStyleVar_GrabRounding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, TabRounding) }, // ImGuiStyleVar_TabRounding + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, TabBorderSize) }, // ImGuiStyleVar_TabBorderSize + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, TabBarBorderSize) }, // ImGuiStyleVar_TabBarBorderSize + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, TabBarOverlineSize) }, // ImGuiStyleVar_TabBarOverlineSize + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, TableAngledHeadersAngle)}, // ImGuiStyleVar_TableAngledHeadersAngle + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, TableAngledHeadersTextAlign)},// ImGuiStyleVar_TableAngledHeadersTextAlign + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, ButtonTextAlign) }, // ImGuiStyleVar_ButtonTextAlign + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, SelectableTextAlign) }, // ImGuiStyleVar_SelectableTextAlign + { ImGuiDataType_Float, 1, (ImU32)offsetof(ImGuiStyle, SeparatorTextBorderSize)}, // ImGuiStyleVar_SeparatorTextBorderSize + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, SeparatorTextAlign) }, // ImGuiStyleVar_SeparatorTextAlign + { ImGuiDataType_Float, 2, (ImU32)offsetof(ImGuiStyle, SeparatorTextPadding) }, // ImGuiStyleVar_SeparatorTextPadding }; const ImGuiDataVarInfo* ImGui::GetStyleVarInfo(ImGuiStyleVar idx) @@ -3143,28 +3368,56 @@ void ImGui::PushStyleVar(ImGuiStyleVar idx, float val) { ImGuiContext& g = *GImGui; const ImGuiDataVarInfo* var_info = GetStyleVarInfo(idx); - if (var_info->Type == ImGuiDataType_Float && var_info->Count == 1) + if (var_info->Type != ImGuiDataType_Float || var_info->Count != 1) { - float* pvar = (float*)var_info->GetVarPtr(&g.Style); - g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar)); - *pvar = val; + IM_ASSERT_USER_ERROR(0, "Calling PushStyleVar() variant with wrong type!"); return; } - IM_ASSERT_USER_ERROR(0, "Called PushStyleVar() variant with wrong type!"); + float* pvar = (float*)var_info->GetVarPtr(&g.Style); + g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar)); + *pvar = val; +} + +void ImGui::PushStyleVarX(ImGuiStyleVar idx, float val_x) +{ + ImGuiContext& g = *GImGui; + const ImGuiDataVarInfo* var_info = GetStyleVarInfo(idx); + if (var_info->Type != ImGuiDataType_Float || var_info->Count != 2) + { + IM_ASSERT_USER_ERROR(0, "Calling PushStyleVar() variant with wrong type!"); + return; + } + ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style); + g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar)); + pvar->x = val_x; +} + +void ImGui::PushStyleVarY(ImGuiStyleVar idx, float val_y) +{ + ImGuiContext& g = *GImGui; + const ImGuiDataVarInfo* var_info = GetStyleVarInfo(idx); + if (var_info->Type != ImGuiDataType_Float || var_info->Count != 2) + { + IM_ASSERT_USER_ERROR(0, "Calling PushStyleVar() variant with wrong type!"); + return; + } + ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style); + g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar)); + pvar->y = val_y; } void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val) { ImGuiContext& g = *GImGui; const ImGuiDataVarInfo* var_info = GetStyleVarInfo(idx); - if (var_info->Type == ImGuiDataType_Float && var_info->Count == 2) + if (var_info->Type != ImGuiDataType_Float || var_info->Count != 2) { - ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style); - g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar)); - *pvar = val; + IM_ASSERT_USER_ERROR(0, "Calling PushStyleVar() variant with wrong type!"); return; } - IM_ASSERT_USER_ERROR(0, "Called PushStyleVar() variant with wrong type!"); + ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style); + g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar)); + *pvar = val; } void ImGui::PopStyleVar(int count) @@ -3172,7 +3425,7 @@ void ImGui::PopStyleVar(int count) ImGuiContext& g = *GImGui; if (g.StyleVarStack.Size < count) { - IM_ASSERT_USER_ERROR(g.StyleVarStack.Size > count, "Calling PopStyleVar() too many times: stack underflow."); + IM_ASSERT_USER_ERROR(0, "Calling PopStyleVar() too many times!"); count = g.StyleVarStack.Size; } while (count > 0) @@ -3226,11 +3479,13 @@ const char* ImGui::GetStyleColorName(ImGuiCol idx) case ImGuiCol_ResizeGrip: return "ResizeGrip"; case ImGuiCol_ResizeGripHovered: return "ResizeGripHovered"; case ImGuiCol_ResizeGripActive: return "ResizeGripActive"; - case ImGuiCol_Tab: return "Tab"; case ImGuiCol_TabHovered: return "TabHovered"; - case ImGuiCol_TabActive: return "TabActive"; - case ImGuiCol_TabUnfocused: return "TabUnfocused"; - case ImGuiCol_TabUnfocusedActive: return "TabUnfocusedActive"; + case ImGuiCol_Tab: return "Tab"; + case ImGuiCol_TabSelected: return "TabSelected"; + case ImGuiCol_TabSelectedOverline: return "TabSelectedOverline"; + case ImGuiCol_TabDimmed: return "TabDimmed"; + case ImGuiCol_TabDimmedSelected: return "TabDimmedSelected"; + case ImGuiCol_TabDimmedSelectedOverline: return "TabDimmedSelectedOverline"; case ImGuiCol_PlotLines: return "PlotLines"; case ImGuiCol_PlotLinesHovered: return "PlotLinesHovered"; case ImGuiCol_PlotHistogram: return "PlotHistogram"; @@ -3240,9 +3495,10 @@ const char* ImGui::GetStyleColorName(ImGuiCol idx) case ImGuiCol_TableBorderLight: return "TableBorderLight"; case ImGuiCol_TableRowBg: return "TableRowBg"; case ImGuiCol_TableRowBgAlt: return "TableRowBgAlt"; + case ImGuiCol_TextLink: return "TextLink"; case ImGuiCol_TextSelectedBg: return "TextSelectedBg"; case ImGuiCol_DragDropTarget: return "DragDropTarget"; - case ImGuiCol_NavHighlight: return "NavHighlight"; + case ImGuiCol_NavCursor: return "NavCursor"; case ImGuiCol_NavWindowingHighlight: return "NavWindowingHighlight"; case ImGuiCol_NavWindowingDimBg: return "NavWindowingDimBg"; case ImGuiCol_ModalWindowDimBg: return "ModalWindowDimBg"; @@ -3385,7 +3641,7 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con const ImFont* font = draw_list->_Data->Font; const float font_size = draw_list->_Data->FontSize; - const float font_scale = font_size / font->FontSize; + const float font_scale = draw_list->_Data->FontScale; const char* text_end_ellipsis = NULL; const float ellipsis_width = font->EllipsisWidth * font_scale; @@ -3407,7 +3663,7 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con // Render text, render ellipsis RenderTextClippedEx(draw_list, pos_min, ImVec2(clip_max_x, pos_max.y), text, text_end_ellipsis, &text_size, ImVec2(0.0f, 0.0f)); - ImVec2 ellipsis_pos = ImFloor(ImVec2(pos_min.x + text_size_clipped_x, pos_min.y)); + ImVec2 ellipsis_pos = ImTrunc(ImVec2(pos_min.x + text_size_clipped_x, pos_min.y)); if (ellipsis_pos.x + ellipsis_width <= ellipsis_max_x) for (int i = 0; i < font->EllipsisCharCount; i++, ellipsis_pos.x += font->EllipsisCharStep * font_scale) font->RenderChar(draw_list, font_size, ellipsis_pos, GetColorU32(ImGuiCol_Text), font->EllipsisChar); @@ -3422,13 +3678,13 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con } // Render a rectangle shaped with optional rounding and borders -void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding) +void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool borders, float rounding) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; window->DrawList->AddRectFilled(p_min, p_max, fill_col, rounding); const float border_size = g.Style.FrameBorderSize; - if (border && border_size > 0.0f) + if (borders && border_size > 0.0f) { window->DrawList->AddRect(p_min + ImVec2(1, 1), p_max + ImVec2(1, 1), GetColorU32(ImGuiCol_BorderShadow), rounding, 0, border_size); window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, 0, border_size); @@ -3447,42 +3703,45 @@ void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding) } } -void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags) +void ImGui::RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags) { ImGuiContext& g = *GImGui; if (id != g.NavId) return; - if (g.NavDisableHighlight && !(flags & ImGuiNavHighlightFlags_AlwaysDraw)) + if (!g.NavCursorVisible && !(flags & ImGuiNavRenderCursorFlags_AlwaysDraw)) + return; + if (id == g.LastItemData.ID && (g.LastItemData.ItemFlags & ImGuiItemFlags_NoNav)) return; ImGuiWindow* window = g.CurrentWindow; if (window->DC.NavHideHighlightOneFrame) return; - float rounding = (flags & ImGuiNavHighlightFlags_NoRounding) ? 0.0f : g.Style.FrameRounding; + float rounding = (flags & ImGuiNavRenderCursorFlags_NoRounding) ? 0.0f : g.Style.FrameRounding; ImRect display_rect = bb; display_rect.ClipWith(window->ClipRect); - if (flags & ImGuiNavHighlightFlags_TypeDefault) + const float thickness = 2.0f; + if (flags & ImGuiNavRenderCursorFlags_Compact) + { + window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, 0, thickness); + } + else { - const float THICKNESS = 2.0f; - const float DISTANCE = 3.0f + THICKNESS * 0.5f; - display_rect.Expand(ImVec2(DISTANCE, DISTANCE)); + const float distance = 3.0f + thickness * 0.5f; + display_rect.Expand(ImVec2(distance, distance)); bool fully_visible = window->ClipRect.Contains(display_rect); if (!fully_visible) window->DrawList->PushClipRect(display_rect.Min, display_rect.Max); - window->DrawList->AddRect(display_rect.Min + ImVec2(THICKNESS * 0.5f, THICKNESS * 0.5f), display_rect.Max - ImVec2(THICKNESS * 0.5f, THICKNESS * 0.5f), GetColorU32(ImGuiCol_NavHighlight), rounding, 0, THICKNESS); + window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, 0, thickness); if (!fully_visible) window->DrawList->PopClipRect(); } - if (flags & ImGuiNavHighlightFlags_TypeThin) - { - window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavHighlight), rounding, 0, 1.0f); - } } void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow) { ImGuiContext& g = *GImGui; - IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT); + if (mouse_cursor <= ImGuiMouseCursor_None || mouse_cursor >= ImGuiMouseCursor_COUNT) // We intentionally accept out of bound values. + mouse_cursor = ImGuiMouseCursor_Arrow; ImFontAtlas* font_atlas = g.DrawListSharedData.Font->ContainerAtlas; for (ImGuiViewportP* viewport : g.Viewports) { @@ -3562,7 +3821,7 @@ void ImGui::DestroyContext(ImGuiContext* ctx) IM_DELETE(ctx); } -// IMPORTANT: ###xxx suffixes must be same in ALL languages +// IMPORTANT: interactive elements requires a fixed ###xxx suffix, it must be same in ALL languages to allow for automation. static const ImGuiLocEntry GLocalizationEntriesEnUS[] = { { ImGuiLocKey_VersionStr, "Dear ImGui " IMGUI_VERSION " (" IM_STRINGIFY(IMGUI_VERSION_NUM) ")" }, @@ -3573,8 +3832,225 @@ static const ImGuiLocEntry GLocalizationEntriesEnUS[] = { ImGuiLocKey_WindowingMainMenuBar, "(Main menu bar)" }, { ImGuiLocKey_WindowingPopup, "(Popup)" }, { ImGuiLocKey_WindowingUntitled, "(Untitled)" }, + { ImGuiLocKey_OpenLink_s, "Open '%s'" }, + { ImGuiLocKey_CopyLink, "Copy Link###CopyLink" }, }; +ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas) +{ + IO.Ctx = this; + InputTextState.Ctx = this; + + Initialized = false; + FontAtlasOwnedByContext = shared_font_atlas ? false : true; + Font = NULL; + FontSize = FontBaseSize = FontScale = CurrentDpiScale = 0.0f; + IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)(); + Time = 0.0f; + FrameCount = 0; + FrameCountEnded = FrameCountRendered = -1; + WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false; + GcCompactAll = false; + TestEngineHookItems = false; + TestEngine = NULL; + memset(ContextName, 0, sizeof(ContextName)); + + InputEventsNextMouseSource = ImGuiMouseSource_Mouse; + InputEventsNextEventId = 1; + + WindowsActiveCount = 0; + CurrentWindow = NULL; + HoveredWindow = NULL; + HoveredWindowUnderMovingWindow = NULL; + HoveredWindowBeforeClear = NULL; + MovingWindow = NULL; + WheelingWindow = NULL; + WheelingWindowStartFrame = WheelingWindowScrolledFrame = -1; + WheelingWindowReleaseTimer = 0.0f; + + DebugDrawIdConflicts = 0; + DebugHookIdInfo = 0; + HoveredId = HoveredIdPreviousFrame = 0; + HoveredIdPreviousFrameItemCount = 0; + HoveredIdAllowOverlap = false; + HoveredIdIsDisabled = false; + HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f; + ItemUnclipByLog = false; + ActiveId = 0; + ActiveIdIsAlive = 0; + ActiveIdTimer = 0.0f; + ActiveIdIsJustActivated = false; + ActiveIdAllowOverlap = false; + ActiveIdNoClearOnFocusLoss = false; + ActiveIdHasBeenPressedBefore = false; + ActiveIdHasBeenEditedBefore = false; + ActiveIdHasBeenEditedThisFrame = false; + ActiveIdFromShortcut = false; + ActiveIdClickOffset = ImVec2(-1, -1); + ActiveIdWindow = NULL; + ActiveIdSource = ImGuiInputSource_None; + ActiveIdMouseButton = -1; + ActiveIdPreviousFrame = 0; + ActiveIdPreviousFrameIsAlive = false; + ActiveIdPreviousFrameHasBeenEditedBefore = false; + ActiveIdPreviousFrameWindow = NULL; + LastActiveId = 0; + LastActiveIdTimer = 0.0f; + + LastKeyboardKeyPressTime = LastKeyModsChangeTime = LastKeyModsChangeFromNoneTime = -1.0; + + ActiveIdUsingNavDirMask = 0x00; + ActiveIdUsingAllKeyboardKeys = false; + + CurrentFocusScopeId = 0; + CurrentItemFlags = ImGuiItemFlags_None; + DebugShowGroupRects = false; + + NavCursorVisible = false; + NavHighlightItemUnderNav = false; + NavMousePosDirty = false; + NavIdIsAlive = false; + NavId = 0; + NavWindow = NULL; + NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = 0; + NavLayer = ImGuiNavLayer_Main; + NavNextActivateId = 0; + NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None; + NavHighlightActivatedId = 0; + NavHighlightActivatedTimer = 0.0f; + NavInputSource = ImGuiInputSource_Keyboard; + NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid; + NavCursorHideFrames = 0; + + NavAnyRequest = false; + NavInitRequest = false; + NavInitRequestFromMove = false; + NavMoveSubmitted = false; + NavMoveScoringItems = false; + NavMoveForwardToNextFrame = false; + NavMoveFlags = ImGuiNavMoveFlags_None; + NavMoveScrollFlags = ImGuiScrollFlags_None; + NavMoveKeyMods = ImGuiMod_None; + NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None; + NavScoringDebugCount = 0; + NavTabbingDir = 0; + NavTabbingCounter = 0; + + NavJustMovedFromFocusScopeId = NavJustMovedToId = NavJustMovedToFocusScopeId = 0; + NavJustMovedToKeyMods = ImGuiMod_None; + NavJustMovedToIsTabbing = false; + NavJustMovedToHasSelectionData = false; + + // All platforms use Ctrl+Tab but Ctrl<>Super are swapped on Mac... + // FIXME: Because this value is stored, it annoyingly interfere with toggling io.ConfigMacOSXBehaviors updating this.. + ConfigNavWindowingKeyNext = IO.ConfigMacOSXBehaviors ? (ImGuiMod_Super | ImGuiKey_Tab) : (ImGuiMod_Ctrl | ImGuiKey_Tab); + ConfigNavWindowingKeyPrev = IO.ConfigMacOSXBehaviors ? (ImGuiMod_Super | ImGuiMod_Shift | ImGuiKey_Tab) : (ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab); + NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL; + NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f; + NavWindowingToggleLayer = false; + NavWindowingToggleKey = ImGuiKey_None; + + DimBgRatio = 0.0f; + + DragDropActive = DragDropWithinSource = DragDropWithinTarget = false; + DragDropSourceFlags = ImGuiDragDropFlags_None; + DragDropSourceFrameCount = -1; + DragDropMouseButton = -1; + DragDropTargetId = 0; + DragDropAcceptFlags = ImGuiDragDropFlags_None; + DragDropAcceptIdCurrRectSurface = 0.0f; + DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0; + DragDropAcceptFrameCount = -1; + DragDropHoldJustPressedId = 0; + memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal)); + + ClipperTempDataStacked = 0; + + CurrentTable = NULL; + TablesTempDataStacked = 0; + CurrentTabBar = NULL; + CurrentMultiSelect = NULL; + MultiSelectTempDataStacked = 0; + + HoverItemDelayId = HoverItemDelayIdPreviousFrame = HoverItemUnlockedStationaryId = HoverWindowUnlockedStationaryId = 0; + HoverItemDelayTimer = HoverItemDelayClearTimer = 0.0f; + + MouseCursor = ImGuiMouseCursor_Arrow; + MouseStationaryTimer = 0.0f; + + TempInputId = 0; + memset(&DataTypeZeroValue, 0, sizeof(DataTypeZeroValue)); + BeginMenuDepth = BeginComboDepth = 0; + ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_; + ColorEditCurrentID = ColorEditSavedID = 0; + ColorEditSavedHue = ColorEditSavedSat = 0.0f; + ColorEditSavedColor = 0; + WindowResizeRelativeMode = false; + ScrollbarSeekMode = 0; + ScrollbarClickDeltaToGrabCenter = 0.0f; + SliderGrabClickOffset = 0.0f; + SliderCurrentAccum = 0.0f; + SliderCurrentAccumDirty = false; + DragCurrentAccumDirty = false; + DragCurrentAccum = 0.0f; + DragSpeedDefaultRatio = 1.0f / 100.0f; + DisabledAlphaBackup = 0.0f; + DisabledStackSize = 0; + TooltipOverrideCount = 0; + TooltipPreviousWindow = NULL; + + PlatformImeData.InputPos = ImVec2(0.0f, 0.0f); + PlatformImeDataPrev.InputPos = ImVec2(-1.0f, -1.0f); // Different to ensure initial submission + + SettingsLoaded = false; + SettingsDirtyTimer = 0.0f; + HookIdNext = 0; + + memset(LocalizationTable, 0, sizeof(LocalizationTable)); + + LogEnabled = false; + LogType = ImGuiLogType_None; + LogNextPrefix = LogNextSuffix = NULL; + LogFile = NULL; + LogLinePosY = FLT_MAX; + LogLineFirstItem = false; + LogDepthRef = 0; + LogDepthToExpand = LogDepthToExpandDefault = 2; + + ErrorCallback = NULL; + ErrorCallbackUserData = NULL; + ErrorFirst = true; + ErrorCountCurrentFrame = 0; + StackSizesInBeginForCurrentWindow = NULL; + + DebugDrawIdConflictsCount = 0; + DebugLogFlags = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_OutputToTTY; + DebugLocateId = 0; + DebugLogSkippedErrors = 0; + DebugLogAutoDisableFlags = ImGuiDebugLogFlags_None; + DebugLogAutoDisableFrames = 0; + DebugLocateFrames = 0; + DebugBeginReturnValueCullDepth = -1; + DebugItemPickerActive = false; + DebugItemPickerMouseButton = ImGuiMouseButton_Left; + DebugItemPickerBreakId = 0; + DebugFlashStyleColorTime = 0.0f; + DebugFlashStyleColorIdx = ImGuiCol_COUNT; + + // Same as DebugBreakClearData(). Those fields are scattered in their respective subsystem to stay in hot-data locations + DebugBreakInWindow = 0; + DebugBreakInTable = 0; + DebugBreakInLocateId = false; + DebugBreakKeyChord = ImGuiKey_Pause; + DebugBreakInShortcutRouting = ImGuiKey_None; + + memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame)); + FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0; + FramerateSecPerFrameAccum = 0.0f; + WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1; + memset(TempKeychordName, 0, sizeof(TempKeychordName)); +} + void ImGui::Initialize() { ImGuiContext& g = *GImGui; @@ -3597,17 +4073,26 @@ void ImGui::Initialize() // Setup default localization table LocalizeRegisterEntries(GLocalizationEntriesEnUS, IM_ARRAYSIZE(GLocalizationEntriesEnUS)); - // Setup default platform clipboard/IME handlers. - g.IO.GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations - g.IO.SetClipboardTextFn = SetClipboardTextFn_DefaultImpl; - g.IO.ClipboardUserData = (void*)&g; // Default implementation use the ImGuiContext as user data (ideally those would be arguments to the function) - g.IO.SetPlatformImeDataFn = SetPlatformImeDataFn_DefaultImpl; + // Setup default ImGuiPlatformIO clipboard/IME handlers. + g.PlatformIO.Platform_GetClipboardTextFn = Platform_GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations + g.PlatformIO.Platform_SetClipboardTextFn = Platform_SetClipboardTextFn_DefaultImpl; + g.PlatformIO.Platform_OpenInShellFn = Platform_OpenInShellFn_DefaultImpl; + g.PlatformIO.Platform_SetImeDataFn = Platform_SetImeDataFn_DefaultImpl; // Create default viewport ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)(); + viewport->ID = IMGUI_VIEWPORT_DEFAULT_ID; g.Viewports.push_back(viewport); g.TempBuffer.resize(1024 * 3 + 1, 0); + // Build KeysMayBeCharInput[] lookup table (1 bool per named key) + for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) + if ((key >= ImGuiKey_0 && key <= ImGuiKey_9) || (key >= ImGuiKey_A && key <= ImGuiKey_Z) || (key >= ImGuiKey_Keypad0 && key <= ImGuiKey_Keypad9) + || key == ImGuiKey_Tab || key == ImGuiKey_Space || key == ImGuiKey_Apostrophe || key == ImGuiKey_Comma || key == ImGuiKey_Minus || key == ImGuiKey_Period + || key == ImGuiKey_Slash || key == ImGuiKey_Semicolon || key == ImGuiKey_Equal || key == ImGuiKey_LeftBracket || key == ImGuiKey_RightBracket || key == ImGuiKey_GraveAccent + || key == ImGuiKey_KeypadDecimal || key == ImGuiKey_KeypadDivide || key == ImGuiKey_KeypadMultiply || key == ImGuiKey_KeypadSubtract || key == ImGuiKey_KeypadAdd || key == ImGuiKey_KeypadEqual) + g.KeysMayBeCharInput.SetBit(key); + #ifdef IMGUI_HAS_DOCK #endif @@ -3617,8 +4102,11 @@ void ImGui::Initialize() // This function is merely here to free heap allocations. void ImGui::Shutdown() { - // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame) ImGuiContext& g = *GImGui; + IM_ASSERT_USER_ERROR(g.IO.BackendPlatformUserData == NULL, "Forgot to shutdown Platform backend?"); + IM_ASSERT_USER_ERROR(g.IO.BackendRendererUserData == NULL, "Forgot to shutdown Renderer backend?"); + + // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame) if (g.IO.Fonts && g.FontAtlasOwnedByContext) { g.IO.Fonts->Locked = false; @@ -3656,7 +4144,7 @@ void ImGui::Shutdown() g.FontStack.clear(); g.OpenPopupStack.clear(); g.BeginPopupStack.clear(); - g.NavTreeNodeStack.clear(); + g.TreeNodeStack.clear(); g.Viewports.clear_delete(); @@ -3670,6 +4158,9 @@ void ImGui::Shutdown() g.TablesTempData.clear_destruct(); g.DrawChannelsTempMergeBuffer.clear(); + g.MultiSelectStorage.Clear(); + g.MultiSelectTempData.clear_destruct(); + g.ClipboardHandlerData.clear(); g.MenusIdSubmittedThisFrame.clear(); g.InputTextState.ClearFreeMemory(); @@ -3761,53 +4252,17 @@ ImGuiWindow::~ImGuiWindow() ColumnsStorage.clear_destruct(); } -ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end) -{ - ImGuiID seed = IDStack.back(); - ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed); - ImGuiContext& g = *Ctx; - if (g.DebugHookIdInfo == id) - ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end); - return id; -} - -ImGuiID ImGuiWindow::GetID(const void* ptr) -{ - ImGuiID seed = IDStack.back(); - ImGuiID id = ImHashData(&ptr, sizeof(void*), seed); - ImGuiContext& g = *Ctx; - if (g.DebugHookIdInfo == id) - ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL); - return id; -} - -ImGuiID ImGuiWindow::GetID(int n) -{ - ImGuiID seed = IDStack.back(); - ImGuiID id = ImHashData(&n, sizeof(n), seed); - ImGuiContext& g = *Ctx; - if (g.DebugHookIdInfo == id) - ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL); - return id; -} - -// This is only used in rare/specific situations to manufacture an ID out of nowhere. -ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs) -{ - ImGuiID seed = IDStack.back(); - ImRect r_rel = ImGui::WindowRectAbsToRel(this, r_abs); - ImGuiID id = ImHashData(&r_rel, sizeof(r_rel), seed); - return id; -} - static void SetCurrentWindow(ImGuiWindow* window) { ImGuiContext& g = *GImGui; g.CurrentWindow = window; + g.StackSizesInBeginForCurrentWindow = g.CurrentWindow ? &g.CurrentWindowStack.back().StackSizesInBegin : NULL; g.CurrentTable = window && window->DC.CurrentTableIdx != -1 ? g.Tables.GetByIndex(window->DC.CurrentTableIdx) : NULL; + g.CurrentDpiScale = 1.0f; // FIXME-DPI: WIP this is modified in docking if (window) { g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize(); + g.FontScale = g.DrawListSharedData.FontScale = g.FontSize / g.Font->FontSize; ImGui::NavUpdateCurrentWindowIsScrollPushableX(); } } @@ -3817,6 +4272,8 @@ void ImGui::GcCompactTransientMiscBuffers() ImGuiContext& g = *GImGui; g.ItemFlagsStack.clear(); g.GroupStack.clear(); + g.MultiSelectTempDataStacked = 0; + g.MultiSelectTempData.clear_destruct(); TableGcCompactSettings(); } @@ -3889,6 +4346,7 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) g.ActiveIdNoClearOnFocusLoss = false; g.ActiveIdWindow = window; g.ActiveIdHasBeenEditedThisFrame = false; + g.ActiveIdFromShortcut = false; if (id) { g.ActiveIdIsAlive = id; @@ -3900,9 +4358,6 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) // (Please note that this is WIP and not all keys/inputs are thoroughly declared by all widgets yet) g.ActiveIdUsingNavDirMask = 0x00; g.ActiveIdUsingAllKeyboardKeys = false; -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - g.ActiveIdUsingNavInputMask = 0x00; -#endif } void ImGui::ClearActiveID() @@ -3925,23 +4380,12 @@ ImGuiID ImGui::GetHoveredID() return g.HoveredId ? g.HoveredId : g.HoveredIdPreviousFrame; } -// This is called by ItemAdd(). -// Code not using ItemAdd() may need to call this manually otherwise ActiveId will be cleared. In IMGUI_VERSION_NUM < 18717 this was called by GetID(). -void ImGui::KeepAliveID(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - if (g.ActiveId == id) - g.ActiveIdIsAlive = id; - if (g.ActiveIdPreviousFrame == id) - g.ActiveIdPreviousFrameIsAlive = true; -} - void ImGui::MarkItemEdited(ImGuiID id) { - // This marking is solely to be able to provide info for IsItemDeactivatedAfterEdit(). + // This marking is to be able to provide info for IsItemDeactivatedAfterEdit(). // ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need to fill the data. ImGuiContext& g = *GImGui; - if (g.LockMarkEdited > 0) + if (g.LastItemData.ItemFlags & ImGuiItemFlags_NoMarkEdited) return; if (g.ActiveId == id || g.ActiveId == 0) { @@ -3951,7 +4395,7 @@ void ImGui::MarkItemEdited(ImGuiID id) // We accept a MarkItemEdited() on drag and drop targets (see https://github.com/ocornut/imgui/issues/1875#issuecomment-978243343) // We accept 'ActiveIdPreviousFrame == id' for InputText() returning an edit after it has been taken ActiveId away (#4714) - IM_ASSERT(g.DragDropActive || g.ActiveId == id || g.ActiveId == 0 || g.ActiveIdPreviousFrame == id); + IM_ASSERT(g.DragDropActive || g.ActiveId == id || g.ActiveId == 0 || g.ActiveIdPreviousFrame == id || (g.CurrentMultiSelect != NULL && g.BoxSelectState.IsActive)); //IM_ASSERT(g.CurrentWindow->DC.LastItemId == id); g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Edited; @@ -3985,13 +4429,21 @@ bool ImGui::IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flag static inline float CalcDelayFromHoveredFlags(ImGuiHoveredFlags flags) { ImGuiContext& g = *GImGui; - if (flags & ImGuiHoveredFlags_DelayShort) - return g.Style.HoverDelayShort; if (flags & ImGuiHoveredFlags_DelayNormal) return g.Style.HoverDelayNormal; + if (flags & ImGuiHoveredFlags_DelayShort) + return g.Style.HoverDelayShort; return 0.0f; } +static ImGuiHoveredFlags ApplyHoverFlagsForTooltip(ImGuiHoveredFlags user_flags, ImGuiHoveredFlags shared_flags) +{ + // Allow instance flags to override shared flags + if (user_flags & (ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal)) + shared_flags &= ~(ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal); + return user_flags | shared_flags; +} + // This is roughly matching the behavior of internal-facing ItemHoverable() // - we allow hovering to be true when ActiveId==window->MoveID, so that clicking on non-interactive items such as a Text() item still returns true with IsItemHovered() // - this should work even for non-interactive items that have no ID, so we cannot use LastItemId @@ -3999,17 +4451,17 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - IM_ASSERT((flags & ~ImGuiHoveredFlags_AllowedMaskForIsItemHovered) == 0 && "Invalid flags for IsItemHovered()!"); + IM_ASSERT_USER_ERROR((flags & ~ImGuiHoveredFlags_AllowedMaskForIsItemHovered) == 0, "Invalid flags for IsItemHovered()!"); - if (g.NavDisableMouseHover && !g.NavDisableHighlight && !(flags & ImGuiHoveredFlags_NoNavOverride)) + if (g.NavHighlightItemUnderNav && g.NavCursorVisible && !(flags & ImGuiHoveredFlags_NoNavOverride)) { - if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled)) - return false; if (!IsItemFocused()) return false; + if ((g.LastItemData.ItemFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled)) + return false; if (flags & ImGuiHoveredFlags_ForTooltip) - flags |= g.Style.HoverFlagsForTooltipNav; + flags = ApplyHoverFlagsForTooltip(flags, g.Style.HoverFlagsForTooltipNav); } else { @@ -4019,9 +4471,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) return false; if (flags & ImGuiHoveredFlags_ForTooltip) - flags |= g.Style.HoverFlagsForTooltipMouse; - - IM_ASSERT((flags & (ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_NoPopupHierarchy)) == 0); // Flags not supported by this function + flags = ApplyHoverFlagsForTooltip(flags, g.Style.HoverFlagsForTooltipMouse); // Done with rectangle culling so we can perform heavier checks now // Test if we are hovering the right window (our window could be behind another window) @@ -4036,25 +4486,27 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) // Test if another item is active (e.g. being dragged) const ImGuiID id = g.LastItemData.ID; if ((flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) == 0) - if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId) - return false; + if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap) + if (g.ActiveId != window->MoveId) + return false; // Test if interactions on this window are blocked by an active popup or modal. // The ImGuiHoveredFlags_AllowWhenBlockedByPopup flag will be tested here. - if (!IsWindowContentHoverable(window, flags) && !(g.LastItemData.InFlags & ImGuiItemFlags_NoWindowHoverableCheck)) + if (!IsWindowContentHoverable(window, flags) && !(g.LastItemData.ItemFlags & ImGuiItemFlags_NoWindowHoverableCheck)) return false; // Test if the item is disabled - if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled)) + if ((g.LastItemData.ItemFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled)) return false; // Special handling for calling after Begin() which represent the title bar or tab. - // When the window is skipped/collapsed (SkipItems==true) that last item will never be overwritten so we need to detect the case. + // When the window is skipped/collapsed (SkipItems==true) that last item (always ->MoveId submitted by Begin) + // will never be overwritten so we need to detect the case. if (id == window->MoveId && window->WriteAccessed) return false; // Test if using AllowOverlap and overlapped - if ((g.LastItemData.InFlags & ImGuiItemFlags_AllowOverlap) && id != 0) + if ((g.LastItemData.ItemFlags & ImGuiItemFlags_AllowOverlap) && id != 0) if ((flags & ImGuiHoveredFlags_AllowWhenOverlappedByItem) == 0) if (g.HoveredIdPreviousFrame != g.LastItemData.ID) return false; @@ -4065,7 +4517,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) const float delay = CalcDelayFromHoveredFlags(flags); if (delay > 0.0f || (flags & ImGuiHoveredFlags_Stationary)) { - ImGuiID hover_delay_id = (g.LastItemData.ID != 0) ? g.LastItemData.ID : window->GetIDFromRectangle(g.LastItemData.Rect); + ImGuiID hover_delay_id = (g.LastItemData.ID != 0) ? g.LastItemData.ID : window->GetIDFromPos(g.LastItemData.Rect.Min); if ((flags & ImGuiHoveredFlags_NoSharedDelay) && (g.HoverItemDelayIdPreviousFrame != hover_delay_id)) g.HoverItemDelayTimer = 0.0f; g.HoverItemDelayId = hover_delay_id; @@ -4087,12 +4539,23 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) // (this does not rely on LastItemData it can be called from a ButtonBehavior() call not following an ItemAdd() call) // FIXME-LEGACY: the 'ImGuiItemFlags item_flags' parameter was added on 2023-06-28. // If you used this in your legacy/custom widgets code: -// - Commonly: if your ItemHoverable() call comes after an ItemAdd() call: pass 'item_flags = g.LastItemData.InFlags'. +// - Commonly: if your ItemHoverable() call comes after an ItemAdd() call: pass 'item_flags = g.LastItemData.ItemFlags'. // - Rare: otherwise you may pass 'item_flags = 0' (ImGuiItemFlags_None) unless you want to benefit from special behavior handled by ItemHoverable. bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; + + // Detect ID conflicts +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + if (id != 0 && g.HoveredIdPreviousFrame == id && (item_flags & ImGuiItemFlags_AllowDuplicateId) == 0) + { + g.HoveredIdPreviousFrameItemCount++; + if (g.DebugDrawIdConflicts == id) + window->DrawList->AddRect(bb.Min - ImVec2(1,1), bb.Max + ImVec2(1,1), IM_COL32(255, 0, 0, 255), 0.0f, ImDrawFlags_None, 2.0f); + } +#endif + if (g.HoveredWindow != window) return false; if (!IsMouseHoveringRect(bb.Min, bb.Max)) @@ -4101,12 +4564,13 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flag if (g.HoveredId != 0 && g.HoveredId != id && !g.HoveredIdAllowOverlap) return false; if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap) - return false; + if (!g.ActiveIdFromShortcut) + return false; // Done with rectangle culling so we can perform heavier checks now. if (!(item_flags & ImGuiItemFlags_NoWindowHoverableCheck) && !IsWindowContentHoverable(window, ImGuiHoveredFlags_None)) { - g.HoveredIdDisabled = true; + g.HoveredIdIsDisabled = true; return false; } @@ -4128,6 +4592,12 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flag if (g.HoveredIdPreviousFrame != id) return false; } + + // Display shortcut (only works with mouse) + // (ImGuiItemStatusFlags_HasShortcut in LastItemData denotes we want a tooltip) + if (id == g.LastItemData.ID && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasShortcut) && g.ActiveId != id) + if (IsItemHovered(ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_DelayNormal)) + SetTooltip("%s", GetKeyChordName(g.LastItemData.Shortcut)); } // When disabled we'll return false but still set HoveredId @@ -4136,36 +4606,39 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flag // Release active id if turning disabled if (g.ActiveId == id && id != 0) ClearActiveID(); - g.HoveredIdDisabled = true; + g.HoveredIdIsDisabled = true; return false; } +#ifndef IMGUI_DISABLE_DEBUG_TOOLS if (id != 0) { // [DEBUG] Item Picker tool! - // We perform the check here because SetHoveredID() is not frequently called (1~ time a frame), making - // the cost of this tool near-zero. We can get slightly better call-stack and support picking non-hovered - // items if we performed the test in ItemAdd(), but that would incur a small runtime cost. + // We perform the check here because reaching is path is rare (1~ time a frame), + // making the cost of this tool near-zero! We could get better call-stack and support picking non-hovered + // items if we performed the test in ItemAdd(), but that would incur a bigger runtime cost. if (g.DebugItemPickerActive && g.HoveredIdPreviousFrame == id) GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 255, 0, 255)); if (g.DebugItemPickerBreakId == id) IM_DEBUG_BREAK(); } +#endif - if (g.NavDisableMouseHover) + if (g.NavHighlightItemUnderNav && (item_flags & ImGuiItemFlags_NoNavDisableMouseHover) == 0) return false; return true; } // FIXME: This is inlined/duplicated in ItemAdd() +// FIXME: The id != 0 path is not used by our codebase, may get rid of it? bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (!bb.Overlaps(window->ClipRect)) - if (id == 0 || (id != g.ActiveId && id != g.NavId)) - if (!g.LogEnabled) + if (id == 0 || (id != g.ActiveId && id != g.ActiveIdPreviousFrame && id != g.NavId && id != g.NavActivateId)) + if (!g.ItemUnclipByLog) return true; return false; } @@ -4176,7 +4649,7 @@ void ImGui::SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemS { ImGuiContext& g = *GImGui; g.LastItemData.ID = item_id; - g.LastItemData.InFlags = in_flags; + g.LastItemData.ItemFlags = in_flags; g.LastItemData.StatusFlags = item_flags; g.LastItemData.Rect = g.LastItemData.NavRect = item_rect; } @@ -4208,31 +4681,62 @@ float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x) // IM_ALLOC() == ImGui::MemAlloc() void* ImGui::MemAlloc(size_t size) { + void* ptr = (*GImAllocatorAllocFunc)(size, GImAllocatorUserData); +#ifndef IMGUI_DISABLE_DEBUG_TOOLS if (ImGuiContext* ctx = GImGui) - ctx->IO.MetricsActiveAllocations++; - return (*GImAllocatorAllocFunc)(size, GImAllocatorUserData); + DebugAllocHook(&ctx->DebugAllocInfo, ctx->FrameCount, ptr, size); +#endif + return ptr; } // IM_FREE() == ImGui::MemFree() void ImGui::MemFree(void* ptr) { - if (ptr) +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + if (ptr != NULL) if (ImGuiContext* ctx = GImGui) - ctx->IO.MetricsActiveAllocations--; + DebugAllocHook(&ctx->DebugAllocInfo, ctx->FrameCount, ptr, (size_t)-1); +#endif return (*GImAllocatorFreeFunc)(ptr, GImAllocatorUserData); } +// We record the number of allocation in recent frames, as a way to audit/sanitize our guiding principles of "no allocations on idle/repeating frames" +void ImGui::DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr, size_t size) +{ + ImGuiDebugAllocEntry* entry = &info->LastEntriesBuf[info->LastEntriesIdx]; + IM_UNUSED(ptr); + if (entry->FrameCount != frame_count) + { + info->LastEntriesIdx = (info->LastEntriesIdx + 1) % IM_ARRAYSIZE(info->LastEntriesBuf); + entry = &info->LastEntriesBuf[info->LastEntriesIdx]; + entry->FrameCount = frame_count; + entry->AllocCount = entry->FreeCount = 0; + } + if (size != (size_t)-1) + { + entry->AllocCount++; + info->TotalAllocCount++; + //printf("[%05d] MemAlloc(%d) -> 0x%p\n", frame_count, size, ptr); + } + else + { + entry->FreeCount++; + info->TotalFreeCount++; + //printf("[%05d] MemFree(0x%p)\n", frame_count, ptr); + } +} + const char* ImGui::GetClipboardText() { ImGuiContext& g = *GImGui; - return g.IO.GetClipboardTextFn ? g.IO.GetClipboardTextFn(g.IO.ClipboardUserData) : ""; + return g.PlatformIO.Platform_GetClipboardTextFn ? g.PlatformIO.Platform_GetClipboardTextFn(&g) : ""; } void ImGui::SetClipboardText(const char* text) { ImGuiContext& g = *GImGui; - if (g.IO.SetClipboardTextFn) - g.IO.SetClipboardTextFn(g.IO.ClipboardUserData, text); + if (g.PlatformIO.Platform_SetClipboardTextFn != NULL) + g.PlatformIO.Platform_SetClipboardTextFn(&g, text); } const char* ImGui::GetVersion() @@ -4246,6 +4750,12 @@ ImGuiIO& ImGui::GetIO() return GImGui->IO; } +ImGuiPlatformIO& ImGui::GetPlatformIO() +{ + IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext()?"); + return GImGui->PlatformIO; +} + // Pass this to your backend rendering function! Valid after Render() and until the next call to NewFrame() ImDrawData* ImGui::GetDrawData() { @@ -4323,7 +4833,8 @@ void ImGui::StartMouseMovingWindow(ImGuiWindow* window) ImGuiContext& g = *GImGui; FocusWindow(window); SetActiveID(window->MoveId, window); - g.NavDisableHighlight = true; + if (g.IO.ConfigNavCursorVisibleAuto) + g.NavCursorVisible = false; g.ActiveIdClickOffset = g.IO.MouseClickedPos[0] - window->RootWindow->Pos; g.ActiveIdNoClearOnFocusLoss = true; SetActiveIdUsingAllKeyboardKeys(); @@ -4374,12 +4885,13 @@ void ImGui::UpdateMouseMovingWindowNewFrame() } } -// Initiate moving window when clicking on empty space or title bar. +// Initiate focusing and moving window when clicking on empty space or title bar. +// Initiate focusing window when clicking on a disabled item. // Handle left-click and right-click focus. void ImGui::UpdateMouseMovingWindowEndFrame() { ImGuiContext& g = *GImGui; - if (g.ActiveId != 0 || g.HoveredId != 0) + if (g.ActiveId != 0 || (g.HoveredId != 0 && !g.HoveredIdIsDisabled)) return; // Unless we just made a window/popup appear @@ -4400,12 +4912,14 @@ void ImGui::UpdateMouseMovingWindowEndFrame() StartMouseMovingWindow(g.HoveredWindow); //-V595 // Cancel moving if clicked outside of title bar - if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(root_window->Flags & ImGuiWindowFlags_NoTitleBar)) - if (!root_window->TitleBarRect().Contains(g.IO.MouseClickedPos[0])) - g.MovingWindow = NULL; - - // Cancel moving if clicked over an item which was disabled or inhibited by popups (note that we know HoveredId == 0 already) - if (g.HoveredIdDisabled) + if (g.IO.ConfigWindowsMoveFromTitleBarOnly) + if (!(root_window->Flags & ImGuiWindowFlags_NoTitleBar)) + if (!root_window->TitleBarRect().Contains(g.IO.MouseClickedPos[0])) + g.MovingWindow = NULL; + + // Cancel moving if clicked over an item which was disabled or inhibited by popups + // (when g.HoveredIdIsDisabled == true && g.HoveredId == 0 we are inhibited by popups, when g.HoveredIdIsDisabled == true && g.HoveredId != 0 we are over a disabled item)0 already) + if (g.HoveredIdIsDisabled) g.MovingWindow = NULL; } else if (root_window == NULL && g.NavWindow != NULL) @@ -4418,7 +4932,7 @@ void ImGui::UpdateMouseMovingWindowEndFrame() // With right mouse button we close popups without changing focus based on where the mouse is aimed // Instead, focus will be restored to the window under the bottom-most closed popup. // (The left mouse button path calls FocusWindow on the hovered window, which will lead NewFrame->ClosePopupsOverWindow to trigger) - if (g.IO.MouseClicked[1]) + if (g.IO.MouseClicked[1] && g.HoveredId == 0) { // Find the top-most window between HoveredWindow and the top-most Modal Window. // This is where we can trim the popup stack. @@ -4438,6 +4952,9 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags() { ImGuiContext& g = *GImGui; ImGuiIO& io = g.IO; + + // FIXME-DPI: This storage was added on 2021/03/31 for test engine, but if we want to multiply WINDOWS_HOVER_PADDING + // by DpiScale, we need to make this window-agnostic anyhow, maybe need storing inside ImGuiWindow. g.WindowsHoverPadding = ImMax(g.Style.TouchExtraPadding, ImVec2(WINDOWS_HOVER_PADDING, WINDOWS_HOVER_PADDING)); // Find the window hovered by mouse: @@ -4445,14 +4962,15 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags() // - When moving a window we can skip the search, which also conveniently bypasses the fact that window->WindowRectClipped is lagging as this point of the frame. // - We also support the moved window toggling the NoInputs flag after moving has started in order to be able to detect windows below it, which is useful for e.g. docking mechanisms. bool clear_hovered_windows = false; - FindHoveredWindow(); + FindHoveredWindowEx(g.IO.MousePos, false, &g.HoveredWindow, &g.HoveredWindowUnderMovingWindow); + g.HoveredWindowBeforeClear = g.HoveredWindow; // Modal windows prevents mouse from hovering behind them. ImGuiWindow* modal_window = GetTopMostPopupModal(); if (modal_window && g.HoveredWindow && !IsWindowWithinBeginStackOf(g.HoveredWindow->RootWindow, modal_window)) clear_hovered_windows = true; - // Disabled mouse? + // Disabled mouse hovering (we don't currently clear MousePos, we could) if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) clear_hovered_windows = true; @@ -4470,7 +4988,7 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags() io.MouseDownOwnedUnlessPopupClose[i] = (g.HoveredWindow != NULL) || has_open_modal; } mouse_any_down |= io.MouseDown[i]; - if (io.MouseDown[i]) + if (io.MouseDown[i] || io.MouseReleased[i]) // Increase release frame for our evaluation of earliest button (#1392) if (mouse_earliest_down == -1 || io.MouseClickedTime[i] < io.MouseClickedTime[mouse_earliest_down]) mouse_earliest_down = i; } @@ -4499,17 +5017,42 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags() } // Update io.WantCaptureKeyboard for the user application (true = dispatch keyboard info to Dear ImGui only, false = dispatch keyboard info to Dear ImGui + underlying app) - if (g.WantCaptureKeyboardNextFrame != -1) + io.WantCaptureKeyboard = false; + if ((io.ConfigFlags & ImGuiConfigFlags_NoKeyboard) == 0) + { + if ((g.ActiveId != 0) || (modal_window != NULL)) + io.WantCaptureKeyboard = true; + else if (io.NavActive && (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && io.ConfigNavCaptureKeyboard) + io.WantCaptureKeyboard = true; + } + if (g.WantCaptureKeyboardNextFrame != -1) // Manual override io.WantCaptureKeyboard = (g.WantCaptureKeyboardNextFrame != 0); - else - io.WantCaptureKeyboard = (g.ActiveId != 0) || (modal_window != NULL); - if (io.NavActive && (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && !(io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard)) - io.WantCaptureKeyboard = true; // Update io.WantTextInput flag, this is to allow systems without a keyboard (e.g. mobile, hand-held) to show a software keyboard if possible io.WantTextInput = (g.WantTextInputNextFrame != -1) ? (g.WantTextInputNextFrame != 0) : false; } +// Calling SetupDrawListSharedData() is followed by SetCurrentFont() which sets up the remaining data. +static void SetupDrawListSharedData() +{ + ImGuiContext& g = *GImGui; + ImRect virtual_space(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX); + for (ImGuiViewportP* viewport : g.Viewports) + virtual_space.Add(viewport->GetMainRect()); + g.DrawListSharedData.ClipRectFullscreen = virtual_space.ToVec4(); + g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol; + g.DrawListSharedData.SetCircleTessellationMaxError(g.Style.CircleTessellationMaxError); + g.DrawListSharedData.InitialFlags = ImDrawListFlags_None; + if (g.Style.AntiAliasedLines) + g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLines; + if (g.Style.AntiAliasedLinesUseTex && !(g.IO.Fonts->Flags & ImFontAtlasFlags_NoBakedLines)) + g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLinesUseTex; + if (g.Style.AntiAliasedFill) + g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill; + if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) + g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset; +} + void ImGui::NewFrame() { IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?"); @@ -4552,23 +5095,9 @@ void ImGui::NewFrame() // Setup current font and draw list shared data g.IO.Fonts->Locked = true; + SetupDrawListSharedData(); SetCurrentFont(GetDefaultFont()); IM_ASSERT(g.Font->IsLoaded()); - ImRect virtual_space(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX); - for (ImGuiViewportP* viewport : g.Viewports) - virtual_space.Add(viewport->GetMainRect()); - g.DrawListSharedData.ClipRectFullscreen = virtual_space.ToVec4(); - g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol; - g.DrawListSharedData.SetCircleTessellationMaxError(g.Style.CircleTessellationMaxError); - g.DrawListSharedData.InitialFlags = ImDrawListFlags_None; - if (g.Style.AntiAliasedLines) - g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLines; - if (g.Style.AntiAliasedLinesUseTex && !(g.Font->ContainerAtlas->Flags & ImFontAtlasFlags_NoBakedLines)) - g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLinesUseTex; - if (g.Style.AntiAliasedFill) - g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill; - if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) - g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset; // Mark rendering data as invalid to prevent user who may have a handle on it to use it. for (ImGuiViewportP* viewport : g.Viewports) @@ -4578,6 +5107,12 @@ void ImGui::NewFrame() if (g.DragDropActive && g.DragDropPayload.SourceId == g.ActiveId) KeepAliveID(g.DragDropPayload.SourceId); + // [DEBUG] + if (!g.IO.ConfigDebugHighlightIdConflicts || !g.IO.KeyCtrl) // Count is locked while holding CTRL + g.DebugDrawIdConflicts = 0; + if (g.IO.ConfigDebugHighlightIdConflicts && g.HoveredIdPreviousFrameItemCount > 1) + g.DebugDrawIdConflicts = g.HoveredIdPreviousFrame; + // Update HoveredId data if (!g.HoveredIdPreviousFrame) g.HoveredIdTimer = 0.0f; @@ -4588,9 +5123,10 @@ void ImGui::NewFrame() if (g.HoveredId && g.ActiveId != g.HoveredId) g.HoveredIdNotActiveTimer += g.IO.DeltaTime; g.HoveredIdPreviousFrame = g.HoveredId; + g.HoveredIdPreviousFrameItemCount = 0; g.HoveredId = 0; g.HoveredIdAllowOverlap = false; - g.HoveredIdDisabled = false; + g.HoveredIdIsDisabled = false; // Clear ActiveID if the item is not alive anymore. // In 1.87, the common most call to KeepAliveID() was moved from GetID() to ItemAdd(). @@ -4618,24 +5154,7 @@ void ImGui::NewFrame() { g.ActiveIdUsingNavDirMask = 0x00; g.ActiveIdUsingAllKeyboardKeys = false; -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - g.ActiveIdUsingNavInputMask = 0x00; -#endif - } - -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - if (g.ActiveId == 0) - g.ActiveIdUsingNavInputMask = 0; - else if (g.ActiveIdUsingNavInputMask != 0) - { - // If your custom widget code used: { g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel); } - // Since IMGUI_VERSION_NUM >= 18804 it should be: { SetKeyOwner(ImGuiKey_Escape, g.ActiveId); SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId); } - if (g.ActiveIdUsingNavInputMask & (1 << ImGuiNavInput_Cancel)) - SetKeyOwner(ImGuiKey_Escape, g.ActiveId); - if (g.ActiveIdUsingNavInputMask & ~(1 << ImGuiNavInput_Cancel)) - IM_ASSERT(0); // Other values unsupported } -#endif // Record when we have been stationary as this state is preserved while over same item. // FIXME: The way this is expressed means user cannot alter HoverStationaryDelay during the frame to use varying values. @@ -4673,6 +5192,7 @@ void ImGui::NewFrame() g.DragDropWithinSource = false; g.DragDropWithinTarget = false; g.DragDropHoldJustPressedId = 0; + g.TooltipPreviousWindow = NULL; // Close popups on focus lost (currently wip/opt-in) //if (g.IO.AppFocusLost) @@ -4686,14 +5206,31 @@ void ImGui::NewFrame() //IM_ASSERT(g.IO.KeyAlt == IsKeyDown(ImGuiKey_LeftAlt) || IsKeyDown(ImGuiKey_RightAlt)); //IM_ASSERT(g.IO.KeySuper == IsKeyDown(ImGuiKey_LeftSuper) || IsKeyDown(ImGuiKey_RightSuper)); - // Update gamepad/keyboard navigation + // Update keyboard/gamepad navigation NavUpdate(); // Update mouse input state UpdateMouseInputs(); + // Mark all windows as not visible and compact unused memory. + IM_ASSERT(g.WindowsFocusOrder.Size <= g.Windows.Size); + const float memory_compact_start_time = (g.GcCompactAll || g.IO.ConfigMemoryCompactTimer < 0.0f) ? FLT_MAX : (float)g.Time - g.IO.ConfigMemoryCompactTimer; + for (ImGuiWindow* window : g.Windows) + { + window->WasActive = window->Active; + window->Active = false; + window->WriteAccessed = false; + window->BeginCountPreviousFrame = window->BeginCount; + window->BeginCount = 0; + + // Garbage collect transient buffers of recently unused windows + if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time) + GcCompactTransientWindowBuffers(window); + } + // Find hovered window // (needs to be before UpdateMouseMovingWindowNewFrame so we fill g.HoveredWindowUnderMovingWindow on the mouse release frame) + // (currently needs to be done after the WasActive=Active loop and FindHoveredWindowEx uses ->Active) UpdateHoveredWindowAndCaptureFlags(); // Handle user moving window with mouse (at the beginning of the frame to avoid input lag or sheering) @@ -4715,22 +5252,6 @@ void ImGui::NewFrame() // Mouse wheel scrolling, scale UpdateMouseWheel(); - // Mark all windows as not visible and compact unused memory. - IM_ASSERT(g.WindowsFocusOrder.Size <= g.Windows.Size); - const float memory_compact_start_time = (g.GcCompactAll || g.IO.ConfigMemoryCompactTimer < 0.0f) ? FLT_MAX : (float)g.Time - g.IO.ConfigMemoryCompactTimer; - for (ImGuiWindow* window : g.Windows) - { - window->WasActive = window->Active; - window->Active = false; - window->WriteAccessed = false; - window->BeginCountPreviousFrame = window->BeginCount; - window->BeginCount = 0; - - // Garbage collect transient buffers of recently unused windows - if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time) - GcCompactTransientWindowBuffers(window); - } - // Garbage collect transient buffers of recently unused tables for (int i = 0; i < g.TablesLastTimeActive.Size; i++) if (g.TablesLastTimeActive[i] >= 0.0f && g.TablesLastTimeActive[i] < memory_compact_start_time) @@ -4751,19 +5272,27 @@ void ImGui::NewFrame() g.CurrentWindowStack.resize(0); g.BeginPopupStack.resize(0); g.ItemFlagsStack.resize(0); - g.ItemFlagsStack.push_back(ImGuiItemFlags_None); + g.ItemFlagsStack.push_back(ImGuiItemFlags_AutoClosePopups); // Default flags + g.CurrentItemFlags = g.ItemFlagsStack.back(); g.GroupStack.resize(0); // [DEBUG] Update debug features +#ifndef IMGUI_DISABLE_DEBUG_TOOLS UpdateDebugToolItemPicker(); UpdateDebugToolStackQueries(); + UpdateDebugToolFlashStyleColor(); if (g.DebugLocateFrames > 0 && --g.DebugLocateFrames == 0) + { g.DebugLocateId = 0; - if (g.DebugLogClipperAutoDisableFrames > 0 && --g.DebugLogClipperAutoDisableFrames == 0) + g.DebugBreakInLocateId = false; + } + if (g.DebugLogAutoDisableFrames > 0 && --g.DebugLogAutoDisableFrames == 0) { - DebugLog("(Auto-disabled ImGuiDebugLogFlags_EventClipper to avoid spamming)\n"); - g.DebugLogFlags &= ~ImGuiDebugLogFlags_EventClipper; + DebugLog("(Debug Log: Auto-disabled some ImGuiDebugLogFlags after 2 frames)\n"); + g.DebugLogFlags &= ~g.DebugLogAutoDisableFlags; + g.DebugLogAutoDisableFlags = ImGuiDebugLogFlags_None; } +#endif // Create implicit/fallback window - which we will only render it if the user has added something to it. // We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags. @@ -4773,12 +5302,18 @@ void ImGui::NewFrame() Begin("Debug##Default"); IM_ASSERT(g.CurrentWindow->IsFallbackWindow == true); + // Store stack sizes + g.ErrorCountCurrentFrame = 0; + ErrorRecoveryStoreState(&g.StackSizesInNewFrame); + // [DEBUG] When io.ConfigDebugBeginReturnValue is set, we make Begin()/BeginChild() return false at different level of the window-stack, // allowing to validate correct Begin/End behavior in user code. +#ifndef IMGUI_DISABLE_DEBUG_TOOLS if (g.IO.ConfigDebugBeginReturnValueLoop) g.DebugBeginReturnValueCullDepth = (g.DebugBeginReturnValueCullDepth == -1) ? 0 : ((g.DebugBeginReturnValueCullDepth + ((g.FrameCount % 4) == 0 ? 1 : 0)) % 10); else g.DebugBeginReturnValueCullDepth = -1; +#endif CallContextHooks(&g, ImGuiContextHookType_NewFramePost); } @@ -4878,6 +5413,8 @@ static void InitViewportDrawData(ImGuiViewportP* viewport) // - If the code here changes, may need to update code of functions like NextColumn() and PushColumnClipRect(): // some frequently called functions which to modify both channels and clipping simultaneously tend to use the // more specialized SetWindowClipRectBeforeSetChannel() to avoid extraneous updates of underlying ImDrawCmds. +// - This is analoguous to PushFont()/PopFont() in the sense that are a mixing a global stack and a window stack, +// which in the case of ClipRect is not so problematic but tends to be more restrictive for fonts. void ImGui::PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect) { ImGuiWindow* window = GetCurrentWindow(); @@ -4951,11 +5488,11 @@ static void ImGui::RenderDimmedBackgrounds() { // Draw dimming behind modal or a begin stack child, whichever comes first in draw order. ImGuiWindow* dim_behind_window = FindBottomMostVisibleWindowWithinBeginStack(modal_window); - RenderDimmedBackgroundBehindWindow(dim_behind_window, GetColorU32(ImGuiCol_ModalWindowDimBg, g.DimBgRatio)); + RenderDimmedBackgroundBehindWindow(dim_behind_window, GetColorU32(modal_window->DC.ModalDimBgColor, g.DimBgRatio)); } else if (dim_bg_for_window_list) { - // Draw dimming behind CTRL+Tab target window + // Draw dimming behind CTRL+Tab target window and behind CTRL+Tab UI window RenderDimmedBackgroundBehindWindow(g.NavWindowingTargetAnim, GetColorU32(ImGuiCol_NavWindowingDimBg, g.DimBgRatio)); // Draw border around CTRL+Tab target window @@ -4987,26 +5524,19 @@ void ImGui::EndFrame() CallContextHooks(&g, ImGuiContextHookType_EndFramePre); + // [EXPERIMENTAL] Recover from errors + if (g.IO.ConfigErrorRecovery) + ErrorRecoveryTryToRecoverState(&g.StackSizesInNewFrame); ErrorCheckEndFrameSanityChecks(); + ErrorCheckEndFrameFinalizeErrorTooltip(); // Notify Platform/OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME) ImGuiPlatformImeData* ime_data = &g.PlatformImeData; - if (g.IO.SetPlatformImeDataFn && memcmp(ime_data, &g.PlatformImeDataPrev, sizeof(ImGuiPlatformImeData)) != 0) + if (g.PlatformIO.Platform_SetImeDataFn != NULL && memcmp(ime_data, &g.PlatformImeDataPrev, sizeof(ImGuiPlatformImeData)) != 0) { - IMGUI_DEBUG_LOG_IO("[io] Calling io.SetPlatformImeDataFn(): WantVisible: %d, InputPos (%.2f,%.2f)\n", ime_data->WantVisible, ime_data->InputPos.x, ime_data->InputPos.y); + IMGUI_DEBUG_LOG_IO("[io] Calling Platform_SetImeDataFn(): WantVisible: %d, InputPos (%.2f,%.2f)\n", ime_data->WantVisible, ime_data->InputPos.x, ime_data->InputPos.y); ImGuiViewport* viewport = GetMainViewport(); -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - if (viewport->PlatformHandleRaw == NULL && g.IO.ImeWindowHandle != NULL) - { - viewport->PlatformHandleRaw = g.IO.ImeWindowHandle; - g.IO.SetPlatformImeDataFn(viewport, ime_data); - viewport->PlatformHandleRaw = NULL; - } - else -#endif - { - g.IO.SetPlatformImeDataFn(viewport, ime_data); - } + g.PlatformIO.Platform_SetImeDataFn(&g, viewport, ime_data); } // Hide implicit/fallback "Debug" window if it hasn't been used @@ -5022,13 +5552,17 @@ void ImGui::EndFrame() if (g.DragDropActive) { bool is_delivered = g.DragDropPayload.Delivery; - bool is_elapsed = (g.DragDropPayload.DataFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton)); + bool is_elapsed = (g.DragDropSourceFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_PayloadAutoExpire) || g.DragDropMouseButton == -1 || !IsMouseDown(g.DragDropMouseButton)); if (is_delivered || is_elapsed) ClearDragDrop(); } - // Drag and Drop: Fallback for source tooltip. This is not ideal but better than nothing. - if (g.DragDropActive && g.DragDropSourceFrameCount < g.FrameCount && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) + // Drag and Drop: Fallback for missing source tooltip. This is not ideal but better than nothing. + // If you want to handle source item disappearing: instead of submitting your description tooltip + // in the BeginDragDropSource() block of the dragged item, you can submit them from a safe single spot + // (e.g. end of your item loop, or before EndFrame) by reading payload data. + // In the typical case, the contents of drag tooltip should be possible to infer solely from payload data. + if (g.DragDropActive && g.DragDropSourceFrameCount + 1 < g.FrameCount && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) { g.DragDropWithinSource = true; SetTooltip("..."); @@ -5062,6 +5596,7 @@ void ImGui::EndFrame() g.IO.Fonts->Locked = false; // Clear Input data for next frame + g.IO.MousePosPrev = g.IO.MousePos; g.IO.AppFocusLost = false; g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f; g.IO.InputQueueCharacters.resize(0); @@ -5086,9 +5621,6 @@ void ImGui::Render() g.IO.MetricsRenderWindows = 0; CallContextHooks(&g, ImGuiContextHookType_RenderPre); - // Draw modal/window whitening backgrounds - RenderDimmedBackgrounds(); - // Add background ImDrawList (for each active viewport) for (ImGuiViewportP* viewport : g.Viewports) { @@ -5097,6 +5629,9 @@ void ImGui::Render() AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport)); } + // Draw modal/window whitening backgrounds + RenderDimmedBackgrounds(); + // Add ImDrawList to render ImGuiWindow* windows_to_render_top_most[2]; windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL; @@ -5161,22 +5696,24 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex // FIXME: Investigate using ceilf or e.g. // - https://git.musl-libc.org/cgit/musl/tree/src/math/ceilf.c // - https://embarkstudios.github.io/rust-gpu/api/src/libm/math/ceilf.rs.html - text_size.x = IM_FLOOR(text_size.x + 0.99999f); + text_size.x = IM_TRUNC(text_size.x + 0.99999f); return text_size; } // Find window given position, search front-to-back -// FIXME: Note that we have an inconsequential lag here: OuterRectClipped is updated in Begin(), so windows moved programmatically -// with SetWindowPos() and not SetNextWindowPos() will have that rectangle lagging by a frame at the time FindHoveredWindow() is -// called, aka before the next Begin(). Moving window isn't affected. -static void FindHoveredWindow() +// - Typically write output back to g.HoveredWindow and g.HoveredWindowUnderMovingWindow. +// - FIXME: Note that we have an inconsequential lag here: OuterRectClipped is updated in Begin(), so windows moved programmatically +// with SetWindowPos() and not SetNextWindowPos() will have that rectangle lagging by a frame at the time FindHoveredWindow() is +// called, aka before the next Begin(). Moving window isn't affected. +// - The 'find_first_and_in_any_viewport = true' mode is only used by TestEngine. It is simpler to maintain here. +void ImGui::FindHoveredWindowEx(const ImVec2& pos, bool find_first_and_in_any_viewport, ImGuiWindow** out_hovered_window, ImGuiWindow** out_hovered_window_under_moving_window) { ImGuiContext& g = *GImGui; - ImGuiWindow* hovered_window = NULL; - ImGuiWindow* hovered_window_ignoring_moving_window = NULL; - if (g.MovingWindow && !(g.MovingWindow->Flags & ImGuiWindowFlags_NoMouseInputs)) + ImGuiWindow* hovered_window_under_moving_window = NULL; + + if (find_first_and_in_any_viewport == false && g.MovingWindow && !(g.MovingWindow->Flags & ImGuiWindowFlags_NoMouseInputs)) hovered_window = g.MovingWindow; ImVec2 padding_regular = g.Style.TouchExtraPadding; @@ -5185,18 +5722,14 @@ static void FindHoveredWindow() { ImGuiWindow* window = g.Windows[i]; IM_MSVC_WARNING_SUPPRESS(28182); // [Static Analyzer] Dereferencing NULL pointer. - if (!window->Active || window->Hidden) + if (!window->WasActive || window->Hidden) continue; if (window->Flags & ImGuiWindowFlags_NoMouseInputs) continue; // Using the clipped AABB, a child window will typically be clipped by its parent (not always) - ImRect bb(window->OuterRectClipped); - if (window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize)) - bb.Expand(padding_regular); - else - bb.Expand(padding_for_resize); - if (!bb.Contains(g.IO.MousePos)) + ImVec2 hit_padding = (window->Flags & (ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize)) ? padding_regular : padding_for_resize; + if (!window->OuterRectClipped.ContainsWithPad(pos, hit_padding)) continue; // Support for one rectangular hole in any given window @@ -5205,21 +5738,30 @@ static void FindHoveredWindow() { ImVec2 hole_pos(window->Pos.x + (float)window->HitTestHoleOffset.x, window->Pos.y + (float)window->HitTestHoleOffset.y); ImVec2 hole_size((float)window->HitTestHoleSize.x, (float)window->HitTestHoleSize.y); - if (ImRect(hole_pos, hole_pos + hole_size).Contains(g.IO.MousePos)) + if (ImRect(hole_pos, hole_pos + hole_size).Contains(pos)) continue; } - if (hovered_window == NULL) + if (find_first_and_in_any_viewport) + { hovered_window = window; - IM_MSVC_WARNING_SUPPRESS(28182); // [Static Analyzer] Dereferencing NULL pointer. - if (hovered_window_ignoring_moving_window == NULL && (!g.MovingWindow || window->RootWindow != g.MovingWindow->RootWindow)) - hovered_window_ignoring_moving_window = window; - if (hovered_window && hovered_window_ignoring_moving_window) break; + } + else + { + if (hovered_window == NULL) + hovered_window = window; + IM_MSVC_WARNING_SUPPRESS(28182); // [Static Analyzer] Dereferencing NULL pointer. + if (hovered_window_under_moving_window == NULL && (!g.MovingWindow || window->RootWindow != g.MovingWindow->RootWindow)) + hovered_window_under_moving_window = window; + if (hovered_window && hovered_window_under_moving_window) + break; + } } - g.HoveredWindow = hovered_window; - g.HoveredWindowUnderMovingWindow = hovered_window_ignoring_moving_window; + *out_hovered_window = hovered_window; + if (out_hovered_window_under_moving_window != NULL) + *out_hovered_window_under_moving_window = hovered_window_under_moving_window; } bool ImGui::IsItemActive() @@ -5257,9 +5799,7 @@ bool ImGui::IsItemDeactivatedAfterEdit() bool ImGui::IsItemFocused() { ImGuiContext& g = *GImGui; - if (g.NavId != g.LastItemData.ID || g.NavId == 0) - return false; - return true; + return g.NavId == g.LastItemData.ID && g.NavId != 0; } // Important: this can be useful but it is NOT equivalent to the behavior of e.g.Button()! @@ -5275,12 +5815,21 @@ bool ImGui::IsItemToggledOpen() return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_ToggledOpen) ? true : false; } +// Call after a Selectable() or TreeNode() involved in multi-selection. +// Useful if you need the per-item information before reaching EndMultiSelect(), e.g. for rendering purpose. +// This is only meant to be called inside a BeginMultiSelect()/EndMultiSelect() block. +// (Outside of multi-select, it would be misleading/ambiguous to report this signal, as widgets +// return e.g. a pressed event and user code is in charge of altering selection in ways we cannot predict.) bool ImGui::IsItemToggledSelection() { ImGuiContext& g = *GImGui; + IM_ASSERT(g.CurrentMultiSelect != NULL); // Can only be used inside a BeginMultiSelect()/EndMultiSelect() return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_ToggledSelection) ? true : false; } +// IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app, +// you should not use this function! Use the 'io.WantCaptureMouse' boolean for that! +// Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details. bool ImGui::IsAnyItemHovered() { ImGuiContext& g = *GImGui; @@ -5296,7 +5845,7 @@ bool ImGui::IsAnyItemActive() bool ImGui::IsAnyItemFocused() { ImGuiContext& g = *GImGui; - return g.NavId != 0 && !g.NavDisableHighlight; + return g.NavId != 0 && g.NavCursorVisible; } bool ImGui::IsItemVisible() @@ -5334,7 +5883,8 @@ void ImGui::SetItemAllowOverlap() } #endif -// FIXME: It might be undesirable that this will likely disable KeyOwner-aware shortcuts systems. Consider a more fine-tuned version for the two users of this function. +// This is a shortcut for not taking ownership of 100+ keys, frequently used by drag operations. +// FIXME: It might be undesirable that this will likely disable KeyOwner-aware shortcuts systems. Consider a more fine-tuned version if needed? void ImGui::SetActiveIdUsingAllKeyboardKeys() { ImGuiContext& g = *GImGui; @@ -5368,40 +5918,124 @@ ImVec2 ImGui::GetItemRectSize() return g.LastItemData.Rect.GetSize(); } -bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags) +// Prior to v1.90 2023/10/16, the BeginChild() function took a 'bool border = false' parameter instead of 'ImGuiChildFlags child_flags = 0'. +// ImGuiChildFlags_Borders is defined as always == 1 in order to allow old code passing 'true'. Read comments in imgui.h for details! +bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags) +{ + ImGuiID id = GetCurrentWindow()->GetID(str_id); + return BeginChildEx(str_id, id, size_arg, child_flags, window_flags); +} + +bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags) +{ + return BeginChildEx(NULL, id, size_arg, child_flags, window_flags); +} + +bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags) { ImGuiContext& g = *GImGui; ImGuiWindow* parent_window = g.CurrentWindow; + IM_ASSERT(id != 0); - flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_ChildWindow; - flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag - - // Size - const ImVec2 content_avail = GetContentRegionAvail(); - ImVec2 size = ImFloor(size_arg); - const int auto_fit_axises = ((size.x == 0.0f) ? (1 << ImGuiAxis_X) : 0x00) | ((size.y == 0.0f) ? (1 << ImGuiAxis_Y) : 0x00); - if (size.x <= 0.0f) - size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too many issues) - if (size.y <= 0.0f) - size.y = ImMax(content_avail.y + size.y, 4.0f); + // Sanity check as it is likely that some user will accidentally pass ImGuiWindowFlags into the ImGuiChildFlags argument. + const ImGuiChildFlags ImGuiChildFlags_SupportedMask_ = ImGuiChildFlags_Borders | ImGuiChildFlags_AlwaysUseWindowPadding | ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY | ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize | ImGuiChildFlags_FrameStyle | ImGuiChildFlags_NavFlattened; + IM_UNUSED(ImGuiChildFlags_SupportedMask_); + IM_ASSERT((child_flags & ~ImGuiChildFlags_SupportedMask_) == 0 && "Illegal ImGuiChildFlags value. Did you pass ImGuiWindowFlags values instead of ImGuiChildFlags?"); + IM_ASSERT((window_flags & ImGuiWindowFlags_AlwaysAutoResize) == 0 && "Cannot specify ImGuiWindowFlags_AlwaysAutoResize for BeginChild(). Use ImGuiChildFlags_AlwaysAutoResize!"); + if (child_flags & ImGuiChildFlags_AlwaysAutoResize) + { + IM_ASSERT((child_flags & (ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY)) == 0 && "Cannot use ImGuiChildFlags_ResizeX or ImGuiChildFlags_ResizeY with ImGuiChildFlags_AlwaysAutoResize!"); + IM_ASSERT((child_flags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY)) != 0 && "Must use ImGuiChildFlags_AutoResizeX or ImGuiChildFlags_AutoResizeY with ImGuiChildFlags_AlwaysAutoResize!"); + } +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + if (window_flags & ImGuiWindowFlags_AlwaysUseWindowPadding) + child_flags |= ImGuiChildFlags_AlwaysUseWindowPadding; + if (window_flags & ImGuiWindowFlags_NavFlattened) + child_flags |= ImGuiChildFlags_NavFlattened; +#endif + if (child_flags & ImGuiChildFlags_AutoResizeX) + child_flags &= ~ImGuiChildFlags_ResizeX; + if (child_flags & ImGuiChildFlags_AutoResizeY) + child_flags &= ~ImGuiChildFlags_ResizeY; + + // Set window flags + window_flags |= ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_NoTitleBar; + window_flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag + if (child_flags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize)) + window_flags |= ImGuiWindowFlags_AlwaysAutoResize; + if ((child_flags & (ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY)) == 0) + window_flags |= ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings; + + // Special framed style + if (child_flags & ImGuiChildFlags_FrameStyle) + { + PushStyleColor(ImGuiCol_ChildBg, g.Style.Colors[ImGuiCol_FrameBg]); + PushStyleVar(ImGuiStyleVar_ChildRounding, g.Style.FrameRounding); + PushStyleVar(ImGuiStyleVar_ChildBorderSize, g.Style.FrameBorderSize); + PushStyleVar(ImGuiStyleVar_WindowPadding, g.Style.FramePadding); + child_flags |= ImGuiChildFlags_Borders | ImGuiChildFlags_AlwaysUseWindowPadding; + window_flags |= ImGuiWindowFlags_NoMove; + } + + // Forward size + // Important: Begin() has special processing to switch condition to ImGuiCond_FirstUseEver for a given axis when ImGuiChildFlags_ResizeXXX is set. + // (the alternative would to store conditional flags per axis, which is possible but more code) + const ImVec2 size_avail = GetContentRegionAvail(); + const ImVec2 size_default((child_flags & ImGuiChildFlags_AutoResizeX) ? 0.0f : size_avail.x, (child_flags & ImGuiChildFlags_AutoResizeY) ? 0.0f : size_avail.y); + ImVec2 size = CalcItemSize(size_arg, size_default.x, size_default.y); + + // A SetNextWindowSize() call always has priority (#8020) + // (since the code in Begin() never supported SizeVal==0.0f aka auto-resize via SetNextWindowSize() call, we don't support it here for now) + // FIXME: We only support ImGuiCond_Always in this path. Supporting other paths would requires to obtain window pointer. + if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) != 0 && (g.NextWindowData.SizeCond & ImGuiCond_Always) != 0) + { + if (g.NextWindowData.SizeVal.x > 0.0f) + { + size.x = g.NextWindowData.SizeVal.x; + child_flags &= ~ImGuiChildFlags_ResizeX; + } + if (g.NextWindowData.SizeVal.y > 0.0f) + { + size.y = g.NextWindowData.SizeVal.y; + child_flags &= ~ImGuiChildFlags_ResizeY; + } + } SetNextWindowSize(size); + // Forward child flags + g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasChildFlags; + g.NextWindowData.ChildFlags = child_flags; + // Build up name. If you need to append to a same child from multiple location in the ID stack, use BeginChild(ImGuiID id) with a stable value. + // FIXME: 2023/11/14: commented out shorted version. We had an issue with multiple ### in child window path names, which the trailing hash helped workaround. + // e.g. "ParentName###ParentIdentifier/ChildName###ChildIdentifier" would get hashed incorrectly by ImHashStr(), trailing _%08X somehow fixes it. const char* temp_window_name; + /*if (name && parent_window->IDStack.back() == parent_window->ID) + ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%s", parent_window->Name, name); // May omit ID if in root of ID stack + else*/ if (name) ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%s_%08X", parent_window->Name, name, id); else ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%08X", parent_window->Name, id); + // Set style const float backup_border_size = g.Style.ChildBorderSize; - if (!border) + if ((child_flags & ImGuiChildFlags_Borders) == 0) g.Style.ChildBorderSize = 0.0f; - bool ret = Begin(temp_window_name, NULL, flags); + + // Begin into window + const bool ret = Begin(temp_window_name, NULL, window_flags); + + // Restore style g.Style.ChildBorderSize = backup_border_size; + if (child_flags & ImGuiChildFlags_FrameStyle) + { + PopStyleVar(3); + PopStyleColor(); + } ImGuiWindow* child_window = g.CurrentWindow; child_window->ChildId = id; - child_window->AutoFitChildAxises = (ImS8)auto_fit_axises; // Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually. // While this is not really documented/defined, it seems that the expected thing to do. @@ -5409,11 +6043,11 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b parent_window->DC.CursorPos = child_window->Pos; // Process navigation-in immediately so NavInit can run on first frame - // Can enter a child if (A) it has navigatable items or (B) it can be scrolled. + // Can enter a child if (A) it has navigable items or (B) it can be scrolled. const ImGuiID temp_id_for_activation = ImHashStr("##Child", 0, id); if (g.ActiveId == temp_id_for_activation) ClearActiveID(); - if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavWindowHasScrollY)) + if (g.NavActivateId == id && !(child_flags & ImGuiChildFlags_NavFlattened) && (child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavWindowHasScrollY)) { FocusWindow(child_window); NavInitWindow(child_window, false); @@ -5423,88 +6057,50 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b return ret; } -bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags) -{ - ImGuiWindow* window = GetCurrentWindow(); - return BeginChildEx(str_id, window->GetID(str_id), size_arg, border, extra_flags); -} - -bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags) -{ - IM_ASSERT(id != 0); - return BeginChildEx(NULL, id, size_arg, border, extra_flags); -} - void ImGui::EndChild() { ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; + ImGuiWindow* child_window = g.CurrentWindow; IM_ASSERT(g.WithinEndChild == false); - IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() calls + IM_ASSERT(child_window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() calls g.WithinEndChild = true; - if (window->BeginCount > 1) - { - End(); - } - else + ImVec2 child_size = child_window->Size; + End(); + if (child_window->BeginCount == 1) { - ImVec2 sz = window->Size; - if (window->AutoFitChildAxises & (1 << ImGuiAxis_X)) // Arbitrary minimum zero-ish child size of 4.0f causes less trouble than a 0.0f - sz.x = ImMax(4.0f, sz.x); - if (window->AutoFitChildAxises & (1 << ImGuiAxis_Y)) - sz.y = ImMax(4.0f, sz.y); - End(); - ImGuiWindow* parent_window = g.CurrentWindow; - ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz); - ItemSize(sz); - if ((window->DC.NavLayersActiveMask != 0 || window->DC.NavWindowHasScrollY) && !(window->Flags & ImGuiWindowFlags_NavFlattened)) + ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + child_size); + ItemSize(child_size); + const bool nav_flattened = (child_window->ChildFlags & ImGuiChildFlags_NavFlattened) != 0; + if ((child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavWindowHasScrollY) && !nav_flattened) { - ItemAdd(bb, window->ChildId); - RenderNavHighlight(bb, window->ChildId); + ItemAdd(bb, child_window->ChildId); + RenderNavCursor(bb, child_window->ChildId); // When browsing a window that has no activable items (scroll only) we keep a highlight on the child (pass g.NavId to trick into always displaying) - if (window->DC.NavLayersActiveMask == 0 && window == g.NavWindow) - RenderNavHighlight(ImRect(bb.Min - ImVec2(2, 2), bb.Max + ImVec2(2, 2)), g.NavId, ImGuiNavHighlightFlags_TypeThin); + if (child_window->DC.NavLayersActiveMask == 0 && child_window == g.NavWindow) + RenderNavCursor(ImRect(bb.Min - ImVec2(2, 2), bb.Max + ImVec2(2, 2)), g.NavId, ImGuiNavRenderCursorFlags_Compact); } else { // Not navigable into - ItemAdd(bb, 0); + // - This is a bit of a fringe use case, mostly useful for undecorated, non-scrolling contents childs, or empty childs. + // - We could later decide to not apply this path if ImGuiChildFlags_FrameStyle or ImGuiChildFlags_Borders is set. + ItemAdd(bb, child_window->ChildId, NULL, ImGuiItemFlags_NoNav); // But when flattened we directly reach items, adjust active layer mask accordingly - if (window->Flags & ImGuiWindowFlags_NavFlattened) - parent_window->DC.NavLayersActiveMaskNext |= window->DC.NavLayersActiveMaskNext; + if (nav_flattened) + parent_window->DC.NavLayersActiveMaskNext |= child_window->DC.NavLayersActiveMaskNext; } - if (g.HoveredWindow == window) + if (g.HoveredWindow == child_window) g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow; } g.WithinEndChild = false; g.LogLinePosY = -FLT_MAX; // To enforce a carriage return } -// Helper to create a child window / scrolling region that looks like a normal widget frame. -bool ImGui::BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags extra_flags) -{ - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - PushStyleColor(ImGuiCol_ChildBg, style.Colors[ImGuiCol_FrameBg]); - PushStyleVar(ImGuiStyleVar_ChildRounding, style.FrameRounding); - PushStyleVar(ImGuiStyleVar_ChildBorderSize, style.FrameBorderSize); - PushStyleVar(ImGuiStyleVar_WindowPadding, style.FramePadding); - bool ret = BeginChild(id, size, true, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysUseWindowPadding | extra_flags); - PopStyleVar(3); - PopStyleColor(); - return ret; -} - -void ImGui::EndChildFrame() -{ - EndChild(); -} - static void SetWindowConditionAllowFlags(ImGuiWindow* window, ImGuiCond flags, bool enabled) { window->SetWindowPosAllowFlags = enabled ? (window->SetWindowPosAllowFlags | flags) : (window->SetWindowPosAllowFlags & ~flags); @@ -5526,9 +6122,9 @@ ImGuiWindow* ImGui::FindWindowByName(const char* name) static void ApplyWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* settings) { - window->Pos = ImFloor(ImVec2(settings->Pos.x, settings->Pos.y)); + window->Pos = ImTrunc(ImVec2(settings->Pos.x, settings->Pos.y)); if (settings->Size.x > 0 && settings->Size.y > 0) - window->Size = window->SizeFull = ImFloor(ImVec2(settings->Size.x, settings->Size.y)); + window->Size = window->SizeFull = ImTrunc(ImVec2(settings->Size.x, settings->Size.y)); window->Collapsed = settings->Collapsed; } @@ -5561,6 +6157,7 @@ static void InitOrLoadWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* s // Use SetNextWindowPos() with the appropriate condition flag to change the initial position of a window. const ImGuiViewport* main_viewport = ImGui::GetMainViewport(); window->Pos = main_viewport->Pos + ImVec2(60, 60); + window->Size = window->SizeFull = ImVec2(0, 0); window->SetWindowPosAllowFlags = window->SetWindowSizeAllowFlags = window->SetWindowCollapsedAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing; if (settings != NULL) @@ -5609,13 +6206,37 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags) return window; } +static inline ImVec2 CalcWindowMinSize(ImGuiWindow* window) +{ + // We give windows non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups) + // FIXME: Essentially we want to restrict manual resizing to WindowMinSize+Decoration, and allow api resizing to be smaller. + // Perhaps should tend further a neater test for this. + ImGuiContext& g = *GImGui; + ImVec2 size_min; + if ((window->Flags & ImGuiWindowFlags_ChildWindow) && !(window->Flags & ImGuiWindowFlags_Popup)) + { + size_min.x = (window->ChildFlags & ImGuiChildFlags_ResizeX) ? g.Style.WindowMinSize.x : 4.0f; + size_min.y = (window->ChildFlags & ImGuiChildFlags_ResizeY) ? g.Style.WindowMinSize.y : 4.0f; + } + else + { + size_min.x = ((window->Flags & ImGuiWindowFlags_AlwaysAutoResize) == 0) ? g.Style.WindowMinSize.x : 4.0f; + size_min.y = ((window->Flags & ImGuiWindowFlags_AlwaysAutoResize) == 0) ? g.Style.WindowMinSize.y : 4.0f; + } + + // Reduce artifacts with very small windows + ImGuiWindow* window_for_height = window; + size_min.y = ImMax(size_min.y, window_for_height->TitleBarHeight + window_for_height->MenuBarHeight + ImMax(0.0f, g.Style.WindowRounding - 1.0f)); + return size_min; +} + static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, const ImVec2& size_desired) { ImGuiContext& g = *GImGui; ImVec2 new_size = size_desired; if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSizeConstraint) { - // Using -1,-1 on either X/Y axis to preserve the current size. + // See comments in SetNextWindowSizeConstraints() for details about setting size_min an size_max. ImRect cr = g.NextWindowData.SizeConstraintRect; new_size.x = (cr.Min.x >= 0 && cr.Max.x >= 0) ? ImClamp(new_size.x, cr.Min.x, cr.Max.x) : window->SizeFull.x; new_size.y = (cr.Min.y >= 0 && cr.Max.y >= 0) ? ImClamp(new_size.y, cr.Min.y, cr.Max.y) : window->SizeFull.y; @@ -5629,19 +6250,13 @@ static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, const ImVec2& s g.NextWindowData.SizeCallback(&data); new_size = data.DesiredSize; } - new_size.x = IM_FLOOR(new_size.x); - new_size.y = IM_FLOOR(new_size.y); + new_size.x = IM_TRUNC(new_size.x); + new_size.y = IM_TRUNC(new_size.y); } // Minimum size - if (!(window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_AlwaysAutoResize))) - { - ImGuiWindow* window_for_height = window; - new_size = ImMax(new_size, g.Style.WindowMinSize); - const float minimum_height = window_for_height->TitleBarHeight() + window_for_height->MenuBarHeight() + ImMax(0.0f, g.Style.WindowRounding - 1.0f); - new_size.y = ImMax(new_size.y, minimum_height); // Reduce artifacts with very small windows - } - return new_size; + ImVec2 size_min = CalcWindowMinSize(window); + return ImMax(new_size, size_min); } static void CalcWindowContentSizes(ImGuiWindow* window, ImVec2* content_size_current, ImVec2* content_size_ideal) @@ -5658,10 +6273,10 @@ static void CalcWindowContentSizes(ImGuiWindow* window, ImVec2* content_size_cur return; } - content_size_current->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_FLOOR(window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x); - content_size_current->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_FLOOR(window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y); - content_size_ideal->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_FLOOR(ImMax(window->DC.CursorMaxPos.x, window->DC.IdealMaxPos.x) - window->DC.CursorStartPos.x); - content_size_ideal->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_FLOOR(ImMax(window->DC.CursorMaxPos.y, window->DC.IdealMaxPos.y) - window->DC.CursorStartPos.y); + content_size_current->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_TRUNC(window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x); + content_size_current->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_TRUNC(window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y); + content_size_ideal->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_TRUNC(ImMax(window->DC.CursorMaxPos.x, window->DC.IdealMaxPos.x) - window->DC.CursorStartPos.x); + content_size_ideal->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_TRUNC(ImMax(window->DC.CursorMaxPos.y, window->DC.IdealMaxPos.y) - window->DC.CursorStartPos.y); } static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_contents) @@ -5680,19 +6295,22 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont else { // Maximum window size is determined by the viewport size or monitor size - const bool is_popup = (window->Flags & ImGuiWindowFlags_Popup) != 0; - const bool is_menu = (window->Flags & ImGuiWindowFlags_ChildMenu) != 0; - ImVec2 size_min = style.WindowMinSize; - if (is_popup || is_menu) // Popups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups) - size_min = ImMin(size_min, ImVec2(4.0f, 4.0f)); - - ImVec2 avail_size = ImGui::GetMainViewport()->WorkSize; - ImVec2 size_auto_fit = ImClamp(size_desired, size_min, ImMax(size_min, avail_size - style.DisplaySafeAreaPadding * 2.0f)); + ImVec2 size_min = CalcWindowMinSize(window); + ImVec2 size_max = ((window->Flags & ImGuiWindowFlags_ChildWindow) && !(window->Flags & ImGuiWindowFlags_Popup)) ? ImVec2(FLT_MAX, FLT_MAX) : ImGui::GetMainViewport()->WorkSize - style.DisplaySafeAreaPadding * 2.0f; + ImVec2 size_auto_fit = ImClamp(size_desired, size_min, size_max); + + // FIXME: CalcWindowAutoFitSize() doesn't take into account that only one axis may be auto-fit when calculating scrollbars, + // we may need to compute/store three variants of size_auto_fit, for x/y/xy. + // Here we implement a workaround for child windows only, but a full solution would apply to normal windows as well: + if ((window->ChildFlags & ImGuiChildFlags_ResizeX) && !(window->ChildFlags & ImGuiChildFlags_ResizeY)) + size_auto_fit.y = window->SizeFull.y; + else if (!(window->ChildFlags & ImGuiChildFlags_ResizeX) && (window->ChildFlags & ImGuiChildFlags_ResizeY)) + size_auto_fit.x = window->SizeFull.x; // When the window cannot fit all contents (either because of constraints, either because screen is too small), // we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than ViewportSize-WindowPadding. ImVec2 size_auto_fit_after_constraint = CalcWindowSizeAfterConstraint(window, size_auto_fit); - bool will_have_scrollbar_x = (size_auto_fit_after_constraint.x - size_pad.x - decoration_w_without_scrollbars < size_contents.x && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (window->Flags & ImGuiWindowFlags_HorizontalScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar); + bool will_have_scrollbar_x = (size_auto_fit_after_constraint.x - size_pad.x - decoration_w_without_scrollbars < size_contents.x && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (window->Flags & ImGuiWindowFlags_HorizontalScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar); bool will_have_scrollbar_y = (size_auto_fit_after_constraint.y - size_pad.y - decoration_h_without_scrollbars < size_contents.y && !(window->Flags & ImGuiWindowFlags_NoScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysVerticalScrollbar); if (will_have_scrollbar_x) size_auto_fit.y += style.ScrollbarSize; @@ -5735,7 +6353,7 @@ static void CalcResizePosSizeFromAnyCorner(ImGuiWindow* window, const ImVec2& co *out_size = size_constrained; } -// Data for resizing from corner +// Data for resizing from resize grip / corner struct ImGuiResizeGripDef { ImVec2 CornerPosN; @@ -5753,9 +6371,9 @@ static const ImGuiResizeGripDef resize_grip_def[4] = // Data for resizing from borders struct ImGuiResizeBorderDef { - ImVec2 InnerDir; - ImVec2 SegmentN1, SegmentN2; - float OuterAngle; + ImVec2 InnerDir; // Normal toward inside + ImVec2 SegmentN1, SegmentN2; // End positions, normalized (0,0: upper left) + float OuterAngle; // Angle toward outside }; static const ImGuiResizeBorderDef resize_border_def[4] = { @@ -5801,7 +6419,7 @@ ImGuiID ImGui::GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir) // Handle resize for: Resize Grips, Borders, Gamepad // Return true when using auto-fit (double-click on resize grip) -static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect) +static int ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_hovered, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect) { ImGuiContext& g = *GImGui; ImGuiWindowFlags flags = window->Flags; @@ -5811,16 +6429,15 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s if (window->WasActive == false) // Early out to avoid running this code for e.g. a hidden implicit/fallback Debug window. return false; - bool ret_auto_fit = false; - const int resize_border_count = g.IO.ConfigWindowsResizeFromEdges ? 4 : 0; - const float grip_draw_size = IM_FLOOR(ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f)); - const float grip_hover_inner_size = IM_FLOOR(grip_draw_size * 0.75f); + int ret_auto_fit_mask = 0x00; + const float grip_draw_size = IM_TRUNC(ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f)); + const float grip_hover_inner_size = (resize_grip_count > 0) ? IM_TRUNC(grip_draw_size * 0.75f) : 0.0f; const float grip_hover_outer_size = g.IO.ConfigWindowsResizeFromEdges ? WINDOWS_HOVER_PADDING : 0.0f; ImRect clamp_rect = visibility_rect; const bool window_move_from_title_bar = g.IO.ConfigWindowsMoveFromTitleBarOnly && !(window->Flags & ImGuiWindowFlags_NoTitleBar); if (window_move_from_title_bar) - clamp_rect.Min.y -= window->TitleBarHeight(); + clamp_rect.Min.y -= window->TitleBarHeight; ImVec2 pos_target(FLT_MAX, FLT_MAX); ImVec2 size_target(FLT_MAX, FLT_MAX); @@ -5845,13 +6462,13 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s ButtonBehavior(resize_rect, resize_grip_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus); //GetForegroundDrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255)); if (hovered || held) - g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE; + SetMouseCursor((resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE); - if (held && g.IO.MouseClickedCount[0] == 2 && resize_grip_n == 0) + if (held && g.IO.MouseDoubleClicked[0]) { - // Manual auto-fit when double-clicking + // Auto-fit when double-clicking size_target = CalcWindowSizeAfterConstraint(window, size_auto_fit); - ret_auto_fit = true; + ret_auto_fit_mask = 0x03; // Both axises ClearActiveID(); } else if (held) @@ -5869,8 +6486,16 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s if (resize_grip_n == 0 || held || hovered) resize_grip_col[resize_grip_n] = GetColorU32(held ? ImGuiCol_ResizeGripActive : hovered ? ImGuiCol_ResizeGripHovered : ImGuiCol_ResizeGrip); } - for (int border_n = 0; border_n < resize_border_count; border_n++) + + int resize_border_mask = 0x00; + if (window->Flags & ImGuiWindowFlags_ChildWindow) + resize_border_mask |= ((window->ChildFlags & ImGuiChildFlags_ResizeX) ? 0x02 : 0) | ((window->ChildFlags & ImGuiChildFlags_ResizeY) ? 0x08 : 0); + else + resize_border_mask = g.IO.ConfigWindowsResizeFromEdges ? 0x0F : 0x00; + for (int border_n = 0; border_n < 4; border_n++) { + if ((resize_border_mask & (1 << border_n)) == 0) + continue; const ImGuiResizeBorderDef& def = resize_border_def[border_n]; const ImGuiAxis axis = (border_n == ImGuiDir_Left || border_n == ImGuiDir_Right) ? ImGuiAxis_X : ImGuiAxis_Y; @@ -5879,22 +6504,78 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s ImGuiID border_id = window->GetID(border_n + 4); // == GetWindowResizeBorderID() ItemAdd(border_rect, border_id, NULL, ImGuiItemFlags_NoNav); ButtonBehavior(border_rect, border_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus); - //GetForegroundDrawLists(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255)); - if ((hovered && g.HoveredIdTimer > WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) || held) + //GetForegroundDrawList(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255)); + if (hovered && g.HoveredIdTimer <= WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) + hovered = false; + if (hovered || held) + SetMouseCursor((axis == ImGuiAxis_X) ? ImGuiMouseCursor_ResizeEW : ImGuiMouseCursor_ResizeNS); + if (held && g.IO.MouseDoubleClicked[0]) { - g.MouseCursor = (axis == ImGuiAxis_X) ? ImGuiMouseCursor_ResizeEW : ImGuiMouseCursor_ResizeNS; - if (held) - *border_held = border_n; + // Double-clicking bottom or right border auto-fit on this axis + // FIXME: CalcWindowAutoFitSize() doesn't take into account that only one side may be auto-fit when calculating scrollbars. + // FIXME: Support top and right borders: rework CalcResizePosSizeFromAnyCorner() to be reusable in both cases. + if (border_n == 1 || border_n == 3) // Right and bottom border + { + size_target[axis] = CalcWindowSizeAfterConstraint(window, size_auto_fit)[axis]; + ret_auto_fit_mask |= (1 << axis); + hovered = held = false; // So border doesn't show highlighted at new position + } + ClearActiveID(); } - if (held) + else if (held) { + // Switch to relative resizing mode when border geometry moved (e.g. resizing a child altering parent scroll), in order to avoid resizing feedback loop. + // Currently only using relative mode on resizable child windows, as the problem to solve is more likely noticeable for them, but could apply for all windows eventually. + // FIXME: May want to generalize this idiom at lower-level, so more widgets can use it! + const bool just_scrolled_manually_while_resizing = (g.WheelingWindow != NULL && g.WheelingWindowScrolledFrame == g.FrameCount && IsWindowChildOf(window, g.WheelingWindow, false)); + if (g.ActiveIdIsJustActivated || just_scrolled_manually_while_resizing) + { + g.WindowResizeBorderExpectedRect = border_rect; + g.WindowResizeRelativeMode = false; + } + if ((window->Flags & ImGuiWindowFlags_ChildWindow) && memcmp(&g.WindowResizeBorderExpectedRect, &border_rect, sizeof(ImRect)) != 0) + g.WindowResizeRelativeMode = true; + + const ImVec2 border_curr = (window->Pos + ImMin(def.SegmentN1, def.SegmentN2) * window->Size); + const float border_target_rel_mode_for_axis = border_curr[axis] + g.IO.MouseDelta[axis]; + const float border_target_abs_mode_for_axis = g.IO.MousePos[axis] - g.ActiveIdClickOffset[axis] + WINDOWS_HOVER_PADDING; // Match ButtonBehavior() padding above. + + // Use absolute mode position + ImVec2 border_target = window->Pos; + border_target[axis] = border_target_abs_mode_for_axis; + + // Use relative mode target for child window, ignore resize when moving back toward the ideal absolute position. + bool ignore_resize = false; + if (g.WindowResizeRelativeMode) + { + //GetForegroundDrawList()->AddText(GetMainViewport()->WorkPos, IM_COL32_WHITE, "Relative Mode"); + border_target[axis] = border_target_rel_mode_for_axis; + if (g.IO.MouseDelta[axis] == 0.0f || (g.IO.MouseDelta[axis] > 0.0f) == (border_target_rel_mode_for_axis > border_target_abs_mode_for_axis)) + ignore_resize = true; + } + + // Clamp, apply ImVec2 clamp_min(border_n == ImGuiDir_Right ? clamp_rect.Min.x : -FLT_MAX, border_n == ImGuiDir_Down || (border_n == ImGuiDir_Up && window_move_from_title_bar) ? clamp_rect.Min.y : -FLT_MAX); ImVec2 clamp_max(border_n == ImGuiDir_Left ? clamp_rect.Max.x : +FLT_MAX, border_n == ImGuiDir_Up ? clamp_rect.Max.y : +FLT_MAX); - ImVec2 border_target = window->Pos; - border_target[axis] = g.IO.MousePos[axis] - g.ActiveIdClickOffset[axis] + WINDOWS_HOVER_PADDING; border_target = ImClamp(border_target, clamp_min, clamp_max); - CalcResizePosSizeFromAnyCorner(window, border_target, ImMin(def.SegmentN1, def.SegmentN2), &pos_target, &size_target); + if (flags & ImGuiWindowFlags_ChildWindow) // Clamp resizing of childs within parent + { + ImGuiWindow* parent_window = window->ParentWindow; + ImGuiWindowFlags parent_flags = parent_window->Flags; + ImRect border_limit_rect = parent_window->InnerRect; + border_limit_rect.Expand(ImVec2(-ImMax(parent_window->WindowPadding.x, parent_window->WindowBorderSize), -ImMax(parent_window->WindowPadding.y, parent_window->WindowBorderSize))); + if ((axis == ImGuiAxis_X) && ((parent_flags & (ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar)) == 0 || (parent_flags & ImGuiWindowFlags_NoScrollbar))) + border_target.x = ImClamp(border_target.x, border_limit_rect.Min.x, border_limit_rect.Max.x); + if ((axis == ImGuiAxis_Y) && (parent_flags & ImGuiWindowFlags_NoScrollbar)) + border_target.y = ImClamp(border_target.y, border_limit_rect.Min.y, border_limit_rect.Max.y); + } + if (!ignore_resize) + CalcResizePosSizeFromAnyCorner(window, border_target, ImMin(def.SegmentN1, def.SegmentN2), &pos_target, &size_target); } + if (hovered) + *border_hovered = border_n; + if (held) + *border_held = border_n; } PopID(); @@ -5918,9 +6599,9 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s g.NavWindowingAccumDeltaSize += nav_resize_dir * resize_step; g.NavWindowingAccumDeltaSize = ImMax(g.NavWindowingAccumDeltaSize, clamp_rect.Min - window->Pos - window->Size); // We need Pos+Size >= clmap_rect.Min, so Size >= clmap_rect.Min - Pos, so size_delta >= clmap_rect.Min - window->Pos - window->Size g.NavWindowingToggleLayer = false; - g.NavDisableMouseHover = true; + g.NavHighlightItemUnderNav = true; resize_grip_col[0] = GetColorU32(ImGuiCol_ResizeGripActive); - ImVec2 accum_floored = ImFloor(g.NavWindowingAccumDeltaSize); + ImVec2 accum_floored = ImTrunc(g.NavWindowingAccumDeltaSize); if (accum_floored.x != 0.0f || accum_floored.y != 0.0f) { // FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck. @@ -5931,19 +6612,24 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s } // Apply back modified position/size to window - if (size_target.x != FLT_MAX) - { - window->SizeFull = size_target; - MarkIniSettingsDirty(window); - } - if (pos_target.x != FLT_MAX) - { - window->Pos = ImFloor(pos_target); + const ImVec2 curr_pos = window->Pos; + const ImVec2 curr_size = window->SizeFull; + if (size_target.x != FLT_MAX && (window->Size.x != size_target.x || window->SizeFull.x != size_target.x)) + window->Size.x = window->SizeFull.x = size_target.x; + if (size_target.y != FLT_MAX && (window->Size.y != size_target.y || window->SizeFull.y != size_target.y)) + window->Size.y = window->SizeFull.y = size_target.y; + if (pos_target.x != FLT_MAX && window->Pos.x != ImTrunc(pos_target.x)) + window->Pos.x = ImTrunc(pos_target.x); + if (pos_target.y != FLT_MAX && window->Pos.y != ImTrunc(pos_target.y)) + window->Pos.y = ImTrunc(pos_target.y); + if (curr_pos.x != window->Pos.x || curr_pos.y != window->Pos.y || curr_size.x != window->SizeFull.x || curr_size.y != window->SizeFull.y) MarkIniSettingsDirty(window); - } - window->Size = window->SizeFull; - return ret_auto_fit; + // Recalculate next expected border expected coordinates + if (*border_held != -1) + g.WindowResizeBorderExpectedRect = GetResizeBorderRect(window, *border_held, grip_hover_inner_size, WINDOWS_HOVER_PADDING); + + return ret_auto_fit_mask; } static inline void ClampWindowPos(ImGuiWindow* window, const ImRect& visibility_rect) @@ -5951,31 +6637,44 @@ static inline void ClampWindowPos(ImGuiWindow* window, const ImRect& visibility_ ImGuiContext& g = *GImGui; ImVec2 size_for_clamping = window->Size; if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(window->Flags & ImGuiWindowFlags_NoTitleBar)) - size_for_clamping.y = window->TitleBarHeight(); + size_for_clamping.y = window->TitleBarHeight; window->Pos = ImClamp(window->Pos, visibility_rect.Min - size_for_clamping, visibility_rect.Max); } +static void RenderWindowOuterSingleBorder(ImGuiWindow* window, int border_n, ImU32 border_col, float border_size) +{ + const ImGuiResizeBorderDef& def = resize_border_def[border_n]; + const float rounding = window->WindowRounding; + const ImRect border_r = GetResizeBorderRect(window, border_n, rounding, 0.0f); + window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN1) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle - IM_PI * 0.25f, def.OuterAngle); + window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN2) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle, def.OuterAngle + IM_PI * 0.25f); + window->DrawList->PathStroke(border_col, ImDrawFlags_None, border_size); +} + static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window) { ImGuiContext& g = *GImGui; - float rounding = window->WindowRounding; - float border_size = window->WindowBorderSize; - if (border_size > 0.0f && !(window->Flags & ImGuiWindowFlags_NoBackground)) - window->DrawList->AddRect(window->Pos, window->Pos + window->Size, GetColorU32(ImGuiCol_Border), rounding, 0, border_size); - - int border_held = window->ResizeBorderHeld; - if (border_held != -1) + const float border_size = window->WindowBorderSize; + const ImU32 border_col = GetColorU32(ImGuiCol_Border); + if (border_size > 0.0f && (window->Flags & ImGuiWindowFlags_NoBackground) == 0) + window->DrawList->AddRect(window->Pos, window->Pos + window->Size, border_col, window->WindowRounding, 0, window->WindowBorderSize); + else if (border_size > 0.0f) + { + if (window->ChildFlags & ImGuiChildFlags_ResizeX) // Similar code as 'resize_border_mask' computation in UpdateWindowManualResize() but we specifically only always draw explicit child resize border. + RenderWindowOuterSingleBorder(window, 1, border_col, border_size); + if (window->ChildFlags & ImGuiChildFlags_ResizeY) + RenderWindowOuterSingleBorder(window, 3, border_col, border_size); + } + if (window->ResizeBorderHovered != -1 || window->ResizeBorderHeld != -1) { - const ImGuiResizeBorderDef& def = resize_border_def[border_held]; - ImRect border_r = GetResizeBorderRect(window, border_held, rounding, 0.0f); - window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN1) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle - IM_PI * 0.25f, def.OuterAngle); - window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN2) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle, def.OuterAngle + IM_PI * 0.25f); - window->DrawList->PathStroke(GetColorU32(ImGuiCol_SeparatorActive), 0, ImMax(2.0f, border_size)); // Thicker than usual + const int border_n = (window->ResizeBorderHeld != -1) ? window->ResizeBorderHeld : window->ResizeBorderHovered; + const ImU32 border_col_resizing = GetColorU32((window->ResizeBorderHeld != -1) ? ImGuiCol_SeparatorActive : ImGuiCol_SeparatorHovered); + RenderWindowOuterSingleBorder(window, border_n, border_col_resizing, ImMax(2.0f, window->WindowBorderSize)); // Thicker than usual } if (g.Style.FrameBorderSize > 0 && !(window->Flags & ImGuiWindowFlags_NoTitleBar)) { - float y = window->Pos.y + window->TitleBarHeight() - 1; - window->DrawList->AddLine(ImVec2(window->Pos.x + border_size, y), ImVec2(window->Pos.x + window->Size.x - border_size, y), GetColorU32(ImGuiCol_Border), g.Style.FrameBorderSize); + float y = window->Pos.y + window->TitleBarHeight - 1; + window->DrawList->AddLine(ImVec2(window->Pos.x + border_size, y), ImVec2(window->Pos.x + window->Size.x - border_size, y), border_col, g.Style.FrameBorderSize); } } @@ -6000,7 +6699,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar // Title bar only const float backup_border_size = style.FrameBorderSize; g.Style.FrameBorderSize = window->WindowBorderSize; - ImU32 title_bar_col = GetColorU32((title_bar_is_highlight && !g.NavDisableHighlight) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBgCollapsed); + ImU32 title_bar_col = GetColorU32((title_bar_is_highlight && g.NavCursorVisible) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBgCollapsed); RenderFrame(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, true, window_rounding); g.Style.FrameBorderSize = backup_border_size; } @@ -6019,7 +6718,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar } if (override_alpha) bg_col = (bg_col & ~IM_COL32_A_MASK) | (IM_F32_TO_INT8_SAT(alpha) << IM_COL32_A_SHIFT); - window->DrawList->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight()), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? 0 : ImDrawFlags_RoundCornersBottom); + window->DrawList->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? 0 : ImDrawFlags_RoundCornersBottom); } // Title bar @@ -6167,13 +6866,50 @@ void ImGui::UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags window->RootWindowPopupTree = parent_window->RootWindowPopupTree; if (parent_window && !(flags & ImGuiWindowFlags_Modal) && (flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Popup))) window->RootWindowForTitleBarHighlight = parent_window->RootWindowForTitleBarHighlight; - while (window->RootWindowForNav->Flags & ImGuiWindowFlags_NavFlattened) + while (window->RootWindowForNav->ChildFlags & ImGuiChildFlags_NavFlattened) { IM_ASSERT(window->RootWindowForNav->ParentWindow != NULL); window->RootWindowForNav = window->RootWindowForNav->ParentWindow; } } +// [EXPERIMENTAL] Called by Begin(). NextWindowData is valid at this point. +// This is designed as a toy/test-bed for +void ImGui::UpdateWindowSkipRefresh(ImGuiWindow* window) +{ + ImGuiContext& g = *GImGui; + window->SkipRefresh = false; + if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasRefreshPolicy) == 0) + return; + if (g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_TryToAvoidRefresh) + { + // FIXME-IDLE: Tests for e.g. mouse clicks or keyboard while focused. + if (window->Appearing) // If currently appearing + return; + if (window->Hidden) // If was hidden (previous frame) + return; + if ((g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_RefreshOnHover) && g.HoveredWindow) + if (window->RootWindow == g.HoveredWindow->RootWindow || IsWindowWithinBeginStackOf(g.HoveredWindow->RootWindow, window)) + return; + if ((g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_RefreshOnFocus) && g.NavWindow) + if (window->RootWindow == g.NavWindow->RootWindow || IsWindowWithinBeginStackOf(g.NavWindow->RootWindow, window)) + return; + window->DrawList = NULL; + window->SkipRefresh = true; + } +} + +static void SetWindowActiveForSkipRefresh(ImGuiWindow* window) +{ + window->Active = true; + for (ImGuiWindow* child : window->DC.ChildWindows) + if (!child->Hidden) + { + child->Active = child->SkipRefresh = true; + SetWindowActiveForSkipRefresh(child); + } +} + // When a modal popup is open, newly created windows that want focus (i.e. are not popups and do not specify ImGuiWindowFlags_NoFocusOnAppearing) // should be positioned behind that modal window, unless the window was created inside the modal begin-stack. // In case of multiple stacked modals newly created window honors begin stack order and does not go below its own modal parent. @@ -6186,7 +6922,7 @@ void ImGui::UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags // - WindowE // .. returns NULL // Notes: // - FindBlockingModal(NULL) == NULL is generally equivalent to GetTopMostPopupModal() == NULL. -// Only difference is here we check for ->Active/WasActive but it may be unecessary. +// Only difference is here we check for ->Active/WasActive but it may be unnecessary. ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window) { ImGuiContext& g = *GImGui; @@ -6231,13 +6967,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) if (window_just_created) window = CreateNewWindow(name, flags); + // [DEBUG] Debug break requested by user + if (g.DebugBreakInWindow == window->ID) + IM_DEBUG_BREAK(); + // Automatically disable manual moving/resizing when NoInputs is set if ((flags & ImGuiWindowFlags_NoInputs) == ImGuiWindowFlags_NoInputs) flags |= ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize; - if (flags & ImGuiWindowFlags_NavFlattened) - IM_ASSERT(flags & ImGuiWindowFlags_ChildWindow); - const int current_frame = g.FrameCount; const bool first_begin_of_the_frame = (window->LastFrameActive != current_frame); window->IsFallbackWindow = (g.CurrentWindowStack.Size == 0 && g.WithinFrameScopeWithImplicitWindow); @@ -6259,6 +6996,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) { UpdateWindowInFocusOrderList(window, window_just_created, flags); window->Flags = (ImGuiWindowFlags)flags; + window->ChildFlags = (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasChildFlags) ? g.NextWindowData.ChildFlags : 0; window->LastFrameActive = current_frame; window->LastTimeActive = (float)g.Time; window->BeginOrderWithinParent = 0; @@ -6279,29 +7017,33 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->IDStack.push_back(window->ID); // Add to stack - // We intentionally set g.CurrentWindow to NULL to prevent usage until when the viewport is set, then will call SetCurrentWindow() g.CurrentWindow = window; - ImGuiWindowStackData window_stack_data; + g.CurrentWindowStack.resize(g.CurrentWindowStack.Size + 1); + ImGuiWindowStackData& window_stack_data = g.CurrentWindowStack.back(); window_stack_data.Window = window; window_stack_data.ParentLastItemDataBackup = g.LastItemData; - window_stack_data.StackSizesOnBegin.SetToContextState(&g); - g.CurrentWindowStack.push_back(window_stack_data); + window_stack_data.DisabledOverrideReenable = (flags & ImGuiWindowFlags_Tooltip) && (g.CurrentItemFlags & ImGuiItemFlags_Disabled); + ErrorRecoveryStoreState(&window_stack_data.StackSizesInBegin); + g.StackSizesInBeginForCurrentWindow = &window_stack_data.StackSizesInBegin; if (flags & ImGuiWindowFlags_ChildMenu) - g.BeginMenuCount++; + g.BeginMenuDepth++; // Update ->RootWindow and others pointers (before any possible call to FocusWindow) if (first_begin_of_the_frame) { UpdateWindowParentAndRootLinks(window, flags, parent_window); window->ParentWindowInBeginStack = parent_window_in_stack; + + // There's little point to expose a flag to set this: because the interesting cases won't be using parent_window_in_stack, + // e.g. linking a tool window in a standalone viewport to a document window, regardless of their Begin() stack parenting. (#6798) + window->ParentWindowForFocusRoute = (flags & ImGuiWindowFlags_ChildWindow) ? parent_window_in_stack : NULL; } // Add to focus scope stack - PushFocusScope(window->ID); + PushFocusScope((window->ChildFlags & ImGuiChildFlags_NavFlattened) ? g.CurrentFocusScopeId : window->ID); window->NavRootFocusScopeId = g.CurrentFocusScopeId; - g.CurrentWindow = NULL; - // Add to popup stack + // Add to popup stacks: update OpenPopupStack[] data, push to BeginPopupStack[] if (flags & ImGuiWindowFlags_Popup) { ImGuiPopupData& popup_ref = g.OpenPopupStack[g.BeginPopupStack.Size]; @@ -6335,6 +7077,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) { window_size_x_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.x > 0.0f); window_size_y_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.y > 0.0f); + if ((window->ChildFlags & ImGuiChildFlags_ResizeX) && (window->SetWindowSizeAllowFlags & ImGuiCond_FirstUseEver) == 0) // Axis-specific conditions for BeginChild() + g.NextWindowData.SizeVal.x = window->SizeFull.x; + if ((window->ChildFlags & ImGuiChildFlags_ResizeY) && (window->SetWindowSizeAllowFlags & ImGuiCond_FirstUseEver) == 0) + g.NextWindowData.SizeVal.y = window->SizeFull.y; SetWindowSize(window, g.NextWindowData.SizeVal, g.NextWindowData.SizeCond); } if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasScroll) @@ -6361,8 +7107,18 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) if (window->Appearing) SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, false); + // [EXPERIMENTAL] Skip Refresh mode + UpdateWindowSkipRefresh(window); + + // Nested root windows (typically tooltips) override disabled state + if (window_stack_data.DisabledOverrideReenable && window->RootWindow == window) + BeginDisabledOverrideReenable(); + + // We intentionally set g.CurrentWindow to NULL to prevent usage until when the viewport is set, then will call SetCurrentWindow() + g.CurrentWindow = NULL; + // When reusing window again multiple times a frame, just append content (don't need to setup again) - if (first_begin_of_the_frame) + if (first_begin_of_the_frame && !window->SkipRefresh) { // Initialize const bool window_is_child_tooltip = (flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_Tooltip); // FIXME-WIP: Undocumented behavior of Child+Tooltip for pinned tooltip (#1345) @@ -6434,24 +7190,34 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) else window->WindowBorderSize = ((flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) && !(flags & ImGuiWindowFlags_Modal)) ? style.PopupBorderSize : style.WindowBorderSize; window->WindowPadding = style.WindowPadding; - if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & (ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_Popup)) && window->WindowBorderSize == 0.0f) + if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !(window->ChildFlags & ImGuiChildFlags_AlwaysUseWindowPadding) && window->WindowBorderSize == 0.0f) window->WindowPadding = ImVec2(0.0f, (flags & ImGuiWindowFlags_MenuBar) ? style.WindowPadding.y : 0.0f); // Lock menu offset so size calculation can use it as menu-bar windows need a minimum size. window->DC.MenuBarOffset.x = ImMax(ImMax(window->WindowPadding.x, style.ItemSpacing.x), g.NextWindowData.MenuBarOffsetMinVal.x); window->DC.MenuBarOffset.y = g.NextWindowData.MenuBarOffsetMinVal.y; + window->TitleBarHeight = (flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : g.FontSize + g.Style.FramePadding.y * 2.0f; + window->MenuBarHeight = (flags & ImGuiWindowFlags_MenuBar) ? window->DC.MenuBarOffset.y + g.FontSize + g.Style.FramePadding.y * 2.0f : 0.0f; + // Depending on condition we use previous or current window size to compare against contents size to decide if a scrollbar should be visible. + // Those flags will be altered further down in the function depending on more conditions. bool use_current_size_for_scrollbar_x = window_just_created; bool use_current_size_for_scrollbar_y = window_just_created; + if (window_size_x_set_by_api && window->ContentSizeExplicit.x != 0.0f) + use_current_size_for_scrollbar_x = true; + if (window_size_y_set_by_api && window->ContentSizeExplicit.y != 0.0f) // #7252 + use_current_size_for_scrollbar_y = true; // Collapse window by double-clicking on title bar // At this point we don't have a clipping rectangle setup yet, so we can use the title bar area for hit detection and drawing if (!(flags & ImGuiWindowFlags_NoTitleBar) && !(flags & ImGuiWindowFlags_NoCollapse)) { - // We don't use a regular button+id to test for double-click on title bar (mostly due to legacy reason, could be fixed), so verify that we don't have items over the title bar. + // We don't use a regular button+id to test for double-click on title bar (mostly due to legacy reason, could be fixed), + // so verify that we don't have items over the title bar. ImRect title_bar_rect = window->TitleBarRect(); - if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseClickedCount[0] == 2) - window->WantCollapseToggle = true; + if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && g.ActiveId == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max)) + if (g.IO.MouseClickedCount[0] == 2 && GetKeyOwner(ImGuiKey_MouseLeft) == ImGuiKeyOwner_NoOwner) + window->WantCollapseToggle = true; if (window->WantCollapseToggle) { window->Collapsed = !window->Collapsed; @@ -6469,11 +7235,11 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // SIZE // Outer Decoration Sizes - // (we need to clear ScrollbarSize immediatly as CalcWindowAutoFitSize() needs it and can be called from other locations). + // (we need to clear ScrollbarSize immediately as CalcWindowAutoFitSize() needs it and can be called from other locations). const ImVec2 scrollbar_sizes_from_last_frame = window->ScrollbarSizes; window->DecoOuterSizeX1 = 0.0f; window->DecoOuterSizeX2 = 0.0f; - window->DecoOuterSizeY1 = window->TitleBarHeight() + window->MenuBarHeight(); + window->DecoOuterSizeY1 = window->TitleBarHeight + window->MenuBarHeight; window->DecoOuterSizeY2 = 0.0f; window->ScrollbarSizes = ImVec2(0.0f, 0.0f); @@ -6557,7 +7323,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) if (!window_pos_set_by_api && !(flags & ImGuiWindowFlags_ChildWindow)) if (viewport_rect.GetWidth() > 0.0f && viewport_rect.GetHeight() > 0.0f) ClampWindowPos(window, visibility_rect); - window->Pos = ImFloor(window->Pos); + window->Pos = ImTrunc(window->Pos); // Lock window rounding for the frame (so that altering them doesn't cause inconsistencies) // Large values tend to lead to variety of artifacts and are not recommended. @@ -6590,13 +7356,19 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) #endif // Handle manual resize: Resize Grips, Borders, Gamepad - int border_held = -1; + int border_hovered = -1, border_held = -1; ImU32 resize_grip_col[4] = {}; - const int resize_grip_count = g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // Allow resize from lower-left if we have the mouse cursor feedback for it. - const float resize_grip_draw_size = IM_FLOOR(ImMax(g.FontSize * 1.10f, window->WindowRounding + 1.0f + g.FontSize * 0.2f)); + const int resize_grip_count = ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup)) ? 0 : g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // Allow resize from lower-left if we have the mouse cursor feedback for it. + const float resize_grip_draw_size = IM_TRUNC(ImMax(g.FontSize * 1.10f, window->WindowRounding + 1.0f + g.FontSize * 0.2f)); if (!window->Collapsed) - if (UpdateWindowManualResize(window, size_auto_fit, &border_held, resize_grip_count, &resize_grip_col[0], visibility_rect)) - use_current_size_for_scrollbar_x = use_current_size_for_scrollbar_y = true; + if (int auto_fit_mask = UpdateWindowManualResize(window, size_auto_fit, &border_hovered, &border_held, resize_grip_count, &resize_grip_col[0], visibility_rect)) + { + if (auto_fit_mask & (1 << ImGuiAxis_X)) + use_current_size_for_scrollbar_x = true; + if (auto_fit_mask & (1 << ImGuiAxis_Y)) + use_current_size_for_scrollbar_y = true; + } + window->ResizeBorderHovered = (signed char)border_hovered; window->ResizeBorderHeld = (signed char)border_held; // SCROLLBAR VISIBILITY @@ -6616,7 +7388,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->ScrollbarY = (flags & ImGuiWindowFlags_AlwaysVerticalScrollbar) || ((needed_size_from_last_frame.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar)); window->ScrollbarX = (flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar) || ((needed_size_from_last_frame.x > size_x_for_scrollbars - (window->ScrollbarY ? style.ScrollbarSize : 0.0f)) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar)); if (window->ScrollbarX && !window->ScrollbarY) - window->ScrollbarY = (needed_size_from_last_frame.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar); + window->ScrollbarY = (needed_size_from_last_frame.y > size_y_for_scrollbars - style.ScrollbarSize) && !(flags & ImGuiWindowFlags_NoScrollbar); window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->ScrollbarX ? style.ScrollbarSize : 0.0f); // Amend the partially filled window->DecorationXXX values. @@ -6651,24 +7423,30 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->InnerRect.Max.y = window->Pos.y + window->Size.y - window->DecoOuterSizeY2; // Inner clipping rectangle. - // Will extend a little bit outside the normal work region. - // This is to allow e.g. Selectable or CollapsingHeader or some separators to cover that space. - // Force round operator last to ensure that e.g. (int)(max.x-min.x) in user's render code produce correct result. + // - Extend a outside of normal work region up to borders. + // - This is to allow e.g. Selectable or CollapsingHeader or some separators to cover that space. + // - It also makes clipped items be more noticeable. + // - And is consistent on both axis (prior to 2024/05/03 ClipRect used WindowPadding.x * 0.5f on left and right edge), see #3312 + // - Force round operator last to ensure that e.g. (int)(max.x-min.x) in user's render code produce correct result. // Note that if our window is collapsed we will end up with an inverted (~null) clipping rectangle which is the correct behavior. // Affected by window/frame border size. Used by: // - Begin() initial clip rect float top_border_size = (((flags & ImGuiWindowFlags_MenuBar) || !(flags & ImGuiWindowFlags_NoTitleBar)) ? style.FrameBorderSize : window->WindowBorderSize); - window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerRect.Min.x + ImMax(ImFloor(window->WindowPadding.x * 0.5f), window->WindowBorderSize)); - window->InnerClipRect.Min.y = ImFloor(0.5f + window->InnerRect.Min.y + top_border_size); - window->InnerClipRect.Max.x = ImFloor(0.5f + window->InnerRect.Max.x - ImMax(ImFloor(window->WindowPadding.x * 0.5f), window->WindowBorderSize)); - window->InnerClipRect.Max.y = ImFloor(0.5f + window->InnerRect.Max.y - window->WindowBorderSize); + + // Try to match the fact that our border is drawn centered over the window rectangle, rather than inner. + // This is why we do a *0.5f here. We don't currently even technically support large values for WindowBorderSize, + // see e.g #7887 #7888, but may do after we move the window border to become an inner border (and then we can remove the 0.5f here). + window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerRect.Min.x + window->WindowBorderSize * 0.5f); + window->InnerClipRect.Min.y = ImFloor(0.5f + window->InnerRect.Min.y + top_border_size * 0.5f); + window->InnerClipRect.Max.x = ImFloor(window->InnerRect.Max.x - window->WindowBorderSize * 0.5f); + window->InnerClipRect.Max.y = ImFloor(window->InnerRect.Max.y - window->WindowBorderSize * 0.5f); window->InnerClipRect.ClipWithFull(host_rect); // Default item width. Make it proportional to window size if window manually resizes if (window->Size.x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_AlwaysAutoResize)) - window->ItemWidthDefault = ImFloor(window->Size.x * 0.65f); + window->ItemWidthDefault = ImTrunc(window->Size.x * 0.65f); else - window->ItemWidthDefault = ImFloor(g.FontSize * 16.0f); + window->ItemWidthDefault = ImTrunc(g.FontSize * 16.0f); // SCROLLING @@ -6729,8 +7507,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) const bool allow_scrollbar_y = !(flags & ImGuiWindowFlags_NoScrollbar); const float work_rect_size_x = (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : ImMax(allow_scrollbar_x ? window->ContentSize.x : 0.0f, window->Size.x - window->WindowPadding.x * 2.0f - (window->DecoOuterSizeX1 + window->DecoOuterSizeX2))); const float work_rect_size_y = (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : ImMax(allow_scrollbar_y ? window->ContentSize.y : 0.0f, window->Size.y - window->WindowPadding.y * 2.0f - (window->DecoOuterSizeY1 + window->DecoOuterSizeY2))); - window->WorkRect.Min.x = ImFloor(window->InnerRect.Min.x - window->Scroll.x + ImMax(window->WindowPadding.x, window->WindowBorderSize)); - window->WorkRect.Min.y = ImFloor(window->InnerRect.Min.y - window->Scroll.y + ImMax(window->WindowPadding.y, window->WindowBorderSize)); + window->WorkRect.Min.x = ImTrunc(window->InnerRect.Min.x - window->Scroll.x + ImMax(window->WindowPadding.x, window->WindowBorderSize)); + window->WorkRect.Min.y = ImTrunc(window->InnerRect.Min.y - window->Scroll.y + ImMax(window->WindowPadding.y, window->WindowBorderSize)); window->WorkRect.Max.x = window->WorkRect.Min.x + work_rect_size_x; window->WorkRect.Max.y = window->WorkRect.Min.y + work_rect_size_y; window->ParentWorkRect = window->WorkRect; @@ -6775,7 +7553,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->DC.MenuBarAppending = false; window->DC.MenuColumns.Update(style.ItemSpacing.x, window_just_activated_by_user); window->DC.TreeDepth = 0; - window->DC.TreeJumpToParentOnPopMask = 0x00; + window->DC.TreeHasStackDataDepthMask = 0x00; window->DC.ChildWindows.resize(0); window->DC.StateStorage = &window->StateStorage; window->DC.CurrentColumns = NULL; @@ -6786,6 +7564,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->DC.TextWrapPos = -1.0f; // disabled window->DC.ItemWidthStack.resize(0); window->DC.TextWrapPosStack.resize(0); + if (flags & ImGuiWindowFlags_Modal) + window->DC.ModalDimBgColor = ColorConvertFloat4ToU32(GetStyleColorVec4(ImGuiCol_ModalWindowDimBg)); if (window->AutoFitFramesX > 0) window->AutoFitFramesX--; @@ -6808,6 +7588,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Clear hit test shape every frame window->HitTestHoleSize.x = window->HitTestHoleSize.y = 0; + if (flags & ImGuiWindowFlags_Tooltip) + g.TooltipPreviousWindow = window; + // Pressing CTRL+C while holding on a window copy its content to the clipboard // This works but 1. doesn't handle multiple Begin/End pairs, 2. recursing into another Begin/End pair - so we need to work that out and add better logging scope. // Maybe we can support CTRL+C on every element? @@ -6820,7 +7603,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // We fill last item data based on Title Bar/Tab, in order for IsItemHovered() and IsItemActive() to be usable after Begin(). // This is useful to allow creating context menus on title bar only, etc. - SetLastItemData(window->MoveId, g.CurrentItemFlags, IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0, title_bar_rect); + SetLastItemDataForWindow(window, title_bar_rect); // [DEBUG] #ifndef IMGUI_DISABLE_DEBUG_TOOLS @@ -6836,11 +7619,17 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) } else { + // Skip refresh always mark active + if (window->SkipRefresh) + SetWindowActiveForSkipRefresh(window); + // Append SetCurrentWindow(window); + SetLastItemDataForWindow(window, window->TitleBarRect()); } - PushClipRect(window->InnerClipRect.Min, window->InnerClipRect.Max, true); + if (!window->SkipRefresh) + PushClipRect(window->InnerClipRect.Min, window->InnerClipRect.Max, true); // Clear 'accessed' flag last thing (After PushClipRect which will set the flag. We want the flag to stay false when the default "Debug" window is unused) window->WriteAccessed = false; @@ -6848,20 +7637,22 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) g.NextWindowData.ClearFlags(); // Update visibility - if (first_begin_of_the_frame) + if (first_begin_of_the_frame && !window->SkipRefresh) { - if (flags & ImGuiWindowFlags_ChildWindow) + if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_ChildMenu)) { // Child window can be out of sight and have "negative" clip windows. // Mark them as collapsed so commands are skipped earlier (we can't manually collapse them because they have no title bar). IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0); - if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) // FIXME: Doesn't make sense for ChildWindow?? - { - const bool nav_request = (flags & ImGuiWindowFlags_NavFlattened) && (g.NavAnyRequest && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav); - if (!g.LogEnabled && !nav_request) - if (window->OuterRectClipped.Min.x >= window->OuterRectClipped.Max.x || window->OuterRectClipped.Min.y >= window->OuterRectClipped.Max.y) + const bool nav_request = (window->ChildFlags & ImGuiChildFlags_NavFlattened) && (g.NavAnyRequest && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav); + if (!g.LogEnabled && !nav_request) + if (window->OuterRectClipped.Min.x >= window->OuterRectClipped.Max.x || window->OuterRectClipped.Min.y >= window->OuterRectClipped.Max.y) + { + if (window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) + window->HiddenFramesCannotSkipItems = 1; + else window->HiddenFramesCanSkipItems = 1; - } + } // Hide along with parent or if parent is collapsed if (parent_window && (parent_window->Collapsed || parent_window->HiddenFramesCanSkipItems > 0)) @@ -6892,19 +7683,33 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) skip_items = true; window->SkipItems = skip_items; } - - // [DEBUG] io.ConfigDebugBeginReturnValue override return value to test Begin/End and BeginChild/EndChild behaviors. - // (The implicit fallback window is NOT automatically ended allowing it to always be able to receive commands without crashing) - if (!window->IsFallbackWindow && ((g.IO.ConfigDebugBeginReturnValueOnce && window_just_created) || (g.IO.ConfigDebugBeginReturnValueLoop && g.DebugBeginReturnValueCullDepth == g.CurrentWindowStack.Size))) + else if (first_begin_of_the_frame) { - if (window->AutoFitFramesX > 0) { window->AutoFitFramesX++; } - if (window->AutoFitFramesY > 0) { window->AutoFitFramesY++; } - return false; + // Skip refresh mode + window->SkipItems = true; } - return !window->SkipItems; -} - + // [DEBUG] io.ConfigDebugBeginReturnValue override return value to test Begin/End and BeginChild/EndChild behaviors. + // (The implicit fallback window is NOT automatically ended allowing it to always be able to receive commands without crashing) +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + if (!window->IsFallbackWindow) + if ((g.IO.ConfigDebugBeginReturnValueOnce && window_just_created) || (g.IO.ConfigDebugBeginReturnValueLoop && g.DebugBeginReturnValueCullDepth == g.CurrentWindowStack.Size)) + { + if (window->AutoFitFramesX > 0) { window->AutoFitFramesX++; } + if (window->AutoFitFramesY > 0) { window->AutoFitFramesY++; } + return false; + } +#endif + + return !window->SkipItems; +} + +static void ImGui::SetLastItemDataForWindow(ImGuiWindow* window, const ImRect& rect) +{ + ImGuiContext& g = *GImGui; + SetLastItemData(window->MoveId, g.CurrentItemFlags, IsMouseHoveringRect(rect.Min, rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0, rect); +} + void ImGui::End() { ImGuiContext& g = *GImGui; @@ -6916,7 +7721,7 @@ void ImGui::End() IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size > 1, "Calling End() too many times!"); return; } - IM_ASSERT(g.CurrentWindowStack.Size > 0); + ImGuiWindowStackData& window_stack_data = g.CurrentWindowStack.back(); // Error checking: verify that user doesn't directly call End() on a child window. if (window->Flags & ImGuiWindowFlags_ChildWindow) @@ -6925,8 +7730,17 @@ void ImGui::End() // Close anything that is open if (window->DC.CurrentColumns) EndColumns(); - PopClipRect(); // Inner window clip rectangle + if (!window->SkipRefresh) + PopClipRect(); // Inner window clip rectangle PopFocusScope(); + if (window_stack_data.DisabledOverrideReenable && window->RootWindow == window) + EndDisabledOverrideReenable(); + + if (window->SkipRefresh) + { + IM_ASSERT(window->DrawList == NULL); + window->DrawList = &window->DrawListInst; + } // Stop logging if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging @@ -6936,12 +7750,16 @@ void ImGui::End() ErrorCheckUsingSetCursorPosToExtendParentBoundaries(); // Pop from window stack - g.LastItemData = g.CurrentWindowStack.back().ParentLastItemDataBackup; + g.LastItemData = window_stack_data.ParentLastItemDataBackup; if (window->Flags & ImGuiWindowFlags_ChildMenu) - g.BeginMenuCount--; + g.BeginMenuDepth--; if (window->Flags & ImGuiWindowFlags_Popup) g.BeginPopupStack.pop_back(); - g.CurrentWindowStack.back().StackSizesOnBegin.CompareWithContextState(&g); + + // Error handling, state recovery + if (g.IO.ConfigErrorRecovery) + ErrorRecoveryTryToRecoverWindowState(&window_stack_data.StackSizesInBegin); + g.CurrentWindowStack.pop_back(); SetCurrentWindow(g.CurrentWindowStack.Size == 0 ? NULL : g.CurrentWindowStack.back().Window); } @@ -7033,9 +7851,13 @@ void ImGui::FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags) if ((flags & ImGuiFocusRequestFlags_UnlessBelowModal) && (g.NavWindow != window)) // Early out in common case. if (ImGuiWindow* blocking_modal = FindBlockingModal(window)) { + // This block would typically be reached in two situations: + // - API call to FocusWindow() with a window under a modal and ImGuiFocusRequestFlags_UnlessBelowModal flag. + // - User clicking on void or anything behind a modal while a modal is open (window == NULL) IMGUI_DEBUG_LOG_FOCUS("[focus] FocusWindow(\"%s\", UnlessBelowModal): prevented by \"%s\".\n", window ? window->Name : "", blocking_modal->Name); if (window && window == window->RootWindow && (window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0) - BringWindowToDisplayBehind(window, blocking_modal); // Still bring to right below modal. + BringWindowToDisplayBehind(window, blocking_modal); // Still bring right under modal. (FIXME: Could move in focus list too?) + ClosePopupsOverWindow(GetTopMostPopupModal(), false); // Note how we need to use GetTopMostPopupModal() aad NOT blocking_modal, to handle nested modals return; } @@ -7047,12 +7869,13 @@ void ImGui::FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags) if (g.NavWindow != window) { SetNavWindow(window); - if (window && g.NavDisableMouseHover) + if (window && g.NavHighlightItemUnderNav) g.NavMousePosDirty = true; g.NavId = window ? window->NavLastIds[0] : 0; // Restore NavId g.NavLayer = ImGuiNavLayer_Main; - g.NavFocusScopeId = window ? window->NavRootFocusScopeId : 0; + SetNavFocusScope(window ? window->NavRootFocusScopeId : 0); g.NavIdIsAlive = false; + g.NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid; // Close popups if any ClosePopupsOverWindow(window, false); @@ -7100,7 +7923,6 @@ void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWind { // We may later decide to test for different NoXXXInputs based on the active navigation input (mouse vs nav) but that may feel more confusing to the user. ImGuiWindow* window = g.WindowsFocusOrder[i]; - IM_ASSERT(window == window->RootWindow); if (window == ignore_window || !window->WasActive) continue; if ((window->Flags & (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) != (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) @@ -7121,30 +7943,45 @@ void ImGui::SetCurrentFont(ImFont* font) g.Font = font; g.FontBaseSize = ImMax(1.0f, g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale); g.FontSize = g.CurrentWindow ? g.CurrentWindow->CalcFontSize() : 0.0f; + g.FontScale = g.FontSize / g.Font->FontSize; ImFontAtlas* atlas = g.Font->ContainerAtlas; g.DrawListSharedData.TexUvWhitePixel = atlas->TexUvWhitePixel; g.DrawListSharedData.TexUvLines = atlas->TexUvLines; g.DrawListSharedData.Font = g.Font; g.DrawListSharedData.FontSize = g.FontSize; + g.DrawListSharedData.FontScale = g.FontScale; } +// Use ImDrawList::_SetTextureID(), making our shared g.FontStack[] authorative against window-local ImDrawList. +// - Whereas ImDrawList::PushTextureID()/PopTextureID() is not to be used across Begin() calls. +// - Note that we don't propagate current texture id when e.g. Begin()-ing into a new window, we never really did... +// - Some code paths never really fully worked with multiple atlas textures. +// - The right-ish solution may be to remove _SetTextureID() and make AddText/RenderText lazily call PushTextureID()/PopTextureID() +// the same way AddImage() does, but then all other primitives would also need to? I don't think we should tackle this problem +// because we have a concrete need and a test bed for multiple atlas textures. void ImGui::PushFont(ImFont* font) { ImGuiContext& g = *GImGui; - if (!font) + if (font == NULL) font = GetDefaultFont(); - SetCurrentFont(font); g.FontStack.push_back(font); - g.CurrentWindow->DrawList->PushTextureID(font->ContainerAtlas->TexID); + SetCurrentFont(font); + g.CurrentWindow->DrawList->_SetTextureID(font->ContainerAtlas->TexID); } void ImGui::PopFont() { ImGuiContext& g = *GImGui; - g.CurrentWindow->DrawList->PopTextureID(); + if (g.FontStack.Size <= 0) + { + IM_ASSERT_USER_ERROR(0, "Calling PopFont() too many times!"); + return; + } g.FontStack.pop_back(); - SetCurrentFont(g.FontStack.empty() ? GetDefaultFont() : g.FontStack.back()); + ImFont* font = g.FontStack.Size == 0 ? GetDefaultFont() : g.FontStack.back(); + SetCurrentFont(font); + g.CurrentWindow->DrawList->_SetTextureID(font->ContainerAtlas->TexID); } void ImGui::PushItemFlag(ImGuiItemFlags option, bool enabled) @@ -7163,7 +8000,11 @@ void ImGui::PushItemFlag(ImGuiItemFlags option, bool enabled) void ImGui::PopItemFlag() { ImGuiContext& g = *GImGui; - IM_ASSERT(g.ItemFlagsStack.Size > 1); // Too many calls to PopItemFlag() - we always leave a 0 at the bottom of the stack. + if (g.ItemFlagsStack.Size <= 1) + { + IM_ASSERT_USER_ERROR(0, "Calling PopItemFlag() too many times!"); + return; + } g.ItemFlagsStack.pop_back(); g.CurrentItemFlags = g.ItemFlagsStack.back(); } @@ -7172,8 +8013,9 @@ void ImGui::PopItemFlag() // - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled) // - Visually this is currently altering alpha, but it is expected that in a future styling system this would work differently. // - Feedback welcome at https://github.com/ocornut/imgui/issues/211 -// - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(False)/EndDisabled() best to avoid it. -// - Optimized shortcuts instead of PushStyleVar() + PushItemFlag() +// - BeginDisabled(false)/EndDisabled() essentially does nothing but is provided to facilitate use of boolean expressions. +// (as a micro-optimization: if you have tens of thousands of BeginDisabled(false)/EndDisabled() pairs, you might want to reformulate your code to avoid making those calls) +// - Note: mixing up BeginDisabled() and PushItemFlag(ImGuiItemFlags_Disabled) is currently NOT SUPPORTED. void ImGui::BeginDisabled(bool disabled) { ImGuiContext& g = *GImGui; @@ -7185,14 +8027,18 @@ void ImGui::BeginDisabled(bool disabled) } if (was_disabled || disabled) g.CurrentItemFlags |= ImGuiItemFlags_Disabled; - g.ItemFlagsStack.push_back(g.CurrentItemFlags); + g.ItemFlagsStack.push_back(g.CurrentItemFlags); // FIXME-OPT: can we simply skip this and use DisabledStackSize? g.DisabledStackSize++; } void ImGui::EndDisabled() { ImGuiContext& g = *GImGui; - IM_ASSERT(g.DisabledStackSize > 0); + if (g.DisabledStackSize <= 0) + { + IM_ASSERT_USER_ERROR(0, "Calling EndDisabled() too many times!"); + return; + } g.DisabledStackSize--; bool was_disabled = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0; //PopItemFlag(); @@ -7202,36 +8048,46 @@ void ImGui::EndDisabled() g.Style.Alpha = g.DisabledAlphaBackup; //PopStyleVar(); } -void ImGui::PushTabStop(bool tab_stop) -{ - PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); -} - -void ImGui::PopTabStop() -{ - PopItemFlag(); -} - -void ImGui::PushButtonRepeat(bool repeat) +// Could have been called BeginDisabledDisable() but it didn't want to be award nominated for most awkward function name. +// Ideally we would use a shared e.g. BeginDisabled()->BeginDisabledEx() but earlier needs to be optimal. +// The whole code for this is awkward, will reevaluate if we find a way to implement SetNextItemDisabled(). +void ImGui::BeginDisabledOverrideReenable() { - PushItemFlag(ImGuiItemFlags_ButtonRepeat, repeat); + ImGuiContext& g = *GImGui; + IM_ASSERT(g.CurrentItemFlags & ImGuiItemFlags_Disabled); + g.Style.Alpha = g.DisabledAlphaBackup; + g.CurrentItemFlags &= ~ImGuiItemFlags_Disabled; + g.ItemFlagsStack.push_back(g.CurrentItemFlags); + g.DisabledStackSize++; } -void ImGui::PopButtonRepeat() +void ImGui::EndDisabledOverrideReenable() { - PopItemFlag(); + ImGuiContext& g = *GImGui; + g.DisabledStackSize--; + IM_ASSERT(g.DisabledStackSize > 0); + g.ItemFlagsStack.pop_back(); + g.CurrentItemFlags = g.ItemFlagsStack.back(); + g.Style.Alpha = g.DisabledAlphaBackup * g.Style.DisabledAlpha; } void ImGui::PushTextWrapPos(float wrap_pos_x) { - ImGuiWindow* window = GetCurrentWindow(); + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; window->DC.TextWrapPosStack.push_back(window->DC.TextWrapPos); window->DC.TextWrapPos = wrap_pos_x; } void ImGui::PopTextWrapPos() { - ImGuiWindow* window = GetCurrentWindow(); + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + if (window->DC.TextWrapPosStack.Size <= 0) + { + IM_ASSERT_USER_ERROR(0, "Calling PopTextWrapPos() too many times!"); + return; + } window->DC.TextWrapPos = window->DC.TextWrapPosStack.back(); window->DC.TextWrapPosStack.pop_back(); } @@ -7298,11 +8154,15 @@ bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_b return false; } +// Is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See ImGuiHoveredFlags_ for options. +// IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app, +// you should not use this function! Use the 'io.WantCaptureMouse' boolean for that! +// Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details. bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags) { - IM_ASSERT((flags & ~ImGuiHoveredFlags_AllowedMaskForIsWindowHovered) == 0 && "Invalid flags for IsWindowHovered()!"); - ImGuiContext& g = *GImGui; + IM_ASSERT_USER_ERROR((flags & ~ImGuiHoveredFlags_AllowedMaskForIsWindowHovered) == 0, "Invalid flags for IsWindowHovered()!"); + ImGuiWindow* ref_window = g.HoveredWindow; ImGuiWindow* cur_window = g.CurrentWindow; if (ref_window == NULL) @@ -7332,11 +8192,11 @@ bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags) // When changing hovered window we requires a bit of stationary delay before activating hover timer. // FIXME: We don't support delay other than stationary one for now, other delay would need a way - // to fullfill the possibility that multiple IsWindowHovered() with varying flag could return true + // to fulfill the possibility that multiple IsWindowHovered() with varying flag could return true // for different windows of the hierarchy. Possibly need a Hash(Current+Flags) ==> (Timer) cache. // We can implement this for _Stationary because the data is linked to HoveredWindow rather than CurrentWindow. if (flags & ImGuiHoveredFlags_ForTooltip) - flags |= g.Style.HoverFlagsForTooltipMouse; + flags = ApplyHoverFlagsForTooltip(flags, g.Style.HoverFlagsForTooltipMouse); if ((flags & ImGuiHoveredFlags_Stationary) != 0 && g.HoverWindowUnlockedStationaryId != ref_window->ID) return false; @@ -7404,7 +8264,7 @@ void ImGui::SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond) // Set const ImVec2 old_pos = window->Pos; - window->Pos = ImFloor(pos); + window->Pos = ImTrunc(pos); ImVec2 offset = window->Pos - old_pos; if (offset.x == 0.0f && offset.y == 0.0f) return; @@ -7442,18 +8302,22 @@ void ImGui::SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond con IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. window->SetWindowSizeAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); + // Enable auto-fit (not done in BeginChild() path unless appearing or combined with ImGuiChildFlags_AlwaysAutoResize) + if ((window->Flags & ImGuiWindowFlags_ChildWindow) == 0 || window->Appearing || (window->ChildFlags & ImGuiChildFlags_AlwaysAutoResize) != 0) + window->AutoFitFramesX = (size.x <= 0.0f) ? 2 : 0; + if ((window->Flags & ImGuiWindowFlags_ChildWindow) == 0 || window->Appearing || (window->ChildFlags & ImGuiChildFlags_AlwaysAutoResize) != 0) + window->AutoFitFramesY = (size.y <= 0.0f) ? 2 : 0; + // Set ImVec2 old_size = window->SizeFull; - window->AutoFitFramesX = (size.x <= 0.0f) ? 2 : 0; - window->AutoFitFramesY = (size.y <= 0.0f) ? 2 : 0; if (size.x <= 0.0f) window->AutoFitOnlyGrows = false; else - window->SizeFull.x = IM_FLOOR(size.x); + window->SizeFull.x = IM_TRUNC(size.x); if (size.y <= 0.0f) window->AutoFitOnlyGrows = false; else - window->SizeFull.y = IM_FLOOR(size.y); + window->SizeFull.y = IM_TRUNC(size.y); if (old_size.x != window->SizeFull.x || old_size.y != window->SizeFull.y) MarkIniSettingsDirty(window); } @@ -7487,7 +8351,7 @@ void ImGui::SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const I window->HitTestHoleOffset = ImVec2ih(pos - window->Pos); } -void ImGui::SetWindowHiddendAndSkipItemsForCurrentFrame(ImGuiWindow* window) +void ImGui::SetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window) { window->Hidden = window->SkipItems = true; window->HiddenFramesCanSkipItems = 1; @@ -7553,6 +8417,10 @@ void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiCond cond) g.NextWindowData.SizeCond = cond ? cond : ImGuiCond_Always; } +// For each axis: +// - Use 0.0f as min or FLT_MAX as max if you don't want limits, e.g. size_min = (500.0f, 0.0f), size_max = (FLT_MAX, FLT_MAX) sets a minimum width. +// - Use -1 for both min and max of same axis to preserve current size which itself is a constraint. +// - See "Demo->Examples->Constrained-resizing window" for examples. void ImGui::SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback, void* custom_callback_user_data) { ImGuiContext& g = *GImGui; @@ -7568,7 +8436,7 @@ void ImGui::SetNextWindowContentSize(const ImVec2& size) { ImGuiContext& g = *GImGui; g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasContentSize; - g.NextWindowData.ContentSizeVal = ImFloor(size); + g.NextWindowData.ContentSizeVal = ImTrunc(size); } void ImGui::SetNextWindowScroll(const ImVec2& scroll) @@ -7600,6 +8468,14 @@ void ImGui::SetNextWindowBgAlpha(float alpha) g.NextWindowData.BgAlphaVal = alpha; } +// This is experimental and meant to be a toy for exploring a future/wider range of features. +void ImGui::SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags) +{ + ImGuiContext& g = *GImGui; + g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasRefreshPolicy; + g.NextWindowData.RefreshFlagsVal = flags; +} + ImDrawList* ImGui::GetWindowDrawList() { ImGuiWindow* window = GetCurrentWindow(); @@ -7628,21 +8504,56 @@ void ImGui::SetWindowFontScale(float scale) ImGuiWindow* window = GetCurrentWindow(); window->FontWindowScale = scale; g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize(); + g.FontScale = g.DrawListSharedData.FontScale = g.FontSize / g.Font->FontSize; } void ImGui::PushFocusScope(ImGuiID id) { ImGuiContext& g = *GImGui; - g.FocusScopeStack.push_back(id); + ImGuiFocusScopeData data; + data.ID = id; + data.WindowID = g.CurrentWindow->ID; + g.FocusScopeStack.push_back(data); g.CurrentFocusScopeId = id; } void ImGui::PopFocusScope() { ImGuiContext& g = *GImGui; - IM_ASSERT(g.FocusScopeStack.Size > 0); // Too many PopFocusScope() ? + if (g.FocusScopeStack.Size <= g.StackSizesInBeginForCurrentWindow->SizeOfFocusScopeStack) + { + IM_ASSERT_USER_ERROR(0, "Calling PopFocusScope() too many times!"); + return; + } g.FocusScopeStack.pop_back(); - g.CurrentFocusScopeId = g.FocusScopeStack.Size ? g.FocusScopeStack.back() : 0; + g.CurrentFocusScopeId = g.FocusScopeStack.Size ? g.FocusScopeStack.back().ID : 0; +} + +void ImGui::SetNavFocusScope(ImGuiID focus_scope_id) +{ + ImGuiContext& g = *GImGui; + g.NavFocusScopeId = focus_scope_id; + g.NavFocusRoute.resize(0); // Invalidate + if (focus_scope_id == 0) + return; + IM_ASSERT(g.NavWindow != NULL); + + // Store current path (in reverse order) + if (focus_scope_id == g.CurrentFocusScopeId) + { + // Top of focus stack contains local focus scopes inside current window + for (int n = g.FocusScopeStack.Size - 1; n >= 0 && g.FocusScopeStack.Data[n].WindowID == g.CurrentWindow->ID; n--) + g.NavFocusRoute.push_back(g.FocusScopeStack.Data[n]); + } + else if (focus_scope_id == g.NavWindow->NavRootFocusScopeId) + g.NavFocusRoute.push_back({ focus_scope_id, g.NavWindow->ID }); + else + return; + + // Then follow on manually set ParentWindowForFocusRoute field (#6798) + for (ImGuiWindow* window = g.NavWindow->ParentWindowForFocusRoute; window != NULL; window = window->ParentWindowForFocusRoute) + g.NavFocusRoute.push_back({ window->NavRootFocusScopeId, window->ID }); + IM_ASSERT(g.NavFocusRoute.Size < 100); // Maximum depth is technically 251 as per CalcRoutingScore(): 254 - 3 } // Focus = move navigation cursor, set scrolling, set focus window. @@ -7657,7 +8568,7 @@ void ImGui::FocusItem() return; } - ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_FocusApi | ImGuiNavMoveFlags_NoSelect; + ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_FocusApi | ImGuiNavMoveFlags_NoSetNavCursorVisible | ImGuiNavMoveFlags_NoSelect; ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY; SetNavWindow(window); NavMoveRequestSubmit(ImGuiDir_None, ImGuiDir_Up, move_flags, scroll_flags); @@ -7692,7 +8603,7 @@ void ImGui::SetKeyboardFocusHere(int offset) SetNavWindow(window); - ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_Activate | ImGuiNavMoveFlags_FocusApi; + ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_Activate | ImGuiNavMoveFlags_FocusApi | ImGuiNavMoveFlags_NoSetNavCursorVisible; ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY; NavMoveRequestSubmit(ImGuiDir_None, offset < 0 ? ImGuiDir_Up : ImGuiDir_Down, move_flags, scroll_flags); // FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable. if (offset == -1) @@ -7736,6 +8647,80 @@ ImGuiStorage* ImGui::GetStateStorage() return window->DC.StateStorage; } +bool ImGui::IsRectVisible(const ImVec2& size) +{ + ImGuiWindow* window = GImGui->CurrentWindow; + return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size)); +} + +bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) +{ + ImGuiWindow* window = GImGui->CurrentWindow; + return window->ClipRect.Overlaps(ImRect(rect_min, rect_max)); +} + +//----------------------------------------------------------------------------- +// [SECTION] ID STACK +//----------------------------------------------------------------------------- + +// This is one of the very rare legacy case where we use ImGuiWindow methods, +// it should ideally be flattened at some point but it's been used a lots by widgets. +IM_MSVC_RUNTIME_CHECKS_OFF +ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end) +{ + ImGuiID seed = IDStack.back(); + ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed); +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + ImGuiContext& g = *Ctx; + if (g.DebugHookIdInfo == id) + ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end); +#endif + return id; +} + +ImGuiID ImGuiWindow::GetID(const void* ptr) +{ + ImGuiID seed = IDStack.back(); + ImGuiID id = ImHashData(&ptr, sizeof(void*), seed); +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + ImGuiContext& g = *Ctx; + if (g.DebugHookIdInfo == id) + ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL); +#endif + return id; +} + +ImGuiID ImGuiWindow::GetID(int n) +{ + ImGuiID seed = IDStack.back(); + ImGuiID id = ImHashData(&n, sizeof(n), seed); +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + ImGuiContext& g = *Ctx; + if (g.DebugHookIdInfo == id) + ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL); +#endif + return id; +} + +// This is only used in rare/specific situations to manufacture an ID out of nowhere. +// FIXME: Consider instead storing last non-zero ID + count of successive zero-ID, and combine those? +ImGuiID ImGuiWindow::GetIDFromPos(const ImVec2& p_abs) +{ + ImGuiID seed = IDStack.back(); + ImVec2 p_rel = ImGui::WindowPosAbsToRel(this, p_abs); + ImGuiID id = ImHashData(&p_rel, sizeof(p_rel), seed); + return id; +} + +// " +ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs) +{ + ImGuiID seed = IDStack.back(); + ImRect r_rel = ImGui::WindowRectAbsToRel(this, r_abs); + ImGuiID id = ImHashData(&r_rel, sizeof(r_rel), seed); + return id; +} + void ImGui::PushID(const char* str_id) { ImGuiContext& g = *GImGui; @@ -7773,36 +8758,46 @@ void ImGui::PushOverrideID(ImGuiID id) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; +#ifndef IMGUI_DISABLE_DEBUG_TOOLS if (g.DebugHookIdInfo == id) DebugHookIdInfo(id, ImGuiDataType_ID, NULL, NULL); +#endif window->IDStack.push_back(id); } // Helper to avoid a common series of PushOverrideID -> GetID() -> PopID() call -// (note that when using this pattern, TestEngine's "Stack Tool" will tend to not display the intermediate stack level. +// (note that when using this pattern, ID Stack Tool will tend to not display the intermediate stack level. // for that to work we would need to do PushOverrideID() -> ItemAdd() -> PopID() which would alter widget code a little more) ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed) { ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed); +#ifndef IMGUI_DISABLE_DEBUG_TOOLS ImGuiContext& g = *GImGui; if (g.DebugHookIdInfo == id) DebugHookIdInfo(id, ImGuiDataType_String, str, str_end); +#endif return id; } ImGuiID ImGui::GetIDWithSeed(int n, ImGuiID seed) { ImGuiID id = ImHashData(&n, sizeof(n), seed); +#ifndef IMGUI_DISABLE_DEBUG_TOOLS ImGuiContext& g = *GImGui; if (g.DebugHookIdInfo == id) DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL); +#endif return id; } void ImGui::PopID() { ImGuiWindow* window = GImGui->CurrentWindow; - IM_ASSERT(window->IDStack.Size > 1); // Too many PopID(), or could be popping in a wrong/different window? + if (window->IDStack.Size <= 1) + { + IM_ASSERT_USER_ERROR(0, "Calling PopID() too many times!"); + return; + } window->IDStack.pop_back(); } @@ -7824,22 +8819,18 @@ ImGuiID ImGui::GetID(const void* ptr_id) return window->GetID(ptr_id); } -bool ImGui::IsRectVisible(const ImVec2& size) -{ - ImGuiWindow* window = GImGui->CurrentWindow; - return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size)); -} - -bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) +ImGuiID ImGui::GetID(int int_id) { ImGuiWindow* window = GImGui->CurrentWindow; - return window->ClipRect.Overlaps(ImRect(rect_min, rect_max)); + return window->GetID(int_id); } - +IM_MSVC_RUNTIME_CHECKS_RESTORE //----------------------------------------------------------------------------- // [SECTION] INPUTS //----------------------------------------------------------------------------- +// - GetModForLRModKey() [Internal] +// - FixupKeyChord() [Internal] // - GetKeyData() [Internal] // - GetKeyIndex() [Internal] // - GetKeyName() @@ -7869,6 +8860,7 @@ bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) // - IsMouseDragPastThreshold() [Internal] // - IsMouseDragging() // - GetMousePos() +// - SetMousePos() [Internal] // - GetMousePosOnOpeningCurrentPopup() // - IsMousePosValid() // - IsAnyMouseDown() @@ -7900,13 +8892,35 @@ bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) // - Shortcut() [Internal] //----------------------------------------------------------------------------- +static ImGuiKeyChord GetModForLRModKey(ImGuiKey key) +{ + if (key == ImGuiKey_LeftCtrl || key == ImGuiKey_RightCtrl) + return ImGuiMod_Ctrl; + if (key == ImGuiKey_LeftShift || key == ImGuiKey_RightShift) + return ImGuiMod_Shift; + if (key == ImGuiKey_LeftAlt || key == ImGuiKey_RightAlt) + return ImGuiMod_Alt; + if (key == ImGuiKey_LeftSuper || key == ImGuiKey_RightSuper) + return ImGuiMod_Super; + return ImGuiMod_None; +} + +ImGuiKeyChord ImGui::FixupKeyChord(ImGuiKeyChord key_chord) +{ + // Add ImGuiMod_XXXX when a corresponding ImGuiKey_LeftXXX/ImGuiKey_RightXXX is specified. + ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); + if (IsLRModKey(key)) + key_chord |= GetModForLRModKey(key); + return key_chord; +} + ImGuiKeyData* ImGui::GetKeyData(ImGuiContext* ctx, ImGuiKey key) { ImGuiContext& g = *ctx; // Special storage location for mods if (key & ImGuiMod_Mask_) - key = ConvertSingleModFlagToKey(ctx, key); + key = ConvertSingleModFlagToKey(key); #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO IM_ASSERT(key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_NamedKey_END); @@ -7919,6 +8933,7 @@ ImGuiKeyData* ImGui::GetKeyData(ImGuiContext* ctx, ImGuiKey key) } #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO +// Formally moved to obsolete section in 1.90.5 in spite of documented as obsolete since 1.87 ImGuiKey ImGui::GetKeyIndex(ImGuiKey key) { ImGuiContext& g = *GImGui; @@ -7937,11 +8952,13 @@ static const char* const GKeyNames[] = "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", + "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24", "Apostrophe", "Comma", "Minus", "Period", "Slash", "Semicolon", "Equal", "LeftBracket", "Backslash", "RightBracket", "GraveAccent", "CapsLock", "ScrollLock", "NumLock", "PrintScreen", "Pause", "Keypad0", "Keypad1", "Keypad2", "Keypad3", "Keypad4", "Keypad5", "Keypad6", "Keypad7", "Keypad8", "Keypad9", "KeypadDecimal", "KeypadDivide", "KeypadMultiply", "KeypadSubtract", "KeypadAdd", "KeypadEnter", "KeypadEqual", + "AppBack", "AppForward", "GamepadStart", "GamepadBack", "GamepadFaceLeft", "GamepadFaceRight", "GamepadFaceUp", "GamepadFaceDown", "GamepadDpadLeft", "GamepadDpadRight", "GamepadDpadUp", "GamepadDpadDown", @@ -7955,10 +8972,12 @@ IM_STATIC_ASSERT(ImGuiKey_NamedKey_COUNT == IM_ARRAYSIZE(GKeyNames)); const char* ImGui::GetKeyName(ImGuiKey key) { - ImGuiContext& g = *GImGui; + if (key == ImGuiKey_None) + return "None"; #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO - IM_ASSERT((IsNamedKeyOrModKey(key) || key == ImGuiKey_None) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code."); + IM_ASSERT(IsNamedKeyOrMod(key) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code."); #else + ImGuiContext& g = *GImGui; if (IsLegacyKey(key)) { if (g.IO.KeyMap[key] == -1) @@ -7967,28 +8986,34 @@ const char* ImGui::GetKeyName(ImGuiKey key) key = (ImGuiKey)g.IO.KeyMap[key]; } #endif - if (key == ImGuiKey_None) - return "None"; if (key & ImGuiMod_Mask_) - key = ConvertSingleModFlagToKey(&g, key); + key = ConvertSingleModFlagToKey(key); if (!IsNamedKey(key)) return "Unknown"; return GKeyNames[key - ImGuiKey_NamedKey_BEGIN]; } -// ImGuiMod_Shortcut is translated to either Ctrl or Super. -void ImGui::GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size) +// Return untranslated names: on macOS, Cmd key will show as Ctrl, Ctrl key will show as super. +// Lifetime of return value: valid until next call to same function. +const char* ImGui::GetKeyChordName(ImGuiKeyChord key_chord) { ImGuiContext& g = *GImGui; - if (key_chord & ImGuiMod_Shortcut) - key_chord = ConvertShortcutMod(key_chord); - ImFormatString(out_buf, (size_t)out_buf_size, "%s%s%s%s%s", + + const ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); + if (IsLRModKey(key)) + key_chord &= ~GetModForLRModKey(key); // Return "Ctrl+LeftShift" instead of "Ctrl+Shift+LeftShift" + ImFormatString(g.TempKeychordName, IM_ARRAYSIZE(g.TempKeychordName), "%s%s%s%s%s", (key_chord & ImGuiMod_Ctrl) ? "Ctrl+" : "", (key_chord & ImGuiMod_Shift) ? "Shift+" : "", (key_chord & ImGuiMod_Alt) ? "Alt+" : "", - (key_chord & ImGuiMod_Super) ? (g.IO.ConfigMacOSXBehaviors ? "Cmd+" : "Super+") : "", - GetKeyName((ImGuiKey)(key_chord & ~ImGuiMod_Mask_))); + (key_chord & ImGuiMod_Super) ? "Super+" : "", + (key != ImGuiKey_None || key_chord == ImGuiKey_None) ? GetKeyName(key) : ""); + size_t len; + if (key == ImGuiKey_None && key_chord != 0) + if ((len = strlen(g.TempKeychordName)) != 0) // Remove trailing '+' + g.TempKeychordName[len - 1] = 0; + return g.TempKeychordName; } // t0 = previous time (e.g.: g.Time - g.IO.DeltaTime) @@ -8055,19 +9080,24 @@ static void ImGui::UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt) for (int old_routing_idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; old_routing_idx != -1; old_routing_idx = routing_entry->NextEntryIndex) { routing_entry = &rt->Entries[old_routing_idx]; + routing_entry->RoutingCurrScore = routing_entry->RoutingNextScore; routing_entry->RoutingCurr = routing_entry->RoutingNext; // Update entry - routing_entry->RoutingNext = ImGuiKeyOwner_None; + routing_entry->RoutingNext = ImGuiKeyOwner_NoOwner; routing_entry->RoutingNextScore = 255; - if (routing_entry->RoutingCurr == ImGuiKeyOwner_None) + if (routing_entry->RoutingCurr == ImGuiKeyOwner_NoOwner) continue; rt->EntriesNext.push_back(*routing_entry); // Write alive ones into new buffer // Apply routing to owner if there's no owner already (RoutingCurr == None at this point) + // This is the result of previous frame's SetShortcutRouting() call. if (routing_entry->Mods == g.IO.KeyMods) { ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key); - if (owner_data->OwnerCurr == ImGuiKeyOwner_None) + if (owner_data->OwnerCurr == ImGuiKeyOwner_NoOwner) + { owner_data->OwnerCurr = routing_entry->RoutingCurr; + //IMGUI_DEBUG_LOG("SetKeyOwner(%s, owner_id=0x%08X) via Routing\n", GetKeyName(key), routing_entry->RoutingCurr); + } } } @@ -8083,7 +9113,7 @@ static void ImGui::UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt) static inline ImGuiID GetRoutingIdFromOwnerId(ImGuiID owner_id) { ImGuiContext& g = *GImGui; - return (owner_id != ImGuiKeyOwner_None && owner_id != ImGuiKeyOwner_Any) ? owner_id : g.CurrentFocusScopeId; + return (owner_id != ImGuiKeyOwner_NoOwner && owner_id != ImGuiKeyOwner_Any) ? owner_id : g.CurrentFocusScopeId; } ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord) @@ -8097,12 +9127,10 @@ ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord) ImGuiContext& g = *GImGui; ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable; ImGuiKeyRoutingData* routing_data; - if (key_chord & ImGuiMod_Shortcut) - key_chord = ConvertShortcutMod(key_chord); ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_); if (key == ImGuiKey_None) - key = ConvertSingleModFlagToKey(&g, mods); + key = ConvertSingleModFlagToKey(mods); IM_ASSERT(IsNamedKey(key)); // Get (in the majority of case, the linked list will have one element so this should be 2 reads. @@ -8125,20 +9153,18 @@ ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord) } // Current score encoding (lower is highest priority): -// - 0: ImGuiInputFlags_RouteGlobalHigh -// - 1: ImGuiInputFlags_RouteFocused (if item active) -// - 2: ImGuiInputFlags_RouteGlobal +// - 0: ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverActive +// - 1: ImGuiInputFlags_ActiveItem or ImGuiInputFlags_RouteFocused (if item active) +// - 2: ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverFocused // - 3+: ImGuiInputFlags_RouteFocused (if window in focus-stack) -// - 254: ImGuiInputFlags_RouteGlobalLow +// - 254: ImGuiInputFlags_RouteGlobal // - 255: never route // 'flags' should include an explicit routing policy -static int CalcRoutingScore(ImGuiWindow* location, ImGuiID owner_id, ImGuiInputFlags flags) +static int CalcRoutingScore(ImGuiID focus_scope_id, ImGuiID owner_id, ImGuiInputFlags flags) { + ImGuiContext& g = *GImGui; if (flags & ImGuiInputFlags_RouteFocused) { - ImGuiContext& g = *GImGui; - ImGuiWindow* focused = g.NavWindow; - // ActiveID gets top priority // (we don't check g.ActiveIdUsingAllKeys here. Routing is applied but if input ownership is tested later it may discard it) if (owner_id != 0 && g.ActiveId == owner_id) @@ -8150,65 +9176,139 @@ static int CalcRoutingScore(ImGuiWindow* location, ImGuiID owner_id, ImGuiInputF // - When Window/ChildB is focused -> Window scores 4, Window/ChildB scores 3 (best) // Assuming only WindowA is submitting a routing request, // - When Window/ChildB is focused -> Window scores 4 (best), Window/ChildB doesn't have a score. - if (focused != NULL && focused->RootWindow == location->RootWindow) - for (int next_score = 3; focused != NULL; next_score++) - { - if (focused == location) - { - IM_ASSERT(next_score < 255); - return next_score; - } - focused = (focused->RootWindow != focused) ? focused->ParentWindow : NULL; // FIXME: This could be later abstracted as a focus path - } + // This essentially follow the window->ParentWindowForFocusRoute chain. + if (focus_scope_id == 0) + return 255; + for (int index_in_focus_path = 0; index_in_focus_path < g.NavFocusRoute.Size; index_in_focus_path++) + if (g.NavFocusRoute.Data[index_in_focus_path].ID == focus_scope_id) + return 3 + index_in_focus_path; return 255; } - - // ImGuiInputFlags_RouteGlobalHigh is default, so calls without flags are not conditional - if (flags & ImGuiInputFlags_RouteGlobal) - return 2; - if (flags & ImGuiInputFlags_RouteGlobalLow) + else if (flags & ImGuiInputFlags_RouteActive) + { + if (owner_id != 0 && g.ActiveId == owner_id) + return 1; + return 255; + } + else if (flags & ImGuiInputFlags_RouteGlobal) + { + if (flags & ImGuiInputFlags_RouteOverActive) + return 0; + if (flags & ImGuiInputFlags_RouteOverFocused) + return 2; return 254; + } + IM_ASSERT(0); return 0; } +// - We need this to filter some Shortcut() routes when an item e.g. an InputText() is active +// e.g. ImGuiKey_G won't be considered a shortcut when item is active, but ImGuiMod|ImGuiKey_G can be. +// - This is also used by UpdateInputEvents() to avoid trickling in the most common case of e.g. pressing ImGuiKey_G also emitting a G character. +static bool IsKeyChordPotentiallyCharInput(ImGuiKeyChord key_chord) +{ + // Mimic 'ignore_char_inputs' logic in InputText() + ImGuiContext& g = *GImGui; + + // When the right mods are pressed it cannot be a char input so we won't filter the shortcut out. + ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_); + const bool ignore_char_inputs = ((mods & ImGuiMod_Ctrl) && !(mods & ImGuiMod_Alt)) || (g.IO.ConfigMacOSXBehaviors && (mods & ImGuiMod_Ctrl)); + if (ignore_char_inputs) + return false; + + // Return true for A-Z, 0-9 and other keys associated to char inputs. Other keys such as F1-F12 won't be filtered. + ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); + if (key == ImGuiKey_None) + return false; + return g.KeysMayBeCharInput.TestBit(key); +} + // Request a desired route for an input chord (key + mods). // Return true if the route is available this frame. // - Routes and key ownership are attributed at the beginning of next frame based on best score and mod state. // (Conceptually this does a "Submit for next frame" + "Test for current frame". // As such, it could be called TrySetXXX or SubmitXXX, or the Submit and Test operations should be separate.) -// - Using 'owner_id == ImGuiKeyOwner_Any/0': auto-assign an owner based on current focus scope (each window has its focus scope by default) -// - Using 'owner_id == ImGuiKeyOwner_None': allows disabling/locking a shortcut. -bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags) +bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id) { ImGuiContext& g = *GImGui; - if ((flags & ImGuiInputFlags_RouteMask_) == 0) - flags |= ImGuiInputFlags_RouteGlobalHigh; // IMPORTANT: This is the default for SetShortcutRouting() but NOT Shortcut() + if ((flags & ImGuiInputFlags_RouteTypeMask_) == 0) + flags |= ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive; // IMPORTANT: This is the default for SetShortcutRouting() but NOT Shortcut() else - IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiInputFlags_RouteMask_)); // Check that only 1 routing flag is used + IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiInputFlags_RouteTypeMask_)); // Check that only 1 routing flag is used + IM_ASSERT(owner_id != ImGuiKeyOwner_Any && owner_id != ImGuiKeyOwner_NoOwner); + if (flags & (ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused)) + IM_ASSERT(flags & ImGuiInputFlags_RouteGlobal); + + // Add ImGuiMod_XXXX when a corresponding ImGuiKey_LeftXXX/ImGuiKey_RightXXX is specified. + key_chord = FixupKeyChord(key_chord); + + // [DEBUG] Debug break requested by user + if (g.DebugBreakInShortcutRouting == key_chord) + IM_DEBUG_BREAK(); if (flags & ImGuiInputFlags_RouteUnlessBgFocused) if (g.NavWindow == NULL) return false; + + // Note how ImGuiInputFlags_RouteAlways won't set routing and thus won't set owner. May want to rework this? if (flags & ImGuiInputFlags_RouteAlways) + { + IMGUI_DEBUG_LOG_INPUTROUTING("SetShortcutRouting(%s, flags=%04X, owner_id=0x%08X) -> always, no register\n", GetKeyChordName(key_chord), flags, owner_id); return true; + } + + // Specific culling when there's an active item. + if (g.ActiveId != 0 && g.ActiveId != owner_id) + { + if (flags & ImGuiInputFlags_RouteActive) + return false; + + // Cull shortcuts with no modifiers when it could generate a character. + // e.g. Shortcut(ImGuiKey_G) also generates 'g' character, should not trigger when InputText() is active. + // but Shortcut(Ctrl+G) should generally trigger when InputText() is active. + // TL;DR: lettered shortcut with no mods or with only Alt mod will not trigger while an item reading text input is active. + // (We cannot filter based on io.InputQueueCharacters[] contents because of trickling and key<>chars submission order are undefined) + if (g.IO.WantTextInput && IsKeyChordPotentiallyCharInput(key_chord)) + { + IMGUI_DEBUG_LOG_INPUTROUTING("SetShortcutRouting(%s, flags=%04X, owner_id=0x%08X) -> filtered as potential char input\n", GetKeyChordName(key_chord), flags, owner_id); + return false; + } - const int score = CalcRoutingScore(g.CurrentWindow, owner_id, flags); + // ActiveIdUsingAllKeyboardKeys trumps all for ActiveId + if ((flags & ImGuiInputFlags_RouteOverActive) == 0 && g.ActiveIdUsingAllKeyboardKeys) + { + ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); + if (key == ImGuiKey_None) + key = ConvertSingleModFlagToKey((ImGuiKey)(key_chord & ImGuiMod_Mask_)); + if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END) + return false; + } + } + + // Where do we evaluate route for? + ImGuiID focus_scope_id = g.CurrentFocusScopeId; + if (flags & ImGuiInputFlags_RouteFromRootWindow) + focus_scope_id = g.CurrentWindow->RootWindow->ID; // See PushFocusScope() call in Begin() + + const int score = CalcRoutingScore(focus_scope_id, owner_id, flags); + IMGUI_DEBUG_LOG_INPUTROUTING("SetShortcutRouting(%s, flags=%04X, owner_id=0x%08X) -> score %d\n", GetKeyChordName(key_chord), flags, owner_id, score); if (score == 255) return false; // Submit routing for NEXT frame (assuming score is sufficient) // FIXME: Could expose a way to use a "serve last" policy for same score resolution (using <= instead of <). ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord); - const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id); //const bool set_route = (flags & ImGuiInputFlags_ServeLast) ? (score <= routing_data->RoutingNextScore) : (score < routing_data->RoutingNextScore); if (score < routing_data->RoutingNextScore) { - routing_data->RoutingNext = routing_id; + routing_data->RoutingNext = owner_id; routing_data->RoutingNextScore = (ImU8)score; } // Return routing state for CURRENT frame - return routing_data->RoutingCurr == routing_id; + if (routing_data->RoutingCurr == owner_id) + IMGUI_DEBUG_LOG_INPUTROUTING("--> granting current route\n"); + return routing_data->RoutingCurr == owner_id; } // Currently unused by core (but used by tests) @@ -8216,6 +9316,7 @@ bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiI bool ImGui::TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id) { const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id); + key_chord = FixupKeyChord(key_chord); ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord); // FIXME: Could avoid creating entry. return routing_data->RoutingCurr == routing_id; } @@ -8239,11 +9340,11 @@ bool ImGui::IsKeyDown(ImGuiKey key, ImGuiID owner_id) bool ImGui::IsKeyPressed(ImGuiKey key, bool repeat) { - return IsKeyPressed(key, ImGuiKeyOwner_Any, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None); + return IsKeyPressed(key, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None, ImGuiKeyOwner_Any); } -// Important: unless legacy IsKeyPressed(ImGuiKey, bool repeat=true) which DEFAULT to repeat, this requires EXPLICIT repeat. -bool ImGui::IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags) +// Important: unlike legacy IsKeyPressed(ImGuiKey, bool repeat=true) which DEFAULT to repeat, this requires EXPLICIT repeat. +bool ImGui::IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id) { const ImGuiKeyData* key_data = GetKeyData(key); if (!key_data->Down) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitates eating mechanism (until we finish work on key ownership) @@ -8252,13 +9353,28 @@ bool ImGui::IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags) if (t < 0.0f) return false; IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsKeyPressed) == 0); // Passing flags not supported by this function! + if (flags & (ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_)) // Setting any _RepeatXXX option enables _Repeat + flags |= ImGuiInputFlags_Repeat; bool pressed = (t == 0.0f); - if (!pressed && ((flags & ImGuiInputFlags_Repeat) != 0)) + if (!pressed && (flags & ImGuiInputFlags_Repeat) != 0) { float repeat_delay, repeat_rate; GetTypematicRepeatRate(flags, &repeat_delay, &repeat_rate); pressed = (t > repeat_delay) && GetKeyPressedAmount(key, repeat_delay, repeat_rate) > 0; + if (pressed && (flags & ImGuiInputFlags_RepeatUntilMask_)) + { + // Slightly bias 'key_pressed_time' as DownDuration is an accumulation of DeltaTime which we compare to an absolute time value. + // Ideally we'd replace DownDuration with KeyPressedTime but it would break user's code. + ImGuiContext& g = *GImGui; + double key_pressed_time = g.Time - t + 0.00001f; + if ((flags & ImGuiInputFlags_RepeatUntilKeyModsChange) && (g.LastKeyModsChangeTime > key_pressed_time)) + pressed = false; + if ((flags & ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone) && (g.LastKeyModsChangeFromNoneTime > key_pressed_time)) + pressed = false; + if ((flags & ImGuiInputFlags_RepeatUntilOtherKeyPress) && (g.LastKeyboardKeyPressTime > key_pressed_time)) + pressed = false; + } } if (!pressed) return false; @@ -8298,10 +9414,10 @@ bool ImGui::IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id) bool ImGui::IsMouseClicked(ImGuiMouseButton button, bool repeat) { - return IsMouseClicked(button, ImGuiKeyOwner_Any, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None); + return IsMouseClicked(button, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None, ImGuiKeyOwner_Any); } -bool ImGui::IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags) +bool ImGui::IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id) { ImGuiContext& g = *GImGui; IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); @@ -8310,7 +9426,7 @@ bool ImGui::IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInput const float t = g.IO.MouseDownDuration[button]; if (t < 0.0f) return false; - IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsKeyPressed) == 0); // Passing flags not supported by this function! + IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsMouseClicked) == 0); // Passing flags not supported by this function! // FIXME: Could support RepeatRate and RepeatUntil flags here. const bool repeat = (flags & ImGuiInputFlags_Repeat) != 0; const bool pressed = (t == 0.0f) || (repeat && t > g.IO.KeyRepeatDelay && CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0); @@ -8344,6 +9460,13 @@ bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button) return g.IO.MouseClickedCount[button] == 2 && TestKeyOwner(MouseButtonToKey(button), ImGuiKeyOwner_Any); } +bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + return g.IO.MouseClickedCount[button] == 2 && TestKeyOwner(MouseButtonToKey(button), owner_id); +} + int ImGui::GetMouseClickedCount(ImGuiMouseButton button) { ImGuiContext& g = *GImGui; @@ -8363,9 +9486,8 @@ bool ImGui::IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool c if (clip) rect_clipped.ClipWith(g.CurrentWindow->ClipRect); - // Expand for touch input - const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Style.TouchExtraPadding); - if (!rect_for_touch.Contains(g.IO.MousePos)) + // Hit testing, expanded for touch input + if (!rect_clipped.ContainsWithPad(g.IO.MousePos, g.Style.TouchExtraPadding)) return false; return true; } @@ -8396,6 +9518,17 @@ ImVec2 ImGui::GetMousePos() return g.IO.MousePos; } +// This is called TeleportMousePos() and not SetMousePos() to emphasis that setting MousePosPrev will effectively clear mouse delta as well. +// It is expected you only call this if (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos) is set and supported by backend. +void ImGui::TeleportMousePos(const ImVec2& pos) +{ + ImGuiContext& g = *GImGui; + g.IO.MousePos = g.IO.MousePosPrev = pos; + g.IO.MouseDelta = ImVec2(0.0f, 0.0f); + g.IO.WantSetMousePos = true; + //IMGUI_DEBUG_LOG_IO("TeleportMousePos: (%.1f,%.1f)\n", io.MousePos.x, io.MousePos.y); +} + // NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed! ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup() { @@ -8460,6 +9593,9 @@ ImGuiMouseCursor ImGui::GetMouseCursor() return g.MouseCursor; } +// We intentionally accept values of ImGuiMouseCursor that are outside our bounds, in case users needs to hack-in a custom cursor value. +// Custom cursors may be handled by custom backends. If you are using a standard backend and want to hack in a custom cursor, you may +// handle it before the backend _NewFrame() call and temporarily set ImGuiConfigFlags_NoMouseCursorChange during the backend _NewFrame() call. void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type) { ImGuiContext& g = *GImGui; @@ -8490,6 +9626,9 @@ static void ImGui::UpdateKeyboardInputs() ImGuiContext& g = *GImGui; ImGuiIO& io = g.IO; + if (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard) + io.ClearInputKeys(); + // Import legacy keys or verify they are not used #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO if (io.BackendUsingLegacyKeyArrays == 0) @@ -8531,7 +9670,9 @@ static void ImGui::UpdateKeyboardInputs() GetKeyData(ImGuiMod_Super)->Down = io.KeySuper; } } +#endif + // Import legacy ImGuiNavInput_ io inputs and convert to gamepad keys #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; if (io.BackendUsingLegacyNavInputArray && nav_gamepad_active) @@ -8554,7 +9695,6 @@ static void ImGui::UpdateKeyboardInputs() MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickDown, ImGuiNavInput_LStickDown); #undef NAV_MAP_KEY } -#endif #endif // Update aliases @@ -8563,15 +9703,20 @@ static void ImGui::UpdateKeyboardInputs() UpdateAliasKey(ImGuiKey_MouseWheelX, io.MouseWheelH != 0.0f, io.MouseWheelH); UpdateAliasKey(ImGuiKey_MouseWheelY, io.MouseWheel != 0.0f, io.MouseWheel); - // Synchronize io.KeyMods and io.KeyXXX values. + // Synchronize io.KeyMods and io.KeyCtrl/io.KeyShift/etc. values. // - New backends (1.87+): send io.AddKeyEvent(ImGuiMod_XXX) -> -> (here) deriving io.KeyMods + io.KeyXXX from key array. // - Legacy backends: set io.KeyXXX bools -> (above) set key array from io.KeyXXX -> (here) deriving io.KeyMods + io.KeyXXX from key array. // So with legacy backends the 4 values will do a unnecessary back-and-forth but it makes the code simpler and future facing. + const ImGuiKeyChord prev_key_mods = io.KeyMods; io.KeyMods = GetMergedModsFromKeys(); io.KeyCtrl = (io.KeyMods & ImGuiMod_Ctrl) != 0; io.KeyShift = (io.KeyMods & ImGuiMod_Shift) != 0; io.KeyAlt = (io.KeyMods & ImGuiMod_Alt) != 0; io.KeySuper = (io.KeyMods & ImGuiMod_Super) != 0; + if (prev_key_mods != io.KeyMods) + g.LastKeyModsChangeTime = g.Time; + if (prev_key_mods != io.KeyMods && prev_key_mods == 0) + g.LastKeyModsChangeFromNoneTime = g.Time; // Clear gamepad data if disabled if ((io.BackendFlags & ImGuiBackendFlags_HasGamepad) == 0) @@ -8587,6 +9732,14 @@ static void ImGui::UpdateKeyboardInputs() ImGuiKeyData* key_data = &io.KeysData[i]; key_data->DownDurationPrev = key_data->DownDuration; key_data->DownDuration = key_data->Down ? (key_data->DownDuration < 0.0f ? 0.0f : key_data->DownDuration + io.DeltaTime) : -1.0f; + if (key_data->DownDuration == 0.0f) + { + ImGuiKey key = (ImGuiKey)(ImGuiKey_KeysData_OFFSET + i); + if (IsKeyboardKey(key)) + g.LastKeyboardKeyPressTime = g.Time; + else if (key == ImGuiKey_ReservedForModCtrl || key == ImGuiKey_ReservedForModShift || key == ImGuiKey_ReservedForModAlt || key == ImGuiKey_ReservedForModSuper) + g.LastKeyboardKeyPressTime = g.Time; + } } // Update keys/input owner (named keys only): one entry per key @@ -8596,10 +9749,11 @@ static void ImGui::UpdateKeyboardInputs() ImGuiKeyOwnerData* owner_data = &g.KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; owner_data->OwnerCurr = owner_data->OwnerNext; if (!key_data->Down) // Important: ownership is released on the frame after a release. Ensure a 'MouseDown -> CloseWindow -> MouseUp' chain doesn't lead to someone else seeing the MouseUp. - owner_data->OwnerNext = ImGuiKeyOwner_None; + owner_data->OwnerNext = ImGuiKeyOwner_NoOwner; owner_data->LockThisFrame = owner_data->LockUntilRelease = owner_data->LockUntilRelease && key_data->Down; // Clear LockUntilRelease when key is not Down anymore } + // Update key routing (for e.g. shortcuts) UpdateKeyRoutingTable(&g.KeysRoutingTable); } @@ -8617,7 +9771,7 @@ static void ImGui::UpdateMouseInputs() // Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't support them well) if (IsMousePosValid(&io.MousePos)) - io.MousePos = g.MouseLastValidPos = ImFloorSigned(io.MousePos); + io.MousePos = g.MouseLastValidPos = ImFloor(io.MousePos); // If mouse just appeared or disappeared (usually denoted by -FLT_MAX components) we cancel out movement in MouseDelta if (IsMousePosValid(&io.MousePos) && IsMousePosValid(&io.MousePosPrev)) @@ -8632,11 +9786,10 @@ static void ImGui::UpdateMouseInputs() g.MouseStationaryTimer = mouse_stationary ? (g.MouseStationaryTimer + io.DeltaTime) : 0.0f; //IMGUI_DEBUG_LOG("%.4f\n", g.MouseStationaryTimer); - // If mouse moved we re-enable mouse hovering in case it was disabled by gamepad/keyboard. In theory should use a >0.0f threshold but would need to reset in everywhere we set this to true. + // If mouse moved we re-enable mouse hovering in case it was disabled by keyboard/gamepad. In theory should use a >0.0f threshold but would need to reset in everywhere we set this to true. if (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f) - g.NavDisableMouseHover = false; + g.NavHighlightItemUnderNav = false; - io.MousePosPrev = io.MousePos; for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) { io.MouseClicked[i] = io.MouseDown[i] && io.MouseDownDuration[i] < 0.0f; @@ -8672,9 +9825,9 @@ static void ImGui::UpdateMouseInputs() // We provide io.MouseDoubleClicked[] as a legacy service io.MouseDoubleClicked[i] = (io.MouseClickedCount[i] == 2); - // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation + // Clicking any mouse button reactivate mouse hovering which may have been deactivated by keyboard/gamepad navigation if (io.MouseClicked[i]) - g.NavDisableMouseHover = false; + g.NavHighlightItemUnderNav = false; } } @@ -8752,8 +9905,8 @@ void ImGui::UpdateMouseWheel() } ImVec2 wheel; - wheel.x = TestKeyOwner(ImGuiKey_MouseWheelX, ImGuiKeyOwner_None) ? g.IO.MouseWheelH : 0.0f; - wheel.y = TestKeyOwner(ImGuiKey_MouseWheelY, ImGuiKeyOwner_None) ? g.IO.MouseWheel : 0.0f; + wheel.x = TestKeyOwner(ImGuiKey_MouseWheelX, ImGuiKeyOwner_NoOwner) ? g.IO.MouseWheelH : 0.0f; + wheel.y = TestKeyOwner(ImGuiKey_MouseWheelY, ImGuiKeyOwner_NoOwner) ? g.IO.MouseWheel : 0.0f; //IMGUI_DEBUG_LOG("MouseWheel X:%.3f Y:%.3f\n", wheel_x, wheel_y); ImGuiWindow* mouse_window = g.WheelingWindow ? g.WheelingWindow : g.HoveredWindow; @@ -8773,8 +9926,8 @@ void ImGui::UpdateMouseWheel() { const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size; SetWindowPos(window, window->Pos + offset, 0); - window->Size = ImFloor(window->Size * scale); - window->SizeFull = ImFloor(window->SizeFull * scale); + window->Size = ImTrunc(window->Size * scale); + window->SizeFull = ImTrunc(window->SizeFull * scale); } return; } @@ -8810,15 +9963,17 @@ void ImGui::UpdateMouseWheel() { LockWheelingWindow(window, wheel.x); float max_step = window->InnerRect.GetWidth() * 0.67f; - float scroll_step = ImFloor(ImMin(2 * window->CalcFontSize(), max_step)); + float scroll_step = ImTrunc(ImMin(2 * window->CalcFontSize(), max_step)); SetScrollX(window, window->Scroll.x - wheel.x * scroll_step); + g.WheelingWindowScrolledFrame = g.FrameCount; } if (do_scroll[ImGuiAxis_Y]) { LockWheelingWindow(window, wheel.y); float max_step = window->InnerRect.GetHeight() * 0.67f; - float scroll_step = ImFloor(ImMin(5 * window->CalcFontSize(), max_step)); + float scroll_step = ImTrunc(ImMin(5 * window->CalcFontSize(), max_step)); SetScrollY(window, window->Scroll.y - wheel.y * scroll_step); + g.WheelingWindowScrolledFrame = g.FrameCount; } } } @@ -8838,7 +9993,7 @@ void ImGui::SetNextFrameWantCaptureMouse(bool want_capture_mouse) #ifndef IMGUI_DISABLE_DEBUG_TOOLS static const char* GetInputSourceName(ImGuiInputSource source) { - const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad", "Clipboard" }; + const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad" }; IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT && source >= 0 && source < ImGuiInputSource_COUNT); return input_source_names[source]; } @@ -8872,9 +10027,9 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs) // Only trickle chars<>key when working with InputText() // FIXME: InputText() could parse event trail? // FIXME: Could specialize chars<>keys trickling rules for control keys (those not typically associated to characters) - const bool trickle_interleaved_keys_and_text = (trickle_fast_inputs && g.WantTextInputNextFrame == 1); + const bool trickle_interleaved_nonchar_keys_and_text = (trickle_fast_inputs && g.WantTextInputNextFrame == 1); - bool mouse_moved = false, mouse_wheeled = false, key_changed = false, text_inputted = false; + bool mouse_moved = false, mouse_wheeled = false, key_changed = false, key_changed_nonchar = false, text_inputted = false; int mouse_button_changed = 0x00; ImBitArray key_changed_mask; @@ -8884,6 +10039,8 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs) ImGuiInputEvent* e = &g.InputEventsQueue[event_n]; if (e->Type == ImGuiInputEventType_MousePos) { + if (g.IO.WantSetMousePos) + continue; // Trickling Rule: Stop processing queued events if we already handled a mouse button change ImVec2 event_pos(e->MousePos.PosX, e->MousePos.PosY); if (trickle_fast_inputs && (mouse_button_changed != 0 || mouse_wheeled || key_changed || text_inputted)) @@ -8918,16 +10075,25 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs) else if (e->Type == ImGuiInputEventType_Key) { // Trickling Rule: Stop processing queued events if we got multiple action on the same button + if (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard) + continue; ImGuiKey key = e->Key.Key; IM_ASSERT(key != ImGuiKey_None); ImGuiKeyData* key_data = GetKeyData(key); const int key_data_index = (int)(key_data - g.IO.KeysData); - if (trickle_fast_inputs && key_data->Down != e->Key.Down && (key_changed_mask.TestBit(key_data_index) || text_inputted || mouse_button_changed != 0)) + if (trickle_fast_inputs && key_data->Down != e->Key.Down && (key_changed_mask.TestBit(key_data_index) || mouse_button_changed != 0)) + break; + + const bool key_is_potentially_for_char_input = IsKeyChordPotentiallyCharInput(GetMergedModsFromKeys() | key); + if (trickle_interleaved_nonchar_keys_and_text && (text_inputted && !key_is_potentially_for_char_input)) break; + key_data->Down = e->Key.Down; key_data->AnalogValue = e->Key.AnalogValue; key_changed = true; key_changed_mask.SetBit(key_data_index); + if (trickle_interleaved_nonchar_keys_and_text && !key_is_potentially_for_char_input) + key_changed_nonchar = true; // Allow legacy code using io.KeysDown[GetKeyIndex()] with new backends #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO @@ -8938,12 +10104,16 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs) } else if (e->Type == ImGuiInputEventType_Text) { + if (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard) + continue; // Trickling Rule: Stop processing queued events if keys/mouse have been interacted with - if (trickle_fast_inputs && ((key_changed && trickle_interleaved_keys_and_text) || mouse_button_changed != 0 || mouse_moved || mouse_wheeled)) + if (trickle_fast_inputs && (mouse_button_changed != 0 || mouse_moved || mouse_wheeled)) + break; + if (trickle_interleaved_nonchar_keys_and_text && key_changed_nonchar) break; unsigned int c = e->Text.Char; io.InputQueueCharacters.push_back(c <= IM_UNICODE_CODEPOINT_MAX ? (ImWchar)c : IM_UNICODE_CODEPOINT_INVALID); - if (trickle_interleaved_keys_and_text) + if (trickle_interleaved_nonchar_keys_and_text) text_inputted = true; } else if (e->Type == ImGuiInputEventType_Focus) @@ -8982,13 +10152,16 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs) // - we clear in EndFrame() and not now in order allow application/user code polling this flag // (e.g. custom backend may want to clear additional data, custom widgets may want to react with a "canceling" event). if (g.IO.AppFocusLost) + { g.IO.ClearInputKeys(); + g.IO.ClearInputMouse(); + } } ImGuiID ImGui::GetKeyOwner(ImGuiKey key) { - if (!IsNamedKeyOrModKey(key)) - return ImGuiKeyOwner_None; + if (!IsNamedKeyOrMod(key)) + return ImGuiKeyOwner_NoOwner; ImGuiContext& g = *GImGui; ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key); @@ -8996,7 +10169,7 @@ ImGuiID ImGui::GetKeyOwner(ImGuiKey key) if (g.ActiveIdUsingAllKeyboardKeys && owner_id != g.ActiveId && owner_id != ImGuiKeyOwner_Any) if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END) - return ImGuiKeyOwner_None; + return ImGuiKeyOwner_NoOwner; return owner_id; } @@ -9007,7 +10180,7 @@ ImGuiID ImGui::GetKeyOwner(ImGuiKey key) // All paths are also testing for key not being locked, for the rare cases that key have been locked with using ImGuiInputFlags_LockXXX flags. bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id) { - if (!IsNamedKeyOrModKey(key)) + if (!IsNamedKeyOrMod(key)) return true; ImGuiContext& g = *GImGui; @@ -9026,7 +10199,7 @@ bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id) { if (owner_data->LockThisFrame) return false; - if (owner_data->OwnerCurr != ImGuiKeyOwner_None) + if (owner_data->OwnerCurr != ImGuiKeyOwner_NoOwner) return false; } @@ -9040,10 +10213,11 @@ bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id) // - SetKeyOwner(..., Any or None, Lock) : set lock void ImGui::SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags) { - IM_ASSERT(IsNamedKeyOrModKey(key) && (owner_id != ImGuiKeyOwner_Any || (flags & (ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease)))); // Can only use _Any with _LockXXX flags (to eat a key away without an ID to retrieve it) + ImGuiContext& g = *GImGui; + IM_ASSERT(IsNamedKeyOrMod(key) && (owner_id != ImGuiKeyOwner_Any || (flags & (ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease)))); // Can only use _Any with _LockXXX flags (to eat a key away without an ID to retrieve it) IM_ASSERT((flags & ~ImGuiInputFlags_SupportedBySetKeyOwner) == 0); // Passing flags not supported by this function! + //IMGUI_DEBUG_LOG("SetKeyOwner(%s, owner_id=0x%08X, flags=%08X)\n", GetKeyName(key), owner_id, flags); - ImGuiContext& g = *GImGui; ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key); owner_data->OwnerCurr = owner_data->OwnerNext = owner_id; @@ -9060,7 +10234,6 @@ void ImGui::SetKeyOwnersForKeyChord(ImGuiKeyChord key_chord, ImGuiID owner_id, I if (key_chord & ImGuiMod_Shift) { SetKeyOwner(ImGuiMod_Shift, owner_id, flags); } if (key_chord & ImGuiMod_Alt) { SetKeyOwner(ImGuiMod_Alt, owner_id, flags); } if (key_chord & ImGuiMod_Super) { SetKeyOwner(ImGuiMod_Super, owner_id, flags); } - if (key_chord & ImGuiMod_Shortcut) { SetKeyOwner(ImGuiMod_Shortcut, owner_id, flags); } if (key_chord & ~ImGuiMod_Mask_) { SetKeyOwner((ImGuiKey)(key_chord & ~ImGuiMod_Mask_), owner_id, flags); } } @@ -9085,18 +10258,22 @@ void ImGui::SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags) } } -bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags) +void ImGui::SetItemKeyOwner(ImGuiKey key) { - ImGuiContext& g = *GImGui; + SetItemKeyOwner(key, ImGuiInputFlags_None); +} - // When using (owner_id == 0/Any): SetShortcutRouting() will use CurrentFocusScopeId and filter with this, so IsKeyPressed() is fine with he 0/Any. - if ((flags & ImGuiInputFlags_RouteMask_) == 0) - flags |= ImGuiInputFlags_RouteFocused; - if (!SetShortcutRouting(key_chord, owner_id, flags)) - return false; +// This is the only public API until we expose owner_id versions of the API as replacements. +bool ImGui::IsKeyChordPressed(ImGuiKeyChord key_chord) +{ + return IsKeyChordPressed(key_chord, ImGuiInputFlags_None, ImGuiKeyOwner_Any); +} - if (key_chord & ImGuiMod_Shortcut) - key_chord = ConvertShortcutMod(key_chord); +// This is equivalent to comparing KeyMods + doing a IsKeyPressed() +bool ImGui::IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id) +{ + ImGuiContext& g = *GImGui; + key_chord = FixupKeyChord(key_chord); ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_); if (g.IO.KeyMods != mods) return false; @@ -9104,38 +10281,120 @@ bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags // Special storage location for mods ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); if (key == ImGuiKey_None) - key = ConvertSingleModFlagToKey(&g, mods); + key = ConvertSingleModFlagToKey(mods); + if (!IsKeyPressed(key, (flags & ImGuiInputFlags_RepeatMask_), owner_id)) + return false; + return true; +} + +void ImGui::SetNextItemShortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags) +{ + ImGuiContext& g = *GImGui; + g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasShortcut; + g.NextItemData.Shortcut = key_chord; + g.NextItemData.ShortcutFlags = flags; +} + +// Called from within ItemAdd: at this point we can read from NextItemData and write to LastItemData +void ImGui::ItemHandleShortcut(ImGuiID id) +{ + ImGuiContext& g = *GImGui; + ImGuiInputFlags flags = g.NextItemData.ShortcutFlags; + IM_ASSERT((flags & ~ImGuiInputFlags_SupportedBySetNextItemShortcut) == 0); // Passing flags not supported by SetNextItemShortcut()! - if (!IsKeyPressed(key, owner_id, (flags & (ImGuiInputFlags_Repeat | (ImGuiInputFlags)ImGuiInputFlags_RepeatRateMask_)))) + if (g.LastItemData.ItemFlags & ImGuiItemFlags_Disabled) + return; + if (flags & ImGuiInputFlags_Tooltip) + { + g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HasShortcut; + g.LastItemData.Shortcut = g.NextItemData.Shortcut; + } + if (!Shortcut(g.NextItemData.Shortcut, flags & ImGuiInputFlags_SupportedByShortcut, id) || g.NavActivateId != 0) + return; + + // FIXME: Generalize Activation queue? + g.NavActivateId = id; // Will effectively disable clipping. + g.NavActivateFlags = ImGuiActivateFlags_PreferInput | ImGuiActivateFlags_FromShortcut; + //if (g.ActiveId == 0 || g.ActiveId == id) + g.NavActivateDownId = g.NavActivatePressedId = id; + NavHighlightActivated(id); +} + +bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags) +{ + return Shortcut(key_chord, flags, ImGuiKeyOwner_Any); +} + +bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id) +{ + ImGuiContext& g = *GImGui; + //IMGUI_DEBUG_LOG("Shortcut(%s, flags=%X, owner_id=0x%08X)\n", GetKeyChordName(key_chord, g.TempBuffer.Data, g.TempBuffer.Size), flags, owner_id); + + // When using (owner_id == 0/Any): SetShortcutRouting() will use CurrentFocusScopeId and filter with this, so IsKeyPressed() is fine with he 0/Any. + if ((flags & ImGuiInputFlags_RouteTypeMask_) == 0) + flags |= ImGuiInputFlags_RouteFocused; + + // Using 'owner_id == ImGuiKeyOwner_Any/0': auto-assign an owner based on current focus scope (each window has its focus scope by default) + // Effectively makes Shortcut() always input-owner aware. + if (owner_id == ImGuiKeyOwner_Any || owner_id == ImGuiKeyOwner_NoOwner) + owner_id = GetRoutingIdFromOwnerId(owner_id); + + if (g.CurrentItemFlags & ImGuiItemFlags_Disabled) return false; - IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByShortcut) == 0); // Passing flags not supported by this function! + // Submit route + if (!SetShortcutRouting(key_chord, flags, owner_id)) + return false; + + // Default repeat behavior for Shortcut() + // So e.g. pressing Ctrl+W and releasing Ctrl while holding W will not trigger the W shortcut. + if ((flags & ImGuiInputFlags_Repeat) != 0 && (flags & ImGuiInputFlags_RepeatUntilMask_) == 0) + flags |= ImGuiInputFlags_RepeatUntilKeyModsChange; + + if (!IsKeyChordPressed(key_chord, flags, owner_id)) + return false; + + // Claim mods during the press + SetKeyOwnersForKeyChord(key_chord & ImGuiMod_Mask_, owner_id); + + IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByShortcut) == 0); // Passing flags not supported by this function! return true; } //----------------------------------------------------------------------------- -// [SECTION] ERROR CHECKING +// [SECTION] ERROR CHECKING, STATE RECOVERY +//----------------------------------------------------------------------------- +// - DebugCheckVersionAndDataLayout() (called via IMGUI_CHECKVERSION() macros) +// - ErrorCheckUsingSetCursorPosToExtendParentBoundaries() +// - ErrorCheckNewFrameSanityChecks() +// - ErrorCheckEndFrameSanityChecks() +// - ErrorRecoveryStoreState() +// - ErrorRecoveryTryToRecoverState() +// - ErrorRecoveryTryToRecoverWindowState() +// - ErrorLog() //----------------------------------------------------------------------------- -// Helper function to verify ABI compatibility between caller code and compiled version of Dear ImGui. +// Verify ABI compatibility between caller code and compiled version of Dear ImGui. This helps detects some build issues. +// Called by IMGUI_CHECKVERSION(). // Verify that the type sizes are matching between the calling file's compilation unit and imgui.cpp's compilation unit -// If this triggers you have an issue: -// - Most commonly: mismatched headers and compiled code version. -// - Or: mismatched configuration #define, compilation settings, packing pragma etc. -// The configuration settings mentioned in imconfig.h must be set for all compilation units involved with Dear ImGui, -// which is way it is required you put them in your imconfig file (and not just before including imgui.h). -// Otherwise it is possible that different compilation units would see different structure layout +// If this triggers you have mismatched headers and compiled code versions. +// - It could be because of a build issue (using new headers with old compiled code) +// - It could be because of mismatched configuration #define, compilation settings, packing pragma etc. +// THE CONFIGURATION SETTINGS MENTIONED IN imconfig.h MUST BE SET FOR ALL COMPILATION UNITS INVOLVED WITH DEAR IMGUI. +// Which is why it is required you put them in your imconfig file (and NOT only before including imgui.h). +// Otherwise it is possible that different compilation units would see different structure layout. +// If you don't want to modify imconfig.h you can use the IMGUI_USER_CONFIG define to change filename. bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_vert, size_t sz_idx) { bool error = false; if (strcmp(version, IMGUI_VERSION) != 0) { error = true; IM_ASSERT(strcmp(version, IMGUI_VERSION) == 0 && "Mismatched version string!"); } - if (sz_io != sizeof(ImGuiIO)) { error = true; IM_ASSERT(sz_io == sizeof(ImGuiIO) && "Mismatched struct layout!"); } + if (sz_io != sizeof(ImGuiIO)) { error = true; IM_ASSERT(sz_io == sizeof(ImGuiIO) && "Mismatched struct layout!"); } if (sz_style != sizeof(ImGuiStyle)) { error = true; IM_ASSERT(sz_style == sizeof(ImGuiStyle) && "Mismatched struct layout!"); } - if (sz_vec2 != sizeof(ImVec2)) { error = true; IM_ASSERT(sz_vec2 == sizeof(ImVec2) && "Mismatched struct layout!"); } - if (sz_vec4 != sizeof(ImVec4)) { error = true; IM_ASSERT(sz_vec4 == sizeof(ImVec4) && "Mismatched struct layout!"); } - if (sz_vert != sizeof(ImDrawVert)) { error = true; IM_ASSERT(sz_vert == sizeof(ImDrawVert) && "Mismatched struct layout!"); } - if (sz_idx != sizeof(ImDrawIdx)) { error = true; IM_ASSERT(sz_idx == sizeof(ImDrawIdx) && "Mismatched struct layout!"); } + if (sz_vec2 != sizeof(ImVec2)) { error = true; IM_ASSERT(sz_vec2 == sizeof(ImVec2) && "Mismatched struct layout!"); } + if (sz_vec4 != sizeof(ImVec4)) { error = true; IM_ASSERT(sz_vec4 == sizeof(ImVec4) && "Mismatched struct layout!"); } + if (sz_vert != sizeof(ImDrawVert)) { error = true; IM_ASSERT(sz_vert == sizeof(ImDrawVert) && "Mismatched struct layout!"); } + if (sz_idx != sizeof(ImDrawIdx)) { error = true; IM_ASSERT(sz_idx == sizeof(ImDrawIdx) && "Mismatched struct layout!"); } return !error; } @@ -9212,259 +10471,319 @@ static void ImGui::ErrorCheckNewFrameSanityChecks() IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation."); #endif - // Check: the io.ConfigWindowsResizeFromEdges option requires backend to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly. - if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors)) - g.IO.ConfigWindowsResizeFromEdges = false; + // Error handling: we do not accept 100% silent recovery! Please contact me if you feel this is getting in your way. + if (g.IO.ConfigErrorRecovery) + IM_ASSERT(g.IO.ConfigErrorRecoveryEnableAssert || g.IO.ConfigErrorRecoveryEnableDebugLog || g.IO.ConfigErrorRecoveryEnableTooltip || g.ErrorCallback != NULL); + +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + // Remap legacy names + if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) + { + g.IO.ConfigNavMoveSetMousePos = true; + g.IO.ConfigFlags &= ~ImGuiConfigFlags_NavEnableSetMousePos; + } + if (g.IO.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard) + { + g.IO.ConfigNavCaptureKeyboard = false; + g.IO.ConfigFlags &= ~ImGuiConfigFlags_NavNoCaptureKeyboard; + } + + // Remap legacy clipboard handlers (OBSOLETED in 1.91.1, August 2024) + if (g.IO.GetClipboardTextFn != NULL && (g.PlatformIO.Platform_GetClipboardTextFn == NULL || g.PlatformIO.Platform_GetClipboardTextFn == Platform_GetClipboardTextFn_DefaultImpl)) + g.PlatformIO.Platform_GetClipboardTextFn = [](ImGuiContext* ctx) { return ctx->IO.GetClipboardTextFn(ctx->IO.ClipboardUserData); }; + if (g.IO.SetClipboardTextFn != NULL && (g.PlatformIO.Platform_SetClipboardTextFn == NULL || g.PlatformIO.Platform_SetClipboardTextFn == Platform_SetClipboardTextFn_DefaultImpl)) + g.PlatformIO.Platform_SetClipboardTextFn = [](ImGuiContext* ctx, const char* text) { return ctx->IO.SetClipboardTextFn(ctx->IO.ClipboardUserData, text); }; +#endif } static void ImGui::ErrorCheckEndFrameSanityChecks() { - ImGuiContext& g = *GImGui; - // Verify that io.KeyXXX fields haven't been tampered with. Key mods should not be modified between NewFrame() and EndFrame() // One possible reason leading to this assert is that your backends update inputs _AFTER_ NewFrame(). // It is known that when some modal native windows called mid-frame takes focus away, some backends such as GLFW will // send key release events mid-frame. This would normally trigger this assertion and lead to sheared inputs. // We silently accommodate for this case by ignoring the case where all io.KeyXXX modifiers were released (aka key_mod_flags == 0), // while still correctly asserting on mid-frame key press events. + ImGuiContext& g = *GImGui; const ImGuiKeyChord key_mods = GetMergedModsFromKeys(); + IM_UNUSED(g); + IM_UNUSED(key_mods); IM_ASSERT((key_mods == 0 || g.IO.KeyMods == key_mods) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"); IM_UNUSED(key_mods); - // [EXPERIMENTAL] Recover from errors: You may call this yourself before EndFrame(). - //ErrorCheckEndFrameRecover(); - - // Report when there is a mismatch of Begin/BeginChild vs End/EndChild calls. Important: Remember that the Begin/BeginChild API requires you - // to always call End/EndChild even if Begin/BeginChild returns false! (this is unfortunately inconsistent with most other Begin* API). - if (g.CurrentWindowStack.Size != 1) - { - if (g.CurrentWindowStack.Size > 1) - { - ImGuiWindow* window = g.CurrentWindowStack.back().Window; // <-- This window was not Ended! - IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?"); - IM_UNUSED(window); - while (g.CurrentWindowStack.Size > 1) - End(); - } - else - { - IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you call End/EndChild too much?"); - } - } + IM_ASSERT(g.CurrentWindowStack.Size == 1); + IM_ASSERT(g.CurrentWindowStack[0].Window->IsFallbackWindow); +} - IM_ASSERT_USER_ERROR(g.GroupStack.Size == 0, "Missing EndGroup call!"); +// Save current stack sizes. Called e.g. by NewFrame() and by Begin() but may be called for manual recovery. +void ImGui::ErrorRecoveryStoreState(ImGuiErrorRecoveryState* state_out) +{ + ImGuiContext& g = *GImGui; + state_out->SizeOfWindowStack = (short)g.CurrentWindowStack.Size; + state_out->SizeOfIDStack = (short)g.CurrentWindow->IDStack.Size; + state_out->SizeOfTreeStack = (short)g.CurrentWindow->DC.TreeDepth; // NOT g.TreeNodeStack.Size which is a partial stack! + state_out->SizeOfColorStack = (short)g.ColorStack.Size; + state_out->SizeOfStyleVarStack = (short)g.StyleVarStack.Size; + state_out->SizeOfFontStack = (short)g.FontStack.Size; + state_out->SizeOfFocusScopeStack = (short)g.FocusScopeStack.Size; + state_out->SizeOfGroupStack = (short)g.GroupStack.Size; + state_out->SizeOfItemFlagsStack = (short)g.ItemFlagsStack.Size; + state_out->SizeOfBeginPopupStack = (short)g.BeginPopupStack.Size; + state_out->SizeOfDisabledStack = (short)g.DisabledStackSize; } -// Experimental recovery from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls. -// Must be called during or before EndFrame(). -// This is generally flawed as we are not necessarily End/Popping things in the right order. -// FIXME: Can't recover from inside BeginTabItem/EndTabItem yet. -// FIXME: Can't recover from interleaved BeginTabBar/Begin -void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data) +// Chosen name "Try to recover" over e.g. "Restore" to suggest this is not a 100% guaranteed recovery. +// Called by e.g. EndFrame() but may be called for manual recovery. +// Attempt to recover full window stack. +void ImGui::ErrorRecoveryTryToRecoverState(const ImGuiErrorRecoveryState* state_in) { // PVS-Studio V1044 is "Loop break conditions do not depend on the number of iterations" ImGuiContext& g = *GImGui; - while (g.CurrentWindowStack.Size > 0) //-V1044 + while (g.CurrentWindowStack.Size > state_in->SizeOfWindowStack) //-V1044 { - ErrorCheckEndWindowRecover(log_callback, user_data); + // Recap: + // - Begin()/BeginChild() return false to indicate the window is collapsed or fully clipped. + // - Always call a matching End() for each Begin() call, regardless of its return value! + // - Begin/End and BeginChild/EndChild logic is KNOWN TO BE INCONSISTENT WITH ALL OTHER BEGIN/END FUNCTIONS. + // - We will fix that in a future major update. ImGuiWindow* window = g.CurrentWindow; - if (g.CurrentWindowStack.Size == 1) - { - IM_ASSERT(window->IsFallbackWindow); - break; - } if (window->Flags & ImGuiWindowFlags_ChildWindow) { - if (log_callback) log_callback(user_data, "Recovered from missing EndChild() for '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing EndChild()"); EndChild(); } else { - if (log_callback) log_callback(user_data, "Recovered from missing End() for '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing End()"); End(); } } + if (g.CurrentWindowStack.Size == state_in->SizeOfWindowStack) + ErrorRecoveryTryToRecoverWindowState(state_in); } -// Must be called before End()/EndChild() -void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data) +// Called by e.g. End() but may be called for manual recovery. +// Read '// Error Handling [BETA]' block in imgui_internal.h for details. +// Attempt to recover from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls. +void ImGui::ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in) { ImGuiContext& g = *GImGui; - while (g.CurrentTable && (g.CurrentTable->OuterWindow == g.CurrentWindow || g.CurrentTable->InnerWindow == g.CurrentWindow)) + + while (g.CurrentTable != NULL && g.CurrentTable->InnerWindow == g.CurrentWindow) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing EndTable() in '%s'", g.CurrentTable->OuterWindow->Name); + IM_ASSERT_USER_ERROR(0, "Missing EndTable()"); EndTable(); } ImGuiWindow* window = g.CurrentWindow; - ImGuiStackSizes* stack_sizes = &g.CurrentWindowStack.back().StackSizesOnBegin; - IM_ASSERT(window != NULL); - while (g.CurrentTabBar != NULL) //-V1044 + + // FIXME: Can't recover from inside BeginTabItem/EndTabItem yet. + while (g.CurrentTabBar != NULL && g.CurrentTabBar->Window == window) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing EndTabBar() in '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing EndTabBar()"); EndTabBar(); } - while (window->DC.TreeDepth > 0) + while (g.CurrentMultiSelect != NULL && g.CurrentMultiSelect->Storage->Window == window) //-V1044 + { + IM_ASSERT_USER_ERROR(0, "Missing EndMultiSelect()"); + EndMultiSelect(); + } + while (window->DC.TreeDepth > state_in->SizeOfTreeStack) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing TreePop() in '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing TreePop()"); TreePop(); } - while (g.GroupStack.Size > stack_sizes->SizeOfGroupStack) //-V1044 + while (g.GroupStack.Size > state_in->SizeOfGroupStack) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing EndGroup() in '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing EndGroup()"); EndGroup(); } - while (window->IDStack.Size > 1) + IM_ASSERT(g.GroupStack.Size == state_in->SizeOfGroupStack); + while (window->IDStack.Size > state_in->SizeOfIDStack) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing PopID() in '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing PopID()"); PopID(); } - while (g.DisabledStackSize > stack_sizes->SizeOfDisabledStack) //-V1044 + while (g.DisabledStackSize > state_in->SizeOfDisabledStack) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing EndDisabled() in '%s'", window->Name); - EndDisabled(); + IM_ASSERT_USER_ERROR(0, "Missing EndDisabled()"); + if (g.CurrentItemFlags & ImGuiItemFlags_Disabled) + EndDisabled(); + else + { + EndDisabledOverrideReenable(); + g.CurrentWindowStack.back().DisabledOverrideReenable = false; + } } - while (g.ColorStack.Size > stack_sizes->SizeOfColorStack) + IM_ASSERT(g.DisabledStackSize == state_in->SizeOfDisabledStack); + while (g.ColorStack.Size > state_in->SizeOfColorStack) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing PopStyleColor() in '%s' for ImGuiCol_%s", window->Name, GetStyleColorName(g.ColorStack.back().Col)); + IM_ASSERT_USER_ERROR(0, "Missing PopStyleColor()"); PopStyleColor(); } - while (g.ItemFlagsStack.Size > stack_sizes->SizeOfItemFlagsStack) //-V1044 + while (g.ItemFlagsStack.Size > state_in->SizeOfItemFlagsStack) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing PopItemFlag() in '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing PopItemFlag()"); PopItemFlag(); } - while (g.StyleVarStack.Size > stack_sizes->SizeOfStyleVarStack) //-V1044 + while (g.StyleVarStack.Size > state_in->SizeOfStyleVarStack) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing PopStyleVar() in '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing PopStyleVar()"); PopStyleVar(); } - while (g.FontStack.Size > stack_sizes->SizeOfFontStack) //-V1044 + while (g.FontStack.Size > state_in->SizeOfFontStack) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing PopFont() in '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing PopFont()"); PopFont(); } - while (g.FocusScopeStack.Size > stack_sizes->SizeOfFocusScopeStack + 1) //-V1044 + while (g.FocusScopeStack.Size > state_in->SizeOfFocusScopeStack) //-V1044 { - if (log_callback) log_callback(user_data, "Recovered from missing PopFocusScope() in '%s'", window->Name); + IM_ASSERT_USER_ERROR(0, "Missing PopFocusScope()"); PopFocusScope(); } + //IM_ASSERT(g.FocusScopeStack.Size == state_in->SizeOfFocusScopeStack); } -// Save current stack sizes for later compare -void ImGuiStackSizes::SetToContextState(ImGuiContext* ctx) +bool ImGui::ErrorLog(const char* msg) { - ImGuiContext& g = *ctx; + ImGuiContext& g = *GImGui; + + // Output to debug log +#ifndef IMGUI_DISABLE_DEBUG_TOOLS ImGuiWindow* window = g.CurrentWindow; - SizeOfIDStack = (short)window->IDStack.Size; - SizeOfColorStack = (short)g.ColorStack.Size; - SizeOfStyleVarStack = (short)g.StyleVarStack.Size; - SizeOfFontStack = (short)g.FontStack.Size; - SizeOfFocusScopeStack = (short)g.FocusScopeStack.Size; - SizeOfGroupStack = (short)g.GroupStack.Size; - SizeOfItemFlagsStack = (short)g.ItemFlagsStack.Size; - SizeOfBeginPopupStack = (short)g.BeginPopupStack.Size; - SizeOfDisabledStack = (short)g.DisabledStackSize; + + if (g.IO.ConfigErrorRecoveryEnableDebugLog) + { + if (g.ErrorFirst) + IMGUI_DEBUG_LOG_ERROR("[imgui-error] (current settings: Assert=%d, Log=%d, Tooltip=%d)\n", + g.IO.ConfigErrorRecoveryEnableAssert, g.IO.ConfigErrorRecoveryEnableDebugLog, g.IO.ConfigErrorRecoveryEnableTooltip); + IMGUI_DEBUG_LOG_ERROR("[imgui-error] In window '%s': %s\n", window ? window->Name : "NULL", msg); + } + g.ErrorFirst = false; + + // Output to tooltip + if (g.IO.ConfigErrorRecoveryEnableTooltip) + { + if (BeginErrorTooltip()) + { + if (g.ErrorCountCurrentFrame < 20) + { + Text("In window '%s': %s", window ? window->Name : "NULL", msg); + if (window && (!window->IsFallbackWindow || window->WasActive)) + GetForegroundDrawList(window)->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 0, 0, 255)); + } + if (g.ErrorCountCurrentFrame == 20) + Text("(and more errors)"); + // EndFrame() will amend debug buttons to this window, after all errors have been submitted. + EndErrorTooltip(); + } + g.ErrorCountCurrentFrame++; + } +#endif + + // Output to callback + if (g.ErrorCallback != NULL) + g.ErrorCallback(&g, g.ErrorCallbackUserData, msg); + + // Return whether we should assert + return g.IO.ConfigErrorRecoveryEnableAssert; } -// Compare to detect usage errors -void ImGuiStackSizes::CompareWithContextState(ImGuiContext* ctx) +void ImGui::ErrorCheckEndFrameFinalizeErrorTooltip() { - ImGuiContext& g = *ctx; - ImGuiWindow* window = g.CurrentWindow; - IM_UNUSED(window); +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + ImGuiContext& g = *GImGui; + if (g.DebugDrawIdConflicts != 0 && g.IO.KeyCtrl == false) + g.DebugDrawIdConflictsCount = g.HoveredIdPreviousFrameItemCount; + if (g.DebugDrawIdConflicts != 0 && g.DebugItemPickerActive == false && BeginErrorTooltip()) + { + Text("Programmer error: %d visible items with conflicting ID!", g.DebugDrawIdConflictsCount); + BulletText("Code should use PushID()/PopID() in loops, or append \"##xx\" to same-label identifiers!"); + BulletText("Empty label e.g. Button(\"\") == same ID as parent widget/node. Use Button(\"##xx\") instead!"); + //BulletText("Code intending to use duplicate ID may use e.g. PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag()"); // Not making this too visible for fear of it being abused. + BulletText("Set io.ConfigDebugDetectIdConflicts=false to disable this warning in non-programmers builds."); + Separator(); + Text("(Hold CTRL to: use"); + SameLine(); + if (SmallButton("Item Picker")) + DebugStartItemPicker(); + SameLine(); + Text("to break in item call-stack, or"); + SameLine(); + if (SmallButton("Open FAQ->About ID Stack System") && g.PlatformIO.Platform_OpenInShellFn != NULL) + g.PlatformIO.Platform_OpenInShellFn(&g, "https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#qa-usage"); + EndErrorTooltip(); + } - // Window stacks - // NOT checking: DC.ItemWidth, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin) - IM_ASSERT(SizeOfIDStack == window->IDStack.Size && "PushID/PopID or TreeNode/TreePop Mismatch!"); + if (g.ErrorCountCurrentFrame > 0 && BeginErrorTooltip()) // Amend at end of frame + { + Separator(); + Text("(Hold CTRL to:"); + SameLine(); + if (SmallButton("Enable Asserts")) + g.IO.ConfigErrorRecoveryEnableAssert = true; + //SameLine(); + //if (SmallButton("Hide Error Tooltips")) + // g.IO.ConfigErrorRecoveryEnableTooltip = false; // Too dangerous + SameLine(0, 0); + Text(")"); + EndErrorTooltip(); + } +#endif +} - // Global stacks - // For color, style and font stacks there is an incentive to use Push/Begin/Pop/.../End patterns, so we relax our checks a little to allow them. - IM_ASSERT(SizeOfGroupStack == g.GroupStack.Size && "BeginGroup/EndGroup Mismatch!"); - IM_ASSERT(SizeOfBeginPopupStack == g.BeginPopupStack.Size && "BeginPopup/EndPopup or BeginMenu/EndMenu Mismatch!"); - IM_ASSERT(SizeOfDisabledStack == g.DisabledStackSize && "BeginDisabled/EndDisabled Mismatch!"); - IM_ASSERT(SizeOfItemFlagsStack >= g.ItemFlagsStack.Size && "PushItemFlag/PopItemFlag Mismatch!"); - IM_ASSERT(SizeOfColorStack >= g.ColorStack.Size && "PushStyleColor/PopStyleColor Mismatch!"); - IM_ASSERT(SizeOfStyleVarStack >= g.StyleVarStack.Size && "PushStyleVar/PopStyleVar Mismatch!"); - IM_ASSERT(SizeOfFontStack >= g.FontStack.Size && "PushFont/PopFont Mismatch!"); - IM_ASSERT(SizeOfFocusScopeStack == g.FocusScopeStack.Size && "PushFocusScope/PopFocusScope Mismatch!"); +// Pseudo-tooltip. Follow mouse until CTRL is held. When CTRL is held we lock position, allowing to click it. +bool ImGui::BeginErrorTooltip() +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = FindWindowByName("##Tooltip_Error"); + const bool use_locked_pos = (g.IO.KeyCtrl && window && window->WasActive); + PushStyleColor(ImGuiCol_PopupBg, ImLerp(g.Style.Colors[ImGuiCol_PopupBg], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.15f)); + if (use_locked_pos) + SetNextWindowPos(g.ErrorTooltipLockedPos); + bool is_visible = Begin("##Tooltip_Error", NULL, ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize); + PopStyleColor(); + if (is_visible && g.CurrentWindow->BeginCount == 1) + { + SeparatorText("MESSAGE FROM DEAR IMGUI"); + BringWindowToDisplayFront(g.CurrentWindow); + BringWindowToFocusFront(g.CurrentWindow); + g.ErrorTooltipLockedPos = GetWindowPos(); + } + else if (!is_visible) + { + End(); + } + return is_visible; } +void ImGui::EndErrorTooltip() +{ + End(); +} //----------------------------------------------------------------------------- -// [SECTION] LAYOUT +// [SECTION] ITEM SUBMISSION //----------------------------------------------------------------------------- -// - ItemSize() +// - KeepAliveID() // - ItemAdd() -// - SameLine() -// - GetCursorScreenPos() -// - SetCursorScreenPos() -// - GetCursorPos(), GetCursorPosX(), GetCursorPosY() -// - SetCursorPos(), SetCursorPosX(), SetCursorPosY() -// - GetCursorStartPos() -// - Indent() -// - Unindent() -// - SetNextItemWidth() -// - PushItemWidth() -// - PushMultiItemsWidths() -// - PopItemWidth() -// - CalcItemWidth() -// - CalcItemSize() -// - GetTextLineHeight() -// - GetTextLineHeightWithSpacing() -// - GetFrameHeight() -// - GetFrameHeightWithSpacing() -// - GetContentRegionMax() -// - GetContentRegionMaxAbs() [Internal] -// - GetContentRegionAvail(), -// - GetWindowContentRegionMin(), GetWindowContentRegionMax() -// - BeginGroup() -// - EndGroup() -// Also see in imgui_widgets: tab bars, and in imgui_tables: tables, columns. //----------------------------------------------------------------------------- -// Advance cursor given item size for layout. -// Register minimum needed size so it can extend the bounding box used for auto-fit calculation. -// See comments in ItemAdd() about how/why the size provided to ItemSize() vs ItemAdd() may often different. -void ImGui::ItemSize(const ImVec2& size, float text_baseline_y) +// Code not using ItemAdd() may need to call this manually otherwise ActiveId will be cleared. In IMGUI_VERSION_NUM < 18717 this was called by GetID(). +void ImGui::KeepAliveID(ImGuiID id) { ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return; - - // We increase the height in this function to accommodate for baseline offset. - // In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor, - // but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect. - const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f; - - const float line_y1 = window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y; - const float line_height = ImMax(window->DC.CurrLineSize.y, /*ImMax(*/window->DC.CursorPos.y - line_y1/*, 0.0f)*/ + size.y + offset_to_match_baseline_y); - - // Always align ourselves on pixel boundaries - //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG] - window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x; - window->DC.CursorPosPrevLine.y = line_y1; - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); // Next line - window->DC.CursorPos.y = IM_FLOOR(line_y1 + line_height + g.Style.ItemSpacing.y); // Next line - window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x); - window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y); - //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG] - - window->DC.PrevLineSize.y = line_height; - window->DC.CurrLineSize.y = 0.0f; - window->DC.PrevLineTextBaseOffset = ImMax(window->DC.CurrLineTextBaseOffset, text_baseline_y); - window->DC.CurrLineTextBaseOffset = 0.0f; - window->DC.IsSameLine = window->DC.IsSetPos = false; - - // Horizontal layout mode - if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) - SameLine(); + if (g.ActiveId == id) + g.ActiveIdIsAlive = id; + if (g.ActiveIdPreviousFrame == id) + g.ActiveIdPreviousFrameIsAlive = true; } // Declare item bounding box for clipping and interaction. // Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface // declare their minimum size requirement to ItemSize() and provide a larger region to ItemAdd() which is used drawing/interaction. +// THIS IS IN THE PERFORMANCE CRITICAL PATH (UNTIL THE CLIPPING TEST AND EARLY-RETURN) +IM_MSVC_RUNTIME_CHECKS_OFF bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGuiItemFlags extra_flags) { ImGuiContext& g = *GImGui; @@ -9475,14 +10794,15 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu g.LastItemData.ID = id; g.LastItemData.Rect = bb; g.LastItemData.NavRect = nav_bb_arg ? *nav_bb_arg : bb; - g.LastItemData.InFlags = g.CurrentItemFlags | g.NextItemData.ItemFlags | extra_flags; + g.LastItemData.ItemFlags = g.CurrentItemFlags | g.NextItemData.ItemFlags | extra_flags; g.LastItemData.StatusFlags = ImGuiItemStatusFlags_None; + // Note: we don't copy 'g.NextItemData.SelectionUserData' to an hypothetical g.LastItemData.SelectionUserData: since the former is not cleared. - // Directional navigation processing if (id != 0) { KeepAliveID(id); + // Directional navigation processing // Runs prior to clipping early-out // (a) So that NavInitRequest can be honored, for newly opened windows to select a default widget // (b) So that we can scroll up/down past clipped items. This adds a small O(N) cost to regular navigation requests @@ -9492,21 +10812,22 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu // to reach unclipped widgets. This would work if user had explicit scrolling control (e.g. mapped on a stick). // We intentionally don't check if g.NavWindow != NULL because g.NavAnyRequest should only be set when it is non null. // If we crash on a NULL g.NavWindow we need to fix the bug elsewhere. - if (!(g.LastItemData.InFlags & ImGuiItemFlags_NoNav)) + if (!(g.LastItemData.ItemFlags & ImGuiItemFlags_NoNav)) { + // FIMXE-NAV: investigate changing the window tests into a simple 'if (g.NavFocusScopeId == g.CurrentFocusScopeId)' test. window->DC.NavLayersActiveMaskNext |= (1 << window->DC.NavLayerCurrent); if (g.NavId == id || g.NavAnyRequest) if (g.NavWindow->RootWindowForNav == window->RootWindowForNav) - if (window == g.NavWindow || ((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened)) + if (window == g.NavWindow || ((window->ChildFlags | g.NavWindow->ChildFlags) & ImGuiChildFlags_NavFlattened)) NavProcessItem(); } - // [DEBUG] People keep stumbling on this problem and using "" as identifier in the root of a window instead of "##something". - // Empty identifier are valid and useful in a small amount of cases, but 99.9% of the time you want to use "##something". - // READ THE FAQ: https://dearimgui.com/faq - IM_ASSERT(id != window->ID && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!"); + if (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasShortcut) + ItemHandleShortcut(id); } - g.NextItemData.Flags = ImGuiNextItemDataFlags_None; + + // Lightweight clear of SetNextItemXXX data. + g.NextItemData.HasFlags = ImGuiNextItemDataFlags_None; g.NextItemData.ItemFlags = ImGuiItemFlags_None; #ifdef IMGUI_ENABLE_TEST_ENGINE @@ -9515,24 +10836,30 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu #endif // Clipping test - // (FIXME: This is a modified copy of IsClippedEx() so we can reuse the is_rect_visible value) - //const bool is_clipped = IsClippedEx(bb, id); - //if (is_clipped) - // return false; + // (this is an inline copy of IsClippedEx() so we can reuse the is_rect_visible value, otherwise we'd do 'if (IsClippedEx(bb, id)) return false') + // g.NavActivateId is not necessarily == g.NavId, in the case of remote activation (e.g. shortcuts) const bool is_rect_visible = bb.Overlaps(window->ClipRect); if (!is_rect_visible) - if (id == 0 || (id != g.ActiveId && id != g.ActiveIdPreviousFrame && id != g.NavId)) - if (!g.LogEnabled) + if (id == 0 || (id != g.ActiveId && id != g.ActiveIdPreviousFrame && id != g.NavId && id != g.NavActivateId)) + if (!g.ItemUnclipByLog) return false; // [DEBUG] #ifndef IMGUI_DISABLE_DEBUG_TOOLS - if (id != 0 && id == g.DebugLocateId) - DebugLocateItemResolveWithLastItem(); -#endif + if (id != 0) + { + if (id == g.DebugLocateId) + DebugLocateItemResolveWithLastItem(); + + // [DEBUG] People keep stumbling on this problem and using "" as identifier in the root of a window instead of "##something". + // Empty identifier are valid and useful in a small amount of cases, but 99.9% of the time you want to use "##something". + // READ THE FAQ: https://dearimgui.com/faq + IM_ASSERT(id != window->ID && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!"); + } //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG] - //if ((g.LastItemData.InFlags & ImGuiItemFlags_NoNav) == 0) + //if ((g.LastItemData.ItemFlags & ImGuiItemFlags_NoNav) == 0) // window->DrawList->AddRect(g.LastItemData.NavRect.Min, g.LastItemData.NavRect.Max, IM_COL32(255,255,0,255)); // [DEBUG] +#endif // We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them) if (is_rect_visible) @@ -9541,6 +10868,78 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredRect; return true; } +IM_MSVC_RUNTIME_CHECKS_RESTORE + +//----------------------------------------------------------------------------- +// [SECTION] LAYOUT +//----------------------------------------------------------------------------- +// - ItemSize() +// - SameLine() +// - GetCursorScreenPos() +// - SetCursorScreenPos() +// - GetCursorPos(), GetCursorPosX(), GetCursorPosY() +// - SetCursorPos(), SetCursorPosX(), SetCursorPosY() +// - GetCursorStartPos() +// - Indent() +// - Unindent() +// - SetNextItemWidth() +// - PushItemWidth() +// - PushMultiItemsWidths() +// - PopItemWidth() +// - CalcItemWidth() +// - CalcItemSize() +// - GetTextLineHeight() +// - GetTextLineHeightWithSpacing() +// - GetFrameHeight() +// - GetFrameHeightWithSpacing() +// - GetContentRegionMax() +// - GetContentRegionAvail(), +// - BeginGroup() +// - EndGroup() +// Also see in imgui_widgets: tab bars, and in imgui_tables: tables, columns. +//----------------------------------------------------------------------------- + +// Advance cursor given item size for layout. +// Register minimum needed size so it can extend the bounding box used for auto-fit calculation. +// See comments in ItemAdd() about how/why the size provided to ItemSize() vs ItemAdd() may often different. +// THIS IS IN THE PERFORMANCE CRITICAL PATH. +IM_MSVC_RUNTIME_CHECKS_OFF +void ImGui::ItemSize(const ImVec2& size, float text_baseline_y) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + if (window->SkipItems) + return; + + // We increase the height in this function to accommodate for baseline offset. + // In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor, + // but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect. + const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f; + + const float line_y1 = window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y; + const float line_height = ImMax(window->DC.CurrLineSize.y, /*ImMax(*/window->DC.CursorPos.y - line_y1/*, 0.0f)*/ + size.y + offset_to_match_baseline_y); + + // Always align ourselves on pixel boundaries + //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG] + window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x; + window->DC.CursorPosPrevLine.y = line_y1; + window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); // Next line + window->DC.CursorPos.y = IM_TRUNC(line_y1 + line_height + g.Style.ItemSpacing.y); // Next line + window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x); + window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y); + //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG] + + window->DC.PrevLineSize.y = line_height; + window->DC.CurrLineSize.y = 0.0f; + window->DC.PrevLineTextBaseOffset = ImMax(window->DC.CurrLineTextBaseOffset, text_baseline_y); + window->DC.CurrLineTextBaseOffset = 0.0f; + window->DC.IsSameLine = window->DC.IsSetPos = false; + + // Horizontal layout mode + if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) + SameLine(); +} +IM_MSVC_RUNTIME_CHECKS_RESTORE // Gets back to previous line and continue with horizontal layout // offset_from_start_x == 0 : follow right after previous item @@ -9657,7 +11056,7 @@ void ImGui::Unindent(float indent_w) void ImGui::SetNextItemWidth(float item_width) { ImGuiContext& g = *GImGui; - g.NextItemData.Flags |= ImGuiNextItemDataFlags_HasWidth; + g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasWidth; g.NextItemData.Width = item_width; } @@ -9668,27 +11067,37 @@ void ImGui::PushItemWidth(float item_width) ImGuiWindow* window = g.CurrentWindow; window->DC.ItemWidthStack.push_back(window->DC.ItemWidth); // Backup current width window->DC.ItemWidth = (item_width == 0.0f ? window->ItemWidthDefault : item_width); - g.NextItemData.Flags &= ~ImGuiNextItemDataFlags_HasWidth; + g.NextItemData.HasFlags &= ~ImGuiNextItemDataFlags_HasWidth; } void ImGui::PushMultiItemsWidths(int components, float w_full) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; + IM_ASSERT(components > 0); const ImGuiStyle& style = g.Style; - const float w_item_one = ImMax(1.0f, IM_FLOOR((w_full - (style.ItemInnerSpacing.x) * (components - 1)) / (float)components)); - const float w_item_last = ImMax(1.0f, IM_FLOOR(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components - 1))); window->DC.ItemWidthStack.push_back(window->DC.ItemWidth); // Backup current width - window->DC.ItemWidthStack.push_back(w_item_last); - for (int i = 0; i < components - 2; i++) - window->DC.ItemWidthStack.push_back(w_item_one); - window->DC.ItemWidth = (components == 1) ? w_item_last : w_item_one; - g.NextItemData.Flags &= ~ImGuiNextItemDataFlags_HasWidth; + float w_items = w_full - style.ItemInnerSpacing.x * (components - 1); + float prev_split = w_items; + for (int i = components - 1; i > 0; i--) + { + float next_split = IM_TRUNC(w_items * i / components); + window->DC.ItemWidthStack.push_back(ImMax(prev_split - next_split, 1.0f)); + prev_split = next_split; + } + window->DC.ItemWidth = ImMax(prev_split, 1.0f); + g.NextItemData.HasFlags &= ~ImGuiNextItemDataFlags_HasWidth; } void ImGui::PopItemWidth() { - ImGuiWindow* window = GetCurrentWindow(); + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + if (window->DC.ItemWidthStack.Size <= 0) + { + IM_ASSERT_USER_ERROR(0, "Calling PopItemWidth() too many times!"); + return; + } window->DC.ItemWidth = window->DC.ItemWidthStack.back(); window->DC.ItemWidthStack.pop_back(); } @@ -9700,16 +11109,16 @@ float ImGui::CalcItemWidth() ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; float w; - if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasWidth) + if (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasWidth) w = g.NextItemData.Width; else w = window->DC.ItemWidth; if (w < 0.0f) { - float region_max_x = GetContentRegionMaxAbs().x; - w = ImMax(1.0f, region_max_x - window->DC.CursorPos.x + w); + float region_avail_x = GetContentRegionAvail().x; + w = ImMax(1.0f, region_avail_x + w); } - w = IM_FLOOR(w); + w = IM_TRUNC(w); return w; } @@ -9719,22 +11128,19 @@ float ImGui::CalcItemWidth() // The 4.0f here may be changed to match CalcItemWidth() and/or BeginChild() (right now we have a mismatch which is harmless but undesirable) ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_w, float default_h) { - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - - ImVec2 region_max; + ImVec2 avail; if (size.x < 0.0f || size.y < 0.0f) - region_max = GetContentRegionMaxAbs(); + avail = GetContentRegionAvail(); if (size.x == 0.0f) size.x = default_w; else if (size.x < 0.0f) - size.x = ImMax(4.0f, region_max.x - window->DC.CursorPos.x + size.x); + size.x = ImMax(4.0f, avail.x + size.x); // <-- size.x is negative here so we are subtracting if (size.y == 0.0f) size.y = default_h; else if (size.y < 0.0f) - size.y = ImMax(4.0f, region_max.y - window->DC.CursorPos.y + size.y); + size.y = ImMax(4.0f, avail.y + size.y); // <-- size.y is negative here so we are subtracting return size; } @@ -9763,33 +11169,23 @@ float ImGui::GetFrameHeightWithSpacing() return g.FontSize + g.Style.FramePadding.y * 2.0f + g.Style.ItemSpacing.y; } -// FIXME: All the Contents Region function are messy or misleading. WE WILL AIM TO OBSOLETE ALL OF THEM WITH A NEW "WORK RECT" API. Thanks for your patience! - -// FIXME: This is in window space (not screen space!). -ImVec2 ImGui::GetContentRegionMax() +ImVec2 ImGui::GetContentRegionAvail() { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; ImVec2 mx = (window->DC.CurrentColumns || g.CurrentTable) ? window->WorkRect.Max : window->ContentRegionRect.Max; - return mx - window->Pos; + return mx - window->DC.CursorPos; } -// [Internal] Absolute coordinate. Saner. This is not exposed until we finishing refactoring work rect features. -ImVec2 ImGui::GetContentRegionMaxAbs() -{ - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - ImVec2 mx = (window->DC.CurrentColumns || g.CurrentTable) ? window->WorkRect.Max : window->ContentRegionRect.Max; - return mx; -} +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS -ImVec2 ImGui::GetContentRegionAvail() +// You should never need those functions. Always use GetCursorScreenPos() and GetContentRegionAvail()! +// They are bizarre local-coordinates which don't play well with scrolling. +ImVec2 ImGui::GetContentRegionMax() { - ImGuiWindow* window = GImGui->CurrentWindow; - return GetContentRegionMaxAbs() - window->DC.CursorPos; + return GetContentRegionAvail() + GetCursorScreenPos() - GetWindowPos(); } -// In window space (not screen space!) ImVec2 ImGui::GetWindowContentRegionMin() { ImGuiWindow* window = GImGui->CurrentWindow; @@ -9801,6 +11197,7 @@ ImVec2 ImGui::GetWindowContentRegionMax() ImGuiWindow* window = GImGui->CurrentWindow; return window->ContentRegionRect.Max - window->Pos; } +#endif // Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) // Groups are currently a mishmash of functionalities which should perhaps be clarified and separated. @@ -9814,6 +11211,7 @@ void ImGui::BeginGroup() ImGuiGroupData& group_data = g.GroupStack.back(); group_data.WindowID = window->ID; group_data.BackupCursorPos = window->DC.CursorPos; + group_data.BackupCursorPosPrevLine = window->DC.CursorPosPrevLine; group_data.BackupCursorMaxPos = window->DC.CursorMaxPos; group_data.BackupIndent = window->DC.Indent; group_data.BackupGroupOffset = window->DC.GroupOffset; @@ -9821,6 +11219,7 @@ void ImGui::BeginGroup() group_data.BackupCurrLineTextBaseOffset = window->DC.CurrLineTextBaseOffset; group_data.BackupActiveIdIsAlive = g.ActiveIdIsAlive; group_data.BackupHoveredIdIsAlive = g.HoveredId != 0; + group_data.BackupIsSameLine = window->DC.IsSameLine; group_data.BackupActiveIdPreviousFrameIsAlive = g.ActiveIdPreviousFrameIsAlive; group_data.EmitItem = true; @@ -9844,14 +11243,16 @@ void ImGui::EndGroup() if (window->DC.IsSetPos) ErrorCheckUsingSetCursorPosToExtendParentBoundaries(); - ImRect group_bb(group_data.BackupCursorPos, ImMax(window->DC.CursorMaxPos, group_data.BackupCursorPos)); - + // Include LastItemData.Rect.Max as a workaround for e.g. EndTable() undershooting with CursorMaxPos report. (#7543) + ImRect group_bb(group_data.BackupCursorPos, ImMax(ImMax(window->DC.CursorMaxPos, g.LastItemData.Rect.Max), group_data.BackupCursorPos)); window->DC.CursorPos = group_data.BackupCursorPos; - window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos); + window->DC.CursorPosPrevLine = group_data.BackupCursorPosPrevLine; + window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, group_bb.Max); window->DC.Indent = group_data.BackupIndent; window->DC.GroupOffset = group_data.BackupGroupOffset; window->DC.CurrLineSize = group_data.BackupCurrLineSize; window->DC.CurrLineTextBaseOffset = group_data.BackupCurrLineTextBaseOffset; + window->DC.IsSameLine = group_data.BackupIsSameLine; if (g.LogEnabled) g.LogLinePosY = -FLT_MAX; // To enforce a carriage return @@ -9861,7 +11262,7 @@ void ImGui::EndGroup() return; } - window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now. + window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now. ItemSize(group_bb.GetSize()); ItemAdd(group_bb, 0, NULL, ImGuiItemFlags_NoTabStop); @@ -9892,7 +11293,8 @@ void ImGui::EndGroup() g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Deactivated; g.GroupStack.pop_back(); - //window->DrawList->AddRect(group_bb.Min, group_bb.Max, IM_COL32(255,0,255,255)); // [Debug] + if (g.DebugShowGroupRects) + window->DrawList->AddRect(group_bb.Min, group_bb.Max, IM_COL32(255,0,255,255)); // [Debug] } @@ -9931,7 +11333,7 @@ static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window) } scroll[axis] = scroll_target - center_ratio * (window->SizeFull[axis] - decoration_size[axis]); } - scroll[axis] = IM_FLOOR(ImMax(scroll[axis], 0.0f)); + scroll[axis] = IM_ROUND(ImMax(scroll[axis], 0.0f)); if (!window->Collapsed && !window->SkipItems) scroll[axis] = ImMin(scroll[axis], window->ScrollMax[axis]); } @@ -9986,7 +11388,7 @@ ImVec2 ImGui::ScrollToRectEx(ImGuiWindow* window, const ImRect& item_rect, ImGui else if (((flags & ImGuiScrollFlags_KeepVisibleCenterX) && !fully_visible_x) || (flags & ImGuiScrollFlags_AlwaysCenterX)) { if (can_be_fully_visible_x) - SetScrollFromPosX(window, ImFloor((item_rect.Min.x + item_rect.Max.x) * 0.5f) - window->Pos.x, 0.5f); + SetScrollFromPosX(window, ImTrunc((item_rect.Min.x + item_rect.Max.x) * 0.5f) - window->Pos.x, 0.5f); else SetScrollFromPosX(window, item_rect.Min.x - window->Pos.x, 0.0f); } @@ -10001,7 +11403,7 @@ ImVec2 ImGui::ScrollToRectEx(ImGuiWindow* window, const ImRect& item_rect, ImGui else if (((flags & ImGuiScrollFlags_KeepVisibleCenterY) && !fully_visible_y) || (flags & ImGuiScrollFlags_AlwaysCenterY)) { if (can_be_fully_visible_y) - SetScrollFromPosY(window, ImFloor((item_rect.Min.y + item_rect.Max.y) * 0.5f) - window->Pos.y, 0.5f); + SetScrollFromPosY(window, ImTrunc((item_rect.Min.y + item_rect.Max.y) * 0.5f) - window->Pos.y, 0.5f); else SetScrollFromPosY(window, item_rect.Min.y - window->Pos.y, 0.0f); } @@ -10086,7 +11488,7 @@ void ImGui::SetScrollY(float scroll_y) void ImGui::SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio) { IM_ASSERT(center_x_ratio >= 0.0f && center_x_ratio <= 1.0f); - window->ScrollTarget.x = IM_FLOOR(local_x - window->DecoOuterSizeX1 - window->DecoInnerSizeX1 + window->Scroll.x); // Convert local position to scroll offset + window->ScrollTarget.x = IM_TRUNC(local_x - window->DecoOuterSizeX1 - window->DecoInnerSizeX1 + window->Scroll.x); // Convert local position to scroll offset window->ScrollTargetCenterRatio.x = center_x_ratio; window->ScrollTargetEdgeSnapDist.x = 0.0f; } @@ -10094,7 +11496,7 @@ void ImGui::SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x void ImGui::SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y_ratio) { IM_ASSERT(center_y_ratio >= 0.0f && center_y_ratio <= 1.0f); - window->ScrollTarget.y = IM_FLOOR(local_y - window->DecoOuterSizeY1 - window->DecoInnerSizeY1 + window->Scroll.y); // Convert local position to scroll offset + window->ScrollTarget.y = IM_TRUNC(local_y - window->DecoOuterSizeY1 - window->DecoInnerSizeY1 + window->Scroll.y); // Convert local position to scroll offset window->ScrollTargetCenterRatio.y = center_y_ratio; window->ScrollTargetEdgeSnapDist.y = 0.0f; } @@ -10157,7 +11559,8 @@ bool ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags ext { ImGuiContext& g = *GImGui; - if (g.DragDropWithinSource || g.DragDropWithinTarget) + const bool is_dragdrop_tooltip = g.DragDropWithinSource || g.DragDropWithinTarget; + if (is_dragdrop_tooltip) { // Drag and Drop tooltips are positioning differently than other tooltips: // - offset visibility to increase visibility around mouse. @@ -10165,23 +11568,29 @@ bool ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags ext // We call SetNextWindowPos() to enforce position and disable clamping. // See FindBestWindowPosForPopup() for positionning logic of other tooltips (not drag and drop ones). //ImVec2 tooltip_pos = g.IO.MousePos - g.ActiveIdClickOffset - g.Style.WindowPadding; - ImVec2 tooltip_pos = g.IO.MousePos + TOOLTIP_DEFAULT_OFFSET * g.Style.MouseCursorScale; - SetNextWindowPos(tooltip_pos); + const bool is_touchscreen = (g.IO.MouseSource == ImGuiMouseSource_TouchScreen); + if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos) == 0) + { + ImVec2 tooltip_pos = is_touchscreen ? (g.IO.MousePos + TOOLTIP_DEFAULT_OFFSET_TOUCH * g.Style.MouseCursorScale) : (g.IO.MousePos + TOOLTIP_DEFAULT_OFFSET_MOUSE * g.Style.MouseCursorScale); + ImVec2 tooltip_pivot = is_touchscreen ? TOOLTIP_DEFAULT_PIVOT_TOUCH : ImVec2(0.0f, 0.0f); + SetNextWindowPos(tooltip_pos, ImGuiCond_None, tooltip_pivot); + } + SetNextWindowBgAlpha(g.Style.Colors[ImGuiCol_PopupBg].w * 0.60f); //PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * 0.60f); // This would be nice but e.g ColorButton with checkboard has issue with transparent colors :( tooltip_flags |= ImGuiTooltipFlags_OverridePrevious; } - char window_name[16]; - ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", g.TooltipOverrideCount); - if (tooltip_flags & ImGuiTooltipFlags_OverridePrevious) - if (ImGuiWindow* window = FindWindowByName(window_name)) - if (window->Active) - { - // Hide previous tooltip from being displayed. We can't easily "reset" the content of a window so we create a new one. - SetWindowHiddendAndSkipItemsForCurrentFrame(window); - ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", ++g.TooltipOverrideCount); - } + const char* window_name_template = is_dragdrop_tooltip ? "##Tooltip_DragDrop_%02d" : "##Tooltip_%02d"; + char window_name[32]; + ImFormatString(window_name, IM_ARRAYSIZE(window_name), window_name_template, g.TooltipOverrideCount); + if ((tooltip_flags & ImGuiTooltipFlags_OverridePrevious) && g.TooltipPreviousWindow != NULL && g.TooltipPreviousWindow->Active) + { + // Hide previous tooltip from being displayed. We can't easily "reset" the content of a window so we create a new one. + //IMGUI_DEBUG_LOG("[tooltip] '%s' already active, using +1 for this frame\n", window_name); + SetWindowHiddenAndSkipItemsForCurrentFrame(g.TooltipPreviousWindow); + ImFormatString(window_name, IM_ARRAYSIZE(window_name), window_name_template, ++g.TooltipOverrideCount); + } ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize; Begin(window_name, NULL, flags | extra_window_flags); // 2023-03-09: Added bool return value to the API, but currently always returning true. @@ -10329,7 +11738,7 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags) ImGuiPopupData popup_ref; // Tagged as new ref as Window will be set back to NULL if we write this into OpenPopupStack. popup_ref.PopupId = id; popup_ref.Window = NULL; - popup_ref.BackupNavWindow = g.NavWindow; // When popup closes focus may be restored to NavWindow (depend on window type). + popup_ref.RestoreNavWindow = g.NavWindow; // When popup closes focus may be restored to NavWindow (depend on window type). popup_ref.OpenFrameCount = g.FrameCount; popup_ref.OpenParentId = parent_window->IDStack.back(); popup_ref.OpenPopupPos = NavCalcPreferredRefPos(); @@ -10342,17 +11751,23 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags) } else { - // Gently handle the user mistakenly calling OpenPopup() every frame. It is a programming mistake! However, if we were to run the regular code path, the ui - // would become completely unusable because the popup will always be in hidden-while-calculating-size state _while_ claiming focus. Which would be a very confusing - // situation for the programmer. Instead, we silently allow the popup to proceed, it will keep reappearing and the programming error will be more obvious to understand. - if (g.OpenPopupStack[current_stack_size].PopupId == id && g.OpenPopupStack[current_stack_size].OpenFrameCount == g.FrameCount - 1) + // Gently handle the user mistakenly calling OpenPopup() every frames: it is likely a programming mistake! + // However, if we were to run the regular code path, the ui would become completely unusable because the popup will always be + // in hidden-while-calculating-size state _while_ claiming focus. Which is extremely confusing situation for the programmer. + // Instead, for successive frames calls to OpenPopup(), we silently avoid reopening even if ImGuiPopupFlags_NoReopen is not specified. + bool keep_existing = false; + if (g.OpenPopupStack[current_stack_size].PopupId == id) + if ((g.OpenPopupStack[current_stack_size].OpenFrameCount == g.FrameCount - 1) || (popup_flags & ImGuiPopupFlags_NoReopen)) + keep_existing = true; + if (keep_existing) { + // No reopen g.OpenPopupStack[current_stack_size].OpenFrameCount = popup_ref.OpenFrameCount; } else { - // Close child popups if any, then flag popup for open/reopen - ClosePopupToLevel(current_stack_size, false); + // Reopen: close child popups if any, then flag popup for open/reopen (set position, focus, init navigation) + ClosePopupToLevel(current_stack_size, true); g.OpenPopupStack.push_back(popup_ref); } @@ -10372,6 +11787,7 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to return; // Don't close our own child popup windows. + //IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupsOverWindow(\"%s\") restore_under=%d\n", ref_window ? ref_window->Name : "", restore_focus_to_window_under_popup); int popup_count_to_keep = 0; if (ref_window) { @@ -10382,14 +11798,15 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to if (!popup.Window) continue; IM_ASSERT((popup.Window->Flags & ImGuiWindowFlags_Popup) != 0); - if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow) - continue; // Trim the stack unless the popup is a direct parent of the reference window (the reference window is often the NavWindow) - // - With this stack of window, clicking/focusing Popup1 will close Popup2 and Popup3: - // Window -> Popup1 -> Popup2 -> Popup3 + // - Clicking/Focusing Window2 won't close Popup1: + // Window -> Popup1 -> Window2(Ref) + // - Clicking/focusing Popup1 will close Popup2 and Popup3: + // Window -> Popup1(Ref) -> Popup2 -> Popup3 // - Each popups may contain child windows, which is why we compare ->RootWindow! // Window -> Popup1 -> Popup1_Child -> Popup2 -> Popup2_Child + // We step through every popup from bottom to top to validate their position relative to reference window. bool ref_window_is_descendent_of_popup = false; for (int n = popup_count_to_keep; n < g.OpenPopupStack.Size; n++) if (ImGuiWindow* popup_window = g.OpenPopupStack[n].Window) @@ -10427,18 +11844,22 @@ void ImGui::ClosePopupsExceptModals() void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup) { ImGuiContext& g = *GImGui; - IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupToLevel(%d), restore_focus_to_window_under_popup=%d\n", remaining, restore_focus_to_window_under_popup); + IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupToLevel(%d), restore_under=%d\n", remaining, restore_focus_to_window_under_popup); IM_ASSERT(remaining >= 0 && remaining < g.OpenPopupStack.Size); + if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) + for (int n = remaining; n < g.OpenPopupStack.Size; n++) + IMGUI_DEBUG_LOG_POPUP("[popup] - Closing PopupID 0x%08X Window \"%s\"\n", g.OpenPopupStack[n].PopupId, g.OpenPopupStack[n].Window ? g.OpenPopupStack[n].Window->Name : NULL); // Trim open popup stack - ImGuiWindow* popup_window = g.OpenPopupStack[remaining].Window; - ImGuiWindow* popup_backup_nav_window = g.OpenPopupStack[remaining].BackupNavWindow; + ImGuiPopupData prev_popup = g.OpenPopupStack[remaining]; g.OpenPopupStack.resize(remaining); - if (restore_focus_to_window_under_popup) + // Restore focus (unless popup window was not yet submitted, and didn't have a chance to take focus anyhow. See #7325 for an edge case) + if (restore_focus_to_window_under_popup && prev_popup.Window) { - ImGuiWindow* focus_window = (popup_window && popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : popup_backup_nav_window; - if (focus_window && !focus_window->WasActive && popup_window) + ImGuiWindow* popup_window = prev_popup.Window; + ImGuiWindow* focus_window = (popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow; + if (focus_window && !focus_window->WasActive) FocusTopMostWindowUnderOne(popup_window, NULL, NULL, ImGuiFocusRequestFlags_RestoreFocusedChild); // Fallback else FocusWindow(focus_window, (g.NavLayer == ImGuiNavLayer_Main) ? ImGuiFocusRequestFlags_RestoreFocusedChild : ImGuiFocusRequestFlags_None); @@ -10476,8 +11897,8 @@ void ImGui::CloseCurrentPopup() window->DC.NavHideHighlightOneFrame = true; } -// Attention! BeginPopup() adds default flags which BeginPopupEx()! -bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags) +// Attention! BeginPopup() adds default flags when calling BeginPopupEx()! +bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_window_flags) { ImGuiContext& g = *GImGui; if (!IsPopupOpen(id, ImGuiPopupFlags_None)) @@ -10487,16 +11908,17 @@ bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags) } char name[20]; - if (flags & ImGuiWindowFlags_ChildMenu) - ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginMenuCount); // Recycle windows based on depth + if (extra_window_flags & ImGuiWindowFlags_ChildMenu) + ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginMenuDepth); // Recycle windows based on depth else ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame - flags |= ImGuiWindowFlags_Popup; - bool is_open = Begin(name, NULL, flags); + bool is_open = Begin(name, NULL, extra_window_flags | ImGuiWindowFlags_Popup); if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display) EndPopup(); + //g.CurrentWindow->FocusRouteParentWindow = g.CurrentWindow->ParentWindowInBeginStack; + return is_open; } @@ -10514,7 +11936,9 @@ bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags) } // If 'p_open' is specified for a modal popup window, the popup will have a regular close button which will close the popup. -// Note that popup visibility status is owned by Dear ImGui (and manipulated with e.g. OpenPopup) so the actual value of *p_open is meaningless here. +// Note that popup visibility status is owned by Dear ImGui (and manipulated with e.g. OpenPopup). +// - *p_open set back to false in BeginPopupModal() when popup is not open. +// - if you set *p_open to false before calling BeginPopupModal(), it will close the popup. bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags flags) { ImGuiContext& g = *GImGui; @@ -10523,6 +11947,8 @@ bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags fla if (!IsPopupOpen(id, ImGuiPopupFlags_None)) { g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values + if (p_open && *p_open) + *p_open = false; return false; } @@ -10755,18 +12181,30 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window) if (window->Flags & ImGuiWindowFlags_Tooltip) { // Position tooltip (always follows mouse + clamp within outer boundaries) - // Note that drag and drop tooltips are NOT using this path: BeginTooltipEx() manually sets their position. - // In theory we could handle both cases in same location, but requires a bit of shuffling as drag and drop tooltips are calling SetWindowPos() leading to 'window_pos_set_by_api' being set in Begin() + // FIXME: + // - Too many paths. One problem is that FindBestWindowPosForPopupEx() doesn't allow passing a suggested position (so touch screen path doesn't use it by default). + // - Drag and drop tooltips are not using this path either: BeginTooltipEx() manually sets their position. + // - Require some tidying up. In theory we could handle both cases in same location, but requires a bit of shuffling + // as drag and drop tooltips are calling SetNextWindowPos() leading to 'window_pos_set_by_api' being set in Begin(). IM_ASSERT(g.CurrentWindow == window); const float scale = g.Style.MouseCursorScale; const ImVec2 ref_pos = NavCalcPreferredRefPos(); - const ImVec2 tooltip_pos = ref_pos + TOOLTIP_DEFAULT_OFFSET * scale; + + if (g.IO.MouseSource == ImGuiMouseSource_TouchScreen && NavCalcPreferredRefPosSource() == ImGuiInputSource_Mouse) + { + ImVec2 tooltip_pos = ref_pos + TOOLTIP_DEFAULT_OFFSET_TOUCH * scale - (TOOLTIP_DEFAULT_PIVOT_TOUCH * window->Size); + if (r_outer.Contains(ImRect(tooltip_pos, tooltip_pos + window->Size))) + return tooltip_pos; + } + + ImVec2 tooltip_pos = ref_pos + TOOLTIP_DEFAULT_OFFSET_MOUSE * scale; ImRect r_avoid; - if (!g.NavDisableHighlight && g.NavDisableMouseHover && !(g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos)) + if (g.NavCursorVisible && g.NavHighlightItemUnderNav && !g.IO.ConfigNavMoveSetMousePos) r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 16, ref_pos.y + 8); else r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 24 * scale, ref_pos.y + 24 * scale); // FIXME: Hard-coded based on mouse cursor shape expectation. Exact dimension not very important. //GetForegroundDrawList()->AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255, 0, 255, 255)); + return FindBestWindowPosForPopupEx(tooltip_pos, window->Size, &window->AutoPosLastDirection, r_outer, r_avoid, ImGuiPopupPositionPolicy_Tooltip); } IM_ASSERT(0); @@ -10781,6 +12219,23 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window) // In our terminology those should be interchangeable, yet right now this is super confusing. // Those two functions are merely a legacy artifact, so at minimum naming should be clarified. +void ImGui::SetNavCursorVisible(bool visible) +{ + ImGuiContext& g = *GImGui; + if (g.IO.ConfigNavCursorVisibleAlways) + visible = true; + g.NavCursorVisible = visible; +} + +// (was called NavRestoreHighlightAfterMove() before 1.91.4) +void ImGui::SetNavCursorVisibleAfterMove() +{ + ImGuiContext& g = *GImGui; + if (g.IO.ConfigNavCursorVisibleAuto) + g.NavCursorVisible = true; + g.NavHighlightItemUnderNav = g.NavMousePosDirty = true; +} + void ImGui::SetNavWindow(ImGuiWindow* window) { ImGuiContext& g = *GImGui; @@ -10788,11 +12243,19 @@ void ImGui::SetNavWindow(ImGuiWindow* window) { IMGUI_DEBUG_LOG_FOCUS("[focus] SetNavWindow(\"%s\")\n", window ? window->Name : ""); g.NavWindow = window; + g.NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid; } g.NavInitRequest = g.NavMoveSubmitted = g.NavMoveScoringItems = false; NavUpdateAnyRequestFlag(); } +void ImGui::NavHighlightActivated(ImGuiID id) +{ + ImGuiContext& g = *GImGui; + g.NavHighlightActivatedId = id; + g.NavHighlightActivatedTimer = NAV_ACTIVATE_HIGHLIGHT_TIMER; +} + void ImGui::NavClearPreferredPosForAxis(ImGuiAxis axis) { ImGuiContext& g = *GImGui; @@ -10806,7 +12269,7 @@ void ImGui::SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id IM_ASSERT(nav_layer == ImGuiNavLayer_Main || nav_layer == ImGuiNavLayer_Menu); g.NavId = id; g.NavLayer = nav_layer; - g.NavFocusScopeId = focus_scope_id; + SetNavFocusScope(focus_scope_id); g.NavWindow->NavLastIds[nav_layer] = id; g.NavWindow->NavRectRel[nav_layer] = rect_rel; @@ -10828,15 +12291,15 @@ void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window) const ImGuiNavLayer nav_layer = window->DC.NavLayerCurrent; g.NavId = id; g.NavLayer = nav_layer; - g.NavFocusScopeId = g.CurrentFocusScopeId; + SetNavFocusScope(g.CurrentFocusScopeId); window->NavLastIds[nav_layer] = id; if (g.LastItemData.ID == id) window->NavRectRel[nav_layer] = WindowRectAbsToRel(window, g.LastItemData.NavRect); if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad) - g.NavDisableMouseHover = true; - else - g.NavDisableHighlight = true; + g.NavHighlightItemUnderNav = true; + else if (g.IO.ConfigNavCursorVisibleAuto) + g.NavCursorVisible = false; // Clear preferred scoring position (NavMoveRequestApplyResult() will tend to restore it) NavClearPreferredPosForAxis(ImGuiAxis_X); @@ -10859,7 +12322,7 @@ static float inline NavScoreItemDistInterval(float cand_min, float cand_max, flo return 0.0f; } -// Scoring function for gamepad/keyboard directional navigation. Based on https://gist.github.com/rygorous/6981057 +// Scoring function for keyboard/gamepad directional navigation. Based on https://gist.github.com/rygorous/6981057 static bool ImGui::NavScoreItem(ImGuiNavItemData* result) { ImGuiContext& g = *GImGui; @@ -10875,7 +12338,7 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result) // When entering through a NavFlattened border, we consider child window items as fully clipped for scoring if (window->ParentWindow == g.NavWindow) { - IM_ASSERT((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened); + IM_ASSERT((window->ChildFlags | g.NavWindow->ChildFlags) & ImGuiChildFlags_NavFlattened); if (!window->ClipRect.Overlaps(cand)) return false; cand.ClipWithFull(window->ClipRect); // This allows the scored item to not overlap other candidates in the parent window @@ -10900,6 +12363,9 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result) if (dbx != 0.0f || dby != 0.0f) { // For non-overlapping boxes, use distance between boxes + // FIXME-NAV: Quadrant may be incorrect because of (1) dbx bias and (2) curr.Max.y bias applied by NavBiasScoringRect() where typically curr.Max.y==curr.Min.y + // One typical case where this happens, with style.WindowMenuButtonPosition == ImGuiDir_Right, pressing Left to navigate from Close to Collapse tends to fail. + // Also see #6344. Calling ImGetDirQuadrantFromDelta() with unbiased values may be good but side-effects are plenty. dax = dbx; day = dby; dist_axial = dist_box; @@ -11005,8 +12471,13 @@ static void ImGui::NavApplyItemToResult(ImGuiNavItemData* result) result->Window = window; result->ID = g.LastItemData.ID; result->FocusScopeId = g.CurrentFocusScopeId; - result->InFlags = g.LastItemData.InFlags; + result->ItemFlags = g.LastItemData.ItemFlags; result->RectRel = WindowRectAbsToRel(window, g.LastItemData.NavRect); + if (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData) + { + IM_ASSERT(g.NextItemData.SelectionUserData != ImGuiSelectionUserData_Invalid); + result->SelectionUserData = g.NextItemData.SelectionUserData; // INTENTIONAL: At this point this field is not cleared in NextItemData. Avoid unnecessary copy to LastItemData. + } } // True when current work location may be scrolled horizontally when moving left / right. @@ -11019,13 +12490,13 @@ void ImGui::NavUpdateCurrentWindowIsScrollPushableX() } // We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above) -// This is called after LastItemData is set. +// This is called after LastItemData is set, but NextItemData is also still valid. static void ImGui::NavProcessItem() { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; const ImGuiID id = g.LastItemData.ID; - const ImGuiItemFlags item_flags = g.LastItemData.InFlags; + const ImGuiItemFlags item_flags = g.LastItemData.ItemFlags; // When inside a container that isn't scrollable with Left<>Right, clip NavRect accordingly (#2221) if (window->DC.NavIsScrollPushableX == false) @@ -11055,23 +12526,26 @@ static void ImGui::NavProcessItem() // FIXME-NAV: Consider policy for double scoring (scoring from NavScoringRect + scoring from a rect wrapped according to current wrapping policy) if (g.NavMoveScoringItems && (item_flags & ImGuiItemFlags_Disabled) == 0) { - const bool is_tabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) != 0; - if (is_tabbing) - { - NavProcessItemForTabbingRequest(id, item_flags, g.NavMoveFlags); - } - else if (g.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) + if ((g.NavMoveFlags & ImGuiNavMoveFlags_FocusApi) || (window->Flags & ImGuiWindowFlags_NoNavInputs) == 0) { - ImGuiNavItemData* result = (window == g.NavWindow) ? &g.NavMoveResultLocal : &g.NavMoveResultOther; - if (NavScoreItem(result)) - NavApplyItemToResult(result); - - // Features like PageUp/PageDown need to maintain a separate score for the visible set of items. - const float VISIBLE_RATIO = 0.70f; - if ((g.NavMoveFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet) && window->ClipRect.Overlaps(nav_bb)) - if (ImClamp(nav_bb.Max.y, window->ClipRect.Min.y, window->ClipRect.Max.y) - ImClamp(nav_bb.Min.y, window->ClipRect.Min.y, window->ClipRect.Max.y) >= (nav_bb.Max.y - nav_bb.Min.y) * VISIBLE_RATIO) - if (NavScoreItem(&g.NavMoveResultLocalVisible)) - NavApplyItemToResult(&g.NavMoveResultLocalVisible); + const bool is_tabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) != 0; + if (is_tabbing) + { + NavProcessItemForTabbingRequest(id, item_flags, g.NavMoveFlags); + } + else if (g.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) + { + ImGuiNavItemData* result = (window == g.NavWindow) ? &g.NavMoveResultLocal : &g.NavMoveResultOther; + if (NavScoreItem(result)) + NavApplyItemToResult(result); + + // Features like PageUp/PageDown need to maintain a separate score for the visible set of items. + const float VISIBLE_RATIO = 0.70f; + if ((g.NavMoveFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet) && window->ClipRect.Overlaps(nav_bb)) + if (ImClamp(nav_bb.Max.y, window->ClipRect.Min.y, window->ClipRect.Max.y) - ImClamp(nav_bb.Min.y, window->ClipRect.Min.y, window->ClipRect.Max.y) >= (nav_bb.Max.y - nav_bb.Min.y) * VISIBLE_RATIO) + if (NavScoreItem(&g.NavMoveResultLocalVisible)) + NavApplyItemToResult(&g.NavMoveResultLocalVisible); + } } } @@ -11081,8 +12555,14 @@ static void ImGui::NavProcessItem() if (g.NavWindow != window) SetNavWindow(window); // Always refresh g.NavWindow, because some operations such as FocusItem() may not have a window. g.NavLayer = window->DC.NavLayerCurrent; + SetNavFocusScope(g.CurrentFocusScopeId); // Will set g.NavFocusScopeId AND store g.NavFocusScopePath g.NavFocusScopeId = g.CurrentFocusScopeId; g.NavIdIsAlive = true; + if (g.LastItemData.ItemFlags & ImGuiItemFlags_HasSelectionUserData) + { + IM_ASSERT(g.NextItemData.SelectionUserData != ImGuiSelectionUserData_Invalid); + g.NavLastValidSelectionUserData = g.NextItemData.SelectionUserData; // INTENTIONAL: At this point this field is not cleared in NextItemData. Avoid unnecessary copy to LastItemData. + } window->NavRectRel[window->DC.NavLayerCurrent] = WindowRectAbsToRel(window, nav_bb); // Store item bounding box (relative to window position) } } @@ -11099,8 +12579,12 @@ void ImGui::NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flag ImGuiContext& g = *GImGui; if ((move_flags & ImGuiNavMoveFlags_FocusApi) == 0) + { if (g.NavLayer != g.CurrentWindow->DC.NavLayerCurrent) return; + if (g.NavFocusScopeId != g.CurrentFocusScopeId) + return; + } // - Can always land on an item when using API call. // - Tabbing with _NavEnableKeyboard (space/enter/arrows): goes through every item. @@ -11160,6 +12644,7 @@ void ImGui::NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavM { ImGuiContext& g = *GImGui; IM_ASSERT(g.NavWindow != NULL); + //IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequestSubmit: dir %c, window \"%s\"\n", "-WENS"[move_dir + 1], g.NavWindow->Name); if (move_flags & ImGuiNavMoveFlags_IsTabbing) move_flags |= ImGuiNavMoveFlags_AllowCurrentNavId; @@ -11171,7 +12656,7 @@ void ImGui::NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavM g.NavMoveFlags = move_flags; g.NavMoveScrollFlags = scroll_flags; g.NavMoveForwardToNextFrame = false; - g.NavMoveKeyMods = g.IO.KeyMods; + g.NavMoveKeyMods = (move_flags & ImGuiNavMoveFlags_FocusApi) ? 0 : g.IO.KeyMods; g.NavMoveResultLocal.Clear(); g.NavMoveResultLocalVisible.Clear(); g.NavMoveResultOther.Clear(); @@ -11189,12 +12674,12 @@ void ImGui::NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result) } // Called by TreePop() to implement ImGuiTreeNodeFlags_NavLeftJumpsBackHere -void ImGui::NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGuiNavTreeNodeData* tree_node_data) +void ImGui::NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGuiTreeNodeStackData* tree_node_data) { ImGuiContext& g = *GImGui; g.NavMoveScoringItems = false; g.LastItemData.ID = tree_node_data->ID; - g.LastItemData.InFlags = tree_node_data->InFlags; + g.LastItemData.ItemFlags = tree_node_data->ItemFlags & ~ImGuiItemFlags_HasSelectionUserData; // Losing SelectionUserData, recovered next-frame (cheaper). g.LastItemData.NavRect = tree_node_data->NavRect; NavApplyItemToResult(result); // Result this instead of implementing a NavApplyPastTreeNodeToResult() NavClearPreferredPosForAxis(ImGuiAxis_Y); @@ -11261,6 +12746,7 @@ void ImGui::NavRestoreLayer(ImGuiNavLayer layer) { ImGuiWindow* prev_nav_window = g.NavWindow; g.NavWindow = NavRestoreLastChildNavWindow(g.NavWindow); // FIXME-NAV: Should clear ongoing nav requests? + g.NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid; if (prev_nav_window) IMGUI_DEBUG_LOG_FOCUS("[focus] NavRestoreLayer: from \"%s\" to SetNavWindow(\"%s\")\n", prev_nav_window->Name, g.NavWindow->Name); } @@ -11276,13 +12762,6 @@ void ImGui::NavRestoreLayer(ImGuiNavLayer layer) } } -void ImGui::NavRestoreHighlightAfterMove() -{ - ImGuiContext& g = *GImGui; - g.NavDisableHighlight = false; - g.NavDisableMouseHover = g.NavMousePosDirty = true; -} - static inline void ImGui::NavUpdateAnyRequestFlag() { ImGuiContext& g = *GImGui; @@ -11300,7 +12779,7 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit) if (window->Flags & ImGuiWindowFlags_NoNavInputs) { g.NavId = 0; - g.NavFocusScopeId = window->NavRootFocusScopeId; + SetNavFocusScope(window->NavRootFocusScopeId); return; } @@ -11317,17 +12796,35 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit) NavUpdateAnyRequestFlag(); } else - { - g.NavId = window->NavLastIds[0]; - g.NavFocusScopeId = window->NavRootFocusScopeId; - } + { + g.NavId = window->NavLastIds[0]; + SetNavFocusScope(window->NavRootFocusScopeId); + } +} + +static ImGuiInputSource ImGui::NavCalcPreferredRefPosSource() +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.NavWindow; + const bool activated_shortcut = g.ActiveId != 0 && g.ActiveIdFromShortcut && g.ActiveId == g.LastItemData.ID; + + // Testing for !activated_shortcut here could in theory be removed if we decided that activating a remote shortcut altered one of the g.NavDisableXXX flag. + if ((!g.NavCursorVisible || !g.NavHighlightItemUnderNav || !window) && !activated_shortcut) + return ImGuiInputSource_Mouse; + else + return ImGuiInputSource_Keyboard; // or Nav in general } static ImVec2 ImGui::NavCalcPreferredRefPos() { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.NavWindow; - if (g.NavDisableHighlight || !g.NavDisableMouseHover || !window) + ImGuiInputSource source = NavCalcPreferredRefPosSource(); + + const bool activated_shortcut = g.ActiveId != 0 && g.ActiveIdFromShortcut && g.ActiveId == g.LastItemData.ID; + + // Testing for !activated_shortcut here could in theory be removed if we decided that activating a remote shortcut altered one of the g.NavDisableXXX flag. + if (source == ImGuiInputSource_Mouse) { // Mouse (we need a fallback in case the mouse becomes invalid after being used) // The +1.0f offset when stored by OpenPopupEx() allows reopening this or another popup (same or another mouse button) while not moving the mouse, it is pretty standard. @@ -11338,16 +12835,21 @@ static ImVec2 ImGui::NavCalcPreferredRefPos() else { // When navigation is active and mouse is disabled, pick a position around the bottom left of the currently navigated item + ImRect ref_rect; + if (activated_shortcut) + ref_rect = g.LastItemData.NavRect; + else + ref_rect = WindowRectRelToAbs(window, window->NavRectRel[g.NavLayer]); + // Take account of upcoming scrolling (maybe set mouse pos should be done in EndFrame?) - ImRect rect_rel = WindowRectRelToAbs(window, window->NavRectRel[g.NavLayer]); if (window->LastFrameActive != g.FrameCount && (window->ScrollTarget.x != FLT_MAX || window->ScrollTarget.y != FLT_MAX)) { ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window); - rect_rel.Translate(window->Scroll - next_scroll); + ref_rect.Translate(window->Scroll - next_scroll); } - ImVec2 pos = ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight())); + ImVec2 pos = ImVec2(ref_rect.Min.x + ImMin(g.Style.FramePadding.x * 4, ref_rect.GetWidth()), ref_rect.Max.y - ImMin(g.Style.FramePadding.y, ref_rect.GetHeight())); ImGuiViewport* viewport = GetMainViewport(); - return ImFloor(ImClamp(pos, viewport->Pos, viewport->Pos + viewport->Size)); // ImFloor() is important because non-integer mouse position application in backend might be lossy and result in undesirable non-zero delta. + return ImTrunc(ImClamp(pos, viewport->Pos, viewport->Pos + viewport->Size)); // ImTrunc() is important because non-integer mouse position application in backend might be lossy and result in undesirable non-zero delta. } } @@ -11399,6 +12901,7 @@ static void ImGui::NavUpdate() // Process navigation init request (select first/default focus) g.NavJustMovedToId = 0; + g.NavJustMovedToFocusScopeId = g.NavJustMovedFromFocusScopeId = 0; if (g.NavInitResult.ID != 0) NavInitRequestApplyResult(); g.NavInitRequest = false; @@ -11410,11 +12913,14 @@ static void ImGui::NavUpdate() NavMoveRequestApplyResult(); g.NavTabbingCounter = 0; g.NavMoveSubmitted = g.NavMoveScoringItems = false; + if (g.NavCursorHideFrames > 0) + if (--g.NavCursorHideFrames == 0) + g.NavCursorVisible = true; // Schedule mouse position update (will be done at the bottom of this function, after 1) processing all move requests and 2) updating scrolling) bool set_mouse_pos = false; if (g.NavMousePosDirty && g.NavIdIsAlive) - if (!g.NavDisableHighlight && g.NavDisableMouseHover && g.NavWindow) + if (g.NavCursorVisible && g.NavHighlightItemUnderNav && g.NavWindow) set_mouse_pos = true; g.NavMousePosDirty = false; IM_ASSERT(g.NavLayer == ImGuiNavLayer_Main || g.NavLayer == ImGuiNavLayer_Menu); @@ -11430,7 +12936,7 @@ static void ImGui::NavUpdate() // Set output flags for user application io.NavActive = (nav_keyboard_active || nav_gamepad_active) && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs); - io.NavVisible = (io.NavActive && g.NavId != 0 && !g.NavDisableHighlight) || (g.NavWindowingTarget != NULL); + io.NavVisible = (io.NavActive && g.NavId != 0 && g.NavCursorVisible) || (g.NavWindowingTarget != NULL); // Process NavCancel input (to close a popup, get back to parent, clear focus) NavUpdateCancelRequest(); @@ -11438,12 +12944,12 @@ static void ImGui::NavUpdate() // Process manual activation request g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = 0; g.NavActivateFlags = ImGuiActivateFlags_None; - if (g.NavId != 0 && !g.NavDisableHighlight && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) + if (g.NavId != 0 && g.NavCursorVisible && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) { - const bool activate_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Space)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadActivate)); - const bool activate_pressed = activate_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Space, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadActivate, false))); - const bool input_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Enter)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadInput)); - const bool input_pressed = input_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Enter, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadInput, false))); + const bool activate_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Space, ImGuiKeyOwner_NoOwner)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadActivate, ImGuiKeyOwner_NoOwner)); + const bool activate_pressed = activate_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Space, 0, ImGuiKeyOwner_NoOwner)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadActivate, 0, ImGuiKeyOwner_NoOwner))); + const bool input_down = (nav_keyboard_active && (IsKeyDown(ImGuiKey_Enter, ImGuiKeyOwner_NoOwner) || IsKeyDown(ImGuiKey_KeypadEnter, ImGuiKeyOwner_NoOwner))) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadInput, ImGuiKeyOwner_NoOwner)); + const bool input_pressed = input_down && ((nav_keyboard_active && (IsKeyPressed(ImGuiKey_Enter, 0, ImGuiKeyOwner_NoOwner) || IsKeyPressed(ImGuiKey_KeypadEnter, 0, ImGuiKeyOwner_NoOwner))) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadInput, 0, ImGuiKeyOwner_NoOwner))); if (g.ActiveId == 0 && activate_pressed) { g.NavActivateId = g.NavId; @@ -11457,13 +12963,24 @@ static void ImGui::NavUpdate() if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && (activate_down || input_down)) g.NavActivateDownId = g.NavId; if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && (activate_pressed || input_pressed)) + { g.NavActivatePressedId = g.NavId; + NavHighlightActivated(g.NavId); + } } if (g.NavWindow && (g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) - g.NavDisableHighlight = true; + g.NavCursorVisible = false; + else if (g.IO.ConfigNavCursorVisibleAlways && g.NavCursorHideFrames == 0) + g.NavCursorVisible = true; if (g.NavActivateId != 0) IM_ASSERT(g.NavActivateDownId == g.NavActivateId); + // Highlight + if (g.NavHighlightActivatedTimer > 0.0f) + g.NavHighlightActivatedTimer = ImMax(0.0f, g.NavHighlightActivatedTimer - io.DeltaTime); + if (g.NavHighlightActivatedTimer == 0.0f) + g.NavHighlightActivatedId = 0; + // Process programmatic activation request // FIXME-NAV: Those should eventually be queued (unlike focus they don't cancel each others) if (g.NavNextActivateId != 0) @@ -11490,9 +13007,9 @@ static void ImGui::NavUpdate() if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavWindowHasScrollY && move_dir != ImGuiDir_None) { if (move_dir == ImGuiDir_Left || move_dir == ImGuiDir_Right) - SetScrollX(window, ImFloor(window->Scroll.x + ((move_dir == ImGuiDir_Left) ? -1.0f : +1.0f) * scroll_speed)); + SetScrollX(window, ImTrunc(window->Scroll.x + ((move_dir == ImGuiDir_Left) ? -1.0f : +1.0f) * scroll_speed)); if (move_dir == ImGuiDir_Up || move_dir == ImGuiDir_Down) - SetScrollY(window, ImFloor(window->Scroll.y + ((move_dir == ImGuiDir_Up) ? -1.0f : +1.0f) * scroll_speed)); + SetScrollY(window, ImTrunc(window->Scroll.y + ((move_dir == ImGuiDir_Up) ? -1.0f : +1.0f) * scroll_speed)); } // *Normal* Manual scroll with LStick @@ -11502,27 +13019,23 @@ static void ImGui::NavUpdate() const ImVec2 scroll_dir = GetKeyMagnitude2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown); const float tweak_factor = IsKeyDown(ImGuiKey_NavGamepadTweakSlow) ? 1.0f / 10.0f : IsKeyDown(ImGuiKey_NavGamepadTweakFast) ? 10.0f : 1.0f; if (scroll_dir.x != 0.0f && window->ScrollbarX) - SetScrollX(window, ImFloor(window->Scroll.x + scroll_dir.x * scroll_speed * tweak_factor)); + SetScrollX(window, ImTrunc(window->Scroll.x + scroll_dir.x * scroll_speed * tweak_factor)); if (scroll_dir.y != 0.0f) - SetScrollY(window, ImFloor(window->Scroll.y + scroll_dir.y * scroll_speed * tweak_factor)); + SetScrollY(window, ImTrunc(window->Scroll.y + scroll_dir.y * scroll_speed * tweak_factor)); } } // Always prioritize mouse highlight if navigation is disabled if (!nav_keyboard_active && !nav_gamepad_active) { - g.NavDisableHighlight = true; - g.NavDisableMouseHover = set_mouse_pos = false; + g.NavCursorVisible = false; + g.NavHighlightItemUnderNav = set_mouse_pos = false; } // Update mouse position if requested // (This will take into account the possibility that a Scroll was queued in the window to offset our absolute mouse position before scroll has been applied) - if (set_mouse_pos && (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos)) - { - io.MousePos = io.MousePosPrev = NavCalcPreferredRefPos(); - io.WantSetMousePos = true; - //IMGUI_DEBUG_LOG_IO("SetMousePos: (%.1f,%.1f)\n", io.MousePos.x, io.MousePos.y); - } + if (set_mouse_pos && io.ConfigNavMoveSetMousePos && (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos)) + TeleportMousePos(NavCalcPreferredRefPos()); // [DEBUG] g.NavScoringDebugCount = 0; @@ -11546,9 +13059,12 @@ void ImGui::NavInitRequestApplyResult() ImGuiNavItemData* result = &g.NavInitResult; if (g.NavId != result->ID) { + g.NavJustMovedFromFocusScopeId = g.NavFocusScopeId; g.NavJustMovedToId = result->ID; g.NavJustMovedToFocusScopeId = result->FocusScopeId; g.NavJustMovedToKeyMods = 0; + g.NavJustMovedToIsTabbing = false; + g.NavJustMovedToHasSelectionData = (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData) != 0; } // Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called) @@ -11556,8 +13072,10 @@ void ImGui::NavInitRequestApplyResult() IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: ApplyResult: NavID 0x%08X in Layer %d Window \"%s\"\n", result->ID, g.NavLayer, g.NavWindow->Name); SetNavID(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel); g.NavIdIsAlive = true; // Mark as alive from previous frame as we got a result + if (result->SelectionUserData != ImGuiSelectionUserData_Invalid) + g.NavLastValidSelectionUserData = result->SelectionUserData; if (g.NavInitRequestFromMove) - NavRestoreHighlightAfterMove(); + SetNavCursorVisibleAfterMove(); } // Bias scoring rect ahead of scoring + update preferred pos (if missing) using source position @@ -11610,10 +13128,10 @@ void ImGui::NavUpdateCreateMoveRequest() if (window && !g.NavWindowingTarget && !(window->Flags & ImGuiWindowFlags_NoNavInputs)) { const ImGuiInputFlags repeat_mode = ImGuiInputFlags_Repeat | (ImGuiInputFlags)ImGuiInputFlags_RepeatRateNavMove; - if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadLeft, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_LeftArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Left; } - if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadRight, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_RightArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Right; } - if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadUp, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_UpArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Up; } - if (!IsActiveIdUsingNavDir(ImGuiDir_Down) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadDown, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_DownArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Down; } + if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadLeft, repeat_mode, ImGuiKeyOwner_NoOwner)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_LeftArrow, repeat_mode, ImGuiKeyOwner_NoOwner)))) { g.NavMoveDir = ImGuiDir_Left; } + if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadRight, repeat_mode, ImGuiKeyOwner_NoOwner)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_RightArrow, repeat_mode, ImGuiKeyOwner_NoOwner)))) { g.NavMoveDir = ImGuiDir_Right; } + if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadUp, repeat_mode, ImGuiKeyOwner_NoOwner)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_UpArrow, repeat_mode, ImGuiKeyOwner_NoOwner)))) { g.NavMoveDir = ImGuiDir_Up; } + if (!IsActiveIdUsingNavDir(ImGuiDir_Down) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadDown, repeat_mode, ImGuiKeyOwner_NoOwner)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_DownArrow, repeat_mode, ImGuiKeyOwner_NoOwner)))) { g.NavMoveDir = ImGuiDir_Down; } } g.NavMoveClipDir = g.NavMoveDir; g.NavScoringNoClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX); @@ -11654,7 +13172,8 @@ void ImGui::NavUpdateCreateMoveRequest() IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from move, window \"%s\", layer=%d\n", window ? window->Name : "", g.NavLayer); g.NavInitRequest = g.NavInitRequestFromMove = true; g.NavInitResult.ID = 0; - g.NavDisableHighlight = false; + if (g.IO.ConfigNavCursorVisibleAuto) + g.NavCursorVisible = true; } // When using gamepad, we project the reference nav bounding box into window visible area. @@ -11709,17 +13228,16 @@ void ImGui::NavUpdateCreateTabbingRequest() if (window == NULL || g.NavWindowingTarget != NULL || (window->Flags & ImGuiWindowFlags_NoNavInputs)) return; - const bool tab_pressed = IsKeyPressed(ImGuiKey_Tab, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat) && !g.IO.KeyCtrl && !g.IO.KeyAlt; + const bool tab_pressed = IsKeyPressed(ImGuiKey_Tab, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner) && !g.IO.KeyCtrl && !g.IO.KeyAlt; if (!tab_pressed) return; // Initiate tabbing request // (this is ALWAYS ENABLED, regardless of ImGuiConfigFlags_NavEnableKeyboard flag!) - // Initially this was designed to use counters and modulo arithmetic, but that could not work with unsubmitted items (list clipper). Instead we use a strategy close to other move requests. // See NavProcessItemForTabbingRequest() for a description of the various forward/backward tabbing cases with and without wrapping. const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; if (nav_keyboard_active) - g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.NavDisableHighlight == true && g.ActiveId == 0) ? 0 : +1; + g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.NavCursorVisible == false && g.ActiveId == 0) ? 0 : +1; else g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.ActiveId == 0) ? 0 : +1; ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_Activate; @@ -11751,9 +13269,9 @@ void ImGui::NavMoveRequestApplyResult() if (result == NULL) { if (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) - g.NavMoveFlags |= ImGuiNavMoveFlags_NoSetNavHighlight; - if (g.NavId != 0 && (g.NavMoveFlags & ImGuiNavMoveFlags_NoSetNavHighlight) == 0) - NavRestoreHighlightAfterMove(); + g.NavMoveFlags |= ImGuiNavMoveFlags_NoSetNavCursorVisible; + if (g.NavId != 0 && (g.NavMoveFlags & ImGuiNavMoveFlags_NoSetNavCursorVisible) == 0) + SetNavCursorVisibleAfterMove(); NavClearPreferredPosForAxis(axis); // On a failed move, clear preferred pos for this axis. IMGUI_DEBUG_LOG_NAV("[nav] NavMoveSubmitted but not led to a result!\n"); return; @@ -11788,23 +13306,34 @@ void ImGui::NavMoveRequestApplyResult() { IMGUI_DEBUG_LOG_FOCUS("[focus] NavMoveRequest: SetNavWindow(\"%s\")\n", result->Window->Name); g.NavWindow = result->Window; + g.NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid; } - if (g.ActiveId != result->ID) + + // Clear active id unless requested not to + // FIXME: ImGuiNavMoveFlags_NoClearActiveId is currently unused as we don't have a clear strategy to preserve active id after interaction, + // so this is mostly provided as a gateway for further experiments (see #1418, #2890) + if (g.ActiveId != result->ID && (g.NavMoveFlags & ImGuiNavMoveFlags_NoClearActiveId) == 0) ClearActiveID(); // Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId) // PageUp/PageDown however sets always set NavJustMovedTo (vs Home/End which doesn't) mimicking Windows behavior. if ((g.NavId != result->ID || (g.NavMoveFlags & ImGuiNavMoveFlags_IsPageMove)) && (g.NavMoveFlags & ImGuiNavMoveFlags_NoSelect) == 0) { + g.NavJustMovedFromFocusScopeId = g.NavFocusScopeId; g.NavJustMovedToId = result->ID; g.NavJustMovedToFocusScopeId = result->FocusScopeId; g.NavJustMovedToKeyMods = g.NavMoveKeyMods; + g.NavJustMovedToIsTabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) != 0; + g.NavJustMovedToHasSelectionData = (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData) != 0; + //IMGUI_DEBUG_LOG_NAV("[nav] NavJustMovedFromFocusScopeId = 0x%08X, NavJustMovedToFocusScopeId = 0x%08X\n", g.NavJustMovedFromFocusScopeId, g.NavJustMovedToFocusScopeId); } // Apply new NavID/Focus IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", result->ID, g.NavLayer, g.NavWindow->Name); ImVec2 preferred_scoring_pos_rel = g.NavWindow->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer]; SetNavID(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel); + if (result->SelectionUserData != ImGuiSelectionUserData_Invalid) + g.NavLastValidSelectionUserData = result->SelectionUserData; // Restore last preferred position for current axis // (storing in RootWindowForNav-> as the info is desirable at the beginning of a Move Request. In theory all storage should use RootWindowForNav..) @@ -11815,7 +13344,7 @@ void ImGui::NavMoveRequestApplyResult() } // Tabbing: Activates Inputable, otherwise only Focus - if ((g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) && (result->InFlags & ImGuiItemFlags_Inputable) == 0) + if ((g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) && (result->ItemFlags & ImGuiItemFlags_Inputable) == 0) g.NavMoveFlags &= ~ImGuiNavMoveFlags_Activate; // Activate @@ -11823,17 +13352,16 @@ void ImGui::NavMoveRequestApplyResult() { g.NavNextActivateId = result->ID; g.NavNextActivateFlags = ImGuiActivateFlags_None; - g.NavMoveFlags |= ImGuiNavMoveFlags_NoSetNavHighlight; if (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) - g.NavNextActivateFlags |= ImGuiActivateFlags_PreferInput | ImGuiActivateFlags_TryToPreserveState; + g.NavNextActivateFlags |= ImGuiActivateFlags_PreferInput | ImGuiActivateFlags_TryToPreserveState | ImGuiActivateFlags_FromTabbing; } - // Enable nav highlight - if ((g.NavMoveFlags & ImGuiNavMoveFlags_NoSetNavHighlight) == 0) - NavRestoreHighlightAfterMove(); + // Make nav cursor visible + if ((g.NavMoveFlags & ImGuiNavMoveFlags_NoSetNavCursorVisible) == 0) + SetNavCursorVisibleAfterMove(); } -// Process NavCancel input (to close a popup, get back to parent, clear focus) +// Process Escape/NavCancel input (to close a popup, get back to parent, clear focus) // FIXME: In order to support e.g. Escape to clear a selection we'll need: // - either to store the equivalent of ActiveIdUsingKeyInputMask for a FocusScope and test for it. // - either to move most/all of those tests to the epilogue/end functions of the scope they are dealing with (e.g. exit child window in EndChild()) or in EndFrame(), to allow an earlier intercept @@ -11842,7 +13370,7 @@ static void ImGui::NavUpdateCancelRequest() ImGuiContext& g = *GImGui; const bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (g.IO.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; - if (!(nav_keyboard_active && IsKeyPressed(ImGuiKey_Escape, ImGuiKeyOwner_None)) && !(nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadCancel, ImGuiKeyOwner_None))) + if (!(nav_keyboard_active && IsKeyPressed(ImGuiKey_Escape, 0, ImGuiKeyOwner_NoOwner)) && !(nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadCancel, 0, ImGuiKeyOwner_NoOwner))) return; IMGUI_DEBUG_LOG_NAV("[nav] NavUpdateCancelRequest()\n"); @@ -11854,18 +13382,17 @@ static void ImGui::NavUpdateCancelRequest() { // Leave the "menu" layer NavRestoreLayer(ImGuiNavLayer_Main); - NavRestoreHighlightAfterMove(); + SetNavCursorVisibleAfterMove(); } - else if (g.NavWindow && g.NavWindow != g.NavWindow->RootWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->ParentWindow) + else if (g.NavWindow && g.NavWindow != g.NavWindow->RootWindow && !(g.NavWindow->RootWindowForNav->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->RootWindowForNav->ParentWindow) { // Exit child window - ImGuiWindow* child_window = g.NavWindow; - ImGuiWindow* parent_window = g.NavWindow->ParentWindow; + ImGuiWindow* child_window = g.NavWindow->RootWindowForNav; + ImGuiWindow* parent_window = child_window->ParentWindow; IM_ASSERT(child_window->ChildId != 0); - ImRect child_rect = child_window->Rect(); FocusWindow(parent_window); - SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_rect)); - NavRestoreHighlightAfterMove(); + SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_window->Rect())); + SetNavCursorVisibleAfterMove(); } else if (g.OpenPopupStack.Size > 0 && g.OpenPopupStack.back().Window != NULL && !(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal)) { @@ -11875,9 +13402,16 @@ static void ImGui::NavUpdateCancelRequest() else { // Clear NavLastId for popups but keep it for regular child window so we can leave one and come back where we were - if (g.NavWindow && ((g.NavWindow->Flags & ImGuiWindowFlags_Popup) || !(g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow))) - g.NavWindow->NavLastIds[0] = 0; - g.NavId = 0; + // FIXME-NAV: This should happen on window appearing. + if (g.IO.ConfigNavEscapeClearFocusItem || g.IO.ConfigNavEscapeClearFocusWindow) + if (g.NavWindow && ((g.NavWindow->Flags & ImGuiWindowFlags_Popup)))// || !(g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow))) + g.NavWindow->NavLastIds[0] = 0; + + // Clear nav focus + if (g.IO.ConfigNavEscapeClearFocusItem || g.IO.ConfigNavEscapeClearFocusWindow) + g.NavId = 0; + if (g.IO.ConfigNavEscapeClearFocusWindow) + FocusWindow(NULL); } } @@ -11892,10 +13426,10 @@ static float ImGui::NavUpdatePageUpPageDown() if ((window->Flags & ImGuiWindowFlags_NoNavInputs) || g.NavWindowingTarget != NULL) return 0.0f; - const bool page_up_held = IsKeyDown(ImGuiKey_PageUp, ImGuiKeyOwner_None); - const bool page_down_held = IsKeyDown(ImGuiKey_PageDown, ImGuiKeyOwner_None); - const bool home_pressed = IsKeyPressed(ImGuiKey_Home, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat); - const bool end_pressed = IsKeyPressed(ImGuiKey_End, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat); + const bool page_up_held = IsKeyDown(ImGuiKey_PageUp, ImGuiKeyOwner_NoOwner); + const bool page_down_held = IsKeyDown(ImGuiKey_PageDown, ImGuiKeyOwner_NoOwner); + const bool home_pressed = IsKeyPressed(ImGuiKey_Home, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner); + const bool end_pressed = IsKeyPressed(ImGuiKey_End, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner); if (page_up_held == page_down_held && home_pressed == end_pressed) // Proceed if either (not both) are pressed, otherwise early out return 0.0f; @@ -11905,9 +13439,9 @@ static float ImGui::NavUpdatePageUpPageDown() if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavWindowHasScrollY) { // Fallback manual-scroll when window has no navigable item - if (IsKeyPressed(ImGuiKey_PageUp, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat)) + if (IsKeyPressed(ImGuiKey_PageUp, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner)) SetScrollY(window, window->Scroll.y - window->InnerRect.GetHeight()); - else if (IsKeyPressed(ImGuiKey_PageDown, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat)) + else if (IsKeyPressed(ImGuiKey_PageDown, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner)) SetScrollY(window, window->Scroll.y + window->InnerRect.GetHeight()); else if (home_pressed) SetScrollY(window, 0.0f); @@ -12052,7 +13586,7 @@ static ImGuiWindow* FindWindowNavFocusable(int i_start, int i_stop, int dir) // return NULL; } -static void NavUpdateWindowingHighlightWindow(int focus_change_dir) +static void NavUpdateWindowingTarget(int focus_change_dir) { ImGuiContext& g = *GImGui; IM_ASSERT(g.NavWindowingTarget); @@ -12096,23 +13630,27 @@ static void ImGui::NavUpdateWindowing() } // Start CTRL+Tab or Square+L/R window selection + // (g.ConfigNavWindowingKeyNext/g.ConfigNavWindowingKeyPrev defaults are ImGuiMod_Ctrl|ImGuiKey_Tab and ImGuiMod_Ctrl|ImGuiMod_Shift|ImGuiKey_Tab) const ImGuiID owner_id = ImHashStr("###NavUpdateWindowing"); const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; - const bool keyboard_next_window = allow_windowing && g.ConfigNavWindowingKeyNext && Shortcut(g.ConfigNavWindowingKeyNext, owner_id, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways); - const bool keyboard_prev_window = allow_windowing && g.ConfigNavWindowingKeyPrev && Shortcut(g.ConfigNavWindowingKeyPrev, owner_id, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways); - const bool start_windowing_with_gamepad = allow_windowing && nav_gamepad_active && !g.NavWindowingTarget && IsKeyPressed(ImGuiKey_NavGamepadMenu, 0, ImGuiInputFlags_None); + const bool keyboard_next_window = allow_windowing && g.ConfigNavWindowingKeyNext && Shortcut(g.ConfigNavWindowingKeyNext, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways, owner_id); + const bool keyboard_prev_window = allow_windowing && g.ConfigNavWindowingKeyPrev && Shortcut(g.ConfigNavWindowingKeyPrev, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways, owner_id); + const bool start_windowing_with_gamepad = allow_windowing && nav_gamepad_active && !g.NavWindowingTarget && IsKeyPressed(ImGuiKey_NavGamepadMenu, ImGuiInputFlags_None); const bool start_windowing_with_keyboard = allow_windowing && !g.NavWindowingTarget && (keyboard_next_window || keyboard_prev_window); // Note: enabled even without NavEnableKeyboard! + bool just_started_windowing_from_null_focus = false; if (start_windowing_with_gamepad || start_windowing_with_keyboard) if (ImGuiWindow* window = g.NavWindow ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1)) { - g.NavWindowingTarget = g.NavWindowingTargetAnim = window->RootWindow; + g.NavWindowingTarget = g.NavWindowingTargetAnim = window->RootWindow; // Current location g.NavWindowingTimer = g.NavWindowingHighlightAlpha = 0.0f; g.NavWindowingAccumDeltaPos = g.NavWindowingAccumDeltaSize = ImVec2(0.0f, 0.0f); g.NavWindowingToggleLayer = start_windowing_with_gamepad ? true : false; // Gamepad starts toggling layer g.NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_Keyboard : ImGuiInputSource_Gamepad; + if (g.NavWindow == NULL) + just_started_windowing_from_null_focus = true; - // Register ownership of our mods. Using ImGuiInputFlags_RouteGlobalHigh in the Shortcut() calls instead would probably be correct but may have more side-effects. + // Manually register ownership of our mods. Using a global route in the Shortcut() calls instead would probably be correct but may have more side-effects. if (keyboard_next_window || keyboard_prev_window) SetKeyOwnersForKeyChord((g.ConfigNavWindowingKeyNext | g.ConfigNavWindowingKeyPrev) & ImGuiMod_Mask_, owner_id); } @@ -12126,9 +13664,9 @@ static void ImGui::NavUpdateWindowing() // Select window to focus const int focus_change_dir = (int)IsKeyPressed(ImGuiKey_GamepadL1) - (int)IsKeyPressed(ImGuiKey_GamepadR1); - if (focus_change_dir != 0) + if (focus_change_dir != 0 && !just_started_windowing_from_null_focus) { - NavUpdateWindowingHighlightWindow(focus_change_dir); + NavUpdateWindowingTarget(focus_change_dir); g.NavWindowingHighlightAlpha = 1.0f; } @@ -12151,35 +13689,44 @@ static void ImGui::NavUpdateWindowing() ImGuiKeyChord shared_mods = ((g.ConfigNavWindowingKeyNext ? g.ConfigNavWindowingKeyNext : ImGuiMod_Mask_) & (g.ConfigNavWindowingKeyPrev ? g.ConfigNavWindowingKeyPrev : ImGuiMod_Mask_)) & ImGuiMod_Mask_; IM_ASSERT(shared_mods != 0); // Next/Prev shortcut currently needs a shared modifier to "hold", otherwise Prev actions would keep cycling between two windows. g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY) / 0.05f)); // 1.0f - if (keyboard_next_window || keyboard_prev_window) - NavUpdateWindowingHighlightWindow(keyboard_next_window ? -1 : +1); + if ((keyboard_next_window || keyboard_prev_window) && !just_started_windowing_from_null_focus) + NavUpdateWindowingTarget(keyboard_next_window ? -1 : +1); else if ((io.KeyMods & shared_mods) != shared_mods) apply_focus_window = g.NavWindowingTarget; } // Keyboard: Press and Release ALT to toggle menu layer - // - Testing that only Alt is tested prevents Alt+Shift or AltGR from toggling menu layer. - // - AltGR is normally Alt+Ctrl but we can't reliably detect it (not all backends/systems/layout emit it as Alt+Ctrl). But even on keyboards without AltGR we don't want Alt+Ctrl to open menu anyway. - if (nav_keyboard_active && IsKeyPressed(ImGuiMod_Alt, ImGuiKeyOwner_None)) - { - g.NavWindowingToggleLayer = true; - g.NavInputSource = ImGuiInputSource_Keyboard; - } + const ImGuiKey windowing_toggle_keys[] = { ImGuiKey_LeftAlt, ImGuiKey_RightAlt }; + bool windowing_toggle_layer_start = false; + for (ImGuiKey windowing_toggle_key : windowing_toggle_keys) + if (nav_keyboard_active && IsKeyPressed(windowing_toggle_key, 0, ImGuiKeyOwner_NoOwner)) + { + windowing_toggle_layer_start = true; + g.NavWindowingToggleLayer = true; + g.NavWindowingToggleKey = windowing_toggle_key; + g.NavInputSource = ImGuiInputSource_Keyboard; + break; + } if (g.NavWindowingToggleLayer && g.NavInputSource == ImGuiInputSource_Keyboard) { // We cancel toggling nav layer when any text has been typed (generally while holding Alt). (See #370) // We cancel toggling nav layer when other modifiers are pressed. (See #4439) + // - AltGR is Alt+Ctrl on some layout but we can't reliably detect it (not all backends/systems/layout emit it as Alt+Ctrl). // We cancel toggling nav layer if an owner has claimed the key. - if (io.InputQueueCharacters.Size > 0 || io.KeyCtrl || io.KeyShift || io.KeySuper || TestKeyOwner(ImGuiMod_Alt, ImGuiKeyOwner_None) == false) + if (io.InputQueueCharacters.Size > 0 || io.KeyCtrl || io.KeyShift || io.KeySuper) + g.NavWindowingToggleLayer = false; + else if (windowing_toggle_layer_start == false && g.LastKeyboardKeyPressTime == g.Time) + g.NavWindowingToggleLayer = false; + else if (TestKeyOwner(g.NavWindowingToggleKey, ImGuiKeyOwner_NoOwner) == false || TestKeyOwner(ImGuiMod_Alt, ImGuiKeyOwner_NoOwner) == false) g.NavWindowingToggleLayer = false; - // Apply layer toggle on release + // Apply layer toggle on Alt release // Important: as before version <18314 we lacked an explicit IO event for focus gain/loss, we also compare mouse validity to detect old backends clearing mouse pos on focus loss. - if (IsKeyReleased(ImGuiMod_Alt) && g.NavWindowingToggleLayer) + if (IsKeyReleased(g.NavWindowingToggleKey) && g.NavWindowingToggleLayer) if (g.ActiveId == 0 || g.ActiveIdAllowOverlap) if (IsMousePosValid(&io.MousePos) == IsMousePosValid(&io.MousePosPrev)) apply_toggle_layer = true; - if (!IsKeyDown(ImGuiMod_Alt)) + if (!IsKeyDown(g.NavWindowingToggleKey)) g.NavWindowingToggleLayer = false; } @@ -12196,8 +13743,8 @@ static void ImGui::NavUpdateWindowing() const float NAV_MOVE_SPEED = 800.0f; const float move_step = NAV_MOVE_SPEED * io.DeltaTime * ImMin(io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y); g.NavWindowingAccumDeltaPos += nav_move_dir * move_step; - g.NavDisableMouseHover = true; - ImVec2 accum_floored = ImFloor(g.NavWindowingAccumDeltaPos); + g.NavHighlightItemUnderNav = true; + ImVec2 accum_floored = ImTrunc(g.NavWindowingAccumDeltaPos); if (accum_floored.x != 0.0f || accum_floored.y != 0.0f) { ImGuiWindow* moving_window = g.NavWindowingTarget->RootWindow; @@ -12211,7 +13758,7 @@ static void ImGui::NavUpdateWindowing() if (apply_focus_window && (g.NavWindow == NULL || apply_focus_window != g.NavWindow->RootWindow)) { ClearActiveID(); - NavRestoreHighlightAfterMove(); + SetNavCursorVisibleAfterMove(); ClosePopupsOverWindow(apply_focus_window, false); FocusWindow(apply_focus_window, ImGuiFocusRequestFlags_RestoreFocusedChild); apply_focus_window = g.NavWindow; @@ -12258,7 +13805,7 @@ static void ImGui::NavUpdateWindowing() if (new_nav_layer == ImGuiNavLayer_Menu) g.NavWindow->NavLastIds[new_nav_layer] = 0; NavRestoreLayer(new_nav_layer); - NavRestoreHighlightAfterMove(); + SetNavCursorVisibleAfterMove(); } } } @@ -12289,6 +13836,8 @@ void ImGui::NavUpdateWindowingOverlay() SetNextWindowPos(viewport->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f)); PushStyleVar(ImGuiStyleVar_WindowPadding, g.Style.WindowPadding * 2.0f); Begin("###NavWindowingList", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings); + if (g.ContextName[0] != 0) + SeparatorText(g.ContextName); for (int n = g.WindowsFocusOrder.Size - 1; n >= 0; n--) { ImGuiWindow* window = g.WindowsFocusOrder[n]; @@ -12318,6 +13867,8 @@ bool ImGui::IsDragDropActive() void ImGui::ClearDragDrop() { ImGuiContext& g = *GImGui; + if (g.DragDropActive) + IMGUI_DEBUG_LOG_ACTIVEID("[dragdrop] ClearDragDrop()\n"); g.DragDropActive = false; g.DragDropPayload.Clear(); g.DragDropAcceptFlags = ImGuiDragDropFlags_None; @@ -12329,6 +13880,14 @@ void ImGui::ClearDragDrop() memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal)); } +bool ImGui::BeginTooltipHidden() +{ + ImGuiContext& g = *GImGui; + bool ret = Begin("##Tooltip_Hidden", NULL, ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize); + SetWindowHiddenAndSkipItemsForCurrentFrame(g.CurrentWindow); + return ret; +} + // When this returns true you need to: a) call SetDragDropPayload() exactly once, b) you may render the payload visual/description, c) call EndDragDropSource() // If the item has an identifier: // - This assume/require the item to be activated (typically via ButtonBehavior). @@ -12348,7 +13907,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) bool source_drag_active = false; ImGuiID source_id = 0; ImGuiID source_parent_id = 0; - if (!(flags & ImGuiDragDropFlags_SourceExtern)) + if ((flags & ImGuiDragDropFlags_SourceExtern) == 0) { source_id = g.LastItemData.ID; if (source_id != 0) @@ -12385,7 +13944,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) // Rely on keeping other window->LastItemXXX fields intact. source_id = g.LastItemData.ID = window->GetIDFromRectangle(g.LastItemData.Rect); KeepAliveID(source_id); - bool is_hovered = ItemHoverable(g.LastItemData.Rect, source_id, g.LastItemData.InFlags); + bool is_hovered = ItemHoverable(g.LastItemData.Rect, source_id, g.LastItemData.ItemFlags); if (is_hovered && g.IO.MouseClicked[mouse_button]) { SetActiveID(source_id, window); @@ -12404,47 +13963,55 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) } else { + // When ImGuiDragDropFlags_SourceExtern is set: window = NULL; source_id = ImHashStr("#SourceExtern"); source_drag_active = true; + mouse_button = g.IO.MouseDown[0] ? 0 : -1; + KeepAliveID(source_id); + SetActiveID(source_id, NULL); } - if (source_drag_active) - { - if (!g.DragDropActive) - { - IM_ASSERT(source_id != 0); - ClearDragDrop(); - ImGuiPayload& payload = g.DragDropPayload; - payload.SourceId = source_id; - payload.SourceParentId = source_parent_id; - g.DragDropActive = true; - g.DragDropSourceFlags = flags; - g.DragDropMouseButton = mouse_button; - if (payload.SourceId == g.ActiveId) - g.ActiveIdNoClearOnFocusLoss = true; - } - g.DragDropSourceFrameCount = g.FrameCount; - g.DragDropWithinSource = true; - - if (!(flags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) - { - // Target can request the Source to not display its tooltip (we use a dedicated flag to make this request explicit) - // We unfortunately can't just modify the source flags and skip the call to BeginTooltip, as caller may be emitting contents. - bool ret = BeginTooltip(); - IM_ASSERT(ret); // FIXME-NEWBEGIN: If this ever becomes false, we need to Begin("##Hidden", NULL, ImGuiWindowFlags_NoSavedSettings) + SetWindowHiddendAndSkipItemsForCurrentFrame(). - IM_UNUSED(ret); + IM_ASSERT(g.DragDropWithinTarget == false); // Can't nest BeginDragDropSource() and BeginDragDropTarget() + if (!source_drag_active) + return false; - if (g.DragDropAcceptIdPrev && (g.DragDropAcceptFlags & ImGuiDragDropFlags_AcceptNoPreviewTooltip)) - SetWindowHiddendAndSkipItemsForCurrentFrame(g.CurrentWindow); - } + // Activate drag and drop + if (!g.DragDropActive) + { + IM_ASSERT(source_id != 0); + ClearDragDrop(); + IMGUI_DEBUG_LOG_ACTIVEID("[dragdrop] BeginDragDropSource() DragDropActive = true, source_id = 0x%08X%s\n", + source_id, (flags & ImGuiDragDropFlags_SourceExtern) ? " (EXTERN)" : ""); + ImGuiPayload& payload = g.DragDropPayload; + payload.SourceId = source_id; + payload.SourceParentId = source_parent_id; + g.DragDropActive = true; + g.DragDropSourceFlags = flags; + g.DragDropMouseButton = mouse_button; + if (payload.SourceId == g.ActiveId) + g.ActiveIdNoClearOnFocusLoss = true; + } + g.DragDropSourceFrameCount = g.FrameCount; + g.DragDropWithinSource = true; + + if (!(flags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) + { + // Target can request the Source to not display its tooltip (we use a dedicated flag to make this request explicit) + // We unfortunately can't just modify the source flags and skip the call to BeginTooltip, as caller may be emitting contents. + bool ret; + if (g.DragDropAcceptIdPrev && (g.DragDropAcceptFlags & ImGuiDragDropFlags_AcceptNoPreviewTooltip)) + ret = BeginTooltipHidden(); + else + ret = BeginTooltip(); + IM_ASSERT(ret); // FIXME-NEWBEGIN: If this ever becomes false, we need to Begin("##Hidden", NULL, ImGuiWindowFlags_NoSavedSettings) + SetWindowHiddendAndSkipItemsForCurrentFrame(). + IM_UNUSED(ret); + } - if (!(flags & ImGuiDragDropFlags_SourceNoDisableHover) && !(flags & ImGuiDragDropFlags_SourceExtern)) - g.LastItemData.StatusFlags &= ~ImGuiItemStatusFlags_HoveredRect; + if (!(flags & ImGuiDragDropFlags_SourceNoDisableHover) && !(flags & ImGuiDragDropFlags_SourceExtern)) + g.LastItemData.StatusFlags &= ~ImGuiItemStatusFlags_HoveredRect; - return true; - } - return false; + return true; } void ImGui::EndDragDropSource() @@ -12474,7 +14041,7 @@ bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_s IM_ASSERT(strlen(type) < IM_ARRAYSIZE(payload.DataType) && "Payload type can be at most 32 characters long"); IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0)); IM_ASSERT(cond == ImGuiCond_Always || cond == ImGuiCond_Once); - IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource() + IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource() if (cond == ImGuiCond_Always || payload.DataFrameCount == -1) { @@ -12523,15 +14090,16 @@ bool ImGui::BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id) if (window->SkipItems) return false; - IM_ASSERT(g.DragDropWithinTarget == false); + IM_ASSERT(g.DragDropWithinTarget == false && g.DragDropWithinSource == false); // Can't nest BeginDragDropSource() and BeginDragDropTarget() g.DragDropTargetRect = bb; + g.DragDropTargetClipRect = window->ClipRect; // May want to be overridden by user depending on use case? g.DragDropTargetId = id; g.DragDropWithinTarget = true; return true; } // We don't use BeginDragDropTargetCustom() and duplicate its code because: -// 1) we use LastItemRectHoveredRect which handles items that push a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them. +// 1) we use LastItemData's ImGuiItemStatusFlags_HoveredRect which handles items that push a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them. // 2) and it's faster. as this code may be very frequently called, we want to early out as fast as we can. // Also note how the HoveredWindow test is positioned differently in both functions (in both functions we optimize for the cheapest early out case) bool ImGui::BeginDragDropTarget() @@ -12557,8 +14125,9 @@ bool ImGui::BeginDragDropTarget() if (g.DragDropPayload.SourceId == id) return false; - IM_ASSERT(g.DragDropWithinTarget == false); + IM_ASSERT(g.DragDropWithinTarget == false && g.DragDropWithinSource == false); // Can't nest BeginDragDropSource() and BeginDragDropTarget() g.DragDropTargetRect = display_rect; + g.DragDropTargetClipRect = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasClipRect) ? g.LastItemData.ClipRect : window->ClipRect; g.DragDropTargetId = id; g.DragDropWithinTarget = true; return true; @@ -12573,7 +14142,6 @@ bool ImGui::IsDragDropPayloadBeingAccepted() const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags) { ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; ImGuiPayload& payload = g.DragDropPayload; IM_ASSERT(g.DragDropActive); // Not called between BeginDragDropTarget() and EndDragDropTarget() ? IM_ASSERT(payload.DataFrameCount != -1); // Forgot to call EndDragDropTarget() ? @@ -12597,21 +14165,35 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop payload.Preview = was_accepted_previously; flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that live for 1 frame) if (!(flags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect) && payload.Preview) - window->DrawList->AddRect(r.Min - ImVec2(3.5f,3.5f), r.Max + ImVec2(3.5f, 3.5f), GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f); + RenderDragDropTargetRect(r, g.DragDropTargetClipRect); g.DragDropAcceptFrameCount = g.FrameCount; - payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting OS window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased() + if ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceExtern) && g.DragDropMouseButton == -1) + payload.Delivery = was_accepted_previously && (g.DragDropSourceFrameCount < g.FrameCount); + else + payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting OS window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased() if (!payload.Delivery && !(flags & ImGuiDragDropFlags_AcceptBeforeDelivery)) return NULL; - //IMGUI_DEBUG_LOG("AcceptDragDropPayload(): %08X: return payload\n", g.DragDropTargetId); + if (payload.Delivery) + IMGUI_DEBUG_LOG_ACTIVEID("[dragdrop] AcceptDragDropPayload(): 0x%08X: payload delivery\n", g.DragDropTargetId); return &payload; } -// FIXME-DRAGDROP: Settle on a proper default visuals for drop target. -void ImGui::RenderDragDropTargetRect(const ImRect& bb) +// FIXME-STYLE FIXME-DRAGDROP: Settle on a proper default visuals for drop target. +void ImGui::RenderDragDropTargetRect(const ImRect& bb, const ImRect& item_clip_rect) { - GetWindowDrawList()->AddRect(bb.Min - ImVec2(3.5f, 3.5f), bb.Max + ImVec2(3.5f, 3.5f), GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f); + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + ImRect bb_display = bb; + bb_display.ClipWith(item_clip_rect); // Clip THEN expand so we have a way to visualize that target is not entirely visible. + bb_display.Expand(3.5f); + bool push_clip_rect = !window->ClipRect.Contains(bb_display); + if (push_clip_rect) + window->DrawList->PushClipRectFullScreen(); + window->DrawList->AddRect(bb_display.Min, bb_display.Max, GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f); + if (push_clip_rect) + window->DrawList->PopClipRect(); } const ImGuiPayload* ImGui::GetDragDropPayload() @@ -12744,7 +14326,7 @@ void ImGui::LogBegin(ImGuiLogType type, int auto_open_depth) IM_ASSERT(g.LogEnabled == false); IM_ASSERT(g.LogFile == NULL); IM_ASSERT(g.LogBuffer.empty()); - g.LogEnabled = true; + g.LogEnabled = g.ItemUnclipByLog = true; g.LogType = type; g.LogNextPrefix = g.LogNextSuffix = NULL; g.LogDepthRef = window->DC.TreeDepth; @@ -12843,7 +14425,7 @@ void ImGui::LogFinish() break; } - g.LogEnabled = false; + g.LogEnabled = g.ItemUnclipByLog = false; g.LogType = ImGuiLogType_None; g.LogFile = NULL; g.LogBuffer.clear(); @@ -12863,10 +14445,10 @@ void ImGui::LogButtons() #endif const bool log_to_file = Button("Log To File"); SameLine(); const bool log_to_clipboard = Button("Log To Clipboard"); SameLine(); - PushTabStop(false); + PushItemFlag(ImGuiItemFlags_NoTabStop, true); SetNextItemWidth(80.0f); SliderInt("Default Depth", &g.LogDepthToExpandDefault, 0, 9, NULL); - PopTabStop(); + PopItemFlag(); PopID(); // Start logging at the end of the function so that the buttons don't appear in the log @@ -13174,6 +14756,7 @@ static void WindowSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler*, if (sscanf(line, "Pos=%i,%i", &x, &y) == 2) { settings->Pos = ImVec2ih((short)x, (short)y); } else if (sscanf(line, "Size=%i,%i", &x, &y) == 2) { settings->Size = ImVec2ih((short)x, (short)y); } else if (sscanf(line, "Collapsed=%d", &i) == 1) { settings->Collapsed = (i != 0); } + else if (sscanf(line, "IsChild=%d", &i) == 1) { settings->IsChild = (i != 0); } } // Apply to existing windows (if any) @@ -13208,7 +14791,7 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl IM_ASSERT(settings->ID == window->ID); settings->Pos = ImVec2ih(window->Pos); settings->Size = ImVec2ih(window->SizeFull); - + settings->IsChild = (window->Flags & ImGuiWindowFlags_ChildWindow) != 0; settings->Collapsed = window->Collapsed; settings->WantDelete = false; } @@ -13221,9 +14804,18 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl continue; const char* settings_name = settings->GetName(); buf->appendf("[%s][%s]\n", handler->TypeName, settings_name); - buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y); - buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y); - buf->appendf("Collapsed=%d\n", settings->Collapsed); + if (settings->IsChild) + { + buf->appendf("IsChild=1\n"); + buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y); + } + else + { + buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y); + buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y); + if (settings->Collapsed) + buf->appendf("Collapsed=1\n"); + } buf->append("\n"); } } @@ -13276,10 +14868,11 @@ static void ImGui::UpdateViewportsNewFrame() for (ImGuiViewportP* viewport : g.Viewports) { - // Lock down space taken by menu bars and status bars, reset the offset for fucntions like BeginMainMenuBar() to alter them again. - viewport->WorkOffsetMin = viewport->BuildWorkOffsetMin; - viewport->WorkOffsetMax = viewport->BuildWorkOffsetMax; - viewport->BuildWorkOffsetMin = viewport->BuildWorkOffsetMax = ImVec2(0.0f, 0.0f); + // Lock down space taken by menu bars and status bars + // Setup initial value for functions like BeginMainMenuBar(), DockSpaceOverViewport() etc. + viewport->WorkInsetMin = viewport->BuildWorkInsetMin; + viewport->WorkInsetMax = viewport->BuildWorkInsetMax; + viewport->BuildWorkInsetMin = viewport->BuildWorkInsetMax = ImVec2(0.0f, 0.0f); viewport->UpdateWorkRect(); } } @@ -13294,6 +14887,10 @@ static void ImGui::UpdateViewportsNewFrame() //----------------------------------------------------------------------------- // [SECTION] PLATFORM DEPENDENT HELPERS //----------------------------------------------------------------------------- +// - Default clipboard handlers +// - Default shell function handlers +// - Default IME handlers +//----------------------------------------------------------------------------- #if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) @@ -13304,9 +14901,9 @@ static void ImGui::UpdateViewportsNewFrame() // Win32 clipboard implementation // We use g.ClipboardHandlerData for temporary storage to ensure it is freed on Shutdown() -static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx) +static const char* Platform_GetClipboardTextFn_DefaultImpl(ImGuiContext* ctx) { - ImGuiContext& g = *(ImGuiContext*)user_data_ctx; + ImGuiContext& g = *ctx; g.ClipboardHandlerData.clear(); if (!::OpenClipboard(NULL)) return NULL; @@ -13327,7 +14924,7 @@ static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx) return g.ClipboardHandlerData.Data; } -static void SetClipboardTextFn_DefaultImpl(void*, const char* text) +static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext*, const char* text) { if (!::OpenClipboard(NULL)) return; @@ -13354,7 +14951,7 @@ static PasteboardRef main_clipboard = 0; // OSX clipboard implementation // If you enable this you will need to add '-framework ApplicationServices' to your linker command-line! -static void SetClipboardTextFn_DefaultImpl(void*, const char* text) +static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext*, const char* text) { if (!main_clipboard) PasteboardCreate(kPasteboardClipboard, &main_clipboard); @@ -13367,9 +14964,9 @@ static void SetClipboardTextFn_DefaultImpl(void*, const char* text) } } -static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx) +static const char* Platform_GetClipboardTextFn_DefaultImpl(ImGuiContext* ctx) { - ImGuiContext& g = *(ImGuiContext*)user_data_ctx; + ImGuiContext& g = *ctx; if (!main_clipboard) PasteboardCreate(kPasteboardClipboard, &main_clipboard); PasteboardSynchronize(main_clipboard); @@ -13403,15 +15000,15 @@ static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx) #else // Local Dear ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers. -static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx) +static const char* Platform_GetClipboardTextFn_DefaultImpl(ImGuiContext* ctx) { - ImGuiContext& g = *(ImGuiContext*)user_data_ctx; + ImGuiContext& g = *ctx; return g.ClipboardHandlerData.empty() ? NULL : g.ClipboardHandlerData.begin(); } -static void SetClipboardTextFn_DefaultImpl(void* user_data_ctx, const char* text) +static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext* ctx, const char* text) { - ImGuiContext& g = *(ImGuiContext*)user_data_ctx; + ImGuiContext& g = *ctx; g.ClipboardHandlerData.clear(); const char* text_end = text + strlen(text); g.ClipboardHandlerData.resize((int)(text_end - text) + 1); @@ -13419,7 +15016,61 @@ static void SetClipboardTextFn_DefaultImpl(void* user_data_ctx, const char* text g.ClipboardHandlerData[(int)(text_end - text)] = 0; } +#endif // Default clipboard handlers + +//----------------------------------------------------------------------------- + +#ifndef IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS +#if defined(__APPLE__) && TARGET_OS_IPHONE +#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS +#endif + +#if defined(_WIN32) && defined(IMGUI_DISABLE_WIN32_FUNCTIONS) +#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS +#endif +#endif + +#ifndef IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS +#ifdef _WIN32 +#include // ShellExecuteA() +#ifdef _MSC_VER +#pragma comment(lib, "shell32") +#endif +static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path) +{ + return (INT_PTR)::ShellExecuteA(NULL, "open", path, NULL, NULL, SW_SHOWDEFAULT) > 32; +} +#else +#include +#include +static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path) +{ +#if defined(__APPLE__) + const char* args[] { "open", "--", path, NULL }; +#else + const char* args[] { "xdg-open", path, NULL }; +#endif + pid_t pid = fork(); + if (pid < 0) + return false; + if (!pid) + { + execvp(args[0], const_cast(args)); + exit(-1); + } + else + { + int status; + waitpid(pid, &status, 0); + return WEXITSTATUS(status) == 0; + } +} #endif +#else +static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char*) { return false; } +#endif // Default shell handlers + +//----------------------------------------------------------------------------- // Win32 API IME support (for Asian languages, etc.) #if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) @@ -13429,7 +15080,7 @@ static void SetClipboardTextFn_DefaultImpl(void* user_data_ctx, const char* text #pragma comment(lib, "imm32") #endif -static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatformImeData* data) +static void Platform_SetImeDataFn_DefaultImpl(ImGuiContext*, ImGuiViewport* viewport, ImGuiPlatformImeData* data) { // Notify OS Input Method Editor of text input position HWND hwnd = (HWND)viewport->PlatformHandleRaw; @@ -13455,14 +15106,14 @@ static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatf #else -static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport*, ImGuiPlatformImeData*) {} +static void Platform_SetImeDataFn_DefaultImpl(ImGuiContext*, ImGuiViewport*, ImGuiPlatformImeData*) {} -#endif +#endif // Default IME handlers //----------------------------------------------------------------------------- // [SECTION] METRICS/DEBUGGER WINDOW //----------------------------------------------------------------------------- -// - RenderViewportThumbnail() [Internal] +// - DebugRenderViewportThumbnail() [Internal] // - RenderViewportsThumbnails() [Internal] // - DebugTextEncoding() // - MetricsHelpMarker() [Internal] @@ -13500,8 +15151,8 @@ void ImGui::DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* ImRect thumb_r = thumb_window->Rect(); ImRect title_r = thumb_window->TitleBarRect(); - thumb_r = ImRect(ImFloor(off + thumb_r.Min * scale), ImFloor(off + thumb_r.Max * scale)); - title_r = ImRect(ImFloor(off + title_r.Min * scale), ImFloor(off + ImVec2(title_r.Max.x, title_r.Min.y) * scale) + ImVec2(0,5)); // Exaggerate title bar height + thumb_r = ImRect(ImTrunc(off + thumb_r.Min * scale), ImTrunc(off + thumb_r.Max * scale)); + title_r = ImRect(ImTrunc(off + title_r.Min * scale), ImTrunc(off + ImVec2(title_r.Max.x, title_r.Min.y + title_r.GetHeight() * 3.0f) * scale)); // Exaggerate title bar height thumb_r.ClipWithFull(bb); title_r.ClipWithFull(bb); const bool window_is_focused = (g.NavWindow && thumb_window->RootWindowForTitleBarHighlight == g.NavWindow->RootWindowForTitleBarHighlight); @@ -13511,6 +15162,8 @@ void ImGui::DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* window->DrawList->AddText(g.Font, g.FontSize * 1.0f, title_r.Min, GetColorU32(ImGuiCol_Text, alpha_mul), thumb_window->Name, FindRenderedTextEnd(thumb_window->Name)); } draw_list->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_Border, alpha_mul)); + if (viewport->ID == g.DebugMetricsConfig.HighlightViewportID) + window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255, 255, 0, 255)); } static void RenderViewportsThumbnails() @@ -13518,13 +15171,12 @@ static void RenderViewportsThumbnails() ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - // We don't display full monitor bounds (we could, but it often looks awkward), instead we display just enough to cover all of our viewports. float SCALE = 1.0f / 8.0f; - ImRect bb_full(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX); - for (ImGuiViewportP* viewport : g.Viewports) - bb_full.Add(viewport->GetMainRect()); + ImRect bb_full(g.Viewports[0]->Pos, g.Viewports[0]->Pos + g.Viewports[0]->Size); ImVec2 p = window->DC.CursorPos; ImVec2 off = p - bb_full.Min * SCALE; + + // Draw viewports for (ImGuiViewportP* viewport : g.Viewports) { ImRect viewport_draw_bb(off + (viewport->Pos) * SCALE, off + (viewport->Pos + viewport->Size) * SCALE); @@ -13536,14 +15188,15 @@ static void RenderViewportsThumbnails() // Draw an arbitrary US keyboard layout to visualize translated keys void ImGui::DebugRenderKeyboardPreview(ImDrawList* draw_list) { - const ImVec2 key_size = ImVec2(35.0f, 35.0f); - const float key_rounding = 3.0f; - const ImVec2 key_face_size = ImVec2(25.0f, 25.0f); - const ImVec2 key_face_pos = ImVec2(5.0f, 3.0f); - const float key_face_rounding = 2.0f; - const ImVec2 key_label_pos = ImVec2(7.0f, 4.0f); + const float scale = ImGui::GetFontSize() / 13.0f; + const ImVec2 key_size = ImVec2(35.0f, 35.0f) * scale; + const float key_rounding = 3.0f * scale; + const ImVec2 key_face_size = ImVec2(25.0f, 25.0f) * scale; + const ImVec2 key_face_pos = ImVec2(5.0f, 3.0f) * scale; + const float key_face_rounding = 2.0f * scale; + const ImVec2 key_label_pos = ImVec2(7.0f, 4.0f) * scale; const ImVec2 key_step = ImVec2(key_size.x - 1.0f, key_size.y - 1.0f); - const float key_row_offset = 9.0f; + const float key_row_offset = 9.0f * scale; ImVec2 board_min = GetCursorScreenPos(); ImVec2 board_max = ImVec2(board_min.x + 3 * key_step.x + 2 * key_row_offset + 10.0f, board_min.y + 3 * key_step.y + 10.0f); @@ -13618,6 +15271,35 @@ void ImGui::DebugTextEncoding(const char* str) EndTable(); } +static void DebugFlashStyleColorStop() +{ + ImGuiContext& g = *GImGui; + if (g.DebugFlashStyleColorIdx != ImGuiCol_COUNT) + g.Style.Colors[g.DebugFlashStyleColorIdx] = g.DebugFlashStyleColorBackup; + g.DebugFlashStyleColorIdx = ImGuiCol_COUNT; +} + +// Flash a given style color for some + inhibit modifications of this color via PushStyleColor() calls. +void ImGui::DebugFlashStyleColor(ImGuiCol idx) +{ + ImGuiContext& g = *GImGui; + DebugFlashStyleColorStop(); + g.DebugFlashStyleColorTime = 0.5f; + g.DebugFlashStyleColorIdx = idx; + g.DebugFlashStyleColorBackup = g.Style.Colors[idx]; +} + +void ImGui::UpdateDebugToolFlashStyleColor() +{ + ImGuiContext& g = *GImGui; + if (g.DebugFlashStyleColorTime <= 0.0f) + return; + ColorConvertHSVtoRGB(ImCos(g.DebugFlashStyleColorTime * 6.0f) * 0.5f + 0.5f, 0.5f, 0.5f, g.Style.Colors[g.DebugFlashStyleColorIdx].x, g.Style.Colors[g.DebugFlashStyleColorIdx].y, g.Style.Colors[g.DebugFlashStyleColorIdx].z); + g.Style.Colors[g.DebugFlashStyleColorIdx].w = 1.0f; + if ((g.DebugFlashStyleColorTime -= g.IO.DeltaTime) <= 0.0f) + DebugFlashStyleColorStop(); +} + // Avoid naming collision with imgui_demo.cpp's HelpMarker() for unity builds. static void MetricsHelpMarker(const char* desc) { @@ -13659,8 +15341,8 @@ void ImGui::ShowMetricsWindow(bool* p_open) ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig; if (cfg->ShowDebugLog) ShowDebugLogWindow(&cfg->ShowDebugLog); - if (cfg->ShowStackTool) - ShowStackToolWindow(&cfg->ShowStackTool); + if (cfg->ShowIDStackTool) + ShowIDStackToolWindow(&cfg->ShowIDStackTool); if (!Begin("Dear ImGui Metrics/Debugger", p_open) || GetCurrentWindow()->BeginCount > 1) { @@ -13668,11 +15350,19 @@ void ImGui::ShowMetricsWindow(bool* p_open) return; } + // [DEBUG] Clear debug breaks hooks after exactly one cycle. + DebugBreakClearData(); + // Basic info - Text("Dear ImGui %s", GetVersion()); + Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM); + if (g.ContextName[0] != 0) + { + SameLine(); + Text("(Context Name: \"%s\")", g.ContextName); + } Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); Text("%d vertices, %d indices (%d triangles)", io.MetricsRenderVertices, io.MetricsRenderIndices, io.MetricsRenderIndices / 3); - Text("%d visible windows, %d active allocations", io.MetricsRenderWindows, io.MetricsActiveAllocations); + Text("%d visible windows, %d current allocations", io.MetricsRenderWindows, g.DebugAllocInfo.TotalAllocCount - g.DebugAllocInfo.TotalFreeCount); //SameLine(); if (SmallButton("GC")) { g.GcCompactAll = true; } Separator(); @@ -13701,8 +15391,8 @@ void ImGui::ShowMetricsWindow(bool* p_open) else if (rect_type == TRT_ColumnsRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->MinX, table->InnerClipRect.Min.y, c->MaxX, table->InnerClipRect.Min.y + table_instance->LastOuterHeight); } else if (rect_type == TRT_ColumnsWorkRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->WorkRect.Min.y, c->WorkMaxX, table->WorkRect.Max.y); } else if (rect_type == TRT_ColumnsClipRect) { ImGuiTableColumn* c = &table->Columns[n]; return c->ClipRect; } - else if (rect_type == TRT_ColumnsContentHeadersUsed){ ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersUsed, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); } // Note: y1/y2 not always accurate - else if (rect_type == TRT_ColumnsContentHeadersIdeal){ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersIdeal, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); } + else if (rect_type == TRT_ColumnsContentHeadersUsed){ ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersUsed, table->InnerClipRect.Min.y + table_instance->LastTopHeadersRowHeight); } // Note: y1/y2 not always accurate + else if (rect_type == TRT_ColumnsContentHeadersIdeal){ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersIdeal, table->InnerClipRect.Min.y + table_instance->LastTopHeadersRowHeight); } else if (rect_type == TRT_ColumnsContentFrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXFrozen, table->InnerClipRect.Min.y + table_instance->LastFrozenHeight); } else if (rect_type == TRT_ColumnsContentUnfrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y + table_instance->LastFrozenHeight, c->ContentMaxXUnfrozen, table->InnerClipRect.Max.y); } IM_ASSERT(0); @@ -13727,34 +15417,24 @@ void ImGui::ShowMetricsWindow(bool* p_open) // Tools if (TreeNode("Tools")) { - bool show_encoding_viewer = TreeNode("UTF-8 Encoding viewer"); - SameLine(); - MetricsHelpMarker("You can also call ImGui::DebugTextEncoding() from your code with a given string to test that your UTF-8 encoding settings are correct."); - if (show_encoding_viewer) - { - static char buf[100] = ""; - SetNextItemWidth(-FLT_MIN); - InputText("##Text", buf, IM_ARRAYSIZE(buf)); - if (buf[0] != 0) - DebugTextEncoding(buf); - TreePop(); - } - + // Debug Break features // The Item Picker tool is super useful to visually select an item and break into the call-stack of where it was submitted. - if (Checkbox("Show Item Picker", &g.DebugItemPickerActive) && g.DebugItemPickerActive) - DebugStartItemPicker(); + SeparatorTextEx(0, "Debug breaks", NULL, CalcTextSize("(?)").x + g.Style.SeparatorTextPadding.x); SameLine(); MetricsHelpMarker("Will call the IM_DEBUG_BREAK() macro to break in debugger.\nWarning: If you don't have a debugger attached, this will probably crash."); + if (Checkbox("Show Item Picker", &g.DebugItemPickerActive) && g.DebugItemPickerActive) + DebugStartItemPicker(); + Checkbox("Show \"Debug Break\" buttons in other sections (io.ConfigDebugIsDebuggerPresent)", &g.IO.ConfigDebugIsDebuggerPresent); + + SeparatorText("Visualize"); - // Stack Tool is your best friend! Checkbox("Show Debug Log", &cfg->ShowDebugLog); SameLine(); MetricsHelpMarker("You can also call ImGui::ShowDebugLogWindow() from your code."); - // Stack Tool is your best friend! - Checkbox("Show Stack Tool", &cfg->ShowStackTool); + Checkbox("Show ID Stack Tool", &cfg->ShowIDStackTool); SameLine(); - MetricsHelpMarker("You can also call ImGui::ShowStackToolWindow() from your code."); + MetricsHelpMarker("You can also call ImGui::ShowIDStackToolWindow() from your code."); Checkbox("Show windows begin order", &cfg->ShowWindowsBeginOrder); Checkbox("Show windows rectangles", &cfg->ShowWindowsRects); @@ -13817,11 +15497,26 @@ void ImGui::ShowMetricsWindow(bool* p_open) Unindent(); } } + Checkbox("Show groups rectangles", &g.DebugShowGroupRects); // Storing in context as this is used by group code and prefers to be in hot-data + + SeparatorText("Validate"); Checkbox("Debug Begin/BeginChild return value", &io.ConfigDebugBeginReturnValueLoop); SameLine(); MetricsHelpMarker("Some calls to Begin()/BeginChild() will return false.\n\nWill cycle through window depths then repeat. Windows should be flickering while running."); + Checkbox("UTF-8 Encoding viewer", &cfg->ShowTextEncodingViewer); + SameLine(); + MetricsHelpMarker("You can also call ImGui::DebugTextEncoding() from your code with a given string to test that your UTF-8 encoding settings are correct."); + if (cfg->ShowTextEncodingViewer) + { + static char buf[64] = ""; + SetNextItemWidth(-FLT_MIN); + InputText("##DebugTextEncodingBuf", buf, IM_ARRAYSIZE(buf)); + if (buf[0] != 0) + DebugTextEncoding(buf); + } + TreePop(); } @@ -13865,9 +15560,14 @@ void ImGui::ShowMetricsWindow(bool* p_open) // Viewports if (TreeNode("Viewports", "Viewports (%d)", g.Viewports.Size)) { - Indent(GetTreeNodeToLabelSpacing()); - RenderViewportsThumbnails(); - Unindent(GetTreeNodeToLabelSpacing()); + SetNextItemOpen(true, ImGuiCond_Once); + if (TreeNode("Windows Minimap")) + { + RenderViewportsThumbnails(); + TreePop(); + } + cfg->HighlightViewportID = 0; + for (ImGuiViewportP* viewport : g.Viewports) DebugNodeViewport(viewport); TreePop(); @@ -13880,9 +15580,9 @@ void ImGui::ShowMetricsWindow(bool* p_open) { // As it's difficult to interact with tree nodes while popups are open, we display everything inline. ImGuiWindow* window = popup_data.Window; - BulletText("PopupID: %08x, Window: '%s' (%s%s), BackupNavWindow '%s', ParentWindow '%s'", + BulletText("PopupID: %08x, Window: '%s' (%s%s), RestoreNavWindow '%s', ParentWindow '%s'", popup_data.PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? "Child;" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? "Menu;" : "", - popup_data.BackupNavWindow ? popup_data.BackupNavWindow->Name : "NULL", window && window->ParentWindow ? window->ParentWindow->Name : "NULL"); + popup_data.RestoreNavWindow ? popup_data.RestoreNavWindow->Name : "NULL", window && window->ParentWindow ? window->ParentWindow->Name : "NULL"); } TreePop(); } @@ -13924,6 +15624,24 @@ void ImGui::ShowMetricsWindow(bool* p_open) TreePop(); } + // Details for TypingSelect + if (TreeNode("TypingSelect", "TypingSelect (%d)", g.TypingSelectState.SearchBuffer[0] != 0 ? 1 : 0)) + { + DebugNodeTypingSelectState(&g.TypingSelectState); + TreePop(); + } + + // Details for MultiSelect + if (TreeNode("MultiSelect", "MultiSelect (%d)", g.MultiSelectStorage.GetAliveCount())) + { + ImGuiBoxSelectState* bs = &g.BoxSelectState; + BulletText("BoxSelect ID=0x%08X, Starting = %d, Active %d", bs->ID, bs->IsStarting, bs->IsActive); + for (int n = 0; n < g.MultiSelectStorage.GetMapSize(); n++) + if (ImGuiMultiSelectState* state = g.MultiSelectStorage.TryGetMapData(n)) + DebugNodeMultiSelectState(state); + TreePop(); + } + // Details for Docking #ifdef IMGUI_HAS_DOCK if (TreeNode("Docking")) @@ -13981,6 +15699,27 @@ void ImGui::ShowMetricsWindow(bool* p_open) TreePop(); } + // Settings + if (TreeNode("Memory allocations")) + { + ImGuiDebugAllocInfo* info = &g.DebugAllocInfo; + Text("%d current allocations", info->TotalAllocCount - info->TotalFreeCount); + if (SmallButton("GC now")) { g.GcCompactAll = true; } + Text("Recent frames with allocations:"); + int buf_size = IM_ARRAYSIZE(info->LastEntriesBuf); + for (int n = buf_size - 1; n >= 0; n--) + { + ImGuiDebugAllocEntry* entry = &info->LastEntriesBuf[(info->LastEntriesIdx - n + buf_size) % buf_size]; + BulletText("Frame %06d: %+3d ( %2d alloc, %2d free )", entry->FrameCount, entry->AllocCount - entry->FreeCount, entry->AllocCount, entry->FreeCount); + if (n == 0) + { + SameLine(); + Text("<- %d frames ago", g.FrameCount - entry->FrameCount); + } + } + TreePop(); + } + if (TreeNode("Inputs")) { Text("KEYBOARD/GAMEPAD/MOUSE KEYS"); @@ -13991,7 +15730,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } }; #else - struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array + struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key >= 0 && key < 512 && GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array //Text("Legacy raw:"); for (ImGuiKey key = ImGuiKey_KeysData_OFFSET; key < ImGuiKey_COUNT; key++) { if (io.KeysDown[key]) { SameLine(); Text("\"%s\" %d", GetKeyName(key), key); } } #endif Text("Keys down:"); for (ImGuiKey key = ImGuiKey_KeysData_OFFSET; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !IsKeyDown(key)) continue; SameLine(); Text(IsNamedKey(key) ? "\"%s\"" : "\"%s\" %d", GetKeyName(key), key); SameLine(); Text("(%.02f)", GetKeyData(key)->DownDuration); } @@ -14034,41 +15773,44 @@ void ImGui::ShowMetricsWindow(bool* p_open) Text("KEY OWNERS"); { Indent(); - if (BeginListBox("##owners", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 6))) - { + if (BeginChild("##owners", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY, ImGuiWindowFlags_NoSavedSettings)) for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key); - if (owner_data->OwnerCurr == ImGuiKeyOwner_None) + if (owner_data->OwnerCurr == ImGuiKeyOwner_NoOwner) continue; Text("%s: 0x%08X%s", GetKeyName(key), owner_data->OwnerCurr, owner_data->LockUntilRelease ? " LockUntilRelease" : owner_data->LockThisFrame ? " LockThisFrame" : ""); DebugLocateItemOnHover(owner_data->OwnerCurr); } - EndListBox(); - } + EndChild(); Unindent(); } Text("SHORTCUT ROUTING"); + SameLine(); + MetricsHelpMarker("Declared shortcut routes automatically set key owner when mods matches."); { Indent(); - if (BeginListBox("##routes", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 6))) - { + if (BeginChild("##routes", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY, ImGuiWindowFlags_NoSavedSettings)) for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable; for (ImGuiKeyRoutingIndex idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; idx != -1; ) { - char key_chord_name[64]; ImGuiKeyRoutingData* routing_data = &rt->Entries[idx]; - GetKeyChordName(key | routing_data->Mods, key_chord_name, IM_ARRAYSIZE(key_chord_name)); - Text("%s: 0x%08X", key_chord_name, routing_data->RoutingCurr); + ImGuiKeyChord key_chord = key | routing_data->Mods; + Text("%s: 0x%08X (scored %d)", GetKeyChordName(key_chord), routing_data->RoutingCurr, routing_data->RoutingCurrScore); DebugLocateItemOnHover(routing_data->RoutingCurr); + if (g.IO.ConfigDebugIsDebuggerPresent) + { + SameLine(); + if (DebugBreakButton("**DebugBreak**", "in SetShortcutRouting() for this KeyChord")) + g.DebugBreakInShortcutRouting = key_chord; + } idx = routing_data->NextEntryIndex; } } - EndListBox(); - } + EndChild(); Text("(ActiveIdUsing: AllKeyboardKeys: %d, NavDirMask: 0x%X)", g.ActiveIdUsingAllKeyboardKeys, g.ActiveIdUsingNavDirMask); Unindent(); } @@ -14103,11 +15845,20 @@ void ImGui::ShowMetricsWindow(bool* p_open) Text("NavId: 0x%08X, NavLayer: %d", g.NavId, g.NavLayer); DebugLocateItemOnHover(g.NavId); Text("NavInputSource: %s", GetInputSourceName(g.NavInputSource)); + Text("NavLastValidSelectionUserData = %" IM_PRId64 " (0x%" IM_PRIX64 ")", g.NavLastValidSelectionUserData, g.NavLastValidSelectionUserData); Text("NavActive: %d, NavVisible: %d", g.IO.NavActive, g.IO.NavVisible); Text("NavActivateId/DownId/PressedId: %08X/%08X/%08X", g.NavActivateId, g.NavActivateDownId, g.NavActivatePressedId); Text("NavActivateFlags: %04X", g.NavActivateFlags); - Text("NavDisableHighlight: %d, NavDisableMouseHover: %d", g.NavDisableHighlight, g.NavDisableMouseHover); + Text("NavCursorVisible: %d, NavHighlightItemUnderNav: %d", g.NavCursorVisible, g.NavHighlightItemUnderNav); Text("NavFocusScopeId = 0x%08X", g.NavFocusScopeId); + Text("NavFocusRoute[] = "); + for (int path_n = g.NavFocusRoute.Size - 1; path_n >= 0; path_n--) + { + const ImGuiFocusScopeData& focus_scope = g.NavFocusRoute[path_n]; + SameLine(0.0f, 0.0f); + Text("0x%08X/", focus_scope.ID); + SetItemTooltip("In window \"%s\"", FindWindowByID(focus_scope.WindowID)->Name); + } Text("NavWindowingTarget: '%s'", g.NavWindowingTarget ? g.NavWindowingTarget->Name : "NULL"); Unindent(); @@ -14175,6 +15926,64 @@ void ImGui::ShowMetricsWindow(bool* p_open) End(); } +void ImGui::DebugBreakClearData() +{ + // Those fields are scattered in their respective subsystem to stay in hot-data locations + ImGuiContext& g = *GImGui; + g.DebugBreakInWindow = 0; + g.DebugBreakInTable = 0; + g.DebugBreakInShortcutRouting = ImGuiKey_None; +} + +void ImGui::DebugBreakButtonTooltip(bool keyboard_only, const char* description_of_location) +{ + if (!BeginItemTooltip()) + return; + Text("To call IM_DEBUG_BREAK() %s:", description_of_location); + Separator(); + TextUnformatted(keyboard_only ? "- Press 'Pause/Break' on keyboard." : "- Press 'Pause/Break' on keyboard.\n- or Click (may alter focus/active id).\n- or navigate using keyboard and press space."); + Separator(); + TextUnformatted("Choose one way that doesn't interfere with what you are trying to debug!\nYou need a debugger attached or this will crash!"); + EndTooltip(); +} + +// Special button that doesn't take focus, doesn't take input owner, and can be activated without a click etc. +// In order to reduce interferences with the contents we are trying to debug into. +bool ImGui::DebugBreakButton(const char* label, const char* description_of_location) +{ + ImGuiWindow* window = GetCurrentWindow(); + if (window->SkipItems) + return false; + + ImGuiContext& g = *GImGui; + const ImGuiID id = window->GetID(label); + const ImVec2 label_size = CalcTextSize(label, NULL, true); + ImVec2 pos = window->DC.CursorPos + ImVec2(0.0f, window->DC.CurrLineTextBaseOffset); + ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x * 2.0f, label_size.y); + + const ImRect bb(pos, pos + size); + ItemSize(size, 0.0f); + if (!ItemAdd(bb, id)) + return false; + + // WE DO NOT USE ButtonEx() or ButtonBehavior() in order to reduce our side-effects. + bool hovered = ItemHoverable(bb, id, g.CurrentItemFlags); + bool pressed = hovered && (IsKeyChordPressed(g.DebugBreakKeyChord) || IsMouseClicked(0) || g.NavActivateId == id); + DebugBreakButtonTooltip(false, description_of_location); + + ImVec4 col4f = GetStyleColorVec4(hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); + ImVec4 hsv; + ColorConvertRGBtoHSV(col4f.x, col4f.y, col4f.z, hsv.x, hsv.y, hsv.z); + ColorConvertHSVtoRGB(hsv.x + 0.20f, hsv.y, hsv.z, col4f.x, col4f.y, col4f.z); + + RenderNavCursor(bb, id); + RenderFrame(bb.Min, bb.Max, GetColorU32(col4f), true, g.Style.FrameRounding); + RenderTextClipped(bb.Min, bb.Max, label, NULL, &label_size, g.Style.ButtonTextAlign, &bb); + + IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags); + return pressed; +} + // [DEBUG] Display contents of Columns void ImGui::DebugNodeColumns(ImGuiOldColumns* columns) { @@ -14186,6 +15995,16 @@ void ImGui::DebugNodeColumns(ImGuiOldColumns* columns) TreePop(); } +static void FormatTextureIDForDebugDisplay(char* buf, int buf_size, ImTextureID tex_id) +{ + union { void* ptr; int integer; } tex_id_opaque; + memcpy(&tex_id_opaque, &tex_id, ImMin(sizeof(void*), sizeof(tex_id))); + if (sizeof(tex_id) >= sizeof(void*)) + ImFormatString(buf, buf_size, "0x%p", tex_id_opaque.ptr); + else + ImFormatString(buf, buf_size, "0x%04X", tex_id_opaque.integer); +} + // [DEBUG] Display contents of ImDrawList void ImGui::DebugNodeDrawList(ImGuiWindow* window, ImGuiViewportP* viewport, const ImDrawList* draw_list, const char* label) { @@ -14222,10 +16041,11 @@ void ImGui::DebugNodeDrawList(ImGuiWindow* window, ImGuiViewportP* viewport, con continue; } + char texid_desc[20]; + FormatTextureIDForDebugDisplay(texid_desc, IM_ARRAYSIZE(texid_desc), pcmd->TextureId); char buf[300]; - ImFormatString(buf, IM_ARRAYSIZE(buf), "DrawCmd:%5d tris, Tex 0x%p, ClipRect (%4.0f,%4.0f)-(%4.0f,%4.0f)", - pcmd->ElemCount / 3, (void*)(intptr_t)pcmd->TextureId, - pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w); + ImFormatString(buf, IM_ARRAYSIZE(buf), "DrawCmd:%5d tris, Tex %s, ClipRect (%4.0f,%4.0f)-(%4.0f,%4.0f)", + pcmd->ElemCount / 3, texid_desc, pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w); bool pcmd_node_open = TreeNode((void*)(pcmd - draw_list->CmdBuffer.begin()), "%s", buf); if (IsItemHovered() && (cfg->ShowDrawCmdMesh || cfg->ShowDrawCmdBoundingBoxes) && fg_draw_list) DebugNodeDrawCmdShowMeshAndBoundingBox(fg_draw_list, draw_list, pcmd, cfg->ShowDrawCmdMesh, cfg->ShowDrawCmdBoundingBoxes); @@ -14305,8 +16125,8 @@ void ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, co // Draw bounding boxes if (show_aabb) { - out_draw_list->AddRect(ImFloor(clip_rect.Min), ImFloor(clip_rect.Max), IM_COL32(255, 0, 255, 255)); // In pink: clipping rectangle submitted to GPU - out_draw_list->AddRect(ImFloor(vtxs_rect.Min), ImFloor(vtxs_rect.Max), IM_COL32(0, 255, 255, 255)); // In cyan: bounding box of triangles + out_draw_list->AddRect(ImTrunc(clip_rect.Min), ImTrunc(clip_rect.Max), IM_COL32(255, 0, 255, 255)); // In pink: clipping rectangle submitted to GPU + out_draw_list->AddRect(ImTrunc(vtxs_rect.Min), ImTrunc(vtxs_rect.Max), IM_COL32(0, 255, 255, 255)); // In cyan: bounding box of triangles } out_draw_list->Flags = backup_flags; } @@ -14331,7 +16151,7 @@ void ImGui::DebugNodeFont(ImFont* font) SetNextItemWidth(GetFontSize() * 8); DragFloat("Font scale", &font->Scale, 0.005f, 0.3f, 2.0f, "%.1f"); SameLine(); MetricsHelpMarker( - "Note than the default embedded font is NOT meant to be scaled.\n\n" + "Note that the default embedded font is NOT meant to be scaled.\n\n" "Font are currently rendered into bitmaps at a given size at the time of building the atlas. " "You may oversample them to get some flexibility with scaling. " "You can also render at multiple sizes and select which one to use at runtime.\n\n" @@ -14417,8 +16237,11 @@ void ImGui::DebugNodeStorage(ImGuiStorage* storage, const char* label) { if (!TreeNode(label, "%s: %d entries, %d bytes", label, storage->Data.Size, storage->Data.size_in_bytes())) return; - for (const ImGuiStorage::ImGuiStoragePair& p : storage->Data) + for (const ImGuiStoragePair& p : storage->Data) + { BulletText("Key 0x%08X Value { i: %d }", p.key, p.val_i); // Important: we currently don't store a type, real value may not be integer. + DebugLocateItemOnHover(p.key); + } TreePop(); } @@ -14465,13 +16288,17 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label) void ImGui::DebugNodeViewport(ImGuiViewportP* viewport) { + ImGuiContext& g = *GImGui; SetNextItemOpen(true, ImGuiCond_Once); - if (TreeNode("viewport0", "Viewport #%d", 0)) + bool open = TreeNode("viewport0", "Viewport #%d", 0); + if (IsItemHovered()) + g.DebugMetricsConfig.HighlightViewportID = viewport->ID; + if (open) { ImGuiWindowFlags flags = viewport->Flags; - BulletText("Main Pos: (%.0f,%.0f), Size: (%.0f,%.0f)\nWorkArea Offset Left: %.0f Top: %.0f, Right: %.0f, Bottom: %.0f", + BulletText("Main Pos: (%.0f,%.0f), Size: (%.0f,%.0f)\nWorkArea Inset Left: %.0f Top: %.0f, Right: %.0f, Bottom: %.0f", viewport->Pos.x, viewport->Pos.y, viewport->Size.x, viewport->Size.y, - viewport->WorkOffsetMin.x, viewport->WorkOffsetMin.y, viewport->WorkOffsetMax.x, viewport->WorkOffsetMax.y); + viewport->WorkInsetMin.x, viewport->WorkInsetMin.y, viewport->WorkInsetMax.x, viewport->WorkInsetMax.y); BulletText("Flags: 0x%04X =%s%s%s", viewport->Flags, (flags & ImGuiViewportFlags_IsPlatformWindow) ? " IsPlatformWindow" : "", (flags & ImGuiViewportFlags_IsPlatformMonitor) ? " IsPlatformMonitor" : "", @@ -14504,6 +16331,9 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label) if (window->MemoryCompacted) TextDisabled("Note: some memory buffers have been compacted/freed."); + if (g.IO.ConfigDebugIsDebuggerPresent && DebugBreakButton("**DebugBreak**", "in Begin()")) + g.DebugBreakInWindow = window->ID; + ImGuiWindowFlags flags = window->Flags; DebugNodeDrawList(window, window->Viewport, window->DrawList, "DrawList"); BulletText("Pos: (%.1f,%.1f), Size: (%.1f,%.1f), ContentSize (%.1f,%.1f) Ideal (%.1f,%.1f)", window->Pos.x, window->Pos.y, window->Size.x, window->Size.y, window->ContentSize.x, window->ContentSize.y, window->ContentSizeIdeal.x, window->ContentSizeIdeal.y); @@ -14511,6 +16341,12 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label) (flags & ImGuiWindowFlags_ChildWindow) ? "Child " : "", (flags & ImGuiWindowFlags_Tooltip) ? "Tooltip " : "", (flags & ImGuiWindowFlags_Popup) ? "Popup " : "", (flags & ImGuiWindowFlags_Modal) ? "Modal " : "", (flags & ImGuiWindowFlags_ChildMenu) ? "ChildMenu " : "", (flags & ImGuiWindowFlags_NoSavedSettings) ? "NoSavedSettings " : "", (flags & ImGuiWindowFlags_NoMouseInputs)? "NoMouseInputs":"", (flags & ImGuiWindowFlags_NoNavInputs) ? "NoNavInputs" : "", (flags & ImGuiWindowFlags_AlwaysAutoResize) ? "AlwaysAutoResize" : ""); + if (flags & ImGuiWindowFlags_ChildWindow) + BulletText("ChildFlags: 0x%08X (%s%s%s%s..)", window->ChildFlags, + (window->ChildFlags & ImGuiChildFlags_Borders) ? "Borders " : "", + (window->ChildFlags & ImGuiChildFlags_ResizeX) ? "ResizeX " : "", + (window->ChildFlags & ImGuiChildFlags_ResizeY) ? "ResizeY " : "", + (window->ChildFlags & ImGuiChildFlags_NavFlattened) ? "NavFlattened " : ""); BulletText("Scroll: (%.2f/%.2f,%.2f/%.2f) Scrollbar:%s%s", window->Scroll.x, window->ScrollMax.x, window->Scroll.y, window->ScrollMax.y, window->ScrollbarX ? "X" : "", window->ScrollbarY ? "Y" : ""); BulletText("Active: %d/%d, WriteAccessed: %d, BeginOrderWithinContext: %d", window->Active, window->WasActive, window->WriteAccessed, (window->Active || window->WasActive) ? window->BeginOrderWithinContext : -1); BulletText("Appearing: %d, Hidden: %d (CanSkip %d Cannot %d), SkipItems: %d", window->Appearing, window->Hidden, window->HiddenFramesCanSkipItems, window->HiddenFramesCannotSkipItems, window->SkipItems); @@ -14527,9 +16363,10 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label) for (int layer = 0; layer < ImGuiNavLayer_COUNT; layer++) BulletText("NavPreferredScoringPosRel[%d] = {%.1f,%.1f)", layer, (pr[layer].x == FLT_MAX ? -99999.0f : pr[layer].x), (pr[layer].y == FLT_MAX ? -99999.0f : pr[layer].y)); // Display as 99999.0f so it looks neater. BulletText("NavLayersActiveMask: %X, NavLastChildNavWindow: %s", window->DC.NavLayersActiveMask, window->NavLastChildNavWindow ? window->NavLastChildNavWindow->Name : "NULL"); - if (window->RootWindow != window) { DebugNodeWindow(window->RootWindow, "RootWindow"); } - if (window->ParentWindow != NULL) { DebugNodeWindow(window->ParentWindow, "ParentWindow"); } - if (window->DC.ChildWindows.Size > 0) { DebugNodeWindowsList(&window->DC.ChildWindows, "ChildWindows"); } + if (window->RootWindow != window) { DebugNodeWindow(window->RootWindow, "RootWindow"); } + if (window->ParentWindow != NULL) { DebugNodeWindow(window->ParentWindow, "ParentWindow"); } + if (window->ParentWindowForFocusRoute != NULL) { DebugNodeWindow(window->ParentWindowForFocusRoute, "ParentWindowForFocusRoute"); } + if (window->DC.ChildWindows.Size > 0) { DebugNodeWindowsList(&window->DC.ChildWindows, "ChildWindows"); } if (window->ColumnsStorage.Size > 0 && TreeNode("Columns", "Columns sets (%d)", window->ColumnsStorage.Size)) { for (ImGuiOldColumns& columns : window->ColumnsStorage) @@ -14597,17 +16434,62 @@ void ImGui::DebugLogV(const char* fmt, va_list args) { ImGuiContext& g = *GImGui; const int old_size = g.DebugLogBuf.size(); - g.DebugLogBuf.appendf("[%05d] ", g.FrameCount); + if (g.ContextName[0] != 0) + g.DebugLogBuf.appendf("[%s] [%05d] ", g.ContextName, g.FrameCount); + else + g.DebugLogBuf.appendf("[%05d] ", g.FrameCount); g.DebugLogBuf.appendfv(fmt, args); + g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size()); if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTTY) IMGUI_DEBUG_PRINTF("%s", g.DebugLogBuf.begin() + old_size); - g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size()); +#ifdef IMGUI_ENABLE_TEST_ENGINE + // IMGUI_TEST_ENGINE_LOG() adds a trailing \n automatically + const int new_size = g.DebugLogBuf.size(); + const bool trailing_carriage_return = (g.DebugLogBuf[new_size - 1] == '\n'); + if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTestEngine) + IMGUI_TEST_ENGINE_LOG("%.*s", new_size - old_size - (trailing_carriage_return ? 1 : 0), g.DebugLogBuf.begin() + old_size); +#endif +} + +// FIXME-LAYOUT: To be done automatically via layout mode once we rework ItemSize/ItemAdd into ItemLayout. +static void SameLineOrWrap(const ImVec2& size) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + ImVec2 pos(window->DC.CursorPosPrevLine.x + g.Style.ItemSpacing.x, window->DC.CursorPosPrevLine.y); + if (window->WorkRect.Contains(ImRect(pos, pos + size))) + ImGui::SameLine(); +} + +static void ShowDebugLogFlag(const char* name, ImGuiDebugLogFlags flags) +{ + ImGuiContext& g = *GImGui; + ImVec2 size(ImGui::GetFrameHeight() + g.Style.ItemInnerSpacing.x + ImGui::CalcTextSize(name).x, ImGui::GetFrameHeight()); + SameLineOrWrap(size); // FIXME-LAYOUT: To be done automatically once we rework ItemSize/ItemAdd into ItemLayout. + + bool highlight_errors = (flags == ImGuiDebugLogFlags_EventError && g.DebugLogSkippedErrors > 0); + if (highlight_errors) + ImGui::PushStyleColor(ImGuiCol_Text, ImLerp(g.Style.Colors[ImGuiCol_Text], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.30f)); + if (ImGui::CheckboxFlags(name, &g.DebugLogFlags, flags) && g.IO.KeyShift && (g.DebugLogFlags & flags) != 0) + { + g.DebugLogAutoDisableFrames = 2; + g.DebugLogAutoDisableFlags |= flags; + } + if (highlight_errors) + { + ImGui::PopStyleColor(); + ImGui::SetItemTooltip("%d past errors skipped.", g.DebugLogSkippedErrors); + } + else + { + ImGui::SetItemTooltip("Hold SHIFT when clicking to enable for 2 frames only (useful for spammy log entries)"); + } } void ImGui::ShowDebugLogWindow(bool* p_open) { ImGuiContext& g = *GImGui; - if (!(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize)) + if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) == 0) SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 12.0f), ImGuiCond_FirstUseEver); if (!Begin("Dear ImGui Debug Log", p_open) || GetCurrentWindow()->BeginCount > 1) { @@ -14615,48 +16497,56 @@ void ImGui::ShowDebugLogWindow(bool* p_open) return; } - CheckboxFlags("All", &g.DebugLogFlags, ImGuiDebugLogFlags_EventMask_); - SameLine(); CheckboxFlags("ActiveId", &g.DebugLogFlags, ImGuiDebugLogFlags_EventActiveId); - SameLine(); CheckboxFlags("Focus", &g.DebugLogFlags, ImGuiDebugLogFlags_EventFocus); - SameLine(); CheckboxFlags("Popup", &g.DebugLogFlags, ImGuiDebugLogFlags_EventPopup); - SameLine(); CheckboxFlags("Nav", &g.DebugLogFlags, ImGuiDebugLogFlags_EventNav); - SameLine(); if (CheckboxFlags("Clipper", &g.DebugLogFlags, ImGuiDebugLogFlags_EventClipper)) { g.DebugLogClipperAutoDisableFrames = 2; } if (IsItemHovered()) SetTooltip("Clipper log auto-disabled after 2 frames"); - //SameLine(); CheckboxFlags("Selection", &g.DebugLogFlags, ImGuiDebugLogFlags_EventSelection); - SameLine(); CheckboxFlags("IO", &g.DebugLogFlags, ImGuiDebugLogFlags_EventIO); + ImGuiDebugLogFlags all_enable_flags = ImGuiDebugLogFlags_EventMask_ & ~ImGuiDebugLogFlags_EventInputRouting; + CheckboxFlags("All", &g.DebugLogFlags, all_enable_flags); + SetItemTooltip("(except InputRouting which is spammy)"); + + ShowDebugLogFlag("Errors", ImGuiDebugLogFlags_EventError); + ShowDebugLogFlag("ActiveId", ImGuiDebugLogFlags_EventActiveId); + ShowDebugLogFlag("Clipper", ImGuiDebugLogFlags_EventClipper); + ShowDebugLogFlag("Focus", ImGuiDebugLogFlags_EventFocus); + ShowDebugLogFlag("IO", ImGuiDebugLogFlags_EventIO); + ShowDebugLogFlag("Nav", ImGuiDebugLogFlags_EventNav); + ShowDebugLogFlag("Popup", ImGuiDebugLogFlags_EventPopup); + ShowDebugLogFlag("Selection", ImGuiDebugLogFlags_EventSelection); + ShowDebugLogFlag("InputRouting", ImGuiDebugLogFlags_EventInputRouting); if (SmallButton("Clear")) { g.DebugLogBuf.clear(); g.DebugLogIndex.clear(); + g.DebugLogSkippedErrors = 0; } SameLine(); if (SmallButton("Copy")) SetClipboardText(g.DebugLogBuf.c_str()); - BeginChild("##log", ImVec2(0.0f, 0.0f), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar); + SameLine(); + if (SmallButton("Configure Outputs..")) + OpenPopup("Outputs"); + if (BeginPopup("Outputs")) + { + CheckboxFlags("OutputToTTY", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTTY); +#ifndef IMGUI_ENABLE_TEST_ENGINE + BeginDisabled(); +#endif + CheckboxFlags("OutputToTestEngine", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTestEngine); +#ifndef IMGUI_ENABLE_TEST_ENGINE + EndDisabled(); +#endif + EndPopup(); + } + + BeginChild("##log", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Borders, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar); + + const ImGuiDebugLogFlags backup_log_flags = g.DebugLogFlags; + g.DebugLogFlags &= ~ImGuiDebugLogFlags_EventClipper; ImGuiListClipper clipper; clipper.Begin(g.DebugLogIndex.size()); while (clipper.Step()) for (int line_no = clipper.DisplayStart; line_no < clipper.DisplayEnd; line_no++) - { - const char* line_begin = g.DebugLogIndex.get_line_begin(g.DebugLogBuf.c_str(), line_no); - const char* line_end = g.DebugLogIndex.get_line_end(g.DebugLogBuf.c_str(), line_no); - TextUnformatted(line_begin, line_end); - ImRect text_rect = g.LastItemData.Rect; - if (IsItemHovered()) - for (const char* p = line_begin; p <= line_end - 10; p++) - { - ImGuiID id = 0; - if (p[0] != '0' || (p[1] != 'x' && p[1] != 'X') || sscanf(p + 2, "%X", &id) != 1) - continue; - ImVec2 p0 = CalcTextSize(line_begin, p); - ImVec2 p1 = CalcTextSize(p, p + 10); - g.LastItemData.Rect = ImRect(text_rect.Min + ImVec2(p0.x, 0.0f), text_rect.Min + ImVec2(p0.x + p1.x, p1.y)); - if (IsMouseHoveringRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, true)) - DebugLocateItemOnHover(id); - p += 10; - } - } + DebugTextUnformattedWithLocateItem(g.DebugLogIndex.get_line_begin(g.DebugLogBuf.c_str(), line_no), g.DebugLogIndex.get_line_end(g.DebugLogBuf.c_str(), line_no)); + g.DebugLogFlags = backup_log_flags; if (GetScrollY() >= GetScrollMaxY()) SetScrollHereY(1.0f); EndChild(); @@ -14664,8 +16554,30 @@ void ImGui::ShowDebugLogWindow(bool* p_open) End(); } +// Display line, search for 0xXXXXXXXX identifiers and call DebugLocateItemOnHover() when hovered. +void ImGui::DebugTextUnformattedWithLocateItem(const char* line_begin, const char* line_end) +{ + TextUnformatted(line_begin, line_end); + if (!IsItemHovered()) + return; + ImGuiContext& g = *GImGui; + ImRect text_rect = g.LastItemData.Rect; + for (const char* p = line_begin; p <= line_end - 10; p++) + { + ImGuiID id = 0; + if (p[0] != '0' || (p[1] != 'x' && p[1] != 'X') || sscanf(p + 2, "%X", &id) != 1 || ImCharIsXdigitA(p[10])) + continue; + ImVec2 p0 = CalcTextSize(line_begin, p); + ImVec2 p1 = CalcTextSize(p, p + 10); + g.LastItemData.Rect = ImRect(text_rect.Min + ImVec2(p0.x, 0.0f), text_rect.Min + ImVec2(p0.x + p1.x, p1.y)); + if (IsMouseHoveringRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, true)) + DebugLocateItemOnHover(id); + p += 10; + } +} + //----------------------------------------------------------------------------- -// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, STACK TOOL) +// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, ID STACK TOOL) //----------------------------------------------------------------------------- // Draw a small cross at current CursorPos in current window's DrawList @@ -14707,8 +16619,10 @@ void ImGui::DebugLocateItem(ImGuiID target_id) ImGuiContext& g = *GImGui; g.DebugLocateId = target_id; g.DebugLocateFrames = 2; + g.DebugBreakInLocateId = false; } +// FIXME: Doesn't work over through a modal window, because they clear HoveredWindow. void ImGui::DebugLocateItemOnHover(ImGuiID target_id) { if (target_id == 0 || !IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenBlockedByPopup)) @@ -14716,11 +16630,24 @@ void ImGui::DebugLocateItemOnHover(ImGuiID target_id) ImGuiContext& g = *GImGui; DebugLocateItem(target_id); GetForegroundDrawList(g.CurrentWindow)->AddRect(g.LastItemData.Rect.Min - ImVec2(3.0f, 3.0f), g.LastItemData.Rect.Max + ImVec2(3.0f, 3.0f), DEBUG_LOCATE_ITEM_COLOR); + + // Can't easily use a context menu here because it will mess with focus, active id etc. + if (g.IO.ConfigDebugIsDebuggerPresent && g.MouseStationaryTimer > 1.0f) + { + DebugBreakButtonTooltip(false, "in ItemAdd()"); + if (IsKeyChordPressed(g.DebugBreakKeyChord)) + g.DebugBreakInLocateId = true; + } } void ImGui::DebugLocateItemResolveWithLastItem() { ImGuiContext& g = *GImGui; + + // [DEBUG] Debug break requested by user + if (g.DebugBreakInLocateId) + IM_DEBUG_BREAK(); + ImGuiLastItemData item_data = g.LastItemData; g.DebugLocateId = 0; ImDrawList* draw_list = GetForegroundDrawList(g.CurrentWindow); @@ -14732,6 +16659,12 @@ void ImGui::DebugLocateItemResolveWithLastItem() draw_list->AddLine(p1, p2, DEBUG_LOCATE_ITEM_COLOR); } +void ImGui::DebugStartItemPicker() +{ + ImGuiContext& g = *GImGui; + g.DebugItemPickerActive = true; +} + // [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack. void ImGui::UpdateDebugToolItemPicker() { @@ -14766,13 +16699,13 @@ void ImGui::UpdateDebugToolItemPicker() EndTooltip(); } -// [DEBUG] Stack Tool: update queries. Called by NewFrame() +// [DEBUG] ID Stack Tool: update queries. Called by NewFrame() void ImGui::UpdateDebugToolStackQueries() { ImGuiContext& g = *GImGui; - ImGuiStackTool* tool = &g.DebugStackTool; + ImGuiIDStackTool* tool = &g.DebugIDStackTool; - // Clear hook when stack tool is not visible + // Clear hook when id stack tool is not visible g.DebugHookIdInfo = 0; if (g.FrameCount != tool->LastActiveFrame + 1) return; @@ -14806,12 +16739,12 @@ void ImGui::UpdateDebugToolStackQueries() } } -// [DEBUG] Stack tool: hooks called by GetID() family functions +// [DEBUG] ID Stack tool: hooks called by GetID() family functions void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - ImGuiStackTool* tool = &g.DebugStackTool; + ImGuiIDStackTool* tool = &g.DebugIDStackTool; // Step 0: stack query // This assumes that the ID was computed with the current ID stack, which tends to be the case for our widget. @@ -14854,7 +16787,7 @@ void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* dat info->DataType = data_type; } -static int StackToolFormatLevelInfo(ImGuiStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size) +static int StackToolFormatLevelInfo(ImGuiIDStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size) { ImGuiStackLevelInfo* info = &tool->Results[n]; ImGuiWindow* window = (info->Desc[0] == 0 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL; @@ -14871,20 +16804,20 @@ static int StackToolFormatLevelInfo(ImGuiStackTool* tool, int n, bool format_for return ImFormatString(buf, buf_size, "???"); } -// Stack Tool: Display UI -void ImGui::ShowStackToolWindow(bool* p_open) +// ID Stack Tool: Display UI +void ImGui::ShowIDStackToolWindow(bool* p_open) { ImGuiContext& g = *GImGui; - if (!(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize)) + if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) == 0) SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 8.0f), ImGuiCond_FirstUseEver); - if (!Begin("Dear ImGui Stack Tool", p_open) || GetCurrentWindow()->BeginCount > 1) + if (!Begin("Dear ImGui ID Stack Tool", p_open) || GetCurrentWindow()->BeginCount > 1) { End(); return; } // Display hovered/active status - ImGuiStackTool* tool = &g.DebugStackTool; + ImGuiIDStackTool* tool = &g.DebugIDStackTool; const ImGuiID hovered_id = g.HoveredIdPreviousFrame; const ImGuiID active_id = g.ActiveId; #ifdef IMGUI_ENABLE_TEST_ENGINE @@ -14900,7 +16833,7 @@ void ImGui::ShowStackToolWindow(bool* p_open) Checkbox("Ctrl+C: copy path to clipboard", &tool->CopyToClipboardOnCtrlC); SameLine(); TextColored((time_since_copy >= 0.0f && time_since_copy < 0.75f && ImFmod(time_since_copy, 0.25f) < 0.25f * 0.5f) ? ImVec4(1.f, 1.f, 0.3f, 1.f) : ImVec4(), "*COPIED*"); - if (tool->CopyToClipboardOnCtrlC && IsKeyDown(ImGuiMod_Ctrl) && IsKeyPressed(ImGuiKey_C)) + if (tool->CopyToClipboardOnCtrlC && Shortcut(ImGuiMod_Ctrl | ImGuiKey_C, ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverFocused)) { tool->CopyToClipboardLastTime = (float)g.Time; char* p = g.TempBuffer.Data; @@ -14963,13 +16896,10 @@ void ImGui::DebugNodeWindowSettings(ImGuiWindowSettings*) {} void ImGui::DebugNodeWindowsList(ImVector*, const char*) {} void ImGui::DebugNodeViewport(ImGuiViewportP*) {} -void ImGui::DebugLog(const char*, ...) {} -void ImGui::DebugLogV(const char*, va_list) {} void ImGui::ShowDebugLogWindow(bool*) {} -void ImGui::ShowStackToolWindow(bool*) {} +void ImGui::ShowIDStackToolWindow(bool*) {} +void ImGui::DebugStartItemPicker() {} void ImGui::DebugHookIdInfo(ImGuiID, ImGuiDataType, const void*, const void*) {} -void ImGui::UpdateDebugToolItemPicker() {} -void ImGui::UpdateDebugToolStackQueries() {} #endif // #ifndef IMGUI_DISABLE_DEBUG_TOOLS diff --git a/bgfx/3rdparty/dear-imgui/imgui.h b/bgfx/3rdparty/dear-imgui/imgui.h index c7f53448..22f992fa 100644 --- a/bgfx/3rdparty/dear-imgui/imgui.h +++ b/bgfx/3rdparty/dear-imgui/imgui.h @@ -1,32 +1,35 @@ -// dear imgui, v1.89.9 +// dear imgui, v1.91.4 // (headers) // Help: -// - Read FAQ at http://dearimgui.com/faq -// - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase. +// - See links below. // - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that. -// Read imgui.cpp for details, links and comments. +// - Read top of imgui.cpp for more details, links and comments. +// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4. // Resources: -// - FAQ http://dearimgui.com/faq -// - Homepage https://github.com/ocornut/imgui -// - Releases & changelog https://github.com/ocornut/imgui/releases -// - Gallery https://github.com/ocornut/imgui/issues/6478 (please post your screenshots/video there!) -// - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there) -// - Getting Started https://github.com/ocornut/imgui/wiki/Getting-Started -// - Glossary https://github.com/ocornut/imgui/wiki/Glossary -// - Issues & support https://github.com/ocornut/imgui/issues -// - Tests & Automation https://github.com/ocornut/imgui_test_engine - -// Getting Started? -// - Read https://github.com/ocornut/imgui/wiki/Getting-Started -// - For first-time users having issues compiling/linking/running/loading fonts: -// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above. +// - FAQ ........................ https://dearimgui.com/faq (in repository as docs/FAQ.md) +// - Homepage ................... https://github.com/ocornut/imgui +// - Releases & changelog ....... https://github.com/ocornut/imgui/releases +// - Gallery .................... https://github.com/ocornut/imgui/issues?q=label%3Agallery (please post your screenshots/video there!) +// - Wiki ....................... https://github.com/ocornut/imgui/wiki (lots of good stuff there) +// - Getting Started https://github.com/ocornut/imgui/wiki/Getting-Started (how to integrate in an existing app by adding ~25 lines of code) +// - Third-party Extensions https://github.com/ocornut/imgui/wiki/Useful-Extensions (ImPlot & many more) +// - Bindings/Backends https://github.com/ocornut/imgui/wiki/Bindings (language bindings, backends for various tech/engines) +// - Glossary https://github.com/ocornut/imgui/wiki/Glossary +// - Debug Tools https://github.com/ocornut/imgui/wiki/Debug-Tools +// - Software using Dear ImGui https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui +// - Issues & support ........... https://github.com/ocornut/imgui/issues +// - Test Engine & Automation ... https://github.com/ocornut/imgui_test_engine (test suite, test engine to automate your apps) + +// For first-time users having issues compiling/linking/running/loading fonts: +// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above. +// Everything else should be asked in 'Issues'! We are building a database of cross-linked knowledge there. // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345') -#define IMGUI_VERSION "1.89.9" -#define IMGUI_VERSION_NUM 18990 +#define IMGUI_VERSION "1.91.4" +#define IMGUI_VERSION_NUM 19140 #define IMGUI_HAS_TABLE /* @@ -36,15 +39,17 @@ Index of this file: // [SECTION] Forward declarations and basic types // [SECTION] Dear ImGui end-user API functions // [SECTION] Flags & Enumerations -// [SECTION] Helpers: Memory allocations macros, ImVector<> +// [SECTION] Tables API flags and structures (ImGuiTableFlags, ImGuiTableColumnFlags, ImGuiTableRowFlags, ImGuiTableBgTarget, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs) +// [SECTION] Helpers: Debug log, Memory allocations macros, ImVector<> // [SECTION] ImGuiStyle // [SECTION] ImGuiIO -// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs) +// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload) // [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor) +// [SECTION] Multi-Select API flags and structures (ImGuiMultiSelectFlags, ImGuiMultiSelectIO, ImGuiSelectionRequest, ImGuiSelectionBasicStorage, ImGuiSelectionExternalStorage) // [SECTION] Drawing API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawFlags, ImDrawListFlags, ImDrawList, ImDrawData) // [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont) // [SECTION] Viewports (ImGuiViewportFlags, ImGuiViewport) -// [SECTION] Platform Dependent Interfaces (ImGuiPlatformImeData) +// [SECTION] ImGuiPlatformIO + other Platform Dependent Interfaces (ImGuiPlatformImeData) // [SECTION] Obsolete functions and types */ @@ -52,7 +57,7 @@ Index of this file: #pragma once // Configuration file with compile-time options -// (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system') +// (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system) #ifdef IMGUI_USER_CONFIG #include IMGUI_USER_CONFIG #endif @@ -72,7 +77,7 @@ Index of this file: // Define attributes of all API symbols declarations (e.g. for DLL under Windows) // IMGUI_API is used for core imgui functions, IMGUI_IMPL_API is used for the default backends files (imgui_impl_xxx.h) -// Using dear imgui via a shared library is not recommended, because we don't guarantee backward nor forward ABI compatibility (also function call overhead, as dear imgui is a call-heavy API) +// Using dear imgui via a shared library is not recommended: we don't guarantee backward nor forward ABI compatibility + this is a call-heavy library and function call overhead adds up. #ifndef IMGUI_API #define IMGUI_API #endif @@ -87,10 +92,13 @@ Index of this file: #endif #define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR) / sizeof(*(_ARR)))) // Size of a static C-style array. Don't use on pointers! #define IM_UNUSED(_VAR) ((void)(_VAR)) // Used to silence "unused variable warnings". Often useful as asserts may be stripped out from final builds. -#define IM_OFFSETOF(_TYPE,_MEMBER) offsetof(_TYPE, _MEMBER) // Offset of _MEMBER within _TYPE. Standardized as offsetof() in C++11 + +// Check that version and structures layouts are matching between compiled imgui code and caller. Read comments above DebugCheckVersionAndDataLayout() for details. #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) // Helper Macros - IM_FMTARGS, IM_FMTLIST: Apply printf-style warnings to our formatting functions. +// (MSVC provides an equivalent mechanism via SAL Annotations but it would require the macros in a different +// location. e.g. #include + void myprintf(_Printf_format_string_ const char* format, ...)) #if !defined(IMGUI_USE_STB_SPRINTF) && defined(__MINGW32__) && !defined(__clang__) #define IM_FMTARGS(FMT) __attribute__((format(gnu_printf, FMT, FMT+1))) #define IM_FMTLIST(FMT) __attribute__((format(gnu_printf, FMT, 0))) @@ -123,8 +131,10 @@ Index of this file: #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx' #pragma clang diagnostic ignored "-Wold-style-cast" +#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" #pragma clang diagnostic ignored "-Wreserved-identifier" // warning: identifier '_Xxx' is reserved because it starts with '_' followed by a capital letter +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access #elif defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind @@ -135,6 +145,17 @@ Index of this file: // [SECTION] Forward declarations and basic types //----------------------------------------------------------------------------- +// Scalar data types +typedef unsigned int ImGuiID;// A unique ID used by widgets (typically the result of hashing a stack of string) +typedef signed char ImS8; // 8-bit signed integer +typedef unsigned char ImU8; // 8-bit unsigned integer +typedef signed short ImS16; // 16-bit signed integer +typedef unsigned short ImU16; // 16-bit unsigned integer +typedef signed int ImS32; // 32-bit signed integer == int +typedef unsigned int ImU32; // 32-bit unsigned integer (often used to store packed colors) +typedef signed long long ImS64; // 64-bit signed integer +typedef unsigned long long ImU64; // 64-bit unsigned integer + // Forward declarations struct ImDrawChannel; // Temporary storage to output draw commands out of order, used by ImDrawListSplitter and ImDrawList::ChannelsSplit() struct ImDrawCmd; // A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call, unless it is a callback) @@ -151,15 +172,21 @@ struct ImFontGlyph; // A single font glyph (code point + coordin struct ImFontGlyphRangesBuilder; // Helper to build glyph ranges from text/string data struct ImColor; // Helper functions to create a color that can be converted to either u32 or float4 (*OBSOLETE* please avoid using) struct ImGuiContext; // Dear ImGui context (opaque structure, unless including imgui_internal.h) -struct ImGuiIO; // Main configuration and I/O between your application and ImGui +struct ImGuiIO; // Main configuration and I/O between your application and ImGui (also see: ImGuiPlatformIO) struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use) struct ImGuiKeyData; // Storage for ImGuiIO and IsKeyDown(), IsKeyPressed() etc functions. struct ImGuiListClipper; // Helper to manually clip large list of items +struct ImGuiMultiSelectIO; // Structure to interact with a BeginMultiSelect()/EndMultiSelect() block struct ImGuiOnceUponAFrame; // Helper for running a block of code not more than once a frame struct ImGuiPayload; // User data payload for drag and drop operations -struct ImGuiPlatformImeData; // Platform IME data for io.SetPlatformImeDataFn() function. +struct ImGuiPlatformIO; // Interface between platform/renderer backends and ImGui (e.g. Clipboard, IME hooks). Extends ImGuiIO. In docking branch, this gets extended to support multi-viewports. +struct ImGuiPlatformImeData; // Platform IME data for io.PlatformSetImeDataFn() function. +struct ImGuiSelectionBasicStorage; // Optional helper to store multi-selection state + apply multi-selection requests. +struct ImGuiSelectionExternalStorage;//Optional helper to apply multi-selection requests to existing randomly accessible storage. +struct ImGuiSelectionRequest; // A selection request (stored in ImGuiMultiSelectIO) struct ImGuiSizeCallbackData; // Callback data when using SetNextWindowSizeConstraints() (rare/advanced use) -struct ImGuiStorage; // Helper for key->value storage +struct ImGuiStorage; // Helper for key->value storage (container sorted by key) +struct ImGuiStoragePair; // Helper for key->value storage (pair) struct ImGuiStyle; // Runtime data for styling/colors struct ImGuiTableSortSpecs; // Sorting specifications for a table (often handling sort specs for a single column, occasionally more) struct ImGuiTableColumnSortSpecs; // Sorting specification for one column of a table @@ -170,38 +197,44 @@ struct ImGuiViewport; // A Platform Window (always only one in 'ma // Enumerations // - We don't use strongly typed enums much because they add constraints (can't extend in private code, can't store typed in bit fields, extra casting on iteration) // - Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists! -// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. -// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. +// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. +// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments. +// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments. +enum ImGuiDir : int; // -> enum ImGuiDir // Enum: A cardinal direction (Left, Right, Up, Down) enum ImGuiKey : int; // -> enum ImGuiKey // Enum: A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value) enum ImGuiMouseSource : int; // -> enum ImGuiMouseSource // Enum; A mouse input source identifier (Mouse, TouchScreen, Pen) +enum ImGuiSortDirection : ImU8; // -> enum ImGuiSortDirection // Enum: A sorting direction (ascending or descending) typedef int ImGuiCol; // -> enum ImGuiCol_ // Enum: A color identifier for styling typedef int ImGuiCond; // -> enum ImGuiCond_ // Enum: A condition for many Set*() functions typedef int ImGuiDataType; // -> enum ImGuiDataType_ // Enum: A primary data type -typedef int ImGuiDir; // -> enum ImGuiDir_ // Enum: A cardinal direction typedef int ImGuiMouseButton; // -> enum ImGuiMouseButton_ // Enum: A mouse button identifier (0=left, 1=right, 2=middle) typedef int ImGuiMouseCursor; // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor shape -typedef int ImGuiSortDirection; // -> enum ImGuiSortDirection_ // Enum: A sorting direction (ascending or descending) typedef int ImGuiStyleVar; // -> enum ImGuiStyleVar_ // Enum: A variable identifier for styling typedef int ImGuiTableBgTarget; // -> enum ImGuiTableBgTarget_ // Enum: A color target for TableSetBgColor() -// Flags (declared as int for compatibility with old C++, to allow using as flags without overhead, and to not pollute the top of this file) +// Flags (declared as int to allow using as flags without overhead, and to not pollute the top of this file) // - Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists! -// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. -// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. +// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. +// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments. +// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments. typedef int ImDrawFlags; // -> enum ImDrawFlags_ // Flags: for ImDrawList functions typedef int ImDrawListFlags; // -> enum ImDrawListFlags_ // Flags: for ImDrawList instance typedef int ImFontAtlasFlags; // -> enum ImFontAtlasFlags_ // Flags: for ImFontAtlas build typedef int ImGuiBackendFlags; // -> enum ImGuiBackendFlags_ // Flags: for io.BackendFlags typedef int ImGuiButtonFlags; // -> enum ImGuiButtonFlags_ // Flags: for InvisibleButton() +typedef int ImGuiChildFlags; // -> enum ImGuiChildFlags_ // Flags: for BeginChild() typedef int ImGuiColorEditFlags; // -> enum ImGuiColorEditFlags_ // Flags: for ColorEdit4(), ColorPicker4() etc. typedef int ImGuiConfigFlags; // -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags typedef int ImGuiComboFlags; // -> enum ImGuiComboFlags_ // Flags: for BeginCombo() typedef int ImGuiDragDropFlags; // -> enum ImGuiDragDropFlags_ // Flags: for BeginDragDropSource(), AcceptDragDropPayload() typedef int ImGuiFocusedFlags; // -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused() typedef int ImGuiHoveredFlags; // -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc. +typedef int ImGuiInputFlags; // -> enum ImGuiInputFlags_ // Flags: for Shortcut(), SetNextItemShortcut() typedef int ImGuiInputTextFlags; // -> enum ImGuiInputTextFlags_ // Flags: for InputText(), InputTextMultiline() -typedef int ImGuiKeyChord; // -> ImGuiKey | ImGuiMod_XXX // Flags: for storage only for now: an ImGuiKey optionally OR-ed with one or more ImGuiMod_XXX values. +typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag(), shared by all items +typedef int ImGuiKeyChord; // -> ImGuiKey | ImGuiMod_XXX // Flags: for IsKeyChordPressed(), Shortcut() etc. an ImGuiKey optionally OR-ed with one or more ImGuiMod_XXX values. typedef int ImGuiPopupFlags; // -> enum ImGuiPopupFlags_ // Flags: for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() +typedef int ImGuiMultiSelectFlags; // -> enum ImGuiMultiSelectFlags_// Flags: for BeginMultiSelect() typedef int ImGuiSelectableFlags; // -> enum ImGuiSelectableFlags_ // Flags: for Selectable() typedef int ImGuiSliderFlags; // -> enum ImGuiSliderFlags_ // Flags: for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc. typedef int ImGuiTabBarFlags; // -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar() @@ -216,8 +249,10 @@ typedef int ImGuiWindowFlags; // -> enum ImGuiWindowFlags_ // Flags: f // ImTexture: user data for renderer backend to identify a texture [Compile-time configurable type] // - To use something else than an opaque void* pointer: override with e.g. '#define ImTextureID MyTextureType*' in your imconfig.h file. // - This can be whatever to you want it to be! read the FAQ about ImTextureID for details. +// - You can make this a structure with various constructors if you need. You will have to implement ==/!= operators. +// - (note: before v1.91.4 (2024/10/08) the default type for ImTextureID was void*. Use intermediary intptr_t cast and read FAQ if you have casting warnings) #ifndef ImTextureID -typedef void* ImTextureID; // Default: store a pointer or an integer fitting in a pointer (most renderer backends are ok with that) +typedef ImU64 ImTextureID; // Default: store a pointer or an integer fitting in a pointer (most renderer backends are ok with that) #endif // ImDrawIdx: vertex index. [Compile-time configurable type] @@ -227,27 +262,21 @@ typedef void* ImTextureID; // Default: store a pointer or an integer fi typedef unsigned short ImDrawIdx; // Default: 16-bit (for maximum compatibility with renderer backends) #endif -// Scalar data types -typedef unsigned int ImGuiID;// A unique ID used by widgets (typically the result of hashing a stack of string) -typedef signed char ImS8; // 8-bit signed integer -typedef unsigned char ImU8; // 8-bit unsigned integer -typedef signed short ImS16; // 16-bit signed integer -typedef unsigned short ImU16; // 16-bit unsigned integer -typedef signed int ImS32; // 32-bit signed integer == int -typedef unsigned int ImU32; // 32-bit unsigned integer (often used to store packed colors) -typedef signed long long ImS64; // 64-bit signed integer -typedef unsigned long long ImU64; // 64-bit unsigned integer - // Character types // (we generally use UTF-8 encoded string in the API. This is storage specifically for a decoded character used for keyboard input and display) -typedef unsigned short ImWchar16; // A single decoded U16 character/code point. We encode them as multi bytes UTF-8 when used in strings. typedef unsigned int ImWchar32; // A single decoded U32 character/code point. We encode them as multi bytes UTF-8 when used in strings. +typedef unsigned short ImWchar16; // A single decoded U16 character/code point. We encode them as multi bytes UTF-8 when used in strings. #ifdef IMGUI_USE_WCHAR32 // ImWchar [configurable type: override in imconfig.h with '#define IMGUI_USE_WCHAR32' to support Unicode planes 1-16] typedef ImWchar32 ImWchar; #else typedef ImWchar16 ImWchar; #endif +// Multi-Selection item index or identifier when using BeginMultiSelect() +// - Used by SetNextItemSelectionUserData() + and inside ImGuiMultiSelectIO structure. +// - Most users are likely to use this store an item INDEX but this may be used to store a POINTER/ID as well. Read comments near ImGuiMultiSelectIO for details. +typedef ImS64 ImGuiSelectionUserData; + // Callback and functions types typedef int (*ImGuiInputTextCallback)(ImGuiInputTextCallbackData* data); // Callback function for ImGui::InputText() typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data); // Callback function for ImGui::SetNextWindowSizeConstraints() @@ -255,7 +284,8 @@ typedef void* (*ImGuiMemAllocFunc)(size_t sz, void* user_data); typedef void (*ImGuiMemFreeFunc)(void* ptr, void* user_data); // Function signature for ImGui::SetAllocatorFunctions() // ImVec2: 2D vector used to store positions, sizes etc. [Compile-time configurable type] -// This is a frequently used type in the API. Consider using IM_VEC2_CLASS_EXTRA to create implicit cast from/to our preferred type. +// - This is a frequently used type in the API. Consider using IM_VEC2_CLASS_EXTRA to create implicit cast from/to our preferred type. +// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4. IM_MSVC_RUNTIME_CHECKS_OFF struct ImVec2 { @@ -298,8 +328,9 @@ namespace ImGui IMGUI_API void SetCurrentContext(ImGuiContext* ctx); // Main - IMGUI_API ImGuiIO& GetIO(); // access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags) - IMGUI_API ImGuiStyle& GetStyle(); // access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame! + IMGUI_API ImGuiIO& GetIO(); // access the ImGuiIO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags) + IMGUI_API ImGuiPlatformIO& GetPlatformIO(); // access the ImGuiPlatformIO structure (mostly hooks/functions to connect to platform/renderer and OS Clipboard, IME etc.) + IMGUI_API ImGuiStyle& GetStyle(); // access the Style structure (colors, sizes). Always use PushStyleColor(), PushStyleVar() to modify style mid-frame! IMGUI_API void NewFrame(); // start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame(). IMGUI_API void EndFrame(); // ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all! IMGUI_API void Render(); // ends the Dear ImGui frame, finalize the draw data. You can then get call GetDrawData(). @@ -309,7 +340,7 @@ namespace ImGui IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application! IMGUI_API void ShowMetricsWindow(bool* p_open = NULL); // create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc. IMGUI_API void ShowDebugLogWindow(bool* p_open = NULL); // create Debug Log window. display a simplified log of important dear imgui events. - IMGUI_API void ShowStackToolWindow(bool* p_open = NULL); // create Stack Tool window. hover items with mouse to query information about the source of their unique ID. + IMGUI_API void ShowIDStackToolWindow(bool* p_open = NULL); // create Stack Tool window. hover items with mouse to query information about the source of their unique ID. IMGUI_API void ShowAboutWindow(bool* p_open = NULL); // create About window. display Dear ImGui version, credits and build/system information. IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style) IMGUI_API bool ShowStyleSelector(const char* label); // add style selector block (not a window), essentially a combo listing the default styles. @@ -330,23 +361,33 @@ namespace ImGui // Some information such as 'flags' or 'p_open' will only be considered by the first call to Begin(). // - Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting // anything to the window. Always call a matching End() for each Begin() call, regardless of its return value! - // [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu, - // BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function - // returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.] + // [Important: due to legacy reason, Begin/End and BeginChild/EndChild are inconsistent with all other functions + // such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding + // BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.] // - Note that the bottom of window stack always contains a window called "Debug". IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); IMGUI_API void End(); // Child Windows // - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child. - // - For each independent axis of 'size': ==0.0f: use remaining host window size / >0.0f: fixed size / <0.0f: use remaining window size minus abs(size) / Each axis can use a different mode, e.g. ImVec2(0,400). - // - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window. - // Always call a matching EndChild() for each BeginChild() call, regardless of its return value. - // [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu, - // BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function - // returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.] - IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0, 0), bool border = false, ImGuiWindowFlags flags = 0); - IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0, 0), bool border = false, ImGuiWindowFlags flags = 0); + // - Before 1.90 (November 2023), the "ImGuiChildFlags child_flags = 0" parameter was "bool border = false". + // This API is backward compatible with old code, as we guarantee that ImGuiChildFlags_Borders == true. + // Consider updating your old code: + // BeginChild("Name", size, false) -> Begin("Name", size, 0); or Begin("Name", size, ImGuiChildFlags_None); + // BeginChild("Name", size, true) -> Begin("Name", size, ImGuiChildFlags_Borders); + // - Manual sizing (each axis can use a different setting e.g. ImVec2(0.0f, 400.0f)): + // == 0.0f: use remaining parent window size for this axis. + // > 0.0f: use specified size for this axis. + // < 0.0f: right/bottom-align to specified distance from available content boundaries. + // - Specifying ImGuiChildFlags_AutoResizeX or ImGuiChildFlags_AutoResizeY makes the sizing automatic based on child contents. + // Combining both ImGuiChildFlags_AutoResizeX _and_ ImGuiChildFlags_AutoResizeY defeats purpose of a scrolling region and is NOT recommended. + // - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting + // anything to the window. Always call a matching EndChild() for each BeginChild() call, regardless of its return value. + // [Important: due to legacy reason, Begin/End and BeginChild/EndChild are inconsistent with all other functions + // such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding + // BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.] + IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0, 0), ImGuiChildFlags child_flags = 0, ImGuiWindowFlags window_flags = 0); + IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0, 0), ImGuiChildFlags child_flags = 0, ImGuiWindowFlags window_flags = 0); IMGUI_API void EndChild(); // Windows Utilities @@ -354,18 +395,18 @@ namespace ImGui IMGUI_API bool IsWindowAppearing(); IMGUI_API bool IsWindowCollapsed(); IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0); // is current window focused? or its root/child, depending on flags. see flags for options. - IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0); // is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ! + IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0); // is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See ImGuiHoveredFlags_ for options. IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app, you should not use this function! Use the 'io.WantCaptureMouse' boolean for that! Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details. IMGUI_API ImDrawList* GetWindowDrawList(); // get draw list associated to the current window, to append your own drawing primitives - IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (note: it is unlikely you need to use this. Consider using current layout pos instead, GetScreenCursorPos()) - IMGUI_API ImVec2 GetWindowSize(); // get current window size (note: it is unlikely you need to use this. Consider using GetScreenCursorPos() and e.g. GetContentRegionAvail() instead) - IMGUI_API float GetWindowWidth(); // get current window width (shortcut for GetWindowSize().x) - IMGUI_API float GetWindowHeight(); // get current window height (shortcut for GetWindowSize().y) + IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead) + IMGUI_API ImVec2 GetWindowSize(); // get current window size (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead) + IMGUI_API float GetWindowWidth(); // get current window width (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().x. + IMGUI_API float GetWindowHeight(); // get current window height (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().y. // Window manipulation // - Prefer using SetNextXXX functions (before Begin) rather that SetXXX functions (after Begin). IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2(0, 0)); // set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc. IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin() - IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down. Use callback to apply non-trivial programmatic constraints. + IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use 0.0f or FLT_MAX if you don't want limits. Use -1 for both min and max of same axis to preserve current size (which itself is a constraint). Use callback to apply non-trivial programmatic constraints. IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before Begin() IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin() IMGUI_API void SetNextWindowFocus(); // set next window to be focused / top-most. call before Begin() @@ -381,14 +422,6 @@ namespace ImGui IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond = 0); // set named window collapsed state IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / top-most. use NULL to remove focus. - // Content region - // - Retrieve available space from a given point. GetContentRegionAvail() is frequently useful. - // - Those functions are bound to be redesigned (they are confusing, incomplete and the Min/Max return values are in local window coordinates which increases confusion) - IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos() - IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates - IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min for the full window (roughly (0,0)-Scroll), in window coordinates - IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be overridden with SetNextWindowContentSize(), in window coordinates - // Windows Scrolling // - Any change of Scroll will be applied at the beginning of next frame in the first call to Begin(). // - You may instead use SetNextWindowScroll() prior to calling Begin() to avoid this delay, as an alternative to using SetScrollX()/SetScrollY(). @@ -409,13 +442,13 @@ namespace ImGui IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col); // modify a style color. always use this if you modify the style after NewFrame(). IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4& col); IMGUI_API void PopStyleColor(int count = 1); - IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); // modify a style float variable. always use this if you modify the style after NewFrame(). - IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); // modify a style ImVec2 variable. always use this if you modify the style after NewFrame(). + IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); // modify a style float variable. always use this if you modify the style after NewFrame()! + IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); // modify a style ImVec2 variable. " + IMGUI_API void PushStyleVarX(ImGuiStyleVar idx, float val_x); // modify X component of a style ImVec2 variable. " + IMGUI_API void PushStyleVarY(ImGuiStyleVar idx, float val_y); // modify Y component of a style ImVec2 variable. " IMGUI_API void PopStyleVar(int count = 1); - IMGUI_API void PushTabStop(bool tab_stop); // == tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets - IMGUI_API void PopTabStop(); - IMGUI_API void PushButtonRepeat(bool repeat); // in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame. - IMGUI_API void PopButtonRepeat(); + IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); // modify specified shared item flag, e.g. PushItemFlag(ImGuiItemFlags_NoTabStop, true) + IMGUI_API void PopItemFlag(); // Parameters stacks (current window) IMGUI_API void PushItemWidth(float item_width); // push width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side). @@ -429,19 +462,34 @@ namespace ImGui // - Use the ShowStyleEditor() function to interactively see/edit the colors. IMGUI_API ImFont* GetFont(); // get current font IMGUI_API float GetFontSize(); // get current font size (= height in pixels) of current font with current scale applied - IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API + IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a white pixel, useful to draw custom shapes via the ImDrawList API IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f); // retrieve given style color with style alpha applied and optional extra alpha multiplier, packed as a 32-bit value suitable for ImDrawList IMGUI_API ImU32 GetColorU32(const ImVec4& col); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList - IMGUI_API ImU32 GetColorU32(ImU32 col); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList + IMGUI_API ImU32 GetColorU32(ImU32 col, float alpha_mul = 1.0f); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList IMGUI_API const ImVec4& GetStyleColorVec4(ImGuiCol idx); // retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwise use GetColorU32() to get style color with style alpha baked in. - // Cursor / Layout + // Layout cursor positioning // - By "cursor" we mean the current output position. // - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down. // - You can call SameLine() between widgets to undo the last carriage return and output at the right of the preceding widget. + // - YOU CAN DO 99% OF WHAT YOU NEED WITH ONLY GetCursorScreenPos() and GetContentRegionAvail(). // - Attention! We currently have inconsistencies between window-local and absolute positions we will aim to fix with future API: - // Window-local coordinates: SameLine(), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), GetContentRegionMax(), GetWindowContentRegion*(), PushTextWrapPos() - // Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. + // - Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. -> this is the preferred way forward. + // - Window-local coordinates: SameLine(offset), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), PushTextWrapPos() + // - Window-local coordinates: GetContentRegionMax(), GetWindowContentRegionMin(), GetWindowContentRegionMax() --> all obsoleted. YOU DON'T NEED THEM. + // - GetCursorScreenPos() = GetCursorPos() + GetWindowPos(). GetWindowPos() is almost only ever useful to convert from window-local to absolute coordinates. Try not to use it. + IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND (prefer using this rather than GetCursorPos(), also more useful to work with ImDrawList API). + IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND. + IMGUI_API ImVec2 GetContentRegionAvail(); // available space from current position. THIS IS YOUR BEST FRIEND. + IMGUI_API ImVec2 GetCursorPos(); // [window-local] cursor position in window-local coordinates. This is not your best friend. + IMGUI_API float GetCursorPosX(); // [window-local] " + IMGUI_API float GetCursorPosY(); // [window-local] " + IMGUI_API void SetCursorPos(const ImVec2& local_pos); // [window-local] " + IMGUI_API void SetCursorPosX(float local_x); // [window-local] " + IMGUI_API void SetCursorPosY(float local_y); // [window-local] " + IMGUI_API ImVec2 GetCursorStartPos(); // [window-local] initial cursor position, in window-local coordinates. Call GetCursorScreenPos() after Begin() to get the absolute coordinates version. + + // Other layout functions IMGUI_API void Separator(); // separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator. IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f); // call between widgets or groups to layout them horizontally. X position given in window coordinates. IMGUI_API void NewLine(); // undo a SameLine() or force a new line when in a horizontal-layout context. @@ -451,15 +499,6 @@ namespace ImGui IMGUI_API void Unindent(float indent_w = 0.0f); // move content position back to the left, by indent_w, or style.IndentSpacing if indent_w <= 0 IMGUI_API void BeginGroup(); // lock horizontal starting position IMGUI_API void EndGroup(); // unlock horizontal starting position + capture the whole group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) - IMGUI_API ImVec2 GetCursorPos(); // cursor position in window coordinates (relative to window position) - IMGUI_API float GetCursorPosX(); // (some functions are using window-relative coordinates, such as: GetCursorPos, GetCursorStartPos, GetContentRegionMax, GetWindowContentRegion* etc. - IMGUI_API float GetCursorPosY(); // other functions such as GetCursorScreenPos or everything in ImDrawList:: - IMGUI_API void SetCursorPos(const ImVec2& local_pos); // are using the main, absolute coordinate system. - IMGUI_API void SetCursorPosX(float local_x); // GetWindowPos() + GetCursorPos() == GetCursorScreenPos() etc.) - IMGUI_API void SetCursorPosY(float local_y); // - IMGUI_API ImVec2 GetCursorStartPos(); // initial cursor position in window coordinates - IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position in absolute coordinates (useful to work with ImDrawList API). generally top-left == GetMainViewport()->Pos == (0,0) in single viewport mode, and bottom-right == GetMainViewport()->Pos+Size == io.DisplaySize in single-viewport mode. - IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position in absolute coordinates IMGUI_API void AlignTextToFramePadding(); // vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item) IMGUI_API float GetTextLineHeight(); // ~ FontSize IMGUI_API float GetTextLineHeightWithSpacing(); // ~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text) @@ -485,6 +524,7 @@ namespace ImGui IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself IMGUI_API ImGuiID GetID(const char* str_id_begin, const char* str_id_end); IMGUI_API ImGuiID GetID(const void* ptr_id); + IMGUI_API ImGuiID GetID(int int_id); // Widgets: Text IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text. @@ -506,7 +546,7 @@ namespace ImGui // - Most widgets return true when the value has been changed or when pressed/selected // - You may also use one of the many IsItemXXX functions (e.g. IsItemActive, IsItemHovered, etc.) to query widget state. IMGUI_API bool Button(const char* label, const ImVec2& size = ImVec2(0, 0)); // button - IMGUI_API bool SmallButton(const char* label); // button with FramePadding=(0,0) to easily embed within text + IMGUI_API bool SmallButton(const char* label); // button with (FramePadding.y == 0) to easily embed within text IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size, ImGuiButtonFlags flags = 0); // flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.) IMGUI_API bool ArrowButton(const char* str_id, ImGuiDir dir); // square button with an arrow shape IMGUI_API bool Checkbox(const char* label, bool* v); @@ -516,11 +556,15 @@ namespace ImGui IMGUI_API bool RadioButton(const char* label, int* v, int v_button); // shortcut to handle the above pattern when value is an integer IMGUI_API void ProgressBar(float fraction, const ImVec2& size_arg = ImVec2(-FLT_MIN, 0), const char* overlay = NULL); IMGUI_API void Bullet(); // draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses + IMGUI_API bool TextLink(const char* label); // hyperlink text button, return true when clicked + IMGUI_API void TextLinkOpenURL(const char* label, const char* url = NULL); // hyperlink text button, automatically open file/url when clicked // Widgets: Images // - Read about ImTextureID here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples - IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& tint_col = ImVec4(1, 1, 1, 1), const ImVec4& border_col = ImVec4(0, 0, 0, 0)); - IMGUI_API bool ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); + // - 'uv0' and 'uv1' are texture coordinates. Read about them from the same link above. + // - Note that Image() may add +2.0f to provided size if a border is visible, ImageButton() adds style.FramePadding*2.0f to provided size. + IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& tint_col = ImVec4(1, 1, 1, 1), const ImVec4& border_col = ImVec4(0, 0, 0, 0)); + IMGUI_API bool ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // Widgets: Combo Box (Dropdown) // - The BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() items. @@ -529,7 +573,7 @@ namespace ImGui IMGUI_API void EndCombo(); // only call EndCombo() if BeginCombo() returns true! IMGUI_API bool Combo(const char* label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1); IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1); // Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0" - IMGUI_API bool Combo(const char* label, int* current_item, bool(*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_max_height_in_items = -1); + IMGUI_API bool Combo(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int popup_max_height_in_items = -1); // Widgets: Drag Sliders // - CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped by default and can go off-bounds. Use ImGuiSliderFlags_AlwaysClamp to always clamp. @@ -537,7 +581,7 @@ namespace ImGui // the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x // - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc. // - Format string may also be set to NULL or use the default format ("%f" or "%d"). - // - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision). + // - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For keyboard/gamepad navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision). // - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits if ImGuiSliderFlags_AlwaysClamp is not used. // - Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum. // - We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them. @@ -617,13 +661,14 @@ namespace ImGui IMGUI_API bool TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_FMTARGS(3); IMGUI_API bool TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); IMGUI_API bool TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); - IMGUI_API void TreePush(const char* str_id); // ~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired. + IMGUI_API void TreePush(const char* str_id); // ~ Indent()+PushID(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired. IMGUI_API void TreePush(const void* ptr_id); // " - IMGUI_API void TreePop(); // ~ Unindent()+PopId() + IMGUI_API void TreePop(); // ~ Unindent()+PopID() IMGUI_API float GetTreeNodeToLabelSpacing(); // horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop(). IMGUI_API bool CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFlags flags = 0); // when 'p_visible != NULL': if '*p_visible==true' display an additional small close button on upper right of the header which will set the bool to false when clicked, if '*p_visible==false' don't display the header. IMGUI_API void SetNextItemOpen(bool is_open, ImGuiCond cond = 0); // set next TreeNode/CollapsingHeader open state. + IMGUI_API void SetNextItemStorageID(ImGuiID storage_id); // set id to use for open/close storage (default to same as item id). // Widgets: Selectables // - A selectable highlights when hovered, and can display another color when selected. @@ -631,23 +676,35 @@ namespace ImGui IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // "bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // "bool* p_selected" point to the selection state (read-write), as a convenient helper. + // Multi-selection system for Selectable(), Checkbox(), TreeNode() functions [BETA] + // - This enables standard multi-selection/range-selection idioms (CTRL+Mouse/Keyboard, SHIFT+Mouse/Keyboard, etc.) in a way that also allow a clipper to be used. + // - ImGuiSelectionUserData is often used to store your item index within the current view (but may store something else). + // - Read comments near ImGuiMultiSelectIO for instructions/details and see 'Demo->Widgets->Selection State & Multi-Select' for demo. + // - TreeNode() is technically supported but... using this correctly is more complicated. You need some sort of linear/random access to your tree, + // which is suited to advanced trees setups already implementing filters and clipper. We will work simplifying the current demo. + // - 'selection_size' and 'items_count' parameters are optional and used by a few features. If they are costly for you to compute, you may avoid them. + IMGUI_API ImGuiMultiSelectIO* BeginMultiSelect(ImGuiMultiSelectFlags flags, int selection_size = -1, int items_count = -1); + IMGUI_API ImGuiMultiSelectIO* EndMultiSelect(); + IMGUI_API void SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data); + IMGUI_API bool IsItemToggledSelection(); // Was the last item selection state toggled? Useful if you need the per-item information _before_ reaching EndMultiSelect(). We only returns toggle _event_ in order to handle clipping correctly. + // Widgets: List Boxes - // - This is essentially a thin wrapper to using BeginChild/EndChild with some stylistic changes. - // - The BeginListBox()/EndListBox() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() or any items. + // - This is essentially a thin wrapper to using BeginChild/EndChild with the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label. + // - You can submit contents and manage your selection state however you want it, by creating e.g. Selectable() or any other items. // - The simplified/old ListBox() api are helpers over BeginListBox()/EndListBox() which are kept available for convenience purpose. This is analoguous to how Combos are created. // - Choose frame width: size.x > 0.0f: custom / size.x < 0.0f or -FLT_MIN: right-align / size.x = 0.0f (default): use current ItemWidth // - Choose frame height: size.y > 0.0f: custom / size.y < 0.0f or -FLT_MIN: bottom-align / size.y = 0.0f (default): arbitrary default height which can fit ~7 items IMGUI_API bool BeginListBox(const char* label, const ImVec2& size = ImVec2(0, 0)); // open a framed scrolling region IMGUI_API void EndListBox(); // only call EndListBox() if BeginListBox() returned true! IMGUI_API bool ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_in_items = -1); - IMGUI_API bool ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1); + IMGUI_API bool ListBox(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int height_in_items = -1); // Widgets: Data Plotting // - Consider using ImPlot (https://github.com/epezent/implot) which is much better! IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float)); IMGUI_API void PlotLines(const char* label, float(*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0)); IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float)); - IMGUI_API void PlotHistogram(const char* label, float(*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0)); + IMGUI_API void PlotHistogram(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0)); // Widgets: Value() Helpers. // - Those are merely shortcut to calling Text() with a format string. Output single value in "name: value" format (tip: freely declare more in your code to handle your types. you can add functions to the ImGui namespace) @@ -672,18 +729,19 @@ namespace ImGui // Tooltips // - Tooltips are windows following the mouse. They do not take focus away. - // - A tooltip window can contain items of any types. SetTooltip() is a shortcut for the 'if (BeginTooltip()) { Text(...); EndTooltip(); }' idiom. + // - A tooltip window can contain items of any types. + // - SetTooltip() is more or less a shortcut for the 'if (BeginTooltip()) { Text(...); EndTooltip(); }' idiom (with a subtlety that it discard any previously submitted tooltip) IMGUI_API bool BeginTooltip(); // begin/append a tooltip window. IMGUI_API void EndTooltip(); // only call EndTooltip() if BeginTooltip()/BeginItemTooltip() returns true! IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip. Often used after a ImGui::IsItemHovered() check. Override any previous call to SetTooltip(). IMGUI_API void SetTooltipV(const char* fmt, va_list args) IM_FMTLIST(1); // Tooltips: helpers for showing a tooltip when hovering an item - // - BeginItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_Tooltip) && BeginTooltip())' idiom. - // - SetItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_Tooltip)) { SetTooltip(...); }' idiom. - // - Where 'ImGuiHoveredFlags_Tooltip' itself is a shortcut to use 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' depending on active input type. For mouse it defaults to 'ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort'. + // - BeginItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_ForTooltip) && BeginTooltip())' idiom. + // - SetItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_ForTooltip)) { SetTooltip(...); }' idiom. + // - Where 'ImGuiHoveredFlags_ForTooltip' itself is a shortcut to use 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' depending on active input type. For mouse it defaults to 'ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort'. IMGUI_API bool BeginItemTooltip(); // begin/append a tooltip window if preceding item was hovered. - IMGUI_API void SetItemTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip if preceeding item was hovered. override any previous call to SetTooltip(). + IMGUI_API void SetItemTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip if preceding item was hovered. override any previous call to SetTooltip(). IMGUI_API void SetItemTooltipV(const char* fmt, va_list args) IM_FMTLIST(1); // Popups, Modals @@ -694,9 +752,7 @@ namespace ImGui // - You can bypass the hovering restriction by using ImGuiHoveredFlags_AllowWhenBlockedByPopup when calling IsItemHovered() or IsWindowHovered(). // - IMPORTANT: Popup identifiers are relative to the current ID stack, so OpenPopup and BeginPopup generally needs to be at the same level of the stack. // This is sometimes leading to confusing mistakes. May rework this in the future. - - // Popups: begin/end functions - // - BeginPopup(): query popup state, if open start appending into the window. Call EndPopup() afterwards. ImGuiWindowFlags are forwarded to the window. + // - BeginPopup(): query popup state, if open start appending into the window. Call EndPopup() afterwards if returned true. ImGuiWindowFlags are forwarded to the window. // - BeginPopupModal(): block every interaction behind the window, cannot be closed by user, add a dimming background, has a title bar. IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0); // return true if the popup is open, and you can start outputting to it. IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // return true if the modal is open, and you can start outputting to it. @@ -746,14 +802,12 @@ namespace ImGui // TableNextColumn() will automatically wrap-around into the next row if needed. // - IMPORTANT: Comparatively to the old Columns() API, we need to call TableNextColumn() for the first column! // - Summary of possible call flow: - // -------------------------------------------------------------------------------------------------------- - // TableNextRow() -> TableSetColumnIndex(0) -> Text("Hello 0") -> TableSetColumnIndex(1) -> Text("Hello 1") // OK - // TableNextRow() -> TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK - // TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK: TableNextColumn() automatically gets to next row! - // TableNextRow() -> Text("Hello 0") // Not OK! Missing TableSetColumnIndex() or TableNextColumn()! Text will not appear! - // -------------------------------------------------------------------------------------------------------- + // - TableNextRow() -> TableSetColumnIndex(0) -> Text("Hello 0") -> TableSetColumnIndex(1) -> Text("Hello 1") // OK + // - TableNextRow() -> TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK + // - TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK: TableNextColumn() automatically gets to next row! + // - TableNextRow() -> Text("Hello 0") // Not OK! Missing TableSetColumnIndex() or TableNextColumn()! Text will not appear! // - 5. Call EndTable() - IMGUI_API bool BeginTable(const char* str_id, int column, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0.0f, 0.0f), float inner_width = 0.0f); + IMGUI_API bool BeginTable(const char* str_id, int columns, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0.0f, 0.0f), float inner_width = 0.0f); IMGUI_API void EndTable(); // only call EndTable() if BeginTable() returns true! IMGUI_API void TableNextRow(ImGuiTableRowFlags row_flags = 0, float min_row_height = 0.0f); // append into the first cell of a new row. IMGUI_API bool TableNextColumn(); // append into the next column (or first column of next row if currently in last column). Return true when column is visible. @@ -769,8 +823,9 @@ namespace ImGui // - Use TableSetupScrollFreeze() to lock columns/rows so they stay visible when scrolled. IMGUI_API void TableSetupColumn(const char* label, ImGuiTableColumnFlags flags = 0, float init_width_or_weight = 0.0f, ImGuiID user_id = 0); IMGUI_API void TableSetupScrollFreeze(int cols, int rows); // lock columns/rows so they stay visible when scrolled. - IMGUI_API void TableHeadersRow(); // submit all headers cells based on data provided to TableSetupColumn() + submit context menu IMGUI_API void TableHeader(const char* label); // submit one header cell manually (rarely used) + IMGUI_API void TableHeadersRow(); // submit a row with headers cells based on data provided to TableSetupColumn() + submit context menu + IMGUI_API void TableAngledHeadersRow(); // submit a row with angled headers for every column with the ImGuiTableColumnFlags_AngledHeader flag. MUST BE FIRST ROW. // Tables: Sorting & Miscellaneous functions // - Sorting: call TableGetSortSpecs() to retrieve latest sort specs for the table. NULL when not sorting. @@ -785,11 +840,12 @@ namespace ImGui IMGUI_API const char* TableGetColumnName(int column_n = -1); // return "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column. IMGUI_API ImGuiTableColumnFlags TableGetColumnFlags(int column_n = -1); // return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column. IMGUI_API void TableSetColumnEnabled(int column_n, bool v);// change user accessible enabled/disabled state of a column. Set to false to hide the column. User can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody) + IMGUI_API int TableGetHoveredColumn(); // return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered. Can also use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. IMGUI_API void TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n = -1); // change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details. // Legacy Columns API (prefer using Tables!) // - You can also use SameLine(pos_x) to mimic simplified columns. - IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border = true); + IMGUI_API void Columns(int count = 1, const char* id = NULL, bool borders = true); IMGUI_API void NextColumn(); // next column, defaults to current row or next row if the current row is finished IMGUI_API int GetColumnIndex(); // get current column index IMGUI_API float GetColumnWidth(int column_index = -1); // get column width (in pixels). pass -1 to use current column @@ -828,12 +884,13 @@ namespace ImGui IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget() IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released. IMGUI_API void EndDragDropTarget(); // only call EndDragDropTarget() if BeginDragDropTarget() returns true! - IMGUI_API const ImGuiPayload* GetDragDropPayload(); // peek directly into the current payload from anywhere. may return NULL. use ImGuiPayload::IsDataType() to test for the payload type. + IMGUI_API const ImGuiPayload* GetDragDropPayload(); // peek directly into the current payload from anywhere. returns NULL when drag and drop is finished or inactive. use ImGuiPayload::IsDataType() to test for the payload type. // Disabling [BETA API] // - Disable all user interactions and dim items visuals (applying style.DisabledAlpha over current colors) // - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled) - // - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(False)/EndDisabled() best to avoid it. + // - Tooltips windows by exception are opted out of disabling. + // - BeginDisabled(false)/EndDisabled() essentially does nothing but is provided to facilitate use of boolean expressions (as a micro-optimization: if you have tens of thousands of BeginDisabled(false)/EndDisabled() pairs, you might want to reformulate your code to avoid making those calls) IMGUI_API void BeginDisabled(bool disabled = true); IMGUI_API void EndDisabled(); @@ -843,10 +900,12 @@ namespace ImGui IMGUI_API void PopClipRect(); // Focus, Activation - // - Prefer using "SetItemDefaultFocus()" over "if (IsWindowAppearing()) SetScrollHereY()" when applicable to signify "this is the default item" - IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a window. + IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of of a newly appearing window. IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget. + // Keyboard/Gamepad Navigation + IMGUI_API void SetNavCursorVisible(bool visible); // alter visibility of keyboard/gamepad cursor. by default: show when using an arrow key, hide when clicking with mouse. + // Overlapping mode IMGUI_API void SetNextItemAllowOverlap(); // allow next item to be overlapped by a subsequent item. Useful with invisible buttons, selectable, treenode covering an area where subsequent items may need to be added. Note that both Selectable() and TreeNode() have dedicated flags doing this. @@ -890,8 +949,6 @@ namespace ImGui IMGUI_API const char* GetStyleColorName(ImGuiCol idx); // get a string corresponding to the enum value (for display, saving, etc.). IMGUI_API void SetStateStorage(ImGuiStorage* storage); // replace current window storage with our own (if you want to manipulate it yourself, typically clear subsection of it) IMGUI_API ImGuiStorage* GetStateStorage(); - IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame - IMGUI_API void EndChildFrame(); // always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window) // Text Utilities IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f); @@ -910,11 +967,38 @@ namespace ImGui IMGUI_API bool IsKeyDown(ImGuiKey key); // is key being held. IMGUI_API bool IsKeyPressed(ImGuiKey key, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate IMGUI_API bool IsKeyReleased(ImGuiKey key); // was key released (went from Down to !Down)? + IMGUI_API bool IsKeyChordPressed(ImGuiKeyChord key_chord); // was key chord (mods + key) pressed, e.g. you can pass 'ImGuiMod_Ctrl | ImGuiKey_S' as a key-chord. This doesn't do any routing or focus check, please consider using Shortcut() function instead. IMGUI_API int GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate IMGUI_API const char* GetKeyName(ImGuiKey key); // [DEBUG] returns English name of the key. Those names a provided for debugging purpose and are not meant to be saved persistently not compared. IMGUI_API void SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard); // Override io.WantCaptureKeyboard flag next frame (said flag is left for your application to handle, typically when true it instructs your app to ignore inputs). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard"; after the next NewFrame() call. - // Inputs Utilities: Mouse specific + // Inputs Utilities: Shortcut Testing & Routing [BETA] + // - ImGuiKeyChord = a ImGuiKey + optional ImGuiMod_Alt/ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Super. + // ImGuiKey_C // Accepted by functions taking ImGuiKey or ImGuiKeyChord arguments) + // ImGuiMod_Ctrl | ImGuiKey_C // Accepted by functions taking ImGuiKeyChord arguments) + // only ImGuiMod_XXX values are legal to combine with an ImGuiKey. You CANNOT combine two ImGuiKey values. + // - The general idea is that several callers may register interest in a shortcut, and only one owner gets it. + // Parent -> call Shortcut(Ctrl+S) // When Parent is focused, Parent gets the shortcut. + // Child1 -> call Shortcut(Ctrl+S) // When Child1 is focused, Child1 gets the shortcut (Child1 overrides Parent shortcuts) + // Child2 -> no call // When Child2 is focused, Parent gets the shortcut. + // The whole system is order independent, so if Child1 makes its calls before Parent, results will be identical. + // This is an important property as it facilitate working with foreign code or larger codebase. + // - To understand the difference: + // - IsKeyChordPressed() compares mods and call IsKeyPressed() -> function has no side-effect. + // - Shortcut() submits a route, routes are resolved, if it currently can be routed it calls IsKeyChordPressed() -> function has (desirable) side-effects as it can prevents another call from getting the route. + // - Visualize registered routes in 'Metrics/Debugger->Inputs'. + IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0); + IMGUI_API void SetNextItemShortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0); + + // Inputs Utilities: Key/Input Ownership [BETA] + // - One common use case would be to allow your items to disable standard inputs behaviors such + // as Tab or Alt key handling, Mouse Wheel scrolling, etc. + // e.g. Button(...); SetItemKeyOwner(ImGuiKey_MouseWheelY); to make hovering/activating a button disable wheel for scrolling. + // - Reminder ImGuiKey enum include access to mouse buttons and gamepad, so key ownership can apply to them. + // - Many related features are still in imgui_internal.h. For instance, most IsKeyXXX()/IsMouseXXX() functions have an owner-id-aware version. + IMGUI_API void SetItemKeyOwner(ImGuiKey key); // Set key owner to last item ID if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'. + + // Inputs Utilities: Mouse // - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right. // - You can also use regular integer: it is forever guaranteed that 0=Left, 1=Right, 2=Middle. // - Dragging operations are only reported after mouse has moved a certain distance away from the initial clicking position (see 'lock_threshold' and 'io.MouseDraggingThreshold') @@ -928,8 +1012,8 @@ namespace ImGui IMGUI_API bool IsAnyMouseDown(); // [WILL OBSOLETE] is any mouse button held? This was designed for backends, but prefer having backend maintain a mask of held mouse buttons, because upcoming input queue system will make this invalid. IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to avoid user backing that value themselves) - IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f); // is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold) - IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f); // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold) + IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f); // is mouse dragging? (uses io.MouseDraggingThreshold if lock_threshold < 0.0f) + IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f); // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (uses io.MouseDraggingThreshold if lock_threshold < 0.0f) IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button = 0); // IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired mouse cursor shape. Important: reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type); // set desired mouse cursor shape @@ -950,8 +1034,15 @@ namespace ImGui IMGUI_API const char* SaveIniSettingsToMemory(size_t* out_ini_size = NULL); // return a zero-terminated string with the .ini data which you can save by your own mean. call when io.WantSaveIniSettings is set, then save data by your own mean and clear io.WantSaveIniSettings. // Debug Utilities + // - Your main debugging friend is the ShowMetricsWindow() function, which is also accessible from Demo->Tools->Metrics Debugger IMGUI_API void DebugTextEncoding(const char* text); + IMGUI_API void DebugFlashStyleColor(ImGuiCol idx); + IMGUI_API void DebugStartItemPicker(); IMGUI_API bool DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx); // This is called by IMGUI_CHECKVERSION() macro. +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + IMGUI_API void DebugLog(const char* fmt, ...) IM_FMTARGS(1); // Call via IMGUI_DEBUG_LOG() for maximum stripping in caller code! + IMGUI_API void DebugLogV(const char* fmt, va_list args) IM_FMTLIST(1); +#endif // Memory Allocators // - Those functions are not reliant on the current context. @@ -989,49 +1080,103 @@ enum ImGuiWindowFlags_ ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, // Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus) ImGuiWindowFlags_AlwaysVerticalScrollbar= 1 << 14, // Always show vertical scrollbar (even if ContentSize.y < Size.y) ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 15, // Always show horizontal scrollbar (even if ContentSize.x < Size.x) - ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient) - ImGuiWindowFlags_NoNavInputs = 1 << 18, // No gamepad/keyboard navigation within the window - ImGuiWindowFlags_NoNavFocus = 1 << 19, // No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB) - ImGuiWindowFlags_UnsavedDocument = 1 << 20, // Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. + ImGuiWindowFlags_NoNavInputs = 1 << 16, // No keyboard/gamepad navigation within the window + ImGuiWindowFlags_NoNavFocus = 1 << 17, // No focusing toward this window with keyboard/gamepad navigation (e.g. skipped by CTRL+TAB) + ImGuiWindowFlags_UnsavedDocument = 1 << 18, // Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, ImGuiWindowFlags_NoDecoration = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse, ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, // [Internal] - ImGuiWindowFlags_NavFlattened = 1 << 23, // [BETA] On child window: allow gamepad/keyboard navigation to cross over parent border to this child or between sibling child windows. ImGuiWindowFlags_ChildWindow = 1 << 24, // Don't use! For internal use by BeginChild() ImGuiWindowFlags_Tooltip = 1 << 25, // Don't use! For internal use by BeginTooltip() ImGuiWindowFlags_Popup = 1 << 26, // Don't use! For internal use by BeginPopup() ImGuiWindowFlags_Modal = 1 << 27, // Don't use! For internal use by BeginPopupModal() ImGuiWindowFlags_ChildMenu = 1 << 28, // Don't use! For internal use by BeginMenu() + + // Obsolete names +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 30, // Obsoleted in 1.90.0: Use ImGuiChildFlags_AlwaysUseWindowPadding in BeginChild() call. + ImGuiWindowFlags_NavFlattened = 1 << 31, // Obsoleted in 1.90.9: Use ImGuiChildFlags_NavFlattened in BeginChild() call. +#endif +}; + +// Flags for ImGui::BeginChild() +// (Legacy: bit 0 must always correspond to ImGuiChildFlags_Borders to be backward compatible with old API using 'bool border = false'. +// About using AutoResizeX/AutoResizeY flags: +// - May be combined with SetNextWindowSizeConstraints() to set a min/max size for each axis (see "Demo->Child->Auto-resize with Constraints"). +// - Size measurement for a given axis is only performed when the child window is within visible boundaries, or is just appearing. +// - This allows BeginChild() to return false when not within boundaries (e.g. when scrolling), which is more optimal. BUT it won't update its auto-size while clipped. +// While not perfect, it is a better default behavior as the always-on performance gain is more valuable than the occasional "resizing after becoming visible again" glitch. +// - You may also use ImGuiChildFlags_AlwaysAutoResize to force an update even when child window is not in view. +// HOWEVER PLEASE UNDERSTAND THAT DOING SO WILL PREVENT BeginChild() FROM EVER RETURNING FALSE, disabling benefits of coarse clipping. +enum ImGuiChildFlags_ +{ + ImGuiChildFlags_None = 0, + ImGuiChildFlags_Borders = 1 << 0, // Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == true for legacy reason) + ImGuiChildFlags_AlwaysUseWindowPadding = 1 << 1, // Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense) + ImGuiChildFlags_ResizeX = 1 << 2, // Allow resize from right border (layout direction). Enable .ini saving (unless ImGuiWindowFlags_NoSavedSettings passed to window flags) + ImGuiChildFlags_ResizeY = 1 << 3, // Allow resize from bottom border (layout direction). " + ImGuiChildFlags_AutoResizeX = 1 << 4, // Enable auto-resizing width. Read "IMPORTANT: Size measurement" details above. + ImGuiChildFlags_AutoResizeY = 1 << 5, // Enable auto-resizing height. Read "IMPORTANT: Size measurement" details above. + ImGuiChildFlags_AlwaysAutoResize = 1 << 6, // Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return true, always disable clipping optimization! NOT RECOMMENDED. + ImGuiChildFlags_FrameStyle = 1 << 7, // Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding. + ImGuiChildFlags_NavFlattened = 1 << 8, // [BETA] Share focus scope, allow keyboard/gamepad navigation to cross over parent border to this child or between sibling child windows. + + // Obsolete names +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + ImGuiChildFlags_Border = ImGuiChildFlags_Borders, // Renamed in 1.91.1 (August 2024) for consistency. +#endif +}; + +// Flags for ImGui::PushItemFlag() +// (Those are shared by all items) +enum ImGuiItemFlags_ +{ + ImGuiItemFlags_None = 0, // (Default) + ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav. + ImGuiItemFlags_NoNav = 1 << 1, // false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls). + ImGuiItemFlags_NoNavDefaultFocus = 1 << 2, // false // Disable item being a candidate for default focus (e.g. used by title bar items). + ImGuiItemFlags_ButtonRepeat = 1 << 3, // false // Any button-like behavior will have repeat mode enabled (based on io.KeyRepeatDelay and io.KeyRepeatRate values). Note that you can also call IsItemActive() after any button to tell if it is being held. + ImGuiItemFlags_AutoClosePopups = 1 << 4, // true // MenuItem()/Selectable() automatically close their parent popup window. + ImGuiItemFlags_AllowDuplicateId = 1 << 5, // false // Allow submitting an item with the same identifier as an item already submitted this frame without triggering a warning tooltip if io.ConfigDebugHighlightIdConflicts is set. }; // Flags for ImGui::InputText() // (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigInputTextCursorBlink and io.ConfigInputTextEnterKeepActive) enum ImGuiInputTextFlags_ { + // Basic filters (also see ImGuiInputTextFlags_CallbackCharFilter) ImGuiInputTextFlags_None = 0, ImGuiInputTextFlags_CharsDecimal = 1 << 0, // Allow 0123456789.+-*/ ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, // Allow 0123456789ABCDEFabcdef - ImGuiInputTextFlags_CharsUppercase = 1 << 2, // Turn a..z into A..Z - ImGuiInputTextFlags_CharsNoBlank = 1 << 3, // Filter out spaces, tabs - ImGuiInputTextFlags_AutoSelectAll = 1 << 4, // Select entire text when first taking mouse focus - ImGuiInputTextFlags_EnterReturnsTrue = 1 << 5, // Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider looking at the IsItemDeactivatedAfterEdit() function. - ImGuiInputTextFlags_CallbackCompletion = 1 << 6, // Callback on pressing TAB (for completion handling) - ImGuiInputTextFlags_CallbackHistory = 1 << 7, // Callback on pressing Up/Down arrows (for history handling) - ImGuiInputTextFlags_CallbackAlways = 1 << 8, // Callback on each iteration. User code may query cursor position, modify text buffer. - ImGuiInputTextFlags_CallbackCharFilter = 1 << 9, // Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard. - ImGuiInputTextFlags_AllowTabInput = 1 << 10, // Pressing TAB input a '\t' character into the text field - ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 11, // In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter, add line with Enter). - ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12, // Disable following the cursor horizontally - ImGuiInputTextFlags_AlwaysOverwrite = 1 << 13, // Overwrite mode - ImGuiInputTextFlags_ReadOnly = 1 << 14, // Read-only mode - ImGuiInputTextFlags_Password = 1 << 15, // Password mode, display all characters as '*' + ImGuiInputTextFlags_CharsScientific = 1 << 2, // Allow 0123456789.+-*/eE (Scientific notation input) + ImGuiInputTextFlags_CharsUppercase = 1 << 3, // Turn a..z into A..Z + ImGuiInputTextFlags_CharsNoBlank = 1 << 4, // Filter out spaces, tabs + + // Inputs + ImGuiInputTextFlags_AllowTabInput = 1 << 5, // Pressing TAB input a '\t' character into the text field + ImGuiInputTextFlags_EnterReturnsTrue = 1 << 6, // Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider using IsItemDeactivatedAfterEdit() instead! + ImGuiInputTextFlags_EscapeClearsAll = 1 << 7, // Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert) + ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 8, // In multi-line mode, validate with Enter, add new line with Ctrl+Enter (default is opposite: validate with Ctrl+Enter, add line with Enter). + + // Other options + ImGuiInputTextFlags_ReadOnly = 1 << 9, // Read-only mode + ImGuiInputTextFlags_Password = 1 << 10, // Password mode, display all characters as '*', disable copy + ImGuiInputTextFlags_AlwaysOverwrite = 1 << 11, // Overwrite mode + ImGuiInputTextFlags_AutoSelectAll = 1 << 12, // Select entire text when first taking mouse focus + ImGuiInputTextFlags_ParseEmptyRefVal = 1 << 13, // InputFloat(), InputInt(), InputScalar() etc. only: parse empty string as zero value. + ImGuiInputTextFlags_DisplayEmptyRefVal = 1 << 14, // InputFloat(), InputInt(), InputScalar() etc. only: when value is zero, do not display it. Generally used with ImGuiInputTextFlags_ParseEmptyRefVal. + ImGuiInputTextFlags_NoHorizontalScroll = 1 << 15, // Disable following the cursor horizontally ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). - ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input) - ImGuiInputTextFlags_CallbackResize = 1 << 18, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) - ImGuiInputTextFlags_CallbackEdit = 1 << 19, // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) - ImGuiInputTextFlags_EscapeClearsAll = 1 << 20, // Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert) + + // Callback features + ImGuiInputTextFlags_CallbackCompletion = 1 << 17, // Callback on pressing TAB (for completion handling) + ImGuiInputTextFlags_CallbackHistory = 1 << 18, // Callback on pressing Up/Down arrows (for history handling) + ImGuiInputTextFlags_CallbackAlways = 1 << 19, // Callback on each iteration. User code may query cursor position, modify text buffer. + ImGuiInputTextFlags_CallbackCharFilter = 1 << 20, // Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard. + ImGuiInputTextFlags_CallbackResize = 1 << 21, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) + ImGuiInputTextFlags_CallbackEdit = 1 << 22, // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) // Obsolete names //ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior @@ -1047,15 +1192,17 @@ enum ImGuiTreeNodeFlags_ ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3, // Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4, // Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes) ImGuiTreeNodeFlags_DefaultOpen = 1 << 5, // Default node to be open - ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, // Need double-click to open node - ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, // Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open. + ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, // Open on double-click instead of simple click (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined. + ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, // Open when clicking on the arrow part (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined. ImGuiTreeNodeFlags_Leaf = 1 << 8, // No collapsing, no arrow (use as a convenience for leaf nodes). ImGuiTreeNodeFlags_Bullet = 1 << 9, // Display a bullet instead of arrow. IMPORTANT: node can still be marked open/close if you don't set the _Leaf flag! - ImGuiTreeNodeFlags_FramePadding = 1 << 10, // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding(). - ImGuiTreeNodeFlags_SpanAvailWidth = 1 << 11, // Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line. In the future we may refactor the hit system to be front-to-back, allowing natural overlaps and then this can become the default. - ImGuiTreeNodeFlags_SpanFullWidth = 1 << 12, // Extend hit box to the left-most and right-most edges (bypass the indented area). - ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop) - //ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible + ImGuiTreeNodeFlags_FramePadding = 1 << 10, // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding() before the node. + ImGuiTreeNodeFlags_SpanAvailWidth = 1 << 11, // Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line without using AllowOverlap mode. + ImGuiTreeNodeFlags_SpanFullWidth = 1 << 12, // Extend hit box to the left-most and right-most edges (cover the indent area). + ImGuiTreeNodeFlags_SpanTextWidth = 1 << 13, // Narrow hit box + narrow hovering highlight, will only cover the label text. + ImGuiTreeNodeFlags_SpanAllColumns = 1 << 14, // Frame will span all columns of its container table (text will still fit in current column) + ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 15, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop) + //ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 16, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog, #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS @@ -1064,8 +1211,8 @@ enum ImGuiTreeNodeFlags_ }; // Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions. -// - To be backward compatible with older API which took an 'int mouse_button = 1' argument, we need to treat -// small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags. +// - To be backward compatible with older API which took an 'int mouse_button = 1' argument instead of 'ImGuiPopupFlags flags', +// we need to treat small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags. // It is therefore guaranteed to be legal to pass a mouse button index in ImGuiPopupFlags. // - For the same reason, we exceptionally default the ImGuiPopupFlags argument of BeginPopupContextXXX functions to 1 instead of 0. // IMPORTANT: because the default parameter is 1 (==ImGuiPopupFlags_MouseButtonRight), if you rely on the default parameter @@ -1079,10 +1226,12 @@ enum ImGuiPopupFlags_ ImGuiPopupFlags_MouseButtonMiddle = 2, // For BeginPopupContext*(): open on Middle Mouse release. Guaranteed to always be == 2 (same as ImGuiMouseButton_Middle) ImGuiPopupFlags_MouseButtonMask_ = 0x1F, ImGuiPopupFlags_MouseButtonDefault_ = 1, - ImGuiPopupFlags_NoOpenOverExistingPopup = 1 << 5, // For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack - ImGuiPopupFlags_NoOpenOverItems = 1 << 6, // For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space - ImGuiPopupFlags_AnyPopupId = 1 << 7, // For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup. - ImGuiPopupFlags_AnyPopupLevel = 1 << 8, // For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level) + ImGuiPopupFlags_NoReopen = 1 << 5, // For OpenPopup*(), BeginPopupContext*(): don't reopen same popup if already open (won't reposition, won't reinitialize navigation) + //ImGuiPopupFlags_NoReopenAlwaysNavInit = 1 << 6, // For OpenPopup*(), BeginPopupContext*(): focus and initialize navigation even when not reopening. + ImGuiPopupFlags_NoOpenOverExistingPopup = 1 << 7, // For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack + ImGuiPopupFlags_NoOpenOverItems = 1 << 8, // For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space + ImGuiPopupFlags_AnyPopupId = 1 << 10, // For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup. + ImGuiPopupFlags_AnyPopupLevel = 1 << 11, // For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level) ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevel, }; @@ -1090,14 +1239,16 @@ enum ImGuiPopupFlags_ enum ImGuiSelectableFlags_ { ImGuiSelectableFlags_None = 0, - ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this doesn't close parent popup window - ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Selectable frame can span all columns (text will still fit in current column) + ImGuiSelectableFlags_NoAutoClosePopups = 1 << 0, // Clicking this doesn't close parent popup window (overrides ImGuiItemFlags_AutoClosePopups) + ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Frame will span all columns of its container table (text will still fit in current column) ImGuiSelectableFlags_AllowDoubleClick = 1 << 2, // Generate press events on double clicks too ImGuiSelectableFlags_Disabled = 1 << 3, // Cannot be selected, display grayed out text ImGuiSelectableFlags_AllowOverlap = 1 << 4, // (WIP) Hit testing to allow subsequent widgets to overlap this one + ImGuiSelectableFlags_Highlight = 1 << 5, // Make the item be displayed as if it is hovered #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - ImGuiSelectableFlags_AllowItemOverlap = ImGuiSelectableFlags_AllowOverlap, // Renamed in 1.89.7 + ImGuiSelectableFlags_DontClosePopups = ImGuiSelectableFlags_NoAutoClosePopups, // Renamed in 1.91.0 + ImGuiSelectableFlags_AllowItemOverlap = ImGuiSelectableFlags_AllowOverlap, // Renamed in 1.89.7 #endif }; @@ -1112,6 +1263,7 @@ enum ImGuiComboFlags_ ImGuiComboFlags_HeightLargest = 1 << 4, // As many fitting items as possible ImGuiComboFlags_NoArrowButton = 1 << 5, // Display on the preview box without the square arrow button ImGuiComboFlags_NoPreview = 1 << 6, // Display only a square arrow button + ImGuiComboFlags_WidthFitPreview = 1 << 7, // Width dynamically calculated from preview contents ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest, }; @@ -1122,11 +1274,12 @@ enum ImGuiTabBarFlags_ ImGuiTabBarFlags_Reorderable = 1 << 0, // Allow manually dragging tabs to re-order them + New tabs are appended at the end of list ImGuiTabBarFlags_AutoSelectNewTabs = 1 << 1, // Automatically select new tabs when they appear ImGuiTabBarFlags_TabListPopupButton = 1 << 2, // Disable buttons to open the tab list popup - ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 1 << 3, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. + ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 1 << 3, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. ImGuiTabBarFlags_NoTabListScrollingButtons = 1 << 4, // Disable scrolling buttons (apply when fitting policy is ImGuiTabBarFlags_FittingPolicyScroll) ImGuiTabBarFlags_NoTooltip = 1 << 5, // Disable tooltips when hovering a tab - ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 6, // Resize tabs when they don't fit - ImGuiTabBarFlags_FittingPolicyScroll = 1 << 7, // Add scroll buttons when tabs don't fit + ImGuiTabBarFlags_DrawSelectedOverline = 1 << 6, // Draw selected overline markers over selected tab + ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 7, // Resize tabs when they don't fit + ImGuiTabBarFlags_FittingPolicyScroll = 1 << 8, // Add scroll buttons when tabs don't fit ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll, ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown, }; @@ -1135,147 +1288,15 @@ enum ImGuiTabBarFlags_ enum ImGuiTabItemFlags_ { ImGuiTabItemFlags_None = 0, - ImGuiTabItemFlags_UnsavedDocument = 1 << 0, // Display a dot next to the title + tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. + ImGuiTabItemFlags_UnsavedDocument = 1 << 0, // Display a dot next to the title + set ImGuiTabItemFlags_NoAssumedClosure. ImGuiTabItemFlags_SetSelected = 1 << 1, // Trigger flag to programmatically make the tab selected when calling BeginTabItem() - ImGuiTabItemFlags_NoCloseWithMiddleMouseButton = 1 << 2, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. - ImGuiTabItemFlags_NoPushId = 1 << 3, // Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem() + ImGuiTabItemFlags_NoCloseWithMiddleMouseButton = 1 << 2, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. + ImGuiTabItemFlags_NoPushId = 1 << 3, // Don't call PushID()/PopID() on BeginTabItem()/EndTabItem() ImGuiTabItemFlags_NoTooltip = 1 << 4, // Disable tooltip for the given tab ImGuiTabItemFlags_NoReorder = 1 << 5, // Disable reordering this tab or having another tab cross over this tab ImGuiTabItemFlags_Leading = 1 << 6, // Enforce the tab position to the left of the tab bar (after the tab list popup button) ImGuiTabItemFlags_Trailing = 1 << 7, // Enforce the tab position to the right of the tab bar (before the scrolling buttons) -}; - -// Flags for ImGui::BeginTable() -// - Important! Sizing policies have complex and subtle side effects, much more so than you would expect. -// Read comments/demos carefully + experiment with live demos to get acquainted with them. -// - The DEFAULT sizing policies are: -// - Default to ImGuiTableFlags_SizingFixedFit if ScrollX is on, or if host window has ImGuiWindowFlags_AlwaysAutoResize. -// - Default to ImGuiTableFlags_SizingStretchSame if ScrollX is off. -// - When ScrollX is off: -// - Table defaults to ImGuiTableFlags_SizingStretchSame -> all Columns defaults to ImGuiTableColumnFlags_WidthStretch with same weight. -// - Columns sizing policy allowed: Stretch (default), Fixed/Auto. -// - Fixed Columns (if any) will generally obtain their requested width (unless the table cannot fit them all). -// - Stretch Columns will share the remaining width according to their respective weight. -// - Mixed Fixed/Stretch columns is possible but has various side-effects on resizing behaviors. -// The typical use of mixing sizing policies is: any number of LEADING Fixed columns, followed by one or two TRAILING Stretch columns. -// (this is because the visible order of columns have subtle but necessary effects on how they react to manual resizing). -// - When ScrollX is on: -// - Table defaults to ImGuiTableFlags_SizingFixedFit -> all Columns defaults to ImGuiTableColumnFlags_WidthFixed -// - Columns sizing policy allowed: Fixed/Auto mostly. -// - Fixed Columns can be enlarged as needed. Table will show a horizontal scrollbar if needed. -// - When using auto-resizing (non-resizable) fixed columns, querying the content width to use item right-alignment e.g. SetNextItemWidth(-FLT_MIN) doesn't make sense, would create a feedback loop. -// - Using Stretch columns OFTEN DOES NOT MAKE SENSE if ScrollX is on, UNLESS you have specified a value for 'inner_width' in BeginTable(). -// If you specify a value for 'inner_width' then effectively the scrolling space is known and Stretch or mixed Fixed/Stretch columns become meaningful again. -// - Read on documentation at the top of imgui_tables.cpp for details. -enum ImGuiTableFlags_ -{ - // Features - ImGuiTableFlags_None = 0, - ImGuiTableFlags_Resizable = 1 << 0, // Enable resizing columns. - ImGuiTableFlags_Reorderable = 1 << 1, // Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers) - ImGuiTableFlags_Hideable = 1 << 2, // Enable hiding/disabling columns in context menu. - ImGuiTableFlags_Sortable = 1 << 3, // Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see ImGuiTableFlags_SortMulti and ImGuiTableFlags_SortTristate. - ImGuiTableFlags_NoSavedSettings = 1 << 4, // Disable persisting columns order, width and sort settings in the .ini file. - ImGuiTableFlags_ContextMenuInBody = 1 << 5, // Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow(). - // Decorations - ImGuiTableFlags_RowBg = 1 << 6, // Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually) - ImGuiTableFlags_BordersInnerH = 1 << 7, // Draw horizontal borders between rows. - ImGuiTableFlags_BordersOuterH = 1 << 8, // Draw horizontal borders at the top and bottom. - ImGuiTableFlags_BordersInnerV = 1 << 9, // Draw vertical borders between columns. - ImGuiTableFlags_BordersOuterV = 1 << 10, // Draw vertical borders on the left and right sides. - ImGuiTableFlags_BordersH = ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterH, // Draw horizontal borders. - ImGuiTableFlags_BordersV = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersOuterV, // Draw vertical borders. - ImGuiTableFlags_BordersInner = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH, // Draw inner borders. - ImGuiTableFlags_BordersOuter = ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH, // Draw outer borders. - ImGuiTableFlags_Borders = ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter, // Draw all borders. - ImGuiTableFlags_NoBordersInBody = 1 << 11, // [ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style - ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 12, // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style - // Sizing Policy (read above for defaults) - ImGuiTableFlags_SizingFixedFit = 1 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width. - ImGuiTableFlags_SizingFixedSame = 2 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible. - ImGuiTableFlags_SizingStretchProp = 3 << 13, // Columns default to _WidthStretch with default weights proportional to each columns contents widths. - ImGuiTableFlags_SizingStretchSame = 4 << 13, // Columns default to _WidthStretch with default weights all equal, unless overridden by TableSetupColumn(). - // Sizing Extra Options - ImGuiTableFlags_NoHostExtendX = 1 << 16, // Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used. - ImGuiTableFlags_NoHostExtendY = 1 << 17, // Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible. - ImGuiTableFlags_NoKeepColumnsVisible = 1 << 18, // Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable. - ImGuiTableFlags_PreciseWidths = 1 << 19, // Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth. - // Clipping - ImGuiTableFlags_NoClip = 1 << 20, // Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze(). - // Padding - ImGuiTableFlags_PadOuterX = 1 << 21, // Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers. - ImGuiTableFlags_NoPadOuterX = 1 << 22, // Default if BordersOuterV is off. Disable outermost padding. - ImGuiTableFlags_NoPadInnerX = 1 << 23, // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off). - // Scrolling - ImGuiTableFlags_ScrollX = 1 << 24, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX. - ImGuiTableFlags_ScrollY = 1 << 25, // Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. - // Sorting - ImGuiTableFlags_SortMulti = 1 << 26, // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1). - ImGuiTableFlags_SortTristate = 1 << 27, // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0). - - // [Internal] Combinations and masks - ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame, -}; - -// Flags for ImGui::TableSetupColumn() -enum ImGuiTableColumnFlags_ -{ - // Input configuration flags - ImGuiTableColumnFlags_None = 0, - ImGuiTableColumnFlags_Disabled = 1 << 0, // Overriding/master disable flag: hide column, won't show in context menu (unlike calling TableSetColumnEnabled() which manipulates the user accessible state) - ImGuiTableColumnFlags_DefaultHide = 1 << 1, // Default as a hidden/disabled column. - ImGuiTableColumnFlags_DefaultSort = 1 << 2, // Default as a sorting column. - ImGuiTableColumnFlags_WidthStretch = 1 << 3, // Column will stretch. Preferable with horizontal scrolling disabled (default if table sizing policy is _SizingStretchSame or _SizingStretchProp). - ImGuiTableColumnFlags_WidthFixed = 1 << 4, // Column will not stretch. Preferable with horizontal scrolling enabled (default if table sizing policy is _SizingFixedFit and table is resizable). - ImGuiTableColumnFlags_NoResize = 1 << 5, // Disable manual resizing. - ImGuiTableColumnFlags_NoReorder = 1 << 6, // Disable manual reordering this column, this will also prevent other columns from crossing over this column. - ImGuiTableColumnFlags_NoHide = 1 << 7, // Disable ability to hide/disable this column. - ImGuiTableColumnFlags_NoClip = 1 << 8, // Disable clipping for this column (all NoClip columns will render in a same draw command). - ImGuiTableColumnFlags_NoSort = 1 << 9, // Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table). - ImGuiTableColumnFlags_NoSortAscending = 1 << 10, // Disable ability to sort in the ascending direction. - ImGuiTableColumnFlags_NoSortDescending = 1 << 11, // Disable ability to sort in the descending direction. - ImGuiTableColumnFlags_NoHeaderLabel = 1 << 12, // TableHeadersRow() will not submit label for this column. Convenient for some small columns. Name will still appear in context menu. - ImGuiTableColumnFlags_NoHeaderWidth = 1 << 13, // Disable header text width contribution to automatic column width. - ImGuiTableColumnFlags_PreferSortAscending = 1 << 14, // Make the initial sort direction Ascending when first sorting on this column (default). - ImGuiTableColumnFlags_PreferSortDescending = 1 << 15, // Make the initial sort direction Descending when first sorting on this column. - ImGuiTableColumnFlags_IndentEnable = 1 << 16, // Use current Indent value when entering cell (default for column 0). - ImGuiTableColumnFlags_IndentDisable = 1 << 17, // Ignore current Indent value when entering cell (default for columns > 0). Indentation changes _within_ the cell will still be honored. - - // Output status flags, read-only via TableGetColumnFlags() - ImGuiTableColumnFlags_IsEnabled = 1 << 24, // Status: is enabled == not hidden by user/api (referred to as "Hide" in _DefaultHide and _NoHide) flags. - ImGuiTableColumnFlags_IsVisible = 1 << 25, // Status: is visible == is enabled AND not clipped by scrolling. - ImGuiTableColumnFlags_IsSorted = 1 << 26, // Status: is currently part of the sort specs - ImGuiTableColumnFlags_IsHovered = 1 << 27, // Status: is hovered by mouse - - // [Internal] Combinations and masks - ImGuiTableColumnFlags_WidthMask_ = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_WidthFixed, - ImGuiTableColumnFlags_IndentMask_ = ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_IndentDisable, - ImGuiTableColumnFlags_StatusMask_ = ImGuiTableColumnFlags_IsEnabled | ImGuiTableColumnFlags_IsVisible | ImGuiTableColumnFlags_IsSorted | ImGuiTableColumnFlags_IsHovered, - ImGuiTableColumnFlags_NoDirectResize_ = 1 << 30, // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge) -}; - -// Flags for ImGui::TableNextRow() -enum ImGuiTableRowFlags_ -{ - ImGuiTableRowFlags_None = 0, - ImGuiTableRowFlags_Headers = 1 << 0, // Identify header row (set default background color + width of its contents accounted differently for auto column width) -}; - -// Enum for ImGui::TableSetBgColor() -// Background colors are rendering in 3 layers: -// - Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set. -// - Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set. -// - Layer 2: draw with CellBg color if set. -// The purpose of the two row/columns layers is to let you decide if a background color change should override or blend with the existing color. -// When using ImGuiTableFlags_RowBg on the table, each row has the RowBg0 color automatically set for odd/even rows. -// If you set the color of RowBg0 target, your color will override the existing RowBg0 color. -// If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color. -enum ImGuiTableBgTarget_ -{ - ImGuiTableBgTarget_None = 0, - ImGuiTableBgTarget_RowBg0 = 1, // Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used) - ImGuiTableBgTarget_RowBg1 = 2, // Set row background color 1 (generally used for selection marking) - ImGuiTableBgTarget_CellBg = 3, // Set cell background color (top-most color) + ImGuiTabItemFlags_NoAssumedClosure = 1 << 8, // Tab is selected when trying to close + closure is not immediately assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. }; // Flags for ImGui::IsWindowFocused() @@ -1307,7 +1328,7 @@ enum ImGuiHoveredFlags_ ImGuiHoveredFlags_AllowWhenOverlappedByItem = 1 << 8, // IsItemHovered() only: Return true even if the item uses AllowOverlap mode and is overlapped by another hoverable item. ImGuiHoveredFlags_AllowWhenOverlappedByWindow = 1 << 9, // IsItemHovered() only: Return true even if the position is obstructed or overlapped by another window. ImGuiHoveredFlags_AllowWhenDisabled = 1 << 10, // IsItemHovered() only: Return true even if the item is disabled - ImGuiHoveredFlags_NoNavOverride = 1 << 11, // IsItemHovered() only: Disable using gamepad/keyboard navigation state when active, always query mouse + ImGuiHoveredFlags_NoNavOverride = 1 << 11, // IsItemHovered() only: Disable using keyboard/gamepad navigation state when active, always query mouse ImGuiHoveredFlags_AllowWhenOverlapped = ImGuiHoveredFlags_AllowWhenOverlappedByItem | ImGuiHoveredFlags_AllowWhenOverlappedByWindow, ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped, ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows, @@ -1340,12 +1361,18 @@ enum ImGuiDragDropFlags_ ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item. ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. ImGuiDragDropFlags_SourceExtern = 1 << 4, // External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. - ImGuiDragDropFlags_SourceAutoExpirePayload = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged) + ImGuiDragDropFlags_PayloadAutoExpire = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged) + ImGuiDragDropFlags_PayloadNoCrossContext = 1 << 6, // Hint to specify that the payload may not be copied outside current dear imgui context. + ImGuiDragDropFlags_PayloadNoCrossProcess = 1 << 7, // Hint to specify that the payload may not be copied outside current process. // AcceptDragDropPayload() flags ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, // Do not draw the default highlight rectangle when hovering over target. ImGuiDragDropFlags_AcceptNoPreviewTooltip = 1 << 12, // Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site. ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect, // For peeking ahead and inspecting the payload before delivery. + +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + ImGuiDragDropFlags_SourceAutoExpirePayload = ImGuiDragDropFlags_PayloadAutoExpire, // Renamed in 1.90.9 +#endif }; // Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui. @@ -1365,11 +1392,12 @@ enum ImGuiDataType_ ImGuiDataType_U64, // unsigned long long / unsigned __int64 ImGuiDataType_Float, // float ImGuiDataType_Double, // double + ImGuiDataType_Bool, // bool (provided for user convenience, not supported by scalar widgets) ImGuiDataType_COUNT }; // A cardinal direction -enum ImGuiDir_ +enum ImGuiDir : int { ImGuiDir_None = -1, ImGuiDir_Left = 0, @@ -1380,18 +1408,24 @@ enum ImGuiDir_ }; // A sorting direction -enum ImGuiSortDirection_ +enum ImGuiSortDirection : ImU8 { ImGuiSortDirection_None = 0, ImGuiSortDirection_Ascending = 1, // Ascending = 0->9, A->Z etc. ImGuiSortDirection_Descending = 2 // Descending = 9->0, Z->A etc. }; +// Since 1.90, defining IMGUI_DISABLE_OBSOLETE_FUNCTIONS automatically defines IMGUI_DISABLE_OBSOLETE_KEYIO as well. +#if defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && !defined(IMGUI_DISABLE_OBSOLETE_KEYIO) +#define IMGUI_DISABLE_OBSOLETE_KEYIO +#endif + // A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value): can represent Keyboard, Mouse and Gamepad values. // All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87). // Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey. // Read details about the 1.87 and 1.89 transition : https://github.com/ocornut/imgui/issues/4921 // Note that "Keys" related to physical keys and are not the same concept as input "Characters", the later are submitted via io.AddInputCharacter(). +// The keyboard key enum values are named after the keys on a standard US keyboard, and on other keyboard types the keys reported may not match the keycaps. enum ImGuiKey : int { // Keyboard @@ -1420,6 +1454,8 @@ enum ImGuiKey : int ImGuiKey_U, ImGuiKey_V, ImGuiKey_W, ImGuiKey_X, ImGuiKey_Y, ImGuiKey_Z, ImGuiKey_F1, ImGuiKey_F2, ImGuiKey_F3, ImGuiKey_F4, ImGuiKey_F5, ImGuiKey_F6, ImGuiKey_F7, ImGuiKey_F8, ImGuiKey_F9, ImGuiKey_F10, ImGuiKey_F11, ImGuiKey_F12, + ImGuiKey_F13, ImGuiKey_F14, ImGuiKey_F15, ImGuiKey_F16, ImGuiKey_F17, ImGuiKey_F18, + ImGuiKey_F19, ImGuiKey_F20, ImGuiKey_F21, ImGuiKey_F22, ImGuiKey_F23, ImGuiKey_F24, ImGuiKey_Apostrophe, // ' ImGuiKey_Comma, // , ImGuiKey_Minus, // - @@ -1445,6 +1481,8 @@ enum ImGuiKey : int ImGuiKey_KeypadAdd, ImGuiKey_KeypadEnter, ImGuiKey_KeypadEqual, + ImGuiKey_AppBack, // Available on some keyboard/mouses. Often referred as "Browser Back" + ImGuiKey_AppForward, // Gamepad (some of those are analog values, 0.0f to 1.0f) // NAVIGATION ACTION // (download controller mapping PNG/PSD at http://dearimgui.com/controls_sheets) @@ -1489,13 +1527,13 @@ enum ImGuiKey : int // - In theory the value of keyboard modifiers should be roughly equivalent to a logical or of the equivalent left/right keys. // In practice: it's complicated; mods are often provided from different sources. Keyboard layout, IME, sticky keys and // backends tend to interfere and break that equivalence. The safer decision is to relay that ambiguity down to the end-user... + // - On macOS, we swap Cmd(Super) and Ctrl keys at the time of the io.AddKeyEvent() call. ImGuiMod_None = 0, - ImGuiMod_Ctrl = 1 << 12, // Ctrl + ImGuiMod_Ctrl = 1 << 12, // Ctrl (non-macOS), Cmd (macOS) ImGuiMod_Shift = 1 << 13, // Shift ImGuiMod_Alt = 1 << 14, // Option/Menu - ImGuiMod_Super = 1 << 15, // Cmd/Super/Windows - ImGuiMod_Shortcut = 1 << 11, // Alias for Ctrl (non-macOS) _or_ Super (macOS). - ImGuiMod_Mask_ = 0xF800, // 5-bits + ImGuiMod_Super = 1 << 15, // Windows/Super (non-macOS), Ctrl (macOS) + ImGuiMod_Mask_ = 0xF000, // 4-bits // [Internal] Prior to 1.87 we required user to fill io.KeysDown[512] using their own native index + the io.KeyMap[] array. // We are ditching this method but keeping a legacy path for user code doing e.g. IsKeyPressed(MY_NATIVE_KEY_CODE) @@ -1512,11 +1550,37 @@ enum ImGuiKey : int #endif #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + ImGuiMod_Shortcut = ImGuiMod_Ctrl, // Removed in 1.90.7, you can now simply use ImGuiMod_Ctrl ImGuiKey_ModCtrl = ImGuiMod_Ctrl, ImGuiKey_ModShift = ImGuiMod_Shift, ImGuiKey_ModAlt = ImGuiMod_Alt, ImGuiKey_ModSuper = ImGuiMod_Super, // Renamed in 1.89 - ImGuiKey_KeyPadEnter = ImGuiKey_KeypadEnter, // Renamed in 1.87 + //ImGuiKey_KeyPadEnter = ImGuiKey_KeypadEnter, // Renamed in 1.87 #endif }; +// Flags for Shortcut(), SetNextItemShortcut(), +// (and for upcoming extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner() that are still in imgui_internal.h) +// Don't mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function) +enum ImGuiInputFlags_ +{ + ImGuiInputFlags_None = 0, + ImGuiInputFlags_Repeat = 1 << 0, // Enable repeat. Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1. + + // Flags for Shortcut(), SetNextItemShortcut() + // - Routing policies: RouteGlobal+OverActive >> RouteActive or RouteFocused (if owner is active item) >> RouteGlobal+OverFocused >> RouteFocused (if in focused window stack) >> RouteGlobal. + // - Default policy is RouteFocused. Can select only 1 policy among all available. + ImGuiInputFlags_RouteActive = 1 << 10, // Route to active item only. + ImGuiInputFlags_RouteFocused = 1 << 11, // Route to windows in the focus stack (DEFAULT). Deep-most focused window takes inputs. Active item takes inputs over deep-most focused window. + ImGuiInputFlags_RouteGlobal = 1 << 12, // Global route (unless a focused window or active item registered the route). + ImGuiInputFlags_RouteAlways = 1 << 13, // Do not register route, poll keys directly. + // - Routing options + ImGuiInputFlags_RouteOverFocused = 1 << 14, // Option: global route: higher priority than focused route (unless active item in focused route). + ImGuiInputFlags_RouteOverActive = 1 << 15, // Option: global route: higher priority than active item. Unlikely you need to use that: will interfere with every active items, e.g. CTRL+A registered by InputText will be overridden by this. May not be fully honored as user/internal code is likely to always assume they can access keys when active. + ImGuiInputFlags_RouteUnlessBgFocused = 1 << 16, // Option: global route: will not be applied if underlying background/void is focused (== no Dear ImGui windows are focused). Useful for overlay applications. + ImGuiInputFlags_RouteFromRootWindow = 1 << 17, // Option: route evaluated from the point of view of root window rather than current window. + + // Flags for SetNextItemShortcut() + ImGuiInputFlags_Tooltip = 1 << 18, // Automatically display a tooltip when hovering item [BETA] Unsure of right api (opt-in/opt-out) +}; + #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO // OBSOLETED in 1.88 (from July 2022): ImGuiNavInput and io.NavInputs[]. // Official backends between 1.60 and 1.86: will keep working and feed gamepad inputs as long as IMGUI_DISABLE_OBSOLETE_KEYIO is not set. @@ -1535,14 +1599,18 @@ enum ImGuiConfigFlags_ ImGuiConfigFlags_None = 0, ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. Enable full Tabbing + directional arrows + space/enter to activate. ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. Backend also needs to set ImGuiBackendFlags_HasGamepad. - ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your backend, otherwise ImGui will react as if the mouse is jumping around back and forth. - ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set. - ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the backend. + ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct dear imgui to disable mouse inputs and interactions. ImGuiConfigFlags_NoMouseCursorChange = 1 << 5, // Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead. + ImGuiConfigFlags_NoKeyboard = 1 << 6, // Instruct dear imgui to disable keyboard inputs and interactions. This is done by ignoring keyboard events and clearing existing states. // User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are NOT used by core Dear ImGui) ImGuiConfigFlags_IsSRGB = 1 << 20, // Application is SRGB-aware. ImGuiConfigFlags_IsTouchScreen = 1 << 21, // Application is using a touch screen instead of a mouse. + +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // [moved/renamed in 1.91.4] -> use bool io.ConfigNavMoveSetMousePos + ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // [moved/renamed in 1.91.4] -> use bool io.ConfigNavCaptureKeyboard +#endif }; // Backend capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom backend. @@ -1551,7 +1619,7 @@ enum ImGuiBackendFlags_ ImGuiBackendFlags_None = 0, ImGuiBackendFlags_HasGamepad = 1 << 0, // Backend Platform supports gamepad and currently has one connected. ImGuiBackendFlags_HasMouseCursors = 1 << 1, // Backend Platform supports honoring GetMouseCursor() value to change the OS cursor shape. - ImGuiBackendFlags_HasSetMousePos = 1 << 2, // Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set). + ImGuiBackendFlags_HasSetMousePos = 1 << 2, // Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if io.ConfigNavMoveSetMousePos is set). ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3, // Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices. }; @@ -1568,15 +1636,15 @@ enum ImGuiCol_ ImGuiCol_FrameBg, // Background of checkbox, radio button, plot, slider, text input ImGuiCol_FrameBgHovered, ImGuiCol_FrameBgActive, - ImGuiCol_TitleBg, - ImGuiCol_TitleBgActive, - ImGuiCol_TitleBgCollapsed, + ImGuiCol_TitleBg, // Title bar + ImGuiCol_TitleBgActive, // Title bar when focused + ImGuiCol_TitleBgCollapsed, // Title bar when collapsed ImGuiCol_MenuBarBg, ImGuiCol_ScrollbarBg, ImGuiCol_ScrollbarGrab, ImGuiCol_ScrollbarGrabHovered, ImGuiCol_ScrollbarGrabActive, - ImGuiCol_CheckMark, + ImGuiCol_CheckMark, // Checkbox tick and RadioButton circle ImGuiCol_SliderGrab, ImGuiCol_SliderGrabActive, ImGuiCol_Button, @@ -1591,11 +1659,13 @@ enum ImGuiCol_ ImGuiCol_ResizeGrip, // Resize grip in lower-right and lower-left corners of windows. ImGuiCol_ResizeGripHovered, ImGuiCol_ResizeGripActive, - ImGuiCol_Tab, // TabItem in a TabBar - ImGuiCol_TabHovered, - ImGuiCol_TabActive, - ImGuiCol_TabUnfocused, - ImGuiCol_TabUnfocusedActive, + ImGuiCol_TabHovered, // Tab background, when hovered + ImGuiCol_Tab, // Tab background, when tab-bar is focused & tab is unselected + ImGuiCol_TabSelected, // Tab background, when tab-bar is focused & tab is selected + ImGuiCol_TabSelectedOverline, // Tab horizontal overline, when tab-bar is focused & tab is selected + ImGuiCol_TabDimmed, // Tab background, when tab-bar is unfocused & tab is unselected + ImGuiCol_TabDimmedSelected, // Tab background, when tab-bar is unfocused & tab is selected + ImGuiCol_TabDimmedSelectedOverline,//..horizontal overline, when tab-bar is unfocused & tab is selected ImGuiCol_PlotLines, ImGuiCol_PlotLinesHovered, ImGuiCol_PlotHistogram, @@ -1605,53 +1675,67 @@ enum ImGuiCol_ ImGuiCol_TableBorderLight, // Table inner borders (prefer using Alpha=1.0 here) ImGuiCol_TableRowBg, // Table row background (even rows) ImGuiCol_TableRowBgAlt, // Table row background (odd rows) + ImGuiCol_TextLink, // Hyperlink color ImGuiCol_TextSelectedBg, ImGuiCol_DragDropTarget, // Rectangle highlighting a drop target - ImGuiCol_NavHighlight, // Gamepad/keyboard: current highlighted item + ImGuiCol_NavCursor, // Color of keyboard/gamepad navigation cursor/rectangle, when visible ImGuiCol_NavWindowingHighlight, // Highlight window when using CTRL+TAB ImGuiCol_NavWindowingDimBg, // Darken/colorize entire screen behind the CTRL+TAB window list, when active ImGuiCol_ModalWindowDimBg, // Darken/colorize entire screen behind a modal window, when one is active - ImGuiCol_COUNT + ImGuiCol_COUNT, + +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + ImGuiCol_TabActive = ImGuiCol_TabSelected, // [renamed in 1.90.9] + ImGuiCol_TabUnfocused = ImGuiCol_TabDimmed, // [renamed in 1.90.9] + ImGuiCol_TabUnfocusedActive = ImGuiCol_TabDimmedSelected, // [renamed in 1.90.9] + ImGuiCol_NavHighlight = ImGuiCol_NavCursor, // [renamed in 1.91.4] +#endif }; // Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure. // - The enum only refers to fields of ImGuiStyle which makes sense to be pushed/popped inside UI code. // During initialization or between frames, feel free to just poke into ImGuiStyle directly. // - Tip: Use your programming IDE navigation facilities on the names in the _second column_ below to find the actual members and their description. -// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. -// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. +// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. +// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments. +// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments. // - When changing this enum, you need to update the associated internal table GStyleVarInfo[] accordingly. This is where we link enum values to members offset/type. enum ImGuiStyleVar_ { - // Enum name --------------------- // Member in ImGuiStyle structure (see ImGuiStyle for descriptions) - ImGuiStyleVar_Alpha, // float Alpha - ImGuiStyleVar_DisabledAlpha, // float DisabledAlpha - ImGuiStyleVar_WindowPadding, // ImVec2 WindowPadding - ImGuiStyleVar_WindowRounding, // float WindowRounding - ImGuiStyleVar_WindowBorderSize, // float WindowBorderSize - ImGuiStyleVar_WindowMinSize, // ImVec2 WindowMinSize - ImGuiStyleVar_WindowTitleAlign, // ImVec2 WindowTitleAlign - ImGuiStyleVar_ChildRounding, // float ChildRounding - ImGuiStyleVar_ChildBorderSize, // float ChildBorderSize - ImGuiStyleVar_PopupRounding, // float PopupRounding - ImGuiStyleVar_PopupBorderSize, // float PopupBorderSize - ImGuiStyleVar_FramePadding, // ImVec2 FramePadding - ImGuiStyleVar_FrameRounding, // float FrameRounding - ImGuiStyleVar_FrameBorderSize, // float FrameBorderSize - ImGuiStyleVar_ItemSpacing, // ImVec2 ItemSpacing - ImGuiStyleVar_ItemInnerSpacing, // ImVec2 ItemInnerSpacing - ImGuiStyleVar_IndentSpacing, // float IndentSpacing - ImGuiStyleVar_CellPadding, // ImVec2 CellPadding - ImGuiStyleVar_ScrollbarSize, // float ScrollbarSize - ImGuiStyleVar_ScrollbarRounding, // float ScrollbarRounding - ImGuiStyleVar_GrabMinSize, // float GrabMinSize - ImGuiStyleVar_GrabRounding, // float GrabRounding - ImGuiStyleVar_TabRounding, // float TabRounding - ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign - ImGuiStyleVar_SelectableTextAlign, // ImVec2 SelectableTextAlign - ImGuiStyleVar_SeparatorTextBorderSize,// float SeparatorTextBorderSize - ImGuiStyleVar_SeparatorTextAlign, // ImVec2 SeparatorTextAlign - ImGuiStyleVar_SeparatorTextPadding,// ImVec2 SeparatorTextPadding + // Enum name -------------------------- // Member in ImGuiStyle structure (see ImGuiStyle for descriptions) + ImGuiStyleVar_Alpha, // float Alpha + ImGuiStyleVar_DisabledAlpha, // float DisabledAlpha + ImGuiStyleVar_WindowPadding, // ImVec2 WindowPadding + ImGuiStyleVar_WindowRounding, // float WindowRounding + ImGuiStyleVar_WindowBorderSize, // float WindowBorderSize + ImGuiStyleVar_WindowMinSize, // ImVec2 WindowMinSize + ImGuiStyleVar_WindowTitleAlign, // ImVec2 WindowTitleAlign + ImGuiStyleVar_ChildRounding, // float ChildRounding + ImGuiStyleVar_ChildBorderSize, // float ChildBorderSize + ImGuiStyleVar_PopupRounding, // float PopupRounding + ImGuiStyleVar_PopupBorderSize, // float PopupBorderSize + ImGuiStyleVar_FramePadding, // ImVec2 FramePadding + ImGuiStyleVar_FrameRounding, // float FrameRounding + ImGuiStyleVar_FrameBorderSize, // float FrameBorderSize + ImGuiStyleVar_ItemSpacing, // ImVec2 ItemSpacing + ImGuiStyleVar_ItemInnerSpacing, // ImVec2 ItemInnerSpacing + ImGuiStyleVar_IndentSpacing, // float IndentSpacing + ImGuiStyleVar_CellPadding, // ImVec2 CellPadding + ImGuiStyleVar_ScrollbarSize, // float ScrollbarSize + ImGuiStyleVar_ScrollbarRounding, // float ScrollbarRounding + ImGuiStyleVar_GrabMinSize, // float GrabMinSize + ImGuiStyleVar_GrabRounding, // float GrabRounding + ImGuiStyleVar_TabRounding, // float TabRounding + ImGuiStyleVar_TabBorderSize, // float TabBorderSize + ImGuiStyleVar_TabBarBorderSize, // float TabBarBorderSize + ImGuiStyleVar_TabBarOverlineSize, // float TabBarOverlineSize + ImGuiStyleVar_TableAngledHeadersAngle, // float TableAngledHeadersAngle + ImGuiStyleVar_TableAngledHeadersTextAlign,// ImVec2 TableAngledHeadersTextAlign + ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign + ImGuiStyleVar_SelectableTextAlign, // ImVec2 SelectableTextAlign + ImGuiStyleVar_SeparatorTextBorderSize, // float SeparatorTextBorderSize + ImGuiStyleVar_SeparatorTextAlign, // ImVec2 SeparatorTextAlign + ImGuiStyleVar_SeparatorTextPadding, // ImVec2 SeparatorTextPadding ImGuiStyleVar_COUNT }; @@ -1662,10 +1746,8 @@ enum ImGuiButtonFlags_ ImGuiButtonFlags_MouseButtonLeft = 1 << 0, // React on left mouse button (default) ImGuiButtonFlags_MouseButtonRight = 1 << 1, // React on right mouse button ImGuiButtonFlags_MouseButtonMiddle = 1 << 2, // React on center mouse button - - // [Internal] - ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle, - ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft, + ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle, // [Internal] + ImGuiButtonFlags_EnableNav = 1 << 3, // InvisibleButton(): do not disable navigation/tabbing. Otherwise disabled by default. }; // Flags for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton() @@ -1714,18 +1796,18 @@ enum ImGuiColorEditFlags_ // Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc. // We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them. -// (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigDragClickToInputText) +// (Those are per-item flags. There is shared behavior flag too: ImGuiIO: io.ConfigDragClickToInputText) enum ImGuiSliderFlags_ { - ImGuiSliderFlags_None = 0, - ImGuiSliderFlags_AlwaysClamp = 1 << 4, // Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds. - ImGuiSliderFlags_Logarithmic = 1 << 5, // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits. - ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits) - ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget - ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed. - - // Obsolete names - //ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79] + ImGuiSliderFlags_None = 0, + ImGuiSliderFlags_Logarithmic = 1 << 5, // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits. + ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits). + ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget. + ImGuiSliderFlags_WrapAround = 1 << 8, // Enable wrapping around from max to min and from min to max. Only supported by DragXXX() functions for now. + ImGuiSliderFlags_ClampOnInput = 1 << 9, // Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds. + ImGuiSliderFlags_ClampZeroRange = 1 << 10, // Clamp even if min==max==0.0f. Otherwise due to legacy reason DragXXX functions don't clamp with those values. When your clamping limits are dynamic you almost always want to use it. + ImGuiSliderFlags_AlwaysClamp = ImGuiSliderFlags_ClampOnInput | ImGuiSliderFlags_ClampZeroRange, + ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed. }; // Identify a mouse button. @@ -1767,7 +1849,7 @@ enum ImGuiMouseSource : int ImGuiMouseSource_COUNT }; -// Enumeration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions +// Enumeration for ImGui::SetNextWindow***(), SetWindow***(), SetNextItem***() functions // Represent a condition. // Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always. enum ImGuiCond_ @@ -1780,9 +1862,183 @@ enum ImGuiCond_ }; //----------------------------------------------------------------------------- -// [SECTION] Helpers: Memory allocations macros, ImVector<> +// [SECTION] Tables API flags and structures (ImGuiTableFlags, ImGuiTableColumnFlags, ImGuiTableRowFlags, ImGuiTableBgTarget, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs) +//----------------------------------------------------------------------------- + +// Flags for ImGui::BeginTable() +// - Important! Sizing policies have complex and subtle side effects, much more so than you would expect. +// Read comments/demos carefully + experiment with live demos to get acquainted with them. +// - The DEFAULT sizing policies are: +// - Default to ImGuiTableFlags_SizingFixedFit if ScrollX is on, or if host window has ImGuiWindowFlags_AlwaysAutoResize. +// - Default to ImGuiTableFlags_SizingStretchSame if ScrollX is off. +// - When ScrollX is off: +// - Table defaults to ImGuiTableFlags_SizingStretchSame -> all Columns defaults to ImGuiTableColumnFlags_WidthStretch with same weight. +// - Columns sizing policy allowed: Stretch (default), Fixed/Auto. +// - Fixed Columns (if any) will generally obtain their requested width (unless the table cannot fit them all). +// - Stretch Columns will share the remaining width according to their respective weight. +// - Mixed Fixed/Stretch columns is possible but has various side-effects on resizing behaviors. +// The typical use of mixing sizing policies is: any number of LEADING Fixed columns, followed by one or two TRAILING Stretch columns. +// (this is because the visible order of columns have subtle but necessary effects on how they react to manual resizing). +// - When ScrollX is on: +// - Table defaults to ImGuiTableFlags_SizingFixedFit -> all Columns defaults to ImGuiTableColumnFlags_WidthFixed +// - Columns sizing policy allowed: Fixed/Auto mostly. +// - Fixed Columns can be enlarged as needed. Table will show a horizontal scrollbar if needed. +// - When using auto-resizing (non-resizable) fixed columns, querying the content width to use item right-alignment e.g. SetNextItemWidth(-FLT_MIN) doesn't make sense, would create a feedback loop. +// - Using Stretch columns OFTEN DOES NOT MAKE SENSE if ScrollX is on, UNLESS you have specified a value for 'inner_width' in BeginTable(). +// If you specify a value for 'inner_width' then effectively the scrolling space is known and Stretch or mixed Fixed/Stretch columns become meaningful again. +// - Read on documentation at the top of imgui_tables.cpp for details. +enum ImGuiTableFlags_ +{ + // Features + ImGuiTableFlags_None = 0, + ImGuiTableFlags_Resizable = 1 << 0, // Enable resizing columns. + ImGuiTableFlags_Reorderable = 1 << 1, // Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers) + ImGuiTableFlags_Hideable = 1 << 2, // Enable hiding/disabling columns in context menu. + ImGuiTableFlags_Sortable = 1 << 3, // Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see ImGuiTableFlags_SortMulti and ImGuiTableFlags_SortTristate. + ImGuiTableFlags_NoSavedSettings = 1 << 4, // Disable persisting columns order, width and sort settings in the .ini file. + ImGuiTableFlags_ContextMenuInBody = 1 << 5, // Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow(). + // Decorations + ImGuiTableFlags_RowBg = 1 << 6, // Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually) + ImGuiTableFlags_BordersInnerH = 1 << 7, // Draw horizontal borders between rows. + ImGuiTableFlags_BordersOuterH = 1 << 8, // Draw horizontal borders at the top and bottom. + ImGuiTableFlags_BordersInnerV = 1 << 9, // Draw vertical borders between columns. + ImGuiTableFlags_BordersOuterV = 1 << 10, // Draw vertical borders on the left and right sides. + ImGuiTableFlags_BordersH = ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterH, // Draw horizontal borders. + ImGuiTableFlags_BordersV = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersOuterV, // Draw vertical borders. + ImGuiTableFlags_BordersInner = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH, // Draw inner borders. + ImGuiTableFlags_BordersOuter = ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH, // Draw outer borders. + ImGuiTableFlags_Borders = ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter, // Draw all borders. + ImGuiTableFlags_NoBordersInBody = 1 << 11, // [ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style + ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 12, // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style + // Sizing Policy (read above for defaults) + ImGuiTableFlags_SizingFixedFit = 1 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width. + ImGuiTableFlags_SizingFixedSame = 2 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible. + ImGuiTableFlags_SizingStretchProp = 3 << 13, // Columns default to _WidthStretch with default weights proportional to each columns contents widths. + ImGuiTableFlags_SizingStretchSame = 4 << 13, // Columns default to _WidthStretch with default weights all equal, unless overridden by TableSetupColumn(). + // Sizing Extra Options + ImGuiTableFlags_NoHostExtendX = 1 << 16, // Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used. + ImGuiTableFlags_NoHostExtendY = 1 << 17, // Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible. + ImGuiTableFlags_NoKeepColumnsVisible = 1 << 18, // Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable. + ImGuiTableFlags_PreciseWidths = 1 << 19, // Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth. + // Clipping + ImGuiTableFlags_NoClip = 1 << 20, // Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze(). + // Padding + ImGuiTableFlags_PadOuterX = 1 << 21, // Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers. + ImGuiTableFlags_NoPadOuterX = 1 << 22, // Default if BordersOuterV is off. Disable outermost padding. + ImGuiTableFlags_NoPadInnerX = 1 << 23, // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off). + // Scrolling + ImGuiTableFlags_ScrollX = 1 << 24, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX. + ImGuiTableFlags_ScrollY = 1 << 25, // Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. + // Sorting + ImGuiTableFlags_SortMulti = 1 << 26, // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1). + ImGuiTableFlags_SortTristate = 1 << 27, // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0). + // Miscellaneous + ImGuiTableFlags_HighlightHoveredColumn = 1 << 28, // Highlight column headers when hovered (may evolve into a fuller highlight) + + // [Internal] Combinations and masks + ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame, +}; + +// Flags for ImGui::TableSetupColumn() +enum ImGuiTableColumnFlags_ +{ + // Input configuration flags + ImGuiTableColumnFlags_None = 0, + ImGuiTableColumnFlags_Disabled = 1 << 0, // Overriding/master disable flag: hide column, won't show in context menu (unlike calling TableSetColumnEnabled() which manipulates the user accessible state) + ImGuiTableColumnFlags_DefaultHide = 1 << 1, // Default as a hidden/disabled column. + ImGuiTableColumnFlags_DefaultSort = 1 << 2, // Default as a sorting column. + ImGuiTableColumnFlags_WidthStretch = 1 << 3, // Column will stretch. Preferable with horizontal scrolling disabled (default if table sizing policy is _SizingStretchSame or _SizingStretchProp). + ImGuiTableColumnFlags_WidthFixed = 1 << 4, // Column will not stretch. Preferable with horizontal scrolling enabled (default if table sizing policy is _SizingFixedFit and table is resizable). + ImGuiTableColumnFlags_NoResize = 1 << 5, // Disable manual resizing. + ImGuiTableColumnFlags_NoReorder = 1 << 6, // Disable manual reordering this column, this will also prevent other columns from crossing over this column. + ImGuiTableColumnFlags_NoHide = 1 << 7, // Disable ability to hide/disable this column. + ImGuiTableColumnFlags_NoClip = 1 << 8, // Disable clipping for this column (all NoClip columns will render in a same draw command). + ImGuiTableColumnFlags_NoSort = 1 << 9, // Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table). + ImGuiTableColumnFlags_NoSortAscending = 1 << 10, // Disable ability to sort in the ascending direction. + ImGuiTableColumnFlags_NoSortDescending = 1 << 11, // Disable ability to sort in the descending direction. + ImGuiTableColumnFlags_NoHeaderLabel = 1 << 12, // TableHeadersRow() will submit an empty label for this column. Convenient for some small columns. Name will still appear in context menu or in angled headers. You may append into this cell by calling TableSetColumnIndex() right after the TableHeadersRow() call. + ImGuiTableColumnFlags_NoHeaderWidth = 1 << 13, // Disable header text width contribution to automatic column width. + ImGuiTableColumnFlags_PreferSortAscending = 1 << 14, // Make the initial sort direction Ascending when first sorting on this column (default). + ImGuiTableColumnFlags_PreferSortDescending = 1 << 15, // Make the initial sort direction Descending when first sorting on this column. + ImGuiTableColumnFlags_IndentEnable = 1 << 16, // Use current Indent value when entering cell (default for column 0). + ImGuiTableColumnFlags_IndentDisable = 1 << 17, // Ignore current Indent value when entering cell (default for columns > 0). Indentation changes _within_ the cell will still be honored. + ImGuiTableColumnFlags_AngledHeader = 1 << 18, // TableHeadersRow() will submit an angled header row for this column. Note this will add an extra row. + + // Output status flags, read-only via TableGetColumnFlags() + ImGuiTableColumnFlags_IsEnabled = 1 << 24, // Status: is enabled == not hidden by user/api (referred to as "Hide" in _DefaultHide and _NoHide) flags. + ImGuiTableColumnFlags_IsVisible = 1 << 25, // Status: is visible == is enabled AND not clipped by scrolling. + ImGuiTableColumnFlags_IsSorted = 1 << 26, // Status: is currently part of the sort specs + ImGuiTableColumnFlags_IsHovered = 1 << 27, // Status: is hovered by mouse + + // [Internal] Combinations and masks + ImGuiTableColumnFlags_WidthMask_ = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_WidthFixed, + ImGuiTableColumnFlags_IndentMask_ = ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_IndentDisable, + ImGuiTableColumnFlags_StatusMask_ = ImGuiTableColumnFlags_IsEnabled | ImGuiTableColumnFlags_IsVisible | ImGuiTableColumnFlags_IsSorted | ImGuiTableColumnFlags_IsHovered, + ImGuiTableColumnFlags_NoDirectResize_ = 1 << 30, // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge) +}; + +// Flags for ImGui::TableNextRow() +enum ImGuiTableRowFlags_ +{ + ImGuiTableRowFlags_None = 0, + ImGuiTableRowFlags_Headers = 1 << 0, // Identify header row (set default background color + width of its contents accounted differently for auto column width) +}; + +// Enum for ImGui::TableSetBgColor() +// Background colors are rendering in 3 layers: +// - Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set. +// - Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set. +// - Layer 2: draw with CellBg color if set. +// The purpose of the two row/columns layers is to let you decide if a background color change should override or blend with the existing color. +// When using ImGuiTableFlags_RowBg on the table, each row has the RowBg0 color automatically set for odd/even rows. +// If you set the color of RowBg0 target, your color will override the existing RowBg0 color. +// If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color. +enum ImGuiTableBgTarget_ +{ + ImGuiTableBgTarget_None = 0, + ImGuiTableBgTarget_RowBg0 = 1, // Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used) + ImGuiTableBgTarget_RowBg1 = 2, // Set row background color 1 (generally used for selection marking) + ImGuiTableBgTarget_CellBg = 3, // Set cell background color (top-most color) +}; + +// Sorting specifications for a table (often handling sort specs for a single column, occasionally more) +// Obtained by calling TableGetSortSpecs(). +// When 'SpecsDirty == true' you can sort your data. It will be true with sorting specs have changed since last call, or the first time. +// Make sure to set 'SpecsDirty = false' after sorting, else you may wastefully sort your data every frame! +struct ImGuiTableSortSpecs +{ + const ImGuiTableColumnSortSpecs* Specs; // Pointer to sort spec array. + int SpecsCount; // Sort spec count. Most often 1. May be > 1 when ImGuiTableFlags_SortMulti is enabled. May be == 0 when ImGuiTableFlags_SortTristate is enabled. + bool SpecsDirty; // Set to true when specs have changed since last time! Use this to sort again, then clear the flag. + + ImGuiTableSortSpecs() { memset(this, 0, sizeof(*this)); } +}; + +// Sorting specification for one column of a table (sizeof == 12 bytes) +struct ImGuiTableColumnSortSpecs +{ + ImGuiID ColumnUserID; // User id of the column (if specified by a TableSetupColumn() call) + ImS16 ColumnIndex; // Index of the column + ImS16 SortOrder; // Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here) + ImGuiSortDirection SortDirection; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending + + ImGuiTableColumnSortSpecs() { memset(this, 0, sizeof(*this)); } +}; + +//----------------------------------------------------------------------------- +// [SECTION] Helpers: Debug log, memory allocations macros, ImVector<> //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// Debug Logging into ShowDebugLogWindow(), tty and more. +//----------------------------------------------------------------------------- + +#ifndef IMGUI_DISABLE_DEBUG_TOOLS +#define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__) +#else +#define IMGUI_DEBUG_LOG(...) ((void)0) +#endif + //----------------------------------------------------------------------------- // IM_MALLOC(), IM_FREE(), IM_NEW(), IM_PLACEMENT_NEW(), IM_DELETE() // We call C++ constructor on own allocated memory via the placement "new(ptr) Type()" syntax. @@ -1868,6 +2124,7 @@ struct ImVector inline bool contains(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; } inline T* find(const T& v) { T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data == v) break; else ++data; return data; } inline const T* find(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data == v) break; else ++data; return data; } + inline int find_index(const T& v) const { const T* data_end = Data + Size; const T* it = find(v); if (it == data_end) return -1; const ptrdiff_t off = it - Data; return (int)off; } inline bool find_erase(const T& v) { const T* it = find(v); if (it < Data + Size) { erase(it); return true; } return false; } inline bool find_erase_unsorted(const T& v) { const T* it = find(v); if (it < Data + Size) { erase_unsorted(it); return true; } return false; } inline int index_from_ptr(const T* it) const { IM_ASSERT(it >= Data && it < Data + Size); const ptrdiff_t off = it - Data; return (int)off; } @@ -1901,7 +2158,7 @@ struct ImGuiStyle float FrameBorderSize; // Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines. ImVec2 ItemInnerSpacing; // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label). - ImVec2 CellPadding; // Padding within a table cell. CellPadding.y may be altered between different rows. + ImVec2 CellPadding; // Padding within a table cell. Cellpadding.x is locked for entire table. CellPadding.y may be altered between different rows. ImVec2 TouchExtraPadding; // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! float IndentSpacing; // Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2). float ColumnsMinSpacing; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1). @@ -1913,15 +2170,19 @@ struct ImGuiStyle float TabRounding; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs. float TabBorderSize; // Thickness of border around tabs. float TabMinWidthForCloseButton; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected. + float TabBarBorderSize; // Thickness of tab-bar separator, which takes on the tab active color to denote focus. + float TabBarOverlineSize; // Thickness of tab-bar overline, which highlights the selected tab-bar. + float TableAngledHeadersAngle; // Angle of angled headers (supported values range from -50.0f degrees to +50.0f degrees). + ImVec2 TableAngledHeadersTextAlign;// Alignment of angled headers within the cell ImGuiDir ColorButtonPosition; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right. ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered). ImVec2 SelectableTextAlign; // Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line. - float SeparatorTextBorderSize; // Thickkness of border in SeparatorText() + float SeparatorTextBorderSize; // Thickness of border in SeparatorText() ImVec2 SeparatorTextAlign; // Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center). ImVec2 SeparatorTextPadding; // Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y. - ImVec2 DisplayWindowPadding; // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows. - ImVec2 DisplaySafeAreaPadding; // If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly! - float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. + ImVec2 DisplayWindowPadding; // Apply to regular windows: amount which we enforce to keep visible when moving near edges of your screen. + ImVec2 DisplaySafeAreaPadding; // Apply to every windows, menus, popups, tooltips: amount where we avoid displaying contents. Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured). + float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). We apply per-monitor DPI scaling over this scale. May be removed later. bool AntiAliasedLines; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList). bool AntiAliasedLinesUseTex; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering). Latched at the beginning of the frame (copied to ImDrawList). bool AntiAliasedFill; // Enable anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList). @@ -1946,6 +2207,11 @@ struct ImGuiStyle //----------------------------------------------------------------------------- // Communicate most settings and inputs/outputs to Dear ImGui using this structure. // Access via ImGui::GetIO(). Read 'Programmer guide' section in .cpp file for general usage. +// It is generally expected that: +// - initialization: backends and user code writes to ImGuiIO. +// - main loop: backends writes to ImGuiIO, user code and imgui code reads from ImGuiIO. +//----------------------------------------------------------------------------- +// Also see ImGui::GetPlatformIO() and ImGuiPlatformIO struct for OS/platform related functions: clipboard, IME etc. //----------------------------------------------------------------------------- // [Internal] Storage used by IsKeyDown(), IsKeyPressed() etc functions. @@ -1964,7 +2230,7 @@ struct ImGuiIO // Configuration // Default value //------------------------------------------------------------------ - ImGuiConfigFlags ConfigFlags; // = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc. + ImGuiConfigFlags ConfigFlags; // = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Keyboard/Gamepad navigation options, etc. ImGuiBackendFlags BackendFlags; // = 0 // See ImGuiBackendFlags_ enum. Set by backend (imgui_impl_xxx files or custom backend) to communicate features supported by the backend. ImVec2 DisplaySize; // // Main display size, in pixels (generally == GetMainViewport()->Size). May change every frame. float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds. May change every frame. @@ -1973,21 +2239,33 @@ struct ImGuiIO const char* LogFilename; // = "imgui_log.txt"// Path to .log file (default parameter to ImGui::LogToFile when no file is specified). void* UserData; // = NULL // Store your own data. + // Font system ImFontAtlas*Fonts; // // Font atlas: load, rasterize and pack one or more fonts into a single texture. float FontGlobalScale; // = 1.0f // Global scale all fonts bool FontAllowUserScaling; // = false // Allow user scaling text of individual window with CTRL+Wheel. ImFont* FontDefault; // = NULL // Font to use on NewFrame(). Use NULL to uses Fonts->Fonts[0]. ImVec2 DisplayFramebufferScale; // = (1, 1) // For retina display or other situations where window coordinates are different from framebuffer coordinates. This generally ends up in ImDrawData::FramebufferScale. + // Keyboard/Gamepad Navigation options + bool ConfigNavSwapGamepadButtons; // = false // Swap Activate<>Cancel (A<>B) buttons, matching typical "Nintendo/Japanese style" gamepad layout. + bool ConfigNavMoveSetMousePos; // = false // Directional/tabbing navigation teleports the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is difficult. Will update io.MousePos and set io.WantSetMousePos=true. + bool ConfigNavCaptureKeyboard; // = true // Sets io.WantCaptureKeyboard when io.NavActive is set. + bool ConfigNavEscapeClearFocusItem; // = true // Pressing Escape can clear focused item + navigation id/highlight. Set to false if you want to always keep highlight on. + bool ConfigNavEscapeClearFocusWindow;// = false // Pressing Escape can clear focused window as well (super set of io.ConfigNavEscapeClearFocusItem). + bool ConfigNavCursorVisibleAuto; // = true // Using directional navigation key makes the cursor visible. Mouse click hides the cursor. + bool ConfigNavCursorVisibleAlways; // = false // Navigation cursor is always visible. + // Miscellaneous options + // (you can visualize and interact with all options in 'Demo->Configuration') bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations. - bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl. + bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // Swap Cmd<>Ctrl keys + OS X style text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl. bool ConfigInputTrickleEventQueue; // = true // Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates. bool ConfigInputTextCursorBlink; // = true // Enable blinking cursor (optional as some users consider it to be distracting). bool ConfigInputTextEnterKeepActive; // = false // [BETA] Pressing Enter will keep item active and select contents (single-line only). bool ConfigDragClickToInputText; // = false // [BETA] Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving). Not desirable on devices without a keyboard. bool ConfigWindowsResizeFromEdges; // = true // Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag) - bool ConfigWindowsMoveFromTitleBarOnly; // = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar. + bool ConfigWindowsMoveFromTitleBarOnly; // = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar. + bool ConfigScrollbarScrollByPage; // = true // Enable scrolling page by page when clicking outside the scrollbar grab. When disabled, always scroll to clicked location. When enabled, Shift+Click scrolls to clicked location. float ConfigMemoryCompactTimer; // = 60.0f // Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable. // Inputs Behaviors @@ -2002,23 +2280,54 @@ struct ImGuiIO // Debug options //------------------------------------------------------------------ + // Options to configure Error Handling and how we handle recoverable errors [EXPERIMENTAL] + // - Error recovery is provided as a way to facilitate: + // - Recovery after a programming error (native code or scripting language - the later tends to facilitate iterating on code while running). + // - Recovery after running an exception handler or any error processing which may skip code after an error has been detected. + // - Error recovery is not perfect nor guaranteed! It is a feature to ease development. + // You not are not supposed to rely on it in the course of a normal application run. + // - Functions that support error recovery are using IM_ASSERT_USER_ERROR() instead of IM_ASSERT(). + // - By design, we do NOT allow error recovery to be 100% silent. One of the three options needs to be checked! + // - Always ensure that on programmers seats you have at minimum Asserts or Tooltips enabled when making direct imgui API calls! + // Otherwise it would severely hinder your ability to catch and correct mistakes! + // Read https://github.com/ocornut/imgui/wiki/Error-Handling for details. + // - Programmer seats: keep asserts (default), or disable asserts and keep error tooltips (new and nice!) + // - Non-programmer seats: maybe disable asserts, but make sure errors are resurfaced (tooltips, visible log entries, use callback etc.) + // - Recovery after error/exception: record stack sizes with ErrorRecoveryStoreState(), disable assert, set log callback (to e.g. trigger high-level breakpoint), recover with ErrorRecoveryTryToRecoverState(), restore settings. + bool ConfigErrorRecovery; // = true // Enable error recovery support. Some errors won't be detected and lead to direct crashes if recovery is disabled. + bool ConfigErrorRecoveryEnableAssert; // = true // Enable asserts on recoverable error. By default call IM_ASSERT() when returning from a failing IM_ASSERT_USER_ERROR() + bool ConfigErrorRecoveryEnableDebugLog; // = true // Enable debug log output on recoverable errors. + bool ConfigErrorRecoveryEnableTooltip; // = true // Enable tooltip on recoverable errors. The tooltip include a way to enable asserts if they were disabled. + + // Option to enable various debug tools showing buttons that will call the IM_DEBUG_BREAK() macro. + // - The Item Picker tool will be available regardless of this being enabled, in order to maximize its discoverability. + // - Requires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application. + // e.g. io.ConfigDebugIsDebuggerPresent = ::IsDebuggerPresent() on Win32, or refer to ImOsIsDebuggerPresent() imgui_test_engine/imgui_te_utils.cpp for a Unix compatible version). + bool ConfigDebugIsDebuggerPresent; // = false // Enable various tools calling IM_DEBUG_BREAK(). + + // Tools to detect code submitting items with conflicting/duplicate IDs + // - Code should use PushID()/PopID() in loops, or append "##xx" to same-label identifiers. + // - Empty label e.g. Button("") == same ID as parent widget/node. Use Button("##xx") instead! + // - See FAQ https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-about-the-id-stack-system + bool ConfigDebugHighlightIdConflicts;// = true // Highlight and show an error message when multiple items have conflicting identifiers. + // Tools to test correct Begin/End and BeginChild/EndChild behaviors. - // Presently Begin()/End() and BeginChild()/EndChild() needs to ALWAYS be called in tandem, regardless of return value of BeginXXX() - // This is inconsistent with other BeginXXX functions and create confusion for many users. - // We expect to update the API eventually. In the meanwhile we provide tools to facilitate checking user-code behavior. + // - Presently Begin()/End() and BeginChild()/EndChild() needs to ALWAYS be called in tandem, regardless of return value of BeginXXX() + // - This is inconsistent with other BeginXXX functions and create confusion for many users. + // - We expect to update the API eventually. In the meanwhile we provide tools to facilitate checking user-code behavior. bool ConfigDebugBeginReturnValueOnce;// = false // First-time calls to Begin()/BeginChild() will return false. NEEDS TO BE SET AT APPLICATION BOOT TIME if you don't want to miss windows. bool ConfigDebugBeginReturnValueLoop;// = false // Some calls to Begin()/BeginChild() will return false. Will cycle through window depths then repeat. Suggested use: add "io.ConfigDebugBeginReturnValue = io.KeyShift" in your main loop then occasionally press SHIFT. Windows should be flickering while running. - // Option to deactivate io.AddFocusEvent(false) handling. May facilitate interactions with a debugger when focus loss leads to clearing inputs data. - // Backends may have other side-effects on focus loss, so this will reduce side-effects but not necessary remove all of them. - // Consider using e.g. Win32's IsDebuggerPresent() as an additional filter (or see ImOsIsDebuggerPresent() in imgui_test_engine/imgui_te_utils.cpp for a Unix compatible version). - bool ConfigDebugIgnoreFocusLoss; // = false // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys() in input processing. + // Option to deactivate io.AddFocusEvent(false) handling. + // - May facilitate interactions with a debugger when focus loss leads to clearing inputs data. + // - Backends may have other side-effects on focus loss, so this will reduce side-effects but not necessary remove all of them. + bool ConfigDebugIgnoreFocusLoss; // = false // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys()/io.ClearInputMouse() in input processing. - // Options to audit .ini data + // Option to audit .ini data bool ConfigDebugIniSettings; // = false // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower) //------------------------------------------------------------------ - // Platform Functions + // Platform Identifiers // (the imgui_impl_xxxx backend files are setting those up for you) //------------------------------------------------------------------ @@ -2029,24 +2338,6 @@ struct ImGuiIO void* BackendRendererUserData; // = NULL // User data for renderer backend void* BackendLanguageUserData; // = NULL // User data for non C++ programming language backend - // Optional: Access OS clipboard - // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures) - const char* (*GetClipboardTextFn)(void* user_data); - void (*SetClipboardTextFn)(void* user_data, const char* text); - void* ClipboardUserData; - - // Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows) - // (default to use native imm32 api on Windows) - void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data); -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - void* ImeWindowHandle; // = NULL // [Obsolete] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning. -#else - void* _UnusedPadding; // Unused field to keep data structure the same size. -#endif - - // Optional: Platform locale - ImWchar PlatformLocaleDecimalPoint; // '.' // [Experimental] Configure decimal point e.g. '.' or ',' useful for some languages (e.g. German), generally pulled from *localeconv()->decimal_point - //------------------------------------------------------------------ // Input - Call before calling NewFrame() //------------------------------------------------------------------ @@ -2066,9 +2357,10 @@ struct ImGuiIO IMGUI_API void SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index = -1); // [Optional] Specify index for legacy <1.87 IsKeyXXX() functions with native indices + specify native keycode, scancode. IMGUI_API void SetAppAcceptingEvents(bool accepting_events); // Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen. IMGUI_API void ClearEventsQueue(); // Clear all incoming events. - IMGUI_API void ClearInputKeys(); // Clear current keyboard/mouse/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons. + IMGUI_API void ClearInputKeys(); // Clear current keyboard/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons. + IMGUI_API void ClearInputMouse(); // Clear current mouse state. #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - IMGUI_API void ClearInputCharacters(); // [Obsolete] Clear the current frame text input buffer. Now included within ClearInputKeys(). + IMGUI_API void ClearInputCharacters(); // [Obsoleted in 1.89.8] Clear the current frame text input buffer. Now included within ClearInputKeys(). #endif //------------------------------------------------------------------ @@ -2080,27 +2372,17 @@ struct ImGuiIO bool WantCaptureMouse; // Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.). bool WantCaptureKeyboard; // Set when Dear ImGui will use keyboard inputs, in this case do not dispatch them to your main game/application (either way, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.). bool WantTextInput; // Mobile/console: when set, you may display an on-screen keyboard. This is set by Dear ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active). - bool WantSetMousePos; // MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled. + bool WantSetMousePos; // MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when io.ConfigNavMoveSetMousePos is enabled. bool WantSaveIniSettings; // When manual .ini load/save is active (io.IniFilename == NULL), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. Important: clear io.WantSaveIniSettings yourself after saving! bool NavActive; // Keyboard/Gamepad navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag. - bool NavVisible; // Keyboard/Gamepad navigation is visible and allowed (will handle ImGuiKey_NavXXX events). + bool NavVisible; // Keyboard/Gamepad navigation highlight is visible and allowed (will handle ImGuiKey_NavXXX events). float Framerate; // Estimate of application framerate (rolling average over 60 frames, based on io.DeltaTime), in frame per second. Solely for convenience. Slow applications may not want to use a moving average or may want to reset underlying buffers occasionally. int MetricsRenderVertices; // Vertices output during last call to Render() int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3 int MetricsRenderWindows; // Number of visible windows int MetricsActiveWindows; // Number of active windows - int MetricsActiveAllocations; // Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts. ImVec2 MouseDelta; // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta. - // Legacy: before 1.87, we required backend to fill io.KeyMap[] (imgui->native map) during initialization and io.KeysDown[] (native indices) every frame. - // This is still temporarily supported as a legacy feature. However the new preferred scheme is for backend to call io.AddKeyEvent(). - // Old (<1.87): ImGui::IsKeyPressed(ImGui::GetIO().KeyMap[ImGuiKey_Space]) --> New (1.87+) ImGui::IsKeyPressed(ImGuiKey_Space) -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - int KeyMap[ImGuiKey_COUNT]; // [LEGACY] Input: map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. The first 512 are now unused and should be kept zero. Legacy backend will write into KeyMap[] using ImGuiKey_ indices which are always >512. - bool KeysDown[ImGuiKey_COUNT]; // [LEGACY] Input: Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow. - float NavInputs[ImGuiNavInput_COUNT]; // [LEGACY] Since 1.88, NavInputs[] was removed. Backends from 1.60 to 1.86 won't build. Feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums. -#endif - //------------------------------------------------------------------ // [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed! //------------------------------------------------------------------ @@ -2121,7 +2403,7 @@ struct ImGuiIO bool KeySuper; // Keyboard modifier down: Cmd/Super/Windows // Other state maintained from data above + IO function calls - ImGuiKeyChord KeyMods; // Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags. DOES NOT CONTAINS ImGuiMod_Shortcut which is pretranslated). Read-only, updated by NewFrame() + ImGuiKeyChord KeyMods; // Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags. Read-only, updated by NewFrame() ImGuiKeyData KeysData[ImGuiKey_KeysData_SIZE]; // Key state for all known keys. Use IsKeyXXX() functions to access this. bool WantCaptureMouseUnlessPopupClose; // Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup. ImVec2 MousePosPrev; // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid) @@ -2135,6 +2417,7 @@ struct ImGuiIO bool MouseDownOwned[5]; // Track if button was clicked inside a dear imgui window or over void blocked by a popup. We don't request mouse capture from the application if click started outside ImGui bounds. bool MouseDownOwnedUnlessPopupClose[5]; // Track if button was clicked inside a dear imgui window. bool MouseWheelRequestAxisSwap; // On a non-Mac system, holding SHIFT requests WheelY to perform the equivalent of a WheelX event. On a Mac system this is already enforced by the system. + bool MouseCtrlLeftAsRightClick; // (OSX) Set to true when the current click was a ctrl-click that spawned a simulated right click float MouseDownDuration[5]; // Duration the mouse button has been down (0.0f == just clicked) float MouseDownDurationPrev[5]; // Previous time the mouse button has been down float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the clicking point (used for moving thresholds) @@ -2146,11 +2429,29 @@ struct ImGuiIO ImWchar16 InputQueueSurrogate; // For AddInputCharacterUTF16() ImVector InputQueueCharacters; // Queue of _characters_ input (obtained by platform backend). Fill using AddInputCharacter() helper. + // Legacy: before 1.87, we required backend to fill io.KeyMap[] (imgui->native map) during initialization and io.KeysDown[] (native indices) every frame. + // This is still temporarily supported as a legacy feature. However the new preferred scheme is for backend to call io.AddKeyEvent(). + // Old (<1.87): ImGui::IsKeyPressed(ImGui::GetIO().KeyMap[ImGuiKey_Space]) --> New (1.87+) ImGui::IsKeyPressed(ImGuiKey_Space) +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + int KeyMap[ImGuiKey_COUNT]; // [LEGACY] Input: map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. The first 512 are now unused and should be kept zero. Legacy backend will write into KeyMap[] using ImGuiKey_ indices which are always >512. + bool KeysDown[ImGuiKey_COUNT]; // [LEGACY] Input: Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow. + float NavInputs[ImGuiNavInput_COUNT]; // [LEGACY] Since 1.88, NavInputs[] was removed. Backends from 1.60 to 1.86 won't build. Feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums. + //void* ImeWindowHandle; // [Obsoleted in 1.87] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning. +#endif + + // Legacy: before 1.91.1, clipboard functions were stored in ImGuiIO instead of ImGuiPlatformIO. + // As this is will affect all users of custom engines/backends, we are providing proper legacy redirection (will obsolete). +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + const char* (*GetClipboardTextFn)(void* user_data); + void (*SetClipboardTextFn)(void* user_data, const char* text); + void* ClipboardUserData; +#endif + IMGUI_API ImGuiIO(); }; //----------------------------------------------------------------------------- -// [SECTION] Misc data structures +// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload) //----------------------------------------------------------------------------- // Shared state of InputText(), passed as an argument to your callback when a ImGuiInputTextFlags_Callback* flag is used. @@ -2170,6 +2471,8 @@ struct ImGuiInputTextCallbackData void* UserData; // What user passed to InputText() // Read-only // Arguments for the different callback events + // - During Resize callback, Buf will be same as your input buffer. + // - However, during Completion/History/Always callback, Buf always points to our own internal data (it is not the same as your buffer)! Changes to it will be reflected into your own buffer shortly after the callback. // - To modify the text buffer in a callback, prefer using the InsertChars() / DeleteChars() function. InsertChars() will take care of calling the resize callback if necessary. // - If you know your edits are not going to resize the underlying buffer allocation, you may modify the contents of 'Buf[]' directly. You need to update 'BufTextLen' accordingly (0 <= BufTextLen < BufSize) and set 'BufDirty'' to true so InputText can update its internal state. ImWchar EventChar; // Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0; @@ -2224,30 +2527,6 @@ struct ImGuiPayload bool IsDelivery() const { return Delivery; } }; -// Sorting specification for one column of a table (sizeof == 12 bytes) -struct ImGuiTableColumnSortSpecs -{ - ImGuiID ColumnUserID; // User id of the column (if specified by a TableSetupColumn() call) - ImS16 ColumnIndex; // Index of the column - ImS16 SortOrder; // Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here) - ImGuiSortDirection SortDirection : 8; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending (you can use this or SortSign, whichever is more convenient for your sort function) - - ImGuiTableColumnSortSpecs() { memset(this, 0, sizeof(*this)); } -}; - -// Sorting specifications for a table (often handling sort specs for a single column, occasionally more) -// Obtained by calling TableGetSortSpecs(). -// When 'SpecsDirty == true' you can sort your data. It will be true with sorting specs have changed since last call, or the first time. -// Make sure to set 'SpecsDirty = false' after sorting, else you may wastefully sort your data every frame! -struct ImGuiTableSortSpecs -{ - const ImGuiTableColumnSortSpecs* Specs; // Pointer to sort spec array. - int SpecsCount; // Sort spec count. Most often 1. May be > 1 when ImGuiTableFlags_SortMulti is enabled. May be == 0 when ImGuiTableFlags_SortTristate is enabled. - bool SpecsDirty; // Set to true when specs have changed since last time! Use this to sort again, then clear the flag. - - ImGuiTableSortSpecs() { memset(this, 0, sizeof(*this)); } -}; - //----------------------------------------------------------------------------- // [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor) //----------------------------------------------------------------------------- @@ -2316,6 +2595,16 @@ struct ImGuiTextBuffer IMGUI_API void appendfv(const char* fmt, va_list args) IM_FMTLIST(2); }; +// [Internal] Key+Value for ImGuiStorage +struct ImGuiStoragePair +{ + ImGuiID key; + union { int val_i; float val_f; void* val_p; }; + ImGuiStoragePair(ImGuiID _key, int _val) { key = _key; val_i = _val; } + ImGuiStoragePair(ImGuiID _key, float _val) { key = _key; val_f = _val; } + ImGuiStoragePair(ImGuiID _key, void* _val) { key = _key; val_p = _val; } +}; + // Helper: Key->Value storage // Typically you don't have to worry about this since a storage is held within each Window. // We use it to e.g. store collapse state for a tree (Int 0/1) @@ -2327,15 +2616,6 @@ struct ImGuiTextBuffer struct ImGuiStorage { // [Internal] - struct ImGuiStoragePair - { - ImGuiID key; - union { int val_i; float val_f; void* val_p; }; - ImGuiStoragePair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; } - ImGuiStoragePair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; } - ImGuiStoragePair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; } - }; - ImVector Data; // - Get***() functions find pair, never add/allocate. Pairs are sorted so a query is O(log N) @@ -2360,11 +2640,14 @@ struct ImGuiStorage IMGUI_API float* GetFloatRef(ImGuiID key, float default_val = 0.0f); IMGUI_API void** GetVoidPtrRef(ImGuiID key, void* default_val = NULL); - // Use on your own storage if you know only integer are being stored (open/close all tree nodes) + // Advanced: for quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once. + IMGUI_API void BuildSortByKey(); + // Obsolete: use on your own storage if you know only integer are being stored (open/close all tree nodes) IMGUI_API void SetAllInt(int val); - // For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once. - IMGUI_API void BuildSortByKey(); +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + //typedef ::ImGuiStoragePair ImGuiStoragePair; // 1.90.8: moved type outside struct +#endif }; // Helper: Manually clip large list of items. @@ -2395,9 +2678,10 @@ struct ImGuiListClipper int ItemsCount; // [Internal] Number of items float ItemsHeight; // [Internal] Height of item after a first step and item submission can calculate it float StartPosY; // [Internal] Cursor position at the time of Begin() or after table frozen rows are all processed + double StartSeekOffsetY; // [Internal] Account for frozen rows in a table and initial loss of precision in very large windows. void* TempData; // [Internal] Internal data - // items_count: Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step) + // items_count: Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step, and you can call SeekCursorForItem() manually if you need) // items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing(). IMGUI_API ImGuiListClipper(); IMGUI_API ~ImGuiListClipper(); @@ -2410,6 +2694,11 @@ struct ImGuiListClipper inline void IncludeItemByIndex(int item_index) { IncludeItemsByIndex(item_index, item_index + 1); } IMGUI_API void IncludeItemsByIndex(int item_begin, int item_end); // item_end is exclusive e.g. use (42, 42+1) to make item 42 never clipped. + // Seek cursor toward given item. This is automatically called while stepping. + // - The only reason to call this is: you can use ImGuiListClipper::Begin(INT_MAX) if you don't know item count ahead of time. + // - In this case, after all steps are done, you'll want to call SeekCursorForItem(item_count). + IMGUI_API void SeekCursorForItem(int item_index); + #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS inline void IncludeRangeByIndices(int item_begin, int item_end) { IncludeItemsByIndex(item_begin, item_end); } // [renamed in 1.89.9] inline void ForceDisplayRangeByIndices(int item_begin, int item_end) { IncludeItemsByIndex(item_begin, item_end); } // [renamed in 1.89.6] @@ -2420,7 +2709,7 @@ struct ImGuiListClipper // Helpers: ImVec2/ImVec4 operators // - It is important that we are keeping those disabled by default so they don't leak in user space. // - This is in order to allow user enabling implicit cast operators between ImVec2/ImVec4 and their own types (using IM_VEC2_CLASS_EXTRA in imconfig.h) -// - You can use '#define IMGUI_DEFINE_MATH_OPERATORS' to import our operators, provided as a courtesy. +// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4. #ifdef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED IM_MSVC_RUNTIME_CHECKS_OFF @@ -2437,9 +2726,13 @@ static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; } static inline ImVec2& operator*=(ImVec2& lhs, const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y; return lhs; } static inline ImVec2& operator/=(ImVec2& lhs, const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y; return lhs; } +static inline bool operator==(const ImVec2& lhs, const ImVec2& rhs) { return lhs.x == rhs.x && lhs.y == rhs.y; } +static inline bool operator!=(const ImVec2& lhs, const ImVec2& rhs) { return lhs.x != rhs.x || lhs.y != rhs.y; } static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); } static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); } static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); } +static inline bool operator==(const ImVec4& lhs, const ImVec4& rhs) { return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.w == rhs.w; } +static inline bool operator!=(const ImVec4& lhs, const ImVec4& rhs) { return lhs.x != rhs.x || lhs.y != rhs.y || lhs.z != rhs.z || lhs.w != rhs.w; } IM_MSVC_RUNTIME_CHECKS_RESTORE #endif @@ -2486,6 +2779,154 @@ struct ImColor static ImColor HSV(float h, float s, float v, float a = 1.0f) { float r, g, b; ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b); return ImColor(r, g, b, a); } }; +//----------------------------------------------------------------------------- +// [SECTION] Multi-Select API flags and structures (ImGuiMultiSelectFlags, ImGuiSelectionRequestType, ImGuiSelectionRequest, ImGuiMultiSelectIO, ImGuiSelectionBasicStorage) +//----------------------------------------------------------------------------- + +// Multi-selection system +// Documentation at: https://github.com/ocornut/imgui/wiki/Multi-Select +// - Refer to 'Demo->Widgets->Selection State & Multi-Select' for demos using this. +// - This system implements standard multi-selection idioms (CTRL+Mouse/Keyboard, SHIFT+Mouse/Keyboard, etc) +// with support for clipper (skipping non-visible items), box-select and many other details. +// - Selectable(), Checkbox() are supported but custom widgets may use it as well. +// - TreeNode() is technically supported but... using this correctly is more complicated: you need some sort of linear/random access to your tree, +// which is suited to advanced trees setups also implementing filters and clipper. We will work toward simplifying and demoing it. +// - In the spirit of Dear ImGui design, your code owns actual selection data. +// This is designed to allow all kinds of selection storage you may use in your application e.g. set/map/hash. +// About ImGuiSelectionBasicStorage: +// - This is an optional helper to store a selection state and apply selection requests. +// - It is used by our demos and provided as a convenience to quickly implement multi-selection. +// Usage: +// - Identify submitted items with SetNextItemSelectionUserData(), most likely using an index into your current data-set. +// - Store and maintain actual selection data using persistent object identifiers. +// - Usage flow: +// BEGIN - (1) Call BeginMultiSelect() and retrieve the ImGuiMultiSelectIO* result. +// - (2) Honor request list (SetAll/SetRange requests) by updating your selection data. Same code as Step 6. +// - (3) [If using clipper] You need to make sure RangeSrcItem is always submitted. Calculate its index and pass to clipper.IncludeItemByIndex(). If storing indices in ImGuiSelectionUserData, a simple clipper.IncludeItemByIndex(ms_io->RangeSrcItem) call will work. +// LOOP - (4) Submit your items with SetNextItemSelectionUserData() + Selectable()/TreeNode() calls. +// END - (5) Call EndMultiSelect() and retrieve the ImGuiMultiSelectIO* result. +// - (6) Honor request list (SetAll/SetRange requests) by updating your selection data. Same code as Step 2. +// If you submit all items (no clipper), Step 2 and 3 are optional and will be handled by each item themselves. It is fine to always honor those steps. +// About ImGuiSelectionUserData: +// - This can store an application-defined identifier (e.g. index or pointer) submitted via SetNextItemSelectionUserData(). +// - In return we store them into RangeSrcItem/RangeFirstItem/RangeLastItem and other fields in ImGuiMultiSelectIO. +// - Most applications will store an object INDEX, hence the chosen name and type. Storing an index is natural, because +// SetRange requests will give you two end-points and you will need to iterate/interpolate between them to update your selection. +// - However it is perfectly possible to store a POINTER or another IDENTIFIER inside ImGuiSelectionUserData. +// Our system never assume that you identify items by indices, it never attempts to interpolate between two values. +// - If you enable ImGuiMultiSelectFlags_NoRangeSelect then it is guaranteed that you will never have to interpolate +// between two ImGuiSelectionUserData, which may be a convenient way to use part of the feature with less code work. +// - As most users will want to store an index, for convenience and to reduce confusion we use ImS64 instead of void*, +// being syntactically easier to downcast. Feel free to reinterpret_cast and store a pointer inside. + +// Flags for BeginMultiSelect() +enum ImGuiMultiSelectFlags_ +{ + ImGuiMultiSelectFlags_None = 0, + ImGuiMultiSelectFlags_SingleSelect = 1 << 0, // Disable selecting more than one item. This is available to allow single-selection code to share same code/logic if desired. It essentially disables the main purpose of BeginMultiSelect() tho! + ImGuiMultiSelectFlags_NoSelectAll = 1 << 1, // Disable CTRL+A shortcut to select all. + ImGuiMultiSelectFlags_NoRangeSelect = 1 << 2, // Disable Shift+selection mouse/keyboard support (useful for unordered 2D selection). With BoxSelect is also ensure contiguous SetRange requests are not combined into one. This allows not handling interpolation in SetRange requests. + ImGuiMultiSelectFlags_NoAutoSelect = 1 << 3, // Disable selecting items when navigating (useful for e.g. supporting range-select in a list of checkboxes). + ImGuiMultiSelectFlags_NoAutoClear = 1 << 4, // Disable clearing selection when navigating or selecting another one (generally used with ImGuiMultiSelectFlags_NoAutoSelect. useful for e.g. supporting range-select in a list of checkboxes). + ImGuiMultiSelectFlags_NoAutoClearOnReselect = 1 << 5, // Disable clearing selection when clicking/selecting an already selected item. + ImGuiMultiSelectFlags_BoxSelect1d = 1 << 6, // Enable box-selection with same width and same x pos items (e.g. full row Selectable()). Box-selection works better with little bit of spacing between items hit-box in order to be able to aim at empty space. + ImGuiMultiSelectFlags_BoxSelect2d = 1 << 7, // Enable box-selection with varying width or varying x pos items support (e.g. different width labels, or 2D layout/grid). This is slower: alters clipping logic so that e.g. horizontal movements will update selection of normally clipped items. + ImGuiMultiSelectFlags_BoxSelectNoScroll = 1 << 8, // Disable scrolling when box-selecting near edges of scope. + ImGuiMultiSelectFlags_ClearOnEscape = 1 << 9, // Clear selection when pressing Escape while scope is focused. + ImGuiMultiSelectFlags_ClearOnClickVoid = 1 << 10, // Clear selection when clicking on empty location within scope. + ImGuiMultiSelectFlags_ScopeWindow = 1 << 11, // Scope for _BoxSelect and _ClearOnClickVoid is whole window (Default). Use if BeginMultiSelect() covers a whole window or used a single time in same window. + ImGuiMultiSelectFlags_ScopeRect = 1 << 12, // Scope for _BoxSelect and _ClearOnClickVoid is rectangle encompassing BeginMultiSelect()/EndMultiSelect(). Use if BeginMultiSelect() is called multiple times in same window. + ImGuiMultiSelectFlags_SelectOnClick = 1 << 13, // Apply selection on mouse down when clicking on unselected item. (Default) + ImGuiMultiSelectFlags_SelectOnClickRelease = 1 << 14, // Apply selection on mouse release when clicking an unselected item. Allow dragging an unselected item without altering selection. + //ImGuiMultiSelectFlags_RangeSelect2d = 1 << 15, // Shift+Selection uses 2d geometry instead of linear sequence, so possible to use Shift+up/down to select vertically in grid. Analogous to what BoxSelect does. + ImGuiMultiSelectFlags_NavWrapX = 1 << 16, // [Temporary] Enable navigation wrapping on X axis. Provided as a convenience because we don't have a design for the general Nav API for this yet. When the more general feature be public we may obsolete this flag in favor of new one. +}; + +// Main IO structure returned by BeginMultiSelect()/EndMultiSelect(). +// This mainly contains a list of selection requests. +// - Use 'Demo->Tools->Debug Log->Selection' to see requests as they happen. +// - Some fields are only useful if your list is dynamic and allows deletion (getting post-deletion focus/state right is shown in the demo) +// - Below: who reads/writes each fields? 'r'=read, 'w'=write, 'ms'=multi-select code, 'app'=application/user code. +struct ImGuiMultiSelectIO +{ + //------------------------------------------// BeginMultiSelect / EndMultiSelect + ImVector Requests; // ms:w, app:r / ms:w app:r // Requests to apply to your selection data. + ImGuiSelectionUserData RangeSrcItem; // ms:w app:r / // (If using clipper) Begin: Source item (often the first selected item) must never be clipped: use clipper.IncludeItemByIndex() to ensure it is submitted. + ImGuiSelectionUserData NavIdItem; // ms:w, app:r / // (If using deletion) Last known SetNextItemSelectionUserData() value for NavId (if part of submitted items). + bool NavIdSelected; // ms:w, app:r / app:r // (If using deletion) Last known selection state for NavId (if part of submitted items). + bool RangeSrcReset; // app:w / ms:r // (If using deletion) Set before EndMultiSelect() to reset ResetSrcItem (e.g. if deleted selection). + int ItemsCount; // ms:w, app:r / app:r // 'int items_count' parameter to BeginMultiSelect() is copied here for convenience, allowing simpler calls to your ApplyRequests handler. Not used internally. +}; + +// Selection request type +enum ImGuiSelectionRequestType +{ + ImGuiSelectionRequestType_None = 0, + ImGuiSelectionRequestType_SetAll, // Request app to clear selection (if Selected==false) or select all items (if Selected==true). We cannot set RangeFirstItem/RangeLastItem as its contents is entirely up to user (not necessarily an index) + ImGuiSelectionRequestType_SetRange, // Request app to select/unselect [RangeFirstItem..RangeLastItem] items (inclusive) based on value of Selected. Only EndMultiSelect() request this, app code can read after BeginMultiSelect() and it will always be false. +}; + +// Selection request item +struct ImGuiSelectionRequest +{ + //------------------------------------------// BeginMultiSelect / EndMultiSelect + ImGuiSelectionRequestType Type; // ms:w, app:r / ms:w, app:r // Request type. You'll most often receive 1 Clear + 1 SetRange with a single-item range. + bool Selected; // ms:w, app:r / ms:w, app:r // Parameter for SetAll/SetRange requests (true = select, false = unselect) + ImS8 RangeDirection; // / ms:w app:r // Parameter for SetRange request: +1 when RangeFirstItem comes before RangeLastItem, -1 otherwise. Useful if you want to preserve selection order on a backward Shift+Click. + ImGuiSelectionUserData RangeFirstItem; // / ms:w, app:r // Parameter for SetRange request (this is generally == RangeSrcItem when shift selecting from top to bottom). + ImGuiSelectionUserData RangeLastItem; // / ms:w, app:r // Parameter for SetRange request (this is generally == RangeSrcItem when shift selecting from bottom to top). Inclusive! +}; + +// Optional helper to store multi-selection state + apply multi-selection requests. +// - Used by our demos and provided as a convenience to easily implement basic multi-selection. +// - Iterate selection with 'void* it = NULL; ImGuiID id; while (selection.GetNextSelectedItem(&it, &id)) { ... }' +// Or you can check 'if (Contains(id)) { ... }' for each possible object if their number is not too high to iterate. +// - USING THIS IS NOT MANDATORY. This is only a helper and not a required API. +// To store a multi-selection, in your application you could: +// - Use this helper as a convenience. We use our simple key->value ImGuiStorage as a std::set replacement. +// - Use your own external storage: e.g. std::set, std::vector, interval trees, intrusively stored selection etc. +// In ImGuiSelectionBasicStorage we: +// - always use indices in the multi-selection API (passed to SetNextItemSelectionUserData(), retrieved in ImGuiMultiSelectIO) +// - use the AdapterIndexToStorageId() indirection layer to abstract how persistent selection data is derived from an index. +// - use decently optimized logic to allow queries and insertion of very large selection sets. +// - do not preserve selection order. +// Many combinations are possible depending on how you prefer to store your items and how you prefer to store your selection. +// Large applications are likely to eventually want to get rid of this indirection layer and do their own thing. +// See https://github.com/ocornut/imgui/wiki/Multi-Select for details and pseudo-code using this helper. +struct ImGuiSelectionBasicStorage +{ + // Members + int Size; // // Number of selected items, maintained by this helper. + bool PreserveOrder; // = false // GetNextSelectedItem() will return ordered selection (currently implemented by two additional sorts of selection. Could be improved) + void* UserData; // = NULL // User data for use by adapter function // e.g. selection.UserData = (void*)my_items; + ImGuiID (*AdapterIndexToStorageId)(ImGuiSelectionBasicStorage* self, int idx); // e.g. selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { return ((MyItems**)self->UserData)[idx]->ID; }; + int _SelectionOrder;// [Internal] Increasing counter to store selection order + ImGuiStorage _Storage; // [Internal] Selection set. Think of this as similar to e.g. std::set. Prefer not accessing directly: iterate with GetNextSelectedItem(). + + // Methods + IMGUI_API ImGuiSelectionBasicStorage(); + IMGUI_API void ApplyRequests(ImGuiMultiSelectIO* ms_io); // Apply selection requests coming from BeginMultiSelect() and EndMultiSelect() functions. It uses 'items_count' passed to BeginMultiSelect() + IMGUI_API bool Contains(ImGuiID id) const; // Query if an item id is in selection. + IMGUI_API void Clear(); // Clear selection + IMGUI_API void Swap(ImGuiSelectionBasicStorage& r); // Swap two selections + IMGUI_API void SetItemSelected(ImGuiID id, bool selected); // Add/remove an item from selection (generally done by ApplyRequests() function) + IMGUI_API bool GetNextSelectedItem(void** opaque_it, ImGuiID* out_id); // Iterate selection with 'void* it = NULL; ImGuiId id; while (selection.GetNextSelectedItem(&it, &id)) { ... }' + inline ImGuiID GetStorageIdFromIndex(int idx) { return AdapterIndexToStorageId(this, idx); } // Convert index to item id based on provided adapter. +}; + +// Optional helper to apply multi-selection requests to existing randomly accessible storage. +// Convenient if you want to quickly wire multi-select API on e.g. an array of bool or items storing their own selection state. +struct ImGuiSelectionExternalStorage +{ + // Members + void* UserData; // User data for use by adapter function // e.g. selection.UserData = (void*)my_items; + void (*AdapterSetItemSelected)(ImGuiSelectionExternalStorage* self, int idx, bool selected); // e.g. AdapterSetItemSelected = [](ImGuiSelectionExternalStorage* self, int idx, bool selected) { ((MyItems**)self->UserData)[idx]->Selected = selected; } + + // Methods + IMGUI_API ImGuiSelectionExternalStorage(); + IMGUI_API void ApplyRequests(ImGuiMultiSelectIO* ms_io); // Apply selection requests by using AdapterSetItemSelected() calls +}; + //----------------------------------------------------------------------------- // [SECTION] Drawing API (ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawListFlags, ImDrawList, ImDrawData) // Hold a series of drawing commands. The user provides a renderer for ImDrawData which essentially contains an array of ImDrawList. @@ -2509,9 +2950,9 @@ typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* c // Special Draw callback value to request renderer backend to reset the graphics/render state. // The renderer backend needs to handle this special value, otherwise it will crash trying to call a function at this address. -// This is useful for example if you submitted callbacks which you know have altered the render state and you want it to be restored. -// It is not done by default because they are many perfectly useful way of altering render state for imgui contents (e.g. changing shader/blending settings before an Image call). -#define ImDrawCallback_ResetRenderState (ImDrawCallback)(-1) +// This is useful, for example, if you submitted callbacks which you know have altered the render state and you want it to be restored. +// Render state is not reset by default because they are many perfectly useful way of altering render state (e.g. changing shader/blending settings before an Image call). +#define ImDrawCallback_ResetRenderState (ImDrawCallback)(-8) // Typically, 1 command = 1 GPU draw call (unless command is a callback) // - VtxOffset: When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' is enabled, @@ -2526,9 +2967,11 @@ struct ImDrawCmd unsigned int IdxOffset; // 4 // Start offset in index buffer. unsigned int ElemCount; // 4 // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[]. ImDrawCallback UserCallback; // 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally. - void* UserCallbackData; // 4-8 // The draw callback code can access this. + void* UserCallbackData; // 4-8 // Callback user data (when UserCallback != NULL). If called AddCallback() with size == 0, this is a copy of the AddCallback() argument. If called AddCallback() with size > 0, this is pointing to a buffer where data is stored. + int UserCallbackDataSize; // 4 // Size of callback user data when using storage, otherwise 0. + int UserCallbackDataOffset;// 4 // [Internal] Offset of callback user data when using storage, otherwise -1. - ImDrawCmd() { memset(this, 0, sizeof(*this)); } // Also ensure our padding fields are zeroed + ImDrawCmd() { memset(this, 0, sizeof(*this)); } // Also ensure our padding fields are zeroed // Since 1.83: returns ImTextureID associated with this draw call. Warning: DO NOT assume this is always same as 'TextureId' (we will change this function for an upcoming feature) inline ImTextureID GetTexID() const { return TextureId; } @@ -2634,15 +3077,16 @@ struct ImDrawList // [Internal, used while building lists] unsigned int _VtxCurrentIdx; // [Internal] generally == VtxBuffer.Size unless we are past 64K vertices, in which case this gets reset to 0. ImDrawListSharedData* _Data; // Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context) - const char* _OwnerName; // Pointer to owner window's name for debugging ImDrawVert* _VtxWritePtr; // [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much) ImDrawIdx* _IdxWritePtr; // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much) - ImVector _ClipRectStack; // [Internal] - ImVector _TextureIdStack; // [Internal] ImVector _Path; // [Internal] current path building ImDrawCmdHeader _CmdHeader; // [Internal] template of active commands. Fields should match those of CmdBuffer.back(). ImDrawListSplitter _Splitter; // [Internal] for channels api (note: prefer using your own persistent instance of ImDrawListSplitter!) + ImVector _ClipRectStack; // [Internal] + ImVector _TextureIdStack; // [Internal] + ImVector _CallbacksDataBuf; // [Internal] float _FringeScale; // [Internal] anti-alias fringe is scaled by this value, this helps to keep things sharp while zooming at vertex buffer content + const char* _OwnerName; // Pointer to owner window's name for debugging // If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData() or create and use your own ImDrawListSharedData (so you can use ImDrawList without ImGui) ImDrawList(ImDrawListSharedData* shared_data) { memset(this, 0, sizeof(*this)); _Data = shared_data; } @@ -2675,13 +3119,20 @@ struct ImDrawList IMGUI_API void AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments = 0); IMGUI_API void AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness = 1.0f); IMGUI_API void AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments); + IMGUI_API void AddEllipse(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot = 0.0f, int num_segments = 0, float thickness = 1.0f); + IMGUI_API void AddEllipseFilled(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot = 0.0f, int num_segments = 0); IMGUI_API void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL); IMGUI_API void AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL); - IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness); - IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col); IMGUI_API void AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0); // Cubic Bezier (4 control points) IMGUI_API void AddBezierQuadratic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments = 0); // Quadratic Bezier (3 control points) + // General polygon + // - Only simple polygons are supported by filling functions (no self-intersections, no holes). + // - Concave polygon fill is more expensive than convex one: it has O(N^2) complexity. Provided as a convenience fo user but not used by main library. + IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness); + IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col); + IMGUI_API void AddConcavePolyFilled(const ImVec2* points, int num_points, ImU32 col); + // Image primitives // - Read FAQ to understand what ImTextureID is. // - "p_min" and "p_max" represent the upper-left and lower-right corners of the rectangle. @@ -2691,20 +3142,33 @@ struct ImDrawList IMGUI_API void AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawFlags flags = 0); // Stateful path API, add points then finish with PathFillConvex() or PathStroke() - // - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing. + // - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing. + // so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex(). inline void PathClear() { _Path.Size = 0; } inline void PathLineTo(const ImVec2& pos) { _Path.push_back(pos); } inline void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || memcmp(&_Path.Data[_Path.Size - 1], &pos, 8) != 0) _Path.push_back(pos); } inline void PathFillConvex(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; } + inline void PathFillConcave(ImU32 col) { AddConcavePolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; } inline void PathStroke(ImU32 col, ImDrawFlags flags = 0, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, flags, thickness); _Path.Size = 0; } IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 0); IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle + IMGUI_API void PathEllipticalArcTo(const ImVec2& center, const ImVec2& radius, float rot, float a_min, float a_max, int num_segments = 0); // Ellipse IMGUI_API void PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0); // Cubic Bezier (4 control points) IMGUI_API void PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments = 0); // Quadratic Bezier (3 control points) IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, ImDrawFlags flags = 0); - // Advanced - IMGUI_API void AddCallback(ImDrawCallback callback, void* callback_data); // Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles. + // Advanced: Draw Callbacks + // - May be used to alter render state (change sampler, blending, current shader). May be used to emit custom rendering commands (difficult to do correctly, but possible). + // - Use special ImDrawCallback_ResetRenderState callback to instruct backend to reset its render state to the default. + // - Your rendering loop must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles. All standard backends are honoring this. + // - For some backends, the callback may access selected render-states exposed by the backend in a ImGui_ImplXXXX_RenderState structure pointed to by platform_io.Renderer_RenderState. + // - IMPORTANT: please be mindful of the different level of indirection between using size==0 (copying argument) and using size>0 (copying pointed data into a buffer). + // - If userdata_size == 0: we copy/store the 'userdata' argument as-is. It will be available unmodified in ImDrawCmd::UserCallbackData during render. + // - If userdata_size > 0, we copy/store 'userdata_size' bytes pointed to by 'userdata'. We store them in a buffer stored inside the drawlist. ImDrawCmd::UserCallbackData will point inside that buffer so you have to retrieve data from there. Your callback may need to use ImDrawCmd::UserCallbackDataSize if you expect dynamically-sized data. + // - Support for userdata_size > 0 was added in v1.91.4, October 2024. So earlier code always only allowed to copy/store a simple void*. + IMGUI_API void AddCallback(ImDrawCallback callback, void* userdata, size_t userdata_size = 0); + + // Advanced: Miscellaneous IMGUI_API void AddDrawCmd(); // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible IMGUI_API ImDrawList* CloneOutput() const; // Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer. @@ -2731,8 +3195,11 @@ struct ImDrawList inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); } // Write vertex with unique index // Obsolete names - //inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021) - //inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021) + //inline void AddEllipse(const ImVec2& center, float radius_x, float radius_y, ImU32 col, float rot = 0.0f, int num_segments = 0, float thickness = 1.0f) { AddEllipse(center, ImVec2(radius_x, radius_y), col, rot, num_segments, thickness); } // OBSOLETED in 1.90.5 (Mar 2024) + //inline void AddEllipseFilled(const ImVec2& center, float radius_x, float radius_y, ImU32 col, float rot = 0.0f, int num_segments = 0) { AddEllipseFilled(center, ImVec2(radius_x, radius_y), col, rot, num_segments); } // OBSOLETED in 1.90.5 (Mar 2024) + //inline void PathEllipticalArcTo(const ImVec2& center, float radius_x, float radius_y, float rot, float a_min, float a_max, int num_segments = 0) { PathEllipticalArcTo(center, ImVec2(radius_x, radius_y), rot, a_min, a_max, num_segments); } // OBSOLETED in 1.90.5 (Mar 2024) + //inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021) + //inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021) // [Internal helpers] IMGUI_API void _ResetForNewFrame(); @@ -2742,6 +3209,7 @@ struct ImDrawList IMGUI_API void _OnChangedClipRect(); IMGUI_API void _OnChangedTextureID(); IMGUI_API void _OnChangedVtxOffset(); + IMGUI_API void _SetTextureID(ImTextureID texture_id); IMGUI_API int _CalcCircleAutoSegmentCount(float radius) const; IMGUI_API void _PathArcToFastEx(const ImVec2& center, float radius, int a_min_sample, int a_max_sample, int a_step); IMGUI_API void _PathArcToN(const ImVec2& center, float radius, float a_min, float a_max, int num_segments); @@ -2791,7 +3259,8 @@ struct ImFontConfig float GlyphMaxAdvanceX; // FLT_MAX // Maximum AdvanceX for glyphs bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights. unsigned int FontBuilderFlags; // 0 // Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure. - float RasterizerMultiply; // 1.0f // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable. + float RasterizerMultiply; // 1.0f // Linearly brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable. This is a silly thing we may remove in the future. + float RasterizerDensity; // 1.0f // DPI scale for rasterization, not altering other font metrics: make it easy to swap between e.g. a 100% and a 400% fonts for a zooming display. IMPORTANT: If you increase this it is expected that you increase font scale accordingly, otherwise quality may look lowered. ImWchar EllipsisChar; // -1 // Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used. // [Internal] @@ -2875,8 +3344,8 @@ struct ImFontAtlas IMGUI_API ImFont* AddFont(const ImFontConfig* font_cfg); IMGUI_API ImFont* AddFontDefault(const ImFontConfig* font_cfg = NULL); IMGUI_API ImFont* AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); - IMGUI_API ImFont* AddFontFromMemoryTTF(void* font_data, int font_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas. Set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed. - IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_font_data, int compressed_font_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp. + IMGUI_API ImFont* AddFontFromMemoryTTF(void* font_data, int font_data_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas. Set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed. + IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_font_data, int compressed_font_data_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp. IMGUI_API ImFont* AddFontFromMemoryCompressedBase85TTF(const char* compressed_font_data_base85, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter. IMGUI_API void ClearInputData(); // Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts. IMGUI_API void ClearTexData(); // Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory. @@ -2918,7 +3387,7 @@ struct ImFontAtlas // You can request arbitrary rectangles to be packed into the atlas, for your own purposes. // - After calling Build(), you can query the rectangle position and render your pixels. - // - If you render colored output, set 'atlas->TexPixelsUseColors = true' as this may help some backends decide of prefered texture format. + // - If you render colored output, set 'atlas->TexPixelsUseColors = true' as this may help some backends decide of preferred texture format. // - You can also request your rectangles to be mapped as font glyph (given a font + Unicode point), // so you can render e.g. custom colorful icons and use them as regular glyphs. // - Read docs/FONTS.md for more details about using colorful icons. @@ -2975,7 +3444,7 @@ struct ImFontAtlas struct ImFont { // Members: Hot ~20/24 bytes (for CalcTextSize) - ImVector IndexAdvanceX; // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this this info, and are often bottleneck in large UI). + ImVector IndexAdvanceX; // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this info, and are often bottleneck in large UI). float FallbackAdvanceX; // 4 // out // = FallbackGlyph->AdvanceX float FontSize; // 4 // in // // Height of characters/line, set during loading (don't change after loading) @@ -2995,7 +3464,7 @@ struct ImFont float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0 bool DirtyLookupTables; // 1 // out // float Scale; // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale() - float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] + float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] (unscaled) int MetricsTotalSurface;// 4 // out // // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs) ImU8 Used4kPagesMap[(IM_UNICODE_CODEPOINT_MAX+1)/4096/8]; // 2 bytes if ImWchar=ImWchar16, 34 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints. @@ -3035,7 +3504,7 @@ enum ImGuiViewportFlags_ ImGuiViewportFlags_None = 0, ImGuiViewportFlags_IsPlatformWindow = 1 << 0, // Represent a Platform Window ImGuiViewportFlags_IsPlatformMonitor = 1 << 1, // Represent a Platform Monitor (unused yet) - ImGuiViewportFlags_OwnedByApp = 1 << 2, // Platform Window: is created/managed by the application (rather than a dear imgui backend) + ImGuiViewportFlags_OwnedByApp = 1 << 2, // Platform Window: Is created/managed by the application (rather than a dear imgui backend) }; // - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows. @@ -3047,6 +3516,7 @@ enum ImGuiViewportFlags_ // - Windows are generally trying to stay within the Work Area of their host viewport. struct ImGuiViewport { + ImGuiID ID; // Unique identifier for the viewport ImGuiViewportFlags Flags; // See ImGuiViewportFlags_ ImVec2 Pos; // Main Area: Position of the viewport (Dear ImGui coordinates are the same as OS desktop/native coordinates) ImVec2 Size; // Main Area: Size of the viewport. @@ -3054,6 +3524,7 @@ struct ImGuiViewport ImVec2 WorkSize; // Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size) // Platform/Backend Dependent Data + void* PlatformHandle; // void* to hold higher-level, platform window handle (e.g. HWND, GLFWWindow*, SDL_Window*) void* PlatformHandleRaw; // void* to hold lower-level, platform-native window handle (under Win32 this is expected to be a HWND, unused for other platforms) ImGuiViewport() { memset(this, 0, sizeof(*this)); } @@ -3067,7 +3538,45 @@ struct ImGuiViewport // [SECTION] Platform Dependent Interfaces //----------------------------------------------------------------------------- -// (Optional) Support for IME (Input Method Editor) via the io.SetPlatformImeDataFn() function. +// Access via ImGui::GetPlatformIO() +struct ImGuiPlatformIO +{ + IMGUI_API ImGuiPlatformIO(); + + //------------------------------------------------------------------ + // Interface with OS and Platform backend + //------------------------------------------------------------------ + + // Optional: Access OS clipboard + // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures) + const char* (*Platform_GetClipboardTextFn)(ImGuiContext* ctx); + void (*Platform_SetClipboardTextFn)(ImGuiContext* ctx, const char* text); + void* Platform_ClipboardUserData; + + // Optional: Open link/folder/file in OS Shell + // (default to use ShellExecuteA() on Windows, system() on Linux/Mac) + bool (*Platform_OpenInShellFn)(ImGuiContext* ctx, const char* path); + void* Platform_OpenInShellUserData; + + // Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows) + // (default to use native imm32 api on Windows) + void (*Platform_SetImeDataFn)(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data); + void* Platform_ImeUserData; + //void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data); // [Renamed to platform_io.PlatformSetImeDataFn in 1.91.1] + + // Optional: Platform locale + // [Experimental] Configure decimal point e.g. '.' or ',' useful for some languages (e.g. German), generally pulled from *localeconv()->decimal_point + ImWchar Platform_LocaleDecimalPoint; // '.' + + //------------------------------------------------------------------ + // Interface with Renderer Backend + //------------------------------------------------------------------ + + // Written by some backends during ImGui_ImplXXXX_RenderDrawData() call to point backend_specific ImGui_ImplXXXX_RenderState* structure. + void* Renderer_RenderState; +}; + +// (Optional) Support for IME (Input Method Editor) via the platform_io.Platform_SetImeDataFn() function. struct ImGuiPlatformImeData { bool WantVisible; // A widget wants the IME to be visible @@ -3083,34 +3592,44 @@ struct ImGuiPlatformImeData // Please keep your copy of dear imgui up to date! Occasionally set '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' in imconfig.h to stay ahead. //----------------------------------------------------------------------------- -namespace ImGui -{ -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - IMGUI_API ImGuiKey GetKeyIndex(ImGuiKey key); // map ImGuiKey_* values into legacy native key index. == io.KeyMap[key] -#else - static inline ImGuiKey GetKeyIndex(ImGuiKey key) { IM_ASSERT(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END && "ImGuiKey and native_index was merged together and native_index is disabled by IMGUI_DISABLE_OBSOLETE_KEYIO. Please switch to ImGuiKey."); return key; } -#endif -} - #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS namespace ImGui { + // OBSOLETED in 1.91.0 (from July 2024) + static inline void PushButtonRepeat(bool repeat) { PushItemFlag(ImGuiItemFlags_ButtonRepeat, repeat); } + static inline void PopButtonRepeat() { PopItemFlag(); } + static inline void PushTabStop(bool tab_stop) { PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); } + static inline void PopTabStop() { PopItemFlag(); } + IMGUI_API ImVec2 GetContentRegionMax(); // Content boundaries max (e.g. window boundaries including scrolling, or current column boundaries). You should never need this. Always use GetCursorScreenPos() and GetContentRegionAvail()! + IMGUI_API ImVec2 GetWindowContentRegionMin(); // Content boundaries min for the window (roughly (0,0)-Scroll), in window-local coordinates. You should never need this. Always use GetCursorScreenPos() and GetContentRegionAvail()! + IMGUI_API ImVec2 GetWindowContentRegionMax(); // Content boundaries max for the window (roughly (0,0)+Size-Scroll), in window-local coordinates. You should never need this. Always use GetCursorScreenPos() and GetContentRegionAvail()! + // OBSOLETED in 1.90.0 (from September 2023) + static inline bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags window_flags = 0) { return BeginChild(id, size, ImGuiChildFlags_FrameStyle, window_flags); } + static inline void EndChildFrame() { EndChild(); } + //static inline bool BeginChild(const char* str_id, const ImVec2& size_arg, bool borders, ImGuiWindowFlags window_flags){ return BeginChild(str_id, size_arg, borders ? ImGuiChildFlags_Borders : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Borders + //static inline bool BeginChild(ImGuiID id, const ImVec2& size_arg, bool borders, ImGuiWindowFlags window_flags) { return BeginChild(id, size_arg, borders ? ImGuiChildFlags_Borders : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Borders + static inline void ShowStackToolWindow(bool* p_open = NULL) { ShowIDStackToolWindow(p_open); } + IMGUI_API bool Combo(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int popup_max_height_in_items = -1); + IMGUI_API bool ListBox(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int height_in_items = -1); // OBSOLETED in 1.89.7 (from June 2023) - IMGUI_API void SetItemAllowOverlap(); // Use SetNextItemAllowOverlap() before item. + IMGUI_API void SetItemAllowOverlap(); // Use SetNextItemAllowOverlap() before item. // OBSOLETED in 1.89.4 (from March 2023) - static inline void PushAllowKeyboardFocus(bool tab_stop) { PushTabStop(tab_stop); } - static inline void PopAllowKeyboardFocus() { PopTabStop(); } - // OBSOLETED in 1.89 (from August 2022) - IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // Use new ImageButton() signature (explicit item id, regular FramePadding) - // OBSOLETED in 1.88 (from May 2022) - static inline void CaptureKeyboardFromApp(bool want_capture_keyboard = true) { SetNextFrameWantCaptureKeyboard(want_capture_keyboard); } // Renamed as name was misleading + removed default value. - static inline void CaptureMouseFromApp(bool want_capture_mouse = true) { SetNextFrameWantCaptureMouse(want_capture_mouse); } // Renamed as name was misleading + removed default value. - // OBSOLETED in 1.86 (from November 2021) - IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // Calculate coarse clipping for large list of evenly sized items. Prefer using ImGuiListClipper. - // OBSOLETED in 1.85 (from August 2021) - static inline float GetWindowContentRegionWidth() { return GetWindowContentRegionMax().x - GetWindowContentRegionMin().x; } + static inline void PushAllowKeyboardFocus(bool tab_stop) { PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); } + static inline void PopAllowKeyboardFocus() { PopItemFlag(); } + // OBSOLETED in 1.87 (from February 2022 but more formally obsoleted April 2024) + IMGUI_API ImGuiKey GetKeyIndex(ImGuiKey key); // Map ImGuiKey_* values into legacy native key index. == io.KeyMap[key]. When using a 1.87+ backend using io.AddKeyEvent(), calling GetKeyIndex() with ANY ImGuiKey_XXXX values will return the same value! + //static inline ImGuiKey GetKeyIndex(ImGuiKey key) { IM_ASSERT(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END); return key; } // Some of the older obsolete names along with their replacement (commented out so they are not reported in IDE) + //-- OBSOLETED in 1.89 (from August 2022) + //IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // --> Use new ImageButton() signature (explicit item id, regular FramePadding). Refer to code in 1.91 if you want to grab a copy of this version. + //-- OBSOLETED in 1.88 (from May 2022) + //static inline void CaptureKeyboardFromApp(bool want_capture_keyboard = true) { SetNextFrameWantCaptureKeyboard(want_capture_keyboard); } // Renamed as name was misleading + removed default value. + //static inline void CaptureMouseFromApp(bool want_capture_mouse = true) { SetNextFrameWantCaptureMouse(want_capture_mouse); } // Renamed as name was misleading + removed default value. + //-- OBSOLETED in 1.86 (from November 2021) + //IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // Code removed, see 1.90 for last version of the code. Calculate range of visible items for large list of evenly sized items. Prefer using ImGuiListClipper. + //-- OBSOLETED in 1.85 (from August 2021) + //static inline float GetWindowContentRegionWidth() { return GetWindowContentRegionMax().x - GetWindowContentRegionMin().x; } //-- OBSOLETED in 1.81 (from February 2021) //static inline bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0, 0)) { return BeginListBox(label, size); } //static inline bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1) { float height = GetTextLineHeightWithSpacing() * ((height_in_items < 0 ? ImMin(items_count, 7) : height_in_items) + 0.25f) + GetStyle().FramePadding.y * 2.0f; return BeginListBox(label, ImVec2(0.0f, height)); } // Helper to calculate size from items_count and height_in_items @@ -3161,36 +3680,35 @@ namespace ImGui //static inline void SetScrollPosHere() { SetScrollHere(); } // OBSOLETED in 1.42 } -// OBSOLETED in 1.82 (from Mars 2021): flags for AddRect(), AddRectFilled(), AddImageRounded(), PathRect() -typedef ImDrawFlags ImDrawCornerFlags; -enum ImDrawCornerFlags_ -{ - ImDrawCornerFlags_None = ImDrawFlags_RoundCornersNone, // Was == 0 prior to 1.82, this is now == ImDrawFlags_RoundCornersNone which is != 0 and not implicit - ImDrawCornerFlags_TopLeft = ImDrawFlags_RoundCornersTopLeft, // Was == 0x01 (1 << 0) prior to 1.82. Order matches ImDrawFlags_NoRoundCorner* flag (we exploit this internally). - ImDrawCornerFlags_TopRight = ImDrawFlags_RoundCornersTopRight, // Was == 0x02 (1 << 1) prior to 1.82. - ImDrawCornerFlags_BotLeft = ImDrawFlags_RoundCornersBottomLeft, // Was == 0x04 (1 << 2) prior to 1.82. - ImDrawCornerFlags_BotRight = ImDrawFlags_RoundCornersBottomRight, // Was == 0x08 (1 << 3) prior to 1.82. - ImDrawCornerFlags_All = ImDrawFlags_RoundCornersAll, // Was == 0x0F prior to 1.82 - ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight, - ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight, - ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft, - ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight, -}; +//-- OBSOLETED in 1.82 (from Mars 2021): flags for AddRect(), AddRectFilled(), AddImageRounded(), PathRect() +//typedef ImDrawFlags ImDrawCornerFlags; +//enum ImDrawCornerFlags_ +//{ +// ImDrawCornerFlags_None = ImDrawFlags_RoundCornersNone, // Was == 0 prior to 1.82, this is now == ImDrawFlags_RoundCornersNone which is != 0 and not implicit +// ImDrawCornerFlags_TopLeft = ImDrawFlags_RoundCornersTopLeft, // Was == 0x01 (1 << 0) prior to 1.82. Order matches ImDrawFlags_NoRoundCorner* flag (we exploit this internally). +// ImDrawCornerFlags_TopRight = ImDrawFlags_RoundCornersTopRight, // Was == 0x02 (1 << 1) prior to 1.82. +// ImDrawCornerFlags_BotLeft = ImDrawFlags_RoundCornersBottomLeft, // Was == 0x04 (1 << 2) prior to 1.82. +// ImDrawCornerFlags_BotRight = ImDrawFlags_RoundCornersBottomRight, // Was == 0x08 (1 << 3) prior to 1.82. +// ImDrawCornerFlags_All = ImDrawFlags_RoundCornersAll, // Was == 0x0F prior to 1.82 +// ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight, +// ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight, +// ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft, +// ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight, +//}; // RENAMED and MERGED both ImGuiKey_ModXXX and ImGuiModFlags_XXX into ImGuiMod_XXX (from September 2022) // RENAMED ImGuiKeyModFlags -> ImGuiModFlags in 1.88 (from April 2022). Exceptionally commented out ahead of obscolescence schedule to reduce confusion and because they were not meant to be used in the first place. -typedef ImGuiKeyChord ImGuiModFlags; // == int. We generally use ImGuiKeyChord to mean "a ImGuiKey or-ed with any number of ImGuiMod_XXX value", but you may store only mods in there. -enum ImGuiModFlags_ { ImGuiModFlags_None = 0, ImGuiModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiModFlags_Shift = ImGuiMod_Shift, ImGuiModFlags_Alt = ImGuiMod_Alt, ImGuiModFlags_Super = ImGuiMod_Super }; +//typedef ImGuiKeyChord ImGuiModFlags; // == int. We generally use ImGuiKeyChord to mean "a ImGuiKey or-ed with any number of ImGuiMod_XXX value", so you may store mods in there. +//enum ImGuiModFlags_ { ImGuiModFlags_None = 0, ImGuiModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiModFlags_Shift = ImGuiMod_Shift, ImGuiModFlags_Alt = ImGuiMod_Alt, ImGuiModFlags_Super = ImGuiMod_Super }; //typedef ImGuiKeyChord ImGuiKeyModFlags; // == int //enum ImGuiKeyModFlags_ { ImGuiKeyModFlags_None = 0, ImGuiKeyModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiKeyModFlags_Shift = ImGuiMod_Shift, ImGuiKeyModFlags_Alt = ImGuiMod_Alt, ImGuiKeyModFlags_Super = ImGuiMod_Super }; +#define IM_OFFSETOF(_TYPE,_MEMBER) offsetof(_TYPE, _MEMBER) // OBSOLETED IN 1.90 (now using C++11 standard version) + #endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS // RENAMED IMGUI_DISABLE_METRICS_WINDOW > IMGUI_DISABLE_DEBUG_TOOLS in 1.88 (from June 2022) -#if defined(IMGUI_DISABLE_METRICS_WINDOW) && !defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && !defined(IMGUI_DISABLE_DEBUG_TOOLS) -#define IMGUI_DISABLE_DEBUG_TOOLS -#endif -#if defined(IMGUI_DISABLE_METRICS_WINDOW) && defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) +#ifdef IMGUI_DISABLE_METRICS_WINDOW #error IMGUI_DISABLE_METRICS_WINDOW was renamed to IMGUI_DISABLE_DEBUG_TOOLS, please use new name. #endif @@ -3206,9 +3724,14 @@ enum ImGuiModFlags_ { ImGuiModFlags_None = 0, ImGuiModFlags_Ctrl = ImGuiMod_Ctrl #pragma warning (pop) #endif -// Include imgui_user.h at the end of imgui.h (convenient for user to only explicitly include vanilla imgui.h) +// Include imgui_user.h at the end of imgui.h +// May be convenient for some users to only explicitly include vanilla imgui.h and have extra stuff included. #ifdef IMGUI_INCLUDE_IMGUI_USER_H +#ifdef IMGUI_USER_H_FILENAME +#include IMGUI_USER_H_FILENAME +#else #include "imgui_user.h" #endif +#endif #endif // #ifndef IMGUI_DISABLE diff --git a/bgfx/3rdparty/dear-imgui/imgui_demo.cpp b/bgfx/3rdparty/dear-imgui/imgui_demo.cpp index ab529e37..5849e11e 100644 --- a/bgfx/3rdparty/dear-imgui/imgui_demo.cpp +++ b/bgfx/3rdparty/dear-imgui/imgui_demo.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.9 +// dear imgui, v1.91.4 // (demo code) // Help: @@ -7,9 +7,14 @@ // - Need help integrating Dear ImGui in your codebase? // - Read Getting Started https://github.com/ocornut/imgui/wiki/Getting-Started // - Read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase. -// Read imgui.cpp for more details, documentation and comments. +// Read top of imgui.cpp and imgui.h for many details, documentation, comments, links. // Get the latest version at https://github.com/ocornut/imgui +// How to easily locate code? +// - Use Tools->Item Picker to debug break in code by clicking any widgets: https://github.com/ocornut/imgui/wiki/Debug-Tools +// - Browse an online version the demo with code linked to hovered widgets: https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html +// - Find a visible string and search for it in the code! + //--------------------------------------------------- // PLEASE DO NOT REMOVE THIS FILE FROM YOUR PROJECT! //--------------------------------------------------- @@ -54,8 +59,10 @@ // Because we can't assume anything about your support of maths operators, we cannot use them in imgui_demo.cpp. // Navigating this file: -// - In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. -// - With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. +// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. +// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments. +// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments. +// - You can search/grep for all sections listed in the index to find the section. /* @@ -63,13 +70,15 @@ Index of this file: // [SECTION] Forward Declarations // [SECTION] Helpers +// [SECTION] Helpers: ExampleTreeNode, ExampleMemberInfo (for use by Property Editor & Multi-Select demos) // [SECTION] Demo Window / ShowDemoWindow() -// - ShowDemoWindow() -// - sub section: ShowDemoWindowWidgets() -// - sub section: ShowDemoWindowLayout() -// - sub section: ShowDemoWindowPopups() -// - sub section: ShowDemoWindowTables() -// - sub section: ShowDemoWindowInputs() +// [SECTION] ShowDemoWindowMenuBar() +// [SECTION] ShowDemoWindowWidgets() +// [SECTION] ShowDemoWindowMultiSelect() +// [SECTION] ShowDemoWindowLayout() +// [SECTION] ShowDemoWindowPopups() +// [SECTION] ShowDemoWindowTables() +// [SECTION] ShowDemoWindowInputs() // [SECTION] About Window / ShowAboutWindow() // [SECTION] Style Editor / ShowStyleEditor() // [SECTION] User Guide / ShowUserGuide() @@ -86,6 +95,7 @@ Index of this file: // [SECTION] Example App: Manipulating window titles / ShowExampleAppWindowTitles() // [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering() // [SECTION] Example App: Documents Handling / ShowExampleAppDocuments() +// [SECTION] Example App: Assets Browser / ShowExampleAppAssetsBrowser() */ @@ -106,6 +116,9 @@ Index of this file: #if !defined(_MSC_VER) || _MSC_VER >= 1800 #include // PRId64/PRIu64, not avail in some MinGW headers. #endif +#ifdef __EMSCRIPTEN__ +#include // __EMSCRIPTEN_major__ etc. +#endif // Visual Studio warnings #ifdef _MSC_VER @@ -130,6 +143,7 @@ Index of this file: #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. #pragma clang diagnostic ignored "-Wreserved-id-macro" // warning: macro name is a reserved identifier #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access #elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size @@ -171,7 +185,8 @@ Index of this file: #define IM_MAX(A, B) (((A) >= (B)) ? (A) : (B)) #define IM_CLAMP(V, MN, MX) ((V) < (MN) ? (MN) : (V) > (MX) ? (MX) : (V)) -// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall +// Enforce cdecl calling convention for functions called by the standard library, +// in case compilation settings changed the default to e.g. __vectorcall #ifndef IMGUI_CDECL #ifdef _MSC_VER #define IMGUI_CDECL __cdecl @@ -181,19 +196,21 @@ Index of this file: #endif //----------------------------------------------------------------------------- -// [SECTION] Forward Declarations, Helpers +// [SECTION] Forward Declarations //----------------------------------------------------------------------------- #if !defined(IMGUI_DISABLE_DEMO_WINDOWS) // Forward Declarations +struct ImGuiDemoWindowData; static void ShowExampleAppMainMenuBar(); +static void ShowExampleAppAssetsBrowser(bool* p_open); static void ShowExampleAppConsole(bool* p_open); static void ShowExampleAppCustomRendering(bool* p_open); static void ShowExampleAppDocuments(bool* p_open); static void ShowExampleAppLog(bool* p_open); static void ShowExampleAppLayout(bool* p_open); -static void ShowExampleAppPropertyEditor(bool* p_open); +static void ShowExampleAppPropertyEditor(bool* p_open, ImGuiDemoWindowData* demo_data); static void ShowExampleAppSimpleOverlay(bool* p_open); static void ShowExampleAppAutoResize(bool* p_open); static void ShowExampleAppConstrainedResize(bool* p_open); @@ -203,8 +220,10 @@ static void ShowExampleAppWindowTitles(bool* p_open); static void ShowExampleMenuFile(); // We split the contents of the big ShowDemoWindow() function into smaller functions -// (because the link time of very large functions grow non-linearly) -static void ShowDemoWindowWidgets(); +// (because the link time of very large functions tends to grow non-linearly) +static void ShowDemoWindowMenuBar(ImGuiDemoWindowData* demo_data); +static void ShowDemoWindowWidgets(ImGuiDemoWindowData* demo_data); +static void ShowDemoWindowMultiSelect(ImGuiDemoWindowData* demo_data); static void ShowDemoWindowLayout(); static void ShowDemoWindowPopups(); static void ShowDemoWindowTables(); @@ -238,17 +257,122 @@ void* GImGuiDemoMarkerCallbackUserData = NULL; #define IMGUI_DEMO_MARKER(section) do { if (GImGuiDemoMarkerCallback != NULL) GImGuiDemoMarkerCallback(__FILE__, __LINE__, section, GImGuiDemoMarkerCallbackUserData); } while (0) //----------------------------------------------------------------------------- -// [SECTION] Demo Window / ShowDemoWindow() +// [SECTION] Helpers: ExampleTreeNode, ExampleMemberInfo (for use by Property Editor etc.) +//----------------------------------------------------------------------------- + +// Simple representation for a tree +// (this is designed to be simple to understand for our demos, not to be fancy or efficient etc.) +struct ExampleTreeNode +{ + // Tree structure + char Name[28] = ""; + int UID = 0; + ExampleTreeNode* Parent = NULL; + ImVector Childs; + unsigned short IndexInParent = 0; // Maintaining this allows us to implement linear traversal more easily + + // Leaf Data + bool HasData = false; // All leaves have data + bool DataMyBool = true; + int DataMyInt = 128; + ImVec2 DataMyVec2 = ImVec2(0.0f, 3.141592f); +}; + +// Simple representation of struct metadata/serialization data. +// (this is a minimal version of what a typical advanced application may provide) +struct ExampleMemberInfo +{ + const char* Name; // Member name + ImGuiDataType DataType; // Member type + int DataCount; // Member count (1 when scalar) + int Offset; // Offset inside parent structure +}; + +// Metadata description of ExampleTreeNode struct. +static const ExampleMemberInfo ExampleTreeNodeMemberInfos[] +{ + { "MyBool", ImGuiDataType_Bool, 1, offsetof(ExampleTreeNode, DataMyBool) }, + { "MyInt", ImGuiDataType_S32, 1, offsetof(ExampleTreeNode, DataMyInt) }, + { "MyVec2", ImGuiDataType_Float, 2, offsetof(ExampleTreeNode, DataMyVec2) }, +}; + +static ExampleTreeNode* ExampleTree_CreateNode(const char* name, int uid, ExampleTreeNode* parent) +{ + ExampleTreeNode* node = IM_NEW(ExampleTreeNode); + snprintf(node->Name, IM_ARRAYSIZE(node->Name), "%s", name); + node->UID = uid; + node->Parent = parent; + node->IndexInParent = parent ? (unsigned short)parent->Childs.Size : 0; + if (parent) + parent->Childs.push_back(node); + return node; +} + +// Create example tree data +// (this allocates _many_ more times than most other code in either Dear ImGui or others demo) +static ExampleTreeNode* ExampleTree_CreateDemoTree() +{ + static const char* root_names[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pear", "Pineapple", "Strawberry", "Watermelon" }; + const size_t NAME_MAX_LEN = sizeof(ExampleTreeNode::Name); + char name_buf[NAME_MAX_LEN]; + int uid = 0; + ExampleTreeNode* node_L0 = ExampleTree_CreateNode("", ++uid, NULL); + const int root_items_multiplier = 2; + for (int idx_L0 = 0; idx_L0 < IM_ARRAYSIZE(root_names) * root_items_multiplier; idx_L0++) + { + snprintf(name_buf, IM_ARRAYSIZE(name_buf), "%s %d", root_names[idx_L0 / root_items_multiplier], idx_L0 % root_items_multiplier); + ExampleTreeNode* node_L1 = ExampleTree_CreateNode(name_buf, ++uid, node_L0); + const int number_of_childs = (int)strlen(node_L1->Name); + for (int idx_L1 = 0; idx_L1 < number_of_childs; idx_L1++) + { + snprintf(name_buf, IM_ARRAYSIZE(name_buf), "Child %d", idx_L1); + ExampleTreeNode* node_L2 = ExampleTree_CreateNode(name_buf, ++uid, node_L1); + node_L2->HasData = true; + if (idx_L1 == 0) + { + snprintf(name_buf, IM_ARRAYSIZE(name_buf), "Sub-child %d", 0); + ExampleTreeNode* node_L3 = ExampleTree_CreateNode(name_buf, ++uid, node_L2); + node_L3->HasData = true; + } + } + } + return node_L0; +} + //----------------------------------------------------------------------------- -// - ShowDemoWindow() -// - ShowDemoWindowWidgets() -// - ShowDemoWindowLayout() -// - ShowDemoWindowPopups() -// - ShowDemoWindowTables() -// - ShowDemoWindowColumns() -// - ShowDemoWindowInputs() +// [SECTION] Demo Window / ShowDemoWindow() //----------------------------------------------------------------------------- +// Data to be shared accross different functions of the demo. +struct ImGuiDemoWindowData +{ + // Examples Apps (accessible from the "Examples" menu) + bool ShowMainMenuBar = false; + bool ShowAppAssetsBrowser = false; + bool ShowAppConsole = false; + bool ShowAppCustomRendering = false; + bool ShowAppDocuments = false; + bool ShowAppLog = false; + bool ShowAppLayout = false; + bool ShowAppPropertyEditor = false; + bool ShowAppSimpleOverlay = false; + bool ShowAppAutoResize = false; + bool ShowAppConstrainedResize = false; + bool ShowAppFullscreen = false; + bool ShowAppLongText = false; + bool ShowAppWindowTitles = false; + + // Dear ImGui Tools (accessible from the "Tools" menu) + bool ShowMetrics = false; + bool ShowDebugLog = false; + bool ShowIDStackTool = false; + bool ShowStyleEditor = false; + bool ShowAbout = false; + + // Other data + ExampleTreeNode* DemoTree = NULL; +}; + // Demonstrate most Dear ImGui features (this is big function!) // You may execute this function to experiment with the UI and understand what it does. // You may then search for keywords in the code when you are interested by a specific feature. @@ -258,56 +382,39 @@ void ImGui::ShowDemoWindow(bool* p_open) // Most functions would normally just assert/crash if the context is missing. IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing Dear ImGui context. Refer to examples app!"); + // Verify ABI compatibility between caller code and compiled version of Dear ImGui. This helps detects some build issues. + IMGUI_CHECKVERSION(); + + // Stored data + static ImGuiDemoWindowData demo_data; + // Examples Apps (accessible from the "Examples" menu) - static bool show_app_main_menu_bar = false; - static bool show_app_console = false; - static bool show_app_custom_rendering = false; - static bool show_app_documents = false; - static bool show_app_log = false; - static bool show_app_layout = false; - static bool show_app_property_editor = false; - static bool show_app_simple_overlay = false; - static bool show_app_auto_resize = false; - static bool show_app_constrained_resize = false; - static bool show_app_fullscreen = false; - static bool show_app_long_text = false; - static bool show_app_window_titles = false; - - if (show_app_main_menu_bar) ShowExampleAppMainMenuBar(); - if (show_app_documents) ShowExampleAppDocuments(&show_app_documents); - if (show_app_console) ShowExampleAppConsole(&show_app_console); - if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering); - if (show_app_log) ShowExampleAppLog(&show_app_log); - if (show_app_layout) ShowExampleAppLayout(&show_app_layout); - if (show_app_property_editor) ShowExampleAppPropertyEditor(&show_app_property_editor); - if (show_app_simple_overlay) ShowExampleAppSimpleOverlay(&show_app_simple_overlay); - if (show_app_auto_resize) ShowExampleAppAutoResize(&show_app_auto_resize); - if (show_app_constrained_resize) ShowExampleAppConstrainedResize(&show_app_constrained_resize); - if (show_app_fullscreen) ShowExampleAppFullscreen(&show_app_fullscreen); - if (show_app_long_text) ShowExampleAppLongText(&show_app_long_text); - if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles); + if (demo_data.ShowMainMenuBar) { ShowExampleAppMainMenuBar(); } + if (demo_data.ShowAppDocuments) { ShowExampleAppDocuments(&demo_data.ShowAppDocuments); } + if (demo_data.ShowAppAssetsBrowser) { ShowExampleAppAssetsBrowser(&demo_data.ShowAppAssetsBrowser); } + if (demo_data.ShowAppConsole) { ShowExampleAppConsole(&demo_data.ShowAppConsole); } + if (demo_data.ShowAppCustomRendering) { ShowExampleAppCustomRendering(&demo_data.ShowAppCustomRendering); } + if (demo_data.ShowAppLog) { ShowExampleAppLog(&demo_data.ShowAppLog); } + if (demo_data.ShowAppLayout) { ShowExampleAppLayout(&demo_data.ShowAppLayout); } + if (demo_data.ShowAppPropertyEditor) { ShowExampleAppPropertyEditor(&demo_data.ShowAppPropertyEditor, &demo_data); } + if (demo_data.ShowAppSimpleOverlay) { ShowExampleAppSimpleOverlay(&demo_data.ShowAppSimpleOverlay); } + if (demo_data.ShowAppAutoResize) { ShowExampleAppAutoResize(&demo_data.ShowAppAutoResize); } + if (demo_data.ShowAppConstrainedResize) { ShowExampleAppConstrainedResize(&demo_data.ShowAppConstrainedResize); } + if (demo_data.ShowAppFullscreen) { ShowExampleAppFullscreen(&demo_data.ShowAppFullscreen); } + if (demo_data.ShowAppLongText) { ShowExampleAppLongText(&demo_data.ShowAppLongText); } + if (demo_data.ShowAppWindowTitles) { ShowExampleAppWindowTitles(&demo_data.ShowAppWindowTitles); } // Dear ImGui Tools (accessible from the "Tools" menu) - static bool show_tool_metrics = false; - static bool show_tool_debug_log = false; - static bool show_tool_stack_tool = false; - static bool show_tool_style_editor = false; - static bool show_tool_about = false; - - if (show_tool_metrics) - ImGui::ShowMetricsWindow(&show_tool_metrics); - if (show_tool_debug_log) - ImGui::ShowDebugLogWindow(&show_tool_debug_log); - if (show_tool_stack_tool) - ImGui::ShowStackToolWindow(&show_tool_stack_tool); - if (show_tool_style_editor) - { - ImGui::Begin("Dear ImGui Style Editor", &show_tool_style_editor); + if (demo_data.ShowMetrics) { ImGui::ShowMetricsWindow(&demo_data.ShowMetrics); } + if (demo_data.ShowDebugLog) { ImGui::ShowDebugLogWindow(&demo_data.ShowDebugLog); } + if (demo_data.ShowIDStackTool) { ImGui::ShowIDStackToolWindow(&demo_data.ShowIDStackTool); } + if (demo_data.ShowAbout) { ImGui::ShowAboutWindow(&demo_data.ShowAbout); } + if (demo_data.ShowStyleEditor) + { + ImGui::Begin("Dear ImGui Style Editor", &demo_data.ShowStyleEditor); ImGui::ShowStyleEditor(); ImGui::End(); } - if (show_tool_about) - ImGui::ShowAboutWindow(&show_tool_about); // Demonstrate the various window flags. Typically you would just use the default! static bool no_titlebar = false; @@ -350,61 +457,11 @@ void ImGui::ShowDemoWindow(bool* p_open) } // Most "big" widgets share a common width settings by default. See 'Demo->Layout->Widgets Width' for details. - // e.g. Use 2/3 of the space for widgets and 1/3 for labels (right align) - //ImGui::PushItemWidth(-ImGui::GetWindowWidth() * 0.35f); - // e.g. Leave a fixed amount of width for labels (by passing a negative value), the rest goes to widgets. - ImGui::PushItemWidth(ImGui::GetFontSize() * -12); + ImGui::PushItemWidth(ImGui::GetFontSize() * -12); // e.g. Leave a fixed amount of width for labels (by passing a negative value), the rest goes to widgets. + //ImGui::PushItemWidth(-ImGui::GetWindowWidth() * 0.35f); // e.g. Use 2/3 of the space for widgets and 1/3 for labels (right align) // Menu Bar - if (ImGui::BeginMenuBar()) - { - if (ImGui::BeginMenu("Menu")) - { - IMGUI_DEMO_MARKER("Menu/File"); - ShowExampleMenuFile(); - ImGui::EndMenu(); - } - if (ImGui::BeginMenu("Examples")) - { - IMGUI_DEMO_MARKER("Menu/Examples"); - ImGui::MenuItem("Main menu bar", NULL, &show_app_main_menu_bar); - - ImGui::SeparatorText("Mini apps"); - ImGui::MenuItem("Console", NULL, &show_app_console); - ImGui::MenuItem("Custom rendering", NULL, &show_app_custom_rendering); - ImGui::MenuItem("Documents", NULL, &show_app_documents); - ImGui::MenuItem("Log", NULL, &show_app_log); - ImGui::MenuItem("Property editor", NULL, &show_app_property_editor); - ImGui::MenuItem("Simple layout", NULL, &show_app_layout); - ImGui::MenuItem("Simple overlay", NULL, &show_app_simple_overlay); - - ImGui::SeparatorText("Concepts"); - ImGui::MenuItem("Auto-resizing window", NULL, &show_app_auto_resize); - ImGui::MenuItem("Constrained-resizing window", NULL, &show_app_constrained_resize); - ImGui::MenuItem("Fullscreen window", NULL, &show_app_fullscreen); - ImGui::MenuItem("Long text display", NULL, &show_app_long_text); - ImGui::MenuItem("Manipulating window titles", NULL, &show_app_window_titles); - - ImGui::EndMenu(); - } - //if (ImGui::MenuItem("MenuItem")) {} // You can also use MenuItem() inside a menu bar! - if (ImGui::BeginMenu("Tools")) - { - IMGUI_DEMO_MARKER("Menu/Tools"); -#ifndef IMGUI_DISABLE_DEBUG_TOOLS - const bool has_debug_tools = true; -#else - const bool has_debug_tools = false; -#endif - ImGui::MenuItem("Metrics/Debugger", NULL, &show_tool_metrics, has_debug_tools); - ImGui::MenuItem("Debug Log", NULL, &show_tool_debug_log, has_debug_tools); - ImGui::MenuItem("Stack Tool", NULL, &show_tool_stack_tool, has_debug_tools); - ImGui::MenuItem("Style Editor", NULL, &show_tool_style_editor); - ImGui::MenuItem("About Dear ImGui", NULL, &show_tool_about); - ImGui::EndMenu(); - } - ImGui::EndMenuBar(); - } + ShowDemoWindowMenuBar(&demo_data); ImGui::Text("dear imgui says hello! (%s) (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM); ImGui::Spacing(); @@ -422,7 +479,9 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::BulletText("See the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!"); ImGui::BulletText("See comments in imgui.cpp."); ImGui::BulletText("See example applications in the examples/ folder."); - ImGui::BulletText("Read the FAQ at http://www.dearimgui.com/faq/"); + ImGui::BulletText("Read the FAQ at "); + ImGui::SameLine(0, 0); + ImGui::TextLinkOpenURL("https://www.dearimgui.com/faq/"); ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls."); ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls."); @@ -442,27 +501,46 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::SameLine(); HelpMarker("Enable keyboard controls."); ImGui::CheckboxFlags("io.ConfigFlags: NavEnableGamepad", &io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad); ImGui::SameLine(); HelpMarker("Enable gamepad controls. Require backend to set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details."); - ImGui::CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", &io.ConfigFlags, ImGuiConfigFlags_NavEnableSetMousePos); - ImGui::SameLine(); HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos."); ImGui::CheckboxFlags("io.ConfigFlags: NoMouse", &io.ConfigFlags, ImGuiConfigFlags_NoMouse); + ImGui::SameLine(); HelpMarker("Instruct dear imgui to disable mouse inputs and interactions."); + + // The "NoMouse" option can get us stuck with a disabled mouse! Let's provide an alternative way to fix it: if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) { - // The "NoMouse" option can get us stuck with a disabled mouse! Let's provide an alternative way to fix it: if (fmodf((float)ImGui::GetTime(), 0.40f) < 0.20f) { ImGui::SameLine(); ImGui::Text("<>"); } - if (ImGui::IsKeyPressed(ImGuiKey_Space)) + // Prevent both being checked + if (ImGui::IsKeyPressed(ImGuiKey_Space) || (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard)) io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse; } - ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", &io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange); + + ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", &io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange); ImGui::SameLine(); HelpMarker("Instruct backend to not alter mouse cursor shape and visibility."); + ImGui::CheckboxFlags("io.ConfigFlags: NoKeyboard", &io.ConfigFlags, ImGuiConfigFlags_NoKeyboard); + ImGui::SameLine(); HelpMarker("Instruct dear imgui to disable keyboard inputs and interactions."); + ImGui::Checkbox("io.ConfigInputTrickleEventQueue", &io.ConfigInputTrickleEventQueue); ImGui::SameLine(); HelpMarker("Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates."); ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor); ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor itself. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something)."); + ImGui::SeparatorText("Keyboard/Gamepad Navigation"); + ImGui::Checkbox("io.ConfigNavSwapGamepadButtons", &io.ConfigNavSwapGamepadButtons); + ImGui::Checkbox("io.ConfigNavMoveSetMousePos", &io.ConfigNavMoveSetMousePos); + ImGui::SameLine(); HelpMarker("Directional/tabbing navigation teleports the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is difficult"); + ImGui::Checkbox("io.ConfigNavCaptureKeyboard", &io.ConfigNavCaptureKeyboard); + ImGui::Checkbox("io.ConfigNavEscapeClearFocusItem", &io.ConfigNavEscapeClearFocusItem); + ImGui::SameLine(); HelpMarker("Pressing Escape clears focused item."); + ImGui::Checkbox("io.ConfigNavEscapeClearFocusWindow", &io.ConfigNavEscapeClearFocusWindow); + ImGui::SameLine(); HelpMarker("Pressing Escape clears focused window."); + ImGui::Checkbox("io.ConfigNavCursorVisibleAuto", &io.ConfigNavCursorVisibleAuto); + ImGui::SameLine(); HelpMarker("Using directional navigation key makes the cursor visible. Mouse click hides the cursor."); + ImGui::Checkbox("io.ConfigNavCursorVisibleAlways", &io.ConfigNavCursorVisibleAlways); + ImGui::SameLine(); HelpMarker("Navigation cursor is always visible."); + ImGui::SeparatorText("Widgets"); ImGui::Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink); ImGui::SameLine(); HelpMarker("Enable blinking cursor (optional as some users consider it to be distracting)."); @@ -473,14 +551,39 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges); ImGui::SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback."); ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly); + ImGui::Checkbox("io.ConfigScrollbarScrollByPage", &io.ConfigScrollbarScrollByPage); + ImGui::SameLine(); HelpMarker("Enable scrolling page by page when clicking outside the scrollbar grab.\nWhen disabled, always scroll to clicked location.\nWhen enabled, Shift+Click scrolls to clicked location."); ImGui::Checkbox("io.ConfigMacOSXBehaviors", &io.ConfigMacOSXBehaviors); + ImGui::SameLine(); HelpMarker("Swap Cmd<>Ctrl keys, enable various MacOS style behaviors."); ImGui::Text("Also see Style->Rendering for rendering options."); + // Also read: https://github.com/ocornut/imgui/wiki/Error-Handling + ImGui::SeparatorText("Error Handling"); + + ImGui::Checkbox("io.ConfigErrorRecovery", &io.ConfigErrorRecovery); + ImGui::SameLine(); HelpMarker( + "Options to configure how we handle recoverable errors.\n" + "- Error recovery is not perfect nor guaranteed! It is a feature to ease development.\n" + "- You not are not supposed to rely on it in the course of a normal application run.\n" + "- Possible usage: facilitate recovery from errors triggered from a scripting language or after specific exceptions handlers.\n" + "- Always ensure that on programmers seat you have at minimum Asserts or Tooltips enabled when making direct imgui API call!" + "Otherwise it would severely hinder your ability to catch and correct mistakes!"); + ImGui::Checkbox("io.ConfigErrorRecoveryEnableAssert", &io.ConfigErrorRecoveryEnableAssert); + ImGui::Checkbox("io.ConfigErrorRecoveryEnableDebugLog", &io.ConfigErrorRecoveryEnableDebugLog); + ImGui::Checkbox("io.ConfigErrorRecoveryEnableTooltip", &io.ConfigErrorRecoveryEnableTooltip); + if (!io.ConfigErrorRecoveryEnableAssert && !io.ConfigErrorRecoveryEnableDebugLog && !io.ConfigErrorRecoveryEnableTooltip) + io.ConfigErrorRecoveryEnableAssert = io.ConfigErrorRecoveryEnableDebugLog = io.ConfigErrorRecoveryEnableTooltip = true; + + // Also read: https://github.com/ocornut/imgui/wiki/Debug-Tools ImGui::SeparatorText("Debug"); + ImGui::Checkbox("io.ConfigDebugIsDebuggerPresent", &io.ConfigDebugIsDebuggerPresent); + ImGui::SameLine(); HelpMarker("Enable various tools calling IM_DEBUG_BREAK().\n\nRequires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application."); + ImGui::Checkbox("io.ConfigDebugHighlightIdConflicts", &io.ConfigDebugHighlightIdConflicts); + ImGui::SameLine(); HelpMarker("Highlight and show an error message when multiple items have conflicting identifiers."); ImGui::BeginDisabled(); - ImGui::Checkbox("io.ConfigDebugBeginReturnValueOnce", &io.ConfigDebugBeginReturnValueOnce); // . + ImGui::Checkbox("io.ConfigDebugBeginReturnValueOnce", &io.ConfigDebugBeginReturnValueOnce); ImGui::EndDisabled(); - ImGui::SameLine(); HelpMarker("First calls to Begin()/BeginChild() will return false.\n\nTHIS OPTION IS DISABLED because it needs to be set at application boot-time to make sense. Showing the disabled option is a way to make this feature easier to discover"); + ImGui::SameLine(); HelpMarker("First calls to Begin()/BeginChild() will return false.\n\nTHIS OPTION IS DISABLED because it needs to be set at application boot-time to make sense. Showing the disabled option is a way to make this feature easier to discover."); ImGui::Checkbox("io.ConfigDebugBeginReturnValueLoop", &io.ConfigDebugBeginReturnValueLoop); ImGui::SameLine(); HelpMarker("Some calls to Begin()/BeginChild() will return false.\n\nWill cycle through window depths then repeat. Windows should be flickering while running."); ImGui::Checkbox("io.ConfigDebugIgnoreFocusLoss", &io.ConfigDebugIgnoreFocusLoss); @@ -506,6 +609,7 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", &io.BackendFlags, ImGuiBackendFlags_HasSetMousePos); ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &io.BackendFlags, ImGuiBackendFlags_RendererHasVtxOffset); ImGui::EndDisabled(); + ImGui::TreePop(); ImGui::Spacing(); } @@ -513,8 +617,9 @@ void ImGui::ShowDemoWindow(bool* p_open) IMGUI_DEMO_MARKER("Configuration/Style"); if (ImGui::TreeNode("Style")) { + ImGui::Checkbox("Style Editor", &demo_data.ShowStyleEditor); + ImGui::SameLine(); HelpMarker("The same contents can be accessed in 'Tools->Style Editor' or by calling the ShowStyleEditor() function."); - ImGui::ShowStyleEditor(); ImGui::TreePop(); ImGui::Spacing(); } @@ -560,7 +665,7 @@ void ImGui::ShowDemoWindow(bool* p_open) } // All demo contents - ShowDemoWindowWidgets(); + ShowDemoWindowWidgets(&demo_data); ShowDemoWindowLayout(); ShowDemoWindowPopups(); ShowDemoWindowTables(); @@ -571,9 +676,82 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::End(); } -static void ShowDemoWindowWidgets() +//----------------------------------------------------------------------------- +// [SECTION] ShowDemoWindowMenuBar() +//----------------------------------------------------------------------------- + +static void ShowDemoWindowMenuBar(ImGuiDemoWindowData* demo_data) +{ + IMGUI_DEMO_MARKER("Menu"); + if (ImGui::BeginMenuBar()) + { + if (ImGui::BeginMenu("Menu")) + { + IMGUI_DEMO_MARKER("Menu/File"); + ShowExampleMenuFile(); + ImGui::EndMenu(); + } + if (ImGui::BeginMenu("Examples")) + { + IMGUI_DEMO_MARKER("Menu/Examples"); + ImGui::MenuItem("Main menu bar", NULL, &demo_data->ShowMainMenuBar); + + ImGui::SeparatorText("Mini apps"); + ImGui::MenuItem("Assets Browser", NULL, &demo_data->ShowAppAssetsBrowser); + ImGui::MenuItem("Console", NULL, &demo_data->ShowAppConsole); + ImGui::MenuItem("Custom rendering", NULL, &demo_data->ShowAppCustomRendering); + ImGui::MenuItem("Documents", NULL, &demo_data->ShowAppDocuments); + ImGui::MenuItem("Log", NULL, &demo_data->ShowAppLog); + ImGui::MenuItem("Property editor", NULL, &demo_data->ShowAppPropertyEditor); + ImGui::MenuItem("Simple layout", NULL, &demo_data->ShowAppLayout); + ImGui::MenuItem("Simple overlay", NULL, &demo_data->ShowAppSimpleOverlay); + + ImGui::SeparatorText("Concepts"); + ImGui::MenuItem("Auto-resizing window", NULL, &demo_data->ShowAppAutoResize); + ImGui::MenuItem("Constrained-resizing window", NULL, &demo_data->ShowAppConstrainedResize); + ImGui::MenuItem("Fullscreen window", NULL, &demo_data->ShowAppFullscreen); + ImGui::MenuItem("Long text display", NULL, &demo_data->ShowAppLongText); + ImGui::MenuItem("Manipulating window titles", NULL, &demo_data->ShowAppWindowTitles); + + ImGui::EndMenu(); + } + //if (ImGui::MenuItem("MenuItem")) {} // You can also use MenuItem() inside a menu bar! + if (ImGui::BeginMenu("Tools")) + { + IMGUI_DEMO_MARKER("Menu/Tools"); + ImGuiIO& io = ImGui::GetIO(); +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + const bool has_debug_tools = true; +#else + const bool has_debug_tools = false; +#endif + ImGui::MenuItem("Metrics/Debugger", NULL, &demo_data->ShowMetrics, has_debug_tools); + ImGui::MenuItem("Debug Log", NULL, &demo_data->ShowDebugLog, has_debug_tools); + ImGui::MenuItem("ID Stack Tool", NULL, &demo_data->ShowIDStackTool, has_debug_tools); + bool is_debugger_present = io.ConfigDebugIsDebuggerPresent; + if (ImGui::MenuItem("Item Picker", NULL, false, has_debug_tools && is_debugger_present)) + ImGui::DebugStartItemPicker(); + if (!is_debugger_present) + ImGui::SetItemTooltip("Requires io.ConfigDebugIsDebuggerPresent=true to be set.\n\nWe otherwise disable the menu option to avoid casual users crashing the application.\n\nYou can however always access the Item Picker in Metrics->Tools."); + ImGui::MenuItem("Style Editor", NULL, &demo_data->ShowStyleEditor); + ImGui::MenuItem("About Dear ImGui", NULL, &demo_data->ShowAbout); + + ImGui::SeparatorText("Debug Options"); + ImGui::MenuItem("Highlight ID Conflicts", NULL, &io.ConfigDebugHighlightIdConflicts, has_debug_tools); + ImGui::EndMenu(); + } + ImGui::EndMenuBar(); + } +} + +//----------------------------------------------------------------------------- +// [SECTION] ShowDemoWindowWidgets() +//----------------------------------------------------------------------------- + +static void ShowDemoWindowWidgets(ImGuiDemoWindowData* demo_data) { IMGUI_DEMO_MARKER("Widgets"); + //ImGui::SetNextItemOpen(true, ImGuiCond_Once); if (!ImGui::CollapsingHeader("Widgets")) return; @@ -632,11 +810,11 @@ static void ShowDemoWindowWidgets() IMGUI_DEMO_MARKER("Widgets/Basic/Buttons (Repeating)"); static int counter = 0; float spacing = ImGui::GetStyle().ItemInnerSpacing.x; - ImGui::PushButtonRepeat(true); + ImGui::PushItemFlag(ImGuiItemFlags_ButtonRepeat, true); if (ImGui::ArrowButton("##left", ImGuiDir_Left)) { counter--; } ImGui::SameLine(0.0f, spacing); if (ImGui::ArrowButton("##right", ImGuiDir_Right)) { counter++; } - ImGui::PopButtonRepeat(); + ImGui::PopItemFlag(); ImGui::SameLine(); ImGui::Text("%d", counter); @@ -693,18 +871,19 @@ static void ShowDemoWindowWidgets() { IMGUI_DEMO_MARKER("Widgets/Basic/DragInt, DragFloat"); - static int i1 = 50, i2 = 42; + static int i1 = 50, i2 = 42, i3 = 128; ImGui::DragInt("drag int", &i1, 1); ImGui::SameLine(); HelpMarker( "Click and drag to edit value.\n" "Hold SHIFT/ALT for faster/slower edit.\n" "Double-click or CTRL+click to input value."); - ImGui::DragInt("drag int 0..100", &i2, 1, 0, 100, "%d%%", ImGuiSliderFlags_AlwaysClamp); + ImGui::DragInt("drag int wrap 100..200", &i3, 1, 100, 200, "%d", ImGuiSliderFlags_WrapAround); static float f1 = 1.00f, f2 = 0.0067f; ImGui::DragFloat("drag float", &f1, 0.005f); ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns"); + //ImGui::DragFloat("drag wrap -1..1", &f3, 0.005f, -1.0f, 1.0f, NULL, ImGuiSliderFlags_WrapAround); } ImGui::SeparatorText("Sliders"); @@ -759,7 +938,8 @@ static void ShowDemoWindowWidgets() static int item_current = 0; ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items)); ImGui::SameLine(); HelpMarker( - "Using the simplified one-liner Combo API here.\nRefer to the \"Combo\" section below for an explanation of how to use the more flexible and general BeginCombo/EndCombo API."); + "Using the simplified one-liner Combo API here.\n" + "Refer to the \"Combo\" section below for an explanation of how to use the more flexible and general BeginCombo/EndCombo API."); } { @@ -770,7 +950,8 @@ static void ShowDemoWindowWidgets() static int item_current = 1; ImGui::ListBox("listbox", &item_current, items, IM_ARRAYSIZE(items), 4); ImGui::SameLine(); HelpMarker( - "Using the simplified one-liner ListBox API here.\nRefer to the \"List boxes\" section below for an explanation of how to use the more flexible and general BeginListBox/EndListBox API."); + "Using the simplified one-liner ListBox API here.\n" + "Refer to the \"List boxes\" section below for an explanation of how to use the more flexible and general BeginListBox/EndListBox API."); } ImGui::TreePop(); @@ -828,13 +1009,18 @@ static void ShowDemoWindowWidgets() ImGui::SeparatorText("Custom"); + HelpMarker( + "Passing ImGuiHoveredFlags_ForTooltip to IsItemHovered() is the preferred way to standardize" + "tooltip activation details across your application. You may however decide to use custom" + "flags for a specific tooltip instance."); + // The following examples are passed for documentation purpose but may not be useful to most users. - // Passing ImGuiHoveredFlags_Tooltip to IsItemHovered() will pull ImGuiHoveredFlags flags values from - // 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' depending on whether mouse or gamepad/keyboard is being used. - // With default settings, ImGuiHoveredFlags_Tooltip is equivalent to ImGuiHoveredFlags_DelayShort + ImGuiHoveredFlags_Stationary. + // Passing ImGuiHoveredFlags_ForTooltip to IsItemHovered() will pull ImGuiHoveredFlags flags values from + // 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' depending on whether mouse or keyboard/gamepad is being used. + // With default settings, ImGuiHoveredFlags_ForTooltip is equivalent to ImGuiHoveredFlags_DelayShort + ImGuiHoveredFlags_Stationary. ImGui::Button("Manual", sz); if (ImGui::IsItemHovered(ImGuiHoveredFlags_ForTooltip)) - ImGui::SetTooltip("I am a manually emitted tooltip"); + ImGui::SetTooltip("I am a manually emitted tooltip."); ImGui::Button("DelayNone", sz); if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNone)) @@ -846,12 +1032,20 @@ static void ShowDemoWindowWidgets() ImGui::Button("DelayLong", sz); if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay)) - ImGui::SetTooltip("I am a tooltip with a long delay (%0.2f sec)", ImGui::GetStyle().HoverDelayNormal); + ImGui::SetTooltip("I am a tooltip with a long delay (%0.2f sec).", ImGui::GetStyle().HoverDelayNormal); ImGui::Button("Stationary", sz); if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary)) ImGui::SetTooltip("I am a tooltip requiring mouse to be stationary before activating."); + // Using ImGuiHoveredFlags_ForTooltip will pull flags from 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav', + // which default value include the ImGuiHoveredFlags_AllowWhenDisabled flag. + ImGui::BeginDisabled(); + ImGui::Button("Disabled item", sz); + if (ImGui::IsItemHovered(ImGuiHoveredFlags_ForTooltip)) + ImGui::SetTooltip("I am a a tooltip for a disabled item."); + ImGui::EndDisabled(); + ImGui::TreePop(); } @@ -861,10 +1055,10 @@ static void ShowDemoWindowWidgets() // if (once) // ImGui::Text("This will be displayed only once."); - IMGUI_DEMO_MARKER("Widgets/Trees"); - if (ImGui::TreeNode("Trees")) + IMGUI_DEMO_MARKER("Widgets/Tree Nodes"); + if (ImGui::TreeNode("Tree Nodes")) { - IMGUI_DEMO_MARKER("Widgets/Trees/Basic trees"); + IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Basic trees"); if (ImGui::TreeNode("Basic trees")) { for (int i = 0; i < 5; i++) @@ -874,18 +1068,23 @@ static void ShowDemoWindowWidgets() if (i == 0) ImGui::SetNextItemOpen(true, ImGuiCond_Once); - if (ImGui::TreeNode((void*)(intptr_t)i, "Child %d", i)) + // Here we use PushID() to generate a unique base ID, and then the "" used as TreeNode id won't conflict. + // An alternative to using 'PushID() + TreeNode("", ...)' to generate a unique ID is to use 'TreeNode((void*)(intptr_t)i, ...)', + // aka generate a dummy pointer-sized value to be hashed. The demo below uses that technique. Both are fine. + ImGui::PushID(i); + if (ImGui::TreeNode("", "Child %d", i)) { ImGui::Text("blah blah"); ImGui::SameLine(); if (ImGui::SmallButton("button")) {} ImGui::TreePop(); } + ImGui::PopID(); } ImGui::TreePop(); } - IMGUI_DEMO_MARKER("Widgets/Trees/Advanced, with Selectable nodes"); + IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Advanced, with Selectable nodes"); if (ImGui::TreeNode("Advanced, with Selectable nodes")) { HelpMarker( @@ -898,6 +1097,11 @@ static void ShowDemoWindowWidgets() ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnDoubleClick", &base_flags, ImGuiTreeNodeFlags_OpenOnDoubleClick); ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAvailWidth", &base_flags, ImGuiTreeNodeFlags_SpanAvailWidth); ImGui::SameLine(); HelpMarker("Extend hit area to all available width instead of allowing more items to be laid out after the node."); ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanFullWidth", &base_flags, ImGuiTreeNodeFlags_SpanFullWidth); + ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanTextWidth", &base_flags, ImGuiTreeNodeFlags_SpanTextWidth); ImGui::SameLine(); HelpMarker("Reduce hit area to the text label and a bit of margin."); + ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAllColumns", &base_flags, ImGuiTreeNodeFlags_SpanAllColumns); ImGui::SameLine(); HelpMarker("For use in Tables only."); + ImGui::CheckboxFlags("ImGuiTreeNodeFlags_AllowOverlap", &base_flags, ImGuiTreeNodeFlags_AllowOverlap); + ImGui::CheckboxFlags("ImGuiTreeNodeFlags_Framed", &base_flags, ImGuiTreeNodeFlags_Framed); ImGui::SameLine(); HelpMarker("Draw frame with background (e.g. for CollapsingHeader)"); + ImGui::CheckboxFlags("ImGuiTreeNodeFlags_NavLeftJumpsBackHere", &base_flags, ImGuiTreeNodeFlags_NavLeftJumpsBackHere); ImGui::Checkbox("Align label with current X position", &align_label_with_current_x_position); ImGui::Checkbox("Test tree node as drag source", &test_drag_and_drop); ImGui::Text("Hello!"); @@ -930,9 +1134,17 @@ static void ShowDemoWindowWidgets() ImGui::Text("This is a drag and drop source"); ImGui::EndDragDropSource(); } + if (i == 2 && (base_flags & ImGuiTreeNodeFlags_SpanTextWidth)) + { + // Item 2 has an additional inline button to help demonstrate SpanTextWidth. + ImGui::SameLine(); + if (ImGui::SmallButton("button")) {} + } if (node_open) { ImGui::BulletText("Blah blah\nBlah Blah"); + ImGui::SameLine(); + ImGui::SmallButton("Button"); ImGui::TreePop(); } } @@ -1073,7 +1285,7 @@ static void ShowDemoWindowWidgets() "CJK text will only appear if the font was loaded with the appropriate CJK character ranges. " "Call io.Fonts->AddFontFromFileTTF() manually to load extra character ranges. " "Read docs/FONTS.md for details."); - ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)"); // Normally we would use u8"blah blah" with the proper characters directly in the string. + ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)"); ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)"); static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e"; //static char buf[32] = u8"NIHONGO"; // <- this is how you would write it with C++11, using real kanjis @@ -1117,7 +1329,7 @@ static void ShowDemoWindowWidgets() ImVec2 pos = ImGui::GetCursorScreenPos(); ImVec2 uv_min = ImVec2(0.0f, 0.0f); // Top-left ImVec2 uv_max = ImVec2(1.0f, 1.0f); // Lower-right - ImVec4 tint_col = use_text_color_for_tint ? ImGui::GetStyleColorVec4(ImGuiCol_Text) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint + ImVec4 tint_col = use_text_color_for_tint ? ImGui::GetStyleColorVec4(ImGuiCol_Text) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint ImVec4 border_col = ImGui::GetStyleColorVec4(ImGuiCol_Border); ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, tint_col, border_col); if (ImGui::BeginItemTooltip()) @@ -1176,23 +1388,36 @@ static void ShowDemoWindowWidgets() ImGui::CheckboxFlags("ImGuiComboFlags_PopupAlignLeft", &flags, ImGuiComboFlags_PopupAlignLeft); ImGui::SameLine(); HelpMarker("Only makes a difference if the popup is larger than the combo"); if (ImGui::CheckboxFlags("ImGuiComboFlags_NoArrowButton", &flags, ImGuiComboFlags_NoArrowButton)) - flags &= ~ImGuiComboFlags_NoPreview; // Clear the other flag, as we cannot combine both + flags &= ~ImGuiComboFlags_NoPreview; // Clear incompatible flags if (ImGui::CheckboxFlags("ImGuiComboFlags_NoPreview", &flags, ImGuiComboFlags_NoPreview)) - flags &= ~ImGuiComboFlags_NoArrowButton; // Clear the other flag, as we cannot combine both + flags &= ~(ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_WidthFitPreview); // Clear incompatible flags + if (ImGui::CheckboxFlags("ImGuiComboFlags_WidthFitPreview", &flags, ImGuiComboFlags_WidthFitPreview)) + flags &= ~ImGuiComboFlags_NoPreview; + + // Override default popup height + if (ImGui::CheckboxFlags("ImGuiComboFlags_HeightSmall", &flags, ImGuiComboFlags_HeightSmall)) + flags &= ~(ImGuiComboFlags_HeightMask_ & ~ImGuiComboFlags_HeightSmall); + if (ImGui::CheckboxFlags("ImGuiComboFlags_HeightRegular", &flags, ImGuiComboFlags_HeightRegular)) + flags &= ~(ImGuiComboFlags_HeightMask_ & ~ImGuiComboFlags_HeightRegular); + if (ImGui::CheckboxFlags("ImGuiComboFlags_HeightLargest", &flags, ImGuiComboFlags_HeightLargest)) + flags &= ~(ImGuiComboFlags_HeightMask_ & ~ImGuiComboFlags_HeightLargest); // Using the generic BeginCombo() API, you have full control over how to display the combo contents. // (your selection data could be an index, a pointer to the object, an id for the object, a flag intrusively // stored in the object itself, etc.) const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" }; - static int item_current_idx = 0; // Here we store our selection data as an index. - const char* combo_preview_value = items[item_current_idx]; // Pass in the preview value visible before opening the combo (it could be anything) + static int item_selected_idx = 0; // Here we store our selection data as an index. + + // Pass in the preview value visible before opening the combo (it could technically be different contents or not pulled from items[]) + const char* combo_preview_value = items[item_selected_idx]; + if (ImGui::BeginCombo("combo 1", combo_preview_value, flags)) { for (int n = 0; n < IM_ARRAYSIZE(items); n++) { - const bool is_selected = (item_current_idx == n); + const bool is_selected = (item_selected_idx == n); if (ImGui::Selectable(items[n], is_selected)) - item_current_idx = n; + item_selected_idx = n; // Set the initial focus when opening the combo (scrolling + keyboard navigation focus) if (is_selected) @@ -1201,6 +1426,10 @@ static void ShowDemoWindowWidgets() ImGui::EndCombo(); } + ImGui::Spacing(); + ImGui::SeparatorText("One-liner variants"); + HelpMarker("Flags above don't apply to this section."); + // Simplified one-liner Combo() API, using values packed in a single constant string // This is a convenience for when the selection set is small and known at compile-time. static int item_current_2 = 0; @@ -1212,9 +1441,8 @@ static void ShowDemoWindowWidgets() ImGui::Combo("combo 3 (array)", &item_current_3, items, IM_ARRAYSIZE(items)); // Simplified one-liner Combo() using an accessor function - struct Funcs { static bool ItemGetter(void* data, int n, const char** out_str) { *out_str = ((const char**)data)[n]; return true; } }; static int item_current_4 = 0; - ImGui::Combo("combo 4 (function)", &item_current_4, &Funcs::ItemGetter, items, IM_ARRAYSIZE(items)); + ImGui::Combo("combo 4 (function)", &item_current_4, [](void* data, int n) { return ((const char**)data)[n]; }, items, IM_ARRAYSIZE(items)); ImGui::TreePop(); } @@ -1222,18 +1450,31 @@ static void ShowDemoWindowWidgets() IMGUI_DEMO_MARKER("Widgets/List Boxes"); if (ImGui::TreeNode("List boxes")) { + // BeginListBox() is essentially a thin wrapper to using BeginChild()/EndChild() + // using the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label. + // You may be tempted to simply use BeginChild() directly. However note that BeginChild() requires EndChild() + // to always be called (inconsistent with BeginListBox()/EndListBox()). + // Using the generic BeginListBox() API, you have full control over how to display the combo contents. // (your selection data could be an index, a pointer to the object, an id for the object, a flag intrusively // stored in the object itself, etc.) const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" }; - static int item_current_idx = 0; // Here we store our selection data as an index. + static int item_selected_idx = 0; // Here we store our selected data as an index. + + static bool item_highlight = false; + int item_highlighted_idx = -1; // Here we store our highlighted data as an index. + ImGui::Checkbox("Highlight hovered item in second listbox", &item_highlight); + if (ImGui::BeginListBox("listbox 1")) { for (int n = 0; n < IM_ARRAYSIZE(items); n++) { - const bool is_selected = (item_current_idx == n); + const bool is_selected = (item_selected_idx == n); if (ImGui::Selectable(items[n], is_selected)) - item_current_idx = n; + item_selected_idx = n; + + if (item_highlight && ImGui::IsItemHovered()) + item_highlighted_idx = n; // Set the initial focus when opening the combo (scrolling + keyboard navigation focus) if (is_selected) @@ -1241,6 +1482,7 @@ static void ShowDemoWindowWidgets() } ImGui::EndListBox(); } + ImGui::SameLine(); HelpMarker("Here we are sharing selection state between both boxes."); // Custom size: use all width, 5 items tall ImGui::Text("Full-width:"); @@ -1248,9 +1490,10 @@ static void ShowDemoWindowWidgets() { for (int n = 0; n < IM_ARRAYSIZE(items); n++) { - const bool is_selected = (item_current_idx == n); - if (ImGui::Selectable(items[n], is_selected)) - item_current_idx = n; + bool is_selected = (item_selected_idx == n); + ImGuiSelectableFlags flags = (item_highlighted_idx == n) ? ImGuiSelectableFlags_Highlight : 0; + if (ImGui::Selectable(items[n], is_selected, flags)) + item_selected_idx = n; // Set the initial focus when opening the combo (scrolling + keyboard navigation focus) if (is_selected) @@ -1263,6 +1506,7 @@ static void ShowDemoWindowWidgets() } IMGUI_DEMO_MARKER("Widgets/Selectables"); + //ImGui::SetNextItemOpen(true, ImGuiCond_Once); if (ImGui::TreeNode("Selectables")) { // Selectable() has 2 overloads: @@ -1284,37 +1528,6 @@ static void ShowDemoWindowWidgets() ImGui::TreePop(); } - IMGUI_DEMO_MARKER("Widgets/Selectables/Single Selection"); - if (ImGui::TreeNode("Selection State: Single Selection")) - { - static int selected = -1; - for (int n = 0; n < 5; n++) - { - char buf[32]; - sprintf(buf, "Object %d", n); - if (ImGui::Selectable(buf, selected == n)) - selected = n; - } - ImGui::TreePop(); - } - IMGUI_DEMO_MARKER("Widgets/Selectables/Multiple Selection"); - if (ImGui::TreeNode("Selection State: Multiple Selection")) - { - HelpMarker("Hold CTRL and click to select multiple items."); - static bool selection[5] = { false, false, false, false, false }; - for (int n = 0; n < 5; n++) - { - char buf[32]; - sprintf(buf, "Object %d", n); - if (ImGui::Selectable(buf, selection[n])) - { - if (!ImGui::GetIO().KeyCtrl) // Clear selection when CTRL is not held - memset(selection, 0, sizeof(selection)); - selection[n] ^= 1; - } - } - ImGui::TreePop(); - } IMGUI_DEMO_MARKER("Widgets/Selectables/Rendering more items on the same line"); if (ImGui::TreeNode("Rendering more items on the same line")) { @@ -1327,8 +1540,8 @@ static void ShowDemoWindowWidgets() ImGui::TreePop(); } - IMGUI_DEMO_MARKER("Widgets/Selectables/In columns"); - if (ImGui::TreeNode("In columns")) + IMGUI_DEMO_MARKER("Widgets/Selectables/In Tables"); + if (ImGui::TreeNode("In Tables")) { static bool selected[10] = {}; @@ -1422,6 +1635,8 @@ static void ShowDemoWindowWidgets() ImGui::TreePop(); } + ShowDemoWindowMultiSelect(demo_data); + // To wire InputText() with std::string or any other custom string type, // see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file. IMGUI_DEMO_MARKER("Widgets/Text Input"); @@ -1448,6 +1663,7 @@ static void ShowDemoWindowWidgets() HelpMarker("You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputTextMultiline() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example. (This is not demonstrated in imgui_demo.cpp because we don't want to include in here)"); ImGui::CheckboxFlags("ImGuiInputTextFlags_ReadOnly", &flags, ImGuiInputTextFlags_ReadOnly); ImGui::CheckboxFlags("ImGuiInputTextFlags_AllowTabInput", &flags, ImGuiInputTextFlags_AllowTabInput); + ImGui::SameLine(); HelpMarker("When _AllowTabInput is set, passing through the widget with Tabbing doesn't automatically activate it, in order to also cycling through subsequent widgets."); ImGui::CheckboxFlags("ImGuiInputTextFlags_CtrlEnterForNewLine", &flags, ImGuiInputTextFlags_CtrlEnterForNewLine); ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16), flags); ImGui::TreePop(); @@ -1538,16 +1754,21 @@ static void ShowDemoWindowWidgets() }; static char buf1[64]; ImGui::InputText("Completion", buf1, 64, ImGuiInputTextFlags_CallbackCompletion, Funcs::MyCallback); - ImGui::SameLine(); HelpMarker("Here we append \"..\" each time Tab is pressed. See 'Examples>Console' for a more meaningful demonstration of using this callback."); + ImGui::SameLine(); HelpMarker( + "Here we append \"..\" each time Tab is pressed. " + "See 'Examples>Console' for a more meaningful demonstration of using this callback."); static char buf2[64]; ImGui::InputText("History", buf2, 64, ImGuiInputTextFlags_CallbackHistory, Funcs::MyCallback); - ImGui::SameLine(); HelpMarker("Here we replace and select text each time Up/Down are pressed. See 'Examples>Console' for a more meaningful demonstration of using this callback."); + ImGui::SameLine(); HelpMarker( + "Here we replace and select text each time Up/Down are pressed. " + "See 'Examples>Console' for a more meaningful demonstration of using this callback."); static char buf3[64]; static int edit_count = 0; ImGui::InputText("Edit", buf3, 64, ImGuiInputTextFlags_CallbackEdit, Funcs::MyCallback, (void*)&edit_count); - ImGui::SameLine(); HelpMarker("Here we toggle the casing of the first character on every edit + count edits."); + ImGui::SameLine(); HelpMarker( + "Here we toggle the casing of the first character on every edit + count edits."); ImGui::SameLine(); ImGui::Text("(%d)", edit_count); ImGui::TreePop(); @@ -1651,6 +1872,7 @@ static void ShowDemoWindowWidgets() ImGui::CheckboxFlags("ImGuiTabBarFlags_AutoSelectNewTabs", &tab_bar_flags, ImGuiTabBarFlags_AutoSelectNewTabs); ImGui::CheckboxFlags("ImGuiTabBarFlags_TabListPopupButton", &tab_bar_flags, ImGuiTabBarFlags_TabListPopupButton); ImGui::CheckboxFlags("ImGuiTabBarFlags_NoCloseWithMiddleMouseButton", &tab_bar_flags, ImGuiTabBarFlags_NoCloseWithMiddleMouseButton); + ImGui::CheckboxFlags("ImGuiTabBarFlags_DrawSelectedOverline", &tab_bar_flags, ImGuiTabBarFlags_DrawSelectedOverline); if ((tab_bar_flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0) tab_bar_flags |= ImGuiTabBarFlags_FittingPolicyDefault_; if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyResizeDown", &tab_bar_flags, ImGuiTabBarFlags_FittingPolicyResizeDown)) @@ -1659,11 +1881,13 @@ static void ShowDemoWindowWidgets() tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyScroll); // Tab Bar + ImGui::AlignTextToFramePadding(); + ImGui::Text("Opened:"); const char* names[4] = { "Artichoke", "Beetroot", "Celery", "Daikon" }; static bool opened[4] = { true, true, true, true }; // Persistent user state for (int n = 0; n < IM_ARRAYSIZE(opened); n++) { - if (n > 0) { ImGui::SameLine(); } + ImGui::SameLine(); ImGui::Checkbox(names[n], &opened[n]); } @@ -1722,8 +1946,9 @@ static void ShowDemoWindowWidgets() ImGui::EndPopup(); } - // Demo Trailing Tabs: click the "+" button to add a new tab (in your app you may want to use a font icon instead of the "+") - // Note that we submit it before the regular tabs, but because of the ImGuiTabItemFlags_Trailing flag it will always appear at the end. + // Demo Trailing Tabs: click the "+" button to add a new tab. + // (In your app you may want to use a font icon instead of the "+") + // We submit it before the regular tabs, but thanks to the ImGuiTabItemFlags_Trailing flag it will always appear at the end. if (show_trailing_button) if (ImGui::TabItemButton("+", ImGuiTabItemFlags_Trailing | ImGuiTabItemFlags_NoTooltip)) active_tabs.push_back(next_tab_id++); // Add new tab @@ -1764,10 +1989,10 @@ static void ShowDemoWindowWidgets() ImGui::Checkbox("Animate", &animate); // Plot as lines and plot as histogram - IMGUI_DEMO_MARKER("Widgets/Plotting/PlotLines, PlotHistogram"); static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr)); ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0, 80.0f)); + //ImGui::SameLine(); HelpMarker("Consider using ImPlot instead!"); // Fill an array of contiguous float values to plot // Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float @@ -1813,19 +2038,25 @@ static void ShowDemoWindowWidgets() ImGui::SameLine(); ImGui::SliderInt("Sample count", &display_count, 1, 400); float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw; - ImGui::PlotLines("Lines", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80)); - ImGui::PlotHistogram("Histogram", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80)); + ImGui::PlotLines("Lines##2", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80)); + ImGui::PlotHistogram("Histogram##2", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80)); + ImGui::Separator(); + + ImGui::Text("Need better plotting and graphing? Consider using ImPlot:"); + ImGui::TextLinkOpenURL("https://github.com/epezent/implot"); ImGui::Separator(); + ImGui::TreePop(); + } + + IMGUI_DEMO_MARKER("Widgets/Progress Bars"); + if (ImGui::TreeNode("Progress Bars")) + { // Animate a simple progress bar - IMGUI_DEMO_MARKER("Widgets/Plotting/ProgressBar"); static float progress = 0.0f, progress_dir = 1.0f; - if (animate) - { - progress += progress_dir * 0.4f * ImGui::GetIO().DeltaTime; - if (progress >= +1.1f) { progress = +1.1f; progress_dir *= -1.0f; } - if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; } - } + progress += progress_dir * 0.4f * ImGui::GetIO().DeltaTime; + if (progress >= +1.1f) { progress = +1.1f; progress_dir *= -1.0f; } + if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; } // Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width, // or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth. @@ -1837,6 +2068,13 @@ static void ShowDemoWindowWidgets() char buf[32]; sprintf(buf, "%d/%d", (int)(progress_saturated * 1753), 1753); ImGui::ProgressBar(progress, ImVec2(0.f, 0.f), buf); + + // Pass an animated negative value, e.g. -1.0f * (float)ImGui::GetTime() is the recommended value. + // Adjust the factor if you want to adjust the animation speed. + ImGui::ProgressBar(-1.0f * (float)ImGui::GetTime(), ImVec2(0.0f, 0.0f), "Searching.."); + ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x); + ImGui::Text("Indeterminate"); + ImGui::TreePop(); } @@ -2007,7 +2245,8 @@ static void ShowDemoWindowWidgets() if (ImGui::Button("Default: Float + HDR + Hue Wheel")) ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel); - // Always both a small version of both types of pickers (to make it more visible in the demo to people who are skimming quickly through it) + // Always display a small version of both types of pickers + // (that's in order to make it more visible in the demo to people who are skimming quickly through it) ImGui::Text("Both types:"); float w = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.y) * 0.40f; ImGui::SetNextItemWidth(w); @@ -2038,13 +2277,18 @@ static void ShowDemoWindowWidgets() // Demonstrate using advanced flags for DragXXX and SliderXXX functions. Note that the flags are the same! static ImGuiSliderFlags flags = ImGuiSliderFlags_None; ImGui::CheckboxFlags("ImGuiSliderFlags_AlwaysClamp", &flags, ImGuiSliderFlags_AlwaysClamp); - ImGui::SameLine(); HelpMarker("Always clamp value to min/max bounds (if any) when input manually with CTRL+Click."); + ImGui::CheckboxFlags("ImGuiSliderFlags_ClampOnInput", &flags, ImGuiSliderFlags_ClampOnInput); + ImGui::SameLine(); HelpMarker("Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds."); + ImGui::CheckboxFlags("ImGuiSliderFlags_ClampZeroRange", &flags, ImGuiSliderFlags_ClampZeroRange); + ImGui::SameLine(); HelpMarker("Clamp even if min==max==0.0f. Otherwise DragXXX functions don't clamp."); ImGui::CheckboxFlags("ImGuiSliderFlags_Logarithmic", &flags, ImGuiSliderFlags_Logarithmic); ImGui::SameLine(); HelpMarker("Enable logarithmic editing (more precision for small values)."); ImGui::CheckboxFlags("ImGuiSliderFlags_NoRoundToFormat", &flags, ImGuiSliderFlags_NoRoundToFormat); ImGui::SameLine(); HelpMarker("Disable rounding underlying value to match precision of the format string (e.g. %.3f values are rounded to those 3 digits)."); ImGui::CheckboxFlags("ImGuiSliderFlags_NoInput", &flags, ImGuiSliderFlags_NoInput); ImGui::SameLine(); HelpMarker("Disable CTRL+Click or Enter key allowing to input text directly into the widget."); + ImGui::CheckboxFlags("ImGuiSliderFlags_WrapAround", &flags, ImGuiSliderFlags_WrapAround); + ImGui::SameLine(); HelpMarker("Enable wrapping around from max to min and from min to max (only supported by DragXXX() functions)"); // Drags static float drag_f = 0.5f; @@ -2054,14 +2298,17 @@ static void ShowDemoWindowWidgets() ImGui::DragFloat("DragFloat (0 -> +inf)", &drag_f, 0.005f, 0.0f, FLT_MAX, "%.3f", flags); ImGui::DragFloat("DragFloat (-inf -> 1)", &drag_f, 0.005f, -FLT_MAX, 1.0f, "%.3f", flags); ImGui::DragFloat("DragFloat (-inf -> +inf)", &drag_f, 0.005f, -FLT_MAX, +FLT_MAX, "%.3f", flags); + //ImGui::DragFloat("DragFloat (0 -> 0)", &drag_f, 0.005f, 0.0f, 0.0f, "%.3f", flags); // To test ClampZeroRange + //ImGui::DragFloat("DragFloat (100 -> 100)", &drag_f, 0.005f, 100.0f, 100.0f, "%.3f", flags); ImGui::DragInt("DragInt (0 -> 100)", &drag_i, 0.5f, 0, 100, "%d", flags); // Sliders static float slider_f = 0.5f; static int slider_i = 50; + const ImGuiSliderFlags flags_for_sliders = flags & ~ImGuiSliderFlags_WrapAround; ImGui::Text("Underlying float value: %f", slider_f); - ImGui::SliderFloat("SliderFloat (0 -> 1)", &slider_f, 0.0f, 1.0f, "%.3f", flags); - ImGui::SliderInt("SliderInt (0 -> 100)", &slider_i, 0, 100, "%d", flags); + ImGui::SliderFloat("SliderFloat (0 -> 1)", &slider_f, 0.0f, 1.0f, "%.3f", flags_for_sliders); + ImGui::SliderInt("SliderInt (0 -> 100)", &slider_i, 0, 100, "%d", flags_for_sliders); ImGui::TreePop(); } @@ -2183,20 +2430,24 @@ static void ShowDemoWindowWidgets() IMGUI_DEMO_MARKER("Widgets/Data Types/Inputs"); static bool inputs_step = true; + static ImGuiInputTextFlags flags = ImGuiInputTextFlags_None; ImGui::SeparatorText("Inputs"); ImGui::Checkbox("Show step buttons", &inputs_step); - ImGui::InputScalar("input s8", ImGuiDataType_S8, &s8_v, inputs_step ? &s8_one : NULL, NULL, "%d"); - ImGui::InputScalar("input u8", ImGuiDataType_U8, &u8_v, inputs_step ? &u8_one : NULL, NULL, "%u"); - ImGui::InputScalar("input s16", ImGuiDataType_S16, &s16_v, inputs_step ? &s16_one : NULL, NULL, "%d"); - ImGui::InputScalar("input u16", ImGuiDataType_U16, &u16_v, inputs_step ? &u16_one : NULL, NULL, "%u"); - ImGui::InputScalar("input s32", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%d"); - ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%04X"); - ImGui::InputScalar("input u32", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%u"); - ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X"); - ImGui::InputScalar("input s64", ImGuiDataType_S64, &s64_v, inputs_step ? &s64_one : NULL); - ImGui::InputScalar("input u64", ImGuiDataType_U64, &u64_v, inputs_step ? &u64_one : NULL); - ImGui::InputScalar("input float", ImGuiDataType_Float, &f32_v, inputs_step ? &f32_one : NULL); - ImGui::InputScalar("input double", ImGuiDataType_Double, &f64_v, inputs_step ? &f64_one : NULL); + ImGui::CheckboxFlags("ImGuiInputTextFlags_ReadOnly", &flags, ImGuiInputTextFlags_ReadOnly); + ImGui::CheckboxFlags("ImGuiInputTextFlags_ParseEmptyRefVal", &flags, ImGuiInputTextFlags_ParseEmptyRefVal); + ImGui::CheckboxFlags("ImGuiInputTextFlags_DisplayEmptyRefVal", &flags, ImGuiInputTextFlags_DisplayEmptyRefVal); + ImGui::InputScalar("input s8", ImGuiDataType_S8, &s8_v, inputs_step ? &s8_one : NULL, NULL, "%d", flags); + ImGui::InputScalar("input u8", ImGuiDataType_U8, &u8_v, inputs_step ? &u8_one : NULL, NULL, "%u", flags); + ImGui::InputScalar("input s16", ImGuiDataType_S16, &s16_v, inputs_step ? &s16_one : NULL, NULL, "%d", flags); + ImGui::InputScalar("input u16", ImGuiDataType_U16, &u16_v, inputs_step ? &u16_one : NULL, NULL, "%u", flags); + ImGui::InputScalar("input s32", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%d", flags); + ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%04X", flags); + ImGui::InputScalar("input u32", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%u", flags); + ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X", flags); + ImGui::InputScalar("input s64", ImGuiDataType_S64, &s64_v, inputs_step ? &s64_one : NULL, NULL, NULL, flags); + ImGui::InputScalar("input u64", ImGuiDataType_U64, &u64_v, inputs_step ? &u64_one : NULL, NULL, NULL, flags); + ImGui::InputScalar("input float", ImGuiDataType_Float, &f32_v, inputs_step ? &f32_one : NULL, NULL, NULL, flags); + ImGui::InputScalar("input double", ImGuiDataType_Double, &f64_v, inputs_step ? &f64_one : NULL, NULL, NULL, flags); ImGui::TreePop(); } @@ -2388,6 +2639,11 @@ static void ShowDemoWindowWidgets() IMGUI_DEMO_MARKER("Widgets/Drag and Drop/Drag to reorder items (simple)"); if (ImGui::TreeNode("Drag to reorder items (simple)")) { + // FIXME: there is temporary (usually single-frame) ID Conflict during reordering as a same item may be submitting twice. + // This code was always slightly faulty but in a way which was not easily noticeable. + // Until we fix this, enable ImGuiItemFlags_AllowDuplicateId to disable detecting the issue. + ImGui::PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); + // Simple reordering HelpMarker( "We don't use the drag and drop api at all here! " @@ -2409,6 +2665,36 @@ static void ShowDemoWindowWidgets() } } } + + ImGui::PopItemFlag(); + ImGui::TreePop(); + } + + IMGUI_DEMO_MARKER("Widgets/Drag and Drop/Tooltip at target location"); + if (ImGui::TreeNode("Tooltip at target location")) + { + for (int n = 0; n < 2; n++) + { + // Drop targets + ImGui::Button(n ? "drop here##1" : "drop here##0"); + if (ImGui::BeginDragDropTarget()) + { + ImGuiDragDropFlags drop_target_flags = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoPreviewTooltip; + if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F, drop_target_flags)) + { + IM_UNUSED(payload); + ImGui::SetMouseCursor(ImGuiMouseCursor_NotAllowed); + ImGui::SetTooltip("Cannot drop here!"); + } + ImGui::EndDragDropTarget(); + } + + // Drop source + static ImVec4 col4 = { 1.0f, 0.0f, 0.2f, 1.0f }; + if (n == 0) + ImGui::ColorButton("drag me", col4); + + } ImGui::TreePop(); } @@ -2440,7 +2726,7 @@ static void ShowDemoWindowWidgets() ImGui::BeginDisabled(true); if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button - if (item_type == 2) { ImGui::PushButtonRepeat(true); ret = ImGui::Button("ITEM: Button"); ImGui::PopButtonRepeat(); } // Testing button (with repeater) + if (item_type == 2) { ImGui::PushItemFlag(ImGuiItemFlags_ButtonRepeat, true); ret = ImGui::Button("ITEM: Button"); ImGui::PopItemFlag(); } // Testing button (with repeater) if (item_type == 3) { ret = ImGui::Checkbox("ITEM: Checkbox", &b); } // Testing checkbox if (item_type == 4) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item if (item_type == 5) { ret = ImGui::InputText("ITEM: InputText", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which handles tabbing) @@ -2533,7 +2819,7 @@ static void ShowDemoWindowWidgets() static bool embed_all_inside_a_child_window = false; ImGui::Checkbox("Embed everything inside a child window for testing _RootWindow flag.", &embed_all_inside_a_child_window); if (embed_all_inside_a_child_window) - ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20.0f), true); + ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20.0f), ImGuiChildFlags_Borders); // Testing IsWindowFocused() function with its various flags. ImGui::BulletText( @@ -2581,7 +2867,7 @@ static void ShowDemoWindowWidgets() ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow), ImGui::IsWindowHovered(ImGuiHoveredFlags_Stationary)); - ImGui::BeginChild("child", ImVec2(0, 50), true); + ImGui::BeginChild("child", ImVec2(0, 50), ImGuiChildFlags_Borders); ImGui::Text("This is another child window for testing the _ChildWindows flag."); ImGui::EndChild(); if (embed_all_inside_a_child_window) @@ -2643,57 +2929,1028 @@ static void ShowDemoWindowWidgets() } } -static void ShowDemoWindowLayout() +static const char* ExampleNames[] = { - IMGUI_DEMO_MARKER("Layout"); - if (!ImGui::CollapsingHeader("Layout & Scrolling")) - return; + "Artichoke", "Arugula", "Asparagus", "Avocado", "Bamboo Shoots", "Bean Sprouts", "Beans", "Beet", "Belgian Endive", "Bell Pepper", + "Bitter Gourd", "Bok Choy", "Broccoli", "Brussels Sprouts", "Burdock Root", "Cabbage", "Calabash", "Capers", "Carrot", "Cassava", + "Cauliflower", "Celery", "Celery Root", "Celcuce", "Chayote", "Chinese Broccoli", "Corn", "Cucumber" +}; - IMGUI_DEMO_MARKER("Layout/Child windows"); - if (ImGui::TreeNode("Child windows")) +// Extra functions to add deletion support to ImGuiSelectionBasicStorage +struct ExampleSelectionWithDeletion : ImGuiSelectionBasicStorage +{ + // Find which item should be Focused after deletion. + // Call _before_ item submission. Retunr an index in the before-deletion item list, your item loop should call SetKeyboardFocusHere() on it. + // The subsequent ApplyDeletionPostLoop() code will use it to apply Selection. + // - We cannot provide this logic in core Dear ImGui because we don't have access to selection data. + // - We don't actually manipulate the ImVector<> here, only in ApplyDeletionPostLoop(), but using similar API for consistency and flexibility. + // - Important: Deletion only works if the underlying ImGuiID for your items are stable: aka not depend on their index, but on e.g. item id/ptr. + // FIXME-MULTISELECT: Doesn't take account of the possibility focus target will be moved during deletion. Need refocus or scroll offset. + int ApplyDeletionPreLoop(ImGuiMultiSelectIO* ms_io, int items_count) { - ImGui::SeparatorText("Child windows"); + if (Size == 0) + return -1; - HelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window."); - static bool disable_mouse_wheel = false; - static bool disable_menu = false; - ImGui::Checkbox("Disable Mouse Wheel", &disable_mouse_wheel); - ImGui::Checkbox("Disable Menu", &disable_menu); + // If focused item is not selected... + const int focused_idx = (int)ms_io->NavIdItem; // Index of currently focused item + if (ms_io->NavIdSelected == false) // This is merely a shortcut, == Contains(adapter->IndexToStorage(items, focused_idx)) + { + ms_io->RangeSrcReset = true; // Request to recover RangeSrc from NavId next frame. Would be ok to reset even when NavIdSelected==true, but it would take an extra frame to recover RangeSrc when deleting a selected item. + return focused_idx; // Request to focus same item after deletion. + } - // Child 1: no border, enable horizontal scrollbar + // If focused item is selected: land on first unselected item after focused item. + for (int idx = focused_idx + 1; idx < items_count; idx++) + if (!Contains(GetStorageIdFromIndex(idx))) + return idx; + + // If focused item is selected: otherwise return last unselected item before focused item. + for (int idx = IM_MIN(focused_idx, items_count) - 1; idx >= 0; idx--) + if (!Contains(GetStorageIdFromIndex(idx))) + return idx; + + return -1; + } + + // Rewrite item list (delete items) + update selection. + // - Call after EndMultiSelect() + // - We cannot provide this logic in core Dear ImGui because we don't have access to your items, nor to selection data. + template + void ApplyDeletionPostLoop(ImGuiMultiSelectIO* ms_io, ImVector& items, int item_curr_idx_to_select) + { + // Rewrite item list (delete items) + convert old selection index (before deletion) to new selection index (after selection). + // If NavId was not part of selection, we will stay on same item. + ImVector new_items; + new_items.reserve(items.Size - Size); + int item_next_idx_to_select = -1; + for (int idx = 0; idx < items.Size; idx++) { - ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar; - if (disable_mouse_wheel) - window_flags |= ImGuiWindowFlags_NoScrollWithMouse; - ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 260), false, window_flags); - for (int i = 0; i < 100; i++) - ImGui::Text("%04d: scrollable region", i); - ImGui::EndChild(); + if (!Contains(GetStorageIdFromIndex(idx))) + new_items.push_back(items[idx]); + if (item_curr_idx_to_select == idx) + item_next_idx_to_select = new_items.Size - 1; } + items.swap(new_items); - ImGui::SameLine(); + // Update selection + Clear(); + if (item_next_idx_to_select != -1 && ms_io->NavIdSelected) + SetItemSelected(GetStorageIdFromIndex(item_next_idx_to_select), true); + } +}; - // Child 2: rounded border +// Example: Implement dual list box storage and interface +struct ExampleDualListBox +{ + ImVector Items[2]; // ID is index into ExampleName[] + ImGuiSelectionBasicStorage Selections[2]; // Store ExampleItemId into selection + bool OptKeepSorted = true; + + void MoveAll(int src, int dst) + { + IM_ASSERT((src == 0 && dst == 1) || (src == 1 && dst == 0)); + for (ImGuiID item_id : Items[src]) + Items[dst].push_back(item_id); + Items[src].clear(); + SortItems(dst); + Selections[src].Swap(Selections[dst]); + Selections[src].Clear(); + } + void MoveSelected(int src, int dst) + { + for (int src_n = 0; src_n < Items[src].Size; src_n++) { - ImGuiWindowFlags window_flags = ImGuiWindowFlags_None; - if (disable_mouse_wheel) - window_flags |= ImGuiWindowFlags_NoScrollWithMouse; - if (!disable_menu) - window_flags |= ImGuiWindowFlags_MenuBar; - ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f); - ImGui::BeginChild("ChildR", ImVec2(0, 260), true, window_flags); - if (!disable_menu && ImGui::BeginMenuBar()) - { - if (ImGui::BeginMenu("Menu")) - { - ShowExampleMenuFile(); - ImGui::EndMenu(); - } - ImGui::EndMenuBar(); - } - if (ImGui::BeginTable("split", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings)) - { - for (int i = 0; i < 100; i++) + ImGuiID item_id = Items[src][src_n]; + if (!Selections[src].Contains(item_id)) + continue; + Items[src].erase(&Items[src][src_n]); // FIXME-OPT: Could be implemented more optimally (rebuild src items and swap) + Items[dst].push_back(item_id); + src_n--; + } + if (OptKeepSorted) + SortItems(dst); + Selections[src].Swap(Selections[dst]); + Selections[src].Clear(); + } + void ApplySelectionRequests(ImGuiMultiSelectIO* ms_io, int side) + { + // In this example we store item id in selection (instead of item index) + Selections[side].UserData = Items[side].Data; + Selections[side].AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { ImGuiID* items = (ImGuiID*)self->UserData; return items[idx]; }; + Selections[side].ApplyRequests(ms_io); + } + static int IMGUI_CDECL CompareItemsByValue(const void* lhs, const void* rhs) + { + const int* a = (const int*)lhs; + const int* b = (const int*)rhs; + return (*a - *b) > 0 ? +1 : -1; + } + void SortItems(int n) + { + qsort(Items[n].Data, (size_t)Items[n].Size, sizeof(Items[n][0]), CompareItemsByValue); + } + void Show() + { + //ImGui::Checkbox("Sorted", &OptKeepSorted); + if (ImGui::BeginTable("split", 3, ImGuiTableFlags_None)) + { + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch); // Left side + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed); // Buttons + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch); // Right side + ImGui::TableNextRow(); + + int request_move_selected = -1; + int request_move_all = -1; + float child_height_0 = 0.0f; + for (int side = 0; side < 2; side++) + { + // FIXME-MULTISELECT: Dual List Box: Add context menus + // FIXME-NAV: Using ImGuiWindowFlags_NavFlattened exhibit many issues. + ImVector& items = Items[side]; + ImGuiSelectionBasicStorage& selection = Selections[side]; + + ImGui::TableSetColumnIndex((side == 0) ? 0 : 2); + ImGui::Text("%s (%d)", (side == 0) ? "Available" : "Basket", items.Size); + + // Submit scrolling range to avoid glitches on moving/deletion + const float items_height = ImGui::GetTextLineHeightWithSpacing(); + ImGui::SetNextWindowContentSize(ImVec2(0.0f, items.Size * items_height)); + + bool child_visible; + if (side == 0) + { + // Left child is resizable + ImGui::SetNextWindowSizeConstraints(ImVec2(0.0f, ImGui::GetFrameHeightWithSpacing() * 4), ImVec2(FLT_MAX, FLT_MAX)); + child_visible = ImGui::BeginChild("0", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY); + child_height_0 = ImGui::GetWindowSize().y; + } + else + { + // Right child use same height as left one + child_visible = ImGui::BeginChild("1", ImVec2(-FLT_MIN, child_height_0), ImGuiChildFlags_FrameStyle); + } + if (child_visible) + { + ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_None; + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, items.Size); + ApplySelectionRequests(ms_io, side); + + for (int item_n = 0; item_n < items.Size; item_n++) + { + ImGuiID item_id = items[item_n]; + bool item_is_selected = selection.Contains(item_id); + ImGui::SetNextItemSelectionUserData(item_n); + ImGui::Selectable(ExampleNames[item_id], item_is_selected, ImGuiSelectableFlags_AllowDoubleClick); + if (ImGui::IsItemFocused()) + { + // FIXME-MULTISELECT: Dual List Box: Transfer focus + if (ImGui::IsKeyPressed(ImGuiKey_Enter) || ImGui::IsKeyPressed(ImGuiKey_KeypadEnter)) + request_move_selected = side; + if (ImGui::IsMouseDoubleClicked(0)) // FIXME-MULTISELECT: Double-click on multi-selection? + request_move_selected = side; + } + } + + ms_io = ImGui::EndMultiSelect(); + ApplySelectionRequests(ms_io, side); + } + ImGui::EndChild(); + } + + // Buttons columns + ImGui::TableSetColumnIndex(1); + ImGui::NewLine(); + //ImVec2 button_sz = { ImGui::CalcTextSize(">>").x + ImGui::GetStyle().FramePadding.x * 2.0f, ImGui::GetFrameHeight() + padding.y * 2.0f }; + ImVec2 button_sz = { ImGui::GetFrameHeight(), ImGui::GetFrameHeight() }; + + // (Using BeginDisabled()/EndDisabled() works but feels distracting given how it is currently visualized) + if (ImGui::Button(">>", button_sz)) + request_move_all = 0; + if (ImGui::Button(">", button_sz)) + request_move_selected = 0; + if (ImGui::Button("<", button_sz)) + request_move_selected = 1; + if (ImGui::Button("<<", button_sz)) + request_move_all = 1; + + // Process requests + if (request_move_all != -1) + MoveAll(request_move_all, request_move_all ^ 1); + if (request_move_selected != -1) + MoveSelected(request_move_selected, request_move_selected ^ 1); + + // FIXME-MULTISELECT: Support action from outside + /* + if (OptKeepSorted == false) + { + ImGui::NewLine(); + if (ImGui::ArrowButton("MoveUp", ImGuiDir_Up)) {} + if (ImGui::ArrowButton("MoveDown", ImGuiDir_Down)) {} + } + */ + + ImGui::EndTable(); + } + } +}; + +//----------------------------------------------------------------------------- +// [SECTION] ShowDemoWindowMultiSelect() +//----------------------------------------------------------------------------- +// Multi-selection demos +// Also read: https://github.com/ocornut/imgui/wiki/Multi-Select +//----------------------------------------------------------------------------- + +static void ShowDemoWindowMultiSelect(ImGuiDemoWindowData* demo_data) +{ + IMGUI_DEMO_MARKER("Widgets/Selection State & Multi-Select"); + if (ImGui::TreeNode("Selection State & Multi-Select")) + { + HelpMarker("Selections can be built using Selectable(), TreeNode() or other widgets. Selection state is owned by application code/data."); + + // Without any fancy API: manage single-selection yourself. + IMGUI_DEMO_MARKER("Widgets/Selection State/Single-Select"); + if (ImGui::TreeNode("Single-Select")) + { + static int selected = -1; + for (int n = 0; n < 5; n++) + { + char buf[32]; + sprintf(buf, "Object %d", n); + if (ImGui::Selectable(buf, selected == n)) + selected = n; + } + ImGui::TreePop(); + } + + // Demonstrate implementation a most-basic form of multi-selection manually + // This doesn't support the SHIFT modifier which requires BeginMultiSelect()! + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (manual/simplified, without BeginMultiSelect)"); + if (ImGui::TreeNode("Multi-Select (manual/simplified, without BeginMultiSelect)")) + { + HelpMarker("Hold CTRL and click to select multiple items."); + static bool selection[5] = { false, false, false, false, false }; + for (int n = 0; n < 5; n++) + { + char buf[32]; + sprintf(buf, "Object %d", n); + if (ImGui::Selectable(buf, selection[n])) + { + if (!ImGui::GetIO().KeyCtrl) // Clear selection when CTRL is not held + memset(selection, 0, sizeof(selection)); + selection[n] ^= 1; // Toggle current item + } + } + ImGui::TreePop(); + } + + // Demonstrate handling proper multi-selection using the BeginMultiSelect/EndMultiSelect API. + // SHIFT+Click w/ CTRL and other standard features are supported. + // We use the ImGuiSelectionBasicStorage helper which you may freely reimplement. + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select"); + if (ImGui::TreeNode("Multi-Select")) + { + ImGui::Text("Supported features:"); + ImGui::BulletText("Keyboard navigation (arrows, page up/down, home/end, space)."); + ImGui::BulletText("Ctrl modifier to preserve and toggle selection."); + ImGui::BulletText("Shift modifier for range selection."); + ImGui::BulletText("CTRL+A to select all."); + ImGui::BulletText("Escape to clear selection."); + ImGui::BulletText("Click and drag to box-select."); + ImGui::Text("Tip: Use 'Demo->Tools->Debug Log->Selection' to see selection requests as they happen."); + + // Use default selection.Adapter: Pass index to SetNextItemSelectionUserData(), store index in Selection + const int ITEMS_COUNT = 50; + static ImGuiSelectionBasicStorage selection; + ImGui::Text("Selection: %d/%d", selection.Size, ITEMS_COUNT); + + // The BeginChild() has no purpose for selection logic, other that offering a scrolling region. + if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY)) + { + ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d; + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, ITEMS_COUNT); + selection.ApplyRequests(ms_io); + + for (int n = 0; n < ITEMS_COUNT; n++) + { + char label[64]; + sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]); + bool item_is_selected = selection.Contains((ImGuiID)n); + ImGui::SetNextItemSelectionUserData(n); + ImGui::Selectable(label, item_is_selected); + } + + ms_io = ImGui::EndMultiSelect(); + selection.ApplyRequests(ms_io); + } + ImGui::EndChild(); + ImGui::TreePop(); + } + + // Demonstrate using the clipper with BeginMultiSelect()/EndMultiSelect() + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (with clipper)"); + if (ImGui::TreeNode("Multi-Select (with clipper)")) + { + // Use default selection.Adapter: Pass index to SetNextItemSelectionUserData(), store index in Selection + static ImGuiSelectionBasicStorage selection; + + ImGui::Text("Added features:"); + ImGui::BulletText("Using ImGuiListClipper."); + + const int ITEMS_COUNT = 10000; + ImGui::Text("Selection: %d/%d", selection.Size, ITEMS_COUNT); + if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY)) + { + ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d; + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, ITEMS_COUNT); + selection.ApplyRequests(ms_io); + + ImGuiListClipper clipper; + clipper.Begin(ITEMS_COUNT); + if (ms_io->RangeSrcItem != -1) + clipper.IncludeItemByIndex((int)ms_io->RangeSrcItem); // Ensure RangeSrc item is not clipped. + while (clipper.Step()) + { + for (int n = clipper.DisplayStart; n < clipper.DisplayEnd; n++) + { + char label[64]; + sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]); + bool item_is_selected = selection.Contains((ImGuiID)n); + ImGui::SetNextItemSelectionUserData(n); + ImGui::Selectable(label, item_is_selected); + } + } + + ms_io = ImGui::EndMultiSelect(); + selection.ApplyRequests(ms_io); + } + ImGui::EndChild(); + ImGui::TreePop(); + } + + // Demonstrate dynamic item list + deletion support using the BeginMultiSelect/EndMultiSelect API. + // In order to support Deletion without any glitches you need to: + // - (1) If items are submitted in their own scrolling area, submit contents size SetNextWindowContentSize() ahead of time to prevent one-frame readjustment of scrolling. + // - (2) Items needs to have persistent ID Stack identifier = ID needs to not depends on their index. PushID(index) = KO. PushID(item_id) = OK. This is in order to focus items reliably after a selection. + // - (3) BeginXXXX process + // - (4) Focus process + // - (5) EndXXXX process + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (with deletion)"); + if (ImGui::TreeNode("Multi-Select (with deletion)")) + { + // Storing items data separately from selection data. + // (you may decide to store selection data inside your item (aka intrusive storage) if you don't need multiple views over same items) + // Use a custom selection.Adapter: store item identifier in Selection (instead of index) + static ImVector items; + static ExampleSelectionWithDeletion selection; + selection.UserData = (void*)&items; + selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { ImVector* p_items = (ImVector*)self->UserData; return (*p_items)[idx]; }; // Index -> ID + + ImGui::Text("Added features:"); + ImGui::BulletText("Dynamic list with Delete key support."); + ImGui::Text("Selection size: %d/%d", selection.Size, items.Size); + + // Initialize default list with 50 items + button to add/remove items. + static ImGuiID items_next_id = 0; + if (items_next_id == 0) + for (ImGuiID n = 0; n < 50; n++) + items.push_back(items_next_id++); + if (ImGui::SmallButton("Add 20 items")) { for (int n = 0; n < 20; n++) { items.push_back(items_next_id++); } } + ImGui::SameLine(); + if (ImGui::SmallButton("Remove 20 items")) { for (int n = IM_MIN(20, items.Size); n > 0; n--) { selection.SetItemSelected(items.back(), false); items.pop_back(); } } + + // (1) Extra to support deletion: Submit scrolling range to avoid glitches on deletion + const float items_height = ImGui::GetTextLineHeightWithSpacing(); + ImGui::SetNextWindowContentSize(ImVec2(0.0f, items.Size * items_height)); + + if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY)) + { + ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d; + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, items.Size); + selection.ApplyRequests(ms_io); + + const bool want_delete = ImGui::Shortcut(ImGuiKey_Delete, ImGuiInputFlags_Repeat) && (selection.Size > 0); + const int item_curr_idx_to_focus = want_delete ? selection.ApplyDeletionPreLoop(ms_io, items.Size) : -1; + + for (int n = 0; n < items.Size; n++) + { + const ImGuiID item_id = items[n]; + char label[64]; + sprintf(label, "Object %05u: %s", item_id, ExampleNames[item_id % IM_ARRAYSIZE(ExampleNames)]); + + bool item_is_selected = selection.Contains(item_id); + ImGui::SetNextItemSelectionUserData(n); + ImGui::Selectable(label, item_is_selected); + if (item_curr_idx_to_focus == n) + ImGui::SetKeyboardFocusHere(-1); + } + + // Apply multi-select requests + ms_io = ImGui::EndMultiSelect(); + selection.ApplyRequests(ms_io); + if (want_delete) + selection.ApplyDeletionPostLoop(ms_io, items, item_curr_idx_to_focus); + } + ImGui::EndChild(); + ImGui::TreePop(); + } + + // Implement a Dual List Box (#6648) + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (dual list box)"); + if (ImGui::TreeNode("Multi-Select (dual list box)")) + { + // Init default state + static ExampleDualListBox dlb; + if (dlb.Items[0].Size == 0 && dlb.Items[1].Size == 0) + for (int item_id = 0; item_id < IM_ARRAYSIZE(ExampleNames); item_id++) + dlb.Items[0].push_back((ImGuiID)item_id); + + // Show + dlb.Show(); + + ImGui::TreePop(); + } + + // Demonstrate using the clipper with BeginMultiSelect()/EndMultiSelect() + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (in a table)"); + if (ImGui::TreeNode("Multi-Select (in a table)")) + { + static ImGuiSelectionBasicStorage selection; + + const int ITEMS_COUNT = 10000; + ImGui::Text("Selection: %d/%d", selection.Size, ITEMS_COUNT); + if (ImGui::BeginTable("##Basket", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter)) + { + ImGui::TableSetupColumn("Object"); + ImGui::TableSetupColumn("Action"); + ImGui::TableSetupScrollFreeze(0, 1); + ImGui::TableHeadersRow(); + + ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d; + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, ITEMS_COUNT); + selection.ApplyRequests(ms_io); + + ImGuiListClipper clipper; + clipper.Begin(ITEMS_COUNT); + if (ms_io->RangeSrcItem != -1) + clipper.IncludeItemByIndex((int)ms_io->RangeSrcItem); // Ensure RangeSrc item is not clipped. + while (clipper.Step()) + { + for (int n = clipper.DisplayStart; n < clipper.DisplayEnd; n++) + { + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + char label[64]; + sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]); + bool item_is_selected = selection.Contains((ImGuiID)n); + ImGui::SetNextItemSelectionUserData(n); + ImGui::Selectable(label, item_is_selected, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap); + ImGui::TableNextColumn(); + ImGui::SmallButton("hello"); + } + } + + ms_io = ImGui::EndMultiSelect(); + selection.ApplyRequests(ms_io); + ImGui::EndTable(); + } + ImGui::TreePop(); + } + + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (checkboxes)"); + if (ImGui::TreeNode("Multi-Select (checkboxes)")) + { + ImGui::Text("In a list of checkboxes (not selectable):"); + ImGui::BulletText("Using _NoAutoSelect + _NoAutoClear flags."); + ImGui::BulletText("Shift+Click to check multiple boxes."); + ImGui::BulletText("Shift+Keyboard to copy current value to other boxes."); + + // If you have an array of checkboxes, you may want to use NoAutoSelect + NoAutoClear and the ImGuiSelectionExternalStorage helper. + static bool items[20] = {}; + static ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_NoAutoSelect | ImGuiMultiSelectFlags_NoAutoClear | ImGuiMultiSelectFlags_ClearOnEscape; + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoSelect", &flags, ImGuiMultiSelectFlags_NoAutoSelect); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoClear", &flags, ImGuiMultiSelectFlags_NoAutoClear); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelect2d", &flags, ImGuiMultiSelectFlags_BoxSelect2d); // Cannot use ImGuiMultiSelectFlags_BoxSelect1d as checkboxes are varying width. + + if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeY)) + { + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, -1, IM_ARRAYSIZE(items)); + ImGuiSelectionExternalStorage storage_wrapper; + storage_wrapper.UserData = (void*)items; + storage_wrapper.AdapterSetItemSelected = [](ImGuiSelectionExternalStorage* self, int n, bool selected) { bool* array = (bool*)self->UserData; array[n] = selected; }; + storage_wrapper.ApplyRequests(ms_io); + for (int n = 0; n < 20; n++) + { + char label[32]; + sprintf(label, "Item %d", n); + ImGui::SetNextItemSelectionUserData(n); + ImGui::Checkbox(label, &items[n]); + } + ms_io = ImGui::EndMultiSelect(); + storage_wrapper.ApplyRequests(ms_io); + } + ImGui::EndChild(); + + ImGui::TreePop(); + } + + // Demonstrate individual selection scopes in same window + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (multiple scopes)"); + if (ImGui::TreeNode("Multi-Select (multiple scopes)")) + { + // Use default select: Pass index to SetNextItemSelectionUserData(), store index in Selection + const int SCOPES_COUNT = 3; + const int ITEMS_COUNT = 8; // Per scope + static ImGuiSelectionBasicStorage selections_data[SCOPES_COUNT]; + + // Use ImGuiMultiSelectFlags_ScopeRect to not affect other selections in same window. + static ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ScopeRect | ImGuiMultiSelectFlags_ClearOnEscape;// | ImGuiMultiSelectFlags_ClearOnClickVoid; + if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ScopeWindow", &flags, ImGuiMultiSelectFlags_ScopeWindow) && (flags & ImGuiMultiSelectFlags_ScopeWindow)) + flags &= ~ImGuiMultiSelectFlags_ScopeRect; + if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ScopeRect", &flags, ImGuiMultiSelectFlags_ScopeRect) && (flags & ImGuiMultiSelectFlags_ScopeRect)) + flags &= ~ImGuiMultiSelectFlags_ScopeWindow; + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ClearOnClickVoid", &flags, ImGuiMultiSelectFlags_ClearOnClickVoid); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelect1d", &flags, ImGuiMultiSelectFlags_BoxSelect1d); + + for (int selection_scope_n = 0; selection_scope_n < SCOPES_COUNT; selection_scope_n++) + { + ImGui::PushID(selection_scope_n); + ImGuiSelectionBasicStorage* selection = &selections_data[selection_scope_n]; + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection->Size, ITEMS_COUNT); + selection->ApplyRequests(ms_io); + + ImGui::SeparatorText("Selection scope"); + ImGui::Text("Selection size: %d/%d", selection->Size, ITEMS_COUNT); + + for (int n = 0; n < ITEMS_COUNT; n++) + { + char label[64]; + sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]); + bool item_is_selected = selection->Contains((ImGuiID)n); + ImGui::SetNextItemSelectionUserData(n); + ImGui::Selectable(label, item_is_selected); + } + + // Apply multi-select requests + ms_io = ImGui::EndMultiSelect(); + selection->ApplyRequests(ms_io); + ImGui::PopID(); + } + ImGui::TreePop(); + } + + // See ShowExampleAppAssetsBrowser() + if (ImGui::TreeNode("Multi-Select (tiled assets browser)")) + { + ImGui::Checkbox("Assets Browser", &demo_data->ShowAppAssetsBrowser); + ImGui::Text("(also access from 'Examples->Assets Browser' in menu)"); + ImGui::TreePop(); + } + + // Demonstrate supporting multiple-selection in a tree. + // - We don't use linear indices for selection user data, but our ExampleTreeNode* pointer directly! + // This showcase how SetNextItemSelectionUserData() never assume indices! + // - The difficulty here is to "interpolate" from RangeSrcItem to RangeDstItem in the SetAll/SetRange request. + // We want this interpolation to match what the user sees: in visible order, skipping closed nodes. + // This is implemented by our TreeGetNextNodeInVisibleOrder() user-space helper. + // - Important: In a real codebase aiming to implement full-featured selectable tree with custom filtering, you + // are more likely to build an array mapping sequential indices to visible tree nodes, since your + // filtering/search + clipping process will benefit from it. Having this will make this interpolation much easier. + // - Consider this a prototype: we are working toward simplifying some of it. + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (trees)"); + if (ImGui::TreeNode("Multi-Select (trees)")) + { + HelpMarker( + "This is rather advanced and experimental. If you are getting started with multi-select," + "please don't start by looking at how to use it for a tree!\n\n" + "Future versions will try to simplify and formalize some of this."); + + struct ExampleTreeFuncs + { + static void DrawNode(ExampleTreeNode* node, ImGuiSelectionBasicStorage* selection) + { + ImGuiTreeNodeFlags tree_node_flags = ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick; + tree_node_flags |= ImGuiTreeNodeFlags_NavLeftJumpsBackHere; // Enable pressing left to jump to parent + if (node->Childs.Size == 0) + tree_node_flags |= ImGuiTreeNodeFlags_Bullet | ImGuiTreeNodeFlags_Leaf; + if (selection->Contains((ImGuiID)node->UID)) + tree_node_flags |= ImGuiTreeNodeFlags_Selected; + + // Using SetNextItemStorageID() to specify storage id, so we can easily peek into + // the storage holding open/close stage, using our TreeNodeGetOpen/TreeNodeSetOpen() functions. + ImGui::SetNextItemSelectionUserData((ImGuiSelectionUserData)(intptr_t)node); + ImGui::SetNextItemStorageID((ImGuiID)node->UID); + if (ImGui::TreeNodeEx(node->Name, tree_node_flags)) + { + for (ExampleTreeNode* child : node->Childs) + DrawNode(child, selection); + ImGui::TreePop(); + } + else if (ImGui::IsItemToggledOpen()) + { + TreeCloseAndUnselectChildNodes(node, selection); + } + } + + static bool TreeNodeGetOpen(ExampleTreeNode* node) + { + return ImGui::GetStateStorage()->GetBool((ImGuiID)node->UID); + } + + static void TreeNodeSetOpen(ExampleTreeNode* node, bool open) + { + ImGui::GetStateStorage()->SetBool((ImGuiID)node->UID, open); + } + + // When closing a node: 1) close and unselect all child nodes, 2) select parent if any child was selected. + // FIXME: This is currently handled by user logic but I'm hoping to eventually provide tree node + // features to do this automatically, e.g. a ImGuiTreeNodeFlags_AutoCloseChildNodes etc. + static int TreeCloseAndUnselectChildNodes(ExampleTreeNode* node, ImGuiSelectionBasicStorage* selection, int depth = 0) + { + // Recursive close (the test for depth == 0 is because we call this on a node that was just closed!) + int unselected_count = selection->Contains((ImGuiID)node->UID) ? 1 : 0; + if (depth == 0 || TreeNodeGetOpen(node)) + { + for (ExampleTreeNode* child : node->Childs) + unselected_count += TreeCloseAndUnselectChildNodes(child, selection, depth + 1); + TreeNodeSetOpen(node, false); + } + + // Select root node if any of its child was selected, otherwise unselect + selection->SetItemSelected((ImGuiID)node->UID, (depth == 0 && unselected_count > 0)); + return unselected_count; + } + + // Apply multi-selection requests + static void ApplySelectionRequests(ImGuiMultiSelectIO* ms_io, ExampleTreeNode* tree, ImGuiSelectionBasicStorage* selection) + { + for (ImGuiSelectionRequest& req : ms_io->Requests) + { + if (req.Type == ImGuiSelectionRequestType_SetAll) + { + if (req.Selected) + TreeSetAllInOpenNodes(tree, selection, req.Selected); + else + selection->Clear(); + } + else if (req.Type == ImGuiSelectionRequestType_SetRange) + { + ExampleTreeNode* first_node = (ExampleTreeNode*)(intptr_t)req.RangeFirstItem; + ExampleTreeNode* last_node = (ExampleTreeNode*)(intptr_t)req.RangeLastItem; + for (ExampleTreeNode* node = first_node; node != NULL; node = TreeGetNextNodeInVisibleOrder(node, last_node)) + selection->SetItemSelected((ImGuiID)node->UID, req.Selected); + } + } + } + + static void TreeSetAllInOpenNodes(ExampleTreeNode* node, ImGuiSelectionBasicStorage* selection, bool selected) + { + if (node->Parent != NULL) // Root node isn't visible nor selectable in our scheme + selection->SetItemSelected((ImGuiID)node->UID, selected); + if (node->Parent == NULL || TreeNodeGetOpen(node)) + for (ExampleTreeNode* child : node->Childs) + TreeSetAllInOpenNodes(child, selection, selected); + } + + // Interpolate in *user-visible order* AND only *over opened nodes*. + // If you have a sequential mapping tables (e.g. generated after a filter/search pass) this would be simpler. + // Here the tricks are that: + // - we store/maintain ExampleTreeNode::IndexInParent which allows implementing a linear iterator easily, without searches, without recursion. + // this could be replaced by a search in parent, aka 'int index_in_parent = curr_node->Parent->Childs.find_index(curr_node)' + // which would only be called when crossing from child to a parent, aka not too much. + // - we call SetNextItemStorageID() before our TreeNode() calls with an ID which doesn't relate to UI stack, + // making it easier to call TreeNodeGetOpen()/TreeNodeSetOpen() from any location. + static ExampleTreeNode* TreeGetNextNodeInVisibleOrder(ExampleTreeNode* curr_node, ExampleTreeNode* last_node) + { + // Reached last node + if (curr_node == last_node) + return NULL; + + // Recurse into childs. Query storage to tell if the node is open. + if (curr_node->Childs.Size > 0 && TreeNodeGetOpen(curr_node)) + return curr_node->Childs[0]; + + // Next sibling, then into our own parent + while (curr_node->Parent != NULL) + { + if (curr_node->IndexInParent + 1 < curr_node->Parent->Childs.Size) + return curr_node->Parent->Childs[curr_node->IndexInParent + 1]; + curr_node = curr_node->Parent; + } + return NULL; + } + + }; // ExampleTreeFuncs + + static ImGuiSelectionBasicStorage selection; + if (demo_data->DemoTree == NULL) + demo_data->DemoTree = ExampleTree_CreateDemoTree(); // Create tree once + ImGui::Text("Selection size: %d", selection.Size); + + if (ImGui::BeginChild("##Tree", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY)) + { + ExampleTreeNode* tree = demo_data->DemoTree; + ImGuiMultiSelectFlags ms_flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect2d; + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(ms_flags, selection.Size, -1); + ExampleTreeFuncs::ApplySelectionRequests(ms_io, tree, &selection); + for (ExampleTreeNode* node : tree->Childs) + ExampleTreeFuncs::DrawNode(node, &selection); + ms_io = ImGui::EndMultiSelect(); + ExampleTreeFuncs::ApplySelectionRequests(ms_io, tree, &selection); + } + ImGui::EndChild(); + + ImGui::TreePop(); + } + + // Advanced demonstration of BeginMultiSelect() + // - Showcase clipping. + // - Showcase deletion. + // - Showcase basic drag and drop. + // - Showcase TreeNode variant (note that tree node don't expand in the demo: supporting expanding tree nodes + clipping a separate thing). + // - Showcase using inside a table. + IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (advanced)"); + //ImGui::SetNextItemOpen(true, ImGuiCond_Once); + if (ImGui::TreeNode("Multi-Select (advanced)")) + { + // Options + enum WidgetType { WidgetType_Selectable, WidgetType_TreeNode }; + static bool use_clipper = true; + static bool use_deletion = true; + static bool use_drag_drop = true; + static bool show_in_table = false; + static bool show_color_button = true; + static ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d; + static WidgetType widget_type = WidgetType_Selectable; + + if (ImGui::TreeNode("Options")) + { + if (ImGui::RadioButton("Selectables", widget_type == WidgetType_Selectable)) { widget_type = WidgetType_Selectable; } + ImGui::SameLine(); + if (ImGui::RadioButton("Tree nodes", widget_type == WidgetType_TreeNode)) { widget_type = WidgetType_TreeNode; } + ImGui::SameLine(); + HelpMarker("TreeNode() is technically supported but... using this correctly is more complicated (you need some sort of linear/random access to your tree, which is suited to advanced trees setups already implementing filters and clipper. We will work toward simplifying and demoing this.\n\nFor now the tree demo is actually a little bit meaningless because it is an empty tree with only root nodes."); + ImGui::Checkbox("Enable clipper", &use_clipper); + ImGui::Checkbox("Enable deletion", &use_deletion); + ImGui::Checkbox("Enable drag & drop", &use_drag_drop); + ImGui::Checkbox("Show in a table", &show_in_table); + ImGui::Checkbox("Show color button", &show_color_button); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_SingleSelect", &flags, ImGuiMultiSelectFlags_SingleSelect); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoSelectAll", &flags, ImGuiMultiSelectFlags_NoSelectAll); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoRangeSelect", &flags, ImGuiMultiSelectFlags_NoRangeSelect); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoSelect", &flags, ImGuiMultiSelectFlags_NoAutoSelect); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoClear", &flags, ImGuiMultiSelectFlags_NoAutoClear); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoClearOnReselect", &flags, ImGuiMultiSelectFlags_NoAutoClearOnReselect); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelect1d", &flags, ImGuiMultiSelectFlags_BoxSelect1d); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelect2d", &flags, ImGuiMultiSelectFlags_BoxSelect2d); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelectNoScroll", &flags, ImGuiMultiSelectFlags_BoxSelectNoScroll); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ClearOnEscape", &flags, ImGuiMultiSelectFlags_ClearOnEscape); + ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ClearOnClickVoid", &flags, ImGuiMultiSelectFlags_ClearOnClickVoid); + if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ScopeWindow", &flags, ImGuiMultiSelectFlags_ScopeWindow) && (flags & ImGuiMultiSelectFlags_ScopeWindow)) + flags &= ~ImGuiMultiSelectFlags_ScopeRect; + if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ScopeRect", &flags, ImGuiMultiSelectFlags_ScopeRect) && (flags & ImGuiMultiSelectFlags_ScopeRect)) + flags &= ~ImGuiMultiSelectFlags_ScopeWindow; + if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_SelectOnClick", &flags, ImGuiMultiSelectFlags_SelectOnClick) && (flags & ImGuiMultiSelectFlags_SelectOnClick)) + flags &= ~ImGuiMultiSelectFlags_SelectOnClickRelease; + if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_SelectOnClickRelease", &flags, ImGuiMultiSelectFlags_SelectOnClickRelease) && (flags & ImGuiMultiSelectFlags_SelectOnClickRelease)) + flags &= ~ImGuiMultiSelectFlags_SelectOnClick; + ImGui::SameLine(); HelpMarker("Allow dragging an unselected item without altering selection."); + ImGui::TreePop(); + } + + // Initialize default list with 1000 items. + // Use default selection.Adapter: Pass index to SetNextItemSelectionUserData(), store index in Selection + static ImVector items; + static int items_next_id = 0; + if (items_next_id == 0) { for (int n = 0; n < 1000; n++) { items.push_back(items_next_id++); } } + static ExampleSelectionWithDeletion selection; + static bool request_deletion_from_menu = false; // Queue deletion triggered from context menu + + ImGui::Text("Selection size: %d/%d", selection.Size, items.Size); + + const float items_height = (widget_type == WidgetType_TreeNode) ? ImGui::GetTextLineHeight() : ImGui::GetTextLineHeightWithSpacing(); + ImGui::SetNextWindowContentSize(ImVec2(0.0f, items.Size * items_height)); + if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY)) + { + ImVec2 color_button_sz(ImGui::GetFontSize(), ImGui::GetFontSize()); + if (widget_type == WidgetType_TreeNode) + ImGui::PushStyleVarY(ImGuiStyleVar_ItemSpacing, 0.0f); + + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, items.Size); + selection.ApplyRequests(ms_io); + + const bool want_delete = (ImGui::Shortcut(ImGuiKey_Delete, ImGuiInputFlags_Repeat) && (selection.Size > 0)) || request_deletion_from_menu; + const int item_curr_idx_to_focus = want_delete ? selection.ApplyDeletionPreLoop(ms_io, items.Size) : -1; + request_deletion_from_menu = false; + + if (show_in_table) + { + if (widget_type == WidgetType_TreeNode) + ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(0.0f, 0.0f)); + ImGui::BeginTable("##Split", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_NoPadOuterX); + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch, 0.70f); + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch, 0.30f); + //ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacingY, 0.0f); + } + + ImGuiListClipper clipper; + if (use_clipper) + { + clipper.Begin(items.Size); + if (item_curr_idx_to_focus != -1) + clipper.IncludeItemByIndex(item_curr_idx_to_focus); // Ensure focused item is not clipped. + if (ms_io->RangeSrcItem != -1) + clipper.IncludeItemByIndex((int)ms_io->RangeSrcItem); // Ensure RangeSrc item is not clipped. + } + + while (!use_clipper || clipper.Step()) + { + const int item_begin = use_clipper ? clipper.DisplayStart : 0; + const int item_end = use_clipper ? clipper.DisplayEnd : items.Size; + for (int n = item_begin; n < item_end; n++) + { + if (show_in_table) + ImGui::TableNextColumn(); + + const int item_id = items[n]; + const char* item_category = ExampleNames[item_id % IM_ARRAYSIZE(ExampleNames)]; + char label[64]; + sprintf(label, "Object %05d: %s", item_id, item_category); + + // IMPORTANT: for deletion refocus to work we need object ID to be stable, + // aka not depend on their index in the list. Here we use our persistent item_id + // instead of index to build a unique ID that will persist. + // (If we used PushID(index) instead, focus wouldn't be restored correctly after deletion). + ImGui::PushID(item_id); + + // Emit a color button, to test that Shift+LeftArrow landing on an item that is not part + // of the selection scope doesn't erroneously alter our selection. + if (show_color_button) + { + ImU32 dummy_col = (ImU32)((unsigned int)n * 0xC250B74B) | IM_COL32_A_MASK; + ImGui::ColorButton("##", ImColor(dummy_col), ImGuiColorEditFlags_NoTooltip, color_button_sz); + ImGui::SameLine(); + } + + // Submit item + bool item_is_selected = selection.Contains((ImGuiID)n); + bool item_is_open = false; + ImGui::SetNextItemSelectionUserData(n); + if (widget_type == WidgetType_Selectable) + { + ImGui::Selectable(label, item_is_selected, ImGuiSelectableFlags_None); + } + else if (widget_type == WidgetType_TreeNode) + { + ImGuiTreeNodeFlags tree_node_flags = ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick; + if (item_is_selected) + tree_node_flags |= ImGuiTreeNodeFlags_Selected; + item_is_open = ImGui::TreeNodeEx(label, tree_node_flags); + } + + // Focus (for after deletion) + if (item_curr_idx_to_focus == n) + ImGui::SetKeyboardFocusHere(-1); + + // Drag and Drop + if (use_drag_drop && ImGui::BeginDragDropSource()) + { + // Create payload with full selection OR single unselected item. + // (the later is only possible when using ImGuiMultiSelectFlags_SelectOnClickRelease) + if (ImGui::GetDragDropPayload() == NULL) + { + ImVector payload_items; + void* it = NULL; + ImGuiID id = 0; + if (!item_is_selected) + payload_items.push_back(item_id); + else + while (selection.GetNextSelectedItem(&it, &id)) + payload_items.push_back((int)id); + ImGui::SetDragDropPayload("MULTISELECT_DEMO_ITEMS", payload_items.Data, (size_t)payload_items.size_in_bytes()); + } + + // Display payload content in tooltip + const ImGuiPayload* payload = ImGui::GetDragDropPayload(); + const int* payload_items = (int*)payload->Data; + const int payload_count = (int)payload->DataSize / (int)sizeof(int); + if (payload_count == 1) + ImGui::Text("Object %05d: %s", payload_items[0], ExampleNames[payload_items[0] % IM_ARRAYSIZE(ExampleNames)]); + else + ImGui::Text("Dragging %d objects", payload_count); + + ImGui::EndDragDropSource(); + } + + if (widget_type == WidgetType_TreeNode && item_is_open) + ImGui::TreePop(); + + // Right-click: context menu + if (ImGui::BeginPopupContextItem()) + { + ImGui::BeginDisabled(!use_deletion || selection.Size == 0); + sprintf(label, "Delete %d item(s)###DeleteSelected", selection.Size); + if (ImGui::Selectable(label)) + request_deletion_from_menu = true; + ImGui::EndDisabled(); + ImGui::Selectable("Close"); + ImGui::EndPopup(); + } + + // Demo content within a table + if (show_in_table) + { + ImGui::TableNextColumn(); + ImGui::SetNextItemWidth(-FLT_MIN); + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); + ImGui::InputText("###NoLabel", (char*)(void*)item_category, strlen(item_category), ImGuiInputTextFlags_ReadOnly); + ImGui::PopStyleVar(); + } + + ImGui::PopID(); + } + if (!use_clipper) + break; + } + + if (show_in_table) + { + ImGui::EndTable(); + if (widget_type == WidgetType_TreeNode) + ImGui::PopStyleVar(); + } + + // Apply multi-select requests + ms_io = ImGui::EndMultiSelect(); + selection.ApplyRequests(ms_io); + if (want_delete) + selection.ApplyDeletionPostLoop(ms_io, items, item_curr_idx_to_focus); + + if (widget_type == WidgetType_TreeNode) + ImGui::PopStyleVar(); + } + ImGui::EndChild(); + ImGui::TreePop(); + } + ImGui::TreePop(); + } +} + +//----------------------------------------------------------------------------- +// [SECTION] ShowDemoWindowLayout() +//----------------------------------------------------------------------------- + +static void ShowDemoWindowLayout() +{ + IMGUI_DEMO_MARKER("Layout"); + if (!ImGui::CollapsingHeader("Layout & Scrolling")) + return; + + IMGUI_DEMO_MARKER("Layout/Child windows"); + if (ImGui::TreeNode("Child windows")) + { + ImGui::SeparatorText("Child windows"); + + HelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window."); + static bool disable_mouse_wheel = false; + static bool disable_menu = false; + ImGui::Checkbox("Disable Mouse Wheel", &disable_mouse_wheel); + ImGui::Checkbox("Disable Menu", &disable_menu); + + // Child 1: no border, enable horizontal scrollbar + { + ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar; + if (disable_mouse_wheel) + window_flags |= ImGuiWindowFlags_NoScrollWithMouse; + ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 260), ImGuiChildFlags_None, window_flags); + for (int i = 0; i < 100; i++) + ImGui::Text("%04d: scrollable region", i); + ImGui::EndChild(); + } + + ImGui::SameLine(); + + // Child 2: rounded border + { + ImGuiWindowFlags window_flags = ImGuiWindowFlags_None; + if (disable_mouse_wheel) + window_flags |= ImGuiWindowFlags_NoScrollWithMouse; + if (!disable_menu) + window_flags |= ImGuiWindowFlags_MenuBar; + ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f); + ImGui::BeginChild("ChildR", ImVec2(0, 260), ImGuiChildFlags_Borders, window_flags); + if (!disable_menu && ImGui::BeginMenuBar()) + { + if (ImGui::BeginMenu("Menu")) + { + ShowExampleMenuFile(); + ImGui::EndMenu(); + } + ImGui::EndMenuBar(); + } + if (ImGui::BeginTable("split", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings)) + { + for (int i = 0; i < 100; i++) { char buf[32]; sprintf(buf, "%03d", i); @@ -2706,6 +3963,38 @@ static void ShowDemoWindowLayout() ImGui::PopStyleVar(); } + // Child 3: manual-resize + ImGui::SeparatorText("Manual-resize"); + { + HelpMarker("Drag bottom border to resize. Double-click bottom border to auto-fit to vertical contents."); + //if (ImGui::Button("Set Height to 200")) + // ImGui::SetNextWindowSize(ImVec2(-FLT_MIN, 200.0f)); + + ImGui::PushStyleColor(ImGuiCol_ChildBg, ImGui::GetStyleColorVec4(ImGuiCol_FrameBg)); + if (ImGui::BeginChild("ResizableChild", ImVec2(-FLT_MIN, ImGui::GetTextLineHeightWithSpacing() * 8), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeY)) + for (int n = 0; n < 10; n++) + ImGui::Text("Line %04d", n); + ImGui::PopStyleColor(); + ImGui::EndChild(); + } + + // Child 4: auto-resizing height with a limit + ImGui::SeparatorText("Auto-resize with constraints"); + { + static int draw_lines = 3; + static int max_height_in_lines = 10; + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); + ImGui::DragInt("Lines Count", &draw_lines, 0.2f); + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); + ImGui::DragInt("Max Height (in Lines)", &max_height_in_lines, 0.2f); + + ImGui::SetNextWindowSizeConstraints(ImVec2(0.0f, ImGui::GetTextLineHeightWithSpacing() * 1), ImVec2(FLT_MAX, ImGui::GetTextLineHeightWithSpacing() * max_height_in_lines)); + if (ImGui::BeginChild("ConstrainedChild", ImVec2(-FLT_MIN, 0.0f), ImGuiChildFlags_Borders | ImGuiChildFlags_AutoResizeY)) + for (int n = 0; n < draw_lines; n++) + ImGui::Text("Line %04d", n); + ImGui::EndChild(); + } + ImGui::SeparatorText("Misc/Advanced"); // Demonstrate a few extra things @@ -2717,19 +4006,33 @@ static void ShowDemoWindowLayout() // the POV of the parent window). See 'Demo->Querying Status (Edited/Active/Hovered etc.)' for details. { static int offset_x = 0; + static bool override_bg_color = true; + static ImGuiChildFlags child_flags = ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY; ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); ImGui::DragInt("Offset X", &offset_x, 1.0f, -1000, 1000); + ImGui::Checkbox("Override ChildBg color", &override_bg_color); + ImGui::CheckboxFlags("ImGuiChildFlags_Borders", &child_flags, ImGuiChildFlags_Borders); + ImGui::CheckboxFlags("ImGuiChildFlags_AlwaysUseWindowPadding", &child_flags, ImGuiChildFlags_AlwaysUseWindowPadding); + ImGui::CheckboxFlags("ImGuiChildFlags_ResizeX", &child_flags, ImGuiChildFlags_ResizeX); + ImGui::CheckboxFlags("ImGuiChildFlags_ResizeY", &child_flags, ImGuiChildFlags_ResizeY); + ImGui::CheckboxFlags("ImGuiChildFlags_FrameStyle", &child_flags, ImGuiChildFlags_FrameStyle); + ImGui::SameLine(); HelpMarker("Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding."); + if (child_flags & ImGuiChildFlags_FrameStyle) + override_bg_color = false; ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (float)offset_x); - ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(255, 0, 0, 100)); - ImGui::BeginChild("Red", ImVec2(200, 100), true, ImGuiWindowFlags_None); + if (override_bg_color) + ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(255, 0, 0, 100)); + ImGui::BeginChild("Red", ImVec2(200, 100), child_flags, ImGuiWindowFlags_None); + if (override_bg_color) + ImGui::PopStyleColor(); + for (int n = 0; n < 50; n++) ImGui::Text("Some test %d", n); ImGui::EndChild(); bool child_is_hovered = ImGui::IsItemHovered(); ImVec2 child_rect_min = ImGui::GetItemRectMin(); ImVec2 child_rect_max = ImGui::GetItemRectMax(); - ImGui::PopStyleColor(); ImGui::Text("Hovered: %d", child_is_hovered); ImGui::Text("Rect of child window is: (%.0f,%.0f) (%.0f,%.0f)", child_rect_min.x, child_rect_min.y, child_rect_max.x, child_rect_max.y); } @@ -2894,7 +4197,7 @@ static void ShowDemoWindowLayout() ImGui::Text("Manual wrapping:"); ImGuiStyle& style = ImGui::GetStyle(); int buttons_count = 20; - float window_visible_x2 = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMax().x; + float window_visible_x2 = ImGui::GetCursorScreenPos().x + ImGui::GetContentRegionAvail().x; for (int n = 0; n < buttons_count; n++) { ImGui::PushID(n); @@ -2975,7 +4278,7 @@ static void ShowDemoWindowLayout() // down by FramePadding.y ahead of time) ImGui::AlignTextToFramePadding(); ImGui::Text("OK Blahblah"); ImGui::SameLine(); - ImGui::Button("Some framed item"); ImGui::SameLine(); + ImGui::Button("Some framed item##2"); ImGui::SameLine(); HelpMarker("We call AlignTextToFramePadding() to vertically align the text baseline by +FramePadding.y"); // SmallButton() uses the same vertical padding as Text @@ -3118,7 +4421,7 @@ static void ShowDemoWindowLayout() const ImGuiWindowFlags child_flags = enable_extra_decorations ? ImGuiWindowFlags_MenuBar : 0; const ImGuiID child_id = ImGui::GetID((void*)(intptr_t)i); - const bool child_is_visible = ImGui::BeginChild(child_id, ImVec2(child_w, 200.0f), true, child_flags); + const bool child_is_visible = ImGui::BeginChild(child_id, ImVec2(child_w, 200.0f), ImGuiChildFlags_Borders, child_flags); if (ImGui::BeginMenuBar()) { ImGui::TextUnformatted("abc"); @@ -3165,7 +4468,7 @@ static void ShowDemoWindowLayout() float child_height = ImGui::GetTextLineHeight() + style.ScrollbarSize + style.WindowPadding.y * 2.0f; ImGuiWindowFlags child_flags = ImGuiWindowFlags_HorizontalScrollbar | (enable_extra_decorations ? ImGuiWindowFlags_AlwaysVerticalScrollbar : 0); ImGuiID child_id = ImGui::GetID((void*)(intptr_t)i); - bool child_is_visible = ImGui::BeginChild(child_id, ImVec2(-100, child_height), true, child_flags); + bool child_is_visible = ImGui::BeginChild(child_id, ImVec2(-100, child_height), ImGuiChildFlags_Borders, child_flags); if (scroll_to_off) ImGui::SetScrollX(scroll_to_off_px); if (scroll_to_pos) @@ -3207,7 +4510,7 @@ static void ShowDemoWindowLayout() ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f)); ImVec2 scrolling_child_size = ImVec2(0, ImGui::GetFrameHeightWithSpacing() * 7 + 30); - ImGui::BeginChild("scrolling", scrolling_child_size, true, ImGuiWindowFlags_HorizontalScrollbar); + ImGui::BeginChild("scrolling", scrolling_child_size, ImGuiChildFlags_Borders, ImGuiWindowFlags_HorizontalScrollbar); for (int line = 0; line < lines; line++) { // Display random stuff. For the sake of this trivial demo we are using basic Button() + SameLine() @@ -3276,7 +4579,9 @@ static void ShowDemoWindowLayout() IMGUI_DEMO_MARKER("Layout/Scrolling/Horizontal contents size demo window"); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2, 0)); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 0)); - HelpMarker("Test of different widgets react and impact the work rectangle growing when horizontal scrolling is enabled.\n\nUse 'Metrics->Tools->Show windows rectangles' to visualize rectangles."); + HelpMarker( + "Test how different widgets react and impact the work rectangle growing when horizontal scrolling is enabled.\n\n" + "Use 'Metrics->Tools->Show windows rectangles' to visualize rectangles."); ImGui::Checkbox("H-scrollbar", &show_h_scrollbar); ImGui::Checkbox("Button", &show_button); // Will grow contents size (unless explicitly overwritten) ImGui::Checkbox("Tree nodes", &show_tree_nodes); // Will grow contents size and display highlight over full width @@ -3351,7 +4656,7 @@ static void ShowDemoWindowLayout() } if (show_child) { - ImGui::BeginChild("child", ImVec2(0, 0), true); + ImGui::BeginChild("child", ImVec2(0, 0), ImGuiChildFlags_Borders); ImGui::EndChild(); } ImGui::End(); @@ -3360,8 +4665,8 @@ static void ShowDemoWindowLayout() ImGui::TreePop(); } - IMGUI_DEMO_MARKER("Layout/Clipping"); - if (ImGui::TreeNode("Clipping")) + IMGUI_DEMO_MARKER("Layout/Text Clipping"); + if (ImGui::TreeNode("Text Clipping")) { static ImVec2 size(100.0f, 100.0f); static ImVec2 offset(30.0f, 30.0f); @@ -3432,7 +4737,8 @@ static void ShowDemoWindowLayout() HelpMarker( "Hit-testing is by default performed in item submission order, which generally is perceived as 'back-to-front'.\n\n" - "By using SetNextItemAllowOverlap() you can notify that an item may be overlapped by another. Doing so alters the hovering logic: items using AllowOverlap mode requires an extra frame to accept hovered state."); + "By using SetNextItemAllowOverlap() you can notify that an item may be overlapped by another. " + "Doing so alters the hovering logic: items using AllowOverlap mode requires an extra frame to accept hovered state."); ImGui::Checkbox("Enable AllowOverlap", &enable_allow_overlap); ImVec2 button1_pos = ImGui::GetCursorScreenPos(); @@ -3456,6 +4762,10 @@ static void ShowDemoWindowLayout() } } +//----------------------------------------------------------------------------- +// [SECTION] ShowDemoWindowPopups() +//----------------------------------------------------------------------------- + static void ShowDemoWindowPopups() { IMGUI_DEMO_MARKER("Popups"); @@ -3711,7 +5021,7 @@ static void ShowDemoWindowPopups() static int item = 1; static float color[4] = { 0.4f, 0.7f, 0.0f, 0.5f }; ImGui::Combo("Combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0"); - ImGui::ColorEdit4("color", color); + ImGui::ColorEdit4("Color", color); if (ImGui::Button("Add another modal..")) ImGui::OpenPopup("Stacked 2"); @@ -3723,6 +5033,7 @@ static void ShowDemoWindowPopups() if (ImGui::BeginPopupModal("Stacked 2", &unused_open)) { ImGui::Text("Hello from Stacked The Second!"); + ImGui::ColorEdit4("Color", color); // Allow opening another nested popup if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); ImGui::EndPopup(); @@ -3819,7 +5130,8 @@ struct MyItem } // qsort() is instable so always return a way to differenciate items. - // Your own compare function may want to avoid fallback on implicit sort specs e.g. a Name compare if it wasn't already part of the sort specs. + // Your own compare function may want to avoid fallback on implicit sort specs. + // e.g. a Name compare if it wasn't already part of the sort specs. return (a->ID - b->ID); } }; @@ -3830,8 +5142,8 @@ const ImGuiTableSortSpecs* MyItem::s_current_sort_specs = NULL; static void PushStyleCompact() { ImGuiStyle& style = ImGui::GetStyle(); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(style.FramePadding.x, (float)(int)(style.FramePadding.y * 0.60f))); - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x, (float)(int)(style.ItemSpacing.y * 0.60f))); + ImGui::PushStyleVarY(ImGuiStyleVar_FramePadding, (float)(int)(style.FramePadding.y * 0.60f)); + ImGui::PushStyleVarY(ImGuiStyleVar_ItemSpacing, (float)(int)(style.ItemSpacing.y * 0.60f)); } static void PopStyleCompact() @@ -3903,6 +5215,7 @@ static void EditTableColumnsFlags(ImGuiTableColumnFlags* p_flags) ImGui::CheckboxFlags("_PreferSortDescending", p_flags, ImGuiTableColumnFlags_PreferSortDescending); ImGui::CheckboxFlags("_IndentEnable", p_flags, ImGuiTableColumnFlags_IndentEnable); ImGui::SameLine(); HelpMarker("Default for column 0"); ImGui::CheckboxFlags("_IndentDisable", p_flags, ImGuiTableColumnFlags_IndentDisable); ImGui::SameLine(); HelpMarker("Default for column >0"); + ImGui::CheckboxFlags("_AngledHeader", p_flags, ImGuiTableColumnFlags_AngledHeader); } static void ShowTableColumnsStatusFlags(ImGuiTableColumnFlags flags) @@ -3913,6 +5226,10 @@ static void ShowTableColumnsStatusFlags(ImGuiTableColumnFlags flags) ImGui::CheckboxFlags("_IsHovered", &flags, ImGuiTableColumnFlags_IsHovered); } +//----------------------------------------------------------------------------- +// [SECTION] ShowDemoWindowTables() +//----------------------------------------------------------------------------- + static void ShowDemoWindowTables() { //ImGui::SetNextItemOpen(true, ImGuiCond_Once); @@ -3927,10 +5244,10 @@ static void ShowDemoWindowTables() ImGui::PushID("Tables"); int open_action = -1; - if (ImGui::Button("Open all")) + if (ImGui::Button("Expand all")) open_action = 1; ImGui::SameLine(); - if (ImGui::Button("Close all")) + if (ImGui::Button("Collapse all")) open_action = 0; ImGui::SameLine(); @@ -4001,8 +5318,9 @@ static void ShowDemoWindowTables() // as TableNextColumn() will automatically wrap around and create new rows as needed. // This is generally more convenient when your cells all contains the same type of data. HelpMarker( - "Only using TableNextColumn(), which tends to be convenient for tables where every cell contains the same type of contents.\n" - "This is also more similar to the old NextColumn() function of the Columns API, and provided to facilitate the Columns->Tables API transition."); + "Only using TableNextColumn(), which tends to be convenient for tables where every cell contains " + "the same type of contents.\n This is also more similar to the old NextColumn() function of the " + "Columns API, and provided to facilitate the Columns->Tables API transition."); if (ImGui::BeginTable("table3", 3)) { for (int item = 0; item < 14; item++) @@ -4030,7 +5348,7 @@ static void ShowDemoWindowTables() PushStyleCompact(); ImGui::CheckboxFlags("ImGuiTableFlags_RowBg", &flags, ImGuiTableFlags_RowBg); ImGui::CheckboxFlags("ImGuiTableFlags_Borders", &flags, ImGuiTableFlags_Borders); - ImGui::SameLine(); HelpMarker("ImGuiTableFlags_Borders\n = ImGuiTableFlags_BordersInnerV\n | ImGuiTableFlags_BordersOuterV\n | ImGuiTableFlags_BordersInnerV\n | ImGuiTableFlags_BordersOuterH"); + ImGui::SameLine(); HelpMarker("ImGuiTableFlags_Borders\n = ImGuiTableFlags_BordersInnerV\n | ImGuiTableFlags_BordersOuterV\n | ImGuiTableFlags_BordersInnerH\n | ImGuiTableFlags_BordersOuterH"); ImGui::Indent(); ImGui::CheckboxFlags("ImGuiTableFlags_BordersH", &flags, ImGuiTableFlags_BordersH); @@ -4058,8 +5376,8 @@ static void ShowDemoWindowTables() if (ImGui::BeginTable("table1", 3, flags)) { - // Display headers so we can inspect their interaction with borders. - // (Headers are not the main purpose of this section of the demo, so we are not elaborating on them too much. See other sections for details) + // Display headers so we can inspect their interaction with borders + // (Headers are not the main purpose of this section of the demo, so we are not elaborating on them now. See other sections for details) if (display_headers) { ImGui::TableSetupColumn("One"); @@ -4098,7 +5416,9 @@ static void ShowDemoWindowTables() PushStyleCompact(); ImGui::CheckboxFlags("ImGuiTableFlags_Resizable", &flags, ImGuiTableFlags_Resizable); ImGui::CheckboxFlags("ImGuiTableFlags_BordersV", &flags, ImGuiTableFlags_BordersV); - ImGui::SameLine(); HelpMarker("Using the _Resizable flag automatically enables the _BordersInnerV flag as well, this is why the resize borders are still showing when unchecking this."); + ImGui::SameLine(); HelpMarker( + "Using the _Resizable flag automatically enables the _BordersInnerV flag as well, " + "this is why the resize borders are still showing when unchecking this."); PopStyleCompact(); if (ImGui::BeginTable("table1", 3, flags)) @@ -4216,6 +5536,7 @@ static void ShowDemoWindowTables() ImGui::CheckboxFlags("ImGuiTableFlags_Hideable", &flags, ImGuiTableFlags_Hideable); ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody", &flags, ImGuiTableFlags_NoBordersInBody); ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize", &flags, ImGuiTableFlags_NoBordersInBodyUntilResize); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers)"); + ImGui::CheckboxFlags("ImGuiTableFlags_HighlightHoveredColumn", &flags, ImGuiTableFlags_HighlightHoveredColumn); PopStyleCompact(); if (ImGui::BeginTable("table1", 3, flags)) @@ -4238,7 +5559,8 @@ static void ShowDemoWindowTables() ImGui::EndTable(); } - // Use outer_size.x == 0.0f instead of default to make the table as tight as possible (only valid when no scrolling and no stretch column) + // Use outer_size.x == 0.0f instead of default to make the table as tight as possible + // (only valid when no scrolling and no stretch column) if (ImGui::BeginTable("table2", 3, flags | ImGuiTableFlags_SizingFixedFit, ImVec2(0.0f, 0.0f))) { ImGui::TableSetupColumn("One"); @@ -4271,7 +5593,8 @@ static void ShowDemoWindowTables() "e.g.:\n" "- BorderOuterV\n" "- any form of row selection\n" - "Because of this, activating BorderOuterV sets the default to PadOuterX. Using PadOuterX or NoPadOuterX you can override the default.\n\n" + "Because of this, activating BorderOuterV sets the default to PadOuterX. " + "Using PadOuterX or NoPadOuterX you can override the default.\n\n" "Actual padding values are using style.CellPadding.\n\n" "In this demo we don't show horizontal borders to emphasize how they don't affect default horizontal padding."); @@ -4387,7 +5710,8 @@ static void ShowDemoWindowTables() EditTableSizingFlags(&sizing_policy_flags[table_n]); // To make it easier to understand the different sizing policy, - // For each policy: we display one table where the columns have equal contents width, and one where the columns have different contents width. + // For each policy: we display one table where the columns have equal contents width, + // and one where the columns have different contents width. if (ImGui::BeginTable("table1", 3, sizing_policy_flags[table_n] | flags1)) { for (int row = 0; row < 3; row++) @@ -4416,7 +5740,9 @@ static void ShowDemoWindowTables() ImGui::Spacing(); ImGui::TextUnformatted("Advanced"); ImGui::SameLine(); - HelpMarker("This section allows you to interact and see the effect of various sizing policies depending on whether Scroll is enabled and the contents of your columns."); + HelpMarker( + "This section allows you to interact and see the effect of various sizing policies " + "depending on whether Scroll is enabled and the contents of your columns."); enum ContentsType { CT_ShowWidth, CT_ShortText, CT_LongText, CT_Button, CT_FillButton, CT_InputText }; static ImGuiTableFlags flags = ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_Resizable; @@ -4431,7 +5757,9 @@ static void ShowDemoWindowTables() if (contents_type == CT_FillButton) { ImGui::SameLine(); - HelpMarker("Be mindful that using right-alignment (e.g. size.x = -FLT_MIN) creates a feedback loop where contents width can feed into auto-column width can feed into contents width."); + HelpMarker( + "Be mindful that using right-alignment (e.g. size.x = -FLT_MIN) creates a feedback loop " + "where contents width can feed into auto-column width can feed into contents width."); } ImGui::DragInt("Columns", &column_count, 0.1f, 1, 64, "%d", ImGuiSliderFlags_AlwaysClamp); ImGui::CheckboxFlags("ImGuiTableFlags_Resizable", &flags, ImGuiTableFlags_Resizable); @@ -4477,7 +5805,9 @@ static void ShowDemoWindowTables() IMGUI_DEMO_MARKER("Tables/Vertical scrolling, with clipping"); if (ImGui::TreeNode("Vertical scrolling, with clipping")) { - HelpMarker("Here we activate ScrollY, which will create a child window container to allow hosting scrollable contents.\n\nWe also demonstrate using ImGuiListClipper to virtualize the submission of many items."); + HelpMarker( + "Here we activate ScrollY, which will create a child window container to allow hosting scrollable contents.\n\n" + "We also demonstrate using ImGuiListClipper to virtualize the submission of many items."); static ImGuiTableFlags flags = ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable; PushStyleCompact(); @@ -4523,8 +5853,9 @@ static void ShowDemoWindowTables() HelpMarker( "When ScrollX is enabled, the default sizing policy becomes ImGuiTableFlags_SizingFixedFit, " "as automatically stretching columns doesn't make much sense with horizontal scrolling.\n\n" - "Also note that as of the current version, you will almost always want to enable ScrollY along with ScrollX," - "because the container window won't automatically extend vertically to fix contents (this may be improved in future versions)."); + "Also note that as of the current version, you will almost always want to enable ScrollY along with ScrollX, " + "because the container window won't automatically extend vertically to fix contents " + "(this may be improved in future versions)."); static ImGuiTableFlags flags = ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable; static int freeze_cols = 1; static int freeze_rows = 1; @@ -4581,7 +5912,8 @@ static void ShowDemoWindowTables() HelpMarker( "Showcase using Stretch columns + ScrollX together: " "this is rather unusual and only makes sense when specifying an 'inner_width' for the table!\n" - "Without an explicit value, inner_width is == outer_size.x and therefore using Stretch columns + ScrollX together doesn't make sense."); + "Without an explicit value, inner_width is == outer_size.x and therefore using Stretch columns " + "along with ScrollX doesn't make sense."); static ImGuiTableFlags flags2 = ImGuiTableFlags_SizingStretchSame | ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_RowBg | ImGuiTableFlags_ContextMenuInBody; static float inner_width = 1000.0f; PushStyleCompact(); @@ -4639,8 +5971,9 @@ static void ShowDemoWindowTables() } // Create the real table we care about for the example! - // We use a scrolling table to be able to showcase the difference between the _IsEnabled and _IsVisible flags above, otherwise in - // a non-scrolling table columns are always visible (unless using ImGuiTableFlags_NoKeepColumnsVisible + resizing the parent window down) + // We use a scrolling table to be able to showcase the difference between the _IsEnabled and _IsVisible flags above, + // otherwise in a non-scrolling table columns are always visible (unless using ImGuiTableFlags_NoKeepColumnsVisible + // + resizing the parent window down). const ImGuiTableFlags flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV @@ -4648,15 +5981,22 @@ static void ShowDemoWindowTables() ImVec2 outer_size = ImVec2(0.0f, TEXT_BASE_HEIGHT * 9); if (ImGui::BeginTable("table_columns_flags", column_count, flags, outer_size)) { + bool has_angled_header = false; for (int column = 0; column < column_count; column++) + { + has_angled_header |= (column_flags[column] & ImGuiTableColumnFlags_AngledHeader) != 0; ImGui::TableSetupColumn(column_names[column], column_flags[column]); + } + if (has_angled_header) + ImGui::TableAngledHeadersRow(); ImGui::TableHeadersRow(); for (int column = 0; column < column_count; column++) column_flags_out[column] = ImGui::TableGetColumnFlags(column); float indent_step = (float)((int)TEXT_BASE_WIDTH / 2); for (int row = 0; row < 8; row++) { - ImGui::Indent(indent_step); // Add some indentation to demonstrate usage of per-column IndentEnable/IndentDisable flags. + // Add some indentation to demonstrate usage of per-column IndentEnable/IndentDisable flags. + ImGui::Indent(indent_step); ImGui::TableNextRow(); for (int column = 0; column < column_count; column++) { @@ -4705,7 +6045,9 @@ static void ShowDemoWindowTables() ImGui::EndTable(); } - HelpMarker("Using TableSetupColumn() to setup explicit width.\n\nUnless _NoKeepColumnsVisible is set, fixed columns with set width may still be shrunk down if there's not enough space in the host."); + HelpMarker( + "Using TableSetupColumn() to setup explicit width.\n\nUnless _NoKeepColumnsVisible is set, " + "fixed columns with set width may still be shrunk down if there's not enough space in the host."); static ImGuiTableFlags flags2 = ImGuiTableFlags_None; PushStyleCompact(); @@ -4715,7 +6057,8 @@ static void ShowDemoWindowTables() PopStyleCompact(); if (ImGui::BeginTable("table2", 4, flags2)) { - // We could also set ImGuiTableFlags_SizingFixedFit on the table and all columns will default to ImGuiTableColumnFlags_WidthFixed. + // We could also set ImGuiTableFlags_SizingFixedFit on the table and then all columns + // will default to ImGuiTableColumnFlags_WidthFixed. ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 100.0f); ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, TEXT_BASE_WIDTH * 15.0f); ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, TEXT_BASE_WIDTH * 30.0f); @@ -4787,7 +6130,10 @@ static void ShowDemoWindowTables() IMGUI_DEMO_MARKER("Tables/Row height"); if (ImGui::TreeNode("Row height")) { - HelpMarker("You can pass a 'min_row_height' to TableNextRow().\n\nRows are padded with 'style.CellPadding.y' on top and bottom, so effectively the minimum row height will always be >= 'style.CellPadding.y * 2.0f'.\n\nWe cannot honor a _maximum_ row height as that would require a unique clipping rectangle per row."); + HelpMarker( + "You can pass a 'min_row_height' to TableNextRow().\n\nRows are padded with 'style.CellPadding.y' on top and bottom, " + "so effectively the minimum row height will always be >= 'style.CellPadding.y * 2.0f'.\n\n" + "We cannot honor a _maximum_ row height as that would require a unique clipping rectangle per row."); if (ImGui::BeginTable("table_row_height", 1, ImGuiTableFlags_Borders)) { for (int row = 0; row < 8; row++) @@ -4800,7 +6146,10 @@ static void ShowDemoWindowTables() ImGui::EndTable(); } - HelpMarker("Showcase using SameLine(0,0) to share Current Line Height between cells.\n\nPlease note that Tables Row Height is not the same thing as Current Line Height, as a table cell may contains multiple lines."); + HelpMarker( + "Showcase using SameLine(0,0) to share Current Line Height between cells.\n\n" + "Please note that Tables Row Height is not the same thing as Current Line Height, " + "as a table cell may contains multiple lines."); if (ImGui::BeginTable("table_share_lineheight", 2, ImGuiTableFlags_Borders)) { ImGui::TableNextRow(); @@ -4828,7 +6177,7 @@ static void ShowDemoWindowTables() for (int row = 0; row < 8; row++) { if ((row % 3) == 2) - ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(style.CellPadding.x, 20.0f)); + ImGui::PushStyleVarY(ImGuiStyleVar_CellPadding, 20.0f); ImGui::TableNextRow(ImGuiTableRowFlags_None); ImGui::TableNextColumn(); ImGui::Text("CellPadding.y = %.2f", style.CellPadding.y); @@ -4973,6 +6322,12 @@ static void ShowDemoWindowTables() { static ImGuiTableFlags flags = ImGuiTableFlags_BordersV | ImGuiTableFlags_BordersOuterH | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody; + static ImGuiTreeNodeFlags tree_node_flags = ImGuiTreeNodeFlags_SpanAllColumns; + ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanFullWidth", &tree_node_flags, ImGuiTreeNodeFlags_SpanFullWidth); + ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanTextWidth", &tree_node_flags, ImGuiTreeNodeFlags_SpanTextWidth); + ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAllColumns", &tree_node_flags, ImGuiTreeNodeFlags_SpanAllColumns); + + HelpMarker("See \"Columns flags\" section to configure how indentation is applied to individual columns."); if (ImGui::BeginTable("3ways", 3, flags)) { // The first column will use the default _WidthStretch when ScrollX is Off and _WidthFixed when ScrollX is On @@ -4996,7 +6351,7 @@ static void ShowDemoWindowTables() const bool is_folder = (node->ChildCount > 0); if (is_folder) { - bool open = ImGui::TreeNodeEx(node->Name, ImGuiTreeNodeFlags_SpanFullWidth); + bool open = ImGui::TreeNodeEx(node->Name, tree_node_flags); ImGui::TableNextColumn(); ImGui::TextDisabled("--"); ImGui::TableNextColumn(); @@ -5010,7 +6365,7 @@ static void ShowDemoWindowTables() } else { - ImGui::TreeNodeEx(node->Name, ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_Bullet | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_SpanFullWidth); + ImGui::TreeNodeEx(node->Name, tree_node_flags | ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_Bullet | ImGuiTreeNodeFlags_NoTreePushOnOpen); ImGui::TableNextColumn(); ImGui::Text("%d", node->Size); ImGui::TableNextColumn(); @@ -5045,7 +6400,8 @@ static void ShowDemoWindowTables() { HelpMarker( "Showcase using PushItemWidth() and how it is preserved on a per-column basis.\n\n" - "Note that on auto-resizing non-resizable fixed columns, querying the content width for e.g. right-alignment doesn't make sense."); + "Note that on auto-resizing non-resizable fixed columns, querying the content width for " + "e.g. right-alignment doesn't make sense."); if (ImGui::BeginTable("table_item_width", 3, ImGuiTableFlags_Borders)) { ImGui::TableSetupColumn("small"); @@ -5100,7 +6456,11 @@ static void ShowDemoWindowTables() // FIXME: It would be nice to actually demonstrate full-featured selection using those checkbox. static bool column_selected[3] = {}; - // Instead of calling TableHeadersRow() we'll submit custom headers ourselves + // Instead of calling TableHeadersRow() we'll submit custom headers ourselves. + // (A different approach is also possible: + // - Specify ImGuiTableColumnFlags_NoHeaderLabel in some TableSetupColumn() call. + // - Call TableHeadersRow() normally. This will submit TableHeader() with no name. + // - Then call TableSetColumnIndex() to position yourself in the column and submit your stuff e.g. Checkbox().) ImGui::TableNextRow(ImGuiTableRowFlags_Headers); for (int column = 0; column < COLUMNS_COUNT; column++) { @@ -5115,6 +6475,7 @@ static void ShowDemoWindowTables() ImGui::PopID(); } + // Submit table contents for (int row = 0; row < 5; row++) { ImGui::TableNextRow(); @@ -5131,13 +6492,84 @@ static void ShowDemoWindowTables() ImGui::TreePop(); } - // Demonstrate creating custom context menus inside columns, while playing it nice with context menus provided by TableHeadersRow()/TableHeader() + // Demonstrate using ImGuiTableColumnFlags_AngledHeader flag to create angled headers + if (open_action != -1) + ImGui::SetNextItemOpen(open_action != 0); + IMGUI_DEMO_MARKER("Tables/Angled headers"); + if (ImGui::TreeNode("Angled headers")) + { + const char* column_names[] = { "Track", "cabasa", "ride", "smash", "tom-hi", "tom-mid", "tom-low", "hihat-o", "hihat-c", "snare-s", "snare-c", "clap", "rim", "kick" }; + const int columns_count = IM_ARRAYSIZE(column_names); + const int rows_count = 12; + + static ImGuiTableFlags table_flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_Hideable | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_HighlightHoveredColumn; + static ImGuiTableColumnFlags column_flags = ImGuiTableColumnFlags_AngledHeader | ImGuiTableColumnFlags_WidthFixed; + static bool bools[columns_count * rows_count] = {}; // Dummy storage selection storage + static int frozen_cols = 1; + static int frozen_rows = 2; + ImGui::CheckboxFlags("_ScrollX", &table_flags, ImGuiTableFlags_ScrollX); + ImGui::CheckboxFlags("_ScrollY", &table_flags, ImGuiTableFlags_ScrollY); + ImGui::CheckboxFlags("_Resizable", &table_flags, ImGuiTableFlags_Resizable); + ImGui::CheckboxFlags("_Sortable", &table_flags, ImGuiTableFlags_Sortable); + ImGui::CheckboxFlags("_NoBordersInBody", &table_flags, ImGuiTableFlags_NoBordersInBody); + ImGui::CheckboxFlags("_HighlightHoveredColumn", &table_flags, ImGuiTableFlags_HighlightHoveredColumn); + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); + ImGui::SliderInt("Frozen columns", &frozen_cols, 0, 2); + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); + ImGui::SliderInt("Frozen rows", &frozen_rows, 0, 2); + ImGui::CheckboxFlags("Disable header contributing to column width", &column_flags, ImGuiTableColumnFlags_NoHeaderWidth); + + if (ImGui::TreeNode("Style settings")) + { + ImGui::SameLine(); + HelpMarker("Giving access to some ImGuiStyle value in this demo for convenience."); + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); + ImGui::SliderAngle("style.TableAngledHeadersAngle", &ImGui::GetStyle().TableAngledHeadersAngle, -50.0f, +50.0f); + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); + ImGui::SliderFloat2("style.TableAngledHeadersTextAlign", (float*)&ImGui::GetStyle().TableAngledHeadersTextAlign, 0.0f, 1.0f, "%.2f"); + ImGui::TreePop(); + } + + if (ImGui::BeginTable("table_angled_headers", columns_count, table_flags, ImVec2(0.0f, TEXT_BASE_HEIGHT * 12))) + { + ImGui::TableSetupColumn(column_names[0], ImGuiTableColumnFlags_NoHide | ImGuiTableColumnFlags_NoReorder); + for (int n = 1; n < columns_count; n++) + ImGui::TableSetupColumn(column_names[n], column_flags); + ImGui::TableSetupScrollFreeze(frozen_cols, frozen_rows); + + ImGui::TableAngledHeadersRow(); // Draw angled headers for all columns with the ImGuiTableColumnFlags_AngledHeader flag. + ImGui::TableHeadersRow(); // Draw remaining headers and allow access to context-menu and other functions. + for (int row = 0; row < rows_count; row++) + { + ImGui::PushID(row); + ImGui::TableNextRow(); + ImGui::TableSetColumnIndex(0); + ImGui::AlignTextToFramePadding(); + ImGui::Text("Track %d", row); + for (int column = 1; column < columns_count; column++) + if (ImGui::TableSetColumnIndex(column)) + { + ImGui::PushID(column); + ImGui::Checkbox("", &bools[row * columns_count + column]); + ImGui::PopID(); + } + ImGui::PopID(); + } + ImGui::EndTable(); + } + ImGui::TreePop(); + } + + // Demonstrate creating custom context menus inside columns, + // while playing it nice with context menus provided by TableHeadersRow()/TableHeader() if (open_action != -1) ImGui::SetNextItemOpen(open_action != 0); IMGUI_DEMO_MARKER("Tables/Context menus"); if (ImGui::TreeNode("Context menus")) { - HelpMarker("By default, right-clicking over a TableHeadersRow()/TableHeader() line will open the default context-menu.\nUsing ImGuiTableFlags_ContextMenuInBody we also allow right-clicking over columns body."); + HelpMarker( + "By default, right-clicking over a TableHeadersRow()/TableHeader() line will open the default context-menu.\n" + "Using ImGuiTableFlags_ContextMenuInBody we also allow right-clicking over columns body."); static ImGuiTableFlags flags1 = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_ContextMenuInBody; PushStyleCompact(); @@ -5174,7 +6606,9 @@ static void ShowDemoWindowTables() // [2.1] Right-click on the TableHeadersRow() line to open the default table context menu. // [2.2] Right-click on the ".." to open a custom popup // [2.3] Right-click in columns to open another custom popup - HelpMarker("Demonstrate mixing table context menu (over header), item context button (over button) and custom per-colum context menu (over column body)."); + HelpMarker( + "Demonstrate mixing table context menu (over header), item context button (over button) " + "and custom per-colunm context menu (over column body)."); ImGuiTableFlags flags2 = ImGuiTableFlags_Resizable | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders; if (ImGui::BeginTable("table_context_menu_2", COLUMNS_COUNT, flags2)) { @@ -5247,8 +6681,10 @@ static void ShowDemoWindowTables() HelpMarker("Multiple tables with the same identifier will share their settings, width, visibility, order etc."); static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoSavedSettings; + ImGui::CheckboxFlags("ImGuiTableFlags_Resizable", &flags, ImGuiTableFlags_Resizable); ImGui::CheckboxFlags("ImGuiTableFlags_ScrollY", &flags, ImGuiTableFlags_ScrollY); ImGui::CheckboxFlags("ImGuiTableFlags_SizingFixedFit", &flags, ImGuiTableFlags_SizingFixedFit); + ImGui::CheckboxFlags("ImGuiTableFlags_HighlightHoveredColumn", &flags, ImGuiTableFlags_HighlightHoveredColumn); for (int n = 0; n < 3; n++) { char buf[32]; @@ -5376,6 +6812,7 @@ static void ShowDemoWindowTables() | ImGuiTableFlags_RowBg | ImGuiTableFlags_Borders | ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_SizingFixedFit; + static ImGuiTableColumnFlags columns_base_flags = ImGuiTableColumnFlags_None; enum ContentsType { CT_Text, CT_Button, CT_SmallButton, CT_FillButton, CT_Selectable, CT_SelectableSpanRow }; static int contents_type = CT_SelectableSpanRow; @@ -5469,9 +6906,17 @@ static void ShowDemoWindowTables() ImGui::TreePop(); } - if (ImGui::TreeNodeEx("Other:", ImGuiTreeNodeFlags_DefaultOpen)) + if (ImGui::TreeNodeEx("Headers:", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::Checkbox("show_headers", &show_headers); + ImGui::CheckboxFlags("ImGuiTableFlags_HighlightHoveredColumn", &flags, ImGuiTableFlags_HighlightHoveredColumn); + ImGui::CheckboxFlags("ImGuiTableColumnFlags_AngledHeader", &columns_base_flags, ImGuiTableColumnFlags_AngledHeader); + ImGui::SameLine(); HelpMarker("Enable AngledHeader on all columns. Best enabled on selected narrow columns (see \"Angled headers\" section of the demo)."); + ImGui::TreePop(); + } + + if (ImGui::TreeNodeEx("Other:", ImGuiTreeNodeFlags_DefaultOpen)) + { ImGui::Checkbox("show_wrapped_text", &show_wrapped_text); ImGui::DragFloat2("##OuterSize", &outer_size_value.x); @@ -5532,12 +6977,12 @@ static void ShowDemoWindowTables() // Declare columns // We use the "user_id" parameter of TableSetupColumn() to specify a user id that will be stored in the sort specifications. // This is so our sort function can identify a column given our own identifier. We could also identify them based on their index! - ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_DefaultSort | ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHide, 0.0f, MyItemColumnID_ID); - ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_Name); - ImGui::TableSetupColumn("Action", ImGuiTableColumnFlags_NoSort | ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_Action); - ImGui::TableSetupColumn("Quantity", ImGuiTableColumnFlags_PreferSortDescending, 0.0f, MyItemColumnID_Quantity); - ImGui::TableSetupColumn("Description", (flags & ImGuiTableFlags_NoHostExtendX) ? 0 : ImGuiTableColumnFlags_WidthStretch, 0.0f, MyItemColumnID_Description); - ImGui::TableSetupColumn("Hidden", ImGuiTableColumnFlags_DefaultHide | ImGuiTableColumnFlags_NoSort); + ImGui::TableSetupColumn("ID", columns_base_flags | ImGuiTableColumnFlags_DefaultSort | ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHide, 0.0f, MyItemColumnID_ID); + ImGui::TableSetupColumn("Name", columns_base_flags | ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_Name); + ImGui::TableSetupColumn("Action", columns_base_flags | ImGuiTableColumnFlags_NoSort | ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_Action); + ImGui::TableSetupColumn("Quantity", columns_base_flags | ImGuiTableColumnFlags_PreferSortDescending, 0.0f, MyItemColumnID_Quantity); + ImGui::TableSetupColumn("Description", columns_base_flags | ((flags & ImGuiTableFlags_NoHostExtendX) ? 0 : ImGuiTableColumnFlags_WidthStretch), 0.0f, MyItemColumnID_Description); + ImGui::TableSetupColumn("Hidden", columns_base_flags | ImGuiTableColumnFlags_DefaultHide | ImGuiTableColumnFlags_NoSort); ImGui::TableSetupScrollFreeze(freeze_cols, freeze_rows); // Sort our data if sort specs have been changed! @@ -5556,12 +7001,13 @@ static void ShowDemoWindowTables() const bool sorts_specs_using_quantity = (ImGui::TableGetColumnFlags(3) & ImGuiTableColumnFlags_IsSorted) != 0; // Show headers + if (show_headers && (columns_base_flags & ImGuiTableColumnFlags_AngledHeader) != 0) + ImGui::TableAngledHeadersRow(); if (show_headers) ImGui::TableHeadersRow(); // Show data // FIXME-TABLE FIXME-NAV: How we can get decent up/down even though we have the buttons here? - ImGui::PushButtonRepeat(true); #if 1 // Demonstrate using clipper for large vertical lists ImGuiListClipper clipper; @@ -5621,7 +7067,7 @@ static void ShowDemoWindowTables() // Here we demonstrate marking our data set as needing to be sorted again if we modified a quantity, // and we are currently sorting on the column showing the Quantity. // To avoid triggering a sort while holding the button, we only trigger it when the button has been released. - // You will probably need a more advanced system in your code if you want to automatically sort when a specific entry changes. + // You will probably need some extra logic if you want to automatically sort when a specific entry changes. if (ImGui::TableSetColumnIndex(2)) { if (ImGui::SmallButton("Chop")) { item->Quantity += 1; } @@ -5646,7 +7092,6 @@ static void ShowDemoWindowTables() ImGui::PopID(); } } - ImGui::PopButtonRepeat(); // Store some info to display debug details below table_scroll_cur = ImVec2(ImGui::GetScrollX(), ImGui::GetScrollY()); @@ -5756,12 +7201,14 @@ static void ShowDemoWindowColumns() { if (h_borders && ImGui::GetColumnIndex() == 0) ImGui::Separator(); + ImGui::PushID(i); ImGui::Text("%c%c%c", 'a' + i, 'a' + i, 'a' + i); ImGui::Text("Width %.2f", ImGui::GetColumnWidth()); ImGui::Text("Avail %.2f", ImGui::GetContentRegionAvail().x); ImGui::Text("Offset %.2f", ImGui::GetColumnOffset()); ImGui::Text("Long text that is likely to clip"); ImGui::Button("Button", ImVec2(-FLT_MIN, 0.0f)); + ImGui::PopID(); ImGui::NextColumn(); } ImGui::Columns(1); @@ -5823,7 +7270,7 @@ static void ShowDemoWindowColumns() { ImGui::SetNextWindowContentSize(ImVec2(1500.0f, 0.0f)); ImVec2 child_size = ImVec2(0, ImGui::GetFontSize() * 20.0f); - ImGui::BeginChild("##ScrollingRegion", child_size, false, ImGuiWindowFlags_HorizontalScrollbar); + ImGui::BeginChild("##ScrollingRegion", child_size, ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar); ImGui::Columns(10); // Also demonstrate using clipper for large vertical lists @@ -5884,6 +7331,10 @@ static void ShowDemoWindowColumns() ImGui::TreePop(); } +//----------------------------------------------------------------------------- +// [SECTION] ShowDemoWindowInputs() +//----------------------------------------------------------------------------- + static void ShowDemoWindowInputs() { IMGUI_DEMO_MARKER("Inputs & Focus"); @@ -5894,12 +7345,14 @@ static void ShowDemoWindowInputs() // Display inputs submitted to ImGuiIO IMGUI_DEMO_MARKER("Inputs & Focus/Inputs"); ImGui::SetNextItemOpen(true, ImGuiCond_Once); - if (ImGui::TreeNode("Inputs")) + bool inputs_opened = ImGui::TreeNode("Inputs"); + ImGui::SameLine(); + HelpMarker( + "This is a simplified view. See more detailed input state:\n" + "- in 'Tools->Metrics/Debugger->Inputs'.\n" + "- in 'Tools->Debug Log->IO'."); + if (inputs_opened) { - HelpMarker( - "This is a simplified view. See more detailed input state:\n" - "- in 'Tools->Metrics/Debugger->Inputs'.\n" - "- in 'Tools->Debug Log->IO'."); if (ImGui::IsMousePosValid()) ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y); else @@ -5909,13 +7362,15 @@ static void ShowDemoWindowInputs() for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDown(i)) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); } ImGui::Text("Mouse wheel: %.1f", io.MouseWheel); - // We iterate both legacy native range and named ImGuiKey ranges, which is a little odd but this allows displaying the data for old/new backends. - // User code should never have to go through such hoops! You can generally iterate between ImGuiKey_NamedKey_BEGIN and ImGuiKey_NamedKey_END. + // We iterate both legacy native range and named ImGuiKey ranges. This is a little unusual/odd but this allows + // displaying the data for old/new backends. + // User code should never have to go through such hoops! + // You can generally iterate between ImGuiKey_NamedKey_BEGIN and ImGuiKey_NamedKey_END. #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } }; ImGuiKey start_key = ImGuiKey_NamedKey_BEGIN; #else - struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array + struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key >= 0 && key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array ImGuiKey start_key = (ImGuiKey)0; #endif ImGui::Text("Keys down:"); for (ImGuiKey key = start_key; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); } @@ -5928,15 +7383,17 @@ static void ShowDemoWindowInputs() // Display ImGuiIO output flags IMGUI_DEMO_MARKER("Inputs & Focus/Outputs"); ImGui::SetNextItemOpen(true, ImGuiCond_Once); - if (ImGui::TreeNode("Outputs")) + bool outputs_opened = ImGui::TreeNode("Outputs"); + ImGui::SameLine(); + HelpMarker( + "The value of io.WantCaptureMouse and io.WantCaptureKeyboard are normally set by Dear ImGui " + "to instruct your application of how to route inputs. Typically, when a value is true, it means " + "Dear ImGui wants the corresponding inputs and we expect the underlying application to ignore them.\n\n" + "The most typical case is: when hovering a window, Dear ImGui set io.WantCaptureMouse to true, " + "and underlying application should ignore mouse inputs (in practice there are many and more subtle " + "rules leading to how those flags are set)."); + if (outputs_opened) { - HelpMarker( - "The value of io.WantCaptureMouse and io.WantCaptureKeyboard are normally set by Dear ImGui " - "to instruct your application of how to route inputs. Typically, when a value is true, it means " - "Dear ImGui wants the corresponding inputs and we expect the underlying application to ignore them.\n\n" - "The most typical case is: when hovering a window, Dear ImGui set io.WantCaptureMouse to true, " - "and underlying application should ignore mouse inputs (in practice there are many and more subtle " - "rules leading to how those flags are set)."); ImGui::Text("io.WantCaptureMouse: %d", io.WantCaptureMouse); ImGui::Text("io.WantCaptureMouseUnlessPopupClose: %d", io.WantCaptureMouseUnlessPopupClose); ImGui::Text("io.WantCaptureKeyboard: %d", io.WantCaptureKeyboard); @@ -5949,7 +7406,8 @@ static void ShowDemoWindowInputs() { HelpMarker( "Hovering the colored canvas will override io.WantCaptureXXX fields.\n" - "Notice how normally (when set to none), the value of io.WantCaptureKeyboard would be false when hovering and true when clicking."); + "Notice how normally (when set to none), the value of io.WantCaptureKeyboard would be false when hovering " + "and true when clicking."); static int capture_override_mouse = -1; static int capture_override_keyboard = -1; const char* capture_override_desc[] = { "None", "Set to false", "Set to true" }; @@ -5969,6 +7427,102 @@ static void ShowDemoWindowInputs() ImGui::TreePop(); } + // Demonstrate using Shortcut() and Routing Policies. + // The general flow is: + // - Code interested in a chord (e.g. "Ctrl+A") declares their intent. + // - Multiple locations may be interested in same chord! Routing helps find a winner. + // - Every frame, we resolve all claims and assign one owner if the modifiers are matching. + // - The lower-level function is 'bool SetShortcutRouting()', returns true when caller got the route. + // - Most of the times, SetShortcutRouting() is not called directly. User mostly calls Shortcut() with routing flags. + // - If you call Shortcut() WITHOUT any routing option, it uses ImGuiInputFlags_RouteFocused. + // TL;DR: Most uses will simply be: + // - Shortcut(ImGuiMod_Ctrl | ImGuiKey_A); // Use ImGuiInputFlags_RouteFocused policy. + IMGUI_DEMO_MARKER("Inputs & Focus/Shortcuts"); + if (ImGui::TreeNode("Shortcuts")) + { + static ImGuiInputFlags route_options = ImGuiInputFlags_Repeat; + static ImGuiInputFlags route_type = ImGuiInputFlags_RouteFocused; + ImGui::CheckboxFlags("ImGuiInputFlags_Repeat", &route_options, ImGuiInputFlags_Repeat); + ImGui::RadioButton("ImGuiInputFlags_RouteActive", &route_type, ImGuiInputFlags_RouteActive); + ImGui::RadioButton("ImGuiInputFlags_RouteFocused (default)", &route_type, ImGuiInputFlags_RouteFocused); + ImGui::RadioButton("ImGuiInputFlags_RouteGlobal", &route_type, ImGuiInputFlags_RouteGlobal); + ImGui::Indent(); + ImGui::BeginDisabled(route_type != ImGuiInputFlags_RouteGlobal); + ImGui::CheckboxFlags("ImGuiInputFlags_RouteOverFocused", &route_options, ImGuiInputFlags_RouteOverFocused); + ImGui::CheckboxFlags("ImGuiInputFlags_RouteOverActive", &route_options, ImGuiInputFlags_RouteOverActive); + ImGui::CheckboxFlags("ImGuiInputFlags_RouteUnlessBgFocused", &route_options, ImGuiInputFlags_RouteUnlessBgFocused); + ImGui::EndDisabled(); + ImGui::Unindent(); + ImGui::RadioButton("ImGuiInputFlags_RouteAlways", &route_type, ImGuiInputFlags_RouteAlways); + ImGuiInputFlags flags = route_type | route_options; // Merged flags + if (route_type != ImGuiInputFlags_RouteGlobal) + flags &= ~(ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused); + + ImGui::SeparatorText("Using SetNextItemShortcut()"); + ImGui::Text("Ctrl+S"); + ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_S, flags | ImGuiInputFlags_Tooltip); + ImGui::Button("Save"); + ImGui::Text("Alt+F"); + ImGui::SetNextItemShortcut(ImGuiMod_Alt | ImGuiKey_F, flags | ImGuiInputFlags_Tooltip); + static float f = 0.5f; + ImGui::SliderFloat("Factor", &f, 0.0f, 1.0f); + + ImGui::SeparatorText("Using Shortcut()"); + const float line_height = ImGui::GetTextLineHeightWithSpacing(); + const ImGuiKeyChord key_chord = ImGuiMod_Ctrl | ImGuiKey_A; + + ImGui::Text("Ctrl+A"); + ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags) ? "PRESSED" : "..."); + + ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(1.0f, 0.0f, 1.0f, 0.1f)); + + ImGui::BeginChild("WindowA", ImVec2(-FLT_MIN, line_height * 14), true); + ImGui::Text("Press CTRL+A and see who receives it!"); + ImGui::Separator(); + + // 1: Window polling for CTRL+A + ImGui::Text("(in WindowA)"); + ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags) ? "PRESSED" : "..."); + + // 2: InputText also polling for CTRL+A: it always uses _RouteFocused internally (gets priority when active) + // (Commmented because the owner-aware version of Shortcut() is still in imgui_internal.h) + //char str[16] = "Press CTRL+A"; + //ImGui::Spacing(); + //ImGui::InputText("InputTextB", str, IM_ARRAYSIZE(str), ImGuiInputTextFlags_ReadOnly); + //ImGuiID item_id = ImGui::GetItemID(); + //ImGui::SameLine(); HelpMarker("Internal widgets always use _RouteFocused"); + //ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags, item_id) ? "PRESSED" : "..."); + + // 3: Dummy child is not claiming the route: focusing them shouldn't steal route away from WindowA + ImGui::BeginChild("ChildD", ImVec2(-FLT_MIN, line_height * 4), true); + ImGui::Text("(in ChildD: not using same Shortcut)"); + ImGui::Text("IsWindowFocused: %d", ImGui::IsWindowFocused()); + ImGui::EndChild(); + + // 4: Child window polling for CTRL+A. It is deeper than WindowA and gets priority when focused. + ImGui::BeginChild("ChildE", ImVec2(-FLT_MIN, line_height * 4), true); + ImGui::Text("(in ChildE: using same Shortcut)"); + ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags) ? "PRESSED" : "..."); + ImGui::EndChild(); + + // 5: In a popup + if (ImGui::Button("Open Popup")) + ImGui::OpenPopup("PopupF"); + if (ImGui::BeginPopup("PopupF")) + { + ImGui::Text("(in PopupF)"); + ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags) ? "PRESSED" : "..."); + // (Commmented because the owner-aware version of Shortcut() is still in imgui_internal.h) + //ImGui::InputText("InputTextG", str, IM_ARRAYSIZE(str), ImGuiInputTextFlags_ReadOnly); + //ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags, ImGui::GetItemID()) ? "PRESSED" : "..."); + ImGui::EndPopup(); + } + ImGui::EndChild(); + ImGui::PopStyleColor(); + + ImGui::TreePop(); + } + // Display mouse cursors IMGUI_DEMO_MARKER("Inputs & Focus/Mouse Cursors"); if (ImGui::TreeNode("Mouse Cursors")) @@ -5977,7 +7531,8 @@ static void ShowDemoWindowInputs() IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_COUNT); ImGuiMouseCursor current = ImGui::GetMouseCursor(); - ImGui::Text("Current mouse cursor = %d: %s", current, mouse_cursors_names[current]); + const char* cursor_name = (current >= ImGuiMouseCursor_Arrow) && (current < ImGuiMouseCursor_COUNT) ? mouse_cursors_names[current] : "N/A"; + ImGui::Text("Current mouse cursor = %d: %s", current, cursor_name); ImGui::BeginDisabled(true); ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", &io.BackendFlags, ImGuiBackendFlags_HasMouseCursors); ImGui::EndDisabled(); @@ -6006,10 +7561,10 @@ static void ShowDemoWindowInputs() ImGui::InputText("1", buf, IM_ARRAYSIZE(buf)); ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); ImGui::InputText("3", buf, IM_ARRAYSIZE(buf)); - ImGui::PushTabStop(false); + ImGui::PushItemFlag(ImGuiItemFlags_NoTabStop, true); ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf)); ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab."); - ImGui::PopTabStop(); + ImGui::PopItemFlag(); ImGui::InputText("5", buf, IM_ARRAYSIZE(buf)); ImGui::TreePop(); } @@ -6031,12 +7586,12 @@ static void ShowDemoWindowInputs() ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 2; - ImGui::PushTabStop(false); + ImGui::PushItemFlag(ImGuiItemFlags_NoTabStop, true); if (focus_3) ImGui::SetKeyboardFocusHere(); ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 3; ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab."); - ImGui::PopTabStop(); + ImGui::PopItemFlag(); if (has_focus) ImGui::Text("Item with focus: %d", has_focus); @@ -6101,10 +7656,21 @@ void ImGui::ShowAboutWindow(bool* p_open) } IMGUI_DEMO_MARKER("Tools/About Dear ImGui"); ImGui::Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM); + + ImGui::TextLinkOpenURL("Homepage", "https://github.com/ocornut/imgui"); + ImGui::SameLine(); + ImGui::TextLinkOpenURL("FAQ", "https://github.com/ocornut/imgui/blob/master/docs/FAQ.md"); + ImGui::SameLine(); + ImGui::TextLinkOpenURL("Wiki", "https://github.com/ocornut/imgui/wiki"); + ImGui::SameLine(); + ImGui::TextLinkOpenURL("Releases", "https://github.com/ocornut/imgui/releases"); + ImGui::SameLine(); + ImGui::TextLinkOpenURL("Funding", "https://github.com/ocornut/imgui/wiki/Funding"); + ImGui::Separator(); ImGui::Text("By Omar Cornut and all Dear ImGui contributors."); ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information."); - ImGui::Text("If your company uses this, please consider sponsoring the project!"); + ImGui::Text("If your company uses this, please consider funding the project."); static bool show_config_info = false; ImGui::Checkbox("Config/Build Information", &show_config_info); @@ -6115,7 +7681,7 @@ void ImGui::ShowAboutWindow(bool* p_open) bool copy_to_clipboard = ImGui::Button("Copy to clipboard"); ImVec2 child_size = ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 18); - ImGui::BeginChildFrame(ImGui::GetID("cfg_infos"), child_size, ImGuiWindowFlags_NoMove); + ImGui::BeginChild(ImGui::GetID("cfg_infos"), child_size, ImGuiChildFlags_FrameStyle); if (copy_to_clipboard) { ImGui::LogToClipboard(); @@ -6191,6 +7757,7 @@ void ImGui::ShowAboutWindow(bool* p_open) #endif #ifdef __EMSCRIPTEN__ ImGui::Text("define: __EMSCRIPTEN__"); + ImGui::Text("Emscripten: %d.%d.%d", __EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__); #endif ImGui::Separator(); ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL"); @@ -6198,12 +7765,13 @@ void ImGui::ShowAboutWindow(bool* p_open) ImGui::Text("io.ConfigFlags: 0x%08X", io.ConfigFlags); if (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) ImGui::Text(" NavEnableKeyboard"); if (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) ImGui::Text(" NavEnableGamepad"); - if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) ImGui::Text(" NavEnableSetMousePos"); - if (io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard) ImGui::Text(" NavNoCaptureKeyboard"); if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) ImGui::Text(" NoMouse"); if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) ImGui::Text(" NoMouseCursorChange"); + if (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard) ImGui::Text(" NoKeyboard"); if (io.MouseDrawCursor) ImGui::Text("io.MouseDrawCursor"); if (io.ConfigMacOSXBehaviors) ImGui::Text("io.ConfigMacOSXBehaviors"); + if (io.ConfigNavMoveSetMousePos) ImGui::Text("io.ConfigNavMoveSetMousePos"); + if (io.ConfigNavCaptureKeyboard) ImGui::Text("io.ConfigNavCaptureKeyboard"); if (io.ConfigInputTextCursorBlink) ImGui::Text("io.ConfigInputTextCursorBlink"); if (io.ConfigWindowsResizeFromEdges) ImGui::Text("io.ConfigWindowsResizeFromEdges"); if (io.ConfigWindowsMoveFromTitleBarOnly) ImGui::Text("io.ConfigWindowsMoveFromTitleBarOnly"); @@ -6231,7 +7799,7 @@ void ImGui::ShowAboutWindow(bool* p_open) ImGui::LogText("\n```\n"); ImGui::LogFinish(); } - ImGui::EndChildFrame(); + ImGui::EndChild(); } ImGui::End(); } @@ -6342,7 +7910,6 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::SeparatorText("Main"); ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2("CellPadding", (float*)&style.CellPadding, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f"); @@ -6356,6 +7923,9 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f"); + ImGui::SliderFloat("TabBarBorderSize", &style.TabBarBorderSize, 0.0f, 2.0f, "%.0f"); + ImGui::SliderFloat("TabBarOverlineSize", &style.TabBarOverlineSize, 0.0f, 2.0f, "%.0f"); + ImGui::SameLine(); HelpMarker("Overline is only drawn over the selected tab when ImGuiTabBarFlags_DrawSelectedOverline is set."); ImGui::SeparatorText("Rounding"); ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 12.0f, "%.0f"); @@ -6366,11 +7936,16 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f"); + ImGui::SeparatorText("Tables"); + ImGui::SliderFloat2("CellPadding", (float*)&style.CellPadding, 0.0f, 20.0f, "%.0f"); + ImGui::SliderAngle("TableAngledHeadersAngle", &style.TableAngledHeadersAngle, -50.0f, +50.0f); + ImGui::SliderFloat2("TableAngledHeadersTextAlign", (float*)&style.TableAngledHeadersTextAlign, 0.0f, 1.0f, "%.2f"); + ImGui::SeparatorText("Widgets"); ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f"); int window_menu_button_position = style.WindowMenuButtonPosition + 1; if (ImGui::Combo("WindowMenuButtonPosition", (int*)&window_menu_button_position, "None\0Left\0Right\0")) - style.WindowMenuButtonPosition = window_menu_button_position - 1; + style.WindowMenuButtonPosition = (ImGuiDir)(window_menu_button_position - 1); ImGui::Combo("ColorButtonPosition", (int*)&style.ColorButtonPosition, "Left\0Right\0"); ImGui::SliderFloat2("ButtonTextAlign", (float*)&style.ButtonTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Alignment applies when a button is larger than its text content."); @@ -6395,7 +7970,8 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) } ImGui::SeparatorText("Misc"); - ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured)."); + ImGui::SliderFloat2("DisplayWindowPadding", (float*)&style.DisplayWindowPadding, 0.0f, 30.0f, "%.0f"); ImGui::SameLine(); HelpMarker("Apply to regular windows: amount which we enforce to keep visible when moving near edges of your screen."); + ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); ImGui::SameLine(); HelpMarker("Apply to every windows, menus, popups, tooltips: amount where we avoid displaying contents. Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured)."); ImGui::EndTabItem(); } @@ -6436,14 +8012,21 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) "Left-click on color square to open color picker,\n" "Right-click to open edit options menu."); - ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened); - ImGui::PushItemWidth(-160); + ImGui::SetNextWindowSizeConstraints(ImVec2(0.0f, ImGui::GetTextLineHeightWithSpacing() * 10), ImVec2(FLT_MAX, FLT_MAX)); + ImGui::BeginChild("##colors", ImVec2(0, 0), ImGuiChildFlags_Borders | ImGuiChildFlags_NavFlattened, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar); + ImGui::PushItemWidth(ImGui::GetFontSize() * -12); for (int i = 0; i < ImGuiCol_COUNT; i++) { const char* name = ImGui::GetStyleColorName(i); if (!filter.PassFilter(name)) continue; ImGui::PushID(i); +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + if (ImGui::Button("?")) + ImGui::DebugFlashStyleColor((ImGuiCol)i); + ImGui::SetItemTooltip("Flash given color to identify places where it is used."); + ImGui::SameLine(); +#endif ImGui::ColorEdit4("##color", (float*)&style.Colors[i], ImGuiColorEditFlags_AlphaBar | alpha_flags); if (memcmp(&style.Colors[i], &ref->Colors[i], sizeof(ImVec4)) != 0) { @@ -6511,10 +8094,10 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos()); if (show_samples && ImGui::BeginTooltip()) { - ImGui::TextUnformatted("(R = radius, N = number of segments)"); + ImGui::TextUnformatted("(R = radius, N = approx number of segments)"); ImGui::Spacing(); ImDrawList* draw_list = ImGui::GetWindowDrawList(); - const float min_widget_width = ImGui::CalcTextSize("N: MMM\nR: MMM").x; + const float min_widget_width = ImGui::CalcTextSize("R: MMM\nN: MMM").x; for (int n = 0; n < 8; n++) { const float RAD_MIN = 5.0f; @@ -6523,6 +8106,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::BeginGroup(); + // N is not always exact here due to how PathArcTo() function work internally ImGui::Text("R: %.f\nN: %d", rad, draw_list->_CalcCircleAutoSegmentCount(rad)); const float canvas_width = IM_MAX(min_widget_width, rad * 2.0f); @@ -6663,7 +8247,7 @@ static void ShowExampleMenuFile() { static bool enabled = true; ImGui::MenuItem("Enabled", "", &enabled); - ImGui::BeginChild("child", ImVec2(0, 60), true); + ImGui::BeginChild("child", ImVec2(0, 60), ImGuiChildFlags_Borders); for (int i = 0; i < 10; i++) ImGui::Text("Scrolling Text %d", i); ImGui::EndChild(); @@ -6748,19 +8332,19 @@ struct ExampleAppConsole { ClearLog(); for (int i = 0; i < History.Size; i++) - free(History[i]); + ImGui::MemFree(History[i]); } // Portable helpers static int Stricmp(const char* s1, const char* s2) { int d; while ((d = toupper(*s2) - toupper(*s1)) == 0 && *s1) { s1++; s2++; } return d; } static int Strnicmp(const char* s1, const char* s2, int n) { int d = 0; while (n > 0 && (d = toupper(*s2) - toupper(*s1)) == 0 && *s1) { s1++; s2++; n--; } return d; } - static char* Strdup(const char* s) { IM_ASSERT(s); size_t len = strlen(s) + 1; void* buf = malloc(len); IM_ASSERT(buf); return (char*)memcpy(buf, (const void*)s, len); } + static char* Strdup(const char* s) { IM_ASSERT(s); size_t len = strlen(s) + 1; void* buf = ImGui::MemAlloc(len); IM_ASSERT(buf); return (char*)memcpy(buf, (const void*)s, len); } static void Strtrim(char* s) { char* str_end = s + strlen(s); while (str_end > s && str_end[-1] == ' ') str_end--; *str_end = 0; } void ClearLog() { for (int i = 0; i < Items.Size; i++) - free(Items[i]); + ImGui::MemFree(Items[i]); Items.clear(); } @@ -6821,6 +8405,7 @@ struct ExampleAppConsole } // Options, Filter + ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_O, ImGuiInputFlags_Tooltip); if (ImGui::Button("Options")) ImGui::OpenPopup("Options"); ImGui::SameLine(); @@ -6829,7 +8414,7 @@ struct ExampleAppConsole // Reserve enough left-over height for 1 separator + 1 input text const float footer_height_to_reserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing(); - if (ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), false, ImGuiWindowFlags_HorizontalScrollbar)) + if (ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), ImGuiChildFlags_NavFlattened, ImGuiWindowFlags_HorizontalScrollbar)) { if (ImGui::BeginPopupContextWindow()) { @@ -6926,7 +8511,7 @@ struct ExampleAppConsole for (int i = History.Size - 1; i >= 0; i--) if (Stricmp(History[i], command_line) == 0) { - free(History[i]); + ImGui::MemFree(History[i]); History.erase(History.begin() + i); break; } @@ -7140,7 +8725,7 @@ struct ExampleAppLog ImGui::Separator(); - if (ImGui::BeginChild("scrolling", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar)) + if (ImGui::BeginChild("scrolling", ImVec2(0, 0), ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar)) { if (clear) Clear(); @@ -7259,7 +8844,7 @@ static void ShowExampleAppLayout(bool* p_open) // Left static int selected = 0; { - ImGui::BeginChild("left pane", ImVec2(150, 0), true); + ImGui::BeginChild("left pane", ImVec2(150, 0), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeX); for (int i = 0; i < 100; i++) { // FIXME: Good candidate to use ImGuiSelectableFlags_SelectOnNav @@ -7305,57 +8890,130 @@ static void ShowExampleAppLayout(bool* p_open) //----------------------------------------------------------------------------- // [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor() //----------------------------------------------------------------------------- +// Some of the interactions are a bit lack-luster: +// - We would want pressing validating or leaving the filter to somehow restore focus. +// - We may want more advanced filtering (child nodes) and clipper support: both will need extra work. +// - We would want to customize some keyboard interactions to easily keyboard navigate between the tree and the properties. +//----------------------------------------------------------------------------- -static void ShowPlaceholderObject(const char* prefix, int uid) +struct ExampleAppPropertyEditor { - // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID. - ImGui::PushID(uid); - - // Text and Tree nodes are less high than framed widgets, using AlignTextToFramePadding() we add vertical spacing to make the tree lines equal high. - ImGui::TableNextRow(); - ImGui::TableSetColumnIndex(0); - ImGui::AlignTextToFramePadding(); - bool node_open = ImGui::TreeNode("Object", "%s_%u", prefix, uid); - ImGui::TableSetColumnIndex(1); - ImGui::Text("my sailor is rich"); + ImGuiTextFilter Filter; + ExampleTreeNode* VisibleNode = NULL; - if (node_open) + void Draw(ExampleTreeNode* root_node) { - static float placeholder_members[8] = { 0.0f, 0.0f, 1.0f, 3.1416f, 100.0f, 999.0f }; - for (int i = 0; i < 8; i++) + // Left side: draw tree + // - Currently using a table to benefit from RowBg feature + if (ImGui::BeginChild("##tree", ImVec2(300, 0), ImGuiChildFlags_ResizeX | ImGuiChildFlags_Borders | ImGuiChildFlags_NavFlattened)) { - ImGui::PushID(i); // Use field index as identifier. - if (i < 2) + ImGui::SetNextItemWidth(-FLT_MIN); + ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_F, ImGuiInputFlags_Tooltip); + ImGui::PushItemFlag(ImGuiItemFlags_NoNavDefaultFocus, true); + if (ImGui::InputTextWithHint("##Filter", "incl,-excl", Filter.InputBuf, IM_ARRAYSIZE(Filter.InputBuf), ImGuiInputTextFlags_EscapeClearsAll)) + Filter.Build(); + ImGui::PopItemFlag(); + + if (ImGui::BeginTable("##bg", 1, ImGuiTableFlags_RowBg)) { - ShowPlaceholderObject("Child", 424242); + for (ExampleTreeNode* node : root_node->Childs) + if (Filter.PassFilter(node->Name)) // Filter root node + DrawTreeNode(node); + ImGui::EndTable(); } - else - { - // Here we use a TreeNode to highlight on hover (we could use e.g. Selectable as well) - ImGui::TableNextRow(); - ImGui::TableSetColumnIndex(0); - ImGui::AlignTextToFramePadding(); - ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_Bullet; - ImGui::TreeNodeEx("Field", flags, "Field_%d", i); + } + ImGui::EndChild(); - ImGui::TableSetColumnIndex(1); - ImGui::SetNextItemWidth(-FLT_MIN); - if (i >= 5) - ImGui::InputFloat("##value", &placeholder_members[i], 1.0f); - else - ImGui::DragFloat("##value", &placeholder_members[i], 0.01f); - ImGui::NextColumn(); + // Right side: draw properties + ImGui::SameLine(); + + ImGui::BeginGroup(); // Lock X position + if (ExampleTreeNode* node = VisibleNode) + { + ImGui::Text("%s", node->Name); + ImGui::TextDisabled("UID: 0x%08X", node->UID); + ImGui::Separator(); + if (ImGui::BeginTable("##properties", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY)) + { + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed); + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch, 2.0f); // Default twice larger + if (node->HasData) + { + // In a typical application, the structure description would be derived from a data-driven system. + // - We try to mimic this with our ExampleMemberInfo structure and the ExampleTreeNodeMemberInfos[] array. + // - Limits and some details are hard-coded to simplify the demo. + for (const ExampleMemberInfo& field_desc : ExampleTreeNodeMemberInfos) + { + ImGui::TableNextRow(); + ImGui::PushID(field_desc.Name); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::TextUnformatted(field_desc.Name); + ImGui::TableNextColumn(); + void* field_ptr = (void*)(((unsigned char*)node) + field_desc.Offset); + switch (field_desc.DataType) + { + case ImGuiDataType_Bool: + { + IM_ASSERT(field_desc.DataCount == 1); + ImGui::Checkbox("##Editor", (bool*)field_ptr); + break; + } + case ImGuiDataType_S32: + { + int v_min = INT_MIN, v_max = INT_MAX; + ImGui::SetNextItemWidth(-FLT_MIN); + ImGui::DragScalarN("##Editor", field_desc.DataType, field_ptr, field_desc.DataCount, 1.0f, &v_min, &v_max); + break; + } + case ImGuiDataType_Float: + { + float v_min = 0.0f, v_max = 1.0f; + ImGui::SetNextItemWidth(-FLT_MIN); + ImGui::SliderScalarN("##Editor", field_desc.DataType, field_ptr, field_desc.DataCount, &v_min, &v_max); + break; + } + } + ImGui::PopID(); + } + } + ImGui::EndTable(); } - ImGui::PopID(); } - ImGui::TreePop(); + ImGui::EndGroup(); } - ImGui::PopID(); -} -// Demonstrate create a simple property editor. -// This demo is a bit lackluster nowadays, would be nice to improve. -static void ShowExampleAppPropertyEditor(bool* p_open) + void DrawTreeNode(ExampleTreeNode* node) + { + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImGui::PushID(node->UID); + ImGuiTreeNodeFlags tree_flags = ImGuiTreeNodeFlags_None; + tree_flags |= ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick; // Standard opening mode as we are likely to want to add selection afterwards + tree_flags |= ImGuiTreeNodeFlags_NavLeftJumpsBackHere; // Left arrow support + if (node == VisibleNode) + tree_flags |= ImGuiTreeNodeFlags_Selected; + if (node->Childs.Size == 0) + tree_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_Bullet; + if (node->DataMyBool == false) + ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]); + bool node_open = ImGui::TreeNodeEx("", tree_flags, "%s", node->Name); + if (node->DataMyBool == false) + ImGui::PopStyleColor(); + if (ImGui::IsItemFocused()) + VisibleNode = node; + if (node_open) + { + for (ExampleTreeNode* child : node->Childs) + DrawTreeNode(child); + ImGui::TreePop(); + } + ImGui::PopID(); + } +}; + +// Demonstrate creating a simple property editor. +static void ShowExampleAppPropertyEditor(bool* p_open, ImGuiDemoWindowData* demo_data) { ImGui::SetNextWindowSize(ImVec2(430, 450), ImGuiCond_FirstUseEver); if (!ImGui::Begin("Example: Property editor", p_open)) @@ -7365,25 +9023,11 @@ static void ShowExampleAppPropertyEditor(bool* p_open) } IMGUI_DEMO_MARKER("Examples/Property Editor"); - HelpMarker( - "This example shows how you may implement a property editor using two columns.\n" - "All objects/fields data are dummies here.\n"); - - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 2)); - if (ImGui::BeginTable("##split", 2, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY)) - { - ImGui::TableSetupScrollFreeze(0, 1); - ImGui::TableSetupColumn("Object"); - ImGui::TableSetupColumn("Contents"); - ImGui::TableHeadersRow(); - - // Iterate placeholder objects (all the same data) - for (int obj_i = 0; obj_i < 4; obj_i++) - ShowPlaceholderObject("Object", obj_i); + static ExampleAppPropertyEditor property_editor; + if (demo_data->DemoTree == NULL) + demo_data->DemoTree = ExampleTree_CreateDemoTree(); + property_editor.Draw(demo_data->DemoTree); - ImGui::EndTable(); - } - ImGui::PopStyleVar(); ImGui::End(); } @@ -7487,18 +9131,31 @@ static void ShowExampleAppConstrainedResize(bool* p_open) { // Helper functions to demonstrate programmatic constraints // FIXME: This doesn't take account of decoration size (e.g. title bar), library should make this easier. - static void AspectRatio(ImGuiSizeCallbackData* data) { float aspect_ratio = *(float*)data->UserData; data->DesiredSize.x = IM_MAX(data->CurrentSize.x, data->CurrentSize.y); data->DesiredSize.y = (float)(int)(data->DesiredSize.x / aspect_ratio); } - static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize.x = data->DesiredSize.y = IM_MAX(data->CurrentSize.x, data->CurrentSize.y); } - static void Step(ImGuiSizeCallbackData* data) { float step = *(float*)data->UserData; data->DesiredSize = ImVec2((int)(data->CurrentSize.x / step + 0.5f) * step, (int)(data->CurrentSize.y / step + 0.5f) * step); } + // FIXME: None of the three demos works consistently when resizing from borders. + static void AspectRatio(ImGuiSizeCallbackData* data) + { + float aspect_ratio = *(float*)data->UserData; + data->DesiredSize.y = (float)(int)(data->DesiredSize.x / aspect_ratio); + } + static void Square(ImGuiSizeCallbackData* data) + { + data->DesiredSize.x = data->DesiredSize.y = IM_MAX(data->DesiredSize.x, data->DesiredSize.y); + } + static void Step(ImGuiSizeCallbackData* data) + { + float step = *(float*)data->UserData; + data->DesiredSize = ImVec2((int)(data->DesiredSize.x / step + 0.5f) * step, (int)(data->DesiredSize.y / step + 0.5f) * step); + } }; const char* test_desc[] = { "Between 100x100 and 500x500", "At least 100x100", - "Resize vertical only", - "Resize horizontal only", + "Resize vertical + lock current width", + "Resize horizontal + lock current height", "Width Between 400 and 500", + "Height at least 400", "Custom: Aspect Ratio 16:9", "Custom: Always Square", "Custom: Fixed Steps (100)", @@ -7507,7 +9164,7 @@ static void ShowExampleAppConstrainedResize(bool* p_open) // Options static bool auto_resize = false; static bool window_padding = true; - static int type = 5; // Aspect Ratio + static int type = 6; // Aspect Ratio static int display_lines = 10; // Submit constraint @@ -7515,12 +9172,13 @@ static void ShowExampleAppConstrainedResize(bool* p_open) float fixed_step = 100.0f; if (type == 0) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(500, 500)); // Between 100x100 and 500x500 if (type == 1) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(FLT_MAX, FLT_MAX)); // Width > 100, Height > 100 - if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Vertical only - if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Horizontal only + if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Resize vertical + lock current width + if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Resize horizontal + lock current height if (type == 4) ImGui::SetNextWindowSizeConstraints(ImVec2(400, -1), ImVec2(500, -1)); // Width Between and 400 and 500 - if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::AspectRatio, (void*)&aspect_ratio); // Aspect ratio - if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square - if (type == 7) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)&fixed_step); // Fixed Step + if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 400), ImVec2(-1, FLT_MAX)); // Height at least 400 + if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::AspectRatio, (void*)&aspect_ratio); // Aspect ratio + if (type == 7) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square + if (type == 8) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)&fixed_step); // Fixed Step // Submit window if (!window_padding) @@ -7692,6 +9350,14 @@ static void ShowExampleAppWindowTitles(bool*) // [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering() //----------------------------------------------------------------------------- +// Add a |_| looking shape +static void PathConcaveShape(ImDrawList* draw_list, float x, float y, float sz) +{ + const ImVec2 pos_norms[] = { { 0.0f, 0.0f }, { 0.3f, 0.0f }, { 0.3f, 0.7f }, { 0.7f, 0.7f }, { 0.7f, 0.0f }, { 1.0f, 0.0f }, { 1.0f, 1.0f }, { 0.0f, 1.0f } }; + for (const ImVec2& p : pos_norms) + draw_list->PathLineTo(ImVec2(x + 0.5f + (int)(sz * p.x), y + 0.5f + (int)(sz * p.y))); +} + // Demonstrate using the low-level ImDrawList to draw custom shapes. static void ShowExampleAppCustomRendering(bool* p_open) { @@ -7764,6 +9430,9 @@ static void ShowExampleAppCustomRendering(bool* p_open) const float rounding = sz / 5.0f; const int circle_segments = circle_segments_override ? circle_segments_override_v : 0; const int curve_segments = curve_segments_override ? curve_segments_override_v : 0; + const ImVec2 cp3[3] = { ImVec2(0.0f, sz * 0.6f), ImVec2(sz * 0.5f, -sz * 0.4f), ImVec2(sz, sz) }; // Control points for curves + const ImVec2 cp4[4] = { ImVec2(0.0f, 0.0f), ImVec2(sz * 1.3f, sz * 0.3f), ImVec2(sz - sz * 1.3f, sz - sz * 0.3f), ImVec2(sz, sz) }; + float x = p.x + 4.0f; float y = p.y + 4.0f; for (int n = 0; n < 2; n++) @@ -7772,39 +9441,63 @@ static void ShowExampleAppCustomRendering(bool* p_open) float th = (n == 0) ? 1.0f : thickness; draw_list->AddNgon(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, ngon_sides, th); x += sz + spacing; // N-gon draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, circle_segments, th); x += sz + spacing; // Circle + draw_list->AddEllipse(ImVec2(x + sz*0.5f, y + sz*0.5f), ImVec2(sz*0.5f, sz*0.3f), col, -0.3f, circle_segments, th); x += sz + spacing; // Ellipse draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 0.0f, ImDrawFlags_None, th); x += sz + spacing; // Square draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, ImDrawFlags_None, th); x += sz + spacing; // Square with all rounded corners draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, corners_tl_br, th); x += sz + spacing; // Square with two rounded corners draw_list->AddTriangle(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col, th);x += sz + spacing; // Triangle //draw_list->AddTriangle(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col, th);x+= sz*0.4f + spacing; // Thin triangle + PathConcaveShape(draw_list, x, y, sz); draw_list->PathStroke(col, ImDrawFlags_Closed, th); x += sz + spacing; // Concave Shape + //draw_list->AddPolyline(concave_shape, IM_ARRAYSIZE(concave_shape), col, ImDrawFlags_Closed, th); draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y), col, th); x += sz + spacing; // Horizontal line (note: drawing a filled rectangle will be faster!) draw_list->AddLine(ImVec2(x, y), ImVec2(x, y + sz), col, th); x += spacing; // Vertical line (note: drawing a filled rectangle will be faster!) draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y + sz), col, th); x += sz + spacing; // Diagonal line + // Path + draw_list->PathArcTo(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, 3.141592f, 3.141592f * -0.5f); + draw_list->PathStroke(col, ImDrawFlags_None, th); + x += sz + spacing; + // Quadratic Bezier Curve (3 control points) - ImVec2 cp3[3] = { ImVec2(x, y + sz * 0.6f), ImVec2(x + sz * 0.5f, y - sz * 0.4f), ImVec2(x + sz, y + sz) }; - draw_list->AddBezierQuadratic(cp3[0], cp3[1], cp3[2], col, th, curve_segments); x += sz + spacing; + draw_list->AddBezierQuadratic(ImVec2(x + cp3[0].x, y + cp3[0].y), ImVec2(x + cp3[1].x, y + cp3[1].y), ImVec2(x + cp3[2].x, y + cp3[2].y), col, th, curve_segments); + x += sz + spacing; // Cubic Bezier Curve (4 control points) - ImVec2 cp4[4] = { ImVec2(x, y), ImVec2(x + sz * 1.3f, y + sz * 0.3f), ImVec2(x + sz - sz * 1.3f, y + sz - sz * 0.3f), ImVec2(x + sz, y + sz) }; - draw_list->AddBezierCubic(cp4[0], cp4[1], cp4[2], cp4[3], col, th, curve_segments); + draw_list->AddBezierCubic(ImVec2(x + cp4[0].x, y + cp4[0].y), ImVec2(x + cp4[1].x, y + cp4[1].y), ImVec2(x + cp4[2].x, y + cp4[2].y), ImVec2(x + cp4[3].x, y + cp4[3].y), col, th, curve_segments); x = p.x + 4; y += sz + spacing; } - draw_list->AddNgonFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz*0.5f, col, ngon_sides); x += sz + spacing; // N-gon - draw_list->AddCircleFilled(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, circle_segments); x += sz + spacing; // Circle + + // Filled shapes + draw_list->AddNgonFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz * 0.5f, col, ngon_sides); x += sz + spacing; // N-gon + draw_list->AddCircleFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz * 0.5f, col, circle_segments); x += sz + spacing; // Circle + draw_list->AddEllipseFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), ImVec2(sz * 0.5f, sz * 0.3f), col, -0.3f, circle_segments); x += sz + spacing;// Ellipse draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col); x += sz + spacing; // Square draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f); x += sz + spacing; // Square with all rounded corners draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_tl_br); x += sz + spacing; // Square with two rounded corners draw_list->AddTriangleFilled(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col); x += sz + spacing; // Triangle //draw_list->AddTriangleFilled(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col); x += sz*0.4f + spacing; // Thin triangle + PathConcaveShape(draw_list, x, y, sz); draw_list->PathFillConcave(col); x += sz + spacing; // Concave shape draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + thickness), col); x += sz + spacing; // Horizontal line (faster than AddLine, but only handle integer thickness) draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + thickness, y + sz), col); x += spacing * 2.0f;// Vertical line (faster than AddLine, but only handle integer thickness) draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + 1, y + 1), col); x += sz; // Pixel (faster than AddLine) + + // Path + draw_list->PathArcTo(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz * 0.5f, 3.141592f * -0.5f, 3.141592f); + draw_list->PathFillConvex(col); + x += sz + spacing; + + // Quadratic Bezier Curve (3 control points) + draw_list->PathLineTo(ImVec2(x + cp3[0].x, y + cp3[0].y)); + draw_list->PathBezierQuadraticCurveTo(ImVec2(x + cp3[1].x, y + cp3[1].y), ImVec2(x + cp3[2].x, y + cp3[2].y), curve_segments); + draw_list->PathFillConvex(col); + x += sz + spacing; + draw_list->AddRectFilledMultiColor(ImVec2(x, y), ImVec2(x + sz, y + sz), IM_COL32(0, 0, 0, 255), IM_COL32(255, 0, 0, 255), IM_COL32(255, 255, 0, 255), IM_COL32(0, 255, 0, 255)); + x += sz + spacing; - ImGui::Dummy(ImVec2((sz + spacing) * 10.2f, (sz + spacing) * 3.0f)); + ImGui::Dummy(ImVec2((sz + spacing) * 13.2f, (sz + spacing) * 3.0f)); ImGui::PopItemWidth(); ImGui::EndTabItem(); } @@ -7826,7 +9519,7 @@ static void ShowExampleAppCustomRendering(bool* p_open) // To use a child window instead we could use, e.g: // ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0)); // Disable padding // ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(50, 50, 50, 255)); // Set a background color - // ImGui::BeginChild("canvas", ImVec2(0.0f, 0.0f), true, ImGuiWindowFlags_NoMove); + // ImGui::BeginChild("canvas", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Borders, ImGuiWindowFlags_NoMove); // ImGui::PopStyleColor(); // ImGui::PopStyleVar(); // [...] @@ -7974,92 +9667,119 @@ static void ShowExampleAppCustomRendering(bool* p_open) // Simplified structure to mimic a Document model struct MyDocument { - const char* Name; // Document title + char Name[32]; // Document title + int UID; // Unique ID (necessary as we can change title) bool Open; // Set when open (we keep an array of all available documents to simplify demo code!) bool OpenPrev; // Copy of Open from last update. bool Dirty; // Set when the document has been modified - bool WantClose; // Set when the document ImVec4 Color; // An arbitrary variable associated to the document - MyDocument(const char* name, bool open = true, const ImVec4& color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)) + MyDocument(int uid, const char* name, bool open = true, const ImVec4& color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)) { - Name = name; + UID = uid; + snprintf(Name, sizeof(Name), "%s", name); Open = OpenPrev = open; Dirty = false; - WantClose = false; Color = color; } void DoOpen() { Open = true; } - void DoQueueClose() { WantClose = true; } void DoForceClose() { Open = false; Dirty = false; } void DoSave() { Dirty = false; } +}; + +struct ExampleAppDocuments +{ + ImVector Documents; + ImVector CloseQueue; + MyDocument* RenamingDoc = NULL; + bool RenamingStarted = false; + + ExampleAppDocuments() + { + Documents.push_back(MyDocument(0, "Lettuce", true, ImVec4(0.4f, 0.8f, 0.4f, 1.0f))); + Documents.push_back(MyDocument(1, "Eggplant", true, ImVec4(0.8f, 0.5f, 1.0f, 1.0f))); + Documents.push_back(MyDocument(2, "Carrot", true, ImVec4(1.0f, 0.8f, 0.5f, 1.0f))); + Documents.push_back(MyDocument(3, "Tomato", false, ImVec4(1.0f, 0.3f, 0.4f, 1.0f))); + Documents.push_back(MyDocument(4, "A Rather Long Title", false, ImVec4(0.4f, 0.8f, 0.8f, 1.0f))); + Documents.push_back(MyDocument(5, "Some Document", false, ImVec4(0.8f, 0.8f, 1.0f, 1.0f))); + } + + // As we allow to change document name, we append a never-changing document ID so tabs are stable + void GetTabName(MyDocument* doc, char* out_buf, size_t out_buf_size) + { + snprintf(out_buf, out_buf_size, "%s###doc%d", doc->Name, doc->UID); + } // Display placeholder contents for the Document - static void DisplayContents(MyDocument* doc) + void DisplayDocContents(MyDocument* doc) { ImGui::PushID(doc); ImGui::Text("Document \"%s\"", doc->Name); ImGui::PushStyleColor(ImGuiCol_Text, doc->Color); ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); ImGui::PopStyleColor(); - if (ImGui::Button("Modify", ImVec2(100, 0))) + + ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_R, ImGuiInputFlags_Tooltip); + if (ImGui::Button("Rename..")) + { + RenamingDoc = doc; + RenamingStarted = true; + } + ImGui::SameLine(); + + ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_M, ImGuiInputFlags_Tooltip); + if (ImGui::Button("Modify")) doc->Dirty = true; + ImGui::SameLine(); - if (ImGui::Button("Save", ImVec2(100, 0))) + ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_S, ImGuiInputFlags_Tooltip); + if (ImGui::Button("Save")) doc->DoSave(); + + ImGui::SameLine(); + ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_W, ImGuiInputFlags_Tooltip); + if (ImGui::Button("Close")) + CloseQueue.push_back(doc); ImGui::ColorEdit3("color", &doc->Color.x); // Useful to test drag and drop and hold-dragged-to-open-tab behavior. ImGui::PopID(); } // Display context menu for the Document - static void DisplayContextMenu(MyDocument* doc) + void DisplayDocContextMenu(MyDocument* doc) { if (!ImGui::BeginPopupContextItem()) return; char buf[256]; sprintf(buf, "Save %s", doc->Name); - if (ImGui::MenuItem(buf, "CTRL+S", false, doc->Open)) + if (ImGui::MenuItem(buf, "Ctrl+S", false, doc->Open)) doc->DoSave(); - if (ImGui::MenuItem("Close", "CTRL+W", false, doc->Open)) - doc->DoQueueClose(); + if (ImGui::MenuItem("Rename...", "Ctrl+R", false, doc->Open)) + RenamingDoc = doc; + if (ImGui::MenuItem("Close", "Ctrl+W", false, doc->Open)) + CloseQueue.push_back(doc); ImGui::EndPopup(); } -}; - -struct ExampleAppDocuments -{ - ImVector Documents; - ExampleAppDocuments() + // [Optional] Notify the system of Tabs/Windows closure that happened outside the regular tab interface. + // If a tab has been closed programmatically (aka closed from another source such as the Checkbox() in the demo, + // as opposed to clicking on the regular tab closing button) and stops being submitted, it will take a frame for + // the tab bar to notice its absence. During this frame there will be a gap in the tab bar, and if the tab that has + // disappeared was the selected one, the tab bar will report no selected tab during the frame. This will effectively + // give the impression of a flicker for one frame. + // We call SetTabItemClosed() to manually notify the Tab Bar or Docking system of removed tabs to avoid this glitch. + // Note that this completely optional, and only affect tab bars with the ImGuiTabBarFlags_Reorderable flag. + void NotifyOfDocumentsClosedElsewhere() { - Documents.push_back(MyDocument("Lettuce", true, ImVec4(0.4f, 0.8f, 0.4f, 1.0f))); - Documents.push_back(MyDocument("Eggplant", true, ImVec4(0.8f, 0.5f, 1.0f, 1.0f))); - Documents.push_back(MyDocument("Carrot", true, ImVec4(1.0f, 0.8f, 0.5f, 1.0f))); - Documents.push_back(MyDocument("Tomato", false, ImVec4(1.0f, 0.3f, 0.4f, 1.0f))); - Documents.push_back(MyDocument("A Rather Long Title", false)); - Documents.push_back(MyDocument("Some Document", false)); + for (MyDocument& doc : Documents) + { + if (!doc.Open && doc.OpenPrev) + ImGui::SetTabItemClosed(doc.Name); + doc.OpenPrev = doc.Open; + } } }; -// [Optional] Notify the system of Tabs/Windows closure that happened outside the regular tab interface. -// If a tab has been closed programmatically (aka closed from another source such as the Checkbox() in the demo, -// as opposed to clicking on the regular tab closing button) and stops being submitted, it will take a frame for -// the tab bar to notice its absence. During this frame there will be a gap in the tab bar, and if the tab that has -// disappeared was the selected one, the tab bar will report no selected tab during the frame. This will effectively -// give the impression of a flicker for one frame. -// We call SetTabItemClosed() to manually notify the Tab Bar or Docking system of removed tabs to avoid this glitch. -// Note that this completely optional, and only affect tab bars with the ImGuiTabBarFlags_Reorderable flag. -static void NotifyOfDocumentsClosedElsewhere(ExampleAppDocuments& app) -{ - for (MyDocument& doc : app.Documents) - { - if (!doc.Open && doc.OpenPrev) - ImGui::SetTabItemClosed(doc.Name); - doc.OpenPrev = doc.Open; - } -} - void ShowExampleAppDocuments(bool* p_open) { static ExampleAppDocuments app; @@ -8093,8 +9813,8 @@ void ShowExampleAppDocuments(bool* p_open) } if (ImGui::MenuItem("Close All Documents", NULL, false, open_count > 0)) for (MyDocument& doc : app.Documents) - doc.DoQueueClose(); - if (ImGui::MenuItem("Exit", "Ctrl+F4") && p_open) + app.CloseQueue.push_back(&doc); + if (ImGui::MenuItem("Exit") && p_open) *p_open = false; ImGui::EndMenu(); } @@ -8129,10 +9849,11 @@ void ShowExampleAppDocuments(bool* p_open) // Submit Tab Bar and Tabs { ImGuiTabBarFlags tab_bar_flags = (opt_fitting_flags) | (opt_reorderable ? ImGuiTabBarFlags_Reorderable : 0); + tab_bar_flags |= ImGuiTabBarFlags_DrawSelectedOverline; if (ImGui::BeginTabBar("##tabs", tab_bar_flags)) { if (opt_reorderable) - NotifyOfDocumentsClosedElsewhere(app); + app.NotifyOfDocumentsClosedElsewhere(); // [DEBUG] Stress tests //if ((ImGui::GetFrameCount() % 30) == 0) docs[1].Open ^= 1; // [DEBUG] Automatically show/hide a tab. Test various interactions e.g. dragging with this on. @@ -8144,20 +9865,23 @@ void ShowExampleAppDocuments(bool* p_open) if (!doc.Open) continue; + // As we allow to change document name, we append a never-changing document id so tabs are stable + char doc_name_buf[64]; + app.GetTabName(&doc, doc_name_buf, sizeof(doc_name_buf)); ImGuiTabItemFlags tab_flags = (doc.Dirty ? ImGuiTabItemFlags_UnsavedDocument : 0); - bool visible = ImGui::BeginTabItem(doc.Name, &doc.Open, tab_flags); + bool visible = ImGui::BeginTabItem(doc_name_buf, &doc.Open, tab_flags); // Cancel attempt to close when unsaved add to save queue so we can display a popup. if (!doc.Open && doc.Dirty) { doc.Open = true; - doc.DoQueueClose(); + app.CloseQueue.push_back(&doc); } - MyDocument::DisplayContextMenu(&doc); + app.DisplayDocContextMenu(&doc); if (visible) { - MyDocument::DisplayContents(&doc); + app.DisplayDocContents(&doc); ImGui::EndTabItem(); } } @@ -8166,33 +9890,44 @@ void ShowExampleAppDocuments(bool* p_open) } } - // Update closing queue - static ImVector close_queue; - if (close_queue.empty()) + // Display renaming UI + if (app.RenamingDoc != NULL) { - // Close queue is locked once we started a popup - for (MyDocument& doc : app.Documents) - if (doc.WantClose) + if (app.RenamingStarted) + ImGui::OpenPopup("Rename"); + if (ImGui::BeginPopup("Rename")) + { + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 30); + if (ImGui::InputText("###Name", app.RenamingDoc->Name, IM_ARRAYSIZE(app.RenamingDoc->Name), ImGuiInputTextFlags_EnterReturnsTrue)) { - doc.WantClose = false; - close_queue.push_back(&doc); + ImGui::CloseCurrentPopup(); + app.RenamingDoc = NULL; } + if (app.RenamingStarted) + ImGui::SetKeyboardFocusHere(-1); + ImGui::EndPopup(); + } + else + { + app.RenamingDoc = NULL; + } + app.RenamingStarted = false; } // Display closing confirmation UI - if (!close_queue.empty()) + if (!app.CloseQueue.empty()) { int close_queue_unsaved_documents = 0; - for (int n = 0; n < close_queue.Size; n++) - if (close_queue[n]->Dirty) + for (int n = 0; n < app.CloseQueue.Size; n++) + if (app.CloseQueue[n]->Dirty) close_queue_unsaved_documents++; if (close_queue_unsaved_documents == 0) { // Close documents when all are unsaved - for (int n = 0; n < close_queue.Size; n++) - close_queue[n]->DoForceClose(); - close_queue.clear(); + for (int n = 0; n < app.CloseQueue.Size; n++) + app.CloseQueue[n]->DoForceClose(); + app.CloseQueue.clear(); } else { @@ -8202,38 +9937,36 @@ void ShowExampleAppDocuments(bool* p_open) { ImGui::Text("Save change to the following items?"); float item_height = ImGui::GetTextLineHeightWithSpacing(); - if (ImGui::BeginChildFrame(ImGui::GetID("frame"), ImVec2(-FLT_MIN, 6.25f * item_height))) - { - for (int n = 0; n < close_queue.Size; n++) - if (close_queue[n]->Dirty) - ImGui::Text("%s", close_queue[n]->Name); - } - ImGui::EndChildFrame(); + if (ImGui::BeginChild(ImGui::GetID("frame"), ImVec2(-FLT_MIN, 6.25f * item_height), ImGuiChildFlags_FrameStyle)) + for (MyDocument* doc : app.CloseQueue) + if (doc->Dirty) + ImGui::Text("%s", doc->Name); + ImGui::EndChild(); ImVec2 button_size(ImGui::GetFontSize() * 7.0f, 0.0f); if (ImGui::Button("Yes", button_size)) { - for (int n = 0; n < close_queue.Size; n++) + for (MyDocument* doc : app.CloseQueue) { - if (close_queue[n]->Dirty) - close_queue[n]->DoSave(); - close_queue[n]->DoForceClose(); + if (doc->Dirty) + doc->DoSave(); + doc->DoForceClose(); } - close_queue.clear(); + app.CloseQueue.clear(); ImGui::CloseCurrentPopup(); } ImGui::SameLine(); if (ImGui::Button("No", button_size)) { - for (int n = 0; n < close_queue.Size; n++) - close_queue[n]->DoForceClose(); - close_queue.clear(); + for (MyDocument* doc : app.CloseQueue) + doc->DoForceClose(); + app.CloseQueue.clear(); ImGui::CloseCurrentPopup(); } ImGui::SameLine(); if (ImGui::Button("Cancel", button_size)) { - close_queue.clear(); + app.CloseQueue.clear(); ImGui::CloseCurrentPopup(); } ImGui::EndPopup(); @@ -8244,6 +9977,404 @@ void ShowExampleAppDocuments(bool* p_open) ImGui::End(); } +//----------------------------------------------------------------------------- +// [SECTION] Example App: Assets Browser / ShowExampleAppAssetsBrowser() +//----------------------------------------------------------------------------- + +//#include "imgui_internal.h" // NavMoveRequestTryWrapping() + +struct ExampleAsset +{ + ImGuiID ID; + int Type; + + ExampleAsset(ImGuiID id, int type) { ID = id; Type = type; } + + static const ImGuiTableSortSpecs* s_current_sort_specs; + + static void SortWithSortSpecs(ImGuiTableSortSpecs* sort_specs, ExampleAsset* items, int items_count) + { + s_current_sort_specs = sort_specs; // Store in variable accessible by the sort function. + if (items_count > 1) + qsort(items, (size_t)items_count, sizeof(items[0]), ExampleAsset::CompareWithSortSpecs); + s_current_sort_specs = NULL; + } + + // Compare function to be used by qsort() + static int IMGUI_CDECL CompareWithSortSpecs(const void* lhs, const void* rhs) + { + const ExampleAsset* a = (const ExampleAsset*)lhs; + const ExampleAsset* b = (const ExampleAsset*)rhs; + for (int n = 0; n < s_current_sort_specs->SpecsCount; n++) + { + const ImGuiTableColumnSortSpecs* sort_spec = &s_current_sort_specs->Specs[n]; + int delta = 0; + if (sort_spec->ColumnIndex == 0) + delta = ((int)a->ID - (int)b->ID); + else if (sort_spec->ColumnIndex == 1) + delta = (a->Type - b->Type); + if (delta > 0) + return (sort_spec->SortDirection == ImGuiSortDirection_Ascending) ? +1 : -1; + if (delta < 0) + return (sort_spec->SortDirection == ImGuiSortDirection_Ascending) ? -1 : +1; + } + return ((int)a->ID - (int)b->ID); + } +}; +const ImGuiTableSortSpecs* ExampleAsset::s_current_sort_specs = NULL; + +struct ExampleAssetsBrowser +{ + // Options + bool ShowTypeOverlay = true; + bool AllowSorting = true; + bool AllowDragUnselected = false; + bool AllowBoxSelect = true; + float IconSize = 32.0f; + int IconSpacing = 10; + int IconHitSpacing = 4; // Increase hit-spacing if you want to make it possible to clear or box-select from gaps. Some spacing is required to able to amend with Shift+box-select. Value is small in Explorer. + bool StretchSpacing = true; + + // State + ImVector Items; // Our items + ExampleSelectionWithDeletion Selection; // Our selection (ImGuiSelectionBasicStorage + helper funcs to handle deletion) + ImGuiID NextItemId = 0; // Unique identifier when creating new items + bool RequestDelete = false; // Deferred deletion request + bool RequestSort = false; // Deferred sort request + float ZoomWheelAccum = 0.0f; // Mouse wheel accumulator to handle smooth wheels better + + // Calculated sizes for layout, output of UpdateLayoutSizes(). Could be locals but our code is simpler this way. + ImVec2 LayoutItemSize; + ImVec2 LayoutItemStep; // == LayoutItemSize + LayoutItemSpacing + float LayoutItemSpacing = 0.0f; + float LayoutSelectableSpacing = 0.0f; + float LayoutOuterPadding = 0.0f; + int LayoutColumnCount = 0; + int LayoutLineCount = 0; + + // Functions + ExampleAssetsBrowser() + { + AddItems(10000); + } + void AddItems(int count) + { + if (Items.Size == 0) + NextItemId = 0; + Items.reserve(Items.Size + count); + for (int n = 0; n < count; n++, NextItemId++) + Items.push_back(ExampleAsset(NextItemId, (NextItemId % 20) < 15 ? 0 : (NextItemId % 20) < 18 ? 1 : 2)); + RequestSort = true; + } + void ClearItems() + { + Items.clear(); + Selection.Clear(); + } + + // Logic would be written in the main code BeginChild() and outputing to local variables. + // We extracted it into a function so we can call it easily from multiple places. + void UpdateLayoutSizes(float avail_width) + { + // Layout: when not stretching: allow extending into right-most spacing. + LayoutItemSpacing = (float)IconSpacing; + if (StretchSpacing == false) + avail_width += floorf(LayoutItemSpacing * 0.5f); + + // Layout: calculate number of icon per line and number of lines + LayoutItemSize = ImVec2(floorf(IconSize), floorf(IconSize)); + LayoutColumnCount = IM_MAX((int)(avail_width / (LayoutItemSize.x + LayoutItemSpacing)), 1); + LayoutLineCount = (Items.Size + LayoutColumnCount - 1) / LayoutColumnCount; + + // Layout: when stretching: allocate remaining space to more spacing. Round before division, so item_spacing may be non-integer. + if (StretchSpacing && LayoutColumnCount > 1) + LayoutItemSpacing = floorf(avail_width - LayoutItemSize.x * LayoutColumnCount) / LayoutColumnCount; + + LayoutItemStep = ImVec2(LayoutItemSize.x + LayoutItemSpacing, LayoutItemSize.y + LayoutItemSpacing); + LayoutSelectableSpacing = IM_MAX(floorf(LayoutItemSpacing) - IconHitSpacing, 0.0f); + LayoutOuterPadding = floorf(LayoutItemSpacing * 0.5f); + } + + void Draw(const char* title, bool* p_open) + { + ImGui::SetNextWindowSize(ImVec2(IconSize * 25, IconSize * 15), ImGuiCond_FirstUseEver); + if (!ImGui::Begin(title, p_open, ImGuiWindowFlags_MenuBar)) + { + ImGui::End(); + return; + } + + // Menu bar + if (ImGui::BeginMenuBar()) + { + if (ImGui::BeginMenu("File")) + { + if (ImGui::MenuItem("Add 10000 items")) + AddItems(10000); + if (ImGui::MenuItem("Clear items")) + ClearItems(); + ImGui::Separator(); + if (ImGui::MenuItem("Close", NULL, false, p_open != NULL)) + *p_open = false; + ImGui::EndMenu(); + } + if (ImGui::BeginMenu("Edit")) + { + if (ImGui::MenuItem("Delete", "Del", false, Selection.Size > 0)) + RequestDelete = true; + ImGui::EndMenu(); + } + if (ImGui::BeginMenu("Options")) + { + ImGui::PushItemWidth(ImGui::GetFontSize() * 10); + + ImGui::SeparatorText("Contents"); + ImGui::Checkbox("Show Type Overlay", &ShowTypeOverlay); + ImGui::Checkbox("Allow Sorting", &AllowSorting); + + ImGui::SeparatorText("Selection Behavior"); + ImGui::Checkbox("Allow dragging unselected item", &AllowDragUnselected); + ImGui::Checkbox("Allow box-selection", &AllowBoxSelect); + + ImGui::SeparatorText("Layout"); + ImGui::SliderFloat("Icon Size", &IconSize, 16.0f, 128.0f, "%.0f"); + ImGui::SameLine(); HelpMarker("Use CTRL+Wheel to zoom"); + ImGui::SliderInt("Icon Spacing", &IconSpacing, 0, 32); + ImGui::SliderInt("Icon Hit Spacing", &IconHitSpacing, 0, 32); + ImGui::Checkbox("Stretch Spacing", &StretchSpacing); + ImGui::PopItemWidth(); + ImGui::EndMenu(); + } + ImGui::EndMenuBar(); + } + + // Show a table with ONLY one header row to showcase the idea/possibility of using this to provide a sorting UI + if (AllowSorting) + { + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); + ImGuiTableFlags table_flags_for_sort_specs = ImGuiTableFlags_Sortable | ImGuiTableFlags_SortMulti | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Borders; + if (ImGui::BeginTable("for_sort_specs_only", 2, table_flags_for_sort_specs, ImVec2(0.0f, ImGui::GetFrameHeight()))) + { + ImGui::TableSetupColumn("Index"); + ImGui::TableSetupColumn("Type"); + ImGui::TableHeadersRow(); + if (ImGuiTableSortSpecs* sort_specs = ImGui::TableGetSortSpecs()) + if (sort_specs->SpecsDirty || RequestSort) + { + ExampleAsset::SortWithSortSpecs(sort_specs, Items.Data, Items.Size); + sort_specs->SpecsDirty = RequestSort = false; + } + ImGui::EndTable(); + } + ImGui::PopStyleVar(); + } + + ImGuiIO& io = ImGui::GetIO(); + ImGui::SetNextWindowContentSize(ImVec2(0.0f, LayoutOuterPadding + LayoutLineCount * (LayoutItemSize.x + LayoutItemSpacing))); + if (ImGui::BeginChild("Assets", ImVec2(0.0f, -ImGui::GetTextLineHeightWithSpacing()), ImGuiChildFlags_Borders, ImGuiWindowFlags_NoMove)) + { + ImDrawList* draw_list = ImGui::GetWindowDrawList(); + + const float avail_width = ImGui::GetContentRegionAvail().x; + UpdateLayoutSizes(avail_width); + + // Calculate and store start position. + ImVec2 start_pos = ImGui::GetCursorScreenPos(); + start_pos = ImVec2(start_pos.x + LayoutOuterPadding, start_pos.y + LayoutOuterPadding); + ImGui::SetCursorScreenPos(start_pos); + + // Multi-select + ImGuiMultiSelectFlags ms_flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_ClearOnClickVoid; + + // - Enable box-select (in 2D mode, so that changing box-select rectangle X1/X2 boundaries will affect clipped items) + if (AllowBoxSelect) + ms_flags |= ImGuiMultiSelectFlags_BoxSelect2d; + + // - This feature allows dragging an unselected item without selecting it (rarely used) + if (AllowDragUnselected) + ms_flags |= ImGuiMultiSelectFlags_SelectOnClickRelease; + + // - Enable keyboard wrapping on X axis + // (FIXME-MULTISELECT: We haven't designed/exposed a general nav wrapping api yet, so this flag is provided as a courtesy to avoid doing: + // ImGui::NavMoveRequestTryWrapping(ImGui::GetCurrentWindow(), ImGuiNavMoveFlags_WrapX); + // When we finish implementing a more general API for this, we will obsolete this flag in favor of the new system) + ms_flags |= ImGuiMultiSelectFlags_NavWrapX; + + ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(ms_flags, Selection.Size, Items.Size); + + // Use custom selection adapter: store ID in selection (recommended) + Selection.UserData = this; + Selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self_, int idx) { ExampleAssetsBrowser* self = (ExampleAssetsBrowser*)self_->UserData; return self->Items[idx].ID; }; + Selection.ApplyRequests(ms_io); + + const bool want_delete = (ImGui::Shortcut(ImGuiKey_Delete, ImGuiInputFlags_Repeat) && (Selection.Size > 0)) || RequestDelete; + const int item_curr_idx_to_focus = want_delete ? Selection.ApplyDeletionPreLoop(ms_io, Items.Size) : -1; + RequestDelete = false; + + // Push LayoutSelectableSpacing (which is LayoutItemSpacing minus hit-spacing, if we decide to have hit gaps between items) + // Altering style ItemSpacing may seem unnecessary as we position every items using SetCursorScreenPos()... + // But it is necessary for two reasons: + // - Selectables uses it by default to visually fill the space between two items. + // - The vertical spacing would be measured by Clipper to calculate line height if we didn't provide it explicitly (here we do). + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(LayoutSelectableSpacing, LayoutSelectableSpacing)); + + // Rendering parameters + const ImU32 icon_type_overlay_colors[3] = { 0, IM_COL32(200, 70, 70, 255), IM_COL32(70, 170, 70, 255) }; + const ImU32 icon_bg_color = ImGui::GetColorU32(ImGuiCol_MenuBarBg); + const ImVec2 icon_type_overlay_size = ImVec2(4.0f, 4.0f); + const bool display_label = (LayoutItemSize.x >= ImGui::CalcTextSize("999").x); + + const int column_count = LayoutColumnCount; + ImGuiListClipper clipper; + clipper.Begin(LayoutLineCount, LayoutItemStep.y); + if (item_curr_idx_to_focus != -1) + clipper.IncludeItemByIndex(item_curr_idx_to_focus / column_count); // Ensure focused item line is not clipped. + if (ms_io->RangeSrcItem != -1) + clipper.IncludeItemByIndex((int)ms_io->RangeSrcItem / column_count); // Ensure RangeSrc item line is not clipped. + while (clipper.Step()) + { + for (int line_idx = clipper.DisplayStart; line_idx < clipper.DisplayEnd; line_idx++) + { + const int item_min_idx_for_current_line = line_idx * column_count; + const int item_max_idx_for_current_line = IM_MIN((line_idx + 1) * column_count, Items.Size); + for (int item_idx = item_min_idx_for_current_line; item_idx < item_max_idx_for_current_line; ++item_idx) + { + ExampleAsset* item_data = &Items[item_idx]; + ImGui::PushID((int)item_data->ID); + + // Position item + ImVec2 pos = ImVec2(start_pos.x + (item_idx % column_count) * LayoutItemStep.x, start_pos.y + line_idx * LayoutItemStep.y); + ImGui::SetCursorScreenPos(pos); + + ImGui::SetNextItemSelectionUserData(item_idx); + bool item_is_selected = Selection.Contains((ImGuiID)item_data->ID); + bool item_is_visible = ImGui::IsRectVisible(LayoutItemSize); + ImGui::Selectable("", item_is_selected, ImGuiSelectableFlags_None, LayoutItemSize); + + // Update our selection state immediately (without waiting for EndMultiSelect() requests) + // because we use this to alter the color of our text/icon. + if (ImGui::IsItemToggledSelection()) + item_is_selected = !item_is_selected; + + // Focus (for after deletion) + if (item_curr_idx_to_focus == item_idx) + ImGui::SetKeyboardFocusHere(-1); + + // Drag and drop + if (ImGui::BeginDragDropSource()) + { + // Create payload with full selection OR single unselected item. + // (the later is only possible when using ImGuiMultiSelectFlags_SelectOnClickRelease) + if (ImGui::GetDragDropPayload() == NULL) + { + ImVector payload_items; + void* it = NULL; + ImGuiID id = 0; + if (!item_is_selected) + payload_items.push_back(item_data->ID); + else + while (Selection.GetNextSelectedItem(&it, &id)) + payload_items.push_back(id); + ImGui::SetDragDropPayload("ASSETS_BROWSER_ITEMS", payload_items.Data, (size_t)payload_items.size_in_bytes()); + } + + // Display payload content in tooltip, by extracting it from the payload data + // (we could read from selection, but it is more correct and reusable to read from payload) + const ImGuiPayload* payload = ImGui::GetDragDropPayload(); + const int payload_count = (int)payload->DataSize / (int)sizeof(ImGuiID); + ImGui::Text("%d assets", payload_count); + + ImGui::EndDragDropSource(); + } + + // Render icon (a real app would likely display an image/thumbnail here) + // Because we use ImGuiMultiSelectFlags_BoxSelect2d, clipping vertical may occasionally be larger, so we coarse-clip our rendering as well. + if (item_is_visible) + { + ImVec2 box_min(pos.x - 1, pos.y - 1); + ImVec2 box_max(box_min.x + LayoutItemSize.x + 2, box_min.y + LayoutItemSize.y + 2); // Dubious + draw_list->AddRectFilled(box_min, box_max, icon_bg_color); // Background color + if (ShowTypeOverlay && item_data->Type != 0) + { + ImU32 type_col = icon_type_overlay_colors[item_data->Type % IM_ARRAYSIZE(icon_type_overlay_colors)]; + draw_list->AddRectFilled(ImVec2(box_max.x - 2 - icon_type_overlay_size.x, box_min.y + 2), ImVec2(box_max.x - 2, box_min.y + 2 + icon_type_overlay_size.y), type_col); + } + if (display_label) + { + ImU32 label_col = ImGui::GetColorU32(item_is_selected ? ImGuiCol_Text : ImGuiCol_TextDisabled); + char label[32]; + sprintf(label, "%d", item_data->ID); + draw_list->AddText(ImVec2(box_min.x, box_max.y - ImGui::GetFontSize()), label_col, label); + } + } + + ImGui::PopID(); + } + } + } + clipper.End(); + ImGui::PopStyleVar(); // ImGuiStyleVar_ItemSpacing + + // Context menu + if (ImGui::BeginPopupContextWindow()) + { + ImGui::Text("Selection: %d items", Selection.Size); + ImGui::Separator(); + if (ImGui::MenuItem("Delete", "Del", false, Selection.Size > 0)) + RequestDelete = true; + ImGui::EndPopup(); + } + + ms_io = ImGui::EndMultiSelect(); + Selection.ApplyRequests(ms_io); + if (want_delete) + Selection.ApplyDeletionPostLoop(ms_io, Items, item_curr_idx_to_focus); + + // Zooming with CTRL+Wheel + if (ImGui::IsWindowAppearing()) + ZoomWheelAccum = 0.0f; + if (ImGui::IsWindowHovered() && io.MouseWheel != 0.0f && ImGui::IsKeyDown(ImGuiMod_Ctrl) && ImGui::IsAnyItemActive() == false) + { + ZoomWheelAccum += io.MouseWheel; + if (fabsf(ZoomWheelAccum) >= 1.0f) + { + // Calculate hovered item index from mouse location + // FIXME: Locking aiming on 'hovered_item_idx' (with a cool-down timer) would ensure zoom keeps on it. + const float hovered_item_nx = (io.MousePos.x - start_pos.x + LayoutItemSpacing * 0.5f) / LayoutItemStep.x; + const float hovered_item_ny = (io.MousePos.y - start_pos.y + LayoutItemSpacing * 0.5f) / LayoutItemStep.y; + const int hovered_item_idx = ((int)hovered_item_ny * LayoutColumnCount) + (int)hovered_item_nx; + //ImGui::SetTooltip("%f,%f -> item %d", hovered_item_nx, hovered_item_ny, hovered_item_idx); // Move those 4 lines in block above for easy debugging + + // Zoom + IconSize *= powf(1.1f, (float)(int)ZoomWheelAccum); + IconSize = IM_CLAMP(IconSize, 16.0f, 128.0f); + ZoomWheelAccum -= (int)ZoomWheelAccum; + UpdateLayoutSizes(avail_width); + + // Manipulate scroll to that we will land at the same Y location of currently hovered item. + // - Calculate next frame position of item under mouse + // - Set new scroll position to be used in next ImGui::BeginChild() call. + float hovered_item_rel_pos_y = ((float)(hovered_item_idx / LayoutColumnCount) + fmodf(hovered_item_ny, 1.0f)) * LayoutItemStep.y; + hovered_item_rel_pos_y += ImGui::GetStyle().WindowPadding.y; + float mouse_local_y = io.MousePos.y - ImGui::GetWindowPos().y; + ImGui::SetScrollY(hovered_item_rel_pos_y - mouse_local_y); + } + } + } + ImGui::EndChild(); + + ImGui::Text("Selected: %d/%d items", Selection.Size, Items.Size); + ImGui::End(); + } +}; + +void ShowExampleAppAssetsBrowser(bool* p_open) +{ + IMGUI_DEMO_MARKER("Examples/Assets Browser"); + static ExampleAssetsBrowser assets_browser; + assets_browser.Draw("Example: Assets Browser", p_open); +} + // End of Demo code #else diff --git a/bgfx/3rdparty/dear-imgui/imgui_draw.cpp b/bgfx/3rdparty/dear-imgui/imgui_draw.cpp index 205ce76f..2fba4993 100644 --- a/bgfx/3rdparty/dear-imgui/imgui_draw.cpp +++ b/bgfx/3rdparty/dear-imgui/imgui_draw.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.9 +// dear imgui, v1.91.4 // (drawing and font code) /* @@ -8,6 +8,7 @@ Index of this file: // [SECTION] STB libraries implementation // [SECTION] Style functions // [SECTION] ImDrawList +// [SECTION] ImTriangulator, ImDrawList concave polygon fill // [SECTION] ImDrawListSplitter // [SECTION] ImDrawData // [SECTION] Helpers ShadeVertsXXX functions @@ -64,6 +65,7 @@ Index of this file: #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision #pragma clang diagnostic ignored "-Wreserved-identifier" // warning: identifier '_Xxx' is reserved because it starts with '_' followed by a capital letter +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access #elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind #pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used @@ -135,7 +137,7 @@ namespace IMGUI_STB_NAMESPACE #define STBTT_sqrt(x) ImSqrt(x) #define STBTT_pow(x,y) ImPow(x,y) #define STBTT_fabs(x) ImFabs(x) -#define STBTT_ifloor(x) ((int)ImFloorSigned(x)) +#define STBTT_ifloor(x) ((int)ImFloor(x)) #define STBTT_iceil(x) ((int)ImCeil(x)) #define STBTT_STATIC #define STB_TRUETYPE_IMPLEMENTATION @@ -209,11 +211,13 @@ void ImGui::StyleColorsDark(ImGuiStyle* dst) colors[ImGuiCol_ResizeGrip] = ImVec4(0.26f, 0.59f, 0.98f, 0.20f); colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); - colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f); colors[ImGuiCol_TabHovered] = colors[ImGuiCol_HeaderHovered]; - colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f); - colors[ImGuiCol_TabUnfocused] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); - colors[ImGuiCol_TabUnfocusedActive] = ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f); + colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f); + colors[ImGuiCol_TabSelected] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f); + colors[ImGuiCol_TabSelectedOverline] = colors[ImGuiCol_HeaderActive]; + colors[ImGuiCol_TabDimmed] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); + colors[ImGuiCol_TabDimmedSelected] = ImLerp(colors[ImGuiCol_TabSelected], colors[ImGuiCol_TitleBg], 0.40f); + colors[ImGuiCol_TabDimmedSelectedOverline] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f); colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f); colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f); colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); @@ -223,9 +227,10 @@ void ImGui::StyleColorsDark(ImGuiStyle* dst) colors[ImGuiCol_TableBorderLight] = ImVec4(0.23f, 0.23f, 0.25f, 1.00f); // Prefer using Alpha=1.0 here colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.06f); + colors[ImGuiCol_TextLink] = colors[ImGuiCol_HeaderActive]; colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f); colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); - colors[ImGuiCol_NavHighlight] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_NavCursor] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f); @@ -269,11 +274,13 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst) colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f); colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.78f, 0.82f, 1.00f, 0.60f); colors[ImGuiCol_ResizeGripActive] = ImVec4(0.78f, 0.82f, 1.00f, 0.90f); - colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f); colors[ImGuiCol_TabHovered] = colors[ImGuiCol_HeaderHovered]; - colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f); - colors[ImGuiCol_TabUnfocused] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); - colors[ImGuiCol_TabUnfocusedActive] = ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f); + colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f); + colors[ImGuiCol_TabSelected] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f); + colors[ImGuiCol_TabSelectedOverline] = colors[ImGuiCol_HeaderActive]; + colors[ImGuiCol_TabDimmed] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); + colors[ImGuiCol_TabDimmedSelected] = ImLerp(colors[ImGuiCol_TabSelected], colors[ImGuiCol_TitleBg], 0.40f); + colors[ImGuiCol_TabDimmedSelectedOverline] = colors[ImGuiCol_HeaderActive]; colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); @@ -283,9 +290,10 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst) colors[ImGuiCol_TableBorderLight] = ImVec4(0.26f, 0.26f, 0.28f, 1.00f); // Prefer using Alpha=1.0 here colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.07f); + colors[ImGuiCol_TextLink] = colors[ImGuiCol_HeaderActive]; colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f); colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); - colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered]; + colors[ImGuiCol_NavCursor] = colors[ImGuiCol_HeaderHovered]; colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); @@ -330,11 +338,13 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst) colors[ImGuiCol_ResizeGrip] = ImVec4(0.35f, 0.35f, 0.35f, 0.17f); colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); - colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.90f); colors[ImGuiCol_TabHovered] = colors[ImGuiCol_HeaderHovered]; - colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f); - colors[ImGuiCol_TabUnfocused] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); - colors[ImGuiCol_TabUnfocusedActive] = ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f); + colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.90f); + colors[ImGuiCol_TabSelected] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f); + colors[ImGuiCol_TabSelectedOverline] = colors[ImGuiCol_HeaderActive]; + colors[ImGuiCol_TabDimmed] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); + colors[ImGuiCol_TabDimmedSelected] = ImLerp(colors[ImGuiCol_TabSelected], colors[ImGuiCol_TitleBg], 0.40f); + colors[ImGuiCol_TabDimmedSelectedOverline] = ImVec4(0.26f, 0.59f, 1.00f, 1.00f); colors[ImGuiCol_PlotLines] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f); colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f); colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); @@ -344,9 +354,10 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst) colors[ImGuiCol_TableBorderLight] = ImVec4(0.68f, 0.68f, 0.74f, 1.00f); // Prefer using Alpha=1.0 here colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); colors[ImGuiCol_TableRowBgAlt] = ImVec4(0.30f, 0.30f, 0.30f, 0.09f); + colors[ImGuiCol_TextLink] = colors[ImGuiCol_HeaderActive]; colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f); colors[ImGuiCol_DragDropTarget] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); - colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered]; + colors[ImGuiCol_NavCursor] = colors[ImGuiCol_HeaderHovered]; colors[ImGuiCol_NavWindowingHighlight] = ImVec4(0.70f, 0.70f, 0.70f, 0.70f); colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.20f); colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); @@ -383,12 +394,13 @@ void ImDrawListSharedData::SetCircleTessellationMaxError(float max_error) } // Initialize before use in a new frame. We always have a command ready in the buffer. +// In the majority of cases, you would want to call PushClipRect() and PushTextureID() after this. void ImDrawList::_ResetForNewFrame() { // Verify that the ImDrawCmd fields we want to memcmp() are contiguous in memory. - IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0); - IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4)); - IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID)); + IM_STATIC_ASSERT(offsetof(ImDrawCmd, ClipRect) == 0); + IM_STATIC_ASSERT(offsetof(ImDrawCmd, TextureId) == sizeof(ImVec4)); + IM_STATIC_ASSERT(offsetof(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID)); if (_Splitter._Count > 1) _Splitter.Merge(this); @@ -402,6 +414,7 @@ void ImDrawList::_ResetForNewFrame() _IdxWritePtr = NULL; _ClipRectStack.resize(0); _TextureIdStack.resize(0); + _CallbacksDataBuf.resize(0); _Path.resize(0); _Splitter.Clear(); CmdBuffer.push_back(ImDrawCmd()); @@ -419,6 +432,7 @@ void ImDrawList::_ClearFreeMemory() _IdxWritePtr = NULL; _ClipRectStack.clear(); _TextureIdStack.clear(); + _CallbacksDataBuf.clear(); _Path.clear(); _Splitter.ClearFreeMemory(); } @@ -458,7 +472,7 @@ void ImDrawList::_PopUnusedDrawCmd() } } -void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data) +void ImDrawList::AddCallback(ImDrawCallback callback, void* userdata, size_t userdata_size) { IM_ASSERT_PARANOID(CmdBuffer.Size > 0); ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1]; @@ -468,14 +482,32 @@ void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data) AddDrawCmd(); curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1]; } + curr_cmd->UserCallback = callback; - curr_cmd->UserCallbackData = callback_data; + if (userdata_size == 0) + { + // Store user data directly in command (no indirection) + curr_cmd->UserCallbackData = userdata; + curr_cmd->UserCallbackDataSize = 0; + curr_cmd->UserCallbackDataOffset = -1; + } + else + { + // Copy and store user data in a buffer + IM_ASSERT(userdata != NULL); + IM_ASSERT(userdata_size < (1u << 31)); + curr_cmd->UserCallbackData = NULL; // Will be resolved during Render() + curr_cmd->UserCallbackDataSize = (int)userdata_size; + curr_cmd->UserCallbackDataOffset = _CallbacksDataBuf.Size; + _CallbacksDataBuf.resize(_CallbacksDataBuf.Size + (int)userdata_size); + memcpy(_CallbacksDataBuf.Data + (size_t)curr_cmd->UserCallbackDataOffset, userdata, userdata_size); + } AddDrawCmd(); // Force a new command after us (see comment below) } // Compare ClipRect, TextureId and VtxOffset with a single memcmp() -#define ImDrawCmd_HeaderSize (IM_OFFSETOF(ImDrawCmd, VtxOffset) + sizeof(unsigned int)) +#define ImDrawCmd_HeaderSize (offsetof(ImDrawCmd, VtxOffset) + sizeof(unsigned int)) #define ImDrawCmd_HeaderCompare(CMD_LHS, CMD_RHS) (memcmp(CMD_LHS, CMD_RHS, ImDrawCmd_HeaderSize)) // Compare ClipRect, TextureId, VtxOffset #define ImDrawCmd_HeaderCopy(CMD_DST, CMD_SRC) (memcpy(CMD_DST, CMD_SRC, ImDrawCmd_HeaderSize)) // Copy ClipRect, TextureId, VtxOffset #define ImDrawCmd_AreSequentialIdxOffset(CMD_0, CMD_1) (CMD_0->IdxOffset + CMD_0->ElemCount == CMD_1->IdxOffset) @@ -514,7 +546,6 @@ void ImDrawList::_OnChangedClipRect() CmdBuffer.pop_back(); return; } - curr_cmd->ClipRect = _CmdHeader.ClipRect; } @@ -537,7 +568,6 @@ void ImDrawList::_OnChangedTextureID() CmdBuffer.pop_back(); return; } - curr_cmd->TextureId = _CmdHeader.TextureId; } @@ -613,6 +643,15 @@ void ImDrawList::PopTextureID() _OnChangedTextureID(); } +// This is used by ImGui::PushFont()/PopFont(). It works because we never use _TextureIdStack[] elsewhere than in PushTextureID()/PopTextureID(). +void ImDrawList::_SetTextureID(ImTextureID texture_id) +{ + if (_CmdHeader.TextureId == texture_id) + return; + _CmdHeader.TextureId = texture_id; + _OnChangedTextureID(); +} + // Reserve space for a number of vertices and indices. // You must finish filling your reserved data before calling PrimReserve() again, as it may reallocate or // submit the intermediate results. PrimUnreserve() can be used to release unused allocations. @@ -641,7 +680,7 @@ void ImDrawList::PrimReserve(int idx_count, int vtx_count) _IdxWritePtr = IdxBuffer.Data + idx_buffer_old_size; } -// Release the a number of reserved vertices/indices from the end of the last reservation made with PrimReserve(). +// Release the number of reserved vertices/indices from the end of the last reservation made with PrimReserve(). void ImDrawList::PrimUnreserve(int idx_count, int vtx_count) { IM_ASSERT_PARANOID(idx_count >= 0 && vtx_count >= 0); @@ -1191,8 +1230,8 @@ void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, floa const float a_min_sample_f = IM_DRAWLIST_ARCFAST_SAMPLE_MAX * a_min / (IM_PI * 2.0f); const float a_max_sample_f = IM_DRAWLIST_ARCFAST_SAMPLE_MAX * a_max / (IM_PI * 2.0f); - const int a_min_sample = a_is_reverse ? (int)ImFloorSigned(a_min_sample_f) : (int)ImCeil(a_min_sample_f); - const int a_max_sample = a_is_reverse ? (int)ImCeil(a_max_sample_f) : (int)ImFloorSigned(a_max_sample_f); + const int a_min_sample = a_is_reverse ? (int)ImFloor(a_min_sample_f) : (int)ImCeil(a_min_sample_f); + const int a_max_sample = a_is_reverse ? (int)ImCeil(a_max_sample_f) : (int)ImFloor(a_max_sample_f); const int a_mid_samples = a_is_reverse ? ImMax(a_min_sample - a_max_sample, 0) : ImMax(a_max_sample - a_min_sample, 0); const float a_min_segment_angle = a_min_sample * IM_PI * 2.0f / IM_DRAWLIST_ARCFAST_SAMPLE_MAX; @@ -1217,6 +1256,26 @@ void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, floa } } +void ImDrawList::PathEllipticalArcTo(const ImVec2& center, const ImVec2& radius, float rot, float a_min, float a_max, int num_segments) +{ + if (num_segments <= 0) + num_segments = _CalcCircleAutoSegmentCount(ImMax(radius.x, radius.y)); // A bit pessimistic, maybe there's a better computation to do here. + + _Path.reserve(_Path.Size + (num_segments + 1)); + + const float cos_rot = ImCos(rot); + const float sin_rot = ImSin(rot); + for (int i = 0; i <= num_segments; i++) + { + const float a = a_min + ((float)i / (float)num_segments) * (a_max - a_min); + ImVec2 point(ImCos(a) * radius.x, ImSin(a) * radius.y); + const ImVec2 rel((point.x * cos_rot) - (point.y * sin_rot), (point.x * sin_rot) + (point.y * cos_rot)); + point.x = rel.x + center.x; + point.y = rel.y + center.y; + _Path.push_back(point); + } +} + ImVec2 ImBezierCubicCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t) { float u = 1.0f - t; @@ -1312,33 +1371,22 @@ void ImDrawList::PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, } } -IM_STATIC_ASSERT(ImDrawFlags_RoundCornersTopLeft == (1 << 4)); static inline ImDrawFlags FixRectCornerFlags(ImDrawFlags flags) { + /* + IM_STATIC_ASSERT(ImDrawFlags_RoundCornersTopLeft == (1 << 4)); #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - // Obsoleted in 1.82 (from February 2021) - // Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All) - // ~0 --> ImDrawFlags_RoundCornersAll or 0 - if (flags == ~0) - return ImDrawFlags_RoundCornersAll; - - // Legacy Support for hard coded 0x01 to 0x0F (matching 15 out of 16 old flags combinations) - // 0x01 --> ImDrawFlags_RoundCornersTopLeft (VALUE 0x01 OVERLAPS ImDrawFlags_Closed but ImDrawFlags_Closed is never valid in this path!) - // 0x02 --> ImDrawFlags_RoundCornersTopRight - // 0x03 --> ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight - // 0x04 --> ImDrawFlags_RoundCornersBotLeft - // 0x05 --> ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersBotLeft - // ... - // 0x0F --> ImDrawFlags_RoundCornersAll or 0 - // (See all values in ImDrawCornerFlags_) - if (flags >= 0x01 && flags <= 0x0F) - return (flags << 4); - + // Obsoleted in 1.82 (from February 2021). This code was stripped/simplified and mostly commented in 1.90 (from September 2023) + // - Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All) + if (flags == ~0) { return ImDrawFlags_RoundCornersAll; } + // - Legacy Support for hard coded 0x01 to 0x0F (matching 15 out of 16 old flags combinations). Read details in older version of this code. + if (flags >= 0x01 && flags <= 0x0F) { return (flags << 4); } // We cannot support hard coded 0x00 with 'float rounding > 0.0f' --> replace with ImDrawFlags_RoundCornersNone or use 'float rounding = 0.0f' #endif - - // If this triggers, please update your code replacing hardcoded values with new ImDrawFlags_RoundCorners* values. - // Note that ImDrawFlags_Closed (== 0x01) is an invalid flag for AddRect(), AddRectFilled(), PathRect() etc... + */ + // If this assert triggers, please update your code replacing hardcoded values with new ImDrawFlags_RoundCorners* values. + // Note that ImDrawFlags_Closed (== 0x01) is an invalid flag for AddRect(), AddRectFilled(), PathRect() etc. anyway. + // See details in 1.82 Changelog as well as 2021/03/12 and 2023/09/08 entries in "API BREAKING CHANGES" section. IM_ASSERT((flags & 0x0F) == 0 && "Misuse of legacy hardcoded ImDrawCornerFlags values!"); if ((flags & ImDrawFlags_RoundCornersMask_) == 0) @@ -1547,6 +1595,35 @@ void ImDrawList::AddNgonFilled(const ImVec2& center, float radius, ImU32 col, in PathFillConvex(col); } +// Ellipse +void ImDrawList::AddEllipse(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot, int num_segments, float thickness) +{ + if ((col & IM_COL32_A_MASK) == 0) + return; + + if (num_segments <= 0) + num_segments = _CalcCircleAutoSegmentCount(ImMax(radius.x, radius.y)); // A bit pessimistic, maybe there's a better computation to do here. + + // Because we are filling a closed shape we remove 1 from the count of segments/points + const float a_max = IM_PI * 2.0f * ((float)num_segments - 1.0f) / (float)num_segments; + PathEllipticalArcTo(center, radius, rot, 0.0f, a_max, num_segments - 1); + PathStroke(col, true, thickness); +} + +void ImDrawList::AddEllipseFilled(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot, int num_segments) +{ + if ((col & IM_COL32_A_MASK) == 0) + return; + + if (num_segments <= 0) + num_segments = _CalcCircleAutoSegmentCount(ImMax(radius.x, radius.y)); // A bit pessimistic, maybe there's a better computation to do here. + + // Because we are filling a closed shape we remove 1 from the count of segments/points + const float a_max = IM_PI * 2.0f * ((float)num_segments - 1.0f) / (float)num_segments; + PathEllipticalArcTo(center, radius, rot, 0.0f, a_max, num_segments - 1); + PathFillConvex(col); +} + // Cubic Bezier takes 4 controls points void ImDrawList::AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments) { @@ -1574,10 +1651,11 @@ void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos, if ((col & IM_COL32_A_MASK) == 0) return; + // Accept null ranges + if (text_begin == text_end || text_begin[0] == 0) + return; if (text_end == NULL) text_end = text_begin + strlen(text_begin); - if (text_begin == text_end) - return; // Pull default font/size from the shared ImDrawListSharedData instance if (font == NULL) @@ -1661,6 +1739,316 @@ void ImDrawList::AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_mi PopTextureID(); } +//----------------------------------------------------------------------------- +// [SECTION] ImTriangulator, ImDrawList concave polygon fill +//----------------------------------------------------------------------------- +// Triangulate concave polygons. Based on "Triangulation by Ear Clipping" paper, O(N^2) complexity. +// Reference: https://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf +// Provided as a convenience for user but not used by main library. +//----------------------------------------------------------------------------- +// - ImTriangulator [Internal] +// - AddConcavePolyFilled() +//----------------------------------------------------------------------------- + +enum ImTriangulatorNodeType +{ + ImTriangulatorNodeType_Convex, + ImTriangulatorNodeType_Ear, + ImTriangulatorNodeType_Reflex +}; + +struct ImTriangulatorNode +{ + ImTriangulatorNodeType Type; + int Index; + ImVec2 Pos; + ImTriangulatorNode* Next; + ImTriangulatorNode* Prev; + + void Unlink() { Next->Prev = Prev; Prev->Next = Next; } +}; + +struct ImTriangulatorNodeSpan +{ + ImTriangulatorNode** Data = NULL; + int Size = 0; + + void push_back(ImTriangulatorNode* node) { Data[Size++] = node; } + void find_erase_unsorted(int idx) { for (int i = Size - 1; i >= 0; i--) if (Data[i]->Index == idx) { Data[i] = Data[Size - 1]; Size--; return; } } +}; + +struct ImTriangulator +{ + static int EstimateTriangleCount(int points_count) { return (points_count < 3) ? 0 : points_count - 2; } + static int EstimateScratchBufferSize(int points_count) { return sizeof(ImTriangulatorNode) * points_count + sizeof(ImTriangulatorNode*) * points_count * 2; } + + void Init(const ImVec2* points, int points_count, void* scratch_buffer); + void GetNextTriangle(unsigned int out_triangle[3]); // Return relative indexes for next triangle + + // Internal functions + void BuildNodes(const ImVec2* points, int points_count); + void BuildReflexes(); + void BuildEars(); + void FlipNodeList(); + bool IsEar(int i0, int i1, int i2, const ImVec2& v0, const ImVec2& v1, const ImVec2& v2) const; + void ReclassifyNode(ImTriangulatorNode* node); + + // Internal members + int _TrianglesLeft = 0; + ImTriangulatorNode* _Nodes = NULL; + ImTriangulatorNodeSpan _Ears; + ImTriangulatorNodeSpan _Reflexes; +}; + +// Distribute storage for nodes, ears and reflexes. +// FIXME-OPT: if everything is convex, we could report it to caller and let it switch to an convex renderer +// (this would require first building reflexes to bail to convex if empty, without even building nodes) +void ImTriangulator::Init(const ImVec2* points, int points_count, void* scratch_buffer) +{ + IM_ASSERT(scratch_buffer != NULL && points_count >= 3); + _TrianglesLeft = EstimateTriangleCount(points_count); + _Nodes = (ImTriangulatorNode*)scratch_buffer; // points_count x Node + _Ears.Data = (ImTriangulatorNode**)(_Nodes + points_count); // points_count x Node* + _Reflexes.Data = (ImTriangulatorNode**)(_Nodes + points_count) + points_count; // points_count x Node* + BuildNodes(points, points_count); + BuildReflexes(); + BuildEars(); +} + +void ImTriangulator::BuildNodes(const ImVec2* points, int points_count) +{ + for (int i = 0; i < points_count; i++) + { + _Nodes[i].Type = ImTriangulatorNodeType_Convex; + _Nodes[i].Index = i; + _Nodes[i].Pos = points[i]; + _Nodes[i].Next = _Nodes + i + 1; + _Nodes[i].Prev = _Nodes + i - 1; + } + _Nodes[0].Prev = _Nodes + points_count - 1; + _Nodes[points_count - 1].Next = _Nodes; +} + +void ImTriangulator::BuildReflexes() +{ + ImTriangulatorNode* n1 = _Nodes; + for (int i = _TrianglesLeft; i >= 0; i--, n1 = n1->Next) + { + if (ImTriangleIsClockwise(n1->Prev->Pos, n1->Pos, n1->Next->Pos)) + continue; + n1->Type = ImTriangulatorNodeType_Reflex; + _Reflexes.push_back(n1); + } +} + +void ImTriangulator::BuildEars() +{ + ImTriangulatorNode* n1 = _Nodes; + for (int i = _TrianglesLeft; i >= 0; i--, n1 = n1->Next) + { + if (n1->Type != ImTriangulatorNodeType_Convex) + continue; + if (!IsEar(n1->Prev->Index, n1->Index, n1->Next->Index, n1->Prev->Pos, n1->Pos, n1->Next->Pos)) + continue; + n1->Type = ImTriangulatorNodeType_Ear; + _Ears.push_back(n1); + } +} + +void ImTriangulator::GetNextTriangle(unsigned int out_triangle[3]) +{ + if (_Ears.Size == 0) + { + FlipNodeList(); + + ImTriangulatorNode* node = _Nodes; + for (int i = _TrianglesLeft; i >= 0; i--, node = node->Next) + node->Type = ImTriangulatorNodeType_Convex; + _Reflexes.Size = 0; + BuildReflexes(); + BuildEars(); + + // If we still don't have ears, it means geometry is degenerated. + if (_Ears.Size == 0) + { + // Return first triangle available, mimicking the behavior of convex fill. + IM_ASSERT(_TrianglesLeft > 0); // Geometry is degenerated + _Ears.Data[0] = _Nodes; + _Ears.Size = 1; + } + } + + ImTriangulatorNode* ear = _Ears.Data[--_Ears.Size]; + out_triangle[0] = ear->Prev->Index; + out_triangle[1] = ear->Index; + out_triangle[2] = ear->Next->Index; + + ear->Unlink(); + if (ear == _Nodes) + _Nodes = ear->Next; + + ReclassifyNode(ear->Prev); + ReclassifyNode(ear->Next); + _TrianglesLeft--; +} + +void ImTriangulator::FlipNodeList() +{ + ImTriangulatorNode* prev = _Nodes; + ImTriangulatorNode* temp = _Nodes; + ImTriangulatorNode* current = _Nodes->Next; + prev->Next = prev; + prev->Prev = prev; + while (current != _Nodes) + { + temp = current->Next; + + current->Next = prev; + prev->Prev = current; + _Nodes->Next = current; + current->Prev = _Nodes; + + prev = current; + current = temp; + } + _Nodes = prev; +} + +// A triangle is an ear is no other vertex is inside it. We can test reflexes vertices only (see reference algorithm) +bool ImTriangulator::IsEar(int i0, int i1, int i2, const ImVec2& v0, const ImVec2& v1, const ImVec2& v2) const +{ + ImTriangulatorNode** p_end = _Reflexes.Data + _Reflexes.Size; + for (ImTriangulatorNode** p = _Reflexes.Data; p < p_end; p++) + { + ImTriangulatorNode* reflex = *p; + if (reflex->Index != i0 && reflex->Index != i1 && reflex->Index != i2) + if (ImTriangleContainsPoint(v0, v1, v2, reflex->Pos)) + return false; + } + return true; +} + +void ImTriangulator::ReclassifyNode(ImTriangulatorNode* n1) +{ + // Classify node + ImTriangulatorNodeType type; + const ImTriangulatorNode* n0 = n1->Prev; + const ImTriangulatorNode* n2 = n1->Next; + if (!ImTriangleIsClockwise(n0->Pos, n1->Pos, n2->Pos)) + type = ImTriangulatorNodeType_Reflex; + else if (IsEar(n0->Index, n1->Index, n2->Index, n0->Pos, n1->Pos, n2->Pos)) + type = ImTriangulatorNodeType_Ear; + else + type = ImTriangulatorNodeType_Convex; + + // Update lists when a type changes + if (type == n1->Type) + return; + if (n1->Type == ImTriangulatorNodeType_Reflex) + _Reflexes.find_erase_unsorted(n1->Index); + else if (n1->Type == ImTriangulatorNodeType_Ear) + _Ears.find_erase_unsorted(n1->Index); + if (type == ImTriangulatorNodeType_Reflex) + _Reflexes.push_back(n1); + else if (type == ImTriangulatorNodeType_Ear) + _Ears.push_back(n1); + n1->Type = type; +} + +// Use ear-clipping algorithm to triangulate a simple polygon (no self-interaction, no holes). +// (Reminder: we don't perform any coarse clipping/culling in ImDrawList layer! +// It is up to caller to ensure not making costly calls that will be outside of visible area. +// As concave fill is noticeably more expensive than other primitives, be mindful of this... +// Caller can build AABB of points, and avoid filling if 'draw_list->_CmdHeader.ClipRect.Overlays(points_bb) == false') +void ImDrawList::AddConcavePolyFilled(const ImVec2* points, const int points_count, ImU32 col) +{ + if (points_count < 3 || (col & IM_COL32_A_MASK) == 0) + return; + + const ImVec2 uv = _Data->TexUvWhitePixel; + ImTriangulator triangulator; + unsigned int triangle[3]; + if (Flags & ImDrawListFlags_AntiAliasedFill) + { + // Anti-aliased Fill + const float AA_SIZE = _FringeScale; + const ImU32 col_trans = col & ~IM_COL32_A_MASK; + const int idx_count = (points_count - 2) * 3 + points_count * 6; + const int vtx_count = (points_count * 2); + PrimReserve(idx_count, vtx_count); + + // Add indexes for fill + unsigned int vtx_inner_idx = _VtxCurrentIdx; + unsigned int vtx_outer_idx = _VtxCurrentIdx + 1; + + _Data->TempBuffer.reserve_discard((ImTriangulator::EstimateScratchBufferSize(points_count) + sizeof(ImVec2)) / sizeof(ImVec2)); + triangulator.Init(points, points_count, _Data->TempBuffer.Data); + while (triangulator._TrianglesLeft > 0) + { + triangulator.GetNextTriangle(triangle); + _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx + (triangle[0] << 1)); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx + (triangle[1] << 1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_inner_idx + (triangle[2] << 1)); + _IdxWritePtr += 3; + } + + // Compute normals + _Data->TempBuffer.reserve_discard(points_count); + ImVec2* temp_normals = _Data->TempBuffer.Data; + for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++) + { + const ImVec2& p0 = points[i0]; + const ImVec2& p1 = points[i1]; + float dx = p1.x - p0.x; + float dy = p1.y - p0.y; + IM_NORMALIZE2F_OVER_ZERO(dx, dy); + temp_normals[i0].x = dy; + temp_normals[i0].y = -dx; + } + + for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++) + { + // Average normals + const ImVec2& n0 = temp_normals[i0]; + const ImVec2& n1 = temp_normals[i1]; + float dm_x = (n0.x + n1.x) * 0.5f; + float dm_y = (n0.y + n1.y) * 0.5f; + IM_FIXNORMAL2F(dm_x, dm_y); + dm_x *= AA_SIZE * 0.5f; + dm_y *= AA_SIZE * 0.5f; + + // Add vertices + _VtxWritePtr[0].pos.x = (points[i1].x - dm_x); _VtxWritePtr[0].pos.y = (points[i1].y - dm_y); _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; // Inner + _VtxWritePtr[1].pos.x = (points[i1].x + dm_x); _VtxWritePtr[1].pos.y = (points[i1].y + dm_y); _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col_trans; // Outer + _VtxWritePtr += 2; + + // Add indexes for fringes + _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx + (i1 << 1)); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx + (i0 << 1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_outer_idx + (i0 << 1)); + _IdxWritePtr[3] = (ImDrawIdx)(vtx_outer_idx + (i0 << 1)); _IdxWritePtr[4] = (ImDrawIdx)(vtx_outer_idx + (i1 << 1)); _IdxWritePtr[5] = (ImDrawIdx)(vtx_inner_idx + (i1 << 1)); + _IdxWritePtr += 6; + } + _VtxCurrentIdx += (ImDrawIdx)vtx_count; + } + else + { + // Non Anti-aliased Fill + const int idx_count = (points_count - 2) * 3; + const int vtx_count = points_count; + PrimReserve(idx_count, vtx_count); + for (int i = 0; i < vtx_count; i++) + { + _VtxWritePtr[0].pos = points[i]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; + _VtxWritePtr++; + } + _Data->TempBuffer.reserve_discard((ImTriangulator::EstimateScratchBufferSize(points_count) + sizeof(ImVec2)) / sizeof(ImVec2)); + triangulator.Init(points, points_count, _Data->TempBuffer.Data); + while (triangulator._TrianglesLeft > 0) + { + triangulator.GetNextTriangle(triangle); + _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx + triangle[0]); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx + triangle[1]); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx + triangle[2]); + _IdxWritePtr += 3; + } + _VtxCurrentIdx += (ImDrawIdx)vtx_count; + } +} //----------------------------------------------------------------------------- // [SECTION] ImDrawListSplitter @@ -1854,6 +2242,12 @@ void ImGui::AddDrawListToDrawDataEx(ImDrawData* draw_data, ImVector if (sizeof(ImDrawIdx) == 2) IM_ASSERT(draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above"); + // Resolve callback data pointers + if (draw_list->_CallbacksDataBuf.Size > 0) + for (ImDrawCmd& cmd : draw_list->CmdBuffer) + if (cmd.UserCallback != NULL && cmd.UserCallbackDataOffset != -1 && cmd.UserCallbackDataSize > 0) + cmd.UserCallbackData = draw_list->_CallbacksDataBuf.Data + cmd.UserCallbackDataOffset; + // Add to output list + records state in ImDrawData out_list->push_back(draw_list); draw_data->CmdListsCount++; @@ -1950,6 +2344,14 @@ void ImGui::ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int ve } } +void ImGui::ShadeVertsTransformPos(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& pivot_in, float cos_a, float sin_a, const ImVec2& pivot_out) +{ + ImDrawVert* vert_start = draw_list->VtxBuffer.Data + vert_start_idx; + ImDrawVert* vert_end = draw_list->VtxBuffer.Data + vert_end_idx; + for (ImDrawVert* vertex = vert_start; vertex < vert_end; ++vertex) + vertex->pos = ImRotate(vertex->pos- pivot_in, cos_a, sin_a) + pivot_out; +} + //----------------------------------------------------------------------------- // [SECTION] ImFontConfig //----------------------------------------------------------------------------- @@ -1962,6 +2364,7 @@ ImFontConfig::ImFontConfig() OversampleV = 1; GlyphMaxAdvanceX = FLT_MAX; RasterizerMultiply = 1.0f; + RasterizerDensity = 1.0f; EllipsisChar = (ImWchar)-1; } @@ -2122,13 +2525,14 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg) { IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); IM_ASSERT(font_cfg->FontData != NULL && font_cfg->FontDataSize > 0); - IM_ASSERT(font_cfg->SizePixels > 0.0f); + IM_ASSERT(font_cfg->SizePixels > 0.0f && "Is ImFontConfig struct correctly initialized?"); + IM_ASSERT(font_cfg->OversampleH > 0 && font_cfg->OversampleV > 0 && "Is ImFontConfig struct correctly initialized?"); // Create new font if (!font_cfg->MergeMode) Fonts.push_back(IM_NEW(ImFont)); else - IM_ASSERT(!Fonts.empty() && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font. + IM_ASSERT(Fonts.Size > 0 && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font. ConfigData.push_back(*font_cfg); ImFontConfig& new_font_cfg = ConfigData.back(); @@ -2144,6 +2548,8 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg) if (new_font_cfg.DstFont->EllipsisChar == (ImWchar)-1) new_font_cfg.DstFont->EllipsisChar = font_cfg->EllipsisChar; + ImFontAtlasUpdateConfigDataPointers(this); + // Invalidate texture TexReady = false; ClearTexData(); @@ -2180,7 +2586,7 @@ ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template) if (font_cfg.Name[0] == '\0') ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "ProggyClean.ttf, %dpx", (int)font_cfg.SizePixels); font_cfg.EllipsisChar = (ImWchar)0x0085; - font_cfg.GlyphOffset.y = 1.0f * IM_FLOOR(font_cfg.SizePixels / 13.0f); // Add +1 offset per 13 units + font_cfg.GlyphOffset.y = 1.0f * IM_TRUNC(font_cfg.SizePixels / 13.0f); // Add +1 offset per 13 units const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85(); const ImWchar* glyph_ranges = font_cfg.GlyphRanges != NULL ? font_cfg.GlyphRanges : GetGlyphRangesDefault(); @@ -2210,13 +2616,14 @@ ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, } // NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build(). -ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) +ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* font_data, int font_data_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) { IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); IM_ASSERT(font_cfg.FontData == NULL); - font_cfg.FontData = ttf_data; - font_cfg.FontDataSize = ttf_size; + IM_ASSERT(font_data_size > 100 && "Incorrect value for font_data_size!"); // Heuristic to prevent accidentally passing a wrong value to font_data_size. + font_cfg.FontData = font_data; + font_cfg.FontDataSize = font_data_size; font_cfg.SizePixels = size_pixels > 0.0f ? size_pixels : font_cfg.SizePixels; if (glyph_ranges) font_cfg.GlyphRanges = glyph_ranges; @@ -2431,7 +2838,10 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)cfg.FontData, cfg.FontNo); IM_ASSERT(font_offset >= 0 && "FontData is incorrect, or FontNo cannot be found."); if (!stbtt_InitFont(&src_tmp.FontInfo, (unsigned char*)cfg.FontData, font_offset)) + { + IM_ASSERT(0 && "stbtt_InitFont(): failed to parse FontData. It is correct and complete? Check FontDataSize."); return false; + } // Measure highest codepoints ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex]; @@ -2439,8 +2849,9 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2) { // Check for valid range. This may also help detect *some* dangling pointers, because a common - // user error is to setup ImFontConfig::GlyphRanges with a pointer to data that isn't persistent. - IM_ASSERT(src_range[0] <= src_range[1]); + // user error is to setup ImFontConfig::GlyphRanges with a pointer to data that isn't persistent, + // or to forget to zero-terminate the glyph range array. + IM_ASSERT(src_range[0] <= src_range[1] && "Invalid range: is your glyph range array persistent? it is zero-terminated?"); src_tmp.GlyphsHighest = ImMax(src_tmp.GlyphsHighest, (int)src_range[1]); } dst_tmp.SrcCount++; @@ -2513,7 +2924,7 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) // Convert our ranges in the format stb_truetype wants ImFontConfig& cfg = atlas->ConfigData[src_i]; - src_tmp.PackRange.font_size = cfg.SizePixels; + src_tmp.PackRange.font_size = cfg.SizePixels * cfg.RasterizerDensity; src_tmp.PackRange.first_unicode_codepoint_in_range = 0; src_tmp.PackRange.array_of_unicode_codepoints = src_tmp.GlyphsList.Data; src_tmp.PackRange.num_chars = src_tmp.GlyphsList.Size; @@ -2522,7 +2933,7 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) src_tmp.PackRange.v_oversample = (unsigned char)cfg.OversampleV; // Gather the sizes of all rectangles we will need to pack (this loop is based on stbtt_PackFontRangesGatherRects) - const float scale = (cfg.SizePixels > 0) ? stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, cfg.SizePixels) : stbtt_ScaleForMappingEmToPixels(&src_tmp.FontInfo, -cfg.SizePixels); + const float scale = (cfg.SizePixels > 0.0f) ? stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, cfg.SizePixels * cfg.RasterizerDensity) : stbtt_ScaleForMappingEmToPixels(&src_tmp.FontInfo, -cfg.SizePixels * cfg.RasterizerDensity); const int padding = atlas->TexGlyphPadding; for (int glyph_i = 0; glyph_i < src_tmp.GlyphsList.Size; glyph_i++) { @@ -2618,12 +3029,14 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) int unscaled_ascent, unscaled_descent, unscaled_line_gap; stbtt_GetFontVMetrics(&src_tmp.FontInfo, &unscaled_ascent, &unscaled_descent, &unscaled_line_gap); - const float ascent = ImFloor(unscaled_ascent * font_scale + ((unscaled_ascent > 0.0f) ? +1 : -1)); - const float descent = ImFloor(unscaled_descent * font_scale + ((unscaled_descent > 0.0f) ? +1 : -1)); + const float ascent = ImCeil(unscaled_ascent * font_scale); + const float descent = ImFloor(unscaled_descent * font_scale); ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent); const float font_off_x = cfg.GlyphOffset.x; const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent); + const float inv_rasterization_scale = 1.0f / cfg.RasterizerDensity; + for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++) { // Register glyph @@ -2632,7 +3045,11 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) stbtt_aligned_quad q; float unused_x = 0.0f, unused_y = 0.0f; stbtt_GetPackedQuad(src_tmp.PackedChars, atlas->TexWidth, atlas->TexHeight, glyph_i, &unused_x, &unused_y, &q, 0); - dst_font->AddGlyph(&cfg, (ImWchar)codepoint, q.x0 + font_off_x, q.y0 + font_off_y, q.x1 + font_off_x, q.y1 + font_off_y, q.s0, q.t0, q.s1, q.t1, pc.xadvance); + float x0 = q.x0 * inv_rasterization_scale + font_off_x; + float y0 = q.y0 * inv_rasterization_scale + font_off_y; + float x1 = q.x1 * inv_rasterization_scale + font_off_x; + float y1 = q.y1 * inv_rasterization_scale + font_off_y; + dst_font->AddGlyph(&cfg, (ImWchar)codepoint, x0, y0, x1, y1, q.s0, q.t0, q.s1, q.t1, pc.xadvance * inv_rasterization_scale); } } @@ -2652,19 +3069,31 @@ const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype() #endif // IMGUI_ENABLE_STB_TRUETYPE +void ImFontAtlasUpdateConfigDataPointers(ImFontAtlas* atlas) +{ + for (ImFontConfig& font_cfg : atlas->ConfigData) + { + ImFont* font = font_cfg.DstFont; + if (!font_cfg.MergeMode) + { + font->ConfigData = &font_cfg; + font->ConfigDataCount = 0; + } + font->ConfigDataCount++; + } +} + void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent) { if (!font_config->MergeMode) { font->ClearOutputData(); font->FontSize = font_config->SizePixels; - font->ConfigData = font_config; - font->ConfigDataCount = 0; + IM_ASSERT(font->ConfigData == font_config); font->ContainerAtlas = atlas; font->Ascent = ascent; font->Descent = descent; } - font->ConfigDataCount++; } void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opaque) @@ -2811,6 +3240,13 @@ static void ImFontAtlasBuildRenderLinesTexData(ImFontAtlas* atlas) // Note: this is called / shared by both the stb_truetype and the FreeType builder void ImFontAtlasBuildInit(ImFontAtlas* atlas) { + // Round font size + // - We started rounding in 1.90 WIP (18991) as our layout system currently doesn't support non-rounded font size well yet. + // - Note that using io.FontGlobalScale or SetWindowFontScale(), with are legacy-ish, partially supported features, can still lead to unrounded sizes. + // - We may support it better later and remove this rounding. + for (ImFontConfig& cfg : atlas->ConfigData) + cfg.SizePixels = ImTrunc(cfg.SizePixels); + // Register texture region for mouse cursors or standard white pixels if (atlas->PackIdMouseCursors < 0) { @@ -3219,6 +3655,7 @@ void ImFont::BuildLookupTable() max_codepoint = ImMax(max_codepoint, (int)Glyphs[i].Codepoint); // Build lookup table + IM_ASSERT(Glyphs.Size > 0 && "Font has not loaded glyph!"); IM_ASSERT(Glyphs.Size < 0xFFFF); // -1 is reserved IndexAdvanceX.clear(); IndexLookup.clear(); @@ -3335,7 +3772,7 @@ void ImFont::AddGlyph(const ImFontConfig* cfg, ImWchar codepoint, float x0, floa advance_x = ImClamp(advance_x, cfg->GlyphMinAdvanceX, cfg->GlyphMaxAdvanceX); if (advance_x != advance_x_original) { - float char_off_x = cfg->PixelSnapH ? ImFloor((advance_x - advance_x_original) * 0.5f) : (advance_x - advance_x_original) * 0.5f; + float char_off_x = cfg->PixelSnapH ? ImTrunc((advance_x - advance_x_original) * 0.5f) : (advance_x - advance_x_original) * 0.5f; x0 += char_off_x; x1 += char_off_x; } @@ -3603,8 +4040,8 @@ void ImFont::RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, Im if (glyph->Colored) col |= ~IM_COL32_A_MASK; float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f; - float x = IM_FLOOR(pos.x); - float y = IM_FLOOR(pos.y); + float x = IM_TRUNC(pos.x); + float y = IM_TRUNC(pos.y); draw_list->PrimReserve(6, 4); draw_list->PrimRectUV(ImVec2(x + glyph->X0 * scale, y + glyph->Y0 * scale), ImVec2(x + glyph->X1 * scale, y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col); } @@ -3616,8 +4053,8 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im text_end = text_begin + strlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls. // Align to be pixel perfect - float x = IM_FLOOR(pos.x); - float y = IM_FLOOR(pos.y); + float x = IM_TRUNC(pos.x); + float y = IM_TRUNC(pos.y); if (y > clip_rect.w) return; @@ -3688,6 +4125,8 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im { x = start_x; y += line_height; + if (y > clip_rect.w) + break; // break out of main loop word_wrap_eol = NULL; s = CalcWordWrapNextLineStartA(s, text_end); // Wrapping skips upcoming blanks continue; @@ -3917,8 +4356,8 @@ void ImGui::RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, Im } else { - draw_list->PathArcTo(ImVec2(x0, p1.y - rounding), rounding, IM_PI - arc0_e, IM_PI - arc0_b, 3); // BL - draw_list->PathArcTo(ImVec2(x0, p0.y + rounding), rounding, IM_PI + arc0_b, IM_PI + arc0_e, 3); // TR + draw_list->PathArcTo(ImVec2(x0, p1.y - rounding), rounding, IM_PI - arc0_e, IM_PI - arc0_b); // BL + draw_list->PathArcTo(ImVec2(x0, p0.y + rounding), rounding, IM_PI + arc0_b, IM_PI + arc0_e); // TR } if (p1.x > rect.Min.x + rounding) { @@ -3937,8 +4376,8 @@ void ImGui::RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, Im } else { - draw_list->PathArcTo(ImVec2(x1, p0.y + rounding), rounding, -arc1_e, -arc1_b, 3); // TR - draw_list->PathArcTo(ImVec2(x1, p1.y - rounding), rounding, +arc1_b, +arc1_e, 3); // BR + draw_list->PathArcTo(ImVec2(x1, p0.y + rounding), rounding, -arc1_e, -arc1_b); // TR + draw_list->PathArcTo(ImVec2(x1, p1.y - rounding), rounding, +arc1_b, +arc1_e); // BR } } draw_list->PathFillConvex(col); @@ -4125,8 +4564,8 @@ static unsigned int stb_decompress(unsigned char *output, const unsigned char *i //----------------------------------------------------------------------------- // ProggyClean.ttf // Copyright (c) 2004, 2005 Tristan Grimmer -// MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip) -// Download and more information at http://upperbounds.net +// MIT license (see License.txt in http://www.proggyfonts.net/index.php?menu=download) +// Download and more information at http://www.proggyfonts.net or http://upperboundsinteractive.com/fonts.php //----------------------------------------------------------------------------- // File: 'ProggyClean.ttf' (41208 bytes) // Exported using misc/fonts/binary_to_compressed_c.cpp (with compression + base85 string encoding). diff --git a/bgfx/3rdparty/dear-imgui/imgui_internal.h b/bgfx/3rdparty/dear-imgui/imgui_internal.h index 70a62334..c9ddceb3 100644 --- a/bgfx/3rdparty/dear-imgui/imgui_internal.h +++ b/bgfx/3rdparty/dear-imgui/imgui_internal.h @@ -1,12 +1,7 @@ -// dear imgui, v1.89.9 +// dear imgui, v1.91.4 // (internal structures/api) // You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility. -// To implement maths operators for ImVec2 (disabled by default to not conflict with using IM_VEC2_CLASS_EXTRA with your own math types+operators), use: -/* -#define IMGUI_DEFINE_MATH_OPERATORS -#include "imgui_internal.h" -*/ /* @@ -19,16 +14,21 @@ Index of this file: // [SECTION] Macros // [SECTION] Generic helpers // [SECTION] ImDrawList support +// [SECTION] Data types support // [SECTION] Widgets support: flags, enums, data structures +// [SECTION] Popup support // [SECTION] Inputs support // [SECTION] Clipper support // [SECTION] Navigation support +// [SECTION] Typing-select support // [SECTION] Columns support +// [SECTION] Box-select support // [SECTION] Multi-select support // [SECTION] Docking support // [SECTION] Viewport support // [SECTION] Settings support // [SECTION] Localization support +// [SECTION] Error handling, State recovery support // [SECTION] Metrics, Debug tools // [SECTION] Generic context hooks // [SECTION] ImGuiContext (main imgui context) @@ -81,7 +81,7 @@ Index of this file: #pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx' -#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok, for ImFloorSigned() +#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok, for ImFloor() #pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h #pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h #pragma clang diagnostic ignored "-Wold-style-cast" @@ -89,10 +89,13 @@ Index of this file: #pragma clang diagnostic ignored "-Wdouble-promotion" #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision #pragma clang diagnostic ignored "-Wmissing-noreturn" // warning: function 'xxx' could be declared with attribute 'noreturn' +#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access #elif defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind #pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead +#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated #endif // In 1.89.4, we moved the implementation of "courtesy maths operators" from imgui_internal.h in imgui.h @@ -123,19 +126,22 @@ struct ImBitVector; // Store 1-bit per value struct ImRect; // An axis-aligned rectangle (2 points) struct ImDrawDataBuilder; // Helper to build a ImDrawData instance struct ImDrawListSharedData; // Data shared between all ImDrawList instances +struct ImGuiBoxSelectState; // Box-selection state (currently used by multi-selection, could potentially be used by others) struct ImGuiColorMod; // Stacked color modifier, backup of modified data so we can restore it struct ImGuiContext; // Main Dear ImGui context struct ImGuiContextHook; // Hook for extensions like ImGuiTestEngine -struct ImGuiDataVarInfo; // Variable information (e.g. to avoid style variables from an enum) +struct ImGuiDataVarInfo; // Variable information (e.g. to access style variables from an enum) struct ImGuiDataTypeInfo; // Type information associated to a ImGuiDataType enum +struct ImGuiErrorRecoveryState; // Storage of stack sizes for error handling and recovery struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup() struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box struct ImGuiInputTextDeactivateData;// Short term storage to backup text of a deactivating InputText() while another is stealing active id struct ImGuiLastItemData; // Status storage for last submitted items struct ImGuiLocEntry; // A localization entry. struct ImGuiMenuColumns; // Simple column measurement, currently used for MenuItem() only -struct ImGuiNavItemData; // Result of a gamepad/keyboard directional navigation move query result -struct ImGuiNavTreeNodeData; // Temporary storage for last TreeNode() being a Left arrow landing candidate. +struct ImGuiMultiSelectState; // Multi-selection persistent state (for focused selection). +struct ImGuiMultiSelectTempData; // Multi-selection temporary state (while traversing). +struct ImGuiNavItemData; // Result of a keyboard/gamepad directional navigation move query result struct ImGuiMetricsConfig; // Storage for ShowMetricsWindow() and DebugNodeXXX() functions struct ImGuiNextWindowData; // Storage for SetNextWindow** functions struct ImGuiNextItemData; // Storage for SetNextItem** functions @@ -143,16 +149,19 @@ struct ImGuiOldColumnData; // Storage data for a single column for lega struct ImGuiOldColumns; // Storage data for a columns set for legacy Columns() api struct ImGuiPopupData; // Storage for current popup stack struct ImGuiSettingsHandler; // Storage for one type registered in the .ini file -struct ImGuiStackSizes; // Storage of stack sizes for debugging/asserting struct ImGuiStyleMod; // Stacked style modifier, backup of modified data so we can restore it struct ImGuiTabBar; // Storage for a tab bar struct ImGuiTabItem; // Storage for a tab item (within a tab bar) struct ImGuiTable; // Storage for a table +struct ImGuiTableHeaderData; // Storage for TableAngledHeadersRow() struct ImGuiTableColumn; // Storage for one column of a table struct ImGuiTableInstanceData; // Storage for one instance of a same table struct ImGuiTableTempData; // Temporary storage for one table (one per table in the stack), shared between tables. struct ImGuiTableSettings; // Storage for a table .ini settings struct ImGuiTableColumnsSettings; // Storage for a column .ini settings +struct ImGuiTreeNodeStackData; // Temporary storage for TreeNode(). +struct ImGuiTypingSelectState; // Storage for GetTypingSelectRequest() +struct ImGuiTypingSelectRequest; // Storage for GetTypingSelectRequest() (aimed to be public) struct ImGuiWindow; // Storage for one window struct ImGuiWindowTempData; // Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame, in practice we currently keep it for each window) struct ImGuiWindowSettings; // Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session) @@ -165,12 +174,10 @@ typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // E // Flags typedef int ImGuiActivateFlags; // -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later) typedef int ImGuiDebugLogFlags; // -> enum ImGuiDebugLogFlags_ // Flags: for ShowDebugLogWindow(), g.DebugLogFlags -typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow(); -typedef int ImGuiInputFlags; // -> enum ImGuiInputFlags_ // Flags: for IsKeyPressed(), IsMouseClicked(), SetKeyOwner(), SetItemKeyOwner() etc. -typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag(), g.LastItemData.InFlags +typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow() typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for g.LastItemData.StatusFlags typedef int ImGuiOldColumnFlags; // -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns() -typedef int ImGuiNavHighlightFlags; // -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight() +typedef int ImGuiNavRenderCursorFlags; // -> enum ImGuiNavRenderCursorFlags_//Flags: for RenderNavCursor() typedef int ImGuiNavMoveFlags; // -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests typedef int ImGuiNextItemDataFlags; // -> enum ImGuiNextItemDataFlags_ // Flags: for SetNextItemXXX() functions typedef int ImGuiNextWindowDataFlags; // -> enum ImGuiNextWindowDataFlags_// Flags: for SetNextWindowXXX() functions @@ -178,8 +185,8 @@ typedef int ImGuiScrollFlags; // -> enum ImGuiScrollFlags_ // F typedef int ImGuiSeparatorFlags; // -> enum ImGuiSeparatorFlags_ // Flags: for SeparatorEx() typedef int ImGuiTextFlags; // -> enum ImGuiTextFlags_ // Flags: for TextEx() typedef int ImGuiTooltipFlags; // -> enum ImGuiTooltipFlags_ // Flags: for BeginTooltipEx() - -typedef void (*ImGuiErrorLogCallback)(void* user_data, const char* fmt, ...); +typedef int ImGuiTypingSelectFlags; // -> enum ImGuiTypingSelectFlags_ // Flags: for GetTypingSelectRequest() +typedef int ImGuiWindowRefreshFlags; // -> enum ImGuiWindowRefreshFlags_ // Flags: for SetNextWindowRefreshPolicy() //----------------------------------------------------------------------------- // [SECTION] Context pointer @@ -190,24 +197,6 @@ typedef void (*ImGuiErrorLogCallback)(void* user_data, const char* fmt, ...); extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer #endif -//------------------------------------------------------------------------- -// [SECTION] STB libraries includes -//------------------------------------------------------------------------- - -namespace ImStb -{ - -#undef STB_TEXTEDIT_STRING -#undef STB_TEXTEDIT_CHARTYPE -#define STB_TEXTEDIT_STRING ImGuiInputTextState -#define STB_TEXTEDIT_CHARTYPE ImWchar -#define STB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f) -#define STB_TEXTEDIT_UNDOSTATECOUNT 99 -#define STB_TEXTEDIT_UNDOCHARCOUNT 999 -#include "imstb_textedit.h" - -} // namespace ImStb - //----------------------------------------------------------------------------- // [SECTION] Macros //----------------------------------------------------------------------------- @@ -228,13 +217,15 @@ namespace ImStb #else #define IMGUI_DEBUG_LOG(...) ((void)0) #endif -#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) -#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) -#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) -#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) -#define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) -#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) -#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) +#define IMGUI_DEBUG_LOG_ERROR(...) do { ImGuiContext& g2 = *GImGui; if (g2.DebugLogFlags & ImGuiDebugLogFlags_EventError) IMGUI_DEBUG_LOG(__VA_ARGS__); else g2.DebugLogSkippedErrors++; } while (0) +#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) +#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) +#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) +#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) +#define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) +#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) +#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) +#define IMGUI_DEBUG_LOG_INPUTROUTING(...) do{if (g.DebugLogFlags & ImGuiDebugLogFlags_EventInputRouting)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) // Static Asserts #define IM_STATIC_ASSERT(_COND) static_assert(_COND, "") @@ -248,12 +239,6 @@ namespace ImStb #define IM_ASSERT_PARANOID(_EXPR) #endif -// Error handling -// Down the line in some frameworks/languages we would like to have a way to redirect those to the programmer and recover from more faults. -#ifndef IM_ASSERT_USER_ERROR -#define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG) // Recoverable User Error -#endif - // Misc Macros #define IM_PI 3.14159265358979323846f #ifdef _WIN32 @@ -267,10 +252,13 @@ namespace ImStb #define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1)) // Memory align e.g. IM_ALIGN(0,4)=0, IM_ALIGN(1,4)=4, IM_ALIGN(4,4)=4, IM_ALIGN(5,4)=8 #define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose #define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255 -#define IM_FLOOR(_VAL) ((float)(int)(_VAL)) // ImFloor() is not inlined in MSVC debug builds +#define IM_TRUNC(_VAL) ((float)(int)(_VAL)) // ImTrunc() is not inlined in MSVC debug builds #define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) // #define IM_STRINGIFY_HELPER(_X) #_X #define IM_STRINGIFY(_X) IM_STRINGIFY_HELPER(_X) // Preprocessor idiom to stringify e.g. an integer. +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS +#define IM_FLOOR IM_TRUNC +#endif // Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall #ifdef _MSC_VER @@ -295,16 +283,28 @@ namespace ImStb #elif defined(__clang__) #define IM_DEBUG_BREAK() __builtin_debugtrap() #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) -#define IM_DEBUG_BREAK() __asm__ volatile("int $0x03") +#define IM_DEBUG_BREAK() __asm__ volatile("int3;nop") #elif defined(__GNUC__) && defined(__thumb__) #define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01") #elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__) -#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0"); +#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0") #else #define IM_DEBUG_BREAK() IM_ASSERT(0) // It is expected that you define IM_DEBUG_BREAK() into something that will break nicely in a debugger! #endif #endif // #ifndef IM_DEBUG_BREAK +// Format specifiers, printing 64-bit hasn't been decently standardized... +// In a real application you should be using PRId64 and PRIu64 from (non-windows) and on Windows define them yourself. +#if defined(_MSC_VER) && !defined(__clang__) +#define IM_PRId64 "I64d" +#define IM_PRIu64 "I64u" +#define IM_PRIX64 "I64X" +#else +#define IM_PRId64 "lld" +#define IM_PRIu64 "llu" +#define IM_PRIX64 "llX" +#endif + //----------------------------------------------------------------------------- // [SECTION] Generic helpers // Note that the ImXXX helpers functions are lower-level than ImGui functions. @@ -328,6 +328,7 @@ namespace ImStb // - Helper: ImPool<> // - Helper: ImChunkStream<> // - Helper: ImGuiTextIndex +// - Helper: ImGuiStorage //----------------------------------------------------------------------------- // Helpers: Hashing @@ -348,22 +349,23 @@ static inline bool ImIsPowerOfTwo(ImU64 v) { return v != 0 && (v & static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; } // Helpers: String -IMGUI_API int ImStricmp(const char* str1, const char* str2); -IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count); -IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count); -IMGUI_API char* ImStrdup(const char* str); -IMGUI_API char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* str); -IMGUI_API const char* ImStrchrRange(const char* str_begin, const char* str_end, char c); -IMGUI_API int ImStrlenW(const ImWchar* str); +IMGUI_API int ImStricmp(const char* str1, const char* str2); // Case insensitive compare. +IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count); // Case insensitive compare to a certain count. +IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count); // Copy to a certain count and always zero terminate (strncpy doesn't). +IMGUI_API char* ImStrdup(const char* str); // Duplicate a string. +IMGUI_API char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* str); // Copy in provided buffer, recreate buffer if needed. +IMGUI_API const char* ImStrchrRange(const char* str_begin, const char* str_end, char c); // Find first occurrence of 'c' in string range. IMGUI_API const char* ImStreolRange(const char* str, const char* str_end); // End end-of-line -IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin); // Find beginning-of-line -IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end); -IMGUI_API void ImStrTrimBlanks(char* str); -IMGUI_API const char* ImStrSkipBlank(const char* str); +IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end); // Find a substring in a string range. +IMGUI_API void ImStrTrimBlanks(char* str); // Remove leading and trailing blanks from a buffer. +IMGUI_API const char* ImStrSkipBlank(const char* str); // Find first non-blank character. +IMGUI_API int ImStrlenW(const ImWchar* str); // Computer string length (ImWchar string) +IMGUI_API const char* ImStrbol(const char* buf_mid_line, const char* buf_begin); // Find beginning-of-line IM_MSVC_RUNTIME_CHECKS_OFF static inline char ImToUpper(char c) { return (c >= 'a' && c <= 'z') ? c &= ~32 : c; } static inline bool ImCharIsBlankA(char c) { return c == ' ' || c == '\t'; } static inline bool ImCharIsBlankW(unsigned int c) { return c == ' ' || c == '\t' || c == 0x3000; } +static inline bool ImCharIsXdigitA(char c) { return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); } IM_MSVC_RUNTIME_CHECKS_RESTORE // Helpers: Formatting @@ -386,6 +388,8 @@ IMGUI_API int ImTextStrFromUtf8(ImWchar* out_buf, int out_buf_size, co IMGUI_API int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end); // return number of UTF-8 code-points (NOT bytes count) IMGUI_API int ImTextCountUtf8BytesFromChar(const char* in_text, const char* in_text_end); // return number of bytes to express one char in UTF-8 IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string in UTF-8 +IMGUI_API const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_text_curr); // return previous UTF-8 code-point. +IMGUI_API int ImTextCountLines(const char* in_text, const char* in_text_end); // return number of lines taken by text. trailing carriage return doesn't count as an extra line. // Helpers: File System #ifdef IMGUI_DISABLE_FILE_FUNCTIONS @@ -421,7 +425,6 @@ IM_MSVC_RUNTIME_CHECKS_OFF #define ImAcos(X) acosf(X) #define ImAtan2(Y, X) atan2f((Y), (X)) #define ImAtof(STR) atof(STR) -//#define ImFloorStd(X) floorf(X) // We use our own, see ImFloor() and ImFloorSigned() #define ImCeil(X) ceilf(X) static inline float ImPow(float x, float y) { return powf(x, y); } // DragBehaviorT/SliderBehaviorT uses ImPow with either float/double and need the precision static inline double ImPow(double x, double y) { return pow(x, y); } @@ -451,7 +454,7 @@ template static inline T ImSubClampOverflow(T a, T b, T mn, T mx) // - Misc maths helpers static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y); } static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x >= rhs.x ? lhs.x : rhs.x, lhs.y >= rhs.y ? lhs.y : rhs.y); } -static inline ImVec2 ImClamp(const ImVec2& v, const ImVec2& mn, ImVec2 mx) { return ImVec2((v.x < mn.x) ? mn.x : (v.x > mx.x) ? mx.x : v.x, (v.y < mn.y) ? mn.y : (v.y > mx.y) ? mx.y : v.y); } +static inline ImVec2 ImClamp(const ImVec2& v, const ImVec2&mn, const ImVec2&mx) { return ImVec2((v.x < mn.x) ? mn.x : (v.x > mx.x) ? mx.x : v.x, (v.y < mn.y) ? mn.y : (v.y > mx.y) ? mx.y : v.y); } static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t) { return ImVec2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); } static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t) { return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); } static inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t) { return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); } @@ -459,14 +462,15 @@ static inline float ImSaturate(float f) static inline float ImLengthSqr(const ImVec2& lhs) { return (lhs.x * lhs.x) + (lhs.y * lhs.y); } static inline float ImLengthSqr(const ImVec4& lhs) { return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); } static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = (lhs.x * lhs.x) + (lhs.y * lhs.y); if (d > 0.0f) return ImRsqrt(d); return fail_value; } -static inline float ImFloor(float f) { return (float)(int)(f); } -static inline float ImFloorSigned(float f) { return (float)((f >= 0 || (float)(int)f == f) ? (int)f : (int)f - 1); } // Decent replacement for floorf() -static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2((float)(int)(v.x), (float)(int)(v.y)); } -static inline ImVec2 ImFloorSigned(const ImVec2& v) { return ImVec2(ImFloorSigned(v.x), ImFloorSigned(v.y)); } +static inline float ImTrunc(float f) { return (float)(int)(f); } +static inline ImVec2 ImTrunc(const ImVec2& v) { return ImVec2((float)(int)(v.x), (float)(int)(v.y)); } +static inline float ImFloor(float f) { return (float)((f >= 0 || (float)(int)f == f) ? (int)f : (int)f - 1); } // Decent replacement for floorf() +static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2(ImFloor(v.x), ImFloor(v.y)); } static inline int ImModPositive(int a, int b) { return (a + b) % b; } static inline float ImDot(const ImVec2& a, const ImVec2& b) { return a.x * b.x + a.y * b.y; } static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) { return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); } static inline float ImLinearSweep(float current, float target, float speed) { if (current < target) return ImMin(current + speed, target); if (current > target) return ImMax(current - speed, target); return current; } +static inline float ImLinearRemapClamp(float s0, float s1, float d0, float d1, float x) { return ImSaturate((x - s0) / (s1 - s0)) * (d1 - d0) + d0; } static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); } static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(float f) { return f <= -16777216 || f >= 16777216; } static inline float ImExponentialMovingAverage(float avg, float sample, int n) { avg -= avg / n; avg += sample / n; return avg; } @@ -481,7 +485,8 @@ IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const IMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p); IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p); IMGUI_API void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w); -inline float ImTriangleArea(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ImFabs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) * 0.5f; } +inline float ImTriangleArea(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ImFabs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) * 0.5f; } +inline bool ImTriangleIsClockwise(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ((b.x - a.x) * (c.y - b.y)) - ((c.x - b.x) * (b.y - a.y)) > 0.0f; } // Helper: ImVec1 (1D vector) // (this odd construct is used to facilitate the transition between 1D and 2D, and the maintenance of some branches/patches) @@ -525,6 +530,7 @@ struct IMGUI_API ImRect ImVec2 GetBR() const { return Max; } // Bottom-right bool Contains(const ImVec2& p) const { return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; } bool Contains(const ImRect& r) const { return r.Min.x >= Min.x && r.Min.y >= Min.y && r.Max.x <= Max.x && r.Max.y <= Max.y; } + bool ContainsWithPad(const ImVec2& p, const ImVec2& pad) const { return p.x >= Min.x - pad.x && p.y >= Min.y - pad.y && p.x < Max.x + pad.x && p.y < Max.y + pad.y; } bool Overlaps(const ImRect& r) const { return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; } void Add(const ImVec2& p) { if (Min.x > p.x) Min.x = p.x; if (Min.y > p.y) Min.y = p.y; if (Max.x < p.x) Max.x = p.x; if (Max.y < p.y) Max.y = p.y; } void Add(const ImRect& r) { if (Min.x > r.Min.x) Min.x = r.Min.x; if (Min.y > r.Min.y) Min.y = r.Min.y; if (Max.x < r.Max.x) Max.x = r.Max.x; if (Max.y < r.Max.y) Max.y = r.Max.y; } @@ -535,7 +541,7 @@ struct IMGUI_API ImRect void TranslateY(float dy) { Min.y += dy; Max.y += dy; } void ClipWith(const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); } // Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display. void ClipWithFull(const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); } // Full version, ensure both points are fully clipped. - void Floor() { Min.x = IM_FLOOR(Min.x); Min.y = IM_FLOOR(Min.y); Max.x = IM_FLOOR(Max.x); Max.y = IM_FLOOR(Max.y); } + void Floor() { Min.x = IM_TRUNC(Min.x); Min.y = IM_TRUNC(Min.y); Max.x = IM_TRUNC(Max.x); Max.y = IM_TRUNC(Max.y); } bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; } ImVec4 ToVec4() const { return ImVec4(Min.x, Min.y, Max.x, Max.y); } }; @@ -674,9 +680,6 @@ struct ImPool int GetBufSize() const { return Buf.Size; } int GetMapSize() const { return Map.Data.Size; } // It is the map we need iterate to find valid items, since we don't have "alive" storage anywhere T* TryGetMapData(ImPoolIdx n) { int idx = Map.Data[n].val_i; if (idx == -1) return NULL; return GetByIndex(idx); } -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - int GetSize() { return GetMapSize(); } // For ImPlot: should use GetMapSize() from (IMGUI_VERSION_NUM >= 18304) -#endif }; // Helper: ImChunkStream<> @@ -700,10 +703,9 @@ struct ImChunkStream int offset_from_ptr(const T* p) { IM_ASSERT(p >= begin() && p < end()); const ptrdiff_t off = (const char*)p - Buf.Data; return (int)off; } T* ptr_from_offset(int off) { IM_ASSERT(off >= 4 && off < Buf.Size); return (T*)(void*)(Buf.Data + off); } void swap(ImChunkStream& rhs) { rhs.Buf.swap(Buf); } - }; -// Helper: ImGuiTextIndex<> +// Helper: ImGuiTextIndex // Maintain a line index for a text buffer. This is a strong candidate to be moved into the public API. struct ImGuiTextIndex { @@ -717,6 +719,8 @@ struct ImGuiTextIndex void append(const char* base, int old_size, int new_size); }; +// Helper: ImGuiStorage +IMGUI_API ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key); //----------------------------------------------------------------------------- // [SECTION] ImDrawList support //----------------------------------------------------------------------------- @@ -753,6 +757,7 @@ struct IMGUI_API ImDrawListSharedData ImVec2 TexUvWhitePixel; // UV of white pixel in the atlas ImFont* Font; // Current/default font (optional, for simplified AddText overload) float FontSize; // Current/default font size (optional, for simplified AddText overload) + float FontScale; // Current/default font scale (== FontSize / Font->FontSize) float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo() float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen() @@ -779,32 +784,67 @@ struct ImDrawDataBuilder ImDrawDataBuilder() { memset(this, 0, sizeof(*this)); } }; +//----------------------------------------------------------------------------- +// [SECTION] Data types support +//----------------------------------------------------------------------------- + +struct ImGuiDataVarInfo +{ + ImGuiDataType Type; + ImU32 Count; // 1+ + ImU32 Offset; // Offset in parent structure + void* GetVarPtr(void* parent) const { return (void*)((unsigned char*)parent + Offset); } +}; + +struct ImGuiDataTypeStorage +{ + ImU8 Data[8]; // Opaque storage to fit any data up to ImGuiDataType_COUNT +}; + +// Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo(). +struct ImGuiDataTypeInfo +{ + size_t Size; // Size in bytes + const char* Name; // Short descriptive name for the type, for debugging + const char* PrintFmt; // Default printf format for the type + const char* ScanFmt; // Default scanf format for the type +}; + +// Extend ImGuiDataType_ +enum ImGuiDataTypePrivate_ +{ + ImGuiDataType_String = ImGuiDataType_COUNT + 1, + ImGuiDataType_Pointer, + ImGuiDataType_ID, +}; + //----------------------------------------------------------------------------- // [SECTION] Widgets support: flags, enums, data structures //----------------------------------------------------------------------------- -// Flags used by upcoming items -// - input: PushItemFlag() manipulates g.CurrentItemFlags, ItemAdd() calls may add extra flags. -// - output: stored in g.LastItemData.InFlags -// Current window shared by all windows. -// This is going to be exposed in imgui.h when stabilized enough. -enum ImGuiItemFlags_ +// Extend ImGuiItemFlags +// - input: PushItemFlag() manipulates g.CurrentItemFlags, g.NextItemData.ItemFlags, ItemAdd() calls may add extra flags too. +// - output: stored in g.LastItemData.ItemFlags +enum ImGuiItemFlagsPrivate_ { // Controlled by user - ImGuiItemFlags_None = 0, - ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav. - ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings. - ImGuiItemFlags_Disabled = 1 << 2, // false // Disable interactions but doesn't affect visuals. See BeginDisabled()/EndDisabled(). See github.com/ocornut/imgui/issues/211 - ImGuiItemFlags_NoNav = 1 << 3, // false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls) - ImGuiItemFlags_NoNavDefaultFocus = 1 << 4, // false // Disable item being a candidate for default focus (e.g. used by title bar items) - ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // Disable MenuItem/Selectable() automatically closing their popup window - ImGuiItemFlags_MixedValue = 1 << 6, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets) - ImGuiItemFlags_ReadOnly = 1 << 7, // false // [ALPHA] Allow hovering interactions but underlying value is not changed. - ImGuiItemFlags_NoWindowHoverableCheck = 1 << 8, // false // Disable hoverable check in ItemHoverable() - ImGuiItemFlags_AllowOverlap = 1 << 9, // false // Allow being overlapped by another widget. Not-hovered to Hovered transition deferred by a frame. + ImGuiItemFlags_Disabled = 1 << 10, // false // Disable interactions (DOES NOT affect visuals. DO NOT mix direct use of this with BeginDisabled(). See BeginDisabled()/EndDisabled() for full disable feature, and github #211). + ImGuiItemFlags_ReadOnly = 1 << 11, // false // [ALPHA] Allow hovering interactions but underlying value is not changed. + ImGuiItemFlags_MixedValue = 1 << 12, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets) + ImGuiItemFlags_NoWindowHoverableCheck = 1 << 13, // false // Disable hoverable check in ItemHoverable() + ImGuiItemFlags_AllowOverlap = 1 << 14, // false // Allow being overlapped by another widget. Not-hovered to Hovered transition deferred by a frame. + ImGuiItemFlags_NoNavDisableMouseHover = 1 << 15, // false // Nav keyboard/gamepad mode doesn't disable hover highlight (behave as if NavHighlightItemUnderNav==false). + ImGuiItemFlags_NoMarkEdited = 1 << 16, // false // Skip calling MarkItemEdited() // Controlled by widget code - ImGuiItemFlags_Inputable = 1 << 10, // false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature. + ImGuiItemFlags_Inputable = 1 << 20, // false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature. + ImGuiItemFlags_HasSelectionUserData = 1 << 21, // false // Set by SetNextItemSelectionUserData() + ImGuiItemFlags_IsMultiSelect = 1 << 22, // false // Set by SetNextItemSelectionUserData() + + ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups, // Please don't change, use PushItemFlag() instead. + + // Obsolete + //ImGuiItemFlags_SelectableDontClosePopup = !ImGuiItemFlags_AutoClosePopups, // Can't have a redirect as we inverted the behavior }; // Status flags for an already submitted item @@ -820,8 +860,9 @@ enum ImGuiItemStatusFlags_ ImGuiItemStatusFlags_HasDeactivated = 1 << 5, // Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag. ImGuiItemStatusFlags_Deactivated = 1 << 6, // Only valid if ImGuiItemStatusFlags_HasDeactivated is set. ImGuiItemStatusFlags_HoveredWindow = 1 << 7, // Override the HoveredWindow test to allow cross-window hover testing. - ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, // Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon) - ImGuiItemStatusFlags_Visible = 1 << 9, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()). + ImGuiItemStatusFlags_Visible = 1 << 8, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()). + ImGuiItemStatusFlags_HasClipRect = 1 << 9, // g.LastItemData.ClipRect is valid. + ImGuiItemStatusFlags_HasShortcut = 1 << 10, // g.LastItemData.Shortcut valid. Set by SetNextItemShortcut() -> ItemAdd(). // Additional status + semantic for ImGuiTestEngine #ifdef IMGUI_ENABLE_TEST_ENGINE @@ -846,8 +887,8 @@ enum ImGuiInputTextFlagsPrivate_ { // [Internal] ImGuiInputTextFlags_Multiline = 1 << 26, // For internal use by InputTextMultiline() - ImGuiInputTextFlags_NoMarkEdited = 1 << 27, // For internal use by functions using InputText() before reformatting data - ImGuiInputTextFlags_MergedItem = 1 << 28, // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match. + ImGuiInputTextFlags_MergedItem = 1 << 27, // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match. + ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 28, // For internal use by InputScalar() and TempInputScalar() }; // Extend ImGuiButtonFlags_ @@ -859,15 +900,15 @@ enum ImGuiButtonFlagsPrivate_ ImGuiButtonFlags_PressedOnRelease = 1 << 7, // return true on release (default requires click+release) ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8, // return true on double-click (default requires click+release) ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9, // return true when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers) - ImGuiButtonFlags_Repeat = 1 << 10, // hold to repeat + //ImGuiButtonFlags_Repeat = 1 << 10, // hold to repeat ImGuiButtonFlags_FlattenChildren = 1 << 11, // allow interactions even if a child window is overlapping ImGuiButtonFlags_AllowOverlap = 1 << 12, // require previous frame HoveredId to either match id or be null before being usable. - ImGuiButtonFlags_DontClosePopups = 1 << 13, // disable automatically closing parent popup on press // [UNUSED] + //ImGuiButtonFlags_DontClosePopups = 1 << 13, // disable automatically closing parent popup on press //ImGuiButtonFlags_Disabled = 1 << 14, // disable interactions -> use BeginDisabled() or ImGuiItemFlags_Disabled ImGuiButtonFlags_AlignTextBaseLine = 1 << 15, // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine - ImGuiButtonFlags_NoKeyModifiers = 1 << 16, // disable mouse interaction if a key modifier is held + ImGuiButtonFlags_NoKeyModsAllowed = 1 << 16, // disable mouse interaction if a key modifier is held ImGuiButtonFlags_NoHoldingActiveId = 1 << 17, // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only) - ImGuiButtonFlags_NoNavFocus = 1 << 18, // don't override navigation focus when activated (FIXME: this is essentially used everytime an item uses ImGuiItemFlags_NoNav, but because legacy specs don't requires LastItemData to be set ButtonBehavior(), we can't poll g.LastItemData.InFlags) + ImGuiButtonFlags_NoNavFocus = 1 << 18, // don't override navigation focus when activated (FIXME: this is essentially used every time an item uses ImGuiItemFlags_NoNav, but because legacy specs don't requires LastItemData to be set ButtonBehavior(), we can't poll g.LastItemData.ItemFlags) ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19, // don't report as hovered when nav focus is on this item ImGuiButtonFlags_NoSetKeyOwner = 1 << 20, // don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!) ImGuiButtonFlags_NoTestKeyOwner = 1 << 21, // don't test key/input owner when polling the key (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!) @@ -905,8 +946,9 @@ enum ImGuiSelectableFlagsPrivate_ // Extend ImGuiTreeNodeFlags_ enum ImGuiTreeNodeFlagsPrivate_ { - ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20, - ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 21,// (FIXME-WIP) Turn Down arrow into an Up arrow, but reversed trees (#6517) + ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 28,// FIXME-WIP: Hard-coded for CollapsingHeader() + ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29,// FIXME-WIP: Turn Down arrow into an Up arrow, for reversed trees (#6517) + ImGuiTreeNodeFlags_OpenOnMask_ = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow, }; enum ImGuiSeparatorFlags_ @@ -970,43 +1012,6 @@ enum ImGuiPlotType ImGuiPlotType_Histogram, }; -enum ImGuiPopupPositionPolicy -{ - ImGuiPopupPositionPolicy_Default, - ImGuiPopupPositionPolicy_ComboBox, - ImGuiPopupPositionPolicy_Tooltip, -}; - -struct ImGuiDataVarInfo -{ - ImGuiDataType Type; - ImU32 Count; // 1+ - ImU32 Offset; // Offset in parent structure - void* GetVarPtr(void* parent) const { return (void*)((unsigned char*)parent + Offset); } -}; - -struct ImGuiDataTypeTempStorage -{ - ImU8 Data[8]; // Can fit any data up to ImGuiDataType_COUNT -}; - -// Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo(). -struct ImGuiDataTypeInfo -{ - size_t Size; // Size in bytes - const char* Name; // Short descriptive name for the type, for debugging - const char* PrintFmt; // Default printf format for the type - const char* ScanFmt; // Default scanf format for the type -}; - -// Extend ImGuiDataType_ -enum ImGuiDataTypePrivate_ -{ - ImGuiDataType_String = ImGuiDataType_COUNT + 1, - ImGuiDataType_Pointer, - ImGuiDataType_ID, -}; - // Stacked color modifier, backup of modified data so we can restore it struct ImGuiColorMod { @@ -1043,6 +1048,7 @@ struct IMGUI_API ImGuiGroupData ImGuiID WindowID; ImVec2 BackupCursorPos; ImVec2 BackupCursorMaxPos; + ImVec2 BackupCursorPosPrevLine; ImVec1 BackupIndent; ImVec1 BackupGroupOffset; ImVec2 BackupCurrLineSize; @@ -1050,6 +1056,7 @@ struct IMGUI_API ImGuiGroupData ImGuiID BackupActiveIdIsAlive; bool BackupActiveIdPreviousFrameIsAlive; bool BackupHoveredIdIsAlive; + bool BackupIsSameLine; bool EmitItem; }; @@ -1080,57 +1087,74 @@ struct IMGUI_API ImGuiInputTextDeactivatedState ImGuiInputTextDeactivatedState() { memset(this, 0, sizeof(*this)); } void ClearFreeMemory() { ID = 0; TextA.clear(); } }; + +// Forward declare imstb_textedit.h structure + make its main configuration define accessible +#undef IMSTB_TEXTEDIT_STRING +#undef IMSTB_TEXTEDIT_CHARTYPE +#define IMSTB_TEXTEDIT_STRING ImGuiInputTextState +#define IMSTB_TEXTEDIT_CHARTYPE char +#define IMSTB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f) +#define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99 +#define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999 +namespace ImStb { struct STB_TexteditState; } +typedef ImStb::STB_TexteditState ImStbTexteditState; + // Internal state of the currently focused/edited text input box // For a given item ID, access with ImGui::GetInputTextState() struct IMGUI_API ImGuiInputTextState { ImGuiContext* Ctx; // parent UI context (needs to be set explicitly by parent). + ImStbTexteditState* Stb; // State for stb_textedit.h ImGuiID ID; // widget id owning the text state - int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not. - ImVector TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer. - ImVector TextA; // temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity. - ImVector InitialTextA; // backup of end-user buffer at the time of focus (in UTF-8, unaltered) - bool TextAIsValid; // temporary UTF8 buffer is not initially valid before we make the widget active (until then we pull the data from user argument) + int CurLenA; // UTF-8 length of the string in TextA (in bytes) + ImVector TextA; // main UTF8 buffer. + ImVector InitialTextA; // value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered) + ImVector CallbackTextBackup; // temporary storage for callback to support automatic reconcile of undo-stack int BufCapacityA; // end-user buffer capacity - float ScrollX; // horizontal scrolling/offset - ImStb::STB_TexteditState Stb; // state for stb_textedit.h + ImVec2 Scroll; // horizontal offset (managed manually) + vertical scrolling (pulled from child window's own Scroll.y) float CursorAnim; // timer for cursor blink, reset on every user action so the cursor reappears immediately bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!) bool SelectedAllMouseLock; // after a double-click to select all, we ignore further mouse drags to update selection bool Edited; // edited this frame ImGuiInputTextFlags Flags; // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set. - - ImGuiInputTextState() { memset(this, 0, sizeof(*this)); } - void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); } - void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); } - int GetUndoAvailCount() const { return Stb.undostate.undo_point; } - int GetRedoAvailCount() const { return STB_TEXTEDIT_UNDOSTATECOUNT - Stb.undostate.redo_point; } + bool ReloadUserBuf; // force a reload of user buf so it may be modified externally. may be automatic in future version. + int ReloadSelectionStart; // POSITIONS ARE IN IMWCHAR units *NOT* UTF-8 this is why this is not exposed yet. + int ReloadSelectionEnd; + + ImGuiInputTextState(); + ~ImGuiInputTextState(); + void ClearText() { CurLenA = 0; TextA[0] = 0; CursorClamp(); } + void ClearFreeMemory() { TextA.clear(); InitialTextA.clear(); } void OnKeyPressed(int key); // Cannot be inline because we call in code in stb_textedit.h implementation + void OnCharPressed(unsigned int c); // Cursor & Selection - void CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking - void CursorClamp() { Stb.cursor = ImMin(Stb.cursor, CurLenW); Stb.select_start = ImMin(Stb.select_start, CurLenW); Stb.select_end = ImMin(Stb.select_end, CurLenW); } - bool HasSelection() const { return Stb.select_start != Stb.select_end; } - void ClearSelection() { Stb.select_start = Stb.select_end = Stb.cursor; } - int GetCursorPos() const { return Stb.cursor; } - int GetSelectionStart() const { return Stb.select_start; } - int GetSelectionEnd() const { return Stb.select_end; } - void SelectAll() { Stb.select_start = 0; Stb.cursor = Stb.select_end = CurLenW; Stb.has_preferred_x = 0; } -}; - -// Storage for current popup stack -struct ImGuiPopupData -{ - ImGuiID PopupId; // Set on OpenPopup() - ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup() - ImGuiWindow* BackupNavWindow;// Set on OpenPopup(), a NavWindow that will be restored on popup close - int ParentNavLayer; // Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as "not any of layers" value - int OpenFrameCount; // Set on OpenPopup() - ImGuiID OpenParentId; // Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items) - ImVec2 OpenPopupPos; // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse) - ImVec2 OpenMousePos; // Set on OpenPopup(), copy of mouse position at the time of opening popup - - ImGuiPopupData() { memset(this, 0, sizeof(*this)); ParentNavLayer = OpenFrameCount = -1; } + void CursorAnimReset(); + void CursorClamp(); + bool HasSelection() const; + void ClearSelection(); + int GetCursorPos() const; + int GetSelectionStart() const; + int GetSelectionEnd() const; + void SelectAll(); + + // Reload user buf (WIP #2890) + // If you modify underlying user-passed const char* while active you need to call this (InputText V2 may lift this) + // strcpy(my_buf, "hello"); + // if (ImGuiInputTextState* state = ImGui::GetInputTextState(id)) // id may be ImGui::GetItemID() is last item + // state->ReloadUserBufAndSelectAll(); + void ReloadUserBufAndSelectAll(); + void ReloadUserBufAndKeepSelection(); + void ReloadUserBufAndMoveToEnd(); +}; + +enum ImGuiWindowRefreshFlags_ +{ + ImGuiWindowRefreshFlags_None = 0, + ImGuiWindowRefreshFlags_TryToAvoidRefresh = 1 << 0, // [EXPERIMENTAL] Try to keep existing contents, USER MUST NOT HONOR BEGIN() RETURNING FALSE AND NOT APPEND. + ImGuiWindowRefreshFlags_RefreshOnHover = 1 << 1, // [EXPERIMENTAL] Always refresh on hover + ImGuiWindowRefreshFlags_RefreshOnFocus = 1 << 2, // [EXPERIMENTAL] Always refresh on focus + // Refresh policy/frequency, Load Balancing etc. }; enum ImGuiNextWindowDataFlags_ @@ -1144,6 +1168,8 @@ enum ImGuiNextWindowDataFlags_ ImGuiNextWindowDataFlags_HasFocus = 1 << 5, ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6, ImGuiNextWindowDataFlags_HasScroll = 1 << 7, + ImGuiNextWindowDataFlags_HasChildFlags = 1 << 8, + ImGuiNextWindowDataFlags_HasRefreshPolicy = 1 << 9, }; // Storage for SetNexWindow** functions @@ -1158,12 +1184,14 @@ struct ImGuiNextWindowData ImVec2 SizeVal; ImVec2 ContentSizeVal; ImVec2 ScrollVal; + ImGuiChildFlags ChildFlags; bool CollapsedVal; ImRect SizeConstraintRect; ImGuiSizeCallback SizeCallback; void* SizeCallbackUserData; float BgAlphaVal; // Override background alpha ImVec2 MenuBarOffsetMinVal; // (Always on) This is not exposed publicly, so we don't clear it and it doesn't have a corresponding flag (could we? for consistency?) + ImGuiWindowRefreshFlags RefreshFlagsVal; ImGuiNextWindowData() { memset(this, 0, sizeof(*this)); } inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; } @@ -1171,50 +1199,67 @@ struct ImGuiNextWindowData enum ImGuiNextItemDataFlags_ { - ImGuiNextItemDataFlags_None = 0, - ImGuiNextItemDataFlags_HasWidth = 1 << 0, - ImGuiNextItemDataFlags_HasOpen = 1 << 1, + ImGuiNextItemDataFlags_None = 0, + ImGuiNextItemDataFlags_HasWidth = 1 << 0, + ImGuiNextItemDataFlags_HasOpen = 1 << 1, + ImGuiNextItemDataFlags_HasShortcut = 1 << 2, + ImGuiNextItemDataFlags_HasRefVal = 1 << 3, + ImGuiNextItemDataFlags_HasStorageID = 1 << 4, }; struct ImGuiNextItemData { - ImGuiNextItemDataFlags Flags; - ImGuiItemFlags ItemFlags; // Currently only tested/used for ImGuiItemFlags_AllowOverlap. - float Width; // Set by SetNextItemWidth() - ImGuiID FocusScopeId; // Set by SetNextItemMultiSelectData() (!= 0 signify value has been set, so it's an alternate version of HasSelectionData, we don't use Flags for this because they are cleared too early. This is mostly used for debugging) - ImGuiCond OpenCond; - bool OpenVal; // Set by SetNextItemOpen() + ImGuiNextItemDataFlags HasFlags; // Called HasFlags instead of Flags to avoid mistaking this + ImGuiItemFlags ItemFlags; // Currently only tested/used for ImGuiItemFlags_AllowOverlap and ImGuiItemFlags_HasSelectionUserData. + // Non-flags members are NOT cleared by ItemAdd() meaning they are still valid during NavProcessItem() + ImGuiID FocusScopeId; // Set by SetNextItemSelectionUserData() + ImGuiSelectionUserData SelectionUserData; // Set by SetNextItemSelectionUserData() (note that NULL/0 is a valid value, we use -1 == ImGuiSelectionUserData_Invalid to mark invalid values) + float Width; // Set by SetNextItemWidth() + ImGuiKeyChord Shortcut; // Set by SetNextItemShortcut() + ImGuiInputFlags ShortcutFlags; // Set by SetNextItemShortcut() + bool OpenVal; // Set by SetNextItemOpen() + ImU8 OpenCond; // Set by SetNextItemOpen() + ImGuiDataTypeStorage RefVal; // Not exposed yet, for ImGuiInputTextFlags_ParseEmptyAsRefVal + ImGuiID StorageId; // Set by SetNextItemStorageID() - ImGuiNextItemData() { memset(this, 0, sizeof(*this)); } - inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; } // Also cleared manually by ItemAdd()! + ImGuiNextItemData() { memset(this, 0, sizeof(*this)); SelectionUserData = -1; } + inline void ClearFlags() { HasFlags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; } // Also cleared manually by ItemAdd()! }; // Status storage for the last submitted item struct ImGuiLastItemData { ImGuiID ID; - ImGuiItemFlags InFlags; // See ImGuiItemFlags_ + ImGuiItemFlags ItemFlags; // See ImGuiItemFlags_ ImGuiItemStatusFlags StatusFlags; // See ImGuiItemStatusFlags_ ImRect Rect; // Full rectangle ImRect NavRect; // Navigation scoring rectangle (not displayed) - ImRect DisplayRect; // Display rectangle (only if ImGuiItemStatusFlags_HasDisplayRect is set) + // Rarely used fields are not explicitly cleared, only valid when the corresponding ImGuiItemStatusFlags ar set. + ImRect DisplayRect; // Display rectangle. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasDisplayRect) is set. + ImRect ClipRect; // Clip rectangle at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasClipRect) is set.. + ImGuiKeyChord Shortcut; // Shortcut at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasShortcut) is set.. ImGuiLastItemData() { memset(this, 0, sizeof(*this)); } }; -// Store data emitted by TreeNode() for usage by TreePop() to implement ImGuiTreeNodeFlags_NavLeftJumpsBackHere. -// This is the minimum amount of data that we need to perform the equivalent of NavApplyItemToResult() and which we can't infer in TreePop() -// Only stored when the node is a potential candidate for landing on a Left arrow jump. -struct ImGuiNavTreeNodeData +// Store data emitted by TreeNode() for usage by TreePop() +// - To implement ImGuiTreeNodeFlags_NavLeftJumpsBackHere: store the minimum amount of data +// which we can't infer in TreePop(), to perform the equivalent of NavApplyItemToResult(). +// Only stored when the node is a potential candidate for landing on a Left arrow jump. +struct ImGuiTreeNodeStackData { ImGuiID ID; - ImGuiItemFlags InFlags; - ImRect NavRect; + ImGuiTreeNodeFlags TreeFlags; + ImGuiItemFlags ItemFlags; // Used for nav landing + ImRect NavRect; // Used for nav landing }; -struct IMGUI_API ImGuiStackSizes +// sizeof() = 20 +struct IMGUI_API ImGuiErrorRecoveryState { + short SizeOfWindowStack; short SizeOfIDStack; + short SizeOfTreeStack; short SizeOfColorStack; short SizeOfStyleVarStack; short SizeOfFontStack; @@ -1224,9 +1269,7 @@ struct IMGUI_API ImGuiStackSizes short SizeOfBeginPopupStack; short SizeOfDisabledStack; - ImGuiStackSizes() { memset(this, 0, sizeof(*this)); } - void SetToContextState(ImGuiContext* ctx); - void CompareWithContextState(ImGuiContext* ctx); + ImGuiErrorRecoveryState() { memset(this, 0, sizeof(*this)); } }; // Data saved for each window pushed into the stack @@ -1234,7 +1277,8 @@ struct ImGuiWindowStackData { ImGuiWindow* Window; ImGuiLastItemData ParentLastItemDataBackup; - ImGuiStackSizes StackSizesOnBegin; // Store size of various stacks for asserting + ImGuiErrorRecoveryState StackSizesInBegin; // Store size of various stacks for asserting + bool DisabledOverrideReenable; // Non-child window override disabled flag }; struct ImGuiShrinkWidthItem @@ -1253,6 +1297,32 @@ struct ImGuiPtrOrIndex ImGuiPtrOrIndex(int index) { Ptr = NULL; Index = index; } }; +//----------------------------------------------------------------------------- +// [SECTION] Popup support +//----------------------------------------------------------------------------- + +enum ImGuiPopupPositionPolicy +{ + ImGuiPopupPositionPolicy_Default, + ImGuiPopupPositionPolicy_ComboBox, + ImGuiPopupPositionPolicy_Tooltip, +}; + +// Storage for popup stacks (g.OpenPopupStack and g.BeginPopupStack) +struct ImGuiPopupData +{ + ImGuiID PopupId; // Set on OpenPopup() + ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup() + ImGuiWindow* RestoreNavWindow;// Set on OpenPopup(), a NavWindow that will be restored on popup close + int ParentNavLayer; // Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as "not any of layers" value + int OpenFrameCount; // Set on OpenPopup() + ImGuiID OpenParentId; // Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items) + ImVec2 OpenPopupPos; // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse) + ImVec2 OpenMousePos; // Set on OpenPopup(), copy of mouse position at the time of opening popup + + ImGuiPopupData() { memset(this, 0, sizeof(*this)); ParentNavLayer = OpenFrameCount = -1; } +}; + //----------------------------------------------------------------------------- // [SECTION] Inputs support //----------------------------------------------------------------------------- @@ -1277,8 +1347,8 @@ typedef ImBitArray ImBitAr #define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift #define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1 #define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1 -#define ImGuiKey_NavGamepadActivate ImGuiKey_GamepadFaceDown -#define ImGuiKey_NavGamepadCancel ImGuiKey_GamepadFaceRight +#define ImGuiKey_NavGamepadActivate (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceRight : ImGuiKey_GamepadFaceDown) +#define ImGuiKey_NavGamepadCancel (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceDown : ImGuiKey_GamepadFaceRight) #define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft #define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp @@ -1300,7 +1370,6 @@ enum ImGuiInputSource ImGuiInputSource_Mouse, // Note: may be Mouse or TouchScreen or Pen. See io.MouseSource to distinguish them. ImGuiInputSource_Keyboard, ImGuiInputSource_Gamepad, - ImGuiInputSource_Clipboard, // Currently only used by InputText() ImGuiInputSource_COUNT }; @@ -1334,7 +1403,8 @@ struct ImGuiInputEvent // Input function taking an 'ImGuiID owner_id' argument defaults to (ImGuiKeyOwner_Any == 0) aka don't test ownership, which matches legacy behavior. #define ImGuiKeyOwner_Any ((ImGuiID)0) // Accept key that have an owner, UNLESS a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease. -#define ImGuiKeyOwner_None ((ImGuiID)-1) // Require key to have no owner. +#define ImGuiKeyOwner_NoOwner ((ImGuiID)-1) // Require key to have no owner. +//#define ImGuiKeyOwner_None ImGuiKeyOwner_NoOwner // We previously called this 'ImGuiKeyOwner_None' but it was inconsistent with our pattern that _None values == 0 and quite dangerous. Also using _NoOwner makes the IsKeyPressed() calls more explicit. typedef ImS16 ImGuiKeyRoutingIndex; @@ -1342,12 +1412,13 @@ typedef ImS16 ImGuiKeyRoutingIndex; struct ImGuiKeyRoutingData { ImGuiKeyRoutingIndex NextEntryIndex; - ImU16 Mods; // Technically we'd only need 4-bits but for simplify we store ImGuiMod_ values which need 16-bits. ImGuiMod_Shortcut is already translated to Ctrl/Super. + ImU16 Mods; // Technically we'd only need 4-bits but for simplify we store ImGuiMod_ values which need 16-bits. + ImU8 RoutingCurrScore; // [DEBUG] For debug display ImU8 RoutingNextScore; // Lower is better (0: perfect score) ImGuiID RoutingCurr; ImGuiID RoutingNext; - ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_None; } + ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingCurrScore = RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_NoOwner; } }; // Routing table: maintain a desired owner for each possible key-chord (key + mods), and setup owner in NewFrame() when mods are matching. @@ -1371,53 +1442,47 @@ struct ImGuiKeyOwnerData bool LockThisFrame; // Reading this key requires explicit owner id (until end of frame). Set by ImGuiInputFlags_LockThisFrame. bool LockUntilRelease; // Reading this key requires explicit owner id (until key is released). Set by ImGuiInputFlags_LockUntilRelease. When this is true LockThisFrame is always true as well. - ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_None; LockThisFrame = LockUntilRelease = false; } + ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_NoOwner; LockThisFrame = LockUntilRelease = false; } }; +// Extend ImGuiInputFlags_ // Flags for extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner() -// Don't mistake with ImGuiInputTextFlags! (for ImGui::InputText() function) -enum ImGuiInputFlags_ -{ - // Flags for IsKeyPressed(), IsMouseClicked(), Shortcut() - ImGuiInputFlags_None = 0, - ImGuiInputFlags_Repeat = 1 << 0, // Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1. - ImGuiInputFlags_RepeatRateDefault = 1 << 1, // Repeat rate: Regular (default) - ImGuiInputFlags_RepeatRateNavMove = 1 << 2, // Repeat rate: Fast - ImGuiInputFlags_RepeatRateNavTweak = 1 << 3, // Repeat rate: Faster - ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak, - - // Flags for SetItemKeyOwner() - ImGuiInputFlags_CondHovered = 1 << 4, // Only set if item is hovered (default to both) - ImGuiInputFlags_CondActive = 1 << 5, // Only set if item is active (default to both) - ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive, - ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive, +// Don't mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function) +enum ImGuiInputFlagsPrivate_ +{ + // Flags for IsKeyPressed(), IsKeyChordPressed(), IsMouseClicked(), Shortcut() + // - Repeat mode: Repeat rate selection + ImGuiInputFlags_RepeatRateDefault = 1 << 1, // Repeat rate: Regular (default) + ImGuiInputFlags_RepeatRateNavMove = 1 << 2, // Repeat rate: Fast + ImGuiInputFlags_RepeatRateNavTweak = 1 << 3, // Repeat rate: Faster + // - Repeat mode: Specify when repeating key pressed can be interrupted. + // - In theory ImGuiInputFlags_RepeatUntilOtherKeyPress may be a desirable default, but it would break too many behavior so everything is opt-in. + ImGuiInputFlags_RepeatUntilRelease = 1 << 4, // Stop repeating when released (default for all functions except Shortcut). This only exists to allow overriding Shortcut() default behavior. + ImGuiInputFlags_RepeatUntilKeyModsChange = 1 << 5, // Stop repeating when released OR if keyboard mods are changed (default for Shortcut) + ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone = 1 << 6, // Stop repeating when released OR if keyboard mods are leaving the None state. Allows going from Mod+Key to Key by releasing Mod. + ImGuiInputFlags_RepeatUntilOtherKeyPress = 1 << 7, // Stop repeating when released OR if any other keyboard key is pressed during the repeat // Flags for SetKeyOwner(), SetItemKeyOwner() - ImGuiInputFlags_LockThisFrame = 1 << 6, // Access to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared at end of frame. This is useful to make input-owner-aware code steal keys from non-input-owner-aware code. - ImGuiInputFlags_LockUntilRelease = 1 << 7, // Access to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared when the key is released or at end of each frame if key is released. This is useful to make input-owner-aware code steal keys from non-input-owner-aware code. + // - Locking key away from non-input aware code. Locking is useful to make input-owner-aware code steal keys from non-input-owner-aware code. If all code is input-owner-aware locking would never be necessary. + ImGuiInputFlags_LockThisFrame = 1 << 20, // Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared at end of frame. + ImGuiInputFlags_LockUntilRelease = 1 << 21, // Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared when the key is released or at end of each frame if key is released. - // Routing policies for Shortcut() + low-level SetShortcutRouting() - // - The general idea is that several callers register interest in a shortcut, and only one owner gets it. - // - When a policy (other than _RouteAlways) is set, Shortcut() will register itself with SetShortcutRouting(), - // allowing the system to decide where to route the input among other route-aware calls. - // - Shortcut() uses ImGuiInputFlags_RouteFocused by default: meaning that a simple Shortcut() poll - // will register a route and only succeed when parent window is in the focus stack and if no-one - // with a higher priority is claiming the shortcut. - // - Using ImGuiInputFlags_RouteAlways is roughly equivalent to doing e.g. IsKeyPressed(key) + testing mods. - // - Priorities: GlobalHigh > Focused (when owner is active item) > Global > Focused (when focused window) > GlobalLow. - // - Can select only 1 policy among all available. - ImGuiInputFlags_RouteFocused = 1 << 8, // (Default) Register focused route: Accept inputs if window is in focus stack. Deep-most focused window takes inputs. ActiveId takes inputs over deep-most focused window. - ImGuiInputFlags_RouteGlobalLow = 1 << 9, // Register route globally (lowest priority: unless a focused window or active item registered the route) -> recommended Global priority. - ImGuiInputFlags_RouteGlobal = 1 << 10, // Register route globally (medium priority: unless an active item registered the route, e.g. CTRL+A registered by InputText). - ImGuiInputFlags_RouteGlobalHigh = 1 << 11, // Register route globally (highest priority: unlikely you need to use that: will interfere with every active items) - ImGuiInputFlags_RouteMask_ = ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteGlobalLow | ImGuiInputFlags_RouteGlobalHigh, // _Always not part of this! - ImGuiInputFlags_RouteAlways = 1 << 12, // Do not register route, poll keys directly. - ImGuiInputFlags_RouteUnlessBgFocused= 1 << 13, // Global routes will not be applied if underlying background/void is focused (== no Dear ImGui windows are focused). Useful for overlay applications. - ImGuiInputFlags_RouteExtraMask_ = ImGuiInputFlags_RouteAlways | ImGuiInputFlags_RouteUnlessBgFocused, + // - Condition for SetItemKeyOwner() + ImGuiInputFlags_CondHovered = 1 << 22, // Only set if item is hovered (default to both) + ImGuiInputFlags_CondActive = 1 << 23, // Only set if item is active (default to both) + ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive, // [Internal] Mask of which function support which flags - ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_, - ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RouteMask_ | ImGuiInputFlags_RouteExtraMask_, + ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak, + ImGuiInputFlags_RepeatUntilMask_ = ImGuiInputFlags_RepeatUntilRelease | ImGuiInputFlags_RepeatUntilKeyModsChange | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone | ImGuiInputFlags_RepeatUntilOtherKeyPress, + ImGuiInputFlags_RepeatMask_ = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_, + ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive, + ImGuiInputFlags_RouteTypeMask_ = ImGuiInputFlags_RouteActive | ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteAlways, + ImGuiInputFlags_RouteOptionsMask_ = ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused | ImGuiInputFlags_RouteFromRootWindow, + ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_RepeatMask_, + ImGuiInputFlags_SupportedByIsMouseClicked = ImGuiInputFlags_Repeat, + ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_, + ImGuiInputFlags_SupportedBySetNextItemShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | ImGuiInputFlags_Tooltip, ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease, ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_, }; @@ -1462,6 +1527,8 @@ enum ImGuiActivateFlags_ ImGuiActivateFlags_PreferInput = 1 << 0, // Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default for Enter key. ImGuiActivateFlags_PreferTweak = 1 << 1, // Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default for Space key and if keyboard is not used. ImGuiActivateFlags_TryToPreserveState = 1 << 2, // Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection) + ImGuiActivateFlags_FromTabbing = 1 << 3, // Activation requested by a tabbing request + ImGuiActivateFlags_FromShortcut = 1 << 4, // Activation requested by an item shortcut via SetNextItemShortcut() function. }; // Early work-in-progress API for ScrollToItem() @@ -1479,13 +1546,18 @@ enum ImGuiScrollFlags_ ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY, }; -enum ImGuiNavHighlightFlags_ +enum ImGuiNavRenderCursorFlags_ { - ImGuiNavHighlightFlags_None = 0, - ImGuiNavHighlightFlags_TypeDefault = 1 << 0, - ImGuiNavHighlightFlags_TypeThin = 1 << 1, - ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) _even_ when using the mouse. - ImGuiNavHighlightFlags_NoRounding = 1 << 3, + ImGuiNavRenderCursorFlags_None = 0, + ImGuiNavRenderCursorFlags_Compact = 1 << 1, // Compact highlight, no padding/distance from focused item + ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) even when g.NavCursorVisible == false, aka even when using the mouse. + ImGuiNavRenderCursorFlags_NoRounding = 1 << 3, +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + ImGuiNavHighlightFlags_None = ImGuiNavRenderCursorFlags_None, // Renamed in 1.91.4 + ImGuiNavHighlightFlags_Compact = ImGuiNavRenderCursorFlags_Compact, // Renamed in 1.91.4 + ImGuiNavHighlightFlags_AlwaysDraw = ImGuiNavRenderCursorFlags_AlwaysDraw, // Renamed in 1.91.4 + ImGuiNavHighlightFlags_NoRounding = ImGuiNavRenderCursorFlags_NoRounding, // Renamed in 1.91.4 +#endif }; enum ImGuiNavMoveFlags_ @@ -1506,7 +1578,8 @@ enum ImGuiNavMoveFlags_ ImGuiNavMoveFlags_IsPageMove = 1 << 11, // Identify a PageDown/PageUp request. ImGuiNavMoveFlags_Activate = 1 << 12, // Activate/select target item. ImGuiNavMoveFlags_NoSelect = 1 << 13, // Don't trigger selection by not setting g.NavJustMovedTo - ImGuiNavMoveFlags_NoSetNavHighlight = 1 << 14, // Do not alter the visible state of keyboard vs mouse nav highlight + ImGuiNavMoveFlags_NoSetNavCursorVisible = 1 << 14, // Do not alter the nav cursor visible state + ImGuiNavMoveFlags_NoClearActiveId = 1 << 15, // (Experimental) Do not clear active id when applying move result }; enum ImGuiNavLayer @@ -1516,26 +1589,72 @@ enum ImGuiNavLayer ImGuiNavLayer_COUNT }; +// Storage for navigation query/results struct ImGuiNavItemData { ImGuiWindow* Window; // Init,Move // Best candidate window (result->ItemWindow->RootWindowForNav == request->Window) ImGuiID ID; // Init,Move // Best candidate item ID ImGuiID FocusScopeId; // Init,Move // Best candidate focus scope ID ImRect RectRel; // Init,Move // Best candidate bounding box in window relative space - ImGuiItemFlags InFlags; // ????,Move // Best candidate item flags + ImGuiItemFlags ItemFlags; // ????,Move // Best candidate item flags float DistBox; // Move // Best candidate box distance to current NavId float DistCenter; // Move // Best candidate center distance to current NavId float DistAxial; // Move // Best candidate axial distance to current NavId + ImGuiSelectionUserData SelectionUserData;//I+Mov // Best candidate SetNextItemSelectionUserData() value. Valid if (ItemFlags & ImGuiItemFlags_HasSelectionUserData) ImGuiNavItemData() { Clear(); } - void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; DistBox = DistCenter = DistAxial = FLT_MAX; } + void Clear() { Window = NULL; ID = FocusScopeId = 0; ItemFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; } +}; + +// Storage for PushFocusScope(), g.FocusScopeStack[], g.NavFocusRoute[] +struct ImGuiFocusScopeData +{ + ImGuiID ID; + ImGuiID WindowID; +}; + +//----------------------------------------------------------------------------- +// [SECTION] Typing-select support +//----------------------------------------------------------------------------- + +// Flags for GetTypingSelectRequest() +enum ImGuiTypingSelectFlags_ +{ + ImGuiTypingSelectFlags_None = 0, + ImGuiTypingSelectFlags_AllowBackspace = 1 << 0, // Backspace to delete character inputs. If using: ensure GetTypingSelectRequest() is not called more than once per frame (filter by e.g. focus state) + ImGuiTypingSelectFlags_AllowSingleCharMode = 1 << 1, // Allow "single char" search mode which is activated when pressing the same character multiple times. +}; + +// Returned by GetTypingSelectRequest(), designed to eventually be public. +struct IMGUI_API ImGuiTypingSelectRequest +{ + ImGuiTypingSelectFlags Flags; // Flags passed to GetTypingSelectRequest() + int SearchBufferLen; + const char* SearchBuffer; // Search buffer contents (use full string. unless SingleCharMode is set, in which case use SingleCharSize). + bool SelectRequest; // Set when buffer was modified this frame, requesting a selection. + bool SingleCharMode; // Notify when buffer contains same character repeated, to implement special mode. In this situation it preferred to not display any on-screen search indication. + ImS8 SingleCharSize; // Length in bytes of first letter codepoint (1 for ascii, 2-4 for UTF-8). If (SearchBufferLen==RepeatCharSize) only 1 letter has been input. +}; + +// Storage for GetTypingSelectRequest() +struct IMGUI_API ImGuiTypingSelectState +{ + ImGuiTypingSelectRequest Request; // User-facing data + char SearchBuffer[64]; // Search buffer: no need to make dynamic as this search is very transient. + ImGuiID FocusScope; + int LastRequestFrame = 0; + float LastRequestTime = 0.0f; + bool SingleCharModeLock = false; // After a certain single char repeat count we lock into SingleCharMode. Two benefits: 1) buffer never fill, 2) we can provide an immediate SingleChar mode without timer elapsing. + + ImGuiTypingSelectState() { memset(this, 0, sizeof(*this)); } + void Clear() { SearchBuffer[0] = 0; SingleCharModeLock = false; } // We preserve remaining data for easier debugging }; //----------------------------------------------------------------------------- // [SECTION] Columns support //----------------------------------------------------------------------------- -// Flags for internal's BeginColumns(). Prefix using BeginTable() nowadays! +// Flags for internal's BeginColumns(). This is an obsolete API. Prefer using BeginTable() nowadays! enum ImGuiOldColumnFlags_ { ImGuiOldColumnFlags_None = 0, @@ -1543,16 +1662,16 @@ enum ImGuiOldColumnFlags_ ImGuiOldColumnFlags_NoResize = 1 << 1, // Disable resizing columns when clicking on the dividers ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2, // Disable column width preservation when adjusting columns ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3, // Disable forcing columns to fit within window - ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4, // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove. + ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4, // Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove. // Obsolete names (will be removed) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None, - ImGuiColumnsFlags_NoBorder = ImGuiOldColumnFlags_NoBorder, - ImGuiColumnsFlags_NoResize = ImGuiOldColumnFlags_NoResize, - ImGuiColumnsFlags_NoPreserveWidths = ImGuiOldColumnFlags_NoPreserveWidths, - ImGuiColumnsFlags_NoForceWithinWindow = ImGuiOldColumnFlags_NoForceWithinWindow, - ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize, + //ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None, + //ImGuiColumnsFlags_NoBorder = ImGuiOldColumnFlags_NoBorder, + //ImGuiColumnsFlags_NoResize = ImGuiOldColumnFlags_NoResize, + //ImGuiColumnsFlags_NoPreserveWidths = ImGuiOldColumnFlags_NoPreserveWidths, + //ImGuiColumnsFlags_NoForceWithinWindow = ImGuiOldColumnFlags_NoForceWithinWindow, + //ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize, #endif }; @@ -1587,13 +1706,80 @@ struct ImGuiOldColumns ImGuiOldColumns() { memset(this, 0, sizeof(*this)); } }; +//----------------------------------------------------------------------------- +// [SECTION] Box-select support +//----------------------------------------------------------------------------- + +struct ImGuiBoxSelectState +{ + // Active box-selection data (persistent, 1 active at a time) + ImGuiID ID; + bool IsActive; + bool IsStarting; + bool IsStartedFromVoid; // Starting click was not from an item. + bool IsStartedSetNavIdOnce; + bool RequestClear; + ImGuiKeyChord KeyMods : 16; // Latched key-mods for box-select logic. + ImVec2 StartPosRel; // Start position in window-contents relative space (to support scrolling) + ImVec2 EndPosRel; // End position in window-contents relative space + ImVec2 ScrollAccum; // Scrolling accumulator (to behave at high-frame spaces) + ImGuiWindow* Window; + + // Temporary/Transient data + bool UnclipMode; // (Temp/Transient, here in hot area). Set/cleared by the BeginMultiSelect()/EndMultiSelect() owning active box-select. + ImRect UnclipRect; // Rectangle where ItemAdd() clipping may be temporarily disabled. Need support by multi-select supporting widgets. + ImRect BoxSelectRectPrev; // Selection rectangle in absolute coordinates (derived every frame from BoxSelectStartPosRel and MousePos) + ImRect BoxSelectRectCurr; + + ImGuiBoxSelectState() { memset(this, 0, sizeof(*this)); } +}; + //----------------------------------------------------------------------------- // [SECTION] Multi-select support //----------------------------------------------------------------------------- -#ifdef IMGUI_HAS_MULTI_SELECT -// -#endif // #ifdef IMGUI_HAS_MULTI_SELECT +// We always assume that -1 is an invalid value (which works for indices and pointers) +#define ImGuiSelectionUserData_Invalid ((ImGuiSelectionUserData)-1) + +// Temporary storage for multi-select +struct IMGUI_API ImGuiMultiSelectTempData +{ + ImGuiMultiSelectIO IO; // MUST BE FIRST FIELD. Requests are set and returned by BeginMultiSelect()/EndMultiSelect() + written to by user during the loop. + ImGuiMultiSelectState* Storage; + ImGuiID FocusScopeId; // Copied from g.CurrentFocusScopeId (unless another selection scope was pushed manually) + ImGuiMultiSelectFlags Flags; + ImVec2 ScopeRectMin; + ImVec2 BackupCursorMaxPos; + ImGuiSelectionUserData LastSubmittedItem; // Copy of last submitted item data, used to merge output ranges. + ImGuiID BoxSelectId; + ImGuiKeyChord KeyMods; + ImS8 LoopRequestSetAll; // -1: no operation, 0: clear all, 1: select all. + bool IsEndIO; // Set when switching IO from BeginMultiSelect() to EndMultiSelect() state. + bool IsFocused; // Set if currently focusing the selection scope (any item of the selection). May be used if you have custom shortcut associated to selection. + bool IsKeyboardSetRange; // Set by BeginMultiSelect() when using Shift+Navigation. Because scrolling may be affected we can't afford a frame of lag with Shift+Navigation. + bool NavIdPassedBy; + bool RangeSrcPassedBy; // Set by the item that matches RangeSrcItem. + bool RangeDstPassedBy; // Set by the item that matches NavJustMovedToId when IsSetRange is set. + + ImGuiMultiSelectTempData() { Clear(); } + void Clear() { size_t io_sz = sizeof(IO); ClearIO(); memset((void*)(&IO + 1), 0, sizeof(*this) - io_sz); } // Zero-clear except IO as we preserve IO.Requests[] buffer allocation. + void ClearIO() { IO.Requests.resize(0); IO.RangeSrcItem = IO.NavIdItem = ImGuiSelectionUserData_Invalid; IO.NavIdSelected = IO.RangeSrcReset = false; } +}; + +// Persistent storage for multi-select (as long as selection is alive) +struct IMGUI_API ImGuiMultiSelectState +{ + ImGuiWindow* Window; + ImGuiID ID; + int LastFrameActive; // Last used frame-count, for GC. + int LastSelectionSize; // Set by BeginMultiSelect() based on optional info provided by user. May be -1 if unknown. + ImS8 RangeSelected; // -1 (don't have) or true/false + ImS8 NavIdSelected; // -1 (don't have) or true/false + ImGuiSelectionUserData RangeSrcItem; // + ImGuiSelectionUserData NavIdItem; // SetNextItemSelectionUserData() value for NavId (if part of submitted items) + + ImGuiMultiSelectState() { Window = NULL; ID = 0; LastFrameActive = LastSelectionSize = 0; RangeSelected = NavIdSelected = -1; RangeSrcItem = NavIdItem = ImGuiSelectionUserData_Invalid; } +}; //----------------------------------------------------------------------------- // [SECTION] Docking support @@ -1615,23 +1801,28 @@ struct ImGuiViewportP : public ImGuiViewport ImDrawList* BgFgDrawLists[2]; // Convenience background (0) and foreground (1) draw lists. We use them to draw software mouser cursor when io.MouseDrawCursor is set and to draw most debug overlays. ImDrawData DrawDataP; ImDrawDataBuilder DrawDataBuilder; // Temporary data while building final ImDrawData - ImVec2 WorkOffsetMin; // Work Area: Offset from Pos to top-left corner of Work Area. Generally (0,0) or (0,+main_menu_bar_height). Work Area is Full Area but without menu-bars/status-bars (so WorkArea always fit inside Pos/Size!) - ImVec2 WorkOffsetMax; // Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height). - ImVec2 BuildWorkOffsetMin; // Work Area: Offset being built during current frame. Generally >= 0.0f. - ImVec2 BuildWorkOffsetMax; // Work Area: Offset being built during current frame. Generally <= 0.0f. + + // Per-viewport work area + // - Insets are >= 0.0f values, distance from viewport corners to work area. + // - BeginMainMenuBar() and DockspaceOverViewport() tend to use work area to avoid stepping over existing contents. + // - Generally 'safeAreaInsets' in iOS land, 'DisplayCutout' in Android land. + ImVec2 WorkInsetMin; // Work Area inset locked for the frame. GetWorkRect() always fits within GetMainRect(). + ImVec2 WorkInsetMax; // " + ImVec2 BuildWorkInsetMin; // Work Area inset accumulator for current frame, to become next frame's WorkInset + ImVec2 BuildWorkInsetMax; // " ImGuiViewportP() { BgFgDrawListsLastFrame[0] = BgFgDrawListsLastFrame[1] = -1; BgFgDrawLists[0] = BgFgDrawLists[1] = NULL; } ~ImGuiViewportP() { if (BgFgDrawLists[0]) IM_DELETE(BgFgDrawLists[0]); if (BgFgDrawLists[1]) IM_DELETE(BgFgDrawLists[1]); } // Calculate work rect pos/size given a set of offset (we have 1 pair of offset for rect locked from last frame data, and 1 pair for currently building rect) - ImVec2 CalcWorkRectPos(const ImVec2& off_min) const { return ImVec2(Pos.x + off_min.x, Pos.y + off_min.y); } - ImVec2 CalcWorkRectSize(const ImVec2& off_min, const ImVec2& off_max) const { return ImVec2(ImMax(0.0f, Size.x - off_min.x + off_max.x), ImMax(0.0f, Size.y - off_min.y + off_max.y)); } - void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkOffsetMin); WorkSize = CalcWorkRectSize(WorkOffsetMin, WorkOffsetMax); } // Update public fields + ImVec2 CalcWorkRectPos(const ImVec2& inset_min) const { return ImVec2(Pos.x + inset_min.x, Pos.y + inset_min.y); } + ImVec2 CalcWorkRectSize(const ImVec2& inset_min, const ImVec2& inset_max) const { return ImVec2(ImMax(0.0f, Size.x - inset_min.x - inset_max.x), ImMax(0.0f, Size.y - inset_min.y - inset_max.y)); } + void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkInsetMin); WorkSize = CalcWorkRectSize(WorkInsetMin, WorkInsetMax); } // Update public fields // Helpers to retrieve ImRect (we don't need to store BuildWorkRect as every access tend to change it, hence the code asymmetry) ImRect GetMainRect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); } ImRect GetWorkRect() const { return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); } - ImRect GetBuildWorkRect() const { ImVec2 pos = CalcWorkRectPos(BuildWorkOffsetMin); ImVec2 size = CalcWorkRectSize(BuildWorkOffsetMin, BuildWorkOffsetMax); return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); } + ImRect GetBuildWorkRect() const { ImVec2 pos = CalcWorkRectPos(BuildWorkInsetMin); ImVec2 size = CalcWorkRectSize(BuildWorkInsetMin, BuildWorkInsetMax); return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); } }; //----------------------------------------------------------------------------- @@ -1647,6 +1838,7 @@ struct ImGuiWindowSettings ImVec2ih Pos; ImVec2ih Size; bool Collapsed; + bool IsChild; bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context) bool WantDelete; // Set to invalidate/delete the settings entry @@ -1684,6 +1876,8 @@ enum ImGuiLocKey : int ImGuiLocKey_WindowingMainMenuBar, ImGuiLocKey_WindowingPopup, ImGuiLocKey_WindowingUntitled, + ImGuiLocKey_OpenLink_s, + ImGuiLocKey_CopyLink, ImGuiLocKey_COUNT }; @@ -1693,6 +1887,21 @@ struct ImGuiLocEntry const char* Text; }; +//----------------------------------------------------------------------------- +// [SECTION] Error handling, State recovery support +//----------------------------------------------------------------------------- + +// Macros used by Recoverable Error handling +// - Only dispatch error if _EXPR: evaluate as assert (similar to an assert macro). +// - The message will always be a string literal, in order to increase likelihood of being display by an assert handler. +// - See 'Demo->Configuration->Error Handling' and ImGuiIO definitions for details on error handling. +// - Read https://github.com/ocornut/imgui/wiki/Error-Handling for details on error handling. +#ifndef IM_ASSERT_USER_ERROR +#define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0) // Recoverable User Error +#endif + +// The error callback is currently not public, as it is expected that only advanced users will rely on it. +typedef void (*ImGuiErrorCallback)(ImGuiContext* ctx, void* user_data, const char* msg); // Function signature for g.ErrorCallback //----------------------------------------------------------------------------- // [SECTION] Metrics, Debug Tools @@ -1701,30 +1910,56 @@ struct ImGuiLocEntry enum ImGuiDebugLogFlags_ { // Event types - ImGuiDebugLogFlags_None = 0, - ImGuiDebugLogFlags_EventActiveId = 1 << 0, - ImGuiDebugLogFlags_EventFocus = 1 << 1, - ImGuiDebugLogFlags_EventPopup = 1 << 2, - ImGuiDebugLogFlags_EventNav = 1 << 3, - ImGuiDebugLogFlags_EventClipper = 1 << 4, - ImGuiDebugLogFlags_EventSelection = 1 << 5, - ImGuiDebugLogFlags_EventIO = 1 << 6, - ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO, - ImGuiDebugLogFlags_OutputToTTY = 1 << 10, // Also send output to TTY + ImGuiDebugLogFlags_None = 0, + ImGuiDebugLogFlags_EventError = 1 << 0, // Error submitted by IM_ASSERT_USER_ERROR() + ImGuiDebugLogFlags_EventActiveId = 1 << 1, + ImGuiDebugLogFlags_EventFocus = 1 << 2, + ImGuiDebugLogFlags_EventPopup = 1 << 3, + ImGuiDebugLogFlags_EventNav = 1 << 4, + ImGuiDebugLogFlags_EventClipper = 1 << 5, + ImGuiDebugLogFlags_EventSelection = 1 << 6, + ImGuiDebugLogFlags_EventIO = 1 << 7, + ImGuiDebugLogFlags_EventInputRouting = 1 << 8, + ImGuiDebugLogFlags_EventDocking = 1 << 9, // Unused in this branch + ImGuiDebugLogFlags_EventViewport = 1 << 10, // Unused in this branch + + ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport, + ImGuiDebugLogFlags_OutputToTTY = 1 << 20, // Also send output to TTY + ImGuiDebugLogFlags_OutputToTestEngine = 1 << 21, // Also send output to Test Engine +}; + +struct ImGuiDebugAllocEntry +{ + int FrameCount; + ImS16 AllocCount; + ImS16 FreeCount; +}; + +struct ImGuiDebugAllocInfo +{ + int TotalAllocCount; // Number of call to MemAlloc(). + int TotalFreeCount; + ImS16 LastEntriesIdx; // Current index in buffer + ImGuiDebugAllocEntry LastEntriesBuf[6]; // Track last 6 frames that had allocations + + ImGuiDebugAllocInfo() { memset(this, 0, sizeof(*this)); } }; struct ImGuiMetricsConfig { bool ShowDebugLog = false; - bool ShowStackTool = false; + bool ShowIDStackTool = false; bool ShowWindowsRects = false; bool ShowWindowsBeginOrder = false; bool ShowTablesRects = false; bool ShowDrawCmdMesh = true; bool ShowDrawCmdBoundingBoxes = true; + bool ShowTextEncodingViewer = false; bool ShowAtlasTintedWithTextColor = false; int ShowWindowsRectsType = -1; int ShowTablesRectsType = -1; + int HighlightMonitorIdx = -1; + ImGuiID HighlightViewportID = 0; }; struct ImGuiStackLevelInfo @@ -1738,8 +1973,8 @@ struct ImGuiStackLevelInfo ImGuiStackLevelInfo() { memset(this, 0, sizeof(*this)); } }; -// State for Stack tool queries -struct ImGuiStackTool +// State for ID Stack tool queries +struct ImGuiIDStackTool { int LastActiveFrame; int StackLevel; // -1: query stack and resize Results, >= 0: individual stack level @@ -1748,7 +1983,7 @@ struct ImGuiStackTool bool CopyToClipboardOnCtrlC; float CopyToClipboardLastTime; - ImGuiStackTool() { memset(this, 0, sizeof(*this)); CopyToClipboardLastTime = -FLT_MAX; } + ImGuiIDStackTool() { memset(this, 0, sizeof(*this)); CopyToClipboardLastTime = -FLT_MAX; } }; //----------------------------------------------------------------------------- @@ -1778,10 +2013,13 @@ struct ImGuiContext bool Initialized; bool FontAtlasOwnedByContext; // IO.Fonts-> is owned by the ImGuiContext and will be destructed along with it. ImGuiIO IO; + ImGuiPlatformIO PlatformIO; ImGuiStyle Style; ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back() float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window. float FontBaseSize; // (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Base text height. + float FontScale; // == FontSize / Font->FontSize + float CurrentDpiScale; // Current window/viewport DpiScale ImDrawListSharedData DrawListSharedData; double Time; int FrameCount; @@ -1793,6 +2031,7 @@ struct ImGuiContext bool GcCompactAll; // Request full GC bool TestEngineHookItems; // Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log() void* TestEngine; // Test engine user data + char ContextName[16]; // Storage for a context name (to facilitate debugging multi-context setups) // Inputs ImVector InputEventsQueue; // Input events which will be trickled/written into IO structure. @@ -1807,26 +2046,32 @@ struct ImGuiContext ImVector CurrentWindowStack; ImGuiStorage WindowsById; // Map window's ImGuiID to ImGuiWindow* int WindowsActiveCount; // Number of unique windows submitted by frame - ImVec2 WindowsHoverPadding; // Padding around resizable windows for which hovering on counts as hovering the window == ImMax(style.TouchExtraPadding, WINDOWS_HOVER_PADDING) + ImVec2 WindowsHoverPadding; // Padding around resizable windows for which hovering on counts as hovering the window == ImMax(style.TouchExtraPadding, WINDOWS_HOVER_PADDING). + ImGuiID DebugBreakInWindow; // Set to break in Begin() call. ImGuiWindow* CurrentWindow; // Window being drawn into ImGuiWindow* HoveredWindow; // Window the mouse is hovering. Will typically catch mouse inputs. ImGuiWindow* HoveredWindowUnderMovingWindow; // Hovered window ignoring MovingWindow. Only set if MovingWindow is set. + ImGuiWindow* HoveredWindowBeforeClear; // Window the mouse is hovering. Filled even with _NoMouse. This is currently useful for multi-context compositors. ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindow. ImGuiWindow* WheelingWindow; // Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window. ImVec2 WheelingWindowRefMousePos; int WheelingWindowStartFrame; // This may be set one frame before WheelingWindow is != NULL + int WheelingWindowScrolledFrame; float WheelingWindowReleaseTimer; ImVec2 WheelingWindowWheelRemainder; ImVec2 WheelingAxisAvg; // Item/widgets state and tracking information - ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line] + ImGuiID DebugDrawIdConflicts; // Set when we detect multiple items with the same identifier + ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by ID Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line] ImGuiID HoveredId; // Hovered widget, filled during the frame ImGuiID HoveredIdPreviousFrame; - bool HoveredIdAllowOverlap; - bool HoveredIdDisabled; // At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be true even if HoveredId == 0. + int HoveredIdPreviousFrameItemCount; // Count numbers of items using the same ID as last frame's hovered id float HoveredIdTimer; // Measure contiguous hovering time float HoveredIdNotActiveTimer; // Measure contiguous hovering time where the item has not been active + bool HoveredIdAllowOverlap; + bool HoveredIdIsDisabled; // At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be true even if HoveredId == 0. + bool ItemUnclipByLog; // Disable ItemAdd() clipping, essentially a memory-locality friendly copy of LogEnabled ImGuiID ActiveId; // Active widget ImGuiID ActiveIdIsAlive; // Active widget has been seen this frame (we can't use a bool as the ActiveId may change within the frame) float ActiveIdTimer; @@ -1836,10 +2081,11 @@ struct ImGuiContext bool ActiveIdHasBeenPressedBefore; // Track whether the active id led to a press (this is to allow changing between PressOnClick and PressOnRelease without pressing twice). Used by range_select branch. bool ActiveIdHasBeenEditedBefore; // Was the value associated to the widget Edited over the course of the Active state. bool ActiveIdHasBeenEditedThisFrame; + bool ActiveIdFromShortcut; + int ActiveIdMouseButton : 8; ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior) ImGuiWindow* ActiveIdWindow; ImGuiInputSource ActiveIdSource; // Activating source: ImGuiInputSource_Mouse OR ImGuiInputSource_Keyboard OR ImGuiInputSource_Gamepad - int ActiveIdMouseButton; ImGuiID ActiveIdPreviousFrame; bool ActiveIdPreviousFrameIsAlive; bool ActiveIdPreviousFrameHasBeenEditedBefore; @@ -1847,61 +2093,68 @@ struct ImGuiContext ImGuiID LastActiveId; // Store the last non-zero ActiveId, useful for animation. float LastActiveIdTimer; // Store the last non-zero ActiveId timer since the beginning of activation, useful for animation. - // [EXPERIMENTAL] Key/Input Ownership + Shortcut Routing system + // Key/Input Ownership + Shortcut Routing system // - The idea is that instead of "eating" a given key, we can link to an owner. - // - Input query can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_None (== -1) or a custom ID. + // - Input query can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_NoOwner (== -1) or a custom ID. // - Routing is requested ahead of time for a given chord (Key + Mods) and granted in NewFrame(). + double LastKeyModsChangeTime; // Record the last time key mods changed (affect repeat delay when using shortcut logic) + double LastKeyModsChangeFromNoneTime; // Record the last time key mods changed away from being 0 (affect repeat delay when using shortcut logic) + double LastKeyboardKeyPressTime; // Record the last time a keyboard key (ignore mouse/gamepad ones) was pressed. + ImBitArrayForNamedKeys KeysMayBeCharInput; // Lookup to tell if a key can emit char input, see IsKeyChordPotentiallyCharInput(). sizeof() = 20 bytes ImGuiKeyOwnerData KeysOwnerData[ImGuiKey_NamedKey_COUNT]; ImGuiKeyRoutingTable KeysRoutingTable; ImU32 ActiveIdUsingNavDirMask; // Active widget will want to read those nav move requests (e.g. can activate a button and move away from it) - bool ActiveIdUsingAllKeyboardKeys; // Active widget will want to read all keyboard keys inputs. (FIXME: This is a shortcut for not taking ownership of 100+ keys but perhaps best to not have the inconsistency) -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - ImU32 ActiveIdUsingNavInputMask; // If you used this. Since (IMGUI_VERSION_NUM >= 18804) : 'g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel);' becomes 'SetKeyOwner(ImGuiKey_Escape, g.ActiveId) and/or SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId);' -#endif + bool ActiveIdUsingAllKeyboardKeys; // Active widget will want to read all keyboard keys inputs. (this is a shortcut for not taking ownership of 100+ keys, frequently used by drag operations) + ImGuiKeyChord DebugBreakInShortcutRouting; // Set to break in SetShortcutRouting()/Shortcut() calls. + //ImU32 ActiveIdUsingNavInputMask; // [OBSOLETE] Since (IMGUI_VERSION_NUM >= 18804) : 'g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel);' becomes --> 'SetKeyOwner(ImGuiKey_Escape, g.ActiveId) and/or SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId);' // Next window/item data - ImGuiID CurrentFocusScopeId; // == g.FocusScopeStack.back() - ImGuiItemFlags CurrentItemFlags; // == g.ItemFlagsStack.back() + ImGuiID CurrentFocusScopeId; // Value for currently appending items == g.FocusScopeStack.back(). Not to be mistaken with g.NavFocusScopeId. + ImGuiItemFlags CurrentItemFlags; // Value for currently appending items == g.ItemFlagsStack.back() ImGuiID DebugLocateId; // Storage for DebugLocateItemOnHover() feature: this is read by ItemAdd() so we keep it in a hot/cached location ImGuiNextItemData NextItemData; // Storage for SetNextItem** functions ImGuiLastItemData LastItemData; // Storage for last submitted item (setup by ItemAdd) ImGuiNextWindowData NextWindowData; // Storage for SetNextWindow** functions + bool DebugShowGroupRects; // Shared stacks - ImVector ColorStack; // Stack for PushStyleColor()/PopStyleColor() - inherited by Begin() - ImVector StyleVarStack; // Stack for PushStyleVar()/PopStyleVar() - inherited by Begin() - ImVector FontStack; // Stack for PushFont()/PopFont() - inherited by Begin() - ImVector FocusScopeStack; // Stack for PushFocusScope()/PopFocusScope() - inherited by BeginChild(), pushed into by Begin() - ImVectorItemFlagsStack; // Stack for PushItemFlag()/PopItemFlag() - inherited by Begin() - ImVectorGroupStack; // Stack for BeginGroup()/EndGroup() - not inherited by Begin() - ImVectorOpenPopupStack; // Which popups are open (persistent) - ImVectorBeginPopupStack; // Which level of BeginPopup() we are in (reset every frame) - ImVector NavTreeNodeStack; // Stack for TreeNode() when a NavLeft requested is emitted. - - int BeginMenuCount; + ImGuiCol DebugFlashStyleColorIdx; // (Keep close to ColorStack to share cache line) + ImVector ColorStack; // Stack for PushStyleColor()/PopStyleColor() - inherited by Begin() + ImVector StyleVarStack; // Stack for PushStyleVar()/PopStyleVar() - inherited by Begin() + ImVector FontStack; // Stack for PushFont()/PopFont() - inherited by Begin() + ImVector FocusScopeStack; // Stack for PushFocusScope()/PopFocusScope() - inherited by BeginChild(), pushed into by Begin() + ImVector ItemFlagsStack; // Stack for PushItemFlag()/PopItemFlag() - inherited by Begin() + ImVector GroupStack; // Stack for BeginGroup()/EndGroup() - not inherited by Begin() + ImVector OpenPopupStack; // Which popups are open (persistent) + ImVector BeginPopupStack; // Which level of BeginPopup() we are in (reset every frame) + ImVectorTreeNodeStack; // Stack for TreeNode() // Viewports ImVector Viewports; // Active viewports (Size==1 in 'master' branch). Each viewports hold their copy of ImDrawData. - // Gamepad/keyboard Navigation - ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow' + // Keyboard/Gamepad Navigation + bool NavCursorVisible; // Nav focus cursor/rectangle is visible? We hide it after a mouse click. We show it after a nav move. + bool NavHighlightItemUnderNav; // Disable mouse hovering highlight. Highlight navigation focused item instead of mouse hovered item. + //bool NavDisableHighlight; // Old name for !g.NavCursorVisible before 1.91.4 (2024/10/18). OPPOSITE VALUE (g.NavDisableHighlight == !g.NavCursorVisible) + //bool NavDisableMouseHover; // Old name for g.NavHighlightItemUnderNav before 1.91.1 (2024/10/18) this was called When user starts using keyboard/gamepad, we hide mouse hovering highlight until mouse is touched again. + bool NavMousePosDirty; // When set we will update mouse position if io.ConfigNavMoveSetMousePos is set (not enabled by default) + bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRectRel is valid ImGuiID NavId; // Focused item for navigation - ImGuiID NavFocusScopeId; // Identify a selection scope (selection code often wants to "clear other items" when landing on an item of the selection set) + ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow' + ImGuiID NavFocusScopeId; // Focused focus scope (e.g. selection code often wants to "clear other items" when landing on an item of the same scope) + ImGuiNavLayer NavLayer; // Focused layer (main scrolling layer, or menu/title bar layer) ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem() ImGuiID NavActivateDownId; // ~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0 ImGuiID NavActivatePressedId; // ~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat) ImGuiActivateFlags NavActivateFlags; - ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest). - ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest). - ImGuiKeyChord NavJustMovedToKeyMods; + ImVector NavFocusRoute; // Reversed copy focus scope stack for NavId (should contains NavFocusScopeId). This essentially follow the window->ParentWindowForFocusRoute chain. + ImGuiID NavHighlightActivatedId; + float NavHighlightActivatedTimer; ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame. ImGuiActivateFlags NavNextActivateFlags; ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Mouse - ImGuiNavLayer NavLayer; // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later. - bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRectRel is valid - bool NavMousePosDirty; // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default) - bool NavDisableHighlight; // When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover) - bool NavDisableMouseHover; // When user starts using gamepad/keyboard, we hide mouse hovering highlight until mouse is touched again. + ImGuiSelectionUserData NavLastValidSelectionUserData; // Last valid data passed to SetNextItemSelectionUser(), or -1. For current window. Not reset when focusing an item that doesn't have selection data. + ImS8 NavCursorHideFrames; // Navigation: Init & Move Requests bool NavAnyRequest; // ~~ NavMoveRequest || NavInitRequest this is to perform early out in ItemAdd() @@ -1927,15 +2180,24 @@ struct ImGuiContext ImGuiNavItemData NavMoveResultOther; // Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag) ImGuiNavItemData NavTabbingResultFirst; // First tabbing request candidate within NavWindow and flattened hierarchy + // Navigation: record of last move request + ImGuiID NavJustMovedFromFocusScopeId; // Just navigated from this focus scope id (result of a successfully MoveRequest). + ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest). + ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest). + ImGuiKeyChord NavJustMovedToKeyMods; + bool NavJustMovedToIsTabbing; // Copy of ImGuiNavMoveFlags_IsTabbing. Maybe we should store whole flags. + bool NavJustMovedToHasSelectionData; // Copy of move result's ItemFlags & ImGuiItemFlags_HasSelectionUserData). Maybe we should just store ImGuiNavItemData. + // Navigation: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize) - ImGuiKeyChord ConfigNavWindowingKeyNext; // = ImGuiMod_Ctrl | ImGuiKey_Tab, for reconfiguration (see #4828) - ImGuiKeyChord ConfigNavWindowingKeyPrev; // = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab + ImGuiKeyChord ConfigNavWindowingKeyNext; // = ImGuiMod_Ctrl | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiKey_Tab on OS X). For reconfiguration (see #4828) + ImGuiKeyChord ConfigNavWindowingKeyPrev; // = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiMod_Shift | ImGuiKey_Tab on OS X) ImGuiWindow* NavWindowingTarget; // Target window when doing CTRL+Tab (or Pad Menu + FocusPrev/Next), this window is temporarily displayed top-most! ImGuiWindow* NavWindowingTargetAnim; // Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0f, so the fade-out can stay on it. ImGuiWindow* NavWindowingListWindow; // Internal window actually listing the CTRL+Tab contents float NavWindowingTimer; float NavWindowingHighlightAlpha; bool NavWindowingToggleLayer; + ImGuiKey NavWindowingToggleKey; ImVec2 NavWindowingAccumDeltaPos; ImVec2 NavWindowingAccumDeltaSize; @@ -1951,6 +2213,7 @@ struct ImGuiContext int DragDropMouseButton; ImGuiPayload DragDropPayload; ImRect DragDropTargetRect; // Store rectangle of current target candidate (we favor small targets when overlapping) + ImRect DragDropTargetClipRect; // Store ClipRect at the time of item's drawing ImGuiID DragDropTargetId; ImGuiDragDropFlags DragDropAcceptFlags; float DragDropAcceptIdCurrRectSurface; // Target item surface (we resolve overlapping targets by prioritizing the smaller surface) @@ -1967,6 +2230,7 @@ struct ImGuiContext // Tables ImGuiTable* CurrentTable; + ImGuiID DebugBreakInTable; // Set to break in BeginTable() call. int TablesTempDataStacked; // Temporary table data size (because we leave previous instances undestructed, we generally don't use TablesTempData.Size) ImVector TablesTempData; // Temporary table data (buffers reused/shared across instances, support nesting) ImPool Tables; // Persistent table data @@ -1979,6 +2243,13 @@ struct ImGuiContext ImVector CurrentTabBarStack; ImVector ShrinkWidthBuffer; + // Multi-Select state + ImGuiBoxSelectState BoxSelectState; + ImGuiMultiSelectTempData* CurrentMultiSelect; + int MultiSelectTempDataStacked; // Temporary multi-select data size (because we leave previous instances undestructed, we generally don't use MultiSelectTempData.Size) + ImVector MultiSelectTempData; + ImPool MultiSelectStorage; + // Hover Delay system ImGuiID HoverItemDelayId; ImGuiID HoverItemDelayIdPreviousFrame; @@ -1997,6 +2268,9 @@ struct ImGuiContext ImGuiInputTextDeactivatedState InputTextDeactivatedState; ImFont InputTextPasswordFont; ImGuiID TempInputId; // Temporary text input when CTRL+clicking on a slider, etc. + ImGuiDataTypeStorage DataTypeZeroValue; // 0 for all data types + int BeginMenuDepth; + int BeginComboDepth; ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets ImGuiID ColorEditCurrentID; // Set temporarily while inside of the parent-most ColorEdit4/ColorPicker4 (because they call each others). ImGuiID ColorEditSavedID; // ID we are saving/restoring HS for @@ -2005,23 +2279,27 @@ struct ImGuiContext ImU32 ColorEditSavedColor; // RGB value with alpha set to 0. ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker. ImGuiComboPreviewData ComboPreviewData; + ImRect WindowResizeBorderExpectedRect; // Expected border rect, switch to relative edit if moving + bool WindowResizeRelativeMode; + short ScrollbarSeekMode; // 0: scroll to clicked location, -1/+1: prev/next page. + float ScrollbarClickDeltaToGrabCenter; // When scrolling to mouse location: distance between mouse and center of grab box, normalized in parent space. float SliderGrabClickOffset; float SliderCurrentAccum; // Accumulated slider delta when using navigation controls. bool SliderCurrentAccumDirty; // Has the accumulated slider delta changed since last time we tried to apply it? bool DragCurrentAccumDirty; float DragCurrentAccum; // Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings float DragSpeedDefaultRatio; // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio - float ScrollbarClickDeltaToGrabCenter; // Distance between mouse and center of grab box, normalized in parent space. Use storage? float DisabledAlphaBackup; // Backup for style.Alpha for BeginDisabled() short DisabledStackSize; - short LockMarkEdited; short TooltipOverrideCount; + ImGuiWindow* TooltipPreviousWindow; // Window of last tooltip submitted during the frame ImVector ClipboardHandlerData; // If no custom clipboard handler is defined ImVector MenusIdSubmittedThisFrame; // A list of menu IDs that were rendered at least once + ImGuiTypingSelectState TypingSelectState; // State for GetTypingSelectRequest() // Platform support ImGuiPlatformImeData PlatformImeData; // Data updated by current frame - ImGuiPlatformImeData PlatformImeDataPrev; // Previous frame data (when changing we will call io.SetPlatformImeDataFn + ImGuiPlatformImeData PlatformImeDataPrev; // Previous frame data. When changed we call the platform_io.Platform_SetImeDataFn() handler. // Settings bool SettingsLoaded; @@ -2049,18 +2327,36 @@ struct ImGuiContext int LogDepthToExpand; int LogDepthToExpandDefault; // Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call. + // Error Handling + ImGuiErrorCallback ErrorCallback; // = NULL. May be exposed in public API eventually. + void* ErrorCallbackUserData; // = NULL + ImVec2 ErrorTooltipLockedPos; + bool ErrorFirst; + int ErrorCountCurrentFrame; // [Internal] Number of errors submitted this frame. + ImGuiErrorRecoveryState StackSizesInNewFrame; // [Internal] + ImGuiErrorRecoveryState*StackSizesInBeginForCurrentWindow; // [Internal] + // Debug Tools + // (some of the highly frequently used data are interleaved in other structures above: DebugBreakXXX fields, DebugHookIdInfo, DebugLocateId etc.) + int DebugDrawIdConflictsCount; // Locked count (preserved when holding CTRL) ImGuiDebugLogFlags DebugLogFlags; ImGuiTextBuffer DebugLogBuf; ImGuiTextIndex DebugLogIndex; - ImU8 DebugLogClipperAutoDisableFrames; + int DebugLogSkippedErrors; + ImGuiDebugLogFlags DebugLogAutoDisableFlags; + ImU8 DebugLogAutoDisableFrames; ImU8 DebugLocateFrames; // For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above. + bool DebugBreakInLocateId; // Debug break in ItemAdd() call for g.DebugLocateId. + ImGuiKeyChord DebugBreakKeyChord; // = ImGuiKey_Pause ImS8 DebugBeginReturnValueCullDepth; // Cycle between 0..9 then wrap around. bool DebugItemPickerActive; // Item picker is active (started with DebugStartItemPicker()) ImU8 DebugItemPickerMouseButton; ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this ID + float DebugFlashStyleColorTime; + ImVec4 DebugFlashStyleColorBackup; ImGuiMetricsConfig DebugMetricsConfig; - ImGuiStackTool DebugStackTool; + ImGuiIDStackTool DebugIDStackTool; + ImGuiDebugAllocInfo DebugAllocInfo; // Misc float FramerateSecPerFrame[60]; // Calculate estimate of framerate for user over the last 60 frames.. @@ -2071,178 +2367,9 @@ struct ImGuiContext int WantCaptureKeyboardNextFrame; // " int WantTextInputNextFrame; ImVector TempBuffer; // Temporary text buffer + char TempKeychordName[64]; - ImGuiContext(ImFontAtlas* shared_font_atlas) - { - IO.Ctx = this; - InputTextState.Ctx = this; - - Initialized = false; - FontAtlasOwnedByContext = shared_font_atlas ? false : true; - Font = NULL; - FontSize = FontBaseSize = 0.0f; - IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)(); - Time = 0.0f; - FrameCount = 0; - FrameCountEnded = FrameCountRendered = -1; - WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false; - GcCompactAll = false; - TestEngineHookItems = false; - TestEngine = NULL; - - InputEventsNextMouseSource = ImGuiMouseSource_Mouse; - InputEventsNextEventId = 1; - - WindowsActiveCount = 0; - CurrentWindow = NULL; - HoveredWindow = NULL; - HoveredWindowUnderMovingWindow = NULL; - MovingWindow = NULL; - WheelingWindow = NULL; - WheelingWindowStartFrame = -1; - WheelingWindowReleaseTimer = 0.0f; - - DebugHookIdInfo = 0; - HoveredId = HoveredIdPreviousFrame = 0; - HoveredIdAllowOverlap = false; - HoveredIdDisabled = false; - HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f; - ActiveId = 0; - ActiveIdIsAlive = 0; - ActiveIdTimer = 0.0f; - ActiveIdIsJustActivated = false; - ActiveIdAllowOverlap = false; - ActiveIdNoClearOnFocusLoss = false; - ActiveIdHasBeenPressedBefore = false; - ActiveIdHasBeenEditedBefore = false; - ActiveIdHasBeenEditedThisFrame = false; - ActiveIdClickOffset = ImVec2(-1, -1); - ActiveIdWindow = NULL; - ActiveIdSource = ImGuiInputSource_None; - ActiveIdMouseButton = -1; - ActiveIdPreviousFrame = 0; - ActiveIdPreviousFrameIsAlive = false; - ActiveIdPreviousFrameHasBeenEditedBefore = false; - ActiveIdPreviousFrameWindow = NULL; - LastActiveId = 0; - LastActiveIdTimer = 0.0f; - - ActiveIdUsingNavDirMask = 0x00; - ActiveIdUsingAllKeyboardKeys = false; -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - ActiveIdUsingNavInputMask = 0x00; -#endif - - CurrentFocusScopeId = 0; - CurrentItemFlags = ImGuiItemFlags_None; - BeginMenuCount = 0; - - NavWindow = NULL; - NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = 0; - NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0; - NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None; - NavJustMovedToKeyMods = ImGuiMod_None; - NavInputSource = ImGuiInputSource_Keyboard; - NavLayer = ImGuiNavLayer_Main; - NavIdIsAlive = false; - NavMousePosDirty = false; - NavDisableHighlight = true; - NavDisableMouseHover = false; - NavAnyRequest = false; - NavInitRequest = false; - NavInitRequestFromMove = false; - NavMoveSubmitted = false; - NavMoveScoringItems = false; - NavMoveForwardToNextFrame = false; - NavMoveFlags = ImGuiNavMoveFlags_None; - NavMoveScrollFlags = ImGuiScrollFlags_None; - NavMoveKeyMods = ImGuiMod_None; - NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None; - NavScoringDebugCount = 0; - NavTabbingDir = 0; - NavTabbingCounter = 0; - - ConfigNavWindowingKeyNext = ImGuiMod_Ctrl | ImGuiKey_Tab; - ConfigNavWindowingKeyPrev = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab; - NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL; - NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f; - NavWindowingToggleLayer = false; - - DimBgRatio = 0.0f; - - DragDropActive = DragDropWithinSource = DragDropWithinTarget = false; - DragDropSourceFlags = ImGuiDragDropFlags_None; - DragDropSourceFrameCount = -1; - DragDropMouseButton = -1; - DragDropTargetId = 0; - DragDropAcceptFlags = ImGuiDragDropFlags_None; - DragDropAcceptIdCurrRectSurface = 0.0f; - DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0; - DragDropAcceptFrameCount = -1; - DragDropHoldJustPressedId = 0; - memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal)); - - ClipperTempDataStacked = 0; - - CurrentTable = NULL; - TablesTempDataStacked = 0; - CurrentTabBar = NULL; - - HoverItemDelayId = HoverItemDelayIdPreviousFrame = HoverItemUnlockedStationaryId = HoverWindowUnlockedStationaryId = 0; - HoverItemDelayTimer = HoverItemDelayClearTimer = 0.0f; - - MouseCursor = ImGuiMouseCursor_Arrow; - MouseStationaryTimer = 0.0f; - - TempInputId = 0; - ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_; - ColorEditCurrentID = ColorEditSavedID = 0; - ColorEditSavedHue = ColorEditSavedSat = 0.0f; - ColorEditSavedColor = 0; - SliderGrabClickOffset = 0.0f; - SliderCurrentAccum = 0.0f; - SliderCurrentAccumDirty = false; - DragCurrentAccumDirty = false; - DragCurrentAccum = 0.0f; - DragSpeedDefaultRatio = 1.0f / 100.0f; - ScrollbarClickDeltaToGrabCenter = 0.0f; - DisabledAlphaBackup = 0.0f; - DisabledStackSize = 0; - LockMarkEdited = 0; - TooltipOverrideCount = 0; - - PlatformImeData.InputPos = ImVec2(0.0f, 0.0f); - PlatformImeDataPrev.InputPos = ImVec2(-1.0f, -1.0f); // Different to ensure initial submission - - SettingsLoaded = false; - SettingsDirtyTimer = 0.0f; - HookIdNext = 0; - - memset(LocalizationTable, 0, sizeof(LocalizationTable)); - - LogEnabled = false; - LogType = ImGuiLogType_None; - LogNextPrefix = LogNextSuffix = NULL; - LogFile = NULL; - LogLinePosY = FLT_MAX; - LogLineFirstItem = false; - LogDepthRef = 0; - LogDepthToExpand = LogDepthToExpandDefault = 2; - - DebugLogFlags = ImGuiDebugLogFlags_OutputToTTY; - DebugLocateId = 0; - DebugLogClipperAutoDisableFrames = 0; - DebugLocateFrames = 0; - DebugBeginReturnValueCullDepth = -1; - DebugItemPickerActive = false; - DebugItemPickerMouseButton = ImGuiMouseButton_Left; - DebugItemPickerBreakId = 0; - - memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame)); - FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0; - FramerateSecPerFrameAccum = 0.0f; - WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1; - } + ImGuiContext(ImFontAtlas* shared_font_atlas); }; //----------------------------------------------------------------------------- @@ -2284,13 +2411,14 @@ struct IMGUI_API ImGuiWindowTempData ImVec2 MenuBarOffset; // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs. ImGuiMenuColumns MenuColumns; // Simplified columns storage for menu items measurement int TreeDepth; // Current tree depth. - ImU32 TreeJumpToParentOnPopMask; // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31.. Could be turned into a ImU64 if necessary. + ImU32 TreeHasStackDataDepthMask; // Store whether given depth has ImGuiTreeNodeStackData data. Could be turned into a ImU64 if necessary. ImVector ChildWindows; ImGuiStorage* StateStorage; // Current persistent per-window storage (store e.g. tree node open/close state) ImGuiOldColumns* CurrentColumns; // Current columns set int CurrentTableIdx; // Current table index (into g.Tables) ImGuiLayoutType LayoutType; ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin() + ImU32 ModalDimBgColor; // Local parameters stacks // We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings. @@ -2307,6 +2435,7 @@ struct IMGUI_API ImGuiWindow char* Name; // Window name, owned by the window. ImGuiID ID; // == ImHashStr(Name) ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_ + ImGuiChildFlags ChildFlags; // Set when window is a child window. See enum ImGuiChildFlags_ ImGuiViewportP* Viewport; // Always set in Begin(). Inactive windows may have a NULL value here if their viewport was discarded. ImVec2 Pos; // Position (always rounded-up to nearest pixel) ImVec2 Size; // Current size (==SizeFull or collapsed title bar size) @@ -2317,12 +2446,14 @@ struct IMGUI_API ImGuiWindow ImVec2 WindowPadding; // Window padding at the time of Begin(). float WindowRounding; // Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc. float WindowBorderSize; // Window border size at the time of Begin(). + float TitleBarHeight, MenuBarHeight; // Note that those used to be function before 2024/05/28. If you have old code calling TitleBarHeight() you can change it to TitleBarHeight. float DecoOuterSizeX1, DecoOuterSizeY1; // Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0f. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin(). float DecoOuterSizeX2, DecoOuterSizeY2; // Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y). float DecoInnerSizeX1, DecoInnerSizeY1; // Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes). int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)! ImGuiID MoveId; // == window->GetID("#MOVE") ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window) + ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling) ImVec2 Scroll; ImVec2 ScrollMax; ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change) @@ -2336,20 +2467,20 @@ struct IMGUI_API ImGuiWindow bool Collapsed; // Set when collapsing window to become only title-bar bool WantCollapseToggle; bool SkipItems; // Set when items can safely be all clipped (e.g. window not visible or collapsed) + bool SkipRefresh; // [EXPERIMENTAL] Reuse previous frame drawn contents, Begin() returns false. bool Appearing; // Set during the frame where the window is appearing (or re-appearing) bool Hidden; // Do not display (== HiddenFrames*** > 0) bool IsFallbackWindow; // Set on the "Debug##Default" window. bool IsExplicitChild; // Set when passed _ChildWindow, left to false by BeginDocked() bool HasCloseButton; // Set when the window has a close button (p_open != NULL) + signed char ResizeBorderHovered; // Current border being hovered for resize (-1: none, otherwise 0-3) signed char ResizeBorderHeld; // Current border being held for resize (-1: none, otherwise 0-3) short BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs) short BeginCountPreviousFrame; // Number of Begin() during the previous frame short BeginOrderWithinParent; // Begin() order within immediate parent window, if we are a child window. Otherwise 0. short BeginOrderWithinContext; // Begin() order within entire imgui context. This is mostly used for debugging submission order related issues. short FocusOrder; // Order within WindowsFocusOrder[], altered when windows are focused. - ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling) ImS8 AutoFitFramesX, AutoFitFramesY; - ImS8 AutoFitChildAxises; bool AutoFitOnlyGrows; ImGuiDir AutoPosLastDirection; ImS8 HiddenFramesCanSkipItems; // Hide the window for N frames @@ -2393,6 +2524,7 @@ struct IMGUI_API ImGuiWindow ImGuiWindow* RootWindowPopupTree; // Point to ourself or first ancestor that is not a child window. Cross through popups parent<>child. ImGuiWindow* RootWindowForTitleBarHighlight; // Point to ourself or first ancestor which will display TitleBgActive color when this window is active. ImGuiWindow* RootWindowForNav; // Point to ourself or first ancestor which doesn't have the NavFlattened flag. + ImGuiWindow* ParentWindowForFocusRoute; // Set to manual link a window to its logical parent so that Shortcut() chain are honoerd (e.g. Tool linked to Document) ImGuiWindow* NavLastChildNavWindow; // When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.) ImGuiID NavLastIds[ImGuiNavLayer_COUNT]; // Last known NavId for this window, per layer (0/1) @@ -2411,15 +2543,14 @@ struct IMGUI_API ImGuiWindow ImGuiID GetID(const char* str, const char* str_end = NULL); ImGuiID GetID(const void* ptr); ImGuiID GetID(int n); + ImGuiID GetIDFromPos(const ImVec2& p_abs); ImGuiID GetIDFromRectangle(const ImRect& r_abs); // We don't use g.FontSize because the window may be != g.CurrentWindow. ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); } float CalcFontSize() const { ImGuiContext& g = *Ctx; float scale = g.FontBaseSize * FontWindowScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; } - float TitleBarHeight() const { ImGuiContext& g = *Ctx; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; } - ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); } - float MenuBarHeight() const { ImGuiContext& g = *Ctx; return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; } - ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); } + ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight)); } + ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight; return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight); } }; //----------------------------------------------------------------------------- @@ -2461,9 +2592,10 @@ struct ImGuiTabItem ImGuiTabItem() { memset(this, 0, sizeof(*this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; } }; -// Storage for a tab bar (sizeof() 152 bytes) +// Storage for a tab bar (sizeof() 160 bytes) struct IMGUI_API ImGuiTabBar { + ImGuiWindow* Window; ImVector Tabs; ImGuiTabBarFlags Flags; ImGuiID ID; // Zero for tab-bars used by docking @@ -2483,6 +2615,8 @@ struct IMGUI_API ImGuiTabBar float ScrollingSpeed; float ScrollingRectMinX; float ScrollingRectMaxX; + float SeparatorMinX; + float SeparatorMaxX; ImGuiID ReorderRequestTabId; ImS16 ReorderRequestOffset; ImS8 BeginCount; @@ -2522,6 +2656,7 @@ struct ImGuiTableColumn float MaxX; float WidthRequest; // Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout() float WidthAuto; // Automatic width + float WidthMax; // Maximum width (FIXME: overwritten by each instance) float StretchWeight; // Master width weight when (Flags & _WidthStretch). Often around ~1.0f initially. float InitStretchWeightOrWidth; // Value passed to TableSetupColumn(). For Width it is a content width (_without padding_). ImRect ClipRect; // Clipping rectangle for the column @@ -2572,28 +2707,39 @@ struct ImGuiTableColumn }; // Transient cell data stored per row. -// sizeof() ~ 6 +// sizeof() ~ 6 bytes struct ImGuiTableCellData { ImU32 BgColor; // Actual color ImGuiTableColumnIdx Column; // Column number }; +// Parameters for TableAngledHeadersRowEx() +// This may end up being refactored for more general purpose. +// sizeof() ~ 12 bytes +struct ImGuiTableHeaderData +{ + ImGuiTableColumnIdx Index; // Column index + ImU32 TextColor; + ImU32 BgColor0; + ImU32 BgColor1; +}; + // Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs. Does that means they could be moved to ImGuiTableTempData?) +// sizeof() ~ 24 bytes struct ImGuiTableInstanceData { ImGuiID TableInstanceID; float LastOuterHeight; // Outer height from last frame - float LastFirstRowHeight; // Height of first row from last frame (FIXME: this is used as "header height" and may be reworked) + float LastTopHeadersRowHeight; // Height of first consecutive header rows from last frame (FIXME: this is used assuming consecutive headers are in same frozen set) float LastFrozenHeight; // Height of frozen section from last frame int HoveredRowLast; // Index of row which was hovered last frame. int HoveredRowNext; // Index of row hovered this frame, set after encountering it. - ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastFirstRowHeight = LastFrozenHeight = 0.0f; HoveredRowLast = HoveredRowNext = -1; } + ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastTopHeadersRowHeight = LastFrozenHeight = 0.0f; HoveredRowLast = HoveredRowNext = -1; } }; -// FIXME-TABLE: more transient data could be stored in a stacked ImGuiTableTempData: e.g. SortSpecs, incoming RowData -// sizeof() ~ 580 bytes + heap allocs described in TableBeginInitMemory() +// sizeof() ~ 592 bytes + heap allocs described in TableBeginInitMemory() struct IMGUI_API ImGuiTable { ImGuiID ID; @@ -2641,6 +2787,8 @@ struct IMGUI_API ImGuiTable float ResizedColumnNextWidth; float ResizeLockMinContentsX2; // Lock minimum contents width while resizing down in order to not create feedback loops. But we allow growing the table. float RefScale; // Reference scale to be able to rescale columns on font/dpi changes. + float AngledHeadersHeight; // Set by TableAngledHeadersRow(), used in TableUpdateLayout() + float AngledHeadersSlope; // Set by TableAngledHeadersRow(), used in TableUpdateLayout() ImRect OuterRect; // Note: for non-scrolling table, OuterRect.Max.y is often FLT_MAX until EndTable(), unless a height has been specified in BeginTable(). ImRect InnerRect; // InnerRect but without decoration. As with OuterRect, for non-scrolling tables, InnerRect.Max.y is ImRect WorkRect; @@ -2661,10 +2809,12 @@ struct IMGUI_API ImGuiTable ImGuiTableSortSpecs SortSpecs; // Public facing sorts specs, this is what we return in TableGetSortSpecs() ImGuiTableColumnIdx SortSpecsCount; ImGuiTableColumnIdx ColumnsEnabledCount; // Number of enabled columns (<= ColumnsCount) - ImGuiTableColumnIdx ColumnsEnabledFixedCount; // Number of enabled columns (<= ColumnsCount) + ImGuiTableColumnIdx ColumnsEnabledFixedCount; // Number of enabled columns using fixed width (<= ColumnsCount) ImGuiTableColumnIdx DeclColumnsCount; // Count calls to TableSetupColumn() + ImGuiTableColumnIdx AngledHeadersCount; // Count columns with angled headers ImGuiTableColumnIdx HoveredColumnBody; // Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column! ImGuiTableColumnIdx HoveredColumnBorder; // Index of column whose right-border is being hovered (for resizing). + ImGuiTableColumnIdx HighlightColumnHeader; // Index of column which should be highlighted. ImGuiTableColumnIdx AutoFitSingleColumn; // Index of single column requesting auto-fit. ImGuiTableColumnIdx ResizedColumn; // Index of column being resized. Reset when InstanceCurrent==0. ImGuiTableColumnIdx LastResizedColumn; // Index of column being resized from previous frame. @@ -2690,6 +2840,7 @@ struct IMGUI_API ImGuiTable bool IsSortSpecsDirty; bool IsUsingHeaders; // Set when the first row had the ImGuiTableRowFlags_Headers flag. bool IsContextPopupOpen; // Set when default context menu is open (also see: ContextPopupColumn, InstanceInteracted). + bool DisableDefaultContextMenu; // Disable default context menu contents. You may submit your own using TableBeginContextMenuPopup()/EndPopup() bool IsSettingsRequestLoad; bool IsSettingsDirty; // Set when table settings have changed and needs to be reported into ImGuiTableSetttings data. bool IsDefaultDisplayOrder; // Set when display order is unchanged from default (DisplayOrder contains 0...Count-1) @@ -2697,6 +2848,8 @@ struct IMGUI_API ImGuiTable bool IsResetDisplayOrderRequest; bool IsUnfrozenRows; // Set when we got past the frozen row. bool IsDefaultSizingPolicy; // Set if user didn't explicitly set a sizing policy in BeginTable() + bool IsActiveIdAliveBeforeTable; + bool IsActiveIdInTable; bool HasScrollbarYCurr; // Whether ANY instance of this table had a vertical scrollbar during the current frame. bool HasScrollbarYPrev; // Whether ANY instance of this table had a vertical scrollbar during the previous. bool MemoryCompacted; @@ -2709,11 +2862,14 @@ struct IMGUI_API ImGuiTable // Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table). // - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure. // - We also leave out of this structure data that tend to be particularly useful for debugging/metrics. -// sizeof() ~ 112 bytes. +// FIXME-TABLE: more transient data could be stored in a stacked ImGuiTableTempData: e.g. SortSpecs. +// sizeof() ~ 136 bytes. struct IMGUI_API ImGuiTableTempData { int TableIndex; // Index in g.Tables.Buf[] pool float LastTimeActive; // Last timestamp this structure was used + float AngledHeadersExtraWidth; // Used in EndTable() + ImVector AngledHeadersRequests; // Used in TableAngledHeadersRow() ImVec2 UserOuterSize; // outer_size.x passed to BeginTable() ImDrawListSplitter DrawSplitter; @@ -2777,7 +2933,7 @@ namespace ImGui { // Windows // We should always have a CurrentWindow in the stack (there is an implicit "Debug" window) - // If this ever crash because g.CurrentWindow is NULL it means that either + // If this ever crashes because g.CurrentWindow is NULL, it means that either: // - ImGui::NewFrame() has never been called, which is illegal. // - You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal. inline ImGuiWindow* GetCurrentWindowRead() { ImGuiContext& g = *GImGui; return g.CurrentWindow; } @@ -2785,6 +2941,7 @@ namespace ImGui IMGUI_API ImGuiWindow* FindWindowByID(ImGuiID id); IMGUI_API ImGuiWindow* FindWindowByName(const char* name); IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window); + IMGUI_API void UpdateWindowSkipRefresh(ImGuiWindow* window); IMGUI_API ImVec2 CalcWindowNextAutoFitSize(ImGuiWindow* window); IMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent, bool popup_hierarchy); IMGUI_API bool IsWindowWithinBeginStackOf(ImGuiWindow* window, ImGuiWindow* potential_parent); @@ -2794,9 +2951,11 @@ namespace ImGui IMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond = 0); IMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond = 0); IMGUI_API void SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size); - IMGUI_API void SetWindowHiddendAndSkipItemsForCurrentFrame(ImGuiWindow* window); + IMGUI_API void SetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window); + inline void SetWindowParentWindowForFocusRoute(ImGuiWindow* window, ImGuiWindow* parent_window) { window->ParentWindowForFocusRoute = parent_window; } inline ImRect WindowRectAbsToRel(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x - off.x, r.Min.y - off.y, r.Max.x - off.x, r.Max.y - off.y); } inline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x + off.x, r.Min.y + off.y, r.Max.x + off.x, r.Max.y + off.y); } + inline ImVec2 WindowPosAbsToRel(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x - off.x, p.y - off.y); } inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x + off.x, p.y + off.y); } // Windows: Display Order and Focus Order @@ -2809,6 +2968,9 @@ namespace ImGui IMGUI_API int FindWindowDisplayIndex(ImGuiWindow* window); IMGUI_API ImGuiWindow* FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window); + // Windows: Idle, Refresh Policies [EXPERIMENTAL] + IMGUI_API void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags); + // Fonts, drawing IMGUI_API void SetCurrentFont(ImFont* font); inline ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; } @@ -2824,6 +2986,7 @@ namespace ImGui // NewFrame IMGUI_API void UpdateInputEvents(bool trickle_fast_inputs); IMGUI_API void UpdateHoveredWindowAndCaptureFlags(); + IMGUI_API void FindHoveredWindowEx(const ImVec2& pos, bool find_first_and_in_any_viewport, ImGuiWindow** out_hovered_window, ImGuiWindow** out_hovered_window_under_moving_window); IMGUI_API void StartMouseMovingWindow(ImGuiWindow* window); IMGUI_API void UpdateMouseMovingWindowNewFrame(); IMGUI_API void UpdateMouseMovingWindowEndFrame(); @@ -2869,8 +3032,8 @@ namespace ImGui //#endif // Basic Accessors - inline ImGuiItemStatusFlags GetItemStatusFlags(){ ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; } - inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.InFlags; } + inline ImGuiItemStatusFlags GetItemStatusFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; } + inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.ItemFlags; } inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; } inline ImGuiID GetFocusID() { ImGuiContext& g = *GImGui; return g.NavId; } IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window); @@ -2895,14 +3058,12 @@ namespace ImGui IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_w, float default_h); IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x); IMGUI_API void PushMultiItemsWidths(int components, float width_full); - IMGUI_API bool IsItemToggledSelection(); // Was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly) - IMGUI_API ImVec2 GetContentRegionMaxAbs(); IMGUI_API void ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess); // Parameter stacks (shared) - IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); - IMGUI_API void PopItemFlag(); IMGUI_API const ImGuiDataVarInfo* GetStyleVarInfo(ImGuiStyleVar idx); + IMGUI_API void BeginDisabledOverrideReenable(); + IMGUI_API void EndDisabledOverrideReenable(); // Logging/Capture IMGUI_API void LogBegin(ImGuiLogType type, int auto_open_depth); // -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name. @@ -2910,15 +3071,16 @@ namespace ImGui IMGUI_API void LogRenderedText(const ImVec2* ref_pos, const char* text, const char* text_end = NULL); IMGUI_API void LogSetNextTextDecoration(const char* prefix, const char* suffix); - // Popups, Modals, Tooltips - IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags); + // Childs + IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags); + + // Popups, Modals + IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_window_flags); IMGUI_API void OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None); IMGUI_API void ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup); IMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup); IMGUI_API void ClosePopupsExceptModals(); IMGUI_API bool IsPopupOpen(ImGuiID id, ImGuiPopupFlags popup_flags); - IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags); - IMGUI_API bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags); IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window); IMGUI_API ImGuiWindow* GetTopMostPopupModal(); IMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal(); @@ -2926,6 +3088,10 @@ namespace ImGui IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window); IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy); + // Tooltips + IMGUI_API bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags); + IMGUI_API bool BeginTooltipHidden(); + // Menus IMGUI_API bool BeginViewportSideBar(const char* name, ImGuiViewport* viewport, ImGuiDir dir, float size, ImGuiWindowFlags window_flags); IMGUI_API bool BeginMenuEx(const char* label, const char* icon, bool enabled = true); @@ -2936,21 +3102,24 @@ namespace ImGui IMGUI_API bool BeginComboPreview(); IMGUI_API void EndComboPreview(); - // Gamepad/Keyboard Navigation + // Keyboard/Gamepad Navigation IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit); IMGUI_API void NavInitRequestApplyResult(); IMGUI_API bool NavMoveRequestButNoResultYet(); IMGUI_API void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags); IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags); IMGUI_API void NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result); - IMGUI_API void NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGuiNavTreeNodeData* tree_node_data); + IMGUI_API void NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGuiTreeNodeStackData* tree_node_data); IMGUI_API void NavMoveRequestCancel(); IMGUI_API void NavMoveRequestApplyResult(); IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags); + IMGUI_API void NavHighlightActivated(ImGuiID id); IMGUI_API void NavClearPreferredPosForAxis(ImGuiAxis axis); + IMGUI_API void SetNavCursorVisibleAfterMove(); IMGUI_API void NavUpdateCurrentWindowIsScrollPushableX(); IMGUI_API void SetNavWindow(ImGuiWindow* window); IMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel); + IMGUI_API void SetNavFocusScope(ImGuiID focus_scope_id); // Focus/Activation // This should be part of a larger set of API: FocusItem(offset = -1), FocusItemByID(id), ActivateItem(offset = -1), ActivateItemByID(id) etc. which are @@ -2960,41 +3129,41 @@ namespace ImGui // Inputs // FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions. - inline bool IsNamedKey(ImGuiKey key) { return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; } - inline bool IsNamedKeyOrModKey(ImGuiKey key) { return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super || key == ImGuiMod_Shortcut; } - inline bool IsLegacyKey(ImGuiKey key) { return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; } - inline bool IsKeyboardKey(ImGuiKey key) { return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; } - inline bool IsGamepadKey(ImGuiKey key) { return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; } - inline bool IsMouseKey(ImGuiKey key) { return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; } - inline bool IsAliasKey(ImGuiKey key) { return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; } - inline ImGuiKeyChord ConvertShortcutMod(ImGuiKeyChord key_chord) { ImGuiContext& g = *GImGui; IM_ASSERT_PARANOID(key_chord & ImGuiMod_Shortcut); return (key_chord & ~ImGuiMod_Shortcut) | (g.IO.ConfigMacOSXBehaviors ? ImGuiMod_Super : ImGuiMod_Ctrl); } - inline ImGuiKey ConvertSingleModFlagToKey(ImGuiContext* ctx, ImGuiKey key) + inline bool IsNamedKey(ImGuiKey key) { return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; } + inline bool IsNamedKeyOrMod(ImGuiKey key) { return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super; } + inline bool IsLegacyKey(ImGuiKey key) { return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; } + inline bool IsKeyboardKey(ImGuiKey key) { return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; } + inline bool IsGamepadKey(ImGuiKey key) { return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; } + inline bool IsMouseKey(ImGuiKey key) { return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; } + inline bool IsAliasKey(ImGuiKey key) { return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; } + inline bool IsLRModKey(ImGuiKey key) { return key >= ImGuiKey_LeftCtrl && key <= ImGuiKey_RightSuper; } + ImGuiKeyChord FixupKeyChord(ImGuiKeyChord key_chord); + inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key) { - ImGuiContext& g = *ctx; if (key == ImGuiMod_Ctrl) return ImGuiKey_ReservedForModCtrl; if (key == ImGuiMod_Shift) return ImGuiKey_ReservedForModShift; if (key == ImGuiMod_Alt) return ImGuiKey_ReservedForModAlt; if (key == ImGuiMod_Super) return ImGuiKey_ReservedForModSuper; - if (key == ImGuiMod_Shortcut) return (g.IO.ConfigMacOSXBehaviors ? ImGuiKey_ReservedForModSuper : ImGuiKey_ReservedForModCtrl); return key; } IMGUI_API ImGuiKeyData* GetKeyData(ImGuiContext* ctx, ImGuiKey key); inline ImGuiKeyData* GetKeyData(ImGuiKey key) { ImGuiContext& g = *GImGui; return GetKeyData(&g, key); } - IMGUI_API void GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size); + IMGUI_API const char* GetKeyChordName(ImGuiKeyChord key_chord); inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT); return (ImGuiKey)(ImGuiKey_MouseLeft + button); } IMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f); IMGUI_API ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down); IMGUI_API float GetNavTweakPressedAmount(ImGuiAxis axis); IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate); IMGUI_API void GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate); + IMGUI_API void TeleportMousePos(const ImVec2& pos); IMGUI_API void SetActiveIdUsingAllKeyboardKeys(); inline bool IsActiveIdUsingNavDir(ImGuiDir dir) { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; } // [EXPERIMENTAL] Low-Level: Key/Input Ownership // - The idea is that instead of "eating" a given input, we can link to an owner id. // - Ownership is most often claimed as a result of reacting to a press/down event (but occasionally may be claimed ahead). - // - Input queries can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_None (== -1) or a custom ID. + // - Input queries can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_NoOwner (== -1) or a custom ID. // - Legacy input queries (without specifying an owner or _Any or _None) are equivalent to using ImGuiKeyOwner_Any (== 0). // - Input ownership is automatically released on the frame after a key is released. Therefore: // - for ownership registration happening as a result of a down/press event, the SetKeyOwner() call may be done once (common case). @@ -3002,12 +3171,12 @@ namespace ImGui // - SetItemKeyOwner() is a shortcut for common simple case. A custom widget will probably want to call SetKeyOwner() multiple times directly based on its interaction state. // - This is marked experimental because not all widgets are fully honoring the Set/Test idioms. We will need to move forward step by step. // Please open a GitHub Issue to submit your usage scenario or if there's a use case you need solved. - IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key); - IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0); - IMGUI_API void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0); - IMGUI_API void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags = 0); // Set key owner to last item if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'. - IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id); // Test that key is either not owned, either owned by 'owner_id' - inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiContext* ctx, ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(ctx, key); IM_ASSERT(IsNamedKey(key)); return &ctx->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; } + IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key); + IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0); + IMGUI_API void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0); + IMGUI_API void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags); // Set key owner to last item if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'. + IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id); // Test that key is either not owned, either owned by 'owner_id' + inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiContext* ctx, ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key)); return &ctx->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; } // [EXPERIMENTAL] High-Level: Input Access functions w/ support for Key/Input Ownership // - Important: legacy IsKeyPressed(ImGuiKey, bool repeat=true) _DEFAULTS_ to repeat, new IsKeyPressed() requires _EXPLICIT_ ImGuiInputFlags_Repeat flag. @@ -3015,26 +3184,32 @@ namespace ImGui // - Specifying a value for 'ImGuiID owner' will test that EITHER the key is NOT owned (UNLESS locked), EITHER the key is owned by 'owner'. // Legacy functions use ImGuiKeyOwner_Any meaning that they typically ignore ownership, unless a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease. // - Binding generators may want to ignore those for now, or suffix them with Ex() until we decide if this gets moved into public API. - IMGUI_API bool IsKeyDown(ImGuiKey key, ImGuiID owner_id); - IMGUI_API bool IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0); // Important: when transitioning from old to new IsKeyPressed(): old API has "bool repeat = true", so would default to repeat. New API requiress explicit ImGuiInputFlags_Repeat. - IMGUI_API bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id); - IMGUI_API bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id); - IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0); - IMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id); - - // [EXPERIMENTAL] Shortcut Routing - // - ImGuiKeyChord = a ImGuiKey optionally OR-red with ImGuiMod_Alt/ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Super. - // ImGuiKey_C (accepted by functions taking ImGuiKey or ImGuiKeyChord) - // ImGuiKey_C | ImGuiMod_Ctrl (accepted by functions taking ImGuiKeyChord) - // ONLY ImGuiMod_XXX values are legal to 'OR' with an ImGuiKey. You CANNOT 'OR' two ImGuiKey values. - // - When using one of the routing flags (e.g. ImGuiInputFlags_RouteFocused): routes requested ahead of time given a chord (key + modifiers) and a routing policy. - // - Routes are resolved during NewFrame(): if keyboard modifiers are matching current ones: SetKeyOwner() is called + route is granted for the frame. - // - Route is granted to a single owner. When multiple requests are made we have policies to select the winning route. - // - Multiple read sites may use the same owner id and will all get the granted route. - // - For routing: when owner_id is 0 we use the current Focus Scope ID as a default owner in order to identify our location. - IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0); - IMGUI_API bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0); - IMGUI_API bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id); + IMGUI_API bool IsKeyDown(ImGuiKey key, ImGuiID owner_id); + IMGUI_API bool IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0); // Important: when transitioning from old to new IsKeyPressed(): old API has "bool repeat = true", so would default to repeat. New API requiress explicit ImGuiInputFlags_Repeat. + IMGUI_API bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id); + IMGUI_API bool IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id = 0); + IMGUI_API bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id); + IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0); + IMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id); + IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id); + + // Shortcut Testing & Routing + // - Set Shortcut() and SetNextItemShortcut() in imgui.h + // - When a policy (except for ImGuiInputFlags_RouteAlways *) is set, Shortcut() will register itself with SetShortcutRouting(), + // allowing the system to decide where to route the input among other route-aware calls. + // (* using ImGuiInputFlags_RouteAlways is roughly equivalent to calling IsKeyChordPressed(key) and bypassing route registration and check) + // - When using one of the routing option: + // - The default route is ImGuiInputFlags_RouteFocused (accept inputs if window is in focus stack. Deep-most focused window takes inputs. ActiveId takes inputs over deep-most focused window.) + // - Routes are requested given a chord (key + modifiers) and a routing policy. + // - Routes are resolved during NewFrame(): if keyboard modifiers are matching current ones: SetKeyOwner() is called + route is granted for the frame. + // - Each route may be granted to a single owner. When multiple requests are made we have policies to select the winning route (e.g. deep most window). + // - Multiple read sites may use the same owner id can all access the granted route. + // - When owner_id is 0 we use the current Focus Scope ID as a owner ID in order to identify our location. + // - You can chain two unrelated windows in the focus stack using SetWindowParentWindowForFocusRoute() + // e.g. if you have a tool window associated to a document, and you want document shortcuts to run when the tool is focused. + IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id); + IMGUI_API bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id); // owner_id needs to be explicit and cannot be 0 + IMGUI_API bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id); IMGUI_API ImGuiKeyRoutingData* GetShortcutRoutingData(ImGuiKeyChord key_chord); // [EXPERIMENTAL] Focus Scope @@ -3054,7 +3229,27 @@ namespace ImGui IMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id); IMGUI_API void ClearDragDrop(); IMGUI_API bool IsDragDropPayloadBeingAccepted(); - IMGUI_API void RenderDragDropTargetRect(const ImRect& bb); + IMGUI_API void RenderDragDropTargetRect(const ImRect& bb, const ImRect& item_clip_rect); + + // Typing-Select API + // (provide Windows Explorer style "select items by typing partial name" + "cycle through items by typing same letter" feature) + // (this is currently not documented nor used by main library, but should work. See "widgets_typingselect" in imgui_test_suite for usage code. Please let us know if you use this!) + IMGUI_API ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None); + IMGUI_API int TypingSelectFindMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx); + IMGUI_API int TypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx); + IMGUI_API int TypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data); + + // Box-Select API + IMGUI_API bool BeginBoxSelect(const ImRect& scope_rect, ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags); + IMGUI_API void EndBoxSelect(const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags); + + // Multi-Select API + IMGUI_API void MultiSelectItemHeader(ImGuiID id, bool* p_selected, ImGuiButtonFlags* p_button_flags); + IMGUI_API void MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed); + IMGUI_API void MultiSelectAddSetAll(ImGuiMultiSelectTempData* ms, bool selected); + IMGUI_API void MultiSelectAddSetRange(ImGuiMultiSelectTempData* ms, bool selected, int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item); + inline ImGuiBoxSelectState* GetBoxSelectState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.BoxSelectState.ID == id && g.BoxSelectState.IsActive) ? &g.BoxSelectState : NULL; } + inline ImGuiMultiSelectState* GetMultiSelectState(ImGuiID id) { ImGuiContext& g = *GImGui; return g.MultiSelectStorage.GetByKey(id); } // Internal Columns API (this is not exposed because we will encourage transitioning to the Tables API) IMGUI_API void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window, const ImRect& clip_rect); @@ -3072,11 +3267,12 @@ namespace ImGui IMGUI_API void TableOpenContextMenu(int column_n = -1); IMGUI_API void TableSetColumnWidth(int column_n, float width); IMGUI_API void TableSetColumnSortDirection(int column_n, ImGuiSortDirection sort_direction, bool append_to_sort_specs); - IMGUI_API int TableGetHoveredColumn(); // May use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. Return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered. IMGUI_API int TableGetHoveredRow(); // Retrieve *PREVIOUS FRAME* hovered row. This difference with TableGetHoveredColumn() is the reason why this is not public yet. IMGUI_API float TableGetHeaderRowHeight(); + IMGUI_API float TableGetHeaderAngledMaxLabelWidth(); IMGUI_API void TablePushBackgroundChannel(); IMGUI_API void TablePopBackgroundChannel(); + IMGUI_API void TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count); // Tables: Internals inline ImGuiTable* GetCurrentTable() { ImGuiContext& g = *GImGui; return g.CurrentTable; } @@ -3089,7 +3285,7 @@ namespace ImGui IMGUI_API void TableUpdateBorders(ImGuiTable* table); IMGUI_API void TableUpdateColumnsWeightFromWidth(ImGuiTable* table); IMGUI_API void TableDrawBorders(ImGuiTable* table); - IMGUI_API void TableDrawContextMenu(ImGuiTable* table); + IMGUI_API void TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display); IMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table); IMGUI_API void TableMergeDrawChannels(ImGuiTable* table); inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; } @@ -3106,7 +3302,7 @@ namespace ImGui IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n); IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n); IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0); - IMGUI_API float TableGetMaxColumnWidth(const ImGuiTable* table, int column_n); + IMGUI_API float TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n); IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n); IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table); IMGUI_API void TableRemove(ImGuiTable* table); @@ -3134,6 +3330,7 @@ namespace ImGui IMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id); IMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab); IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab); + IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, const char* tab_name); IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset); IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, ImVec2 mouse_pos); IMGUI_API bool TabBarProcessReorder(ImGuiTabBar* tab_bar); @@ -3151,10 +3348,13 @@ namespace ImGui IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL); IMGUI_API void RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL); IMGUI_API void RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float clip_max_x, float ellipsis_max_x, const char* text, const char* text_end, const ImVec2* text_size_if_known); - IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f); + IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool borders = true, float rounding = 0.0f); IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f); IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding = 0.0f, ImDrawFlags flags = 0); - IMGUI_API void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault); // Navigation highlight + IMGUI_API void RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None); // Navigation highlight +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + inline void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None) { RenderNavCursor(bb, id, flags); } // Renamed in 1.91.4 +#endif IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text. IMGUI_API void RenderMouseCursor(ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow); @@ -3170,7 +3370,7 @@ namespace ImGui IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0); IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0); IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0); - IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0); + IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0); IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags, float thickness = 1.0f); IMGUI_API void SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_width); IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value); @@ -3191,10 +3391,13 @@ namespace ImGui IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags); IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb); IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f, ImU32 bg_col = 0); + + // Widgets: Tree Nodes IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL); IMGUI_API void TreePushOverrideID(ImGuiID id); - IMGUI_API void TreeNodeSetOpen(ImGuiID id, bool open); - IMGUI_API bool TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags); // Return open state. Consume previous SetNextItemOpen() data, if any. May return true when logging. + IMGUI_API bool TreeNodeGetOpen(ImGuiID storage_id); + IMGUI_API void TreeNodeSetOpen(ImGuiID storage_id, bool open); + IMGUI_API bool TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags); // Return open state. Consume previous SetNextItemOpen() data, if any. May return true when logging. // Template functions are instantiated in imgui_widgets.cpp for a finite number of types. // To use them externally (for custom widget) you may need an "extern template" statement in your code in order to link to existing instances and silence Clang warnings (see #2036). @@ -3210,9 +3413,10 @@ namespace ImGui IMGUI_API const ImGuiDataTypeInfo* DataTypeGetInfo(ImGuiDataType data_type); IMGUI_API int DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format); IMGUI_API void DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, const void* arg_1, const void* arg_2); - IMGUI_API bool DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format); + IMGUI_API bool DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format, void* p_data_when_empty = NULL); IMGUI_API int DataTypeCompare(ImGuiDataType data_type, const void* arg_1, const void* arg_2); IMGUI_API bool DataTypeClamp(ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max); + IMGUI_API bool DataTypeIsZero(ImGuiDataType data_type, const void* p_data); // InputText IMGUI_API bool InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); @@ -3221,6 +3425,7 @@ namespace ImGui IMGUI_API bool TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min = NULL, const void* p_clamp_max = NULL); inline bool TempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.ActiveId == id && g.TempInputId == id); } inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active + IMGUI_API void SetNextItemRefVal(ImGuiDataType data_type, void* p_data); // Color IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags); @@ -3233,27 +3438,35 @@ namespace ImGui // Shade functions (write over already created vertices) IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1); IMGUI_API void ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp); + IMGUI_API void ShadeVertsTransformPos(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& pivot_in, float cos_a, float sin_a, const ImVec2& pivot_out); // Garbage collection IMGUI_API void GcCompactTransientMiscBuffers(); IMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow* window); IMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow* window); - // Debug Log - IMGUI_API void DebugLog(const char* fmt, ...) IM_FMTARGS(1); - IMGUI_API void DebugLogV(const char* fmt, va_list args) IM_FMTLIST(1); + // Error handling, State Recovery + IMGUI_API bool ErrorLog(const char* msg); + IMGUI_API void ErrorRecoveryStoreState(ImGuiErrorRecoveryState* state_out); + IMGUI_API void ErrorRecoveryTryToRecoverState(const ImGuiErrorRecoveryState* state_in); + IMGUI_API void ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in); + IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries(); + IMGUI_API void ErrorCheckEndFrameFinalizeErrorTooltip(); + IMGUI_API bool BeginErrorTooltip(); + IMGUI_API void EndErrorTooltip(); // Debug Tools - IMGUI_API void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL); - IMGUI_API void ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL); - IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries(); + IMGUI_API void DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr, size_t size); // size >= 0 : alloc, size = -1 : free IMGUI_API void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255)); IMGUI_API void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255)); IMGUI_API void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255)); + IMGUI_API void DebugTextUnformattedWithLocateItem(const char* line_begin, const char* line_end); IMGUI_API void DebugLocateItem(ImGuiID target_id); // Call sparingly: only 1 at the same time! IMGUI_API void DebugLocateItemOnHover(ImGuiID target_id); // Only call on reaction to a mouse Hover: because only 1 at the same time! IMGUI_API void DebugLocateItemResolveWithLastItem(); - inline void DebugStartItemPicker() { ImGuiContext& g = *GImGui; g.DebugItemPickerActive = true; } + IMGUI_API void DebugBreakClearData(); + IMGUI_API bool DebugBreakButton(const char* label, const char* description_of_location); + IMGUI_API void DebugBreakButtonTooltip(bool keyboard_only, const char* description_of_location); IMGUI_API void ShowFontAtlas(ImFontAtlas* atlas); IMGUI_API void DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end); IMGUI_API void DebugNodeColumns(ImGuiOldColumns* columns); @@ -3266,6 +3479,8 @@ namespace ImGui IMGUI_API void DebugNodeTable(ImGuiTable* table); IMGUI_API void DebugNodeTableSettings(ImGuiTableSettings* settings); IMGUI_API void DebugNodeInputTextState(ImGuiInputTextState* state); + IMGUI_API void DebugNodeTypingSelectState(ImGuiTypingSelectState* state); + IMGUI_API void DebugNodeMultiSelectState(ImGuiMultiSelectState* state); IMGUI_API void DebugNodeWindow(ImGuiWindow* window, const char* label); IMGUI_API void DebugNodeWindowSettings(ImGuiWindowSettings* settings); IMGUI_API void DebugNodeWindowsList(ImVector* windows, const char* label); @@ -3276,19 +3491,16 @@ namespace ImGui // Obsolete functions #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); } // Changed in 1.89 - inline bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0) { return TreeNodeUpdateNextOpen(id, flags); } // Renamed in 1.89 + //inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); } // Changed in 1.89 + //inline bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0) { return TreeNodeUpdateNextOpen(id, flags); } // Renamed in 1.89 + //inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { IM_ASSERT(IsNamedKey(key)); return IsKeyPressed(key, repeat); } // Removed in 1.87: Mapping from named key is always identity! - // Refactored focus/nav/tabbing system in 1.82 and 1.84. If you have old/custom copy-and-pasted widgets that used FocusableItemRegister(): + // Refactored focus/nav/tabbing system in 1.82 and 1.84. If you have old/custom copy-and-pasted widgets which used FocusableItemRegister(): // (Old) IMGUI_VERSION_NUM < 18209: using 'ItemAdd(....)' and 'bool tab_focused = FocusableItemRegister(...)' - // (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0' - // (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedTabbing) != 0 || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))' (WIP) - // Widget code are simplified as there's no need to call FocusableItemUnregister() while managing the transition from regular widget to TempInputText() - inline bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id) { IM_ASSERT(0); IM_UNUSED(window); IM_UNUSED(id); return false; } // -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd() - inline void FocusableItemUnregister(ImGuiWindow* window) { IM_ASSERT(0); IM_UNUSED(window); } // -> unnecessary: TempInputText() uses ImGuiInputTextFlags_MergedItem -#endif -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { IM_ASSERT(IsNamedKey(key)); return IsKeyPressed(key, repeat); } // Removed in 1.87: Mapping from named key is always identity! + // (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool tab_focused = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Focused) != 0' + // (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))' + //inline bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id) // -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd() + //inline void FocusableItemUnregister(ImGuiWindow* window) // -> unnecessary: TempInputText() uses ImGuiInputTextFlags_MergedItem #endif } // namespace ImGui @@ -3308,6 +3520,7 @@ struct ImFontBuilderIO #ifdef IMGUI_ENABLE_STB_TRUETYPE IMGUI_API const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype(); #endif +IMGUI_API void ImFontAtlasUpdateConfigDataPointers(ImFontAtlas* atlas); IMGUI_API void ImFontAtlasBuildInit(ImFontAtlas* atlas); IMGUI_API void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent); IMGUI_API void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opaque); @@ -3330,7 +3543,7 @@ extern const char* ImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ctx, ImGuiI // In IMGUI_VERSION_NUM >= 18934: changed IMGUI_TEST_ENGINE_ITEM_ADD(bb,id) to IMGUI_TEST_ENGINE_ITEM_ADD(id,bb,item_data); #define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA) // Register item bounding box #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional) -#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log +#define IMGUI_TEST_ENGINE_LOG(_FMT,...) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log #else #define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0) #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g) diff --git a/bgfx/3rdparty/dear-imgui/imgui_tables.cpp b/bgfx/3rdparty/dear-imgui/imgui_tables.cpp index 8fdcbcf8..598496be 100644 --- a/bgfx/3rdparty/dear-imgui/imgui_tables.cpp +++ b/bgfx/3rdparty/dear-imgui/imgui_tables.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.9 +// dear imgui, v1.91.4 // (tables and columns code) /* @@ -24,8 +24,9 @@ Index of this file: */ // Navigating this file: -// - In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. -// - With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. +// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. +// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments. +// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments. //----------------------------------------------------------------------------- // [SECTION] Commentary @@ -48,7 +49,8 @@ Index of this file: // - TableUpdateLayout() [Internal] followup to BeginTable(): setup everything: widths, columns positions, clipping rectangles. Automatically called by the FIRST call to TableNextRow() or TableHeadersRow(). // | TableSetupDrawChannels() - setup ImDrawList channels // | TableUpdateBorders() - detect hovering columns for resize, ahead of contents submission -// | TableDrawContextMenu() - draw right-click context menu +// | TableBeginContextMenuPopup() +// | - TableDrawDefaultContextMenu() - draw right-click context menu contents //----------------------------------------------------------------------------- // - TableHeadersRow() or TableHeader() user submit a headers row (optional) // | TableSortSpecsClickColumn() - when left-clicked: alter sort order and sort direction @@ -226,6 +228,7 @@ Index of this file: #pragma clang diagnostic ignored "-Wenum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') #pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access #elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind #pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked @@ -317,19 +320,30 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG IM_ASSERT(inner_width >= 0.0f); // If an outer size is specified ahead we will be able to early out when not visible. Exact clipping criteria may evolve. + // FIXME: coarse clipping because access to table data causes two issues: + // - instance numbers varying/unstable. may not be a direct problem for users, but could make outside access broken or confusing, e.g. TestEngine. + // - can't implement support for ImGuiChildFlags_ResizeY as we need to somehow pull the height data from somewhere. this also needs stable instance numbers. + // The side-effects of accessing table data on coarse clip would be: + // - always reserving the pooled ImGuiTable data ahead for a fully clipped table (minor IMHO). Also the 'outer_window_is_measuring_size' criteria may already be defeating this in some situations. + // - always performing the GetOrAddByKey() O(log N) query in g.Tables.Map[]. const bool use_child_window = (flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) != 0; const ImVec2 avail_size = GetContentRegionAvail(); - ImVec2 actual_outer_size = CalcItemSize(outer_size, ImMax(avail_size.x, 1.0f), use_child_window ? ImMax(avail_size.y, 1.0f) : 0.0f); - ImRect outer_rect(outer_window->DC.CursorPos, outer_window->DC.CursorPos + actual_outer_size); - if (use_child_window && IsClippedEx(outer_rect, 0)) + const ImVec2 actual_outer_size = ImTrunc(CalcItemSize(outer_size, ImMax(avail_size.x, 1.0f), use_child_window ? ImMax(avail_size.y, 1.0f) : 0.0f)); + const ImRect outer_rect(outer_window->DC.CursorPos, outer_window->DC.CursorPos + actual_outer_size); + const bool outer_window_is_measuring_size = (outer_window->AutoFitFramesX > 0) || (outer_window->AutoFitFramesY > 0); // Doesn't apply to AlwaysAutoResize windows! + if (use_child_window && IsClippedEx(outer_rect, 0) && !outer_window_is_measuring_size) { ItemSize(outer_rect); + ItemAdd(outer_rect, id); return false; } + // [DEBUG] Debug break requested by user + if (g.DebugBreakInTable == id) + IM_DEBUG_BREAK(); + // Acquire storage for the table ImGuiTable* table = g.Tables.GetOrAddByKey(id); - const ImGuiTableFlags table_last_flags = table->Flags; // Acquire temporary buffers const int table_idx = g.Tables.GetIndex(table); @@ -345,7 +359,9 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG flags = TableFixFlags(flags, outer_window); // Initialize - const int instance_no = (table->LastFrameActive != g.FrameCount) ? 0 : table->InstanceCurrent + 1; + const int previous_frame_active = table->LastFrameActive; + const int instance_no = (previous_frame_active != g.FrameCount) ? 0 : table->InstanceCurrent + 1; + const ImGuiTableFlags previous_flags = table->Flags; table->ID = id; table->Flags = flags; table->LastFrameActive = g.FrameCount; @@ -392,18 +408,22 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG SetNextWindowContentSize(ImVec2(override_content_size.x != FLT_MAX ? override_content_size.x : 0.0f, override_content_size.y != FLT_MAX ? override_content_size.y : 0.0f)); // Reset scroll if we are reactivating it - if ((table_last_flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) == 0) + if ((previous_flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) == 0) SetNextWindowScroll(ImVec2(0.0f, 0.0f)); // Create scrolling region (without border and zero window padding) - ImGuiWindowFlags child_flags = (flags & ImGuiTableFlags_ScrollX) ? ImGuiWindowFlags_HorizontalScrollbar : ImGuiWindowFlags_None; - BeginChildEx(name, instance_id, outer_rect.GetSize(), false, child_flags); + ImGuiWindowFlags child_window_flags = (flags & ImGuiTableFlags_ScrollX) ? ImGuiWindowFlags_HorizontalScrollbar : ImGuiWindowFlags_None; + BeginChildEx(name, instance_id, outer_rect.GetSize(), ImGuiChildFlags_None, child_window_flags); table->InnerWindow = g.CurrentWindow; table->WorkRect = table->InnerWindow->WorkRect; table->OuterRect = table->InnerWindow->Rect(); table->InnerRect = table->InnerWindow->InnerRect; IM_ASSERT(table->InnerWindow->WindowPadding.x == 0.0f && table->InnerWindow->WindowPadding.y == 0.0f && table->InnerWindow->WindowBorderSize == 0.0f); + // Allow submitting when host is measuring + if (table->InnerWindow->SkipItems && outer_window_is_measuring_size) + table->InnerWindow->SkipItems = false; + // When using multiple instances, ensure they have the same amount of horizontal decorations (aka vertical scrollbar) so stretched columns can be aligned) if (instance_no == 0) { @@ -417,6 +437,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG // For non-scrolling tables, WorkRect == OuterRect == InnerRect. // But at this point we do NOT have a correct value for .Max.y (unless a height has been explicitly passed in). It will only be updated in EndTable(). table->WorkRect = table->OuterRect = table->InnerRect = outer_rect; + table->HasScrollbarYPrev = table->HasScrollbarYCurr = false; } // Push a standardized ID for both child-using and not-child-using tables @@ -439,6 +460,29 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG temp_data->HostBackupItemWidthStackSize = outer_window->DC.ItemWidthStack.Size; inner_window->DC.PrevLineSize = inner_window->DC.CurrLineSize = ImVec2(0.0f, 0.0f); + // Make borders not overlap our contents by offsetting HostClipRect (#6765, #7428, #3752) + // (we normally shouldn't alter HostClipRect as we rely on TableMergeDrawChannels() expanding non-clipped column toward the + // limits of that rectangle, in order for ImDrawListSplitter::Merge() to merge the draw commands. However since the overlap + // problem only affect scrolling tables in this case we can get away with doing it without extra cost). + if (inner_window != outer_window) + { + // FIXME: Because inner_window's Scrollbar doesn't know about border size, since it's not encoded in window->WindowBorderSize, + // it already overlaps it and doesn't need an extra offset. Ideally we should be able to pass custom border size with + // different x/y values to BeginChild(). + if (flags & ImGuiTableFlags_BordersOuterV) + { + table->HostClipRect.Min.x = ImMin(table->HostClipRect.Min.x + TABLE_BORDER_SIZE, table->HostClipRect.Max.x); + if (inner_window->DecoOuterSizeX2 == 0.0f) + table->HostClipRect.Max.x = ImMax(table->HostClipRect.Max.x - TABLE_BORDER_SIZE, table->HostClipRect.Min.x); + } + if (flags & ImGuiTableFlags_BordersOuterH) + { + table->HostClipRect.Min.y = ImMin(table->HostClipRect.Min.y + TABLE_BORDER_SIZE, table->HostClipRect.Max.y); + if (inner_window->DecoOuterSizeY2 == 0.0f) + table->HostClipRect.Max.y = ImMax(table->HostClipRect.Max.y - TABLE_BORDER_SIZE, table->HostClipRect.Min.y); + } + } + // Padding and Spacing // - None ........Content..... Pad .....Content........ // - PadOuter | Pad ..Content..... Pad .....Content.. Pad | @@ -464,7 +508,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG table->InnerClipRect = (inner_window == outer_window) ? table->WorkRect : inner_window->ClipRect; table->InnerClipRect.ClipWith(table->WorkRect); // We need this to honor inner_width table->InnerClipRect.ClipWithFull(table->HostClipRect); - table->InnerClipRect.Max.y = (flags & ImGuiTableFlags_NoHostExtendY) ? ImMin(table->InnerClipRect.Max.y, inner_window->WorkRect.Max.y) : inner_window->ClipRect.Max.y; + table->InnerClipRect.Max.y = (flags & ImGuiTableFlags_NoHostExtendY) ? ImMin(table->InnerClipRect.Max.y, inner_window->WorkRect.Max.y) : table->HostClipRect.Max.y; table->RowPosY1 = table->RowPosY2 = table->WorkRect.Min.y; // This is needed somehow table->RowTextBaseline = 0.0f; // This will be cleared again by TableBeginRow() @@ -472,7 +516,11 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG table->FreezeRowsRequest = table->FreezeRowsCount = 0; // This will be setup by TableSetupScrollFreeze(), if any table->FreezeColumnsRequest = table->FreezeColumnsCount = 0; table->IsUnfrozenRows = true; - table->DeclColumnsCount = 0; + table->DeclColumnsCount = table->AngledHeadersCount = 0; + if (previous_frame_active + 1 < g.FrameCount) + table->IsActiveIdInTable = false; + table->AngledHeadersHeight = 0.0f; + temp_data->AngledHeadersExtraWidth = 0.0f; // Using opaque colors facilitate overlapping lines of the grid, otherwise we'd need to improve TableDrawBorders() table->BorderColorStrong = GetColorU32(ImGuiCol_TableBorderStrong); @@ -485,7 +533,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG if (inner_window != outer_window) // So EndChild() within the inner window can restore the table properly. inner_window->DC.CurrentTableIdx = table_idx; - if ((table_last_flags & ImGuiTableFlags_Reorderable) && (flags & ImGuiTableFlags_Reorderable) == 0) + if ((previous_flags & ImGuiTableFlags_Reorderable) && (flags & ImGuiTableFlags_Reorderable) == 0) table->IsResetDisplayOrderRequest = true; // Mark as used to avoid GC @@ -818,7 +866,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // Calculate ideal/auto column width (that's the width required for all contents to be visible without clipping) // Combine width from regular rows + width from headers unless requested not to. - if (!column->IsPreserveWidthAuto) + if (!column->IsPreserveWidthAuto && table->InstanceCurrent == 0) column->WidthAuto = TableGetColumnWidthAuto(table, column); // Non-resizable columns keep their requested width (apply user value regardless of IsPreserveWidthAuto) @@ -846,8 +894,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) table->RightMostEnabledColumn = (ImGuiTableColumnIdx)prev_visible_column_idx; IM_ASSERT(table->LeftMostEnabledColumn >= 0 && table->RightMostEnabledColumn >= 0); - // [Part 2] Disable child window clipping while fitting columns. This is not strictly necessary but makes it possible - // to avoid the column fitting having to wait until the first visible frame of the child container (may or not be a good thing). + // [Part 2] Disable child window clipping while fitting columns. This is not strictly necessary but makes it possible to avoid + // the column fitting having to wait until the first visible frame of the child container (may or not be a good thing). Also see #6510. // FIXME-TABLE: for always auto-resizing columns may not want to do that all the time. if (has_auto_fit_request && table->OuterWindow != table->InnerWindow) table->InnerWindow->SkipItems = false; @@ -932,7 +980,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) if (column->Flags & ImGuiTableColumnFlags_WidthStretch) { float weight_ratio = column->StretchWeight / stretch_sum_weights; - column->WidthRequest = IM_FLOOR(ImMax(width_avail_for_stretched_columns * weight_ratio, table->MinColumnWidth) + 0.01f); + column->WidthRequest = IM_TRUNC(ImMax(width_avail_for_stretched_columns * weight_ratio, table->MinColumnWidth) + 0.01f); width_remaining_for_stretched_columns -= column->WidthRequest; } @@ -942,7 +990,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) column->Flags |= ImGuiTableColumnFlags_NoDirectResize_; // Assign final width, record width in case we will need to shrink - column->WidthGiven = ImFloor(ImMax(column->WidthRequest, table->MinColumnWidth)); + column->WidthGiven = ImTrunc(ImMax(column->WidthRequest, table->MinColumnWidth)); table->ColumnsGivenWidth += column->WidthGiven; } @@ -969,17 +1017,23 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); table_instance->HoveredRowLast = table_instance->HoveredRowNext; table_instance->HoveredRowNext = -1; - table->HoveredColumnBody = -1; - table->HoveredColumnBorder = -1; + table->HoveredColumnBody = table->HoveredColumnBorder = -1; const ImRect mouse_hit_rect(table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.Max.x, ImMax(table->OuterRect.Max.y, table->OuterRect.Min.y + table_instance->LastOuterHeight)); const ImGuiID backup_active_id = g.ActiveId; g.ActiveId = 0; const bool is_hovering_table = ItemHoverable(mouse_hit_rect, 0, ImGuiItemFlags_None); g.ActiveId = backup_active_id; + // Determine skewed MousePos.x to support angled headers. + float mouse_skewed_x = g.IO.MousePos.x; + if (table->AngledHeadersHeight > 0.0f) + if (g.IO.MousePos.y >= table->OuterRect.Min.y && g.IO.MousePos.y <= table->OuterRect.Min.y + table->AngledHeadersHeight) + mouse_skewed_x += ImTrunc((table->OuterRect.Min.y + table->AngledHeadersHeight - g.IO.MousePos.y) * table->AngledHeadersSlope); + // [Part 6] Setup final position, offset, skip/clip states and clipping rectangles, detect hovered column // Process columns in their visible orders as we are comparing the visible order and adjusting host_clip_rect while looping. int visible_n = 0; + bool has_at_least_one_column_requesting_output = false; bool offset_x_frozen = (table->FreezeColumnsCount > 0); float offset_x = ((table->FreezeColumnsCount > 0) ? table->OuterRect.Min.x : work_rect.Min.x) + table->OuterPaddingX - table->CellSpacingX1; ImRect host_clip_rect = table->InnerClipRect; @@ -1016,16 +1070,12 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) continue; } - // Detect hovered column - if (is_hovering_table && g.IO.MousePos.x >= column->ClipRect.Min.x && g.IO.MousePos.x < column->ClipRect.Max.x) - table->HoveredColumnBody = (ImGuiTableColumnIdx)column_n; - // Lock start position column->MinX = offset_x; // Lock width based on start position and minimum/maximum width for this position - float max_width = TableGetMaxColumnWidth(table, column_n); - column->WidthGiven = ImMin(column->WidthGiven, max_width); + column->WidthMax = TableCalcMaxColumnWidth(table, column_n); + column->WidthGiven = ImMin(column->WidthGiven, column->WidthMax); column->WidthGiven = ImMax(column->WidthGiven, ImMin(column->WidthRequest, table->MinColumnWidth)); column->MaxX = offset_x + column->WidthGiven + table->CellSpacingX1 + table->CellSpacingX2 + table->CellPaddingX * 2.0f; @@ -1034,9 +1084,10 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // - ClipRect.Max.x: using WorkMaxX instead of MaxX (aka including padding) makes things more consistent when resizing down, tho slightly detrimental to visibility in very-small column. // - ClipRect.Max.x: using MaxX makes it easier for header to receive hover highlight with no discontinuity and display sorting arrow. // - FIXME-TABLE: We want equal width columns to have equal (ClipRect.Max.x - WorkMinX) width, which means ClipRect.max.x cannot stray off host_clip_rect.Max.x else right-most column may appear shorter. + const float previous_instance_work_min_x = column->WorkMinX; column->WorkMinX = column->MinX + table->CellPaddingX + table->CellSpacingX1; column->WorkMaxX = column->MaxX - table->CellPaddingX - table->CellSpacingX2; // Expected max - column->ItemWidth = ImFloor(column->WidthGiven * 0.65f); + column->ItemWidth = ImTrunc(column->WidthGiven * 0.65f); column->ClipRect.Min.x = column->MinX; column->ClipRect.Min.y = work_rect.Min.y; column->ClipRect.Max.x = column->MaxX; //column->WorkMaxX; @@ -1060,9 +1111,12 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) column->IsRequestOutput = is_visible || column->AutoFitQueue != 0 || column->CannotSkipItemsQueue != 0; // Mark column as SkipItems (ignoring all items/layout) + // (table->HostSkipItems is a copy of inner_window->SkipItems before we cleared it above in Part 2) column->IsSkipItems = !column->IsEnabled || table->HostSkipItems; if (column->IsSkipItems) IM_ASSERT(!is_visible); + if (column->IsRequestOutput && !column->IsSkipItems) + has_at_least_one_column_requesting_output = true; // Update status flags column->Flags |= ImGuiTableColumnFlags_IsEnabled; @@ -1070,8 +1124,13 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) column->Flags |= ImGuiTableColumnFlags_IsVisible; if (column->SortOrder != -1) column->Flags |= ImGuiTableColumnFlags_IsSorted; - if (table->HoveredColumnBody == column_n) + + // Detect hovered column + if (is_hovering_table && mouse_skewed_x >= column->ClipRect.Min.x && mouse_skewed_x < column->ClipRect.Max.x) + { column->Flags |= ImGuiTableColumnFlags_IsHovered; + table->HoveredColumnBody = (ImGuiTableColumnIdx)column_n; + } // Alignment // FIXME-TABLE: This align based on the whole column width, not per-cell, and therefore isn't useful in @@ -1083,11 +1142,25 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // column->WorkMinX = ImLerp(column->WorkMinX, ImMax(column->StartX, column->MaxX - column->ContentWidthRowsUnfrozen), 0.5f); // Reset content width variables - column->ContentMaxXFrozen = column->ContentMaxXUnfrozen = column->WorkMinX; - column->ContentMaxXHeadersUsed = column->ContentMaxXHeadersIdeal = column->WorkMinX; + if (table->InstanceCurrent == 0) + { + column->ContentMaxXFrozen = column->WorkMinX; + column->ContentMaxXUnfrozen = column->WorkMinX; + column->ContentMaxXHeadersUsed = column->WorkMinX; + column->ContentMaxXHeadersIdeal = column->WorkMinX; + } + else + { + // As we store an absolute value to make per-cell updates faster, we need to offset values used for width computation. + const float offset_from_previous_instance = column->WorkMinX - previous_instance_work_min_x; + column->ContentMaxXFrozen += offset_from_previous_instance; + column->ContentMaxXUnfrozen += offset_from_previous_instance; + column->ContentMaxXHeadersUsed += offset_from_previous_instance; + column->ContentMaxXHeadersIdeal += offset_from_previous_instance; + } // Don't decrement auto-fit counters until container window got a chance to submit its items - if (table->HostSkipItems == false) + if (table->HostSkipItems == false && table->InstanceCurrent == 0) { column->AutoFitQueue >>= 1; column->CannotSkipItemsQueue >>= 1; @@ -1100,18 +1173,26 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) visible_n++; } + // In case the table is visible (e.g. decorations) but all columns clipped, we keep a column visible. + // Else if give no chance to a clipper-savy user to submit rows and therefore total contents height used by scrollbar. + if (has_at_least_one_column_requesting_output == false) + { + table->Columns[table->LeftMostEnabledColumn].IsRequestOutput = true; + table->Columns[table->LeftMostEnabledColumn].IsSkipItems = false; + } + // [Part 7] Detect/store when we are hovering the unused space after the right-most column (so e.g. context menus can react on it) // Clear Resizable flag if none of our column are actually resizable (either via an explicit _NoResize flag, either // because of using _WidthAuto/_WidthStretch). This will hide the resizing option from the context menu. const float unused_x1 = ImMax(table->WorkRect.Min.x, table->Columns[table->RightMostEnabledColumn].ClipRect.Max.x); if (is_hovering_table && table->HoveredColumnBody == -1) - { - if (g.IO.MousePos.x >= unused_x1) + if (mouse_skewed_x >= unused_x1) table->HoveredColumnBody = (ImGuiTableColumnIdx)table->ColumnsCount; - } if (has_resizable == false && (table->Flags & ImGuiTableFlags_Resizable)) table->Flags &= ~ImGuiTableFlags_Resizable; + table->IsActiveIdAliveBeforeTable = (g.ActiveIdIsAlive != 0); + // [Part 8] Lock actual OuterRect/WorkRect right-most position. // This is done late to handle the case of fixed-columns tables not claiming more widths that they need. // Because of this we are careful with uses of WorkRect and InnerClipRect before this point. @@ -1123,8 +1204,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) table->InnerClipRect.Max.x = ImMin(table->InnerClipRect.Max.x, unused_x1); } table->InnerWindow->ParentWorkRect = table->WorkRect; - table->BorderX1 = table->InnerClipRect.Min.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : -1.0f); - table->BorderX2 = table->InnerClipRect.Max.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : +1.0f); + table->BorderX1 = table->InnerClipRect.Min.x; + table->BorderX2 = table->InnerClipRect.Max.x; // Setup window's WorkRect.Max.y for GetContentRegionAvail(). Other values will be updated in each TableBeginCell() call. float window_content_max_y; @@ -1140,14 +1221,26 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // [Part 10] Hit testing on borders if (table->Flags & ImGuiTableFlags_Resizable) TableUpdateBorders(table); - table_instance->LastFirstRowHeight = 0.0f; + table_instance->LastTopHeadersRowHeight = 0.0f; table->IsLayoutLocked = true; table->IsUsingHeaders = false; - // [Part 11] Context menu - if (TableBeginContextMenuPopup(table)) + // Highlight header + table->HighlightColumnHeader = -1; + if (table->IsContextPopupOpen && table->ContextPopupColumn != -1 && table->InstanceInteracted == table->InstanceCurrent) + table->HighlightColumnHeader = table->ContextPopupColumn; + else if ((table->Flags & ImGuiTableFlags_HighlightHoveredColumn) && table->HoveredColumnBody != -1 && table->HoveredColumnBody != table->ColumnsCount && table->HoveredColumnBorder == -1) + if (g.ActiveId == 0 || (table->IsActiveIdInTable || g.DragDropActive)) + table->HighlightColumnHeader = table->HoveredColumnBody; + + // [Part 11] Default context menu + // - To append to this menu: you can call TableBeginContextMenuPopup()/.../EndPopup(). + // - To modify or replace this: set table->IsContextPopupNoDefaultContents = true, then call TableBeginContextMenuPopup()/.../EndPopup(). + // - You may call TableDrawDefaultContextMenu() with selected flags to display specific sections of the default menu, + // e.g. TableDrawDefaultContextMenu(table, table->Flags & ~ImGuiTableFlags_Hideable) will display everything EXCEPT columns visibility options. + if (table->DisableDefaultContextMenu == false && TableBeginContextMenuPopup(table)) { - TableDrawContextMenu(table); + TableDrawDefaultContextMenu(table, table->Flags); EndPopup(); } @@ -1168,7 +1261,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) if (table->Flags & ImGuiTableFlags_NoClip) table->DrawSplitter->SetCurrentChannel(inner_window->DrawList, TABLE_DRAW_CHANNEL_NOCLIP); else - inner_window->DrawList->PushClipRect(inner_window->ClipRect.Min, inner_window->ClipRect.Max, false); + inner_window->DrawList->PushClipRect(inner_window->InnerClipRect.Min, inner_window->InnerClipRect.Max, false); // FIXME: use table->InnerClipRect? } // Process hit-testing on resizing borders. Actual size change will be applied in EndTable() @@ -1183,10 +1276,10 @@ void ImGui::TableUpdateBorders(ImGuiTable* table) // really problematic (whereas the actual visual will be displayed in EndTable() and using the current frame height). // Actual columns highlight/render will be performed in EndTable() and not be affected. ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); - const float hit_half_width = TABLE_RESIZE_SEPARATOR_HALF_THICKNESS; - const float hit_y1 = table->OuterRect.Min.y; - const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table_instance->LastOuterHeight); - const float hit_y2_head = hit_y1 + table_instance->LastFirstRowHeight; + const float hit_half_width = ImTrunc(TABLE_RESIZE_SEPARATOR_HALF_THICKNESS * g.CurrentDpiScale); + const float hit_y1 = (table->FreezeRowsCount >= 1 ? table->OuterRect.Min.y : table->WorkRect.Min.y) + table->AngledHeadersHeight; + const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table_instance->LastOuterHeight - table->AngledHeadersHeight); + const float hit_y2_head = hit_y1 + table_instance->LastTopHeadersRowHeight; for (int order_n = 0; order_n < table->ColumnsCount; order_n++) { @@ -1217,7 +1310,7 @@ void ImGui::TableUpdateBorders(ImGuiTable* table) { TableSetColumnWidthAutoSingle(table, column_n); ClearActiveID(); - held = hovered = false; + held = false; } if (held) { @@ -1289,7 +1382,7 @@ void ImGui::EndTable() max_pos_x = ImMax(max_pos_x, table->Columns[table->RightMostEnabledColumn].WorkMaxX + table->CellPaddingX + table->OuterPaddingX - outer_padding_for_border); if (table->ResizedColumn != -1) max_pos_x = ImMax(max_pos_x, table->ResizeLockMinContentsX2); - table->InnerWindow->DC.CursorMaxPos.x = max_pos_x; + table->InnerWindow->DC.CursorMaxPos.x = max_pos_x + table->TempData->AngledHeadersExtraWidth; } // Pop clipping rect @@ -1360,11 +1453,13 @@ void ImGui::EndTable() if (table->ResizedColumn != -1 && table->InstanceCurrent == table->InstanceInteracted) { ImGuiTableColumn* column = &table->Columns[table->ResizedColumn]; - const float new_x2 = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + TABLE_RESIZE_SEPARATOR_HALF_THICKNESS); - const float new_width = ImFloor(new_x2 - column->MinX - table->CellSpacingX1 - table->CellPaddingX * 2.0f); + const float new_x2 = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + ImTrunc(TABLE_RESIZE_SEPARATOR_HALF_THICKNESS * g.CurrentDpiScale)); + const float new_width = ImTrunc(new_x2 - column->MinX - table->CellSpacingX1 - table->CellPaddingX * 2.0f); table->ResizedColumnNextWidth = new_width; } + table->IsActiveIdInTable = (g.ActiveIdIsAlive != 0 && table->IsActiveIdAliveBeforeTable == false); + // Pop from id stack IM_ASSERT_USER_ERROR(inner_window->IDStack.back() == table_instance->TableInstanceID, "Mismatching PushID/PopID!"); IM_ASSERT_USER_ERROR(outer_window->DC.ItemWidthStack.Size >= temp_data->HostBackupItemWidthStackSize, "Too many PopItemWidth!"); @@ -1387,7 +1482,12 @@ void ImGui::EndTable() // CursorPosPrevLine and CursorMaxPos manually. That should be a more general layout feature, see same problem e.g. #3414) if (inner_window != outer_window) { + short backup_nav_layers_active_mask = inner_window->DC.NavLayersActiveMask; + inner_window->DC.NavLayersActiveMask |= 1 << ImGuiNavLayer_Main; // So empty table don't appear to navigate differently. + g.CurrentTable = NULL; // To avoid error recovery recursing EndChild(); + g.CurrentTable = table; + inner_window->DC.NavLayersActiveMask = backup_nav_layers_active_mask; } else { @@ -1405,9 +1505,13 @@ void ImGui::EndTable() } else if (temp_data->UserOuterSize.x <= 0.0f) { - const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollX) ? inner_window->ScrollbarSizes.x : 0.0f; - outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, table->OuterRect.Min.x + table->ColumnsAutoFitWidth + decoration_size - temp_data->UserOuterSize.x); - outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, table->OuterRect.Min.x + table->ColumnsAutoFitWidth)); + // Some references for this: #7651 + tests "table_reported_size", "table_reported_size_outer" equivalent Y block + // - Checking for ImGuiTableFlags_ScrollX/ScrollY flag makes us a frame ahead when disabling those flags. + // - FIXME-TABLE: Would make sense to pre-compute expected scrollbar visibility/sizes to generally save a frame of feedback. + const float inner_content_max_x = table->OuterRect.Min.x + table->ColumnsAutoFitWidth; // Slightly misleading name but used for code symmetry with inner_content_max_y + const float decoration_size = table->TempData->AngledHeadersExtraWidth + ((table->Flags & ImGuiTableFlags_ScrollY) ? inner_window->ScrollbarSizes.x : 0.0f); + outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, inner_content_max_x + decoration_size - temp_data->UserOuterSize.x); + outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, inner_content_max_x + decoration_size)); } else { @@ -1415,9 +1519,9 @@ void ImGui::EndTable() } if (temp_data->UserOuterSize.y <= 0.0f) { - const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollY) ? inner_window->ScrollbarSizes.y : 0.0f; + const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollX) ? inner_window->ScrollbarSizes.y : 0.0f; outer_window->DC.IdealMaxPos.y = ImMax(outer_window->DC.IdealMaxPos.y, inner_content_max_y + decoration_size - temp_data->UserOuterSize.y); - outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, inner_content_max_y)); + outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, inner_content_max_y + decoration_size)); } else { @@ -1444,7 +1548,7 @@ void ImGui::EndTable() NavUpdateCurrentWindowIsScrollPushableX(); } -// See "COLUMN SIZING POLICIES" comments at the top of this file +// See "COLUMNS SIZING POLICIES" comments at the top of this file // If (init_width_or_weight <= 0.0f) it is ignored void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_id) { @@ -1472,6 +1576,11 @@ void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, flo if ((flags & ImGuiTableColumnFlags_WidthMask_) == 0 && init_width_or_weight > 0.0f) if ((table->Flags & ImGuiTableFlags_SizingMask_) == ImGuiTableFlags_SizingFixedFit || (table->Flags & ImGuiTableFlags_SizingMask_) == ImGuiTableFlags_SizingFixedSame) flags |= ImGuiTableColumnFlags_WidthFixed; + if (flags & ImGuiTableColumnFlags_AngledHeader) + { + flags |= ImGuiTableColumnFlags_NoHeaderLabel; + table->AngledHeadersCount++; + } TableSetupColumnFlags(table, column, flags); column->UserID = user_id; @@ -1505,6 +1614,7 @@ void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, flo } // Store name (append with zero-terminator in contiguous buffer) + // FIXME: If we recorded the number of \n in names we could compute header row height column->NameOffset = -1; if (label != NULL && label[0] != 0) { @@ -1819,15 +1929,16 @@ void ImGui::TableEndRow(ImGuiTable* table) const float bg_y2 = table->RowPosY2; const bool unfreeze_rows_actual = (table->CurrentRow + 1 == table->FreezeRowsCount); const bool unfreeze_rows_request = (table->CurrentRow + 1 == table->FreezeRowsRequest); - if (table->CurrentRow == 0) - TableGetInstanceData(table, table->InstanceCurrent)->LastFirstRowHeight = bg_y2 - bg_y1; + ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); + if ((table->RowFlags & ImGuiTableRowFlags_Headers) && (table->CurrentRow == 0 || (table->LastRowFlags & ImGuiTableRowFlags_Headers))) + table_instance->LastTopHeadersRowHeight += bg_y2 - bg_y1; const bool is_visible = (bg_y2 >= table->InnerClipRect.Min.y && bg_y1 <= table->InnerClipRect.Max.y); if (is_visible) { // Update data for TableGetHoveredRow() - if (table->HoveredColumnBody != -1 && g.IO.MousePos.y >= bg_y1 && g.IO.MousePos.y < bg_y2) - TableGetInstanceData(table, table->InstanceCurrent)->HoveredRowNext = table->CurrentRow; + if (table->HoveredColumnBody != -1 && g.IO.MousePos.y >= bg_y1 && g.IO.MousePos.y < bg_y2 && table_instance->HoveredRowNext < 0) + table_instance->HoveredRowNext = table->CurrentRow; // Decide of background color for the row ImU32 bg_col0 = 0; @@ -1840,15 +1951,14 @@ void ImGui::TableEndRow(ImGuiTable* table) bg_col1 = table->RowBgColor[1]; // Decide of top border color - ImU32 border_col = 0; + ImU32 top_border_col = 0; const float border_size = TABLE_BORDER_SIZE; - if (table->CurrentRow > 0 || table->InnerWindow == table->OuterWindow) - if (table->Flags & ImGuiTableFlags_BordersInnerH) - border_col = (table->LastRowFlags & ImGuiTableRowFlags_Headers) ? table->BorderColorStrong : table->BorderColorLight; + if (table->CurrentRow > 0 && (table->Flags & ImGuiTableFlags_BordersInnerH)) + top_border_col = (table->LastRowFlags & ImGuiTableRowFlags_Headers) ? table->BorderColorStrong : table->BorderColorLight; const bool draw_cell_bg_color = table->RowCellDataCurrent >= 0; const bool draw_strong_bottom_border = unfreeze_rows_actual; - if ((bg_col0 | bg_col1 | border_col) != 0 || draw_strong_bottom_border || draw_cell_bg_color) + if ((bg_col0 | bg_col1 | top_border_col) != 0 || draw_strong_bottom_border || draw_cell_bg_color) { // In theory we could call SetWindowClipRectBeforeSetChannel() but since we know TableEndRow() is // always followed by a change of clipping rectangle we perform the smallest overwrite possible here. @@ -1882,13 +1992,14 @@ void ImGui::TableEndRow(ImGuiTable* table) cell_bg_rect.ClipWith(table->BgClipRect); cell_bg_rect.Min.x = ImMax(cell_bg_rect.Min.x, column->ClipRect.Min.x); // So that first column after frozen one gets clipped when scrolling cell_bg_rect.Max.x = ImMin(cell_bg_rect.Max.x, column->MaxX); - window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor); + if (cell_bg_rect.Min.y < cell_bg_rect.Max.y) + window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor); } } // Draw top border - if (border_col && bg_y1 >= table->BgClipRect.Min.y && bg_y1 < table->BgClipRect.Max.y) - window->DrawList->AddLine(ImVec2(table->BorderX1, bg_y1), ImVec2(table->BorderX2, bg_y1), border_col, border_size); + if (top_border_col && bg_y1 >= table->BgClipRect.Min.y && bg_y1 < table->BgClipRect.Max.y) + window->DrawList->AddLine(ImVec2(table->BorderX1, bg_y1), ImVec2(table->BorderX2, bg_y1), top_border_col, border_size); // Draw bottom border at the row unfreezing mark (always strong) if (draw_strong_bottom_border && bg_y2 >= table->BgClipRect.Min.y && bg_y2 < table->BgClipRect.Max.y) @@ -1899,34 +2010,37 @@ void ImGui::TableEndRow(ImGuiTable* table) // We need to do that in TableEndRow() instead of TableBeginRow() so the list clipper can mark end of row and // get the new cursor position. if (unfreeze_rows_request) - for (int column_n = 0; column_n < table->ColumnsCount; column_n++) - table->Columns[column_n].NavLayerCurrent = ImGuiNavLayer_Main; - if (unfreeze_rows_actual) { - IM_ASSERT(table->IsUnfrozenRows == false); - const float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y); - table->IsUnfrozenRows = true; - TableGetInstanceData(table, table->InstanceCurrent)->LastFrozenHeight = y0 - table->OuterRect.Min.y; - - // BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect - table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, window->InnerClipRect.Max.y); - table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = window->InnerClipRect.Max.y; - table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen; - IM_ASSERT(table->Bg2ClipRectForDrawCmd.Min.y <= table->Bg2ClipRectForDrawCmd.Max.y); - - float row_height = table->RowPosY2 - table->RowPosY1; - table->RowPosY2 = window->DC.CursorPos.y = table->WorkRect.Min.y + table->RowPosY2 - table->OuterRect.Min.y; - table->RowPosY1 = table->RowPosY2 - row_height; for (int column_n = 0; column_n < table->ColumnsCount; column_n++) + table->Columns[column_n].NavLayerCurrent = ImGuiNavLayer_Main; + const float y0 = ImMax(table->RowPosY2 + 1, table->InnerClipRect.Min.y); + table_instance->LastFrozenHeight = y0 - table->OuterRect.Min.y; + + if (unfreeze_rows_actual) { - ImGuiTableColumn* column = &table->Columns[column_n]; - column->DrawChannelCurrent = column->DrawChannelUnfrozen; - column->ClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y; - } + IM_ASSERT(table->IsUnfrozenRows == false); + table->IsUnfrozenRows = true; + + // BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect + table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, table->InnerClipRect.Max.y); + table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = table->InnerClipRect.Max.y; + table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen; + IM_ASSERT(table->Bg2ClipRectForDrawCmd.Min.y <= table->Bg2ClipRectForDrawCmd.Max.y); + + float row_height = table->RowPosY2 - table->RowPosY1; + table->RowPosY2 = window->DC.CursorPos.y = table->WorkRect.Min.y + table->RowPosY2 - table->OuterRect.Min.y; + table->RowPosY1 = table->RowPosY2 - row_height; + for (int column_n = 0; column_n < table->ColumnsCount; column_n++) + { + ImGuiTableColumn* column = &table->Columns[column_n]; + column->DrawChannelCurrent = column->DrawChannelUnfrozen; + column->ClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y; + } - // Update cliprect ahead of TableBeginCell() so clipper can access to new ClipRect->Min.y - SetWindowClipRectBeforeSetChannel(window, table->Columns[0].ClipRect); - table->DrawSplitter->SetCurrentChannel(window->DrawList, table->Columns[0].DrawChannelCurrent); + // Update cliprect ahead of TableBeginCell() so clipper can access to new ClipRect->Min.y + SetWindowClipRectBeforeSetChannel(window, table->Columns[0].ClipRect); + table->DrawSplitter->SetCurrentChannel(window->DrawList, table->Columns[0].DrawChannelCurrent); + } } if (!(table->RowFlags & ImGuiTableRowFlags_Headers)) @@ -2092,9 +2206,11 @@ void ImGui::TableEndCell(ImGuiTable* table) // - TableSetColumnWidthAutoAll() [Internal] // - TableUpdateColumnsWeightFromWidth() [Internal] //------------------------------------------------------------------------- +// Note that actual columns widths are computed in TableUpdateLayout(). +//------------------------------------------------------------------------- -// Maximum column content width given current layout. Use column->MinX so this value on a per-column basis. -float ImGui::TableGetMaxColumnWidth(const ImGuiTable* table, int column_n) +// Maximum column content width given current layout. Use column->MinX so this value differs on a per-column basis. +float ImGui::TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n) { const ImGuiTableColumn* column = &table->Columns[column_n]; float max_width = FLT_MAX; @@ -2156,7 +2272,7 @@ void ImGui::TableSetColumnWidth(int column_n, float width) // Compare both requested and actual given width to avoid overwriting requested width when column is stuck (minimum size, bounded) IM_ASSERT(table->MinColumnWidth > 0.0f); const float min_width = table->MinColumnWidth; - const float max_width = ImMax(min_width, TableGetMaxColumnWidth(table, column_n)); + const float max_width = ImMax(min_width, column_0->WidthMax); // Don't use TableCalcMaxColumnWidth() here as it would rely on MinX from last instance (#7933) column_0_width = ImClamp(column_0_width, min_width, max_width); if (column_0->WidthGiven == column_0_width || column_0->WidthRequest == column_0_width) return; @@ -2284,6 +2400,7 @@ void ImGui::TableUpdateColumnsWeightFromWidth(ImGuiTable* table) // - TablePopBackgroundChannel() [Internal] // - TableSetupDrawChannels() [Internal] // - TableMergeDrawChannels() [Internal] +// - TableGetColumnBorderCol() [Internal] // - TableDrawBorders() [Internal] //------------------------------------------------------------------------- @@ -2567,6 +2684,18 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table) } } +static ImU32 TableGetColumnBorderCol(ImGuiTable* table, int order_n, int column_n) +{ + const bool is_hovered = (table->HoveredColumnBorder == column_n); + const bool is_resized = (table->ResizedColumn == column_n) && (table->InstanceInteracted == table->InstanceCurrent); + const bool is_frozen_separator = (table->FreezeColumnsCount == order_n + 1); + if (is_resized || is_hovered) + return ImGui::GetColorU32(is_resized ? ImGuiCol_SeparatorActive : ImGuiCol_SeparatorHovered); + if (is_frozen_separator || (table->Flags & (ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_NoBordersInBodyUntilResize))) + return table->BorderColorStrong; + return table->BorderColorLight; +} + // FIXME-TABLE: This is a mess, need to redesign how we render borders (as some are also done in TableEndRow) void ImGui::TableDrawBorders(ImGuiTable* table) { @@ -2581,9 +2710,9 @@ void ImGui::TableDrawBorders(ImGuiTable* table) // Draw inner border and resizing feedback ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); const float border_size = TABLE_BORDER_SIZE; - const float draw_y1 = table->InnerRect.Min.y; + const float draw_y1 = ImMax(table->InnerRect.Min.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table->AngledHeadersHeight) + ((table->Flags & ImGuiTableFlags_BordersOuterH) ? 1.0f : 0.0f); const float draw_y2_body = table->InnerRect.Max.y; - const float draw_y2_head = table->IsUsingHeaders ? ImMin(table->InnerRect.Max.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table_instance->LastFirstRowHeight) : draw_y1; + const float draw_y2_head = table->IsUsingHeaders ? ImMin(table->InnerRect.Max.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table_instance->LastTopHeadersRowHeight) : draw_y1; if (table->Flags & ImGuiTableFlags_BordersInnerV) { for (int order_n = 0; order_n < table->ColumnsCount; order_n++) @@ -2609,21 +2738,9 @@ void ImGui::TableDrawBorders(ImGuiTable* table) // Draw in outer window so right-most column won't be clipped // Always draw full height border when being resized/hovered, or on the delimitation of frozen column scrolling. - ImU32 col; - float draw_y2; - if (is_hovered || is_resized || is_frozen_separator) - { - draw_y2 = draw_y2_body; - col = is_resized ? GetColorU32(ImGuiCol_SeparatorActive) : is_hovered ? GetColorU32(ImGuiCol_SeparatorHovered) : table->BorderColorStrong; - } - else - { - draw_y2 = (table->Flags & (ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_NoBordersInBodyUntilResize)) ? draw_y2_head : draw_y2_body; - col = (table->Flags & (ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_NoBordersInBodyUntilResize)) ? table->BorderColorStrong : table->BorderColorLight; - } - + float draw_y2 = (is_hovered || is_resized || is_frozen_separator || (table->Flags & (ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_NoBordersInBodyUntilResize)) == 0) ? draw_y2_body : draw_y2_head; if (draw_y2 > draw_y1) - inner_drawlist->AddLine(ImVec2(column->MaxX, draw_y1), ImVec2(column->MaxX, draw_y2), col, border_size); + inner_drawlist->AddLine(ImVec2(column->MaxX, draw_y1), ImVec2(column->MaxX, draw_y2), TableGetColumnBorderCol(table, order_n, column_n), border_size); } } @@ -2655,7 +2772,7 @@ void ImGui::TableDrawBorders(ImGuiTable* table) } if ((table->Flags & ImGuiTableFlags_BordersInnerH) && table->RowPosY2 < table->OuterRect.Max.y) { - // Draw bottom-most row border + // Draw bottom-most row border between it is above outer border. const float border_y = table->RowPosY2; if (border_y >= table->BgClipRect.Min.y && border_y < table->BgClipRect.Max.y) inner_drawlist->AddLine(ImVec2(table->BorderX1, border_y), ImVec2(table->BorderX2, border_y), table->BorderColorLight, border_size); @@ -2700,7 +2817,7 @@ ImGuiTableSortSpecs* ImGui::TableGetSortSpecs() static inline ImGuiSortDirection TableGetColumnAvailSortDirection(ImGuiTableColumn* column, int n) { IM_ASSERT(n < column->SortDirectionsAvailCount); - return (column->SortDirectionsAvailList >> (n << 1)) & 0x03; + return (ImGuiSortDirection)((column->SortDirectionsAvailList >> (n << 1)) & 0x03); } // Fix sort direction if currently set on a value which is unavailable (e.g. activating NoSortAscending/NoSortDescending) @@ -2841,6 +2958,7 @@ void ImGui::TableSortSpecsBuild(ImGuiTable* table) } // Write output + // May be able to move all SortSpecs data from table (48 bytes) to ImGuiTableTempData if we decide to write it back on every BeginTable() ImGuiTableColumnSortSpecs* sort_specs = (table->SortSpecsCount == 0) ? NULL : (table->SortSpecsCount == 1) ? &table->SortSpecsSingle : table->SortSpecsMulti.Data; if (dirty && sort_specs != NULL) for (int column_n = 0; column_n < table->ColumnsCount; column_n++) @@ -2853,7 +2971,7 @@ void ImGui::TableSortSpecsBuild(ImGuiTable* table) sort_spec->ColumnUserID = column->UserID; sort_spec->ColumnIndex = (ImGuiTableColumnIdx)column_n; sort_spec->SortOrder = (ImGuiTableColumnIdx)column->SortOrder; - sort_spec->SortDirection = column->SortDirection; + sort_spec->SortDirection = (ImGuiSortDirection)column->SortDirection; } table->SortSpecs.Specs = sort_specs; @@ -2864,8 +2982,11 @@ void ImGui::TableSortSpecsBuild(ImGuiTable* table) // [SECTION] Tables: Headers //------------------------------------------------------------------------- // - TableGetHeaderRowHeight() [Internal] +// - TableGetHeaderAngledMaxLabelWidth() [Internal] // - TableHeadersRow() // - TableHeader() +// - TableAngledHeadersRow() +// - TableAngledHeadersRowEx() [Internal] //------------------------------------------------------------------------- float ImGui::TableGetHeaderRowHeight() @@ -2874,23 +2995,34 @@ float ImGui::TableGetHeaderRowHeight() // Calculate row height, for the unlikely case that some labels may be taller than others. // If we didn't do that, uneven header height would highlight but smaller one before the tallest wouldn't catch input for all height. // In your custom header row you may omit this all together and just call TableNextRow() without a height... - float row_height = GetTextLineHeight(); - int columns_count = TableGetColumnCount(); - for (int column_n = 0; column_n < columns_count; column_n++) - { - ImGuiTableColumnFlags flags = TableGetColumnFlags(column_n); - if ((flags & ImGuiTableColumnFlags_IsEnabled) && !(flags & ImGuiTableColumnFlags_NoHeaderLabel)) - row_height = ImMax(row_height, CalcTextSize(TableGetColumnName(column_n)).y); - } - row_height += GetStyle().CellPadding.y * 2.0f; - return row_height; + ImGuiContext& g = *GImGui; + ImGuiTable* table = g.CurrentTable; + float row_height = g.FontSize; + for (int column_n = 0; column_n < table->ColumnsCount; column_n++) + if (IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n)) + if ((table->Columns[column_n].Flags & ImGuiTableColumnFlags_NoHeaderLabel) == 0) + row_height = ImMax(row_height, CalcTextSize(TableGetColumnName(table, column_n)).y); + return row_height + g.Style.CellPadding.y * 2.0f; +} + +float ImGui::TableGetHeaderAngledMaxLabelWidth() +{ + ImGuiContext& g = *GImGui; + ImGuiTable* table = g.CurrentTable; + float width = 0.0f; + for (int column_n = 0; column_n < table->ColumnsCount; column_n++) + if (IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n)) + if (table->Columns[column_n].Flags & ImGuiTableColumnFlags_AngledHeader) + width = ImMax(width, CalcTextSize(TableGetColumnName(table, column_n), NULL, true).x); + return width + g.Style.CellPadding.y * 2.0f; // Swap padding } // [Public] This is a helper to output TableHeader() calls based on the column names declared in TableSetupColumn(). // The intent is that advanced users willing to create customized headers would not need to use this helper -// and can create their own! For example: TableHeader() may be preceeded by Checkbox() or other custom widgets. +// and can create their own! For example: TableHeader() may be preceded by Checkbox() or other custom widgets. // See 'Demo->Tables->Custom headers' for a demonstration of implementing a custom version of this. -// This code is constructed to not make much use of internal functions, as it is intended to be a template to copy. +// This code is intentionally written to not make much use of internal functions, to give you better direction +// if you need to write your own. // FIXME-TABLE: TableOpenContextMenu() and TableGetHeaderRowHeight() are not public. void ImGui::TableHeadersRow() { @@ -2898,14 +3030,15 @@ void ImGui::TableHeadersRow() ImGuiTable* table = g.CurrentTable; IM_ASSERT(table != NULL && "Need to call TableHeadersRow() after BeginTable()!"); - // Layout if not already done (this is automatically done by TableNextRow, we do it here solely to facilitate stepping in debugger as it is frequent to step in TableUpdateLayout) + // Call layout if not already done. This is automatically done by TableNextRow: we do it here _only_ to make + // it easier to debug-step in TableUpdateLayout(). Your own version of this function doesn't need this. if (!table->IsLayoutLocked) TableUpdateLayout(table); // Open row - const float row_y1 = GetCursorScreenPos().y; const float row_height = TableGetHeaderRowHeight(); TableNextRow(ImGuiTableRowFlags_Headers, row_height); + const float row_y1 = GetCursorScreenPos().y; if (table->HostSkipItems) // Merely an optimization, you may skip in your own code. return; @@ -2915,8 +3048,7 @@ void ImGui::TableHeadersRow() if (!TableSetColumnIndex(column_n)) continue; - // Push an id to allow unnamed labels (generally accidental, but let's behave nicely with them) - // In your own code you may omit the PushID/PopID all-together, provided you know they won't collide. + // Push an id to allow empty/unnamed headers. This is also idiomatic as it ensure there is a consistent ID path to access columns (for e.g. automation) const char* name = (TableGetColumnFlags(column_n) & ImGuiTableColumnFlags_NoHeaderLabel) ? "" : TableGetColumnName(column_n); PushID(column_n); TableHeader(name); @@ -2927,7 +3059,7 @@ void ImGui::TableHeadersRow() ImVec2 mouse_pos = ImGui::GetMousePos(); if (IsMouseReleased(1) && TableGetHoveredColumn() == columns_count) if (mouse_pos.y >= row_y1 && mouse_pos.y < row_y1 + row_height) - TableOpenContextMenu(-1); // Will open a non-column-specific popup. + TableOpenContextMenu(columns_count); // Will open a non-column-specific popup. } // Emit a column header (text + optional sort order) @@ -2961,11 +3093,14 @@ void ImGui::TableHeader(const char* label) // Calculate ideal size for sort order arrow float w_arrow = 0.0f; float w_sort_text = 0.0f; + bool sort_arrow = false; char sort_order_suf[4] = ""; const float ARROW_SCALE = 0.65f; if ((table->Flags & ImGuiTableFlags_Sortable) && !(column->Flags & ImGuiTableColumnFlags_NoSort)) { - w_arrow = ImFloor(g.FontSize * ARROW_SCALE + g.Style.FramePadding.x); + w_arrow = ImTrunc(g.FontSize * ARROW_SCALE + g.Style.FramePadding.x); + if (column->SortOrder != -1) + sort_arrow = true; if (column->SortOrder > 0) { ImFormatString(sort_order_suf, IM_ARRAYSIZE(sort_order_suf), "%d", column->SortOrder + 1); @@ -2973,13 +3108,12 @@ void ImGui::TableHeader(const char* label) } } - // We feed our unclipped width to the column without writing on CursorMaxPos, so that column is still considering for merging. + // We feed our unclipped width to the column without writing on CursorMaxPos, so that column is still considered for merging. float max_pos_x = label_pos.x + label_size.x + w_sort_text + w_arrow; - column->ContentMaxXHeadersUsed = ImMax(column->ContentMaxXHeadersUsed, column->WorkMaxX); + column->ContentMaxXHeadersUsed = ImMax(column->ContentMaxXHeadersUsed, sort_arrow ? cell_r.Max.x : ImMin(max_pos_x, cell_r.Max.x)); column->ContentMaxXHeadersIdeal = ImMax(column->ContentMaxXHeadersIdeal, max_pos_x); // Keep header highlighted when context menu is open. - const bool selected = (table->IsContextPopupOpen && table->ContextPopupColumn == column_n && table->InstanceInteracted == table->InstanceCurrent); ImGuiID id = window->GetID(label); ImRect bb(cell_r.Min.x, cell_r.Min.y, cell_r.Max.x, ImMax(cell_r.Max.y, cell_r.Min.y + label_height + g.Style.CellPadding.y * 2.0f)); ItemSize(ImVec2(0.0f, label_height)); // Don't declare unclipped width, it'll be fed ContentMaxPosHeadersIdeal @@ -2990,9 +3124,10 @@ void ImGui::TableHeader(const char* label) //GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 0, 0, 255)); // [DEBUG] // Using AllowOverlap mode because we cover the whole cell, and we want user to be able to submit subsequent items. + const bool highlight = (table->HighlightColumnHeader == column_n); bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_AllowOverlap); - if (held || hovered || selected) + if (held || hovered || highlight) { const ImU32 col = GetColorU32(held ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); //RenderFrame(bb.Min, bb.Max, col, false, 0.0f); @@ -3004,7 +3139,7 @@ void ImGui::TableHeader(const char* label) if ((table->RowFlags & ImGuiTableRowFlags_Headers) == 0) TableSetBgColor(ImGuiTableBgTarget_CellBg, GetColorU32(ImGuiCol_TableHeaderBg), table->CurrentColumn); } - RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_TypeThin | ImGuiNavHighlightFlags_NoRounding); + RenderNavCursor(bb, id, ImGuiNavRenderCursorFlags_Compact | ImGuiNavRenderCursorFlags_NoRounding); if (held) table->HeldHeaderColumn = (ImGuiTableColumnIdx)column_n; window->DC.CursorPos.y -= g.Style.ItemSpacing.y * 0.5f; @@ -3070,11 +3205,182 @@ void ImGui::TableHeader(const char* label) TableOpenContextMenu(column_n); } +// Unlike TableHeadersRow() it is not expected that you can reimplement or customize this with custom widgets. +// FIXME: No hit-testing/button on the angled header. +void ImGui::TableAngledHeadersRow() +{ + ImGuiContext& g = *GImGui; + ImGuiTable* table = g.CurrentTable; + ImGuiTableTempData* temp_data = table->TempData; + temp_data->AngledHeadersRequests.resize(0); + temp_data->AngledHeadersRequests.reserve(table->ColumnsEnabledCount); + + // Which column needs highlight? + const ImGuiID row_id = GetID("##AngledHeaders"); + ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); + int highlight_column_n = table->HighlightColumnHeader; + if (highlight_column_n == -1 && table->HoveredColumnBody != -1) + if (table_instance->HoveredRowLast == 0 && table->HoveredColumnBorder == -1 && (g.ActiveId == 0 || g.ActiveId == row_id || (table->IsActiveIdInTable || g.DragDropActive))) + highlight_column_n = table->HoveredColumnBody; + + // Build up request + ImU32 col_header_bg = GetColorU32(ImGuiCol_TableHeaderBg); + ImU32 col_text = GetColorU32(ImGuiCol_Text); + for (int order_n = 0; order_n < table->ColumnsCount; order_n++) + if (IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n)) + { + const int column_n = table->DisplayOrderToIndex[order_n]; + ImGuiTableColumn* column = &table->Columns[column_n]; + if ((column->Flags & ImGuiTableColumnFlags_AngledHeader) == 0) // Note: can't rely on ImGuiTableColumnFlags_IsVisible test here. + continue; + ImGuiTableHeaderData request = { (ImGuiTableColumnIdx)column_n, col_text, col_header_bg, (column_n == highlight_column_n) ? GetColorU32(ImGuiCol_Header) : 0 }; + temp_data->AngledHeadersRequests.push_back(request); + } + + // Render row + TableAngledHeadersRowEx(row_id, g.Style.TableAngledHeadersAngle, 0.0f, temp_data->AngledHeadersRequests.Data, temp_data->AngledHeadersRequests.Size); +} + +// Important: data must be fed left to right +void ImGui::TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count) +{ + ImGuiContext& g = *GImGui; + ImGuiTable* table = g.CurrentTable; + ImGuiWindow* window = g.CurrentWindow; + ImDrawList* draw_list = window->DrawList; + IM_ASSERT(table != NULL && "Need to call TableHeadersRow() after BeginTable()!"); + IM_ASSERT(table->CurrentRow == -1 && "Must be first row"); + + if (max_label_width == 0.0f) + max_label_width = TableGetHeaderAngledMaxLabelWidth(); + + // Angle argument expressed in (-IM_PI/2 .. +IM_PI/2) as it is easier to think about for user. + const bool flip_label = (angle < 0.0f); + angle -= IM_PI * 0.5f; + const float cos_a = ImCos(angle); + const float sin_a = ImSin(angle); + const float label_cos_a = flip_label ? ImCos(angle + IM_PI) : cos_a; + const float label_sin_a = flip_label ? ImSin(angle + IM_PI) : sin_a; + const ImVec2 unit_right = ImVec2(cos_a, sin_a); + + // Calculate our base metrics and set angled headers data _before_ the first call to TableNextRow() + // FIXME-STYLE: Would it be better for user to submit 'max_label_width' or 'row_height' ? One can be derived from the other. + const float header_height = g.FontSize + g.Style.CellPadding.x * 2.0f; + const float row_height = ImTrunc(ImFabs(ImRotate(ImVec2(max_label_width, flip_label ? +header_height : -header_height), cos_a, sin_a).y)); + table->AngledHeadersHeight = row_height; + table->AngledHeadersSlope = (sin_a != 0.0f) ? (cos_a / sin_a) : 0.0f; + const ImVec2 header_angled_vector = unit_right * (row_height / -sin_a); // vector from bottom-left to top-left, and from bottom-right to top-right + + // Declare row, override and draw our own background + TableNextRow(ImGuiTableRowFlags_Headers, row_height); + TableNextColumn(); + const ImRect row_r(table->WorkRect.Min.x, table->BgClipRect.Min.y, table->WorkRect.Max.x, table->RowPosY2); + table->DrawSplitter->SetCurrentChannel(draw_list, TABLE_DRAW_CHANNEL_BG0); + float clip_rect_min_x = table->BgClipRect.Min.x; + if (table->FreezeColumnsCount > 0) + clip_rect_min_x = ImMax(clip_rect_min_x, table->Columns[table->FreezeColumnsCount - 1].MaxX); + TableSetBgColor(ImGuiTableBgTarget_RowBg0, 0); // Cancel + PushClipRect(table->BgClipRect.Min, table->BgClipRect.Max, false); // Span all columns + draw_list->AddRectFilled(ImVec2(table->BgClipRect.Min.x, row_r.Min.y), ImVec2(table->BgClipRect.Max.x, row_r.Max.y), GetColorU32(ImGuiCol_TableHeaderBg, 0.25f)); // FIXME-STYLE: Change row background with an arbitrary color. + PushClipRect(ImVec2(clip_rect_min_x, table->BgClipRect.Min.y), table->BgClipRect.Max, true); // Span all columns + + ButtonBehavior(row_r, row_id, NULL, NULL); + KeepAliveID(row_id); + + const float ascent_scaled = g.Font->Ascent * g.FontScale; // FIXME: Standardize those scaling factors better + const float line_off_for_ascent_x = (ImMax((g.FontSize - ascent_scaled) * 0.5f, 0.0f) / -sin_a) * (flip_label ? -1.0f : 1.0f); + const ImVec2 padding = g.Style.CellPadding; // We will always use swapped component + const ImVec2 align = g.Style.TableAngledHeadersTextAlign; + + // Draw background and labels in first pass, then all borders. + float max_x = 0.0f; + for (int pass = 0; pass < 2; pass++) + for (int order_n = 0; order_n < data_count; order_n++) + { + const ImGuiTableHeaderData* request = &data[order_n]; + const int column_n = request->Index; + ImGuiTableColumn* column = &table->Columns[column_n]; + + ImVec2 bg_shape[4]; + bg_shape[0] = ImVec2(column->MaxX, row_r.Max.y); + bg_shape[1] = ImVec2(column->MinX, row_r.Max.y); + bg_shape[2] = bg_shape[1] + header_angled_vector; + bg_shape[3] = bg_shape[0] + header_angled_vector; + if (pass == 0) + { + // Draw shape + draw_list->AddQuadFilled(bg_shape[0], bg_shape[1], bg_shape[2], bg_shape[3], request->BgColor0); + draw_list->AddQuadFilled(bg_shape[0], bg_shape[1], bg_shape[2], bg_shape[3], request->BgColor1); // Optional highlight + max_x = ImMax(max_x, bg_shape[3].x); + + // Draw label + // - First draw at an offset where RenderTextXXX() function won't meddle with applying current ClipRect, then transform to final offset. + // - Handle multiple lines manually, as we want each lines to follow on the horizontal border, rather than see a whole block rotated. + const char* label_name = TableGetColumnName(table, column_n); + const char* label_name_end = FindRenderedTextEnd(label_name); + const float line_off_step_x = (g.FontSize / -sin_a); + const int label_lines = ImTextCountLines(label_name, label_name_end); + + // Left<>Right alignment + float line_off_curr_x = flip_label ? (label_lines - 1) * line_off_step_x : 0.0f; + float line_off_for_align_x = ImMax((((column->MaxX - column->MinX) - padding.x * 2.0f) - (label_lines * line_off_step_x)), 0.0f) * align.x; + line_off_curr_x += line_off_for_align_x - line_off_for_ascent_x; + + // Register header width + column->ContentMaxXHeadersUsed = column->ContentMaxXHeadersIdeal = column->WorkMinX + ImCeil(label_lines * line_off_step_x - line_off_for_align_x); + + while (label_name < label_name_end) + { + const char* label_name_eol = strchr(label_name, '\n'); + if (label_name_eol == NULL) + label_name_eol = label_name_end; + + // FIXME: Individual line clipping for right-most column is broken for negative angles. + ImVec2 label_size = CalcTextSize(label_name, label_name_eol); + float clip_width = max_label_width - padding.y; // Using padding.y*2.0f would be symmetrical but hide more text. + float clip_height = ImMin(label_size.y, column->ClipRect.Max.x - column->WorkMinX - line_off_curr_x); + ImRect clip_r(window->ClipRect.Min, window->ClipRect.Min + ImVec2(clip_width, clip_height)); + int vtx_idx_begin = draw_list->_VtxCurrentIdx; + PushStyleColor(ImGuiCol_Text, request->TextColor); + RenderTextEllipsis(draw_list, clip_r.Min, clip_r.Max, clip_r.Max.x, clip_r.Max.x, label_name, label_name_eol, &label_size); + PopStyleColor(); + int vtx_idx_end = draw_list->_VtxCurrentIdx; + + // Up<>Down alignment + const float available_space = ImMax(clip_width - label_size.x + ImAbs(padding.x * cos_a) * 2.0f - ImAbs(padding.y * sin_a) * 2.0f, 0.0f); + const float vertical_offset = available_space * align.y * (flip_label ? -1.0f : 1.0f); + + // Rotate and offset label + ImVec2 pivot_in = ImVec2(window->ClipRect.Min.x - vertical_offset, window->ClipRect.Min.y + label_size.y); + ImVec2 pivot_out = ImVec2(column->WorkMinX, row_r.Max.y); + line_off_curr_x += flip_label ? -line_off_step_x : line_off_step_x; + pivot_out += unit_right * padding.y; + if (flip_label) + pivot_out += unit_right * (clip_width - ImMax(0.0f, clip_width - label_size.x)); + pivot_out.x += flip_label ? line_off_curr_x + line_off_step_x : line_off_curr_x; + ShadeVertsTransformPos(draw_list, vtx_idx_begin, vtx_idx_end, pivot_in, label_cos_a, label_sin_a, pivot_out); // Rotate and offset + //if (g.IO.KeyShift) { ImDrawList* fg_dl = GetForegroundDrawList(); vtx_idx_begin = fg_dl->_VtxCurrentIdx; fg_dl->AddRect(clip_r.Min, clip_r.Max, IM_COL32(0, 255, 0, 255), 0.0f, 0, 1.0f); ShadeVertsTransformPos(fg_dl, vtx_idx_begin, fg_dl->_VtxCurrentIdx, pivot_in, label_cos_a, label_sin_a, pivot_out); } + + label_name = label_name_eol + 1; + } + } + if (pass == 1) + { + // Draw border + draw_list->AddLine(bg_shape[0], bg_shape[3], TableGetColumnBorderCol(table, order_n, column_n)); + } + } + PopClipRect(); + PopClipRect(); + table->TempData->AngledHeadersExtraWidth = ImMax(0.0f, max_x - table->Columns[table->RightMostEnabledColumn].MaxX); +} + //------------------------------------------------------------------------- // [SECTION] Tables: Context Menu //------------------------------------------------------------------------- // - TableOpenContextMenu() [Internal] -// - TableDrawContextMenu() [Internal] +// - TableBeginContextMenuPopup() [Internal] +// - TableDrawDefaultContextMenu() [Internal] //------------------------------------------------------------------------- // Use -1 to open menu not specific to a given column. @@ -3110,7 +3416,13 @@ bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table) // Output context menu into current window (generally a popup) // FIXME-TABLE: Ideally this should be writable by the user. Full programmatic access to that data? -void ImGui::TableDrawContextMenu(ImGuiTable* table) +// Sections to display are pulled from 'flags_for_section_to_display', which is typically == table->Flags. +// - ImGuiTableFlags_Resizable -> display Sizing menu items +// - ImGuiTableFlags_Reorderable -> display "Reset Order" +////- ImGuiTableFlags_Sortable -> display sorting options (disabled) +// - ImGuiTableFlags_Hideable -> display columns visibility menu items +// It means if you have a custom context menus you can call this section and omit some sections, and add your own. +void ImGui::TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; @@ -3122,7 +3434,7 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table) ImGuiTableColumn* column = (column_n != -1) ? &table->Columns[column_n] : NULL; // Sizing - if (table->Flags & ImGuiTableFlags_Resizable) + if (flags_for_section_to_display & ImGuiTableFlags_Resizable) { if (column != NULL) { @@ -3142,7 +3454,7 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table) } // Ordering - if (table->Flags & ImGuiTableFlags_Reorderable) + if (flags_for_section_to_display & ImGuiTableFlags_Reorderable) { if (MenuItem(LocalizeGetMsg(ImGuiLocKey_TableResetOrder), NULL, false, !table->IsDefaultDisplayOrder)) table->IsResetDisplayOrderRequest = true; @@ -3156,7 +3468,7 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table) // Sorting // (modify TableOpenContextMenu() to add _Sortable flag if enabling this) #if 0 - if ((table->Flags & ImGuiTableFlags_Sortable) && column != NULL && (column->Flags & ImGuiTableColumnFlags_NoSort) == 0) + if ((flags_for_section_to_display & ImGuiTableFlags_Sortable) && column != NULL && (column->Flags & ImGuiTableColumnFlags_NoSort) == 0) { if (want_separator) Separator(); @@ -3171,13 +3483,13 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table) #endif // Hiding / Visibility - if (table->Flags & ImGuiTableFlags_Hideable) + if (flags_for_section_to_display & ImGuiTableFlags_Hideable) { if (want_separator) Separator(); want_separator = true; - PushItemFlag(ImGuiItemFlags_SelectableDontClosePopup, true); + PushItemFlag(ImGuiItemFlags_AutoClosePopups, false); for (int other_column_n = 0; other_column_n < table->ColumnsCount; other_column_n++) { ImGuiTableColumn* other_column = &table->Columns[other_column_n]; @@ -3607,7 +3919,8 @@ static const char* DebugNodeTableGetSizingPolicyDesc(ImGuiTableFlags sizing_poli void ImGui::DebugNodeTable(ImGuiTable* table) { - const bool is_active = (table->LastFrameActive >= GetFrameCount() - 2); // Note that fully clipped early out scrolling tables will appear as inactive here. + ImGuiContext& g = *GImGui; + const bool is_active = (table->LastFrameActive >= g.FrameCount - 2); // Note that fully clipped early out scrolling tables will appear as inactive here. if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); } bool open = TreeNode(table, "Table 0x%08X (%d columns, in '%s')%s", table->ID, table->ColumnsCount, table->OuterWindow->Name, is_active ? "" : " *Inactive*"); if (!is_active) { PopStyleColor(); } @@ -3619,6 +3932,13 @@ void ImGui::DebugNodeTable(ImGuiTable* table) return; if (table->InstanceCurrent > 0) Text("** %d instances of same table! Some data below will refer to last instance.", table->InstanceCurrent + 1); + if (g.IO.ConfigDebugIsDebuggerPresent) + { + if (DebugBreakButton("**DebugBreak**", "in BeginTable()")) + g.DebugBreakInTable = table->ID; + SameLine(); + } + bool clear_settings = SmallButton("Clear settings"); BulletText("OuterRect: Pos: (%.1f,%.1f) Size: (%.1f,%.1f) Sizing: '%s'", table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.GetWidth(), table->OuterRect.GetHeight(), DebugNodeTableGetSizingPolicyDesc(table->Flags)); BulletText("ColumnsGivenWidth: %.1f, ColumnsAutoFitWidth: %.1f, InnerWidth: %.1f%s", table->ColumnsGivenWidth, table->ColumnsAutoFitWidth, table->InnerWidth, table->InnerWidth == 0.0f ? " (auto)" : ""); @@ -3755,7 +4075,7 @@ float ImGui::GetColumnNormFromOffset(const ImGuiOldColumns* columns, float offse return offset / (columns->OffMaxX - columns->OffMinX); } -static const float COLUMNS_HIT_RECT_HALF_WIDTH = 4.0f; +static const float COLUMNS_HIT_RECT_HALF_THICKNESS = 4.0f; static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column_index) { @@ -3766,7 +4086,7 @@ static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column_index) IM_ASSERT(column_index > 0); // We are not supposed to drag column 0. IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index)); - float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + COLUMNS_HIT_RECT_HALF_WIDTH - window->Pos.x; + float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + ImTrunc(COLUMNS_HIT_RECT_HALF_THICKNESS * g.CurrentDpiScale) - window->Pos.x; x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing); if ((columns->Flags & ImGuiOldColumnFlags_NoPreserveWidths)) x = ImMin(x, ImGui::GetColumnOffset(column_index + 1) - g.Style.ColumnsMinSpacing); @@ -3939,7 +4259,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl // Set state for first column // We aim so that the right-most column will have the same clipping width as other after being clipped by parent ClipRect const float column_padding = g.Style.ItemSpacing.x; - const float half_clip_extend_x = ImFloor(ImMax(window->WindowPadding.x * 0.5f, window->WindowBorderSize)); + const float half_clip_extend_x = ImTrunc(ImMax(window->WindowPadding.x * 0.5f, window->WindowBorderSize)); const float max_1 = window->WorkRect.Max.x + column_padding - ImMax(column_padding - window->WindowPadding.x, 0.0f); const float max_2 = window->WorkRect.Max.x + half_clip_extend_x; columns->OffMinX = window->DC.Indent.x - column_padding + ImMax(column_padding - window->WindowPadding.x, 0.0f); @@ -3986,7 +4306,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl float width = offset_1 - offset_0; PushItemWidth(width * 0.65f); window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f); - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); + window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding; window->WorkRect.Max.y = window->ContentRegionRect.Max.y; } @@ -4002,7 +4322,7 @@ void ImGui::NextColumn() if (columns->Count == 1) { - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); + window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); IM_ASSERT(columns->Current == 0); return; } @@ -4034,7 +4354,7 @@ void ImGui::NextColumn() window->DC.IsSameLine = false; columns->LineMinY = columns->LineMaxY; } - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); + window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); window->DC.CursorPos.y = columns->LineMinY; window->DC.CurrLineSize = ImVec2(0.0f, 0.0f); window->DC.CurrLineTextBaseOffset = 0.0f; @@ -4081,7 +4401,7 @@ void ImGui::EndColumns() ImGuiOldColumnData* column = &columns->Columns[n]; float x = window->Pos.x + GetColumnOffset(n); const ImGuiID column_id = columns->ID + ImGuiID(n); - const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH; + const float column_hit_hw = ImTrunc(COLUMNS_HIT_RECT_HALF_THICKNESS * g.CurrentDpiScale); const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2)); if (!ItemAdd(column_hit_rect, column_id, NULL, ImGuiItemFlags_NoNav)) continue; @@ -4091,14 +4411,14 @@ void ImGui::EndColumns() { ButtonBehavior(column_hit_rect, column_id, &hovered, &held); if (hovered || held) - g.MouseCursor = ImGuiMouseCursor_ResizeEW; + SetMouseCursor(ImGuiMouseCursor_ResizeEW); if (held && !(column->Flags & ImGuiOldColumnFlags_NoResize)) dragging_column = n; } // Draw column const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : hovered ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator); - const float xi = IM_FLOOR(x); + const float xi = IM_TRUNC(x); window->DrawList->AddLine(ImVec2(xi, y1 + 1.0f), ImVec2(xi, y2), col); } @@ -4119,16 +4439,16 @@ void ImGui::EndColumns() window->ParentWorkRect = columns->HostBackupParentWorkRect; window->DC.CurrentColumns = NULL; window->DC.ColumnsOffset.x = 0.0f; - window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); + window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); NavUpdateCurrentWindowIsScrollPushableX(); } -void ImGui::Columns(int columns_count, const char* id, bool border) +void ImGui::Columns(int columns_count, const char* id, bool borders) { ImGuiWindow* window = GetCurrentWindow(); IM_ASSERT(columns_count >= 1); - ImGuiOldColumnFlags flags = (border ? 0 : ImGuiOldColumnFlags_NoBorder); + ImGuiOldColumnFlags flags = (borders ? 0 : ImGuiOldColumnFlags_NoBorder); //flags |= ImGuiOldColumnFlags_NoPreserveWidths; // NB: Legacy behavior ImGuiOldColumns* columns = window->DC.CurrentColumns; if (columns != NULL && columns->Count == columns_count && columns->Flags == flags) diff --git a/bgfx/3rdparty/dear-imgui/imgui_user.h b/bgfx/3rdparty/dear-imgui/imgui_user.h index e1819956..b6b57aa2 100644 --- a/bgfx/3rdparty/dear-imgui/imgui_user.h +++ b/bgfx/3rdparty/dear-imgui/imgui_user.h @@ -48,5 +48,4 @@ namespace ImGui #include "widgets/file_list.h" #include "widgets/gizmo.h" #include "widgets/markdown.h" -#include "widgets/memory_editor.h" #include "widgets/range_slider.h" diff --git a/bgfx/3rdparty/dear-imgui/imgui_user.inl b/bgfx/3rdparty/dear-imgui/imgui_user.inl index 1ef19027..7cc28b45 100644 --- a/bgfx/3rdparty/dear-imgui/imgui_user.inl +++ b/bgfx/3rdparty/dear-imgui/imgui_user.inl @@ -77,5 +77,4 @@ namespace ImGui #include "widgets/file_list.inl" #include "widgets/gizmo.inl" #include "widgets/markdown.inl" -#include "widgets/memory_editor.inl" #include "widgets/range_slider.inl" diff --git a/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp b/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp index 22bb2a40..6a3d2976 100644 --- a/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp +++ b/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.9 +// dear imgui, v1.91.4 // (widgets code) /* @@ -18,6 +18,10 @@ Index of this file: // [SECTION] Widgets: ColorEdit, ColorPicker, ColorButton, etc. // [SECTION] Widgets: TreeNode, CollapsingHeader, etc. // [SECTION] Widgets: Selectable +// [SECTION] Widgets: Typing-Select support +// [SECTION] Widgets: Box-Select support +// [SECTION] Widgets: Multi-Select support +// [SECTION] Widgets: Multi-Select helpers // [SECTION] Widgets: ListBox // [SECTION] Widgets: PlotLines, PlotHistogram // [SECTION] Widgets: Value helpers @@ -68,11 +72,13 @@ Index of this file: #pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants (typically 0.0f) is ok. #pragma clang diagnostic ignored "-Wformat-nonliteral" // warning: format string is not a string literal // passing non-literal to vsnformat(). yes, user passing incorrect format strings can crash the code. #pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness +#pragma clang diagnostic ignored "-Wunused-macros" // warning: macro is not used // we define snprintf/vsnprintf on Windows so they are available, but not always used. #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant // some standard header variations use #define NULL 0 #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. #pragma clang diagnostic ignored "-Wenum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') #pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access #elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind #pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked @@ -120,9 +126,9 @@ static const ImU64 IM_U64_MAX = (2ULL * 9223372036854775807LL + 1); //------------------------------------------------------------------------- // For InputTextEx() -static bool InputTextFilterCharacter(ImGuiContext* ctx, unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data, ImGuiInputSource input_source); -static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end); -static ImVec2 InputTextCalcTextSizeW(ImGuiContext* ctx, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false); +static bool InputTextFilterCharacter(ImGuiContext* ctx, unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data, bool input_source_is_clipboard = false); +static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end); +static ImVec2 InputTextCalcTextSize(ImGuiContext* ctx, const char* text_begin, const char* text_end, const char** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false); //------------------------------------------------------------------------- // [SECTION] Widgets: Text, etc. @@ -419,6 +425,7 @@ void ImGui::BulletTextV(const char* fmt, va_list args) // - RadioButton() // - ProgressBar() // - Bullet() +// - Hyperlink() //------------------------------------------------------------------------- // The ButtonBehavior() function is key to many interactions and used by many/most widgets. @@ -475,6 +482,14 @@ void ImGui::BulletTextV(const char* fmt, va_list args) // Frame N + RepeatDelay + RepeatRate*N true true - true //------------------------------------------------------------------------------------------------------------------------------------------------- +// - FIXME: For refactor we could output flags, incl mouse hovered vs nav keyboard vs nav triggered etc. +// And better standardize how widgets use 'GetColor32((held && hovered) ? ... : hovered ? ...)' vs 'GetColor32(held ? ... : hovered ? ...);' +// For mouse feedback we typically prefer the 'held && hovered' test, but for nav feedback not always. Outputting hovered=true on Activation may be misleading. +// - Since v1.91.2 (Sept 2024) we included io.ConfigDebugHighlightIdConflicts feature. +// One idiom which was previously valid which will now emit a warning is when using multiple overlayed ButtonBehavior() +// with same ID and different MouseButton (see #8030). You can fix it by: +// (1) switching to use a single ButtonBehavior() with multiple _MouseButton flags. +// or (2) surrounding those calls with PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag() bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags) { ImGuiContext& g = *GImGui; @@ -482,7 +497,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool // Default only reacts to left mouse button if ((flags & ImGuiButtonFlags_MouseButtonMask_) == 0) - flags |= ImGuiButtonFlags_MouseButtonDefault_; + flags |= ImGuiButtonFlags_MouseButtonLeft; // Default behavior requires click + release inside bounding box if ((flags & ImGuiButtonFlags_PressedOnMask_) == 0) @@ -490,11 +505,9 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool // Default behavior inherited from item flags // Note that _both_ ButtonFlags and ItemFlags are valid sources, so copy one into the item_flags and only check that. - ImGuiItemFlags item_flags = (g.LastItemData.ID == id ? g.LastItemData.InFlags : g.CurrentItemFlags); + ImGuiItemFlags item_flags = (g.LastItemData.ID == id ? g.LastItemData.ItemFlags : g.CurrentItemFlags); if (flags & ImGuiButtonFlags_AllowOverlap) item_flags |= ImGuiItemFlags_AllowOverlap; - if (flags & ImGuiButtonFlags_Repeat) - item_flags |= ImGuiItemFlags_ButtonRepeat; ImGuiWindow* backup_hovered_window = g.HoveredWindow; const bool flatten_hovered_children = (flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredWindow && g.HoveredWindow->RootWindow == window; @@ -503,7 +516,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool #ifdef IMGUI_ENABLE_TEST_ENGINE // Alternate registration spot, for when caller didn't use ItemAdd() - if (id != 0 && g.LastItemData.ID != id) + if (g.LastItemData.ID != id) IMGUI_TEST_ENGINE_ITEM_ADD(id, bb, NULL); #endif @@ -531,6 +544,8 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool const ImGuiID test_owner_id = (flags & ImGuiButtonFlags_NoTestKeyOwner) ? ImGuiKeyOwner_Any : id; if (hovered) { + IM_ASSERT(id != 0); // Lazily check inside rare path. + // Poll mouse buttons // - 'mouse_button_clicked' is generally carried into ActiveIdMouseButton when setting ActiveId. // - Technically we only need some values in one code path, but since this is gated by hovered test this is fine. @@ -539,12 +554,13 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool for (int button = 0; button < 3; button++) if (flags & (ImGuiButtonFlags_MouseButtonLeft << button)) // Handle ImGuiButtonFlags_MouseButtonRight and ImGuiButtonFlags_MouseButtonMiddle here. { - if (IsMouseClicked(button, test_owner_id) && mouse_button_clicked == -1) { mouse_button_clicked = button; } + if (IsMouseClicked(button, ImGuiInputFlags_None, test_owner_id) && mouse_button_clicked == -1) { mouse_button_clicked = button; } if (IsMouseReleased(button, test_owner_id) && mouse_button_released == -1) { mouse_button_released = button; } } // Process initial action - if (!(flags & ImGuiButtonFlags_NoKeyModifiers) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt)) + const bool mods_ok = !(flags & ImGuiButtonFlags_NoKeyModsAllowed) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt); + if (mods_ok) { if (mouse_button_clicked != -1 && g.ActiveId != id) { @@ -555,8 +571,14 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool SetActiveID(id, window); g.ActiveIdMouseButton = mouse_button_clicked; if (!(flags & ImGuiButtonFlags_NoNavFocus)) + { SetFocusID(id, window); - FocusWindow(window); + FocusWindow(window); + } + else + { + FocusWindow(window, ImGuiFocusRequestFlags_RestoreFocusedChild); // Still need to focus and bring to front, but try to avoid losing NavId when navigating a child + } } if ((flags & ImGuiButtonFlags_PressedOnClick) || ((flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseClickedCount[mouse_button_clicked] == 2)) { @@ -565,10 +587,16 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool ClearActiveID(); else SetActiveID(id, window); // Hold on ID + g.ActiveIdMouseButton = mouse_button_clicked; if (!(flags & ImGuiButtonFlags_NoNavFocus)) + { SetFocusID(id, window); - g.ActiveIdMouseButton = mouse_button_clicked; - FocusWindow(window); + FocusWindow(window); + } + else + { + FocusWindow(window, ImGuiFocusRequestFlags_RestoreFocusedChild); // Still need to focus and bring to front, but try to avoid losing NavId when navigating a child + } } } if (flags & ImGuiButtonFlags_PressedOnRelease) @@ -579,7 +607,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool if (!has_repeated_at_least_once) pressed = true; if (!(flags & ImGuiButtonFlags_NoNavFocus)) - SetFocusID(id, window); + SetFocusID(id, window); // FIXME: Lack of FocusWindow() call here is inconsistent with other paths. Research why. ClearActiveID(); } } @@ -587,17 +615,17 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool // 'Repeat' mode acts when held regardless of _PressedOn flags (see table above). // Relies on repeat logic of IsMouseClicked() but we may as well do it ourselves if we end up exposing finer RepeatDelay/RepeatRate settings. if (g.ActiveId == id && (item_flags & ImGuiItemFlags_ButtonRepeat)) - if (g.IO.MouseDownDuration[g.ActiveIdMouseButton] > 0.0f && IsMouseClicked(g.ActiveIdMouseButton, test_owner_id, ImGuiInputFlags_Repeat)) + if (g.IO.MouseDownDuration[g.ActiveIdMouseButton] > 0.0f && IsMouseClicked(g.ActiveIdMouseButton, ImGuiInputFlags_Repeat, test_owner_id)) pressed = true; } - if (pressed) - g.NavDisableHighlight = true; + if (pressed && g.IO.ConfigNavCursorVisibleAuto) + g.NavCursorVisible = false; } - // Gamepad/Keyboard navigation - // We report navigated item as hovered but we don't set g.HoveredId to not interfere with mouse. - if (g.NavId == id && !g.NavDisableHighlight && g.NavDisableMouseHover && (g.ActiveId == 0 || g.ActiveId == id || g.ActiveId == window->MoveId)) + // Keyboard/Gamepad navigation handling + // We report navigated and navigation-activated items as hovered but we don't set g.HoveredId to not interfere with mouse. + if (g.NavId == id && g.NavCursorVisible && g.NavHighlightItemUnderNav) if (!(flags & ImGuiButtonFlags_NoHoveredOnFocus)) hovered = true; if (g.NavActivateDownId == id) @@ -619,8 +647,10 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool pressed = true; SetActiveID(id, window); g.ActiveIdSource = g.NavInputSource; - if (!(flags & ImGuiButtonFlags_NoNavFocus)) + if (!(flags & ImGuiButtonFlags_NoNavFocus) && !(g.NavActivateFlags & ImGuiActivateFlags_FromShortcut)) SetFocusID(id, window); + if (g.NavActivateFlags & ImGuiActivateFlags_FromShortcut) + g.ActiveIdFromShortcut = true; } } @@ -658,19 +688,25 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool } ClearActiveID(); } - if (!(flags & ImGuiButtonFlags_NoNavFocus)) - g.NavDisableHighlight = true; + if (!(flags & ImGuiButtonFlags_NoNavFocus) && g.IO.ConfigNavCursorVisibleAuto) + g.NavCursorVisible = false; } else if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad) { // When activated using Nav, we hold on the ActiveID until activation button is released - if (g.NavActivateDownId != id) + if (g.NavActivateDownId == id) + held = true; // hovered == true not true as we are already likely hovered on direct activation. + else ClearActiveID(); } if (pressed) g.ActiveIdHasBeenPressedBefore = true; } + // Activation highlight (this may be a remote activation) + if (g.NavHighlightActivatedId == id) + hovered = true; + if (out_hovered) *out_hovered = hovered; if (out_held) *out_held = held; @@ -703,7 +739,7 @@ bool ImGui::ButtonEx(const char* label, const ImVec2& size_arg, ImGuiButtonFlags // Render const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); - RenderNavHighlight(bb, id); + RenderNavCursor(bb, id); RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding); if (g.LogEnabled) @@ -750,11 +786,12 @@ bool ImGui::InvisibleButton(const char* str_id, const ImVec2& size_arg, ImGuiBut ImVec2 size = CalcItemSize(size_arg, 0.0f, 0.0f); const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); ItemSize(size); - if (!ItemAdd(bb, id)) + if (!ItemAdd(bb, id, NULL, (flags & ImGuiButtonFlags_EnableNav) ? ImGuiItemFlags_None : ImGuiItemFlags_NoNav)) return false; bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); + RenderNavCursor(bb, id); IMGUI_TEST_ENGINE_ITEM_INFO(id, str_id, g.LastItemData.StatusFlags); return pressed; @@ -780,7 +817,7 @@ bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiBu // Render const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); const ImU32 text_col = GetColorU32(ImGuiCol_Text); - RenderNavHighlight(bb, id); + RenderNavCursor(bb, id); RenderFrame(bb.Min, bb.Max, bg_col, true, g.Style.FrameRounding); RenderArrow(window->DrawList, bb.Min + ImVec2(ImMax(0.0f, (size.x - g.FontSize) * 0.5f), ImMax(0.0f, (size.y - g.FontSize) * 0.5f)), text_col, dir); @@ -806,7 +843,7 @@ bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos) ImRect bb_interact = bb; const float area_to_visible_ratio = window->OuterRectClipped.GetArea() / bb.GetArea(); if (area_to_visible_ratio < 1.5f) - bb_interact.Expand(ImFloor(bb_interact.GetSize() * -0.25f)); + bb_interact.Expand(ImTrunc(bb_interact.GetSize() * -0.25f)); // Tweak 2: We intentionally allow interaction when clipped so that a mechanical Alt,Right,Activate sequence can always close a window. // (this isn't the common behavior of buttons, but it doesn't affect the user because navigation tends to keep items visible in scrolling layer). @@ -818,17 +855,15 @@ bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos) return pressed; // Render - // FIXME: Clarify this mess - ImU32 col = GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered); - ImVec2 center = bb.GetCenter(); + ImU32 bg_col = GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered); if (hovered) - window->DrawList->AddCircleFilled(center, ImMax(2.0f, g.FontSize * 0.5f + 1.0f), col); - - float cross_extent = g.FontSize * 0.5f * 0.7071f - 1.0f; + window->DrawList->AddRectFilled(bb.Min, bb.Max, bg_col); + RenderNavCursor(bb, id, ImGuiNavRenderCursorFlags_Compact); ImU32 cross_col = GetColorU32(ImGuiCol_Text); - center -= ImVec2(0.5f, 0.5f); - window->DrawList->AddLine(center + ImVec2(+cross_extent, +cross_extent), center + ImVec2(-cross_extent, -cross_extent), cross_col, 1.0f); - window->DrawList->AddLine(center + ImVec2(+cross_extent, -cross_extent), center + ImVec2(-cross_extent, +cross_extent), cross_col, 1.0f); + ImVec2 cross_center = bb.GetCenter() - ImVec2(0.5f, 0.5f); + float cross_extent = g.FontSize * 0.5f * 0.7071f - 1.0f; + window->DrawList->AddLine(cross_center + ImVec2(+cross_extent, +cross_extent), cross_center + ImVec2(-cross_extent, -cross_extent), cross_col, 1.0f); + window->DrawList->AddLine(cross_center + ImVec2(+cross_extent, -cross_extent), cross_center + ImVec2(-cross_extent, +cross_extent), cross_col, 1.0f); return pressed; } @@ -849,7 +884,8 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos) ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); ImU32 text_col = GetColorU32(ImGuiCol_Text); if (hovered || held) - window->DrawList->AddCircleFilled(bb.GetCenter() + ImVec2(0.0f, -0.5f), g.FontSize * 0.5f + 1.0f, bg_col); + window->DrawList->AddRectFilled(bb.Min, bb.Max, bg_col); + RenderNavCursor(bb, id, ImGuiNavRenderCursorFlags_Compact); RenderArrow(window->DrawList, bb.Min, text_col, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f); // Switch to moving the window after mouse is moved beyond the initial drag threshold @@ -900,10 +936,10 @@ void ImGui::Scrollbar(ImGuiAxis axis) if (!window->ScrollbarX) rounding_corners |= ImDrawFlags_RoundCornersBottomRight; } - float size_avail = window->InnerRect.Max[axis] - window->InnerRect.Min[axis]; + float size_visible = window->InnerRect.Max[axis] - window->InnerRect.Min[axis]; float size_contents = window->ContentSize[axis] + window->WindowPadding[axis] * 2.0f; ImS64 scroll = (ImS64)window->Scroll[axis]; - ScrollbarEx(bb, id, axis, &scroll, (ImS64)size_avail, (ImS64)size_contents, rounding_corners); + ScrollbarEx(bb, id, axis, &scroll, (ImS64)size_visible, (ImS64)size_contents, rounding_corners); window->Scroll[axis] = (float)scroll; } @@ -913,7 +949,7 @@ void ImGui::Scrollbar(ImGuiAxis axis) // - We store values as normalized ratio and in a form that allows the window content to change while we are holding on a scrollbar // - We handle both horizontal and vertical scrollbars, which makes the terminology not ideal. // Still, the code should probably be made simpler.. -bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 size_avail_v, ImS64 size_contents_v, ImDrawFlags flags) +bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 size_visible_v, ImS64 size_contents_v, ImDrawFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; @@ -936,16 +972,16 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6 const bool allow_interaction = (alpha >= 1.0f); ImRect bb = bb_frame; - bb.Expand(ImVec2(-ImClamp(IM_FLOOR((bb_frame_width - 2.0f) * 0.5f), 0.0f, 3.0f), -ImClamp(IM_FLOOR((bb_frame_height - 2.0f) * 0.5f), 0.0f, 3.0f))); + bb.Expand(ImVec2(-ImClamp(IM_TRUNC((bb_frame_width - 2.0f) * 0.5f), 0.0f, 3.0f), -ImClamp(IM_TRUNC((bb_frame_height - 2.0f) * 0.5f), 0.0f, 3.0f))); // V denote the main, longer axis of the scrollbar (= height for a vertical scrollbar) const float scrollbar_size_v = (axis == ImGuiAxis_X) ? bb.GetWidth() : bb.GetHeight(); // Calculate the height of our grabbable box. It generally represent the amount visible (vs the total scrollable amount) // But we maintain a minimum size in pixel to allow for the user to still aim inside. - IM_ASSERT(ImMax(size_contents_v, size_avail_v) > 0.0f); // Adding this assert to check if the ImMax(XXX,1.0f) is still needed. PLEASE CONTACT ME if this triggers. - const ImS64 win_size_v = ImMax(ImMax(size_contents_v, size_avail_v), (ImS64)1); - const float grab_h_pixels = ImClamp(scrollbar_size_v * ((float)size_avail_v / (float)win_size_v), style.GrabMinSize, scrollbar_size_v); + IM_ASSERT(ImMax(size_contents_v, size_visible_v) > 0.0f); // Adding this assert to check if the ImMax(XXX,1.0f) is still needed. PLEASE CONTACT ME if this triggers. + const ImS64 win_size_v = ImMax(ImMax(size_contents_v, size_visible_v), (ImS64)1); + const float grab_h_pixels = ImClamp(scrollbar_size_v * ((float)size_visible_v / (float)win_size_v), style.GrabMinSize, scrollbar_size_v); const float grab_h_norm = grab_h_pixels / scrollbar_size_v; // Handle input right away. None of the code of Begin() is relying on scrolling position before calling Scrollbar(). @@ -954,7 +990,7 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6 ItemAdd(bb_frame, id, NULL, ImGuiItemFlags_NoNav); ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_NoNavFocus); - const ImS64 scroll_max = ImMax((ImS64)1, size_contents_v - size_avail_v); + const ImS64 scroll_max = ImMax((ImS64)1, size_contents_v - size_visible_v); float scroll_ratio = ImSaturate((float)*p_scroll_v / (float)scroll_max); float grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v; // Grab position in normalized space if (held && allow_interaction && grab_h_norm < 1.0f) @@ -964,31 +1000,41 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6 // Click position in scrollbar normalized space (0.0f->1.0f) const float clicked_v_norm = ImSaturate((mouse_pos_v - scrollbar_pos_v) / scrollbar_size_v); - SetHoveredID(id); - bool seek_absolute = false; + const int held_dir = (clicked_v_norm < grab_v_norm) ? -1 : (clicked_v_norm > grab_v_norm + grab_h_norm) ? +1 : 0; if (g.ActiveIdIsJustActivated) { - // On initial click calculate the distance between mouse and the center of the grab - seek_absolute = (clicked_v_norm < grab_v_norm || clicked_v_norm > grab_v_norm + grab_h_norm); - if (seek_absolute) - g.ScrollbarClickDeltaToGrabCenter = 0.0f; - else - g.ScrollbarClickDeltaToGrabCenter = clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f; + // On initial click when held_dir == 0 (clicked over grab): calculate the distance between mouse and the center of the grab + const bool scroll_to_clicked_location = (g.IO.ConfigScrollbarScrollByPage == false || g.IO.KeyShift || held_dir == 0); + g.ScrollbarSeekMode = scroll_to_clicked_location ? 0 : (short)held_dir; + g.ScrollbarClickDeltaToGrabCenter = (held_dir == 0 && !g.IO.KeyShift) ? clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f : 0.0f; } // Apply scroll (p_scroll_v will generally point on one member of window->Scroll) // It is ok to modify Scroll here because we are being called in Begin() after the calculation of ContentSize and before setting up our starting position - const float scroll_v_norm = ImSaturate((clicked_v_norm - g.ScrollbarClickDeltaToGrabCenter - grab_h_norm * 0.5f) / (1.0f - grab_h_norm)); - *p_scroll_v = (ImS64)(scroll_v_norm * scroll_max); + if (g.ScrollbarSeekMode == 0) + { + // Absolute seeking + const float scroll_v_norm = ImSaturate((clicked_v_norm - g.ScrollbarClickDeltaToGrabCenter - grab_h_norm * 0.5f) / (1.0f - grab_h_norm)); + *p_scroll_v = (ImS64)(scroll_v_norm * scroll_max); + } + else + { + // Page by page + if (IsMouseClicked(ImGuiMouseButton_Left, ImGuiInputFlags_Repeat) && held_dir == g.ScrollbarSeekMode) + { + float page_dir = (g.ScrollbarSeekMode > 0.0f) ? +1.0f : -1.0f; + *p_scroll_v = ImClamp(*p_scroll_v + (ImS64)(page_dir * size_visible_v), (ImS64)0, scroll_max); + } + } // Update values for rendering scroll_ratio = ImSaturate((float)*p_scroll_v / (float)scroll_max); grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v; - // Update distance to grab now that we have seeked and saturated - if (seek_absolute) - g.ScrollbarClickDeltaToGrabCenter = clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f; + // Update distance to grab now that we have seek'ed and saturated + //if (seek_absolute) + // g.ScrollbarClickDeltaToGrabCenter = clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f; } // Render @@ -1005,33 +1051,30 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6 return held; } -void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col) +// - Read about ImTextureID here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples +// - 'uv0' and 'uv1' are texture coordinates. Read about them from the same link above. +void ImGui::Image(ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; - ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); - if (border_col.w > 0.0f) - bb.Max += ImVec2(2, 2); + const float border_size = (border_col.w > 0.0f) ? 1.0f : 0.0f; + const ImVec2 padding(border_size, border_size); + const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + image_size + padding * 2.0f); ItemSize(bb); if (!ItemAdd(bb, 0)) return; - if (border_col.w > 0.0f) - { - window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(border_col), 0.0f); - window->DrawList->AddImage(user_texture_id, bb.Min + ImVec2(1, 1), bb.Max - ImVec2(1, 1), uv0, uv1, GetColorU32(tint_col)); - } - else - { - window->DrawList->AddImage(user_texture_id, bb.Min, bb.Max, uv0, uv1, GetColorU32(tint_col)); - } + // Render + if (border_size > 0.0f) + window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(border_col), 0.0f, ImDrawFlags_None, border_size); + window->DrawList->AddImage(user_texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, GetColorU32(tint_col)); } // ImageButton() is flawed as 'id' is always derived from 'texture_id' (see #2464 #1390) // We provide this internal helper to write your own variant while we figure out how to redesign the public ImageButton() API. -bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags) +bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); @@ -1039,7 +1082,7 @@ bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size return false; const ImVec2 padding = g.Style.FramePadding; - const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding * 2.0f); + const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + image_size + padding * 2.0f); ItemSize(bb); if (!ItemAdd(bb, id)) return false; @@ -1049,7 +1092,7 @@ bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size // Render const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); - RenderNavHighlight(bb, id); + RenderNavCursor(bb, id); RenderFrame(bb.Min, bb.Max, col, true, ImClamp((float)ImMin(padding.x, padding.y), 0.0f, g.Style.FrameRounding)); if (bg_col.w > 0.0f) window->DrawList->AddRectFilled(bb.Min + padding, bb.Max - padding, GetColorU32(bg_col)); @@ -1058,40 +1101,37 @@ bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size return pressed; } -bool ImGui::ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col) +// Note that ImageButton() adds style.FramePadding*2.0f to provided size. This is in order to facilitate fitting an image in a button. +bool ImGui::ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (window->SkipItems) return false; - return ImageButtonEx(window->GetID(str_id), user_texture_id, size, uv0, uv1, bg_col, tint_col); + return ImageButtonEx(window->GetID(str_id), user_texture_id, image_size, uv0, uv1, bg_col, tint_col); } #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS // Legacy API obsoleted in 1.89. Two differences with new ImageButton() -// - new ImageButton() requires an explicit 'const char* str_id' Old ImageButton() used opaque imTextureId (created issue with: multiple buttons with same image, transient texture id values, opaque computation of ID) -// - new ImageButton() always use style.FramePadding Old ImageButton() had an override argument. -// If you need to change padding with new ImageButton() you can use PushStyleVar(ImGuiStyleVar_FramePadding, value), consistent with other Button functions. +// - old ImageButton() used ImTextureId as item id (created issue with multiple buttons with same image, transient texture id values, opaque computation of ID) +// - new ImageButton() requires an explicit 'const char* str_id' +// - old ImageButton() had frame_padding' override argument. +// - new ImageButton() always use style.FramePadding. +/* bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col) { - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (window->SkipItems) - return false; - // Default to using texture ID as ID. User can still push string/integer prefixes. - PushID((void*)(intptr_t)user_texture_id); - const ImGuiID id = window->GetID("#image"); - PopID(); - + PushID((ImTextureID)(intptr_t)user_texture_id); if (frame_padding >= 0) PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2((float)frame_padding, (float)frame_padding)); - bool ret = ImageButtonEx(id, user_texture_id, size, uv0, uv1, bg_col, tint_col); + bool ret = ImageButton("", user_texture_id, size, uv0, uv1, bg_col, tint_col); if (frame_padding >= 0) PopStyleVar(); + PopID(); return ret; } +*/ #endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS bool ImGui::Checkbox(const char* label, bool* v) @@ -1109,42 +1149,60 @@ bool ImGui::Checkbox(const char* label, bool* v) const ImVec2 pos = window->DC.CursorPos; const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f)); ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, id)) - { - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); - return false; - } + const bool is_visible = ItemAdd(total_bb, id); + const bool is_multi_select = (g.LastItemData.ItemFlags & ImGuiItemFlags_IsMultiSelect) != 0; + if (!is_visible) + if (!is_multi_select || !g.BoxSelectState.UnclipMode || !g.BoxSelectState.UnclipRect.Overlaps(total_bb)) // Extra layer of "no logic clip" for box-select support + { + IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); + return false; + } + + // Range-Selection/Multi-selection support (header) + bool checked = *v; + if (is_multi_select) + MultiSelectItemHeader(id, &checked, NULL); bool hovered, held; bool pressed = ButtonBehavior(total_bb, id, &hovered, &held); - if (pressed) + + // Range-Selection/Multi-selection support (footer) + if (is_multi_select) + MultiSelectItemFooter(id, &checked, &pressed); + else if (pressed) + checked = !checked; + + if (*v != checked) { - *v = !(*v); + *v = checked; + pressed = true; // return value MarkItemEdited(id); } const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz)); - RenderNavHighlight(total_bb, id); - RenderFrame(check_bb.Min, check_bb.Max, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding); - ImU32 check_col = GetColorU32(ImGuiCol_CheckMark); - bool mixed_value = (g.LastItemData.InFlags & ImGuiItemFlags_MixedValue) != 0; - if (mixed_value) + const bool mixed_value = (g.LastItemData.ItemFlags & ImGuiItemFlags_MixedValue) != 0; + if (is_visible) { - // Undocumented tristate/mixed/indeterminate checkbox (#2644) - // This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all widgets (not just checkbox) - ImVec2 pad(ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)), ImMax(1.0f, IM_FLOOR(square_sz / 3.6f))); - window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding); - } - else if (*v) - { - const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f)); - RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad * 2.0f); + RenderNavCursor(total_bb, id); + RenderFrame(check_bb.Min, check_bb.Max, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding); + ImU32 check_col = GetColorU32(ImGuiCol_CheckMark); + if (mixed_value) + { + // Undocumented tristate/mixed/indeterminate checkbox (#2644) + // This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all widgets (not just checkbox) + ImVec2 pad(ImMax(1.0f, IM_TRUNC(square_sz / 3.6f)), ImMax(1.0f, IM_TRUNC(square_sz / 3.6f))); + window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding); + } + else if (*v) + { + const float pad = ImMax(1.0f, IM_TRUNC(square_sz / 6.0f)); + RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad * 2.0f); + } } - - ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y); + const ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y); if (g.LogEnabled) LogRenderedText(&label_pos, mixed_value ? "[~]" : *v ? "[x]" : "[ ]"); - if (label_size.x > 0.0f) + if (is_visible && label_size.x > 0.0f) RenderText(label_pos, label); IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); @@ -1227,12 +1285,12 @@ bool ImGui::RadioButton(const char* label, bool active) if (pressed) MarkItemEdited(id); - RenderNavHighlight(total_bb, id); + RenderNavCursor(total_bb, id); const int num_segment = window->DrawList->_CalcCircleAutoSegmentCount(radius); window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), num_segment); if (active) { - const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f)); + const float pad = ImMax(1.0f, IM_TRUNC(square_sz / 6.0f)); window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(ImGuiCol_CheckMark)); } @@ -1278,24 +1336,47 @@ void ImGui::ProgressBar(float fraction, const ImVec2& size_arg, const char* over if (!ItemAdd(bb, 0)) return; + // Fraction < 0.0f will display an indeterminate progress bar animation + // The value must be animated along with time, so e.g. passing '-1.0f * ImGui::GetTime()' as fraction works. + const bool is_indeterminate = (fraction < 0.0f); + if (!is_indeterminate) + fraction = ImSaturate(fraction); + + // Out of courtesy we accept a NaN fraction without crashing + float fill_n0 = 0.0f; + float fill_n1 = (fraction == fraction) ? fraction : 0.0f; + + if (is_indeterminate) + { + const float fill_width_n = 0.2f; + fill_n0 = ImFmod(-fraction, 1.0f) * (1.0f + fill_width_n) - fill_width_n; + fill_n1 = ImSaturate(fill_n0 + fill_width_n); + fill_n0 = ImSaturate(fill_n0); + } + // Render - fraction = ImSaturate(fraction); RenderFrame(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding); bb.Expand(ImVec2(-style.FrameBorderSize, -style.FrameBorderSize)); - const ImVec2 fill_br = ImVec2(ImLerp(bb.Min.x, bb.Max.x, fraction), bb.Max.y); - RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0f, fraction, style.FrameRounding); + RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), fill_n0, fill_n1, style.FrameRounding); // Default displaying the fraction as percentage string, but user can override it + // Don't display text for indeterminate bars by default char overlay_buf[32]; - if (!overlay) + if (!is_indeterminate || overlay != NULL) { - ImFormatString(overlay_buf, IM_ARRAYSIZE(overlay_buf), "%.0f%%", fraction * 100 + 0.01f); - overlay = overlay_buf; - } + if (!overlay) + { + ImFormatString(overlay_buf, IM_ARRAYSIZE(overlay_buf), "%.0f%%", fraction * 100 + 0.01f); + overlay = overlay_buf; + } - ImVec2 overlay_size = CalcTextSize(overlay, NULL); - if (overlay_size.x > 0.0f) - RenderTextClipped(ImVec2(ImClamp(fill_br.x + style.ItemSpacing.x, bb.Min.x, bb.Max.x - overlay_size.x - style.ItemInnerSpacing.x), bb.Min.y), bb.Max, overlay, NULL, &overlay_size, ImVec2(0.0f, 0.5f), &bb); + ImVec2 overlay_size = CalcTextSize(overlay, NULL); + if (overlay_size.x > 0.0f) + { + float text_x = is_indeterminate ? (bb.Min.x + bb.Max.x - overlay_size.x) * 0.5f : ImLerp(bb.Min.x, bb.Max.x, fill_n1) + style.ItemSpacing.x; + RenderTextClipped(ImVec2(ImClamp(text_x, bb.Min.x, bb.Max.x - overlay_size.x - style.ItemInnerSpacing.x), bb.Min.y), bb.Max, overlay, NULL, &overlay_size, ImVec2(0.0f, 0.5f), &bb); + } + } } void ImGui::Bullet() @@ -1321,6 +1402,79 @@ void ImGui::Bullet() SameLine(0, style.FramePadding.x * 2.0f); } +// This is provided as a convenience for being an often requested feature. +// FIXME-STYLE: we delayed adding as there is a larger plan to revamp the styling system. +// Because of this we currently don't provide many styling options for this widget +// (e.g. hovered/active colors are automatically inferred from a single color). +bool ImGui::TextLink(const char* label) +{ + ImGuiWindow* window = GetCurrentWindow(); + if (window->SkipItems) + return false; + + ImGuiContext& g = *GImGui; + const ImGuiID id = window->GetID(label); + const char* label_end = FindRenderedTextEnd(label); + + ImVec2 pos = window->DC.CursorPos; + ImVec2 size = CalcTextSize(label, label_end, true); + ImRect bb(pos, pos + size); + ItemSize(size, 0.0f); + if (!ItemAdd(bb, id)) + return false; + + bool hovered, held; + bool pressed = ButtonBehavior(bb, id, &hovered, &held); + RenderNavCursor(bb, id); + + if (hovered) + SetMouseCursor(ImGuiMouseCursor_Hand); + + ImVec4 text_colf = g.Style.Colors[ImGuiCol_TextLink]; + ImVec4 line_colf = text_colf; + { + // FIXME-STYLE: Read comments above. This widget is NOT written in the same style as some earlier widgets, + // as we are currently experimenting/planning a different styling system. + float h, s, v; + ColorConvertRGBtoHSV(text_colf.x, text_colf.y, text_colf.z, h, s, v); + if (held || hovered) + { + v = ImSaturate(v + (held ? 0.4f : 0.3f)); + h = ImFmod(h + 0.02f, 1.0f); + } + ColorConvertHSVtoRGB(h, s, v, text_colf.x, text_colf.y, text_colf.z); + v = ImSaturate(v - 0.20f); + ColorConvertHSVtoRGB(h, s, v, line_colf.x, line_colf.y, line_colf.z); + } + + float line_y = bb.Max.y + ImFloor(g.Font->Descent * g.FontScale * 0.20f); + window->DrawList->AddLine(ImVec2(bb.Min.x, line_y), ImVec2(bb.Max.x, line_y), GetColorU32(line_colf)); // FIXME-TEXT: Underline mode. + + PushStyleColor(ImGuiCol_Text, GetColorU32(text_colf)); + RenderText(bb.Min, label, label_end); + PopStyleColor(); + + IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags); + return pressed; +} + +void ImGui::TextLinkOpenURL(const char* label, const char* url) +{ + ImGuiContext& g = *GImGui; + if (url == NULL) + url = label; + if (TextLink(label)) + if (g.PlatformIO.Platform_OpenInShellFn != NULL) + g.PlatformIO.Platform_OpenInShellFn(&g, url); + SetItemTooltip(LocalizeGetMsg(ImGuiLocKey_OpenLink_s), url); // It is more reassuring for user to _always_ display URL when we same as label + if (BeginPopupContextItem()) + { + if (MenuItem(LocalizeGetMsg(ImGuiLocKey_CopyLink))) + SetClipboardText(url); + EndPopup(); + } +} + //------------------------------------------------------------------------- // [SECTION] Widgets: Low-level Layout helpers //------------------------------------------------------------------------- @@ -1412,26 +1566,19 @@ void ImGui::SeparatorEx(ImGuiSeparatorFlags flags, float thickness) else if (flags & ImGuiSeparatorFlags_Horizontal) { // Horizontal Separator - float x1 = window->Pos.x; - float x2 = window->Pos.x + window->Size.x; - - // FIXME-WORKRECT: old hack (#205) until we decide of consistent behavior with WorkRect/Indent and Separator - if (g.GroupStack.Size > 0 && g.GroupStack.back().WindowID == window->ID) - x1 += window->DC.Indent.x; - - // FIXME-WORKRECT: In theory we should simply be using WorkRect.Min.x/Max.x everywhere but it isn't aesthetically what we want, - // need to introduce a variant of WorkRect for that purpose. (#4787) - if (ImGuiTable* table = g.CurrentTable) - { - x1 = table->Columns[table->CurrentColumn].MinX; - x2 = table->Columns[table->CurrentColumn].MaxX; - } + float x1 = window->DC.CursorPos.x; + float x2 = window->WorkRect.Max.x; + // Preserve legacy behavior inside Columns() // Before Tables API happened, we relied on Separator() to span all columns of a Columns() set. // We currently don't need to provide the same feature for tables because tables naturally have border features. ImGuiOldColumns* columns = (flags & ImGuiSeparatorFlags_SpanAllColumns) ? window->DC.CurrentColumns : NULL; if (columns) + { + x1 = window->Pos.x + window->DC.Indent.x; // Used to be Pos.x before 2023/10/03 + x2 = window->Pos.x + window->Size.x; PushColumnsBackground(); + } // We don't provide our width to the layout so that it doesn't get feed back into AutoFit // FIXME: This prevents ->CursorMaxPos based bounding box evaluation from working (e.g. TableEndCell) @@ -1465,7 +1612,11 @@ void ImGui::Separator() // Those flags should eventually be configurable by the user // FIXME: We cannot g.Style.SeparatorTextBorderSize for thickness as it relates to SeparatorText() which is a decorated separator, not defaulting to 1.0f. ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal; - flags |= ImGuiSeparatorFlags_SpanAllColumns; // NB: this only applies to legacy Columns() api as they relied on Separator() a lot. + + // Only applies to legacy Columns() api as they relied on Separator() a lot. + if (window->DC.CurrentColumns) + flags |= ImGuiSeparatorFlags_SpanAllColumns; + SeparatorEx(flags, 1.0f); } @@ -1482,14 +1633,14 @@ void ImGui::SeparatorTextEx(ImGuiID id, const char* label, const char* label_end const float separator_thickness = style.SeparatorTextBorderSize; const ImVec2 min_size(label_size.x + extra_w + padding.x * 2.0f, ImMax(label_size.y + padding.y * 2.0f, separator_thickness)); const ImRect bb(pos, ImVec2(window->WorkRect.Max.x, pos.y + min_size.y)); - const float text_baseline_y = ImFloor((bb.GetHeight() - label_size.y) * style.SeparatorTextAlign.y + 0.99999f); //ImMax(padding.y, ImFloor((style.SeparatorTextSize - label_size.y) * 0.5f)); + const float text_baseline_y = ImTrunc((bb.GetHeight() - label_size.y) * style.SeparatorTextAlign.y + 0.99999f); //ImMax(padding.y, ImFloor((style.SeparatorTextSize - label_size.y) * 0.5f)); ItemSize(min_size, text_baseline_y); if (!ItemAdd(bb, id)) return; const float sep1_x1 = pos.x; const float sep2_x2 = bb.Max.x; - const float seps_y = ImFloor((bb.Min.y + bb.Max.y) * 0.5f + 0.99999f); + const float seps_y = ImTrunc((bb.Min.y + bb.Max.y) * 0.5f + 0.99999f); const float label_avail_w = ImMax(0.0f, sep2_x2 - sep1_x1 - padding.x * 2.0f); const ImVec2 label_pos(pos.x + padding.x + ImMax(0.0f, (label_avail_w - label_size.x - extra_w) * style.SeparatorTextAlign.x), pos.y + text_baseline_y); // FIXME-ALIGN @@ -1564,8 +1715,7 @@ bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float ImRect bb_render = bb; if (held) { - ImVec2 mouse_delta_2d = g.IO.MousePos - g.ActiveIdClickOffset - bb_interact.Min; - float mouse_delta = (axis == ImGuiAxis_Y) ? mouse_delta_2d.y : mouse_delta_2d.x; + float mouse_delta = (g.IO.MousePos - g.ActiveIdClickOffset - bb_interact.Min)[axis]; // Minimum pane size float size_1_maximum_delta = ImMax(0.0f, *size1 - min_size1); @@ -1578,12 +1728,8 @@ bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float // Apply resize if (mouse_delta != 0.0f) { - if (mouse_delta < 0.0f) - IM_ASSERT(*size1 + mouse_delta >= min_size1); - if (mouse_delta > 0.0f) - IM_ASSERT(*size2 - mouse_delta >= min_size2); - *size1 += mouse_delta; - *size2 -= mouse_delta; + *size1 = ImMax(*size1 + mouse_delta, min_size1); + *size2 = ImMax(*size2 - mouse_delta, min_size2); bb_render.Translate((axis == ImGuiAxis_X) ? ImVec2(mouse_delta, 0.0f) : ImVec2(0.0f, mouse_delta)); MarkItemEdited(id); } @@ -1637,7 +1783,7 @@ void ImGui::ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_exc width_excess = 0.0f; for (int n = 0; n < count; n++) { - float width_rounded = ImFloor(items[n].Width); + float width_rounded = ImTrunc(items[n].Width); width_excess += items[n].Width - width_rounded; items[n].Width = width_rounded; } @@ -1683,10 +1829,13 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); IM_ASSERT((flags & (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)) != (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)); // Can't use both flags together + if (flags & ImGuiComboFlags_WidthFitPreview) + IM_ASSERT((flags & (ImGuiComboFlags_NoPreview | (ImGuiComboFlags)ImGuiComboFlags_CustomPreview)) == 0); const float arrow_size = (flags & ImGuiComboFlags_NoArrowButton) ? 0.0f : GetFrameHeight(); const ImVec2 label_size = CalcTextSize(label, NULL, true); - const float w = (flags & ImGuiComboFlags_NoPreview) ? arrow_size : CalcItemWidth(); + const float preview_width = ((flags & ImGuiComboFlags_WidthFitPreview) && (preview_value != NULL)) ? CalcTextSize(preview_value, NULL, true).x : 0.0f; + const float w = (flags & ImGuiComboFlags_NoPreview) ? arrow_size : ((flags & ImGuiComboFlags_WidthFitPreview) ? (arrow_size + preview_width + style.FramePadding.x * 2.0f) : CalcItemWidth()); const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y * 2.0f)); const ImRect total_bb(bb.Min, bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); ItemSize(total_bb, style.FramePadding.y); @@ -1707,7 +1856,7 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF // Render shape const ImU32 frame_col = GetColorU32(hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); const float value_x2 = ImMax(bb.Min.x, bb.Max.x - arrow_size); - RenderNavHighlight(bb, id); + RenderNavCursor(bb, id); if (!(flags & ImGuiComboFlags_NoPreview)) window->DrawList->AddRectFilled(bb.Min, ImVec2(value_x2, bb.Max.y), frame_col, style.FrameRounding, (flags & ImGuiComboFlags_NoArrowButton) ? ImDrawFlags_RoundCornersAll : ImDrawFlags_RoundCornersLeft); if (!(flags & ImGuiComboFlags_NoArrowButton)) @@ -1779,7 +1928,7 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags // This is essentially a specialized version of BeginPopupEx() char name[16]; - ImFormatString(name, IM_ARRAYSIZE(name), "##Combo_%02d", g.BeginPopupStack.Size); // Recycle windows based on depth + ImFormatString(name, IM_ARRAYSIZE(name), "##Combo_%02d", g.BeginComboDepth); // Recycle windows based on depth // Set position given a custom constraint (peak into expected window size so we can position it) // FIXME: This might be easier to express with an hypothetical SetNextWindowPosConstraints() function? @@ -1797,7 +1946,7 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags // We don't use BeginPopupEx() solely because we have a custom name string, which we could make an argument to BeginPopupEx() ImGuiWindowFlags window_flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoMove; - PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(g.Style.FramePadding.x, g.Style.WindowPadding.y)); // Horizontally align ourselves with the framed text + PushStyleVarX(ImGuiStyleVar_WindowPadding, g.Style.FramePadding.x); // Horizontally align ourselves with the framed text bool ret = Begin(name, NULL, window_flags); PopStyleVar(); if (!ret) @@ -1806,12 +1955,15 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags IM_ASSERT(0); // This should never happen as we tested for IsPopupOpen() above return false; } + g.BeginComboDepth++; return true; } void ImGui::EndCombo() { + ImGuiContext& g = *GImGui; EndPopup(); + g.BeginComboDepth--; } // Call directly after the BeginCombo/EndCombo block. The preview is designed to only host non-interactive elements @@ -1868,18 +2020,15 @@ void ImGui::EndComboPreview() } // Getter for the old Combo() API: const char*[] -static bool Items_ArrayGetter(void* data, int idx, const char** out_text) +static const char* Items_ArrayGetter(void* data, int idx) { const char* const* items = (const char* const*)data; - if (out_text) - *out_text = items[idx]; - return true; + return items[idx]; } // Getter for the old Combo() API: "item1\0item2\0item3\0" -static bool Items_SingleStringGetter(void* data, int idx, const char** out_text) +static const char* Items_SingleStringGetter(void* data, int idx) { - // FIXME-OPT: we could pre-compute the indices to fasten this. But only 1 active combo means the waste is limited. const char* items_separated_by_zeros = (const char*)data; int items_count = 0; const char* p = items_separated_by_zeros; @@ -1890,22 +2039,18 @@ static bool Items_SingleStringGetter(void* data, int idx, const char** out_text) p += strlen(p) + 1; items_count++; } - if (!*p) - return false; - if (out_text) - *out_text = p; - return true; + return *p ? p : NULL; } // Old API, prefer using BeginCombo() nowadays if you can. -bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int popup_max_height_in_items) +bool ImGui::Combo(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int popup_max_height_in_items) { ImGuiContext& g = *GImGui; // Call the getter to obtain the preview string which is a parameter to BeginCombo() const char* preview_value = NULL; if (*current_item >= 0 && *current_item < items_count) - items_getter(data, *current_item, &preview_value); + preview_value = getter(user_data, *current_item); // The old Combo() API exposed "popup_max_height_in_items". The new more general BeginCombo() API doesn't have/need it, but we emulate it here. if (popup_max_height_in_items != -1 && !(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSizeConstraint)) @@ -1915,27 +2060,30 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi return false; // Display items - // FIXME-OPT: Use clipper (but we need to disable it on the appearing frame to make sure our call to SetItemDefaultFocus() is processed) bool value_changed = false; - for (int i = 0; i < items_count; i++) - { - PushID(i); - const bool item_selected = (i == *current_item); - const char* item_text; - if (!items_getter(data, i, &item_text)) - item_text = "*Unknown item*"; - if (Selectable(item_text, item_selected) && *current_item != i) + ImGuiListClipper clipper; + clipper.Begin(items_count); + clipper.IncludeItemByIndex(*current_item); + while (clipper.Step()) + for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) { - value_changed = true; - *current_item = i; + const char* item_text = getter(user_data, i); + if (item_text == NULL) + item_text = "*Unknown item*"; + + PushID(i); + const bool item_selected = (i == *current_item); + if (Selectable(item_text, item_selected) && *current_item != i) + { + value_changed = true; + *current_item = i; + } + if (item_selected) + SetItemDefaultFocus(); + PopID(); } - if (item_selected) - SetItemDefaultFocus(); - PopID(); - } EndCombo(); - if (value_changed) MarkItemEdited(g.LastItemData.ID); @@ -1963,13 +2111,37 @@ bool ImGui::Combo(const char* label, int* current_item, const char* items_separa return value_changed; } +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + +struct ImGuiGetNameFromIndexOldToNewCallbackData { void* UserData; bool (*OldCallback)(void*, int, const char**); }; +static const char* ImGuiGetNameFromIndexOldToNewCallback(void* user_data, int idx) +{ + ImGuiGetNameFromIndexOldToNewCallbackData* data = (ImGuiGetNameFromIndexOldToNewCallbackData*)user_data; + const char* s = NULL; + data->OldCallback(data->UserData, idx, &s); + return s; +} + +bool ImGui::ListBox(const char* label, int* current_item, bool (*old_getter)(void*, int, const char**), void* user_data, int items_count, int height_in_items) +{ + ImGuiGetNameFromIndexOldToNewCallbackData old_to_new_data = { user_data, old_getter }; + return ListBox(label, current_item, ImGuiGetNameFromIndexOldToNewCallback, &old_to_new_data, items_count, height_in_items); +} +bool ImGui::Combo(const char* label, int* current_item, bool (*old_getter)(void*, int, const char**), void* user_data, int items_count, int popup_max_height_in_items) +{ + ImGuiGetNameFromIndexOldToNewCallbackData old_to_new_data = { user_data, old_getter }; + return Combo(label, current_item, ImGuiGetNameFromIndexOldToNewCallback, &old_to_new_data, items_count, popup_max_height_in_items); +} + +#endif + //------------------------------------------------------------------------- // [SECTION] Data Type and Data Formatting Helpers [Internal] //------------------------------------------------------------------------- // - DataTypeGetInfo() // - DataTypeFormatString() // - DataTypeApplyOp() -// - DataTypeApplyOpFromText() +// - DataTypeApplyFromText() // - DataTypeCompare() // - DataTypeClamp() // - GetMinimumStepAtDecimalPrecision @@ -1993,6 +2165,7 @@ static const ImGuiDataTypeInfo GDataTypeInfo[] = #endif { sizeof(float), "float", "%.3f","%f" }, // ImGuiDataType_Float (float are promoted to double in va_arg) { sizeof(double), "double","%f", "%lf" }, // ImGuiDataType_Double + { sizeof(bool), "bool", "%d", "%d" }, // ImGuiDataType_Bool }; IM_STATIC_ASSERT(IM_ARRAYSIZE(GDataTypeInfo) == ImGuiDataType_COUNT); @@ -2077,17 +2250,24 @@ void ImGui::DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, const // User can input math operators (e.g. +100) to edit a numerical values. // NB: This is _not_ a full expression evaluator. We should probably add one and replace this dumb mess.. -bool ImGui::DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format) +bool ImGui::DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format, void* p_data_when_empty) { + // Copy the value in an opaque buffer so we can compare at the end of the function if it changed at all. + const ImGuiDataTypeInfo* type_info = DataTypeGetInfo(data_type); + ImGuiDataTypeStorage data_backup; + memcpy(&data_backup, p_data, type_info->Size); + while (ImCharIsBlankA(*buf)) buf++; if (!buf[0]) + { + if (p_data_when_empty != NULL) + { + memcpy(p_data, p_data_when_empty, type_info->Size); + return memcmp(&data_backup, p_data, type_info->Size) != 0; + } return false; - - // Copy the value in an opaque buffer so we can compare at the end of the function if it changed at all. - const ImGuiDataTypeInfo* type_info = DataTypeGetInfo(data_type); - ImGuiDataTypeTempStorage data_backup; - memcpy(&data_backup, p_data, type_info->Size); + } // Sanitize format // - For float/double we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in, so force them into %f and %lf @@ -2176,6 +2356,12 @@ bool ImGui::DataTypeClamp(ImGuiDataType data_type, void* p_data, const void* p_m return false; } +bool ImGui::DataTypeIsZero(ImGuiDataType data_type, const void* p_data) +{ + ImGuiContext& g = *GImGui; + return DataTypeCompare(data_type, p_data, &g.DataTypeZeroValue) == 0; +} + static float GetMinimumStepAtDecimalPrecision(int decimal_precision) { static const float min_steps[10] = { 1.0f, 0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f, 0.0000001f, 0.00000001f, 0.000000001f }; @@ -2234,12 +2420,13 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const { ImGuiContext& g = *GImGui; const ImGuiAxis axis = (flags & ImGuiSliderFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X; - const bool is_clamped = (v_min < v_max); + const bool is_bounded = (v_min < v_max) || ((v_min == v_max) && (v_min != 0.0f || (flags & ImGuiSliderFlags_ClampZeroRange))); + const bool is_wrapped = is_bounded && (flags & ImGuiSliderFlags_WrapAround); const bool is_logarithmic = (flags & ImGuiSliderFlags_Logarithmic) != 0; const bool is_floating_point = (data_type == ImGuiDataType_Float) || (data_type == ImGuiDataType_Double); // Default tweak speed - if (v_speed == 0.0f && is_clamped && (v_max - v_min < FLT_MAX)) + if (v_speed == 0.0f && is_bounded && (v_max - v_min < FLT_MAX)) v_speed = (float)((v_max - v_min) * g.DragSpeedDefaultRatio); // Inputs accumulates into g.DragCurrentAccum, which is flushed into the current value as soon as it makes a difference with our precision settings @@ -2257,7 +2444,7 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const const int decimal_precision = is_floating_point ? ImParseFormatPrecision(format, 3) : 0; const bool tweak_slow = IsKeyDown((g.NavInputSource == ImGuiInputSource_Gamepad) ? ImGuiKey_NavGamepadTweakSlow : ImGuiKey_NavKeyboardTweakSlow); const bool tweak_fast = IsKeyDown((g.NavInputSource == ImGuiInputSource_Gamepad) ? ImGuiKey_NavGamepadTweakFast : ImGuiKey_NavKeyboardTweakFast); - const float tweak_factor = tweak_slow ? 1.0f / 1.0f : tweak_fast ? 10.0f : 1.0f; + const float tweak_factor = tweak_slow ? 1.0f / 10.0f : tweak_fast ? 10.0f : 1.0f; adjust_delta = GetNavTweakPressedAmount(axis) * tweak_factor; v_speed = ImMax(v_speed, GetMinimumStepAtDecimalPrecision(decimal_precision)); } @@ -2273,8 +2460,8 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const // Clear current value on activation // Avoid altering values and clamping when we are _already_ past the limits and heading in the same direction, so e.g. if range is 0..255, current value is 300 and we are pushing to the right side, keep the 300. - bool is_just_activated = g.ActiveIdIsJustActivated; - bool is_already_past_limits_and_pushing_outward = is_clamped && ((*v >= v_max && adjust_delta > 0.0f) || (*v <= v_min && adjust_delta < 0.0f)); + const bool is_just_activated = g.ActiveIdIsJustActivated; + const bool is_already_past_limits_and_pushing_outward = is_bounded && !is_wrapped && ((*v >= v_max && adjust_delta > 0.0f) || (*v <= v_min && adjust_delta < 0.0f)); if (is_just_activated || is_already_past_limits_and_pushing_outward) { g.DragCurrentAccum = 0.0f; @@ -2332,13 +2519,24 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const if (v_cur == (TYPE)-0) v_cur = (TYPE)0; - // Clamp values (+ handle overflow/wrap-around for integer types) - if (*v != v_cur && is_clamped) + if (*v != v_cur && is_bounded) { - if (v_cur < v_min || (v_cur > *v && adjust_delta < 0.0f && !is_floating_point)) - v_cur = v_min; - if (v_cur > v_max || (v_cur < *v && adjust_delta > 0.0f && !is_floating_point)) - v_cur = v_max; + if (is_wrapped) + { + // Wrap values + if (v_cur < v_min) + v_cur += v_max - v_min + (is_floating_point ? 0 : 1); + if (v_cur > v_max) + v_cur -= v_max - v_min + (is_floating_point ? 0 : 1); + } + else + { + // Clamp values + handle overflow/wrap-around for integer types. + if (v_cur < v_min || (v_cur > *v && adjust_delta < 0.0f && !is_floating_point)) + v_cur = v_min; + if (v_cur > v_max || (v_cur < *v && adjust_delta > 0.0f && !is_floating_point)) + v_cur = v_max; + } } // Apply result @@ -2351,7 +2549,7 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags) { // Read imgui.cpp "API BREAKING CHANGES" section for 1.78 if you hit this assert. - IM_ASSERT((flags == 1 || (flags & ImGuiSliderFlags_InvalidMask_) == 0) && "Invalid ImGuiSliderFlags flags! Has the 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead."); + IM_ASSERT((flags == 1 || (flags & ImGuiSliderFlags_InvalidMask_) == 0) && "Invalid ImGuiSliderFlags flags! Has the legacy 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead."); ImGuiContext& g = *GImGui; if (g.ActiveId == id) @@ -2364,7 +2562,7 @@ bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v } if (g.ActiveId != id) return false; - if ((g.LastItemData.InFlags & ImGuiItemFlags_ReadOnly) || (flags & ImGuiSliderFlags_ReadOnly)) + if ((g.LastItemData.ItemFlags & ImGuiItemFlags_ReadOnly) || (flags & ImGuiSliderFlags_ReadOnly)) return false; switch (data_type) @@ -2411,19 +2609,18 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data, if (format == NULL) format = DataTypeGetInfo(data_type)->PrintFmt; - const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags); + const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags); bool temp_input_is_active = temp_input_allowed && TempInputIsActive(id); if (!temp_input_is_active) { // Tabbing or CTRL-clicking on Drag turns it into an InputText - const bool input_requested_by_tabbing = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByTabbing) != 0; - const bool clicked = hovered && IsMouseClicked(0, id); + const bool clicked = hovered && IsMouseClicked(0, ImGuiInputFlags_None, id); const bool double_clicked = (hovered && g.IO.MouseClickedCount[0] == 2 && TestKeyOwner(ImGuiKey_MouseLeft, id)); - const bool make_active = (input_requested_by_tabbing || clicked || double_clicked || g.NavActivateId == id); + const bool make_active = (clicked || double_clicked || g.NavActivateId == id); if (make_active && (clicked || double_clicked)) SetKeyOwner(ImGuiKey_MouseLeft, id); if (make_active && temp_input_allowed) - if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || double_clicked || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))) + if ((clicked && g.IO.KeyCtrl) || double_clicked || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))) temp_input_is_active = true; // (Optional) simple click (without moving) turns Drag into an InputText @@ -2446,14 +2643,22 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data, if (temp_input_is_active) { - // Only clamp CTRL+Click input when ImGuiSliderFlags_AlwaysClamp is set - const bool is_clamp_input = (flags & ImGuiSliderFlags_AlwaysClamp) != 0 && (p_min == NULL || p_max == NULL || DataTypeCompare(data_type, p_min, p_max) < 0); - return TempInputScalar(frame_bb, id, label, data_type, p_data, format, is_clamp_input ? p_min : NULL, is_clamp_input ? p_max : NULL); + // Only clamp CTRL+Click input when ImGuiSliderFlags_ClampOnInput is set (generally via ImGuiSliderFlags_AlwaysClamp) + bool clamp_enabled = false; + if ((flags & ImGuiSliderFlags_ClampOnInput) && (p_min != NULL || p_max != NULL)) + { + const int clamp_range_dir = (p_min != NULL && p_max != NULL) ? DataTypeCompare(data_type, p_min, p_max) : 0; // -1 when *p_min < *p_max, == 0 when *p_min == *p_max + if (p_min == NULL || p_max == NULL || clamp_range_dir < 0) + clamp_enabled = true; + else if (clamp_range_dir == 0) + clamp_enabled = DataTypeIsZero(data_type, p_min) ? ((flags & ImGuiSliderFlags_ClampZeroRange) != 0) : true; + } + return TempInputScalar(frame_bb, id, label, data_type, p_data, format, clamp_enabled ? p_min : NULL, clamp_enabled ? p_max : NULL); } // Draw frame const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); - RenderNavHighlight(frame_bb, id); + RenderNavCursor(frame_bb, id); RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, style.FrameRounding); // Drag behavior @@ -2859,14 +3064,14 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ const int decimal_precision = is_floating_point ? ImParseFormatPrecision(format, 3) : 0; if (decimal_precision > 0) { - input_delta /= 100.0f; // Gamepad/keyboard tweak speeds in % of slider bounds + input_delta /= 100.0f; // Keyboard/Gamepad tweak speeds in % of slider bounds if (tweak_slow) input_delta /= 10.0f; } else { if ((v_range_f >= -100.0f && v_range_f <= 100.0f && v_range_f != 0.0f) || tweak_slow) - input_delta = ((input_delta < 0.0f) ? -1.0f : +1.0f) / v_range_f; // Gamepad/keyboard tweak speeds in integer steps + input_delta = ((input_delta < 0.0f) ? -1.0f : +1.0f) / v_range_f; // Keyboard/Gamepad tweak speeds in integer steps else input_delta /= 100.0f; } @@ -2914,7 +3119,7 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ } if (set_new_value) - if ((g.LastItemData.InFlags & ImGuiItemFlags_ReadOnly) || (flags & ImGuiSliderFlags_ReadOnly)) + if ((g.LastItemData.ItemFlags & ImGuiItemFlags_ReadOnly) || (flags & ImGuiSliderFlags_ReadOnly)) set_new_value = false; if (set_new_value) @@ -2960,7 +3165,8 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb) { // Read imgui.cpp "API BREAKING CHANGES" section for 1.78 if you hit this assert. - IM_ASSERT((flags == 1 || (flags & ImGuiSliderFlags_InvalidMask_) == 0) && "Invalid ImGuiSliderFlags flag! Has the 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead."); + IM_ASSERT((flags == 1 || (flags & ImGuiSliderFlags_InvalidMask_) == 0) && "Invalid ImGuiSliderFlags flags! Has the legacy 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead."); + IM_ASSERT((flags & ImGuiSliderFlags_WrapAround) == 0); // Not supported by SliderXXX(), only by DragXXX() switch (data_type) { @@ -3018,18 +3224,17 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat if (format == NULL) format = DataTypeGetInfo(data_type)->PrintFmt; - const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags); + const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags); bool temp_input_is_active = temp_input_allowed && TempInputIsActive(id); if (!temp_input_is_active) { // Tabbing or CTRL-clicking on Slider turns it into an input box - const bool input_requested_by_tabbing = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByTabbing) != 0; - const bool clicked = hovered && IsMouseClicked(0, id); - const bool make_active = (input_requested_by_tabbing || clicked || g.NavActivateId == id); + const bool clicked = hovered && IsMouseClicked(0, ImGuiInputFlags_None, id); + const bool make_active = (clicked || g.NavActivateId == id); if (make_active && clicked) SetKeyOwner(ImGuiKey_MouseLeft, id); if (make_active && temp_input_allowed) - if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))) + if ((clicked && g.IO.KeyCtrl) || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))) temp_input_is_active = true; if (make_active && !temp_input_is_active) @@ -3043,14 +3248,14 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat if (temp_input_is_active) { - // Only clamp CTRL+Click input when ImGuiSliderFlags_AlwaysClamp is set - const bool is_clamp_input = (flags & ImGuiSliderFlags_AlwaysClamp) != 0; - return TempInputScalar(frame_bb, id, label, data_type, p_data, format, is_clamp_input ? p_min : NULL, is_clamp_input ? p_max : NULL); + // Only clamp CTRL+Click input when ImGuiSliderFlags_ClampOnInput is set (generally via ImGuiSliderFlags_AlwaysClamp) + const bool clamp_enabled = (flags & ImGuiSliderFlags_ClampOnInput) != 0; + return TempInputScalar(frame_bb, id, label, data_type, p_data, format, clamp_enabled ? p_min : NULL, clamp_enabled ? p_max : NULL); } // Draw frame const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); - RenderNavHighlight(frame_bb, id); + RenderNavCursor(frame_bb, id); RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, g.Style.FrameRounding); // Slider behavior @@ -3185,8 +3390,8 @@ bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType d if (format == NULL) format = DataTypeGetInfo(data_type)->PrintFmt; - const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags); - const bool clicked = hovered && IsMouseClicked(0, id); + const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags); + const bool clicked = hovered && IsMouseClicked(0, ImGuiInputFlags_None, id); if (clicked || g.NavActivateId == id) { if (clicked) @@ -3199,7 +3404,7 @@ bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType d // Draw frame const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); - RenderNavHighlight(frame_bb, id); + RenderNavCursor(frame_bb, id); RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, g.Style.FrameRounding); // Slider behavior @@ -3381,6 +3586,8 @@ int ImParseFormatPrecision(const char* fmt, int default_precision) // Create text input in place of another active widget (e.g. used when doing a CTRL+Click on drag/slider widgets) // FIXME: Facilitate using this in variety of other situations. +// FIXME: Among other things, setting ImGuiItemFlags_AllowDuplicateId in LastItemData is currently correct but +// the expected relationship between TempInputXXX functions and LastItemData is a little fishy. bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags) { // On the first frame, g.TempInputTextId == 0, then on subsequent frames it becomes == id. @@ -3391,6 +3598,7 @@ bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* ClearActiveID(); g.CurrentWindow->DC.CursorPos = bb.Min; + g.LastItemData.ItemFlags |= ImGuiItemFlags_AllowDuplicateId; bool value_changed = InputTextEx(label, NULL, buf, buf_size, bb.GetSize(), flags | ImGuiInputTextFlags_MergedItem); if (init) { @@ -3401,14 +3609,6 @@ bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* return value_changed; } -static inline ImGuiInputTextFlags InputScalar_DefaultCharsFilter(ImGuiDataType data_type, const char* format) -{ - if (data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double) - return ImGuiInputTextFlags_CharsScientific; - const char format_last_char = format[0] ? format[strlen(format) - 1] : 0; - return (format_last_char == 'x' || format_last_char == 'X') ? ImGuiInputTextFlags_CharsHexadecimal : ImGuiInputTextFlags_CharsDecimal; -} - // Note that Drag/Slider functions are only forwarding the min/max values clamping values if the ImGuiSliderFlags_AlwaysClamp flag is set! // This is intended: this way we allow CTRL+Click manual input to set a value out of bounds, for maximum flexibility. // However this may not be ideal for all uses, as some user code may break on out of bound values. @@ -3416,6 +3616,7 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG { // FIXME: May need to clarify display behavior if format doesn't contain %. // "%d" -> "%d" / "There are %d items" -> "%d" / "items" -> "%d" (fallback). Also see #6405 + ImGuiContext& g = *GImGui; const ImGuiDataTypeInfo* type_info = DataTypeGetInfo(data_type); char fmt_buf[32]; char data_buf[32]; @@ -3425,19 +3626,18 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG DataTypeFormatString(data_buf, IM_ARRAYSIZE(data_buf), data_type, p_data, format); ImStrTrimBlanks(data_buf); - ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited; - flags |= InputScalar_DefaultCharsFilter(data_type, format); - + ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | (ImGuiInputTextFlags)ImGuiInputTextFlags_LocalizeDecimalPoint; + g.LastItemData.ItemFlags |= ImGuiItemFlags_NoMarkEdited; // Because TempInputText() uses ImGuiInputTextFlags_MergedItem it doesn't submit a new item, so we poke LastItemData. bool value_changed = false; if (TempInputText(bb, id, label, data_buf, IM_ARRAYSIZE(data_buf), flags)) { // Backup old value size_t data_type_size = type_info->Size; - ImGuiDataTypeTempStorage data_backup; + ImGuiDataTypeStorage data_backup; memcpy(&data_backup, p_data, data_type_size); // Apply new value (or operations) then clamp - DataTypeApplyFromText(data_buf, data_type, p_data, format); + DataTypeApplyFromText(data_buf, data_type, p_data, format, NULL); if (p_clamp_min || p_clamp_max) { if (p_clamp_min && p_clamp_max && DataTypeCompare(data_type, p_clamp_min, p_clamp_max) > 0) @@ -3446,6 +3646,7 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG } // Only mark as edited if new value is different + g.LastItemData.ItemFlags &= ~ImGuiItemFlags_NoMarkEdited; value_changed = memcmp(&data_backup, p_data, data_type_size) != 0; if (value_changed) MarkItemEdited(id); @@ -3453,6 +3654,13 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG return value_changed; } +void ImGui::SetNextItemRefVal(ImGuiDataType data_type, void* p_data) +{ + ImGuiContext& g = *GImGui; + g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasRefVal; + memcpy(&g.NextItemData.RefVal, p_data, DataTypeGetInfo(data_type)->Size); +} + // Note: p_data, p_step, p_step_fast are _pointers_ to a memory address holding the data. For an Input widget, p_step and p_step_fast are optional. // Read code of e.g. InputFloat(), InputInt() etc. or examples in 'Demo->Widgets->Data Types' to understand how to use this function directly. bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_step, const void* p_step_fast, const char* format, ImGuiInputTextFlags flags) @@ -3463,23 +3671,29 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data ImGuiContext& g = *GImGui; ImGuiStyle& style = g.Style; + IM_ASSERT((flags & ImGuiInputTextFlags_EnterReturnsTrue) == 0); // Not supported by InputScalar(). Please open an issue if you this would be useful to you. Otherwise use IsItemDeactivatedAfterEdit()! if (format == NULL) format = DataTypeGetInfo(data_type)->PrintFmt; + void* p_data_default = (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasRefVal) ? &g.NextItemData.RefVal : &g.DataTypeZeroValue; + char buf[64]; - DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, p_data, format); + if ((flags & ImGuiInputTextFlags_DisplayEmptyRefVal) && DataTypeCompare(data_type, p_data, p_data_default) == 0) + buf[0] = 0; + else + DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, p_data, format); - // Testing ActiveId as a minor optimization as filtering is not needed until active - if (g.ActiveId == 0 && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0) - flags |= InputScalar_DefaultCharsFilter(data_type, format); - flags |= ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited; // We call MarkItemEdited() ourselves by comparing the actual data rather than the string. + // Disable the MarkItemEdited() call in InputText but keep ImGuiItemStatusFlags_Edited. + // We call MarkItemEdited() ourselves by comparing the actual data rather than the string. + g.NextItemData.ItemFlags |= ImGuiItemFlags_NoMarkEdited; + flags |= ImGuiInputTextFlags_AutoSelectAll | (ImGuiInputTextFlags)ImGuiInputTextFlags_LocalizeDecimalPoint; bool value_changed = false; if (p_step == NULL) { if (InputText(label, buf, IM_ARRAYSIZE(buf), flags)) - value_changed = DataTypeApplyFromText(buf, data_type, p_data, format); + value_changed = DataTypeApplyFromText(buf, data_type, p_data, format, (flags & ImGuiInputTextFlags_ParseEmptyRefVal) ? p_data_default : NULL); } else { @@ -3489,27 +3703,28 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data PushID(label); SetNextItemWidth(ImMax(1.0f, CalcItemWidth() - (button_size + style.ItemInnerSpacing.x) * 2)); if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view - value_changed = DataTypeApplyFromText(buf, data_type, p_data, format); + value_changed = DataTypeApplyFromText(buf, data_type, p_data, format, (flags & ImGuiInputTextFlags_ParseEmptyRefVal) ? p_data_default : NULL); IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Inputable); // Step buttons const ImVec2 backup_frame_padding = style.FramePadding; style.FramePadding.x = style.FramePadding.y; - ImGuiButtonFlags button_flags = ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups; if (flags & ImGuiInputTextFlags_ReadOnly) BeginDisabled(); + PushItemFlag(ImGuiItemFlags_ButtonRepeat, true); SameLine(0, style.ItemInnerSpacing.x); - if (ButtonEx("-", ImVec2(button_size, button_size), button_flags)) + if (ButtonEx("-", ImVec2(button_size, button_size))) { DataTypeApplyOp(data_type, '-', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step); value_changed = true; } SameLine(0, style.ItemInnerSpacing.x); - if (ButtonEx("+", ImVec2(button_size, button_size), button_flags)) + if (ButtonEx("+", ImVec2(button_size, button_size))) { DataTypeApplyOp(data_type, '+', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step); value_changed = true; } + PopItemFlag(); if (flags & ImGuiInputTextFlags_ReadOnly) EndDisabled(); @@ -3524,6 +3739,8 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data PopID(); EndGroup(); } + + g.LastItemData.ItemFlags &= ~ImGuiItemFlags_NoMarkEdited; if (value_changed) MarkItemEdited(g.LastItemData.ID); @@ -3567,7 +3784,6 @@ bool ImGui::InputScalarN(const char* label, ImGuiDataType data_type, void* p_dat bool ImGui::InputFloat(const char* label, float* v, float step, float step_fast, const char* format, ImGuiInputTextFlags flags) { - flags |= ImGuiInputTextFlags_CharsScientific; return InputScalar(label, ImGuiDataType_Float, (void*)v, (void*)(step > 0.0f ? &step : NULL), (void*)(step_fast > 0.0f ? &step_fast : NULL), format, flags); } @@ -3610,13 +3826,13 @@ bool ImGui::InputInt4(const char* label, int v[4], ImGuiInputTextFlags flags) bool ImGui::InputDouble(const char* label, double* v, double step, double step_fast, const char* format, ImGuiInputTextFlags flags) { - flags |= ImGuiInputTextFlags_CharsScientific; return InputScalar(label, ImGuiDataType_Double, (void*)v, (void*)(step > 0.0 ? &step : NULL), (void*)(step_fast > 0.0 ? &step_fast : NULL), format, flags); } //------------------------------------------------------------------------- // [SECTION] Widgets: InputText, InputTextMultiline, InputTextWithHint //------------------------------------------------------------------------- +// - imstb_textedit.h include // - InputText() // - InputTextWithHint() // - InputTextMultiline() @@ -3627,6 +3843,11 @@ bool ImGui::InputDouble(const char* label, double* v, double step, double step_f // - DebugNodeInputTextState() [Internal] //------------------------------------------------------------------------- +namespace ImStb +{ +#include "imstb_textedit.h" +} + bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) { IM_ASSERT(!(flags & ImGuiInputTextFlags_Multiline)); // call InputTextMultiline() @@ -3644,21 +3865,28 @@ bool ImGui::InputTextWithHint(const char* label, const char* hint, char* buf, si return InputTextEx(label, hint, buf, (int)buf_size, ImVec2(0, 0), flags, callback, user_data); } +// This is only used in the path where the multiline widget is inactivate. static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end) { int line_count = 0; const char* s = text_begin; - while (char c = *s++) // We are only matching for \n so we can ignore UTF-8 decoding - if (c == '\n') - line_count++; - s--; - if (s[0] != '\n' && s[0] != '\r') + while (true) + { + const char* s_eol = strchr(s, '\n'); line_count++; + if (s_eol == NULL) + { + s = s + strlen(s); + break; + } + s = s_eol + 1; + } *out_text_end = s; return line_count; } -static ImVec2 InputTextCalcTextSizeW(ImGuiContext* ctx, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line) +// FIXME: Ideally we'd share code with ImFont::CalcTextSizeA() +static ImVec2 InputTextCalcTextSize(ImGuiContext* ctx, const char* text_begin, const char* text_end, const char** remaining, ImVec2* out_offset, bool stop_on_new_line) { ImGuiContext& g = *ctx; ImFont* font = g.Font; @@ -3668,10 +3896,15 @@ static ImVec2 InputTextCalcTextSizeW(ImGuiContext* ctx, const ImWchar* text_begi ImVec2 text_size = ImVec2(0, 0); float line_width = 0.0f; - const ImWchar* s = text_begin; + const char* s = text_begin; while (s < text_end) { - unsigned int c = (unsigned int)(*s++); + unsigned int c = (unsigned int)*s; + if (c < 0x80) + s += 1; + else + s += ImTextCharFromUtf8(&c, s, text_end); + if (c == '\n') { text_size.x = ImMax(text_size.x, line_width); @@ -3684,7 +3917,7 @@ static ImVec2 InputTextCalcTextSizeW(ImGuiContext* ctx, const ImWchar* text_begi if (c == '\r') continue; - const float char_width = font->GetCharAdvance((ImWchar)c) * scale; + const float char_width = ((int)c < font->IndexAdvanceX.Size ? font->IndexAdvanceX.Data[c] : font->FallbackAdvanceX) * scale; line_width += char_width; } @@ -3704,19 +3937,21 @@ static ImVec2 InputTextCalcTextSizeW(ImGuiContext* ctx, const ImWchar* text_begi } // Wrapper for stb_textedit.h to edit text (our wrapper is for: statically sized buffer, single-line, wchar characters. InputText converts between UTF-8 and wchar) +// With our UTF-8 use of stb_textedit: +// - STB_TEXTEDIT_GETCHAR is nothing more than a a "GETBYTE". It's only used to compare to ascii or to copy blocks of text so we are fine. +// - One exception is the STB_TEXTEDIT_IS_SPACE feature which would expect a full char in order to handle full-width space such as 0x3000 (see ImCharIsBlankW). +// - ...but we don't use that feature. namespace ImStb { - -static int STB_TEXTEDIT_STRINGLEN(const ImGuiInputTextState* obj) { return obj->CurLenW; } -static ImWchar STB_TEXTEDIT_GETCHAR(const ImGuiInputTextState* obj, int idx) { return obj->TextW[idx]; } -static float STB_TEXTEDIT_GETWIDTH(ImGuiInputTextState* obj, int line_start_idx, int char_idx) { ImWchar c = obj->TextW[line_start_idx + char_idx]; if (c == '\n') return STB_TEXTEDIT_GETWIDTH_NEWLINE; ImGuiContext& g = *obj->Ctx; return g.Font->GetCharAdvance(c) * (g.FontSize / g.Font->FontSize); } -static int STB_TEXTEDIT_KEYTOTEXT(int key) { return key >= 0x200000 ? 0 : key; } -static ImWchar STB_TEXTEDIT_NEWLINE = '\n'; +static int STB_TEXTEDIT_STRINGLEN(const ImGuiInputTextState* obj) { return obj->CurLenA; } +static char STB_TEXTEDIT_GETCHAR(const ImGuiInputTextState* obj, int idx) { IM_ASSERT(idx <= obj->CurLenA); return obj->TextA[idx]; } +static float STB_TEXTEDIT_GETWIDTH(ImGuiInputTextState* obj, int line_start_idx, int char_idx) { unsigned int c; ImTextCharFromUtf8(&c, obj->TextA.Data + line_start_idx + char_idx, obj->TextA.Data + obj->TextA.Size); if ((ImWchar)c == '\n') return IMSTB_TEXTEDIT_GETWIDTH_NEWLINE; ImGuiContext& g = *obj->Ctx; return g.Font->GetCharAdvance((ImWchar)c) * g.FontScale; } +static char STB_TEXTEDIT_NEWLINE = '\n'; static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, ImGuiInputTextState* obj, int line_start_idx) { - const ImWchar* text = obj->TextW.Data; - const ImWchar* text_remaining = NULL; - const ImVec2 size = InputTextCalcTextSizeW(obj->Ctx, text + line_start_idx, text + obj->CurLenW, &text_remaining, NULL, true); + const char* text = obj->TextA.Data; + const char* text_remaining = NULL; + const ImVec2 size = InputTextCalcTextSize(obj->Ctx, text + line_start_idx, text + obj->CurLenA, &text_remaining, NULL, true); r->x0 = 0.0f; r->x1 = size.x; r->baseline_y_delta = size.y; @@ -3725,9 +3960,37 @@ static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, ImGuiInputTextState* ob r->num_chars = (int)(text_remaining - (text + line_start_idx)); } -static bool is_separator(unsigned int c) +#define IMSTB_TEXTEDIT_GETNEXTCHARINDEX IMSTB_TEXTEDIT_GETNEXTCHARINDEX_IMPL +#define IMSTB_TEXTEDIT_GETPREVCHARINDEX IMSTB_TEXTEDIT_GETPREVCHARINDEX_IMPL + +static int IMSTB_TEXTEDIT_GETNEXTCHARINDEX_IMPL(ImGuiInputTextState* obj, int idx) +{ + if (idx >= obj->CurLenA) + return obj->CurLenA + 1; + unsigned int c; + return idx + ImTextCharFromUtf8(&c, obj->TextA.Data + idx, obj->TextA.Data + obj->TextA.Size); +} + +static int IMSTB_TEXTEDIT_GETPREVCHARINDEX_IMPL(ImGuiInputTextState* obj, int idx) +{ + if (idx <= 0) + return -1; + const char* p = ImTextFindPreviousUtf8Codepoint(obj->TextA.Data, obj->TextA.Data + idx); + return (int)(p - obj->TextA.Data); +} + +static bool ImCharIsSeparatorW(unsigned int c) { - return c==',' || c==';' || c=='(' || c==')' || c=='{' || c=='}' || c=='[' || c==']' || c=='|' || c=='\n' || c=='\r' || c=='.' || c=='!'; + static const unsigned int separator_list[] = + { + ',', 0x3001, '.', 0x3002, ';', 0xFF1B, '(', 0xFF08, ')', 0xFF09, '{', 0xFF5B, '}', 0xFF5D, + '[', 0x300C, ']', 0x300D, '|', 0xFF5C, '!', 0xFF01, '\\', 0xFFE5, '/', 0x30FB, 0xFF0F, + '\n', '\r', + }; + for (unsigned int separator : separator_list) + if (c == separator) + return true; + return false; } static int is_word_boundary_from_right(ImGuiInputTextState* obj, int idx) @@ -3736,10 +3999,15 @@ static int is_word_boundary_from_right(ImGuiInputTextState* obj, int idx) if ((obj->Flags & ImGuiInputTextFlags_Password) || idx <= 0) return 0; - bool prev_white = ImCharIsBlankW(obj->TextW[idx - 1]); - bool prev_separ = is_separator(obj->TextW[idx - 1]); - bool curr_white = ImCharIsBlankW(obj->TextW[idx]); - bool curr_separ = is_separator(obj->TextW[idx]); + const char* curr_p = obj->TextA.Data + idx; + const char* prev_p = ImTextFindPreviousUtf8Codepoint(obj->TextA.Data, curr_p); + unsigned int curr_c; ImTextCharFromUtf8(&curr_c, curr_p, obj->TextA.Data + obj->TextA.Size); + unsigned int prev_c; ImTextCharFromUtf8(&prev_c, prev_p, obj->TextA.Data + obj->TextA.Size); + + bool prev_white = ImCharIsBlankW(prev_c); + bool prev_separ = ImCharIsSeparatorW(prev_c); + bool curr_white = ImCharIsBlankW(curr_c); + bool curr_separ = ImCharIsSeparatorW(curr_c); return ((prev_white || prev_separ) && !(curr_separ || curr_white)) || (curr_separ && !prev_separ); } static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx) @@ -3747,63 +4015,83 @@ static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx) if ((obj->Flags & ImGuiInputTextFlags_Password) || idx <= 0) return 0; - bool prev_white = ImCharIsBlankW(obj->TextW[idx]); - bool prev_separ = is_separator(obj->TextW[idx]); - bool curr_white = ImCharIsBlankW(obj->TextW[idx - 1]); - bool curr_separ = is_separator(obj->TextW[idx - 1]); + const char* curr_p = obj->TextA.Data + idx; + const char* prev_p = ImTextFindPreviousUtf8Codepoint(obj->TextA.Data, curr_p); + unsigned int prev_c; ImTextCharFromUtf8(&prev_c, curr_p, obj->TextA.Data + obj->TextA.Size); + unsigned int curr_c; ImTextCharFromUtf8(&curr_c, prev_p, obj->TextA.Data + obj->TextA.Size); + + bool prev_white = ImCharIsBlankW(prev_c); + bool prev_separ = ImCharIsSeparatorW(prev_c); + bool curr_white = ImCharIsBlankW(curr_c); + bool curr_separ = ImCharIsSeparatorW(curr_c); return ((prev_white) && !(curr_separ || curr_white)) || (curr_separ && !prev_separ); } -static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(ImGuiInputTextState* obj, int idx) { idx--; while (idx >= 0 && !is_word_boundary_from_right(obj, idx)) idx--; return idx < 0 ? 0 : idx; } -static int STB_TEXTEDIT_MOVEWORDRIGHT_MAC(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_left(obj, idx)) idx++; return idx > len ? len : idx; } -static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; } +static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(ImGuiInputTextState* obj, int idx) +{ + idx = IMSTB_TEXTEDIT_GETPREVCHARINDEX(obj, idx); + while (idx >= 0 && !is_word_boundary_from_right(obj, idx)) + idx = IMSTB_TEXTEDIT_GETPREVCHARINDEX(obj, idx); + return idx < 0 ? 0 : idx; +} +static int STB_TEXTEDIT_MOVEWORDRIGHT_MAC(ImGuiInputTextState* obj, int idx) +{ + int len = obj->CurLenA; + idx = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx); + while (idx < len && !is_word_boundary_from_left(obj, idx)) + idx = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx); + return idx > len ? len : idx; +} +static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx) +{ + idx = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx); + int len = obj->CurLenA; + while (idx < len && !is_word_boundary_from_right(obj, idx)) + idx = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx); + return idx > len ? len : idx; +} static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(ImGuiInputTextState* obj, int idx) { ImGuiContext& g = *obj->Ctx; if (g.IO.ConfigMacOSXBehaviors) return STB_TEXTEDIT_MOVEWORDRIGHT_MAC(obj, idx); else return STB_TEXTEDIT_MOVEWORDRIGHT_WIN(obj, idx); } -#define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h -#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_IMPL +#define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h +#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_IMPL static void STB_TEXTEDIT_DELETECHARS(ImGuiInputTextState* obj, int pos, int n) { - ImWchar* dst = obj->TextW.Data + pos; + char* dst = obj->TextA.Data + pos; - // We maintain our buffer length in both UTF-8 and wchar formats obj->Edited = true; - obj->CurLenA -= ImTextCountUtf8BytesFromStr(dst, dst + n); - obj->CurLenW -= n; + obj->CurLenA -= n; // Offset remaining text (FIXME-OPT: Use memmove) - const ImWchar* src = obj->TextW.Data + pos + n; - while (ImWchar c = *src++) + const char* src = obj->TextA.Data + pos + n; + while (char c = *src++) *dst++ = c; *dst = '\0'; } -static bool STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const ImWchar* new_text, int new_text_len) +static bool STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const char* new_text, int new_text_len) { const bool is_resizable = (obj->Flags & ImGuiInputTextFlags_CallbackResize) != 0; - const int text_len = obj->CurLenW; + const int text_len = obj->CurLenA; IM_ASSERT(pos <= text_len); - const int new_text_len_utf8 = ImTextCountUtf8BytesFromStr(new_text, new_text + new_text_len); - if (!is_resizable && (new_text_len_utf8 + obj->CurLenA + 1 > obj->BufCapacityA)) + if (!is_resizable && (new_text_len + obj->CurLenA + 1 > obj->BufCapacityA)) return false; // Grow internal buffer if needed - if (new_text_len + text_len + 1 > obj->TextW.Size) + if (new_text_len + text_len + 1 > obj->TextA.Size) { if (!is_resizable) return false; - IM_ASSERT(text_len < obj->TextW.Size); - obj->TextW.resize(text_len + ImClamp(new_text_len * 4, 32, ImMax(256, new_text_len)) + 1); + obj->TextA.resize(text_len + ImClamp(new_text_len, 32, ImMax(256, new_text_len)) + 1); } - ImWchar* text = obj->TextW.Data; + char* text = obj->TextA.Data; if (pos != text_len) - memmove(text + pos + new_text_len, text + pos, (size_t)(text_len - pos) * sizeof(ImWchar)); - memcpy(text + pos, new_text, (size_t)new_text_len * sizeof(ImWchar)); + memmove(text + pos + new_text_len, text + pos, (size_t)(text_len - pos)); + memcpy(text + pos, new_text, (size_t)new_text_len); obj->Edited = true; - obj->CurLenW += new_text_len; - obj->CurLenA += new_text_len_utf8; - obj->TextW[obj->CurLenW] = '\0'; + obj->CurLenA += new_text_len; + obj->TextA[obj->CurLenA] = '\0'; return true; } @@ -3827,16 +4115,16 @@ static bool STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const Im #define STB_TEXTEDIT_K_PGDOWN 0x20000F // keyboard input to move cursor down a page #define STB_TEXTEDIT_K_SHIFT 0x400000 -#define STB_TEXTEDIT_IMPLEMENTATION -#define STB_TEXTEDIT_memmove memmove +#define IMSTB_TEXTEDIT_IMPLEMENTATION +#define IMSTB_TEXTEDIT_memmove memmove #include "imstb_textedit.h" // stb_textedit internally allows for a single undo record to do addition and deletion, but somehow, calling // the stb_textedit_paste() function creates two separate records, so we perform it manually. (FIXME: Report to nothings/stb?) -static void stb_textedit_replace(ImGuiInputTextState* str, STB_TexteditState* state, const STB_TEXTEDIT_CHARTYPE* text, int text_len) +static void stb_textedit_replace(ImGuiInputTextState* str, STB_TexteditState* state, const IMSTB_TEXTEDIT_CHARTYPE* text, int text_len) { - stb_text_makeundo_replace(str, state, 0, str->CurLenW, text_len); - ImStb::STB_TEXTEDIT_DELETECHARS(str, 0, str->CurLenW); + stb_text_makeundo_replace(str, state, 0, str->CurLenA, text_len); + ImStb::STB_TEXTEDIT_DELETECHARS(str, 0, str->CurLenA); state->cursor = state->select_start = state->select_end = 0; if (text_len <= 0) return; @@ -3851,13 +4139,50 @@ static void stb_textedit_replace(ImGuiInputTextState* str, STB_TexteditState* st } // namespace ImStb +// We added an extra indirection where 'Stb' is heap-allocated, in order facilitate the work of bindings generators. +ImGuiInputTextState::ImGuiInputTextState() +{ + memset(this, 0, sizeof(*this)); + Stb = IM_NEW(ImStbTexteditState); + memset(Stb, 0, sizeof(*Stb)); +} + +ImGuiInputTextState::~ImGuiInputTextState() +{ + IM_DELETE(Stb); +} + void ImGuiInputTextState::OnKeyPressed(int key) { - stb_textedit_key(this, &Stb, key); + stb_textedit_key(this, Stb, key); + CursorFollow = true; + CursorAnimReset(); +} + +void ImGuiInputTextState::OnCharPressed(unsigned int c) +{ + // Convert the key to a UTF8 byte sequence. + // The changes we had to make to stb_textedit_key made it very much UTF-8 specific which is not too great. + char utf8[5]; + ImTextCharToUtf8(utf8, c); + stb_textedit_text(this, Stb, utf8, (int)strlen(utf8)); CursorFollow = true; CursorAnimReset(); } +// Those functions are not inlined in imgui_internal.h, allowing us to hide ImStbTexteditState from that header. +void ImGuiInputTextState::CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking +void ImGuiInputTextState::CursorClamp() { Stb->cursor = ImMin(Stb->cursor, CurLenA); Stb->select_start = ImMin(Stb->select_start, CurLenA); Stb->select_end = ImMin(Stb->select_end, CurLenA); } +bool ImGuiInputTextState::HasSelection() const { return Stb->select_start != Stb->select_end; } +void ImGuiInputTextState::ClearSelection() { Stb->select_start = Stb->select_end = Stb->cursor; } +int ImGuiInputTextState::GetCursorPos() const { return Stb->cursor; } +int ImGuiInputTextState::GetSelectionStart() const { return Stb->select_start; } +int ImGuiInputTextState::GetSelectionEnd() const { return Stb->select_end; } +void ImGuiInputTextState::SelectAll() { Stb->select_start = 0; Stb->cursor = Stb->select_end = CurLenA; Stb->has_preferred_x = 0; } +void ImGuiInputTextState::ReloadUserBufAndSelectAll() { ReloadUserBuf = true; ReloadSelectionStart = 0; ReloadSelectionEnd = INT_MAX; } +void ImGuiInputTextState::ReloadUserBufAndKeepSelection() { ReloadUserBuf = true; ReloadSelectionStart = Stb->select_start; ReloadSelectionEnd = Stb->select_end; } +void ImGuiInputTextState::ReloadUserBufAndMoveToEnd() { ReloadUserBuf = true; ReloadSelectionStart = ReloadSelectionEnd = INT_MAX; } + ImGuiInputTextCallbackData::ImGuiInputTextCallbackData() { memset(this, 0, sizeof(*this)); @@ -3921,9 +4246,8 @@ void ImGuiInputTextCallbackData::InsertChars(int pos, const char* new_text, cons } // Return false to discard a character. -static bool InputTextFilterCharacter(ImGuiContext* ctx, unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data, ImGuiInputSource input_source) +static bool InputTextFilterCharacter(ImGuiContext* ctx, unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data, bool input_source_is_clipboard) { - IM_ASSERT(input_source == ImGuiInputSource_Keyboard || input_source == ImGuiInputSource_Clipboard); unsigned int c = *p_char; // Filter non-printable (NB: isprint is unreliable! see #2467) @@ -3931,14 +4255,14 @@ static bool InputTextFilterCharacter(ImGuiContext* ctx, unsigned int* p_char, Im if (c < 0x20) { bool pass = false; - pass |= (c == '\n' && (flags & ImGuiInputTextFlags_Multiline)); // Note that an Enter KEY will emit \r and be ignored (we poll for KEY in InputText() code) - pass |= (c == '\t' && (flags & ImGuiInputTextFlags_AllowTabInput)); + pass |= (c == '\n') && (flags & ImGuiInputTextFlags_Multiline) != 0; // Note that an Enter KEY will emit \r and be ignored (we poll for KEY in InputText() code) + pass |= (c == '\t') && (flags & ImGuiInputTextFlags_AllowTabInput) != 0; if (!pass) return false; apply_named_filters = false; // Override named filters below so newline and tabs can still be inserted. } - if (input_source != ImGuiInputSource_Clipboard) + if (input_source_is_clipboard == false) { // We ignore Ascii representation of delete (emitted from Backspace on OSX, see #2578, #2817) if (c == 127) @@ -3954,17 +4278,17 @@ static bool InputTextFilterCharacter(ImGuiContext* ctx, unsigned int* p_char, Im return false; // Generic named filters - if (apply_named_filters && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific))) + if (apply_named_filters && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific | (ImGuiInputTextFlags)ImGuiInputTextFlags_LocalizeDecimalPoint))) { // The libc allows overriding locale, with e.g. 'setlocale(LC_NUMERIC, "de_DE.UTF-8");' which affect the output/input of printf/scanf to use e.g. ',' instead of '.'. // The standard mandate that programs starts in the "C" locale where the decimal point is '.'. // We don't really intend to provide widespread support for it, but out of empathy for people stuck with using odd API, we support the bare minimum aka overriding the decimal point. // Change the default decimal_point with: - // ImGui::GetIO()->PlatformLocaleDecimalPoint = *localeconv()->decimal_point; + // ImGui::GetPlatformIO()->Platform_LocaleDecimalPoint = *localeconv()->decimal_point; // Users of non-default decimal point (in particular ',') may be affected by word-selection logic (is_word_boundary_from_right/is_word_boundary_from_left) functions. ImGuiContext& g = *ctx; - const unsigned c_decimal_point = (unsigned int)g.IO.PlatformLocaleDecimalPoint; - if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsScientific)) + const unsigned c_decimal_point = (unsigned int)g.PlatformIO.Platform_LocaleDecimalPoint; + if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsScientific | (ImGuiInputTextFlags)ImGuiInputTextFlags_LocalizeDecimalPoint)) if (c == '.' || c == ',') c = c_decimal_point; @@ -4027,34 +4351,29 @@ static bool InputTextFilterCharacter(ImGuiContext* ctx, unsigned int* p_char, Im // FIXME: Ideally we should transition toward (1) making InsertChars()/DeleteChars() update undo-stack (2) discourage (and keep reconcile) or obsolete (and remove reconcile) accessing buffer directly. static void InputTextReconcileUndoStateAfterUserCallback(ImGuiInputTextState* state, const char* new_buf_a, int new_length_a) { - ImGuiContext& g = *GImGui; - const ImWchar* old_buf = state->TextW.Data; - const int old_length = state->CurLenW; - const int new_length = ImTextCountCharsFromUtf8(new_buf_a, new_buf_a + new_length_a); - g.TempBuffer.reserve_discard((new_length + 1) * sizeof(ImWchar)); - ImWchar* new_buf = (ImWchar*)(void*)g.TempBuffer.Data; - ImTextStrFromUtf8(new_buf, new_length + 1, new_buf_a, new_buf_a + new_length_a); - - const int shorter_length = ImMin(old_length, new_length); + const char* old_buf = state->CallbackTextBackup.Data; + const int old_length = state->CallbackTextBackup.Size - 1; + + const int shorter_length = ImMin(old_length, new_length_a); int first_diff; for (first_diff = 0; first_diff < shorter_length; first_diff++) - if (old_buf[first_diff] != new_buf[first_diff]) + if (old_buf[first_diff] != new_buf_a[first_diff]) break; - if (first_diff == old_length && first_diff == new_length) + if (first_diff == old_length && first_diff == new_length_a) return; - int old_last_diff = old_length - 1; - int new_last_diff = new_length - 1; + int old_last_diff = old_length - 1; + int new_last_diff = new_length_a - 1; for (; old_last_diff >= first_diff && new_last_diff >= first_diff; old_last_diff--, new_last_diff--) - if (old_buf[old_last_diff] != new_buf[new_last_diff]) + if (old_buf[old_last_diff] != new_buf_a[new_last_diff]) break; const int insert_len = new_last_diff - first_diff + 1; const int delete_len = old_last_diff - first_diff + 1; if (insert_len > 0 || delete_len > 0) - if (STB_TEXTEDIT_CHARTYPE* p = stb_text_createundo(&state->Stb.undostate, first_diff, delete_len, insert_len)) + if (IMSTB_TEXTEDIT_CHARTYPE* p = stb_text_createundo(&state->Stb->undostate, first_diff, delete_len, insert_len)) for (int i = 0; i < delete_len; i++) - p[i] = ImStb::STB_TEXTEDIT_GETCHAR(state, first_diff + i); + p[i] = old_buf[first_diff + i]; } // As InputText() retain textual data and we currently provide a path for user to not retain it (via local variables) @@ -4104,12 +4423,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ const bool RENDER_SELECTION_WHEN_INACTIVE = false; const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0; - const bool is_readonly = (flags & ImGuiInputTextFlags_ReadOnly) != 0; - const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0; - const bool is_undoable = (flags & ImGuiInputTextFlags_NoUndoRedo) == 0; - const bool is_resizable = (flags & ImGuiInputTextFlags_CallbackResize) != 0; - if (is_resizable) - IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag! if (is_multiline) // Open group before calling GetID() because groups tracks id created within their scope (including the scrollbar) BeginGroup(); @@ -4123,7 +4436,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ ImGuiWindow* draw_window = window; ImVec2 inner_size = frame_size; - ImGuiItemStatusFlags item_status_flags = 0; ImGuiLastItemData item_data_backup; if (is_multiline) { @@ -4134,17 +4446,25 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ EndGroup(); return false; } - item_status_flags = g.LastItemData.StatusFlags; item_data_backup = g.LastItemData; window->DC.CursorPos = backup_pos; + // Prevent NavActivation from Tabbing when our widget accepts Tab inputs: this allows cycling through widgets without stopping. + if (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_FromTabbing) && (flags & ImGuiInputTextFlags_AllowTabInput)) + g.NavActivateId = 0; + + // Prevent NavActivate reactivating in BeginChild() when we are already active. + const ImGuiID backup_activate_id = g.NavActivateId; + if (g.ActiveId == id) // Prevent reactivation + g.NavActivateId = 0; + // We reproduce the contents of BeginChildFrame() in order to provide 'label' so our window internal data are easier to read/debug. - // FIXME-NAV: Pressing NavActivate will trigger general child activation right before triggering our own below. Harmless but bizarre. PushStyleColor(ImGuiCol_ChildBg, style.Colors[ImGuiCol_FrameBg]); PushStyleVar(ImGuiStyleVar_ChildRounding, style.FrameRounding); PushStyleVar(ImGuiStyleVar_ChildBorderSize, style.FrameBorderSize); PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0)); // Ensure no clip rect so mouse hover can reach FramePadding edges - bool child_visible = BeginChildEx(label, id, frame_bb.GetSize(), true, ImGuiWindowFlags_NoMove); + bool child_visible = BeginChildEx(label, id, frame_bb.GetSize(), ImGuiChildFlags_Borders, ImGuiWindowFlags_NoMove); + g.NavActivateId = backup_activate_id; PopStyleVar(3); PopStyleColor(); if (!child_visible) @@ -4165,19 +4485,30 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (!(flags & ImGuiInputTextFlags_MergedItem)) if (!ItemAdd(total_bb, id, &frame_bb, ImGuiItemFlags_Inputable)) return false; - item_status_flags = g.LastItemData.StatusFlags; } - const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags); + + // Ensure mouse cursor is set even after switching to keyboard/gamepad mode. May generalize further? (#6417) + bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags | ImGuiItemFlags_NoNavDisableMouseHover); if (hovered) - g.MouseCursor = ImGuiMouseCursor_TextInput; + SetMouseCursor(ImGuiMouseCursor_TextInput); + if (hovered && g.NavHighlightItemUnderNav) + hovered = false; // We are only allowed to access the state if we are already the active widget. ImGuiInputTextState* state = GetInputTextState(id); - const bool input_requested_by_tabbing = (item_status_flags & ImGuiItemStatusFlags_FocusedByTabbing) != 0; - const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateId == id) && ((g.NavActivateFlags & ImGuiActivateFlags_PreferInput) || (g.NavInputSource == ImGuiInputSource_Keyboard))); - - const bool user_clicked = hovered && io.MouseClicked[0]; + if (g.LastItemData.ItemFlags & ImGuiItemFlags_ReadOnly) + flags |= ImGuiInputTextFlags_ReadOnly; + const bool is_readonly = (flags & ImGuiInputTextFlags_ReadOnly) != 0; + const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0; + const bool is_undoable = (flags & ImGuiInputTextFlags_NoUndoRedo) == 0; + const bool is_resizable = (flags & ImGuiInputTextFlags_CallbackResize) != 0; + if (is_resizable) + IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag! + + const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateId == id) && ((g.NavActivateFlags & ImGuiActivateFlags_PreferInput) || (g.NavInputSource == ImGuiInputSource_Keyboard))); + + const bool user_clicked = hovered && io.MouseClicked[0]; const bool user_scroll_finish = is_multiline && state != NULL && g.ActiveId == 0 && g.ActiveIdPreviousFrame == GetWindowScrollbarID(draw_window, ImGuiAxis_Y); const bool user_scroll_active = is_multiline && state != NULL && g.ActiveId == GetWindowScrollbarID(draw_window, ImGuiAxis_Y); bool clear_active_id = false; @@ -4185,38 +4516,40 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ float scroll_y = is_multiline ? draw_window->Scroll.y : FLT_MAX; - const bool init_changed_specs = (state != NULL && state->Stb.single_line != !is_multiline); // state != NULL means its our state. - const bool init_make_active = (user_clicked || user_scroll_finish || input_requested_by_nav || input_requested_by_tabbing); + const bool init_reload_from_user_buf = (state != NULL && state->ReloadUserBuf); + const bool init_changed_specs = (state != NULL && state->Stb->single_line != !is_multiline); // state != NULL means its our state. + const bool init_make_active = (user_clicked || user_scroll_finish || input_requested_by_nav); const bool init_state = (init_make_active || user_scroll_active); - if ((init_state && g.ActiveId != id) || init_changed_specs) + if ((init_state && g.ActiveId != id) || init_changed_specs || init_reload_from_user_buf) { // Access state even if we don't own it yet. state = &g.InputTextState; state->CursorAnimReset(); + state->ReloadUserBuf = false; // Backup state of deactivating item so they'll have a chance to do a write to output buffer on the same frame they report IsItemDeactivatedAfterEdit (#4714) InputTextDeactivateHook(state->ID); - // Take a copy of the initial buffer value (both in original UTF-8 format and converted to wchar) - // From the moment we focused we are ignoring the content of 'buf' (unless we are in read-only mode) + // From the moment we focused we are normally ignoring the content of 'buf' (unless we are in read-only mode) const int buf_len = (int)strlen(buf); - state->InitialTextA.resize(buf_len + 1); // UTF-8. we use +1 to make sure that .Data is always pointing to at least an empty string. - memcpy(state->InitialTextA.Data, buf, buf_len + 1); + if (!init_reload_from_user_buf) + { + // Take a copy of the initial buffer value. + state->InitialTextA.resize(buf_len + 1); // UTF-8. we use +1 to make sure that .Data is always pointing to at least an empty string. + memcpy(state->InitialTextA.Data, buf, buf_len + 1); + } // Preserve cursor position and undo/redo stack if we come back to same widget - // FIXME: Since we reworked this on 2022/06, may want to differenciate recycle_cursor vs recycle_undostate? - bool recycle_state = (state->ID == id && !init_changed_specs); - if (recycle_state && (state->CurLenA != buf_len || (state->TextAIsValid && strncmp(state->TextA.Data, buf, buf_len) != 0))) + // FIXME: Since we reworked this on 2022/06, may want to differentiate recycle_cursor vs recycle_undostate? + bool recycle_state = (state->ID == id && !init_changed_specs && !init_reload_from_user_buf); + if (recycle_state && (state->CurLenA != buf_len || (strncmp(state->TextA.Data, buf, buf_len) != 0))) recycle_state = false; // Start edition - const char* buf_end = NULL; state->ID = id; - state->TextW.resize(buf_size + 1); // wchar count <= UTF-8 count. we use +1 to make sure that .Data is always pointing to at least an empty string. - state->TextA.resize(0); - state->TextAIsValid = false; // TextA is not valid yet (we will display buf until then) - state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, buf_size, buf, NULL, &buf_end); - state->CurLenA = (int)(buf_end - buf); // We can't get the result from ImStrncpy() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8. + state->TextA.resize(buf_size + 1); // we use +1 to make sure that .Data is always pointing to at least an empty string. + state->CurLenA = (int)strlen(buf); + memcpy(state->TextA.Data, buf, state->CurLenA + 1); if (recycle_state) { @@ -4226,22 +4559,28 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ } else { - state->ScrollX = 0.0f; - stb_textedit_initialize_state(&state->Stb, !is_multiline); + state->Scroll = ImVec2(0.0f, 0.0f); + stb_textedit_initialize_state(state->Stb, !is_multiline); } - if (!is_multiline) + if (init_reload_from_user_buf) + { + state->Stb->select_start = state->ReloadSelectionStart; + state->Stb->cursor = state->Stb->select_end = state->ReloadSelectionEnd; + state->CursorClamp(); + } + else if (!is_multiline) { if (flags & ImGuiInputTextFlags_AutoSelectAll) select_all = true; if (input_requested_by_nav && (!recycle_state || !(g.NavActivateFlags & ImGuiActivateFlags_TryToPreserveState))) select_all = true; - if (input_requested_by_tabbing || (user_clicked && io.KeyCtrl)) + if (user_clicked && io.KeyCtrl) select_all = true; } if (flags & ImGuiInputTextFlags_AlwaysOverwrite) - state->Stb.insert_mode = 1; // stb field name is indeed incorrect (see #2863) + state->Stb->insert_mode = 1; // stb field name is indeed incorrect (see #2863) } const bool is_osx = io.ConfigMacOSXBehaviors; @@ -4255,22 +4594,31 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (g.ActiveId == id) { // Declare some inputs, the other are registered and polled via Shortcut() routing system. + // FIXME: The reason we don't use Shortcut() is we would need a routing flag to specify multiple mods, or to all mods combinaison into individual shortcuts. + const ImGuiKey always_owned_keys[] = { ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_Enter, ImGuiKey_KeypadEnter, ImGuiKey_Delete, ImGuiKey_Backspace, ImGuiKey_Home, ImGuiKey_End }; + for (ImGuiKey key : always_owned_keys) + SetKeyOwner(key, id); if (user_clicked) SetKeyOwner(ImGuiKey_MouseLeft, id); g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right); if (is_multiline || (flags & ImGuiInputTextFlags_CallbackHistory)) + { g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down); - SetKeyOwner(ImGuiKey_Home, id); - SetKeyOwner(ImGuiKey_End, id); + SetKeyOwner(ImGuiKey_UpArrow, id); + SetKeyOwner(ImGuiKey_DownArrow, id); + } if (is_multiline) { SetKeyOwner(ImGuiKey_PageUp, id); SetKeyOwner(ImGuiKey_PageDown, id); } + // FIXME: May be a problem to always steal Alt on OSX, would ideally still allow an uninterrupted Alt down-up to toggle menu if (is_osx) SetKeyOwner(ImGuiMod_Alt, id); - if (flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_AllowTabInput)) // Disable keyboard tabbing out as we will use the \t character. - SetShortcutRouting(ImGuiKey_Tab, id); + + // Expose scroll in a manner that is agnostic to us using a child window + if (is_multiline && state != NULL) + state->Scroll.y = draw_window->Scroll.y; } // We have an edge case if ActiveId was set through another widget (e.g. widget being swapped), clear id immediately (don't wait until the end of the function) @@ -4287,20 +4635,8 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ bool value_changed = false; bool validated = false; - // When read-only we always use the live data passed to the function - // FIXME-OPT: Because our selection/cursor code currently needs the wide text we need to convert it when active, which is not ideal :( - if (is_readonly && state != NULL && (render_cursor || render_selection)) - { - const char* buf_end = NULL; - state->TextW.resize(buf_size + 1); - state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, state->TextW.Size, buf, NULL, &buf_end); - state->CurLenA = (int)(buf_end - buf); - state->CursorClamp(); - render_selection &= state->HasSelection(); - } - // Select the buffer to render. - const bool buf_display_from_state = (render_cursor || render_selection || g.ActiveId == id) && !is_readonly && state && state->TextAIsValid; + const bool buf_display_from_state = (render_cursor || render_selection || g.ActiveId == id) && !is_readonly && state; const bool is_displaying_hint = (hint != NULL && (buf_display_from_state ? state->TextA.Data : buf)[0] == 0); // Password pushes a temporary font with only a fallback glyph @@ -4320,11 +4656,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ } // Process mouse inputs and character inputs - int backup_current_text_length = 0; if (g.ActiveId == id) { IM_ASSERT(state != NULL); - backup_current_text_length = state->CurLenA; state->Edited = false; state->BufCapacityA = buf_size; state->Flags = flags; @@ -4334,7 +4668,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ g.ActiveIdAllowOverlap = !io.MouseDown[0]; // Edit in progress - const float mouse_x = (io.MousePos.x - frame_bb.Min.x - style.FramePadding.x) + state->ScrollX; + const float mouse_x = (io.MousePos.x - frame_bb.Min.x - style.FramePadding.x) + state->Scroll.x; const float mouse_y = (is_multiline ? (io.MousePos.y - draw_window->DC.CursorPos.y) : (g.FontSize * 0.5f)); if (select_all) @@ -4344,34 +4678,34 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ } else if (hovered && io.MouseClickedCount[0] >= 2 && !io.KeyShift) { - stb_textedit_click(state, &state->Stb, mouse_x, mouse_y); + stb_textedit_click(state, state->Stb, mouse_x, mouse_y); const int multiclick_count = (io.MouseClickedCount[0] - 2); if ((multiclick_count % 2) == 0) { // Double-click: Select word // We always use the "Mac" word advance for double-click select vs CTRL+Right which use the platform dependent variant: // FIXME: There are likely many ways to improve this behavior, but there's no "right" behavior (depends on use-case, software, OS) - const bool is_bol = (state->Stb.cursor == 0) || ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb.cursor - 1) == '\n'; - if (STB_TEXT_HAS_SELECTION(&state->Stb) || !is_bol) + const bool is_bol = (state->Stb->cursor == 0) || ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb->cursor - 1) == '\n'; + if (STB_TEXT_HAS_SELECTION(state->Stb) || !is_bol) state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT); //state->OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT); - if (!STB_TEXT_HAS_SELECTION(&state->Stb)) - ImStb::stb_textedit_prep_selection_at_cursor(&state->Stb); - state->Stb.cursor = ImStb::STB_TEXTEDIT_MOVEWORDRIGHT_MAC(state, state->Stb.cursor); - state->Stb.select_end = state->Stb.cursor; - ImStb::stb_textedit_clamp(state, &state->Stb); + if (!STB_TEXT_HAS_SELECTION(state->Stb)) + ImStb::stb_textedit_prep_selection_at_cursor(state->Stb); + state->Stb->cursor = ImStb::STB_TEXTEDIT_MOVEWORDRIGHT_MAC(state, state->Stb->cursor); + state->Stb->select_end = state->Stb->cursor; + ImStb::stb_textedit_clamp(state, state->Stb); } else { // Triple-click: Select line - const bool is_eol = ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb.cursor) == '\n'; + const bool is_eol = ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb->cursor) == '\n'; state->OnKeyPressed(STB_TEXTEDIT_K_LINESTART); state->OnKeyPressed(STB_TEXTEDIT_K_LINEEND | STB_TEXTEDIT_K_SHIFT); state->OnKeyPressed(STB_TEXTEDIT_K_RIGHT | STB_TEXTEDIT_K_SHIFT); if (!is_eol && is_multiline) { - ImSwap(state->Stb.select_start, state->Stb.select_end); - state->Stb.cursor = state->Stb.select_end; + ImSwap(state->Stb->select_start, state->Stb->select_end); + state->Stb->cursor = state->Stb->select_end; } state->CursorFollow = false; } @@ -4382,15 +4716,15 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (hovered) { if (io.KeyShift) - stb_textedit_drag(state, &state->Stb, mouse_x, mouse_y); + stb_textedit_drag(state, state->Stb, mouse_x, mouse_y); else - stb_textedit_click(state, &state->Stb, mouse_x, mouse_y); + stb_textedit_click(state, state->Stb, mouse_x, mouse_y); state->CursorAnimReset(); } } else if (io.MouseDown[0] && !state->SelectedAllMouseLock && (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f)) { - stb_textedit_drag(state, &state->Stb, mouse_x, mouse_y); + stb_textedit_drag(state, state->Stb, mouse_x, mouse_y); state->CursorAnimReset(); state->CursorFollow = true; } @@ -4399,16 +4733,25 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // We expect backends to emit a Tab key but some also emit a Tab character which we ignore (#2467, #1336) // (For Tab and Enter: Win32/SFML/Allegro are sending both keys and chars, GLFW and SDL are only sending keys. For Space they all send all threes) - if ((flags & ImGuiInputTextFlags_AllowTabInput) && Shortcut(ImGuiKey_Tab, id) && !is_readonly) + if ((flags & ImGuiInputTextFlags_AllowTabInput) && !is_readonly) { - unsigned int c = '\t'; // Insert TAB - if (InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard)) - state->OnKeyPressed((int)c); + if (Shortcut(ImGuiKey_Tab, ImGuiInputFlags_Repeat, id)) + { + unsigned int c = '\t'; // Insert TAB + if (InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data)) + state->OnCharPressed(c); + } + // FIXME: Implement Shift+Tab + /* + if (Shortcut(ImGuiKey_Tab | ImGuiMod_Shift, ImGuiInputFlags_Repeat, id)) + { + } + */ } // Process regular text input (before we check for Return because using some IME will effectively send a Return?) // We ignore CTRL inputs, but need to allow ALT+CTRL as some keyboards (e.g. German) use AltGR (which _is_ Alt+Ctrl) to input certain characters. - const bool ignore_char_inputs = (io.KeyCtrl && !io.KeyAlt) || (is_osx && io.KeySuper); + const bool ignore_char_inputs = (io.KeyCtrl && !io.KeyAlt) || (is_osx && io.KeyCtrl); if (io.InputQueueCharacters.Size > 0) { if (!ignore_char_inputs && !is_readonly && !input_requested_by_nav) @@ -4418,8 +4761,8 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ unsigned int c = (unsigned int)io.InputQueueCharacters[n]; if (c == '\t') // Skip Tab, see above. continue; - if (InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard)) - state->OnKeyPressed((int)c); + if (InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data)) + state->OnCharPressed(c); } // Consume characters @@ -4434,29 +4777,30 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ IM_ASSERT(state != NULL); const int row_count_per_page = ImMax((int)((inner_size.y - style.FramePadding.y) / g.FontSize), 1); - state->Stb.row_count_per_page = row_count_per_page; + state->Stb->row_count_per_page = row_count_per_page; const int k_mask = (io.KeyShift ? STB_TEXTEDIT_K_SHIFT : 0); const bool is_wordmove_key_down = is_osx ? io.KeyAlt : io.KeyCtrl; // OS X style: Text editing cursor movement using Alt instead of Ctrl - const bool is_startend_key_down = is_osx && io.KeySuper && !io.KeyCtrl && !io.KeyAlt; // OS X style: Line/Text Start and End using Cmd+Arrows instead of Home/End + const bool is_startend_key_down = is_osx && io.KeyCtrl && !io.KeySuper && !io.KeyAlt; // OS X style: Line/Text Start and End using Cmd+Arrows instead of Home/End // Using Shortcut() with ImGuiInputFlags_RouteFocused (default policy) to allow routing operations for other code (e.g. calling window trying to use CTRL+A and CTRL+B: formet would be handled by InputText) // Otherwise we could simply assume that we own the keys as we are active. const ImGuiInputFlags f_repeat = ImGuiInputFlags_Repeat; - const bool is_cut = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_X, id, f_repeat) || Shortcut(ImGuiMod_Shift | ImGuiKey_Delete, id, f_repeat)) && !is_readonly && !is_password && (!is_multiline || state->HasSelection()); - const bool is_copy = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_C, id) || Shortcut(ImGuiMod_Ctrl | ImGuiKey_Insert, id)) && !is_password && (!is_multiline || state->HasSelection()); - const bool is_paste = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_V, id, f_repeat) || Shortcut(ImGuiMod_Shift | ImGuiKey_Insert, id, f_repeat)) && !is_readonly; - const bool is_undo = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_Z, id, f_repeat)) && !is_readonly && is_undoable; - const bool is_redo = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_Y, id, f_repeat) || (is_osx && Shortcut(ImGuiMod_Shortcut | ImGuiMod_Shift | ImGuiKey_Z, id, f_repeat))) && !is_readonly && is_undoable; - const bool is_select_all = Shortcut(ImGuiMod_Shortcut | ImGuiKey_A, id); + const bool is_cut = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_X, f_repeat, id) || Shortcut(ImGuiMod_Shift | ImGuiKey_Delete, f_repeat, id)) && !is_readonly && !is_password && (!is_multiline || state->HasSelection()); + const bool is_copy = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_C, 0, id) || Shortcut(ImGuiMod_Ctrl | ImGuiKey_Insert, 0, id)) && !is_password && (!is_multiline || state->HasSelection()); + const bool is_paste = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_V, f_repeat, id) || Shortcut(ImGuiMod_Shift | ImGuiKey_Insert, f_repeat, id)) && !is_readonly; + const bool is_undo = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_Z, f_repeat, id)) && !is_readonly && is_undoable; + const bool is_redo = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_Y, f_repeat, id) || (is_osx && Shortcut(ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Z, f_repeat, id))) && !is_readonly && is_undoable; + const bool is_select_all = Shortcut(ImGuiMod_Ctrl | ImGuiKey_A, 0, id); // We allow validate/cancel with Nav source (gamepad) to makes it easier to undo an accidental NavInput press with no keyboard wired, but otherwise it isn't very useful. const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; const bool is_enter_pressed = IsKeyPressed(ImGuiKey_Enter, true) || IsKeyPressed(ImGuiKey_KeypadEnter, true); const bool is_gamepad_validate = nav_gamepad_active && (IsKeyPressed(ImGuiKey_NavGamepadActivate, false) || IsKeyPressed(ImGuiKey_NavGamepadInput, false)); - const bool is_cancel = Shortcut(ImGuiKey_Escape, id, f_repeat) || (nav_gamepad_active && Shortcut(ImGuiKey_NavGamepadCancel, id, f_repeat)); + const bool is_cancel = Shortcut(ImGuiKey_Escape, f_repeat, id) || (nav_gamepad_active && Shortcut(ImGuiKey_NavGamepadCancel, f_repeat, id)); // FIXME: Should use more Shortcut() and reduce IsKeyPressed()+SetKeyOwner(), but requires modifiers combination to be taken account of. + // FIXME-OSX: Missing support for Alt(option)+Right/Left = go to end of line, or next line if already in end of line. if (IsKeyPressed(ImGuiKey_LeftArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINESTART : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDLEFT : STB_TEXTEDIT_K_LEFT) | k_mask); } else if (IsKeyPressed(ImGuiKey_RightArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINEEND : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDRIGHT : STB_TEXTEDIT_K_RIGHT) | k_mask); } else if (IsKeyPressed(ImGuiKey_UpArrow) && is_multiline) { if (io.KeyCtrl) SetScrollY(draw_window, ImMax(draw_window->Scroll.y - g.FontSize, 0.0f)); else state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTSTART : STB_TEXTEDIT_K_UP) | k_mask); } @@ -4481,7 +4825,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ { if (is_wordmove_key_down) state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT | STB_TEXTEDIT_K_SHIFT); - else if (is_osx && io.KeySuper && !io.KeyAlt && !io.KeyCtrl) + else if (is_osx && io.KeyCtrl && !io.KeyAlt && !io.KeySuper) state->OnKeyPressed(STB_TEXTEDIT_K_LINESTART | STB_TEXTEDIT_K_SHIFT); } state->OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask); @@ -4501,8 +4845,8 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ else if (!is_readonly) { unsigned int c = '\n'; // Insert new line - if (InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard)) - state->OnKeyPressed((int)c); + if (InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data)) + state->OnCharPressed(c); } } else if (is_cancel) @@ -4538,22 +4882,22 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ else if (is_cut || is_copy) { // Cut, Copy - if (io.SetClipboardTextFn) + if (g.PlatformIO.Platform_SetClipboardTextFn != NULL) { - const int ib = state->HasSelection() ? ImMin(state->Stb.select_start, state->Stb.select_end) : 0; - const int ie = state->HasSelection() ? ImMax(state->Stb.select_start, state->Stb.select_end) : state->CurLenW; - const int clipboard_data_len = ImTextCountUtf8BytesFromStr(state->TextW.Data + ib, state->TextW.Data + ie) + 1; - char* clipboard_data = (char*)IM_ALLOC(clipboard_data_len * sizeof(char)); - ImTextStrToUtf8(clipboard_data, clipboard_data_len, state->TextW.Data + ib, state->TextW.Data + ie); - SetClipboardText(clipboard_data); - MemFree(clipboard_data); + const int ib = state->HasSelection() ? ImMin(state->Stb->select_start, state->Stb->select_end) : 0; + const int ie = state->HasSelection() ? ImMax(state->Stb->select_start, state->Stb->select_end) : state->CurLenA; + + char backup = state->TextA.Data[ie]; + state->TextA.Data[ie] = 0; // A bit of a hack since SetClipboardText only takes null terminated strings + SetClipboardText(state->TextA.Data + ib); + state->TextA.Data[ie] = backup; } if (is_cut) { if (!state->HasSelection()) state->SelectAll(); state->CursorFollow = true; - stb_textedit_cut(state, &state->Stb); + stb_textedit_cut(state, state->Stb); } } else if (is_paste) @@ -4562,20 +4906,22 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ { // Filter pasted buffer const int clipboard_len = (int)strlen(clipboard); - ImWchar* clipboard_filtered = (ImWchar*)IM_ALLOC((clipboard_len + 1) * sizeof(ImWchar)); + char* clipboard_filtered = (char*)IM_ALLOC(clipboard_len + 1); int clipboard_filtered_len = 0; for (const char* s = clipboard; *s != 0; ) { unsigned int c; - s += ImTextCharFromUtf8(&c, s, NULL); - if (!InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data, ImGuiInputSource_Clipboard)) + int len = ImTextCharFromUtf8(&c, s, NULL); + s += len; + if (!InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data, true)) continue; - clipboard_filtered[clipboard_filtered_len++] = (ImWchar)c; + memcpy(clipboard_filtered + clipboard_filtered_len, s - len, len); + clipboard_filtered_len += len; } clipboard_filtered[clipboard_filtered_len] = 0; if (clipboard_filtered_len > 0) // If everything was filtered, ignore the pasting operation { - stb_textedit_paste(state, &state->Stb, clipboard_filtered, clipboard_filtered_len); + stb_textedit_paste(state, state->Stb, clipboard_filtered, clipboard_filtered_len); state->CursorFollow = true; } MemFree(clipboard_filtered); @@ -4601,34 +4947,21 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ apply_new_text = ""; apply_new_text_length = 0; value_changed = true; - STB_TEXTEDIT_CHARTYPE empty_string; - stb_textedit_replace(state, &state->Stb, &empty_string, 0); + IMSTB_TEXTEDIT_CHARTYPE empty_string; + stb_textedit_replace(state, state->Stb, &empty_string, 0); } else if (strcmp(buf, state->InitialTextA.Data) != 0) { - // Restore initial value. Only return true if restoring to the initial value changes the current buffer contents. - // Push records into the undo stack so we can CTRL+Z the revert operation itself apply_new_text = state->InitialTextA.Data; apply_new_text_length = state->InitialTextA.Size - 1; + + // Restore initial value. Only return true if restoring to the initial value changes the current buffer contents. + // Push records into the undo stack so we can CTRL+Z the revert operation itself value_changed = true; - ImVector w_text; - if (apply_new_text_length > 0) - { - w_text.resize(ImTextCountCharsFromUtf8(apply_new_text, apply_new_text + apply_new_text_length) + 1); - ImTextStrFromUtf8(w_text.Data, w_text.Size, apply_new_text, apply_new_text + apply_new_text_length); - } - stb_textedit_replace(state, &state->Stb, w_text.Data, (apply_new_text_length > 0) ? (w_text.Size - 1) : 0); + stb_textedit_replace(state, state->Stb, state->InitialTextA.Data, state->InitialTextA.Size - 1); } } - // Apply ASCII value - if (!is_readonly) - { - state->TextAIsValid = true; - state->TextA.resize(state->TextW.Size * 4 + 1); - ImTextStrToUtf8(state->TextA.Data, state->TextA.Size, state->TextW.Data, NULL); - } - // When using 'ImGuiInputTextFlags_EnterReturnsTrue' as a special case we reapply the live buffer back to the input buffer // before clearing ActiveId, even though strictly speaking it wasn't modified on this frame. // If we didn't do that, code like InputInt() with ImGuiInputTextFlags_EnterReturnsTrue would fail. @@ -4651,7 +4984,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // The reason we specify the usage semantic (Completion/History) is that Completion needs to disable keyboard TABBING at the moment. ImGuiInputTextFlags event_flag = 0; ImGuiKey event_key = ImGuiKey_None; - if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && Shortcut(ImGuiKey_Tab, id)) + if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && Shortcut(ImGuiKey_Tab, 0, id)) { event_flag = ImGuiInputTextFlags_CallbackCompletion; event_key = ImGuiKey_Tab; @@ -4683,6 +5016,10 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ callback_data.Flags = flags; callback_data.UserData = callback_user_data; + // FIXME-OPT: Undo stack reconcile needs a backup of the data until we rework API, see #7925 + state->CallbackTextBackup.resize(state->CurLenA + 1); + memcpy(state->CallbackTextBackup.Data, state->TextA.Data, state->CurLenA + 1); + char* callback_buf = is_readonly ? buf : state->TextA.Data; callback_data.EventKey = event_key; callback_data.Buf = callback_buf; @@ -4690,11 +5027,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ callback_data.BufSize = state->BufCapacityA; callback_data.BufDirty = false; - // We have to convert from wchar-positions to UTF-8-positions, which can be pretty slow (an incentive to ditch the ImWchar buffer, see https://github.com/nothings/stb/issues/188) - ImWchar* text = state->TextW.Data; - const int utf8_cursor_pos = callback_data.CursorPos = ImTextCountUtf8BytesFromStr(text, text + state->Stb.cursor); - const int utf8_selection_start = callback_data.SelectionStart = ImTextCountUtf8BytesFromStr(text, text + state->Stb.select_start); - const int utf8_selection_end = callback_data.SelectionEnd = ImTextCountUtf8BytesFromStr(text, text + state->Stb.select_end); + const int utf8_cursor_pos = callback_data.CursorPos = state->Stb->cursor; + const int utf8_selection_start = callback_data.SelectionStart = state->Stb->select_start; + const int utf8_selection_end = callback_data.SelectionEnd = state->Stb->select_end; // Call user code callback(&callback_data); @@ -4705,18 +5040,16 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ IM_ASSERT(callback_data.BufSize == state->BufCapacityA); IM_ASSERT(callback_data.Flags == flags); const bool buf_dirty = callback_data.BufDirty; - if (callback_data.CursorPos != utf8_cursor_pos || buf_dirty) { state->Stb.cursor = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.CursorPos); state->CursorFollow = true; } - if (callback_data.SelectionStart != utf8_selection_start || buf_dirty) { state->Stb.select_start = (callback_data.SelectionStart == callback_data.CursorPos) ? state->Stb.cursor : ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionStart); } - if (callback_data.SelectionEnd != utf8_selection_end || buf_dirty) { state->Stb.select_end = (callback_data.SelectionEnd == callback_data.SelectionStart) ? state->Stb.select_start : ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd); } + if (callback_data.CursorPos != utf8_cursor_pos || buf_dirty) { state->Stb->cursor = callback_data.CursorPos; state->CursorFollow = true; } + if (callback_data.SelectionStart != utf8_selection_start || buf_dirty) { state->Stb->select_start = (callback_data.SelectionStart == callback_data.CursorPos) ? state->Stb->cursor : callback_data.SelectionStart; } + if (callback_data.SelectionEnd != utf8_selection_end || buf_dirty) { state->Stb->select_end = (callback_data.SelectionEnd == callback_data.SelectionStart) ? state->Stb->select_start : callback_data.SelectionEnd; } if (buf_dirty) { - IM_ASSERT((flags & ImGuiInputTextFlags_ReadOnly) == 0); + // Callback may update buffer and thus set buf_dirty even in read-only mode. IM_ASSERT(callback_data.BufTextLen == (int)strlen(callback_data.Buf)); // You need to maintain BufTextLen if you change the text! InputTextReconcileUndoStateAfterUserCallback(state, callback_data.Buf, callback_data.BufTextLen); // FIXME: Move the rest of this block inside function and rename to InputTextReconcileStateAfterUserCallback() ? - if (callback_data.BufTextLen > backup_current_text_length && is_resizable) - state->TextW.resize(state->TextW.Size + (callback_data.BufTextLen - backup_current_text_length)); // Worse case scenario resize - state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, state->TextW.Size, callback_data.Buf, NULL); state->CurLenA = callback_data.BufTextLen; // Assume correct length and valid UTF-8 from user, saves us an extra strlen() + state->TextA.Size = state->CurLenA + 1; state->CursorAnimReset(); } } @@ -4748,9 +5081,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // Copy result to user buffer. This can currently only happen when (g.ActiveId == id) if (apply_new_text != NULL) { - // We cannot test for 'backup_current_text_length != apply_new_text_length' here because we have no guarantee that the size - // of our owned buffer matches the size of the string object held by the user, and by design we allow InputText() to be used - // without any storage on user's side. + //// We cannot test for 'backup_current_text_length != apply_new_text_length' here because we have no guarantee that the size + //// of our owned buffer matches the size of the string object held by the user, and by design we allow InputText() to be used + //// without any storage on user's side. IM_ASSERT(apply_new_text_length >= 0); if (is_resizable) { @@ -4784,7 +5117,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // Render frame if (!is_multiline) { - RenderNavHighlight(frame_bb, id); + RenderNavCursor(frame_bb, id); RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding); } @@ -4819,52 +5152,40 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // - Measure text height (for scrollbar) // We are attempting to do most of that in **one main pass** to minimize the computation cost (non-negligible for large amount of text) + 2nd pass for selection rendering (we could merge them by an extra refactoring effort) // FIXME: This should occur on buf_display but we'd need to maintain cursor/select_start/select_end for UTF-8. - const ImWchar* text_begin = state->TextW.Data; + const char* text_begin = state->TextA.Data; + const char* text_end = text_begin + state->CurLenA; ImVec2 cursor_offset, select_start_offset; { - // Find lines numbers straddling 'cursor' (slot 0) and 'select_start' (slot 1) positions. - const ImWchar* searches_input_ptr[2] = { NULL, NULL }; - int searches_result_line_no[2] = { -1000, -1000 }; - int searches_remaining = 0; - if (render_cursor) - { - searches_input_ptr[0] = text_begin + state->Stb.cursor; - searches_result_line_no[0] = -1; - searches_remaining++; - } - if (render_selection) + // Find lines numbers straddling cursor and selection min position + int cursor_line_no = render_cursor ? -1 : -1000; + int selmin_line_no = render_selection ? -1 : -1000; + const char* cursor_ptr = render_cursor ? text_begin + state->Stb->cursor : NULL; + const char* selmin_ptr = render_selection ? text_begin + ImMin(state->Stb->select_start, state->Stb->select_end) : NULL; + + // Count lines and find line number for cursor and selection ends + int line_count = 1; + if (is_multiline) { - searches_input_ptr[1] = text_begin + ImMin(state->Stb.select_start, state->Stb.select_end); - searches_result_line_no[1] = -1; - searches_remaining++; - } - - // Iterate all lines to find our line numbers - // In multi-line mode, we never exit the loop until all lines are counted, so add one extra to the searches_remaining counter. - searches_remaining += is_multiline ? 1 : 0; - int line_count = 0; - //for (const ImWchar* s = text_begin; (s = (const ImWchar*)wcschr((const wchar_t*)s, (wchar_t)'\n')) != NULL; s++) // FIXME-OPT: Could use this when wchar_t are 16-bit - for (const ImWchar* s = text_begin; *s != 0; s++) - if (*s == '\n') + for (const char* s = text_begin; (s = (const char*)memchr(s, '\n', (size_t)(text_end - s))) != NULL; s++) { + if (cursor_line_no == -1 && s >= cursor_ptr) { cursor_line_no = line_count; } + if (selmin_line_no == -1 && s >= selmin_ptr) { selmin_line_no = line_count; } line_count++; - if (searches_result_line_no[0] == -1 && s >= searches_input_ptr[0]) { searches_result_line_no[0] = line_count; if (--searches_remaining <= 0) break; } - if (searches_result_line_no[1] == -1 && s >= searches_input_ptr[1]) { searches_result_line_no[1] = line_count; if (--searches_remaining <= 0) break; } } - line_count++; - if (searches_result_line_no[0] == -1) - searches_result_line_no[0] = line_count; - if (searches_result_line_no[1] == -1) - searches_result_line_no[1] = line_count; + } + if (cursor_line_no == -1) + cursor_line_no = line_count; + if (selmin_line_no == -1) + selmin_line_no = line_count; // Calculate 2d position by finding the beginning of the line and measuring distance - cursor_offset.x = InputTextCalcTextSizeW(&g, ImStrbolW(searches_input_ptr[0], text_begin), searches_input_ptr[0]).x; - cursor_offset.y = searches_result_line_no[0] * g.FontSize; - if (searches_result_line_no[1] >= 0) + cursor_offset.x = InputTextCalcTextSize(&g, ImStrbol(cursor_ptr, text_begin), cursor_ptr).x; + cursor_offset.y = cursor_line_no * g.FontSize; + if (selmin_line_no >= 0) { - select_start_offset.x = InputTextCalcTextSizeW(&g, ImStrbolW(searches_input_ptr[1], text_begin), searches_input_ptr[1]).x; - select_start_offset.y = searches_result_line_no[1] * g.FontSize; + select_start_offset.x = InputTextCalcTextSize(&g, ImStrbol(selmin_ptr, text_begin), selmin_ptr).x; + select_start_offset.y = selmin_line_no * g.FontSize; } // Store text height (note that we haven't calculated text width at all, see GitHub issues #383, #1224) @@ -4880,14 +5201,14 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ { const float scroll_increment_x = inner_size.x * 0.25f; const float visible_width = inner_size.x - style.FramePadding.x; - if (cursor_offset.x < state->ScrollX) - state->ScrollX = IM_FLOOR(ImMax(0.0f, cursor_offset.x - scroll_increment_x)); - else if (cursor_offset.x - visible_width >= state->ScrollX) - state->ScrollX = IM_FLOOR(cursor_offset.x - visible_width + scroll_increment_x); + if (cursor_offset.x < state->Scroll.x) + state->Scroll.x = IM_TRUNC(ImMax(0.0f, cursor_offset.x - scroll_increment_x)); + else if (cursor_offset.x - visible_width >= state->Scroll.x) + state->Scroll.x = IM_TRUNC(cursor_offset.x - visible_width + scroll_increment_x); } else { - state->ScrollX = 0.0f; + state->Scroll.y = 0.0f; } // Vertical scroll @@ -4908,43 +5229,41 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ } // Draw selection - const ImVec2 draw_scroll = ImVec2(state->ScrollX, 0.0f); + const ImVec2 draw_scroll = ImVec2(state->Scroll.x, 0.0f); if (render_selection) { - const ImWchar* text_selected_begin = text_begin + ImMin(state->Stb.select_start, state->Stb.select_end); - const ImWchar* text_selected_end = text_begin + ImMax(state->Stb.select_start, state->Stb.select_end); + const char* text_selected_begin = text_begin + ImMin(state->Stb->select_start, state->Stb->select_end); + const char* text_selected_end = text_begin + ImMax(state->Stb->select_start, state->Stb->select_end); ImU32 bg_color = GetColorU32(ImGuiCol_TextSelectedBg, render_cursor ? 1.0f : 0.6f); // FIXME: current code flow mandate that render_cursor is always true here, we are leaving the transparent one for tests. float bg_offy_up = is_multiline ? 0.0f : -1.0f; // FIXME: those offsets should be part of the style? they don't play so well with multi-line selection. float bg_offy_dn = is_multiline ? 0.0f : 2.0f; ImVec2 rect_pos = draw_pos + select_start_offset - draw_scroll; - for (const ImWchar* p = text_selected_begin; p < text_selected_end; ) + for (const char* p = text_selected_begin; p < text_selected_end; ) { if (rect_pos.y > clip_rect.w + g.FontSize) break; if (rect_pos.y < clip_rect.y) { - //p = (const ImWchar*)wmemchr((const wchar_t*)p, '\n', text_selected_end - p); // FIXME-OPT: Could use this when wchar_t are 16-bit - //p = p ? p + 1 : text_selected_end; - while (p < text_selected_end) - if (*p++ == '\n') - break; + p = (const char*)memchr((void*)p, '\n', text_selected_end - p); + p = p ? p + 1 : text_selected_end; } else { - ImVec2 rect_size = InputTextCalcTextSizeW(&g, p, text_selected_end, &p, NULL, true); - if (rect_size.x <= 0.0f) rect_size.x = IM_FLOOR(g.Font->GetCharAdvance((ImWchar)' ') * 0.50f); // So we can see selected empty lines + ImVec2 rect_size = InputTextCalcTextSize(&g, p, text_selected_end, &p, NULL, true); + if (rect_size.x <= 0.0f) rect_size.x = IM_TRUNC(g.Font->GetCharAdvance((ImWchar)' ') * 0.50f); // So we can see selected empty lines ImRect rect(rect_pos + ImVec2(0.0f, bg_offy_up - g.FontSize), rect_pos + ImVec2(rect_size.x, bg_offy_dn)); rect.ClipWith(clip_rect); if (rect.Overlaps(clip_rect)) draw_window->DrawList->AddRectFilled(rect.Min, rect.Max, bg_color); + rect_pos.x = draw_pos.x - draw_scroll.x; } - rect_pos.x = draw_pos.x - draw_scroll.x; rect_pos.y += g.FontSize; } } // We test for 'buf_display_max_length' as a way to avoid some pathological cases (e.g. single-line 1 MB string) which would make ImDrawList crash. + // FIXME-OPT: Multiline could submit a smaller amount of contents to AddText() since we already iterated through it. if (is_multiline || (buf_display_end - buf_display) < buf_display_max_length) { ImU32 col = GetColorU32(is_displaying_hint ? ImGuiCol_TextDisabled : ImGuiCol_Text); @@ -4956,7 +5275,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ { state->CursorAnim += io.DeltaTime; bool cursor_is_visible = (!g.IO.ConfigInputTextCursorBlink) || (state->CursorAnim <= 0.0f) || ImFmod(state->CursorAnim, 1.20f) <= 0.80f; - ImVec2 cursor_screen_pos = ImFloor(draw_pos + cursor_offset - draw_scroll); + ImVec2 cursor_screen_pos = ImTrunc(draw_pos + cursor_offset - draw_scroll); ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y - g.FontSize + 0.5f, cursor_screen_pos.x + 1.0f, cursor_screen_pos.y - 1.5f); if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect)) draw_window->DrawList->AddLine(cursor_screen_rect.Min, cursor_screen_rect.GetBL(), GetColorU32(ImGuiCol_Text)); @@ -4992,19 +5311,19 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (is_multiline) { - // For focus requests to work on our multiline we need to ensure our child ItemAdd() call specifies the ImGuiItemFlags_Inputable (ref issue #4761)... + // For focus requests to work on our multiline we need to ensure our child ItemAdd() call specifies the ImGuiItemFlags_Inputable (see #4761, #7870)... Dummy(ImVec2(text_size.x, text_size.y + style.FramePadding.y)); - g.NextItemData.ItemFlags |= ImGuiItemFlags_Inputable | ImGuiItemFlags_NoTabStop; + g.NextItemData.ItemFlags |= (ImGuiItemFlags)ImGuiItemFlags_Inputable | ImGuiItemFlags_NoTabStop; EndChild(); item_data_backup.StatusFlags |= (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredWindow); // ...and then we need to undo the group overriding last item data, which gets a bit messy as EndGroup() tries to forward scrollbar being active... // FIXME: This quite messy/tricky, should attempt to get rid of the child window. EndGroup(); - if (g.LastItemData.ID == 0) + if (g.LastItemData.ID == 0 || g.LastItemData.ID != GetWindowScrollbarID(draw_window, ImGuiAxis_Y)) { g.LastItemData.ID = id; - g.LastItemData.InFlags = item_data_backup.InFlags; + g.LastItemData.ItemFlags = item_data_backup.ItemFlags; g.LastItemData.StatusFlags = item_data_backup.StatusFlags; } } @@ -5019,7 +5338,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (label_size.x > 0) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); - if (value_changed && !(flags & ImGuiInputTextFlags_NoMarkEdited)) + if (value_changed) MarkItemEdited(id); IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Inputable); @@ -5033,27 +5352,26 @@ void ImGui::DebugNodeInputTextState(ImGuiInputTextState* state) { #ifndef IMGUI_DISABLE_DEBUG_TOOLS ImGuiContext& g = *GImGui; - ImStb::STB_TexteditState* stb_state = &state->Stb; + ImStb::STB_TexteditState* stb_state = state->Stb; ImStb::StbUndoState* undo_state = &stb_state->undostate; Text("ID: 0x%08X, ActiveID: 0x%08X", state->ID, g.ActiveId); DebugLocateItemOnHover(state->ID); - Text("CurLenW: %d, CurLenA: %d, Cursor: %d, Selection: %d..%d", state->CurLenW, state->CurLenA, stb_state->cursor, stb_state->select_start, stb_state->select_end); + Text("CurLenA: %d, Cursor: %d, Selection: %d..%d", state->CurLenA, stb_state->cursor, stb_state->select_start, stb_state->select_end); Text("has_preferred_x: %d (%.2f)", stb_state->has_preferred_x, stb_state->preferred_x); Text("undo_point: %d, redo_point: %d, undo_char_point: %d, redo_char_point: %d", undo_state->undo_point, undo_state->redo_point, undo_state->undo_char_point, undo_state->redo_char_point); - if (BeginChild("undopoints", ImVec2(0.0f, GetTextLineHeight() * 15), true)) // Visualize undo state + if (BeginChild("undopoints", ImVec2(0.0f, GetTextLineHeight() * 10), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeY)) // Visualize undo state { PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); - for (int n = 0; n < STB_TEXTEDIT_UNDOSTATECOUNT; n++) + for (int n = 0; n < IMSTB_TEXTEDIT_UNDOSTATECOUNT; n++) { ImStb::StbUndoRecord* undo_rec = &undo_state->undo_rec[n]; const char undo_rec_type = (n < undo_state->undo_point) ? 'u' : (n >= undo_state->redo_point) ? 'r' : ' '; if (undo_rec_type == ' ') BeginDisabled(); - char buf[64] = ""; - if (undo_rec_type != ' ' && undo_rec->char_storage != -1) - ImTextStrToUtf8(buf, IM_ARRAYSIZE(buf), undo_state->undo_char + undo_rec->char_storage, undo_state->undo_char + undo_rec->char_storage + undo_rec->insert_length); - Text("%c [%02d] where %03d, insert %03d, delete %03d, char_storage %03d \"%s\"", - undo_rec_type, n, undo_rec->where, undo_rec->insert_length, undo_rec->delete_length, undo_rec->char_storage, buf); + const int buf_preview_len = (undo_rec_type != ' ' && undo_rec->char_storage != -1) ? undo_rec->insert_length : 0; + const char* buf_preview_str = undo_state->undo_char + undo_rec->char_storage; + Text("%c [%02d] where %03d, insert %03d, delete %03d, char_storage %03d \"%.*s\"", + undo_rec_type, n, undo_rec->where, undo_rec->insert_length, undo_rec->delete_length, undo_rec->char_storage, buf_preview_len, buf_preview_str); if (undo_rec_type == ' ') EndDisabled(); } @@ -5125,10 +5443,8 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const float square_sz = GetFrameHeight(); - const float w_full = CalcItemWidth(); - const float w_button = (flags & ImGuiColorEditFlags_NoSmallPreview) ? 0.0f : (square_sz + style.ItemInnerSpacing.x); - const float w_inputs = w_full - w_button; const char* label_display_end = FindRenderedTextEnd(label); + float w_full = CalcItemWidth(); g.NextItemData.ClearFlags(); BeginGroup(); @@ -5162,6 +5478,9 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag const bool alpha = (flags & ImGuiColorEditFlags_NoAlpha) == 0; const bool hdr = (flags & ImGuiColorEditFlags_HDR) != 0; const int components = alpha ? 4 : 3; + const float w_button = (flags & ImGuiColorEditFlags_NoSmallPreview) ? 0.0f : (square_sz + style.ItemInnerSpacing.x); + const float w_inputs = ImMax(w_full - w_button, 1.0f); + w_full = w_inputs + w_button; // Convert to the formats we need float f[4] = { col[0], col[1], col[2], alpha ? col[3] : 1.0f }; @@ -5185,10 +5504,9 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag if ((flags & (ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV)) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0) { // RGB/HSV 0..255 Sliders - const float w_item_one = ImMax(1.0f, IM_FLOOR((w_inputs - (style.ItemInnerSpacing.x) * (components - 1)) / (float)components)); - const float w_item_last = ImMax(1.0f, IM_FLOOR(w_inputs - (w_item_one + style.ItemInnerSpacing.x) * (components - 1))); + const float w_items = w_inputs - style.ItemInnerSpacing.x * (components - 1); - const bool hide_prefix = (w_item_one <= CalcTextSize((flags & ImGuiColorEditFlags_Float) ? "M:0.000" : "M:000").x); + const bool hide_prefix = (IM_TRUNC(w_items / components) <= CalcTextSize((flags & ImGuiColorEditFlags_Float) ? "M:0.000" : "M:000").x); static const char* ids[4] = { "##X", "##Y", "##Z", "##W" }; static const char* fmt_table_int[3][4] = { @@ -5204,11 +5522,14 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag }; const int fmt_idx = hide_prefix ? 0 : (flags & ImGuiColorEditFlags_DisplayHSV) ? 2 : 1; + float prev_split = 0.0f; for (int n = 0; n < components; n++) { if (n > 0) SameLine(0, style.ItemInnerSpacing.x); - SetNextItemWidth((n + 1 < components) ? w_item_one : w_item_last); + float next_split = IM_TRUNC(w_items * (n + 1) / components); + SetNextItemWidth(ImMax(next_split - prev_split, 1.0f)); + prev_split = next_split; // FIXME: When ImGuiColorEditFlags_HDR flag is passed HS values snap in weird ways when SV values go below 0. if (flags & ImGuiColorEditFlags_Float) @@ -5233,7 +5554,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag else ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", ImClamp(i[0], 0, 255), ImClamp(i[1], 0, 255), ImClamp(i[2], 0, 255)); SetNextItemWidth(w_inputs); - if (InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase)) + if (InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsUppercase)) { value_changed = true; char* p = buf; @@ -5331,7 +5652,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag // Drag and Drop Target // NB: The flag test is merely an optional micro-optimization, BeginDragDropTarget() does the same test. - if ((g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredRect) && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropTarget()) + if ((g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredRect) && !(g.LastItemData.ItemFlags & ImGuiItemFlags_ReadOnly) && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropTarget()) { bool accepted_drag_drop = false; if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F)) @@ -5396,6 +5717,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl ImGuiIO& io = g.IO; const float width = CalcItemWidth(); + const bool is_readonly = ((g.NextItemData.ItemFlags | g.CurrentItemFlags) & ImGuiItemFlags_ReadOnly) != 0; g.NextItemData.ClearFlags(); PushID(label); @@ -5430,7 +5752,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl float sv_picker_size = ImMax(bars_width * 1, width - (alpha_bar ? 2 : 1) * (bars_width + style.ItemInnerSpacing.x)); // Saturation/Value picking box float bar0_pos_x = picker_pos.x + sv_picker_size + style.ItemInnerSpacing.x; float bar1_pos_x = bar0_pos_x + bars_width + style.ItemInnerSpacing.x; - float bars_triangles_half_sz = IM_FLOOR(bars_width * 0.20f); + float bars_triangles_half_sz = IM_TRUNC(bars_width * 0.20f); float backup_initial_col[4]; memcpy(backup_initial_col, col, components * sizeof(float)); @@ -5466,7 +5788,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl { // Hue wheel + SV triangle logic InvisibleButton("hsv", ImVec2(sv_picker_size + style.ItemInnerSpacing.x + bars_width, sv_picker_size)); - if (IsItemActive()) + if (IsItemActive() && !is_readonly) { ImVec2 initial_off = g.IO.MouseClickedPos[0] - wheel_center; ImVec2 current_off = g.IO.MousePos - wheel_center; @@ -5501,7 +5823,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl { // SV rectangle logic InvisibleButton("sv", ImVec2(sv_picker_size, sv_picker_size)); - if (IsItemActive()) + if (IsItemActive() && !is_readonly) { S = ImSaturate((io.MousePos.x - picker_pos.x) / (sv_picker_size - 1)); V = 1.0f - ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size - 1)); @@ -5514,7 +5836,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl // Hue bar logic SetCursorScreenPos(ImVec2(bar0_pos_x, picker_pos.y)); InvisibleButton("hue", ImVec2(bars_width, sv_picker_size)); - if (IsItemActive()) + if (IsItemActive() && !is_readonly) { H = ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size - 1)); value_changed = value_changed_h = true; @@ -5598,7 +5920,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl if ((flags & ImGuiColorEditFlags_NoInputs) == 0) { PushItemWidth((alpha_bar ? bar1_pos_x : bar0_pos_x) + bars_width - picker_pos.x); - ImGuiColorEditFlags sub_flags_to_forward = ImGuiColorEditFlags_DataTypeMask_ | ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoSmallPreview | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf; + ImGuiColorEditFlags sub_flags_to_forward = ImGuiColorEditFlags_DataTypeMask_ | ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoSmallPreview | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf; ImGuiColorEditFlags sub_flags = (flags & sub_flags_to_forward) | ImGuiColorEditFlags_NoPicker; if (flags & ImGuiColorEditFlags_DisplayRGB || (flags & ImGuiColorEditFlags_DisplayMask_) == 0) if (ColorEdit4("##rgb", col, sub_flags | ImGuiColorEditFlags_DisplayRGB)) @@ -5720,7 +6042,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl } // Render cursor/preview circle (clamp S/V within 0..1 range because floating points colors may lead HSV values to be out of range) - float sv_cursor_rad = value_changed_sv ? 10.0f : 6.0f; + float sv_cursor_rad = value_changed_sv ? wheel_thickness * 0.55f : wheel_thickness * 0.40f; int sv_cursor_segments = draw_list->_CalcCircleAutoSegmentCount(sv_cursor_rad); // Lock segment count so the +1 one matches others. draw_list->AddCircleFilled(sv_cursor_pos, sv_cursor_rad, user_col32_striped_of_alpha, sv_cursor_segments); draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad + 1, col_midgrey, sv_cursor_segments); @@ -5806,7 +6128,7 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl else window->DrawList->AddRectFilled(bb_inner.Min, bb_inner.Max, GetColorU32(col_source), rounding); } - RenderNavHighlight(bb, id); + RenderNavCursor(bb, id); if ((flags & ImGuiColorEditFlags_NoBorder) == 0) { if (g.Style.FrameBorderSize > 0.0f) @@ -5897,8 +6219,9 @@ void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags) bool allow_opt_datatype = !(flags & ImGuiColorEditFlags_DataTypeMask_); if ((!allow_opt_inputs && !allow_opt_datatype) || !BeginPopup("context")) return; + ImGuiContext& g = *GImGui; - g.LockMarkEdited++; + PushItemFlag(ImGuiItemFlags_NoMarkEdited, true); ImGuiColorEditFlags opts = g.ColorEditOptions; if (allow_opt_inputs) { @@ -5940,8 +6263,8 @@ void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags) } g.ColorEditOptions = opts; + PopItemFlag(); EndPopup(); - g.LockMarkEdited--; } void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags) @@ -5950,8 +6273,9 @@ void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags fl bool allow_opt_alpha_bar = !(flags & ImGuiColorEditFlags_NoAlpha) && !(flags & ImGuiColorEditFlags_AlphaBar); if ((!allow_opt_picker && !allow_opt_alpha_bar) || !BeginPopup("context")) return; + ImGuiContext& g = *GImGui; - g.LockMarkEdited++; + PushItemFlag(ImGuiItemFlags_NoMarkEdited, true); if (allow_opt_picker) { ImVec2 picker_size(g.FontSize * 8, ImMax(g.FontSize * 8 - (GetFrameHeight() + g.Style.ItemInnerSpacing.x), 1.0f)); // FIXME: Picker size copied from main picker function @@ -5980,8 +6304,8 @@ void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags fl if (allow_opt_picker) Separator(); CheckboxFlags("Alpha Bar", &g.ColorEditOptions, ImGuiColorEditFlags_AlphaBar); } + PopItemFlag(); EndPopup(); - g.LockMarkEdited--; } //------------------------------------------------------------------------- @@ -6022,7 +6346,8 @@ bool ImGui::TreeNode(const char* label) ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; - return TreeNodeBehavior(window->GetID(label), 0, label, NULL); + ImGuiID id = window->GetID(label); + return TreeNodeBehavior(id, ImGuiTreeNodeFlags_None, label, NULL); } bool ImGui::TreeNodeV(const char* str_id, const char* fmt, va_list args) @@ -6040,8 +6365,8 @@ bool ImGui::TreeNodeEx(const char* label, ImGuiTreeNodeFlags flags) ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; - - return TreeNodeBehavior(window->GetID(label), flags, label, NULL); + ImGuiID id = window->GetID(label); + return TreeNodeBehavior(id, flags, label, NULL); } bool ImGui::TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) @@ -6068,9 +6393,10 @@ bool ImGui::TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char if (window->SkipItems) return false; + ImGuiID id = window->GetID(str_id); const char* label, *label_end; ImFormatStringToTempBufferV(&label, &label_end, fmt, args); - return TreeNodeBehavior(window->GetID(str_id), flags, label, label_end); + return TreeNodeBehavior(id, flags, label, label_end); } bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) @@ -6079,44 +6405,52 @@ bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char if (window->SkipItems) return false; + ImGuiID id = window->GetID(ptr_id); const char* label, *label_end; ImFormatStringToTempBufferV(&label, &label_end, fmt, args); - return TreeNodeBehavior(window->GetID(ptr_id), flags, label, label_end); + return TreeNodeBehavior(id, flags, label, label_end); +} + +bool ImGui::TreeNodeGetOpen(ImGuiID storage_id) +{ + ImGuiContext& g = *GImGui; + ImGuiStorage* storage = g.CurrentWindow->DC.StateStorage; + return storage->GetInt(storage_id, 0) != 0; } -void ImGui::TreeNodeSetOpen(ImGuiID id, bool open) +void ImGui::TreeNodeSetOpen(ImGuiID storage_id, bool open) { ImGuiContext& g = *GImGui; ImGuiStorage* storage = g.CurrentWindow->DC.StateStorage; - storage->SetInt(id, open ? 1 : 0); + storage->SetInt(storage_id, open ? 1 : 0); } -bool ImGui::TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags) +bool ImGui::TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags) { if (flags & ImGuiTreeNodeFlags_Leaf) return true; - // We only write to the tree storage if the user clicks (or explicitly use the SetNextItemOpen function) + // We only write to the tree storage if the user clicks, or explicitly use the SetNextItemOpen function ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; ImGuiStorage* storage = window->DC.StateStorage; bool is_open; - if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasOpen) + if (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasOpen) { if (g.NextItemData.OpenCond & ImGuiCond_Always) { is_open = g.NextItemData.OpenVal; - TreeNodeSetOpen(id, is_open); + TreeNodeSetOpen(storage_id, is_open); } else { // We treat ImGuiCond_Once and ImGuiCond_FirstUseEver the same because tree node state are not saved persistently. - const int stored_value = storage->GetInt(id, -1); + const int stored_value = storage->GetInt(storage_id, -1); if (stored_value == -1) { is_open = g.NextItemData.OpenVal; - TreeNodeSetOpen(id, is_open); + TreeNodeSetOpen(storage_id, is_open); } else { @@ -6126,7 +6460,7 @@ bool ImGui::TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags) } else { - is_open = storage->GetInt(id, (flags & ImGuiTreeNodeFlags_DefaultOpen) ? 1 : 0) != 0; + is_open = storage->GetInt(storage_id, (flags & ImGuiTreeNodeFlags_DefaultOpen) ? 1 : 0) != 0; } // When logging is enabled, we automatically expand tree nodes (but *NOT* collapsing headers.. seems like sensible behavior). @@ -6137,6 +6471,23 @@ bool ImGui::TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags) return is_open; } +// Store ImGuiTreeNodeStackData for just submitted node. +// Currently only supports 32 level deep and we are fine with (1 << Depth) overflowing into a zero, easy to increase. +static void TreeNodeStoreStackData(ImGuiTreeNodeFlags flags) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + + g.TreeNodeStack.resize(g.TreeNodeStack.Size + 1); + ImGuiTreeNodeStackData* tree_node_data = &g.TreeNodeStack.back(); + tree_node_data->ID = g.LastItemData.ID; + tree_node_data->TreeFlags = flags; + tree_node_data->ItemFlags = g.LastItemData.ItemFlags; + tree_node_data->NavRect = g.LastItemData.NavRect; + window->DC.TreeHasStackDataDepthMask |= (1 << window->DC.TreeDepth); +} + +// When using public API, currently 'id == storage_id' is always true, but we separate the values to facilitate advanced user code doing storage queries outside of UI loop. bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end) { ImGuiWindow* window = GetCurrentWindow(); @@ -6152,35 +6503,53 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l label_end = FindRenderedTextEnd(label); const ImVec2 label_size = CalcTextSize(label, label_end, false); + const float text_offset_x = g.FontSize + (display_frame ? padding.x * 3 : padding.x * 2); // Collapsing arrow width + Spacing + const float text_offset_y = ImMax(padding.y, window->DC.CurrLineTextBaseOffset); // Latch before ItemSize changes it + const float text_width = g.FontSize + label_size.x + padding.x * 2; // Include collapsing arrow + // We vertically grow up to current line height up the typical widget height. const float frame_height = ImMax(ImMin(window->DC.CurrLineSize.y, g.FontSize + style.FramePadding.y * 2), label_size.y + padding.y * 2); + const bool span_all_columns = (flags & ImGuiTreeNodeFlags_SpanAllColumns) != 0 && (g.CurrentTable != NULL); ImRect frame_bb; - frame_bb.Min.x = (flags & ImGuiTreeNodeFlags_SpanFullWidth) ? window->WorkRect.Min.x : window->DC.CursorPos.x; + frame_bb.Min.x = span_all_columns ? window->ParentWorkRect.Min.x : (flags & ImGuiTreeNodeFlags_SpanFullWidth) ? window->WorkRect.Min.x : window->DC.CursorPos.x; frame_bb.Min.y = window->DC.CursorPos.y; - frame_bb.Max.x = window->WorkRect.Max.x; + frame_bb.Max.x = span_all_columns ? window->ParentWorkRect.Max.x : (flags & ImGuiTreeNodeFlags_SpanTextWidth) ? window->DC.CursorPos.x + text_width + padding.x : window->WorkRect.Max.x; frame_bb.Max.y = window->DC.CursorPos.y + frame_height; if (display_frame) { - // Framed header expand a little outside the default padding, to the edge of InnerClipRect - // (FIXME: May remove this at some point and make InnerClipRect align with WindowPadding.x instead of WindowPadding.x*0.5f) - frame_bb.Min.x -= IM_FLOOR(window->WindowPadding.x * 0.5f - 1.0f); - frame_bb.Max.x += IM_FLOOR(window->WindowPadding.x * 0.5f); + const float outer_extend = IM_TRUNC(window->WindowPadding.x * 0.5f); // Framed header expand a little outside of current limits + frame_bb.Min.x -= outer_extend; + frame_bb.Max.x += outer_extend; } - const float text_offset_x = g.FontSize + (display_frame ? padding.x * 3 : padding.x * 2); // Collapser arrow width + Spacing - const float text_offset_y = ImMax(padding.y, window->DC.CurrLineTextBaseOffset); // Latch before ItemSize changes it - const float text_width = g.FontSize + (label_size.x > 0.0f ? label_size.x + padding.x * 2 : 0.0f); // Include collapser ImVec2 text_pos(window->DC.CursorPos.x + text_offset_x, window->DC.CursorPos.y + text_offset_y); ItemSize(ImVec2(text_width, frame_height), padding.y); // For regular tree nodes, we arbitrary allow to click past 2 worth of ItemSpacing ImRect interact_bb = frame_bb; - if (!display_frame && (flags & (ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_SpanFullWidth)) == 0) - interact_bb.Max.x = frame_bb.Min.x + text_width + style.ItemSpacing.x * 2.0f; + if ((flags & (ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_SpanTextWidth | ImGuiTreeNodeFlags_SpanAllColumns)) == 0) + interact_bb.Max.x = frame_bb.Min.x + text_width + (label_size.x > 0.0f ? style.ItemSpacing.x * 2.0f : 0.0f); // Compute open and multi-select states before ItemAdd() as it clear NextItem data. - bool is_open = TreeNodeUpdateNextOpen(id, flags); - bool item_add = ItemAdd(interact_bb, id); + ImGuiID storage_id = (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasStorageID) ? g.NextItemData.StorageId : id; + bool is_open = TreeNodeUpdateNextOpen(storage_id, flags); + + bool is_visible; + if (span_all_columns) + { + // Modify ClipRect for the ItemAdd(), faster than doing a PushColumnsBackground/PushTableBackgroundChannel for every Selectable.. + const float backup_clip_rect_min_x = window->ClipRect.Min.x; + const float backup_clip_rect_max_x = window->ClipRect.Max.x; + window->ClipRect.Min.x = window->ParentWorkRect.Min.x; + window->ClipRect.Max.x = window->ParentWorkRect.Max.x; + is_visible = ItemAdd(interact_bb, id); + window->ClipRect.Min.x = backup_clip_rect_min_x; + window->ClipRect.Max.x = backup_clip_rect_max_x; + } + else + { + is_visible = ItemAdd(interact_bb, id); + } g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HasDisplayRect; g.LastItemData.DisplayRect = frame_bb; @@ -6188,29 +6557,34 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l // Store data for the current depth to allow returning to this node from any child item. // For this purpose we essentially compare if g.NavIdIsAlive went from 0 to 1 between TreeNode() and TreePop(). // It will become tempting to enable ImGuiTreeNodeFlags_NavLeftJumpsBackHere by default or move it to ImGuiStyle. - // Currently only supports 32 level deep and we are fine with (1 << Depth) overflowing into a zero, easy to increase. - if (is_open && !g.NavIdIsAlive && (flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) - if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet()) - { - g.NavTreeNodeStack.resize(g.NavTreeNodeStack.Size + 1); - ImGuiNavTreeNodeData* nav_tree_node_data = &g.NavTreeNodeStack.back(); - nav_tree_node_data->ID = id; - nav_tree_node_data->InFlags = g.LastItemData.InFlags; - nav_tree_node_data->NavRect = g.LastItemData.NavRect; - window->DC.TreeJumpToParentOnPopMask |= (1 << window->DC.TreeDepth); - } + bool store_tree_node_stack_data = false; + if (!(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) + { + if ((flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && is_open && !g.NavIdIsAlive) + if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet()) + store_tree_node_stack_data = true; + } const bool is_leaf = (flags & ImGuiTreeNodeFlags_Leaf) != 0; - if (!item_add) + if (!is_visible) { + if (store_tree_node_stack_data && is_open) + TreeNodeStoreStackData(flags); // Call before TreePushOverrideID() if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) TreePushOverrideID(id); IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0)); return is_open; } + if (span_all_columns) + { + TablePushBackgroundChannel(); + g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HasClipRect; + g.LastItemData.ClipRect = window->ClipRect; + } + ImGuiButtonFlags button_flags = ImGuiTreeNodeFlags_None; - if ((flags & ImGuiTreeNodeFlags_AllowOverlap) || (g.LastItemData.InFlags & ImGuiItemFlags_AllowOverlap)) + if ((flags & ImGuiTreeNodeFlags_AllowOverlap) || (g.LastItemData.ItemFlags & ImGuiItemFlags_AllowOverlap)) button_flags |= ImGuiButtonFlags_AllowOverlap; if (!is_leaf) button_flags |= ImGuiButtonFlags_PressedOnDragDropHold; @@ -6221,8 +6595,10 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l const float arrow_hit_x1 = (text_pos.x - text_offset_x) - style.TouchExtraPadding.x; const float arrow_hit_x2 = (text_pos.x - text_offset_x) + (g.FontSize + padding.x * 2.0f) + style.TouchExtraPadding.x; const bool is_mouse_x_over_arrow = (g.IO.MousePos.x >= arrow_hit_x1 && g.IO.MousePos.x < arrow_hit_x2); - if (window != g.HoveredWindow || !is_mouse_x_over_arrow) - button_flags |= ImGuiButtonFlags_NoKeyModifiers; + + const bool is_multi_select = (g.LastItemData.ItemFlags & ImGuiItemFlags_IsMultiSelect) != 0; + if (is_multi_select) // We absolutely need to distinguish open vs select so _OpenOnArrow comes by default + flags |= (flags & ImGuiTreeNodeFlags_OpenOnMask_) == 0 ? ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick : ImGuiTreeNodeFlags_OpenOnArrow; // Open behaviors can be altered with the _OpenOnArrow and _OnOnDoubleClick flags. // Some alteration have subtle effects (e.g. toggle on MouseUp vs MouseDown events) due to requirements for multi-selection and drag and drop support. @@ -6243,6 +6619,20 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l bool selected = (flags & ImGuiTreeNodeFlags_Selected) != 0; const bool was_selected = selected; + // Multi-selection support (header) + if (is_multi_select) + { + // Handle multi-select + alter button flags for it + MultiSelectItemHeader(id, &selected, &button_flags); + if (is_mouse_x_over_arrow) + button_flags = (button_flags | ImGuiButtonFlags_PressedOnClick) & ~ImGuiButtonFlags_PressedOnClickRelease; + } + else + { + if (window != g.HoveredWindow || !is_mouse_x_over_arrow) + button_flags |= ImGuiButtonFlags_NoKeyModsAllowed; + } + bool hovered, held; bool pressed = ButtonBehavior(interact_bb, id, &hovered, &held, button_flags); bool toggled = false; @@ -6250,18 +6640,20 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l { if (pressed && g.DragDropHoldJustPressedId != id) { - if ((flags & (ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick)) == 0 || (g.NavActivateId == id)) - toggled = true; + if ((flags & ImGuiTreeNodeFlags_OpenOnMask_) == 0 || (g.NavActivateId == id && !is_multi_select)) + toggled = true; // Single click if (flags & ImGuiTreeNodeFlags_OpenOnArrow) - toggled |= is_mouse_x_over_arrow && !g.NavDisableMouseHover; // Lightweight equivalent of IsMouseHoveringRect() since ButtonBehavior() already did the job + toggled |= is_mouse_x_over_arrow && !g.NavHighlightItemUnderNav; // Lightweight equivalent of IsMouseHoveringRect() since ButtonBehavior() already did the job if ((flags & ImGuiTreeNodeFlags_OpenOnDoubleClick) && g.IO.MouseClickedCount[0] == 2) - toggled = true; + toggled = true; // Double click } else if (pressed && g.DragDropHoldJustPressedId == id) { IM_ASSERT(button_flags & ImGuiButtonFlags_PressedOnDragDropHold); if (!is_open) // When using Drag and Drop "hold to open" we keep the node highlighted after opening, but never close it again. toggled = true; + else + pressed = false; // Cancel press so it doesn't trigger selection. } if (g.NavId == id && g.NavMoveDir == ImGuiDir_Left && is_open) @@ -6280,57 +6672,78 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l if (toggled) { is_open = !is_open; - window->DC.StateStorage->SetInt(id, is_open); + window->DC.StateStorage->SetInt(storage_id, is_open); g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_ToggledOpen; } } - // In this branch, TreeNodeBehavior() cannot toggle the selection so this will never trigger. - if (selected != was_selected) //-V547 + // Multi-selection support (footer) + if (is_multi_select) + { + bool pressed_copy = pressed && !toggled; + MultiSelectItemFooter(id, &selected, &pressed_copy); + if (pressed) + SetNavID(id, window->DC.NavLayerCurrent, g.CurrentFocusScopeId, interact_bb); + } + + if (selected != was_selected) g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_ToggledSelection; // Render - const ImU32 text_col = GetColorU32(ImGuiCol_Text); - ImGuiNavHighlightFlags nav_highlight_flags = ImGuiNavHighlightFlags_TypeThin; - if (display_frame) - { - // Framed type - const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); - RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, true, style.FrameRounding); - RenderNavHighlight(frame_bb, id, nav_highlight_flags); - if (flags & ImGuiTreeNodeFlags_Bullet) - RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.60f, text_pos.y + g.FontSize * 0.5f), text_col); - else if (!is_leaf) - RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 1.0f); - else // Leaf without bullet, left-adjusted text - text_pos.x -= text_offset_x -padding.x; - if (flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton) - frame_bb.Max.x -= g.FontSize + style.FramePadding.x; - - if (g.LogEnabled) - LogSetNextTextDecoration("###", "###"); - RenderTextClipped(text_pos, frame_bb.Max, label, label_end, &label_size); - } - else { - // Unframed typed for tree nodes - if (hovered || selected) + const ImU32 text_col = GetColorU32(ImGuiCol_Text); + ImGuiNavRenderCursorFlags nav_render_cursor_flags = ImGuiNavRenderCursorFlags_Compact; + if (is_multi_select) + nav_render_cursor_flags |= ImGuiNavRenderCursorFlags_AlwaysDraw; // Always show the nav rectangle + if (display_frame) { + // Framed type const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); - RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false); + RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, true, style.FrameRounding); + RenderNavCursor(frame_bb, id, nav_render_cursor_flags); + if (flags & ImGuiTreeNodeFlags_Bullet) + RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.60f, text_pos.y + g.FontSize * 0.5f), text_col); + else if (!is_leaf) + RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 1.0f); + else // Leaf without bullet, left-adjusted text + text_pos.x -= text_offset_x - padding.x; + if (flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton) + frame_bb.Max.x -= g.FontSize + style.FramePadding.x; + if (g.LogEnabled) + LogSetNextTextDecoration("###", "###"); } - RenderNavHighlight(frame_bb, id, nav_highlight_flags); - if (flags & ImGuiTreeNodeFlags_Bullet) - RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col); - else if (!is_leaf) - RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 0.70f); - if (g.LogEnabled) - LogSetNextTextDecoration(">", NULL); - RenderText(text_pos, label, label_end, false); + else + { + // Unframed typed for tree nodes + if (hovered || selected) + { + const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); + RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false); + } + RenderNavCursor(frame_bb, id, nav_render_cursor_flags); + if (flags & ImGuiTreeNodeFlags_Bullet) + RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col); + else if (!is_leaf) + RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 0.70f); + if (g.LogEnabled) + LogSetNextTextDecoration(">", NULL); + } + + if (span_all_columns) + TablePopBackgroundChannel(); + + // Label + if (display_frame) + RenderTextClipped(text_pos, frame_bb.Max, label, label_end, &label_size); + else + RenderText(text_pos, label, label_end, false); } + if (store_tree_node_stack_data && is_open) + TreeNodeStoreStackData(flags); // Call before TreePushOverrideID() if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) - TreePushOverrideID(id); + TreePushOverrideID(id); // Could use TreePush(label) but this avoid computing twice + IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0)); return is_open; } @@ -6369,16 +6782,19 @@ void ImGui::TreePop() window->DC.TreeDepth--; ImU32 tree_depth_mask = (1 << window->DC.TreeDepth); - // Handle Left arrow to move to parent tree node (when ImGuiTreeNodeFlags_NavLeftJumpsBackHere is enabled) - if (window->DC.TreeJumpToParentOnPopMask & tree_depth_mask) // Only set during request + if (window->DC.TreeHasStackDataDepthMask & tree_depth_mask) // Only set during request { - ImGuiNavTreeNodeData* nav_tree_node_data = &g.NavTreeNodeStack.back(); - IM_ASSERT(nav_tree_node_data->ID == window->IDStack.back()); - if (g.NavIdIsAlive && g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet()) - NavMoveRequestResolveWithPastTreeNode(&g.NavMoveResultLocal, nav_tree_node_data); - g.NavTreeNodeStack.pop_back(); + ImGuiTreeNodeStackData* data = &g.TreeNodeStack.back(); + IM_ASSERT(data->ID == window->IDStack.back()); + if (data->TreeFlags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) + { + // Handle Left arrow to move to parent tree node (when ImGuiTreeNodeFlags_NavLeftJumpsBackHere is enabled) + if (g.NavIdIsAlive && g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet()) + NavMoveRequestResolveWithPastTreeNode(&g.NavMoveResultLocal, data); + } + g.TreeNodeStack.pop_back(); + window->DC.TreeHasStackDataDepthMask &= ~tree_depth_mask; } - window->DC.TreeJumpToParentOnPopMask &= tree_depth_mask - 1; IM_ASSERT(window->IDStack.Size > 1); // There should always be 1 element in the IDStack (pushed during window creation). If this triggers you called TreePop/PopID too much. PopID(); @@ -6397,9 +6813,19 @@ void ImGui::SetNextItemOpen(bool is_open, ImGuiCond cond) ImGuiContext& g = *GImGui; if (g.CurrentWindow->SkipItems) return; - g.NextItemData.Flags |= ImGuiNextItemDataFlags_HasOpen; + g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasOpen; g.NextItemData.OpenVal = is_open; - g.NextItemData.OpenCond = cond ? cond : ImGuiCond_Always; + g.NextItemData.OpenCond = (ImU8)(cond ? cond : ImGuiCond_Always); +} + +// Set next TreeNode/CollapsingHeader storage id. +void ImGui::SetNextItemStorageID(ImGuiID storage_id) +{ + ImGuiContext& g = *GImGui; + if (g.CurrentWindow->SkipItems) + return; + g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasStorageID; + g.NextItemData.StorageId = storage_id; } // CollapsingHeader returns true when opened but do not indent nor push into the ID stack (because of the ImGuiTreeNodeFlags_NoTreePushOnOpen flag). @@ -6409,8 +6835,8 @@ bool ImGui::CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags) ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; - - return TreeNodeBehavior(window->GetID(label), flags | ImGuiTreeNodeFlags_CollapsingHeader, label); + ImGuiID id = window->GetID(label); + return TreeNodeBehavior(id, flags | ImGuiTreeNodeFlags_CollapsingHeader, label); } // p_visible == NULL : regular collapsing header @@ -6429,7 +6855,7 @@ bool ImGui::CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFl ImGuiID id = window->GetID(label); flags |= ImGuiTreeNodeFlags_CollapsingHeader; if (p_visible) - flags |= ImGuiTreeNodeFlags_AllowOverlap | ImGuiTreeNodeFlags_ClipLabelForTrailingButton; + flags |= ImGuiTreeNodeFlags_AllowOverlap | (ImGuiTreeNodeFlags)ImGuiTreeNodeFlags_ClipLabelForTrailingButton; bool is_open = TreeNodeBehavior(id, flags, label); if (p_visible != NULL) { @@ -6490,13 +6916,14 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl const ImVec2 text_max(min_x + size.x, pos.y + size.y); // Selectables are meant to be tightly packed together with no click-gap, so we extend their box to cover spacing between selectable. + // FIXME: Not part of layout so not included in clipper calculation, but ItemSize currently doesn't allow offsetting CursorPos. ImRect bb(min_x, pos.y, text_max.x, text_max.y); if ((flags & ImGuiSelectableFlags_NoPadWithHalfSpacing) == 0) { const float spacing_x = span_all_columns ? 0.0f : style.ItemSpacing.x; const float spacing_y = style.ItemSpacing.y; - const float spacing_L = IM_FLOOR(spacing_x * 0.50f); - const float spacing_U = IM_FLOOR(spacing_y * 0.50f); + const float spacing_L = IM_TRUNC(spacing_x * 0.50f); + const float spacing_U = IM_TRUNC(spacing_y * 0.50f); bb.Min.x -= spacing_L; bb.Min.y -= spacing_U; bb.Max.x += (spacing_x - spacing_L); @@ -6504,25 +6931,29 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl } //if (g.IO.KeyCtrl) { GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(0, 255, 0, 255)); } - // Modify ClipRect for the ItemAdd(), faster than doing a PushColumnsBackground/PushTableBackground for every Selectable.. - const float backup_clip_rect_min_x = window->ClipRect.Min.x; - const float backup_clip_rect_max_x = window->ClipRect.Max.x; + const bool disabled_item = (flags & ImGuiSelectableFlags_Disabled) != 0; + const ImGuiItemFlags extra_item_flags = disabled_item ? (ImGuiItemFlags)ImGuiItemFlags_Disabled : ImGuiItemFlags_None; + bool is_visible; if (span_all_columns) { + // Modify ClipRect for the ItemAdd(), faster than doing a PushColumnsBackground/PushTableBackgroundChannel for every Selectable.. + const float backup_clip_rect_min_x = window->ClipRect.Min.x; + const float backup_clip_rect_max_x = window->ClipRect.Max.x; window->ClipRect.Min.x = window->ParentWorkRect.Min.x; window->ClipRect.Max.x = window->ParentWorkRect.Max.x; - } - - const bool disabled_item = (flags & ImGuiSelectableFlags_Disabled) != 0; - const bool item_add = ItemAdd(bb, id, NULL, disabled_item ? ImGuiItemFlags_Disabled : ImGuiItemFlags_None); - if (span_all_columns) - { + is_visible = ItemAdd(bb, id, NULL, extra_item_flags); window->ClipRect.Min.x = backup_clip_rect_min_x; window->ClipRect.Max.x = backup_clip_rect_max_x; } + else + { + is_visible = ItemAdd(bb, id, NULL, extra_item_flags); + } - if (!item_add) - return false; + const bool is_multi_select = (g.LastItemData.ItemFlags & ImGuiItemFlags_IsMultiSelect) != 0; + if (!is_visible) + if (!is_multi_select || !g.BoxSelectState.UnclipMode || !g.BoxSelectState.UnclipRect.Overlaps(bb)) // Extra layer of "no logic clip" for box-select support (would be more overhead to add to ItemAdd) + return false; const bool disabled_global = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0; if (disabled_item && !disabled_global) // Only testing this as an optimization @@ -6530,10 +6961,15 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl // FIXME: We can standardize the behavior of those two, we could also keep the fast path of override ClipRect + full push on render only, // which would be advantageous since most selectable are not selected. - if (span_all_columns && window->DC.CurrentColumns) - PushColumnsBackground(); - else if (span_all_columns && g.CurrentTable) - TablePushBackgroundChannel(); + if (span_all_columns) + { + if (g.CurrentTable) + TablePushBackgroundChannel(); + else if (window->DC.CurrentColumns) + PushColumnsBackground(); + g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HasClipRect; + g.LastItemData.ClipRect = window->ClipRect; + } // We use NoHoldingActiveID on menus so user can click and _hold_ on a menu then drag to browse child entries ImGuiButtonFlags button_flags = 0; @@ -6542,62 +6978,98 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl if (flags & ImGuiSelectableFlags_SelectOnClick) { button_flags |= ImGuiButtonFlags_PressedOnClick; } if (flags & ImGuiSelectableFlags_SelectOnRelease) { button_flags |= ImGuiButtonFlags_PressedOnRelease; } if (flags & ImGuiSelectableFlags_AllowDoubleClick) { button_flags |= ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick; } - if ((flags & ImGuiSelectableFlags_AllowOverlap) || (g.LastItemData.InFlags & ImGuiItemFlags_AllowOverlap)) { button_flags |= ImGuiButtonFlags_AllowOverlap; } + if ((flags & ImGuiSelectableFlags_AllowOverlap) || (g.LastItemData.ItemFlags & ImGuiItemFlags_AllowOverlap)) { button_flags |= ImGuiButtonFlags_AllowOverlap; } + // Multi-selection support (header) const bool was_selected = selected; + if (is_multi_select) + { + // Handle multi-select + alter button flags for it + MultiSelectItemHeader(id, &selected, &button_flags); + } + bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags); - // Auto-select when moved into - // - This will be more fully fleshed in the range-select branch - // - This is not exposed as it won't nicely work with some user side handling of shift/control - // - We cannot do 'if (g.NavJustMovedToId != id) { selected = false; pressed = was_selected; }' for two reasons - // - (1) it would require focus scope to be set, need exposing PushFocusScope() or equivalent (e.g. BeginSelection() calling PushFocusScope()) - // - (2) usage will fail with clipped items - // The multi-select API aim to fix those issues, e.g. may be replaced with a BeginSelection() API. - if ((flags & ImGuiSelectableFlags_SelectOnNav) && g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == g.CurrentFocusScopeId) - if (g.NavJustMovedToId == id) - selected = pressed = true; - - // Update NavId when clicking or when Hovering (this doesn't happen on most widgets), so navigation can be resumed with gamepad/keyboard + // Multi-selection support (footer) + if (is_multi_select) + { + MultiSelectItemFooter(id, &selected, &pressed); + } + else + { + // Auto-select when moved into + // - This will be more fully fleshed in the range-select branch + // - This is not exposed as it won't nicely work with some user side handling of shift/control + // - We cannot do 'if (g.NavJustMovedToId != id) { selected = false; pressed = was_selected; }' for two reasons + // - (1) it would require focus scope to be set, need exposing PushFocusScope() or equivalent (e.g. BeginSelection() calling PushFocusScope()) + // - (2) usage will fail with clipped items + // The multi-select API aim to fix those issues, e.g. may be replaced with a BeginSelection() API. + if ((flags & ImGuiSelectableFlags_SelectOnNav) && g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == g.CurrentFocusScopeId) + if (g.NavJustMovedToId == id) + selected = pressed = true; + } + + // Update NavId when clicking or when Hovering (this doesn't happen on most widgets), so navigation can be resumed with keyboard/gamepad if (pressed || (hovered && (flags & ImGuiSelectableFlags_SetNavIdOnHover))) { - if (!g.NavDisableMouseHover && g.NavWindow == window && g.NavLayer == window->DC.NavLayerCurrent) + if (!g.NavHighlightItemUnderNav && g.NavWindow == window && g.NavLayer == window->DC.NavLayerCurrent) { SetNavID(id, window->DC.NavLayerCurrent, g.CurrentFocusScopeId, WindowRectAbsToRel(window, bb)); // (bb == NavRect) - g.NavDisableHighlight = true; + if (g.IO.ConfigNavCursorVisibleAuto) + g.NavCursorVisible = false; } } if (pressed) MarkItemEdited(id); - // In this branch, Selectable() cannot toggle the selection so this will never trigger. - if (selected != was_selected) //-V547 + if (selected != was_selected) g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_ToggledSelection; // Render - if (hovered || selected) + if (is_visible) { - const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); - RenderFrame(bb.Min, bb.Max, col, false, 0.0f); + const bool highlighted = hovered || (flags & ImGuiSelectableFlags_Highlight); + if (highlighted || selected) + { + // FIXME-MULTISELECT: Styling: Color for 'selected' elements? ImGuiCol_HeaderSelected + ImU32 col; + if (selected && !highlighted) + col = GetColorU32(ImLerp(GetStyleColorVec4(ImGuiCol_Header), GetStyleColorVec4(ImGuiCol_HeaderHovered), 0.5f)); + else + col = GetColorU32((held && highlighted) ? ImGuiCol_HeaderActive : highlighted ? ImGuiCol_HeaderHovered : ImGuiCol_Header); + RenderFrame(bb.Min, bb.Max, col, false, 0.0f); + } + if (g.NavId == id) + { + ImGuiNavRenderCursorFlags nav_render_cursor_flags = ImGuiNavRenderCursorFlags_Compact | ImGuiNavRenderCursorFlags_NoRounding; + if (is_multi_select) + nav_render_cursor_flags |= ImGuiNavRenderCursorFlags_AlwaysDraw; // Always show the nav rectangle + RenderNavCursor(bb, id, nav_render_cursor_flags); + } } - if (g.NavId == id) - RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_TypeThin | ImGuiNavHighlightFlags_NoRounding); - if (span_all_columns && window->DC.CurrentColumns) - PopColumnsBackground(); - else if (span_all_columns && g.CurrentTable) - TablePopBackgroundChannel(); + if (span_all_columns) + { + if (g.CurrentTable) + TablePopBackgroundChannel(); + else if (window->DC.CurrentColumns) + PopColumnsBackground(); + } - RenderTextClipped(text_min, text_max, label, NULL, &label_size, style.SelectableTextAlign, &bb); + if (is_visible) + RenderTextClipped(text_min, text_max, label, NULL, &label_size, style.SelectableTextAlign, &bb); // Automatically close popups - if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(g.LastItemData.InFlags & ImGuiItemFlags_SelectableDontClosePopup)) + if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_NoAutoClosePopups) && (g.LastItemData.ItemFlags & ImGuiItemFlags_AutoClosePopups)) CloseCurrentPopup(); if (disabled_item && !disabled_global) EndDisabled(); + // Selectable() always returns a pressed state! + // Users of BeginMultiSelect()/EndMultiSelect() scope: you may call ImGui::IsItemToggledSelection() to retrieve + // selection toggle, only useful if you need that state updated (e.g. for rendering purpose) before reaching EndMultiSelect(). IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags); return pressed; //-V1020 } @@ -6612,83 +7084,1212 @@ bool ImGui::Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags return false; } + //------------------------------------------------------------------------- -// [SECTION] Widgets: ListBox -//------------------------------------------------------------------------- -// - BeginListBox() -// - EndListBox() -// - ListBox() +// [SECTION] Widgets: Typing-Select support //------------------------------------------------------------------------- -// Tip: To have a list filling the entire window width, use size.x = -FLT_MIN and pass an non-visible label e.g. "##empty" -// Tip: If your vertical size is calculated from an item count (e.g. 10 * item_height) consider adding a fractional part to facilitate seeing scrolling boundaries (e.g. 10.25 * item_height). -bool ImGui::BeginListBox(const char* label, const ImVec2& size_arg) +// [Experimental] Currently not exposed in public API. +// Consume character inputs and return search request, if any. +// This would typically only be called on the focused window or location you want to grab inputs for, e.g. +// if (ImGui::IsWindowFocused(...)) +// if (ImGuiTypingSelectRequest* req = ImGui::GetTypingSelectRequest()) +// focus_idx = ImGui::TypingSelectFindMatch(req, my_items.size(), [](void*, int n) { return my_items[n]->Name; }, &my_items, -1); +// However the code is written in a way where calling it from multiple locations is safe (e.g. to obtain buffer). +ImGuiTypingSelectRequest* ImGui::GetTypingSelectRequest(ImGuiTypingSelectFlags flags) { ImGuiContext& g = *GImGui; - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; + ImGuiTypingSelectState* data = &g.TypingSelectState; + ImGuiTypingSelectRequest* out_request = &data->Request; + + // Clear buffer + const float TYPING_SELECT_RESET_TIMER = 1.80f; // FIXME: Potentially move to IO config. + const int TYPING_SELECT_SINGLE_CHAR_COUNT_FOR_LOCK = 4; // Lock single char matching when repeating same char 4 times + if (data->SearchBuffer[0] != 0) + { + bool clear_buffer = false; + clear_buffer |= (g.NavFocusScopeId != data->FocusScope); + clear_buffer |= (data->LastRequestTime + TYPING_SELECT_RESET_TIMER < g.Time); + clear_buffer |= g.NavAnyRequest; + clear_buffer |= g.ActiveId != 0 && g.NavActivateId == 0; // Allow temporary SPACE activation to not interfere + clear_buffer |= IsKeyPressed(ImGuiKey_Escape) || IsKeyPressed(ImGuiKey_Enter); + clear_buffer |= IsKeyPressed(ImGuiKey_Backspace) && (flags & ImGuiTypingSelectFlags_AllowBackspace) == 0; + //if (clear_buffer) { IMGUI_DEBUG_LOG("GetTypingSelectRequest(): Clear SearchBuffer.\n"); } + if (clear_buffer) + data->Clear(); + } + + // Append to buffer + const int buffer_max_len = IM_ARRAYSIZE(data->SearchBuffer) - 1; + int buffer_len = (int)strlen(data->SearchBuffer); + bool select_request = false; + for (ImWchar w : g.IO.InputQueueCharacters) + { + const int w_len = ImTextCountUtf8BytesFromStr(&w, &w + 1); + if (w < 32 || (buffer_len == 0 && ImCharIsBlankW(w)) || (buffer_len + w_len > buffer_max_len)) // Ignore leading blanks + continue; + char w_buf[5]; + ImTextCharToUtf8(w_buf, (unsigned int)w); + if (data->SingleCharModeLock && w_len == out_request->SingleCharSize && memcmp(w_buf, data->SearchBuffer, w_len) == 0) + { + select_request = true; // Same character: don't need to append to buffer. + continue; + } + if (data->SingleCharModeLock) + { + data->Clear(); // Different character: clear + buffer_len = 0; + } + memcpy(data->SearchBuffer + buffer_len, w_buf, w_len + 1); // Append + buffer_len += w_len; + select_request = true; + } + g.IO.InputQueueCharacters.resize(0); - const ImGuiStyle& style = g.Style; - const ImGuiID id = GetID(label); - const ImVec2 label_size = CalcTextSize(label, NULL, true); + // Handle backspace + if ((flags & ImGuiTypingSelectFlags_AllowBackspace) && IsKeyPressed(ImGuiKey_Backspace, ImGuiInputFlags_Repeat)) + { + char* p = (char*)(void*)ImTextFindPreviousUtf8Codepoint(data->SearchBuffer, data->SearchBuffer + buffer_len); + *p = 0; + buffer_len = (int)(p - data->SearchBuffer); + } - // Size default to hold ~7.25 items. - // Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar. - ImVec2 size = ImFloor(CalcItemSize(size_arg, CalcItemWidth(), GetTextLineHeightWithSpacing() * 7.25f + style.FramePadding.y * 2.0f)); - ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y)); - ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size); - ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); - g.NextItemData.ClearFlags(); + // Return request if any + if (buffer_len == 0) + return NULL; + if (select_request) + { + data->FocusScope = g.NavFocusScopeId; + data->LastRequestFrame = g.FrameCount; + data->LastRequestTime = (float)g.Time; + } + out_request->Flags = flags; + out_request->SearchBufferLen = buffer_len; + out_request->SearchBuffer = data->SearchBuffer; + out_request->SelectRequest = (data->LastRequestFrame == g.FrameCount); + out_request->SingleCharMode = false; + out_request->SingleCharSize = 0; + + // Calculate if buffer contains the same character repeated. + // - This can be used to implement a special search mode on first character. + // - Performed on UTF-8 codepoint for correctness. + // - SingleCharMode is always set for first input character, because it usually leads to a "next". + if (flags & ImGuiTypingSelectFlags_AllowSingleCharMode) + { + const char* buf_begin = out_request->SearchBuffer; + const char* buf_end = out_request->SearchBuffer + out_request->SearchBufferLen; + const int c0_len = ImTextCountUtf8BytesFromChar(buf_begin, buf_end); + const char* p = buf_begin + c0_len; + for (; p < buf_end; p += c0_len) + if (memcmp(buf_begin, p, (size_t)c0_len) != 0) + break; + const int single_char_count = (p == buf_end) ? (out_request->SearchBufferLen / c0_len) : 0; + out_request->SingleCharMode = (single_char_count > 0 || data->SingleCharModeLock); + out_request->SingleCharSize = (ImS8)c0_len; + data->SingleCharModeLock |= (single_char_count >= TYPING_SELECT_SINGLE_CHAR_COUNT_FOR_LOCK); // From now on we stop search matching to lock to single char mode. + } - if (!IsRectVisible(bb.Min, bb.Max)) + return out_request; +} + +static int ImStrimatchlen(const char* s1, const char* s1_end, const char* s2) +{ + int match_len = 0; + while (s1 < s1_end && ImToUpper(*s1++) == ImToUpper(*s2++)) + match_len++; + return match_len; +} + +// Default handler for finding a result for typing-select. You may implement your own. +// You might want to display a tooltip to visualize the current request SearchBuffer +// When SingleCharMode is set: +// - it is better to NOT display a tooltip of other on-screen display indicator. +// - the index of the currently focused item is required. +// if your SetNextItemSelectionUserData() values are indices, you can obtain it from ImGuiMultiSelectIO::NavIdItem, otherwise from g.NavLastValidSelectionUserData. +int ImGui::TypingSelectFindMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx) +{ + if (req == NULL || req->SelectRequest == false) // Support NULL parameter so both calls can be done from same spot. + return -1; + int idx = -1; + if (req->SingleCharMode && (req->Flags & ImGuiTypingSelectFlags_AllowSingleCharMode)) + idx = TypingSelectFindNextSingleCharMatch(req, items_count, get_item_name_func, user_data, nav_item_idx); + else + idx = TypingSelectFindBestLeadingMatch(req, items_count, get_item_name_func, user_data); + if (idx != -1) + SetNavCursorVisibleAfterMove(); + return idx; +} + +// Special handling when a single character is repeated: perform search on a single letter and goes to next. +int ImGui::TypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx) +{ + // FIXME: Assume selection user data is index. Would be extremely practical. + //if (nav_item_idx == -1) + // nav_item_idx = (int)g.NavLastValidSelectionUserData; + + int first_match_idx = -1; + bool return_next_match = false; + for (int idx = 0; idx < items_count; idx++) { - ItemSize(bb.GetSize(), style.FramePadding.y); - ItemAdd(bb, 0, &frame_bb); - return false; + const char* item_name = get_item_name_func(user_data, idx); + if (ImStrimatchlen(req->SearchBuffer, req->SearchBuffer + req->SingleCharSize, item_name) < req->SingleCharSize) + continue; + if (return_next_match) // Return next matching item after current item. + return idx; + if (first_match_idx == -1 && nav_item_idx == -1) // Return first match immediately if we don't have a nav_item_idx value. + return idx; + if (first_match_idx == -1) // Record first match for wrapping. + first_match_idx = idx; + if (nav_item_idx == idx) // Record that we encountering nav_item so we can return next match. + return_next_match = true; } + return first_match_idx; // First result +} - // FIXME-OPT: We could omit the BeginGroup() if label_size.x but would need to omit the EndGroup() as well. - BeginGroup(); - if (label_size.x > 0.0f) +int ImGui::TypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data) +{ + int longest_match_idx = -1; + int longest_match_len = 0; + for (int idx = 0; idx < items_count; idx++) { - ImVec2 label_pos = ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y); - RenderText(label_pos, label); - window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, label_pos + label_size); + const char* item_name = get_item_name_func(user_data, idx); + const int match_len = ImStrimatchlen(req->SearchBuffer, req->SearchBuffer + req->SearchBufferLen, item_name); + if (match_len <= longest_match_len) + continue; + longest_match_idx = idx; + longest_match_len = match_len; + if (match_len == req->SearchBufferLen) + break; } + return longest_match_idx; +} - BeginChildFrame(id, frame_bb.GetSize()); - return true; +void ImGui::DebugNodeTypingSelectState(ImGuiTypingSelectState* data) +{ +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + Text("SearchBuffer = \"%s\"", data->SearchBuffer); + Text("SingleCharMode = %d, Size = %d, Lock = %d", data->Request.SingleCharMode, data->Request.SingleCharSize, data->SingleCharModeLock); + Text("LastRequest = time: %.2f, frame: %d", data->LastRequestTime, data->LastRequestFrame); +#else + IM_UNUSED(data); +#endif } -void ImGui::EndListBox() +//------------------------------------------------------------------------- +// [SECTION] Widgets: Box-Select support +// This has been extracted away from Multi-Select logic in the hope that it could eventually be used elsewhere, but hasn't been yet. +//------------------------------------------------------------------------- +// Extra logic in MultiSelectItemFooter() and ImGuiListClipper::Step() +//------------------------------------------------------------------------- +// - BoxSelectPreStartDrag() [Internal] +// - BoxSelectActivateDrag() [Internal] +// - BoxSelectDeactivateDrag() [Internal] +// - BoxSelectScrollWithMouseDrag() [Internal] +// - BeginBoxSelect() [Internal] +// - EndBoxSelect() [Internal] +//------------------------------------------------------------------------- + +// Call on the initial click. +static void BoxSelectPreStartDrag(ImGuiID id, ImGuiSelectionUserData clicked_item) { ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - IM_ASSERT((window->Flags & ImGuiWindowFlags_ChildWindow) && "Mismatched BeginListBox/EndListBox calls. Did you test the return value of BeginListBox?"); - IM_UNUSED(window); + ImGuiBoxSelectState* bs = &g.BoxSelectState; + bs->ID = id; + bs->IsStarting = true; // Consider starting box-select. + bs->IsStartedFromVoid = (clicked_item == ImGuiSelectionUserData_Invalid); + bs->IsStartedSetNavIdOnce = bs->IsStartedFromVoid; + bs->KeyMods = g.IO.KeyMods; + bs->StartPosRel = bs->EndPosRel = ImGui::WindowPosAbsToRel(g.CurrentWindow, g.IO.MousePos); + bs->ScrollAccum = ImVec2(0.0f, 0.0f); +} - EndChildFrame(); - EndGroup(); // This is only required to be able to do IsItemXXX query on the whole ListBox including label +static void BoxSelectActivateDrag(ImGuiBoxSelectState* bs, ImGuiWindow* window) +{ + ImGuiContext& g = *GImGui; + IMGUI_DEBUG_LOG_SELECTION("[selection] BeginBoxSelect() 0X%08X: Activate\n", bs->ID); + bs->IsActive = true; + bs->Window = window; + bs->IsStarting = false; + ImGui::SetActiveID(bs->ID, window); + ImGui::SetActiveIdUsingAllKeyboardKeys(); + if (bs->IsStartedFromVoid && (bs->KeyMods & (ImGuiMod_Ctrl | ImGuiMod_Shift)) == 0) + bs->RequestClear = true; } -bool ImGui::ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_items) +static void BoxSelectDeactivateDrag(ImGuiBoxSelectState* bs) { - const bool value_changed = ListBox(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_items); - return value_changed; + ImGuiContext& g = *GImGui; + bs->IsActive = bs->IsStarting = false; + if (g.ActiveId == bs->ID) + { + IMGUI_DEBUG_LOG_SELECTION("[selection] BeginBoxSelect() 0X%08X: Deactivate\n", bs->ID); + ImGui::ClearActiveID(); + } + bs->ID = 0; } -// This is merely a helper around BeginListBox(), EndListBox(). -// Considering using those directly to submit custom data or store selection differently. -bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items) +static void BoxSelectScrollWithMouseDrag(ImGuiBoxSelectState* bs, ImGuiWindow* window, const ImRect& inner_r) { ImGuiContext& g = *GImGui; + IM_ASSERT(bs->Window == window); + for (int n = 0; n < 2; n++) // each axis + { + const float mouse_pos = g.IO.MousePos[n]; + const float dist = (mouse_pos > inner_r.Max[n]) ? mouse_pos - inner_r.Max[n] : (mouse_pos < inner_r.Min[n]) ? mouse_pos - inner_r.Min[n] : 0.0f; + const float scroll_curr = window->Scroll[n]; + if (dist == 0.0f || (dist < 0.0f && scroll_curr < 0.0f) || (dist > 0.0f && scroll_curr >= window->ScrollMax[n])) + continue; - // Calculate size from "height_in_items" - if (height_in_items < 0) - height_in_items = ImMin(items_count, 7); + const float speed_multiplier = ImLinearRemapClamp(g.FontSize, g.FontSize * 5.0f, 1.0f, 4.0f, ImAbs(dist)); // x1 to x4 depending on distance + const float scroll_step = g.FontSize * 35.0f * speed_multiplier * ImSign(dist) * g.IO.DeltaTime; + bs->ScrollAccum[n] += scroll_step; + + // Accumulate into a stored value so we can handle high-framerate + const float scroll_step_i = ImFloor(bs->ScrollAccum[n]); + if (scroll_step_i == 0.0f) + continue; + if (n == 0) + ImGui::SetScrollX(window, scroll_curr + scroll_step_i); + else + ImGui::SetScrollY(window, scroll_curr + scroll_step_i); + bs->ScrollAccum[n] -= scroll_step_i; + } +} + +bool ImGui::BeginBoxSelect(const ImRect& scope_rect, ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags) +{ + ImGuiContext& g = *GImGui; + ImGuiBoxSelectState* bs = &g.BoxSelectState; + KeepAliveID(box_select_id); + if (bs->ID != box_select_id) + return false; + + // IsStarting is set by MultiSelectItemFooter() when considering a possible box-select. We validate it here and lock geometry. + bs->UnclipMode = false; + bs->RequestClear = false; + if (bs->IsStarting && IsMouseDragPastThreshold(0)) + BoxSelectActivateDrag(bs, window); + else if ((bs->IsStarting || bs->IsActive) && g.IO.MouseDown[0] == false) + BoxSelectDeactivateDrag(bs); + if (!bs->IsActive) + return false; + + // Current frame absolute prev/current rectangles are used to toggle selection. + // They are derived from positions relative to scrolling space. + ImVec2 start_pos_abs = WindowPosRelToAbs(window, bs->StartPosRel); + ImVec2 prev_end_pos_abs = WindowPosRelToAbs(window, bs->EndPosRel); // Clamped already + ImVec2 curr_end_pos_abs = g.IO.MousePos; + if (ms_flags & ImGuiMultiSelectFlags_ScopeWindow) // Box-select scrolling only happens with ScopeWindow + curr_end_pos_abs = ImClamp(curr_end_pos_abs, scope_rect.Min, scope_rect.Max); + bs->BoxSelectRectPrev.Min = ImMin(start_pos_abs, prev_end_pos_abs); + bs->BoxSelectRectPrev.Max = ImMax(start_pos_abs, prev_end_pos_abs); + bs->BoxSelectRectCurr.Min = ImMin(start_pos_abs, curr_end_pos_abs); + bs->BoxSelectRectCurr.Max = ImMax(start_pos_abs, curr_end_pos_abs); + + // Box-select 2D mode detects horizontal changes (vertical ones are already picked by Clipper) + // Storing an extra rect used by widgets supporting box-select. + if (ms_flags & ImGuiMultiSelectFlags_BoxSelect2d) + if (bs->BoxSelectRectPrev.Min.x != bs->BoxSelectRectCurr.Min.x || bs->BoxSelectRectPrev.Max.x != bs->BoxSelectRectCurr.Max.x) + { + bs->UnclipMode = true; + bs->UnclipRect = bs->BoxSelectRectPrev; // FIXME-OPT: UnclipRect x coordinates could be intersection of Prev and Curr rect on X axis. + bs->UnclipRect.Add(bs->BoxSelectRectCurr); + } + + //GetForegroundDrawList()->AddRect(bs->UnclipRect.Min, bs->UnclipRect.Max, IM_COL32(255,0,0,200), 0.0f, 0, 3.0f); + //GetForegroundDrawList()->AddRect(bs->BoxSelectRectPrev.Min, bs->BoxSelectRectPrev.Max, IM_COL32(255,0,0,200), 0.0f, 0, 3.0f); + //GetForegroundDrawList()->AddRect(bs->BoxSelectRectCurr.Min, bs->BoxSelectRectCurr.Max, IM_COL32(0,255,0,200), 0.0f, 0, 1.0f); + return true; +} + +void ImGui::EndBoxSelect(const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + ImGuiBoxSelectState* bs = &g.BoxSelectState; + IM_ASSERT(bs->IsActive); + bs->UnclipMode = false; + + // Render selection rectangle + bs->EndPosRel = WindowPosAbsToRel(window, ImClamp(g.IO.MousePos, scope_rect.Min, scope_rect.Max)); // Clamp stored position according to current scrolling view + ImRect box_select_r = bs->BoxSelectRectCurr; + box_select_r.ClipWith(scope_rect); + window->DrawList->AddRectFilled(box_select_r.Min, box_select_r.Max, GetColorU32(ImGuiCol_SeparatorHovered, 0.30f)); // FIXME-MULTISELECT: Styling + window->DrawList->AddRect(box_select_r.Min, box_select_r.Max, GetColorU32(ImGuiCol_NavCursor)); // FIXME-MULTISELECT: Styling + + // Scroll + const bool enable_scroll = (ms_flags & ImGuiMultiSelectFlags_ScopeWindow) && (ms_flags & ImGuiMultiSelectFlags_BoxSelectNoScroll) == 0; + if (enable_scroll) + { + ImRect scroll_r = scope_rect; + scroll_r.Expand(-g.FontSize); + //GetForegroundDrawList()->AddRect(scroll_r.Min, scroll_r.Max, IM_COL32(0, 255, 0, 255)); + if (!scroll_r.Contains(g.IO.MousePos)) + BoxSelectScrollWithMouseDrag(bs, window, scroll_r); + } +} + +//------------------------------------------------------------------------- +// [SECTION] Widgets: Multi-Select support +//------------------------------------------------------------------------- +// - DebugLogMultiSelectRequests() [Internal] +// - CalcScopeRect() [Internal] +// - BeginMultiSelect() +// - EndMultiSelect() +// - SetNextItemSelectionUserData() +// - MultiSelectItemHeader() [Internal] +// - MultiSelectItemFooter() [Internal] +// - DebugNodeMultiSelectState() [Internal] +//------------------------------------------------------------------------- + +static void DebugLogMultiSelectRequests(const char* function, const ImGuiMultiSelectIO* io) +{ + ImGuiContext& g = *GImGui; + IM_UNUSED(function); + for (const ImGuiSelectionRequest& req : io->Requests) + { + if (req.Type == ImGuiSelectionRequestType_SetAll) IMGUI_DEBUG_LOG_SELECTION("[selection] %s: Request: SetAll %d (= %s)\n", function, req.Selected, req.Selected ? "SelectAll" : "Clear"); + if (req.Type == ImGuiSelectionRequestType_SetRange) IMGUI_DEBUG_LOG_SELECTION("[selection] %s: Request: SetRange %" IM_PRId64 "..%" IM_PRId64 " (0x%" IM_PRIX64 "..0x%" IM_PRIX64 ") = %d (dir %d)\n", function, req.RangeFirstItem, req.RangeLastItem, req.RangeFirstItem, req.RangeLastItem, req.Selected, req.RangeDirection); + } +} + +static ImRect CalcScopeRect(ImGuiMultiSelectTempData* ms, ImGuiWindow* window) +{ + ImGuiContext& g = *GImGui; + if (ms->Flags & ImGuiMultiSelectFlags_ScopeRect) + { + // Warning: this depends on CursorMaxPos so it means to be called by EndMultiSelect() only + return ImRect(ms->ScopeRectMin, ImMax(window->DC.CursorMaxPos, ms->ScopeRectMin)); + } + else + { + // When a table, pull HostClipRect, which allows us to predict ClipRect before first row/layout is performed. (#7970) + ImRect scope_rect = window->InnerClipRect; + if (g.CurrentTable != NULL) + scope_rect = g.CurrentTable->HostClipRect; + + // Add inner table decoration (#7821) // FIXME: Why not baking in InnerClipRect? + scope_rect.Min = ImMin(scope_rect.Min + ImVec2(window->DecoInnerSizeX1, window->DecoInnerSizeY1), scope_rect.Max); + return scope_rect; + } +} + +// Return ImGuiMultiSelectIO structure. +// Lifetime: don't hold on ImGuiMultiSelectIO* pointers over multiple frames or past any subsequent call to BeginMultiSelect() or EndMultiSelect(). +// Passing 'selection_size' and 'items_count' parameters is currently optional. +// - 'selection_size' is useful to disable some shortcut routing: e.g. ImGuiMultiSelectFlags_ClearOnEscape won't claim Escape key when selection_size 0, +// allowing a first press to clear selection THEN the second press to leave child window and return to parent. +// - 'items_count' is stored in ImGuiMultiSelectIO which makes it a convenient way to pass the information to your ApplyRequest() handler (but you may pass it differently). +// - If they are costly for you to compute (e.g. external intrusive selection without maintaining size), you may avoid them and pass -1. +// - If you can easily tell if your selection is empty or not, you may pass 0/1, or you may enable ImGuiMultiSelectFlags_ClearOnEscape flag dynamically. +ImGuiMultiSelectIO* ImGui::BeginMultiSelect(ImGuiMultiSelectFlags flags, int selection_size, int items_count) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + + if (++g.MultiSelectTempDataStacked > g.MultiSelectTempData.Size) + g.MultiSelectTempData.resize(g.MultiSelectTempDataStacked, ImGuiMultiSelectTempData()); + ImGuiMultiSelectTempData* ms = &g.MultiSelectTempData[g.MultiSelectTempDataStacked - 1]; + IM_STATIC_ASSERT(offsetof(ImGuiMultiSelectTempData, IO) == 0); // Clear() relies on that. + g.CurrentMultiSelect = ms; + if ((flags & (ImGuiMultiSelectFlags_ScopeWindow | ImGuiMultiSelectFlags_ScopeRect)) == 0) + flags |= ImGuiMultiSelectFlags_ScopeWindow; + if (flags & ImGuiMultiSelectFlags_SingleSelect) + flags &= ~(ImGuiMultiSelectFlags_BoxSelect2d | ImGuiMultiSelectFlags_BoxSelect1d); + if (flags & ImGuiMultiSelectFlags_BoxSelect2d) + flags &= ~ImGuiMultiSelectFlags_BoxSelect1d; + + // FIXME: BeginFocusScope() + const ImGuiID id = window->IDStack.back(); + ms->Clear(); + ms->FocusScopeId = id; + ms->Flags = flags; + ms->IsFocused = (ms->FocusScopeId == g.NavFocusScopeId); + ms->BackupCursorMaxPos = window->DC.CursorMaxPos; + ms->ScopeRectMin = window->DC.CursorMaxPos = window->DC.CursorPos; + PushFocusScope(ms->FocusScopeId); + if (flags & ImGuiMultiSelectFlags_ScopeWindow) // Mark parent child window as navigable into, with highlight. Assume user will always submit interactive items. + window->DC.NavLayersActiveMask |= 1 << ImGuiNavLayer_Main; + + // Use copy of keyboard mods at the time of the request, otherwise we would requires mods to be held for an extra frame. + ms->KeyMods = g.NavJustMovedToId ? (g.NavJustMovedToIsTabbing ? 0 : g.NavJustMovedToKeyMods) : g.IO.KeyMods; + if (flags & ImGuiMultiSelectFlags_NoRangeSelect) + ms->KeyMods &= ~ImGuiMod_Shift; + + // Bind storage + ImGuiMultiSelectState* storage = g.MultiSelectStorage.GetOrAddByKey(id); + storage->ID = id; + storage->LastFrameActive = g.FrameCount; + storage->LastSelectionSize = selection_size; + storage->Window = window; + ms->Storage = storage; + + // Output to user + ms->IO.Requests.resize(0); + ms->IO.RangeSrcItem = storage->RangeSrcItem; + ms->IO.NavIdItem = storage->NavIdItem; + ms->IO.NavIdSelected = (storage->NavIdSelected == 1) ? true : false; + ms->IO.ItemsCount = items_count; + + // Clear when using Navigation to move within the scope + // (we compare FocusScopeId so it possible to use multiple selections inside a same window) + bool request_clear = false; + bool request_select_all = false; + if (g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == ms->FocusScopeId && g.NavJustMovedToHasSelectionData) + { + if (ms->KeyMods & ImGuiMod_Shift) + ms->IsKeyboardSetRange = true; + if (ms->IsKeyboardSetRange) + IM_ASSERT(storage->RangeSrcItem != ImGuiSelectionUserData_Invalid); // Not ready -> could clear? + if ((ms->KeyMods & (ImGuiMod_Ctrl | ImGuiMod_Shift)) == 0 && (flags & (ImGuiMultiSelectFlags_NoAutoClear | ImGuiMultiSelectFlags_NoAutoSelect)) == 0) + request_clear = true; + } + else if (g.NavJustMovedFromFocusScopeId == ms->FocusScopeId) + { + // Also clear on leaving scope (may be optional?) + if ((ms->KeyMods & (ImGuiMod_Ctrl | ImGuiMod_Shift)) == 0 && (flags & (ImGuiMultiSelectFlags_NoAutoClear | ImGuiMultiSelectFlags_NoAutoSelect)) == 0) + request_clear = true; + } + + // Box-select handling: update active state. + ImGuiBoxSelectState* bs = &g.BoxSelectState; + if (flags & (ImGuiMultiSelectFlags_BoxSelect1d | ImGuiMultiSelectFlags_BoxSelect2d)) + { + ms->BoxSelectId = GetID("##BoxSelect"); + if (BeginBoxSelect(CalcScopeRect(ms, window), window, ms->BoxSelectId, flags)) + request_clear |= bs->RequestClear; + } + + if (ms->IsFocused) + { + // Shortcut: Clear selection (Escape) + // - Only claim shortcut if selection is not empty, allowing further presses on Escape to e.g. leave current child window. + // - Box select also handle Escape and needs to pass an id to bypass ActiveIdUsingAllKeyboardKeys lock. + if (flags & ImGuiMultiSelectFlags_ClearOnEscape) + { + if (selection_size != 0 || bs->IsActive) + if (Shortcut(ImGuiKey_Escape, ImGuiInputFlags_None, bs->IsActive ? bs->ID : 0)) + { + request_clear = true; + if (bs->IsActive) + BoxSelectDeactivateDrag(bs); + } + } + + // Shortcut: Select all (CTRL+A) + if (!(flags & ImGuiMultiSelectFlags_SingleSelect) && !(flags & ImGuiMultiSelectFlags_NoSelectAll)) + if (Shortcut(ImGuiMod_Ctrl | ImGuiKey_A)) + request_select_all = true; + } + + if (request_clear || request_select_all) + { + MultiSelectAddSetAll(ms, request_select_all); + if (!request_select_all) + storage->LastSelectionSize = 0; + } + ms->LoopRequestSetAll = request_select_all ? 1 : request_clear ? 0 : -1; + ms->LastSubmittedItem = ImGuiSelectionUserData_Invalid; + + if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) + DebugLogMultiSelectRequests("BeginMultiSelect", &ms->IO); + + return &ms->IO; +} + +// Return updated ImGuiMultiSelectIO structure. +// Lifetime: don't hold on ImGuiMultiSelectIO* pointers over multiple frames or past any subsequent call to BeginMultiSelect() or EndMultiSelect(). +ImGuiMultiSelectIO* ImGui::EndMultiSelect() +{ + ImGuiContext& g = *GImGui; + ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect; + ImGuiMultiSelectState* storage = ms->Storage; + ImGuiWindow* window = g.CurrentWindow; + IM_ASSERT_USER_ERROR(ms->FocusScopeId == g.CurrentFocusScopeId, "EndMultiSelect() FocusScope mismatch!"); + IM_ASSERT(g.CurrentMultiSelect != NULL && storage->Window == g.CurrentWindow); + IM_ASSERT(g.MultiSelectTempDataStacked > 0 && &g.MultiSelectTempData[g.MultiSelectTempDataStacked - 1] == g.CurrentMultiSelect); + + ImRect scope_rect = CalcScopeRect(ms, window); + if (ms->IsFocused) + { + // We currently don't allow user code to modify RangeSrcItem by writing to BeginIO's version, but that would be an easy change here. + if (ms->IO.RangeSrcReset || (ms->RangeSrcPassedBy == false && ms->IO.RangeSrcItem != ImGuiSelectionUserData_Invalid)) // Can't read storage->RangeSrcItem here -> we want the state at begining of the scope (see tests for easy failure) + { + IMGUI_DEBUG_LOG_SELECTION("[selection] EndMultiSelect: Reset RangeSrcItem.\n"); // Will set be to NavId. + storage->RangeSrcItem = ImGuiSelectionUserData_Invalid; + } + if (ms->NavIdPassedBy == false && storage->NavIdItem != ImGuiSelectionUserData_Invalid) + { + IMGUI_DEBUG_LOG_SELECTION("[selection] EndMultiSelect: Reset NavIdItem.\n"); + storage->NavIdItem = ImGuiSelectionUserData_Invalid; + storage->NavIdSelected = -1; + } + + if ((ms->Flags & (ImGuiMultiSelectFlags_BoxSelect1d | ImGuiMultiSelectFlags_BoxSelect2d)) && GetBoxSelectState(ms->BoxSelectId)) + EndBoxSelect(scope_rect, ms->Flags); + } + + if (ms->IsEndIO == false) + ms->IO.Requests.resize(0); + + // Clear selection when clicking void? + // We specifically test for IsMouseDragPastThreshold(0) == false to allow box-selection! + // The InnerRect test is necessary for non-child/decorated windows. + bool scope_hovered = IsWindowHovered() && window->InnerRect.Contains(g.IO.MousePos); + if (scope_hovered && (ms->Flags & ImGuiMultiSelectFlags_ScopeRect)) + scope_hovered &= scope_rect.Contains(g.IO.MousePos); + if (scope_hovered && g.HoveredId == 0 && g.ActiveId == 0) + { + if (ms->Flags & (ImGuiMultiSelectFlags_BoxSelect1d | ImGuiMultiSelectFlags_BoxSelect2d)) + { + if (!g.BoxSelectState.IsActive && !g.BoxSelectState.IsStarting && g.IO.MouseClickedCount[0] == 1) + { + BoxSelectPreStartDrag(ms->BoxSelectId, ImGuiSelectionUserData_Invalid); + FocusWindow(window, ImGuiFocusRequestFlags_UnlessBelowModal); + SetHoveredID(ms->BoxSelectId); + if (ms->Flags & ImGuiMultiSelectFlags_ScopeRect) + SetNavID(0, ImGuiNavLayer_Main, ms->FocusScopeId, ImRect(g.IO.MousePos, g.IO.MousePos)); // Automatically switch FocusScope for initial click from void to box-select. + } + } + + if (ms->Flags & ImGuiMultiSelectFlags_ClearOnClickVoid) + if (IsMouseReleased(0) && IsMouseDragPastThreshold(0) == false && g.IO.KeyMods == ImGuiMod_None) + MultiSelectAddSetAll(ms, false); + } + + // Courtesy nav wrapping helper flag + if (ms->Flags & ImGuiMultiSelectFlags_NavWrapX) + { + IM_ASSERT(ms->Flags & ImGuiMultiSelectFlags_ScopeWindow); // Only supported at window scope + ImGui::NavMoveRequestTryWrapping(ImGui::GetCurrentWindow(), ImGuiNavMoveFlags_WrapX); + } + + // Unwind + window->DC.CursorMaxPos = ImMax(ms->BackupCursorMaxPos, window->DC.CursorMaxPos); + PopFocusScope(); + + if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) + DebugLogMultiSelectRequests("EndMultiSelect", &ms->IO); + + ms->FocusScopeId = 0; + ms->Flags = ImGuiMultiSelectFlags_None; + g.CurrentMultiSelect = (--g.MultiSelectTempDataStacked > 0) ? &g.MultiSelectTempData[g.MultiSelectTempDataStacked - 1] : NULL; + + return &ms->IO; +} + +void ImGui::SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data) +{ + // Note that flags will be cleared by ItemAdd(), so it's only useful for Navigation code! + // This designed so widgets can also cheaply set this before calling ItemAdd(), so we are not tied to MultiSelect api. + ImGuiContext& g = *GImGui; + g.NextItemData.SelectionUserData = selection_user_data; + g.NextItemData.FocusScopeId = g.CurrentFocusScopeId; + + if (ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect) + { + // Auto updating RangeSrcPassedBy for cases were clipper is not used (done before ItemAdd() clipping) + g.NextItemData.ItemFlags |= ImGuiItemFlags_HasSelectionUserData | ImGuiItemFlags_IsMultiSelect; + if (ms->IO.RangeSrcItem == selection_user_data) + ms->RangeSrcPassedBy = true; + } + else + { + g.NextItemData.ItemFlags |= ImGuiItemFlags_HasSelectionUserData; + } +} + +// In charge of: +// - Applying SetAll for submitted items. +// - Applying SetRange for submitted items and record end points. +// - Altering button behavior flags to facilitate use with drag and drop. +void ImGui::MultiSelectItemHeader(ImGuiID id, bool* p_selected, ImGuiButtonFlags* p_button_flags) +{ + ImGuiContext& g = *GImGui; + ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect; + + bool selected = *p_selected; + if (ms->IsFocused) + { + ImGuiMultiSelectState* storage = ms->Storage; + ImGuiSelectionUserData item_data = g.NextItemData.SelectionUserData; + IM_ASSERT(g.NextItemData.FocusScopeId == g.CurrentFocusScopeId && "Forgot to call SetNextItemSelectionUserData() prior to item, required in BeginMultiSelect()/EndMultiSelect() scope"); + + // Apply SetAll (Clear/SelectAll) requests requested by BeginMultiSelect(). + // This is only useful if the user hasn't processed them already, and this only works if the user isn't using the clipper. + // If you are using a clipper you need to process the SetAll request after calling BeginMultiSelect() + if (ms->LoopRequestSetAll != -1) + selected = (ms->LoopRequestSetAll == 1); + + // When using SHIFT+Nav: because it can incur scrolling we cannot afford a frame of lag with the selection highlight (otherwise scrolling would happen before selection) + // For this to work, we need someone to set 'RangeSrcPassedBy = true' at some point (either clipper either SetNextItemSelectionUserData() function) + if (ms->IsKeyboardSetRange) + { + IM_ASSERT(id != 0 && (ms->KeyMods & ImGuiMod_Shift) != 0); + const bool is_range_dst = (ms->RangeDstPassedBy == false) && g.NavJustMovedToId == id; // Assume that g.NavJustMovedToId is not clipped. + if (is_range_dst) + ms->RangeDstPassedBy = true; + if (is_range_dst && storage->RangeSrcItem == ImGuiSelectionUserData_Invalid) // If we don't have RangeSrc, assign RangeSrc = RangeDst + { + storage->RangeSrcItem = item_data; + storage->RangeSelected = selected ? 1 : 0; + } + const bool is_range_src = storage->RangeSrcItem == item_data; + if (is_range_src || is_range_dst || ms->RangeSrcPassedBy != ms->RangeDstPassedBy) + { + // Apply range-select value to visible items + IM_ASSERT(storage->RangeSrcItem != ImGuiSelectionUserData_Invalid && storage->RangeSelected != -1); + selected = (storage->RangeSelected != 0); + } + else if ((ms->KeyMods & ImGuiMod_Ctrl) == 0 && (ms->Flags & ImGuiMultiSelectFlags_NoAutoClear) == 0) + { + // Clear other items + selected = false; + } + } + *p_selected = selected; + } + + // Alter button behavior flags + // To handle drag and drop of multiple items we need to avoid clearing selection on click. + // Enabling this test makes actions using CTRL+SHIFT delay their effect on MouseUp which is annoying, but it allows drag and drop of multiple items. + if (p_button_flags != NULL) + { + ImGuiButtonFlags button_flags = *p_button_flags; + button_flags |= ImGuiButtonFlags_NoHoveredOnFocus; + if ((!selected || (g.ActiveId == id && g.ActiveIdHasBeenPressedBefore)) && !(ms->Flags & ImGuiMultiSelectFlags_SelectOnClickRelease)) + button_flags = (button_flags | ImGuiButtonFlags_PressedOnClick) & ~ImGuiButtonFlags_PressedOnClickRelease; + else + button_flags |= ImGuiButtonFlags_PressedOnClickRelease; + *p_button_flags = button_flags; + } +} + +// In charge of: +// - Auto-select on navigation. +// - Box-select toggle handling. +// - Right-click handling. +// - Altering selection based on Ctrl/Shift modifiers, both for keyboard and mouse. +// - Record current selection state for RangeSrc +// This is all rather complex, best to run and refer to "widgets_multiselect_xxx" tests in imgui_test_suite. +void ImGui::MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + + bool selected = *p_selected; + bool pressed = *p_pressed; + ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect; + ImGuiMultiSelectState* storage = ms->Storage; + if (pressed) + ms->IsFocused = true; + + bool hovered = false; + if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredRect) + hovered = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup); + if (!ms->IsFocused && !hovered) + return; + + ImGuiSelectionUserData item_data = g.NextItemData.SelectionUserData; + + ImGuiMultiSelectFlags flags = ms->Flags; + const bool is_singleselect = (flags & ImGuiMultiSelectFlags_SingleSelect) != 0; + bool is_ctrl = (ms->KeyMods & ImGuiMod_Ctrl) != 0; + bool is_shift = (ms->KeyMods & ImGuiMod_Shift) != 0; + + bool apply_to_range_src = false; + + if (g.NavId == id && storage->RangeSrcItem == ImGuiSelectionUserData_Invalid) + apply_to_range_src = true; + if (ms->IsEndIO == false) + { + ms->IO.Requests.resize(0); + ms->IsEndIO = true; + } + + // Auto-select as you navigate a list + if (g.NavJustMovedToId == id) + { + if ((flags & ImGuiMultiSelectFlags_NoAutoSelect) == 0) + { + if (is_ctrl && is_shift) + pressed = true; + else if (!is_ctrl) + selected = pressed = true; + } + else + { + // With NoAutoSelect, using Shift+keyboard performs a write/copy + if (is_shift) + pressed = true; + else if (!is_ctrl) + apply_to_range_src = true; // Since if (pressed) {} main block is not running we update this + } + } + + if (apply_to_range_src) + { + storage->RangeSrcItem = item_data; + storage->RangeSelected = selected; // Will be updated at the end of this function anyway. + } + + // Box-select toggle handling + if (ms->BoxSelectId != 0) + if (ImGuiBoxSelectState* bs = GetBoxSelectState(ms->BoxSelectId)) + { + const bool rect_overlap_curr = bs->BoxSelectRectCurr.Overlaps(g.LastItemData.Rect); + const bool rect_overlap_prev = bs->BoxSelectRectPrev.Overlaps(g.LastItemData.Rect); + if ((rect_overlap_curr && !rect_overlap_prev && !selected) || (rect_overlap_prev && !rect_overlap_curr)) + { + if (storage->LastSelectionSize <= 0 && bs->IsStartedSetNavIdOnce) + { + pressed = true; // First item act as a pressed: code below will emit selection request and set NavId (whatever we emit here will be overridden anyway) + bs->IsStartedSetNavIdOnce = false; + } + else + { + selected = !selected; + MultiSelectAddSetRange(ms, selected, +1, item_data, item_data); + } + storage->LastSelectionSize = ImMax(storage->LastSelectionSize + 1, 1); + } + } + + // Right-click handling. + // FIXME-MULTISELECT: Currently filtered out by ImGuiMultiSelectFlags_NoAutoSelect but maybe should be moved to Selectable(). See https://github.com/ocornut/imgui/pull/5816 + if (hovered && IsMouseClicked(1) && (flags & ImGuiMultiSelectFlags_NoAutoSelect) == 0) + { + if (g.ActiveId != 0 && g.ActiveId != id) + ClearActiveID(); + SetFocusID(id, window); + if (!pressed && !selected) + { + pressed = true; + is_ctrl = is_shift = false; + } + } + + // Unlike Space, Enter doesn't alter selection (but can still return a press) unless current item is not selected. + // The later, "unless current item is not select", may become optional? It seems like a better default if Enter doesn't necessarily open something + // (unlike e.g. Windows explorer). For use case where Enter always open something, we might decide to make this optional? + const bool enter_pressed = pressed && (g.NavActivateId == id) && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput); + + // Alter selection + if (pressed && (!enter_pressed || !selected)) + { + // Box-select + ImGuiInputSource input_source = (g.NavJustMovedToId == id || g.NavActivateId == id) ? g.NavInputSource : ImGuiInputSource_Mouse; + if (flags & (ImGuiMultiSelectFlags_BoxSelect1d | ImGuiMultiSelectFlags_BoxSelect2d)) + if (selected == false && !g.BoxSelectState.IsActive && !g.BoxSelectState.IsStarting && input_source == ImGuiInputSource_Mouse && g.IO.MouseClickedCount[0] == 1) + BoxSelectPreStartDrag(ms->BoxSelectId, item_data); + + //---------------------------------------------------------------------------------------- + // ACTION | Begin | Pressed/Activated | End + //---------------------------------------------------------------------------------------- + // Keys Navigated: | Clear | Src=item, Sel=1 SetRange 1 + // Keys Navigated: Ctrl | n/a | n/a + // Keys Navigated: Shift | n/a | Dst=item, Sel=1, => Clear + SetRange 1 + // Keys Navigated: Ctrl+Shift | n/a | Dst=item, Sel=Src => Clear + SetRange Src-Dst + // Keys Activated: | n/a | Src=item, Sel=1 => Clear + SetRange 1 + // Keys Activated: Ctrl | n/a | Src=item, Sel=!Sel => SetSange 1 + // Keys Activated: Shift | n/a | Dst=item, Sel=1 => Clear + SetSange 1 + //---------------------------------------------------------------------------------------- + // Mouse Pressed: | n/a | Src=item, Sel=1, => Clear + SetRange 1 + // Mouse Pressed: Ctrl | n/a | Src=item, Sel=!Sel => SetRange 1 + // Mouse Pressed: Shift | n/a | Dst=item, Sel=1, => Clear + SetRange 1 + // Mouse Pressed: Ctrl+Shift | n/a | Dst=item, Sel=!Sel => SetRange Src-Dst + //---------------------------------------------------------------------------------------- + + if ((flags & ImGuiMultiSelectFlags_NoAutoClear) == 0) + { + bool request_clear = false; + if (is_singleselect) + request_clear = true; + else if ((input_source == ImGuiInputSource_Mouse || g.NavActivateId == id) && !is_ctrl) + request_clear = (flags & ImGuiMultiSelectFlags_NoAutoClearOnReselect) ? !selected : true; + else if ((input_source == ImGuiInputSource_Keyboard || input_source == ImGuiInputSource_Gamepad) && is_shift && !is_ctrl) + request_clear = true; // With is_shift==false the RequestClear was done in BeginIO, not necessary to do again. + if (request_clear) + MultiSelectAddSetAll(ms, false); + } + + int range_direction; + bool range_selected; + if (is_shift && !is_singleselect) + { + //IM_ASSERT(storage->HasRangeSrc && storage->HasRangeValue); + if (storage->RangeSrcItem == ImGuiSelectionUserData_Invalid) + storage->RangeSrcItem = item_data; + if ((flags & ImGuiMultiSelectFlags_NoAutoSelect) == 0) + { + // Shift+Arrow always select + // Ctrl+Shift+Arrow copy source selection state (already stored by BeginMultiSelect() in storage->RangeSelected) + range_selected = (is_ctrl && storage->RangeSelected != -1) ? (storage->RangeSelected != 0) : true; + } + else + { + // Shift+Arrow copy source selection state + // Shift+Click always copy from target selection state + if (ms->IsKeyboardSetRange) + range_selected = (storage->RangeSelected != -1) ? (storage->RangeSelected != 0) : true; + else + range_selected = !selected; + } + range_direction = ms->RangeSrcPassedBy ? +1 : -1; + } + else + { + // Ctrl inverts selection, otherwise always select + if ((flags & ImGuiMultiSelectFlags_NoAutoSelect) == 0) + selected = is_ctrl ? !selected : true; + else + selected = !selected; + storage->RangeSrcItem = item_data; + range_selected = selected; + range_direction = +1; + } + MultiSelectAddSetRange(ms, range_selected, range_direction, storage->RangeSrcItem, item_data); + } + + // Update/store the selection state of the Source item (used by CTRL+SHIFT, when Source is unselected we perform a range unselect) + if (storage->RangeSrcItem == item_data) + storage->RangeSelected = selected ? 1 : 0; + + // Update/store the selection state of focused item + if (g.NavId == id) + { + storage->NavIdItem = item_data; + storage->NavIdSelected = selected ? 1 : 0; + } + if (storage->NavIdItem == item_data) + ms->NavIdPassedBy = true; + ms->LastSubmittedItem = item_data; + + *p_selected = selected; + *p_pressed = pressed; +} + +void ImGui::MultiSelectAddSetAll(ImGuiMultiSelectTempData* ms, bool selected) +{ + ImGuiSelectionRequest req = { ImGuiSelectionRequestType_SetAll, selected, 0, ImGuiSelectionUserData_Invalid, ImGuiSelectionUserData_Invalid }; + ms->IO.Requests.resize(0); // Can always clear previous requests + ms->IO.Requests.push_back(req); // Add new request +} + +void ImGui::MultiSelectAddSetRange(ImGuiMultiSelectTempData* ms, bool selected, int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item) +{ + // Merge contiguous spans into same request (unless NoRangeSelect is set which guarantees single-item ranges) + if (ms->IO.Requests.Size > 0 && first_item == last_item && (ms->Flags & ImGuiMultiSelectFlags_NoRangeSelect) == 0) + { + ImGuiSelectionRequest* prev = &ms->IO.Requests.Data[ms->IO.Requests.Size - 1]; + if (prev->Type == ImGuiSelectionRequestType_SetRange && prev->RangeLastItem == ms->LastSubmittedItem && prev->Selected == selected) + { + prev->RangeLastItem = last_item; + return; + } + } + + ImGuiSelectionRequest req = { ImGuiSelectionRequestType_SetRange, selected, (ImS8)range_dir, (range_dir > 0) ? first_item : last_item, (range_dir > 0) ? last_item : first_item }; + ms->IO.Requests.push_back(req); // Add new request +} + +void ImGui::DebugNodeMultiSelectState(ImGuiMultiSelectState* storage) +{ +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + const bool is_active = (storage->LastFrameActive >= GetFrameCount() - 2); // Note that fully clipped early out scrolling tables will appear as inactive here. + if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); } + bool open = TreeNode((void*)(intptr_t)storage->ID, "MultiSelect 0x%08X in '%s'%s", storage->ID, storage->Window ? storage->Window->Name : "N/A", is_active ? "" : " *Inactive*"); + if (!is_active) { PopStyleColor(); } + if (!open) + return; + Text("RangeSrcItem = %" IM_PRId64 " (0x%" IM_PRIX64 "), RangeSelected = %d", storage->RangeSrcItem, storage->RangeSrcItem, storage->RangeSelected); + Text("NavIdItem = %" IM_PRId64 " (0x%" IM_PRIX64 "), NavIdSelected = %d", storage->NavIdItem, storage->NavIdItem, storage->NavIdSelected); + Text("LastSelectionSize = %d", storage->LastSelectionSize); // Provided by user + TreePop(); +#else + IM_UNUSED(storage); +#endif +} + +//------------------------------------------------------------------------- +// [SECTION] Widgets: Multi-Select helpers +//------------------------------------------------------------------------- +// - ImGuiSelectionBasicStorage +// - ImGuiSelectionExternalStorage +//------------------------------------------------------------------------- + +ImGuiSelectionBasicStorage::ImGuiSelectionBasicStorage() +{ + Size = 0; + PreserveOrder = false; + UserData = NULL; + AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage*, int idx) { return (ImGuiID)idx; }; + _SelectionOrder = 1; // Always >0 +} + +void ImGuiSelectionBasicStorage::Clear() +{ + Size = 0; + _SelectionOrder = 1; // Always >0 + _Storage.Data.resize(0); +} + +void ImGuiSelectionBasicStorage::Swap(ImGuiSelectionBasicStorage& r) +{ + ImSwap(Size, r.Size); + ImSwap(_SelectionOrder, r._SelectionOrder); + _Storage.Data.swap(r._Storage.Data); +} + +bool ImGuiSelectionBasicStorage::Contains(ImGuiID id) const +{ + return _Storage.GetInt(id, 0) != 0; +} + +static int IMGUI_CDECL PairComparerByValueInt(const void* lhs, const void* rhs) +{ + int lhs_v = ((const ImGuiStoragePair*)lhs)->val_i; + int rhs_v = ((const ImGuiStoragePair*)rhs)->val_i; + return (lhs_v > rhs_v ? +1 : lhs_v < rhs_v ? -1 : 0); +} + +// GetNextSelectedItem() is an abstraction allowing us to change our underlying actual storage system without impacting user. +// (e.g. store unselected vs compact down, compact down on demand, use raw ImVector instead of ImGuiStorage...) +bool ImGuiSelectionBasicStorage::GetNextSelectedItem(void** opaque_it, ImGuiID* out_id) +{ + ImGuiStoragePair* it = (ImGuiStoragePair*)*opaque_it; + ImGuiStoragePair* it_end = _Storage.Data.Data + _Storage.Data.Size; + if (PreserveOrder && it == NULL && it_end != NULL) + ImQsort(_Storage.Data.Data, (size_t)_Storage.Data.Size, sizeof(ImGuiStoragePair), PairComparerByValueInt); // ~ImGuiStorage::BuildSortByValueInt() + if (it == NULL) + it = _Storage.Data.Data; + IM_ASSERT(it >= _Storage.Data.Data && it <= it_end); + if (it != it_end) + while (it->val_i == 0 && it < it_end) + it++; + const bool has_more = (it != it_end); + *opaque_it = has_more ? (void**)(it + 1) : (void**)(it); + *out_id = has_more ? it->key : 0; + if (PreserveOrder && !has_more) + _Storage.BuildSortByKey(); + return has_more; +} + +void ImGuiSelectionBasicStorage::SetItemSelected(ImGuiID id, bool selected) +{ + int* p_int = _Storage.GetIntRef(id, 0); + if (selected && *p_int == 0) { *p_int = _SelectionOrder++; Size++; } + else if (!selected && *p_int != 0) { *p_int = 0; Size--; } +} + +// Optimized for batch edits (with same value of 'selected') +static void ImGuiSelectionBasicStorage_BatchSetItemSelected(ImGuiSelectionBasicStorage* selection, ImGuiID id, bool selected, int size_before_amends, int selection_order) +{ + ImGuiStorage* storage = &selection->_Storage; + ImGuiStoragePair* it = ImLowerBound(storage->Data.Data, storage->Data.Data + size_before_amends, id); + const bool is_contained = (it != storage->Data.Data + size_before_amends) && (it->key == id); + if (selected == (is_contained && it->val_i != 0)) + return; + if (selected && !is_contained) + storage->Data.push_back(ImGuiStoragePair(id, selection_order)); // Push unsorted at end of vector, will be sorted in SelectionMultiAmendsFinish() + else if (is_contained) + it->val_i = selected ? selection_order : 0; // Modify in-place. + selection->Size += selected ? +1 : -1; +} + +static void ImGuiSelectionBasicStorage_BatchFinish(ImGuiSelectionBasicStorage* selection, bool selected, int size_before_amends) +{ + ImGuiStorage* storage = &selection->_Storage; + if (selected && selection->Size != size_before_amends) + storage->BuildSortByKey(); // When done selecting: sort everything +} + +// Apply requests coming from BeginMultiSelect() and EndMultiSelect(). +// - Enable 'Demo->Tools->Debug Log->Selection' to see selection requests as they happen. +// - Honoring SetRange requests requires that you can iterate/interpolate between RangeFirstItem and RangeLastItem. +// - In this demo we often submit indices to SetNextItemSelectionUserData() + store the same indices in persistent selection. +// - Your code may do differently. If you store pointers or objects ID in ImGuiSelectionUserData you may need to perform +// a lookup in order to have some way to iterate/interpolate between two items. +// - A full-featured application is likely to allow search/filtering which is likely to lead to using indices +// and constructing a view index <> object id/ptr data structure anyway. +// WHEN YOUR APPLICATION SETTLES ON A CHOICE, YOU WILL PROBABLY PREFER TO GET RID OF THIS UNNECESSARY 'ImGuiSelectionBasicStorage' INDIRECTION LOGIC. +// Notice that with the simplest adapter (using indices everywhere), all functions return their parameters. +// The most simple implementation (using indices everywhere) would look like: +// for (ImGuiSelectionRequest& req : ms_io->Requests) +// { +// if (req.Type == ImGuiSelectionRequestType_SetAll) { Clear(); if (req.Selected) { for (int n = 0; n < items_count; n++) { SetItemSelected(n, true); } } +// if (req.Type == ImGuiSelectionRequestType_SetRange) { for (int n = (int)ms_io->RangeFirstItem; n <= (int)ms_io->RangeLastItem; n++) { SetItemSelected(n, ms_io->Selected); } } +// } +void ImGuiSelectionBasicStorage::ApplyRequests(ImGuiMultiSelectIO* ms_io) +{ + // For convenience we obtain ItemsCount as passed to BeginMultiSelect(), which is optional. + // It makes sense when using ImGuiSelectionBasicStorage to simply pass your items count to BeginMultiSelect(). + // Other scheme may handle SetAll differently. + IM_ASSERT(ms_io->ItemsCount != -1 && "Missing value for items_count in BeginMultiSelect() call!"); + IM_ASSERT(AdapterIndexToStorageId != NULL); + + // This is optimized/specialized to cope with very large selections (e.g. 100k+ items) + // - A simpler version could call SetItemSelected() directly instead of ImGuiSelectionBasicStorage_BatchSetItemSelected() + ImGuiSelectionBasicStorage_BatchFinish(). + // - Optimized select can append unsorted, then sort in a second pass. Optimized unselect can clear in-place then compact in a second pass. + // - A more optimal version wouldn't even use ImGuiStorage but directly a ImVector to reduce bandwidth, but this is a reasonable trade off to reuse code. + // - There are many ways this could be better optimized. The worse case scenario being: using BoxSelect2d in a grid, box-select scrolling down while wiggling + // left and right: it affects coarse clipping + can emit multiple SetRange with 1 item each.) + // FIXME-OPT: For each block of consecutive SetRange request: + // - add all requests to a sorted list, store ID, selected, offset in ImGuiStorage. + // - rewrite sorted storage a single time. + for (ImGuiSelectionRequest& req : ms_io->Requests) + { + if (req.Type == ImGuiSelectionRequestType_SetAll) + { + Clear(); + if (req.Selected) + { + _Storage.Data.reserve(ms_io->ItemsCount); + const int size_before_amends = _Storage.Data.Size; + for (int idx = 0; idx < ms_io->ItemsCount; idx++, _SelectionOrder++) + ImGuiSelectionBasicStorage_BatchSetItemSelected(this, GetStorageIdFromIndex(idx), req.Selected, size_before_amends, _SelectionOrder); + ImGuiSelectionBasicStorage_BatchFinish(this, req.Selected, size_before_amends); + } + } + else if (req.Type == ImGuiSelectionRequestType_SetRange) + { + const int selection_changes = (int)req.RangeLastItem - (int)req.RangeFirstItem + 1; + //ImGuiContext& g = *GImGui; IMGUI_DEBUG_LOG_SELECTION("Req %d/%d: set %d to %d\n", ms_io->Requests.index_from_ptr(&req), ms_io->Requests.Size, selection_changes, req.Selected); + if (selection_changes == 1 || (selection_changes < Size / 100)) + { + // Multiple sorted insertion + copy likely to be faster. + // Technically we could do a single copy with a little more work (sort sequential SetRange requests) + for (int idx = (int)req.RangeFirstItem; idx <= (int)req.RangeLastItem; idx++) + SetItemSelected(GetStorageIdFromIndex(idx), req.Selected); + } + else + { + // Append insertion + single sort likely be faster. + // Use req.RangeDirection to set order field so that shift+clicking from 1 to 5 is different than shift+clicking from 5 to 1 + const int size_before_amends = _Storage.Data.Size; + int selection_order = _SelectionOrder + ((req.RangeDirection < 0) ? selection_changes - 1 : 0); + for (int idx = (int)req.RangeFirstItem; idx <= (int)req.RangeLastItem; idx++, selection_order += req.RangeDirection) + ImGuiSelectionBasicStorage_BatchSetItemSelected(this, GetStorageIdFromIndex(idx), req.Selected, size_before_amends, selection_order); + if (req.Selected) + _SelectionOrder += selection_changes; + ImGuiSelectionBasicStorage_BatchFinish(this, req.Selected, size_before_amends); + } + } + } +} + +//------------------------------------------------------------------------- + +ImGuiSelectionExternalStorage::ImGuiSelectionExternalStorage() +{ + UserData = NULL; + AdapterSetItemSelected = NULL; +} + +// Apply requests coming from BeginMultiSelect() and EndMultiSelect(). +// We also pull 'ms_io->ItemsCount' as passed for BeginMultiSelect() for consistency with ImGuiSelectionBasicStorage +// This makes no assumption about underlying storage. +void ImGuiSelectionExternalStorage::ApplyRequests(ImGuiMultiSelectIO* ms_io) +{ + IM_ASSERT(AdapterSetItemSelected); + for (ImGuiSelectionRequest& req : ms_io->Requests) + { + if (req.Type == ImGuiSelectionRequestType_SetAll) + for (int idx = 0; idx < ms_io->ItemsCount; idx++) + AdapterSetItemSelected(this, idx, req.Selected); + if (req.Type == ImGuiSelectionRequestType_SetRange) + for (int idx = (int)req.RangeFirstItem; idx <= (int)req.RangeLastItem; idx++) + AdapterSetItemSelected(this, idx, req.Selected); + } +} + +//------------------------------------------------------------------------- +// [SECTION] Widgets: ListBox +//------------------------------------------------------------------------- +// - BeginListBox() +// - EndListBox() +// - ListBox() +//------------------------------------------------------------------------- + +// This is essentially a thin wrapper to using BeginChild/EndChild with the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label. +// This handle some subtleties with capturing info from the label, but for 99% uses it could essentially be rewritten as: +// if (ImGui::BeginChild("...", ImVec2(ImGui::CalcItemWidth(), ImGui::GetTextLineHeight() * 7.5f), ImGuiChildFlags_FrameStyle)) +// { .... } +// ImGui::EndChild(); +// ImGui::SameLine(); +// ImGui::AlignTextToFramePadding(); +// ImGui::Text("Label"); +// Tip: To have a list filling the entire window width, use size.x = -FLT_MIN and pass an non-visible label e.g. "##empty" +// Tip: If your vertical size is calculated from an item count (e.g. 10 * item_height) consider adding a fractional part to facilitate seeing scrolling boundaries (e.g. 10.25 * item_height). +bool ImGui::BeginListBox(const char* label, const ImVec2& size_arg) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = GetCurrentWindow(); + if (window->SkipItems) + return false; + + const ImGuiStyle& style = g.Style; + const ImGuiID id = GetID(label); + const ImVec2 label_size = CalcTextSize(label, NULL, true); + + // Size default to hold ~7.25 items. + // Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar. + ImVec2 size = ImTrunc(CalcItemSize(size_arg, CalcItemWidth(), GetTextLineHeightWithSpacing() * 7.25f + style.FramePadding.y * 2.0f)); + ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y)); + ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size); + ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); + g.NextItemData.ClearFlags(); + + if (!IsRectVisible(bb.Min, bb.Max)) + { + ItemSize(bb.GetSize(), style.FramePadding.y); + ItemAdd(bb, 0, &frame_bb); + g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values + return false; + } + + // FIXME-OPT: We could omit the BeginGroup() if label_size.x == 0.0f but would need to omit the EndGroup() as well. + BeginGroup(); + if (label_size.x > 0.0f) + { + ImVec2 label_pos = ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y); + RenderText(label_pos, label); + window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, label_pos + label_size); + AlignTextToFramePadding(); + } + + BeginChild(id, frame_bb.GetSize(), ImGuiChildFlags_FrameStyle); + return true; +} + +void ImGui::EndListBox() +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + IM_ASSERT((window->Flags & ImGuiWindowFlags_ChildWindow) && "Mismatched BeginListBox/EndListBox calls. Did you test the return value of BeginListBox?"); + IM_UNUSED(window); + + EndChild(); + EndGroup(); // This is only required to be able to do IsItemXXX query on the whole ListBox including label +} + +bool ImGui::ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_items) +{ + const bool value_changed = ListBox(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_items); + return value_changed; +} + +// This is merely a helper around BeginListBox(), EndListBox(). +// Considering using those directly to submit custom data or store selection differently. +bool ImGui::ListBox(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int height_in_items) +{ + ImGuiContext& g = *GImGui; + + // Calculate size from "height_in_items" + if (height_in_items < 0) + height_in_items = ImMin(items_count, 7); float height_in_items_f = height_in_items + 0.25f; - ImVec2 size(0.0f, ImFloor(GetTextLineHeightWithSpacing() * height_in_items_f + g.Style.FramePadding.y * 2.0f)); + ImVec2 size(0.0f, ImTrunc(GetTextLineHeightWithSpacing() * height_in_items_f + g.Style.FramePadding.y * 2.0f)); if (!BeginListBox(label, size)) return false; @@ -6698,11 +8299,12 @@ bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(v bool value_changed = false; ImGuiListClipper clipper; clipper.Begin(items_count, GetTextLineHeightWithSpacing()); // We know exactly our line height here so we pass it as a minor optimization, but generally you don't need to. + clipper.IncludeItemByIndex(*current_item); while (clipper.Step()) for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) { - const char* item_text; - if (!items_getter(data, i, &item_text)) + const char* item_text = getter(user_data, i); + if (item_text == NULL) item_text = "*Unknown item*"; PushID(i); @@ -6754,9 +8356,10 @@ int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_get const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding); const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0)); ItemSize(total_bb, style.FramePadding.y); - if (!ItemAdd(total_bb, 0, &frame_bb)) + if (!ItemAdd(total_bb, id, &frame_bb, ImGuiItemFlags_NoNav)) return -1; - const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags); + bool hovered; + ButtonBehavior(frame_bb, id, &hovered, NULL); // Determine scale from values if not specified if (scale_min == FLT_MAX || scale_max == FLT_MAX) @@ -7037,8 +8640,13 @@ void ImGui::EndMenuBar() IM_ASSERT(window->DC.NavLayersActiveMaskNext & (1 << layer)); // Sanity check (FIXME: Seems unnecessary) FocusWindow(window); SetNavID(window->NavLastIds[layer], layer, 0, window->NavRectRel[layer]); - g.NavDisableHighlight = true; // Hide highlight for the current frame so we don't see the intermediary selection. - g.NavDisableMouseHover = g.NavMousePosDirty = true; + // FIXME-NAV: How to deal with this when not using g.IO.ConfigNavCursorVisibleAuto? + if (g.NavCursorVisible) + { + g.NavCursorVisible = false; // Hide nav cursor for the current frame so we don't see the intermediary selection. Will be set again + g.NavCursorHideFrames = 2; + } + g.NavHighlightItemUnderNav = g.NavMousePosDirty = true; NavMoveRequestForward(g.NavMoveDir, g.NavMoveClipDir, g.NavMoveFlags, g.NavMoveScrollFlags); // Repeat } } @@ -7049,12 +8657,18 @@ void ImGui::EndMenuBar() PopClipRect(); PopID(); window->DC.MenuBarOffset.x = window->DC.CursorPos.x - window->Pos.x; // Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos. - g.GroupStack.back().EmitItem = false; - EndGroup(); // Restore position on layer 0 + + // FIXME: Extremely confusing, cleanup by (a) working on WorkRect stack system (b) not using a Group confusingly here. + ImGuiGroupData& group_data = g.GroupStack.back(); + group_data.EmitItem = false; + ImVec2 restore_cursor_max_pos = group_data.BackupCursorMaxPos; + window->DC.IdealMaxPos.x = ImMax(window->DC.IdealMaxPos.x, window->DC.CursorMaxPos.x - window->Scroll.x); // Convert ideal extents for scrolling layer equivalent. + EndGroup(); // Restore position on layer 0 // FIXME: Misleading to use a group for that backup/restore window->DC.LayoutType = ImGuiLayoutType_Vertical; window->DC.IsSameLine = false; window->DC.NavLayerCurrent = ImGuiNavLayer_Main; window->DC.MenuBarAppending = false; + window->DC.CursorMaxPos = restore_cursor_max_pos; } // Important: calling order matters! @@ -7081,9 +8695,9 @@ bool ImGui::BeginViewportSideBar(const char* name, ImGuiViewport* viewport_p, Im // Report our size into work area (for next frame) using actual window size if (dir == ImGuiDir_Up || dir == ImGuiDir_Left) - viewport->BuildWorkOffsetMin[axis] += axis_size; + viewport->BuildWorkInsetMin[axis] += axis_size; else if (dir == ImGuiDir_Down || dir == ImGuiDir_Right) - viewport->BuildWorkOffsetMax[axis] -= axis_size; + viewport->BuildWorkInsetMax[axis] += axis_size; } window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove; @@ -7204,21 +8818,21 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) bool pressed; // We use ImGuiSelectableFlags_NoSetKeyOwner to allow down on one menu item, move, up on another. - const ImGuiSelectableFlags selectable_flags = ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_NoSetKeyOwner | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_DontClosePopups; + const ImGuiSelectableFlags selectable_flags = ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_NoSetKeyOwner | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_NoAutoClosePopups; if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) { // Menu inside an horizontal menu bar // Selectable extend their highlight by half ItemSpacing in each direction. // For ChildMenu, the popup position will be overwritten by the call to FindBestWindowPosForPopup() in Begin() - popup_pos = ImVec2(pos.x - 1.0f - IM_FLOOR(style.ItemSpacing.x * 0.5f), pos.y - style.FramePadding.y + window->MenuBarHeight()); - window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f); - PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y)); + popup_pos = ImVec2(pos.x - 1.0f - IM_TRUNC(style.ItemSpacing.x * 0.5f), pos.y - style.FramePadding.y + window->MenuBarHeight); + window->DC.CursorPos.x += IM_TRUNC(style.ItemSpacing.x * 0.5f); + PushStyleVarX(ImGuiStyleVar_ItemSpacing, style.ItemSpacing.x * 2.0f); float w = label_size.x; ImVec2 text_pos(window->DC.CursorPos.x + offsets->OffsetLabel, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset); pressed = Selectable("", menu_is_open, selectable_flags, ImVec2(w, label_size.y)); RenderText(text_pos, label); PopStyleVar(); - window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar(). + window->DC.CursorPos.x += IM_TRUNC(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar(). } else { @@ -7227,7 +8841,7 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) // Only when they are other items sticking out we're going to add spacing, yet only register minimum width into the layout system. popup_pos = ImVec2(pos.x, pos.y - style.WindowPadding.y); float icon_w = (icon && icon[0]) ? CalcTextSize(icon, NULL).x : 0.0f; - float checkmark_w = IM_FLOOR(g.FontSize * 1.20f); + float checkmark_w = IM_TRUNC(g.FontSize * 1.20f); float min_w = window->DC.MenuColumns.DeclColumns(icon_w, label_size.x, 0.0f, checkmark_w); // Feedback to next frame float extra_w = ImMax(0.0f, GetContentRegionAvail().x - min_w); ImVec2 text_pos(window->DC.CursorPos.x + offsets->OffsetLabel, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset); @@ -7240,11 +8854,12 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) if (!enabled) EndDisabled(); - const bool hovered = (g.HoveredId == id) && enabled && !g.NavDisableMouseHover; + const bool hovered = (g.HoveredId == id) && enabled && !g.NavHighlightItemUnderNav; if (menuset_is_open) PopItemFlag(); bool want_open = false; + bool want_open_nav_init = false; bool want_close = false; if (window->DC.LayoutType == ImGuiLayoutType_Vertical) // (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) { @@ -7255,18 +8870,18 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) ImGuiWindow* child_menu_window = (child_popup && child_popup->Window && child_popup->Window->ParentWindow == window) ? child_popup->Window : NULL; if (g.HoveredWindow == window && child_menu_window != NULL) { - float ref_unit = g.FontSize; // FIXME-DPI - float child_dir = (window->Pos.x < child_menu_window->Pos.x) ? 1.0f : -1.0f; - ImRect next_window_rect = child_menu_window->Rect(); + const float ref_unit = g.FontSize; // FIXME-DPI + const float child_dir = (window->Pos.x < child_menu_window->Pos.x) ? 1.0f : -1.0f; + const ImRect next_window_rect = child_menu_window->Rect(); ImVec2 ta = (g.IO.MousePos - g.IO.MouseDelta); ImVec2 tb = (child_dir > 0.0f) ? next_window_rect.GetTL() : next_window_rect.GetTR(); ImVec2 tc = (child_dir > 0.0f) ? next_window_rect.GetBL() : next_window_rect.GetBR(); - float extra = ImClamp(ImFabs(ta.x - tb.x) * 0.30f, ref_unit * 0.5f, ref_unit * 2.5f); // add a bit of extra slack. + const float pad_farmost_h = ImClamp(ImFabs(ta.x - tb.x) * 0.30f, ref_unit * 0.5f, ref_unit * 2.5f); // Add a bit of extra slack. ta.x += child_dir * -0.5f; tb.x += child_dir * ref_unit; tc.x += child_dir * ref_unit; - tb.y = ta.y + ImMax((tb.y - extra) - ta.y, -ref_unit * 8.0f); // triangle has maximum height to limit the slope and the bias toward large sub-menus - tc.y = ta.y + ImMin((tc.y + extra) - ta.y, +ref_unit * 8.0f); + tb.y = ta.y + ImMax((tb.y - pad_farmost_h) - ta.y, -ref_unit * 8.0f); // Triangle has maximum height to limit the slope and the bias toward large sub-menus + tc.y = ta.y + ImMin((tc.y + pad_farmost_h) - ta.y, +ref_unit * 8.0f); moving_toward_child_menu = ImTriangleContainsPoint(ta, tb, tc, g.IO.MousePos); //GetForegroundDrawList()->AddTriangleFilled(ta, tb, tc, moving_toward_child_menu ? IM_COL32(0,128,0,128) : IM_COL32(128,0,0,128)); // [DEBUG] } @@ -7274,18 +8889,22 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) // The 'HovereWindow == window' check creates an inconsistency (e.g. moving away from menu slowly tends to hit same window, whereas moving away fast does not) // But we also need to not close the top-menu menu when moving over void. Perhaps we should extend the triangle check to a larger polygon. // (Remember to test this on BeginPopup("A")->BeginMenu("B") sequence which behaves slightly differently as B isn't a Child of A and hovering isn't shared.) - if (menu_is_open && !hovered && g.HoveredWindow == window && !moving_toward_child_menu && !g.NavDisableMouseHover) + if (menu_is_open && !hovered && g.HoveredWindow == window && !moving_toward_child_menu && !g.NavHighlightItemUnderNav && g.ActiveId == 0) want_close = true; // Open + // (note: at this point 'hovered' actually includes the NavDisableMouseHover == false test) if (!menu_is_open && pressed) // Click/activate to open want_open = true; else if (!menu_is_open && hovered && !moving_toward_child_menu) // Hover to open want_open = true; + else if (!menu_is_open && hovered && g.HoveredIdTimer >= 0.30f && g.MouseStationaryTimer >= 0.30f) // Hover to open (timer fallback) + want_open = true; if (g.NavId == id && g.NavMoveDir == ImGuiDir_Right) // Nav-Right to open { - want_open = true; + want_open = want_open_nav_init = true; NavMoveRequestCancel(); + SetNavCursorVisibleAfterMove(); } } else @@ -7317,13 +8936,13 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) if (want_open && !menu_is_open && g.OpenPopupStack.Size > g.BeginPopupStack.Size) { - // Don't reopen/recycle same menu level in the same frame, first close the other menu and yield for a frame. + // Don't reopen/recycle same menu level in the same frame if it is a different menu ID, first close the other menu and yield for a frame. OpenPopup(label); } else if (want_open) { menu_is_open = true; - OpenPopup(label); + OpenPopup(label, ImGuiPopupFlags_NoReopen);// | (want_open_nav_init ? ImGuiPopupFlags_NoReopenAlwaysNavInit : 0)); } if (menu_is_open) @@ -7335,6 +8954,14 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) PopStyleVar(); if (menu_is_open) { + // Implement what ImGuiPopupFlags_NoReopenAlwaysNavInit would do: + // Perform an init request in the case the popup was already open (via a previous mouse hover) + if (want_open && want_open_nav_init && !g.NavInitRequest) + { + FocusWindow(g.CurrentWindow, ImGuiFocusRequestFlags_UnlessBelowModal); + NavInitWindow(g.CurrentWindow, false); + } + // Restore LastItemData so IsItemXXXX functions can work after BeginMenu()/EndMenu() // (This fixes using IsItemClicked() and IsItemHovered(), but IsItemHovered() also relies on its support for ImGuiItemFlags_NoWindowHoverableCheck) g.LastItemData = last_item_in_parent; @@ -7404,14 +9031,14 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut // Mimic the exact layout spacing of BeginMenu() to allow MenuItem() inside a menu bar, which is a little misleading but may be useful // Note that in this situation: we don't render the shortcut, we render a highlight instead of the selected tick mark. float w = label_size.x; - window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f); + window->DC.CursorPos.x += IM_TRUNC(style.ItemSpacing.x * 0.5f); ImVec2 text_pos(window->DC.CursorPos.x + offsets->OffsetLabel, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset); - PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y)); + PushStyleVarX(ImGuiStyleVar_ItemSpacing, style.ItemSpacing.x * 2.0f); pressed = Selectable("", selected, selectable_flags, ImVec2(w, 0.0f)); PopStyleVar(); if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible) RenderText(text_pos, label); - window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar(). + window->DC.CursorPos.x += IM_TRUNC(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar(). } else { @@ -7420,7 +9047,7 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut // Only when they are other items sticking out we're going to add spacing, yet only register minimum width into the layout system. float icon_w = (icon && icon[0]) ? CalcTextSize(icon, NULL).x : 0.0f; float shortcut_w = (shortcut && shortcut[0]) ? CalcTextSize(shortcut, NULL).x : 0.0f; - float checkmark_w = IM_FLOOR(g.FontSize * 1.20f); + float checkmark_w = IM_TRUNC(g.FontSize * 1.20f); float min_w = window->DC.MenuColumns.DeclColumns(icon_w, label_size.x, shortcut_w, checkmark_w); // Feedback for next frame float stretch_w = ImMax(0.0f, GetContentRegionAvail().x - min_w); pressed = Selectable("", false, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, label_size.y)); @@ -7565,7 +9192,11 @@ bool ImGui::BeginTabBar(const char* str_id, ImGuiTabBarFlags flags) ImGuiTabBar* tab_bar = g.TabBars.GetOrAddByKey(id); ImRect tab_bar_bb = ImRect(window->DC.CursorPos.x, window->DC.CursorPos.y, window->WorkRect.Max.x, window->DC.CursorPos.y + g.FontSize + g.Style.FramePadding.y * 2); tab_bar->ID = id; - return BeginTabBarEx(tab_bar, tab_bar_bb, flags | ImGuiTabBarFlags_IsFocused); + tab_bar->SeparatorMinX = tab_bar->BarRect.Min.x - IM_TRUNC(window->WindowPadding.x * 0.5f); + tab_bar->SeparatorMaxX = tab_bar->BarRect.Max.x + IM_TRUNC(window->WindowPadding.x * 0.5f); + //if (g.NavWindow && IsWindowChildOf(g.NavWindow, window, false, false)) + flags |= ImGuiTabBarFlags_IsFocused; + return BeginTabBarEx(tab_bar, tab_bar_bb, flags); } bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImGuiTabBarFlags flags) @@ -7575,12 +9206,14 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG if (window->SkipItems) return false; + IM_ASSERT(tab_bar->ID != 0); if ((flags & ImGuiTabBarFlags_DockNode) == 0) PushOverrideID(tab_bar->ID); // Add to stack g.CurrentTabBarStack.push_back(GetTabBarRefFromTabBar(tab_bar)); g.CurrentTabBar = tab_bar; + tab_bar->Window = window; // Append with multiple BeginTabBar()/EndTabBar() pairs. tab_bar->BackupCursorPos = window->DC.CursorPos; @@ -7617,12 +9250,12 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG window->DC.CursorPos = ImVec2(tab_bar->BarRect.Min.x, tab_bar->BarRect.Max.y + tab_bar->ItemSpacingY); // Draw separator - const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive); - const float y = tab_bar->BarRect.Max.y - 1.0f; + // (it would be misleading to draw this in EndTabBar() suggesting that it may be drawn over tabs, as tab bar are appendable) + const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabSelected : ImGuiCol_TabDimmedSelected); + if (g.Style.TabBarBorderSize > 0.0f) { - const float separator_min_x = tab_bar->BarRect.Min.x - IM_FLOOR(window->WindowPadding.x * 0.5f); - const float separator_max_x = tab_bar->BarRect.Max.x + IM_FLOOR(window->WindowPadding.x * 0.5f); - window->DrawList->AddLine(ImVec2(separator_min_x, y), ImVec2(separator_max_x, y), col, 1.0f); + const float y = tab_bar->BarRect.Max.y; + window->DrawList->AddRectFilled(ImVec2(tab_bar->SeparatorMinX, y - g.Style.TabBarBorderSize), ImVec2(tab_bar->SeparatorMaxX, y), col); } return true; } @@ -7829,7 +9462,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar) for (int tab_n = shrink_data_offset; tab_n < shrink_data_offset + shrink_data_count; tab_n++) { ImGuiTabItem* tab = &tab_bar->Tabs[g.ShrinkWidthBuffer[tab_n].Index]; - float shrinked_width = IM_FLOOR(g.ShrinkWidthBuffer[tab_n].Width); + float shrinked_width = IM_TRUNC(g.ShrinkWidthBuffer[tab_n].Width); if (shrinked_width < 0.0f) continue; @@ -7960,7 +9593,7 @@ ImGuiTabItem* ImGui::TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order) ImGuiTabItem* ImGui::TabBarGetCurrentTab(ImGuiTabBar* tab_bar) { - if (tab_bar->LastTabItemIdx <= 0 || tab_bar->LastTabItemIdx >= tab_bar->Tabs.Size) + if (tab_bar->LastTabItemIdx < 0 || tab_bar->LastTabItemIdx >= tab_bar->Tabs.Size) return NULL; return &tab_bar->Tabs[tab_bar->LastTabItemIdx]; } @@ -7989,7 +9622,7 @@ void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) if (tab->Flags & ImGuiTabItemFlags_Button) return; // A button appended with TabItemButton(). - if (!(tab->Flags & ImGuiTabItemFlags_UnsavedDocument)) + if ((tab->Flags & (ImGuiTabItemFlags_UnsavedDocument | ImGuiTabItemFlags_NoAssumedClosure)) == 0) { // This will remove a frame of lag for selecting another tab on closure. // However we don't run it in the case where the 'Unsaved' flag is set, so user gets a chance to fully undo the closure @@ -8053,6 +9686,13 @@ void ImGui::TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) tab_bar->NextSelectedTabId = tab->ID; } +void ImGui::TabBarQueueFocus(ImGuiTabBar* tab_bar, const char* tab_name) +{ + IM_ASSERT((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0); // Only supported for manual/explicit tab bars + ImGuiID tab_id = TabBarCalcTabID(tab_bar, tab_name, NULL); + tab_bar->NextSelectedTabId = tab_id; +} + void ImGui::TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset) { IM_ASSERT(offset != 0); @@ -8145,17 +9785,19 @@ static ImGuiTabItem* ImGui::TabBarScrollingButtons(ImGuiTabBar* tab_bar) PushStyleColor(ImGuiCol_Text, arrow_col); PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); + PushItemFlag(ImGuiItemFlags_ButtonRepeat, true); const float backup_repeat_delay = g.IO.KeyRepeatDelay; const float backup_repeat_rate = g.IO.KeyRepeatRate; g.IO.KeyRepeatDelay = 0.250f; g.IO.KeyRepeatRate = 0.200f; float x = ImMax(tab_bar->BarRect.Min.x, tab_bar->BarRect.Max.x - scrolling_buttons_width); window->DC.CursorPos = ImVec2(x, tab_bar->BarRect.Min.y); - if (ArrowButtonEx("##<", ImGuiDir_Left, arrow_button_size, ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat)) + if (ArrowButtonEx("##<", ImGuiDir_Left, arrow_button_size, ImGuiButtonFlags_PressedOnClick)) select_dir = -1; window->DC.CursorPos = ImVec2(x + arrow_button_size.x, tab_bar->BarRect.Min.y); - if (ArrowButtonEx("##>", ImGuiDir_Right, arrow_button_size, ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat)) + if (ArrowButtonEx("##>", ImGuiDir_Right, arrow_button_size, ImGuiButtonFlags_PressedOnClick)) select_dir = +1; + PopItemFlag(); PopStyleColor(2); g.IO.KeyRepeatRate = backup_repeat_rate; g.IO.KeyRepeatDelay = backup_repeat_delay; @@ -8349,7 +9991,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, // Calculate tab contents size ImVec2 size = TabItemCalcSize(label, (p_open != NULL) || (flags & ImGuiTabItemFlags_UnsavedDocument)); tab->RequestedWidth = -1.0f; - if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasWidth) + if (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasWidth) size.x = tab->RequestedWidth = g.NextItemData.Width; if (tab_is_new) tab->Width = ImMax(1.0f, size.x); @@ -8416,7 +10058,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, const bool is_central_section = (tab->Flags & ImGuiTabItemFlags_SectionMask_) == 0; size.x = tab->Width; if (is_central_section) - window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(IM_FLOOR(tab->Offset - tab_bar->ScrollingAnim), 0.0f); + window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(IM_TRUNC(tab->Offset - tab_bar->ScrollingAnim), 0.0f); else window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(tab->Offset, 0.0f); ImVec2 pos = window->DC.CursorPos; @@ -8470,7 +10112,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, if (hovered && g.HoveredIdNotActiveTimer > TOOLTIP_DELAY && bb.GetWidth() < tab->ContentWidth) { // Enlarge tab display when hovering - bb.Max.x = bb.Min.x + IM_FLOOR(ImLerp(bb.GetWidth(), tab->ContentWidth, ImSaturate((g.HoveredIdNotActiveTimer - 0.40f) * 6.0f))); + bb.Max.x = bb.Min.x + IM_TRUNC(ImLerp(bb.GetWidth(), tab->ContentWidth, ImSaturate((g.HoveredIdNotActiveTimer - 0.40f) * 6.0f))); display_draw_list = GetForegroundDrawList(window); TabItemBackground(display_draw_list, bb, flags, GetColorU32(ImGuiCol_TitleBgActive)); } @@ -8478,13 +10120,21 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, // Render tab shape ImDrawList* display_draw_list = window->DrawList; - const ImU32 tab_col = GetColorU32((held || hovered) ? ImGuiCol_TabHovered : tab_contents_visible ? (tab_bar_focused ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive) : (tab_bar_focused ? ImGuiCol_Tab : ImGuiCol_TabUnfocused)); + const ImU32 tab_col = GetColorU32((held || hovered) ? ImGuiCol_TabHovered : tab_contents_visible ? (tab_bar_focused ? ImGuiCol_TabSelected : ImGuiCol_TabDimmedSelected) : (tab_bar_focused ? ImGuiCol_Tab : ImGuiCol_TabDimmed)); TabItemBackground(display_draw_list, bb, flags, tab_col); - RenderNavHighlight(bb, id); + if (tab_contents_visible && (tab_bar->Flags & ImGuiTabBarFlags_DrawSelectedOverline) && style.TabBarOverlineSize > 0.0f) + { + float x_offset = IM_TRUNC(0.4f * style.TabRounding); + if (x_offset < 2.0f * g.CurrentDpiScale) + x_offset = 0.0f; + float y_offset = 1.0f * g.CurrentDpiScale; + display_draw_list->AddLine(bb.GetTL() + ImVec2(x_offset, y_offset), bb.GetTR() + ImVec2(-x_offset, y_offset), GetColorU32(tab_bar_focused ? ImGuiCol_TabSelectedOverline : ImGuiCol_TabDimmedSelectedOverline), style.TabBarOverlineSize); + } + RenderNavCursor(bb, id); // Select with right mouse button. This is so the common idiom for context menu automatically highlight the current widget. const bool hovered_unblocked = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup); - if (hovered_unblocked && (IsMouseClicked(1) || IsMouseReleased(1)) && !is_tab_button) + if (tab_bar->SelectedTabId != tab->ID && hovered_unblocked && (IsMouseClicked(1) || IsMouseReleased(1)) && !is_tab_button) TabBarQueueFocus(tab_bar, tab); if (tab_bar->Flags & ImGuiTabBarFlags_NoCloseWithMiddleMouseButton) @@ -8564,7 +10214,7 @@ void ImGui::TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabI IM_ASSERT(width > 0.0f); const float rounding = ImMax(0.0f, ImMin((flags & ImGuiTabItemFlags_Button) ? g.Style.FrameRounding : g.Style.TabRounding, width * 0.5f - 1.0f)); const float y1 = bb.Min.y + 1.0f; - const float y2 = bb.Max.y - 1.0f; + const float y2 = bb.Max.y - g.Style.TabBarBorderSize; draw_list->PathLineTo(ImVec2(bb.Min.x, y2)); draw_list->PathArcToFast(ImVec2(bb.Min.x + rounding, y1 + rounding), rounding, 6, 9); draw_list->PathArcToFast(ImVec2(bb.Max.x - rounding, y1 + rounding), rounding, 9, 12); @@ -8643,7 +10293,7 @@ void ImGui::TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, } else if (unsaved_marker_visible) { - const ImRect bullet_bb(button_pos, button_pos + ImVec2(button_sz, button_sz) + g.Style.FramePadding * 2.0f); + const ImRect bullet_bb(button_pos, button_pos + ImVec2(button_sz, button_sz)); RenderBullet(draw_list, bullet_bb.GetCenter(), GetColorU32(ImGuiCol_Text)); } diff --git a/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl b/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl deleted file mode 100644 index 4ca722f4..00000000 --- a/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl +++ /dev/null @@ -1,252 +0,0 @@ -#include - -#ifdef _MSC_VER -# define snprintf _snprintf -#endif - -namespace ImGui -{ -// const char* title; -// if (Begin(title, &Open)) -// { -// End(); -// } - - void MemoryEditor::Draw(void* mem_data_void, int mem_size, int base_display_addr) - { - PushFont(Font::Mono); - - unsigned char* mem_data = (unsigned char*)mem_data_void; - - BeginChild("##scrolling", ImVec2(0, -GetFrameHeight())); - - if (ImGui::BeginPopupContextWindow() ) - { - ImGui::Checkbox("HexII", &HexII); - ImGui::EndPopup(); - } - - PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f) ); - PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 0.0f) ); - - int addr_digits_count = 0; - for (int n = base_display_addr + mem_size - 1; n > 0; n >>= 4) - { - addr_digits_count++; - } - - float glyph_width = CalcTextSize("F").x; - float cell_width = glyph_width * 3; // "FF " we include trailing space in the width to easily catch clicks everywhere - - float line_height = GetTextLineHeight(); - int line_total_count = (int)((mem_size + Rows-1) / Rows); - ImGuiListClipper clipper; - clipper.Begin(line_total_count, line_height); - int visible_start_addr = clipper.DisplayStart * Rows; - int visible_end_addr = clipper.DisplayEnd * Rows; - - bool data_next = false; - - if (!AllowEdits || DataEditingAddr >= mem_size) - { - DataEditingAddr = -1; - } - - int data_editing_addr_backup = DataEditingAddr; - if (DataEditingAddr != -1) - { - if (IsKeyPressed(GetKeyIndex(ImGuiKey_UpArrow)) && DataEditingAddr >= Rows) { DataEditingAddr -= Rows; DataEditingTakeFocus = true; } - else if (IsKeyPressed(GetKeyIndex(ImGuiKey_DownArrow)) && DataEditingAddr < mem_size - Rows) { DataEditingAddr += Rows; DataEditingTakeFocus = true; } - else if (IsKeyPressed(GetKeyIndex(ImGuiKey_LeftArrow)) && DataEditingAddr > 0) { DataEditingAddr -= 1; DataEditingTakeFocus = true; } - else if (IsKeyPressed(GetKeyIndex(ImGuiKey_RightArrow)) && DataEditingAddr < mem_size - 1) { DataEditingAddr += 1; DataEditingTakeFocus = true; } - } - - if ((DataEditingAddr / Rows) != (data_editing_addr_backup / Rows)) - { - // Track cursor movements - float scroll_offset = ((DataEditingAddr / Rows) - (data_editing_addr_backup / Rows)) * line_height; - bool scroll_desired = (scroll_offset < 0.0f && DataEditingAddr < visible_start_addr + Rows*2) || (scroll_offset > 0.0f && DataEditingAddr > visible_end_addr - Rows*2); - if (scroll_desired) - { - SetScrollY(GetScrollY() + scroll_offset); - } - } - - bool draw_separator = true; - for (int line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible items - { - int addr = line_i * Rows; - Text("%0*x: ", addr_digits_count, base_display_addr+addr); - SameLine(); - - // Draw Hexadecimal - float line_start_x = GetCursorPosX(); - for (int n = 0; n < Rows && addr < mem_size; n++, addr++) - { - SameLine(line_start_x + cell_width * n); - - if (DataEditingAddr == addr) - { - // Display text input on current byte - PushID(addr); - struct FuncHolder - { - // FIXME: We should have a way to retrieve the text edit cursor position more easily in the API, this is rather tedious. - static int Callback(ImGuiInputTextCallbackData* data) - { - int* p_cursor_pos = (int*)data->UserData; - if (!data->HasSelection()) - { - *p_cursor_pos = data->CursorPos; - } - return 0; - } - }; - int cursor_pos = -1; - bool data_write = false; - if (DataEditingTakeFocus) - { - SetKeyboardFocusHere(); - snprintf(AddrInput, sizeof(AddrInput), "%0*x", addr_digits_count, base_display_addr+addr); - snprintf(DataInput, sizeof(DataInput), "%02x", mem_data[addr]); - } - - PushItemWidth(CalcTextSize("FF").x); - ImGuiInputTextFlags flags = ImGuiInputTextFlags_CharsHexadecimal|ImGuiInputTextFlags_EnterReturnsTrue|ImGuiInputTextFlags_AutoSelectAll|ImGuiInputTextFlags_NoHorizontalScroll|ImGuiInputTextFlags_AlwaysOverwrite|ImGuiInputTextFlags_CallbackAlways; - if (InputText("##data", DataInput, 32, flags, FuncHolder::Callback, &cursor_pos)) - { - data_write = data_next = true; - } - else if (!DataEditingTakeFocus && !IsItemActive()) - { - DataEditingAddr = -1; - } - - DataEditingTakeFocus = false; - PopItemWidth(); - if (cursor_pos >= 2) - { - data_write = data_next = true; - } - - if (data_write) - { - int data; - if (sscanf(DataInput, "%X", &data) == 1) - { - mem_data[addr] = (unsigned char)data; - } - } - PopID(); - } - else - { - if (HexII) - { - unsigned char byte = mem_data[addr]; - if (bx::isPrint(byte) ) - { - Text(".%c ", byte); - } - else if (0x00 == byte) - { - Text(" "); - } - else if (0xff == byte) - { - Text("## "); - } - else - { - Text("%02x ", byte); - } - } - else - { - Text("%02x ", mem_data[addr]); - } - - if (AllowEdits && IsItemHovered() && IsMouseClicked(0)) - { - DataEditingTakeFocus = true; - DataEditingAddr = addr; - } - } - } - - SameLine(line_start_x + cell_width * Rows + glyph_width * 2); - - if (draw_separator) - { - ImVec2 screen_pos = GetCursorScreenPos(); - GetWindowDrawList()->AddLine(ImVec2(screen_pos.x - glyph_width, screen_pos.y - 9999), ImVec2(screen_pos.x - glyph_width, screen_pos.y + 9999), ImColor(GetStyle().Colors[ImGuiCol_Border])); - draw_separator = false; - } - - // Draw ASCII values - addr = line_i * Rows; - for (int n = 0; n < Rows && addr < mem_size; n++, addr++) - { - if (n > 0) { SameLine(); } - int c = mem_data[addr]; - Text("%c", (c >= 32 && c < 128) ? c : '.'); - } - } - clipper.End(); - PopStyleVar(2); - - EndChild(); - - if (data_next && DataEditingAddr < mem_size) - { - DataEditingAddr = DataEditingAddr + 1; - DataEditingTakeFocus = true; - } - - Separator(); - - AlignTextToFramePadding(); - PushItemWidth(50); - PushTabStop(false); - int rows_backup = Rows; - if (DragInt("##rows", &Rows, 0.2f, 4, 32, "%.0f rows")) - { - ImVec2 new_window_size = GetWindowSize(); - new_window_size.x += (Rows - rows_backup) * (cell_width + glyph_width); - SetWindowSize(new_window_size); - } - - PopTabStop(); - PopItemWidth(); - SameLine(); - Text("Range %0*x..%0*x", addr_digits_count, (int)base_display_addr, addr_digits_count, (int)base_display_addr+mem_size-1); - SameLine(); - PushItemWidth(70); - if (InputText("##addr", AddrInput, 32, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_EnterReturnsTrue)) - { - int goto_addr; - if (sscanf(AddrInput, "%X", &goto_addr) == 1) - { - goto_addr -= base_display_addr; - if (goto_addr >= 0 && goto_addr < mem_size) - { - BeginChild("##scrolling"); - SetScrollFromPosY(GetCursorStartPos().y + (goto_addr / Rows) * GetTextLineHeight()); - EndChild(); - DataEditingAddr = goto_addr; - DataEditingTakeFocus = true; - } - } - } - - PopItemWidth(); - - PopFont(); - } - - void MemoryEditor::Draw(const void* mem_data, int mem_size, int base_display_addr) - { - Draw(const_cast(mem_data), mem_size, base_display_addr); - } - -} // namespace ImGui diff --git a/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl b/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl index 6d6180b3..582d3c61 100644 --- a/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl +++ b/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl @@ -173,7 +173,7 @@ bool RangeSliderFloat(const char* label, float* v1, float* v2, float v_min, floa return false; } - const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags); + const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags); if (hovered) SetHoveredID(id); @@ -183,13 +183,12 @@ bool RangeSliderFloat(const char* label, float* v1, float* v2, float v_min, floa // Tabbing or CTRL-clicking on Slider turns it into an input box bool start_text_input = false; - const bool tab_focus_requested = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedByTabbing) != 0; - if (tab_focus_requested || (hovered && g.IO.MouseClicked[0])) + if (hovered && g.IO.MouseClicked[0]) { SetActiveID(id, window); FocusWindow(window); - if (tab_focus_requested || g.IO.KeyCtrl) + if (g.IO.KeyCtrl) { start_text_input = true; g.TempInputId = 0; diff --git a/bgfx/3rdparty/directx-headers/include/directx/d3d9.h b/bgfx/3rdparty/directx-headers/include/directx/d3d9.h deleted file mode 100644 index 3a604072..00000000 --- a/bgfx/3rdparty/directx-headers/include/directx/d3d9.h +++ /dev/null @@ -1,2794 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d9.h - * Content: Direct3D include file - * - ****************************************************************************/ - -#ifndef _D3D9_H_ -#define _D3D9_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0900 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX9 interfaces -#if(DIRECT3D_VERSION >= 0x0900) - - - -/* This identifier is passed to Direct3DCreate9 in order to ensure that an - * application was built against the correct header files. This number is - * incremented whenever a header (or other) change would require applications - * to be rebuilt. If the version doesn't match, Direct3DCreate9 will fail. - * (The number itself has no meaning.)*/ - -#ifdef D3D_DEBUG_INFO -#define D3D_SDK_VERSION (32 | 0x80000000) -#define D3D9b_SDK_VERSION (31 | 0x80000000) - -#else -#define D3D_SDK_VERSION 32 -#define D3D9b_SDK_VERSION 31 -#endif - - -#include - -#define COM_NO_WINDOWS_H -#include - -#include - -#if !defined(HMONITOR_DECLARED) && (!defined(WINVER) || WINVER < 0x0500) - #define HMONITOR_DECLARED - DECLARE_HANDLE(HMONITOR); -#endif - -#define D3DAPI WINAPI -/* - * Interface IID's - */ -#if defined( _WIN32 ) && !defined( _NO_COM) - -/* IID_IDirect3D9 */ -/* {81BDCBCA-64D4-426d-AE8D-AD0147F4275C} */ -DEFINE_GUID(IID_IDirect3D9, 0x81bdcbca, 0x64d4, 0x426d, 0xae, 0x8d, 0xad, 0x1, 0x47, 0xf4, 0x27, 0x5c); - -/* IID_IDirect3DDevice9 */ -// {D0223B96-BF7A-43fd-92BD-A43B0D82B9EB} */ -DEFINE_GUID(IID_IDirect3DDevice9, 0xd0223b96, 0xbf7a, 0x43fd, 0x92, 0xbd, 0xa4, 0x3b, 0xd, 0x82, 0xb9, 0xeb); - -/* IID_IDirect3DResource9 */ -// {05EEC05D-8F7D-4362-B999-D1BAF357C704} -DEFINE_GUID(IID_IDirect3DResource9, 0x5eec05d, 0x8f7d, 0x4362, 0xb9, 0x99, 0xd1, 0xba, 0xf3, 0x57, 0xc7, 0x4); - -/* IID_IDirect3DBaseTexture9 */ -/* {580CA87E-1D3C-4d54-991D-B7D3E3C298CE} */ -DEFINE_GUID(IID_IDirect3DBaseTexture9, 0x580ca87e, 0x1d3c, 0x4d54, 0x99, 0x1d, 0xb7, 0xd3, 0xe3, 0xc2, 0x98, 0xce); - -/* IID_IDirect3DTexture9 */ -/* {85C31227-3DE5-4f00-9B3A-F11AC38C18B5} */ -DEFINE_GUID(IID_IDirect3DTexture9, 0x85c31227, 0x3de5, 0x4f00, 0x9b, 0x3a, 0xf1, 0x1a, 0xc3, 0x8c, 0x18, 0xb5); - -/* IID_IDirect3DCubeTexture9 */ -/* {FFF32F81-D953-473a-9223-93D652ABA93F} */ -DEFINE_GUID(IID_IDirect3DCubeTexture9, 0xfff32f81, 0xd953, 0x473a, 0x92, 0x23, 0x93, 0xd6, 0x52, 0xab, 0xa9, 0x3f); - -/* IID_IDirect3DVolumeTexture9 */ -/* {2518526C-E789-4111-A7B9-47EF328D13E6} */ -DEFINE_GUID(IID_IDirect3DVolumeTexture9, 0x2518526c, 0xe789, 0x4111, 0xa7, 0xb9, 0x47, 0xef, 0x32, 0x8d, 0x13, 0xe6); - -/* IID_IDirect3DVertexBuffer9 */ -/* {B64BB1B5-FD70-4df6-BF91-19D0A12455E3} */ -DEFINE_GUID(IID_IDirect3DVertexBuffer9, 0xb64bb1b5, 0xfd70, 0x4df6, 0xbf, 0x91, 0x19, 0xd0, 0xa1, 0x24, 0x55, 0xe3); - -/* IID_IDirect3DIndexBuffer9 */ -/* {7C9DD65E-D3F7-4529-ACEE-785830ACDE35} */ -DEFINE_GUID(IID_IDirect3DIndexBuffer9, 0x7c9dd65e, 0xd3f7, 0x4529, 0xac, 0xee, 0x78, 0x58, 0x30, 0xac, 0xde, 0x35); - -/* IID_IDirect3DSurface9 */ -/* {0CFBAF3A-9FF6-429a-99B3-A2796AF8B89B} */ -DEFINE_GUID(IID_IDirect3DSurface9, 0xcfbaf3a, 0x9ff6, 0x429a, 0x99, 0xb3, 0xa2, 0x79, 0x6a, 0xf8, 0xb8, 0x9b); - -/* IID_IDirect3DVolume9 */ -/* {24F416E6-1F67-4aa7-B88E-D33F6F3128A1} */ -DEFINE_GUID(IID_IDirect3DVolume9, 0x24f416e6, 0x1f67, 0x4aa7, 0xb8, 0x8e, 0xd3, 0x3f, 0x6f, 0x31, 0x28, 0xa1); - -/* IID_IDirect3DSwapChain9 */ -/* {794950F2-ADFC-458a-905E-10A10B0B503B} */ -DEFINE_GUID(IID_IDirect3DSwapChain9, 0x794950f2, 0xadfc, 0x458a, 0x90, 0x5e, 0x10, 0xa1, 0xb, 0xb, 0x50, 0x3b); - -/* IID_IDirect3DVertexDeclaration9 */ -/* {DD13C59C-36FA-4098-A8FB-C7ED39DC8546} */ -DEFINE_GUID(IID_IDirect3DVertexDeclaration9, 0xdd13c59c, 0x36fa, 0x4098, 0xa8, 0xfb, 0xc7, 0xed, 0x39, 0xdc, 0x85, 0x46); - -/* IID_IDirect3DVertexShader9 */ -/* {EFC5557E-6265-4613-8A94-43857889EB36} */ -DEFINE_GUID(IID_IDirect3DVertexShader9, 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36); - -/* IID_IDirect3DPixelShader9 */ -/* {6D3BDBDC-5B02-4415-B852-CE5E8BCCB289} */ -DEFINE_GUID(IID_IDirect3DPixelShader9, 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89); - -/* IID_IDirect3DStateBlock9 */ -/* {B07C4FE5-310D-4ba8-A23C-4F0F206F218B} */ -DEFINE_GUID(IID_IDirect3DStateBlock9, 0xb07c4fe5, 0x310d, 0x4ba8, 0xa2, 0x3c, 0x4f, 0xf, 0x20, 0x6f, 0x21, 0x8b); - -/* IID_IDirect3DQuery9 */ -/* {d9771460-a695-4f26-bbd3-27b840b541cc} */ -DEFINE_GUID(IID_IDirect3DQuery9, 0xd9771460, 0xa695, 0x4f26, 0xbb, 0xd3, 0x27, 0xb8, 0x40, 0xb5, 0x41, 0xcc); - - -/* IID_HelperName */ -/* {E4A36723-FDFE-4b22-B146-3C04C07F4CC8} */ -DEFINE_GUID(IID_HelperName, 0xe4a36723, 0xfdfe, 0x4b22, 0xb1, 0x46, 0x3c, 0x4, 0xc0, 0x7f, 0x4c, 0xc8); - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -/* IID_IDirect3D9Ex */ -/* {02177241-69FC-400C-8FF1-93A44DF6861D} */ -DEFINE_GUID(IID_IDirect3D9Ex, 0x02177241, 0x69FC, 0x400C, 0x8F, 0xF1, 0x93, 0xA4, 0x4D, 0xF6, 0x86, 0x1D); - -/* IID_IDirect3DDevice9Ex */ -// {B18B10CE-2649-405a-870F-95F777D4313A} -DEFINE_GUID(IID_IDirect3DDevice9Ex, 0xb18b10ce, 0x2649, 0x405a, 0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a); - -/* IID_IDirect3DSwapChain9Ex */ -/* {91886CAF-1C3D-4d2e-A0AB-3E4C7D8D3303} */ -DEFINE_GUID(IID_IDirect3DSwapChain9Ex, 0x91886caf, 0x1c3d, 0x4d2e, 0xa0, 0xab, 0x3e, 0x4c, 0x7d, 0x8d, 0x33, 0x3); - -/* IID_IDirect3D9ExOverlayExtension */ -/* {187aeb13-aaf5-4c59-876d-e059088c0df8} */ -DEFINE_GUID(IID_IDirect3D9ExOverlayExtension, 0x187aeb13, 0xaaf5, 0x4c59, 0x87, 0x6d, 0xe0, 0x59, 0x8, 0x8c, 0xd, 0xf8); - -/* IID_IDirect3DDevice9Video */ -// {26DC4561-A1EE-4ae7-96DA-118A36C0EC95} -DEFINE_GUID(IID_IDirect3DDevice9Video, 0x26dc4561, 0xa1ee, 0x4ae7, 0x96, 0xda, 0x11, 0x8a, 0x36, 0xc0, 0xec, 0x95); - -/* IID_IDirect3D9AuthenticatedChannel */ -// {FF24BEEE-DA21-4beb-98B5-D2F899F98AF9} -DEFINE_GUID(IID_IDirect3DAuthenticatedChannel9, 0xff24beee, 0xda21, 0x4beb, 0x98, 0xb5, 0xd2, 0xf8, 0x99, 0xf9, 0x8a, 0xf9); - -/* IID_IDirect3DCryptoSession9 */ -// {FA0AB799-7A9C-48ca-8C5B-237E71A54434} -DEFINE_GUID(IID_IDirect3DCryptoSession9, 0xfa0ab799, 0x7a9c, 0x48ca, 0x8c, 0x5b, 0x23, 0x7e, 0x71, 0xa5, 0x44, 0x34); - - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - -#endif - -#ifdef __cplusplus - -#ifndef DECLSPEC_UUID -#if _MSC_VER >= 1100 -#define DECLSPEC_UUID(x) __declspec(uuid(x)) -#else -#define DECLSPEC_UUID(x) -#endif -#endif - -interface DECLSPEC_UUID("81BDCBCA-64D4-426d-AE8D-AD0147F4275C") IDirect3D9; -interface DECLSPEC_UUID("D0223B96-BF7A-43fd-92BD-A43B0D82B9EB") IDirect3DDevice9; - -interface DECLSPEC_UUID("B07C4FE5-310D-4ba8-A23C-4F0F206F218B") IDirect3DStateBlock9; -interface DECLSPEC_UUID("05EEC05D-8F7D-4362-B999-D1BAF357C704") IDirect3DResource9; -interface DECLSPEC_UUID("DD13C59C-36FA-4098-A8FB-C7ED39DC8546") IDirect3DVertexDeclaration9; -interface DECLSPEC_UUID("EFC5557E-6265-4613-8A94-43857889EB36") IDirect3DVertexShader9; -interface DECLSPEC_UUID("6D3BDBDC-5B02-4415-B852-CE5E8BCCB289") IDirect3DPixelShader9; -interface DECLSPEC_UUID("580CA87E-1D3C-4d54-991D-B7D3E3C298CE") IDirect3DBaseTexture9; -interface DECLSPEC_UUID("85C31227-3DE5-4f00-9B3A-F11AC38C18B5") IDirect3DTexture9; -interface DECLSPEC_UUID("2518526C-E789-4111-A7B9-47EF328D13E6") IDirect3DVolumeTexture9; -interface DECLSPEC_UUID("FFF32F81-D953-473a-9223-93D652ABA93F") IDirect3DCubeTexture9; - -interface DECLSPEC_UUID("B64BB1B5-FD70-4df6-BF91-19D0A12455E3") IDirect3DVertexBuffer9; -interface DECLSPEC_UUID("7C9DD65E-D3F7-4529-ACEE-785830ACDE35") IDirect3DIndexBuffer9; - -interface DECLSPEC_UUID("0CFBAF3A-9FF6-429a-99B3-A2796AF8B89B") IDirect3DSurface9; -interface DECLSPEC_UUID("24F416E6-1F67-4aa7-B88E-D33F6F3128A1") IDirect3DVolume9; - -interface DECLSPEC_UUID("794950F2-ADFC-458a-905E-10A10B0B503B") IDirect3DSwapChain9; -interface DECLSPEC_UUID("d9771460-a695-4f26-bbd3-27b840b541cc") IDirect3DQuery9; - - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -interface DECLSPEC_UUID("02177241-69FC-400C-8FF1-93A44DF6861D") IDirect3D9Ex; -interface DECLSPEC_UUID("B18B10CE-2649-405a-870F-95F777D4313A") IDirect3DDevice9Ex; -interface DECLSPEC_UUID("91886CAF-1C3D-4d2e-A0AB-3E4C7D8D3303") IDirect3DSwapChain9Ex; -interface DECLSPEC_UUID("187AEB13-AAF5-4C59-876D-E059088C0DF8") IDirect3D9ExOverlayExtension; -interface DECLSPEC_UUID("26DC4561-A1EE-4ae7-96DA-118A36C0EC95") IDirect3DDevice9Video; -interface DECLSPEC_UUID("FF24BEEE-DA21-4beb-98B5-D2F899F98AF9") IDirect3DAuthenticatedChannel9; -interface DECLSPEC_UUID("FA0AB799-7A9C-48CA-8C5B-237E71A54434") IDirect3DCryptoSession9; - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - -#if defined(_COM_SMARTPTR_TYPEDEF) -_COM_SMARTPTR_TYPEDEF(IDirect3D9, __uuidof(IDirect3D9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9, __uuidof(IDirect3DDevice9)); - -_COM_SMARTPTR_TYPEDEF(IDirect3DStateBlock9, __uuidof(IDirect3DStateBlock9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DResource9, __uuidof(IDirect3DResource9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DVertexDeclaration9, __uuidof(IDirect3DVertexDeclaration9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DVertexShader9, __uuidof(IDirect3DVertexShader9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DPixelShader9, __uuidof(IDirect3DPixelShader9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DBaseTexture9, __uuidof(IDirect3DBaseTexture9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DTexture9, __uuidof(IDirect3DTexture9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DVolumeTexture9, __uuidof(IDirect3DVolumeTexture9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DCubeTexture9, __uuidof(IDirect3DCubeTexture9)); - -_COM_SMARTPTR_TYPEDEF(IDirect3DVertexBuffer9, __uuidof(IDirect3DVertexBuffer9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DIndexBuffer9, __uuidof(IDirect3DIndexBuffer9)); - -_COM_SMARTPTR_TYPEDEF(IDirect3DSurface9, __uuidof(IDirect3DSurface9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DVolume9, __uuidof(IDirect3DVolume9)); - -_COM_SMARTPTR_TYPEDEF(IDirect3DSwapChain9, __uuidof(IDirect3DSwapChain9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DQuery9, __uuidof(IDirect3DQuery9)); - - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -_COM_SMARTPTR_TYPEDEF(IDirect3D9Ex, __uuidof(IDirect3D9Ex)); -_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9Ex, __uuidof(IDirect3DDevice9Ex)); -_COM_SMARTPTR_TYPEDEF(IDirect3DSwapChain9Ex, __uuidof(IDirect3DSwapChain9Ex)); -_COM_SMARTPTR_TYPEDEF(IDirect3D9ExOverlayExtension, __uuidof(IDirect3D9ExOverlayExtension)); -_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9Video, __uuidof(IDirect3DDevice9Video)); -_COM_SMARTPTR_TYPEDEF(IDirect3DAuthenticatedChannel9, __uuidof(IDirect3DAuthenticatedChannel9)); -_COM_SMARTPTR_TYPEDEF(IDirect3DCryptoSession9, __uuidof(IDirect3DCryptoSession9)); - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - -#endif - -#endif - - -typedef interface IDirect3D9 IDirect3D9; -typedef interface IDirect3DDevice9 IDirect3DDevice9; -typedef interface IDirect3DStateBlock9 IDirect3DStateBlock9; -typedef interface IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9; -typedef interface IDirect3DVertexShader9 IDirect3DVertexShader9; -typedef interface IDirect3DPixelShader9 IDirect3DPixelShader9; -typedef interface IDirect3DResource9 IDirect3DResource9; -typedef interface IDirect3DBaseTexture9 IDirect3DBaseTexture9; -typedef interface IDirect3DTexture9 IDirect3DTexture9; -typedef interface IDirect3DVolumeTexture9 IDirect3DVolumeTexture9; -typedef interface IDirect3DCubeTexture9 IDirect3DCubeTexture9; -typedef interface IDirect3DVertexBuffer9 IDirect3DVertexBuffer9; -typedef interface IDirect3DIndexBuffer9 IDirect3DIndexBuffer9; -typedef interface IDirect3DSurface9 IDirect3DSurface9; -typedef interface IDirect3DVolume9 IDirect3DVolume9; -typedef interface IDirect3DSwapChain9 IDirect3DSwapChain9; -typedef interface IDirect3DQuery9 IDirect3DQuery9; - - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - - -typedef interface IDirect3D9Ex IDirect3D9Ex; -typedef interface IDirect3DDevice9Ex IDirect3DDevice9Ex; -typedef interface IDirect3DSwapChain9Ex IDirect3DSwapChain9Ex; -typedef interface IDirect3D9ExOverlayExtension IDirect3D9ExOverlayExtension; -typedef interface IDirect3DDevice9Video IDirect3DDevice9Video; -typedef interface IDirect3DAuthenticatedChannel9 IDirect3DAuthenticatedChannel9; -typedef interface IDirect3DCryptoSession9 IDirect3DCryptoSession9; - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - -#include "d3d9types.h" -#include "d3d9caps.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * DLL Function for creating a Direct3D9 object. This object supports - * enumeration and allows the creation of Direct3DDevice9 objects. - * Pass the value of the constant D3D_SDK_VERSION to this function, so - * that the run-time can validate that your application was compiled - * against the right headers. - */ - -IDirect3D9 * WINAPI Direct3DCreate9(UINT SDKVersion); - -/* - * Stubs for graphics profiling. - */ - -int WINAPI D3DPERF_BeginEvent( D3DCOLOR col, LPCWSTR wszName ); -int WINAPI D3DPERF_EndEvent( void ); -void WINAPI D3DPERF_SetMarker( D3DCOLOR col, LPCWSTR wszName ); -void WINAPI D3DPERF_SetRegion( D3DCOLOR col, LPCWSTR wszName ); -BOOL WINAPI D3DPERF_QueryRepeatFrame( void ); - -void WINAPI D3DPERF_SetOptions( DWORD dwOptions ); -DWORD WINAPI D3DPERF_GetStatus( void ); - -/* - * Direct3D interfaces - */ - - - - - - -#undef INTERFACE -#define INTERFACE IDirect3D9 - -DECLARE_INTERFACE_(IDirect3D9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D9 methods ***/ - STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; - STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; - STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE; - STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE; - STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) PURE; - STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; - STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) PURE; - STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; - STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) PURE; - STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) PURE; - STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; - STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR Version; - #endif -}; - -typedef struct IDirect3D9 *LPDIRECT3D9, *PDIRECT3D9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D9_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) -#define IDirect3D9_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) -#define IDirect3D9_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) -#define IDirect3D9_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b) -#define IDirect3D9_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d) -#define IDirect3D9_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) -#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) -#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) -#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f) -#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) -#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d) -#define IDirect3D9_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) -#define IDirect3D9_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) -#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) -#else -#define IDirect3D9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D9_AddRef(p) (p)->AddRef() -#define IDirect3D9_Release(p) (p)->Release() -#define IDirect3D9_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) -#define IDirect3D9_GetAdapterCount(p) (p)->GetAdapterCount() -#define IDirect3D9_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) -#define IDirect3D9_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b) -#define IDirect3D9_EnumAdapterModes(p,a,b,c,d) (p)->EnumAdapterModes(a,b,c,d) -#define IDirect3D9_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) -#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) -#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) -#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f) -#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) -#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d) (p)->CheckDeviceFormatConversion(a,b,c,d) -#define IDirect3D9_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) -#define IDirect3D9_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) -#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) -#endif - - - - - - - -/* SwapChain */ - - - - - - - - - - - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DDevice9 - -DECLARE_INTERFACE_(IDirect3DDevice9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice9 methods ***/ - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; - STDMETHOD(EvictManagedResources)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE; - STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE; - STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; - STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE; - STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; - STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; - STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE; - STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE; - STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE; - STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; - STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; - STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE; - STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE; - STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; - STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE; - STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; - STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) PURE; - STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE; - STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE; - STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE; - STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE; - STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) PURE; - STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; - STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE; - STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE; - STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE; - STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; - STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE; - STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE; - STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE; - STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE; - STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*) PURE; - STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE; - STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; - STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; - STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; - STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; - STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE; - STDMETHOD(BeginStateBlock)(THIS) PURE; - STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE; - STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE; - STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE; - STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE; - STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE; - STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; - STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; - STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE; - STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE; - STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; - STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; - STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; - STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; - STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; - STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE; - STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE; - STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE; - STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE; - STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE; - STDMETHOD_(float, GetNPatchMode)(THIS) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; - STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; - STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; - STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE; - STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE; - STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE; - STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE; - STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; - STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE; - STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE; - STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE; - STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE; - STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; - STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; - STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; - STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; - STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; - STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; - STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE; - STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride) PURE; - STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting) PURE; - STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting) PURE; - STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE; - STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE; - STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE; - STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE; - STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE; - STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; - STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; - STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; - STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; - STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; - STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; - STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; - STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; - STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; - STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE; - - #ifdef D3D_DEBUG_INFO - D3DDEVICE_CREATION_PARAMETERS CreationParameters; - D3DPRESENT_PARAMETERS PresentParameters; - D3DDISPLAYMODE DisplayMode; - D3DCAPS9 Caps; - - UINT AvailableTextureMem; - UINT SwapChains; - UINT Textures; - UINT VertexBuffers; - UINT IndexBuffers; - UINT VertexShaders; - UINT PixelShaders; - - D3DVIEWPORT9 Viewport; - D3DMATRIX ProjectionMatrix; - D3DMATRIX ViewMatrix; - D3DMATRIX WorldMatrix; - D3DMATRIX TextureMatrices[8]; - - DWORD FVF; - UINT VertexSize; - DWORD VertexShaderVersion; - DWORD PixelShaderVersion; - BOOL SoftwareVertexProcessing; - - D3DMATERIAL9 Material; - D3DLIGHT9 Lights[16]; - BOOL LightsEnabled[16]; - - D3DGAMMARAMP GammaRamp; - RECT ScissorRect; - BOOL DialogBoxMode; - #endif -}; - -typedef struct IDirect3DDevice9 *LPDIRECT3DDEVICE9, *PDIRECT3DDEVICE9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice9_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) -#define IDirect3DDevice9_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) -#define IDirect3DDevice9_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p) -#define IDirect3DDevice9_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice9_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) -#define IDirect3DDevice9_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b) -#define IDirect3DDevice9_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) -#define IDirect3DDevice9_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) -#define IDirect3DDevice9_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) -#define IDirect3DDevice9_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) -#define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) -#define IDirect3DDevice9_GetSwapChain(p,a,b) (p)->lpVtbl->GetSwapChain(p,a,b) -#define IDirect3DDevice9_GetNumberOfSwapChains(p) (p)->lpVtbl->GetNumberOfSwapChains(p) -#define IDirect3DDevice9_Reset(p,a) (p)->lpVtbl->Reset(p,a) -#define IDirect3DDevice9_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) -#define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d) -#define IDirect3DDevice9_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b) -#define IDirect3DDevice9_SetDialogBoxMode(p,a) (p)->lpVtbl->SetDialogBoxMode(p,a) -#define IDirect3DDevice9_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) -#define IDirect3DDevice9_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) -#define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) -#define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g) -#define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f) -#define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f) -#define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice9_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) -#define IDirect3DDevice9_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) -#define IDirect3DDevice9_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) -#define IDirect3DDevice9_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) -#define IDirect3DDevice9_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) -#define IDirect3DDevice9_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) -#define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f) -#define IDirect3DDevice9_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice9_GetRenderTarget(p,a,b) (p)->lpVtbl->GetRenderTarget(p,a,b) -#define IDirect3DDevice9_SetDepthStencilSurface(p,a) (p)->lpVtbl->SetDepthStencilSurface(p,a) -#define IDirect3DDevice9_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) -#define IDirect3DDevice9_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice9_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice9_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) -#define IDirect3DDevice9_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice9_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice9_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice9_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DDevice9_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DDevice9_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DDevice9_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DDevice9_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) -#define IDirect3DDevice9_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) -#define IDirect3DDevice9_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) -#define IDirect3DDevice9_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) -#define IDirect3DDevice9_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) -#define IDirect3DDevice9_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) -#define IDirect3DDevice9_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice9_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice9_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) -#define IDirect3DDevice9_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) -#define IDirect3DDevice9_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) -#define IDirect3DDevice9_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice9_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#define IDirect3DDevice9_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) -#define IDirect3DDevice9_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) -#define IDirect3DDevice9_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) -#define IDirect3DDevice9_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) -#define IDirect3DDevice9_GetSamplerState(p,a,b,c) (p)->lpVtbl->GetSamplerState(p,a,b,c) -#define IDirect3DDevice9_SetSamplerState(p,a,b,c) (p)->lpVtbl->SetSamplerState(p,a,b,c) -#define IDirect3DDevice9_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) -#define IDirect3DDevice9_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) -#define IDirect3DDevice9_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) -#define IDirect3DDevice9_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) -#define IDirect3DDevice9_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) -#define IDirect3DDevice9_SetScissorRect(p,a) (p)->lpVtbl->SetScissorRect(p,a) -#define IDirect3DDevice9_GetScissorRect(p,a) (p)->lpVtbl->GetScissorRect(p,a) -#define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a) (p)->lpVtbl->SetSoftwareVertexProcessing(p,a) -#define IDirect3DDevice9_GetSoftwareVertexProcessing(p) (p)->lpVtbl->GetSoftwareVertexProcessing(p) -#define IDirect3DDevice9_SetNPatchMode(p,a) (p)->lpVtbl->SetNPatchMode(p,a) -#define IDirect3DDevice9_GetNPatchMode(p) (p)->lpVtbl->GetNPatchMode(p) -#define IDirect3DDevice9_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) -#define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f) -#define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) -#define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f) -#define IDirect3DDevice9_CreateVertexDeclaration(p,a,b) (p)->lpVtbl->CreateVertexDeclaration(p,a,b) -#define IDirect3DDevice9_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a) -#define IDirect3DDevice9_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a) -#define IDirect3DDevice9_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a) -#define IDirect3DDevice9_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a) -#define IDirect3DDevice9_CreateVertexShader(p,a,b) (p)->lpVtbl->CreateVertexShader(p,a,b) -#define IDirect3DDevice9_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) -#define IDirect3DDevice9_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) -#define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c) -#define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c) -#define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c) -#define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c) -#define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c) -#define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c) -#define IDirect3DDevice9_SetStreamSource(p,a,b,c,d) (p)->lpVtbl->SetStreamSource(p,a,b,c,d) -#define IDirect3DDevice9_GetStreamSource(p,a,b,c,d) (p)->lpVtbl->GetStreamSource(p,a,b,c,d) -#define IDirect3DDevice9_SetStreamSourceFreq(p,a,b) (p)->lpVtbl->SetStreamSourceFreq(p,a,b) -#define IDirect3DDevice9_GetStreamSourceFreq(p,a,b) (p)->lpVtbl->GetStreamSourceFreq(p,a,b) -#define IDirect3DDevice9_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) -#define IDirect3DDevice9_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) -#define IDirect3DDevice9_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) -#define IDirect3DDevice9_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) -#define IDirect3DDevice9_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) -#define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c) -#define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c) -#define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c) -#define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c) -#define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c) -#define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c) -#define IDirect3DDevice9_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) -#define IDirect3DDevice9_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) -#define IDirect3DDevice9_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) -#define IDirect3DDevice9_CreateQuery(p,a,b) (p)->lpVtbl->CreateQuery(p,a,b) -#else -#define IDirect3DDevice9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice9_AddRef(p) (p)->AddRef() -#define IDirect3DDevice9_Release(p) (p)->Release() -#define IDirect3DDevice9_TestCooperativeLevel(p) (p)->TestCooperativeLevel() -#define IDirect3DDevice9_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() -#define IDirect3DDevice9_EvictManagedResources(p) (p)->EvictManagedResources() -#define IDirect3DDevice9_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice9_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) -#define IDirect3DDevice9_GetDisplayMode(p,a,b) (p)->GetDisplayMode(a,b) -#define IDirect3DDevice9_GetCreationParameters(p,a) (p)->GetCreationParameters(a) -#define IDirect3DDevice9_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) -#define IDirect3DDevice9_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) -#define IDirect3DDevice9_ShowCursor(p,a) (p)->ShowCursor(a) -#define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) -#define IDirect3DDevice9_GetSwapChain(p,a,b) (p)->GetSwapChain(a,b) -#define IDirect3DDevice9_GetNumberOfSwapChains(p) (p)->GetNumberOfSwapChains() -#define IDirect3DDevice9_Reset(p,a) (p)->Reset(a) -#define IDirect3DDevice9_Present(p,a,b,c,d) (p)->Present(a,b,c,d) -#define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d) (p)->GetBackBuffer(a,b,c,d) -#define IDirect3DDevice9_GetRasterStatus(p,a,b) (p)->GetRasterStatus(a,b) -#define IDirect3DDevice9_SetDialogBoxMode(p,a) (p)->SetDialogBoxMode(a) -#define IDirect3DDevice9_SetGammaRamp(p,a,b,c) (p)->SetGammaRamp(a,b,c) -#define IDirect3DDevice9_GetGammaRamp(p,a,b) (p)->GetGammaRamp(a,b) -#define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->CreateTexture(a,b,c,d,e,f,g,h) -#define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i) -#define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->CreateCubeTexture(a,b,c,d,e,f,g) -#define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->CreateVertexBuffer(a,b,c,d,e,f) -#define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->CreateIndexBuffer(a,b,c,d,e,f) -#define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->CreateRenderTarget(a,b,c,d,e,f,g,h) -#define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h) -#define IDirect3DDevice9_UpdateSurface(p,a,b,c,d) (p)->UpdateSurface(a,b,c,d) -#define IDirect3DDevice9_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) -#define IDirect3DDevice9_GetRenderTargetData(p,a,b) (p)->GetRenderTargetData(a,b) -#define IDirect3DDevice9_GetFrontBufferData(p,a,b) (p)->GetFrontBufferData(a,b) -#define IDirect3DDevice9_StretchRect(p,a,b,c,d,e) (p)->StretchRect(a,b,c,d,e) -#define IDirect3DDevice9_ColorFill(p,a,b,c) (p)->ColorFill(a,b,c) -#define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f) -#define IDirect3DDevice9_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice9_GetRenderTarget(p,a,b) (p)->GetRenderTarget(a,b) -#define IDirect3DDevice9_SetDepthStencilSurface(p,a) (p)->SetDepthStencilSurface(a) -#define IDirect3DDevice9_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) -#define IDirect3DDevice9_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice9_EndScene(p) (p)->EndScene() -#define IDirect3DDevice9_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) -#define IDirect3DDevice9_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice9_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice9_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice9_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DDevice9_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DDevice9_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DDevice9_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DDevice9_SetLight(p,a,b) (p)->SetLight(a,b) -#define IDirect3DDevice9_GetLight(p,a,b) (p)->GetLight(a,b) -#define IDirect3DDevice9_LightEnable(p,a,b) (p)->LightEnable(a,b) -#define IDirect3DDevice9_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) -#define IDirect3DDevice9_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) -#define IDirect3DDevice9_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) -#define IDirect3DDevice9_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice9_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice9_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) -#define IDirect3DDevice9_BeginStateBlock(p) (p)->BeginStateBlock() -#define IDirect3DDevice9_EndStateBlock(p,a) (p)->EndStateBlock(a) -#define IDirect3DDevice9_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice9_GetClipStatus(p,a) (p)->GetClipStatus(a) -#define IDirect3DDevice9_GetTexture(p,a,b) (p)->GetTexture(a,b) -#define IDirect3DDevice9_SetTexture(p,a,b) (p)->SetTexture(a,b) -#define IDirect3DDevice9_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) -#define IDirect3DDevice9_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) -#define IDirect3DDevice9_GetSamplerState(p,a,b,c) (p)->GetSamplerState(a,b,c) -#define IDirect3DDevice9_SetSamplerState(p,a,b,c) (p)->SetSamplerState(a,b,c) -#define IDirect3DDevice9_ValidateDevice(p,a) (p)->ValidateDevice(a) -#define IDirect3DDevice9_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) -#define IDirect3DDevice9_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) -#define IDirect3DDevice9_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) -#define IDirect3DDevice9_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) -#define IDirect3DDevice9_SetScissorRect(p,a) (p)->SetScissorRect(a) -#define IDirect3DDevice9_GetScissorRect(p,a) (p)->GetScissorRect(a) -#define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a) (p)->SetSoftwareVertexProcessing(a) -#define IDirect3DDevice9_GetSoftwareVertexProcessing(p) (p)->GetSoftwareVertexProcessing() -#define IDirect3DDevice9_SetNPatchMode(p,a) (p)->SetNPatchMode(a) -#define IDirect3DDevice9_GetNPatchMode(p) (p)->GetNPatchMode() -#define IDirect3DDevice9_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) -#define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->DrawIndexedPrimitive(a,b,c,d,e,f) -#define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) -#define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) -#define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f) (p)->ProcessVertices(a,b,c,d,e,f) -#define IDirect3DDevice9_CreateVertexDeclaration(p,a,b) (p)->CreateVertexDeclaration(a,b) -#define IDirect3DDevice9_SetVertexDeclaration(p,a) (p)->SetVertexDeclaration(a) -#define IDirect3DDevice9_GetVertexDeclaration(p,a) (p)->GetVertexDeclaration(a) -#define IDirect3DDevice9_SetFVF(p,a) (p)->SetFVF(a) -#define IDirect3DDevice9_GetFVF(p,a) (p)->GetFVF(a) -#define IDirect3DDevice9_CreateVertexShader(p,a,b) (p)->CreateVertexShader(a,b) -#define IDirect3DDevice9_SetVertexShader(p,a) (p)->SetVertexShader(a) -#define IDirect3DDevice9_GetVertexShader(p,a) (p)->GetVertexShader(a) -#define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c) (p)->SetVertexShaderConstantF(a,b,c) -#define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c) (p)->GetVertexShaderConstantF(a,b,c) -#define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c) (p)->SetVertexShaderConstantI(a,b,c) -#define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c) (p)->GetVertexShaderConstantI(a,b,c) -#define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c) (p)->SetVertexShaderConstantB(a,b,c) -#define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c) (p)->GetVertexShaderConstantB(a,b,c) -#define IDirect3DDevice9_SetStreamSource(p,a,b,c,d) (p)->SetStreamSource(a,b,c,d) -#define IDirect3DDevice9_GetStreamSource(p,a,b,c,d) (p)->GetStreamSource(a,b,c,d) -#define IDirect3DDevice9_SetStreamSourceFreq(p,a,b) (p)->SetStreamSourceFreq(a,b) -#define IDirect3DDevice9_GetStreamSourceFreq(p,a,b) (p)->GetStreamSourceFreq(a,b) -#define IDirect3DDevice9_SetIndices(p,a) (p)->SetIndices(a) -#define IDirect3DDevice9_GetIndices(p,a) (p)->GetIndices(a) -#define IDirect3DDevice9_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) -#define IDirect3DDevice9_SetPixelShader(p,a) (p)->SetPixelShader(a) -#define IDirect3DDevice9_GetPixelShader(p,a) (p)->GetPixelShader(a) -#define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c) (p)->SetPixelShaderConstantF(a,b,c) -#define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c) (p)->GetPixelShaderConstantF(a,b,c) -#define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c) (p)->SetPixelShaderConstantI(a,b,c) -#define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c) (p)->GetPixelShaderConstantI(a,b,c) -#define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c) (p)->SetPixelShaderConstantB(a,b,c) -#define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c) (p)->GetPixelShaderConstantB(a,b,c) -#define IDirect3DDevice9_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) -#define IDirect3DDevice9_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) -#define IDirect3DDevice9_DeletePatch(p,a) (p)->DeletePatch(a) -#define IDirect3DDevice9_CreateQuery(p,a,b) (p)->CreateQuery(a,b) -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DStateBlock9 - -DECLARE_INTERFACE_(IDirect3DStateBlock9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DStateBlock9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(Capture)(THIS) PURE; - STDMETHOD(Apply)(THIS) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DStateBlock9 *LPDIRECT3DSTATEBLOCK9, *PDIRECT3DSTATEBLOCK9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DStateBlock9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DStateBlock9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DStateBlock9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DStateBlock9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DStateBlock9_Capture(p) (p)->lpVtbl->Capture(p) -#define IDirect3DStateBlock9_Apply(p) (p)->lpVtbl->Apply(p) -#else -#define IDirect3DStateBlock9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DStateBlock9_AddRef(p) (p)->AddRef() -#define IDirect3DStateBlock9_Release(p) (p)->Release() -#define IDirect3DStateBlock9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DStateBlock9_Capture(p) (p)->Capture() -#define IDirect3DStateBlock9_Apply(p) (p)->Apply() -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DSwapChain9 - -DECLARE_INTERFACE_(IDirect3DSwapChain9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DSwapChain9 methods ***/ - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; - STDMETHOD(GetFrontBufferData)(THIS_ IDirect3DSurface9* pDestSurface) PURE; - STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; - STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; - STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; - - #ifdef D3D_DEBUG_INFO - D3DPRESENT_PARAMETERS PresentParameters; - D3DDISPLAYMODE DisplayMode; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DSwapChain9 *LPDIRECT3DSWAPCHAIN9, *PDIRECT3DSWAPCHAIN9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DSwapChain9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DSwapChain9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DSwapChain9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DSwapChain9_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e) -#define IDirect3DSwapChain9_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a) -#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) -#define IDirect3DSwapChain9_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) -#define IDirect3DSwapChain9_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) -#define IDirect3DSwapChain9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DSwapChain9_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a) -#else -#define IDirect3DSwapChain9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DSwapChain9_AddRef(p) (p)->AddRef() -#define IDirect3DSwapChain9_Release(p) (p)->Release() -#define IDirect3DSwapChain9_Present(p,a,b,c,d,e) (p)->Present(a,b,c,d,e) -#define IDirect3DSwapChain9_GetFrontBufferData(p,a) (p)->GetFrontBufferData(a) -#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) -#define IDirect3DSwapChain9_GetRasterStatus(p,a) (p)->GetRasterStatus(a) -#define IDirect3DSwapChain9_GetDisplayMode(p,a) (p)->GetDisplayMode(a) -#define IDirect3DSwapChain9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DSwapChain9_GetPresentParameters(p,a) (p)->GetPresentParameters(a) -#endif - - - -#undef INTERFACE -#define INTERFACE IDirect3DResource9 - -DECLARE_INTERFACE_(IDirect3DResource9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; -}; - -typedef struct IDirect3DResource9 *LPDIRECT3DRESOURCE9, *PDIRECT3DRESOURCE9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DResource9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DResource9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DResource9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DResource9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DResource9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DResource9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DResource9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DResource9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DResource9_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DResource9_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DResource9_GetType(p) (p)->lpVtbl->GetType(p) -#else -#define IDirect3DResource9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DResource9_AddRef(p) (p)->AddRef() -#define IDirect3DResource9_Release(p) (p)->Release() -#define IDirect3DResource9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DResource9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DResource9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DResource9_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DResource9_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DResource9_GetPriority(p) (p)->GetPriority() -#define IDirect3DResource9_PreLoad(p) (p)->PreLoad() -#define IDirect3DResource9_GetType(p) (p)->GetType() -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVertexDeclaration9 - -DECLARE_INTERFACE_(IDirect3DVertexDeclaration9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DVertexDeclaration9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9* pElement,UINT* pNumElements) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DVertexDeclaration9 *LPDIRECT3DVERTEXDECLARATION9, *PDIRECT3DVERTEXDECLARATION9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVertexDeclaration9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVertexDeclaration9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVertexDeclaration9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVertexDeclaration9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b) (p)->lpVtbl->GetDeclaration(p,a,b) -#else -#define IDirect3DVertexDeclaration9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVertexDeclaration9_AddRef(p) (p)->AddRef() -#define IDirect3DVertexDeclaration9_Release(p) (p)->Release() -#define IDirect3DVertexDeclaration9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b) (p)->GetDeclaration(a,b) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVertexShader9 - -DECLARE_INTERFACE_(IDirect3DVertexShader9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DVertexShader9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(GetFunction)(THIS_ void*,UINT* pSizeOfData) PURE; - - #ifdef D3D_DEBUG_INFO - DWORD Version; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DVertexShader9 *LPDIRECT3DVERTEXSHADER9, *PDIRECT3DVERTEXSHADER9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVertexShader9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVertexShader9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVertexShader9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVertexShader9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVertexShader9_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) -#else -#define IDirect3DVertexShader9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVertexShader9_AddRef(p) (p)->AddRef() -#define IDirect3DVertexShader9_Release(p) (p)->Release() -#define IDirect3DVertexShader9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVertexShader9_GetFunction(p,a,b) (p)->GetFunction(a,b) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DPixelShader9 - -DECLARE_INTERFACE_(IDirect3DPixelShader9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DPixelShader9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(GetFunction)(THIS_ void*,UINT* pSizeOfData) PURE; - - #ifdef D3D_DEBUG_INFO - DWORD Version; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DPixelShader9 *LPDIRECT3DPIXELSHADER9, *PDIRECT3DPIXELSHADER9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DPixelShader9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DPixelShader9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DPixelShader9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DPixelShader9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DPixelShader9_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) -#else -#define IDirect3DPixelShader9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DPixelShader9_AddRef(p) (p)->AddRef() -#define IDirect3DPixelShader9_Release(p) (p)->Release() -#define IDirect3DPixelShader9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DPixelShader9_GetFunction(p,a,b) (p)->GetFunction(a,b) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DBaseTexture9 - -DECLARE_INTERFACE_(IDirect3DBaseTexture9, IDirect3DResource9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; - STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; - STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; -}; - -typedef struct IDirect3DBaseTexture9 *LPDIRECT3DBASETEXTURE9, *PDIRECT3DBASETEXTURE9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DBaseTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DBaseTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DBaseTexture9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DBaseTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DBaseTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DBaseTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DBaseTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DBaseTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DBaseTexture9_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DBaseTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DBaseTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DBaseTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) -#define IDirect3DBaseTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) -#define IDirect3DBaseTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) -#else -#define IDirect3DBaseTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DBaseTexture9_AddRef(p) (p)->AddRef() -#define IDirect3DBaseTexture9_Release(p) (p)->Release() -#define IDirect3DBaseTexture9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DBaseTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DBaseTexture9_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DBaseTexture9_GetPriority(p) (p)->GetPriority() -#define IDirect3DBaseTexture9_PreLoad(p) (p)->PreLoad() -#define IDirect3DBaseTexture9_GetType(p) (p)->GetType() -#define IDirect3DBaseTexture9_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DBaseTexture9_GetLOD(p) (p)->GetLOD() -#define IDirect3DBaseTexture9_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) -#define IDirect3DBaseTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() -#define IDirect3DBaseTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DTexture9 - -DECLARE_INTERFACE_(IDirect3DTexture9, IDirect3DBaseTexture9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DBaseTexture9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; - STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; - STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; - STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,IDirect3DSurface9** ppSurfaceLevel) PURE; - STDMETHOD(LockRect)(THIS_ UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; - STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE; - STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR Name; - UINT Width; - UINT Height; - UINT Levels; - DWORD Usage; - D3DFORMAT Format; - D3DPOOL Pool; - DWORD Priority; - DWORD LOD; - D3DTEXTUREFILTERTYPE FilterType; - UINT LockCount; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DTexture9 *LPDIRECT3DTEXTURE9, *PDIRECT3DTEXTURE9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DTexture9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DTexture9_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) -#define IDirect3DTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) -#define IDirect3DTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) -#define IDirect3DTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) -#define IDirect3DTexture9_GetSurfaceLevel(p,a,b) (p)->lpVtbl->GetSurfaceLevel(p,a,b) -#define IDirect3DTexture9_LockRect(p,a,b,c,d) (p)->lpVtbl->LockRect(p,a,b,c,d) -#define IDirect3DTexture9_UnlockRect(p,a) (p)->lpVtbl->UnlockRect(p,a) -#define IDirect3DTexture9_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a) -#else -#define IDirect3DTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DTexture9_AddRef(p) (p)->AddRef() -#define IDirect3DTexture9_Release(p) (p)->Release() -#define IDirect3DTexture9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DTexture9_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DTexture9_GetPriority(p) (p)->GetPriority() -#define IDirect3DTexture9_PreLoad(p) (p)->PreLoad() -#define IDirect3DTexture9_GetType(p) (p)->GetType() -#define IDirect3DTexture9_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DTexture9_GetLOD(p) (p)->GetLOD() -#define IDirect3DTexture9_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) -#define IDirect3DTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() -#define IDirect3DTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() -#define IDirect3DTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) -#define IDirect3DTexture9_GetSurfaceLevel(p,a,b) (p)->GetSurfaceLevel(a,b) -#define IDirect3DTexture9_LockRect(p,a,b,c,d) (p)->LockRect(a,b,c,d) -#define IDirect3DTexture9_UnlockRect(p,a) (p)->UnlockRect(a) -#define IDirect3DTexture9_AddDirtyRect(p,a) (p)->AddDirtyRect(a) -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVolumeTexture9 - -DECLARE_INTERFACE_(IDirect3DVolumeTexture9, IDirect3DBaseTexture9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DBaseTexture9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; - STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; - STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DVOLUME_DESC *pDesc) PURE; - STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume9** ppVolumeLevel) PURE; - STDMETHOD(LockBox)(THIS_ UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; - STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE; - STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR Name; - UINT Width; - UINT Height; - UINT Depth; - UINT Levels; - DWORD Usage; - D3DFORMAT Format; - D3DPOOL Pool; - DWORD Priority; - DWORD LOD; - D3DTEXTUREFILTERTYPE FilterType; - UINT LockCount; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DVolumeTexture9 *LPDIRECT3DVOLUMETEXTURE9, *PDIRECT3DVOLUMETEXTURE9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVolumeTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVolumeTexture9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DVolumeTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DVolumeTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DVolumeTexture9_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DVolumeTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) -#define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) -#define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) -#define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) -#define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b) -#define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d) -#define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a) -#define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a) -#else -#define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVolumeTexture9_AddRef(p) (p)->AddRef() -#define IDirect3DVolumeTexture9_Release(p) (p)->Release() -#define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DVolumeTexture9_GetPriority(p) (p)->GetPriority() -#define IDirect3DVolumeTexture9_PreLoad(p) (p)->PreLoad() -#define IDirect3DVolumeTexture9_GetType(p) (p)->GetType() -#define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DVolumeTexture9_GetLOD(p) (p)->GetLOD() -#define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) -#define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() -#define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() -#define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) -#define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b) -#define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d) -#define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->UnlockBox(a) -#define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->AddDirtyBox(a) -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DCubeTexture9 - -DECLARE_INTERFACE_(IDirect3DCubeTexture9, IDirect3DBaseTexture9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DBaseTexture9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; - STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; - STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; - STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface9** ppCubeMapSurface) PURE; - STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; - STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level) PURE; - STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR Name; - UINT Width; - UINT Height; - UINT Levels; - DWORD Usage; - D3DFORMAT Format; - D3DPOOL Pool; - DWORD Priority; - DWORD LOD; - D3DTEXTUREFILTERTYPE FilterType; - UINT LockCount; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DCubeTexture9 *LPDIRECT3DCUBETEXTURE9, *PDIRECT3DCUBETEXTURE9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DCubeTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DCubeTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DCubeTexture9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DCubeTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DCubeTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DCubeTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DCubeTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DCubeTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DCubeTexture9_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DCubeTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DCubeTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DCubeTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) -#define IDirect3DCubeTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) -#define IDirect3DCubeTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) -#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) -#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c) -#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e) (p)->lpVtbl->LockRect(p,a,b,c,d,e) -#define IDirect3DCubeTexture9_UnlockRect(p,a,b) (p)->lpVtbl->UnlockRect(p,a,b) -#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b) (p)->lpVtbl->AddDirtyRect(p,a,b) -#else -#define IDirect3DCubeTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DCubeTexture9_AddRef(p) (p)->AddRef() -#define IDirect3DCubeTexture9_Release(p) (p)->Release() -#define IDirect3DCubeTexture9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DCubeTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DCubeTexture9_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DCubeTexture9_GetPriority(p) (p)->GetPriority() -#define IDirect3DCubeTexture9_PreLoad(p) (p)->PreLoad() -#define IDirect3DCubeTexture9_GetType(p) (p)->GetType() -#define IDirect3DCubeTexture9_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DCubeTexture9_GetLOD(p) (p)->GetLOD() -#define IDirect3DCubeTexture9_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) -#define IDirect3DCubeTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() -#define IDirect3DCubeTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() -#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) -#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c) (p)->GetCubeMapSurface(a,b,c) -#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e) (p)->LockRect(a,b,c,d,e) -#define IDirect3DCubeTexture9_UnlockRect(p,a,b) (p)->UnlockRect(a,b) -#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b) (p)->AddDirtyRect(a,b) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVertexBuffer9 - -DECLARE_INTERFACE_(IDirect3DVertexBuffer9, IDirect3DResource9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC *pDesc) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR Name; - UINT Length; - DWORD Usage; - DWORD FVF; - D3DPOOL Pool; - DWORD Priority; - UINT LockCount; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DVertexBuffer9 *LPDIRECT3DVERTEXBUFFER9, *PDIRECT3DVERTEXBUFFER9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVertexBuffer9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVertexBuffer9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVertexBuffer9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVertexBuffer9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DVertexBuffer9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DVertexBuffer9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DVertexBuffer9_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DVertexBuffer9_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DVertexBuffer9_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirect3DVertexBuffer9_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DVertexBuffer9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#else -#define IDirect3DVertexBuffer9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVertexBuffer9_AddRef(p) (p)->AddRef() -#define IDirect3DVertexBuffer9_Release(p) (p)->Release() -#define IDirect3DVertexBuffer9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DVertexBuffer9_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DVertexBuffer9_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DVertexBuffer9_GetPriority(p) (p)->GetPriority() -#define IDirect3DVertexBuffer9_PreLoad(p) (p)->PreLoad() -#define IDirect3DVertexBuffer9_GetType(p) (p)->GetType() -#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirect3DVertexBuffer9_Unlock(p) (p)->Unlock() -#define IDirect3DVertexBuffer9_GetDesc(p,a) (p)->GetDesc(a) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DIndexBuffer9 - -DECLARE_INTERFACE_(IDirect3DIndexBuffer9, IDirect3DResource9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC *pDesc) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR Name; - UINT Length; - DWORD Usage; - D3DFORMAT Format; - D3DPOOL Pool; - DWORD Priority; - UINT LockCount; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DIndexBuffer9 *LPDIRECT3DINDEXBUFFER9, *PDIRECT3DINDEXBUFFER9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DIndexBuffer9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DIndexBuffer9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DIndexBuffer9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DIndexBuffer9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DIndexBuffer9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DIndexBuffer9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DIndexBuffer9_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DIndexBuffer9_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DIndexBuffer9_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirect3DIndexBuffer9_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DIndexBuffer9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#else -#define IDirect3DIndexBuffer9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DIndexBuffer9_AddRef(p) (p)->AddRef() -#define IDirect3DIndexBuffer9_Release(p) (p)->Release() -#define IDirect3DIndexBuffer9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DIndexBuffer9_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DIndexBuffer9_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DIndexBuffer9_GetPriority(p) (p)->GetPriority() -#define IDirect3DIndexBuffer9_PreLoad(p) (p)->PreLoad() -#define IDirect3DIndexBuffer9_GetType(p) (p)->GetType() -#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirect3DIndexBuffer9_Unlock(p) (p)->Unlock() -#define IDirect3DIndexBuffer9_GetDesc(p,a) (p)->GetDesc(a) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DSurface9 - -DECLARE_INTERFACE_(IDirect3DSurface9, IDirect3DResource9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; - STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC *pDesc) PURE; - STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; - STDMETHOD(UnlockRect)(THIS) PURE; - STDMETHOD(GetDC)(THIS_ HDC *phdc) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC hdc) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR Name; - UINT Width; - UINT Height; - DWORD Usage; - D3DFORMAT Format; - D3DPOOL Pool; - D3DMULTISAMPLE_TYPE MultiSampleType; - DWORD MultiSampleQuality; - DWORD Priority; - UINT LockCount; - UINT DCCount; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DSurface9 *LPDIRECT3DSURFACE9, *PDIRECT3DSURFACE9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DSurface9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DSurface9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DSurface9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DSurface9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DSurface9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DSurface9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DSurface9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DSurface9_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DSurface9_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DSurface9_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DSurface9_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) -#define IDirect3DSurface9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#define IDirect3DSurface9_LockRect(p,a,b,c) (p)->lpVtbl->LockRect(p,a,b,c) -#define IDirect3DSurface9_UnlockRect(p) (p)->lpVtbl->UnlockRect(p) -#define IDirect3DSurface9_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirect3DSurface9_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#else -#define IDirect3DSurface9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DSurface9_AddRef(p) (p)->AddRef() -#define IDirect3DSurface9_Release(p) (p)->Release() -#define IDirect3DSurface9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DSurface9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DSurface9_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DSurface9_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DSurface9_GetPriority(p) (p)->GetPriority() -#define IDirect3DSurface9_PreLoad(p) (p)->PreLoad() -#define IDirect3DSurface9_GetType(p) (p)->GetType() -#define IDirect3DSurface9_GetContainer(p,a,b) (p)->GetContainer(a,b) -#define IDirect3DSurface9_GetDesc(p,a) (p)->GetDesc(a) -#define IDirect3DSurface9_LockRect(p,a,b,c) (p)->LockRect(a,b,c) -#define IDirect3DSurface9_UnlockRect(p) (p)->UnlockRect() -#define IDirect3DSurface9_GetDC(p,a) (p)->GetDC(a) -#define IDirect3DSurface9_ReleaseDC(p,a) (p)->ReleaseDC(a) -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVolume9 - -DECLARE_INTERFACE_(IDirect3DVolume9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DVolume9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; - STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC *pDesc) PURE; - STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX * pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; - STDMETHOD(UnlockBox)(THIS) PURE; - - #ifdef D3D_DEBUG_INFO - LPCWSTR Name; - UINT Width; - UINT Height; - UINT Depth; - DWORD Usage; - D3DFORMAT Format; - D3DPOOL Pool; - UINT LockCount; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DVolume9 *LPDIRECT3DVOLUME9, *PDIRECT3DVOLUME9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVolume9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVolume9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVolume9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVolume9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DVolume9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DVolume9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DVolume9_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) -#define IDirect3DVolume9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#define IDirect3DVolume9_LockBox(p,a,b,c) (p)->lpVtbl->LockBox(p,a,b,c) -#define IDirect3DVolume9_UnlockBox(p) (p)->lpVtbl->UnlockBox(p) -#else -#define IDirect3DVolume9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVolume9_AddRef(p) (p)->AddRef() -#define IDirect3DVolume9_Release(p) (p)->Release() -#define IDirect3DVolume9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DVolume9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DVolume9_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DVolume9_GetContainer(p,a,b) (p)->GetContainer(a,b) -#define IDirect3DVolume9_GetDesc(p,a) (p)->GetDesc(a) -#define IDirect3DVolume9_LockBox(p,a,b,c) (p)->LockBox(a,b,c) -#define IDirect3DVolume9_UnlockBox(p) (p)->UnlockBox() -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DQuery9 - -DECLARE_INTERFACE_(IDirect3DQuery9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DQuery9 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD_(D3DQUERYTYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, GetDataSize)(THIS) PURE; - STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags) PURE; - STDMETHOD(GetData)(THIS_ void* pData,DWORD dwSize,DWORD dwGetDataFlags) PURE; - - #ifdef D3D_DEBUG_INFO - D3DQUERYTYPE Type; - DWORD DataSize; - LPCWSTR CreationCallStack; - #endif -}; - -typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DQuery9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DQuery9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DQuery9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DQuery9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DQuery9_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DQuery9_GetDataSize(p) (p)->lpVtbl->GetDataSize(p) -#define IDirect3DQuery9_Issue(p,a) (p)->lpVtbl->Issue(p,a) -#define IDirect3DQuery9_GetData(p,a,b,c) (p)->lpVtbl->GetData(p,a,b,c) -#else -#define IDirect3DQuery9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DQuery9_AddRef(p) (p)->AddRef() -#define IDirect3DQuery9_Release(p) (p)->Release() -#define IDirect3DQuery9_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DQuery9_GetType(p) (p)->GetType() -#define IDirect3DQuery9_GetDataSize(p) (p)->GetDataSize() -#define IDirect3DQuery9_Issue(p,a) (p)->Issue(a) -#define IDirect3DQuery9_GetData(p,a,b,c) (p)->GetData(a,b,c) -#endif - -/**************************************************************************** - * Flags for SetPrivateData method on all D3D9 interfaces - * - * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData - * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this - * pointer and Release when the private data is destroyed. The data will be - * destroyed when another SetPrivateData with the same GUID is set, when - * FreePrivateData is called, or when the D3D9 object is freed. - ****************************************************************************/ -#define D3DSPD_IUNKNOWN 0x00000001L - -/**************************************************************************** - * - * Flags for IDirect3D9::CreateDevice's BehaviorFlags - * - ****************************************************************************/ - -#define D3DCREATE_FPU_PRESERVE 0x00000002L -#define D3DCREATE_MULTITHREADED 0x00000004L - -#define D3DCREATE_PUREDEVICE 0x00000010L -#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L -#define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L -#define D3DCREATE_MIXED_VERTEXPROCESSING 0x00000080L - -#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100L -#define D3DCREATE_ADAPTERGROUP_DEVICE 0x00000200L -#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX 0x00000400L - -// This flag causes the D3D runtime not to alter the focus -// window in any way. Use with caution- the burden of supporting -// focus management events (alt-tab, etc.) falls on the -// application, and appropriate responses (switching display -// mode, etc.) should be coded. -#define D3DCREATE_NOWINDOWCHANGES 0x00000800L - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -// Disable multithreading for software vertex processing -#define D3DCREATE_DISABLE_PSGP_THREADING 0x00002000L -// This flag enables present statistics on device. -#define D3DCREATE_ENABLE_PRESENTSTATS 0x00004000L -// This flag disables printscreen support in the runtime for this device -#define D3DCREATE_DISABLE_PRINTSCREEN 0x00008000L - -#define D3DCREATE_SCREENSAVER 0x10000000L - - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - - - -/**************************************************************************** - * - * Parameter for IDirect3D9::CreateDevice's Adapter argument - * - ****************************************************************************/ - -#define D3DADAPTER_DEFAULT 0 - -/**************************************************************************** - * - * Flags for IDirect3D9::EnumAdapters - * - ****************************************************************************/ - -/* - * The D3DENUM_WHQL_LEVEL value has been retired for 9Ex and future versions, - * but it needs to be defined here for compatibility with DX9 and earlier versions. - * See the DirectX SDK for sample code on discovering driver signatures. - */ -#define D3DENUM_WHQL_LEVEL 0x00000002L - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -/* NO_DRIVERVERSION will not fill out the DriverVersion field, nor will the - DriverVersion be incorporated into the DeviceIdentifier GUID. WINNT only */ -#define D3DENUM_NO_DRIVERVERSION 0x00000004L - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - - -/**************************************************************************** - * - * Maximum number of back-buffers supported in DX9 - * - ****************************************************************************/ - -#define D3DPRESENT_BACK_BUFFERS_MAX 3L - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -/**************************************************************************** - * - * Maximum number of back-buffers supported when apps use CreateDeviceEx - * - ****************************************************************************/ - -#define D3DPRESENT_BACK_BUFFERS_MAX_EX 30L - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - -/**************************************************************************** - * - * Flags for IDirect3DDevice9::SetGammaRamp - * - ****************************************************************************/ - -#define D3DSGR_NO_CALIBRATION 0x00000000L -#define D3DSGR_CALIBRATE 0x00000001L - -/**************************************************************************** - * - * Flags for IDirect3DDevice9::SetCursorPosition - * - ****************************************************************************/ - -#define D3DCURSOR_IMMEDIATE_UPDATE 0x00000001L - -/**************************************************************************** - * - * Flags for IDirect3DSwapChain9::Present - * - ****************************************************************************/ - -#define D3DPRESENT_DONOTWAIT 0x00000001L -#define D3DPRESENT_LINEAR_CONTENT 0x00000002L - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -#define D3DPRESENT_DONOTFLIP 0x00000004L -#define D3DPRESENT_FLIPRESTART 0x00000008L -#define D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR 0x00000010L -#define D3DPRESENT_UPDATEOVERLAYONLY 0x00000020L -#define D3DPRESENT_HIDEOVERLAY 0x00000040L -#define D3DPRESENT_UPDATECOLORKEY 0x00000080L -#define D3DPRESENT_FORCEIMMEDIATE 0x00000100L - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - - -/**************************************************************************** - * - * Flags for DrawPrimitive/DrawIndexedPrimitive - * Also valid for Begin/BeginIndexed - * Also valid for VertexBuffer::CreateVertexBuffer - ****************************************************************************/ - - -/* - * DirectDraw error codes - */ -#define _FACD3D 0x876 -#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) -#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) - -/* - * Direct3D Errors - */ -#define D3D_OK S_OK - -#define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072) -#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073) -#define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074) -#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075) -#define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076) -#define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077) -#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078) -#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079) -#define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081) -#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082) -#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086) -#define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) - -#define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) -#define D3DERR_MOREDATA MAKE_D3DHRESULT(2151) -#define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) -#define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) -#define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) -#define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) -#define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155) -#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) -#define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157) -#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) -#define D3DOK_NOAUTOGEN MAKE_D3DSTATUS(2159) - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - - -#define D3DERR_DEVICEREMOVED MAKE_D3DHRESULT(2160) -#define S_NOT_RESIDENT MAKE_D3DSTATUS(2165) -#define S_RESIDENT_IN_SHARED_MEMORY MAKE_D3DSTATUS(2166) -#define S_PRESENT_MODE_CHANGED MAKE_D3DSTATUS(2167) -#define S_PRESENT_OCCLUDED MAKE_D3DSTATUS(2168) -#define D3DERR_DEVICEHUNG MAKE_D3DHRESULT(2164) -#define D3DERR_UNSUPPORTEDOVERLAY MAKE_D3DHRESULT(2171) -#define D3DERR_UNSUPPORTEDOVERLAYFORMAT MAKE_D3DHRESULT(2172) -#define D3DERR_CANNOTPROTECTCONTENT MAKE_D3DHRESULT(2173) -#define D3DERR_UNSUPPORTEDCRYPTO MAKE_D3DHRESULT(2174) -#define D3DERR_PRESENT_STATISTICS_DISJOINT MAKE_D3DHRESULT(2180) - - -/********************* - * D3D9Ex interfaces - *********************/ - -HRESULT WINAPI Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex**); - - - - -#undef INTERFACE -#define INTERFACE IDirect3D9Ex - -DECLARE_INTERFACE_(IDirect3D9Ex, IDirect3D9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D9 methods ***/ - STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; - STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; - STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE; - STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE; - STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) PURE; - STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; - STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) PURE; - STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; - STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) PURE; - STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) PURE; - STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; - STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) PURE; - STDMETHOD_(UINT, GetAdapterModeCountEx)(THIS_ UINT Adapter,CONST D3DDISPLAYMODEFILTER* pFilter ) PURE; - STDMETHOD(EnumAdapterModesEx)(THIS_ UINT Adapter,CONST D3DDISPLAYMODEFILTER* pFilter,UINT Mode,D3DDISPLAYMODEEX* pMode) PURE; - STDMETHOD(GetAdapterDisplayModeEx)(THIS_ UINT Adapter,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; - STDMETHOD(CreateDeviceEx)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX* pFullscreenDisplayMode,IDirect3DDevice9Ex** ppReturnedDeviceInterface) PURE; - STDMETHOD(GetAdapterLUID)(THIS_ UINT Adapter,LUID * pLUID) PURE; -}; - -typedef struct IDirect3D9Ex *LPDIRECT3D9EX, *PDIRECT3D9EX; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D9Ex_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D9Ex_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) -#define IDirect3D9Ex_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) -#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) -#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b) -#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d) -#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) -#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) -#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) -#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f) -#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) -#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d) -#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) -#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) -#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) -#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b) (p)->lpVtbl->GetAdapterModeCountEx(p,a,b) -#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModesEx(p,a,b,c,d) -#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetAdapterDisplayModeEx(p,a,b,c) -#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d,e,f,g) -#define IDirect3D9Ex_GetAdapterLUID(p,a,b) (p)->lpVtbl->GetAdapterLUID(p,a,b) -#else -#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D9Ex_AddRef(p) (p)->AddRef() -#define IDirect3D9Ex_Release(p) (p)->Release() -#define IDirect3D9Ex_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) -#define IDirect3D9Ex_GetAdapterCount(p) (p)->GetAdapterCount() -#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) -#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b) -#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->EnumAdapterModes(a,b,c,d) -#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) -#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) -#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) -#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f) -#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) -#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->CheckDeviceFormatConversion(a,b,c,d) -#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) -#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) -#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) -#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b) (p)->GetAdapterModeCountEx(a,b) -#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d) (p)->EnumAdapterModesEx(a,b,c,d) -#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c) (p)->GetAdapterDisplayModeEx(a,b,c) -#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g) (p)->CreateDeviceEx(a,b,c,d,e,f,g) -#define IDirect3D9Ex_GetAdapterLUID(p,a,b) (p)->GetAdapterLUID(a,b) -#endif - - - - - - - - - - - - - - - - - - - - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DDevice9Ex - -DECLARE_INTERFACE_(IDirect3DDevice9Ex, IDirect3DDevice9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice9 methods ***/ - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; - STDMETHOD(EvictManagedResources)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE; - STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE; - STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; - STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE; - STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; - STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; - STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE; - STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE; - STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE; - STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; - STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; - STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE; - STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE; - STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; - STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE; - STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; - STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; - STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) PURE; - STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE; - STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE; - STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE; - STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE; - STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) PURE; - STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; - STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE; - STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE; - STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE; - STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; - STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE; - STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE; - STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE; - STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE; - STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*) PURE; - STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE; - STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; - STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; - STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; - STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; - STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE; - STDMETHOD(BeginStateBlock)(THIS) PURE; - STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE; - STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE; - STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE; - STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE; - STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE; - STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; - STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; - STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE; - STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE; - STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; - STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; - STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; - STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; - STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; - STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE; - STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE; - STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE; - STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE; - STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE; - STDMETHOD_(float, GetNPatchMode)(THIS) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; - STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; - STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; - STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE; - STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE; - STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE; - STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE; - STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; - STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE; - STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE; - STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE; - STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE; - STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; - STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; - STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; - STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; - STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; - STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; - STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE; - STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride) PURE; - STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting) PURE; - STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting) PURE; - STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE; - STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE; - STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE; - STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE; - STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE; - STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; - STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; - STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; - STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; - STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; - STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; - STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; - STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; - STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; - STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE; - STDMETHOD(SetConvolutionMonoKernel)(THIS_ UINT width,UINT height,float* rows,float* columns) PURE; - STDMETHOD(ComposeRects)(THIS_ IDirect3DSurface9* pSrc,IDirect3DSurface9* pDst,IDirect3DVertexBuffer9* pSrcRectDescs,UINT NumRects,IDirect3DVertexBuffer9* pDstRectDescs,D3DCOMPOSERECTSOP Operation,int Xoffset,int Yoffset) PURE; - STDMETHOD(PresentEx)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; - STDMETHOD(GetGPUThreadPriority)(THIS_ INT* pPriority) PURE; - STDMETHOD(SetGPUThreadPriority)(THIS_ INT Priority) PURE; - STDMETHOD(WaitForVBlank)(THIS_ UINT iSwapChain) PURE; - STDMETHOD(CheckResourceResidency)(THIS_ IDirect3DResource9** pResourceArray,UINT32 NumResources) PURE; - STDMETHOD(SetMaximumFrameLatency)(THIS_ UINT MaxLatency) PURE; - STDMETHOD(GetMaximumFrameLatency)(THIS_ UINT* pMaxLatency) PURE; - STDMETHOD(CheckDeviceState)(THIS_ HWND hDestinationWindow) PURE; - STDMETHOD(CreateRenderTargetEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; - STDMETHOD(CreateOffscreenPlainSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; - STDMETHOD(CreateDepthStencilSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; - STDMETHOD(ResetEx)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX *pFullscreenDisplayMode) PURE; - STDMETHOD(GetDisplayModeEx)(THIS_ UINT iSwapChain,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; -}; - -typedef struct IDirect3DDevice9Ex *LPDIRECT3DDEVICE9EX, *PDIRECT3DDEVICE9EX; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice9Ex_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) -#define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) -#define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p) -#define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) -#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b) -#define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) -#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) -#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) -#define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) -#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) -#define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->lpVtbl->GetSwapChain(p,a,b) -#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->lpVtbl->GetNumberOfSwapChains(p) -#define IDirect3DDevice9Ex_Reset(p,a) (p)->lpVtbl->Reset(p,a) -#define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) -#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d) -#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b) -#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->lpVtbl->SetDialogBoxMode(p,a) -#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) -#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) -#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) -#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g) -#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f) -#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f) -#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) -#define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) -#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) -#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) -#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) -#define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) -#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f) -#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->lpVtbl->GetRenderTarget(p,a,b) -#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->lpVtbl->SetDepthStencilSurface(p,a) -#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) -#define IDirect3DDevice9Ex_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice9Ex_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) -#define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice9Ex_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DDevice9Ex_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) -#define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) -#define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) -#define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) -#define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) -#define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) -#define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) -#define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) -#define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) -#define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) -#define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) -#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) -#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) -#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->lpVtbl->GetSamplerState(p,a,b,c) -#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->lpVtbl->SetSamplerState(p,a,b,c) -#define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) -#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) -#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) -#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) -#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) -#define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->lpVtbl->SetScissorRect(p,a) -#define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->lpVtbl->GetScissorRect(p,a) -#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->lpVtbl->SetSoftwareVertexProcessing(p,a) -#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->lpVtbl->GetSoftwareVertexProcessing(p) -#define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->lpVtbl->SetNPatchMode(p,a) -#define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->lpVtbl->GetNPatchMode(p) -#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) -#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f) -#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) -#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f) -#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->lpVtbl->CreateVertexDeclaration(p,a,b) -#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a) -#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a) -#define IDirect3DDevice9Ex_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a) -#define IDirect3DDevice9Ex_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a) -#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->lpVtbl->CreateVertexShader(p,a,b) -#define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) -#define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) -#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c) -#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c) -#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c) -#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c) -#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c) -#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c) -#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->lpVtbl->SetStreamSource(p,a,b,c,d) -#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->lpVtbl->GetStreamSource(p,a,b,c,d) -#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->lpVtbl->SetStreamSourceFreq(p,a,b) -#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->lpVtbl->GetStreamSourceFreq(p,a,b) -#define IDirect3DDevice9Ex_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) -#define IDirect3DDevice9Ex_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) -#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) -#define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) -#define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) -#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c) -#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c) -#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c) -#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c) -#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c) -#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c) -#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) -#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) -#define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) -#define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->lpVtbl->CreateQuery(p,a,b) -#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->lpVtbl->SetConvolutionMonoKernel(p,a,b,c,d) -#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->ComposeRects(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->lpVtbl->PresentEx(p,a,b,c,d,e) -#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->lpVtbl->GetGPUThreadPriority(p,a) -#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->lpVtbl->SetGPUThreadPriority(p,a) -#define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->lpVtbl->WaitForVBlank(p,a) -#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->lpVtbl->CheckResourceResidency(p,a,b) -#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->lpVtbl->SetMaximumFrameLatency(p,a) -#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->lpVtbl->GetMaximumFrameLatency(p,a) -#define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->lpVtbl->CheckDeviceState(p,a) -#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) -#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) -#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) -#define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->lpVtbl->ResetEx(p,a,b) -#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetDisplayModeEx(p,a,b,c) -#else -#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice9Ex_AddRef(p) (p)->AddRef() -#define IDirect3DDevice9Ex_Release(p) (p)->Release() -#define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->TestCooperativeLevel() -#define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() -#define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->EvictManagedResources() -#define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) -#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->GetDisplayMode(a,b) -#define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->GetCreationParameters(a) -#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) -#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) -#define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->ShowCursor(a) -#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) -#define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->GetSwapChain(a,b) -#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->GetNumberOfSwapChains() -#define IDirect3DDevice9Ex_Reset(p,a) (p)->Reset(a) -#define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->Present(a,b,c,d) -#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->GetBackBuffer(a,b,c,d) -#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->GetRasterStatus(a,b) -#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->SetDialogBoxMode(a) -#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->SetGammaRamp(a,b,c) -#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->GetGammaRamp(a,b) -#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->CreateTexture(a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i) -#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->CreateCubeTexture(a,b,c,d,e,f,g) -#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->CreateVertexBuffer(a,b,c,d,e,f) -#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->CreateIndexBuffer(a,b,c,d,e,f) -#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->CreateRenderTarget(a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->UpdateSurface(a,b,c,d) -#define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) -#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->GetRenderTargetData(a,b) -#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->GetFrontBufferData(a,b) -#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->StretchRect(a,b,c,d,e) -#define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->ColorFill(a,b,c) -#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f) -#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->GetRenderTarget(a,b) -#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->SetDepthStencilSurface(a) -#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) -#define IDirect3DDevice9Ex_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice9Ex_EndScene(p) (p)->EndScene() -#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) -#define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice9Ex_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DDevice9Ex_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->SetLight(a,b) -#define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->GetLight(a,b) -#define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->LightEnable(a,b) -#define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) -#define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) -#define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) -#define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) -#define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->BeginStateBlock() -#define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->EndStateBlock(a) -#define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->GetClipStatus(a) -#define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->GetTexture(a,b) -#define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->SetTexture(a,b) -#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) -#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) -#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->GetSamplerState(a,b,c) -#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->SetSamplerState(a,b,c) -#define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->ValidateDevice(a) -#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) -#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) -#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) -#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) -#define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->SetScissorRect(a) -#define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->GetScissorRect(a) -#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->SetSoftwareVertexProcessing(a) -#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->GetSoftwareVertexProcessing() -#define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->SetNPatchMode(a) -#define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->GetNPatchMode() -#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) -#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->DrawIndexedPrimitive(a,b,c,d,e,f) -#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) -#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->ProcessVertices(a,b,c,d,e,f) -#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->CreateVertexDeclaration(a,b) -#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->SetVertexDeclaration(a) -#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->GetVertexDeclaration(a) -#define IDirect3DDevice9Ex_SetFVF(p,a) (p)->SetFVF(a) -#define IDirect3DDevice9Ex_GetFVF(p,a) (p)->GetFVF(a) -#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->CreateVertexShader(a,b) -#define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->SetVertexShader(a) -#define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->GetVertexShader(a) -#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->SetVertexShaderConstantF(a,b,c) -#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->GetVertexShaderConstantF(a,b,c) -#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->SetVertexShaderConstantI(a,b,c) -#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->GetVertexShaderConstantI(a,b,c) -#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->SetVertexShaderConstantB(a,b,c) -#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->GetVertexShaderConstantB(a,b,c) -#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->SetStreamSource(a,b,c,d) -#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->GetStreamSource(a,b,c,d) -#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->SetStreamSourceFreq(a,b) -#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->GetStreamSourceFreq(a,b) -#define IDirect3DDevice9Ex_SetIndices(p,a) (p)->SetIndices(a) -#define IDirect3DDevice9Ex_GetIndices(p,a) (p)->GetIndices(a) -#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) -#define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->SetPixelShader(a) -#define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->GetPixelShader(a) -#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->SetPixelShaderConstantF(a,b,c) -#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->GetPixelShaderConstantF(a,b,c) -#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->SetPixelShaderConstantI(a,b,c) -#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->GetPixelShaderConstantI(a,b,c) -#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->SetPixelShaderConstantB(a,b,c) -#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->GetPixelShaderConstantB(a,b,c) -#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) -#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) -#define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->DeletePatch(a) -#define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->CreateQuery(a,b) -#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->SetConvolutionMonoKernel(a,b,c,d) -#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->ComposeRects(a,b,c,d,e,f,g,h) -#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->PresentEx(a,b,c,d,e) -#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->GetGPUThreadPriority(a) -#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->SetGPUThreadPriority(a) -#define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->WaitForVBlank(a) -#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->CheckResourceResidency(a,b) -#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->SetMaximumFrameLatency(a) -#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->GetMaximumFrameLatency(a) -#define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->CheckDeviceState(a) -#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->CreateRenderTargetEx(a,b,c,d,e,f,g,h,i) -#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) (p)->CreateOffscreenPlainSurfaceEx(a,b,c,d,e,f,g) -#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) (p)->CreateDepthStencilSurfaceEx(a,b,c,d,e,f,g,h,i) -#define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->ResetEx(a,b) -#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->GetDisplayModeEx(a,b,c) -#endif - - - -#undef INTERFACE -#define INTERFACE IDirect3DSwapChain9Ex - -DECLARE_INTERFACE_(IDirect3DSwapChain9Ex, IDirect3DSwapChain9) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DSwapChain9 methods ***/ - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; - STDMETHOD(GetFrontBufferData)(THIS_ IDirect3DSurface9* pDestSurface) PURE; - STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; - STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; - STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; - STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; - STDMETHOD(GetLastPresentCount)(THIS_ UINT* pLastPresentCount) PURE; - STDMETHOD(GetPresentStats)(THIS_ D3DPRESENTSTATS* pPresentationStatistics) PURE; - STDMETHOD(GetDisplayModeEx)(THIS_ D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; -}; - -typedef struct IDirect3DSwapChain9Ex *LPDIRECT3DSWAPCHAIN9EX, *PDIRECT3DSWAPCHAIN9EX; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DSwapChain9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DSwapChain9Ex_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e) -#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a) -#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) -#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) -#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) -#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a) -#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->lpVtbl->GetLastPresentCount(p,a) -#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->lpVtbl->GetPresentStats(p,a) -#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->lpVtbl->GetDisplayModeEx(p,a,b) -#else -#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DSwapChain9Ex_AddRef(p) (p)->AddRef() -#define IDirect3DSwapChain9Ex_Release(p) (p)->Release() -#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->Present(a,b,c,d,e) -#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->GetFrontBufferData(a) -#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) -#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->GetRasterStatus(a) -#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->GetDisplayMode(a) -#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->GetPresentParameters(a) -#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->GetLastPresentCount(a) -#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->GetPresentStats(a) -#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->GetDisplayModeEx(a,b) -#endif - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - - - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - - - -#undef INTERFACE -#define INTERFACE IDirect3D9ExOverlayExtension - -DECLARE_INTERFACE_(IDirect3D9ExOverlayExtension, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D9ExOverlayExtension methods ***/ - STDMETHOD(CheckDeviceOverlayType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,UINT OverlayWidth,UINT OverlayHeight,D3DFORMAT OverlayFormat,D3DDISPLAYMODEEX* pDisplayMode,D3DDISPLAYROTATION DisplayRotation,D3DOVERLAYCAPS* pOverlayCaps) PURE; -}; - -typedef struct IDirect3D9ExOverlayExtension *LPDIRECT3D9EXOVERLAYEXTENSION, *PDIRECT3D9EXOVERLAYEXTENSION; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D9ExOverlayExtension_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D9ExOverlayExtension_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D9ExOverlayExtension_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D9ExOverlayExtension_CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) -#else -#define IDirect3D9ExOverlayExtension_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D9ExOverlayExtension_AddRef(p) (p)->AddRef() -#define IDirect3D9ExOverlayExtension_Release(p) (p)->Release() -#define IDirect3D9ExOverlayExtension_CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) (p)->CheckDeviceOverlayType(a,b,c,d,e,f,g,h) -#endif - - - -#undef INTERFACE -#define INTERFACE IDirect3DDevice9Video - -DECLARE_INTERFACE_(IDirect3DDevice9Video, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice9Video methods ***/ - STDMETHOD(GetContentProtectionCaps)(THIS_ CONST GUID* pCryptoType,CONST GUID* pDecodeProfile,D3DCONTENTPROTECTIONCAPS* pCaps) PURE; - STDMETHOD(CreateAuthenticatedChannel)(THIS_ D3DAUTHENTICATEDCHANNELTYPE ChannelType,IDirect3DAuthenticatedChannel9** ppAuthenticatedChannel,HANDLE* pChannelHandle) PURE; - STDMETHOD(CreateCryptoSession)(THIS_ CONST GUID* pCryptoType,CONST GUID* pDecodeProfile,IDirect3DCryptoSession9** ppCryptoSession,HANDLE* pCryptoHandle) PURE; -}; - -typedef struct IDirect3DDevice9Video *LPDIRECT3DDEVICE9VIDEO, *PDIRECT3DDEVICE9VIDEO; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice9Video_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice9Video_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice9Video_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice9Video_GetContentProtectionCaps(p,a,b,c) (p)->lpVtbl->GetContentProtectionCaps(p,a,b,c) -#define IDirect3DDevice9Video_CreateAuthenticatedChannel(p,a,b,c) (p)->lpVtbl->CreateAuthenticatedChannel(p,a,b,c) -#define IDirect3DDevice9Video_CreateCryptoSession(p,a,b,c,d) (p)->lpVtbl->CreateCryptoSession(p,a,b,c,d) -#else -#define IDirect3DDevice9Video_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice9Video_AddRef(p) (p)->AddRef() -#define IDirect3DDevice9Video_Release(p) (p)->Release() -#define IDirect3DDevice9Video_GetContentProtectionCaps(p,a,b,c) (p)->GetContentProtectionCaps(a,b,c) -#define IDirect3DDevice9Video_CreateAuthenticatedChannel(p,a,b,c) (p)->CreateAuthenticatedChannel(a,b,c) -#define IDirect3DDevice9Video_CreateCryptoSession(p,a,b,c,d) (p)->CreateCryptoSession(a,b,c,d) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DAuthenticatedChannel9 - -DECLARE_INTERFACE_(IDirect3DAuthenticatedChannel9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DAuthenticatedChannel9 methods ***/ - STDMETHOD(GetCertificateSize)(THIS_ UINT* pCertificateSize) PURE; - STDMETHOD(GetCertificate)(THIS_ UINT CertifacteSize,BYTE* ppCertificate) PURE; - STDMETHOD(NegotiateKeyExchange)(THIS_ UINT DataSize,VOID* pData) PURE; - STDMETHOD(Query)(THIS_ UINT InputSize,CONST VOID* pInput,UINT OutputSize,VOID* pOutput) PURE; - STDMETHOD(Configure)(THIS_ UINT InputSize,CONST VOID* pInput,D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT* pOutput) PURE; -}; - -typedef struct IDirect3DAuthenticatedChannel9 *LPDIRECT3DAUTHENTICATEDCHANNEL9, *PDIRECT3DAUTHENTICATEDCHANNEL9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DAuthenticatedChannel9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DAuthenticatedChannel9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DAuthenticatedChannel9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DAuthenticatedChannel9_GetCertificateSize(p,a) (p)->lpVtbl->GetCertificateSize(p,a) -#define IDirect3DAuthenticatedChannel9_GetCertificate(p,a,b) (p)->lpVtbl->GetCertificate(p,a,b) -#define IDirect3DAuthenticatedChannel9_NegotiateKeyExchange(p,a,b) (p)->lpVtbl->NegotiateKeyExchange(p,a,b) -#define IDirect3DAuthenticatedChannel9_Query(p,a,b,c,d) (p)->lpVtbl->Query(p,a,b,c,d) -#define IDirect3DAuthenticatedChannel9_Configure(p,a,b,c) (p)->lpVtbl->Configure(p,a,b,c) -#else -#define IDirect3DAuthenticatedChannel9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DAuthenticatedChannel9_AddRef(p) (p)->AddRef() -#define IDirect3DAuthenticatedChannel9_Release(p) (p)->Release() -#define IDirect3DAuthenticatedChannel9_GetCertificateSize(p,a) (p)->GetCertificateSize(a) -#define IDirect3DAuthenticatedChannel9_GetCertificate(p,a,b) (p)->GetCertificate(a,b) -#define IDirect3DAuthenticatedChannel9_NegotiateKeyExchange(p,a,b) (p)->NegotiateKeyExchange(a,b) -#define IDirect3DAuthenticatedChannel9_Query(p,a,b,c,d) (p)->Query(a,b,c,d) -#define IDirect3DAuthenticatedChannel9_Configure(p,a,b,c) (p)->Configure(a,b,c) -#endif - - - -#undef INTERFACE -#define INTERFACE IDirect3DCryptoSession9 - -DECLARE_INTERFACE_(IDirect3DCryptoSession9, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DCryptoSession9 methods ***/ - STDMETHOD(GetCertificateSize)(THIS_ UINT* pCertificateSize) PURE; - STDMETHOD(GetCertificate)(THIS_ UINT CertifacteSize,BYTE* ppCertificate) PURE; - STDMETHOD(NegotiateKeyExchange)(THIS_ UINT DataSize,VOID* pData) PURE; - STDMETHOD(EncryptionBlt)(THIS_ IDirect3DSurface9* pSrcSurface,IDirect3DSurface9* pDstSurface,UINT DstSurfaceSize,VOID* pIV) PURE; - STDMETHOD(DecryptionBlt)(THIS_ IDirect3DSurface9* pSrcSurface,IDirect3DSurface9* pDstSurface,UINT SrcSurfaceSize,D3DENCRYPTED_BLOCK_INFO* pEncryptedBlockInfo,VOID* pContentKey,VOID* pIV) PURE; - STDMETHOD(GetSurfacePitch)(THIS_ IDirect3DSurface9* pSrcSurface,UINT* pSurfacePitch) PURE; - STDMETHOD(StartSessionKeyRefresh)(THIS_ VOID* pRandomNumber,UINT RandomNumberSize) PURE; - STDMETHOD(FinishSessionKeyRefresh)(THIS) PURE; - STDMETHOD(GetEncryptionBltKey)(THIS_ VOID* pReadbackKey,UINT KeySize) PURE; -}; - -typedef struct IDirect3DCryptoSession9 *LPDIRECT3DCRYPTOSESSION9, *PDIRECT3DCRYPTOSESSION9; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DCryptoSession9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DCryptoSession9_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DCryptoSession9_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DCryptoSession9_GetCertificateSize(p,a) (p)->lpVtbl->GetCertificateSize(p,a) -#define IDirect3DCryptoSession9_GetCertificate(p,a,b) (p)->lpVtbl->GetCertificate(p,a,b) -#define IDirect3DCryptoSession9_NegotiateKeyExchange(p,a,b) (p)->lpVtbl->NegotiateKeyExchange(p,a,b) -#define IDirect3DCryptoSession9_EncryptionBlt(p,a,b,c,d) (p)->lpVtbl->EncryptionBlt(p,a,b,c,d) -#define IDirect3DCryptoSession9_DecryptionBlt(p,a,b,c,d,e,f) (p)->lpVtbl->DecryptionBlt(p,a,b,c,d,e,f) -#define IDirect3DCryptoSession9_GetSurfacePitch(p,a,b) (p)->lpVtbl->GetSurfacePitch(p,a,b) -#define IDirect3DCryptoSession9_StartSessionKeyRefresh(p,a,b) (p)->lpVtbl->StartSessionKeyRefresh(p,a,b) -#define IDirect3DCryptoSession9_FinishSessionKeyRefresh(p) (p)->lpVtbl->FinishSessionKeyRefresh(p) -#define IDirect3DCryptoSession9_GetEncryptionBltKey(p,a,b) (p)->lpVtbl->GetEncryptionBltKey(p,a,b) -#else -#define IDirect3DCryptoSession9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DCryptoSession9_AddRef(p) (p)->AddRef() -#define IDirect3DCryptoSession9_Release(p) (p)->Release() -#define IDirect3DCryptoSession9_GetCertificateSize(p,a) (p)->GetCertificateSize(a) -#define IDirect3DCryptoSession9_GetCertificate(p,a,b) (p)->GetCertificate(a,b) -#define IDirect3DCryptoSession9_NegotiateKeyExchange(p,a,b) (p)->NegotiateKeyExchange(a,b) -#define IDirect3DCryptoSession9_EncryptionBlt(p,a,b,c,d) (p)->EncryptionBlt(a,b,c,d) -#define IDirect3DCryptoSession9_DecryptionBlt(p,a,b,c,d,e,f) (p)->DecryptionBlt(a,b,c,d,e,f) -#define IDirect3DCryptoSession9_GetSurfacePitch(p,a,b) (p)->GetSurfacePitch(a,b) -#define IDirect3DCryptoSession9_StartSessionKeyRefresh(p,a,b) (p)->StartSessionKeyRefresh(a,b) -#define IDirect3DCryptoSession9_FinishSessionKeyRefresh(p) (p)->FinishSessionKeyRefresh() -#define IDirect3DCryptoSession9_GetEncryptionBltKey(p,a,b) (p)->GetEncryptionBltKey(a,b) -#endif - -/* -- D3D9Ex only */ -#endif // !D3D_DISABLE_9EX - - -#ifdef __cplusplus -}; -#endif - - -#endif /* (DIRECT3D_VERSION >= 0x0900) */ -#endif /* _D3D_H_ */ - diff --git a/bgfx/3rdparty/directx-headers/include/directx/d3d9caps.h b/bgfx/3rdparty/directx-headers/include/directx/d3d9caps.h deleted file mode 100644 index 8298cc4f..00000000 --- a/bgfx/3rdparty/directx-headers/include/directx/d3d9caps.h +++ /dev/null @@ -1,571 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d9caps.h - * Content: Direct3D capabilities include file - * - ***************************************************************************/ - -#ifndef _d3d9CAPS_H -#define _d3d9CAPS_H - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0900 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX9 interfaces -#if(DIRECT3D_VERSION >= 0x0900) - - - -#if defined(_X86_) || defined(_IA64_) -#pragma pack(4) -#endif - -typedef struct _D3DVSHADERCAPS2_0 -{ - DWORD Caps; - INT DynamicFlowControlDepth; - INT NumTemps; - INT StaticFlowControlDepth; -} D3DVSHADERCAPS2_0; - -#define D3DVS20CAPS_PREDICATION (1<<0) - -#define D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH 24 -#define D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH 0 -#define D3DVS20_MAX_NUMTEMPS 32 -#define D3DVS20_MIN_NUMTEMPS 12 -#define D3DVS20_MAX_STATICFLOWCONTROLDEPTH 4 -#define D3DVS20_MIN_STATICFLOWCONTROLDEPTH 1 - -typedef struct _D3DPSHADERCAPS2_0 -{ - DWORD Caps; - INT DynamicFlowControlDepth; - INT NumTemps; - INT StaticFlowControlDepth; - INT NumInstructionSlots; -} D3DPSHADERCAPS2_0; - -#define D3DPS20CAPS_ARBITRARYSWIZZLE (1<<0) -#define D3DPS20CAPS_GRADIENTINSTRUCTIONS (1<<1) -#define D3DPS20CAPS_PREDICATION (1<<2) -#define D3DPS20CAPS_NODEPENDENTREADLIMIT (1<<3) -#define D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT (1<<4) - -#define D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH 24 -#define D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH 0 -#define D3DPS20_MAX_NUMTEMPS 32 -#define D3DPS20_MIN_NUMTEMPS 12 -#define D3DPS20_MAX_STATICFLOWCONTROLDEPTH 4 -#define D3DPS20_MIN_STATICFLOWCONTROLDEPTH 0 -#define D3DPS20_MAX_NUMINSTRUCTIONSLOTS 512 -#define D3DPS20_MIN_NUMINSTRUCTIONSLOTS 96 - -#define D3DMIN30SHADERINSTRUCTIONS 512 -#define D3DMAX30SHADERINSTRUCTIONS 32768 - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -typedef struct _D3DOVERLAYCAPS -{ - UINT Caps; - UINT MaxOverlayDisplayWidth; - UINT MaxOverlayDisplayHeight; -} D3DOVERLAYCAPS; - -#define D3DOVERLAYCAPS_FULLRANGERGB 0x00000001 -#define D3DOVERLAYCAPS_LIMITEDRANGERGB 0x00000002 -#define D3DOVERLAYCAPS_YCbCr_BT601 0x00000004 -#define D3DOVERLAYCAPS_YCbCr_BT709 0x00000008 -#define D3DOVERLAYCAPS_YCbCr_BT601_xvYCC 0x00000010 -#define D3DOVERLAYCAPS_YCbCr_BT709_xvYCC 0x00000020 -#define D3DOVERLAYCAPS_STRETCHX 0x00000040 -#define D3DOVERLAYCAPS_STRETCHY 0x00000080 - - -typedef struct _D3DCONTENTPROTECTIONCAPS -{ - DWORD Caps; - GUID KeyExchangeType; - UINT BufferAlignmentStart; - UINT BlockAlignmentSize; - ULONGLONG ProtectedMemorySize; -} D3DCONTENTPROTECTIONCAPS; - -#define D3DCPCAPS_SOFTWARE 0x00000001 -#define D3DCPCAPS_HARDWARE 0x00000002 -#define D3DCPCAPS_PROTECTIONALWAYSON 0x00000004 -#define D3DCPCAPS_PARTIALDECRYPTION 0x00000008 -#define D3DCPCAPS_CONTENTKEY 0x00000010 -#define D3DCPCAPS_FRESHENSESSIONKEY 0x00000020 -#define D3DCPCAPS_ENCRYPTEDREADBACK 0x00000040 -#define D3DCPCAPS_ENCRYPTEDREADBACKKEY 0x00000080 -#define D3DCPCAPS_SEQUENTIAL_CTR_IV 0x00000100 -#define D3DCPCAPS_ENCRYPTSLICEDATAONLY 0x00000200 - -DEFINE_GUID(D3DCRYPTOTYPE_AES128_CTR, -0x9b6bd711, 0x4f74, 0x41c9, 0x9e, 0x7b, 0xb, 0xe2, 0xd7, 0xd9, 0x3b, 0x4f); -DEFINE_GUID(D3DCRYPTOTYPE_PROPRIETARY, -0xab4e9afd, 0x1d1c, 0x46e6, 0xa7, 0x2f, 0x8, 0x69, 0x91, 0x7b, 0xd, 0xe8); - -DEFINE_GUID(D3DKEYEXCHANGE_RSAES_OAEP, -0xc1949895, 0xd72a, 0x4a1d, 0x8e, 0x5d, 0xed, 0x85, 0x7d, 0x17, 0x15, 0x20); -DEFINE_GUID(D3DKEYEXCHANGE_DXVA, -0x43d3775c, 0x38e5, 0x4924, 0x8d, 0x86, 0xd3, 0xfc, 0xcf, 0x15, 0x3e, 0x9b); - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - -typedef struct _D3DCAPS9 -{ - /* Device Info */ - D3DDEVTYPE DeviceType; - UINT AdapterOrdinal; - - /* Caps from DX7 Draw */ - DWORD Caps; - DWORD Caps2; - DWORD Caps3; - DWORD PresentationIntervals; - - /* Cursor Caps */ - DWORD CursorCaps; - - /* 3D Device Caps */ - DWORD DevCaps; - - DWORD PrimitiveMiscCaps; - DWORD RasterCaps; - DWORD ZCmpCaps; - DWORD SrcBlendCaps; - DWORD DestBlendCaps; - DWORD AlphaCmpCaps; - DWORD ShadeCaps; - DWORD TextureCaps; - DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's - DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture9's - DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture9's - DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture9's - DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture9's - - DWORD LineCaps; // D3DLINECAPS - - DWORD MaxTextureWidth, MaxTextureHeight; - DWORD MaxVolumeExtent; - - DWORD MaxTextureRepeat; - DWORD MaxTextureAspectRatio; - DWORD MaxAnisotropy; - float MaxVertexW; - - float GuardBandLeft; - float GuardBandTop; - float GuardBandRight; - float GuardBandBottom; - - float ExtentsAdjust; - DWORD StencilCaps; - - DWORD FVFCaps; - DWORD TextureOpCaps; - DWORD MaxTextureBlendStages; - DWORD MaxSimultaneousTextures; - - DWORD VertexProcessingCaps; - DWORD MaxActiveLights; - DWORD MaxUserClipPlanes; - DWORD MaxVertexBlendMatrices; - DWORD MaxVertexBlendMatrixIndex; - - float MaxPointSize; - - DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call - DWORD MaxVertexIndex; - DWORD MaxStreams; - DWORD MaxStreamStride; // max stride for SetStreamSource - - DWORD VertexShaderVersion; - DWORD MaxVertexShaderConst; // number of vertex shader constant registers - - DWORD PixelShaderVersion; - float PixelShader1xMaxValue; // max value storable in registers of ps.1.x shaders - - // Here are the DX9 specific ones - DWORD DevCaps2; - - float MaxNpatchTessellationLevel; - DWORD Reserved5; - - UINT MasterAdapterOrdinal; // ordinal of master adaptor for adapter group - UINT AdapterOrdinalInGroup; // ordinal inside the adapter group - UINT NumberOfAdaptersInGroup; // number of adapters in this adapter group (only if master) - DWORD DeclTypes; // Data types, supported in vertex declarations - DWORD NumSimultaneousRTs; // Will be at least 1 - DWORD StretchRectFilterCaps; // Filter caps supported by StretchRect - D3DVSHADERCAPS2_0 VS20Caps; - D3DPSHADERCAPS2_0 PS20Caps; - DWORD VertexTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's for texture, used in vertex shaders - DWORD MaxVShaderInstructionsExecuted; // maximum number of vertex shader instructions that can be executed - DWORD MaxPShaderInstructionsExecuted; // maximum number of pixel shader instructions that can be executed - DWORD MaxVertexShader30InstructionSlots; - DWORD MaxPixelShader30InstructionSlots; -} D3DCAPS9; - -// -// BIT DEFINES FOR D3DCAPS9 DWORD MEMBERS -// - -// -// Caps -// -#define D3DCAPS_OVERLAY 0x00000800L -#define D3DCAPS_READ_SCANLINE 0x00020000L - -// -// Caps2 -// -#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L -#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L -#define D3DCAPS2_RESERVED 0x02000000L -#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L -#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L -#define D3DCAPS2_CANAUTOGENMIPMAP 0x40000000L - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -#define D3DCAPS2_CANSHARERESOURCE 0x80000000L - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - -// -// Caps3 -// -#define D3DCAPS3_RESERVED 0x8000001fL - -// Indicates that the device can respect the ALPHABLENDENABLE render state -// when fullscreen while using the FLIP or DISCARD swap effect. -// COPY and COPYVSYNC swap effects work whether or not this flag is set. -#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L - -// Indicates that the device can perform a gamma correction from -// a windowed back buffer containing linear content to the sRGB desktop. -#define D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION 0x00000080L - -#define D3DCAPS3_COPY_TO_VIDMEM 0x00000100L /* Device can acclerate copies from sysmem to local vidmem */ -#define D3DCAPS3_COPY_TO_SYSTEMMEM 0x00000200L /* Device can acclerate copies from local vidmem to sysmem */ -#define D3DCAPS3_DXVAHD 0x00000400L -#define D3DCAPS3_DXVAHD_LIMITED 0x00000800L - - -// -// PresentationIntervals -// -#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L -#define D3DPRESENT_INTERVAL_ONE 0x00000001L -#define D3DPRESENT_INTERVAL_TWO 0x00000002L -#define D3DPRESENT_INTERVAL_THREE 0x00000004L -#define D3DPRESENT_INTERVAL_FOUR 0x00000008L -#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L - -// -// CursorCaps -// -// Driver supports HW color cursor in at least hi-res modes(height >=400) -#define D3DCURSORCAPS_COLOR 0x00000001L -// Driver supports HW cursor also in low-res modes(height < 400) -#define D3DCURSORCAPS_LOWRES 0x00000002L - -// -// DevCaps -// -#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ -#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ -#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ -#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ -#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ -#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ -#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ -#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ -#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ -#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */ -#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ -#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/ -#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ -#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ -#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ -#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */ -#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */ -#define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */ -#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */ -#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */ - -// -// PrimitiveMiscCaps -// -#define D3DPMISCCAPS_MASKZ 0x00000002L -#define D3DPMISCCAPS_CULLNONE 0x00000010L -#define D3DPMISCCAPS_CULLCW 0x00000020L -#define D3DPMISCCAPS_CULLCCW 0x00000040L -#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L -#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */ -#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */ -#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */ -#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */ -#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */ -#define D3DPMISCCAPS_INDEPENDENTWRITEMASKS 0x00004000L /* Device supports independent write masks for MET or MRT */ -#define D3DPMISCCAPS_PERSTAGECONSTANT 0x00008000L /* Device supports per-stage constants */ -#define D3DPMISCCAPS_FOGANDSPECULARALPHA 0x00010000L /* Device supports separate fog and specular alpha (many devices - use the specular alpha channel to store fog factor) */ -#define D3DPMISCCAPS_SEPARATEALPHABLEND 0x00020000L /* Device supports separate blend settings for the alpha channel */ -#define D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS 0x00040000L /* Device supports different bit depths for MRT */ -#define D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING 0x00080000L /* Device supports post-pixel shader operations for MRT */ -#define D3DPMISCCAPS_FOGVERTEXCLAMPED 0x00100000L /* Device clamps fog blend factor per vertex */ - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -#define D3DPMISCCAPS_POSTBLENDSRGBCONVERT 0x00200000L /* Indicates device can perform conversion to sRGB after blending. */ - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - - -// -// LineCaps -// -#define D3DLINECAPS_TEXTURE 0x00000001L -#define D3DLINECAPS_ZTEST 0x00000002L -#define D3DLINECAPS_BLEND 0x00000004L -#define D3DLINECAPS_ALPHACMP 0x00000008L -#define D3DLINECAPS_FOG 0x00000010L -#define D3DLINECAPS_ANTIALIAS 0x00000020L - -// -// RasterCaps -// -#define D3DPRASTERCAPS_DITHER 0x00000001L -#define D3DPRASTERCAPS_ZTEST 0x00000010L -#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L -#define D3DPRASTERCAPS_FOGTABLE 0x00000100L -#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L -#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L -#define D3DPRASTERCAPS_FOGRANGE 0x00010000L -#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L -#define D3DPRASTERCAPS_WBUFFER 0x00040000L -#define D3DPRASTERCAPS_WFOG 0x00100000L -#define D3DPRASTERCAPS_ZFOG 0x00200000L -#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */ -#define D3DPRASTERCAPS_SCISSORTEST 0x01000000L -#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS 0x02000000L -#define D3DPRASTERCAPS_DEPTHBIAS 0x04000000L -#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE 0x08000000L - -// -// ZCmpCaps, AlphaCmpCaps -// -#define D3DPCMPCAPS_NEVER 0x00000001L -#define D3DPCMPCAPS_LESS 0x00000002L -#define D3DPCMPCAPS_EQUAL 0x00000004L -#define D3DPCMPCAPS_LESSEQUAL 0x00000008L -#define D3DPCMPCAPS_GREATER 0x00000010L -#define D3DPCMPCAPS_NOTEQUAL 0x00000020L -#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L -#define D3DPCMPCAPS_ALWAYS 0x00000080L - -// -// SourceBlendCaps, DestBlendCaps -// -#define D3DPBLENDCAPS_ZERO 0x00000001L -#define D3DPBLENDCAPS_ONE 0x00000002L -#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L -#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L -#define D3DPBLENDCAPS_SRCALPHA 0x00000010L -#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L -#define D3DPBLENDCAPS_DESTALPHA 0x00000040L -#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L -#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L -#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L -#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L -#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L -#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L -#define D3DPBLENDCAPS_BLENDFACTOR 0x00002000L /* Supports both D3DBLEND_BLENDFACTOR and D3DBLEND_INVBLENDFACTOR */ - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -#define D3DPBLENDCAPS_SRCCOLOR2 0x00004000L -#define D3DPBLENDCAPS_INVSRCCOLOR2 0x00008000L - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - - -// -// ShadeCaps -// -#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L -#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L -#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L -#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L - -// -// TextureCaps -// -#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */ -#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */ -#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */ -#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */ -#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */ -#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */ -// Device can use non-POW2 textures if: -// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage -// 2) D3DRS_WRAP(N) is zero for this texture's coordinates -// 3) mip mapping is not enabled (use magnification filter only) -#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L -#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */ -#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */ -#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */ -#define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */ -#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */ -#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */ -#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */ -#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */ -#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV 0x00200000L /* Device does not support projected bump env lookup operation - in programmable and fixed function pixel shaders */ - -// -// TextureFilterCaps, StretchRectFilterCaps -// -#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */ -#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L -#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L -#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD 0x00000800L -#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD 0x00001000L -#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */ -#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L - -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - -#define D3DPTFILTERCAPS_CONVOLUTIONMONO 0x00040000L /* Min and Mag for the convolution mono filter */ - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - -#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */ -#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L -#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L -#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD 0x08000000L -#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD 0x10000000L - -// -// TextureAddressCaps -// -#define D3DPTADDRESSCAPS_WRAP 0x00000001L -#define D3DPTADDRESSCAPS_MIRROR 0x00000002L -#define D3DPTADDRESSCAPS_CLAMP 0x00000004L -#define D3DPTADDRESSCAPS_BORDER 0x00000008L -#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L -#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L - -// -// StencilCaps -// -#define D3DSTENCILCAPS_KEEP 0x00000001L -#define D3DSTENCILCAPS_ZERO 0x00000002L -#define D3DSTENCILCAPS_REPLACE 0x00000004L -#define D3DSTENCILCAPS_INCRSAT 0x00000008L -#define D3DSTENCILCAPS_DECRSAT 0x00000010L -#define D3DSTENCILCAPS_INVERT 0x00000020L -#define D3DSTENCILCAPS_INCR 0x00000040L -#define D3DSTENCILCAPS_DECR 0x00000080L -#define D3DSTENCILCAPS_TWOSIDED 0x00000100L - -// -// TextureOpCaps -// -#define D3DTEXOPCAPS_DISABLE 0x00000001L -#define D3DTEXOPCAPS_SELECTARG1 0x00000002L -#define D3DTEXOPCAPS_SELECTARG2 0x00000004L -#define D3DTEXOPCAPS_MODULATE 0x00000008L -#define D3DTEXOPCAPS_MODULATE2X 0x00000010L -#define D3DTEXOPCAPS_MODULATE4X 0x00000020L -#define D3DTEXOPCAPS_ADD 0x00000040L -#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L -#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L -#define D3DTEXOPCAPS_SUBTRACT 0x00000200L -#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L -#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L -#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L -#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L -#define D3DTEXOPCAPS_PREMODULATE 0x00010000L -#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L -#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L -#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L -#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L -#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L -#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L -#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L -#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L -#define D3DTEXOPCAPS_LERP 0x02000000L - -// -// FVFCaps -// -#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ -#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ -#define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */ - -// -// VertexProcessingCaps -// -#define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */ -#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */ -#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */ -#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */ -#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */ -#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */ -#define D3DVTXPCAPS_TEXGEN_SPHEREMAP 0x00000100L /* device supports D3DTSS_TCI_SPHEREMAP */ -#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER 0x00000200L /* device does not support TexGen in non-local - viewer mode */ - -// -// DevCaps2 -// -#define D3DDEVCAPS2_STREAMOFFSET 0x00000001L /* Device supports offsets in streams. Must be set by DX9 drivers */ -#define D3DDEVCAPS2_DMAPNPATCH 0x00000002L /* Device supports displacement maps for N-Patches*/ -#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004L /* Device supports adaptive tesselation of RT-patches*/ -#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008L /* Device supports adaptive tesselation of N-patches*/ -#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010L /* Device supports StretchRect calls with a texture as the source*/ -#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020L /* Device supports presampled displacement maps for N-Patches */ -#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040L /* Vertex elements in a vertex declaration can share the same stream offset */ - -// -// DeclTypes -// -#define D3DDTCAPS_UBYTE4 0x00000001L -#define D3DDTCAPS_UBYTE4N 0x00000002L -#define D3DDTCAPS_SHORT2N 0x00000004L -#define D3DDTCAPS_SHORT4N 0x00000008L -#define D3DDTCAPS_USHORT2N 0x00000010L -#define D3DDTCAPS_USHORT4N 0x00000020L -#define D3DDTCAPS_UDEC3 0x00000040L -#define D3DDTCAPS_DEC3N 0x00000080L -#define D3DDTCAPS_FLOAT16_2 0x00000100L -#define D3DDTCAPS_FLOAT16_4 0x00000200L - - -#pragma pack() - - -#endif /* (DIRECT3D_VERSION >= 0x0900) */ -#endif /* _d3d9CAPS_H_ */ - diff --git a/bgfx/3rdparty/directx-headers/include/directx/d3d9types.h b/bgfx/3rdparty/directx-headers/include/directx/d3d9types.h deleted file mode 100644 index d16102bd..00000000 --- a/bgfx/3rdparty/directx-headers/include/directx/d3d9types.h +++ /dev/null @@ -1,2444 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d9types.h - * Content: Direct3D capabilities include file - * - ***************************************************************************/ - -#ifndef _d3d9TYPES_H_ -#define _d3d9TYPES_H_ - - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0900 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX9 interfaces -#if(DIRECT3D_VERSION >= 0x0900) - -#include - -#ifdef _MSC_VER -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // anonymous unions warning -#if defined(_X86_) || defined(_IA64_) -#pragma pack(4) -#endif -#endif // _MSC_VER - -// D3DCOLOR is equivalent to D3DFMT_A8R8G8B8 -#ifndef D3DCOLOR_DEFINED -typedef DWORD D3DCOLOR; -#define D3DCOLOR_DEFINED -#endif - -// maps unsigned 8 bits/channel to D3DCOLOR -#define D3DCOLOR_ARGB(a,r,g,b) \ - ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) -#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b) -#define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b) - -#define D3DCOLOR_XYUV(y,u,v) D3DCOLOR_ARGB(0xff,y,u,v) -#define D3DCOLOR_AYUV(a,y,u,v) D3DCOLOR_ARGB(a,y,u,v) - -// maps floating point channels (0.f to 1.f range) to D3DCOLOR -#define D3DCOLOR_COLORVALUE(r,g,b,a) \ - D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f)) - - -#ifndef D3DVECTOR_DEFINED -typedef struct _D3DVECTOR { - float x; - float y; - float z; -} D3DVECTOR; -#define D3DVECTOR_DEFINED -#endif - -#ifndef D3DCOLORVALUE_DEFINED -typedef struct _D3DCOLORVALUE { - float r; - float g; - float b; - float a; -} D3DCOLORVALUE; -#define D3DCOLORVALUE_DEFINED -#endif - -#ifndef D3DRECT_DEFINED -typedef struct _D3DRECT { - LONG x1; - LONG y1; - LONG x2; - LONG y2; -} D3DRECT; -#define D3DRECT_DEFINED -#endif - - - -#ifndef D3DMATRIX_DEFINED -typedef struct _D3DMATRIX { - union { - struct { - float _11, _12, _13, _14; - float _21, _22, _23, _24; - float _31, _32, _33, _34; - float _41, _42, _43, _44; - - }; - float m[4][4]; - }; -} D3DMATRIX; -#define D3DMATRIX_DEFINED -#endif - - - -typedef struct _D3DVIEWPORT9 { - DWORD X; - DWORD Y; /* Viewport Top left */ - DWORD Width; - DWORD Height; /* Viewport Dimensions */ - float MinZ; /* Min/max of clip Volume */ - float MaxZ; -} D3DVIEWPORT9; - -/* - * Values for clip fields. - */ - -// Max number of user clipping planes, supported in D3D. -#define D3DMAXUSERCLIPPLANES 32 - -// These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE -// -#define D3DCLIPPLANE0 (1 << 0) -#define D3DCLIPPLANE1 (1 << 1) -#define D3DCLIPPLANE2 (1 << 2) -#define D3DCLIPPLANE3 (1 << 3) -#define D3DCLIPPLANE4 (1 << 4) -#define D3DCLIPPLANE5 (1 << 5) - -// The following bits are used in the ClipUnion and ClipIntersection -// members of the D3DCLIPSTATUS9 -// - -#define D3DCS_LEFT 0x00000001L -#define D3DCS_RIGHT 0x00000002L -#define D3DCS_TOP 0x00000004L -#define D3DCS_BOTTOM 0x00000008L -#define D3DCS_FRONT 0x00000010L -#define D3DCS_BACK 0x00000020L -#define D3DCS_PLANE0 0x00000040L -#define D3DCS_PLANE1 0x00000080L -#define D3DCS_PLANE2 0x00000100L -#define D3DCS_PLANE3 0x00000200L -#define D3DCS_PLANE4 0x00000400L -#define D3DCS_PLANE5 0x00000800L - -#define D3DCS_ALL (D3DCS_LEFT | \ - D3DCS_RIGHT | \ - D3DCS_TOP | \ - D3DCS_BOTTOM | \ - D3DCS_FRONT | \ - D3DCS_BACK | \ - D3DCS_PLANE0 | \ - D3DCS_PLANE1 | \ - D3DCS_PLANE2 | \ - D3DCS_PLANE3 | \ - D3DCS_PLANE4 | \ - D3DCS_PLANE5) - -typedef struct _D3DCLIPSTATUS9 { - DWORD ClipUnion; - DWORD ClipIntersection; -} D3DCLIPSTATUS9; - -typedef struct _D3DMATERIAL9 { - D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */ - D3DCOLORVALUE Ambient; /* Ambient color RGB */ - D3DCOLORVALUE Specular; /* Specular 'shininess' */ - D3DCOLORVALUE Emissive; /* Emissive color RGB */ - float Power; /* Sharpness if specular highlight */ -} D3DMATERIAL9; - -typedef enum _D3DLIGHTTYPE { - D3DLIGHT_POINT = 1, - D3DLIGHT_SPOT = 2, - D3DLIGHT_DIRECTIONAL = 3, - D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DLIGHTTYPE; - -typedef struct _D3DLIGHT9 { - D3DLIGHTTYPE Type; /* Type of light source */ - D3DCOLORVALUE Diffuse; /* Diffuse color of light */ - D3DCOLORVALUE Specular; /* Specular color of light */ - D3DCOLORVALUE Ambient; /* Ambient color of light */ - D3DVECTOR Position; /* Position in world space */ - D3DVECTOR Direction; /* Direction in world space */ - float Range; /* Cutoff range */ - float Falloff; /* Falloff */ - float Attenuation0; /* Constant attenuation */ - float Attenuation1; /* Linear attenuation */ - float Attenuation2; /* Quadratic attenuation */ - float Theta; /* Inner angle of spotlight cone */ - float Phi; /* Outer angle of spotlight cone */ -} D3DLIGHT9; - -/* - * Options for clearing - */ -#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ -#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ -#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ - -/* - * The following defines the rendering states - */ - -typedef enum _D3DSHADEMODE { - D3DSHADE_FLAT = 1, - D3DSHADE_GOURAUD = 2, - D3DSHADE_PHONG = 3, - D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSHADEMODE; - -typedef enum _D3DFILLMODE { - D3DFILL_POINT = 1, - D3DFILL_WIREFRAME = 2, - D3DFILL_SOLID = 3, - D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DFILLMODE; - -typedef enum _D3DBLEND { - D3DBLEND_ZERO = 1, - D3DBLEND_ONE = 2, - D3DBLEND_SRCCOLOR = 3, - D3DBLEND_INVSRCCOLOR = 4, - D3DBLEND_SRCALPHA = 5, - D3DBLEND_INVSRCALPHA = 6, - D3DBLEND_DESTALPHA = 7, - D3DBLEND_INVDESTALPHA = 8, - D3DBLEND_DESTCOLOR = 9, - D3DBLEND_INVDESTCOLOR = 10, - D3DBLEND_SRCALPHASAT = 11, - D3DBLEND_BOTHSRCALPHA = 12, - D3DBLEND_BOTHINVSRCALPHA = 13, - D3DBLEND_BLENDFACTOR = 14, /* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on */ - D3DBLEND_INVBLENDFACTOR = 15, /* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on */ -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - - D3DBLEND_SRCCOLOR2 = 16, - D3DBLEND_INVSRCCOLOR2 = 17, - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DBLEND; - -typedef enum _D3DBLENDOP { - D3DBLENDOP_ADD = 1, - D3DBLENDOP_SUBTRACT = 2, - D3DBLENDOP_REVSUBTRACT = 3, - D3DBLENDOP_MIN = 4, - D3DBLENDOP_MAX = 5, - D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DBLENDOP; - -typedef enum _D3DTEXTUREADDRESS { - D3DTADDRESS_WRAP = 1, - D3DTADDRESS_MIRROR = 2, - D3DTADDRESS_CLAMP = 3, - D3DTADDRESS_BORDER = 4, - D3DTADDRESS_MIRRORONCE = 5, - D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTUREADDRESS; - -typedef enum _D3DCULL { - D3DCULL_NONE = 1, - D3DCULL_CW = 2, - D3DCULL_CCW = 3, - D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DCULL; - -typedef enum _D3DCMPFUNC { - D3DCMP_NEVER = 1, - D3DCMP_LESS = 2, - D3DCMP_EQUAL = 3, - D3DCMP_LESSEQUAL = 4, - D3DCMP_GREATER = 5, - D3DCMP_NOTEQUAL = 6, - D3DCMP_GREATEREQUAL = 7, - D3DCMP_ALWAYS = 8, - D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DCMPFUNC; - -typedef enum _D3DSTENCILOP { - D3DSTENCILOP_KEEP = 1, - D3DSTENCILOP_ZERO = 2, - D3DSTENCILOP_REPLACE = 3, - D3DSTENCILOP_INCRSAT = 4, - D3DSTENCILOP_DECRSAT = 5, - D3DSTENCILOP_INVERT = 6, - D3DSTENCILOP_INCR = 7, - D3DSTENCILOP_DECR = 8, - D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSTENCILOP; - -typedef enum _D3DFOGMODE { - D3DFOG_NONE = 0, - D3DFOG_EXP = 1, - D3DFOG_EXP2 = 2, - D3DFOG_LINEAR = 3, - D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DFOGMODE; - -typedef enum _D3DZBUFFERTYPE { - D3DZB_FALSE = 0, - D3DZB_TRUE = 1, // Z buffering - D3DZB_USEW = 2, // W buffering - D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DZBUFFERTYPE; - -// Primitives supported by draw-primitive API -typedef enum _D3DPRIMITIVETYPE { - D3DPT_POINTLIST = 1, - D3DPT_LINELIST = 2, - D3DPT_LINESTRIP = 3, - D3DPT_TRIANGLELIST = 4, - D3DPT_TRIANGLESTRIP = 5, - D3DPT_TRIANGLEFAN = 6, - D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DPRIMITIVETYPE; - -typedef enum _D3DTRANSFORMSTATETYPE { - D3DTS_VIEW = 2, - D3DTS_PROJECTION = 3, - D3DTS_TEXTURE0 = 16, - D3DTS_TEXTURE1 = 17, - D3DTS_TEXTURE2 = 18, - D3DTS_TEXTURE3 = 19, - D3DTS_TEXTURE4 = 20, - D3DTS_TEXTURE5 = 21, - D3DTS_TEXTURE6 = 22, - D3DTS_TEXTURE7 = 23, - D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTRANSFORMSTATETYPE; - -#define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256) -#define D3DTS_WORLD D3DTS_WORLDMATRIX(0) -#define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1) -#define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2) -#define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3) - -typedef enum _D3DRENDERSTATETYPE { - D3DRS_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */ - D3DRS_FILLMODE = 8, /* D3DFILLMODE */ - D3DRS_SHADEMODE = 9, /* D3DSHADEMODE */ - D3DRS_ZWRITEENABLE = 14, /* TRUE to enable z writes */ - D3DRS_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ - D3DRS_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ - D3DRS_SRCBLEND = 19, /* D3DBLEND */ - D3DRS_DESTBLEND = 20, /* D3DBLEND */ - D3DRS_CULLMODE = 22, /* D3DCULL */ - D3DRS_ZFUNC = 23, /* D3DCMPFUNC */ - D3DRS_ALPHAREF = 24, /* D3DFIXED */ - D3DRS_ALPHAFUNC = 25, /* D3DCMPFUNC */ - D3DRS_DITHERENABLE = 26, /* TRUE to enable dithering */ - D3DRS_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ - D3DRS_FOGENABLE = 28, /* TRUE to enable fog blending */ - D3DRS_SPECULARENABLE = 29, /* TRUE to enable specular */ - D3DRS_FOGCOLOR = 34, /* D3DCOLOR */ - D3DRS_FOGTABLEMODE = 35, /* D3DFOGMODE */ - D3DRS_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */ - D3DRS_FOGEND = 37, /* Fog end */ - D3DRS_FOGDENSITY = 38, /* Fog density */ - D3DRS_RANGEFOGENABLE = 48, /* Enables range-based fog */ - D3DRS_STENCILENABLE = 52, /* BOOL enable/disable stenciling */ - D3DRS_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */ - D3DRS_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */ - D3DRS_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */ - D3DRS_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ - D3DRS_STENCILREF = 57, /* Reference value used in stencil test */ - D3DRS_STENCILMASK = 58, /* Mask value used in stencil test */ - D3DRS_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */ - D3DRS_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */ - D3DRS_WRAP0 = 128, /* wrap for 1st texture coord. set */ - D3DRS_WRAP1 = 129, /* wrap for 2nd texture coord. set */ - D3DRS_WRAP2 = 130, /* wrap for 3rd texture coord. set */ - D3DRS_WRAP3 = 131, /* wrap for 4th texture coord. set */ - D3DRS_WRAP4 = 132, /* wrap for 5th texture coord. set */ - D3DRS_WRAP5 = 133, /* wrap for 6th texture coord. set */ - D3DRS_WRAP6 = 134, /* wrap for 7th texture coord. set */ - D3DRS_WRAP7 = 135, /* wrap for 8th texture coord. set */ - D3DRS_CLIPPING = 136, - D3DRS_LIGHTING = 137, - D3DRS_AMBIENT = 139, - D3DRS_FOGVERTEXMODE = 140, - D3DRS_COLORVERTEX = 141, - D3DRS_LOCALVIEWER = 142, - D3DRS_NORMALIZENORMALS = 143, - D3DRS_DIFFUSEMATERIALSOURCE = 145, - D3DRS_SPECULARMATERIALSOURCE = 146, - D3DRS_AMBIENTMATERIALSOURCE = 147, - D3DRS_EMISSIVEMATERIALSOURCE = 148, - D3DRS_VERTEXBLEND = 151, - D3DRS_CLIPPLANEENABLE = 152, - D3DRS_POINTSIZE = 154, /* float point size */ - D3DRS_POINTSIZE_MIN = 155, /* float point size min threshold */ - D3DRS_POINTSPRITEENABLE = 156, /* BOOL point texture coord control */ - D3DRS_POINTSCALEENABLE = 157, /* BOOL point size scale enable */ - D3DRS_POINTSCALE_A = 158, /* float point attenuation A value */ - D3DRS_POINTSCALE_B = 159, /* float point attenuation B value */ - D3DRS_POINTSCALE_C = 160, /* float point attenuation C value */ - D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer - D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable - D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation - D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor - D3DRS_POINTSIZE_MAX = 166, /* float point size max threshold */ - D3DRS_INDEXEDVERTEXBLENDENABLE = 167, - D3DRS_COLORWRITEENABLE = 168, // per-channel write enable - D3DRS_TWEENFACTOR = 170, // float tween factor - D3DRS_BLENDOP = 171, // D3DBLENDOP setting - D3DRS_POSITIONDEGREE = 172, // NPatch position interpolation degree. D3DDEGREE_LINEAR or D3DDEGREE_CUBIC (default) - D3DRS_NORMALDEGREE = 173, // NPatch normal interpolation degree. D3DDEGREE_LINEAR (default) or D3DDEGREE_QUADRATIC - D3DRS_SCISSORTESTENABLE = 174, - D3DRS_SLOPESCALEDEPTHBIAS = 175, - D3DRS_ANTIALIASEDLINEENABLE = 176, - D3DRS_MINTESSELLATIONLEVEL = 178, - D3DRS_MAXTESSELLATIONLEVEL = 179, - D3DRS_ADAPTIVETESS_X = 180, - D3DRS_ADAPTIVETESS_Y = 181, - D3DRS_ADAPTIVETESS_Z = 182, - D3DRS_ADAPTIVETESS_W = 183, - D3DRS_ENABLEADAPTIVETESSELLATION = 184, - D3DRS_TWOSIDEDSTENCILMODE = 185, /* BOOL enable/disable 2 sided stenciling */ - D3DRS_CCW_STENCILFAIL = 186, /* D3DSTENCILOP to do if ccw stencil test fails */ - D3DRS_CCW_STENCILZFAIL = 187, /* D3DSTENCILOP to do if ccw stencil test passes and Z test fails */ - D3DRS_CCW_STENCILPASS = 188, /* D3DSTENCILOP to do if both ccw stencil and Z tests pass */ - D3DRS_CCW_STENCILFUNC = 189, /* D3DCMPFUNC fn. ccw Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ - D3DRS_COLORWRITEENABLE1 = 190, /* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS */ - D3DRS_COLORWRITEENABLE2 = 191, /* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS */ - D3DRS_COLORWRITEENABLE3 = 192, /* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS */ - D3DRS_BLENDFACTOR = 193, /* D3DCOLOR used for a constant blend factor during alpha blending for devices that support D3DPBLENDCAPS_BLENDFACTOR */ - D3DRS_SRGBWRITEENABLE = 194, /* Enable rendertarget writes to be DE-linearized to SRGB (for formats that expose D3DUSAGE_QUERY_SRGBWRITE) */ - D3DRS_DEPTHBIAS = 195, - D3DRS_WRAP8 = 198, /* Additional wrap states for vs_3_0+ attributes with D3DDECLUSAGE_TEXCOORD */ - D3DRS_WRAP9 = 199, - D3DRS_WRAP10 = 200, - D3DRS_WRAP11 = 201, - D3DRS_WRAP12 = 202, - D3DRS_WRAP13 = 203, - D3DRS_WRAP14 = 204, - D3DRS_WRAP15 = 205, - D3DRS_SEPARATEALPHABLENDENABLE = 206, /* TRUE to enable a separate blending function for the alpha channel */ - D3DRS_SRCBLENDALPHA = 207, /* SRC blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */ - D3DRS_DESTBLENDALPHA = 208, /* DST blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */ - D3DRS_BLENDOPALPHA = 209, /* Blending operation for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */ - - - D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DRENDERSTATETYPE; - -// Maximum number of simultaneous render targets D3D supports -#define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4 - -// Values for material source -typedef enum _D3DMATERIALCOLORSOURCE -{ - D3DMCS_MATERIAL = 0, // Color from material is used - D3DMCS_COLOR1 = 1, // Diffuse vertex color is used - D3DMCS_COLOR2 = 2, // Specular vertex color is used - D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DMATERIALCOLORSOURCE; - -// Bias to apply to the texture coordinate set to apply a wrap to. -#define D3DRENDERSTATE_WRAPBIAS 128UL - -/* Flags to construct the WRAP render states */ -#define D3DWRAP_U 0x00000001L -#define D3DWRAP_V 0x00000002L -#define D3DWRAP_W 0x00000004L - -/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ -#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U -#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V -#define D3DWRAPCOORD_2 0x00000004L // same as D3DWRAP_W -#define D3DWRAPCOORD_3 0x00000008L - -/* Flags to construct D3DRS_COLORWRITEENABLE */ -#define D3DCOLORWRITEENABLE_RED (1L<<0) -#define D3DCOLORWRITEENABLE_GREEN (1L<<1) -#define D3DCOLORWRITEENABLE_BLUE (1L<<2) -#define D3DCOLORWRITEENABLE_ALPHA (1L<<3) - -/* - * State enumerants for per-stage processing of fixed function pixel processing - * Two of these affect fixed function vertex processing as well: TEXTURETRANSFORMFLAGS and TEXCOORDINDEX. - */ -typedef enum _D3DTEXTURESTAGESTATETYPE -{ - D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ - D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ - D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ - D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ - D3DTSS_BUMPENVMAT00 = 7, /* float (bump mapping matrix) */ - D3DTSS_BUMPENVMAT01 = 8, /* float (bump mapping matrix) */ - D3DTSS_BUMPENVMAT10 = 9, /* float (bump mapping matrix) */ - D3DTSS_BUMPENVMAT11 = 10, /* float (bump mapping matrix) */ - D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ - D3DTSS_BUMPENVLSCALE = 22, /* float scale for bump map luminance */ - D3DTSS_BUMPENVLOFFSET = 23, /* float offset for bump map luminance */ - D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ - D3DTSS_COLORARG0 = 26, /* D3DTA_* third arg for triadic ops */ - D3DTSS_ALPHAARG0 = 27, /* D3DTA_* third arg for triadic ops */ - D3DTSS_RESULTARG = 28, /* D3DTA_* arg for result (CURRENT or TEMP) */ - D3DTSS_CONSTANT = 32, /* Per-stage constant D3DTA_CONSTANT */ - - - D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTURESTAGESTATETYPE; - -/* - * State enumerants for per-sampler texture processing. - */ -typedef enum _D3DSAMPLERSTATETYPE -{ - D3DSAMP_ADDRESSU = 1, /* D3DTEXTUREADDRESS for U coordinate */ - D3DSAMP_ADDRESSV = 2, /* D3DTEXTUREADDRESS for V coordinate */ - D3DSAMP_ADDRESSW = 3, /* D3DTEXTUREADDRESS for W coordinate */ - D3DSAMP_BORDERCOLOR = 4, /* D3DCOLOR */ - D3DSAMP_MAGFILTER = 5, /* D3DTEXTUREFILTER filter to use for magnification */ - D3DSAMP_MINFILTER = 6, /* D3DTEXTUREFILTER filter to use for minification */ - D3DSAMP_MIPFILTER = 7, /* D3DTEXTUREFILTER filter to use between mipmaps during minification */ - D3DSAMP_MIPMAPLODBIAS = 8, /* float Mipmap LOD bias */ - D3DSAMP_MAXMIPLEVEL = 9, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */ - D3DSAMP_MAXANISOTROPY = 10, /* DWORD maximum anisotropy */ - D3DSAMP_SRGBTEXTURE = 11, /* Default = 0 (which means Gamma 1.0, - no correction required.) else correct for - Gamma = 2.2 */ - D3DSAMP_ELEMENTINDEX = 12, /* When multi-element texture is assigned to sampler, this - indicates which element index to use. Default = 0. */ - D3DSAMP_DMAPOFFSET = 13, /* Offset in vertices in the pre-sampled displacement map. - Only valid for D3DDMAPSAMPLER sampler */ - D3DSAMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSAMPLERSTATETYPE; - -/* Special sampler which is used in the tesselator */ -#define D3DDMAPSAMPLER 256 - -// Samplers used in vertex shaders -#define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1) -#define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2) -#define D3DVERTEXTEXTURESAMPLER2 (D3DDMAPSAMPLER+3) -#define D3DVERTEXTEXTURESAMPLER3 (D3DDMAPSAMPLER+4) - -// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position -// and normal in the camera space) should be taken as texture coordinates -// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from -// -#define D3DTSS_TCI_PASSTHRU 0x00000000 -#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 -#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 -#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000 -#define D3DTSS_TCI_SPHEREMAP 0x00040000 - -/* - * Enumerations for COLOROP and ALPHAOP texture blending operations set in - * texture processing stage controls in D3DTSS. - */ -typedef enum _D3DTEXTUREOP -{ - // Control - D3DTOP_DISABLE = 1, // disables stage - D3DTOP_SELECTARG1 = 2, // the default - D3DTOP_SELECTARG2 = 3, - - // Modulate - D3DTOP_MODULATE = 4, // multiply args together - D3DTOP_MODULATE2X = 5, // multiply and 1 bit - D3DTOP_MODULATE4X = 6, // multiply and 2 bits - - // Add - D3DTOP_ADD = 7, // add arguments together - D3DTOP_ADDSIGNED = 8, // add with -0.5 bias - D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit - D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation - D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product - // Arg1 + Arg2 - Arg1*Arg2 - // = Arg1 + (1-Arg1)*Arg2 - - // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) - D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha - D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha - D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR - - // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) - D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha - D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color - - // Specular mapping - D3DTOP_PREMODULATE = 17, // modulate with next texture before use - D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB - // COLOROP only - D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A - // COLOROP only - D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB - // COLOROP only - D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A - // COLOROP only - - // Bump mapping - D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation - D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel - - // This can do either diffuse or specular bump mapping with correct input. - // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) - // where each component has been scaled and offset to make it signed. - // The result is replicated into all four (including alpha) channels. - // This is a valid COLOROP only. - D3DTOP_DOTPRODUCT3 = 24, - - // Triadic ops - D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2 - D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2 - - D3DTOP_FORCE_DWORD = 0x7fffffff, -} D3DTEXTUREOP; - -/* - * Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending - * operations set in texture processing stage controls in D3DRENDERSTATE. - */ -#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector -#define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only) -#define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write) -#define D3DTA_TEXTURE 0x00000002 // select texture color (read only) -#define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only) -#define D3DTA_SPECULAR 0x00000004 // select specular color (read only) -#define D3DTA_TEMP 0x00000005 // select temporary register color (read/write) -#define D3DTA_CONSTANT 0x00000006 // select texture stage constant -#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier) -#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier) - -// -// Values for D3DSAMP_***FILTER texture stage states -// -typedef enum _D3DTEXTUREFILTERTYPE -{ - D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only) - D3DTEXF_POINT = 1, // nearest - D3DTEXF_LINEAR = 2, // linear interpolation - D3DTEXF_ANISOTROPIC = 3, // anisotropic - D3DTEXF_PYRAMIDALQUAD = 6, // 4-sample tent - D3DTEXF_GAUSSIANQUAD = 7, // 4-sample gaussian -/* D3D9Ex only -- */ -#if !defined(D3D_DISABLE_9EX) - - D3DTEXF_CONVOLUTIONMONO = 8, // Convolution filter for monochrome textures - -#endif // !D3D_DISABLE_9EX -/* -- D3D9Ex only */ - D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DTEXTUREFILTERTYPE; - -/* Bits for Flags in ProcessVertices call */ - -#define D3DPV_DONOTCOPYDATA (1 << 0) - -//------------------------------------------------------------------- - -// Flexible vertex format bits -// -#define D3DFVF_RESERVED0 0x001 -#define D3DFVF_POSITION_MASK 0x400E -#define D3DFVF_XYZ 0x002 -#define D3DFVF_XYZRHW 0x004 -#define D3DFVF_XYZB1 0x006 -#define D3DFVF_XYZB2 0x008 -#define D3DFVF_XYZB3 0x00a -#define D3DFVF_XYZB4 0x00c -#define D3DFVF_XYZB5 0x00e -#define D3DFVF_XYZW 0x4002 - -#define D3DFVF_NORMAL 0x010 -#define D3DFVF_PSIZE 0x020 -#define D3DFVF_DIFFUSE 0x040 -#define D3DFVF_SPECULAR 0x080 - -#define D3DFVF_TEXCOUNT_MASK 0xf00 -#define D3DFVF_TEXCOUNT_SHIFT 8 -#define D3DFVF_TEX0 0x000 -#define D3DFVF_TEX1 0x100 -#define D3DFVF_TEX2 0x200 -#define D3DFVF_TEX3 0x300 -#define D3DFVF_TEX4 0x400 -#define D3DFVF_TEX5 0x500 -#define D3DFVF_TEX6 0x600 -#define D3DFVF_TEX7 0x700 -#define D3DFVF_TEX8 0x800 - -#define D3DFVF_LASTBETA_UBYTE4 0x1000 -#define D3DFVF_LASTBETA_D3DCOLOR 0x8000 - -#define D3DFVF_RESERVED2 0x6000 // 2 reserved bits - -//--------------------------------------------------------------------- -// Vertex Shaders -// - -// Vertex shader declaration - -// Vertex element semantics -// -typedef enum _D3DDECLUSAGE -{ - D3DDECLUSAGE_POSITION = 0, - D3DDECLUSAGE_BLENDWEIGHT, // 1 - D3DDECLUSAGE_BLENDINDICES, // 2 - D3DDECLUSAGE_NORMAL, // 3 - D3DDECLUSAGE_PSIZE, // 4 - D3DDECLUSAGE_TEXCOORD, // 5 - D3DDECLUSAGE_TANGENT, // 6 - D3DDECLUSAGE_BINORMAL, // 7 - D3DDECLUSAGE_TESSFACTOR, // 8 - D3DDECLUSAGE_POSITIONT, // 9 - D3DDECLUSAGE_COLOR, // 10 - D3DDECLUSAGE_FOG, // 11 - D3DDECLUSAGE_DEPTH, // 12 - D3DDECLUSAGE_SAMPLE, // 13 -} D3DDECLUSAGE; - -#define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE -#define MAXD3DDECLUSAGEINDEX 15 -#define MAXD3DDECLLENGTH 64 // does not include "end" marker vertex element - -typedef enum _D3DDECLMETHOD -{ - D3DDECLMETHOD_DEFAULT = 0, - D3DDECLMETHOD_PARTIALU, - D3DDECLMETHOD_PARTIALV, - D3DDECLMETHOD_CROSSUV, // Normal - D3DDECLMETHOD_UV, - D3DDECLMETHOD_LOOKUP, // Lookup a displacement map - D3DDECLMETHOD_LOOKUPPRESAMPLED, // Lookup a pre-sampled displacement map -} D3DDECLMETHOD; - -#define MAXD3DDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED - -// Declarations for _Type fields -// -typedef enum _D3DDECLTYPE -{ - D3DDECLTYPE_FLOAT1 = 0, // 1D float expanded to (value, 0., 0., 1.) - D3DDECLTYPE_FLOAT2 = 1, // 2D float expanded to (value, value, 0., 1.) - D3DDECLTYPE_FLOAT3 = 2, // 3D float expanded to (value, value, value, 1.) - D3DDECLTYPE_FLOAT4 = 3, // 4D float - D3DDECLTYPE_D3DCOLOR = 4, // 4D packed unsigned bytes mapped to 0. to 1. range - // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) - D3DDECLTYPE_UBYTE4 = 5, // 4D unsigned byte - D3DDECLTYPE_SHORT2 = 6, // 2D signed short expanded to (value, value, 0., 1.) - D3DDECLTYPE_SHORT4 = 7, // 4D signed short - -// The following types are valid only with vertex shaders >= 2.0 - - - D3DDECLTYPE_UBYTE4N = 8, // Each of 4 bytes is normalized by dividing to 255.0 - D3DDECLTYPE_SHORT2N = 9, // 2D signed short normalized (v[0]/32767.0,v[1]/32767.0,0,1) - D3DDECLTYPE_SHORT4N = 10, // 4D signed short normalized (v[0]/32767.0,v[1]/32767.0,v[2]/32767.0,v[3]/32767.0) - D3DDECLTYPE_USHORT2N = 11, // 2D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,0,1) - D3DDECLTYPE_USHORT4N = 12, // 4D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,v[2]/65535.0,v[3]/65535.0) - D3DDECLTYPE_UDEC3 = 13, // 3D unsigned 10 10 10 format expanded to (value, value, value, 1) - D3DDECLTYPE_DEC3N = 14, // 3D signed 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1) - D3DDECLTYPE_FLOAT16_2 = 15, // Two 16-bit floating point values, expanded to (value, value, 0, 1) - D3DDECLTYPE_FLOAT16_4 = 16, // Four 16-bit floating point values - D3DDECLTYPE_UNUSED = 17, // When the type field in a decl is unused. -} D3DDECLTYPE; - -#define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED - -typedef struct _D3DVERTEXELEMENT9 -{ - WORD Stream; // Stream index - WORD Offset; // Offset in the stream in bytes - BYTE Type; // Data type - BYTE Method; // Processing method - BYTE Usage; // Semantics - BYTE UsageIndex; // Semantic index -} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9; - -// This is used to initialize the last vertex element in a vertex declaration -// array -// -#define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0} - -// Maximum supported number of texture coordinate sets -#define D3DDP_MAXTEXCOORD 8 - -//--------------------------------------------------------------------- -// Values for IDirect3DDevice9::SetStreamSourceFreq's Setting parameter -//--------------------------------------------------------------------- -#define D3DSTREAMSOURCE_INDEXEDDATA (1<<30) -#define D3DSTREAMSOURCE_INSTANCEDATA (2<<30) - - - -//--------------------------------------------------------------------- -// -// The internal format of Pixel Shader (PS) & Vertex Shader (VS) -// Instruction Tokens is defined in the Direct3D Device Driver Kit -// -//--------------------------------------------------------------------- - -// -// Instruction Token Bit Definitions -// -#define D3DSI_OPCODE_MASK 0x0000FFFF - -#define D3DSI_INSTLENGTH_MASK 0x0F000000 -#define D3DSI_INSTLENGTH_SHIFT 24 - -typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE -{ - D3DSIO_NOP = 0, - D3DSIO_MOV , - D3DSIO_ADD , - D3DSIO_SUB , - D3DSIO_MAD , - D3DSIO_MUL , - D3DSIO_RCP , - D3DSIO_RSQ , - D3DSIO_DP3 , - D3DSIO_DP4 , - D3DSIO_MIN , - D3DSIO_MAX , - D3DSIO_SLT , - D3DSIO_SGE , - D3DSIO_EXP , - D3DSIO_LOG , - D3DSIO_LIT , - D3DSIO_DST , - D3DSIO_LRP , - D3DSIO_FRC , - D3DSIO_M4x4 , - D3DSIO_M4x3 , - D3DSIO_M3x4 , - D3DSIO_M3x3 , - D3DSIO_M3x2 , - D3DSIO_CALL , - D3DSIO_CALLNZ , - D3DSIO_LOOP , - D3DSIO_RET , - D3DSIO_ENDLOOP , - D3DSIO_LABEL , - D3DSIO_DCL , - D3DSIO_POW , - D3DSIO_CRS , - D3DSIO_SGN , - D3DSIO_ABS , - D3DSIO_NRM , - D3DSIO_SINCOS , - D3DSIO_REP , - D3DSIO_ENDREP , - D3DSIO_IF , - D3DSIO_IFC , - D3DSIO_ELSE , - D3DSIO_ENDIF , - D3DSIO_BREAK , - D3DSIO_BREAKC , - D3DSIO_MOVA , - D3DSIO_DEFB , - D3DSIO_DEFI , - - D3DSIO_TEXCOORD = 64, - D3DSIO_TEXKILL , - D3DSIO_TEX , - D3DSIO_TEXBEM , - D3DSIO_TEXBEML , - D3DSIO_TEXREG2AR , - D3DSIO_TEXREG2GB , - D3DSIO_TEXM3x2PAD , - D3DSIO_TEXM3x2TEX , - D3DSIO_TEXM3x3PAD , - D3DSIO_TEXM3x3TEX , - D3DSIO_RESERVED0 , - D3DSIO_TEXM3x3SPEC , - D3DSIO_TEXM3x3VSPEC , - D3DSIO_EXPP , - D3DSIO_LOGP , - D3DSIO_CND , - D3DSIO_DEF , - D3DSIO_TEXREG2RGB , - D3DSIO_TEXDP3TEX , - D3DSIO_TEXM3x2DEPTH , - D3DSIO_TEXDP3 , - D3DSIO_TEXM3x3 , - D3DSIO_TEXDEPTH , - D3DSIO_CMP , - D3DSIO_BEM , - D3DSIO_DP2ADD , - D3DSIO_DSX , - D3DSIO_DSY , - D3DSIO_TEXLDD , - D3DSIO_SETP , - D3DSIO_TEXLDL , - D3DSIO_BREAKP , - - D3DSIO_PHASE = 0xFFFD, - D3DSIO_COMMENT = 0xFFFE, - D3DSIO_END = 0xFFFF, - - D3DSIO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DSHADER_INSTRUCTION_OPCODE_TYPE; - -//--------------------------------------------------------------------- -// Use these constants with D3DSIO_SINCOS macro as SRC2, SRC3 -// -#define D3DSINCOSCONST1 -1.5500992e-006f, -2.1701389e-005f, 0.0026041667f, 0.00026041668f -#define D3DSINCOSCONST2 -0.020833334f, -0.12500000f, 1.0f, 0.50000000f - -//--------------------------------------------------------------------- -// Co-Issue Instruction Modifier - if set then this instruction is to be -// issued in parallel with the previous instruction(s) for which this bit -// is not set. -// -#define D3DSI_COISSUE 0x40000000 - -//--------------------------------------------------------------------- -// Opcode specific controls - -#define D3DSP_OPCODESPECIFICCONTROL_MASK 0x00ff0000 -#define D3DSP_OPCODESPECIFICCONTROL_SHIFT 16 - -// ps_2_0 texld controls -#define D3DSI_TEXLD_PROJECT (0x01 << D3DSP_OPCODESPECIFICCONTROL_SHIFT) -#define D3DSI_TEXLD_BIAS (0x02 << D3DSP_OPCODESPECIFICCONTROL_SHIFT) - -// Comparison for dynamic conditional instruction opcodes (i.e. if, breakc) -typedef enum _D3DSHADER_COMPARISON -{ - // < = > - D3DSPC_RESERVED0= 0, // 0 0 0 - D3DSPC_GT = 1, // 0 0 1 - D3DSPC_EQ = 2, // 0 1 0 - D3DSPC_GE = 3, // 0 1 1 - D3DSPC_LT = 4, // 1 0 0 - D3DSPC_NE = 5, // 1 0 1 - D3DSPC_LE = 6, // 1 1 0 - D3DSPC_RESERVED1= 7 // 1 1 1 -} D3DSHADER_COMPARISON; - -// Comparison is part of instruction opcode token: -#define D3DSHADER_COMPARISON_SHIFT D3DSP_OPCODESPECIFICCONTROL_SHIFT -#define D3DSHADER_COMPARISON_MASK (0x7<>8)&0xFF) -#define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF) - -// destination/source parameter register type -#define D3DSI_COMMENTSIZE_SHIFT 16 -#define D3DSI_COMMENTSIZE_MASK 0x7FFF0000 -#define D3DSHADER_COMMENT(_DWordSize) \ - ((((_DWordSize)<= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -#endif -#endif // _MSC_VER - -#endif /* (DIRECT3D_VERSION >= 0x0900) */ -#endif /* _d3d9TYPES(P)_H_ */ - diff --git a/bgfx/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp b/bgfx/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp index d56ad46e..631d19d7 100644 --- a/bgfx/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp +++ b/bgfx/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp @@ -32,6 +32,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "glslang/Include/glslang_c_interface.h" +#include +#include "glslang/Public/ShaderLang.h" #include "SPIRV/GlslangToSpv.h" #include "SPIRV/Logger.h" #include "SPIRV/SpvTools.h" @@ -83,14 +85,8 @@ static EShLanguage c_shader_stage(glslang_stage_t stage) GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage) { - glslang_spv_options_t spv_options; - spv_options.generate_debug_info = false; - spv_options.strip_debug_info = false; - spv_options.emit_nonsemantic_shader_debug_info = false; - spv_options.emit_nonsemantic_shader_debug_source = false; + glslang_spv_options_t spv_options {}; spv_options.disable_optimizer = true; - spv_options.optimize_size = false; - spv_options.disassemble = false; spv_options.validate = true; glslang_program_SPIRV_generate_with_options(program, stage, &spv_options); @@ -101,6 +97,8 @@ GLSLANG_EXPORT void glslang_program_SPIRV_generate_with_options(glslang_program_ const glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage)); + program->spirv.clear(); + glslang::GlslangToSpv(*intermediate, program->spirv, &logger, reinterpret_cast(spv_options)); program->loggerMessages = logger.getAllMessages(); diff --git a/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h b/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h index caab2793..07f3c302 100644 --- a/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h +++ b/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h @@ -41,5 +41,6 @@ static const char* const E_SPV_EXT_shader_atomic_float_min_max = "SPV_EXT_shader static const char* const E_SPV_EXT_shader_image_int64 = "SPV_EXT_shader_image_int64"; static const char* const E_SPV_EXT_shader_tile_image = "SPV_EXT_shader_tile_image"; static const char* const E_SPV_EXT_mesh_shader = "SPV_EXT_mesh_shader"; +static const char* const E_SPV_ARM_cooperative_matrix_layouts = "SPV_ARM_cooperative_matrix_layouts"; #endif // #ifndef GLSLextEXT_H diff --git a/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h b/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h index 121defa1..38d3b974 100644 --- a/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h +++ b/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h @@ -1,5 +1,6 @@ /* ** Copyright (c) 2014-2020 The Khronos Group Inc. +** Copyright (C) 2022-2024 Arm Limited. ** Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. ** ** Permission is hereby granted, free of charge, to any person obtaining a copy @@ -53,8 +54,14 @@ static const char* const E_SPV_KHR_terminate_invocation = "SPV_KHR_termi static const char* const E_SPV_KHR_workgroup_memory_explicit_layout = "SPV_KHR_workgroup_memory_explicit_layout"; static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subgroup_uniform_control_flow"; static const char* const E_SPV_KHR_fragment_shader_barycentric = "SPV_KHR_fragment_shader_barycentric"; +static const char* const E_SPV_KHR_quad_control = "SPV_KHR_quad_control"; static const char* const E_SPV_AMD_shader_early_and_late_fragment_tests = "SPV_AMD_shader_early_and_late_fragment_tests"; static const char* const E_SPV_KHR_ray_tracing_position_fetch = "SPV_KHR_ray_tracing_position_fetch"; static const char* const E_SPV_KHR_cooperative_matrix = "SPV_KHR_cooperative_matrix"; +static const char* const E_SPV_KHR_maximal_reconvergence = "SPV_KHR_maximal_reconvergence"; +static const char* const E_SPV_KHR_subgroup_rotate = "SPV_KHR_subgroup_rotate"; +static const char* const E_SPV_KHR_expect_assume = "SPV_KHR_expect_assume"; +static const char* const E_SPV_EXT_replicated_composites = "SPV_EXT_replicated_composites"; +static const char* const E_SPV_KHR_relaxed_extended_instruction = "SPV_KHR_relaxed_extended_instruction"; #endif // #ifndef GLSLextKHR_H diff --git a/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.NV.h b/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.NV.h index 5b0f7eb1..e4f11e4b 100644 --- a/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.NV.h +++ b/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.NV.h @@ -84,4 +84,10 @@ const char* const E_SPV_NV_shader_sm_builtins = "SPV_NV_shader_sm_builtins"; //SPV_NV_shader_execution_reorder const char* const E_SPV_NV_shader_invocation_reorder = "SPV_NV_shader_invocation_reorder"; +//SPV_NV_displacement_micromap +const char* const E_SPV_NV_displacement_micromap = "SPV_NV_displacement_micromap"; + +//SPV_NV_shader_atomic_fp16_vector +const char* const E_SPV_NV_shader_atomic_fp16_vector = "SPV_NV_shader_atomic_fp16_vector"; + #endif // #ifndef GLSLextNV_H diff --git a/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.QCOM.h b/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.QCOM.h index f13bb693..b52990f0 100644 --- a/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.QCOM.h +++ b/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.QCOM.h @@ -37,5 +37,7 @@ static const int GLSLextQCOMRevision = 1; //SPV_QCOM_image_processing const char* const E_SPV_QCOM_image_processing = "SPV_QCOM_image_processing"; +//SPV_QCOM_image_processing2 +const char* const E_SPV_QCOM_image_processing2 = "SPV_QCOM_image_processing2"; #endif // #ifndef GLSLextQCOM_H diff --git a/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp old mode 100755 new mode 100644 index 373e95f0..4348fdf8 --- a/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -1,7 +1,7 @@ // // Copyright (C) 2014-2016 LunarG, Inc. // Copyright (C) 2015-2020 Google, Inc. -// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2017, 2022-2024 Arm Limited. // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. @@ -43,6 +43,7 @@ #include "spirv.hpp" #include "GlslangToSpv.h" #include "SpvBuilder.h" +#include "SpvTools.h" namespace spv { #include "GLSL.std.450.h" #include "GLSL.ext.KHR.h" @@ -66,6 +67,7 @@ namespace spv { #include #include #include +#include #include #include #include @@ -133,7 +135,7 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { bool visitLoop(glslang::TVisit, glslang::TIntermLoop*); bool visitBranch(glslang::TVisit visit, glslang::TIntermBranch*); - void finishSpv(); + void finishSpv(bool compileOnly); void dumpSpv(std::vector& out); protected: @@ -164,9 +166,11 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { spv::Id convertGlslangToSpvType(const glslang::TType& type, bool forwardReferenceOnly = false); spv::Id convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking, const glslang::TQualifier&, bool lastBufferBlockMember, bool forwardReferenceOnly = false); + void applySpirvDecorate(const glslang::TType& type, spv::Id id, std::optional member); bool filterMember(const glslang::TType& member); spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&); + spv::LinkageType convertGlslangLinkageToSpv(glslang::TLinkType glslangLinkType); void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&, spv::Id, const std::vector& spvMembers); spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim, bool allowZero = false); @@ -200,7 +204,8 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { spv::Id createBinaryMatrixOperation(spv::Op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right); spv::Id createUnaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy, - const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); + const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags, + const glslang::TType &opType); spv::Id createUnaryMatrixOperation(spv::Op op, OpDecorations&, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy); spv::Id createConversion(glslang::TOperator op, OpDecorations&, spv::Id destTypeId, spv::Id operand, @@ -209,7 +214,8 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { spv::Id makeSmearedConstant(spv::Id constant, int vectorSize); spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy, - const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); + const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags, + const glslang::TType &opType); spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, @@ -221,7 +227,9 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId); spv::Id getSymbolId(const glslang::TIntermSymbol* node); void addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier & qualifier); + bool hasQCOMImageProceessingDecoration(spv::Id id, spv::Decoration decor); void addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor); + void addImageProcessing2QCOMDecoration(spv::Id id, bool isForGather); spv::Id createSpvConstant(const glslang::TIntermTyped&); spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant); @@ -276,6 +284,7 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { spv::Id taskPayloadID; // Used later for generating OpTraceKHR/OpExecuteCallableKHR/OpHitObjectRecordHit*/OpHitObjectGetShaderBindingTableData std::unordered_map locationToSymbol[4]; + std::unordered_map > idToQCOMDecorations; }; // @@ -391,11 +400,11 @@ void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector bool useVulkanMemoryModel) { if (!useVulkanMemoryModel) { - if (qualifier.isCoherent()) - memory.push_back(spv::DecorationCoherent); if (qualifier.isVolatile()) { memory.push_back(spv::DecorationVolatile); memory.push_back(spv::DecorationCoherent); + } else if (qualifier.isCoherent()) { + memory.push_back(spv::DecorationCoherent); } } if (qualifier.isRestrict()) @@ -980,18 +989,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI return spv::BuiltInHitTriangleVertexPositionsKHR; case glslang::EbvInstanceCustomIndex: return spv::BuiltInInstanceCustomIndexKHR; - case glslang::EbvHitT: - { - // this is a GLSL alias of RayTmax - // in SPV_NV_ray_tracing it has a dedicated builtin - // but in SPV_KHR_ray_tracing it gets mapped to RayTmax - auto& extensions = glslangIntermediate->getRequestedExtensions(); - if (extensions.find("GL_NV_ray_tracing") != extensions.end()) { - return spv::BuiltInHitTNV; - } else { - return spv::BuiltInRayTmaxKHR; - } - } case glslang::EbvHitKind: return spv::BuiltInHitKindKHR; case glslang::EbvObjectToWorld: @@ -1008,6 +1005,22 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur); builder.addCapability(spv::CapabilityRayTracingMotionBlurNV); return spv::BuiltInCurrentRayTimeNV; + case glslang::EbvMicroTrianglePositionNV: + builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltInHitMicroTriangleVertexPositionsNV; + case glslang::EbvMicroTriangleBaryNV: + builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltInHitMicroTriangleVertexBarycentricsNV; + case glslang::EbvHitKindFrontFacingMicroTriangleNV: + builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltInHitKindFrontFacingMicroTriangleNV; + case glslang::EbvHitKindBackFacingMicroTriangleNV: + builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltInHitKindBackFacingMicroTriangleNV; // barycentrics case glslang::EbvBaryCoordNV: @@ -1143,6 +1156,7 @@ spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TTy case glslang::ElfR64i: builder.addExtension(spv::E_SPV_EXT_shader_image_int64); builder.addCapability(spv::CapabilityInt64ImageEXT); + break; default: break; } @@ -1538,8 +1552,13 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, this->options.generateDebugInfo = true; if (this->options.generateDebugInfo) { - builder.setEmitOpLines(); - builder.setSourceFile(glslangIntermediate->getSourceFile()); + if (this->options.emitNonSemanticShaderDebugInfo) { + builder.setEmitNonSemanticShaderDebugInfo(this->options.emitNonSemanticShaderDebugSource); + } + else { + builder.setEmitSpirvDebugInfo(); + } + builder.setDebugMainSourceFile(glslangIntermediate->getSourceFile()); // Set the source shader's text. If for SPV version 1.0, include // a preamble in comments stating the OpModuleProcessed instructions. @@ -1564,8 +1583,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, builder.addInclude(iItr->first, iItr->second); } - builder.setEmitNonSemanticShaderDebugInfo(this->options.emitNonSemanticShaderDebugInfo); - builder.setEmitNonSemanticShaderDebugSource(this->options.emitNonSemanticShaderDebugSource); + builder.setUseReplicatedComposites(glslangIntermediate->usingReplicatedComposites()); stdBuiltins = builder.import("GLSL.std.450"); @@ -1588,8 +1606,12 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, builder.addCapability(spv::CapabilityVariablePointers); } - shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str()); - entryPoint = builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPointName().c_str()); + // If not linking, there is no entry point + if (!options.compileOnly) { + shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str()); + entryPoint = + builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPointName().c_str()); + } // Add the source extensions const auto& sourceExtensions = glslangIntermediate->getRequestedExtensions(); @@ -1611,6 +1633,24 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, builder.addExtension(spv::E_SPV_KHR_subgroup_uniform_control_flow); builder.addExecutionMode(shaderEntry, spv::ExecutionModeSubgroupUniformControlFlowKHR); } + if (glslangIntermediate->getMaximallyReconverges()) { + builder.addExtension(spv::E_SPV_KHR_maximal_reconvergence); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeMaximallyReconvergesKHR); + } + + if (glslangIntermediate->getQuadDerivMode()) + { + builder.addCapability(spv::CapabilityQuadControlKHR); + builder.addExtension(spv::E_SPV_KHR_quad_control); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeQuadDerivativesKHR); + } + + if (glslangIntermediate->getReqFullQuadsMode()) + { + builder.addCapability(spv::CapabilityQuadControlKHR); + builder.addExtension(spv::E_SPV_KHR_quad_control); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeRequireFullQuadsKHR); + } unsigned int mode; switch (glslangIntermediate->getStage()) { @@ -1720,23 +1760,31 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, } break; - case EShLangCompute: + case EShLangCompute: { builder.addCapability(spv::CapabilityShader); - if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) { - std::vector dimConstId; - for (int dim = 0; dim < 3; ++dim) { - bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); - dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); - if (specConst) { - builder.addDecoration(dimConstId.back(), spv::DecorationSpecId, - glslangIntermediate->getLocalSizeSpecId(dim)); + bool needSizeId = false; + for (int dim = 0; dim < 3; ++dim) { + if ((glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet)) { + needSizeId = true; + break; + } + } + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6 && needSizeId) { + std::vector dimConstId; + for (int dim = 0; dim < 3; ++dim) { + bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); + dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); + if (specConst) { + builder.addDecoration(dimConstId.back(), spv::DecorationSpecId, + glslangIntermediate->getLocalSizeSpecId(dim)); + needSizeId = true; + } } - } - builder.addExecutionModeId(shaderEntry, spv::ExecutionModeLocalSizeId, dimConstId); + builder.addExecutionModeId(shaderEntry, spv::ExecutionModeLocalSizeId, dimConstId); } else { - builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0), - glslangIntermediate->getLocalSize(1), - glslangIntermediate->getLocalSize(2)); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0), + glslangIntermediate->getLocalSize(1), + glslangIntermediate->getLocalSize(2)); } if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupQuads) { builder.addCapability(spv::CapabilityComputeDerivativeGroupQuadsNV); @@ -1748,6 +1796,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); } break; + } case EShLangTessEvaluation: case EShLangTessControl: builder.addCapability(spv::CapabilityTessellation); @@ -1939,23 +1988,27 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, } // Finish creating SPV, after the traversal is complete. -void TGlslangToSpvTraverser::finishSpv() +void TGlslangToSpvTraverser::finishSpv(bool compileOnly) { - // Finish the entry point function - if (! entryPointTerminated) { - builder.setBuildPoint(shaderEntry->getLastBlock()); - builder.leaveFunction(); - } + // If not linking, an entry point is not expected + if (!compileOnly) { + // Finish the entry point function + if (!entryPointTerminated) { + builder.setBuildPoint(shaderEntry->getLastBlock()); + builder.leaveFunction(); + } - // finish off the entry-point SPV instruction by adding the Input/Output - for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it) - entryPoint->addIdOperand(*it); + // finish off the entry-point SPV instruction by adding the Input/Output + entryPoint->reserveOperands(iOSet.size()); + for (auto id : iOSet) + entryPoint->addIdOperand(id); + } // Add capabilities, extensions, remove unneeded decorations, etc., // based on the resulting SPIR-V. // Note: WebGPU code generation must have the opportunity to aggressively // prune unreachable merge blocks and continue targets. - builder.postProcess(); + builder.postProcess(compileOnly); } // Write the SPV into 'out'. @@ -1983,7 +2036,9 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) { // We update the line information even though no code might be generated here // This is helpful to yield correct lines for control flow instructions - builder.setLine(symbol->getLoc().line, symbol->getLoc().getFilename()); + if (!linkageOnly) { + builder.setDebugSourceLocation(symbol->getLoc().line, symbol->getLoc().getFilename()); + } SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); if (symbol->getType().isStruct()) @@ -2092,7 +2147,7 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node) { - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); if (node->getLeft()->getAsSymbolNode() != nullptr && node->getLeft()->getType().isStruct()) { glslangTypeToIdMap[node->getLeft()->getType().getStruct()] = node->getLeft()->getAsSymbolNode()->getId(); } @@ -2137,7 +2192,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T spv::Id rValue = accessChainLoad(node->getRight()->getType()); // reset line number for assignment - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); if (node->getOp() != glslang::EOpAssign) { // the left is also an r-value @@ -2470,7 +2525,7 @@ spv::Id TGlslangToSpvTraverser::translateForcedType(spv::Id object) bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TIntermUnary* node) { - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); if (node->getType().getQualifier().isSpecConstant()) @@ -2634,7 +2689,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI // if not, then possibly an operation if (! result) result = createUnaryOperation(node->getOp(), decorations, resultType(), operand, - node->getOperand()->getBasicType(), lvalueCoherentFlags); + node->getOperand()->getBasicType(), lvalueCoherentFlags, node->getType()); // it could be attached to a SPIR-V intruction if (!result) { @@ -2727,6 +2782,11 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI return false; + case glslang::EOpAssumeEXT: + builder.addCapability(spv::CapabilityExpectAssumeKHR); + builder.addExtension(spv::E_SPV_KHR_expect_assume); + builder.createNoResultOp(spv::OpAssumeTrueKHR, operand); + return false; case glslang::EOpEmitStreamVertex: builder.createNoResultOp(spv::OpEmitStreamVertex, operand); return false; @@ -2798,9 +2858,16 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // SPIR-V, for an out parameter std::vector temporaryLvalues; // temporaries to pass, as proxies for complexLValues - auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ? - invertedType : - convertGlslangToSpvType(node->getType()); }; + auto resultType = [&invertedType, &node, this](){ + if (invertedType != spv::NoType) { + return invertedType; + } else { + auto ret = convertGlslangToSpvType(node->getType()); + // convertGlslangToSpvType may clobber the debug location, reset it + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + return ret; + } + }; // try texturing result = createImageTextureFunctionCall(node); @@ -2840,9 +2907,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // In all cases, still let the traverser visit the children for us. makeFunctions(node->getAsAggregate()->getSequence()); - // Also, we want all globals initializers to go into the beginning of the entry point, before - // anything else gets there, so visit out of order, doing them all now. - makeGlobalInitializers(node->getAsAggregate()->getSequence()); + // Global initializers is specific to the shader entry point, which does not exist in compile-only mode + if (!options.compileOnly) { + // Also, we want all globals initializers to go into the beginning of the entry point, before + // anything else gets there, so visit out of order, doing them all now. + makeGlobalInitializers(node->getAsAggregate()->getSequence()); + } //Pre process linker objects for ray tracing stages if (glslangIntermediate->isRayTracingStage()) @@ -2854,12 +2924,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt return false; } else { - if (node->getOp() == glslang::EOpScope) - builder.enterScope(0); + if (node->getOp() == glslang::EOpScope) { + auto loc = node->getLoc(); + builder.enterLexicalBlock(loc.line, loc.column); + } } } else { if (sequenceDepth > 1 && node->getOp() == glslang::EOpScope) - builder.leaveScope(); + builder.leaveLexicalBlock(); --sequenceDepth; } @@ -2886,6 +2958,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt } case glslang::EOpFunction: if (visit == glslang::EvPreVisit) { + if (options.generateDebugInfo) { + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + } if (isShaderEntryPoint(node)) { inEntryPoint = true; builder.setBuildPoint(shaderEntry->getLastBlock()); @@ -2894,13 +2969,19 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt } else { handleFunctionEntry(node); } - if (options.generateDebugInfo) { + if (options.generateDebugInfo && !options.emitNonSemanticShaderDebugInfo) { const auto& loc = node->getLoc(); const char* sourceFileName = loc.getFilename(); - spv::Id sourceFileId = sourceFileName ? builder.getStringId(sourceFileName) : builder.getSourceFile(); + spv::Id sourceFileId = sourceFileName ? builder.getStringId(sourceFileName) : builder.getMainFileId(); currentFunction->setDebugLineInfo(sourceFileId, loc.line, loc.column); } } else { + if (options.generateDebugInfo) { + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl && node->getSequence().size() > 1) { + auto endLoc = node->getSequence()[1]->getAsAggregate()->getEndLoc(); + builder.setDebugSourceLocation(endLoc.line, endLoc.getFilename()); + } + } if (inEntryPoint) entryPointTerminated = true; builder.leaveFunction(); @@ -2915,7 +2996,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt return false; case glslang::EOpFunctionCall: { - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); if (node->isUserDefined()) result = handleUserFunctionCall(node); if (result) { @@ -2981,7 +3062,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructF16Mat4x3: case glslang::EOpConstructF16Mat4x4: isMatrix = true; - // fall through + [[fallthrough]]; case glslang::EOpConstructFloat: case glslang::EOpConstructVec2: case glslang::EOpConstructVec3: @@ -3036,7 +3117,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructCooperativeMatrixNV: case glslang::EOpConstructCooperativeMatrixKHR: { - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); std::vector arguments; translateArguments(*node, arguments, lvalueCoherentFlags); spv::Id constructed; @@ -3152,7 +3233,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpAtomicStore: noReturnValue = true; - // fallthrough + [[fallthrough]]; case glslang::EOpAtomicLoad: atomic = true; break; @@ -3182,6 +3263,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt binOp = node->getOp(); break; + case glslang::EOpExpectEXT: + builder.addCapability(spv::CapabilityExpectAssumeKHR); + builder.addExtension(spv::E_SPV_KHR_expect_assume); + binOp = node->getOp(); + break; + case glslang::EOpIgnoreIntersectionNV: case glslang::EOpTerminateRayNV: case glslang::EOpTraceNV: @@ -3249,7 +3336,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpHitObjectRecordHitWithIndexMotionNV: case glslang::EOpReorderThreadNV: noReturnValue = true; - //Fallthrough + [[fallthrough]]; case glslang::EOpHitObjectIsEmptyNV: case glslang::EOpHitObjectIsMissNV: case glslang::EOpHitObjectIsHitNV: @@ -3292,6 +3379,28 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.addExtension(spv::E_SPV_QCOM_image_processing); break; + case glslang::EOpImageBlockMatchWindowSSDQCOM: + case glslang::EOpImageBlockMatchWindowSADQCOM: + builder.addCapability(spv::CapabilityTextureBlockMatchQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + builder.addCapability(spv::CapabilityTextureBlockMatch2QCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing2); + break; + + case glslang::EOpImageBlockMatchGatherSSDQCOM: + case glslang::EOpImageBlockMatchGatherSADQCOM: + builder.addCapability(spv::CapabilityTextureBlockMatchQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + builder.addCapability(spv::CapabilityTextureBlockMatch2QCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing2); + break; + + case glslang::EOpFetchMicroTriangleVertexPositionNV: + case glslang::EOpFetchMicroTriangleVertexBarycentricNV: + builder.addExtension(spv::E_SPV_NV_displacement_micromap); + builder.addCapability(spv::CapabilityDisplacementMicromapNV); + break; + case glslang::EOpDebugPrintf: noReturnValue = true; break; @@ -3316,7 +3425,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt right->traverse(this); spv::Id rightId = accessChainLoad(right->getType()); - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); OpDecorations decorations = { precision, TranslateNoContractionDecoration(node->getType().getQualifier()), TranslateNonUniformDecoration(node->getType().getQualifier()) }; @@ -3551,7 +3660,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt lvalueCoherentFlags = builder.getAccessChain().coherentFlags; lvalueCoherentFlags |= TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType()); } else { - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); glslang::TOperator glslangOp = node->getOp(); if (arg == 1 && (glslangOp == glslang::EOpRayQueryGetIntersectionType || @@ -3603,7 +3712,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt } } - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); if (node->getOp() == glslang::EOpCooperativeMatrixLoad || node->getOp() == glslang::EOpCooperativeMatrixLoadNV) { std::vector idImmOps; @@ -3611,6 +3720,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf if (node->getOp() == glslang::EOpCooperativeMatrixLoad) { idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout + auto layout = builder.getConstantScalar(operands[3]); + if (layout == spv::CooperativeMatrixLayoutRowBlockedInterleavedARM || + layout == spv::CooperativeMatrixLayoutColumnBlockedInterleavedARM) { + builder.addExtension(spv::E_SPV_ARM_cooperative_matrix_layouts); + builder.addCapability(spv::CapabilityCooperativeMatrixLayoutsARM); + } idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride } else { idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride @@ -3635,6 +3750,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt idImmOps.push_back(spv::IdImmediate(true, operands[0])); // object if (node->getOp() == glslang::EOpCooperativeMatrixStore) { idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout + auto layout = builder.getConstantScalar(operands[3]); + if (layout == spv::CooperativeMatrixLayoutRowBlockedInterleavedARM || + layout == spv::CooperativeMatrixLayoutColumnBlockedInterleavedARM) { + builder.addExtension(spv::E_SPV_ARM_cooperative_matrix_layouts); + builder.addCapability(spv::CapabilityCooperativeMatrixLayoutsARM); + } idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride } else { idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride @@ -3656,7 +3777,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3), builder.makeUintConstant(3), 0); // do the op - spv::Id result = builder.createOp(spv::OpRayQueryGetIntersectionTriangleVertexPositionsKHR, typeId, idImmOps); + + spv::Op spvOp = spv::OpRayQueryGetIntersectionTriangleVertexPositionsKHR; + + spv::Id result = builder.createOp(spvOp, typeId, idImmOps); // store the result to the pointer (out param 'm') builder.createStore(result, operands[2]); result = 0; @@ -3670,13 +3794,13 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // Determine Cooperative Matrix Operands bits from the signedness of the types. if (isTypeSignedInt(glslangOperands[0]->getAsTyped()->getBasicType())) - matrixOperands |= spv::CooperativeMatrixOperandsMatrixASignedComponentsMask; + matrixOperands |= spv::CooperativeMatrixOperandsMatrixASignedComponentsKHRMask; if (isTypeSignedInt(glslangOperands[1]->getAsTyped()->getBasicType())) - matrixOperands |= spv::CooperativeMatrixOperandsMatrixBSignedComponentsMask; + matrixOperands |= spv::CooperativeMatrixOperandsMatrixBSignedComponentsKHRMask; if (isTypeSignedInt(glslangOperands[2]->getAsTyped()->getBasicType())) - matrixOperands |= spv::CooperativeMatrixOperandsMatrixCSignedComponentsMask; + matrixOperands |= spv::CooperativeMatrixOperandsMatrixCSignedComponentsKHRMask; if (isTypeSignedInt(node->getBasicType())) - matrixOperands |= spv::CooperativeMatrixOperandsMatrixResultSignedComponentsMask; + matrixOperands |= spv::CooperativeMatrixOperandsMatrixResultSignedComponentsKHRMask; std::vector idImmOps; idImmOps.push_back(spv::IdImmediate(true, operands[0])); @@ -3691,7 +3815,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt glslang::TBasicType typeProxy = (node->getOp() == glslang::EOpAtomicStore) ? node->getSequence()[0]->getAsTyped()->getBasicType() : node->getBasicType(); result = createAtomicOperation(node->getOp(), precision, resultType(), operands, typeProxy, - lvalueCoherentFlags); + lvalueCoherentFlags, node->getType()); } else if (node->getOp() == glslang::EOpSpirvInst) { const auto& spirvInst = node->getSpirvInstruction(); if (spirvInst.set == "") { @@ -3738,7 +3862,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt result = createUnaryOperation( node->getOp(), decorations, resultType(), operands.front(), - glslangOperands[0]->getAsTyped()->getBasicType(), lvalueCoherentFlags); + glslangOperands[0]->getAsTyped()->getBasicType(), lvalueCoherentFlags, node->getType()); } break; default: @@ -3840,7 +3964,7 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang node->getFalseBlock()->traverse(this); spv::Id falseValue = accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()); - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); // done if void if (node->getBasicType() == glslang::EbtVoid) @@ -4011,7 +4135,7 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T if (codeSegments[s]) codeSegments[s]->traverse(this); else - builder.addSwitchBreak(); + builder.addSwitchBreak(true); } breakForLoop.pop(); @@ -4035,7 +4159,7 @@ void TGlslangToSpvTraverser::visitConstantUnion(glslang::TIntermConstantUnion* n bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIntermLoop* node) { auto blocks = builder.makeNewLoop(); - builder.createBranch(&blocks.head); + builder.createBranch(true, &blocks.head); // Loop control: std::vector operands; @@ -4048,11 +4172,11 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn // instructions in it, since the body/test may have arbitrary instructions, // including merges of its own. builder.setBuildPoint(&blocks.head); - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); builder.createLoopMerge(&blocks.merge, &blocks.continue_target, control, operands); if (node->testFirst() && node->getTest()) { spv::Block& test = builder.makeNewBlock(); - builder.createBranch(&test); + builder.createBranch(true, &test); builder.setBuildPoint(&test); node->getTest()->traverse(this); @@ -4063,22 +4187,22 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn breakForLoop.push(true); if (node->getBody()) node->getBody()->traverse(this); - builder.createBranch(&blocks.continue_target); + builder.createBranch(true, &blocks.continue_target); breakForLoop.pop(); builder.setBuildPoint(&blocks.continue_target); if (node->getTerminal()) node->getTerminal()->traverse(this); - builder.createBranch(&blocks.head); + builder.createBranch(true, &blocks.head); } else { - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); - builder.createBranch(&blocks.body); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + builder.createBranch(true, &blocks.body); breakForLoop.push(true); builder.setBuildPoint(&blocks.body); if (node->getBody()) node->getBody()->traverse(this); - builder.createBranch(&blocks.continue_target); + builder.createBranch(true, &blocks.continue_target); breakForLoop.pop(); builder.setBuildPoint(&blocks.continue_target); @@ -4093,7 +4217,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn // TODO: unless there was a break/return/discard instruction // somewhere in the body, this is an infinite loop, so we should // issue a warning. - builder.createBranch(&blocks.head); + builder.createBranch(true, &blocks.head); } } builder.setBuildPoint(&blocks.merge); @@ -4106,7 +4230,7 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T if (node->getExpression()) node->getExpression()->traverse(this); - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); switch (node->getFlowOp()) { case glslang::EOpKill: @@ -4129,7 +4253,7 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T if (breakForLoop.top()) builder.createLoopExit(); else - builder.addSwitchBreak(); + builder.addSwitchBreak(false); break; case glslang::EOpContinue: builder.createLoopContinue(); @@ -4263,7 +4387,14 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* initializer = builder.makeNullConstant(spvType); } - return builder.createVariable(spv::NoPrecision, storageClass, spvType, name, initializer, false); + spv::Id var = builder.createVariable(spv::NoPrecision, storageClass, spvType, name, initializer, false); + std::vector topLevelDecorations; + glslang::TQualifier typeQualifier = node->getType().getQualifier(); + TranslateMemoryDecoration(typeQualifier, topLevelDecorations, glslangIntermediate->usingVulkanMemoryModel()); + for (auto deco : topLevelDecorations) { + builder.addDecoration(var, deco); + } + return var; } // Return type Id of the sampled type. @@ -4329,6 +4460,16 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty return convertGlslangToSpvType(type, getExplicitLayout(type), type.getQualifier(), false, forwardReferenceOnly); } +spv::LinkageType TGlslangToSpvTraverser::convertGlslangLinkageToSpv(glslang::TLinkType linkType) +{ + switch (linkType) { + case glslang::ELinkExport: + return spv::LinkageTypeExport; + default: + return spv::LinkageTypeMax; + } +} + // Do full recursive conversion of an arbitrary glslang type to a SPIR-V Id. // explicitLayout can be kept the same throughout the hierarchical recursive walk. // Mutually recursive with convertGlslangStructToSpvType(). @@ -4349,7 +4490,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty if (explicitLayout != glslang::ElpNone) spvType = builder.makeUintType(32); else - spvType = builder.makeBoolType(false); + spvType = builder.makeBoolType(); break; case glslang::EbtInt: spvType = builder.makeIntType(32); @@ -4492,26 +4633,27 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty std::vector operands; for (const auto& typeParam : spirvType.typeParams) { - if (typeParam.constant != nullptr) { + if (typeParam.getAsConstant() != nullptr) { // Constant expression - if (typeParam.constant->isLiteral()) { - if (typeParam.constant->getBasicType() == glslang::EbtFloat) { - float floatValue = static_cast(typeParam.constant->getConstArray()[0].getDConst()); + auto constant = typeParam.getAsConstant(); + if (constant->isLiteral()) { + if (constant->getBasicType() == glslang::EbtFloat) { + float floatValue = static_cast(constant->getConstArray()[0].getDConst()); unsigned literal; static_assert(sizeof(literal) == sizeof(floatValue), "sizeof(unsigned) != sizeof(float)"); memcpy(&literal, &floatValue, sizeof(literal)); operands.push_back({false, literal}); - } else if (typeParam.constant->getBasicType() == glslang::EbtInt) { - unsigned literal = typeParam.constant->getConstArray()[0].getIConst(); + } else if (constant->getBasicType() == glslang::EbtInt) { + unsigned literal = constant->getConstArray()[0].getIConst(); operands.push_back({false, literal}); - } else if (typeParam.constant->getBasicType() == glslang::EbtUint) { - unsigned literal = typeParam.constant->getConstArray()[0].getUConst(); + } else if (constant->getBasicType() == glslang::EbtUint) { + unsigned literal = constant->getConstArray()[0].getUConst(); operands.push_back({false, literal}); - } else if (typeParam.constant->getBasicType() == glslang::EbtBool) { - unsigned literal = typeParam.constant->getConstArray()[0].getBConst(); + } else if (constant->getBasicType() == glslang::EbtBool) { + unsigned literal = constant->getConstArray()[0].getBConst(); operands.push_back({false, literal}); - } else if (typeParam.constant->getBasicType() == glslang::EbtString) { - auto str = typeParam.constant->getConstArray()[0].getSConst()->c_str(); + } else if (constant->getBasicType() == glslang::EbtString) { + auto str = constant->getConstArray()[0].getSConst()->c_str(); unsigned literal = 0; char* literalPtr = reinterpret_cast(&literal); unsigned charCount = 0; @@ -4536,11 +4678,11 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty } else assert(0); // Unexpected type } else - operands.push_back({true, createSpvConstant(*typeParam.constant)}); + operands.push_back({true, createSpvConstant(*constant)}); } else { // Type specifier - assert(typeParam.type != nullptr); - operands.push_back({true, convertGlslangToSpvType(*typeParam.type)}); + assert(typeParam.getAsType() != nullptr); + operands.push_back({true, convertGlslangToSpvType(*typeParam.getAsType())}); } } @@ -4649,6 +4791,64 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty return spvType; } +// Apply SPIR-V decorations to the SPIR-V object (provided by SPIR-V ID). If member index is provided, the +// decorations are applied to this member. +void TGlslangToSpvTraverser::applySpirvDecorate(const glslang::TType& type, spv::Id id, std::optional member) +{ + assert(type.getQualifier().hasSpirvDecorate()); + + const glslang::TSpirvDecorate& spirvDecorate = type.getQualifier().getSpirvDecorate(); + + // Add spirv_decorate + for (auto& decorate : spirvDecorate.decorates) { + if (!decorate.second.empty()) { + std::vector literals; + TranslateLiterals(decorate.second, literals); + if (member.has_value()) + builder.addMemberDecoration(id, *member, static_cast(decorate.first), literals); + else + builder.addDecoration(id, static_cast(decorate.first), literals); + } else { + if (member.has_value()) + builder.addMemberDecoration(id, *member, static_cast(decorate.first)); + else + builder.addDecoration(id, static_cast(decorate.first)); + } + } + + // Add spirv_decorate_id + if (member.has_value()) { + // spirv_decorate_id not applied to members + assert(spirvDecorate.decorateIds.empty()); + } else { + for (auto& decorateId : spirvDecorate.decorateIds) { + std::vector operandIds; + assert(!decorateId.second.empty()); + for (auto extraOperand : decorateId.second) { + if (extraOperand->getQualifier().isFrontEndConstant()) + operandIds.push_back(createSpvConstant(*extraOperand)); + else + operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode())); + } + builder.addDecorationId(id, static_cast(decorateId.first), operandIds); + } + } + + // Add spirv_decorate_string + for (auto& decorateString : spirvDecorate.decorateStrings) { + std::vector strings; + assert(!decorateString.second.empty()); + for (auto extraOperand : decorateString.second) { + const char* string = extraOperand->getConstArray()[0].getSConst()->c_str(); + strings.push_back(string); + } + if (member.has_value()) + builder.addMemberDecoration(id, *member, static_cast(decorateString.first), strings); + else + builder.addDecoration(id, static_cast(decorateString.first), strings); + } +} + // TODO: this functionality should exist at a higher level, in creating the AST // // Identify interface members that don't have their required extension turned on. @@ -4683,7 +4883,7 @@ bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member) } return false; -}; +} // Do full recursive conversion of a glslang structure (or block) type to a SPIR-V Id. // explicitLayout can be kept the same throughout the hierarchical recursive walk. @@ -4887,37 +5087,9 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); } - // - // Add SPIR-V decorations for members (GL_EXT_spirv_intrinsics) - // - if (glslangMember.getQualifier().hasSprivDecorate()) { - const glslang::TSpirvDecorate& spirvDecorate = glslangMember.getQualifier().getSpirvDecorate(); - - // Add spirv_decorate - for (auto& decorate : spirvDecorate.decorates) { - if (!decorate.second.empty()) { - std::vector literals; - TranslateLiterals(decorate.second, literals); - builder.addMemberDecoration(spvType, member, static_cast(decorate.first), literals); - } - else - builder.addMemberDecoration(spvType, member, static_cast(decorate.first)); - } - - // spirv_decorate_id not applied to members - assert(spirvDecorate.decorateIds.empty()); - - // Add spirv_decorate_string - for (auto& decorateString : spirvDecorate.decorateStrings) { - std::vector strings; - assert(!decorateString.second.empty()); - for (auto extraOperand : decorateString.second) { - const char* string = extraOperand->getConstArray()[0].getSConst()->c_str(); - strings.push_back(string); - } - builder.addDecoration(spvType, static_cast(decorateString.first), strings); - } - } + // Add SPIR-V decorations (GL_EXT_spirv_intrinsics) + if (glslangMember.getQualifier().hasSpirvDecorate()) + applySpirvDecorate(glslangMember, spvType, member); } // Decorate the structure @@ -5233,17 +5405,37 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType int memberAlignment = glslangIntermediate->getMemberAlignment(memberType, memberSize, dummyStride, explicitLayout, matrixLayout == glslang::ElmRowMajor); + bool isVectorLike = memberType.isVector(); + if (memberType.isMatrix()) { + if (matrixLayout == glslang::ElmRowMajor) + isVectorLike = memberType.getMatrixRows() == 1; + else + isVectorLike = memberType.getMatrixCols() == 1; + } + // Adjust alignment for HLSL rules // TODO: make this consistent in early phases of code: // adjusting this late means inconsistencies with earlier code, which for reflection is an issue // Until reflection is brought in sync with these adjustments, don't apply to $Global, // which is the most likely to rely on reflection, and least likely to rely implicit layouts if (glslangIntermediate->usingHlslOffsets() && - ! memberType.isArray() && memberType.isVector() && structType.getTypeName().compare("$Global") != 0) { - int dummySize; - int componentAlignment = glslangIntermediate->getBaseAlignmentScalar(memberType, dummySize); - if (componentAlignment <= 4) + ! memberType.isStruct() && structType.getTypeName().compare("$Global") != 0) { + int componentSize; + int componentAlignment = glslangIntermediate->getBaseAlignmentScalar(memberType, componentSize); + if (! memberType.isArray() && isVectorLike && componentAlignment <= 4) memberAlignment = componentAlignment; + + // Don't add unnecessary padding after this member + // (undo std140 bumping size to a mutliple of vec4) + if (explicitLayout == glslang::ElpStd140) { + if (memberType.isMatrix()) { + if (matrixLayout == glslang::ElmRowMajor) + memberSize -= componentSize * (4 - memberType.getMatrixCols()); + else + memberSize -= componentSize * (4 - memberType.getMatrixRows()); + } else if (memberType.isArray()) + memberSize -= componentSize * (4 - memberType.getVectorSize()); + } } // Bump up to member alignment @@ -5251,7 +5443,7 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType // Bump up to vec4 if there is a bad straddle if (explicitLayout != glslang::ElpScalar && glslangIntermediate->improperStraddle(memberType, memberSize, - currentOffset)) + currentOffset, isVectorLike)) glslang::RoundToPow2(currentOffset, 16); nextOffset = currentOffset + memberSize; @@ -5336,8 +5528,10 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF // memory and use RestrictPointer/AliasedPointer. if (originalParam(type.getQualifier().storage, type, false) || !writableParam(type.getQualifier().storage)) { - decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrict : - spv::DecorationAliased); + // TranslateMemoryDecoration added Restrict decoration already. + if (!type.getQualifier().isRestrict()) { + decorations.push_back(spv::DecorationAliased); + } } else { decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT); @@ -5347,9 +5541,21 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF for (int f = 0; f < (int)glslFunctions.size(); ++f) { glslang::TIntermAggregate* glslFunction = glslFunctions[f]->getAsAggregate(); - if (! glslFunction || glslFunction->getOp() != glslang::EOpFunction || isShaderEntryPoint(glslFunction)) + if (! glslFunction || glslFunction->getOp() != glslang::EOpFunction) continue; + builder.setDebugSourceLocation(glslFunction->getLoc().line, glslFunction->getLoc().getFilename()); + + if (isShaderEntryPoint(glslFunction)) { + // For HLSL, the entry function is actually a compiler generated function to resolve the difference of + // entry function signature between HLSL and SPIR-V. So we don't emit debug information for that. + if (glslangIntermediate->getSource() != glslang::EShSourceHlsl) { + builder.setupFunctionDebugInfo(shaderEntry, glslangIntermediate->getEntryPointMangledName().c_str(), + std::vector(), // main function has no param + std::vector()); + } + continue; + } // We're on a user function. Set up the basic interface for the function now, // so that it's available to call. Translating the body will happen later. // @@ -5395,10 +5601,11 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF } spv::Block* functionBlock; - spv::Function *function = builder.makeFunctionEntry(TranslatePrecisionDecoration(glslFunction->getType()), - convertGlslangToSpvType(glslFunction->getType()), - glslFunction->getName().c_str(), paramTypes, paramNames, - paramDecorations, &functionBlock); + spv::Function* function = builder.makeFunctionEntry( + TranslatePrecisionDecoration(glslFunction->getType()), convertGlslangToSpvType(glslFunction->getType()), + glslFunction->getName().c_str(), convertGlslangLinkageToSpv(glslFunction->getLinkType()), paramTypes, + paramDecorations, &functionBlock); + builder.setupFunctionDebugInfo(function, glslFunction->getName().c_str(), paramTypes, paramNames); if (implicitThis) function->setImplicitThis(); @@ -5622,8 +5829,16 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& lvalueCoherentFlags = builder.getAccessChain().coherentFlags; builder.addDecoration(lvalue_id, TranslateNonUniformDecoration(lvalueCoherentFlags)); lvalueCoherentFlags |= TranslateCoherent(glslangArguments[i]->getAsTyped()->getType()); - } else - arguments.push_back(accessChainLoad(glslangArguments[i]->getAsTyped()->getType())); + } else { + if (i > 0 && + glslangArguments[i]->getAsSymbolNode() && glslangArguments[i-1]->getAsSymbolNode() && + glslangArguments[i]->getAsSymbolNode()->getId() == glslangArguments[i-1]->getAsSymbolNode()->getId()) { + // Reuse the id if possible + arguments.push_back(arguments[i-1]); + } else { + arguments.push_back(accessChainLoad(glslangArguments[i]->getAsTyped()->getType())); + } + } } } @@ -5639,7 +5854,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO if (! node->isImage() && ! node->isTexture()) return spv::NoResult; - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); // Process a GLSL texturing op (will be SPV image) @@ -5942,7 +6157,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO operands.push_back(*opIt); return createAtomicOperation(node->getOp(), precision, resultType(), operands, typeProxy, - lvalueCoherentFlags); + lvalueCoherentFlags, node->getType()); } } @@ -6254,6 +6469,9 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg } } + // Reset source location to the function call location after argument evaluation + builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); + // 2. Allocate space for anything needing a copy, and if it's "in" or "inout" // copy the original into that space. // @@ -6467,6 +6685,10 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpD binOp = isUnsigned ? spv::OpUMul32x16INTEL : spv::OpIMul32x16INTEL; break; + case glslang::EOpExpectEXT: + binOp = spv::OpExpectKHR; + break; + case glslang::EOpLessThan: case glslang::EOpGreaterThan: case glslang::EOpLessThanEqual: @@ -6689,7 +6911,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, OpDecora } spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDecorations& decorations, spv::Id typeId, - spv::Id operand, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) + spv::Id operand, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags, + const glslang::TType &opType) { spv::Op unaryOp = spv::OpNop; int extBuiltins = -1; @@ -6977,7 +7200,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe // Handle all of the atomics in one place, in createAtomicOperation() std::vector operands; operands.push_back(operand); - return createAtomicOperation(op, decorations.precision, typeId, operands, typeProxy, lvalueCoherentFlags); + return createAtomicOperation(op, decorations.precision, typeId, operands, typeProxy, lvalueCoherentFlags, opType); } case glslang::EOpBitFieldReverse: @@ -7070,7 +7293,9 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe case glslang::EOpSubgroupExclusiveXor: case glslang::EOpSubgroupQuadSwapHorizontal: case glslang::EOpSubgroupQuadSwapVertical: - case glslang::EOpSubgroupQuadSwapDiagonal: { + case glslang::EOpSubgroupQuadSwapDiagonal: + case glslang::EOpSubgroupQuadAll: + case glslang::EOpSubgroupQuadAny: { std::vector operands; operands.push_back(operand); return createSubgroupOperation(op, typeId, operands, typeProxy); @@ -7177,6 +7402,14 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe unaryOp = spv::OpHitObjectGetShaderRecordBufferHandleNV; break; + case glslang::EOpFetchMicroTriangleVertexPositionNV: + unaryOp = spv::OpFetchMicroTriangleVertexPositionNV; + break; + + case glslang::EOpFetchMicroTriangleVertexBarycentricNV: + unaryOp = spv::OpFetchMicroTriangleVertexBarycentricNV; + break; + case glslang::EOpCopyObject: unaryOp = spv::OpCopyObject; break; @@ -7685,7 +7918,7 @@ spv::Id TGlslangToSpvTraverser::makeSmearedConstant(spv::Id constant, int vector // For glslang ops that map to SPV atomic opCodes spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration /*precision*/, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy, - const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) + const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags, const glslang::TType &opType) { spv::Op opCode = spv::OpNop; @@ -7696,14 +7929,20 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv opCode = spv::OpAtomicIAdd; if (typeProxy == glslang::EbtFloat16 || typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) { opCode = spv::OpAtomicFAddEXT; - builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_add); - if (typeProxy == glslang::EbtFloat16) { - builder.addExtension(spv::E_SPV_EXT_shader_atomic_float16_add); - builder.addCapability(spv::CapabilityAtomicFloat16AddEXT); - } else if (typeProxy == glslang::EbtFloat) { - builder.addCapability(spv::CapabilityAtomicFloat32AddEXT); + if (typeProxy == glslang::EbtFloat16 && + (opType.getVectorSize() == 2 || opType.getVectorSize() == 4)) { + builder.addExtension(spv::E_SPV_NV_shader_atomic_fp16_vector); + builder.addCapability(spv::CapabilityAtomicFloat16VectorNV); } else { - builder.addCapability(spv::CapabilityAtomicFloat64AddEXT); + builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_add); + if (typeProxy == glslang::EbtFloat16) { + builder.addExtension(spv::E_SPV_EXT_shader_atomic_float16_add); + builder.addCapability(spv::CapabilityAtomicFloat16AddEXT); + } else if (typeProxy == glslang::EbtFloat) { + builder.addCapability(spv::CapabilityAtomicFloat32AddEXT); + } else { + builder.addCapability(spv::CapabilityAtomicFloat64AddEXT); + } } } break; @@ -7716,13 +7955,19 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv case glslang::EOpAtomicCounterMin: if (typeProxy == glslang::EbtFloat16 || typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) { opCode = spv::OpAtomicFMinEXT; - builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_min_max); - if (typeProxy == glslang::EbtFloat16) - builder.addCapability(spv::CapabilityAtomicFloat16MinMaxEXT); - else if (typeProxy == glslang::EbtFloat) - builder.addCapability(spv::CapabilityAtomicFloat32MinMaxEXT); - else - builder.addCapability(spv::CapabilityAtomicFloat64MinMaxEXT); + if (typeProxy == glslang::EbtFloat16 && + (opType.getVectorSize() == 2 || opType.getVectorSize() == 4)) { + builder.addExtension(spv::E_SPV_NV_shader_atomic_fp16_vector); + builder.addCapability(spv::CapabilityAtomicFloat16VectorNV); + } else { + builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_min_max); + if (typeProxy == glslang::EbtFloat16) + builder.addCapability(spv::CapabilityAtomicFloat16MinMaxEXT); + else if (typeProxy == glslang::EbtFloat) + builder.addCapability(spv::CapabilityAtomicFloat32MinMaxEXT); + else + builder.addCapability(spv::CapabilityAtomicFloat64MinMaxEXT); + } } else if (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) { opCode = spv::OpAtomicUMin; } else { @@ -7734,13 +7979,19 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv case glslang::EOpAtomicCounterMax: if (typeProxy == glslang::EbtFloat16 || typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) { opCode = spv::OpAtomicFMaxEXT; - builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_min_max); - if (typeProxy == glslang::EbtFloat16) - builder.addCapability(spv::CapabilityAtomicFloat16MinMaxEXT); - else if (typeProxy == glslang::EbtFloat) - builder.addCapability(spv::CapabilityAtomicFloat32MinMaxEXT); - else - builder.addCapability(spv::CapabilityAtomicFloat64MinMaxEXT); + if (typeProxy == glslang::EbtFloat16 && + (opType.getVectorSize() == 2 || opType.getVectorSize() == 4)) { + builder.addExtension(spv::E_SPV_NV_shader_atomic_fp16_vector); + builder.addCapability(spv::CapabilityAtomicFloat16VectorNV); + } else { + builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_min_max); + if (typeProxy == glslang::EbtFloat16) + builder.addCapability(spv::CapabilityAtomicFloat16MinMaxEXT); + else if (typeProxy == glslang::EbtFloat) + builder.addCapability(spv::CapabilityAtomicFloat32MinMaxEXT); + else + builder.addCapability(spv::CapabilityAtomicFloat64MinMaxEXT); + } } else if (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) { opCode = spv::OpAtomicUMax; } else { @@ -7765,6 +8016,12 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv case glslang::EOpAtomicExchange: case glslang::EOpImageAtomicExchange: case glslang::EOpAtomicCounterExchange: + if ((typeProxy == glslang::EbtFloat16) && + (opType.getVectorSize() == 2 || opType.getVectorSize() == 4)) { + builder.addExtension(spv::E_SPV_NV_shader_atomic_fp16_vector); + builder.addCapability(spv::CapabilityAtomicFloat16VectorNV); + } + opCode = spv::OpAtomicExchange; break; case glslang::EOpAtomicCompSwap: @@ -7863,6 +8120,7 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv } std::vector spvAtomicOperands; // hold the spv operands + spvAtomicOperands.reserve(6); spvAtomicOperands.push_back(pointerId); spvAtomicOperands.push_back(scopeId); spvAtomicOperands.push_back(semanticsId); @@ -8167,6 +8425,11 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupElect: builder.addCapability(spv::CapabilityGroupNonUniform); break; + case glslang::EOpSubgroupQuadAll: + case glslang::EOpSubgroupQuadAny: + builder.addExtension(spv::E_SPV_KHR_quad_control); + builder.addCapability(spv::CapabilityQuadControlKHR); + [[fallthrough]]; case glslang::EOpSubgroupAll: case glslang::EOpSubgroupAny: case glslang::EOpSubgroupAllEqual: @@ -8186,6 +8449,11 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s builder.addCapability(spv::CapabilityGroupNonUniform); builder.addCapability(spv::CapabilityGroupNonUniformBallot); break; + case glslang::EOpSubgroupRotate: + case glslang::EOpSubgroupClusteredRotate: + builder.addExtension(spv::E_SPV_KHR_subgroup_rotate); + builder.addCapability(spv::CapabilityGroupNonUniformRotateKHR); + break; case glslang::EOpSubgroupShuffle: case glslang::EOpSubgroupShuffleXor: builder.addCapability(spv::CapabilityGroupNonUniform); @@ -8274,7 +8542,9 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s // Figure out which opcode to use. switch (op) { case glslang::EOpSubgroupElect: opCode = spv::OpGroupNonUniformElect; break; + case glslang::EOpSubgroupQuadAll: opCode = spv::OpGroupNonUniformQuadAllKHR; break; case glslang::EOpSubgroupAll: opCode = spv::OpGroupNonUniformAll; break; + case glslang::EOpSubgroupQuadAny: opCode = spv::OpGroupNonUniformQuadAnyKHR; break; case glslang::EOpSubgroupAny: opCode = spv::OpGroupNonUniformAny; break; case glslang::EOpSubgroupAllEqual: opCode = spv::OpGroupNonUniformAllEqual; break; case glslang::EOpSubgroupBroadcast: opCode = spv::OpGroupNonUniformBroadcast; break; @@ -8291,6 +8561,8 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupShuffleXor: opCode = spv::OpGroupNonUniformShuffleXor; break; case glslang::EOpSubgroupShuffleUp: opCode = spv::OpGroupNonUniformShuffleUp; break; case glslang::EOpSubgroupShuffleDown: opCode = spv::OpGroupNonUniformShuffleDown; break; + case glslang::EOpSubgroupRotate: + case glslang::EOpSubgroupClusteredRotate: opCode = spv::OpGroupNonUniformRotateKHR; break; case glslang::EOpSubgroupAdd: case glslang::EOpSubgroupInclusiveAdd: case glslang::EOpSubgroupExclusiveAdd: @@ -8471,7 +8743,10 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s // Every operation begins with the Execution Scope operand. spv::IdImmediate executionScope = { true, builder.makeUintConstant(spv::ScopeSubgroup) }; - spvGroupOperands.push_back(executionScope); + // All other ops need the execution scope. Quad Control Ops don't need scope, it's always Quad. + if (opCode != spv::OpGroupNonUniformQuadAllKHR && opCode != spv::OpGroupNonUniformQuadAnyKHR) { + spvGroupOperands.push_back(executionScope); + } // Next, for all operations that use a Group Operation, push that as an operand. if (groupOperation != spv::GroupOperationMax) { @@ -8714,6 +8989,8 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: case glslang::EOpSubgroupShuffleXor: case glslang::EOpSubgroupShuffleUp: case glslang::EOpSubgroupShuffleDown: + case glslang::EOpSubgroupRotate: + case glslang::EOpSubgroupClusteredRotate: case glslang::EOpSubgroupClusteredAdd: case glslang::EOpSubgroupClusteredMul: case glslang::EOpSubgroupClusteredMin: @@ -9061,6 +9338,41 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: addImageProcessingQCOMDecoration(operands[0], spv::DecorationBlockMatchTextureQCOM); addImageProcessingQCOMDecoration(operands[2], spv::DecorationBlockMatchTextureQCOM); break; + + case glslang::EOpFetchMicroTriangleVertexBarycentricNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 2); + opCode = spv::OpFetchMicroTriangleVertexBarycentricNV; + break; + + case glslang::EOpFetchMicroTriangleVertexPositionNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpFetchMicroTriangleVertexPositionNV; + break; + + case glslang::EOpImageBlockMatchWindowSSDQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::OpImageBlockMatchWindowSSDQCOM; + addImageProcessing2QCOMDecoration(operands[0], false); + addImageProcessing2QCOMDecoration(operands[2], false); + break; + case glslang::EOpImageBlockMatchWindowSADQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::OpImageBlockMatchWindowSADQCOM; + addImageProcessing2QCOMDecoration(operands[0], false); + addImageProcessing2QCOMDecoration(operands[2], false); + break; + case glslang::EOpImageBlockMatchGatherSSDQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::OpImageBlockMatchGatherSSDQCOM; + addImageProcessing2QCOMDecoration(operands[0], true); + addImageProcessing2QCOMDecoration(operands[2], true); + break; + case glslang::EOpImageBlockMatchGatherSADQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::OpImageBlockMatchGatherSADQCOM; + addImageProcessing2QCOMDecoration(operands[0], true); + addImageProcessing2QCOMDecoration(operands[2], true); + break; default: return 0; } @@ -9513,47 +9825,9 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT); } - // - // Add SPIR-V decorations for structure (GL_EXT_spirv_intrinsics) - // - if (symbol->getType().getQualifier().hasSprivDecorate()) { - const glslang::TSpirvDecorate& spirvDecorate = symbol->getType().getQualifier().getSpirvDecorate(); - - // Add spirv_decorate - for (auto& decorate : spirvDecorate.decorates) { - if (!decorate.second.empty()) { - std::vector literals; - TranslateLiterals(decorate.second, literals); - builder.addDecoration(id, static_cast(decorate.first), literals); - } - else - builder.addDecoration(id, static_cast(decorate.first)); - } - - // Add spirv_decorate_id - for (auto& decorateId : spirvDecorate.decorateIds) { - std::vector operandIds; - assert(!decorateId.second.empty()); - for (auto extraOperand : decorateId.second) { - if (extraOperand->getQualifier().isFrontEndConstant()) - operandIds.push_back(createSpvConstant(*extraOperand)); - else - operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode())); - } - builder.addDecorationId(id, static_cast(decorateId.first), operandIds); - } - - // Add spirv_decorate_string - for (auto& decorateString : spirvDecorate.decorateStrings) { - std::vector strings; - assert(!decorateString.second.empty()); - for (auto extraOperand : decorateString.second) { - const char* string = extraOperand->getConstArray()[0].getSConst()->c_str(); - strings.push_back(string); - } - builder.addDecoration(id, static_cast(decorateString.first), strings); - } - } + // Add SPIR-V decorations (GL_EXT_spirv_intrinsics) + if (symbol->getType().getQualifier().hasSpirvDecorate()) + applySpirvDecorate(symbol->getType(), id, {}); return id; } @@ -9605,6 +9879,16 @@ void TGlslangToSpvTraverser::addMeshNVDecoration(spv::Id id, int member, const g } } +bool TGlslangToSpvTraverser::hasQCOMImageProceessingDecoration(spv::Id id, spv::Decoration decor) +{ + std::vector &decoVec = idToQCOMDecorations[id]; + for ( auto d : decoVec ) { + if ( d == decor ) + return true; + } + return false; +} + void TGlslangToSpvTraverser::addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor) { spv::Op opc = builder.getOpCode(id); @@ -9615,7 +9899,43 @@ void TGlslangToSpvTraverser::addImageProcessingQCOMDecoration(spv::Id id, spv::D if (opc == spv::OpLoad) { spv::Id texid = builder.getIdOperand(id, 0); - builder.addDecoration(texid, decor); + if (!hasQCOMImageProceessingDecoration(texid, decor)) {// + builder.addDecoration(texid, decor); + idToQCOMDecorations[texid].push_back(decor); + } + } +} + +void TGlslangToSpvTraverser::addImageProcessing2QCOMDecoration(spv::Id id, bool isForGather) +{ + if (isForGather) { + return addImageProcessingQCOMDecoration(id, spv::DecorationBlockMatchTextureQCOM); + } + + auto addDecor = + [this](spv::Id id, spv::Decoration decor) { + spv::Id tsopc = this->builder.getOpCode(id); + if (tsopc == spv::OpLoad) { + spv::Id tsid = this->builder.getIdOperand(id, 0); + if (this->glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) { + assert(iOSet.count(tsid) > 0); + } + if (!hasQCOMImageProceessingDecoration(tsid, decor)) { + this->builder.addDecoration(tsid, decor); + idToQCOMDecorations[tsid].push_back(decor); + } + } + }; + + spv::Id opc = builder.getOpCode(id); + bool isInterfaceObject = (opc != spv::OpSampledImage); + + if (!isInterfaceObject) { + addDecor(builder.getIdOperand(id, 0), spv::DecorationBlockMatchTextureQCOM); + addDecor(builder.getIdOperand(id, 1), spv::DecorationBlockMatchSamplerQCOM); + } else { + addDecor(id, spv::DecorationBlockMatchTextureQCOM); + addDecor(id, spv::DecorationBlockMatchSamplerQCOM); } } @@ -9945,6 +10265,7 @@ spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslan // Operands to accumulate OpPhi operands std::vector phiOperands; + phiOperands.reserve(4); // accumulate left operand's phi information phiOperands.push_back(leftId); phiOperands.push_back(builder.getBuildPoint()->getId()); @@ -9984,14 +10305,13 @@ spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name) if (extBuiltinMap.find(name) != extBuiltinMap.end()) return extBuiltinMap[name]; else { - builder.addExtension(name); spv::Id extBuiltins = builder.import(name); extBuiltinMap[name] = extBuiltins; return extBuiltins; } } -}; // end anonymous namespace +} // end anonymous namespace namespace glslang { @@ -10101,7 +10421,7 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector& TGlslangToSpvTraverser it(intermediate.getSpv().spv, &intermediate, logger, *options); root->traverse(&it); - it.finishSpv(); + it.finishSpv(options->compileOnly); it.dumpSpv(spirv); #if ENABLE_OPT @@ -10128,4 +10448,4 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector& GetThreadPoolAllocator().pop(); } -}; // end namespace glslang +} // end namespace glslang diff --git a/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.h b/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.h index b9736d7c..9fb4f3ff 100644 --- a/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.h +++ b/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.h @@ -35,27 +35,35 @@ #pragma once -#if defined(_MSC_VER) && _MSC_VER >= 1900 - #pragma warning(disable : 4464) // relative include path contains '..' -#endif - -#include "SpvTools.h" -#include "glslang/Include/intermediate.h" - #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}; +}; -void GetSpirvVersion(std::string&); -int GetSpirvGeneratorVersion(); -void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, - SpvOptions* options = nullptr); -void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, - spv::SpvBuildLogger* logger, SpvOptions* options = nullptr); -bool OutputSpvBin(const std::vector& spirv, const char* baseName); -bool OutputSpvHex(const std::vector& spirv, const char* baseName, const char* varName); +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/bgfx/3rdparty/glslang/SPIRV/Logger.h b/bgfx/3rdparty/glslang/SPIRV/Logger.h index 2e4ddaf5..c64a3b8a 100644 --- a/bgfx/3rdparty/glslang/SPIRV/Logger.h +++ b/bgfx/3rdparty/glslang/SPIRV/Logger.h @@ -37,12 +37,13 @@ #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 SpvBuildLogger { +class GLSLANG_EXPORT SpvBuildLogger { public: SpvBuildLogger() {} diff --git a/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp b/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp index f8f50a95..2ef3bf75 100644 --- a/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp +++ b/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp @@ -38,7 +38,6 @@ #include #include -#include "../glslang/Include/Common.h" namespace spv { diff --git a/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h b/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h index 42b01686..e60da792 100644 --- a/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h +++ b/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h @@ -41,6 +41,21 @@ #include #include +#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 + namespace spv { class spirvbin_base_t @@ -77,12 +92,13 @@ class spirvbin_base_t #include #include "spirv.hpp" -#include "spvIR.h" namespace spv { +static inline constexpr Id NoResult = 0; + // class to hold SPIR-V binary data for remapping, DCE, and debug stripping -class spirvbin_t : public spirvbin_base_t +class GLSLANG_EXPORT spirvbin_t : public spirvbin_base_t { public: spirvbin_t(int verbose = 0) : entryPoint(spv::NoResult), largestNewId(0), verbose(verbose), errorLatch(false) diff --git a/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp b/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp index 57e03d5d..500c78f9 100644 --- a/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp +++ b/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp @@ -58,13 +58,6 @@ Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogg spvVersion(spvVersion), sourceLang(SourceLanguageUnknown), sourceVersion(0), - sourceFileStringId(NoResult), - currentLine(0), - currentFile(nullptr), - currentFileId(NoResult), - lastDebugScopeId(NoResult), - emitOpLines(false), - emitNonSemanticShaderDebugInfo(false), addressModel(AddressingModelLogical), memoryModel(MemoryModelGLSL450), builderNumber(magicNumber), @@ -91,78 +84,6 @@ Id Builder::import(const char* name) return import->getResultId(); } -// Emit instruction for non-filename-based #line directives (ie. no filename -// seen yet): emit an OpLine if we've been asked to emit OpLines and the line -// number has changed since the last time, and is a valid line number. -void Builder::setLine(int lineNum) -{ - if (lineNum != 0 && lineNum != currentLine) { - currentLine = lineNum; - if (emitOpLines) { - if (emitNonSemanticShaderDebugInfo) - addDebugScopeAndLine(currentFileId, currentLine, 0); - else - addLine(sourceFileStringId, currentLine, 0); - } - } -} - -// If no filename, do non-filename-based #line emit. Else do filename-based emit. -// Emit OpLine if we've been asked to emit OpLines and the line number or filename -// has changed since the last time, and line number is valid. -void Builder::setLine(int lineNum, const char* filename) -{ - if (filename == nullptr) { - setLine(lineNum); - return; - } - if ((lineNum != 0 && lineNum != currentLine) || currentFile == nullptr || - strncmp(filename, currentFile, strlen(currentFile) + 1) != 0) { - currentLine = lineNum; - currentFile = filename; - if (emitOpLines) { - spv::Id strId = getStringId(filename); - if (emitNonSemanticShaderDebugInfo) - addDebugScopeAndLine(strId, currentLine, 0); - else - addLine(strId, currentLine, 0); - } - } -} - -void Builder::addLine(Id fileName, int lineNum, int column) -{ - Instruction* line = new Instruction(OpLine); - line->addIdOperand(fileName); - line->addImmediateOperand(lineNum); - line->addImmediateOperand(column); - buildPoint->addInstruction(std::unique_ptr(line)); -} - -void Builder::addDebugScopeAndLine(Id fileName, int lineNum, int column) -{ - assert(!currentDebugScopeId.empty()); - if (currentDebugScopeId.top() != lastDebugScopeId) { - spv::Id resultId = getUniqueId(); - Instruction* scopeInst = new Instruction(resultId, makeVoidType(), OpExtInst); - scopeInst->addIdOperand(nonSemanticShaderDebugInfo); - scopeInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugScope); - scopeInst->addIdOperand(currentDebugScopeId.top()); - buildPoint->addInstruction(std::unique_ptr(scopeInst)); - lastDebugScopeId = currentDebugScopeId.top(); - } - spv::Id resultId = getUniqueId(); - Instruction* lineInst = new Instruction(resultId, makeVoidType(), OpExtInst); - lineInst->addIdOperand(nonSemanticShaderDebugInfo); - lineInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLine); - lineInst->addIdOperand(makeDebugSource(fileName)); - lineInst->addIdOperand(makeUintConstant(lineNum)); - lineInst->addIdOperand(makeUintConstant(lineNum)); - lineInst->addIdOperand(makeUintConstant(column)); - lineInst->addIdOperand(makeUintConstant(column)); - buildPoint->addInstruction(std::unique_ptr(lineInst)); -} - // For creating new groupedTypes (will return old type if the requested one was already made). Id Builder::makeVoidType() { @@ -182,7 +103,7 @@ Id Builder::makeVoidType() return type->getResultId(); } -Id Builder::makeBoolType(bool const compilerGenerated) +Id Builder::makeBoolType() { Instruction* type; if (groupedTypes[OpTypeBool].size() == 0) { @@ -190,14 +111,15 @@ Id Builder::makeBoolType(bool const compilerGenerated) groupedTypes[OpTypeBool].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + + if (emitNonSemanticShaderDebugInfo) { + auto const debugResultId = makeBoolDebugType(32); + debugId[type->getResultId()] = debugResultId; + } + } else type = groupedTypes[OpTypeBool].back(); - if (emitNonSemanticShaderDebugInfo && !compilerGenerated) - { - auto const debugResultId = makeBoolDebugType(32); - debugId[type->getResultId()] = debugResultId; - } return type->getResultId(); } @@ -235,12 +157,18 @@ Id Builder::makePointer(StorageClass storageClass, Id pointee) // not found, make it type = new Instruction(getUniqueId(), NoType, OpTypePointer); + type->reserveOperands(2); type->addImmediateOperand(storageClass); type->addIdOperand(pointee); groupedTypes[OpTypePointer].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) { + const Id debugResultId = makePointerDebugType(storageClass, pointee); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -254,6 +182,10 @@ Id Builder::makeForwardPointer(StorageClass storageClass) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) { + const Id debugResultId = makeForwardPointerDebugType(storageClass); + debugId[type->getResultId()] = debugResultId; + } return type->getResultId(); } @@ -269,12 +201,22 @@ Id Builder::makePointerFromForwardPointer(StorageClass storageClass, Id forwardP } type = new Instruction(forwardPointerType, NoType, OpTypePointer); + type->reserveOperands(2); type->addImmediateOperand(storageClass); type->addIdOperand(pointee); groupedTypes[OpTypePointer].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + // If we are emitting nonsemantic debuginfo, we need to patch the debug pointer type + // that was emitted alongside the forward pointer, now that we have a pointee debug + // type for it to point to. + if (emitNonSemanticShaderDebugInfo) { + Instruction *debugForwardPointer = module.getInstruction(debugId[forwardPointerType]); + assert(debugId[pointee]); + debugForwardPointer->setIdOperand(2, debugId[pointee]); + } + return type->getResultId(); } @@ -291,6 +233,7 @@ Id Builder::makeIntegerType(int width, bool hasSign) // not found, make it type = new Instruction(getUniqueId(), NoType, OpTypeInt); + type->reserveOperands(2); type->addImmediateOperand(width); type->addImmediateOperand(hasSign ? 1 : 0); groupedTypes[OpTypeInt].push_back(type); @@ -421,6 +364,7 @@ Id Builder::makeVectorType(Id component, int size) // not found, make it type = new Instruction(getUniqueId(), NoType, OpTypeVector); + type->reserveOperands(2); type->addIdOperand(component); type->addImmediateOperand(size); groupedTypes[OpTypeVector].push_back(type); @@ -453,6 +397,7 @@ Id Builder::makeMatrixType(Id component, int cols, int rows) // not found, make it type = new Instruction(getUniqueId(), NoType, OpTypeMatrix); + type->reserveOperands(2); type->addIdOperand(column); type->addImmediateOperand(cols); groupedTypes[OpTypeMatrix].push_back(type); @@ -484,6 +429,7 @@ Id Builder::makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id col // not found, make it type = new Instruction(getUniqueId(), NoType, OpTypeCooperativeMatrixKHR); + type->reserveOperands(5); type->addIdOperand(component); type->addIdOperand(scope); type->addIdOperand(rows); @@ -493,6 +439,43 @@ Id Builder::makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id col constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) + { + // Find a name for one of the parameters. It can either come from debuginfo for another + // type, or an OpName from a constant. + auto const findName = [&](Id id) { + Id id2 = debugId[id]; + for (auto &t : groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic]) { + if (t->getResultId() == id2) { + for (auto &s : strings) { + if (s->getResultId() == t->getIdOperand(2)) { + return s->getNameString(); + } + } + } + } + for (auto &t : names) { + if (t->getIdOperand(0) == id) { + return t->getNameString(); + } + } + return "unknown"; + }; + std::string debugName = "coopmat<"; + debugName += std::string(findName(component)) + ", "; + if (isConstantScalar(scope)) { + debugName += std::string("gl_Scope") + std::string(spv::ScopeToString((spv::Scope)getConstantScalar(scope))) + ", "; + } else { + debugName += std::string(findName(scope)) + ", "; + } + debugName += std::string(findName(rows)) + ", "; + debugName += std::string(findName(cols)) + ">"; + // There's no nonsemantic debug info instruction for cooperative matrix types, + // use opaque composite instead. + auto const debugResultId = makeCompositeDebugType({}, debugName.c_str(), NonSemanticShaderDebugInfo100Structure, true); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -509,6 +492,7 @@ Id Builder::makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols // not found, make it type = new Instruction(getUniqueId(), NoType, OpTypeCooperativeMatrixNV); + type->reserveOperands(4); type->addIdOperand(component); type->addIdOperand(scope); type->addIdOperand(rows); @@ -550,6 +534,7 @@ Id Builder::makeGenericType(spv::Op opcode, std::vector& opera // not found, make it type = new Instruction(getUniqueId(), NoType, opcode); + type->reserveOperands(operands.size()); for (size_t op = 0; op < operands.size(); ++op) { if (operands[op].isId) type->addIdOperand(operands[op].word); @@ -582,6 +567,7 @@ Id Builder::makeArrayType(Id element, Id sizeId, int stride) // not found, make it type = new Instruction(getUniqueId(), NoType, OpTypeArray); + type->reserveOperands(2); type->addIdOperand(element); type->addIdOperand(sizeId); groupedTypes[OpTypeArray].push_back(type); @@ -648,6 +634,7 @@ Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) // not found, make it Id typeId = getUniqueId(); type = new Instruction(typeId, NoType, OpTypeFunction); + type->reserveOperands(paramTypes.size() + 1); type->addIdOperand(returnType); for (int p = 0; p < (int)paramTypes.size(); ++p) type->addIdOperand(paramTypes[p]); @@ -670,6 +657,7 @@ Id Builder::makeDebugFunctionType(Id returnType, const std::vector& paramTyp Id typeId = getUniqueId(); auto type = new Instruction(typeId, makeVoidType(), OpExtInst); + type->reserveOperands(paramTypes.size() + 4); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeFunction); type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); @@ -708,6 +696,7 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo // not found, make it type = new Instruction(getUniqueId(), NoType, OpTypeImage); + type->reserveOperands(7); type->addIdOperand(sampledType); type->addImmediateOperand( dim); type->addImmediateOperand( depth ? 1 : 0); @@ -818,6 +807,7 @@ Id Builder::makeDebugInfoNone() return debugInfoNone; Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->reserveOperands(2); inst->addIdOperand(nonSemanticShaderDebugInfo); inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugInfoNone); @@ -842,6 +832,7 @@ Id Builder::makeBoolDebugType(int const size) } type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->reserveOperands(6); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); @@ -859,11 +850,19 @@ Id Builder::makeBoolDebugType(int const size) Id Builder::makeIntegerDebugType(int const width, bool const hasSign) { + const char* typeName = nullptr; + switch (width) { + case 8: typeName = hasSign ? "int8_t" : "uint8_t"; break; + case 16: typeName = hasSign ? "int16_t" : "uint16_t"; break; + case 64: typeName = hasSign ? "int64_t" : "uint64_t"; break; + default: typeName = hasSign ? "int" : "uint"; + } + auto nameId = getStringId(typeName); // try to find it Instruction* type; for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; - if (type->getIdOperand(0) == (hasSign ? getStringId("int") : getStringId("uint")) && + if (type->getIdOperand(0) == nameId && type->getIdOperand(1) == static_cast(width) && type->getIdOperand(2) == (hasSign ? NonSemanticShaderDebugInfo100Signed : NonSemanticShaderDebugInfo100Unsigned)) return type->getResultId(); @@ -871,13 +870,10 @@ Id Builder::makeIntegerDebugType(int const width, bool const hasSign) // not found, make it type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->reserveOperands(6); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); - if(hasSign == true) { - type->addIdOperand(getStringId("int")); // name id - } else { - type->addIdOperand(getStringId("uint")); // name id - } + type->addIdOperand(nameId); // name id type->addIdOperand(makeUintConstant(width)); // size id if(hasSign == true) { type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Signed)); // encoding id @@ -895,11 +891,18 @@ Id Builder::makeIntegerDebugType(int const width, bool const hasSign) Id Builder::makeFloatDebugType(int const width) { + const char* typeName = nullptr; + switch (width) { + case 16: typeName = "float16_t"; break; + case 64: typeName = "double"; break; + default: typeName = "float"; break; + } + auto nameId = getStringId(typeName); // try to find it Instruction* type; for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; - if (type->getIdOperand(0) == getStringId("float") && + if (type->getIdOperand(0) == nameId && type->getIdOperand(1) == static_cast(width) && type->getIdOperand(2) == NonSemanticShaderDebugInfo100Float) return type->getResultId(); @@ -907,9 +910,10 @@ Id Builder::makeFloatDebugType(int const width) // not found, make it type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->reserveOperands(6); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); - type->addIdOperand(getStringId("float")); // name id + type->addIdOperand(nameId); // name id type->addIdOperand(makeUintConstant(width)); // size id type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Float)); // encoding id type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id @@ -937,6 +941,7 @@ Id Builder::makeSequentialDebugType(Id const baseType, Id const componentCount, // not found, make it type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->reserveOperands(4); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(sequenceType); type->addIdOperand(debugId[baseType]); // base type @@ -972,6 +977,7 @@ Id Builder::makeMatrixDebugType(Id const vectorType, int const vectorCount, bool // not found, make it type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->reserveOperands(5); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMatrix); type->addIdOperand(debugId[vectorType]); // vector type id @@ -990,11 +996,12 @@ Id Builder::makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTy assert(debugId[memberType] != 0); Instruction* type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->reserveOperands(10); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMember); type->addIdOperand(getStringId(debugTypeLoc.name)); // name id type->addIdOperand(debugId[memberType]); // type id - type->addIdOperand(makeDebugSource(sourceFileStringId)); // source id TODO: verify this works across include directives + type->addIdOperand(makeDebugSource(currentFileId)); // source id type->addIdOperand(makeUintConstant(debugTypeLoc.line)); // line id TODO: currentLine is always zero type->addIdOperand(makeUintConstant(debugTypeLoc.column)); // TODO: column id type->addIdOperand(makeUintConstant(0)); // TODO: offset id @@ -1018,7 +1025,10 @@ Id Builder::makeCompositeDebugType(std::vector const& memberTypes, char cons for(auto const memberType : memberTypes) { assert(debugTypeLocs.find(memberType) != debugTypeLocs.end()); - memberDebugTypes.emplace_back(makeMemberDebugType(memberType, debugTypeLocs[memberType])); + // There _should_ be debug types for all the member types but currently buffer references + // do not have member debug info generated. + if (debugId[memberType]) + memberDebugTypes.emplace_back(makeMemberDebugType(memberType, debugTypeLocs[memberType])); // TODO: Need to rethink this method of passing location information. // debugTypeLocs.erase(memberType); @@ -1026,11 +1036,12 @@ Id Builder::makeCompositeDebugType(std::vector const& memberTypes, char cons // Create The structure debug type. Instruction* type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->reserveOperands(memberDebugTypes.size() + 11); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeComposite); type->addIdOperand(getStringId(name)); // name id type->addIdOperand(makeUintConstant(tag)); // tag id - type->addIdOperand(makeDebugSource(sourceFileStringId)); // source id TODO: verify this works across include directives + type->addIdOperand(makeDebugSource(currentFileId)); // source id type->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero? type->addIdOperand(makeUintConstant(0)); // TODO: column id type->addIdOperand(makeDebugCompilationUnit()); // scope id @@ -1055,24 +1066,82 @@ Id Builder::makeCompositeDebugType(std::vector const& memberTypes, char cons return type->getResultId(); } +Id Builder::makePointerDebugType(StorageClass storageClass, Id const baseType) +{ + const Id debugBaseType = debugId[baseType]; + if (!debugBaseType) { + return makeDebugInfoNone(); + } + const Id scID = makeUintConstant(storageClass); + for (Instruction* otherType : groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer]) { + if (otherType->getIdOperand(2) == debugBaseType && + otherType->getIdOperand(3) == scID) { + return otherType->getResultId(); + } + } + + Instruction* type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->reserveOperands(5); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypePointer); + type->addIdOperand(debugBaseType); + type->addIdOperand(scID); + type->addIdOperand(makeUintConstant(0)); + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +// Emit a OpExtInstWithForwardRefsKHR nonsemantic instruction for a pointer debug type +// where we don't have the pointee yet. Since we don't have the pointee yet, it just +// points to itself and we rely on patching it later. +Id Builder::makeForwardPointerDebugType(StorageClass storageClass) +{ + const Id scID = makeUintConstant(storageClass); + + this->addExtension(spv::E_SPV_KHR_relaxed_extended_instruction); + + Instruction *type = new Instruction(getUniqueId(), makeVoidType(), OpExtInstWithForwardRefsKHR); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypePointer); + type->addIdOperand(type->getResultId()); + type->addIdOperand(scID); + type->addIdOperand(makeUintConstant(0)); + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + Id Builder::makeDebugSource(const Id fileName) { if (debugSourceId.find(fileName) != debugSourceId.end()) return debugSourceId[fileName]; spv::Id resultId = getUniqueId(); Instruction* sourceInst = new Instruction(resultId, makeVoidType(), OpExtInst); + sourceInst->reserveOperands(3); sourceInst->addIdOperand(nonSemanticShaderDebugInfo); sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugSource); sourceInst->addIdOperand(fileName); if (emitNonSemanticShaderDebugSource) { spv::Id sourceId = 0; - if (fileName == sourceFileStringId) { + if (fileName == mainFileId) { sourceId = getStringId(sourceText); } else { auto incItr = includeFiles.find(fileName); - assert(incItr != includeFiles.end()); - sourceId = getStringId(*incItr->second); + if (incItr != includeFiles.end()) { + sourceId = getStringId(*incItr->second); + } + } + + // We omit the optional source text item if not available in glslang + if (sourceId != 0) { + sourceInst->addIdOperand(sourceId); } - sourceInst->addIdOperand(sourceId); } constantsTypesGlobals.push_back(std::unique_ptr(sourceInst)); module.mapInstruction(sourceInst); @@ -1085,11 +1154,12 @@ Id Builder::makeDebugCompilationUnit() { return nonSemanticShaderCompilationUnitId; spv::Id resultId = getUniqueId(); Instruction* sourceInst = new Instruction(resultId, makeVoidType(), OpExtInst); + sourceInst->reserveOperands(6); sourceInst->addIdOperand(nonSemanticShaderDebugInfo); sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugCompilationUnit); sourceInst->addIdOperand(makeUintConstant(1)); // TODO(greg-lunarg): Get rid of magic number sourceInst->addIdOperand(makeUintConstant(4)); // TODO(greg-lunarg): Get rid of magic number - sourceInst->addIdOperand(makeDebugSource(sourceFileStringId)); + sourceInst->addIdOperand(makeDebugSource(mainFileId)); sourceInst->addIdOperand(makeUintConstant(sourceLang)); constantsTypesGlobals.push_back(std::unique_ptr(sourceInst)); module.mapInstruction(sourceInst); @@ -1108,11 +1178,12 @@ Id Builder::createDebugGlobalVariable(Id const type, char const*const name, Id c assert(type != 0); Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->reserveOperands(11); inst->addIdOperand(nonSemanticShaderDebugInfo); inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugGlobalVariable); inst->addIdOperand(getStringId(name)); // name id inst->addIdOperand(type); // type id - inst->addIdOperand(makeDebugSource(sourceFileStringId)); // source id + inst->addIdOperand(makeDebugSource(currentFileId)); // source id inst->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero? inst->addIdOperand(makeUintConstant(0)); // TODO: column id inst->addIdOperand(makeDebugCompilationUnit()); // scope id @@ -1132,11 +1203,12 @@ Id Builder::createDebugLocalVariable(Id type, char const*const name, size_t cons assert(!currentDebugScopeId.empty()); Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->reserveOperands(9); inst->addIdOperand(nonSemanticShaderDebugInfo); inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLocalVariable); inst->addIdOperand(getStringId(name)); // name id inst->addIdOperand(type); // type id - inst->addIdOperand(makeDebugSource(sourceFileStringId)); // source id + inst->addIdOperand(makeDebugSource(currentFileId)); // source id inst->addIdOperand(makeUintConstant(currentLine)); // line id inst->addIdOperand(makeUintConstant(0)); // TODO: column id inst->addIdOperand(currentDebugScopeId.top()); // scope id @@ -1157,6 +1229,7 @@ Id Builder::makeDebugExpression() return debugExpression; Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->reserveOperands(2); inst->addIdOperand(nonSemanticShaderDebugInfo); inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugExpression); @@ -1168,15 +1241,30 @@ Id Builder::makeDebugExpression() return debugExpression; } -Id Builder::makeDebugDeclare(Id const debugLocalVariable, Id const localVariable) +Id Builder::makeDebugDeclare(Id const debugLocalVariable, Id const pointer) { Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->reserveOperands(5); inst->addIdOperand(nonSemanticShaderDebugInfo); inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugDeclare); inst->addIdOperand(debugLocalVariable); // debug local variable id - inst->addIdOperand(localVariable); // local variable id + inst->addIdOperand(pointer); // pointer to local variable id + inst->addIdOperand(makeDebugExpression()); // expression id + addInstruction(std::unique_ptr(inst)); + + return inst->getResultId(); +} + +Id Builder::makeDebugValue(Id const debugLocalVariable, Id const value) +{ + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->reserveOperands(5); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugValue); + inst->addIdOperand(debugLocalVariable); // debug local variable id + inst->addIdOperand(value); // value of local variable id inst->addIdOperand(makeDebugExpression()); // expression id - buildPoint->addInstruction(std::unique_ptr(inst)); + addInstruction(std::unique_ptr(inst)); return inst->getResultId(); } @@ -1189,6 +1277,10 @@ Id Builder::makeAccelerationStructureType() groupedTypes[OpTypeAccelerationStructureKHR].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) { + spv::Id debugType = makeCompositeDebugType({}, "accelerationStructure", NonSemanticShaderDebugInfo100Structure, true); + debugId[type->getResultId()] = debugType; + } } else { type = groupedTypes[OpTypeAccelerationStructureKHR].back(); } @@ -1204,6 +1296,10 @@ Id Builder::makeRayQueryType() groupedTypes[OpTypeRayQueryKHR].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) { + spv::Id debugType = makeCompositeDebugType({}, "rayQuery", NonSemanticShaderDebugInfo100Structure, true); + debugId[type->getResultId()] = debugType; + } } else { type = groupedTypes[OpTypeRayQueryKHR].back(); } @@ -1253,7 +1349,7 @@ Op Builder::getMostBasicTypeClass(Id typeId) const } } -int Builder::getNumTypeConstituents(Id typeId) const +unsigned int Builder::getNumTypeConstituents(Id typeId) const { Instruction* instr = module.getInstruction(typeId); @@ -1461,12 +1557,14 @@ bool Builder::isConstantOpCode(Op opcode) const case OpConstantFalse: case OpConstant: case OpConstantComposite: + case OpConstantCompositeReplicateEXT: case OpConstantSampler: case OpConstantNull: case OpSpecConstantTrue: case OpSpecConstantFalse: case OpSpecConstant: case OpSpecConstantComposite: + case OpSpecConstantCompositeReplicateEXT: case OpSpecConstantOp: return true; default: @@ -1483,17 +1581,7 @@ bool Builder::isSpecConstantOpCode(Op opcode) const case OpSpecConstant: case OpSpecConstantComposite: case OpSpecConstantOp: - return true; - default: - return false; - } -} - -bool Builder::isRayTracingOpCode(Op opcode) const -{ - switch (opcode) { - case OpTypeAccelerationStructureKHR: - case OpTypeRayQueryKHR: + case OpSpecConstantCompositeReplicateEXT: return true; default: return false; @@ -1590,6 +1678,7 @@ Id Builder::makeInt64Constant(Id typeId, unsigned long long value, bool specCons } Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->reserveOperands(2); c->addImmediateOperand(op1); c->addImmediateOperand(op2); constantsTypesGlobals.push_back(std::unique_ptr(c)); @@ -1643,6 +1732,7 @@ Id Builder::makeDoubleConstant(double d, bool specConstant) } Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->reserveOperands(2); c->addImmediateOperand(op1); c->addImmediateOperand(op2); constantsTypesGlobals.push_back(std::unique_ptr(c)); @@ -1768,10 +1858,27 @@ Id Builder::findStructConstant(Id typeId, const std::vector& comps) // Comments in header Id Builder::makeCompositeConstant(Id typeId, const std::vector& members, bool specConstant) { - Op opcode = specConstant ? OpSpecConstantComposite : OpConstantComposite; assert(typeId); Op typeClass = getTypeClass(typeId); + bool replicate = false; + size_t numMembers = members.size(); + if (useReplicatedComposites) { + // use replicate if all members are the same + replicate = numMembers > 0 && + std::equal(members.begin() + 1, members.end(), members.begin()); + + if (replicate) { + numMembers = 1; + addCapability(spv::CapabilityReplicatedCompositesEXT); + addExtension(spv::E_SPV_EXT_replicated_composites); + } + } + + Op opcode = replicate ? + (specConstant ? OpSpecConstantCompositeReplicateEXT : OpConstantCompositeReplicateEXT) : + (specConstant ? OpSpecConstantComposite : OpConstantComposite); + switch (typeClass) { case OpTypeVector: case OpTypeArray: @@ -1797,7 +1904,8 @@ Id Builder::makeCompositeConstant(Id typeId, const std::vector& members, boo } Instruction* c = new Instruction(getUniqueId(), typeId, opcode); - for (int op = 0; op < (int)members.size(); ++op) + c->reserveOperands(members.size()); + for (size_t op = 0; op < numMembers; ++op) c->addIdOperand(members[op]); constantsTypesGlobals.push_back(std::unique_ptr(c)); if (typeClass == OpTypeStruct) @@ -1812,6 +1920,7 @@ Id Builder::makeCompositeConstant(Id typeId, const std::vector& members, boo Instruction* Builder::addEntryPoint(ExecutionModel model, Function* function, const char* name) { Instruction* entryPoint = new Instruction(OpEntryPoint); + entryPoint->reserveOperands(3); entryPoint->addImmediateOperand(model); entryPoint->addIdOperand(function->getId()); entryPoint->addStringOperand(name); @@ -1824,7 +1933,12 @@ Instruction* Builder::addEntryPoint(ExecutionModel model, Function* function, co // Currently relying on the fact that all 'value' of interest are small non-negative values. void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, int value1, int value2, int value3) { + // entryPoint can be null if we are in compile-only mode + if (!entryPoint) + return; + Instruction* instr = new Instruction(OpExecutionMode); + instr->reserveOperands(3); instr->addIdOperand(entryPoint->getId()); instr->addImmediateOperand(mode); if (value1 >= 0) @@ -1839,7 +1953,12 @@ void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, int val void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, const std::vector& literals) { + // entryPoint can be null if we are in compile-only mode + if (!entryPoint) + return; + Instruction* instr = new Instruction(OpExecutionMode); + instr->reserveOperands(literals.size() + 2); instr->addIdOperand(entryPoint->getId()); instr->addImmediateOperand(mode); for (auto literal : literals) @@ -1850,7 +1969,12 @@ void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, const s void Builder::addExecutionModeId(Function* entryPoint, ExecutionMode mode, const std::vector& operandIds) { + // entryPoint can be null if we are in compile-only mode + if (!entryPoint) + return; + Instruction* instr = new Instruction(OpExecutionModeId); + instr->reserveOperands(operandIds.size() + 2); instr->addIdOperand(entryPoint->getId()); instr->addImmediateOperand(mode); for (auto operandId : operandIds) @@ -1862,6 +1986,7 @@ void Builder::addExecutionModeId(Function* entryPoint, ExecutionMode mode, const void Builder::addName(Id id, const char* string) { Instruction* name = new Instruction(OpName); + name->reserveOperands(2); name->addIdOperand(id); name->addStringOperand(string); @@ -1871,6 +1996,7 @@ void Builder::addName(Id id, const char* string) void Builder::addMemberName(Id id, int memberNumber, const char* string) { Instruction* name = new Instruction(OpMemberName); + name->reserveOperands(3); name->addIdOperand(id); name->addImmediateOperand(memberNumber); name->addStringOperand(string); @@ -1884,12 +2010,13 @@ void Builder::addDecoration(Id id, Decoration decoration, int num) return; Instruction* dec = new Instruction(OpDecorate); + dec->reserveOperands(2); dec->addIdOperand(id); dec->addImmediateOperand(decoration); if (num >= 0) dec->addImmediateOperand(num); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); } void Builder::addDecoration(Id id, Decoration decoration, const char* s) @@ -1898,11 +2025,12 @@ void Builder::addDecoration(Id id, Decoration decoration, const char* s) return; Instruction* dec = new Instruction(OpDecorateString); + dec->reserveOperands(3); dec->addIdOperand(id); dec->addImmediateOperand(decoration); dec->addStringOperand(s); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); } void Builder::addDecoration(Id id, Decoration decoration, const std::vector& literals) @@ -1911,12 +2039,13 @@ void Builder::addDecoration(Id id, Decoration decoration, const std::vectorreserveOperands(literals.size() + 2); dec->addIdOperand(id); dec->addImmediateOperand(decoration); for (auto literal : literals) dec->addImmediateOperand(literal); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); } void Builder::addDecoration(Id id, Decoration decoration, const std::vector& strings) @@ -1925,12 +2054,24 @@ void Builder::addDecoration(Id id, Decoration decoration, const std::vectorreserveOperands(strings.size() + 2); dec->addIdOperand(id); dec->addImmediateOperand(decoration); for (auto string : strings) dec->addStringOperand(string); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addLinkageDecoration(Id id, const char* name, spv::LinkageType linkType) { + Instruction* dec = new Instruction(OpDecorate); + dec->reserveOperands(4); + dec->addIdOperand(id); + dec->addImmediateOperand(spv::DecorationLinkageAttributes); + dec->addStringOperand(name); + dec->addImmediateOperand(linkType); + + decorations.insert(std::unique_ptr(dec)); } void Builder::addDecorationId(Id id, Decoration decoration, Id idDecoration) @@ -1939,11 +2080,12 @@ void Builder::addDecorationId(Id id, Decoration decoration, Id idDecoration) return; Instruction* dec = new Instruction(OpDecorateId); + dec->reserveOperands(3); dec->addIdOperand(id); dec->addImmediateOperand(decoration); dec->addIdOperand(idDecoration); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); } void Builder::addDecorationId(Id id, Decoration decoration, const std::vector& operandIds) @@ -1952,13 +2094,14 @@ void Builder::addDecorationId(Id id, Decoration decoration, const std::vectorreserveOperands(operandIds.size() + 2); dec->addIdOperand(id); dec->addImmediateOperand(decoration); for (auto operandId : operandIds) dec->addIdOperand(operandId); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); } void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, int num) @@ -1967,13 +2110,14 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat return; Instruction* dec = new Instruction(OpMemberDecorate); + dec->reserveOperands(3); dec->addIdOperand(id); dec->addImmediateOperand(member); dec->addImmediateOperand(decoration); if (num >= 0) dec->addImmediateOperand(num); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); } void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, const char *s) @@ -1982,12 +2126,13 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat return; Instruction* dec = new Instruction(OpMemberDecorateStringGOOGLE); + dec->reserveOperands(4); dec->addIdOperand(id); dec->addImmediateOperand(member); dec->addImmediateOperand(decoration); dec->addStringOperand(s); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); } void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, const std::vector& literals) @@ -1996,13 +2141,14 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat return; Instruction* dec = new Instruction(OpMemberDecorate); + dec->reserveOperands(literals.size() + 3); dec->addIdOperand(id); dec->addImmediateOperand(member); dec->addImmediateOperand(decoration); for (auto literal : literals) dec->addImmediateOperand(literal); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); } void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, const std::vector& strings) @@ -2011,13 +2157,70 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat return; Instruction* dec = new Instruction(OpMemberDecorateString); + dec->reserveOperands(strings.size() + 3); dec->addIdOperand(id); dec->addImmediateOperand(member); dec->addImmediateOperand(decoration); for (auto string : strings) dec->addStringOperand(string); - decorations.push_back(std::unique_ptr(dec)); + decorations.insert(std::unique_ptr(dec)); +} + +void Builder::addInstruction(std::unique_ptr inst) { + // Phis must appear first in their block, don't insert line tracking instructions + // in front of them, just add the OpPhi and return. + if (inst->getOpCode() == OpPhi) { + buildPoint->addInstruction(std::move(inst)); + return; + } + // Optionally insert OpDebugScope + if (emitNonSemanticShaderDebugInfo && dirtyScopeTracker) { + if (buildPoint->updateDebugScope(currentDebugScopeId.top())) { + auto scopeInst = std::make_unique(getUniqueId(), makeVoidType(), OpExtInst); + scopeInst->reserveOperands(3); + scopeInst->addIdOperand(nonSemanticShaderDebugInfo); + scopeInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugScope); + scopeInst->addIdOperand(currentDebugScopeId.top()); + buildPoint->addInstruction(std::move(scopeInst)); + } + + dirtyScopeTracker = false; + } + + // Insert OpLine/OpDebugLine if the debug source location has changed + if (trackDebugInfo && dirtyLineTracker) { + if (buildPoint->updateDebugSourceLocation(currentLine, 0, currentFileId)) { + if (emitSpirvDebugInfo) { + auto lineInst = std::make_unique(OpLine); + lineInst->reserveOperands(3); + lineInst->addIdOperand(currentFileId); + lineInst->addImmediateOperand(currentLine); + lineInst->addImmediateOperand(0); + buildPoint->addInstruction(std::move(lineInst)); + } + if (emitNonSemanticShaderDebugInfo) { + auto lineInst = std::make_unique(getUniqueId(), makeVoidType(), OpExtInst); + lineInst->reserveOperands(7); + lineInst->addIdOperand(nonSemanticShaderDebugInfo); + lineInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLine); + lineInst->addIdOperand(makeDebugSource(currentFileId)); + lineInst->addIdOperand(makeUintConstant(currentLine)); + lineInst->addIdOperand(makeUintConstant(currentLine)); + lineInst->addIdOperand(makeUintConstant(0)); + lineInst->addIdOperand(makeUintConstant(0)); + buildPoint->addInstruction(std::move(lineInst)); + } + } + + dirtyLineTracker = false; + } + + buildPoint->addInstruction(std::move(inst)); +} + +void Builder::addInstructionNoDebugInfo(std::unique_ptr inst) { + buildPoint->addInstruction(std::move(inst)); } // Comments in header @@ -2025,11 +2228,6 @@ Function* Builder::makeEntryPoint(const char* entryPoint) { assert(! entryPointFunction); - Block* entry; - std::vector paramsTypes; - std::vector paramNames; - std::vector> decorations; - auto const returnType = makeVoidType(); restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo; @@ -2037,7 +2235,8 @@ Function* Builder::makeEntryPoint(const char* entryPoint) emitNonSemanticShaderDebugInfo = false; } - entryPointFunction = makeFunctionEntry(NoPrecision, returnType, entryPoint, paramsTypes, paramNames, decorations, &entry); + Block* entry = nullptr; + entryPointFunction = makeFunctionEntry(NoPrecision, returnType, entryPoint, LinkageTypeMax, {}, {}, &entry); emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo; @@ -2045,15 +2244,15 @@ Function* Builder::makeEntryPoint(const char* entryPoint) } // Comments in header -Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name, - const std::vector& paramTypes, const std::vector& paramNames, - const std::vector>& decorations, Block **entry) +Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name, LinkageType linkType, + const std::vector& paramTypes, + const std::vector>& decorations, Block** entry) { // Make the function and initial instructions in it Id typeId = makeFunctionType(returnType, paramTypes); Id firstParamId = paramTypes.size() == 0 ? 0 : getUniqueIds((int)paramTypes.size()); Id funcId = getUniqueId(); - Function* function = new Function(funcId, returnType, typeId, firstParamId, module); + Function* function = new Function(funcId, returnType, typeId, firstParamId, linkType, name, module); // Set up the precisions setPrecision(function->getId(), precision); @@ -2065,13 +2264,9 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const } } - // Make the debug function instruction + // reset last debug scope if (emitNonSemanticShaderDebugInfo) { - Id nameId = getStringId(unmangleFunctionName(name)); - Id debugFuncId = makeDebugFunction(function, nameId, typeId); - debugId[funcId] = debugFuncId; - currentDebugScopeId.push(debugFuncId); - lastDebugScopeId = NoResult; + dirtyScopeTracker = true; } // CFG @@ -2080,41 +2275,64 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const function->addBlock(*entry); setBuildPoint(*entry); + if (name) + addName(function->getId(), name); + + functions.push_back(std::unique_ptr(function)); + + return function; +} + +void Builder::setupFunctionDebugInfo(Function* function, const char* name, const std::vector& paramTypes, + const std::vector& paramNames) +{ + + if (!emitNonSemanticShaderDebugInfo) + return; + + Id nameId = getStringId(unmangleFunctionName(name)); + Id funcTypeId = function->getFuncTypeId(); + assert(debugId[funcTypeId] != 0); + Id funcId = function->getId(); + + assert(funcId != 0); + + // Make the debug function instruction + Id debugFuncId = makeDebugFunction(function, nameId, funcTypeId); + debugId[funcId] = debugFuncId; + currentDebugScopeId.push(debugFuncId); + // DebugScope and DebugLine for parameter DebugDeclares - if (emitNonSemanticShaderDebugInfo && (int)paramTypes.size() > 0) { - addDebugScopeAndLine(currentFileId, currentLine, 0); - } + assert(paramTypes.size() == paramNames.size()); + if ((int)paramTypes.size() > 0) { + Id firstParamId = function->getParamId(0); + + for (size_t p = 0; p < paramTypes.size(); ++p) { + bool passByRef = false; + Id paramTypeId = paramTypes[p]; + + // For pointer-typed parameters, they are actually passed by reference and we need unwrap the pointer to get the actual parameter type. + if (isPointerType(paramTypeId) || isArrayType(paramTypeId)) { + passByRef = true; + paramTypeId = getContainedTypeId(paramTypeId); + } - if (emitNonSemanticShaderDebugInfo) { - assert(paramTypes.size() == paramNames.size()); - for(size_t p = 0; p < paramTypes.size(); ++p) - { - auto getParamTypeId = [this](Id const& typeId) { - if (isPointerType(typeId) || isArrayType(typeId)) { - return getContainedTypeId(typeId); - } - else { - return typeId; - } - }; auto const& paramName = paramNames[p]; - auto const debugLocalVariableId = createDebugLocalVariable(debugId[getParamTypeId(paramTypes[p])], paramName, p+1); - debugId[firstParamId + p] = debugLocalVariableId; + auto const debugLocalVariableId = createDebugLocalVariable(debugId[paramTypeId], paramName, p + 1); + auto const paramId = static_cast(firstParamId + p); + debugId[paramId] = debugLocalVariableId; - makeDebugDeclare(debugLocalVariableId, firstParamId + p); + if (passByRef) { + makeDebugDeclare(debugLocalVariableId, paramId); + } else { + makeDebugValue(debugLocalVariableId, paramId); + } } } - if (name) - addName(function->getId(), name); - - functions.push_back(std::unique_ptr(function)); - // Clear debug scope stack if (emitNonSemanticShaderDebugInfo) currentDebugScopeId.pop(); - - return function; } Id Builder::makeDebugFunction([[maybe_unused]] Function* function, Id nameId, Id funcTypeId) @@ -2126,32 +2344,34 @@ Id Builder::makeDebugFunction([[maybe_unused]] Function* function, Id nameId, Id Id funcId = getUniqueId(); auto type = new Instruction(funcId, makeVoidType(), OpExtInst); + type->reserveOperands(11); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunction); type->addIdOperand(nameId); type->addIdOperand(debugId[funcTypeId]); - type->addIdOperand(makeDebugSource(currentFileId)); // Will be fixed later when true filename available - type->addIdOperand(makeUintConstant(currentLine)); // Will be fixed later when true line available + type->addIdOperand(makeDebugSource(currentFileId)); // TODO: This points to file of definition instead of declaration + type->addIdOperand(makeUintConstant(currentLine)); // TODO: This points to line of definition instead of declaration type->addIdOperand(makeUintConstant(0)); // column type->addIdOperand(makeDebugCompilationUnit()); // scope type->addIdOperand(nameId); // linkage name type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); - type->addIdOperand(makeUintConstant(currentLine)); // TODO(greg-lunarg): correct scope line + type->addIdOperand(makeUintConstant(currentLine)); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return funcId; } -Id Builder::makeDebugLexicalBlock(uint32_t line) { +Id Builder::makeDebugLexicalBlock(uint32_t line, uint32_t column) { assert(!currentDebugScopeId.empty()); Id lexId = getUniqueId(); auto lex = new Instruction(lexId, makeVoidType(), OpExtInst); + lex->reserveOperands(6); lex->addIdOperand(nonSemanticShaderDebugInfo); lex->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLexicalBlock); lex->addIdOperand(makeDebugSource(currentFileId)); lex->addIdOperand(makeUintConstant(line)); - lex->addIdOperand(makeUintConstant(0)); // column + lex->addIdOperand(makeUintConstant(column)); // column lex->addIdOperand(currentDebugScopeId.top()); // scope constantsTypesGlobals.push_back(std::unique_ptr(lex)); module.mapInstruction(lex); @@ -2175,29 +2395,37 @@ void Builder::makeReturn(bool implicit, Id retVal) if (retVal) { Instruction* inst = new Instruction(NoResult, NoType, OpReturnValue); inst->addIdOperand(retVal); - buildPoint->addInstruction(std::unique_ptr(inst)); + addInstruction(std::unique_ptr(inst)); } else - buildPoint->addInstruction(std::unique_ptr(new Instruction(NoResult, NoType, OpReturn))); + addInstruction(std::unique_ptr(new Instruction(NoResult, NoType, OpReturn))); if (! implicit) createAndSetNoPredecessorBlock("post-return"); } // Comments in header -void Builder::enterScope(uint32_t line) +void Builder::enterLexicalBlock(uint32_t line, uint32_t column) { + if (!emitNonSemanticShaderDebugInfo) { + return; + } + // Generate new lexical scope debug instruction - Id lexId = makeDebugLexicalBlock(line); + Id lexId = makeDebugLexicalBlock(line, column); currentDebugScopeId.push(lexId); - lastDebugScopeId = NoResult; + dirtyScopeTracker = true; } // Comments in header -void Builder::leaveScope() +void Builder::leaveLexicalBlock() { + if (!emitNonSemanticShaderDebugInfo) { + return; + } + // Pop current scope from stack and clear current scope currentDebugScopeId.pop(); - lastDebugScopeId = NoResult; + dirtyScopeTracker = true; } // Comments in header @@ -2217,11 +2445,18 @@ void Builder::enterFunction(Function const* function) // Create DebugFunctionDefinition spv::Id resultId = getUniqueId(); Instruction* defInst = new Instruction(resultId, makeVoidType(), OpExtInst); + defInst->reserveOperands(4); defInst->addIdOperand(nonSemanticShaderDebugInfo); defInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunctionDefinition); defInst->addIdOperand(debugId[funcId]); defInst->addIdOperand(funcId); - buildPoint->addInstruction(std::unique_ptr(defInst)); + addInstruction(std::unique_ptr(defInst)); + } + + if (auto linkType = function->getLinkType(); linkType != LinkageTypeMax) { + Id funcId = function->getFuncId(); + addCapability(CapabilityLinkage); + addLinkageDecoration(funcId, function->getExportName(), linkType); } } @@ -2251,7 +2486,7 @@ void Builder::leaveFunction() // Comments in header void Builder::makeStatementTerminator(spv::Op opcode, const char *name) { - buildPoint->addInstruction(std::unique_ptr(new Instruction(opcode))); + addInstruction(std::unique_ptr(new Instruction(opcode))); createAndSetNoPredecessorBlock(name); } @@ -2294,7 +2529,7 @@ Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id t constantsTypesGlobals.push_back(std::unique_ptr(inst)); module.mapInstruction(inst); - if (emitNonSemanticShaderDebugInfo && !isRayTracingOpCode(getOpCode(type))) + if (emitNonSemanticShaderDebugInfo) { auto const debugResultId = createDebugGlobalVariable(debugId[type], name, inst->getResultId()); debugId[inst->getResultId()] = debugResultId; @@ -2313,7 +2548,7 @@ Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id t Id Builder::createUndefined(Id type) { Instruction* inst = new Instruction(getUniqueId(), type, OpUndef); - buildPoint->addInstruction(std::unique_ptr(inst)); + addInstruction(std::unique_ptr(inst)); return inst->getResultId(); } @@ -2342,6 +2577,7 @@ void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAcce unsigned int alignment) { Instruction* store = new Instruction(OpStore); + store->reserveOperands(2); store->addIdOperand(lValue); store->addIdOperand(rValue); @@ -2357,7 +2593,7 @@ void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAcce } } - buildPoint->addInstruction(std::unique_ptr(store)); + addInstruction(std::unique_ptr(store)); } // Comments in header @@ -2379,7 +2615,7 @@ Id Builder::createLoad(Id lValue, spv::Decoration precision, spv::MemoryAccessMa } } - buildPoint->addInstruction(std::unique_ptr(load)); + addInstruction(std::unique_ptr(load)); setPrecision(load->getResultId(), precision); return load->getResultId(); @@ -2394,10 +2630,11 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vec // Make the instruction Instruction* chain = new Instruction(getUniqueId(), typeId, OpAccessChain); + chain->reserveOperands(offsets.size() + 1); chain->addIdOperand(base); for (int i = 0; i < (int)offsets.size(); ++i) chain->addIdOperand(offsets[i]); - buildPoint->addInstruction(std::unique_ptr(chain)); + addInstruction(std::unique_ptr(chain)); return chain->getResultId(); } @@ -2406,9 +2643,10 @@ Id Builder::createArrayLength(Id base, unsigned int member) { spv::Id intType = makeUintType(32); Instruction* length = new Instruction(getUniqueId(), intType, OpArrayLength); + length->reserveOperands(2); length->addIdOperand(base); length->addImmediateOperand(member); - buildPoint->addInstruction(std::unique_ptr(length)); + addInstruction(std::unique_ptr(length)); return length->getResultId(); } @@ -2425,7 +2663,7 @@ Id Builder::createCooperativeMatrixLengthKHR(Id type) Instruction* length = new Instruction(getUniqueId(), intType, OpCooperativeMatrixLengthKHR); length->addIdOperand(type); - buildPoint->addInstruction(std::unique_ptr(length)); + addInstruction(std::unique_ptr(length)); return length->getResultId(); } @@ -2442,7 +2680,7 @@ Id Builder::createCooperativeMatrixLengthNV(Id type) Instruction* length = new Instruction(getUniqueId(), intType, OpCooperativeMatrixLengthNV); length->addIdOperand(type); - buildPoint->addInstruction(std::unique_ptr(length)); + addInstruction(std::unique_ptr(length)); return length->getResultId(); } @@ -2456,9 +2694,10 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index) std::vector(1, index)); } Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract); + extract->reserveOperands(2); extract->addIdOperand(composite); extract->addImmediateOperand(index); - buildPoint->addInstruction(std::unique_ptr(extract)); + addInstruction(std::unique_ptr(extract)); return extract->getResultId(); } @@ -2471,10 +2710,11 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, const std::vector(1, composite), indexes); } Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract); + extract->reserveOperands(indexes.size() + 1); extract->addIdOperand(composite); for (int i = 0; i < (int)indexes.size(); ++i) extract->addImmediateOperand(indexes[i]); - buildPoint->addInstruction(std::unique_ptr(extract)); + addInstruction(std::unique_ptr(extract)); return extract->getResultId(); } @@ -2482,10 +2722,11 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, const std::vectorreserveOperands(3); insert->addIdOperand(object); insert->addIdOperand(composite); insert->addImmediateOperand(index); - buildPoint->addInstruction(std::unique_ptr(insert)); + addInstruction(std::unique_ptr(insert)); return insert->getResultId(); } @@ -2493,11 +2734,12 @@ Id Builder::createCompositeInsert(Id object, Id composite, Id typeId, unsigned i Id Builder::createCompositeInsert(Id object, Id composite, Id typeId, const std::vector& indexes) { Instruction* insert = new Instruction(getUniqueId(), typeId, OpCompositeInsert); + insert->reserveOperands(indexes.size() + 2); insert->addIdOperand(object); insert->addIdOperand(composite); for (int i = 0; i < (int)indexes.size(); ++i) insert->addImmediateOperand(indexes[i]); - buildPoint->addInstruction(std::unique_ptr(insert)); + addInstruction(std::unique_ptr(insert)); return insert->getResultId(); } @@ -2505,9 +2747,10 @@ Id Builder::createCompositeInsert(Id object, Id composite, Id typeId, const std: Id Builder::createVectorExtractDynamic(Id vector, Id typeId, Id componentIndex) { Instruction* extract = new Instruction(getUniqueId(), typeId, OpVectorExtractDynamic); + extract->reserveOperands(2); extract->addIdOperand(vector); extract->addIdOperand(componentIndex); - buildPoint->addInstruction(std::unique_ptr(extract)); + addInstruction(std::unique_ptr(extract)); return extract->getResultId(); } @@ -2515,10 +2758,11 @@ Id Builder::createVectorExtractDynamic(Id vector, Id typeId, Id componentIndex) Id Builder::createVectorInsertDynamic(Id vector, Id typeId, Id component, Id componentIndex) { Instruction* insert = new Instruction(getUniqueId(), typeId, OpVectorInsertDynamic); + insert->reserveOperands(3); insert->addIdOperand(vector); insert->addIdOperand(component); insert->addIdOperand(componentIndex); - buildPoint->addInstruction(std::unique_ptr(insert)); + addInstruction(std::unique_ptr(insert)); return insert->getResultId(); } @@ -2527,7 +2771,7 @@ Id Builder::createVectorInsertDynamic(Id vector, Id typeId, Id component, Id com void Builder::createNoResultOp(Op opCode) { Instruction* op = new Instruction(opCode); - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); } // An opcode that has one id operand, no result id, and no type @@ -2535,47 +2779,51 @@ void Builder::createNoResultOp(Op opCode, Id operand) { Instruction* op = new Instruction(opCode); op->addIdOperand(operand); - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); } // An opcode that has one or more operands, no result id, and no type void Builder::createNoResultOp(Op opCode, const std::vector& operands) { Instruction* op = new Instruction(opCode); - for (auto it = operands.cbegin(); it != operands.cend(); ++it) { - op->addIdOperand(*it); + op->reserveOperands(operands.size()); + for (auto id : operands) { + op->addIdOperand(id); } - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); } // An opcode that has multiple operands, no result id, and no type void Builder::createNoResultOp(Op opCode, const std::vector& operands) { Instruction* op = new Instruction(opCode); + op->reserveOperands(operands.size()); for (auto it = operands.cbegin(); it != operands.cend(); ++it) { if (it->isId) op->addIdOperand(it->word); else op->addImmediateOperand(it->word); } - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); } void Builder::createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask semantics) { Instruction* op = new Instruction(OpControlBarrier); + op->reserveOperands(3); op->addIdOperand(makeUintConstant(execution)); op->addIdOperand(makeUintConstant(memory)); op->addIdOperand(makeUintConstant(semantics)); - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); } void Builder::createMemoryBarrier(unsigned executionScope, unsigned memorySemantics) { Instruction* op = new Instruction(OpMemoryBarrier); + op->reserveOperands(2); op->addIdOperand(makeUintConstant(executionScope)); op->addIdOperand(makeUintConstant(memorySemantics)); - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); } // An opcode that has one operands, a result id, and a type @@ -2588,7 +2836,7 @@ Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand) } Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(operand); - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -2603,9 +2851,10 @@ Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right) return createSpecConstantOp(opCode, typeId, operands, std::vector()); } Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + op->reserveOperands(2); op->addIdOperand(left); op->addIdOperand(right); - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -2623,10 +2872,11 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3) opCode, typeId, operands, std::vector()); } Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + op->reserveOperands(3); op->addIdOperand(op1); op->addIdOperand(op2); op->addIdOperand(op3); - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -2634,9 +2884,10 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3) Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) { Instruction* op = new Instruction(getUniqueId(), typeId, opCode); - for (auto it = operands.cbegin(); it != operands.cend(); ++it) - op->addIdOperand(*it); - buildPoint->addInstruction(std::unique_ptr(op)); + op->reserveOperands(operands.size()); + for (auto id : operands) + op->addIdOperand(id); + addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -2644,13 +2895,14 @@ Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) { Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + op->reserveOperands(operands.size()); for (auto it = operands.cbegin(); it != operands.cend(); ++it) { if (it->isId) op->addIdOperand(it->word); else op->addImmediateOperand(it->word); } - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -2659,6 +2911,7 @@ Id Builder::createSpecConstantOp(Op opCode, Id typeId, const std::vector& op const std::vector& literals) { Instruction* op = new Instruction(getUniqueId(), typeId, OpSpecConstantOp); + op->reserveOperands(operands.size() + literals.size() + 1); op->addImmediateOperand((unsigned) opCode); for (auto it = operands.cbegin(); it != operands.cend(); ++it) op->addIdOperand(*it); @@ -2667,16 +2920,25 @@ Id Builder::createSpecConstantOp(Op opCode, Id typeId, const std::vector& op module.mapInstruction(op); constantsTypesGlobals.push_back(std::unique_ptr(op)); + // OpSpecConstantOp's using 8 or 16 bit types require the associated capability + if (containsType(typeId, OpTypeInt, 8)) + addCapability(CapabilityInt8); + if (containsType(typeId, OpTypeInt, 16)) + addCapability(CapabilityInt16); + if (containsType(typeId, OpTypeFloat, 16)) + addCapability(CapabilityFloat16); + return op->getResultId(); } Id Builder::createFunctionCall(spv::Function* function, const std::vector& args) { Instruction* op = new Instruction(getUniqueId(), function->getReturnType(), OpFunctionCall); + op->reserveOperands(args.size() + 1); op->addIdOperand(function->getId()); for (int a = 0; a < (int)args.size(); ++a) op->addIdOperand(args[a]); - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -2694,11 +2956,12 @@ Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, cons } Instruction* swizzle = new Instruction(getUniqueId(), typeId, OpVectorShuffle); assert(isVector(source)); + swizzle->reserveOperands(channels.size() + 2); swizzle->addIdOperand(source); swizzle->addIdOperand(source); for (int i = 0; i < (int)channels.size(); ++i) swizzle->addImmediateOperand(channels[i]); - buildPoint->addInstruction(std::unique_ptr(swizzle)); + addInstruction(std::unique_ptr(swizzle)); return setPrecision(swizzle->getResultId(), precision); } @@ -2712,9 +2975,10 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vect Instruction* swizzle = new Instruction(getUniqueId(), typeId, OpVectorShuffle); assert(isVector(target)); + swizzle->reserveOperands(2); swizzle->addIdOperand(target); - assert(getNumComponents(source) == (int)channels.size()); + assert(getNumComponents(source) == channels.size()); assert(isVector(source)); swizzle->addIdOperand(source); @@ -2729,9 +2993,10 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vect components[channels[i]] = numTargetComponents + i; // finish the instruction with these components selectors + swizzle->reserveOperands(numTargetComponents); for (int i = 0; i < numTargetComponents; ++i) swizzle->addImmediateOperand(components[i]); - buildPoint->addInstruction(std::unique_ptr(swizzle)); + addInstruction(std::unique_ptr(swizzle)); return swizzle->getResultId(); } @@ -2773,10 +3038,21 @@ Id Builder::smearScalar(Decoration precision, Id scalar, Id vectorType) auto result_id = makeCompositeConstant(vectorType, members, isSpecConstant(scalar)); smear = module.getInstruction(result_id); } else { - smear = new Instruction(getUniqueId(), vectorType, OpCompositeConstruct); + bool replicate = useReplicatedComposites && (numComponents > 0); + + if (replicate) { + numComponents = 1; + addCapability(spv::CapabilityReplicatedCompositesEXT); + addExtension(spv::E_SPV_EXT_replicated_composites); + } + + Op opcode = replicate ? OpCompositeConstructReplicateEXT : OpCompositeConstruct; + + smear = new Instruction(getUniqueId(), vectorType, opcode); + smear->reserveOperands(numComponents); for (int c = 0; c < numComponents; ++c) smear->addIdOperand(scalar); - buildPoint->addInstruction(std::unique_ptr(smear)); + addInstruction(std::unique_ptr(smear)); } return setPrecision(smear->getResultId(), precision); @@ -2786,12 +3062,13 @@ Id Builder::smearScalar(Decoration precision, Id scalar, Id vectorType) Id Builder::createBuiltinCall(Id resultType, Id builtins, int entryPoint, const std::vector& args) { Instruction* inst = new Instruction(getUniqueId(), resultType, OpExtInst); + inst->reserveOperands(args.size() + 2); inst->addIdOperand(builtins); inst->addImmediateOperand(entryPoint); for (int arg = 0; arg < (int)args.size(); ++arg) inst->addIdOperand(args[arg]); - buildPoint->addInstruction(std::unique_ptr(inst)); + addInstruction(std::unique_ptr(inst)); return inst->getResultId(); } @@ -2980,6 +3257,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, // Build the SPIR-V instruction Instruction* textureInst = new Instruction(getUniqueId(), resultType, opCode); + textureInst->reserveOperands(optArgNum + (texArgs.size() - (optArgNum + 1))); for (size_t op = 0; op < optArgNum; ++op) textureInst->addIdOperand(texArgs[op]); if (optArgNum < texArgs.size()) @@ -2987,7 +3265,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, for (size_t op = optArgNum + 1; op < texArgs.size(); ++op) textureInst->addIdOperand(texArgs[op]); setPrecision(textureInst->getResultId(), precision); - buildPoint->addInstruction(std::unique_ptr(textureInst)); + addInstruction(std::unique_ptr(textureInst)); Id resultId = textureInst->getResultId(); @@ -3067,7 +3345,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter query->addIdOperand(parameters.coords); if (parameters.lod) query->addIdOperand(parameters.lod); - buildPoint->addInstruction(std::unique_ptr(query)); + addInstruction(std::unique_ptr(query)); addCapability(CapabilityImageQuery); return query->getResultId(); @@ -3147,7 +3425,7 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b Id Builder::createCompositeConstruct(Id typeId, const std::vector& constituents) { assert(isAggregateType(typeId) || (getNumTypeConstituents(typeId) > 1 && - getNumTypeConstituents(typeId) == (int)constituents.size())); + getNumTypeConstituents(typeId) == constituents.size())); if (generatingOpCodeForSpecConst) { // Sometime, even in spec-constant-op mode, the constant composite to be @@ -3163,10 +3441,27 @@ Id Builder::createCompositeConstruct(Id typeId, const std::vector& constitue [&](spv::Id id) { return isSpecConstant(id); })); } - Instruction* op = new Instruction(getUniqueId(), typeId, OpCompositeConstruct); - for (int c = 0; c < (int)constituents.size(); ++c) + bool replicate = false; + size_t numConstituents = constituents.size(); + + if (useReplicatedComposites) { + replicate = numConstituents > 0 && + std::equal(constituents.begin() + 1, constituents.end(), constituents.begin()); + } + + if (replicate) { + numConstituents = 1; + addCapability(spv::CapabilityReplicatedCompositesEXT); + addExtension(spv::E_SPV_EXT_replicated_composites); + } + + Op opcode = replicate ? OpCompositeConstructReplicateEXT : OpCompositeConstruct; + + Instruction* op = new Instruction(getUniqueId(), typeId, opcode); + op->reserveOperands(constituents.size()); + for (size_t c = 0; c < numConstituents; ++c) op->addIdOperand(constituents[c]); - buildPoint->addInstruction(std::unique_ptr(op)); + addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -3183,6 +3478,12 @@ Id Builder::createConstructor(Decoration precision, const std::vector& sourc if (sources.size() == 1 && isScalar(sources[0]) && numTargetComponents > 1) return smearScalar(precision, sources[0], resultTypeId); + // Special case: 2 vectors of equal size + if (sources.size() == 1 && isVector(sources[0]) && numTargetComponents == getNumComponents(sources[0])) { + assert(resultTypeId == getTypeId(sources[0])); + return sources[0]; + } + // accumulate the arguments for OpCompositeConstruct std::vector constituents; Id scalarTypeId = getScalarTypeId(resultTypeId); @@ -3217,8 +3518,8 @@ Id Builder::createConstructor(Decoration precision, const std::vector& sourc if (sourcesToUse + targetComponent > numTargetComponents) sourcesToUse = numTargetComponents - targetComponent; - int col = 0; - int row = 0; + unsigned int col = 0; + unsigned int row = 0; for (unsigned int s = 0; s < sourcesToUse; ++s) { if (row >= getNumRows(sourceArg)) { row = 0; @@ -3250,18 +3551,21 @@ Id Builder::createConstructor(Decoration precision, const std::vector& sourc } // If the result is a vector, make it from the gathered constituents. - if (constituents.size() > 0) + if (constituents.size() > 0) { result = createCompositeConstruct(resultTypeId, constituents); - - return setPrecision(result, precision); + return setPrecision(result, precision); + } else { + // Precision was set when generating this component. + return result; + } } // Comments in header Id Builder::createMatrixConstructor(Decoration precision, const std::vector& sources, Id resultTypeId) { Id componentTypeId = getScalarTypeId(resultTypeId); - int numCols = getTypeNumColumns(resultTypeId); - int numRows = getTypeNumRows(resultTypeId); + unsigned int numCols = getTypeNumColumns(resultTypeId); + unsigned int numRows = getTypeNumRows(resultTypeId); Instruction* instr = module.getInstruction(componentTypeId); const unsigned bitCount = instr->getImmediateOperand(0); @@ -3276,11 +3580,11 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& Id sourceColumnTypeId = getContainedTypeId(getTypeId(matrix)); std::vector channels; - for (int row = 0; row < numRows; ++row) + for (unsigned int row = 0; row < numRows; ++row) channels.push_back(row); std::vector matrixColumns; - for (int col = 0; col < numCols; ++col) { + for (unsigned int col = 0; col < numCols; ++col) { std::vector indexes; indexes.push_back(col); Id colv = createCompositeExtract(matrix, sourceColumnTypeId, indexes); @@ -3296,6 +3600,13 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& return setPrecision(createCompositeConstruct(resultTypeId, matrixColumns), precision); } + // Detect a matrix being constructed from a repeated vector of the correct size. + // Create the composite directly from it. + if (sources.size() == numCols && isVector(sources[0]) && getNumComponents(sources[0]) == numRows && + std::equal(sources.begin() + 1, sources.end(), sources.begin())) { + return setPrecision(createCompositeConstruct(resultTypeId, sources), precision); + } + // Otherwise, will use a two step process // 1. make a compile-time 2D array of values // 2. construct a matrix from that array @@ -3323,12 +3634,12 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& } else if (isMatrix(sources[0])) { // constructing from another matrix; copy over the parts that exist in both the argument and constructee Id matrix = sources[0]; - int minCols = std::min(numCols, getNumColumns(matrix)); - int minRows = std::min(numRows, getNumRows(matrix)); - for (int col = 0; col < minCols; ++col) { + unsigned int minCols = std::min(numCols, getNumColumns(matrix)); + unsigned int minRows = std::min(numRows, getNumRows(matrix)); + for (unsigned int col = 0; col < minCols; ++col) { std::vector indexes; indexes.push_back(col); - for (int row = 0; row < minRows; ++row) { + for (unsigned int row = 0; row < minRows; ++row) { indexes.push_back(row); ids[col][row] = createCompositeExtract(matrix, componentTypeId, indexes); indexes.pop_back(); @@ -3337,12 +3648,12 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& } } else { // fill in the matrix in column-major order with whatever argument components are available - int row = 0; - int col = 0; + unsigned int row = 0; + unsigned int col = 0; - for (int arg = 0; arg < (int)sources.size() && col < numCols; ++arg) { + for (unsigned int arg = 0; arg < sources.size() && col < numCols; ++arg) { Id argComp = sources[arg]; - for (int comp = 0; comp < getNumComponents(sources[arg]); ++comp) { + for (unsigned int comp = 0; comp < getNumComponents(sources[arg]); ++comp) { if (getNumComponents(sources[arg]) > 1) { argComp = createCompositeExtract(sources[arg], componentTypeId, comp); setPrecision(argComp, precision); @@ -3366,9 +3677,9 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& // make the column vectors Id columnTypeId = getContainedTypeId(resultTypeId); std::vector matrixColumns; - for (int col = 0; col < numCols; ++col) { + for (unsigned int col = 0; col < numCols; ++col) { std::vector vectorComponents; - for (int row = 0; row < numRows; ++row) + for (unsigned int row = 0; row < numRows; ++row) vectorComponents.push_back(ids[col][row]); Id column = createCompositeConstruct(columnTypeId, vectorComponents); setPrecision(column, precision); @@ -3397,6 +3708,7 @@ Builder::If::If(Id cond, unsigned int ctrl, Builder& gb) : // Save the current block, so that we can add in the flow control split when // makeEndIf is called. headerBlock = builder.getBuildPoint(); + builder.createSelectionMerge(mergeBlock, control); function->addBlock(thenBlock); builder.setBuildPoint(thenBlock); @@ -3406,7 +3718,7 @@ Builder::If::If(Id cond, unsigned int ctrl, Builder& gb) : void Builder::If::makeBeginElse() { // Close out the "then" by having it jump to the mergeBlock - builder.createBranch(mergeBlock); + builder.createBranch(true, mergeBlock); // Make the first else block and add it to the function elseBlock = new Block(builder.getUniqueId(), *function); @@ -3420,11 +3732,10 @@ void Builder::If::makeBeginElse() void Builder::If::makeEndIf() { // jump to the merge block - builder.createBranch(mergeBlock); + builder.createBranch(true, mergeBlock); // Go back to the headerBlock and make the flow control split builder.setBuildPoint(headerBlock); - builder.createSelectionMerge(mergeBlock, control); if (elseBlock) builder.createConditionalBranch(condition, thenBlock, elseBlock); else @@ -3453,6 +3764,7 @@ void Builder::makeSwitch(Id selector, unsigned int control, int numSegments, con // make the switch instruction Instruction* switchInst = new Instruction(NoResult, NoType, OpSwitch); + switchInst->reserveOperands((caseValues.size() * 2) + 2); switchInst->addIdOperand(selector); auto defaultOrMerge = (defaultSegment >= 0) ? segmentBlocks[defaultSegment] : mergeBlock; switchInst->addIdOperand(defaultOrMerge->getId()); @@ -3462,17 +3774,17 @@ void Builder::makeSwitch(Id selector, unsigned int control, int numSegments, con switchInst->addIdOperand(segmentBlocks[valueIndexToSegment[i]]->getId()); segmentBlocks[valueIndexToSegment[i]]->addPredecessor(buildPoint); } - buildPoint->addInstruction(std::unique_ptr(switchInst)); + addInstruction(std::unique_ptr(switchInst)); // push the merge block switchMerges.push(mergeBlock); } // Comments in header -void Builder::addSwitchBreak() +void Builder::addSwitchBreak(bool implicit) { // branch to the top of the merge block stack - createBranch(switchMerges.top()); + createBranch(implicit, switchMerges.top()); createAndSetNoPredecessorBlock("post-switch-break"); } @@ -3483,7 +3795,7 @@ void Builder::nextSwitchSegment(std::vector& segmentBlock, int nextSegme if (lastSegment >= 0) { // Close out previous segment by jumping, if necessary, to next segment if (! buildPoint->isTerminated()) - createBranch(segmentBlock[nextSegment]); + createBranch(true, segmentBlock[nextSegment]); } Block* block = segmentBlock[nextSegment]; block->getParent().addBlock(block); @@ -3495,7 +3807,7 @@ void Builder::endSwitch(std::vector& /*segmentBlock*/) { // Close out previous segment by jumping, if necessary, to next segment if (! buildPoint->isTerminated()) - addSwitchBreak(); + addSwitchBreak(true); switchMerges.top()->getParent().addBlock(switchMerges.top()); setBuildPoint(switchMerges.top()); @@ -3528,14 +3840,14 @@ Builder::LoopBlocks& Builder::makeNewLoop() void Builder::createLoopContinue() { - createBranch(&loops.top().continue_target); + createBranch(false, &loops.top().continue_target); // Set up a block for dead code. createAndSetNoPredecessorBlock("post-loop-continue"); } void Builder::createLoopExit() { - createBranch(&loops.top().merge); + createBranch(false, &loops.top().merge); // Set up a block for dead code. createAndSetNoPredecessorBlock("post-loop-break"); } @@ -3594,7 +3906,7 @@ void Builder::accessChainStore(Id rvalue, Decoration nonUniform, spv::MemoryAcce // If a swizzle exists and is not full and is not dynamic, then the swizzle will be broken into individual stores. if (accessChain.swizzle.size() > 0 && - getNumTypeComponents(getResultingAccessChainType()) != (int)accessChain.swizzle.size() && + getNumTypeComponents(getResultingAccessChainType()) != accessChain.swizzle.size() && accessChain.component == NoResult) { for (unsigned int i = 0; i < accessChain.swizzle.size(); ++i) { accessChain.indexChain.push_back(makeUintConstant(accessChain.swizzle[i])); @@ -3914,7 +4226,7 @@ void Builder::simplifyAccessChainSwizzle() { // If the swizzle has fewer components than the vector, it is subsetting, and must stay // to preserve that fact. - if (getNumTypeComponents(accessChain.preSwizzleBaseType) > (int)accessChain.swizzle.size()) + if (getNumTypeComponents(accessChain.preSwizzleBaseType) > accessChain.swizzle.size()) return; // if components are out of order, it is a swizzle @@ -3977,41 +4289,52 @@ void Builder::createAndSetNoPredecessorBlock(const char* /*name*/) } // Comments in header -void Builder::createBranch(Block* block) +void Builder::createBranch(bool implicit, Block* block) { Instruction* branch = new Instruction(OpBranch); branch->addIdOperand(block->getId()); - buildPoint->addInstruction(std::unique_ptr(branch)); + if (implicit) { + addInstructionNoDebugInfo(std::unique_ptr(branch)); + } + else { + addInstruction(std::unique_ptr(branch)); + } block->addPredecessor(buildPoint); } void Builder::createSelectionMerge(Block* mergeBlock, unsigned int control) { Instruction* merge = new Instruction(OpSelectionMerge); + merge->reserveOperands(2); merge->addIdOperand(mergeBlock->getId()); merge->addImmediateOperand(control); - buildPoint->addInstruction(std::unique_ptr(merge)); + addInstruction(std::unique_ptr(merge)); } void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control, const std::vector& operands) { Instruction* merge = new Instruction(OpLoopMerge); + merge->reserveOperands(operands.size() + 3); merge->addIdOperand(mergeBlock->getId()); merge->addIdOperand(continueBlock->getId()); merge->addImmediateOperand(control); for (int op = 0; op < (int)operands.size(); ++op) merge->addImmediateOperand(operands[op]); - buildPoint->addInstruction(std::unique_ptr(merge)); + addInstruction(std::unique_ptr(merge)); } void Builder::createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock) { Instruction* branch = new Instruction(OpBranchConditional); + branch->reserveOperands(3); branch->addIdOperand(condition); branch->addIdOperand(thenBlock->getId()); branch->addIdOperand(elseBlock->getId()); - buildPoint->addInstruction(std::unique_ptr(branch)); + + // A conditional branch is always attached to a condition expression + addInstructionNoDebugInfo(std::unique_ptr(branch)); + thenBlock->addPredecessor(buildPoint); elseBlock->addPredecessor(buildPoint); } @@ -4029,6 +4352,7 @@ void Builder::dumpSourceInstructions(const spv::Id fileId, const std::string& te if (sourceLang != SourceLanguageUnknown) { // OpSource Language Version File Source Instruction sourceInst(NoResult, NoType, OpSource); + sourceInst.reserveOperands(3); sourceInst.addImmediateOperand(sourceLang); sourceInst.addImmediateOperand(sourceVersion); // File operand @@ -4063,16 +4387,15 @@ void Builder::dumpSourceInstructions(const spv::Id fileId, const std::string& te void Builder::dumpSourceInstructions(std::vector& out) const { if (emitNonSemanticShaderDebugInfo) return; - dumpSourceInstructions(sourceFileStringId, sourceText, out); + dumpSourceInstructions(mainFileId, sourceText, out); for (auto iItr = includeFiles.begin(); iItr != includeFiles.end(); ++iItr) dumpSourceInstructions(iItr->first, *iItr->second, out); } -void Builder::dumpInstructions(std::vector& out, - const std::vector >& instructions) const +template void Builder::dumpInstructions(std::vector& out, const Range& instructions) const { - for (int i = 0; i < (int)instructions.size(); ++i) { - instructions[i]->dump(out); + for (const auto& inst : instructions) { + inst->dump(out); } } @@ -4085,4 +4408,40 @@ void Builder::dumpModuleProcesses(std::vector& out) const } } +bool Builder::DecorationInstructionLessThan::operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const +{ + // Order by the id to which the decoration applies first. This is more intuitive. + assert(lhs->isIdOperand(0) && rhs->isIdOperand(0)); + if (lhs->getIdOperand(0) != rhs->getIdOperand(0)) { + return lhs->getIdOperand(0) < rhs->getIdOperand(0); + } + + if (lhs->getOpCode() != rhs->getOpCode()) + return lhs->getOpCode() < rhs->getOpCode(); + + // Now compare the operands. + int minSize = std::min(lhs->getNumOperands(), rhs->getNumOperands()); + for (int i = 1; i < minSize; ++i) { + if (lhs->isIdOperand(i) != rhs->isIdOperand(i)) { + return lhs->isIdOperand(i) < rhs->isIdOperand(i); + } + + if (lhs->isIdOperand(i)) { + if (lhs->getIdOperand(i) != rhs->getIdOperand(i)) { + return lhs->getIdOperand(i) < rhs->getIdOperand(i); + } + } else { + if (lhs->getImmediateOperand(i) != rhs->getImmediateOperand(i)) { + return lhs->getImmediateOperand(i) < rhs->getImmediateOperand(i); + } + } + } + + if (lhs->getNumOperands() != rhs->getNumOperands()) + return lhs->getNumOperands() < rhs->getNumOperands(); + + // In this case they are equal. + return false; +} } // end spv namespace diff --git a/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h b/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h index 79d2681f..4bae1d5c 100644 --- a/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h +++ b/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h @@ -48,6 +48,7 @@ #define SpvBuilder_H #include "Logger.h" +#define SPV_ENABLE_UTILITY_CODE #include "spirv.hpp" #include "spvIR.h" namespace spv { @@ -56,6 +57,7 @@ namespace spv { } #include +#include #include #include #include @@ -103,31 +105,53 @@ class Builder { stringIds[file_c_str] = strId; return strId; } - spv::Id getSourceFile() const + + spv::Id getMainFileId() const { return mainFileId; } + + // Initialize the main source file name + void setDebugMainSourceFile(const std::string& file) { - return sourceFileStringId; + if (trackDebugInfo) { + dirtyLineTracker = true; + mainFileId = getStringId(file); + currentFileId = mainFileId; + } } - void setSourceFile(const std::string& file) + + // Set the debug source location tracker in the builder. + // The upcoming instructions in basic blocks will be associated to this location. + void setDebugSourceLocation(int line, const char* filename) { - sourceFileStringId = getStringId(file); - currentFileId = sourceFileStringId; + if (trackDebugInfo) { + dirtyLineTracker = true; + if (line != 0) { + // TODO: This is special handling of some AST nodes having (untracked) line 0. + // But they should have a valid line number. + currentLine = line; + if (filename) { + currentFileId = getStringId(filename); + } + } + } } + void setSourceText(const std::string& text) { sourceText = text; } void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); } void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); } - void setEmitOpLines() { emitOpLines = true; } - void setEmitNonSemanticShaderDebugInfo(bool const emit) + void setEmitSpirvDebugInfo() { - emitNonSemanticShaderDebugInfo = emit; - - if(emit) - { - importNonSemanticShaderDebugInfoInstructions(); - } + trackDebugInfo = true; + emitSpirvDebugInfo = true; } - void setEmitNonSemanticShaderDebugSource(bool const src) + void setEmitNonSemanticShaderDebugInfo(bool emitSourceText) { - emitNonSemanticShaderDebugSource = src; + trackDebugInfo = true; + emitNonSemanticShaderDebugInfo = true; + importNonSemanticShaderDebugInfoInstructions(); + + if (emitSourceText) { + emitNonSemanticShaderDebugSource = emitSourceText; + } } void addExtension(const char* ext) { extensions.insert(ext); } void removeExtension(const char* ext) @@ -169,23 +193,9 @@ class Builder { return id; } - // Generate OpLine for non-filename-based #line directives (ie no filename - // seen yet): Log the current line, and if different than the last one, - // issue a new OpLine using the new line and current source file name. - void setLine(int line); - - // If filename null, generate OpLine for non-filename-based line directives, - // else do filename-based: Log the current line and file, and if different - // than the last one, issue a new OpLine using the new line and file - // name. - void setLine(int line, const char* filename); - // Low-level OpLine. See setLine() for a layered helper. - void addLine(Id fileName, int line, int column); - void addDebugScopeAndLine(Id fileName, int line, int column); - // For creating new types (will return old type if the requested one was already made). Id makeVoidType(); - Id makeBoolType(bool const compilerGenerated = true); + Id makeBoolType(); Id makePointer(StorageClass, Id pointee); Id makeForwardPointer(StorageClass); Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee); @@ -226,18 +236,26 @@ class Builder { Id makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc); Id makeCompositeDebugType(std::vector const& memberTypes, char const*const name, NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType = false); + Id makePointerDebugType(StorageClass storageClass, Id const baseType); + Id makeForwardPointerDebugType(StorageClass storageClass); Id makeDebugSource(const Id fileName); Id makeDebugCompilationUnit(); Id createDebugGlobalVariable(Id const type, char const*const name, Id const variable); Id createDebugLocalVariable(Id type, char const*const name, size_t const argNumber = 0); Id makeDebugExpression(); - Id makeDebugDeclare(Id const debugLocalVariable, Id const localVariable); + Id makeDebugDeclare(Id const debugLocalVariable, Id const pointer); Id makeDebugValue(Id const debugLocalVariable, Id const value); Id makeDebugFunctionType(Id returnType, const std::vector& paramTypes); Id makeDebugFunction(Function* function, Id nameId, Id funcTypeId); - Id makeDebugLexicalBlock(uint32_t line); + Id makeDebugLexicalBlock(uint32_t line, uint32_t column); std::string unmangleFunctionName(std::string const& name) const; + // Initialize non-semantic debug information for a function, including those of: + // - The function definition + // - The function parameters + void setupFunctionDebugInfo(Function* function, const char* name, const std::vector& paramTypes, + const std::vector& paramNames); + // accelerationStructureNV type Id makeAccelerationStructureType(); // rayQueryEXT type @@ -251,9 +269,9 @@ class Builder { Op getOpCode(Id id) const { return module.getInstruction(id)->getOpCode(); } Op getTypeClass(Id typeId) const { return getOpCode(typeId); } Op getMostBasicTypeClass(Id typeId) const; - int getNumComponents(Id resultId) const { return getNumTypeComponents(getTypeId(resultId)); } - int getNumTypeConstituents(Id typeId) const; - int getNumTypeComponents(Id typeId) const { return getNumTypeConstituents(typeId); } + unsigned int getNumComponents(Id resultId) const { return getNumTypeComponents(getTypeId(resultId)); } + unsigned int getNumTypeConstituents(Id typeId) const; + unsigned int getNumTypeComponents(Id typeId) const { return getNumTypeConstituents(typeId); } Id getScalarTypeId(Id typeId) const; Id getContainedTypeId(Id typeId) const; Id getContainedTypeId(Id typeId, int) const; @@ -314,8 +332,6 @@ class Builder { // See if a resultId is valid for use as an initializer. bool isValidInitializer(Id resultId) const { return isConstant(resultId) || isGlobalVariable(resultId); } - bool isRayTracingOpCode(Op opcode) const; - int getScalarTypeWidth(Id typeId) const { Id scalarTypeId = getScalarTypeId(typeId); @@ -323,18 +339,18 @@ class Builder { return module.getInstruction(scalarTypeId)->getImmediateOperand(0); } - int getTypeNumColumns(Id typeId) const + unsigned int getTypeNumColumns(Id typeId) const { assert(isMatrixType(typeId)); return getNumTypeConstituents(typeId); } - int getNumColumns(Id resultId) const { return getTypeNumColumns(getTypeId(resultId)); } - int getTypeNumRows(Id typeId) const + unsigned int getNumColumns(Id resultId) const { return getTypeNumColumns(getTypeId(resultId)); } + unsigned int getTypeNumRows(Id typeId) const { assert(isMatrixType(typeId)); return getNumTypeComponents(getContainedTypeId(typeId)); } - int getNumRows(Id resultId) const { return getTypeNumRows(getTypeId(resultId)); } + unsigned int getNumRows(Id resultId) const { return getTypeNumRows(getTypeId(resultId)); } Dim getTypeDimensionality(Id typeId) const { @@ -393,6 +409,7 @@ class Builder { void addDecoration(Id, Decoration, const char*); void addDecoration(Id, Decoration, const std::vector& literals); void addDecoration(Id, Decoration, const std::vector& strings); + void addLinkageDecoration(Id id, const char* name, spv::LinkageType linkType); void addDecorationId(Id id, Decoration, Id idDecoration); void addDecorationId(Id id, Decoration, const std::vector& operandIds); void addMemberDecoration(Id, unsigned int member, Decoration, int num = -1); @@ -404,11 +421,20 @@ class Builder { // Also reset current last DebugScope and current source line to unknown void setBuildPoint(Block* bp) { buildPoint = bp; - lastDebugScopeId = NoResult; - currentLine = 0; + dirtyLineTracker = true; + dirtyScopeTracker = true; } Block* getBuildPoint() const { return buildPoint; } + // Append an instruction to the end of the current build point. + // Optionally, additional debug info instructions may also be prepended. + void addInstruction(std::unique_ptr inst); + + // Append an instruction to the end of the current build point without prepending any debug instructions. + // This is useful for insertion of some debug info instructions themselves or some control flow instructions + // that are attached to its predecessor instruction. + void addInstructionNoDebugInfo(std::unique_ptr inst); + // Make the entry-point function. The returned pointer is only valid // for the lifetime of this builder. Function* makeEntryPoint(const char*); @@ -416,19 +442,19 @@ class Builder { // Make a shader-style function, and create its entry block if entry is non-zero. // Return the function, pass back the entry. // The returned pointer is only valid for the lifetime of this builder. - Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, - const std::vector& paramTypes, const std::vector& paramNames, - const std::vector>& precisions, Block **entry = nullptr); + Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, LinkageType linkType, + const std::vector& paramTypes, + const std::vector>& precisions, Block** entry = nullptr); // Create a return. An 'implicit' return is one not appearing in the source // code. In the case of an implicit return, no post-return block is inserted. void makeReturn(bool implicit, Id retVal = 0); // Initialize state and generate instructions for new lexical scope - void enterScope(uint32_t line); + void enterLexicalBlock(uint32_t line, uint32_t column); // Set state and generate instructions to exit current lexical scope - void leaveScope(); + void leaveLexicalBlock(); // Prepare builder for generation of instructions for a function. void enterFunction(Function const* function); @@ -622,7 +648,7 @@ class Builder { const std::vector& valueToSegment, int defaultSegment, std::vector& segmentBB); // Add a branch to the innermost switch's merge block. - void addSwitchBreak(); + void addSwitchBreak(bool implicit); // Move to the next code segment, passing in the return argument in makeSwitch() void nextSwitchSegment(std::vector& segmentBB, int segment); @@ -828,7 +854,7 @@ class Builder { // Add capabilities, extensions, remove unneeded decorations, etc., // based on the resulting SPIR-V. - void postProcess(); + void postProcess(bool compileOnly); // Prune unreachable blocks in the CFG and remove unneeded decorations. void postProcessCFG(); @@ -839,10 +865,14 @@ class Builder { void postProcess(Instruction&); // Hook to visit each non-32-bit sized float/int operation in a block. void postProcessType(const Instruction&, spv::Id typeId); + // move OpSampledImage instructions to be next to their users. + void postProcessSamplers(); void dump(std::vector&) const; - void createBranch(Block* block); + // Add a branch to the target block. + // If set implicit, the branch instruction shouldn't have debug source location. + void createBranch(bool implicit, Block* block); void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control, const std::vector& operands); @@ -854,6 +884,8 @@ class Builder { // Check if the builder is generating code for spec constants. bool isInSpecConstCodeGenMode() { return generatingOpCodeForSpecConst; } + void setUseReplicatedComposites(bool use) { useReplicatedComposites = use; } + protected: Id makeIntConstant(Id typeId, unsigned value, bool specConstant); Id makeInt64Constant(Id typeId, unsigned long long value, bool specConstant); @@ -869,29 +901,48 @@ class Builder { void createSelectionMerge(Block* mergeBlock, unsigned int control); void dumpSourceInstructions(std::vector&) const; void dumpSourceInstructions(const spv::Id fileId, const std::string& text, std::vector&) const; - void dumpInstructions(std::vector&, const std::vector >&) const; + template void dumpInstructions(std::vector& out, const Range& instructions) const; void dumpModuleProcesses(std::vector&) const; spv::MemoryAccessMask sanitizeMemoryAccessForStorageClass(spv::MemoryAccessMask memoryAccess, StorageClass sc) const; + struct DecorationInstructionLessThan { + bool operator()(const std::unique_ptr& lhs, const std::unique_ptr& rhs) const; + }; unsigned int spvVersion; // the version of SPIR-V to emit in the header SourceLanguage sourceLang; int sourceVersion; - spv::Id sourceFileStringId; spv::Id nonSemanticShaderCompilationUnitId {0}; spv::Id nonSemanticShaderDebugInfo {0}; spv::Id debugInfoNone {0}; spv::Id debugExpression {0}; // Debug expression with zero operations. std::string sourceText; - int currentLine; - const char* currentFile; - spv::Id currentFileId; + + // True if an new OpLine/OpDebugLine may need to be inserted. Either: + // 1. The current debug location changed + // 2. The current build point changed + bool dirtyLineTracker; + int currentLine = 0; + // OpString id of the current file name. Always 0 if debug info is off. + spv::Id currentFileId = 0; + // OpString id of the main file name. Always 0 if debug info is off. + spv::Id mainFileId = 0; + + // True if an new OpDebugScope may need to be inserted. Either: + // 1. A new lexical block is pushed + // 2. The current build point changed + bool dirtyScopeTracker; std::stack currentDebugScopeId; - spv::Id lastDebugScopeId; - bool emitOpLines; - bool emitNonSemanticShaderDebugInfo; - bool restoreNonSemanticShaderDebugInfo; - bool emitNonSemanticShaderDebugSource; + + // This flag toggles tracking of debug info while building the SPIR-V. + bool trackDebugInfo = false; + // This flag toggles emission of SPIR-V debug instructions, like OpLine and OpSource. + bool emitSpirvDebugInfo = false; + // This flag toggles emission of Non-Semantic Debug extension debug instructions. + bool emitNonSemanticShaderDebugInfo = false; + bool restoreNonSemanticShaderDebugInfo = false; + bool emitNonSemanticShaderDebugSource = false; + std::set extensions; std::vector sourceExtensions; std::vector moduleProcesses; @@ -904,6 +955,7 @@ class Builder { Id uniqueId; Function* entryPointFunction; bool generatingOpCodeForSpecConst; + bool useReplicatedComposites { false }; AccessChain accessChain; // special blocks of instructions for output @@ -912,7 +964,7 @@ class Builder { std::vector > entryPoints; std::vector > executionModes; std::vector > names; - std::vector > decorations; + std::set, DecorationInstructionLessThan> decorations; std::vector > constantsTypesGlobals; std::vector > externals; std::vector > functions; @@ -952,6 +1004,6 @@ class Builder { SpvBuildLogger* logger; }; // end Builder class -}; // end spv namespace +} // end spv namespace #endif // SpvBuilder_H diff --git a/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp b/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp index 50fb793b..4cd01102 100644 --- a/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp +++ b/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp @@ -181,6 +181,7 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) else if (width == 8) addCapability(CapabilityInt8); } + break; default: if (basicTypeOp == OpTypeInt) { if (width == 16) @@ -386,12 +387,14 @@ void Builder::postProcessCFG() } // Remove unneeded decorations, for unreachable instructions - decorations.erase(std::remove_if(decorations.begin(), decorations.end(), - [&unreachableDefinitions](std::unique_ptr& I) -> bool { - Id decoration_id = I.get()->getIdOperand(0); - return unreachableDefinitions.count(decoration_id) != 0; - }), - decorations.end()); + for (auto decorationIter = decorations.begin(); decorationIter != decorations.end();) { + Id decorationId = (*decorationIter)->getIdOperand(0); + if (unreachableDefinitions.count(decorationId) != 0) { + decorationIter = decorations.erase(decorationIter); + } else { + ++decorationIter; + } + } } // comment in header @@ -482,10 +485,67 @@ void Builder::postProcessFeatures() { } } +// SPIR-V requires that any instruction consuming the result of an OpSampledImage +// be in the same block as the OpSampledImage instruction. This pass goes finds +// uses of OpSampledImage where that is not the case and duplicates the +// OpSampledImage to be immediately before the instruction that consumes it. +// The old OpSampledImage is left in place, potentially with no users. +void Builder::postProcessSamplers() +{ + // first, find all OpSampledImage instructions and store them in a map. + std::map sampledImageInstrs; + for (auto f: module.getFunctions()) { + for (auto b: f->getBlocks()) { + for (auto &i: b->getInstructions()) { + if (i->getOpCode() == spv::OpSampledImage) { + sampledImageInstrs[i->getResultId()] = i.get(); + } + } + } + } + // next find all uses of the given ids and rewrite them if needed. + for (auto f: module.getFunctions()) { + for (auto b: f->getBlocks()) { + auto &instrs = b->getInstructions(); + for (size_t idx = 0; idx < instrs.size(); idx++) { + Instruction *i = instrs[idx].get(); + for (int opnum = 0; opnum < i->getNumOperands(); opnum++) { + // Is this operand of the current instruction the result of an OpSampledImage? + if (i->isIdOperand(opnum) && + sampledImageInstrs.count(i->getIdOperand(opnum))) + { + Instruction *opSampImg = sampledImageInstrs[i->getIdOperand(opnum)]; + if (i->getBlock() != opSampImg->getBlock()) { + Instruction *newInstr = new Instruction(getUniqueId(), + opSampImg->getTypeId(), + spv::OpSampledImage); + newInstr->addIdOperand(opSampImg->getIdOperand(0)); + newInstr->addIdOperand(opSampImg->getIdOperand(1)); + newInstr->setBlock(b); + + // rewrite the user of the OpSampledImage to use the new instruction. + i->setIdOperand(opnum, newInstr->getResultId()); + // insert the new OpSampledImage right before the current instruction. + instrs.insert(instrs.begin() + idx, + std::unique_ptr(newInstr)); + idx++; + } + } + } + } + } + } +} + // comment in header -void Builder::postProcess() { - postProcessCFG(); - postProcessFeatures(); +void Builder::postProcess(bool compileOnly) +{ + // postProcessCFG needs an entrypoint to determine what is reachable, but if we are not creating an "executable" shader, we don't have an entrypoint + if (!compileOnly) + postProcessCFG(); + + postProcessFeatures(); + postProcessSamplers(); } -}; // end spv namespace +} // end spv namespace diff --git a/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp b/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp index ff04f4f9..8cd03ef5 100644 --- a/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp +++ b/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp @@ -44,6 +44,7 @@ #include "SpvTools.h" #include "spirv-tools/optimizer.hpp" +#include "glslang/MachineIndependent/localintermediate.h" namespace glslang { @@ -81,6 +82,11 @@ spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLog return spv_target_env::SPV_ENV_UNIVERSAL_1_0; } +spv_target_env MapToSpirvToolsEnv(const glslang::TIntermediate& intermediate, spv::SpvBuildLogger* logger) +{ + return MapToSpirvToolsEnv(intermediate.getSpv(), logger); +} + // Callback passed to spvtools::Optimizer::SetMessageConsumer void OptimizerMesssageConsumer(spv_message_level_t level, const char *source, const spv_position_t &position, const char *message) @@ -218,9 +224,20 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector optimizer.RegisterPass(spvtools::CreateCFGCleanupPass()); spvtools::OptimizerOptions spvOptOptions; + if (options->optimizerAllowExpandedIDBound) + spvOptOptions.set_max_id_bound(0x3FFFFFFF); optimizer.SetTargetEnv(MapToSpirvToolsEnv(intermediate.getSpv(), logger)); spvOptOptions.set_run_validator(false); // The validator may run as a separate step later on optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); + + if (options->optimizerAllowExpandedIDBound) { + if (spirv.size() > 3 && spirv[3] > kDefaultMaxIdBound) { + spvtools::Optimizer optimizer2(target_env); + optimizer2.SetMessageConsumer(OptimizerMesssageConsumer); + optimizer2.RegisterPass(spvtools::CreateCompactIdsPass()); + optimizer2.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); + } + } } bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector& spirv, @@ -292,6 +309,6 @@ void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate, optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); } -}; // end namespace glslang +} // end namespace glslang #endif diff --git a/bgfx/3rdparty/glslang/SPIRV/SpvTools.h b/bgfx/3rdparty/glslang/SPIRV/SpvTools.h index 6fc4e40b..45585723 100644 --- a/bgfx/3rdparty/glslang/SPIRV/SpvTools.h +++ b/bgfx/3rdparty/glslang/SPIRV/SpvTools.h @@ -44,66 +44,63 @@ #if ENABLE_OPT #include #include +#include #include "spirv-tools/libspirv.h" #endif -#include "glslang/MachineIndependent/localintermediate.h" +#include "glslang/MachineIndependent/Versions.h" +#include "glslang/Include/visibility.h" +#include "GlslangToSpv.h" #include "Logger.h" namespace glslang { -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 }; -}; - #if ENABLE_OPT +class TIntermediate; + // Translate glslang's view of target versioning to what SPIRV-Tools uses. -spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger); +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. -void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv); +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. -void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv, - spv_target_env requested_context); +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. -void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector& spirv, - spv::SpvBuildLogger*, bool prelegalization); +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. -void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector& spirv, - spv::SpvBuildLogger*, const SpvOptions*); +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|. -void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector& spirv, - spv::SpvBuildLogger*); +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. -bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector& spirv, - std::unordered_set* live_locs, - std::unordered_set* live_builtins, spv::SpvBuildLogger*); +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|. -void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector& spirv, - std::unordered_set* live_locs, - std::unordered_set* live_builtins, spv::SpvBuildLogger*); +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. -void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate, - std::vector& spirv, spv::SpvBuildLogger*); +GLSLANG_EXPORT void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate, + std::vector& spirv, spv::SpvBuildLogger*); #endif diff --git a/bgfx/3rdparty/glslang/SPIRV/disassemble.cpp b/bgfx/3rdparty/glslang/SPIRV/disassemble.cpp index c5e961cf..be364b33 100644 --- a/bgfx/3rdparty/glslang/SPIRV/disassemble.cpp +++ b/bgfx/3rdparty/glslang/SPIRV/disassemble.cpp @@ -80,6 +80,7 @@ enum ExtInstSet { GLSLextNVInst, OpenCLExtInst, NonSemanticDebugPrintfExtInst, + NonSemanticDebugBreakExtInst, NonSemanticShaderDebugInfo100 }; @@ -360,7 +361,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, switch (stream[word]) { case 8: idDescriptor[resultId] = "int8_t"; break; case 16: idDescriptor[resultId] = "int16_t"; break; - default: assert(0); // fallthrough + default: assert(0); [[fallthrough]]; case 32: idDescriptor[resultId] = "int"; break; case 64: idDescriptor[resultId] = "int64_t"; break; } @@ -368,7 +369,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, case OpTypeFloat: switch (stream[word]) { case 16: idDescriptor[resultId] = "float16_t"; break; - default: assert(0); // fallthrough + default: assert(0); [[fallthrough]]; case 32: idDescriptor[resultId] = "float"; break; case 64: idDescriptor[resultId] = "float64_t"; break; } @@ -506,6 +507,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, extInstSet = OpenCLExtInst; } else if (strcmp("NonSemantic.DebugPrintf", name) == 0) { extInstSet = NonSemanticDebugPrintfExtInst; + } else if (strcmp("NonSemantic.DebugBreak", name) == 0) { + extInstSet = NonSemanticDebugBreakExtInst; } else if (strcmp("NonSemantic.Shader.DebugInfo.100", name) == 0) { extInstSet = NonSemanticShaderDebugInfo100; } else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 || @@ -533,6 +536,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")"; } else if (extInstSet == NonSemanticDebugPrintfExtInst) { out << "(DebugPrintf)"; + } else if (extInstSet == NonSemanticDebugBreakExtInst) { + out << "(DebugBreak)"; } else if (extInstSet == NonSemanticShaderDebugInfo100) { out << "(" << NonSemanticShaderDebugInfo100GetDebugNames(entrypoint) << ")"; } @@ -820,4 +825,4 @@ void Disassemble(std::ostream& out, const std::vector& stream) SpirvStream.processInstructions(); } -}; // end namespace spv +} // end namespace spv diff --git a/bgfx/3rdparty/glslang/SPIRV/disassemble.h b/bgfx/3rdparty/glslang/SPIRV/disassemble.h index b6a46357..3bded14f 100644 --- a/bgfx/3rdparty/glslang/SPIRV/disassemble.h +++ b/bgfx/3rdparty/glslang/SPIRV/disassemble.h @@ -43,10 +43,12 @@ #include #include +#include "glslang/Include/visibility.h" + namespace spv { // disassemble with glslang custom disassembler - void Disassemble(std::ostream& out, const std::vector&); + GLSLANG_EXPORT void Disassemble(std::ostream& out, const std::vector&); } // end namespace spv diff --git a/bgfx/3rdparty/glslang/SPIRV/doc.cpp b/bgfx/3rdparty/glslang/SPIRV/doc.cpp old mode 100755 new mode 100644 index 417e6e08..2051486b --- a/bgfx/3rdparty/glslang/SPIRV/doc.cpp +++ b/bgfx/3rdparty/glslang/SPIRV/doc.cpp @@ -1,5 +1,6 @@ // // Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2022-2024 Arm Limited. // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. @@ -198,6 +199,7 @@ const char* ExecutionModeString(int mode) case ExecutionModeStencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD"; case ExecutionModeStencilRefReplacingEXT: return "StencilRefReplacingEXT"; case ExecutionModeSubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlow"; + case ExecutionModeMaximallyReconvergesKHR: return "MaximallyReconverges"; case ExecutionModeOutputLinesNV: return "OutputLinesNV"; case ExecutionModeOutputPrimitivesNV: return "OutputPrimitivesNV"; @@ -217,6 +219,9 @@ const char* ExecutionModeString(int mode) case ExecutionModeNoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; case ExecutionModeNumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + case ExecutionModeRequireFullQuadsKHR: return "RequireFullQuadsKHR"; + case ExecutionModeQuadDerivativesKHR: return "QuadDerivativesKHR"; + case ExecutionModeNonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; case ExecutionModeNonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; case ExecutionModeNonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; @@ -314,6 +319,7 @@ const char* DecorationString(int decoration) case DecorationWeightTextureQCOM: return "DecorationWeightTextureQCOM"; case DecorationBlockMatchTextureQCOM: return "DecorationBlockMatchTextureQCOM"; + case DecorationBlockMatchSamplerQCOM: return "DecorationBlockMatchSamplerQCOM"; case DecorationExplicitInterpAMD: return "ExplicitInterpAMD"; case DecorationOverrideCoverageNV: return "OverrideCoverageNV"; case DecorationPassthroughNV: return "PassthroughNV"; @@ -414,6 +420,10 @@ const char* BuiltInString(int builtIn) case BuiltInRayTmaxKHR: return "RayTmaxKHR"; case BuiltInCullMaskKHR: return "CullMaskKHR"; case BuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case BuiltInHitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case BuiltInHitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case BuiltInHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case BuiltInHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR"; case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR"; @@ -798,11 +808,11 @@ const int CooperativeMatrixOperandsCeiling = 6; const char* CooperativeMatrixOperandsString(int op) { switch (op) { - case CooperativeMatrixOperandsMatrixASignedComponentsShift: return "ASignedComponents"; - case CooperativeMatrixOperandsMatrixBSignedComponentsShift: return "BSignedComponents"; - case CooperativeMatrixOperandsMatrixCSignedComponentsShift: return "CSignedComponents"; - case CooperativeMatrixOperandsMatrixResultSignedComponentsShift: return "ResultSignedComponents"; - case CooperativeMatrixOperandsSaturatingAccumulationShift: return "SaturatingAccumulation"; + case CooperativeMatrixOperandsMatrixASignedComponentsKHRShift: return "ASignedComponentsKHR"; + case CooperativeMatrixOperandsMatrixBSignedComponentsKHRShift: return "BSignedComponentsKHR"; + case CooperativeMatrixOperandsMatrixCSignedComponentsKHRShift: return "CSignedComponentsKHR"; + case CooperativeMatrixOperandsMatrixResultSignedComponentsKHRShift: return "ResultSignedComponentsKHR"; + case CooperativeMatrixOperandsSaturatingAccumulationKHRShift: return "SaturatingAccumulationKHR"; default: return "Bad"; } @@ -934,6 +944,7 @@ const char* CapabilityString(int info) case CapabilitySubgroupBallotKHR: return "SubgroupBallotKHR"; case CapabilityDrawParameters: return "DrawParameters"; case CapabilitySubgroupVoteKHR: return "SubgroupVoteKHR"; + case CapabilityGroupNonUniformRotateKHR: return "CapabilityGroupNonUniformRotateKHR"; case CapabilityStorageUniformBufferBlock16: return "StorageUniformBufferBlock16"; case CapabilityStorageUniform16: return "StorageUniform16"; @@ -977,6 +988,8 @@ const char* CapabilityString(int info) case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; case CapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; case CapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case CapabilityDisplacementMicromapNV: return "DisplacementMicromapNV"; + case CapabilityRayTracingDisplacementMicromapNV: return "CapabilityRayTracingDisplacementMicromapNV"; case CapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; case CapabilityComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV"; case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV"; @@ -1022,14 +1035,20 @@ const char* CapabilityString(int info) case CapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; case CapabilityTileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case CapabilityCooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case CapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR"; case CapabilityDemoteToHelperInvocationEXT: return "DemoteToHelperInvocationEXT"; + case CapabilityAtomicFloat16VectorNV: return "AtomicFloat16VectorNV"; case CapabilityShaderClockKHR: return "ShaderClockKHR"; + case CapabilityQuadControlKHR: return "QuadControlKHR"; case CapabilityInt64ImageEXT: return "Int64ImageEXT"; case CapabilityIntegerFunctions2INTEL: return "CapabilityIntegerFunctions2INTEL"; + case CapabilityExpectAssumeKHR: return "ExpectAssumeKHR"; + case CapabilityAtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; case CapabilityAtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; case CapabilityAtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; @@ -1047,6 +1066,9 @@ const char* CapabilityString(int info) case CapabilityTextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; case CapabilityTextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; case CapabilityTextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case CapabilityTextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; + + case CapabilityReplicatedCompositesEXT: return "CapabilityReplicatedCompositesEXT"; default: return "Bad"; } @@ -1425,11 +1447,18 @@ const char* OpcodeString(int op) case 4429: return "OpSubgroupAnyKHR"; case 4430: return "OpSubgroupAllEqualKHR"; case 4432: return "OpSubgroupReadInvocationKHR"; + case 4433: return "OpExtInstWithForwardRefsKHR"; + + case OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; + case OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; case OpAtomicFAddEXT: return "OpAtomicFAddEXT"; case OpAtomicFMinEXT: return "OpAtomicFMinEXT"; case OpAtomicFMaxEXT: return "OpAtomicFMaxEXT"; + case OpAssumeTrueKHR: return "OpAssumeTrueKHR"; + case OpExpectKHR: return "OpExpectKHR"; + case 5000: return "OpGroupIAddNonUniformAMD"; case 5001: return "OpGroupFAddNonUniformAMD"; case 5002: return "OpGroupFMinNonUniformAMD"; @@ -1466,6 +1495,8 @@ const char* OpcodeString(int op) case OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT"; case OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT"; + case OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; + case OpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; case OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; case OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; @@ -1542,6 +1573,9 @@ const char* OpcodeString(int op) case OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; case OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + case OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; case OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; case OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; @@ -1550,6 +1584,14 @@ const char* OpcodeString(int op) case OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; case OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; case OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + case OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; + case OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; + case OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; + case OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + + case OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; default: return "Bad"; @@ -1669,7 +1711,7 @@ void Parameterize() InstructionDesc[OpCooperativeMatrixStoreKHR].setResultAndType(false, false); InstructionDesc[OpBeginInvocationInterlockEXT].setResultAndType(false, false); InstructionDesc[OpEndInvocationInterlockEXT].setResultAndType(false, false); - + InstructionDesc[OpAssumeTrueKHR].setResultAndType(false, false); // Specific additional context-dependent operands ExecutionModeOperands[ExecutionModeInvocations].push(OperandLiteralNumber, "'Number of <>'"); @@ -1857,6 +1899,10 @@ void Parameterize() InstructionDesc[OpExtInst].operands.push(OperandLiteralNumber, "'Instruction'"); InstructionDesc[OpExtInst].operands.push(OperandVariableIds, "'Operand 1', +\n'Operand 2', +\n..."); + InstructionDesc[OpExtInstWithForwardRefsKHR].operands.push(OperandId, "'Set'"); + InstructionDesc[OpExtInstWithForwardRefsKHR].operands.push(OperandLiteralNumber, "'Instruction'"); + InstructionDesc[OpExtInstWithForwardRefsKHR].operands.push(OperandVariableIds, "'Operand 1', +\n'Operand 2', +\n..."); + InstructionDesc[OpLoad].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpLoad].operands.push(OperandMemoryAccess, "", true); InstructionDesc[OpLoad].operands.push(OperandLiteralNumber, "", true); @@ -2448,6 +2494,11 @@ void Parameterize() InstructionDesc[OpAtomicFAddEXT].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicFAddEXT].operands.push(OperandId, "'Value'"); + InstructionDesc[OpAssumeTrueKHR].operands.push(OperandId, "'Condition'"); + + InstructionDesc[OpExpectKHR].operands.push(OperandId, "'Value'"); + InstructionDesc[OpExpectKHR].operands.push(OperandId, "'ExpectedValue'"); + InstructionDesc[OpAtomicISub].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicISub].operands.push(OperandScope, "'Scope'"); InstructionDesc[OpAtomicISub].operands.push(OperandMemorySemantics, "'Semantics'"); @@ -2876,6 +2927,11 @@ void Parameterize() InstructionDesc[OpSubgroupAllEqualKHR].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpSubgroupAllEqualKHR].operands.push(OperandId, "'Predicate'"); + InstructionDesc[OpGroupNonUniformRotateKHR].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformRotateKHR].operands.push(OperandId, "'X'"); + InstructionDesc[OpGroupNonUniformRotateKHR].operands.push(OperandId, "'Delta'"); + InstructionDesc[OpGroupNonUniformRotateKHR].operands.push(OperandId, "'ClusterSize'", true); + InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Value'"); InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Index'"); @@ -2922,6 +2978,8 @@ void Parameterize() InstructionDesc[OpGroupNonUniformPartitionNV].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformQuadAllKHR].operands.push(OperandId, "'Predicate'"); + InstructionDesc[OpGroupNonUniformQuadAnyKHR].operands.push(OperandId, "'Predicate'"); InstructionDesc[OpTypeAccelerationStructureKHR].setResultAndType(true, false); InstructionDesc[OpTraceNV].operands.push(OperandId, "'Acceleration Structure'"); @@ -3082,7 +3140,7 @@ void Parameterize() InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'RayQuery'"); InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'Committed'"); - InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].setResultAndType(true, true); + InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].setResultAndType(true, true); InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Coordinate'"); @@ -3348,6 +3406,20 @@ void Parameterize() InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Payload'"); InstructionDesc[OpHitObjectTraceRayMotionNV].setResultAndType(false, false); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Instance ID'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Geometry Index'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Primitive Index'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Barycentrics'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].setResultAndType(true, true); + + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Instance ID'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Geometry Index'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Primitive Index'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Barycentrics'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].setResultAndType(true, true); + InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Attachment'"); InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Sample'", true); InstructionDesc[OpStencilAttachmentReadEXT].operands.push(OperandId, "'Sample'", true); @@ -3380,7 +3452,43 @@ void Parameterize() InstructionDesc[OpImageBlockMatchSSDQCOM].operands.push(OperandId, "'block size'"); InstructionDesc[OpImageBlockMatchSSDQCOM].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageBlockMatchSSDQCOM].setResultAndType(true, true); + + InstructionDesc[OpImageBlockMatchWindowSSDQCOM].operands.push(OperandId, "'target texture'"); + InstructionDesc[OpImageBlockMatchWindowSSDQCOM].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[OpImageBlockMatchWindowSSDQCOM].operands.push(OperandId, "'reference texture'"); + InstructionDesc[OpImageBlockMatchWindowSSDQCOM].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[OpImageBlockMatchWindowSSDQCOM].operands.push(OperandId, "'block size'"); + InstructionDesc[OpImageBlockMatchWindowSSDQCOM].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageBlockMatchWindowSSDQCOM].setResultAndType(true, true); + + InstructionDesc[OpImageBlockMatchWindowSADQCOM].operands.push(OperandId, "'target texture'"); + InstructionDesc[OpImageBlockMatchWindowSADQCOM].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[OpImageBlockMatchWindowSADQCOM].operands.push(OperandId, "'reference texture'"); + InstructionDesc[OpImageBlockMatchWindowSADQCOM].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[OpImageBlockMatchWindowSADQCOM].operands.push(OperandId, "'block size'"); + InstructionDesc[OpImageBlockMatchWindowSADQCOM].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageBlockMatchWindowSADQCOM].setResultAndType(true, true); + + InstructionDesc[OpImageBlockMatchGatherSSDQCOM].operands.push(OperandId, "'target texture'"); + InstructionDesc[OpImageBlockMatchGatherSSDQCOM].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[OpImageBlockMatchGatherSSDQCOM].operands.push(OperandId, "'reference texture'"); + InstructionDesc[OpImageBlockMatchGatherSSDQCOM].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[OpImageBlockMatchGatherSSDQCOM].operands.push(OperandId, "'block size'"); + InstructionDesc[OpImageBlockMatchGatherSSDQCOM].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageBlockMatchGatherSSDQCOM].setResultAndType(true, true); + + InstructionDesc[OpImageBlockMatchGatherSADQCOM].operands.push(OperandId, "'target texture'"); + InstructionDesc[OpImageBlockMatchGatherSADQCOM].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[OpImageBlockMatchGatherSADQCOM].operands.push(OperandId, "'reference texture'"); + InstructionDesc[OpImageBlockMatchGatherSADQCOM].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[OpImageBlockMatchGatherSADQCOM].operands.push(OperandId, "'block size'"); + InstructionDesc[OpImageBlockMatchGatherSADQCOM].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageBlockMatchGatherSADQCOM].setResultAndType(true, true); + + InstructionDesc[OpConstantCompositeReplicateEXT].operands.push(OperandId, "'Value'"); + InstructionDesc[OpSpecConstantCompositeReplicateEXT].operands.push(OperandId, "'Value'"); + InstructionDesc[OpCompositeConstructReplicateEXT].operands.push(OperandId, "'Value'"); }); } -}; // end spv namespace +} // end spv namespace diff --git a/bgfx/3rdparty/glslang/SPIRV/doc.h b/bgfx/3rdparty/glslang/SPIRV/doc.h index b60ad340..52152991 100644 --- a/bgfx/3rdparty/glslang/SPIRV/doc.h +++ b/bgfx/3rdparty/glslang/SPIRV/doc.h @@ -240,8 +240,8 @@ class InstructionParameters { OperandParameters operands; protected: - int typePresent : 1; - int resultPresent : 1; + bool typePresent : 1; + bool resultPresent : 1; }; // The set of objects that hold all the instruction/operand diff --git a/bgfx/3rdparty/glslang/SPIRV/spirv.hpp b/bgfx/3rdparty/glslang/SPIRV/spirv.hpp index bdc96fa3..157fee19 100644 --- a/bgfx/3rdparty/glslang/SPIRV/spirv.hpp +++ b/bgfx/3rdparty/glslang/SPIRV/spirv.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2020 The Khronos Group Inc. +// 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"), @@ -174,6 +174,8 @@ enum ExecutionMode { ExecutionModeStencilRefUnchangedBackAMD = 5082, ExecutionModeStencilRefGreaterBackAMD = 5083, ExecutionModeStencilRefLessBackAMD = 5084, + ExecutionModeQuadDerivativesKHR = 5088, + ExecutionModeRequireFullQuadsKHR = 5089, ExecutionModeOutputLinesEXT = 5269, ExecutionModeOutputLinesNV = 5269, ExecutionModeOutputPrimitivesEXT = 5270, @@ -198,6 +200,7 @@ enum ExecutionMode { ExecutionModeNoGlobalOffsetINTEL = 5895, ExecutionModeNumSIMDWorkitemsINTEL = 5896, ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903, + ExecutionModeMaximallyReconvergesKHR = 6023, ExecutionModeStreamingInterfaceINTEL = 6154, ExecutionModeNamedBarrierCountINTEL = 6417, ExecutionModeMax = 0x7fffffff, @@ -382,7 +385,7 @@ enum ImageOperandsShift { ImageOperandsMax = 0x7fffffff, }; -enum ImageOperandsMask { +enum ImageOperandsMask : unsigned { ImageOperandsMaskNone = 0, ImageOperandsBiasMask = 0x00000001, ImageOperandsLodMask = 0x00000002, @@ -417,7 +420,7 @@ enum FPFastMathModeShift { FPFastMathModeMax = 0x7fffffff, }; -enum FPFastMathModeMask { +enum FPFastMathModeMask : unsigned { FPFastMathModeMaskNone = 0, FPFastMathModeNotNaNMask = 0x00000001, FPFastMathModeNotInfMask = 0x00000002, @@ -515,6 +518,7 @@ enum Decoration { DecorationNoUnsignedWrap = 4470, DecorationWeightTextureQCOM = 4487, DecorationBlockMatchTextureQCOM = 4488, + DecorationBlockMatchSamplerQCOM = 4499, DecorationExplicitInterpAMD = 4999, DecorationOverrideCoverageNV = 5248, DecorationPassthroughNV = 5250, @@ -720,6 +724,8 @@ enum BuiltIn { BuiltInHitKindNV = 5333, BuiltInCurrentRayTimeNV = 5334, BuiltInHitTriangleVertexPositionsKHR = 5335, + BuiltInHitMicroTriangleVertexPositionsNV = 5337, + BuiltInHitMicroTriangleVertexBarycentricsNV = 5344, BuiltInIncomingRayFlagsKHR = 5351, BuiltInIncomingRayFlagsNV = 5351, BuiltInRayGeometryIndexKHR = 5352, @@ -727,6 +733,8 @@ enum BuiltIn { BuiltInSMCountNV = 5375, BuiltInWarpIDNV = 5376, BuiltInSMIDNV = 5377, + BuiltInHitKindFrontFacingMicroTriangleNV = 5405, + BuiltInHitKindBackFacingMicroTriangleNV = 5406, BuiltInCullMaskKHR = 6021, BuiltInMax = 0x7fffffff, }; @@ -737,7 +745,7 @@ enum SelectionControlShift { SelectionControlMax = 0x7fffffff, }; -enum SelectionControlMask { +enum SelectionControlMask : unsigned { SelectionControlMaskNone = 0, SelectionControlFlattenMask = 0x00000001, SelectionControlDontFlattenMask = 0x00000002, @@ -766,7 +774,7 @@ enum LoopControlShift { LoopControlMax = 0x7fffffff, }; -enum LoopControlMask { +enum LoopControlMask : unsigned { LoopControlMaskNone = 0, LoopControlUnrollMask = 0x00000001, LoopControlDontUnrollMask = 0x00000002, @@ -798,7 +806,7 @@ enum FunctionControlShift { FunctionControlMax = 0x7fffffff, }; -enum FunctionControlMask { +enum FunctionControlMask : unsigned { FunctionControlMaskNone = 0, FunctionControlInlineMask = 0x00000001, FunctionControlDontInlineMask = 0x00000002, @@ -828,7 +836,7 @@ enum MemorySemanticsShift { MemorySemanticsMax = 0x7fffffff, }; -enum MemorySemanticsMask { +enum MemorySemanticsMask : unsigned { MemorySemanticsMaskNone = 0, MemorySemanticsAcquireMask = 0x00000002, MemorySemanticsReleaseMask = 0x00000004, @@ -864,7 +872,7 @@ enum MemoryAccessShift { MemoryAccessMax = 0x7fffffff, }; -enum MemoryAccessMask { +enum MemoryAccessMask : unsigned { MemoryAccessMaskNone = 0, MemoryAccessVolatileMask = 0x00000001, MemoryAccessAlignedMask = 0x00000002, @@ -914,7 +922,7 @@ enum KernelProfilingInfoShift { KernelProfilingInfoMax = 0x7fffffff, }; -enum KernelProfilingInfoMask { +enum KernelProfilingInfoMask : unsigned { KernelProfilingInfoMaskNone = 0, KernelProfilingInfoCmdExecTimeMask = 0x00000001, }; @@ -994,6 +1002,7 @@ enum Capability { CapabilityTileImageColorReadAccessEXT = 4166, CapabilityTileImageDepthReadAccessEXT = 4167, CapabilityTileImageStencilReadAccessEXT = 4168, + CapabilityCooperativeMatrixLayoutsARM = 4201, CapabilityFragmentShadingRateKHR = 4422, CapabilitySubgroupBallotKHR = 4423, CapabilityDrawParameters = 4427, @@ -1028,6 +1037,7 @@ enum Capability { CapabilityTextureSampleWeightedQCOM = 4484, CapabilityTextureBoxFilterQCOM = 4485, CapabilityTextureBlockMatchQCOM = 4486, + CapabilityTextureBlockMatch2QCOM = 4498, CapabilityFloat16ImageAMD = 5008, CapabilityImageGatherBiasLodAMD = 5009, CapabilityFragmentMaskAMD = 5010, @@ -1035,6 +1045,7 @@ enum Capability { CapabilityImageReadWriteLodAMD = 5015, CapabilityInt64ImageEXT = 5016, CapabilityShaderClockKHR = 5055, + CapabilityQuadControlKHR = 5087, CapabilitySampleMaskOverrideCoverageNV = 5249, CapabilityGeometryShaderPassthroughNV = 5251, CapabilityShaderViewportIndexLayerEXT = 5254, @@ -1094,10 +1105,13 @@ enum Capability { CapabilityFragmentShaderPixelInterlockEXT = 5378, CapabilityDemoteToHelperInvocation = 5379, CapabilityDemoteToHelperInvocationEXT = 5379, + CapabilityDisplacementMicromapNV = 5380, CapabilityRayTracingOpacityMicromapEXT = 5381, CapabilityShaderInvocationReorderNV = 5383, CapabilityBindlessTextureNV = 5390, CapabilityRayQueryPositionFetchKHR = 5391, + CapabilityAtomicFloat16VectorNV = 5404, + CapabilityRayTracingDisplacementMicromapNV = 5409, CapabilitySubgroupShuffleINTEL = 5568, CapabilitySubgroupBufferBlockIOINTEL = 5569, CapabilitySubgroupImageBlockIOINTEL = 5570, @@ -1150,6 +1164,7 @@ enum Capability { CapabilityDotProductKHR = 6019, CapabilityRayCullMaskKHR = 6020, CapabilityCooperativeMatrixKHR = 6022, + CapabilityReplicatedCompositesEXT = 6024, CapabilityBitInstructions = 6025, CapabilityGroupNonUniformRotateKHR = 6026, CapabilityAtomicFloat32AddEXT = 6033, @@ -1179,7 +1194,7 @@ enum RayFlagsShift { RayFlagsMax = 0x7fffffff, }; -enum RayFlagsMask { +enum RayFlagsMask : unsigned { RayFlagsMaskNone = 0, RayFlagsOpaqueKHRMask = 0x00000001, RayFlagsNoOpaqueKHRMask = 0x00000002, @@ -1221,7 +1236,7 @@ enum FragmentShadingRateShift { FragmentShadingRateMax = 0x7fffffff, }; -enum FragmentShadingRateMask { +enum FragmentShadingRateMask : unsigned { FragmentShadingRateMaskNone = 0, FragmentShadingRateVertical2PixelsMask = 0x00000001, FragmentShadingRateVertical4PixelsMask = 0x00000002, @@ -1268,26 +1283,28 @@ enum PackedVectorFormat { }; enum CooperativeMatrixOperandsShift { - CooperativeMatrixOperandsMatrixASignedComponentsShift = 0, - CooperativeMatrixOperandsMatrixBSignedComponentsShift = 1, - CooperativeMatrixOperandsMatrixCSignedComponentsShift = 2, - CooperativeMatrixOperandsMatrixResultSignedComponentsShift = 3, - CooperativeMatrixOperandsSaturatingAccumulationShift = 4, + CooperativeMatrixOperandsMatrixASignedComponentsKHRShift = 0, + CooperativeMatrixOperandsMatrixBSignedComponentsKHRShift = 1, + CooperativeMatrixOperandsMatrixCSignedComponentsKHRShift = 2, + CooperativeMatrixOperandsMatrixResultSignedComponentsKHRShift = 3, + CooperativeMatrixOperandsSaturatingAccumulationKHRShift = 4, CooperativeMatrixOperandsMax = 0x7fffffff, }; -enum CooperativeMatrixOperandsMask { +enum CooperativeMatrixOperandsMask : unsigned { CooperativeMatrixOperandsMaskNone = 0, - CooperativeMatrixOperandsMatrixASignedComponentsMask = 0x00000001, - CooperativeMatrixOperandsMatrixBSignedComponentsMask = 0x00000002, - CooperativeMatrixOperandsMatrixCSignedComponentsMask = 0x00000004, - CooperativeMatrixOperandsMatrixResultSignedComponentsMask = 0x00000008, - CooperativeMatrixOperandsSaturatingAccumulationMask = 0x00000010, + CooperativeMatrixOperandsMatrixASignedComponentsKHRMask = 0x00000001, + CooperativeMatrixOperandsMatrixBSignedComponentsKHRMask = 0x00000002, + CooperativeMatrixOperandsMatrixCSignedComponentsKHRMask = 0x00000004, + CooperativeMatrixOperandsMatrixResultSignedComponentsKHRMask = 0x00000008, + CooperativeMatrixOperandsSaturatingAccumulationKHRMask = 0x00000010, }; enum CooperativeMatrixLayout { - CooperativeMatrixLayoutCooperativeMatrixRowMajorKHR = 0, - CooperativeMatrixLayoutCooperativeMatrixColumnMajorKHR = 1, + CooperativeMatrixLayoutRowMajorKHR = 0, + CooperativeMatrixLayoutColumnMajorKHR = 1, + CooperativeMatrixLayoutRowBlockedInterleavedARM = 4202, + CooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203, CooperativeMatrixLayoutMax = 0x7fffffff, }; @@ -1654,6 +1671,7 @@ enum Op { OpSubgroupAllEqualKHR = 4430, OpGroupNonUniformRotateKHR = 4431, OpSubgroupReadInvocationKHR = 4432, + OpExtInstWithForwardRefsKHR = 4433, OpTraceRayKHR = 4445, OpExecuteCallableKHR = 4446, OpConvertUToAccelerationStructureKHR = 4447, @@ -1676,6 +1694,9 @@ enum Op { OpCooperativeMatrixStoreKHR = 4458, OpCooperativeMatrixMulAddKHR = 4459, OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, @@ -1687,6 +1708,10 @@ enum Op { OpImageBoxFilterQCOM = 4481, OpImageBlockMatchSSDQCOM = 4482, OpImageBlockMatchSADQCOM = 4483, + OpImageBlockMatchWindowSSDQCOM = 4500, + OpImageBlockMatchWindowSADQCOM = 4501, + OpImageBlockMatchGatherSSDQCOM = 4502, + OpImageBlockMatchGatherSADQCOM = 4503, OpGroupIAddNonUniformAMD = 5000, OpGroupFAddNonUniformAMD = 5001, OpGroupFMinNonUniformAMD = 5002, @@ -1698,6 +1723,8 @@ enum Op { OpFragmentMaskFetchAMD = 5011, OpFragmentFetchAMD = 5012, OpReadClockKHR = 5056, + OpGroupNonUniformQuadAllKHR = 5110, + OpGroupNonUniformQuadAnyKHR = 5111, OpHitObjectRecordHitMotionNV = 5249, OpHitObjectRecordHitWithIndexMotionNV = 5250, OpHitObjectRecordMissMotionNV = 5251, @@ -1736,6 +1763,8 @@ enum Op { OpSetMeshOutputsEXT = 5295, OpGroupNonUniformPartitionNV = 5296, OpWritePackedPrimitiveIndices4x8NV = 5299, + OpFetchMicroTriangleVertexPositionNV = 5300, + OpFetchMicroTriangleVertexBarycentricNV = 5301, OpReportIntersectionKHR = 5334, OpReportIntersectionNV = 5334, OpIgnoreIntersectionNV = 5335, @@ -2370,6 +2399,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpPtrEqual: *hasResult = true; *hasResultType = true; break; case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; case OpPtrDiff: *hasResult = true; *hasResultType = true; break; + case OpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break; case OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; @@ -2397,6 +2427,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; case OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; case OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; + case OpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case OpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break; case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; @@ -2408,6 +2441,10 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; case OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; case OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; @@ -2419,6 +2456,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; case OpReadClockKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break; case OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; case OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; case OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; @@ -2733,6 +2772,20 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break; } } + +inline const char* ScopeToString(Scope value) { + switch (value) { + case ScopeCrossDevice: return "CrossDevice"; + case ScopeDevice: return "Device"; + case ScopeWorkgroup: return "Workgroup"; + case ScopeSubgroup: return "Subgroup"; + case ScopeInvocation: return "Invocation"; + case ScopeQueueFamily: return "QueueFamily"; + case ScopeShaderCallKHR: return "ShaderCallKHR"; + default: return "Unknown"; + } +} + #endif /* SPV_ENABLE_UTILITY_CODE */ // Overload bitwise operators for mask bit combining diff --git a/bgfx/3rdparty/glslang/SPIRV/spvIR.h b/bgfx/3rdparty/glslang/SPIRV/spvIR.h index 5cbffec2..e723f0e1 100644 --- a/bgfx/3rdparty/glslang/SPIRV/spvIR.h +++ b/bgfx/3rdparty/glslang/SPIRV/spvIR.h @@ -56,6 +56,7 @@ #include #include #include +#include namespace spv { @@ -96,12 +97,24 @@ class Instruction { Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(nullptr) { } explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { } virtual ~Instruction() {} + void reserveOperands(size_t count) { + operands.reserve(count); + idOperand.reserve(count); + } void addIdOperand(Id id) { // ids can't be 0 assert(id); operands.push_back(id); idOperand.push_back(true); } + // This method is potentially dangerous as it can break assumptions + // about SSA and lack of forward references. + void setIdOperand(unsigned idx, Id id) { + assert(id); + assert(idOperand[idx]); + operands[idx] = id; + } + void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); idOperand.push_back(false); @@ -176,6 +189,15 @@ class Instruction { out.push_back(operands[op]); } + const char *getNameString() const { + if (opCode == OpString) { + return (const char *)&operands[0]; + } else { + assert(opCode == OpName); + return (const char *)&operands[1]; + } + } + protected: Instruction(const Instruction&); Id resultId; @@ -190,6 +212,12 @@ class Instruction { // SPIR-V IR block. // +struct DebugSourceLocation { + int line; + int column; + spv::Id fileId; +}; + class Block { public: Block(Id id, Function& parent); @@ -200,12 +228,34 @@ class Block { Id getId() { return instructions.front()->getResultId(); } Function& getParent() const { return parent; } + // Returns true if the source location is actually updated. + // Note we still need the builder to insert the line marker instruction. This is just a tracker. + bool updateDebugSourceLocation(int line, int column, spv::Id fileId) { + if (currentSourceLoc && currentSourceLoc->line == line && currentSourceLoc->column == column && + currentSourceLoc->fileId == fileId) { + return false; + } + + currentSourceLoc = DebugSourceLocation{line, column, fileId}; + return true; + } + // Returns true if the scope is actually updated. + // Note we still need the builder to insert the debug scope instruction. This is just a tracker. + bool updateDebugScope(spv::Id scopeId) { + assert(scopeId); + if (currentDebugScope && *currentDebugScope == scopeId) { + return false; + } + + currentDebugScope = scopeId; + return true; + } void addInstruction(std::unique_ptr inst); void addPredecessor(Block* pred) { predecessors.push_back(pred); pred->successors.push_back(this);} void addLocalVariable(std::unique_ptr inst) { localVariables.push_back(std::move(inst)); } const std::vector& getPredecessors() const { return predecessors; } const std::vector& getSuccessors() const { return successors; } - const std::vector >& getInstructions() const { + std::vector >& getInstructions() { return instructions; } const std::vector >& getLocalVariables() const { return localVariables; } @@ -292,6 +342,12 @@ class Block { std::vector > localVariables; Function& parent; + // Track source location of the last source location marker instruction. + std::optional currentSourceLoc; + + // Track scope of the last debug scope instruction. + std::optional currentDebugScope; + // track whether this block is known to be uncreachable (not necessarily // true for all unreachable blocks, but should be set at least // for the extraneous ones introduced by the builder). @@ -323,7 +379,7 @@ void inReadableOrder(Block* root, std::function inst); Id getReturnType() const { return functionInstruction.getTypeId(); } Id getFuncId() const { return functionInstruction.getResultId(); } + Id getFuncTypeId() const { return functionInstruction.getIdOperand(1); } void setReturnPrecision(Decoration precision) { if (precision == DecorationRelaxedPrecision) @@ -362,6 +419,7 @@ class Function { void setDebugLineInfo(Id fileName, int line, int column) { lineInstruction = std::unique_ptr{new Instruction(OpLine)}; + lineInstruction->reserveOperands(3); lineInstruction->addIdOperand(fileName); lineInstruction->addImmediateOperand(line); lineInstruction->addImmediateOperand(column); @@ -402,6 +460,9 @@ class Function { end.dump(out); } + LinkageType getLinkType() const { return linkType; } + const char* getExportName() const { return exportName.c_str(); } + protected: Function(const Function&); Function& operator=(Function&); @@ -414,6 +475,8 @@ class Function { bool implicitThis; // true if this is a member function expecting to be passed a 'this' as the first argument bool reducedPrecisionReturn; std::set reducedPrecisionParams; // list of parameter indexes that need a relaxed precision arg + LinkageType linkType; + std::string exportName; }; // @@ -473,12 +536,14 @@ class Module { // Add both // - the OpFunction instruction // - all the OpFunctionParameter instructions -__inline Function::Function(Id id, Id resultType, Id functionType, Id firstParamId, Module& parent) +__inline Function::Function(Id id, Id resultType, Id functionType, Id firstParamId, LinkageType linkage, const std::string& name, Module& parent) : parent(parent), lineInstruction(nullptr), functionInstruction(id, resultType, OpFunction), implicitThis(false), - reducedPrecisionReturn(false) + reducedPrecisionReturn(false), + linkType(linkage) { // OpFunction + functionInstruction.reserveOperands(2); functionInstruction.addImmediateOperand(FunctionControlMaskNone); functionInstruction.addIdOperand(functionType); parent.mapInstruction(&functionInstruction); @@ -492,6 +557,11 @@ __inline Function::Function(Id id, Id resultType, Id functionType, Id firstParam parent.mapInstruction(param); parameterInstructions.push_back(param); } + + // If importing/exporting, save the function name (without the mangled parameters) for the linkage decoration + if (linkType != LinkageTypeMax) { + exportName = name.substr(0, name.find_first_of('(')); + } } __inline void Function::addLocalVariable(std::unique_ptr inst) diff --git a/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp b/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp index d6ef5225..e7153b7a 100644 --- a/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp +++ b/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp @@ -44,22 +44,22 @@ #include "glslang/Public/ResourceLimits.h" #include "Worklist.h" #include "DirStackFileIncluder.h" -#include "./../glslang/Include/ShHandle.h" #include "./../glslang/Public/ShaderLang.h" +#include "../glslang/MachineIndependent/localintermediate.h" #include "../SPIRV/GlslangToSpv.h" #include "../SPIRV/GLSL.std.450.h" -#include "../SPIRV/doc.h" #include "../SPIRV/disassemble.h" -#include -#include +#include +#include #include #include -#include +#include +#include #include #include -#include #include +#include #include "../glslang/OSDependent/osinclude.h" @@ -73,40 +73,43 @@ extern "C" { } // Command-line options -enum TOptions { - EOptionNone = 0, - EOptionIntermediate = (1 << 0), - EOptionSuppressInfolog = (1 << 1), - EOptionMemoryLeakMode = (1 << 2), - EOptionRelaxedErrors = (1 << 3), - EOptionGiveWarnings = (1 << 4), - EOptionLinkProgram = (1 << 5), - EOptionMultiThreaded = (1 << 6), - EOptionDumpConfig = (1 << 7), - EOptionDumpReflection = (1 << 8), - EOptionSuppressWarnings = (1 << 9), - EOptionDumpVersions = (1 << 10), - EOptionSpv = (1 << 11), - EOptionHumanReadableSpv = (1 << 12), - EOptionVulkanRules = (1 << 13), - EOptionDefaultDesktop = (1 << 14), - EOptionOutputPreprocessed = (1 << 15), - EOptionOutputHexadecimal = (1 << 16), - EOptionReadHlsl = (1 << 17), - EOptionCascadingErrors = (1 << 18), - EOptionAutoMapBindings = (1 << 19), - EOptionFlattenUniformArrays = (1 << 20), - EOptionNoStorageFormat = (1 << 21), - EOptionKeepUncalled = (1 << 22), - EOptionHlslOffsets = (1 << 23), - EOptionHlslIoMapping = (1 << 24), - EOptionAutoMapLocations = (1 << 25), - EOptionDebug = (1 << 26), - EOptionStdin = (1 << 27), - EOptionOptimizeDisable = (1 << 28), - EOptionOptimizeSize = (1 << 29), - EOptionInvertY = (1 << 30), - EOptionDumpBareVersion = (1 << 31), +enum TOptions : uint64_t { + EOptionNone = 0, + EOptionIntermediate = (1ull << 0), + EOptionSuppressInfolog = (1ull << 1), + EOptionMemoryLeakMode = (1ull << 2), + EOptionRelaxedErrors = (1ull << 3), + EOptionGiveWarnings = (1ull << 4), + EOptionLinkProgram = (1ull << 5), + EOptionMultiThreaded = (1ull << 6), + EOptionDumpConfig = (1ull << 7), + EOptionDumpReflection = (1ull << 8), + EOptionSuppressWarnings = (1ull << 9), + EOptionDumpVersions = (1ull << 10), + EOptionSpv = (1ull << 11), + EOptionHumanReadableSpv = (1ull << 12), + EOptionVulkanRules = (1ull << 13), + EOptionDefaultDesktop = (1ull << 14), + EOptionOutputPreprocessed = (1ull << 15), + EOptionOutputHexadecimal = (1ull << 16), + EOptionReadHlsl = (1ull << 17), + EOptionCascadingErrors = (1ull << 18), + EOptionAutoMapBindings = (1ull << 19), + EOptionFlattenUniformArrays = (1ull << 20), + EOptionNoStorageFormat = (1ull << 21), + EOptionKeepUncalled = (1ull << 22), + EOptionHlslOffsets = (1ull << 23), + EOptionHlslIoMapping = (1ull << 24), + EOptionAutoMapLocations = (1ull << 25), + EOptionDebug = (1ull << 26), + EOptionStdin = (1ull << 27), + EOptionOptimizeDisable = (1ull << 28), + EOptionOptimizeSize = (1ull << 29), + EOptionInvertY = (1ull << 30), + EOptionDumpBareVersion = (1ull << 31), + EOptionCompileOnly = (1ull << 32), + EOptionDisplayErrorColumn = (1ull << 33), + EOptionLinkTimeOptimization = (1ull << 34), }; bool targetHlslFunctionality1 = false; bool SpvToolsDisassembler = false; @@ -143,8 +146,9 @@ void FreeFileData(char* data); void InfoLogMsg(const char* msg, const char* name, const int num); // Globally track if any compile or link failure. -bool CompileFailed = false; -bool LinkFailed = false; +std::atomic CompileFailed{0}; +std::atomic LinkFailed{0}; +std::atomic CompileOrLinkFailed{0}; // array of unique places to leave the shader names and infologs for the asynchronous compiles std::vector> WorkItems; @@ -166,7 +170,7 @@ void ProcessConfigFile() } int ReflectOptions = EShReflectionDefault; -int Options = 0; +std::underlying_type_t Options = EOptionNone; const char* ExecutableName = nullptr; const char* binaryFileName = nullptr; const char* depencyFileName = nullptr; @@ -178,6 +182,7 @@ bool HlslEnable16BitTypes = false; bool HlslDX9compatible = false; bool HlslDxPositionW = false; bool EnhancedMsgs = false; +bool AbsolutePath = false; bool DumpBuiltinSymbols = false; std::vector IncludeDirectoryList; @@ -513,7 +518,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi if (set) { errno = 0; - int setVal = ::strtol(argv[curArg], nullptr, 10); + int setVal = static_cast(::strtol(argv[curArg], nullptr, 10)); if (errno || setVal < 0) { printf("%s: invalid set\n", argv[curArg]); usage(); @@ -525,7 +530,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi if (binding) { errno = 0; - int bindingVal = ::strtol(argv[curArg], nullptr, 10); + int bindingVal = static_cast(::strtol(argv[curArg], nullptr, 10)); if (errno || bindingVal < 0) { printf("%s: invalid binding\n", argv[curArg]); usage(); @@ -608,7 +613,7 @@ void ProcessArguments(std::vector>& workItem exit(EFailUsage); } errno = 0; - int location = ::strtol(split + 1, nullptr, 10); + int location = static_cast(::strtol(split + 1, nullptr, 10)); if (errno) { printf("%s: invalid location\n", arg); exit(EFailUsage); @@ -635,7 +640,7 @@ void ProcessArguments(std::vector>& workItem } else if (lowerword == "uniform-base") { if (argc <= 1) Error("no provided", lowerword.c_str()); - uniformBase = ::strtol(argv[1], nullptr, 10); + uniformBase = static_cast(::strtol(argv[1], nullptr, 10)); bumpArg(); break; } else if (lowerword == "client") { @@ -723,6 +728,8 @@ void ProcessArguments(std::vector>& workItem HlslDxPositionW = true; } else if (lowerword == "enhanced-msgs") { EnhancedMsgs = true; + } else if (lowerword == "absolute-path") { + AbsolutePath = true; } else if (lowerword == "auto-sampled-textures") { autoSampledTextures = true; } else if (lowerword == "invert-y" || // synonyms @@ -889,6 +896,12 @@ void ProcessArguments(std::vector>& workItem bumpArg(); } else if (lowerword == "version") { Options |= EOptionDumpVersions; + } else if (lowerword == "no-link") { + Options |= EOptionCompileOnly; + } else if (lowerword == "error-column") { + Options |= EOptionDisplayErrorColumn; + } else if (lowerword == "lto") { + Options |= EOptionLinkTimeOptimization; } else if (lowerword == "help") { usage(); break; @@ -1073,6 +1086,10 @@ void ProcessArguments(std::vector>& workItem if ((Options & EOptionDumpReflection) && !(Options & EOptionLinkProgram)) Error("reflection requires -l for linking"); + // link time optimization makes no sense unless linking + if ((Options & EOptionLinkTimeOptimization) && !(Options & EOptionLinkProgram)) + Error("link time optimization requires -l for linking"); + // -o or -x makes no sense if there is no target binary if (binaryFileName && (Options & EOptionSpv) == 0) Error("no binary generation requested (e.g., -V)"); @@ -1153,6 +1170,12 @@ void SetMessageOptions(EShMessages& messages) messages = (EShMessages)(messages | EShMsgBuiltinSymbolTable); if (EnhancedMsgs) messages = (EShMessages)(messages | EShMsgEnhanced); + if (AbsolutePath) + messages = (EShMessages)(messages | EShMsgAbsolutePath); + if (Options & EOptionDisplayErrorColumn) + messages = (EShMessages)(messages | EShMsgDisplayErrorColumn); + if (Options & EOptionLinkTimeOptimization) + messages = (EShMessages)(messages | EShMsgLinkTimeOptimization); } // @@ -1163,10 +1186,11 @@ void CompileShaders(glslang::TWorklist& worklist) if (Options & EOptionDebug) Error("cannot generate debug information unless linking to generate code"); + // NOTE: TWorkList::remove is thread-safe glslang::TWorkItem* workItem; if (Options & EOptionStdin) { if (worklist.remove(workItem)) { - ShHandle compiler = ShConstructCompiler(FindLanguage("stdin"), Options); + ShHandle compiler = ShConstructCompiler(FindLanguage("stdin"), 0); if (compiler == nullptr) return; @@ -1179,10 +1203,11 @@ void CompileShaders(glslang::TWorklist& worklist) } } else { while (worklist.remove(workItem)) { - ShHandle compiler = ShConstructCompiler(FindLanguage(workItem->name), Options); + ShHandle compiler = ShConstructCompiler(FindLanguage(workItem->name), 0); if (compiler == nullptr) return; + CompileFile(workItem->name.c_str(), compiler); if (! (Options & EOptionSuppressInfolog)) @@ -1310,6 +1335,7 @@ void CompileAndLinkShaderUnits(std::vector compUnits) // glslang::TProgram& program = *new glslang::TProgram; + const bool compileOnly = (Options & EOptionCompileOnly) != 0; for (auto it = compUnits.cbegin(); it != compUnits.cend(); ++it) { const auto &compUnit = *it; for (int i = 0; i < compUnit.count; i++) { @@ -1326,6 +1352,9 @@ void CompileAndLinkShaderUnits(std::vector compUnits) shader->setSourceEntryPoint(sourceEntryPointName); } + if (compileOnly) + shader->setCompileOnly(); + shader->setOverrideVersion(GlslVersion); std::string intrinsicString = getIntrinsic(compUnit.text, compUnit.count); @@ -1435,7 +1464,7 @@ void CompileAndLinkShaderUnits(std::vector compUnits) if (shader->preprocess(GetResources(), defaultVersion, ENoProfile, false, false, messages, &str, includer)) { PutsIfNonEmpty(str.c_str()); } else { - CompileFailed = true; + CompileFailed = 1; } StderrIfNonEmpty(shader->getInfoLog()); StderrIfNonEmpty(shader->getInfoDebugLog()); @@ -1443,9 +1472,10 @@ void CompileAndLinkShaderUnits(std::vector compUnits) } if (! shader->parse(GetResources(), defaultVersion, false, messages, includer)) - CompileFailed = true; + CompileFailed = 1; - program.addShader(shader); + if (!compileOnly) + program.addShader(shader); if (! (Options & EOptionSuppressInfolog) && ! (Options & EOptionMemoryLeakMode)) { @@ -1460,79 +1490,102 @@ void CompileAndLinkShaderUnits(std::vector compUnits) // Program-level processing... // - // Link - if (! (Options & EOptionOutputPreprocessed) && ! program.link(messages)) - LinkFailed = true; - - // Map IO - if (Options & EOptionSpv) { - if (!program.mapIO()) + if (!compileOnly) { + // Link + if (!(Options & EOptionOutputPreprocessed) && !program.link(messages)) LinkFailed = true; - } - // Report - if (! (Options & EOptionSuppressInfolog) && - ! (Options & EOptionMemoryLeakMode)) { - PutsIfNonEmpty(program.getInfoLog()); - PutsIfNonEmpty(program.getInfoDebugLog()); - } + // Map IO + if (Options & EOptionSpv) { + if (!program.mapIO()) + LinkFailed = true; + } - // Reflect - if (Options & EOptionDumpReflection) { - program.buildReflection(ReflectOptions); - program.dumpReflection(); + // Report + if (!(Options & EOptionSuppressInfolog) && !(Options & EOptionMemoryLeakMode)) { + PutsIfNonEmpty(program.getInfoLog()); + PutsIfNonEmpty(program.getInfoDebugLog()); + } + + // Reflect + if (Options & EOptionDumpReflection) { + program.buildReflection(ReflectOptions); + program.dumpReflection(); + } } std::vector outputFiles; // Dump SPIR-V if (Options & EOptionSpv) { - if (CompileFailed || LinkFailed) +#ifdef ENABLE_SPIRV + CompileOrLinkFailed.fetch_or(CompileFailed); + CompileOrLinkFailed.fetch_or(LinkFailed); + if (static_cast(CompileOrLinkFailed.load())) printf("SPIR-V is not generated for failed compile or link\n"); else { - for (int stage = 0; stage < EShLangCount; ++stage) { - if (program.getIntermediate((EShLanguage)stage)) { - std::vector spirv; - spv::SpvBuildLogger logger; - glslang::SpvOptions spvOptions; - if (Options & EOptionDebug) { - spvOptions.generateDebugInfo = true; - if (emitNonSemanticShaderDebugInfo) { - spvOptions.emitNonSemanticShaderDebugInfo = true; - if (emitNonSemanticShaderDebugSource) { - spvOptions.emitNonSemanticShaderDebugSource = true; - } - } - } else if (stripDebugInfo) - spvOptions.stripDebugInfo = true; - spvOptions.disableOptimizer = (Options & EOptionOptimizeDisable) != 0; - spvOptions.optimizeSize = (Options & EOptionOptimizeSize) != 0; - spvOptions.disassemble = SpvToolsDisassembler; - spvOptions.validate = SpvToolsValidate; - glslang::GlslangToSpv(*program.getIntermediate((EShLanguage)stage), spirv, &logger, &spvOptions); - - // Dump the spv to a file or stdout, etc., but only if not doing - // memory/perf testing, as it's not internal to programmatic use. - if (! (Options & EOptionMemoryLeakMode)) { - printf("%s", logger.getAllMessages().c_str()); - if (Options & EOptionOutputHexadecimal) { - if (!glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName)) - exit(EFailUsage); - } else { - if (!glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage))) - exit(EFailUsage); + std::vector intermediates; + if (!compileOnly) { + for (int stage = 0; stage < EShLangCount; ++stage) { + if (auto* i = program.getIntermediate((EShLanguage)stage)) { + intermediates.emplace_back(i); + } + } + } else { + for (const auto* shader : shaders) { + if (auto* i = shader->getIntermediate()) { + intermediates.emplace_back(i); + } + } + } + for (auto* intermediate : intermediates) { + std::vector spirv; + spv::SpvBuildLogger logger; + glslang::SpvOptions spvOptions; + if (Options & EOptionDebug) { + spvOptions.generateDebugInfo = true; + if (emitNonSemanticShaderDebugInfo) { + spvOptions.emitNonSemanticShaderDebugInfo = true; + if (emitNonSemanticShaderDebugSource) { + spvOptions.emitNonSemanticShaderDebugSource = true; } - - outputFiles.push_back(GetBinaryName((EShLanguage)stage)); - if (!SpvToolsDisassembler && (Options & EOptionHumanReadableSpv)) - spv::Disassemble(std::cout, spirv); } + } else if (stripDebugInfo) + spvOptions.stripDebugInfo = true; + spvOptions.disableOptimizer = (Options & EOptionOptimizeDisable) != 0; + spvOptions.optimizeSize = (Options & EOptionOptimizeSize) != 0; + spvOptions.disassemble = SpvToolsDisassembler; + spvOptions.validate = SpvToolsValidate; + spvOptions.compileOnly = compileOnly; + glslang::GlslangToSpv(*intermediate, spirv, &logger, &spvOptions); + + // Dump the spv to a file or stdout, etc., but only if not doing + // memory/perf testing, as it's not internal to programmatic use. + if (!(Options & EOptionMemoryLeakMode)) { + printf("%s", logger.getAllMessages().c_str()); + const auto filename = GetBinaryName(intermediate->getStage()); + if (Options & EOptionOutputHexadecimal) { + if (!glslang::OutputSpvHex(spirv, filename, variableName)) + exit(EFailUsage); + } else { + if (!glslang::OutputSpvBin(spirv, filename)) + exit(EFailUsage); + } + + outputFiles.push_back(filename); + if (!SpvToolsDisassembler && (Options & EOptionHumanReadableSpv)) + spv::Disassemble(std::cout, spirv); } } } +#else + Error("This configuration of glslang does not have SPIR-V support"); +#endif } - if (depencyFileName && !(CompileFailed || LinkFailed)) { + CompileOrLinkFailed.fetch_or(CompileFailed); + CompileOrLinkFailed.fetch_or(LinkFailed); + if (depencyFileName && !static_cast(CompileOrLinkFailed.load())) { std::set includedFiles = includer.getIncludedFiles(); sources.insert(sources.end(), includedFiles.begin(), includedFiles.end()); @@ -1627,21 +1680,31 @@ int singleMain() } if (Options & EOptionDumpBareVersion) { - printf("%d:%d.%d.%d%s\n", glslang::GetSpirvGeneratorVersion(), GLSLANG_VERSION_MAJOR, GLSLANG_VERSION_MINOR, + int spirvGeneratorVersion = 0; +#ifdef ENABLE_SPIRV + spirvGeneratorVersion = glslang::GetSpirvGeneratorVersion(); +#endif + printf("%d:%d.%d.%d%s\n", spirvGeneratorVersion, GLSLANG_VERSION_MAJOR, GLSLANG_VERSION_MINOR, GLSLANG_VERSION_PATCH, GLSLANG_VERSION_FLAVOR); if (workList.empty()) return ESuccess; } else if (Options & EOptionDumpVersions) { - printf("Glslang Version: %d:%d.%d.%d%s\n", glslang::GetSpirvGeneratorVersion(), GLSLANG_VERSION_MAJOR, + int spirvGeneratorVersion = 0; +#ifdef ENABLE_SPIRV + spirvGeneratorVersion = glslang::GetSpirvGeneratorVersion(); +#endif + printf("Glslang Version: %d:%d.%d.%d%s\n", spirvGeneratorVersion, GLSLANG_VERSION_MAJOR, GLSLANG_VERSION_MINOR, GLSLANG_VERSION_PATCH, GLSLANG_VERSION_FLAVOR); printf("ESSL Version: %s\n", glslang::GetEsslVersionString()); printf("GLSL Version: %s\n", glslang::GetGlslVersionString()); std::string spirvVersion; +#if ENABLE_SPIRV glslang::GetSpirvVersion(spirvVersion); +#endif printf("SPIR-V Version %s\n", spirvVersion.c_str()); printf("GLSL.std.450 Version %d, Revision %d\n", GLSLstd450Version, GLSLstd450Revision); printf("Khronos Tool ID %d\n", glslang::GetKhronosToolId()); - printf("SPIR-V Generator Version %d\n", glslang::GetSpirvGeneratorVersion()); + printf("SPIR-V Generator Version %d\n", spirvGeneratorVersion); printf("GL_KHR_vulkan_glsl version %d\n", 100); printf("ARB_GL_gl_spirv version %d\n", 100); if (workList.empty()) @@ -1708,9 +1771,9 @@ int singleMain() ShFinalize(); } - if (CompileFailed) + if (CompileFailed.load()) return EFailCompile; - if (LinkFailed) + if (LinkFailed.load()) return EFailLink; return 0; @@ -1846,7 +1909,8 @@ void CompileFile(const char* fileName, ShHandle compiler) for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) { for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) { // ret = ShCompile(compiler, shaderStrings, NumShaderStrings, lengths, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); - ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, GetResources(), Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); + ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, GetResources(), 0, + (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages, fileName); // const char* multi[12] = { "# ve", "rsion", " 300 e", "s", "\n#err", // "or should be l", "ine 1", "string 5\n", "float glo", "bal", // ";\n#error should be line 2\n void main() {", "global = 2.3;}" }; @@ -1961,6 +2025,7 @@ void usage() " without explicit bindings\n" " --auto-map-locations | --aml automatically locate input/output lacking\n" " 'location' (fragile, not cross stage)\n" + " --absolute-path Prints absolute path for messages\n" " --auto-sampled-textures Removes sampler variables and converts\n" " existing textures to sampled textures\n" " --client {vulkan|opengl} see -V and -G\n" @@ -1985,6 +2050,7 @@ void usage() " shaders compatible with DirectX\n" " --invert-y | --iy invert position.Y output in vertex shader\n" " --enhanced-msgs print more readable error messages (GLSL only)\n" + " --error-column display the column of the error along the line\n" " --keep-uncalled | --ku don't eliminate uncalled functions\n" " --nan-clamp favor non-NaN operand in min, max, and clamp\n" " --no-storage-format | --nsf use Unknown image format\n" @@ -2075,7 +2141,11 @@ void usage() " --variable-name \n" " --vn creates a C header file that contains a\n" " uint32_t array named \n" - " initialized with the shader binary code\n"); + " initialized with the shader binary code\n" + " --no-link Only compile shader; do not link (GLSL-only)\n" + " NOTE: this option will set the export linkage\n" + " attribute on all functions\n" + " --lto perform link time optimization\n"); exit(EFailUsage); } @@ -2125,6 +2195,20 @@ char* ReadFileData(const char* fileName) fseek(in, 0, SEEK_SET); + if (count > 3) { + unsigned char head[3]; + if (fread(head, 1, 3, in) == 3) { + if (head[0] == 0xef && head[1] == 0xbb && head[2] == 0xbf) { + // skip BOM + count -= 3; + } else { + fseek(in, 0, SEEK_SET); + } + } else { + Error("can't read input file"); + } + } + char* return_data = (char*)malloc(count + 1); // freed in FreeFileData() if ((int)fread(return_data, 1, count, in) != count) { free(return_data); diff --git a/bgfx/3rdparty/glslang/StandAlone/Worklist.h b/bgfx/3rdparty/glslang/StandAlone/Worklist.h index 91b6f516..dc726270 100644 --- a/bgfx/3rdparty/glslang/StandAlone/Worklist.h +++ b/bgfx/3rdparty/glslang/StandAlone/Worklist.h @@ -35,7 +35,6 @@ #ifndef WORKLIST_H_INCLUDED #define WORKLIST_H_INCLUDED -#include "../glslang/OSDependent/osinclude.h" #include #include #include diff --git a/bgfx/3rdparty/glslang/build_info.h b/bgfx/3rdparty/glslang/build_info.h index 7a54a7dc..328c273f 100644 --- a/bgfx/3rdparty/glslang/build_info.h +++ b/bgfx/3rdparty/glslang/build_info.h @@ -34,7 +34,7 @@ #ifndef GLSLANG_BUILD_INFO #define GLSLANG_BUILD_INFO -#define GLSLANG_VERSION_MAJOR 13 +#define GLSLANG_VERSION_MAJOR 15 #define GLSLANG_VERSION_MINOR 0 #define GLSLANG_VERSION_PATCH 0 #define GLSLANG_VERSION_FLAVOR "" diff --git a/bgfx/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp b/bgfx/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp index 870698f2..97f5a86d 100644 --- a/bgfx/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp +++ b/bgfx/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp @@ -34,9 +34,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StandAlone/DirStackFileIncluder.h" #include "glslang/Public/ResourceLimits.h" +#include "glslang/Public/ShaderLang.h" #include "glslang/Include/ShHandle.h" +#include "glslang/Include/BaseTypes.h" #include "glslang/Include/ResourceLimits.h" +#include "glslang/Include/Types.h" +#include "glslang/MachineIndependent/iomapper.h" #include "glslang/MachineIndependent/Versions.h" #include "glslang/MachineIndependent/localintermediate.h" @@ -54,10 +58,12 @@ static_assert(int(GLSLANG_REFLECTION_COUNT) == EShReflectionCount, ""); static_assert(int(GLSLANG_PROFILE_COUNT) == EProfileCount, ""); static_assert(sizeof(glslang_limits_t) == sizeof(TLimits), ""); static_assert(sizeof(glslang_resource_t) == sizeof(TBuiltInResource), ""); +static_assert(sizeof(glslang_version_t) == sizeof(glslang::Version), ""); typedef struct glslang_shader_s { glslang::TShader* shader; std::string preprocessedGLSL; + std::vector baseResourceSetBinding; } glslang_shader_t; typedef struct glslang_program_s { @@ -141,6 +147,11 @@ class CallbackIncluder : public glslang::TShader::Includer { void* context; }; +GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version) +{ + *reinterpret_cast(version) = glslang::GetVersion(); +} + GLSLANG_EXPORT int glslang_initialize_process() { return static_cast(glslang::InitializeProcess()); } GLSLANG_EXPORT void glslang_finalize_process() { glslang::FinalizeProcess(); } @@ -205,6 +216,9 @@ static int c_shader_messages(glslang_messages_t messages) CONVERT_MSG(GLSLANG_MSG_HLSL_LEGALIZATION_BIT, EShMsgHlslLegalization); CONVERT_MSG(GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT, EShMsgHlslDX9Compatible); CONVERT_MSG(GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT, EShMsgBuiltinSymbolTable); + CONVERT_MSG(GLSLANG_MSG_ENHANCED, EShMsgEnhanced); + CONVERT_MSG(GLSLANG_MSG_ABSOLUTE_PATH, EShMsgAbsolutePath); + CONVERT_MSG(GLSLANG_MSG_DISPLAY_ERROR_COLUMN, EShMsgDisplayErrorColumn); return res; #undef CONVERT_MSG } @@ -310,7 +324,7 @@ static EProfile c_shader_profile(glslang_profile_t profile) GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input) { if (!input || !input->code) { - printf("Error creating shader: null input(%p)/input->code\n", input); + printf("Error creating shader: null input(%p)/input->code\n", (void*)input); if (input) printf("input->code = %p\n", input->code); @@ -367,11 +381,35 @@ GLSLANG_EXPORT void glslang_shader_set_glsl_version(glslang_shader_t* shader, in shader->shader->setOverrideVersion(version); } +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_set_and_binding(glslang_shader_t* shader, unsigned int set, unsigned int binding) { + shader->shader->setGlobalUniformSet(set); + shader->shader->setGlobalUniformBinding(binding); +} + +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_name(glslang_shader_t* shader, const char *name) { + shader->shader->setGlobalUniformBlockName(name); +} + +GLSLANG_EXPORT void glslang_shader_set_resource_set_binding(glslang_shader_t* shader, const char *const *bindings, unsigned int num_bindings) { + shader->baseResourceSetBinding.clear(); + + for (unsigned int i = 0; i < num_bindings; ++i) { + shader->baseResourceSetBinding.push_back(std::string(bindings[i])); + } + + shader->shader->setResourceSetBinding(shader->baseResourceSetBinding); +} + GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader) { return shader->preprocessedGLSL.c_str(); } +GLSLANG_EXPORT void glslang_shader_set_preprocessed_code(glslang_shader_t* shader, const char* code) +{ + shader->preprocessedGLSL.assign(code); +} + GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input) { DirStackFileIncluder dirStackFileIncluder; @@ -458,6 +496,11 @@ GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program) return (int)program->program->mapIO(); } +GLSLANG_EXPORT int glslang_program_map_io_with_resolver_and_mapper(glslang_program_t* program, glslang_resolver_t* resolver, glslang_mapper_t* mapper) +{ + return (int)program->program->mapIO(reinterpret_cast(resolver), reinterpret_cast(mapper)); +} + GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program) { return program->program->getInfoLog(); @@ -467,3 +510,30 @@ GLSLANG_EXPORT const char* glslang_program_get_info_debug_log(glslang_program_t* { return program->program->getInfoDebugLog(); } + +GLSLANG_EXPORT glslang_mapper_t* glslang_glsl_mapper_create() +{ + return reinterpret_cast(new glslang::TGlslIoMapper()); +} + +GLSLANG_EXPORT void glslang_glsl_mapper_delete(glslang_mapper_t* mapper) +{ + if (!mapper) + return; + + delete reinterpret_cast(mapper); +} + +GLSLANG_EXPORT glslang_resolver_t* glslang_glsl_resolver_create(glslang_program_t* program, glslang_stage_t stage) +{ + glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage)); + return reinterpret_cast(new glslang::TDefaultGlslIoResolver(reinterpret_cast(*intermediate))); +} + +GLSLANG_EXPORT void glslang_glsl_resolver_delete(glslang_resolver_t* resolver) +{ + if (!resolver) + return; + + delete reinterpret_cast(resolver); +} diff --git a/bgfx/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp b/bgfx/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp index b3c7226d..1ef24496 100644 --- a/bgfx/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp +++ b/bgfx/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp @@ -41,10 +41,9 @@ // class TGenericCompiler : public TCompiler { public: - TGenericCompiler(EShLanguage l, int dOptions) : TCompiler(l, infoSink), debugOptions(dOptions) { } + TGenericCompiler(EShLanguage l) : TCompiler(l, infoSink) {} virtual bool compile(TIntermNode* root, int version = 0, EProfile profile = ENoProfile); TInfoSink infoSink; - int debugOptions; }; // @@ -52,10 +51,7 @@ class TGenericCompiler : public TCompiler { // compile object used by higher level code. It returns // a subclass of TCompiler. // -TCompiler* ConstructCompiler(EShLanguage language, int debugOptions) -{ - return new TGenericCompiler(language, debugOptions); -} +TCompiler* ConstructCompiler(EShLanguage language, int) { return new TGenericCompiler(language); } // // Delete the compiler made by ConstructCompiler diff --git a/bgfx/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp b/bgfx/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp index 5e28405f..5df39b81 100644 --- a/bgfx/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp +++ b/bgfx/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp @@ -44,11 +44,10 @@ // class TGenericLinker : public TLinker { public: - TGenericLinker(EShExecutable e, int dOptions) : TLinker(e, infoSink), debugOptions(dOptions) { } + TGenericLinker(EShExecutable e) : TLinker(e, infoSink) {} bool link(TCompilerList&, TUniformMap*) { return true; } void getAttributeBindings(ShBindingTable const **) const { } TInfoSink infoSink; - int debugOptions; }; // @@ -60,10 +59,7 @@ class TUniformLinkedMap : public TUniformMap { virtual int getLocation(const char*) { return 0; } }; -TShHandleBase* ConstructLinker(EShExecutable executable, int debugOptions) -{ - return new TGenericLinker(executable, debugOptions); -} +TShHandleBase* ConstructLinker(EShExecutable executable, int) { return new TGenericLinker(executable); } void DeleteLinker(TShHandleBase* linker) { diff --git a/bgfx/3rdparty/glslang/glslang/HLSL/hlslAttributes.cpp b/bgfx/3rdparty/glslang/glslang/HLSL/hlslAttributes.cpp index 0cc0d3f4..97305493 100644 --- a/bgfx/3rdparty/glslang/glslang/HLSL/hlslAttributes.cpp +++ b/bgfx/3rdparty/glslang/glslang/HLSL/hlslAttributes.cpp @@ -101,6 +101,8 @@ namespace glslang { if (name == "nonwritable") return EatNonWritable; if (name == "nonreadable") return EatNonReadable; + + if (name == "export") return EatExport; } else if (nameSpace.size() > 0) return EatNone; diff --git a/bgfx/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp b/bgfx/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp index 11c0e45e..ed32ff0c 100644 --- a/bgfx/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp +++ b/bgfx/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp @@ -391,6 +391,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) case EvqOut: case EvqInOut: parseContext.error(token.loc, "in/out qualifiers are only valid on parameters", token.string->c_str(), ""); + break; default: break; } diff --git a/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp b/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp index ac0dee50..63a4deb0 100644 --- a/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp +++ b/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp @@ -43,8 +43,6 @@ #include "../MachineIndependent/Scan.h" #include "../MachineIndependent/preprocessor/PpContext.h" -#include "../OSDependent/osinclude.h" - #include #include #include @@ -402,7 +400,7 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* case EOpLeftShiftAssign: case EOpRightShiftAssign: isModifyOp = true; - // fall through... + [[fallthrough]]; case EOpAssign: { // Since this is an lvalue, we'll convert an image load to a sequence like this @@ -962,14 +960,11 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt return addConstructor(loc, base, type); } } - if (base->getVectorSize() == 1) { + // Use EOpIndexDirect (below) with vec1.x so that it remains l-value (Test/hlsl.swizzle.vec1.comp) + if (base->getVectorSize() == 1 && selectors.size() > 1) { TType scalarType(base->getBasicType(), EvqTemporary, 1); - if (selectors.size() == 1) - return addConstructor(loc, base, scalarType); - else { - TType vectorType(base->getBasicType(), EvqTemporary, selectors.size()); - return addConstructor(loc, addConstructor(loc, base, scalarType), vectorType); - } + TType vectorType(base->getBasicType(), EvqTemporary, selectors.size()); + return addConstructor(loc, addConstructor(loc, base, scalarType), vectorType); } if (base->getType().getQualifier().isFrontEndConstant()) @@ -1444,7 +1439,7 @@ int HlslParseContext::findSubtreeOffset(const TType& type, int subset, const TVe return offsets[subset]; TType derefType(type, 0); return findSubtreeOffset(derefType, offsets[subset], offsets); -}; +} // Find and return the split IO TVariable for id, or nullptr if none. TVariable* HlslParseContext::getSplitNonIoVar(long long id) const @@ -4507,13 +4502,13 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType int cmpValues = 0; // 1 if there is a compare value (handier than a bool below) switch (op) { - case EOpMethodGatherCmpRed: cmpValues = 1; // fall through + case EOpMethodGatherCmpRed: cmpValues = 1; [[fallthrough]]; case EOpMethodGatherRed: channel = 0; break; - case EOpMethodGatherCmpGreen: cmpValues = 1; // fall through + case EOpMethodGatherCmpGreen: cmpValues = 1; [[fallthrough]]; case EOpMethodGatherGreen: channel = 1; break; - case EOpMethodGatherCmpBlue: cmpValues = 1; // fall through + case EOpMethodGatherCmpBlue: cmpValues = 1; [[fallthrough]]; case EOpMethodGatherBlue: channel = 2; break; - case EOpMethodGatherCmpAlpha: cmpValues = 1; // fall through + case EOpMethodGatherCmpAlpha: cmpValues = 1; [[fallthrough]]; case EOpMethodGatherAlpha: channel = 3; break; default: assert(0); break; } @@ -6062,7 +6057,7 @@ void HlslParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fn unaryArg = callNode.getAsUnaryNode()->getOperand(); arg0 = unaryArg; } - const TIntermSequence& aggArgs = *argp; // only valid when unaryArg is nullptr + const TIntermSequence& aggArgs = argp ? *argp : TIntermSequence(); // only valid when unaryArg is nullptr switch (callNode.getOp()) { case EOpTextureGather: @@ -9551,6 +9546,8 @@ bool HlslParseContext::isInputBuiltIn(const TQualifier& qualifier) const return language == EShLangTessEvaluation; case EbvTessCoord: return language == EShLangTessEvaluation; + case EbvViewIndex: + return language != EShLangCompute; default: return false; } @@ -9656,6 +9653,10 @@ void HlslParseContext::correctOutput(TQualifier& qualifier) if (language != EShLangTessControl) qualifier.patch = false; + // Fixes Test/hlsl.entry-inout.vert (SV_Position will not become a varying). + if (qualifier.builtIn == EbvNone) + qualifier.builtIn = qualifier.declaredBuiltIn; + switch (qualifier.builtIn) { case EbvFragDepth: intermediate.setDepthReplacing(); diff --git a/bgfx/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp b/bgfx/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp index 823b17aa..e45643e9 100644 --- a/bgfx/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp +++ b/bgfx/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp @@ -78,414 +78,396 @@ struct str_hash }; // A single global usable by all threads, by all versions, by all languages. -// After a single process-level initialization, this is read only and thread safe -std::unordered_map* KeywordMap = nullptr; -std::unordered_set* ReservedSet = nullptr; -std::unordered_map* SemanticMap = nullptr; - +const std::unordered_map KeywordMap { + {"static",glslang::EHTokStatic}, + {"const",glslang::EHTokConst}, + {"unorm",glslang::EHTokUnorm}, + {"snorm",glslang::EHTokSNorm}, + {"extern",glslang::EHTokExtern}, + {"uniform",glslang::EHTokUniform}, + {"volatile",glslang::EHTokVolatile}, + {"precise",glslang::EHTokPrecise}, + {"shared",glslang::EHTokShared}, + {"groupshared",glslang::EHTokGroupShared}, + {"linear",glslang::EHTokLinear}, + {"centroid",glslang::EHTokCentroid}, + {"nointerpolation",glslang::EHTokNointerpolation}, + {"noperspective",glslang::EHTokNoperspective}, + {"sample",glslang::EHTokSample}, + {"row_major",glslang::EHTokRowMajor}, + {"column_major",glslang::EHTokColumnMajor}, + {"packoffset",glslang::EHTokPackOffset}, + {"in",glslang::EHTokIn}, + {"out",glslang::EHTokOut}, + {"inout",glslang::EHTokInOut}, + {"layout",glslang::EHTokLayout}, + {"globallycoherent",glslang::EHTokGloballyCoherent}, + {"inline",glslang::EHTokInline}, + + {"point",glslang::EHTokPoint}, + {"line",glslang::EHTokLine}, + {"triangle",glslang::EHTokTriangle}, + {"lineadj",glslang::EHTokLineAdj}, + {"triangleadj",glslang::EHTokTriangleAdj}, + + {"PointStream",glslang::EHTokPointStream}, + {"LineStream",glslang::EHTokLineStream}, + {"TriangleStream",glslang::EHTokTriangleStream}, + + {"InputPatch",glslang::EHTokInputPatch}, + {"OutputPatch",glslang::EHTokOutputPatch}, + + {"Buffer",glslang::EHTokBuffer}, + {"vector",glslang::EHTokVector}, + {"matrix",glslang::EHTokMatrix}, + + {"void",glslang::EHTokVoid}, + {"string",glslang::EHTokString}, + {"bool",glslang::EHTokBool}, + {"int",glslang::EHTokInt}, + {"uint",glslang::EHTokUint}, + {"uint64_t",glslang::EHTokUint64}, + {"dword",glslang::EHTokDword}, + {"half",glslang::EHTokHalf}, + {"float",glslang::EHTokFloat}, + {"double",glslang::EHTokDouble}, + {"min16float",glslang::EHTokMin16float}, + {"min10float",glslang::EHTokMin10float}, + {"min16int",glslang::EHTokMin16int}, + {"min12int",glslang::EHTokMin12int}, + {"min16uint",glslang::EHTokMin16uint}, + + {"bool1",glslang::EHTokBool1}, + {"bool2",glslang::EHTokBool2}, + {"bool3",glslang::EHTokBool3}, + {"bool4",glslang::EHTokBool4}, + {"float1",glslang::EHTokFloat1}, + {"float2",glslang::EHTokFloat2}, + {"float3",glslang::EHTokFloat3}, + {"float4",glslang::EHTokFloat4}, + {"int1",glslang::EHTokInt1}, + {"int2",glslang::EHTokInt2}, + {"int3",glslang::EHTokInt3}, + {"int4",glslang::EHTokInt4}, + {"double1",glslang::EHTokDouble1}, + {"double2",glslang::EHTokDouble2}, + {"double3",glslang::EHTokDouble3}, + {"double4",glslang::EHTokDouble4}, + {"uint1",glslang::EHTokUint1}, + {"uint2",glslang::EHTokUint2}, + {"uint3",glslang::EHTokUint3}, + {"uint4",glslang::EHTokUint4}, + + {"half1",glslang::EHTokHalf1}, + {"half2",glslang::EHTokHalf2}, + {"half3",glslang::EHTokHalf3}, + {"half4",glslang::EHTokHalf4}, + {"min16float1",glslang::EHTokMin16float1}, + {"min16float2",glslang::EHTokMin16float2}, + {"min16float3",glslang::EHTokMin16float3}, + {"min16float4",glslang::EHTokMin16float4}, + {"min10float1",glslang::EHTokMin10float1}, + {"min10float2",glslang::EHTokMin10float2}, + {"min10float3",glslang::EHTokMin10float3}, + {"min10float4",glslang::EHTokMin10float4}, + {"min16int1",glslang::EHTokMin16int1}, + {"min16int2",glslang::EHTokMin16int2}, + {"min16int3",glslang::EHTokMin16int3}, + {"min16int4",glslang::EHTokMin16int4}, + {"min12int1",glslang::EHTokMin12int1}, + {"min12int2",glslang::EHTokMin12int2}, + {"min12int3",glslang::EHTokMin12int3}, + {"min12int4",glslang::EHTokMin12int4}, + {"min16uint1",glslang::EHTokMin16uint1}, + {"min16uint2",glslang::EHTokMin16uint2}, + {"min16uint3",glslang::EHTokMin16uint3}, + {"min16uint4",glslang::EHTokMin16uint4}, + + {"bool1x1",glslang::EHTokBool1x1}, + {"bool1x2",glslang::EHTokBool1x2}, + {"bool1x3",glslang::EHTokBool1x3}, + {"bool1x4",glslang::EHTokBool1x4}, + {"bool2x1",glslang::EHTokBool2x1}, + {"bool2x2",glslang::EHTokBool2x2}, + {"bool2x3",glslang::EHTokBool2x3}, + {"bool2x4",glslang::EHTokBool2x4}, + {"bool3x1",glslang::EHTokBool3x1}, + {"bool3x2",glslang::EHTokBool3x2}, + {"bool3x3",glslang::EHTokBool3x3}, + {"bool3x4",glslang::EHTokBool3x4}, + {"bool4x1",glslang::EHTokBool4x1}, + {"bool4x2",glslang::EHTokBool4x2}, + {"bool4x3",glslang::EHTokBool4x3}, + {"bool4x4",glslang::EHTokBool4x4}, + {"int1x1",glslang::EHTokInt1x1}, + {"int1x2",glslang::EHTokInt1x2}, + {"int1x3",glslang::EHTokInt1x3}, + {"int1x4",glslang::EHTokInt1x4}, + {"int2x1",glslang::EHTokInt2x1}, + {"int2x2",glslang::EHTokInt2x2}, + {"int2x3",glslang::EHTokInt2x3}, + {"int2x4",glslang::EHTokInt2x4}, + {"int3x1",glslang::EHTokInt3x1}, + {"int3x2",glslang::EHTokInt3x2}, + {"int3x3",glslang::EHTokInt3x3}, + {"int3x4",glslang::EHTokInt3x4}, + {"int4x1",glslang::EHTokInt4x1}, + {"int4x2",glslang::EHTokInt4x2}, + {"int4x3",glslang::EHTokInt4x3}, + {"int4x4",glslang::EHTokInt4x4}, + {"uint1x1",glslang::EHTokUint1x1}, + {"uint1x2",glslang::EHTokUint1x2}, + {"uint1x3",glslang::EHTokUint1x3}, + {"uint1x4",glslang::EHTokUint1x4}, + {"uint2x1",glslang::EHTokUint2x1}, + {"uint2x2",glslang::EHTokUint2x2}, + {"uint2x3",glslang::EHTokUint2x3}, + {"uint2x4",glslang::EHTokUint2x4}, + {"uint3x1",glslang::EHTokUint3x1}, + {"uint3x2",glslang::EHTokUint3x2}, + {"uint3x3",glslang::EHTokUint3x3}, + {"uint3x4",glslang::EHTokUint3x4}, + {"uint4x1",glslang::EHTokUint4x1}, + {"uint4x2",glslang::EHTokUint4x2}, + {"uint4x3",glslang::EHTokUint4x3}, + {"uint4x4",glslang::EHTokUint4x4}, + {"bool1x1",glslang::EHTokBool1x1}, + {"bool1x2",glslang::EHTokBool1x2}, + {"bool1x3",glslang::EHTokBool1x3}, + {"bool1x4",glslang::EHTokBool1x4}, + {"bool2x1",glslang::EHTokBool2x1}, + {"bool2x2",glslang::EHTokBool2x2}, + {"bool2x3",glslang::EHTokBool2x3}, + {"bool2x4",glslang::EHTokBool2x4}, + {"bool3x1",glslang::EHTokBool3x1}, + {"bool3x2",glslang::EHTokBool3x2}, + {"bool3x3",glslang::EHTokBool3x3}, + {"bool3x4",glslang::EHTokBool3x4}, + {"bool4x1",glslang::EHTokBool4x1}, + {"bool4x2",glslang::EHTokBool4x2}, + {"bool4x3",glslang::EHTokBool4x3}, + {"bool4x4",glslang::EHTokBool4x4}, + {"float1x1",glslang::EHTokFloat1x1}, + {"float1x2",glslang::EHTokFloat1x2}, + {"float1x3",glslang::EHTokFloat1x3}, + {"float1x4",glslang::EHTokFloat1x4}, + {"float2x1",glslang::EHTokFloat2x1}, + {"float2x2",glslang::EHTokFloat2x2}, + {"float2x3",glslang::EHTokFloat2x3}, + {"float2x4",glslang::EHTokFloat2x4}, + {"float3x1",glslang::EHTokFloat3x1}, + {"float3x2",glslang::EHTokFloat3x2}, + {"float3x3",glslang::EHTokFloat3x3}, + {"float3x4",glslang::EHTokFloat3x4}, + {"float4x1",glslang::EHTokFloat4x1}, + {"float4x2",glslang::EHTokFloat4x2}, + {"float4x3",glslang::EHTokFloat4x3}, + {"float4x4",glslang::EHTokFloat4x4}, + {"half1x1",glslang::EHTokHalf1x1}, + {"half1x2",glslang::EHTokHalf1x2}, + {"half1x3",glslang::EHTokHalf1x3}, + {"half1x4",glslang::EHTokHalf1x4}, + {"half2x1",glslang::EHTokHalf2x1}, + {"half2x2",glslang::EHTokHalf2x2}, + {"half2x3",glslang::EHTokHalf2x3}, + {"half2x4",glslang::EHTokHalf2x4}, + {"half3x1",glslang::EHTokHalf3x1}, + {"half3x2",glslang::EHTokHalf3x2}, + {"half3x3",glslang::EHTokHalf3x3}, + {"half3x4",glslang::EHTokHalf3x4}, + {"half4x1",glslang::EHTokHalf4x1}, + {"half4x2",glslang::EHTokHalf4x2}, + {"half4x3",glslang::EHTokHalf4x3}, + {"half4x4",glslang::EHTokHalf4x4}, + {"double1x1",glslang::EHTokDouble1x1}, + {"double1x2",glslang::EHTokDouble1x2}, + {"double1x3",glslang::EHTokDouble1x3}, + {"double1x4",glslang::EHTokDouble1x4}, + {"double2x1",glslang::EHTokDouble2x1}, + {"double2x2",glslang::EHTokDouble2x2}, + {"double2x3",glslang::EHTokDouble2x3}, + {"double2x4",glslang::EHTokDouble2x4}, + {"double3x1",glslang::EHTokDouble3x1}, + {"double3x2",glslang::EHTokDouble3x2}, + {"double3x3",glslang::EHTokDouble3x3}, + {"double3x4",glslang::EHTokDouble3x4}, + {"double4x1",glslang::EHTokDouble4x1}, + {"double4x2",glslang::EHTokDouble4x2}, + {"double4x3",glslang::EHTokDouble4x3}, + {"double4x4",glslang::EHTokDouble4x4}, + {"min16float1x1",glslang::EHTokMin16float1x1}, + {"min16float1x2",glslang::EHTokMin16float1x2}, + {"min16float1x3",glslang::EHTokMin16float1x3}, + {"min16float1x4",glslang::EHTokMin16float1x4}, + {"min16float2x1",glslang::EHTokMin16float2x1}, + {"min16float2x2",glslang::EHTokMin16float2x2}, + {"min16float2x3",glslang::EHTokMin16float2x3}, + {"min16float2x4",glslang::EHTokMin16float2x4}, + {"min16float3x1",glslang::EHTokMin16float3x1}, + {"min16float3x2",glslang::EHTokMin16float3x2}, + {"min16float3x3",glslang::EHTokMin16float3x3}, + {"min16float3x4",glslang::EHTokMin16float3x4}, + {"min16float4x1",glslang::EHTokMin16float4x1}, + {"min16float4x2",glslang::EHTokMin16float4x2}, + {"min16float4x3",glslang::EHTokMin16float4x3}, + {"min16float4x4",glslang::EHTokMin16float4x4}, + {"min10float1x1",glslang::EHTokMin10float1x1}, + {"min10float1x2",glslang::EHTokMin10float1x2}, + {"min10float1x3",glslang::EHTokMin10float1x3}, + {"min10float1x4",glslang::EHTokMin10float1x4}, + {"min10float2x1",glslang::EHTokMin10float2x1}, + {"min10float2x2",glslang::EHTokMin10float2x2}, + {"min10float2x3",glslang::EHTokMin10float2x3}, + {"min10float2x4",glslang::EHTokMin10float2x4}, + {"min10float3x1",glslang::EHTokMin10float3x1}, + {"min10float3x2",glslang::EHTokMin10float3x2}, + {"min10float3x3",glslang::EHTokMin10float3x3}, + {"min10float3x4",glslang::EHTokMin10float3x4}, + {"min10float4x1",glslang::EHTokMin10float4x1}, + {"min10float4x2",glslang::EHTokMin10float4x2}, + {"min10float4x3",glslang::EHTokMin10float4x3}, + {"min10float4x4",glslang::EHTokMin10float4x4}, + {"min16int1x1",glslang::EHTokMin16int1x1}, + {"min16int1x2",glslang::EHTokMin16int1x2}, + {"min16int1x3",glslang::EHTokMin16int1x3}, + {"min16int1x4",glslang::EHTokMin16int1x4}, + {"min16int2x1",glslang::EHTokMin16int2x1}, + {"min16int2x2",glslang::EHTokMin16int2x2}, + {"min16int2x3",glslang::EHTokMin16int2x3}, + {"min16int2x4",glslang::EHTokMin16int2x4}, + {"min16int3x1",glslang::EHTokMin16int3x1}, + {"min16int3x2",glslang::EHTokMin16int3x2}, + {"min16int3x3",glslang::EHTokMin16int3x3}, + {"min16int3x4",glslang::EHTokMin16int3x4}, + {"min16int4x1",glslang::EHTokMin16int4x1}, + {"min16int4x2",glslang::EHTokMin16int4x2}, + {"min16int4x3",glslang::EHTokMin16int4x3}, + {"min16int4x4",glslang::EHTokMin16int4x4}, + {"min12int1x1",glslang::EHTokMin12int1x1}, + {"min12int1x2",glslang::EHTokMin12int1x2}, + {"min12int1x3",glslang::EHTokMin12int1x3}, + {"min12int1x4",glslang::EHTokMin12int1x4}, + {"min12int2x1",glslang::EHTokMin12int2x1}, + {"min12int2x2",glslang::EHTokMin12int2x2}, + {"min12int2x3",glslang::EHTokMin12int2x3}, + {"min12int2x4",glslang::EHTokMin12int2x4}, + {"min12int3x1",glslang::EHTokMin12int3x1}, + {"min12int3x2",glslang::EHTokMin12int3x2}, + {"min12int3x3",glslang::EHTokMin12int3x3}, + {"min12int3x4",glslang::EHTokMin12int3x4}, + {"min12int4x1",glslang::EHTokMin12int4x1}, + {"min12int4x2",glslang::EHTokMin12int4x2}, + {"min12int4x3",glslang::EHTokMin12int4x3}, + {"min12int4x4",glslang::EHTokMin12int4x4}, + {"min16uint1x1",glslang::EHTokMin16uint1x1}, + {"min16uint1x2",glslang::EHTokMin16uint1x2}, + {"min16uint1x3",glslang::EHTokMin16uint1x3}, + {"min16uint1x4",glslang::EHTokMin16uint1x4}, + {"min16uint2x1",glslang::EHTokMin16uint2x1}, + {"min16uint2x2",glslang::EHTokMin16uint2x2}, + {"min16uint2x3",glslang::EHTokMin16uint2x3}, + {"min16uint2x4",glslang::EHTokMin16uint2x4}, + {"min16uint3x1",glslang::EHTokMin16uint3x1}, + {"min16uint3x2",glslang::EHTokMin16uint3x2}, + {"min16uint3x3",glslang::EHTokMin16uint3x3}, + {"min16uint3x4",glslang::EHTokMin16uint3x4}, + {"min16uint4x1",glslang::EHTokMin16uint4x1}, + {"min16uint4x2",glslang::EHTokMin16uint4x2}, + {"min16uint4x3",glslang::EHTokMin16uint4x3}, + {"min16uint4x4",glslang::EHTokMin16uint4x4}, + + {"sampler",glslang::EHTokSampler}, + {"sampler1D",glslang::EHTokSampler1d}, + {"sampler2D",glslang::EHTokSampler2d}, + {"sampler3D",glslang::EHTokSampler3d}, + {"samplerCUBE",glslang::EHTokSamplerCube}, + {"sampler_state",glslang::EHTokSamplerState}, + {"SamplerState",glslang::EHTokSamplerState}, + {"SamplerComparisonState",glslang::EHTokSamplerComparisonState}, + {"texture",glslang::EHTokTexture}, + {"Texture1D",glslang::EHTokTexture1d}, + {"Texture1DArray",glslang::EHTokTexture1darray}, + {"Texture2D",glslang::EHTokTexture2d}, + {"Texture2DArray",glslang::EHTokTexture2darray}, + {"Texture3D",glslang::EHTokTexture3d}, + {"TextureCube",glslang::EHTokTextureCube}, + {"TextureCubeArray",glslang::EHTokTextureCubearray}, + {"Texture2DMS",glslang::EHTokTexture2DMS}, + {"Texture2DMSArray",glslang::EHTokTexture2DMSarray}, + {"RWTexture1D",glslang::EHTokRWTexture1d}, + {"RWTexture1DArray",glslang::EHTokRWTexture1darray}, + {"RWTexture2D",glslang::EHTokRWTexture2d}, + {"RWTexture2DArray",glslang::EHTokRWTexture2darray}, + {"RWTexture3D",glslang::EHTokRWTexture3d}, + {"RWBuffer",glslang::EHTokRWBuffer}, + {"SubpassInput",glslang::EHTokSubpassInput}, + {"SubpassInputMS",glslang::EHTokSubpassInputMS}, + + {"AppendStructuredBuffer",glslang::EHTokAppendStructuredBuffer}, + {"ByteAddressBuffer",glslang::EHTokByteAddressBuffer}, + {"ConsumeStructuredBuffer",glslang::EHTokConsumeStructuredBuffer}, + {"RWByteAddressBuffer",glslang::EHTokRWByteAddressBuffer}, + {"RWStructuredBuffer",glslang::EHTokRWStructuredBuffer}, + {"StructuredBuffer",glslang::EHTokStructuredBuffer}, + {"TextureBuffer",glslang::EHTokTextureBuffer}, + + {"class",glslang::EHTokClass}, + {"struct",glslang::EHTokStruct}, + {"cbuffer",glslang::EHTokCBuffer}, + {"ConstantBuffer",glslang::EHTokConstantBuffer}, + {"tbuffer",glslang::EHTokTBuffer}, + {"typedef",glslang::EHTokTypedef}, + {"this",glslang::EHTokThis}, + {"namespace",glslang::EHTokNamespace}, + + {"true",glslang::EHTokBoolConstant}, + {"false",glslang::EHTokBoolConstant}, + + {"for",glslang::EHTokFor}, + {"do",glslang::EHTokDo}, + {"while",glslang::EHTokWhile}, + {"break",glslang::EHTokBreak}, + {"continue",glslang::EHTokContinue}, + {"if",glslang::EHTokIf}, + {"else",glslang::EHTokElse}, + {"discard",glslang::EHTokDiscard}, + {"return",glslang::EHTokReturn}, + {"switch",glslang::EHTokSwitch}, + {"case",glslang::EHTokCase}, + {"default",glslang::EHTokDefault}, }; -namespace glslang { - -void HlslScanContext::fillInKeywordMap() -{ - if (KeywordMap != nullptr) { - // this is really an error, as this should called only once per process - // but, the only risk is if two threads called simultaneously - return; - } - KeywordMap = new std::unordered_map; - - (*KeywordMap)["static"] = EHTokStatic; - (*KeywordMap)["const"] = EHTokConst; - (*KeywordMap)["unorm"] = EHTokUnorm; - (*KeywordMap)["snorm"] = EHTokSNorm; - (*KeywordMap)["extern"] = EHTokExtern; - (*KeywordMap)["uniform"] = EHTokUniform; - (*KeywordMap)["volatile"] = EHTokVolatile; - (*KeywordMap)["precise"] = EHTokPrecise; - (*KeywordMap)["shared"] = EHTokShared; - (*KeywordMap)["groupshared"] = EHTokGroupShared; - (*KeywordMap)["linear"] = EHTokLinear; - (*KeywordMap)["centroid"] = EHTokCentroid; - (*KeywordMap)["nointerpolation"] = EHTokNointerpolation; - (*KeywordMap)["noperspective"] = EHTokNoperspective; - (*KeywordMap)["sample"] = EHTokSample; - (*KeywordMap)["row_major"] = EHTokRowMajor; - (*KeywordMap)["column_major"] = EHTokColumnMajor; - (*KeywordMap)["packoffset"] = EHTokPackOffset; - (*KeywordMap)["in"] = EHTokIn; - (*KeywordMap)["out"] = EHTokOut; - (*KeywordMap)["inout"] = EHTokInOut; - (*KeywordMap)["layout"] = EHTokLayout; - (*KeywordMap)["globallycoherent"] = EHTokGloballyCoherent; - (*KeywordMap)["inline"] = EHTokInline; - - (*KeywordMap)["point"] = EHTokPoint; - (*KeywordMap)["line"] = EHTokLine; - (*KeywordMap)["triangle"] = EHTokTriangle; - (*KeywordMap)["lineadj"] = EHTokLineAdj; - (*KeywordMap)["triangleadj"] = EHTokTriangleAdj; - - (*KeywordMap)["PointStream"] = EHTokPointStream; - (*KeywordMap)["LineStream"] = EHTokLineStream; - (*KeywordMap)["TriangleStream"] = EHTokTriangleStream; - - (*KeywordMap)["InputPatch"] = EHTokInputPatch; - (*KeywordMap)["OutputPatch"] = EHTokOutputPatch; - - (*KeywordMap)["Buffer"] = EHTokBuffer; - (*KeywordMap)["vector"] = EHTokVector; - (*KeywordMap)["matrix"] = EHTokMatrix; - - (*KeywordMap)["void"] = EHTokVoid; - (*KeywordMap)["string"] = EHTokString; - (*KeywordMap)["bool"] = EHTokBool; - (*KeywordMap)["int"] = EHTokInt; - (*KeywordMap)["uint"] = EHTokUint; - (*KeywordMap)["uint64_t"] = EHTokUint64; - (*KeywordMap)["dword"] = EHTokDword; - (*KeywordMap)["half"] = EHTokHalf; - (*KeywordMap)["float"] = EHTokFloat; - (*KeywordMap)["double"] = EHTokDouble; - (*KeywordMap)["min16float"] = EHTokMin16float; - (*KeywordMap)["min10float"] = EHTokMin10float; - (*KeywordMap)["min16int"] = EHTokMin16int; - (*KeywordMap)["min12int"] = EHTokMin12int; - (*KeywordMap)["min16uint"] = EHTokMin16uint; - - (*KeywordMap)["bool1"] = EHTokBool1; - (*KeywordMap)["bool2"] = EHTokBool2; - (*KeywordMap)["bool3"] = EHTokBool3; - (*KeywordMap)["bool4"] = EHTokBool4; - (*KeywordMap)["float1"] = EHTokFloat1; - (*KeywordMap)["float2"] = EHTokFloat2; - (*KeywordMap)["float3"] = EHTokFloat3; - (*KeywordMap)["float4"] = EHTokFloat4; - (*KeywordMap)["int1"] = EHTokInt1; - (*KeywordMap)["int2"] = EHTokInt2; - (*KeywordMap)["int3"] = EHTokInt3; - (*KeywordMap)["int4"] = EHTokInt4; - (*KeywordMap)["double1"] = EHTokDouble1; - (*KeywordMap)["double2"] = EHTokDouble2; - (*KeywordMap)["double3"] = EHTokDouble3; - (*KeywordMap)["double4"] = EHTokDouble4; - (*KeywordMap)["uint1"] = EHTokUint1; - (*KeywordMap)["uint2"] = EHTokUint2; - (*KeywordMap)["uint3"] = EHTokUint3; - (*KeywordMap)["uint4"] = EHTokUint4; - - (*KeywordMap)["half1"] = EHTokHalf1; - (*KeywordMap)["half2"] = EHTokHalf2; - (*KeywordMap)["half3"] = EHTokHalf3; - (*KeywordMap)["half4"] = EHTokHalf4; - (*KeywordMap)["min16float1"] = EHTokMin16float1; - (*KeywordMap)["min16float2"] = EHTokMin16float2; - (*KeywordMap)["min16float3"] = EHTokMin16float3; - (*KeywordMap)["min16float4"] = EHTokMin16float4; - (*KeywordMap)["min10float1"] = EHTokMin10float1; - (*KeywordMap)["min10float2"] = EHTokMin10float2; - (*KeywordMap)["min10float3"] = EHTokMin10float3; - (*KeywordMap)["min10float4"] = EHTokMin10float4; - (*KeywordMap)["min16int1"] = EHTokMin16int1; - (*KeywordMap)["min16int2"] = EHTokMin16int2; - (*KeywordMap)["min16int3"] = EHTokMin16int3; - (*KeywordMap)["min16int4"] = EHTokMin16int4; - (*KeywordMap)["min12int1"] = EHTokMin12int1; - (*KeywordMap)["min12int2"] = EHTokMin12int2; - (*KeywordMap)["min12int3"] = EHTokMin12int3; - (*KeywordMap)["min12int4"] = EHTokMin12int4; - (*KeywordMap)["min16uint1"] = EHTokMin16uint1; - (*KeywordMap)["min16uint2"] = EHTokMin16uint2; - (*KeywordMap)["min16uint3"] = EHTokMin16uint3; - (*KeywordMap)["min16uint4"] = EHTokMin16uint4; - - (*KeywordMap)["bool1x1"] = EHTokBool1x1; - (*KeywordMap)["bool1x2"] = EHTokBool1x2; - (*KeywordMap)["bool1x3"] = EHTokBool1x3; - (*KeywordMap)["bool1x4"] = EHTokBool1x4; - (*KeywordMap)["bool2x1"] = EHTokBool2x1; - (*KeywordMap)["bool2x2"] = EHTokBool2x2; - (*KeywordMap)["bool2x3"] = EHTokBool2x3; - (*KeywordMap)["bool2x4"] = EHTokBool2x4; - (*KeywordMap)["bool3x1"] = EHTokBool3x1; - (*KeywordMap)["bool3x2"] = EHTokBool3x2; - (*KeywordMap)["bool3x3"] = EHTokBool3x3; - (*KeywordMap)["bool3x4"] = EHTokBool3x4; - (*KeywordMap)["bool4x1"] = EHTokBool4x1; - (*KeywordMap)["bool4x2"] = EHTokBool4x2; - (*KeywordMap)["bool4x3"] = EHTokBool4x3; - (*KeywordMap)["bool4x4"] = EHTokBool4x4; - (*KeywordMap)["int1x1"] = EHTokInt1x1; - (*KeywordMap)["int1x2"] = EHTokInt1x2; - (*KeywordMap)["int1x3"] = EHTokInt1x3; - (*KeywordMap)["int1x4"] = EHTokInt1x4; - (*KeywordMap)["int2x1"] = EHTokInt2x1; - (*KeywordMap)["int2x2"] = EHTokInt2x2; - (*KeywordMap)["int2x3"] = EHTokInt2x3; - (*KeywordMap)["int2x4"] = EHTokInt2x4; - (*KeywordMap)["int3x1"] = EHTokInt3x1; - (*KeywordMap)["int3x2"] = EHTokInt3x2; - (*KeywordMap)["int3x3"] = EHTokInt3x3; - (*KeywordMap)["int3x4"] = EHTokInt3x4; - (*KeywordMap)["int4x1"] = EHTokInt4x1; - (*KeywordMap)["int4x2"] = EHTokInt4x2; - (*KeywordMap)["int4x3"] = EHTokInt4x3; - (*KeywordMap)["int4x4"] = EHTokInt4x4; - (*KeywordMap)["uint1x1"] = EHTokUint1x1; - (*KeywordMap)["uint1x2"] = EHTokUint1x2; - (*KeywordMap)["uint1x3"] = EHTokUint1x3; - (*KeywordMap)["uint1x4"] = EHTokUint1x4; - (*KeywordMap)["uint2x1"] = EHTokUint2x1; - (*KeywordMap)["uint2x2"] = EHTokUint2x2; - (*KeywordMap)["uint2x3"] = EHTokUint2x3; - (*KeywordMap)["uint2x4"] = EHTokUint2x4; - (*KeywordMap)["uint3x1"] = EHTokUint3x1; - (*KeywordMap)["uint3x2"] = EHTokUint3x2; - (*KeywordMap)["uint3x3"] = EHTokUint3x3; - (*KeywordMap)["uint3x4"] = EHTokUint3x4; - (*KeywordMap)["uint4x1"] = EHTokUint4x1; - (*KeywordMap)["uint4x2"] = EHTokUint4x2; - (*KeywordMap)["uint4x3"] = EHTokUint4x3; - (*KeywordMap)["uint4x4"] = EHTokUint4x4; - (*KeywordMap)["bool1x1"] = EHTokBool1x1; - (*KeywordMap)["bool1x2"] = EHTokBool1x2; - (*KeywordMap)["bool1x3"] = EHTokBool1x3; - (*KeywordMap)["bool1x4"] = EHTokBool1x4; - (*KeywordMap)["bool2x1"] = EHTokBool2x1; - (*KeywordMap)["bool2x2"] = EHTokBool2x2; - (*KeywordMap)["bool2x3"] = EHTokBool2x3; - (*KeywordMap)["bool2x4"] = EHTokBool2x4; - (*KeywordMap)["bool3x1"] = EHTokBool3x1; - (*KeywordMap)["bool3x2"] = EHTokBool3x2; - (*KeywordMap)["bool3x3"] = EHTokBool3x3; - (*KeywordMap)["bool3x4"] = EHTokBool3x4; - (*KeywordMap)["bool4x1"] = EHTokBool4x1; - (*KeywordMap)["bool4x2"] = EHTokBool4x2; - (*KeywordMap)["bool4x3"] = EHTokBool4x3; - (*KeywordMap)["bool4x4"] = EHTokBool4x4; - (*KeywordMap)["float1x1"] = EHTokFloat1x1; - (*KeywordMap)["float1x2"] = EHTokFloat1x2; - (*KeywordMap)["float1x3"] = EHTokFloat1x3; - (*KeywordMap)["float1x4"] = EHTokFloat1x4; - (*KeywordMap)["float2x1"] = EHTokFloat2x1; - (*KeywordMap)["float2x2"] = EHTokFloat2x2; - (*KeywordMap)["float2x3"] = EHTokFloat2x3; - (*KeywordMap)["float2x4"] = EHTokFloat2x4; - (*KeywordMap)["float3x1"] = EHTokFloat3x1; - (*KeywordMap)["float3x2"] = EHTokFloat3x2; - (*KeywordMap)["float3x3"] = EHTokFloat3x3; - (*KeywordMap)["float3x4"] = EHTokFloat3x4; - (*KeywordMap)["float4x1"] = EHTokFloat4x1; - (*KeywordMap)["float4x2"] = EHTokFloat4x2; - (*KeywordMap)["float4x3"] = EHTokFloat4x3; - (*KeywordMap)["float4x4"] = EHTokFloat4x4; - (*KeywordMap)["half1x1"] = EHTokHalf1x1; - (*KeywordMap)["half1x2"] = EHTokHalf1x2; - (*KeywordMap)["half1x3"] = EHTokHalf1x3; - (*KeywordMap)["half1x4"] = EHTokHalf1x4; - (*KeywordMap)["half2x1"] = EHTokHalf2x1; - (*KeywordMap)["half2x2"] = EHTokHalf2x2; - (*KeywordMap)["half2x3"] = EHTokHalf2x3; - (*KeywordMap)["half2x4"] = EHTokHalf2x4; - (*KeywordMap)["half3x1"] = EHTokHalf3x1; - (*KeywordMap)["half3x2"] = EHTokHalf3x2; - (*KeywordMap)["half3x3"] = EHTokHalf3x3; - (*KeywordMap)["half3x4"] = EHTokHalf3x4; - (*KeywordMap)["half4x1"] = EHTokHalf4x1; - (*KeywordMap)["half4x2"] = EHTokHalf4x2; - (*KeywordMap)["half4x3"] = EHTokHalf4x3; - (*KeywordMap)["half4x4"] = EHTokHalf4x4; - (*KeywordMap)["double1x1"] = EHTokDouble1x1; - (*KeywordMap)["double1x2"] = EHTokDouble1x2; - (*KeywordMap)["double1x3"] = EHTokDouble1x3; - (*KeywordMap)["double1x4"] = EHTokDouble1x4; - (*KeywordMap)["double2x1"] = EHTokDouble2x1; - (*KeywordMap)["double2x2"] = EHTokDouble2x2; - (*KeywordMap)["double2x3"] = EHTokDouble2x3; - (*KeywordMap)["double2x4"] = EHTokDouble2x4; - (*KeywordMap)["double3x1"] = EHTokDouble3x1; - (*KeywordMap)["double3x2"] = EHTokDouble3x2; - (*KeywordMap)["double3x3"] = EHTokDouble3x3; - (*KeywordMap)["double3x4"] = EHTokDouble3x4; - (*KeywordMap)["double4x1"] = EHTokDouble4x1; - (*KeywordMap)["double4x2"] = EHTokDouble4x2; - (*KeywordMap)["double4x3"] = EHTokDouble4x3; - (*KeywordMap)["double4x4"] = EHTokDouble4x4; - (*KeywordMap)["min16float1x1"] = EHTokMin16float1x1; - (*KeywordMap)["min16float1x2"] = EHTokMin16float1x2; - (*KeywordMap)["min16float1x3"] = EHTokMin16float1x3; - (*KeywordMap)["min16float1x4"] = EHTokMin16float1x4; - (*KeywordMap)["min16float2x1"] = EHTokMin16float2x1; - (*KeywordMap)["min16float2x2"] = EHTokMin16float2x2; - (*KeywordMap)["min16float2x3"] = EHTokMin16float2x3; - (*KeywordMap)["min16float2x4"] = EHTokMin16float2x4; - (*KeywordMap)["min16float3x1"] = EHTokMin16float3x1; - (*KeywordMap)["min16float3x2"] = EHTokMin16float3x2; - (*KeywordMap)["min16float3x3"] = EHTokMin16float3x3; - (*KeywordMap)["min16float3x4"] = EHTokMin16float3x4; - (*KeywordMap)["min16float4x1"] = EHTokMin16float4x1; - (*KeywordMap)["min16float4x2"] = EHTokMin16float4x2; - (*KeywordMap)["min16float4x3"] = EHTokMin16float4x3; - (*KeywordMap)["min16float4x4"] = EHTokMin16float4x4; - (*KeywordMap)["min10float1x1"] = EHTokMin10float1x1; - (*KeywordMap)["min10float1x2"] = EHTokMin10float1x2; - (*KeywordMap)["min10float1x3"] = EHTokMin10float1x3; - (*KeywordMap)["min10float1x4"] = EHTokMin10float1x4; - (*KeywordMap)["min10float2x1"] = EHTokMin10float2x1; - (*KeywordMap)["min10float2x2"] = EHTokMin10float2x2; - (*KeywordMap)["min10float2x3"] = EHTokMin10float2x3; - (*KeywordMap)["min10float2x4"] = EHTokMin10float2x4; - (*KeywordMap)["min10float3x1"] = EHTokMin10float3x1; - (*KeywordMap)["min10float3x2"] = EHTokMin10float3x2; - (*KeywordMap)["min10float3x3"] = EHTokMin10float3x3; - (*KeywordMap)["min10float3x4"] = EHTokMin10float3x4; - (*KeywordMap)["min10float4x1"] = EHTokMin10float4x1; - (*KeywordMap)["min10float4x2"] = EHTokMin10float4x2; - (*KeywordMap)["min10float4x3"] = EHTokMin10float4x3; - (*KeywordMap)["min10float4x4"] = EHTokMin10float4x4; - (*KeywordMap)["min16int1x1"] = EHTokMin16int1x1; - (*KeywordMap)["min16int1x2"] = EHTokMin16int1x2; - (*KeywordMap)["min16int1x3"] = EHTokMin16int1x3; - (*KeywordMap)["min16int1x4"] = EHTokMin16int1x4; - (*KeywordMap)["min16int2x1"] = EHTokMin16int2x1; - (*KeywordMap)["min16int2x2"] = EHTokMin16int2x2; - (*KeywordMap)["min16int2x3"] = EHTokMin16int2x3; - (*KeywordMap)["min16int2x4"] = EHTokMin16int2x4; - (*KeywordMap)["min16int3x1"] = EHTokMin16int3x1; - (*KeywordMap)["min16int3x2"] = EHTokMin16int3x2; - (*KeywordMap)["min16int3x3"] = EHTokMin16int3x3; - (*KeywordMap)["min16int3x4"] = EHTokMin16int3x4; - (*KeywordMap)["min16int4x1"] = EHTokMin16int4x1; - (*KeywordMap)["min16int4x2"] = EHTokMin16int4x2; - (*KeywordMap)["min16int4x3"] = EHTokMin16int4x3; - (*KeywordMap)["min16int4x4"] = EHTokMin16int4x4; - (*KeywordMap)["min12int1x1"] = EHTokMin12int1x1; - (*KeywordMap)["min12int1x2"] = EHTokMin12int1x2; - (*KeywordMap)["min12int1x3"] = EHTokMin12int1x3; - (*KeywordMap)["min12int1x4"] = EHTokMin12int1x4; - (*KeywordMap)["min12int2x1"] = EHTokMin12int2x1; - (*KeywordMap)["min12int2x2"] = EHTokMin12int2x2; - (*KeywordMap)["min12int2x3"] = EHTokMin12int2x3; - (*KeywordMap)["min12int2x4"] = EHTokMin12int2x4; - (*KeywordMap)["min12int3x1"] = EHTokMin12int3x1; - (*KeywordMap)["min12int3x2"] = EHTokMin12int3x2; - (*KeywordMap)["min12int3x3"] = EHTokMin12int3x3; - (*KeywordMap)["min12int3x4"] = EHTokMin12int3x4; - (*KeywordMap)["min12int4x1"] = EHTokMin12int4x1; - (*KeywordMap)["min12int4x2"] = EHTokMin12int4x2; - (*KeywordMap)["min12int4x3"] = EHTokMin12int4x3; - (*KeywordMap)["min12int4x4"] = EHTokMin12int4x4; - (*KeywordMap)["min16uint1x1"] = EHTokMin16uint1x1; - (*KeywordMap)["min16uint1x2"] = EHTokMin16uint1x2; - (*KeywordMap)["min16uint1x3"] = EHTokMin16uint1x3; - (*KeywordMap)["min16uint1x4"] = EHTokMin16uint1x4; - (*KeywordMap)["min16uint2x1"] = EHTokMin16uint2x1; - (*KeywordMap)["min16uint2x2"] = EHTokMin16uint2x2; - (*KeywordMap)["min16uint2x3"] = EHTokMin16uint2x3; - (*KeywordMap)["min16uint2x4"] = EHTokMin16uint2x4; - (*KeywordMap)["min16uint3x1"] = EHTokMin16uint3x1; - (*KeywordMap)["min16uint3x2"] = EHTokMin16uint3x2; - (*KeywordMap)["min16uint3x3"] = EHTokMin16uint3x3; - (*KeywordMap)["min16uint3x4"] = EHTokMin16uint3x4; - (*KeywordMap)["min16uint4x1"] = EHTokMin16uint4x1; - (*KeywordMap)["min16uint4x2"] = EHTokMin16uint4x2; - (*KeywordMap)["min16uint4x3"] = EHTokMin16uint4x3; - (*KeywordMap)["min16uint4x4"] = EHTokMin16uint4x4; - - (*KeywordMap)["sampler"] = EHTokSampler; - (*KeywordMap)["sampler1D"] = EHTokSampler1d; - (*KeywordMap)["sampler2D"] = EHTokSampler2d; - (*KeywordMap)["sampler3D"] = EHTokSampler3d; - (*KeywordMap)["samplerCUBE"] = EHTokSamplerCube; - (*KeywordMap)["sampler_state"] = EHTokSamplerState; - (*KeywordMap)["SamplerState"] = EHTokSamplerState; - (*KeywordMap)["SamplerComparisonState"] = EHTokSamplerComparisonState; - (*KeywordMap)["texture"] = EHTokTexture; - (*KeywordMap)["Texture1D"] = EHTokTexture1d; - (*KeywordMap)["Texture1DArray"] = EHTokTexture1darray; - (*KeywordMap)["Texture2D"] = EHTokTexture2d; - (*KeywordMap)["Texture2DArray"] = EHTokTexture2darray; - (*KeywordMap)["Texture3D"] = EHTokTexture3d; - (*KeywordMap)["TextureCube"] = EHTokTextureCube; - (*KeywordMap)["TextureCubeArray"] = EHTokTextureCubearray; - (*KeywordMap)["Texture2DMS"] = EHTokTexture2DMS; - (*KeywordMap)["Texture2DMSArray"] = EHTokTexture2DMSarray; - (*KeywordMap)["RWTexture1D"] = EHTokRWTexture1d; - (*KeywordMap)["RWTexture1DArray"] = EHTokRWTexture1darray; - (*KeywordMap)["RWTexture2D"] = EHTokRWTexture2d; - (*KeywordMap)["RWTexture2DArray"] = EHTokRWTexture2darray; - (*KeywordMap)["RWTexture3D"] = EHTokRWTexture3d; - (*KeywordMap)["RWBuffer"] = EHTokRWBuffer; - (*KeywordMap)["SubpassInput"] = EHTokSubpassInput; - (*KeywordMap)["SubpassInputMS"] = EHTokSubpassInputMS; - - (*KeywordMap)["AppendStructuredBuffer"] = EHTokAppendStructuredBuffer; - (*KeywordMap)["ByteAddressBuffer"] = EHTokByteAddressBuffer; - (*KeywordMap)["ConsumeStructuredBuffer"] = EHTokConsumeStructuredBuffer; - (*KeywordMap)["RWByteAddressBuffer"] = EHTokRWByteAddressBuffer; - (*KeywordMap)["RWStructuredBuffer"] = EHTokRWStructuredBuffer; - (*KeywordMap)["StructuredBuffer"] = EHTokStructuredBuffer; - (*KeywordMap)["TextureBuffer"] = EHTokTextureBuffer; - - (*KeywordMap)["class"] = EHTokClass; - (*KeywordMap)["struct"] = EHTokStruct; - (*KeywordMap)["cbuffer"] = EHTokCBuffer; - (*KeywordMap)["ConstantBuffer"] = EHTokConstantBuffer; - (*KeywordMap)["tbuffer"] = EHTokTBuffer; - (*KeywordMap)["typedef"] = EHTokTypedef; - (*KeywordMap)["this"] = EHTokThis; - (*KeywordMap)["namespace"] = EHTokNamespace; - - (*KeywordMap)["true"] = EHTokBoolConstant; - (*KeywordMap)["false"] = EHTokBoolConstant; - - (*KeywordMap)["for"] = EHTokFor; - (*KeywordMap)["do"] = EHTokDo; - (*KeywordMap)["while"] = EHTokWhile; - (*KeywordMap)["break"] = EHTokBreak; - (*KeywordMap)["continue"] = EHTokContinue; - (*KeywordMap)["if"] = EHTokIf; - (*KeywordMap)["else"] = EHTokElse; - (*KeywordMap)["discard"] = EHTokDiscard; - (*KeywordMap)["return"] = EHTokReturn; - (*KeywordMap)["switch"] = EHTokSwitch; - (*KeywordMap)["case"] = EHTokCase; - (*KeywordMap)["default"] = EHTokDefault; - - // TODO: get correct set here - ReservedSet = new std::unordered_set; - - ReservedSet->insert("auto"); - ReservedSet->insert("catch"); - ReservedSet->insert("char"); - ReservedSet->insert("const_cast"); - ReservedSet->insert("enum"); - ReservedSet->insert("explicit"); - ReservedSet->insert("friend"); - ReservedSet->insert("goto"); - ReservedSet->insert("long"); - ReservedSet->insert("mutable"); - ReservedSet->insert("new"); - ReservedSet->insert("operator"); - ReservedSet->insert("private"); - ReservedSet->insert("protected"); - ReservedSet->insert("public"); - ReservedSet->insert("reinterpret_cast"); - ReservedSet->insert("short"); - ReservedSet->insert("signed"); - ReservedSet->insert("sizeof"); - ReservedSet->insert("static_cast"); - ReservedSet->insert("template"); - ReservedSet->insert("throw"); - ReservedSet->insert("try"); - ReservedSet->insert("typename"); - ReservedSet->insert("union"); - ReservedSet->insert("unsigned"); - ReservedSet->insert("using"); - ReservedSet->insert("virtual"); - - SemanticMap = new std::unordered_map; +const std::unordered_set ReservedSet { + "auto", + "catch", + "char", + "const_cast", + "enum", + "explicit", + "friend", + "goto", + "long", + "mutable", + "new", + "operator", + "private", + "protected", + "public", + "reinterpret_cast", + "short", + "signed", + "sizeof", + "static_cast", + "template", + "throw", + "try", + "typename", + "union", + "unsigned", + "using", + "virtual", +}; +std::unordered_map SemanticMap { // in DX9, all outputs had to have a semantic associated with them, that was either consumed // by the system or was a specific register assignment @@ -494,48 +476,41 @@ void HlslScanContext::fillInKeywordMap() // Also, in DX10 if a SV value is present as the input of a stage, but isn't appropriate for that // stage, it would just be ignored as it is likely there as part of an output struct from one stage // to the next - bool bParseDX9 = false; - if (bParseDX9) { - (*SemanticMap)["PSIZE"] = EbvPointSize; - (*SemanticMap)["FOG"] = EbvFogFragCoord; - (*SemanticMap)["DEPTH"] = EbvFragDepth; - (*SemanticMap)["VFACE"] = EbvFace; - (*SemanticMap)["VPOS"] = EbvFragCoord; - } - - (*SemanticMap)["SV_POSITION"] = EbvPosition; - (*SemanticMap)["SV_VERTEXID"] = EbvVertexIndex; - (*SemanticMap)["SV_VIEWPORTARRAYINDEX"] = EbvViewportIndex; - (*SemanticMap)["SV_TESSFACTOR"] = EbvTessLevelOuter; - (*SemanticMap)["SV_SAMPLEINDEX"] = EbvSampleId; - (*SemanticMap)["SV_RENDERTARGETARRAYINDEX"] = EbvLayer; - (*SemanticMap)["SV_PRIMITIVEID"] = EbvPrimitiveId; - (*SemanticMap)["SV_OUTPUTCONTROLPOINTID"] = EbvInvocationId; - (*SemanticMap)["SV_ISFRONTFACE"] = EbvFace; - (*SemanticMap)["SV_INSTANCEID"] = EbvInstanceIndex; - (*SemanticMap)["SV_INSIDETESSFACTOR"] = EbvTessLevelInner; - (*SemanticMap)["SV_GSINSTANCEID"] = EbvInvocationId; - (*SemanticMap)["SV_DISPATCHTHREADID"] = EbvGlobalInvocationId; - (*SemanticMap)["SV_GROUPTHREADID"] = EbvLocalInvocationId; - (*SemanticMap)["SV_GROUPINDEX"] = EbvLocalInvocationIndex; - (*SemanticMap)["SV_GROUPID"] = EbvWorkGroupId; - (*SemanticMap)["SV_DOMAINLOCATION"] = EbvTessCoord; - (*SemanticMap)["SV_DEPTH"] = EbvFragDepth; - (*SemanticMap)["SV_COVERAGE"] = EbvSampleMask; - (*SemanticMap)["SV_DEPTHGREATEREQUAL"] = EbvFragDepthGreater; - (*SemanticMap)["SV_DEPTHLESSEQUAL"] = EbvFragDepthLesser; - (*SemanticMap)["SV_STENCILREF"] = EbvFragStencilRef; +#if 0 + (*SemanticMap)["PSIZE"] = EbvPointSize; + (*SemanticMap)["FOG"] = EbvFogFragCoord; + (*SemanticMap)["DEPTH"] = EbvFragDepth; + (*SemanticMap)["VFACE"] = EbvFace; + (*SemanticMap)["VPOS"] = EbvFragCoord; +#endif + + {"SV_POSITION",glslang::EbvPosition}, + {"SV_VERTEXID",glslang::EbvVertexIndex}, + {"SV_VIEWPORTARRAYINDEX",glslang::EbvViewportIndex}, + {"SV_TESSFACTOR",glslang::EbvTessLevelOuter}, + {"SV_SAMPLEINDEX",glslang::EbvSampleId}, + {"SV_RENDERTARGETARRAYINDEX",glslang::EbvLayer}, + {"SV_PRIMITIVEID",glslang::EbvPrimitiveId}, + {"SV_OUTPUTCONTROLPOINTID",glslang::EbvInvocationId}, + {"SV_ISFRONTFACE",glslang::EbvFace}, + {"SV_VIEWID",glslang::EbvViewIndex}, + {"SV_INSTANCEID",glslang::EbvInstanceIndex}, + {"SV_INSIDETESSFACTOR",glslang::EbvTessLevelInner}, + {"SV_GSINSTANCEID",glslang::EbvInvocationId}, + {"SV_DISPATCHTHREADID",glslang::EbvGlobalInvocationId}, + {"SV_GROUPTHREADID",glslang::EbvLocalInvocationId}, + {"SV_GROUPINDEX",glslang::EbvLocalInvocationIndex}, + {"SV_GROUPID",glslang::EbvWorkGroupId}, + {"SV_DOMAINLOCATION",glslang::EbvTessCoord}, + {"SV_DEPTH",glslang::EbvFragDepth}, + {"SV_COVERAGE",glslang::EbvSampleMask}, + {"SV_DEPTHGREATEREQUAL",glslang::EbvFragDepthGreater}, + {"SV_DEPTHLESSEQUAL",glslang::EbvFragDepthLesser}, + {"SV_STENCILREF", glslang::EbvFragStencilRef}, +}; } -void HlslScanContext::deleteKeywordMap() -{ - delete KeywordMap; - KeywordMap = nullptr; - delete ReservedSet; - ReservedSet = nullptr; - delete SemanticMap; - SemanticMap = nullptr; -} +namespace glslang { // Wrapper for tokenizeClass() to get everything inside the token. void HlslScanContext::tokenize(HlslToken& token) @@ -546,8 +521,8 @@ void HlslScanContext::tokenize(HlslToken& token) glslang::TBuiltInVariable HlslScanContext::mapSemantic(const char* upperCase) { - auto it = SemanticMap->find(upperCase); - if (it != SemanticMap->end()) + auto it = SemanticMap.find(upperCase); + if (it != SemanticMap.end()) return it->second; else return glslang::EbvNone; @@ -663,11 +638,11 @@ EHlslTokenClass HlslScanContext::tokenizeClass(HlslToken& token) EHlslTokenClass HlslScanContext::tokenizeIdentifier() { - if (ReservedSet->find(tokenText) != ReservedSet->end()) + if (ReservedSet.find(tokenText) != ReservedSet.end()) return reservedWord(); - auto it = KeywordMap->find(tokenText); - if (it == KeywordMap->end()) { + auto it = KeywordMap.find(tokenText); + if (it == KeywordMap.end()) { // Should have an identifier of some sort return identifierOrType(); } diff --git a/bgfx/3rdparty/glslang/glslang/HLSL/pch.h b/bgfx/3rdparty/glslang/glslang/HLSL/pch.h index 465e7c14..f51efacc 100644 --- a/bgfx/3rdparty/glslang/glslang/HLSL/pch.h +++ b/bgfx/3rdparty/glslang/glslang/HLSL/pch.h @@ -42,8 +42,6 @@ #include "../MachineIndependent/Scan.h" #include "../MachineIndependent/preprocessor/PpContext.h" -#include "../OSDependent/osinclude.h" - #include #include #include diff --git a/bgfx/3rdparty/glslang/glslang/Include/BaseTypes.h b/bgfx/3rdparty/glslang/glslang/Include/BaseTypes.h old mode 100755 new mode 100644 index ae49a936..0ac526bf --- a/bgfx/3rdparty/glslang/glslang/Include/BaseTypes.h +++ b/bgfx/3rdparty/glslang/glslang/Include/BaseTypes.h @@ -268,7 +268,6 @@ enum TBuiltInVariable { EbvRayTmin, EbvRayTmax, EbvCullMask, - EbvHitT, EbvHitKind, EbvObjectToWorld, EbvObjectToWorld3x4, @@ -290,6 +289,12 @@ enum TBuiltInVariable { EbvLayerPerViewNV, EbvMeshViewCountNV, EbvMeshViewIndicesNV, + + EbvMicroTrianglePositionNV, + EbvMicroTriangleBaryNV, + EbvHitKindFrontFacingMicroTriangleNV, + EbvHitKindBackFacingMicroTriangleNV, + //GL_EXT_mesh_shader EbvPrimitivePointIndicesEXT, EbvPrimitiveLineIndicesEXT, @@ -489,7 +494,6 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvObjectRayDirection: return "ObjectRayDirectionNV"; case EbvRayTmin: return "ObjectRayTminNV"; case EbvRayTmax: return "ObjectRayTmaxNV"; - case EbvHitT: return "HitTNV"; case EbvHitKind: return "HitKindNV"; case EbvIncomingRayFlags: return "IncomingRayFlagsNV"; case EbvObjectToWorld: return "ObjectToWorldNV"; @@ -523,6 +527,9 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvShadingRateKHR: return "ShadingRateKHR"; case EbvPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + case EbvHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case EbvHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + default: return "unknown built-in variable"; } } diff --git a/bgfx/3rdparty/glslang/glslang/Include/Common.h b/bgfx/3rdparty/glslang/glslang/Include/Common.h index abfe8446..bf37d964 100644 --- a/bgfx/3rdparty/glslang/glslang/Include/Common.h +++ b/bgfx/3rdparty/glslang/glslang/Include/Common.h @@ -96,6 +96,11 @@ std::string to_string(const T& val) { #pragma warning(disable : 4201) // nameless union #endif +// Allow compilation to WASI which does not support threads yet. +#ifdef __wasi__ +#define DISABLE_THREAD_SUPPORT +#endif + #include "PoolAlloc.h" // @@ -161,6 +166,11 @@ template inline T* NewPoolObject(T, int instances) return new(GetThreadPoolAllocator().allocate(instances * sizeof(T))) T[instances]; } +inline bool StartsWith(TString const &str, const char *prefix) +{ + return str.compare(0, strlen(prefix), prefix) == 0; +} + // // Pool allocator versions of vectors, lists, and maps // @@ -294,34 +304,6 @@ template int IntLog2(T n) return result; } -inline bool IsInfinity(double x) { -#ifdef _MSC_VER - switch (_fpclass(x)) { - case _FPCLASS_NINF: - case _FPCLASS_PINF: - return true; - default: - return false; - } -#else - return std::isinf(x); -#endif -} - -inline bool IsNan(double x) { -#ifdef _MSC_VER - switch (_fpclass(x)) { - case _FPCLASS_SNAN: - case _FPCLASS_QNAN: - return true; - default: - return false; - } -#else - return std::isnan(x); -#endif -} - } // end namespace glslang #endif // _COMMON_INCLUDED_ diff --git a/bgfx/3rdparty/glslang/glslang/Include/ConstantUnion.h b/bgfx/3rdparty/glslang/glslang/Include/ConstantUnion.h index 1f39fc59..da4737b6 100644 --- a/bgfx/3rdparty/glslang/glslang/Include/ConstantUnion.h +++ b/bgfx/3rdparty/glslang/glslang/Include/ConstantUnion.h @@ -503,7 +503,7 @@ class TConstUnion { case EbtInt: returnValue.setIConst(iConst % constant.iConst); break; case EbtUint: returnValue.setUConst(uConst % constant.uConst); break; case EbtInt8: returnValue.setI8Const(i8Const % constant.i8Const); break; - case EbtInt16: returnValue.setI8Const(i8Const % constant.i16Const); break; + case EbtInt16: returnValue.setI16Const(i16Const % constant.i16Const); break; case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break; case EbtUint8: returnValue.setU8Const(u8Const % constant.u8Const); break; case EbtUint16: returnValue.setU16Const(u16Const % constant.u16Const); break; diff --git a/bgfx/3rdparty/glslang/glslang/Include/InfoSink.h b/bgfx/3rdparty/glslang/glslang/Include/InfoSink.h index dceb603c..26293394 100644 --- a/bgfx/3rdparty/glslang/glslang/Include/InfoSink.h +++ b/bgfx/3rdparty/glslang/glslang/Include/InfoSink.h @@ -36,6 +36,7 @@ #define _INFOSINK_INCLUDED_ #include "../Include/Common.h" +#include #include namespace glslang { @@ -67,7 +68,7 @@ enum TOutputStream { // class TInfoSinkBase { public: - TInfoSinkBase() : outputStream(4) {} + TInfoSinkBase() : outputStream(4), shaderFileName(nullptr) {} void erase() { sink.erase(); } TInfoSinkBase& operator<<(const TPersistString& t) { append(t); return *this; } TInfoSinkBase& operator<<(char c) { append(1, c); return *this; } @@ -94,11 +95,26 @@ class TInfoSinkBase { default: append("UNKNOWN ERROR: "); break; } } - void location(const TSourceLoc& loc) { + void location(const TSourceLoc& loc, bool absolute = false, bool displayColumn = false) { const int maxSize = 24; char locText[maxSize]; - snprintf(locText, maxSize, ":%d", loc.line); - append(loc.getStringNameOrNum(false).c_str()); + if (displayColumn) { + snprintf(locText, maxSize, ":%d:%d", loc.line, loc.column); + } else { + snprintf(locText, maxSize, ":%d", loc.line); + } + + if(loc.getFilename() == nullptr && shaderFileName != nullptr && absolute) { + append(std::filesystem::absolute(shaderFileName).string()); + } else { + std::string location = loc.getStringNameOrNum(false); + if (absolute) { + append(std::filesystem::absolute(location).string()); + } else { + append(location); + } + } + append(locText); append(": "); } @@ -107,9 +123,11 @@ class TInfoSinkBase { append(s); append("\n"); } - void message(TPrefixType message, const char* s, const TSourceLoc& loc) { + void message(TPrefixType message, const char* s, const TSourceLoc& loc, bool absolute = false, + bool displayColumn = false) + { prefix(message); - location(loc); + location(loc, absolute, displayColumn); append(s); append("\n"); } @@ -119,6 +137,11 @@ class TInfoSinkBase { outputStream = output; } + void setShaderFileName(const char* file = nullptr) + { + shaderFileName = file; + } + protected: void append(const char* s); @@ -131,6 +154,7 @@ class TInfoSinkBase { void appendToStream(const char* s); TPersistString sink; int outputStream; + const char* shaderFileName; }; } // end namespace glslang diff --git a/bgfx/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h b/bgfx/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h index bfb551e4..0082a4d4 100644 --- a/bgfx/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h +++ b/bgfx/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h @@ -39,6 +39,7 @@ // GL_EXT_spirv_intrinsics // #include "Common.h" +#include namespace glslang { @@ -96,23 +97,27 @@ struct TSpirvInstruction { struct TSpirvTypeParameter { POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TSpirvTypeParameter(const TIntermConstantUnion* arg) + TSpirvTypeParameter(const TIntermConstantUnion* arg) { value = arg; } + TSpirvTypeParameter(const TType* arg) { value = arg; } + + const TIntermConstantUnion* getAsConstant() const { - constant = arg; - type = nullptr; + if (value.index() == 0) + return std::get(value); + return nullptr; } - - TSpirvTypeParameter(const TType *arg) + const TType* getAsType() const { - constant = nullptr; - type = arg; + if (value.index() == 1) + return std::get(value); + return nullptr; } bool operator==(const TSpirvTypeParameter& rhs) const; bool operator!=(const TSpirvTypeParameter& rhs) const { return !operator==(rhs); } - const TIntermConstantUnion* constant; // Constant expression - const TType* type; // Type specifier + // Parameter value: constant expression or type specifier + std::variant value; }; typedef TVector TSpirvTypeParameters; diff --git a/bgfx/3rdparty/glslang/glslang/Include/Types.h b/bgfx/3rdparty/glslang/glslang/Include/Types.h index 26aba9bb..ec6b1db8 100644 --- a/bgfx/3rdparty/glslang/glslang/Include/Types.h +++ b/bgfx/3rdparty/glslang/glslang/Include/Types.h @@ -307,21 +307,6 @@ typedef TVector TTypeList; typedef TVector TIdentifierList; -// -// 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 -}; - enum TLayoutMatrix { ElmNone, ElmRowMajor, @@ -573,7 +558,8 @@ class TQualifier { } const char* semanticName; - TStorageQualifier storage : 6; + TStorageQualifier storage : 7; + static_assert(EvqLast < 64, "need to increase size of TStorageQualifier bitfields!"); TBuiltInVariable builtIn : 9; TBuiltInVariable declaredBuiltIn : 9; static_assert(EbvLast < 256, "need to increase size of TBuiltInVariable bitfields!"); @@ -852,6 +838,8 @@ class TQualifier { // -2048 as the default value indicating layoutSecondaryViewportRelative is not set layoutSecondaryViewportRelativeOffset = -2048; layoutShaderRecord = false; + layoutFullQuads = false; + layoutQuadDeriv = false; layoutHitObjectShaderRecordNV = false; layoutBindlessSampler = false; layoutBindlessImage = false; @@ -948,6 +936,8 @@ class TQualifier { bool layoutViewportRelative; int layoutSecondaryViewportRelativeOffset; bool layoutShaderRecord; + bool layoutFullQuads; + bool layoutQuadDeriv; bool layoutHitObjectShaderRecordNV; // GL_EXT_spirv_intrinsics @@ -1055,6 +1045,8 @@ class TQualifier { TLayoutFormat getFormat() const { return layoutFormat; } bool isPushConstant() const { return layoutPushConstant; } bool isShaderRecord() const { return layoutShaderRecord; } + bool isFullQuads() const { return layoutFullQuads; } + bool isQuadDeriv() const { return layoutQuadDeriv; } bool hasHitObjectShaderRecordNV() const { return layoutHitObjectShaderRecordNV; } bool hasBufferReference() const { return layoutBufferReference; } bool hasBufferReferenceAlign() const @@ -1075,7 +1067,7 @@ class TQualifier { } // GL_EXT_spirv_intrinsics - bool hasSprivDecorate() const { return spirvDecorate != nullptr; } + bool hasSpirvDecorate() const { return spirvDecorate != nullptr; } void setSpirvDecorate(int decoration, const TIntermAggregate* args = nullptr); void setSpirvDecorateId(int decoration, const TIntermAggregate* args); void setSpirvDecorateString(int decoration, const TIntermAggregate* args); @@ -1428,13 +1420,25 @@ class TTypeParameters { public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TTypeParameters() : basicType(EbtVoid), arraySizes(nullptr) {} + TTypeParameters() : basicType(EbtVoid), arraySizes(nullptr), spirvType(nullptr) {} TBasicType basicType; TArraySizes *arraySizes; + TSpirvType *spirvType; - bool operator==(const TTypeParameters& rhs) const { return basicType == rhs.basicType && *arraySizes == *rhs.arraySizes; } - bool operator!=(const TTypeParameters& rhs) const { return basicType != rhs.basicType || *arraySizes != *rhs.arraySizes; } + bool operator==(const TTypeParameters& rhs) const + { + bool same = basicType == rhs.basicType && *arraySizes == *rhs.arraySizes; + if (same && basicType == EbtSpirvType) { + assert(spirvType && rhs.spirvType); + return *spirvType == *rhs.spirvType; + } + return same; + } + bool operator!=(const TTypeParameters& rhs) const + { + return !(*this == rhs); + } }; // @@ -1451,9 +1455,9 @@ class TPublicType { TSampler sampler; TQualifier qualifier; TShaderQualifiers shaderQualifiers; - int vectorSize : 4; - int matrixCols : 4; - int matrixRows : 4; + uint32_t vectorSize : 4; + uint32_t matrixCols : 4; + uint32_t matrixRows : 4; bool coopmatNV : 1; bool coopmatKHR : 1; TArraySizes* arraySizes; @@ -1470,7 +1474,7 @@ class TPublicType { void initType(const TSourceLoc& l) { basicType = EbtVoid; - vectorSize = 1; + vectorSize = 1u; matrixRows = 0; matrixCols = 0; arraySizes = nullptr; @@ -1501,19 +1505,22 @@ class TPublicType { { matrixRows = 0; matrixCols = 0; - vectorSize = s; + assert(s >= 0); + vectorSize = static_cast(s) & 0b1111; } void setMatrix(int c, int r) { - matrixRows = r; - matrixCols = c; + assert(r >= 0); + matrixRows = static_cast(r) & 0b1111; + assert(c >= 0); + matrixCols = static_cast(c) & 0b1111; vectorSize = 0; } bool isScalar() const { - return matrixCols == 0 && vectorSize == 1 && arraySizes == nullptr && userDef == nullptr; + return matrixCols == 0u && vectorSize == 1u && arraySizes == nullptr && userDef == nullptr; } // GL_EXT_spirv_intrinsics @@ -1535,10 +1542,14 @@ class TType { // for "empty" type (no args) or simple scalar/vector/matrix explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0, bool isVector = false) : - basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1), + basicType(t), vectorSize(static_cast(vs) & 0b1111), matrixCols(static_cast(mc) & 0b1111), matrixRows(static_cast(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), spirvType(nullptr) { + assert(vs >= 0); + assert(mc >= 0); + assert(mr >= 0); + sampler.clear(); qualifier.clear(); qualifier.storage = q; @@ -1547,10 +1558,14 @@ class TType { // for explicit precision qualifier TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0, bool isVector = false) : - basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1), + basicType(t), vectorSize(static_cast(vs) & 0b1111), matrixCols(static_cast(mc) & 0b1111), matrixRows(static_cast(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), spirvType(nullptr) { + assert(vs >= 0); + assert(mc >= 0); + assert(mr >= 0); + sampler.clear(); qualifier.clear(); qualifier.storage = q; @@ -1561,7 +1576,7 @@ class TType { // for turning a TPublicType into a TType, using a shallow copy explicit TType(const TPublicType& p) : basicType(p.basicType), - vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(-1), + vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(0), coopmatKHRUseValid(false), arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters), spirvType(p.spirvType) { @@ -1600,16 +1615,23 @@ class TType { } if (p.isCoopmatKHR() && p.typeParameters && p.typeParameters->arraySizes->getNumDims() > 0) { basicType = p.typeParameters->basicType; + if (isSpirvType()) { + assert(p.typeParameters->spirvType); + spirvType = p.typeParameters->spirvType; + } if (p.typeParameters->arraySizes->getNumDims() == 4) { - coopmatKHRuse = p.typeParameters->arraySizes->getDimSize(3); + const int dimSize = p.typeParameters->arraySizes->getDimSize(3); + assert(dimSize >= 0); + coopmatKHRuse = static_cast(dimSize) & 0b111; + coopmatKHRUseValid = true; p.typeParameters->arraySizes->removeLastSize(); } } } // for construction of sampler types TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) : - basicType(EbtSampler), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1), + basicType(EbtSampler), vectorSize(1u), matrixCols(0u), matrixRows(0u), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr), sampler(sampler), typeParameters(nullptr), spirvType(nullptr) { @@ -1655,14 +1677,15 @@ class TType { } else if (isCoopMat()) { coopmatNV = false; coopmatKHR = false; - coopmatKHRuse = -1; + coopmatKHRuse = 0; + coopmatKHRUseValid = false; typeParameters = nullptr; } } } // for making structures, ... TType(TTypeList* userDef, const TString& n) : - basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1), + basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr), spirvType(nullptr) { @@ -1672,7 +1695,7 @@ class TType { } // For interface blocks TType(TTypeList* userDef, const TString& n, const TQualifier& q) : - basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1), + basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr), spirvType(nullptr) { @@ -1681,7 +1704,7 @@ class TType { } // for block reference (first parameter must be EbtReference) explicit TType(TBasicType t, const TType &p, const TString& n) : - basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1), + basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), spirvType(nullptr) { @@ -1719,6 +1742,7 @@ class TType { coopmatNV = copyOf.isCoopMatNV(); coopmatKHR = copyOf.isCoopMatKHR(); coopmatKHRuse = copyOf.coopmatKHRuse; + coopmatKHRUseValid = copyOf.coopmatKHRUseValid; } // Make complete copy of the whole type graph rooted at 'copyOf'. @@ -1748,7 +1772,7 @@ class TType { void makeVector() { vector1 = true; } - virtual void hideMember() { basicType = EbtVoid; vectorSize = 1; } + virtual void hideMember() { basicType = EbtVoid; vectorSize = 1u; } virtual bool hiddenMember() const { return basicType == EbtVoid; } virtual void setFieldName(const TString& n) { fieldName = NewPoolTString(n.c_str()); } @@ -1788,9 +1812,9 @@ class TType { virtual TQualifier& getQualifier() { return qualifier; } virtual const TQualifier& getQualifier() const { return qualifier; } - virtual int getVectorSize() const { return vectorSize; } // returns 1 for either scalar or vector of size 1, valid for both - virtual int getMatrixCols() const { return matrixCols; } - virtual int getMatrixRows() const { return matrixRows; } + virtual int getVectorSize() const { return static_cast(vectorSize); } // returns 1 for either scalar or vector of size 1, valid for both + virtual int getMatrixCols() const { return static_cast(matrixCols); } + virtual int getMatrixRows() const { return static_cast(matrixRows); } virtual int getOuterArraySize() const { return arraySizes->getOuterSize(); } virtual TIntermTyped* getOuterArrayNode() const { return arraySizes->getOuterNode(); } virtual int getCumulativeArraySize() const { return arraySizes->getCumulativeSize(); } @@ -1805,7 +1829,7 @@ class TType { virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray(); } virtual bool isScalarOrVec1() const { return isScalar() || vector1; } virtual bool isScalarOrVector() const { return !isMatrix() && !isStruct() && !isArray(); } - virtual bool isVector() const { return vectorSize > 1 || vector1; } + virtual bool isVector() const { return vectorSize > 1u || vector1; } virtual bool isMatrix() const { return matrixCols ? true : false; } virtual bool isArray() const { return arraySizes != nullptr; } virtual bool isSizedArray() const { return isArray() && arraySizes->isSized(); } @@ -1855,7 +1879,7 @@ class TType { bool isCoopMatKHR() const { return coopmatKHR; } bool isReference() const { return getBasicType() == EbtReference; } bool isSpirvType() const { return getBasicType() == EbtSpirvType; } - int getCoopMatKHRuse() const { return coopmatKHRuse; } + int getCoopMatKHRuse() const { return static_cast(coopmatKHRuse); } // return true if this type contains any subtype which satisfies the given predicate. template @@ -2096,7 +2120,7 @@ class TType { const auto appendInt = [&](int i) { typeString.append(std::to_string(i).c_str()); }; if (getQualifiers) { - if (qualifier.hasSprivDecorate()) + if (qualifier.hasSpirvDecorate()) appendStr(qualifier.getSpirvDecorateQualifierString().c_str()); if (qualifier.hasLayout()) { @@ -2190,6 +2214,10 @@ class TType { if (qualifier.layoutShaderRecord) appendStr(" shaderRecordNV"); + if (qualifier.layoutFullQuads) + appendStr(" full_quads"); + if (qualifier.layoutQuadDeriv) + appendStr(" quad_derivatives"); if (qualifier.layoutHitObjectShaderRecordNV) appendStr(" hitobjectshaderrecordnv"); @@ -2395,7 +2423,7 @@ class TType { if (i != (int)typeParameters->arraySizes->getNumDims() - 1) appendStr(", "); } - if (coopmatKHRuse != -1) { + if (coopmatKHRUseValid) { appendStr(", "); appendInt(coopmatKHRuse); } @@ -2464,11 +2492,14 @@ class TType { void setStruct(TTypeList* s) { assert(isStruct()); structure = s; } TTypeList* getWritableStruct() const { assert(isStruct()); return structure; } // This should only be used when known to not be sharing with other threads void setBasicType(const TBasicType& t) { basicType = t; } - void setVectorSize(int s) { vectorSize = s; } + void setVectorSize(int s) { + assert(s >= 0); + vectorSize = static_cast(s) & 0b1111; + } int computeNumComponents() const { - int components = 0; + uint32_t components = 0; if (getBasicType() == EbtStruct || getBasicType() == EbtBlock) { for (TTypeList::const_iterator tl = getStruct()->begin(); tl != getStruct()->end(); tl++) @@ -2482,7 +2513,7 @@ class TType { components *= arraySizes->getCumulativeSize(); } - return components; + return static_cast(components); } // append this type's mangled name to the passed in 'name' @@ -2689,7 +2720,8 @@ class TType { if (isCoopMatKHR() && right.isCoopMatKHR()) { return ((getBasicType() == right.getBasicType()) || (getBasicType() == EbtCoopmat) || (right.getBasicType() == EbtCoopmat)) && - typeParameters == nullptr && right.typeParameters != nullptr; + ((typeParameters == nullptr && right.typeParameters != nullptr) || + (typeParameters != nullptr && right.typeParameters == nullptr)); } return false; } @@ -2795,6 +2827,7 @@ class TType { typeParameters = new TTypeParameters; typeParameters->arraySizes = new TArraySizes; *typeParameters->arraySizes = *copyOf.typeParameters->arraySizes; + *typeParameters->spirvType = *copyOf.typeParameters->spirvType; typeParameters->basicType = copyOf.basicType; } @@ -2825,9 +2858,9 @@ class TType { void buildMangledName(TString&) const; TBasicType basicType : 8; - int vectorSize : 4; // 1 means either scalar or 1-component vector; see vector1 to disambiguate. - int matrixCols : 4; - int matrixRows : 4; + uint32_t vectorSize : 4; // 1 means either scalar or 1-component vector; see vector1 to disambiguate. + uint32_t matrixCols : 4; + uint32_t matrixRows : 4; bool vector1 : 1; // Backward-compatible tracking of a 1-component vector distinguished from a scalar. // GLSL 4.5 never has a 1-component vector; so this will always be false until such // functionality is added. @@ -2835,7 +2868,8 @@ class TType { // from a scalar. bool coopmatNV : 1; bool coopmatKHR : 1; - int coopmatKHRuse : 4; // Accepts one of three values: 0, 1, 2 (gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator) + uint32_t coopmatKHRuse : 3; // Accepts one of three values: 0, 1, 2 (gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator) + bool coopmatKHRUseValid : 1; // True if coopmatKHRuse has been set TQualifier qualifier; TArraySizes* arraySizes; // nullptr unless an array; can be shared across types diff --git a/bgfx/3rdparty/glslang/glslang/Include/glslang_c_interface.h b/bgfx/3rdparty/glslang/glslang/Include/glslang_c_interface.h index fd636cf5..bfe06522 100644 --- a/bgfx/3rdparty/glslang/glslang/Include/glslang_c_interface.h +++ b/bgfx/3rdparty/glslang/glslang/Include/glslang_c_interface.h @@ -37,9 +37,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #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 { @@ -226,27 +237,15 @@ typedef struct glslang_spv_options_s { 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 -#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 +GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version); GLSLANG_EXPORT int glslang_initialize_process(void); GLSLANG_EXPORT void glslang_finalize_process(void); @@ -258,9 +257,13 @@ GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glsla 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); @@ -271,6 +274,7 @@ GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages 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); @@ -280,6 +284,12 @@ GLSLANG_EXPORT const char* glslang_program_SPIRV_get_messages(glslang_program_t* 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(); +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 diff --git a/bgfx/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h b/bgfx/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h index 9bc21149..768e2e84 100644 --- a/bgfx/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h +++ b/bgfx/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h @@ -157,23 +157,26 @@ typedef enum { /* 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_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_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), LAST_ELEMENT_MARKER(GLSLANG_MSG_COUNT), } glslang_messages_t; diff --git a/bgfx/3rdparty/glslang/glslang/Include/intermediate.h b/bgfx/3rdparty/glslang/glslang/Include/intermediate.h index 604f08b6..82de2b4d 100644 --- a/bgfx/3rdparty/glslang/glslang/Include/intermediate.h +++ b/bgfx/3rdparty/glslang/glslang/Include/intermediate.h @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. -// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2017, 2022-2024 Arm Limited. // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. @@ -48,14 +48,9 @@ #ifndef __INTERMEDIATE_H #define __INTERMEDIATE_H -#if defined(_MSC_VER) && _MSC_VER >= 1900 - #pragma warning(disable : 4464) // relative include path contains '..' - #pragma warning(disable : 5026) // 'glslang::TIntermUnary': move constructor was implicitly defined as deleted -#endif - -#include "../Include/Common.h" -#include "../Include/Types.h" -#include "../Include/ConstantUnion.h" +#include "Common.h" +#include "Types.h" +#include "ConstantUnion.h" namespace glslang { @@ -511,6 +506,8 @@ enum TOperator { EOpSubgroupShuffleXor, EOpSubgroupShuffleUp, EOpSubgroupShuffleDown, + EOpSubgroupRotate, + EOpSubgroupClusteredRotate, EOpSubgroupAdd, EOpSubgroupMul, EOpSubgroupMin, @@ -543,6 +540,8 @@ enum TOperator { EOpSubgroupQuadSwapHorizontal, EOpSubgroupQuadSwapVertical, EOpSubgroupQuadSwapDiagonal, + EOpSubgroupQuadAll, + EOpSubgroupQuadAny, EOpSubgroupPartition, EOpSubgroupPartitionedAdd, @@ -1006,6 +1005,8 @@ enum TOperator { EOpHitObjectGetAttributesNV, EOpHitObjectGetCurrentTimeNV, EOpReorderThreadNV, + EOpFetchMicroTriangleVertexPositionNV, + EOpFetchMicroTriangleVertexBarycentricNV, // HLSL operations // @@ -1090,6 +1091,10 @@ enum TOperator { EOpWaveActiveCountBits, // Will decompose to subgroupBallotBitCount(subgroupBallot()). EOpWavePrefixCountBits, // Will decompose to subgroupBallotInclusiveBitCount(subgroupBallot()). + // GL_EXT_expect_assume + EOpAssumeEXT, + EOpExpectEXT, + // Shader Clock Ops EOpReadClockSubgroupKHR, EOpReadClockDeviceKHR, @@ -1106,6 +1111,17 @@ enum TOperator { EOpImageBoxFilterQCOM, EOpImageBlockMatchSADQCOM, EOpImageBlockMatchSSDQCOM, + + // Image processing2 + EOpImageBlockMatchWindowSSDQCOM, + EOpImageBlockMatchWindowSADQCOM, + EOpImageBlockMatchGatherSSDQCOM, + EOpImageBlockMatchGatherSADQCOM, +}; + +enum TLinkType { + ELinkNone, + ELinkExport, }; class TIntermTraverser; @@ -1325,9 +1341,11 @@ class TIntermMethod : public TIntermTyped { virtual const TString& getMethodName() const { return method; } virtual TIntermTyped* getObject() const { return object; } virtual void traverse(TIntermTraverser*); + void setExport() { linkType = ELinkExport; } protected: TIntermTyped* object; TString method; + TLinkType linkType; }; // @@ -1676,8 +1694,12 @@ typedef TVector TQualifierList; // class TIntermAggregate : public TIntermOperator { public: - TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) { } - TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) { } + TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) { + endLoc.init(); + } + TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) { + endLoc.init(); + } ~TIntermAggregate() { delete pragmaTable; } virtual TIntermAggregate* getAsAggregate() { return this; } virtual const TIntermAggregate* getAsAggregate() const { return this; } @@ -1700,6 +1722,12 @@ class TIntermAggregate : public TIntermOperator { const TPragmaTable& getPragmaTable() const { return *pragmaTable; } void setSpirvInstruction(const TSpirvInstruction& inst) { spirvInst = inst; } const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; } + + void setEndLoc(TSourceLoc loc) { endLoc = loc; } + TSourceLoc getEndLoc() const { return endLoc; } + + void setLinkType(TLinkType l) { linkType = l; } + TLinkType getLinkType() const { return linkType; } protected: TIntermAggregate(const TIntermAggregate&); // disallow copy constructor TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator @@ -1711,6 +1739,11 @@ class TIntermAggregate : public TIntermOperator { bool debug; TPragmaTable* pragmaTable; TSpirvInstruction spirvInst; + TLinkType linkType = ELinkNone; + + // Marking the end source location of the aggregate. + // This is currently only set for a compound statement or a function body, pointing to '}'. + TSourceLoc endLoc; }; // diff --git a/bgfx/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h b/bgfx/3rdparty/glslang/glslang/Include/visibility.h similarity index 68% rename from bgfx/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h rename to bgfx/3rdparty/glslang/glslang/Include/visibility.h index b18e2ab3..9bb8f3fa 100644 --- a/bgfx/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h +++ b/bgfx/3rdparty/glslang/glslang/Include/visibility.h @@ -1,5 +1,6 @@ // -// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2023 LunarG, Inc. +// // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -31,19 +32,23 @@ // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // -#ifndef __INITIALIZEDLL_H -#define __INITIALIZEDLL_H - -#include "../glslang/OSDependent/osinclude.h" - -namespace glslang { - -inline bool InitProcess() { return true; } // DEPRECATED -inline bool InitThread() { return true; } // DEPRECATED -inline bool DetachThread() { return true; } // DEPRECATED -inline bool DetachProcess() { return true; } // DEPRECATED - -} // end namespace glslang +#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 -#endif // __INITIALIZEDLL_H +#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. +#define GLSLANG_EXPORT_FOR_TESTS GLSLANG_EXPORT diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp index 8acf9e55..7a9fb2ed 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp @@ -507,7 +507,11 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EbtUint8: newConstArray[i].setU8Const(static_cast(-static_cast(unionArray[i].getU8Const()))); break; case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break; case EbtUint16:newConstArray[i].setU16Const(static_cast(-static_cast(unionArray[i].getU16Const()))); break; - case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break; + case EbtInt64: { + int64_t i64val = unionArray[i].getI64Const(); + newConstArray[i].setI64Const(i64val == INT64_MIN ? INT64_MIN : -i64val); + break; + } case EbtUint64: newConstArray[i].setU64Const(static_cast(-static_cast(unionArray[i].getU64Const()))); break; default: return nullptr; @@ -628,12 +632,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpIsNan: { - newConstArray[i].setBConst(IsNan(unionArray[i].getDConst())); + newConstArray[i].setBConst(std::isnan(unionArray[i].getDConst())); break; } case EOpIsInf: { - newConstArray[i].setBConst(IsInfinity(unionArray[i].getDConst())); + newConstArray[i].setBConst(std::isinf(unionArray[i].getDConst())); break; } @@ -689,7 +693,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpConvInt64ToBool: newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break; case EOpConvUint64ToBool: - newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break; + newConstArray[i].setBConst(unionArray[i].getU64Const() != 0); break; case EOpConvFloat16ToBool: newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break; @@ -1009,6 +1013,12 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) objectSize = std::max(children[0]->getAsTyped()->getType().getVectorSize(), children[2]->getAsTyped()->getType().getVectorSize()); break; + case EOpMul: + { + TIntermConstantUnion* left = children[0]->getAsConstantUnion(); + TIntermConstantUnion* right = children[1]->getAsConstantUnion(); + return left->fold(EOpMul, right); + } default: return aggrNode; } diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp old mode 100755 new mode 100644 index 2f8ce295..d8a969d7 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. // Copyright (C) 2015-2020 Google, Inc. -// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2017, 2022-2024 Arm Limited. // Modifications Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. @@ -51,8 +51,9 @@ // including identifying what extensions are needed if a version does not allow a symbol // -#include "../Include/intermediate.h" +#include #include "Initialize.h" +#include "span.h" namespace glslang { @@ -140,20 +141,17 @@ struct Versioning { EProfile EDesktopProfile = static_cast(ENoProfile | ECoreProfile | ECompatibilityProfile); // Declare pointers to put into the table for versioning. - const Versioning Es300Desktop130Version[] = { { EEsProfile, 0, 300, 0, nullptr }, - { EDesktopProfile, 0, 130, 0, nullptr }, - { EBadProfile } }; - const Versioning* Es300Desktop130 = &Es300Desktop130Version[0]; + const std::array Es300Desktop130Version = { Versioning{ EEsProfile, 0, 300, 0, nullptr }, + Versioning{ EDesktopProfile, 0, 130, 0, nullptr }, + }; - const Versioning Es310Desktop420Version[] = { { EEsProfile, 0, 310, 0, nullptr }, - { EDesktopProfile, 0, 420, 0, nullptr }, - { EBadProfile } }; - const Versioning* Es310Desktop420 = &Es310Desktop420Version[0]; + const std::array Es310Desktop400Version = { Versioning{ EEsProfile, 0, 310, 0, nullptr }, + Versioning{ EDesktopProfile, 0, 400, 0, nullptr }, + }; - const Versioning Es310Desktop450Version[] = { { EEsProfile, 0, 310, 0, nullptr }, - { EDesktopProfile, 0, 450, 0, nullptr }, - { EBadProfile } }; - const Versioning* Es310Desktop450 = &Es310Desktop450Version[0]; + const std::array Es310Desktop450Version = { Versioning{ EEsProfile, 0, 310, 0, nullptr }, + Versioning{ EDesktopProfile, 0, 450, 0, nullptr }, + }; // The main descriptor of what a set of function prototypes can look like, and // a pointer to extra versioning information, when needed. @@ -163,7 +161,7 @@ struct BuiltInFunction { int numArguments; // number of arguments (overloads with varying arguments need different entries) ArgType types; // ArgType mask ArgClass classes; // the ways this particular function entry manifests - const Versioning* versioning; // nullptr means always a valid version + const span versioning; // An empty span means always a valid version }; // The tables can have the same built-in function name more than one time, @@ -175,151 +173,146 @@ struct BuiltInFunction { // // Table is terminated by an OpNull TOperator. -const BuiltInFunction BaseFunctions[] = { +const std::array BaseFunctions = { // TOperator, name, arg-count, ArgType, ArgClass, versioning // --------- ---- --------- ------- -------- ---------- - { EOpRadians, "radians", 1, TypeF, ClassRegular, nullptr }, - { EOpDegrees, "degrees", 1, TypeF, ClassRegular, nullptr }, - { EOpSin, "sin", 1, TypeF, ClassRegular, nullptr }, - { EOpCos, "cos", 1, TypeF, ClassRegular, nullptr }, - { EOpTan, "tan", 1, TypeF, ClassRegular, nullptr }, - { EOpAsin, "asin", 1, TypeF, ClassRegular, nullptr }, - { EOpAcos, "acos", 1, TypeF, ClassRegular, nullptr }, - { EOpAtan, "atan", 2, TypeF, ClassRegular, nullptr }, - { EOpAtan, "atan", 1, TypeF, ClassRegular, nullptr }, - { EOpPow, "pow", 2, TypeF, ClassRegular, nullptr }, - { EOpExp, "exp", 1, TypeF, ClassRegular, nullptr }, - { EOpLog, "log", 1, TypeF, ClassRegular, nullptr }, - { EOpExp2, "exp2", 1, TypeF, ClassRegular, nullptr }, - { EOpLog2, "log2", 1, TypeF, ClassRegular, nullptr }, - { EOpSqrt, "sqrt", 1, TypeF, ClassRegular, nullptr }, - { EOpInverseSqrt, "inversesqrt", 1, TypeF, ClassRegular, nullptr }, - { EOpAbs, "abs", 1, TypeF, ClassRegular, nullptr }, - { EOpSign, "sign", 1, TypeF, ClassRegular, nullptr }, - { EOpFloor, "floor", 1, TypeF, ClassRegular, nullptr }, - { EOpCeil, "ceil", 1, TypeF, ClassRegular, nullptr }, - { EOpFract, "fract", 1, TypeF, ClassRegular, nullptr }, - { EOpMod, "mod", 2, TypeF, ClassLS, nullptr }, - { EOpMin, "min", 2, TypeF, ClassLS, nullptr }, - { EOpMax, "max", 2, TypeF, ClassLS, nullptr }, - { EOpClamp, "clamp", 3, TypeF, ClassLS2, nullptr }, - { EOpMix, "mix", 3, TypeF, ClassLS, nullptr }, - { EOpStep, "step", 2, TypeF, ClassFS, nullptr }, - { EOpSmoothStep, "smoothstep", 3, TypeF, ClassFS2, nullptr }, - { EOpNormalize, "normalize", 1, TypeF, ClassRegular, nullptr }, - { EOpFaceForward, "faceforward", 3, TypeF, ClassRegular, nullptr }, - { EOpReflect, "reflect", 2, TypeF, ClassRegular, nullptr }, - { EOpRefract, "refract", 3, TypeF, ClassXLS, nullptr }, - { EOpLength, "length", 1, TypeF, ClassRS, nullptr }, - { EOpDistance, "distance", 2, TypeF, ClassRS, nullptr }, - { EOpDot, "dot", 2, TypeF, ClassRS, nullptr }, - { EOpCross, "cross", 2, TypeF, ClassV3, nullptr }, - { EOpLessThan, "lessThan", 2, TypeFI, ClassBNS, nullptr }, - { EOpLessThanEqual, "lessThanEqual", 2, TypeFI, ClassBNS, nullptr }, - { EOpGreaterThan, "greaterThan", 2, TypeFI, ClassBNS, nullptr }, - { EOpGreaterThanEqual, "greaterThanEqual", 2, TypeFI, ClassBNS, nullptr }, - { EOpVectorEqual, "equal", 2, TypeFIB, ClassBNS, nullptr }, - { EOpVectorNotEqual, "notEqual", 2, TypeFIB, ClassBNS, nullptr }, - { EOpAny, "any", 1, TypeB, ClassRSNS, nullptr }, - { EOpAll, "all", 1, TypeB, ClassRSNS, nullptr }, - { EOpVectorLogicalNot, "not", 1, TypeB, ClassNS, nullptr }, - { EOpSinh, "sinh", 1, TypeF, ClassRegular, Es300Desktop130 }, - { EOpCosh, "cosh", 1, TypeF, ClassRegular, Es300Desktop130 }, - { EOpTanh, "tanh", 1, TypeF, ClassRegular, Es300Desktop130 }, - { EOpAsinh, "asinh", 1, TypeF, ClassRegular, Es300Desktop130 }, - { EOpAcosh, "acosh", 1, TypeF, ClassRegular, Es300Desktop130 }, - { EOpAtanh, "atanh", 1, TypeF, ClassRegular, Es300Desktop130 }, - { EOpAbs, "abs", 1, TypeI, ClassRegular, Es300Desktop130 }, - { EOpSign, "sign", 1, TypeI, ClassRegular, Es300Desktop130 }, - { EOpTrunc, "trunc", 1, TypeF, ClassRegular, Es300Desktop130 }, - { EOpRound, "round", 1, TypeF, ClassRegular, Es300Desktop130 }, - { EOpRoundEven, "roundEven", 1, TypeF, ClassRegular, Es300Desktop130 }, - { EOpModf, "modf", 2, TypeF, ClassLO, Es300Desktop130 }, - { EOpMin, "min", 2, TypeIU, ClassLS, Es300Desktop130 }, - { EOpMax, "max", 2, TypeIU, ClassLS, Es300Desktop130 }, - { EOpClamp, "clamp", 3, TypeIU, ClassLS2, Es300Desktop130 }, - { EOpMix, "mix", 3, TypeF, ClassLB, Es300Desktop130 }, - { EOpIsInf, "isinf", 1, TypeF, ClassB, Es300Desktop130 }, - { EOpIsNan, "isnan", 1, TypeF, ClassB, Es300Desktop130 }, - { EOpLessThan, "lessThan", 2, TypeU, ClassBNS, Es300Desktop130 }, - { EOpLessThanEqual, "lessThanEqual", 2, TypeU, ClassBNS, Es300Desktop130 }, - { EOpGreaterThan, "greaterThan", 2, TypeU, ClassBNS, Es300Desktop130 }, - { EOpGreaterThanEqual, "greaterThanEqual", 2, TypeU, ClassBNS, Es300Desktop130 }, - { EOpVectorEqual, "equal", 2, TypeU, ClassBNS, Es300Desktop130 }, - { EOpVectorNotEqual, "notEqual", 2, TypeU, ClassBNS, Es300Desktop130 }, - { EOpAtomicAdd, "atomicAdd", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, - { EOpAtomicMin, "atomicMin", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, - { EOpAtomicMax, "atomicMax", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, - { EOpAtomicAnd, "atomicAnd", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, - { EOpAtomicOr, "atomicOr", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, - { EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, - { EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, - { EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCV, Es310Desktop420 }, - { EOpMix, "mix", 3, TypeB, ClassRegular, Es310Desktop450 }, - { EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 }, - - { EOpNull } + BuiltInFunction{ EOpRadians, "radians", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpDegrees, "degrees", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpSin, "sin", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpCos, "cos", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpTan, "tan", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAsin, "asin", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAcos, "acos", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAtan, "atan", 2, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAtan, "atan", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpPow, "pow", 2, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpExp, "exp", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpLog, "log", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpExp2, "exp2", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpLog2, "log2", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpSqrt, "sqrt", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpInverseSqrt, "inversesqrt", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpAbs, "abs", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpSign, "sign", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpFloor, "floor", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpCeil, "ceil", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpFract, "fract", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpMod, "mod", 2, TypeF, ClassLS, {} }, + BuiltInFunction{ EOpMin, "min", 2, TypeF, ClassLS, {} }, + BuiltInFunction{ EOpMax, "max", 2, TypeF, ClassLS, {} }, + BuiltInFunction{ EOpClamp, "clamp", 3, TypeF, ClassLS2, {} }, + BuiltInFunction{ EOpMix, "mix", 3, TypeF, ClassLS, {} }, + BuiltInFunction{ EOpStep, "step", 2, TypeF, ClassFS, {} }, + BuiltInFunction{ EOpSmoothStep, "smoothstep", 3, TypeF, ClassFS2, {} }, + BuiltInFunction{ EOpNormalize, "normalize", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpFaceForward, "faceforward", 3, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpReflect, "reflect", 2, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpRefract, "refract", 3, TypeF, ClassXLS, {} }, + BuiltInFunction{ EOpLength, "length", 1, TypeF, ClassRS, {} }, + BuiltInFunction{ EOpDistance, "distance", 2, TypeF, ClassRS, {} }, + BuiltInFunction{ EOpDot, "dot", 2, TypeF, ClassRS, {} }, + BuiltInFunction{ EOpCross, "cross", 2, TypeF, ClassV3, {} }, + BuiltInFunction{ EOpLessThan, "lessThan", 2, TypeFI, ClassBNS, {} }, + BuiltInFunction{ EOpLessThanEqual, "lessThanEqual", 2, TypeFI, ClassBNS, {} }, + BuiltInFunction{ EOpGreaterThan, "greaterThan", 2, TypeFI, ClassBNS, {} }, + BuiltInFunction{ EOpGreaterThanEqual, "greaterThanEqual", 2, TypeFI, ClassBNS, {} }, + BuiltInFunction{ EOpVectorEqual, "equal", 2, TypeFIB, ClassBNS, {} }, + BuiltInFunction{ EOpVectorNotEqual, "notEqual", 2, TypeFIB, ClassBNS, {} }, + BuiltInFunction{ EOpAny, "any", 1, TypeB, ClassRSNS, {} }, + BuiltInFunction{ EOpAll, "all", 1, TypeB, ClassRSNS, {} }, + BuiltInFunction{ EOpVectorLogicalNot, "not", 1, TypeB, ClassNS, {} }, + BuiltInFunction{ EOpSinh, "sinh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpCosh, "cosh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpTanh, "tanh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAsinh, "asinh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAcosh, "acosh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAtanh, "atanh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAbs, "abs", 1, TypeI, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpSign, "sign", 1, TypeI, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpTrunc, "trunc", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpRound, "round", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpRoundEven, "roundEven", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, + BuiltInFunction{ EOpModf, "modf", 2, TypeF, ClassLO, {Es300Desktop130Version} }, + BuiltInFunction{ EOpMin, "min", 2, TypeIU, ClassLS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpMax, "max", 2, TypeIU, ClassLS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpClamp, "clamp", 3, TypeIU, ClassLS2, {Es300Desktop130Version} }, + BuiltInFunction{ EOpMix, "mix", 3, TypeF, ClassLB, {Es300Desktop130Version} }, + BuiltInFunction{ EOpIsInf, "isinf", 1, TypeF, ClassB, {Es300Desktop130Version} }, + BuiltInFunction{ EOpIsNan, "isnan", 1, TypeF, ClassB, {Es300Desktop130Version} }, + BuiltInFunction{ EOpLessThan, "lessThan", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpLessThanEqual, "lessThanEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpGreaterThan, "greaterThan", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpGreaterThanEqual, "greaterThanEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpVectorEqual, "equal", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpVectorNotEqual, "notEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, + BuiltInFunction{ EOpAtomicAdd, "atomicAdd", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicMin, "atomicMin", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicMax, "atomicMax", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicAnd, "atomicAnd", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicOr, "atomicOr", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} }, + BuiltInFunction{ EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} }, + BuiltInFunction{ EOpMix, "mix", 3, TypeB, ClassRegular, {Es310Desktop450Version} }, + BuiltInFunction{ EOpMix, "mix", 3, TypeIU, ClassLB, {Es310Desktop450Version} }, }; -const BuiltInFunction DerivativeFunctions[] = { - { EOpDPdx, "dFdx", 1, TypeF, ClassRegular, nullptr }, - { EOpDPdy, "dFdy", 1, TypeF, ClassRegular, nullptr }, - { EOpFwidth, "fwidth", 1, TypeF, ClassRegular, nullptr }, - { EOpNull } +const std::array DerivativeFunctions = { + BuiltInFunction{ EOpDPdx, "dFdx", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpDPdy, "dFdy", 1, TypeF, ClassRegular, {} }, + BuiltInFunction{ EOpFwidth, "fwidth", 1, TypeF, ClassRegular, {} }, }; // For functions declared some other way, but still use the table to relate to operator. struct CustomFunction { TOperator op; // operator to map the name to const char* name; // function name - const Versioning* versioning; // nullptr means always a valid version + const span versioning; // An empty span means always a valid version }; const CustomFunction CustomFunctions[] = { - { EOpBarrier, "barrier", nullptr }, - { EOpMemoryBarrierShared, "memoryBarrierShared", nullptr }, - { EOpGroupMemoryBarrier, "groupMemoryBarrier", nullptr }, - { EOpMemoryBarrier, "memoryBarrier", nullptr }, - { EOpMemoryBarrierBuffer, "memoryBarrierBuffer", nullptr }, - - { EOpPackSnorm2x16, "packSnorm2x16", nullptr }, - { EOpUnpackSnorm2x16, "unpackSnorm2x16", nullptr }, - { EOpPackUnorm2x16, "packUnorm2x16", nullptr }, - { EOpUnpackUnorm2x16, "unpackUnorm2x16", nullptr }, - { EOpPackHalf2x16, "packHalf2x16", nullptr }, - { EOpUnpackHalf2x16, "unpackHalf2x16", nullptr }, - - { EOpMul, "matrixCompMult", nullptr }, - { EOpOuterProduct, "outerProduct", nullptr }, - { EOpTranspose, "transpose", nullptr }, - { EOpDeterminant, "determinant", nullptr }, - { EOpMatrixInverse, "inverse", nullptr }, - { EOpFloatBitsToInt, "floatBitsToInt", nullptr }, - { EOpFloatBitsToUint, "floatBitsToUint", nullptr }, - { EOpIntBitsToFloat, "intBitsToFloat", nullptr }, - { EOpUintBitsToFloat, "uintBitsToFloat", nullptr }, - - { EOpTextureQuerySize, "textureSize", nullptr }, - { EOpTextureQueryLod, "textureQueryLod", nullptr }, - { EOpTextureQueryLod, "textureQueryLOD", nullptr }, // extension GL_ARB_texture_query_lod - { EOpTextureQueryLevels, "textureQueryLevels", nullptr }, - { EOpTextureQuerySamples, "textureSamples", nullptr }, - { EOpTexture, "texture", nullptr }, - { EOpTextureProj, "textureProj", nullptr }, - { EOpTextureLod, "textureLod", nullptr }, - { EOpTextureOffset, "textureOffset", nullptr }, - { EOpTextureFetch, "texelFetch", nullptr }, - { EOpTextureFetchOffset, "texelFetchOffset", nullptr }, - { EOpTextureProjOffset, "textureProjOffset", nullptr }, - { EOpTextureLodOffset, "textureLodOffset", nullptr }, - { EOpTextureProjLod, "textureProjLod", nullptr }, - { EOpTextureProjLodOffset, "textureProjLodOffset", nullptr }, - { EOpTextureGrad, "textureGrad", nullptr }, - { EOpTextureGradOffset, "textureGradOffset", nullptr }, - { EOpTextureProjGrad, "textureProjGrad", nullptr }, - { EOpTextureProjGradOffset, "textureProjGradOffset", nullptr }, - - { EOpNull } + { EOpBarrier, "barrier", {} }, + { EOpMemoryBarrierShared, "memoryBarrierShared", {} }, + { EOpGroupMemoryBarrier, "groupMemoryBarrier", {} }, + { EOpMemoryBarrier, "memoryBarrier", {} }, + { EOpMemoryBarrierBuffer, "memoryBarrierBuffer", {} }, + + { EOpPackSnorm2x16, "packSnorm2x16", {} }, + { EOpUnpackSnorm2x16, "unpackSnorm2x16", {} }, + { EOpPackUnorm2x16, "packUnorm2x16", {} }, + { EOpUnpackUnorm2x16, "unpackUnorm2x16", {} }, + { EOpPackHalf2x16, "packHalf2x16", {} }, + { EOpUnpackHalf2x16, "unpackHalf2x16", {} }, + + { EOpMul, "matrixCompMult", {} }, + { EOpOuterProduct, "outerProduct", {} }, + { EOpTranspose, "transpose", {} }, + { EOpDeterminant, "determinant", {} }, + { EOpMatrixInverse, "inverse", {} }, + { EOpFloatBitsToInt, "floatBitsToInt", {} }, + { EOpFloatBitsToUint, "floatBitsToUint", {} }, + { EOpIntBitsToFloat, "intBitsToFloat", {} }, + { EOpUintBitsToFloat, "uintBitsToFloat", {} }, + + { EOpTextureQuerySize, "textureSize", {} }, + { EOpTextureQueryLod, "textureQueryLod", {} }, + { EOpTextureQueryLod, "textureQueryLOD", {} }, // extension GL_ARB_texture_query_lod + { EOpTextureQueryLevels, "textureQueryLevels", {} }, + { EOpTextureQuerySamples, "textureSamples", {} }, + { EOpTexture, "texture", {} }, + { EOpTextureProj, "textureProj", {} }, + { EOpTextureLod, "textureLod", {} }, + { EOpTextureOffset, "textureOffset", {} }, + { EOpTextureFetch, "texelFetch", {} }, + { EOpTextureFetchOffset, "texelFetchOffset", {} }, + { EOpTextureProjOffset, "textureProjOffset", {} }, + { EOpTextureLodOffset, "textureLodOffset", {} }, + { EOpTextureProjLod, "textureProjLod", {} }, + { EOpTextureProjLodOffset, "textureProjLodOffset", {} }, + { EOpTextureGrad, "textureGrad", {} }, + { EOpTextureGradOffset, "textureGradOffset", {} }, + { EOpTextureProjGrad, "textureProjGrad", {} }, + { EOpTextureProjGradOffset, "textureProjGradOffset", {} }, }; // For the given table of functions, add all the indicated prototypes for each @@ -404,13 +397,13 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function) bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile, const SpvVersion& /* spVersion */) { // nullptr means always valid - if (function.versioning == nullptr) + if (function.versioning.empty()) return true; // check for what is said about our current profile - for (const Versioning* v = function.versioning; v->profiles != EBadProfile; ++v) { - if ((v->profiles & profile) != 0) { - if (v->minCoreVersion <= version || (v->numExtensions > 0 && v->minExtendedVersion <= version)) + for (const auto& v : function.versioning) { + if ((v.profiles & profile) != 0) { + if (v.minCoreVersion <= version || (v.numExtensions > 0 && v.minExtendedVersion <= version)) return true; } } @@ -423,12 +416,11 @@ bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile // called once per stage). This is a performance issue only, not a correctness // concern. It is done for quality arising from simplicity, as there are subtleties // to get correct if instead trying to do it surgically. -template -void RelateTabledBuiltins(const FunctionT* functions, TSymbolTable& symbolTable) +template +void RelateTabledBuiltins(const FunctionContainer& functions, TSymbolTable& symbolTable) { - while (functions->op != EOpNull) { - symbolTable.relateToOperator(functions->name, functions->op); - ++functions; + for (const auto& fn : functions) { + symbolTable.relateToOperator(fn.name, fn.op); } } @@ -437,11 +429,10 @@ void RelateTabledBuiltins(const FunctionT* functions, TSymbolTable& symbolTable) // Add declarations for all tables of built-in functions. void TBuiltIns::addTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion) { - const auto forEachFunction = [&](TString& decls, const BuiltInFunction* function) { - while (function->op != EOpNull) { - if (ValidVersion(*function, version, profile, spvVersion)) - AddTabledBuiltin(decls, *function); - ++function; + const auto forEachFunction = [&](TString& decls, const span& functions) { + for (const auto& fn : functions) { + if (ValidVersion(fn, version, profile, spvVersion)) + AddTabledBuiltin(decls, fn); } }; @@ -1474,6 +1465,20 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + // NV_shader_atomic_fp16_vector + if (profile != EEsProfile && version >= 430) { + commonBuiltins.append( + "f16vec2 atomicAdd(coherent volatile inout f16vec2, f16vec2);" + "f16vec4 atomicAdd(coherent volatile inout f16vec4, f16vec4);" + "f16vec2 atomicMin(coherent volatile inout f16vec2, f16vec2);" + "f16vec4 atomicMin(coherent volatile inout f16vec4, f16vec4);" + "f16vec2 atomicMax(coherent volatile inout f16vec2, f16vec2);" + "f16vec4 atomicMax(coherent volatile inout f16vec4, f16vec4);" + "f16vec2 atomicExchange(coherent volatile inout f16vec2, f16vec2);" + "f16vec4 atomicExchange(coherent volatile inout f16vec4, f16vec4);" + "\n"); + } + if ((profile == EEsProfile && version >= 300) || (profile != EEsProfile && version >= 150)) { // GL_ARB_shader_bit_encoding commonBuiltins.append( @@ -1727,6 +1732,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec4 shadow2DRect(sampler2DRectShadow, vec3);" // GL_ARB_texture_rectangle, caught by keyword check "vec4 shadow2DRectProj(sampler2DRectShadow, vec4);" // GL_ARB_texture_rectangle, caught by keyword check + "vec4 texture1DArray(sampler1DArray, vec2);" // GL_EXT_texture_array + "vec4 texture2DArray(sampler2DArray, vec3);" // GL_EXT_texture_array + "vec4 shadow1DArray(sampler1DArrayShadow, vec3);" // GL_EXT_texture_array + "vec4 shadow2DArray(sampler2DArrayShadow, vec4);" // GL_EXT_texture_array + "vec4 texture1DArray(sampler1DArray, vec2, float);" // GL_EXT_texture_array + "vec4 texture2DArray(sampler2DArray, vec3, float);" // GL_EXT_texture_array + "vec4 shadow1DArray(sampler1DArrayShadow, vec3, float);" // GL_EXT_texture_array + "vec4 texture1DArrayLod(sampler1DArray, vec2, float);" // GL_EXT_texture_array + "vec4 texture2DArrayLod(sampler2DArray, vec3, float);" // GL_EXT_texture_array + "vec4 shadow1DArrayLod(sampler1DArrayShadow, vec3, float);" // GL_EXT_texture_array "\n"); } } @@ -2098,6 +2113,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "%s subgroupShuffleXor(%s, uint);\n", "%s subgroupShuffleUp(%s, uint delta);\n", "%s subgroupShuffleDown(%s, uint delta);\n", + "%s subgroupRotate(%s, uint);\n", + "%s subgroupClusteredRotate(%s, uint, uint);\n", "%s subgroupAdd(%s);\n", "%s subgroupMul(%s);\n", "%s subgroupMin(%s);\n", @@ -2226,6 +2243,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV ); } + // GL_EXT_shader_quad_control + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + commonBuiltins.append( + "bool subgroupQuadAll(bool);\n" + "bool subgroupQuadAny(bool);\n" + ); + } + if (profile != EEsProfile && version >= 460) { commonBuiltins.append( "bool anyInvocation(bool);" @@ -4106,6 +4132,50 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "u16vec4 unpack16(uint64_t);" "i32vec2 unpack32(int64_t);" "u32vec2 unpack32(uint64_t);" + + // GL_EXT_expect_assume + "int8_t expectEXT(int8_t, int8_t);" + "i8vec2 expectEXT(i8vec2, i8vec2);" + "i8vec3 expectEXT(i8vec3, i8vec3);" + "i8vec4 expectEXT(i8vec4, i8vec4);" + + "uint8_t expectEXT(uint8_t, uint8_t);" + "u8vec2 expectEXT(u8vec2, u8vec2);" + "u8vec3 expectEXT(u8vec3, u8vec3);" + "u8vec4 expectEXT(u8vec4, u8vec4);" + + "int16_t expectEXT(int16_t, int16_t);" + "i16vec2 expectEXT(i16vec2, i16vec2);" + "i16vec3 expectEXT(i16vec3, i16vec3);" + "i16vec4 expectEXT(i16vec4, i16vec4);" + + "uint16_t expectEXT(uint16_t, uint16_t);" + "u16vec2 expectEXT(u16vec2, u16vec2);" + "u16vec3 expectEXT(u16vec3, u16vec3);" + "u16vec4 expectEXT(u16vec4, u16vec4);" + + "int64_t expectEXT(int64_t, int64_t);" + "i64vec2 expectEXT(i64vec2, i64vec2);" + "i64vec3 expectEXT(i64vec3, i64vec3);" + "i64vec4 expectEXT(i64vec4, i64vec4);" + + "uint64_t expectEXT(uint64_t, uint64_t);" + "u64vec2 expectEXT(u64vec2, u64vec2);" + "u64vec3 expectEXT(u64vec3, u64vec3);" + "u64vec4 expectEXT(u64vec4, u64vec4);" + "\n"); + } + + // Builtins for GL_EXT_texture_shadow_lod + if ((profile == EEsProfile && version >= 300) || ((profile != EEsProfile && version >= 130))) { + commonBuiltins.append( + "float texture(sampler2DArrayShadow, vec4, float);" + "float texture(samplerCubeArrayShadow, vec4, float, float);" + "float textureLod(sampler2DArrayShadow, vec4, float);" + "float textureLod(samplerCubeShadow, vec4, float);" + "float textureLod(samplerCubeArrayShadow, vec4, float, float);" + "float textureLodOffset(sampler2DArrayShadow, vec4, float, ivec2);" + "float textureOffset(sampler2DArrayShadow, vec4 , ivec2, float);" "\n"); } @@ -4131,6 +4201,29 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV } + // GL_EXT_expect_assume + if ((profile == EEsProfile && version >= 310) || + ((profile != EEsProfile && version >= 140))) { + commonBuiltins.append( + "void assumeEXT(bool);" + + "bool expectEXT(bool, bool);" + "bvec2 expectEXT(bvec2, bvec2);" + "bvec3 expectEXT(bvec3, bvec3);" + "bvec4 expectEXT(bvec4, bvec4);" + + "int expectEXT(int, int);" + "ivec2 expectEXT(ivec2, ivec2);" + "ivec3 expectEXT(ivec3, ivec3);" + "ivec4 expectEXT(ivec4, ivec4);" + + "uint expectEXT(uint, uint);" + "uvec2 expectEXT(uvec2, uvec2);" + "uvec3 expectEXT(uvec3, uvec3);" + "uvec4 expectEXT(uvec4, uvec4);" + "\n"); + } + // QCOM_image_processing if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 140)) { @@ -4140,6 +4233,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec4 textureBoxFilterQCOM(sampler2D, vec2, vec2);" "vec4 textureBlockMatchSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" "vec4 textureBlockMatchSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + + "vec4 textureBlockMatchWindowSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "vec4 textureBlockMatchWindowSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "vec4 textureBlockMatchGatherSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "vec4 textureBlockMatchGatherSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" "\n"); } @@ -4460,6 +4558,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "const int gl_MatrixOperandsSaturatingAccumulation = 0x10;\n" "const int gl_CooperativeMatrixLayoutRowMajor = 0;\n" "const int gl_CooperativeMatrixLayoutColumnMajor = 1;\n" + "const int gl_CooperativeMatrixLayoutRowBlockedInterleavedARM = 4202;\n" + "const int gl_CooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203;\n" "\n" ); } @@ -4702,6 +4802,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void reorderThreadNV(uint, uint);" "void reorderThreadNV(hitObjectNV);" "void reorderThreadNV(hitObjectNV, uint, uint);" + "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" "\n"); stageBuiltins[EShLangIntersect].append( "bool reportIntersectionNV(float, uint);" @@ -4819,6 +4921,20 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void SetMeshOutputsEXT(uint, uint);" "\n"); } + // Builtins for GL_NV_displacement_micromap + if ((profile != EEsProfile && version >= 460) || (profile == EEsProfile && version >= 320)) { + stageBuiltins[EShLangMesh].append( + "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" + "\n"); + + stageBuiltins[EShLangCompute].append( + "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" + "\n"); + + } + //============================================================================ // @@ -5218,7 +5334,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangVertex].append( "int gl_VertexID;" // needs qualifier fixed later ); - if (version >= 140 && spvVersion.vulkan == 0) + if (spvVersion.vulkan == 0) stageBuiltins[EShLangVertex].append( "int gl_InstanceID;" // needs qualifier fixed later ); @@ -5273,6 +5389,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangVertex].append( "highp vec4 gl_Position;" // needs qualifier fixed later "mediump float gl_PointSize;" // needs qualifier fixed later + "highp int gl_InstanceID;" // needs qualifier fixed later ); } else { if (spvVersion.vulkan == 0 || spvVersion.vulkanRelaxed) @@ -6001,6 +6118,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "const uint gl_RayFlagsForceOpacityMicromap2StateEXT = 1024U;" "const uint gl_HitKindFrontFacingTriangleEXT = 254U;" "const uint gl_HitKindBackFacingTriangleEXT = 255U;" + "in uint gl_HitKindFrontFacingMicroTriangleNV;" + "in uint gl_HitKindBackFacingMicroTriangleNV;" "\n"; const char *constRayQueryIntersection = @@ -6089,7 +6208,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in float gl_CurrentRayTimeNV;" "in uint gl_CullMaskEXT;" "in vec3 gl_HitTriangleVertexPositionsEXT[3];" + "in vec3 gl_HitMicroTriangleVertexPositionsNV[3];" + "in vec2 gl_HitMicroTriangleVertexBarycentricsNV[3];" "\n"; + const char *missDecls = "in uvec3 gl_LaunchIDNV;" "in uvec3 gl_LaunchIDEXT;" @@ -6245,7 +6367,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c { if ((ms || image) && shadow) continue; - if (ms && profile != EEsProfile && version < 150) + if (ms && profile != EEsProfile && version < 140) continue; if (ms && image && profile == EEsProfile) continue; @@ -6577,6 +6699,34 @@ void TBuiltIns::addImageFunctions(TSampler sampler, const TString& typeName, int commonBuiltins.append(imageParams); commonBuiltins.append(", float);\n"); } + + // GL_NV_shader_atomic_fp16_vector + if (profile != EEsProfile && version >= 430) { + const int numFp16Builtins = 4; + const char* atomicFp16Func[numFp16Builtins] = { + " imageAtomicAdd(volatile coherent ", + " imageAtomicMin(volatile coherent ", + " imageAtomicMax(volatile coherent ", + " imageAtomicExchange(volatile coherent " + }; + const int numFp16DataTypes = 2; + const char* atomicFp16DataTypes[numFp16DataTypes] = { + "f16vec2", + "f16vec4" + }; + // Loop twice to add prototypes with/without scope/semantics + for (int j = 0; j < numFp16DataTypes; ++j) { + for (int i = 0; i < numFp16Builtins; ++i) { + commonBuiltins.append(atomicFp16DataTypes[j]); + commonBuiltins.append(atomicFp16Func[i]); + commonBuiltins.append(imageParams); + commonBuiltins.append(", "); + commonBuiltins.append(atomicFp16DataTypes[j]); + commonBuiltins.append(");\n"); + } + } + } + if (profile != EEsProfile && version >= 450) { commonBuiltins.append("float imageAtomicAdd(volatile coherent "); commonBuiltins.append(imageParams); @@ -7818,6 +7968,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion if (spvVersion.vulkan == 0) { SpecialQualifier("gl_VertexID", EvqVertexId, EbvVertexId, symbolTable); SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable); + if (version < 140) + symbolTable.setVariableExtensions("gl_InstanceID", 1, &E_GL_EXT_draw_instanced); } if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) { @@ -7969,7 +8121,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("shadow2DEXT", 1, &E_GL_EXT_shadow_samplers); symbolTable.setFunctionExtensions("shadow2DProjEXT", 1, &E_GL_EXT_shadow_samplers); } - // Fall through + + // E_GL_EXT_texture_array + if (profile != EEsProfile && spvVersion.spv == 0) { + symbolTable.setFunctionExtensions("texture1DArray", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("texture2DArray", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("shadow1DArray", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("shadow2DArray", 1, &E_GL_EXT_texture_array); + + symbolTable.setFunctionExtensions("texture1DArrayLod", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("texture2DArrayLod", 1, &E_GL_EXT_texture_array); + symbolTable.setFunctionExtensions("shadow1DArrayLod", 1, &E_GL_EXT_texture_array); + } + [[fallthrough]]; case EShLangTessControl: if (profile == EEsProfile && version >= 310) { @@ -7984,7 +8148,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_BoundingBox", EbvBoundingBox, symbolTable); } } - // Fall through + [[fallthrough]]; case EShLangTessEvaluation: case EShLangGeometry: @@ -8570,6 +8734,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); } + // GL_EXT_expect_assume + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.setFunctionExtensions("assumeEXT", 1, &E_GL_EXT_expect_assume); + symbolTable.setFunctionExtensions("expectEXT", 1, &E_GL_EXT_expect_assume); + } + // GL_KHR_shader_subgroup if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 140)) { @@ -8611,6 +8782,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("subgroupShuffleXor", 1, &E_GL_KHR_shader_subgroup_shuffle); symbolTable.setFunctionExtensions("subgroupShuffleUp", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); symbolTable.setFunctionExtensions("subgroupShuffleDown", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); + symbolTable.setFunctionExtensions("subgroupRotate", 1, &E_GL_KHR_shader_subgroup_rotate); + symbolTable.setFunctionExtensions("subgroupClusteredRotate", 1, &E_GL_KHR_shader_subgroup_rotate); symbolTable.setFunctionExtensions("subgroupAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); symbolTable.setFunctionExtensions("subgroupMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); symbolTable.setFunctionExtensions("subgroupMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); @@ -8729,6 +8902,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); } + // GL_EXT_shader_quad_control + if ((profile != EEsProfile && version >= 140) || + (profile == EEsProfile && version >= 310)) { + symbolTable.setFunctionExtensions("subgroupQuadAll", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupQuadAny", 1, &E_GL_KHR_shader_subgroup_vote); + } + // GL_EXT_shader_tile_image symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); @@ -8736,10 +8916,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 140)) { + symbolTable.setFunctionExtensions("textureWeightedQCOM", 1, &E_GL_QCOM_image_processing); symbolTable.setFunctionExtensions("textureBoxFilterQCOM", 1, &E_GL_QCOM_image_processing); symbolTable.setFunctionExtensions("textureBlockMatchSADQCOM", 1, &E_GL_QCOM_image_processing); symbolTable.setFunctionExtensions("textureBlockMatchSSDQCOM", 1, &E_GL_QCOM_image_processing); + + symbolTable.setFunctionExtensions("textureBlockMatchWindowSSDQCOM", 1, &E_GL_QCOM_image_processing2); + symbolTable.setFunctionExtensions("textureBlockMatchWindowSADQCOM", 1, &E_GL_QCOM_image_processing2); + symbolTable.setFunctionExtensions("textureBlockMatchGatherSSDQCOM", 1, &E_GL_QCOM_image_processing2); + symbolTable.setFunctionExtensions("textureBlockMatchGatherSADQCOM", 1, &E_GL_QCOM_image_processing2); } break; @@ -8901,6 +9087,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); } + + if ((profile != EEsProfile && version >= 460)) { + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); + } break; case EShLangRayGen: @@ -8947,6 +9138,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur); symbolTable.setVariableExtensions("gl_HitTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch); + symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexPositionsNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexBarycentricsNV", 1, &E_GL_NV_displacement_micromap); symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); @@ -8992,6 +9185,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexNV", 1, &E_GL_NV_shader_invocation_reorder); symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleNV", 1, &E_GL_NV_shader_invocation_reorder); symbolTable.setFunctionExtensions("reorderThreadNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable); @@ -9016,8 +9211,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_RayTmaxNV", EbvRayTmax, symbolTable); BuiltInVariable("gl_RayTmaxEXT", EbvRayTmax, symbolTable); BuiltInVariable("gl_CullMaskEXT", EbvCullMask, symbolTable); - BuiltInVariable("gl_HitTNV", EbvHitT, symbolTable); - BuiltInVariable("gl_HitTEXT", EbvHitT, symbolTable); BuiltInVariable("gl_HitKindNV", EbvHitKind, symbolTable); BuiltInVariable("gl_HitKindEXT", EbvHitKind, symbolTable); BuiltInVariable("gl_ObjectToWorldNV", EbvObjectToWorld, symbolTable); @@ -9031,6 +9224,14 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable); BuiltInVariable("gl_HitTriangleVertexPositionsEXT", EbvPositionFetch, symbolTable); + BuiltInVariable("gl_HitMicroTriangleVertexPositionsNV", EbvMicroTrianglePositionNV, symbolTable); + BuiltInVariable("gl_HitMicroTriangleVertexBarycentricsNV", EbvMicroTriangleBaryNV, symbolTable); + BuiltInVariable("gl_HitKindFrontFacingMicroTriangleNV", EbvHitKindFrontFacingMicroTriangleNV, symbolTable); + BuiltInVariable("gl_HitKindBackFacingMicroTriangleNV", EbvHitKindBackFacingMicroTriangleNV, symbolTable); + + // gl_HitT variables are aliases of their gl_RayTmax counterparts. + RetargetVariable("gl_HitTNV", "gl_RayTmaxNV", symbolTable); + RetargetVariable("gl_HitTEXT", "gl_RayTmaxEXT", symbolTable); // GL_ARB_shader_ballot symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); @@ -9332,6 +9533,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); } + + // Builtins for GL_NV_displacment_micromap + if ((profile != EEsProfile && version >= 460)) { + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); + } + break; case EShLangTask: @@ -9642,6 +9850,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("averageRounded", EOpAverageRounded); symbolTable.relateToOperator("multiply32x16", EOpMul32x16); symbolTable.relateToOperator("debugPrintfEXT", EOpDebugPrintf); + symbolTable.relateToOperator("assumeEXT", EOpAssumeEXT); + symbolTable.relateToOperator("expectEXT", EOpExpectEXT); if (PureOperatorBuiltins) { @@ -9845,6 +10055,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("subgroupShuffleXor", EOpSubgroupShuffleXor); symbolTable.relateToOperator("subgroupShuffleUp", EOpSubgroupShuffleUp); symbolTable.relateToOperator("subgroupShuffleDown", EOpSubgroupShuffleDown); + symbolTable.relateToOperator("subgroupRotate", EOpSubgroupRotate); + symbolTable.relateToOperator("subgroupClusteredRotate", EOpSubgroupClusteredRotate); symbolTable.relateToOperator("subgroupAdd", EOpSubgroupAdd); symbolTable.relateToOperator("subgroupMul", EOpSubgroupMul); symbolTable.relateToOperator("subgroupMin", EOpSubgroupMin); @@ -9907,12 +10119,35 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("shadow2DProjEXT", EOpTextureProj); } + // GL_EXT_shader_quad_control + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.relateToOperator("subgroupQuadAll", EOpSubgroupQuadAll); + symbolTable.relateToOperator("subgroupQuadAny", EOpSubgroupQuadAny); + } + if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 140)) { symbolTable.relateToOperator("textureWeightedQCOM", EOpImageSampleWeightedQCOM); symbolTable.relateToOperator("textureBoxFilterQCOM", EOpImageBoxFilterQCOM); symbolTable.relateToOperator("textureBlockMatchSADQCOM", EOpImageBlockMatchSADQCOM); symbolTable.relateToOperator("textureBlockMatchSSDQCOM", EOpImageBlockMatchSSDQCOM); + + symbolTable.relateToOperator("textureBlockMatchWindowSSDQCOM", EOpImageBlockMatchWindowSSDQCOM); + symbolTable.relateToOperator("textureBlockMatchWindowSADQCOM", EOpImageBlockMatchWindowSADQCOM); + symbolTable.relateToOperator("textureBlockMatchGatherSSDQCOM", EOpImageBlockMatchGatherSSDQCOM); + symbolTable.relateToOperator("textureBlockMatchGatherSADQCOM", EOpImageBlockMatchGatherSADQCOM); + } + + if (profile != EEsProfile && spvVersion.spv == 0) { + symbolTable.relateToOperator("texture1DArray", EOpTexture); + symbolTable.relateToOperator("texture2DArray", EOpTexture); + symbolTable.relateToOperator("shadow1DArray", EOpTexture); + symbolTable.relateToOperator("shadow2DArray", EOpTexture); + + symbolTable.relateToOperator("texture1DArrayLod", EOpTextureLod); + symbolTable.relateToOperator("texture2DArrayLod", EOpTextureLod); + symbolTable.relateToOperator("shadow1DArrayLod", EOpTextureLod); } } @@ -10005,9 +10240,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("coopMatLoad", EOpCooperativeMatrixLoad); symbolTable.relateToOperator("coopMatStore", EOpCooperativeMatrixStore); symbolTable.relateToOperator("coopMatMulAdd", EOpCooperativeMatrixMulAdd); + + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); + symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); + } break; case EShLangRayGen: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); + symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); + } + [[fallthrough]]; case EShLangClosestHit: case EShLangMiss: if (profile != EEsProfile && version >= 460) { @@ -10079,6 +10324,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion if (profile != EEsProfile && version >= 450) { symbolTable.relateToOperator("SetMeshOutputsEXT", EOpSetMeshOutputsEXT); } + + if (profile != EEsProfile && version >= 460) { + // Builtins for GL_NV_displacement_micromap. + symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); + symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); + } break; case EShLangTask: if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp index a8e3b38b..63e176e3 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -376,6 +376,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, case EOpNegative: if (child->getType().getBasicType() == EbtStruct || child->getType().isArray()) return nullptr; + break; default: break; // some compilers want this } @@ -1277,6 +1278,7 @@ void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, T // matrix multiply does not change shapes if (lhsNode->isMatrix() && rhsNode->isMatrix()) return; + [[fallthrough]]; case EOpAdd: case EOpSub: case EOpDiv: @@ -2317,6 +2319,40 @@ TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* r return aggNode; } +TIntermAggregate* TIntermediate::mergeAggregate(TIntermNode* left, TIntermNode* right) +{ + if (left == nullptr && right == nullptr) + return nullptr; + + TIntermAggregate* aggNode = nullptr; + if (left != nullptr) + aggNode = left->getAsAggregate(); + if (aggNode == nullptr || aggNode->getOp() != EOpNull) { + aggNode = new TIntermAggregate; + if (left != nullptr) + aggNode->getSequence().push_back(left); + } + + TIntermAggregate* rhsagg = right->getAsAggregate(); + if (rhsagg == nullptr || rhsagg->getOp() != EOpNull) + aggNode->getSequence().push_back(right); + else + aggNode->getSequence().insert(aggNode->getSequence().end(), + rhsagg->getSequence().begin(), + rhsagg->getSequence().end()); + + return aggNode; +} + +TIntermAggregate* TIntermediate::mergeAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc& loc) +{ + TIntermAggregate* aggNode = mergeAggregate(left, right); + if (aggNode) + aggNode->setLoc(loc); + + return aggNode; +} + // // Turn an existing node into an aggregate. // @@ -2590,6 +2626,18 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(double d, TBasicType baseT { assert(baseType == EbtFloat || baseType == EbtDouble || baseType == EbtFloat16); + if (isEsProfile() && (baseType == EbtFloat || baseType == EbtFloat16)) { + int exponent = 0; + frexp(d, &exponent); + int minExp = baseType == EbtFloat ? -126 : -14; + int maxExp = baseType == EbtFloat ? 127 : 15; + if (exponent > maxExp) { //overflow, d = inf + d = std::numeric_limits::infinity(); + } else if (exponent < minExp) { //underflow, d = 0.0; + d = 0.0; + } + } + TConstUnionArray unionArray(1); unionArray[0].setDConst(d); @@ -2647,28 +2695,42 @@ TIntermTyped* TIntermediate::addSwizzle(TSwizzleSelectors& selecto // 'swizzleOkay' says whether or not it is okay to consider a swizzle // a valid part of the dereference chain. // -// 'BufferReferenceOk' says if type is buffer_reference, the routine stop to find the most left node. +// 'bufferReferenceOk' says if type is buffer_reference, the routine will stop to find the most left node. // +// 'proc' is an optional function to run on each node that is processed during the traversal. 'proc' must +// return true to continue the traversal, or false to end the traversal early. // -const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool swizzleOkay , bool bufferReferenceOk) +const TIntermTyped* TIntermediate::traverseLValueBase(const TIntermTyped* node, bool swizzleOkay, + bool bufferReferenceOk, + std::function proc) { do { const TIntermBinary* binary = node->getAsBinaryNode(); - if (binary == nullptr) + if (binary == nullptr) { + if (proc) { + proc(*node); + } return node; + } TOperator op = binary->getOp(); - if (op != EOpIndexDirect && op != EOpIndexIndirect && op != EOpIndexDirectStruct && op != EOpVectorSwizzle && op != EOpMatrixSwizzle) + if (op != EOpIndexDirect && op != EOpIndexIndirect && op != EOpIndexDirectStruct && op != EOpVectorSwizzle && + op != EOpMatrixSwizzle) return nullptr; - if (! swizzleOkay) { + if (!swizzleOkay) { if (op == EOpVectorSwizzle || op == EOpMatrixSwizzle) return nullptr; if ((op == EOpIndexDirect || op == EOpIndexIndirect) && (binary->getLeft()->getType().isVector() || binary->getLeft()->getType().isScalar()) && - ! binary->getLeft()->getType().isArray()) + !binary->getLeft()->getType().isArray()) return nullptr; } - node = node->getAsBinaryNode()->getLeft(); + if (proc) { + if (!proc(*node)) { + return node; + } + } + node = binary->getLeft(); if (bufferReferenceOk && node->isReference()) return node; } while (true); @@ -2795,10 +2857,9 @@ void TIntermediate::addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguag //} if (language == EShLangVertex) { - // the names won't be found in the symbol table unless the versions are right, - // so version logic does not need to be repeated here addSymbolLinkageNode(linkage, symbolTable, "gl_VertexID"); - addSymbolLinkageNode(linkage, symbolTable, "gl_InstanceID"); + if ((version < 140 && requestedExtensions.find(E_GL_EXT_draw_instanced) != requestedExtensions.end()) || version >= 140) + addSymbolLinkageNode(linkage, symbolTable, "gl_InstanceID"); } // Add a child to the root node for the linker objects @@ -3430,6 +3491,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) // check for non-Boolean operands if (left->getBasicType() == EbtBool || right->getBasicType() == EbtBool) return false; + break; default: break; @@ -3473,13 +3535,14 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) if (left->getType() == right->getType()) return true; - // Fall through + [[fallthrough]]; case EOpMul: case EOpMulAssign: // At least the basic type has to match if (left->getBasicType() != right->getBasicType()) return false; + break; default: break; @@ -3622,7 +3685,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) case EOpAssign: if (left->getVectorSize() != right->getVectorSize() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixRows() != right->getMatrixRows()) return false; - // fall through + [[fallthrough]]; case EOpAdd: case EOpSub: diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp index d73f403b..f7895d97 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -59,7 +59,7 @@ void TParseContextBase::outputMessage(const TSourceLoc& loc, const char* szReaso safe_vsprintf(szExtraInfo, maxSize, szExtraInfoFormat, args); infoSink.info.prefix(prefix); - infoSink.info.location(loc); + infoSink.info.location(loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); infoSink.info << "'" << szToken << "' : " << szReason << " " << szExtraInfo << "\n"; if (prefix == EPrefixError) { @@ -208,7 +208,7 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, // // If we get here, we have an error and a message. // - const TIntermTyped* leftMostTypeNode = TIntermediate::findLValueBase(node, true); + const TIntermTyped* leftMostTypeNode = TIntermediate::traverseLValueBase(node, true); if (symNode) error(loc, " l-value required", op, "\"%s\" (%s)", symbol, message); @@ -234,7 +234,7 @@ void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op, const TIntermSymbol* symNode = node->getAsSymbolNode(); if (node->getQualifier().isWriteOnly()) { - const TIntermTyped* leftMostTypeNode = TIntermediate::findLValueBase(node, true); + const TIntermTyped* leftMostTypeNode = TIntermediate::traverseLValueBase(node, true); if (symNode != nullptr) error(loc, "can't read from writeonly object: ", op, symNode->getName().c_str()); @@ -257,6 +257,7 @@ void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op, case EOpVectorSwizzle: case EOpMatrixSwizzle: rValueErrorCheck(loc, op, binaryNode->getLeft()); + break; default: break; } @@ -626,10 +627,8 @@ void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& mem if (symbol) { if (memberType != symbol->getType()) { TString err; - err += "\"" + memberType.getCompleteString() + "\""; - err += " versus "; - err += "\"" + symbol->getType().getCompleteString() + "\""; - error(loc, "Types must match:", memberType.getFieldName().c_str(), err.c_str()); + err += "Redeclaration: already declared as \"" + symbol->getType().getCompleteString() + "\""; + error(loc, "", memberName.c_str(), err.c_str()); } return; } @@ -724,6 +723,24 @@ void TParseContextBase::finish() if (parsingBuiltins) return; + for (const TString& relaxedSymbol : relaxedSymbols) + { + TSymbol* symbol = symbolTable.find(relaxedSymbol); + TType& type = symbol->getWritableType(); + for (const TTypeLoc& typeLoc : *type.getStruct()) + { + if (typeLoc.type->isOpaque()) + { + typeLoc.type->getSampler() = TSampler{}; + typeLoc.type->setBasicType(EbtInt); + TString fieldName("/*"); + fieldName.append(typeLoc.type->getFieldName()); + fieldName.append("*/"); + typeLoc.type->setFieldName(fieldName); + } + } + } + // Transfer the linkage symbols to AST nodes, preserving order. TIntermAggregate* linkage = new TIntermAggregate; for (auto i = linkageSymbols.begin(); i != linkageSymbols.end(); ++i) diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index 806983a1..215ccd99 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -4,6 +4,7 @@ // Copyright (C) 2015-2018 Google, Inc. // Copyright (C) 2017, 2019 ARM Limited. // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// Modifications Copyright (C) 2024 Ravi Prakash Singh. // // All rights reserved. // @@ -41,7 +42,6 @@ #include "Initialize.h" #include "Scan.h" -#include "../OSDependent/osinclude.h" #include #include "preprocessor/PpContext.h" @@ -399,6 +399,10 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& if (spvVersion.spv < glslang::EShTargetSpv_1_3) error(loc, "requires SPIR-V 1.3", "#pragma use_variable_pointers", ""); intermediate.setUseVariablePointers(); + } else if (spvVersion.spv > 0 && tokens[0].compare("use_replicated_composites") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setReplicatedComposites(); } else if (tokens[0].compare("once") == 0) { warn(loc, "not implemented", "#pragma once", ""); } else if (tokens[0].compare("glslang_binary_double_output") == 0) { @@ -492,7 +496,7 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb if ((variable->getMangledName() == "gl_PrimitiveTriangleIndicesEXT" && primitiveType != ElgTriangles) || (variable->getMangledName() == "gl_PrimitiveLineIndicesEXT" && primitiveType != ElgLines) || (variable->getMangledName() == "gl_PrimitivePointIndicesEXT" && primitiveType != ElgPoints)) { - error(loc, "cannot be used (ouput primitive type mismatch)", string->c_str(), ""); + error(loc, "cannot be used (output primitive type mismatch)", string->c_str(), ""); variable = nullptr; } } @@ -598,6 +602,10 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn indexValue >= resources.maxCullDistances) { error(loc, "gl_CullDistance", "[", "array index out of range '%d'", indexValue); } + else if (base->getQualifier().builtIn == EbvSampleMask && + indexValue >= (resources.maxSamples + 31) / 32) { + error(loc, "gl_SampleMask", "[", "array index out of range '%d'", indexValue); + } // For 2D per-view builtin arrays, update the inner dimension size in parent type if (base->getQualifier().isPerView() && base->getQualifier().builtIn != EbvNone) { TIntermBinary* binaryNode = base->getAsBinaryNode(); @@ -632,7 +640,7 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn else { // input/output blocks either don't exist or can't be variably indexed } - } else if (language == EShLangFragment && base->getQualifier().isPipeOutput()) + } else if (language == EShLangFragment && base->getQualifier().isPipeOutput() && base->getQualifier().builtIn != EbvSampleMask) requireProfile(base->getLoc(), ~EEsProfile, "variable indexing fragment shader output array"); else if (base->getBasicType() == EbtSampler && version >= 130) { const char* explanation = "variable indexing sampler array"; @@ -993,17 +1001,25 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm break; } } + if (fieldFound) { - if (base->getType().getQualifier().isFrontEndConstant()) - result = intermediate.foldDereference(base, member, loc); - else { - blockMemberExtensionCheck(loc, base, member, field); - TIntermTyped* index = intermediate.addConstantUnion(member, loc); - result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc); - result->setType(*(*fields)[member].type); - if ((*fields)[member].type->getQualifier().isIo()) - intermediate.addIoAccessed(field); + if (spvVersion.vulkan != 0 && spvVersion.vulkanRelaxed) + result = vkRelaxedRemapDotDereference(loc, *base, *(*fields)[member].type, field); + + if (result == base) + { + if (base->getType().getQualifier().isFrontEndConstant()) + result = intermediate.foldDereference(base, member, loc); + else { + blockMemberExtensionCheck(loc, base, member, field); + TIntermTyped* index = intermediate.addConstantUnion(member, loc); + result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc); + result->setType(*(*fields)[member].type); + if ((*fields)[member].type->getQualifier().isIo()) + intermediate.addIoAccessed(field); + } } + inheritMemoryQualifiers(base->getQualifier(), result->getWritableType().getQualifier()); } else { auto baseSymbol = base; @@ -1243,6 +1259,8 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, error(loc, "function cannot take any parameter(s)", function.getName().c_str(), ""); if (function.getType().getBasicType() != EbtVoid) error(loc, "", function.getType().getBasicTypeString().c_str(), "entry point cannot return a value"); + if (function.getLinkType() != ELinkNone) + error(loc, "main function cannot be exported", "", ""); } // @@ -1279,6 +1297,7 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, } else paramNodes = intermediate.growAggregate(paramNodes, intermediate.addSymbol(*param.type, loc), loc); } + paramNodes->setLinkType(function.getLinkType()); intermediate.setAggregateOperator(paramNodes, EOpParameters, TType(EbtVoid), loc); loopNestingLevel = 0; statementNestingLevel = 0; @@ -1340,6 +1359,10 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction // - a user function. // Error check for a function requiring specific extensions present. + if (builtIn && + (fnCandidate->getBuiltInOp() == EOpSubgroupQuadAll || fnCandidate->getBuiltInOp() == EOpSubgroupQuadAny)) + requireExtensions(loc, 1, &E_GL_EXT_shader_quad_control, fnCandidate->getName().c_str()); + if (builtIn && fnCandidate->getNumExtensions()) requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(), fnCandidate->getName().c_str()); @@ -1349,7 +1372,10 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction requireInt16Arithmetic(loc, "built-in function", "(u)int16 types can only be in uniform block or buffer storage"); if (builtIn && fnCandidate->getType().contains8BitInt()) requireInt8Arithmetic(loc, "built-in function", "(u)int8 types can only be in uniform block or buffer storage"); - + if (builtIn && (fnCandidate->getBuiltInOp() == EOpTextureFetch || fnCandidate->getBuiltInOp() == EOpTextureQuerySize)) { + if ((*fnCandidate)[0].type->getSampler().isMultiSample() && version <= 140) + requireExtensions(loc, 1, &E_GL_ARB_texture_multisample, fnCandidate->getName().c_str()); + } if (arguments != nullptr) { // Make sure qualifications work for these arguments. TIntermAggregate* aggregate = arguments->getAsAggregate(); @@ -1652,7 +1678,9 @@ TIntermNode* TParseContext::handleReturnValue(const TSourceLoc& loc, TIntermType } } else { if (value->getType().isTexture() || value->getType().isImage()) { - if (!extensionTurnedOn(E_GL_ARB_bindless_texture)) + if (spvVersion.spv != 0) + error(loc, "sampler or image cannot be used as return type when generating SPIR-V", "return", ""); + else if (!extensionTurnedOn(E_GL_ARB_bindless_texture)) error(loc, "sampler or image can be used as return type only when the extension GL_ARB_bindless_texture enabled", "return", ""); } branch = intermediate.addBranch(EOpReturn, value, loc); @@ -1743,6 +1771,11 @@ TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction name == "gl_MeshPrimitivesNV") { length = getIoArrayImplicitSize(type.getQualifier()); } + } else if (const auto typed = intermNode->getAsTyped()) { + if (typed->getQualifier().builtIn == EbvSampleMask) { + requireProfile(loc, EEsProfile, "the array size of gl_SampleMask and gl_SampleMaskIn is ceil(gl_MaxSamples/32)"); + length = (resources.maxSamples + 31) / 32; + } } if (length == 0) { if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) @@ -2169,6 +2202,37 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } break; } + + case EOpTexture: + case EOpTextureLod: + { + if ((fnCandidate.getParamCount() > 2) && ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && + ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && fnCandidate[0].type->getSampler().shadow) { + featureString = fnCandidate.getName(); + if (callNode.getOp() == EOpTexture) + featureString += "(..., float bias)"; + else + featureString += "(..., float lod)"; + feature = featureString.c_str(); + + if ((fnCandidate[0].type->getSampler().dim == Esd2D && fnCandidate[0].type->getSampler().arrayed) || //2D Array Shadow + (fnCandidate[0].type->getSampler().dim == EsdCube && fnCandidate[0].type->getSampler().arrayed && fnCandidate.getParamCount() > 3) || // Cube Array Shadow + (fnCandidate[0].type->getSampler().dim == EsdCube && callNode.getOp() == EOpTextureLod)) { // Cube Shadow + requireExtensions(loc, 1, &E_GL_EXT_texture_shadow_lod, feature); + if (isEsProfile()) { + if (version < 320 && + !extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array)) + error(loc, "GL_EXT_texture_shadow_lod not supported for this ES version", feature, ""); + else + profileRequires(loc, EEsProfile, 320, nullptr, feature); + } else { // Desktop + profileRequires(loc, ~EEsProfile, 130, nullptr, feature); + } + } + } + break; + } + case EOpSparseTextureGather: case EOpSparseTextureGatherOffset: case EOpSparseTextureGatherOffsets: @@ -2283,12 +2347,36 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan if (callNode.getOp() == EOpTextureOffset) { TSampler s = arg0->getType().getSampler(); if (s.is2D() && s.isArrayed() && s.isShadow()) { - if (isEsProfile()) + if ( + ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && + ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && + (fnCandidate.getParamCount() == 4)) { + featureString = fnCandidate.getName() + " for sampler2DArrayShadow"; + feature = featureString.c_str(); + requireExtensions(loc, 1, &E_GL_EXT_texture_shadow_lod, feature); + profileRequires(loc, EEsProfile, 300, nullptr, feature); + profileRequires(loc, ~EEsProfile, 130, nullptr, feature); + } + else if (isEsProfile()) error(loc, "TextureOffset does not support sampler2DArrayShadow : ", "sampler", "ES Profile"); else if (version <= 420) error(loc, "TextureOffset does not support sampler2DArrayShadow : ", "sampler", "version <= 420"); } } + + if (callNode.getOp() == EOpTextureLodOffset) { + TSampler s = arg0->getType().getSampler(); + if (s.is2D() && s.isArrayed() && s.isShadow() && + ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && + ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && + (fnCandidate.getParamCount() == 4)) { + featureString = fnCandidate.getName() + " for sampler2DArrayShadow"; + feature = featureString.c_str(); + profileRequires(loc, EEsProfile, 300, nullptr, feature); + profileRequires(loc, ~EEsProfile, 130, nullptr, feature); + requireExtensions(loc, 1, &E_GL_EXT_texture_shadow_lod, feature); + } + } } break; @@ -2444,15 +2532,26 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan error(loc, "only supported on image with format r64i", fnCandidate.getName().c_str(), ""); else if (callNode.getType().getBasicType() == EbtUint64 && imageType.getQualifier().getFormat() != ElfR64ui) error(loc, "only supported on image with format r64ui", fnCandidate.getName().c_str(), ""); + } else if(callNode.getType().getBasicType() == EbtFloat16 && + ((callNode.getType().getVectorSize() == 2 && arg0->getType().getQualifier().getFormat() == ElfRg16f) || + (callNode.getType().getVectorSize() == 4 && arg0->getType().getQualifier().getFormat() == ElfRgba16f))) { + if (StartsWith(fnCandidate.getName(), "imageAtomicAdd") || + StartsWith(fnCandidate.getName(), "imageAtomicExchange") || + StartsWith(fnCandidate.getName(), "imageAtomicMin") || + StartsWith(fnCandidate.getName(), "imageAtomicMax")) { + requireExtensions(loc, 1, &E_GL_NV_shader_atomic_fp16_vector, fnCandidate.getName().c_str()); + } else { + error(loc, "f16vec2/4 operation not supported on: ", fnCandidate.getName().c_str(), ""); + } } else if (imageType.getSampler().type == EbtFloat) { - if (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") == 0) { + if (StartsWith(fnCandidate.getName(), "imageAtomicExchange")) { // imageAtomicExchange doesn't require an extension - } else if ((fnCandidate.getName().compare(0, 14, "imageAtomicAdd") == 0) || - (fnCandidate.getName().compare(0, 15, "imageAtomicLoad") == 0) || - (fnCandidate.getName().compare(0, 16, "imageAtomicStore") == 0)) { + } else if (StartsWith(fnCandidate.getName(), "imageAtomicAdd") || + StartsWith(fnCandidate.getName(), "imageAtomicLoad") || + StartsWith(fnCandidate.getName(), "imageAtomicStore")) { requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float, fnCandidate.getName().c_str()); - } else if ((fnCandidate.getName().compare(0, 14, "imageAtomicMin") == 0) || - (fnCandidate.getName().compare(0, 14, "imageAtomicMax") == 0)) { + } else if (StartsWith(fnCandidate.getName(), "imageAtomicMin") || + StartsWith(fnCandidate.getName(), "imageAtomicMax")) { requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float2, fnCandidate.getName().c_str()); } else { error(loc, "only supported on integer images", fnCandidate.getName().c_str(), ""); @@ -2502,6 +2601,11 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan const char* const extensions[2] = { E_GL_NV_shader_atomic_int64, E_GL_EXT_shader_atomic_int64 }; requireExtensions(loc, 2, extensions, fnCandidate.getName().c_str()); + } else if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange || + callNode.getOp() == EOpAtomicMin || callNode.getOp() == EOpAtomicMax) && + arg0->getType().getBasicType() == EbtFloat16 && + (arg0->getType().getVectorSize() == 2 || arg0->getType().getVectorSize() == 4 )) { + requireExtensions(loc, 1, &E_GL_NV_shader_atomic_fp16_vector, fnCandidate.getName().c_str()); } else if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange) && (arg0->getType().getBasicType() == EbtFloat || arg0->getType().getBasicType() == EbtDouble)) { @@ -2513,12 +2617,19 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float2, fnCandidate.getName().c_str()); } - const TIntermTyped* base = TIntermediate::findLValueBase(arg0, true , true); - const TType* refType = (base->getType().isReference()) ? base->getType().getReferentType() : nullptr; - const TQualifier& qualifier = (refType != nullptr) ? refType->getQualifier() : base->getType().getQualifier(); - if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer && qualifier.storage != EvqtaskPayloadSharedEXT) - error(loc,"Atomic memory function can only be used for shader storage block member or shared variable.", - fnCandidate.getName().c_str(), ""); + const TIntermTyped* base = TIntermediate::traverseLValueBase(arg0, true, true); + const char* errMsg = "Only l-values corresponding to shader block storage or shared variables can be used with " + "atomic memory functions."; + if (base) { + const TType* refType = (base->getType().isReference()) ? base->getType().getReferentType() : nullptr; + const TQualifier& qualifier = + (refType != nullptr) ? refType->getQualifier() : base->getType().getQualifier(); + if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer && + qualifier.storage != EvqtaskPayloadSharedEXT) + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } else { + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } break; } @@ -2526,20 +2637,57 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpInterpolateAtCentroid: case EOpInterpolateAtSample: case EOpInterpolateAtOffset: - case EOpInterpolateAtVertex: - // Make sure the first argument is an interpolant, or an array element of an interpolant + case EOpInterpolateAtVertex: { if (arg0->getType().getQualifier().storage != EvqVaryingIn) { - // It might still be an array element. + // Traverse down the left branch of arg0 to ensure this argument is a valid interpolant. + // + // For desktop GL >4.3 we effectively only need to ensure that arg0 represents an l-value from an + // input declaration. // - // We could check more, but the semantics of the first argument are already met; the - // only way to turn an array into a float/vec* is array dereference and swizzle. + // For desktop GL <= 4.3 and ES, we must also ensure that swizzling is not used // - // ES and desktop 4.3 and earlier: swizzles may not be used - // desktop 4.4 and later: swizzles may be used - bool swizzleOkay = (!isEsProfile()) && (version >= 440); - const TIntermTyped* base = TIntermediate::findLValueBase(arg0, swizzleOkay); - if (base == nullptr || base->getType().getQualifier().storage != EvqVaryingIn) - error(loc, "first argument must be an interpolant, or interpolant-array element", fnCandidate.getName().c_str(), ""); + // For ES, we must also ensure that a field selection operator (i.e., '.') is not used on a named + // struct. + + const bool esProfile = isEsProfile(); + const bool swizzleOkay = !esProfile && (version >= 440); + + std::string interpolantErrorMsg = "first argument must be an interpolant, or interpolant-array element"; + bool isValid = true; // Assume that the interpolant is valid until we find a condition making it invalid + bool isIn = false; // Checks whether or not the interpolant is a shader input + bool structAccessOp = false; // Whether or not the previous node in the chain is a struct accessor + TIntermediate::traverseLValueBase( + arg0, swizzleOkay, false, + [&isValid, &isIn, &interpolantErrorMsg, esProfile, &structAccessOp](const TIntermNode& n) -> bool { + auto* type = n.getAsTyped(); + if (type) { + if (type->getType().getQualifier().storage == EvqVaryingIn) { + isIn = true; + } + // If a field accessor was used, it can only be used to access a field with an input block, not a struct. + if (structAccessOp && (type->getType().getBasicType() != EbtBlock)) { + interpolantErrorMsg += + ". Using the field of a named struct as an interpolant argument is not " + "allowed (ES-only)."; + isValid = false; + } + } + + // ES has different requirements for interpolants than GL + if (esProfile) { + // Swizzling will be taken care of by the 'swizzleOkay' argument passsed to traverseLValueBase, + // so we only ned to check whether or not a field accessor has been used with a named struct. + auto* binary = n.getAsBinaryNode(); + if (binary && (binary->getOp() == EOpIndexDirectStruct)) { + structAccessOp = true; + } + } + // Don't continue traversing if we know we have an invalid interpolant at this point. + return isValid; + }); + if (!isIn || !isValid) { + error(loc, interpolantErrorMsg.c_str(), fnCandidate.getName().c_str(), ""); + } } if (callNode.getOp() == EOpInterpolateAtVertex) { @@ -2555,12 +2703,12 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } } } - break; + } break; case EOpEmitStreamVertex: case EOpEndStreamPrimitive: if (version == 150) - requireExtensions(loc, 1, &E_GL_ARB_gpu_shader5, "if the verison is 150 , the EmitStreamVertex and EndStreamPrimitive only support at extension GL_ARB_gpu_shader5"); + requireExtensions(loc, 1, &E_GL_ARB_gpu_shader5, "if the version is 150 , the EmitStreamVertex and EndStreamPrimitive only support at extension GL_ARB_gpu_shader5"); intermediate.setMultiStream(); break; @@ -3469,6 +3617,19 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T makeSpecConst = ! intArgument && !type.isArray(); break; + case EOpConstructCooperativeMatrixNV: + case EOpConstructCooperativeMatrixKHR: + case EOpConstructStruct: + { + const char *specConstantCompositeExt[] = { E_GL_EXT_spec_constant_composites }; + if (checkExtensionsRequested(loc, 1, specConstantCompositeExt, "spec constant aggregate constructor")) { + makeSpecConst = true; + } else { + makeSpecConst = false; + } + } + break; + default: // anything else wasn't white-listed in the spec as a conversion makeSpecConst = false; @@ -3774,6 +3935,18 @@ void TParseContext::accStructCheck(const TSourceLoc& loc, const TType& type, con } +void TParseContext::hitObjectNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier) +{ + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtHitObjectNV)) { + error(loc, "struct is not allowed to contain hitObjectNV:", type.getTypeName().c_str(), identifier.c_str()); + } else if (type.getBasicType() == EbtHitObjectNV) { + TStorageQualifier qualifier = type.getQualifier().storage; + if (qualifier != EvqGlobal && qualifier != EvqTemporary) { + error(loc, "hitObjectNV can only be declared in global or function scope with no storage qualifier:", "hitObjectNV", identifier.c_str()); + } + } +} + void TParseContext::transparentOpaqueCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) { if (parsingBuiltins) @@ -3866,6 +4039,18 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q // Storage qualifier isn't ready for memberQualifierCheck, we should skip invariantCheck for it. if (!isMemberCheck || structNestingLevel > 0) invariantCheck(loc, qualifier); + + if (qualifier.isFullQuads()) { + if (qualifier.storage != EvqVaryingIn) + error(loc, "can only apply to input layout", "full_quads ", ""); + intermediate.setReqFullQuadsMode(); + } + + if (qualifier.isQuadDeriv()) { + if (qualifier.storage != EvqVaryingIn) + error(loc, "can only apply to input layout", "quad_derivatives", ""); + intermediate.setQuadDerivMode(); + } } // @@ -4126,8 +4311,8 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons dst.spirvStorageClass = src.spirvStorageClass; // SPIR-V decorate qualifiers (GL_EXT_spirv_intrinsics) - if (src.hasSprivDecorate()) { - if (dst.hasSprivDecorate()) { + if (src.hasSpirvDecorate()) { + if (dst.hasSpirvDecorate()) { const TSpirvDecorate& srcSpirvDecorate = src.getSpirvDecorate(); TSpirvDecorate& dstSpirvDecorate = dst.getSpirvDecorate(); for (auto& decorate : srcSpirvDecorate.decorates) { @@ -5739,6 +5924,15 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.shaderQualifiers.layoutOverrideCoverage = true; return; } + if (id == "full_quads") + { + const char* feature = "full_quads qualifier"; + requireProfile(loc, ECompatibilityProfile | ECoreProfile | EEsProfile, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 140, E_GL_EXT_shader_quad_control, feature); + profileRequires(loc, EEsProfile, 310, E_GL_EXT_shader_quad_control, feature); + publicType.qualifier.layoutFullQuads = true; + return; + } } if (language == EShLangVertex || language == EShLangTessControl || @@ -5788,6 +5982,16 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi return; } + if (id == "quad_derivatives") + { + const char* feature = "quad_derivatives qualifier"; + requireProfile(loc, ECompatibilityProfile | ECoreProfile | EEsProfile, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 140, E_GL_EXT_shader_quad_control, feature); + profileRequires(loc, EEsProfile, 310, E_GL_EXT_shader_quad_control, feature); + publicType.qualifier.layoutQuadDeriv = true; + return; + } + error(loc, "unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4)", id.c_str(), ""); } @@ -6089,7 +6293,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi error(loc, "needs a literal integer", "max_primitives", ""); return; } - // Fall through + [[fallthrough]]; case EShLangTask: // Fall through @@ -6216,6 +6420,10 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie dst.layoutSecondaryViewportRelativeOffset = src.layoutSecondaryViewportRelativeOffset; if (src.layoutShaderRecord) dst.layoutShaderRecord = true; + if (src.layoutFullQuads) + dst.layoutFullQuads = true; + if (src.layoutQuadDeriv) + dst.layoutQuadDeriv = true; if (src.layoutBindlessSampler) dst.layoutBindlessSampler = true; if (src.layoutBindlessImage) @@ -6261,8 +6469,7 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb switch (qualifier.storage) { case EvqVaryingIn: case EvqVaryingOut: - if (!type.getQualifier().isTaskMemory() && - !type.getQualifier().hasSprivDecorate() && + if (!type.getQualifier().isTaskMemory() && !type.getQualifier().hasSpirvDecorate() && (type.getBasicType() != EbtBlock || (!(*type.getStruct())[0].type->getQualifier().hasLocation() && (*type.getStruct())[0].type->getQualifier().builtIn == EbvNone))) @@ -6390,10 +6597,10 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) int repeated = intermediate.addUsedLocation(qualifier, type, typeCollision); if (repeated >= 0 && ! typeCollision) error(loc, "overlapping use of location", "location", "%d", repeated); - // "fragment-shader outputs/tileImageEXT ... if two variables are placed within the same - // location, they must have the same underlying type (floating-point or integer)" - if (typeCollision && language == EShLangFragment && (qualifier.isPipeOutput() || qualifier.storage == EvqTileImageEXT)) - error(loc, "fragment outputs or tileImageEXTs sharing the same location", "location", "%d must be the same basic type", repeated); + // When location aliasing, the aliases sharing the location must have the same underlying numerical type and bit width( + // floating - point or integer, 32 - bit versus 64 - bit,etc.) + if (typeCollision && (qualifier.isPipeInput() || qualifier.isPipeOutput() || qualifier.storage == EvqTileImageEXT)) + error(loc, "the aliases sharing the location", "location", "%d must be the same basic type and interpolation qualification", repeated); } if (qualifier.hasXfbOffset() && qualifier.hasXfbBuffer()) { @@ -7162,7 +7369,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T realFunc.addParameter(TParameter().copyParam((*function)[i])); } - TParameter tmpP = { nullptr, &uintType }; + TParameter tmpP = { nullptr, &uintType, {} }; realFunc.addParameter(TParameter().copyParam(tmpP)); arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true)); @@ -7179,7 +7386,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T realFunc.addParameter(TParameter().copyParam((*function)[i])); } - TParameter tmpP = { nullptr, &uintType }; + TParameter tmpP = { nullptr, &uintType, {} }; realFunc.addParameter(TParameter().copyParam(tmpP)); arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true)); @@ -7191,7 +7398,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T } } else if (function->getName() == "atomicCounter") { // change atomicCounter into a direct read of the variable - if (arguments->getAsTyped()) { + if (arguments && arguments->getAsTyped()) { result = arguments->getAsTyped(); } } @@ -7239,6 +7446,7 @@ void TParseContext::coopMatTypeParametersCheck(const TSourceLoc& loc, const TPub case EbtUint: case EbtUint8: case EbtUint16: + case EbtSpirvType: break; default: error(loc, "coopmat invalid basic type", TType::getBasicString(publicType.typeParameters->basicType), ""); @@ -7256,12 +7464,14 @@ void TParseContext::coopMatTypeParametersCheck(const TSourceLoc& loc, const TPub } } -bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString& identifier, const TPublicType&, +bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType, TArraySizes*, TIntermTyped* initializer, TType& type) { + vkRelaxedRemapUniformMembers(loc, publicType, type, identifier); + if (parsingBuiltins || symbolTable.atBuiltInLevel() || !symbolTable.atGlobalLevel() || type.getQualifier().storage != EvqUniform || - !(type.containsNonOpaque()|| type.getBasicType() == EbtAtomicUint)) { + !(type.containsNonOpaque() || type.getBasicType() == EbtAtomicUint || (type.containsSampler() && type.isStruct()))) { return false; } @@ -7335,6 +7545,263 @@ bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString return true; } +template +static void ForEachOpaque(const TType& type, const TString& path, Function callback) +{ + auto recursion = [&callback](const TType& type, const TString& path, bool skipArray, auto& recursion) -> void { + if (!skipArray && type.isArray()) + { + std::vector indices(type.getArraySizes()->getNumDims()); + for (int flatIndex = 0; + flatIndex < type.getArraySizes()->getCumulativeSize(); + ++flatIndex) + { + TString subscriptPath = path; + for (size_t dimIndex = 0; dimIndex < indices.size(); ++dimIndex) + { + int index = indices[dimIndex]; + subscriptPath.append("["); + subscriptPath.append(String(index)); + subscriptPath.append("]"); + } + + recursion(type, subscriptPath, true, recursion); + + for (size_t dimIndex = 0; dimIndex < indices.size(); ++dimIndex) + { + ++indices[dimIndex]; + if (indices[dimIndex] < type.getArraySizes()->getDimSize(dimIndex)) + break; + else + indices[dimIndex] = 0; + } + } + } + + else if (type.isStruct() && type.containsOpaque()) + { + const TTypeList& types = *type.getStruct(); + for (const TTypeLoc& typeLoc : types) + { + TString nextPath = path; + nextPath.append("."); + nextPath.append(typeLoc.type->getFieldName()); + + recursion(*(typeLoc.type), nextPath, false, recursion); + } + } + + else if (type.isOpaque()) + { + callback(type, path); + } + }; + + recursion(type, path, false, recursion); +} + +void TParseContext::vkRelaxedRemapUniformMembers(const TSourceLoc& loc, const TPublicType& publicType, const TType& type, + const TString& identifier) +{ + if (!type.isStruct() || !type.containsOpaque()) + return; + + ForEachOpaque(type, identifier, + [&publicType, &loc, this](const TType& type, const TString& path) { + TArraySizes arraySizes = {}; + if (type.getArraySizes()) arraySizes = *type.getArraySizes(); + TTypeParameters typeParameters = {}; + if (type.getTypeParameters()) typeParameters = *type.getTypeParameters(); + + TPublicType memberType{}; + memberType.basicType = type.getBasicType(); + memberType.sampler = type.getSampler(); + memberType.qualifier = type.getQualifier(); + memberType.vectorSize = type.getVectorSize(); + memberType.matrixCols = type.getMatrixCols(); + memberType.matrixRows = type.getMatrixRows(); + memberType.coopmatNV = type.isCoopMatNV(); + memberType.coopmatKHR = type.isCoopMatKHR(); + memberType.arraySizes = nullptr; + memberType.userDef = nullptr; + memberType.loc = loc; + memberType.typeParameters = (type.getTypeParameters() ? &typeParameters : nullptr); + memberType.spirvType = nullptr; + + memberType.qualifier.storage = publicType.qualifier.storage; + memberType.shaderQualifiers = publicType.shaderQualifiers; + + TString& structMemberName = *NewPoolTString(path.c_str()); // A copy is required due to declareVariable() signature. + declareVariable(loc, structMemberName, memberType, nullptr, nullptr); + }); +} + +void TParseContext::vkRelaxedRemapFunctionParameter(TFunction* function, TParameter& param, std::vector* newParams) +{ + function->addParameter(param); + + if (!param.type->isStruct() || !param.type->containsOpaque()) + return; + + ForEachOpaque(*param.type, (param.name ? *param.name : param.type->getFieldName()), + [function, param, newParams](const TType& type, const TString& path) { + TString* memberName = NewPoolTString(path.c_str()); + + TType* memberType = new TType(); + memberType->shallowCopy(type); + memberType->getQualifier().storage = param.type->getQualifier().storage; + memberType->clearArraySizes(); + + TParameter memberParam = {}; + memberParam.name = memberName; + memberParam.type = memberType; + memberParam.defaultValue = nullptr; + function->addParameter(memberParam); + if (newParams) + newParams->push_back(function->getParamCount()-1); + }); +} + +// +// Generates a valid GLSL dereferencing string for the input TIntermNode +// +struct AccessChainTraverser : public TIntermTraverser { + AccessChainTraverser() : TIntermTraverser(false, false, true) + {} + + TString path = ""; + TStorageQualifier topLevelStorageQualifier = TStorageQualifier::EvqLast; + + bool visitBinary(TVisit, TIntermBinary* binary) override { + if (binary->getOp() == EOpIndexDirectStruct) + { + const TTypeList& members = *binary->getLeft()->getType().getStruct(); + const TTypeLoc& member = + members[binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst()]; + TString memberName = member.type->getFieldName(); + + if (path != "") + path.append("."); + + path.append(memberName); + } + + if (binary->getOp() == EOpIndexDirect) + { + const TConstUnionArray& indices = binary->getRight()->getAsConstantUnion()->getConstArray(); + for (int index = 0; index < indices.size(); ++index) + { + path.append("["); + path.append(String(indices[index].getIConst())); + path.append("]"); + } + } + + return true; + } + + void visitSymbol(TIntermSymbol* symbol) override { + if (symbol->getType().isOpaque()) + topLevelStorageQualifier = symbol->getQualifier().storage; + if (!IsAnonymous(symbol->getName())) + path.append(symbol->getName()); + } +}; + +TIntermNode* TParseContext::vkRelaxedRemapFunctionArgument(const TSourceLoc& loc, TFunction* function, TIntermTyped* intermTyped) +{ + AccessChainTraverser accessChainTraverser{}; + intermTyped->traverse(&accessChainTraverser); + + if (accessChainTraverser.topLevelStorageQualifier == TStorageQualifier::EvqUniform) + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy(intermTyped->getType()); + + function->addParameter(param); + return intermTyped; + } + + TParameter param = { NewPoolTString(accessChainTraverser.path.c_str()), new TType, {} }; + param.type->shallowCopy(intermTyped->getType()); + + std::vector newParams = {}; + vkRelaxedRemapFunctionParameter(function, param, &newParams); + + if (intermTyped->getType().isOpaque()) + { + TIntermNode* remappedArgument = intermTyped; + { + TIntermSymbol* intermSymbol = nullptr; + TSymbol* symbol = symbolTable.find(*param.name); + if (symbol && symbol->getAsVariable()) + intermSymbol = intermediate.addSymbol(*symbol->getAsVariable(), loc); + else + { + TVariable* variable = new TVariable(param.name, *param.type); + intermSymbol = intermediate.addSymbol(*variable, loc); + } + + remappedArgument = intermSymbol; + } + + return remappedArgument; + } + else if (!(intermTyped->isStruct() && intermTyped->getType().containsOpaque())) + return intermTyped; + else + { + TIntermNode* remappedArgument = intermTyped; + { + TSymbol* symbol = symbolTable.find(*param.name); + if (symbol && symbol->getAsVariable()) + remappedArgument = intermediate.addSymbol(*symbol->getAsVariable(), loc); + } + + if (!newParams.empty()) + remappedArgument = intermediate.makeAggregate(remappedArgument, loc); + + for (int paramIndex : newParams) + { + TParameter& newParam = function->operator[](paramIndex); + TIntermSymbol* intermSymbol = nullptr; + TSymbol* symbol = symbolTable.find(*newParam.name); + if (symbol && symbol->getAsVariable()) + intermSymbol = intermediate.addSymbol(*symbol->getAsVariable(), loc); + else + { + TVariable* variable = new TVariable(newParam.name, *newParam.type); + intermSymbol = intermediate.addSymbol(*variable, loc); + } + + remappedArgument = intermediate.growAggregate(remappedArgument, intermSymbol); + } + + return remappedArgument; + } +} + +TIntermTyped* TParseContext::vkRelaxedRemapDotDereference(const TSourceLoc&, TIntermTyped& base, const TType& member, + const TString& identifier) +{ + if (!member.isOpaque()) + return &base; + + AccessChainTraverser traverser{}; + base.traverse(&traverser); + if (!traverser.path.empty()) + traverser.path.append("."); + traverser.path.append(identifier); + + const TSymbol* symbol = symbolTable.find(traverser.path); + if (!symbol) + return &base; + + TIntermTyped* result = intermediate.addSymbol(*symbol->getAsVariable()); + result->setType(symbol->getType()); + return result; +} + // // Do everything necessary to handle a variable (non-block) declaration. // Either redeclaring a variable, or making a new one, updating the symbol @@ -7374,7 +7841,8 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden error(loc, "unexpected number type parameters", identifier.c_str(), ""); } if (publicType.typeParameters) { - if (!isTypeFloat(publicType.typeParameters->basicType) && !isTypeInt(publicType.typeParameters->basicType)) { + if (!isTypeFloat(publicType.typeParameters->basicType) && + !isTypeInt(publicType.typeParameters->basicType) && publicType.typeParameters->basicType != EbtSpirvType) { error(loc, "expected 8, 16, 32, or 64 bit signed or unsigned integer or 16, 32, or 64 bit float type", identifier.c_str(), ""); } } @@ -7418,6 +7886,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden transparentOpaqueCheck(loc, type, identifier); atomicUintCheck(loc, type, identifier); accStructCheck(loc, type, identifier); + hitObjectNVCheck(loc, type, identifier); checkAndResizeMeshViewDim(loc, type, /*isBlockMember*/ false); if (type.getQualifier().storage == EvqConst && type.containsReference()) { error(loc, "variables with reference type can't have qualifier 'const'", "qualifier", ""); @@ -7916,6 +8385,11 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* int paramCount = 0; // keeps track of the constructor parameter number being checked + // We don't know "top down" whether type is a specialization constant, + // but a const becomes a specialization constant if any of its children are. + bool hasSpecConst = false; + bool isConstConstructor = true; + // for each parameter to the constructor call, check to see if the right type is passed or convert them // to the right type if possible (and allowed). // for structure constructors, just check if the right type is passed, no conversion is allowed. @@ -7928,13 +8402,24 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* else newNode = constructBuiltIn(type, op, (*p)->getAsTyped(), node->getLoc(), true); - if (newNode) + if (newNode) { *p = newNode; - else + if (!newNode->getType().getQualifier().isConstant()) + isConstConstructor = false; + if (newNode->getType().getQualifier().isSpecConstant()) + hasSpecConst = true; + } else return nullptr; } - TIntermTyped *ret_node = intermediate.setAggregateOperator(aggrNode, op, type, loc); + TIntermTyped* ret_node = intermediate.setAggregateOperator(aggrNode, op, type, loc); + + const char *specConstantCompositeExt[] = { E_GL_EXT_spec_constant_composites }; + if (checkExtensionsRequested(loc, 1, specConstantCompositeExt, "spec constant aggregate constructor")) { + if (isConstConstructor && hasSpecConst) { + ret_node->getWritableType().getQualifier().makeSpecConstant(); + } + } TIntermAggregate *agg_node = ret_node->getAsAggregate(); if (agg_node && (agg_node->isVector() || agg_node->isArray() || agg_node->isMatrix())) @@ -8013,6 +8498,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructUVec2, false, newSrcNode, type); return newNode; } + [[fallthrough]]; case EOpConstructUVec3: case EOpConstructUVec4: case EOpConstructUint: @@ -8034,6 +8520,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T intermediate.addBuiltInFunctionCall(node->getLoc(), EOpPackUint2x32, true, node, type); return newNode; } + [[fallthrough]]; case EOpConstructDVec2: case EOpConstructDVec3: case EOpConstructDVec4: @@ -8064,9 +8551,10 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T case EOpConstructF16Mat4x4: case EOpConstructFloat16: basicOp = EOpConstructFloat16; - // 8/16-bit storage extensions don't support constructing composites of 8/16-bit types, + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, // so construct a 32-bit type and convert - if (!intermediate.getArithemeticFloat16Enabled()) { + // and do not generate any conversion if it is an identity conversion, i.e. float16_t( var) + if (!intermediate.getArithemeticFloat16Enabled() && (node->getBasicType() != EbtFloat16)) { TType tempType(EbtFloat, EvqTemporary, type.getVectorSize()); newNode = node; if (tempType != newNode->getType()) { @@ -8087,9 +8575,10 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T case EOpConstructI8Vec4: case EOpConstructInt8: basicOp = EOpConstructInt8; - // 8/16-bit storage extensions don't support constructing composites of 8/16-bit types, + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, // so construct a 32-bit type and convert - if (!intermediate.getArithemeticInt8Enabled()) { + // and do not generate any conversion if it is an identity conversion, i.e. int8_t( var) + if (!intermediate.getArithemeticInt8Enabled() && (node->getBasicType() != EbtInt8)) { TType tempType(EbtInt, EvqTemporary, type.getVectorSize()); newNode = node; if (tempType != newNode->getType()) { @@ -8110,9 +8599,10 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T case EOpConstructU8Vec4: case EOpConstructUint8: basicOp = EOpConstructUint8; - // 8/16-bit storage extensions don't support constructing composites of 8/16-bit types, + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, // so construct a 32-bit type and convert - if (!intermediate.getArithemeticInt8Enabled()) { + // and do not generate any conversion if it is an identity conversion, i.e. uint8_t( var) + if (!intermediate.getArithemeticInt8Enabled() && (node->getBasicType() != EbtUint8)) { TType tempType(EbtUint, EvqTemporary, type.getVectorSize()); newNode = node; if (tempType != newNode->getType()) { @@ -8133,9 +8623,10 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T case EOpConstructI16Vec4: case EOpConstructInt16: basicOp = EOpConstructInt16; - // 8/16-bit storage extensions don't support constructing composites of 8/16-bit types, + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, // so construct a 32-bit type and convert - if (!intermediate.getArithemeticInt16Enabled()) { + // and do not generate any conversion if it is an identity conversion, i.e. int16_t( var) + if (!intermediate.getArithemeticInt16Enabled() && (node->getBasicType() != EbtInt16)) { TType tempType(EbtInt, EvqTemporary, type.getVectorSize()); newNode = node; if (tempType != newNode->getType()) { @@ -8156,9 +8647,10 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T case EOpConstructU16Vec4: case EOpConstructUint16: basicOp = EOpConstructUint16; - // 8/16-bit storage extensions don't support constructing composites of 8/16-bit types, + // 8/16-bit storage extensions don't support direct constructing composites of 8/16-bit types, // so construct a 32-bit type and convert - if (!intermediate.getArithemeticInt16Enabled()) { + // and do not generate any conversion if it is an identity conversion, i.e. uint16_t( var) + if (!intermediate.getArithemeticInt16Enabled() && (node->getBasicType() != EbtUint16)) { TType tempType(EbtUint, EvqTemporary, type.getVectorSize()); newNode = node; if (tempType != newNode->getType()) { @@ -8186,7 +8678,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T TIntermTyped* newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvPtrToUint64, true, node, type); return newNode; } - // fall through + [[fallthrough]]; case EOpConstructU64Vec2: case EOpConstructU64Vec3: case EOpConstructU64Vec4: @@ -8475,7 +8967,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con memberQualifier.storage = EvqtaskPayloadSharedEXT; if (memberQualifier.storage == EvqSpirvStorageClass) error(memberLoc, "member cannot have a spirv_storage_class qualifier", memberType.getFieldName().c_str(), ""); - if (memberQualifier.hasSprivDecorate() && !memberQualifier.getSpirvDecorate().decorateIds.empty()) + if (memberQualifier.hasSpirvDecorate() && !memberQualifier.getSpirvDecorate().decorateIds.empty()) error(memberLoc, "member cannot have a spirv_decorate_id qualifier", memberType.getFieldName().c_str(), ""); if ((currentBlockQualifier.storage == EvqUniform || currentBlockQualifier.storage == EvqBuffer) && (memberQualifier.isInterpolation() || memberQualifier.isAuxiliary())) error(memberLoc, "member of uniform or buffer block cannot have an auxiliary or interpolation qualifier", memberType.getFieldName().c_str(), ""); @@ -9251,7 +9743,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "cannot apply to 'out'", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); break; } - // Fall through + [[fallthrough]]; case ElgPoints: case ElgLineStrip: case ElgTriangleStrip: @@ -9432,8 +9924,8 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con if (publicType.shaderQualifiers.layoutDerivativeGroupQuads) { if (publicType.qualifier.storage == EvqVaryingIn) { - if ((intermediate.getLocalSize(0) & 1) || - (intermediate.getLocalSize(1) & 1)) + if ((intermediate.getLocalSizeSpecId(0) == TQualifier::layoutNotSet && (intermediate.getLocalSize(0) & 1)) || + (intermediate.getLocalSizeSpecId(1) == TQualifier::layoutNotSet && (intermediate.getLocalSize(1) & 1))) error(loc, "requires local_size_x and local_size_y to be multiple of two", "derivative_group_quadsNV", ""); else intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupQuads); @@ -9443,7 +9935,10 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con } if (publicType.shaderQualifiers.layoutDerivativeGroupLinear) { if (publicType.qualifier.storage == EvqVaryingIn) { - if((intermediate.getLocalSize(0) * + if (intermediate.getLocalSizeSpecId(0) == TQualifier::layoutNotSet && + intermediate.getLocalSizeSpecId(1) == TQualifier::layoutNotSet && + intermediate.getLocalSizeSpecId(2) == TQualifier::layoutNotSet && + (intermediate.getLocalSize(0) * intermediate.getLocalSize(1) * intermediate.getLocalSize(2)) % 4 != 0) error(loc, "requires total group size to be multiple of four", "derivative_group_linearNV", ""); diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h index d7466293..67ba7dbd 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h @@ -180,6 +180,7 @@ class TParseContextBase : public TParseVersions { // Basic parsing state, easily accessible to the grammar TSymbolTable& symbolTable; // symbol table that goes with the current language, version, and profile + TVector relaxedSymbols; int statementNestingLevel; // 0 if outside all flow control or compound statements int loopNestingLevel; // 0 if outside all loops int structNestingLevel; // 0 if outside structures @@ -196,6 +197,7 @@ class TParseContextBase : public TParseVersions { struct TPragma contextPragma; int beginInvocationInterlockCount; int endInvocationInterlockCount; + bool compileOnly = false; protected: TParseContextBase(TParseContextBase&); @@ -366,6 +368,10 @@ class TParseContext : public TParseContextBase { TIntermTyped* vkRelaxedRemapFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*); // returns true if the variable was remapped to something else bool vkRelaxedRemapUniformVariable(const TSourceLoc&, TString&, const TPublicType&, TArraySizes*, TIntermTyped*, TType&); + void vkRelaxedRemapUniformMembers(const TSourceLoc&, const TPublicType&, const TType&, const TString&); + void vkRelaxedRemapFunctionParameter(TFunction*, TParameter&, std::vector* newParams = nullptr); + TIntermNode* vkRelaxedRemapFunctionArgument(const TSourceLoc&, TFunction*, TIntermTyped*); + TIntermTyped* vkRelaxedRemapDotDereference(const TSourceLoc&, TIntermTyped&, const TType&, const TString&); void assignError(const TSourceLoc&, const char* op, TString left, TString right); void unaryOpError(const TSourceLoc&, const char* op, TString operand); @@ -391,6 +397,7 @@ class TParseContext : public TParseContextBase { void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer); void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier); void accStructCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); + void hitObjectNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier); void memberQualifierCheck(glslang::TPublicType&); void globalQualifierFixCheck(const TSourceLoc&, TQualifier&, bool isMemberCheck = false, const TPublicType* publicType = nullptr); diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp index 5d7173c9..93a3b0d1 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp @@ -35,14 +35,21 @@ #include "../Include/Common.h" #include "../Include/PoolAlloc.h" +// Mostly here for target that do not support threads such as WASI. +#ifdef DISABLE_THREAD_SUPPORT +#define THREAD_LOCAL +#else +#define THREAD_LOCAL thread_local +#endif + namespace glslang { namespace { -thread_local TPoolAllocator* threadPoolAllocator = nullptr; +THREAD_LOCAL TPoolAllocator* threadPoolAllocator = nullptr; TPoolAllocator* GetDefaultThreadPoolAllocator() { - thread_local TPoolAllocator defaultAllocator; + THREAD_LOCAL TPoolAllocator defaultAllocator; return &defaultAllocator; } } // anonymous namespace diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp index 99c9ecbb..a90edb32 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp @@ -322,503 +322,481 @@ struct str_hash }; // A single global usable by all threads, by all versions, by all languages. -// After a single process-level initialization, this is read only and thread safe -std::unordered_map* KeywordMap = nullptr; -std::unordered_set* ReservedSet = nullptr; - -} - -namespace glslang { - -void TScanContext::fillInKeywordMap() -{ - if (KeywordMap != nullptr) { - // this is really an error, as this should called only once per process - // but, the only risk is if two threads called simultaneously - return; - } - KeywordMap = new std::unordered_map; - - (*KeywordMap)["const"] = CONST; - (*KeywordMap)["uniform"] = UNIFORM; - (*KeywordMap)["tileImageEXT"] = TILEIMAGEEXT; - (*KeywordMap)["buffer"] = BUFFER; - (*KeywordMap)["in"] = IN; - (*KeywordMap)["out"] = OUT; - (*KeywordMap)["smooth"] = SMOOTH; - (*KeywordMap)["flat"] = FLAT; - (*KeywordMap)["centroid"] = CENTROID; - (*KeywordMap)["invariant"] = INVARIANT; - (*KeywordMap)["packed"] = PACKED; - (*KeywordMap)["resource"] = RESOURCE; - (*KeywordMap)["inout"] = INOUT; - (*KeywordMap)["struct"] = STRUCT; - (*KeywordMap)["break"] = BREAK; - (*KeywordMap)["continue"] = CONTINUE; - (*KeywordMap)["do"] = DO; - (*KeywordMap)["for"] = FOR; - (*KeywordMap)["while"] = WHILE; - (*KeywordMap)["switch"] = SWITCH; - (*KeywordMap)["case"] = CASE; - (*KeywordMap)["default"] = DEFAULT; - (*KeywordMap)["if"] = IF; - (*KeywordMap)["else"] = ELSE; - (*KeywordMap)["discard"] = DISCARD; - (*KeywordMap)["terminateInvocation"] = TERMINATE_INVOCATION; - (*KeywordMap)["terminateRayEXT"] = TERMINATE_RAY; - (*KeywordMap)["ignoreIntersectionEXT"] = IGNORE_INTERSECTION; - (*KeywordMap)["return"] = RETURN; - (*KeywordMap)["void"] = VOID; - (*KeywordMap)["bool"] = BOOL; - (*KeywordMap)["float"] = FLOAT; - (*KeywordMap)["int"] = INT; - (*KeywordMap)["bvec2"] = BVEC2; - (*KeywordMap)["bvec3"] = BVEC3; - (*KeywordMap)["bvec4"] = BVEC4; - (*KeywordMap)["vec2"] = VEC2; - (*KeywordMap)["vec3"] = VEC3; - (*KeywordMap)["vec4"] = VEC4; - (*KeywordMap)["ivec2"] = IVEC2; - (*KeywordMap)["ivec3"] = IVEC3; - (*KeywordMap)["ivec4"] = IVEC4; - (*KeywordMap)["mat2"] = MAT2; - (*KeywordMap)["mat3"] = MAT3; - (*KeywordMap)["mat4"] = MAT4; - (*KeywordMap)["true"] = BOOLCONSTANT; - (*KeywordMap)["false"] = BOOLCONSTANT; - (*KeywordMap)["layout"] = LAYOUT; - (*KeywordMap)["shared"] = SHARED; - (*KeywordMap)["highp"] = HIGH_PRECISION; - (*KeywordMap)["mediump"] = MEDIUM_PRECISION; - (*KeywordMap)["lowp"] = LOW_PRECISION; - (*KeywordMap)["superp"] = SUPERP; - (*KeywordMap)["precision"] = PRECISION; - (*KeywordMap)["mat2x2"] = MAT2X2; - (*KeywordMap)["mat2x3"] = MAT2X3; - (*KeywordMap)["mat2x4"] = MAT2X4; - (*KeywordMap)["mat3x2"] = MAT3X2; - (*KeywordMap)["mat3x3"] = MAT3X3; - (*KeywordMap)["mat3x4"] = MAT3X4; - (*KeywordMap)["mat4x2"] = MAT4X2; - (*KeywordMap)["mat4x3"] = MAT4X3; - (*KeywordMap)["mat4x4"] = MAT4X4; - (*KeywordMap)["uint"] = UINT; - (*KeywordMap)["uvec2"] = UVEC2; - (*KeywordMap)["uvec3"] = UVEC3; - (*KeywordMap)["uvec4"] = UVEC4; - - (*KeywordMap)["nonuniformEXT"] = NONUNIFORM; - (*KeywordMap)["demote"] = DEMOTE; - (*KeywordMap)["attribute"] = ATTRIBUTE; - (*KeywordMap)["varying"] = VARYING; - (*KeywordMap)["noperspective"] = NOPERSPECTIVE; - (*KeywordMap)["coherent"] = COHERENT; - (*KeywordMap)["devicecoherent"] = DEVICECOHERENT; - (*KeywordMap)["queuefamilycoherent"] = QUEUEFAMILYCOHERENT; - (*KeywordMap)["workgroupcoherent"] = WORKGROUPCOHERENT; - (*KeywordMap)["subgroupcoherent"] = SUBGROUPCOHERENT; - (*KeywordMap)["shadercallcoherent"] = SHADERCALLCOHERENT; - (*KeywordMap)["nonprivate"] = NONPRIVATE; - (*KeywordMap)["restrict"] = RESTRICT; - (*KeywordMap)["readonly"] = READONLY; - (*KeywordMap)["writeonly"] = WRITEONLY; - (*KeywordMap)["atomic_uint"] = ATOMIC_UINT; - (*KeywordMap)["volatile"] = VOLATILE; - (*KeywordMap)["patch"] = PATCH; - (*KeywordMap)["sample"] = SAMPLE; - (*KeywordMap)["subroutine"] = SUBROUTINE; - (*KeywordMap)["dmat2"] = DMAT2; - (*KeywordMap)["dmat3"] = DMAT3; - (*KeywordMap)["dmat4"] = DMAT4; - (*KeywordMap)["dmat2x2"] = DMAT2X2; - (*KeywordMap)["dmat2x3"] = DMAT2X3; - (*KeywordMap)["dmat2x4"] = DMAT2X4; - (*KeywordMap)["dmat3x2"] = DMAT3X2; - (*KeywordMap)["dmat3x3"] = DMAT3X3; - (*KeywordMap)["dmat3x4"] = DMAT3X4; - (*KeywordMap)["dmat4x2"] = DMAT4X2; - (*KeywordMap)["dmat4x3"] = DMAT4X3; - (*KeywordMap)["dmat4x4"] = DMAT4X4; - (*KeywordMap)["image1D"] = IMAGE1D; - (*KeywordMap)["iimage1D"] = IIMAGE1D; - (*KeywordMap)["uimage1D"] = UIMAGE1D; - (*KeywordMap)["image2D"] = IMAGE2D; - (*KeywordMap)["iimage2D"] = IIMAGE2D; - (*KeywordMap)["uimage2D"] = UIMAGE2D; - (*KeywordMap)["image3D"] = IMAGE3D; - (*KeywordMap)["iimage3D"] = IIMAGE3D; - (*KeywordMap)["uimage3D"] = UIMAGE3D; - (*KeywordMap)["image2DRect"] = IMAGE2DRECT; - (*KeywordMap)["iimage2DRect"] = IIMAGE2DRECT; - (*KeywordMap)["uimage2DRect"] = UIMAGE2DRECT; - (*KeywordMap)["imageCube"] = IMAGECUBE; - (*KeywordMap)["iimageCube"] = IIMAGECUBE; - (*KeywordMap)["uimageCube"] = UIMAGECUBE; - (*KeywordMap)["imageBuffer"] = IMAGEBUFFER; - (*KeywordMap)["iimageBuffer"] = IIMAGEBUFFER; - (*KeywordMap)["uimageBuffer"] = UIMAGEBUFFER; - (*KeywordMap)["image1DArray"] = IMAGE1DARRAY; - (*KeywordMap)["iimage1DArray"] = IIMAGE1DARRAY; - (*KeywordMap)["uimage1DArray"] = UIMAGE1DARRAY; - (*KeywordMap)["image2DArray"] = IMAGE2DARRAY; - (*KeywordMap)["iimage2DArray"] = IIMAGE2DARRAY; - (*KeywordMap)["uimage2DArray"] = UIMAGE2DARRAY; - (*KeywordMap)["imageCubeArray"] = IMAGECUBEARRAY; - (*KeywordMap)["iimageCubeArray"] = IIMAGECUBEARRAY; - (*KeywordMap)["uimageCubeArray"] = UIMAGECUBEARRAY; - (*KeywordMap)["image2DMS"] = IMAGE2DMS; - (*KeywordMap)["iimage2DMS"] = IIMAGE2DMS; - (*KeywordMap)["uimage2DMS"] = UIMAGE2DMS; - (*KeywordMap)["image2DMSArray"] = IMAGE2DMSARRAY; - (*KeywordMap)["iimage2DMSArray"] = IIMAGE2DMSARRAY; - (*KeywordMap)["uimage2DMSArray"] = UIMAGE2DMSARRAY; - (*KeywordMap)["i64image1D"] = I64IMAGE1D; - (*KeywordMap)["u64image1D"] = U64IMAGE1D; - (*KeywordMap)["i64image2D"] = I64IMAGE2D; - (*KeywordMap)["u64image2D"] = U64IMAGE2D; - (*KeywordMap)["i64image3D"] = I64IMAGE3D; - (*KeywordMap)["u64image3D"] = U64IMAGE3D; - (*KeywordMap)["i64image2DRect"] = I64IMAGE2DRECT; - (*KeywordMap)["u64image2DRect"] = U64IMAGE2DRECT; - (*KeywordMap)["i64imageCube"] = I64IMAGECUBE; - (*KeywordMap)["u64imageCube"] = U64IMAGECUBE; - (*KeywordMap)["i64imageBuffer"] = I64IMAGEBUFFER; - (*KeywordMap)["u64imageBuffer"] = U64IMAGEBUFFER; - (*KeywordMap)["i64image1DArray"] = I64IMAGE1DARRAY; - (*KeywordMap)["u64image1DArray"] = U64IMAGE1DARRAY; - (*KeywordMap)["i64image2DArray"] = I64IMAGE2DARRAY; - (*KeywordMap)["u64image2DArray"] = U64IMAGE2DARRAY; - (*KeywordMap)["i64imageCubeArray"] = I64IMAGECUBEARRAY; - (*KeywordMap)["u64imageCubeArray"] = U64IMAGECUBEARRAY; - (*KeywordMap)["i64image2DMS"] = I64IMAGE2DMS; - (*KeywordMap)["u64image2DMS"] = U64IMAGE2DMS; - (*KeywordMap)["i64image2DMSArray"] = I64IMAGE2DMSARRAY; - (*KeywordMap)["u64image2DMSArray"] = U64IMAGE2DMSARRAY; - (*KeywordMap)["double"] = DOUBLE; - (*KeywordMap)["dvec2"] = DVEC2; - (*KeywordMap)["dvec3"] = DVEC3; - (*KeywordMap)["dvec4"] = DVEC4; - (*KeywordMap)["int64_t"] = INT64_T; - (*KeywordMap)["uint64_t"] = UINT64_T; - (*KeywordMap)["i64vec2"] = I64VEC2; - (*KeywordMap)["i64vec3"] = I64VEC3; - (*KeywordMap)["i64vec4"] = I64VEC4; - (*KeywordMap)["u64vec2"] = U64VEC2; - (*KeywordMap)["u64vec3"] = U64VEC3; - (*KeywordMap)["u64vec4"] = U64VEC4; +const std::unordered_map KeywordMap { + {"const",CONST}, + {"uniform",UNIFORM}, + {"tileImageEXT",TILEIMAGEEXT}, + {"buffer",BUFFER}, + {"in",IN}, + {"out",OUT}, + {"smooth",SMOOTH}, + {"flat",FLAT}, + {"centroid",CENTROID}, + {"invariant",INVARIANT}, + {"packed",PACKED}, + {"resource",RESOURCE}, + {"inout",INOUT}, + {"struct",STRUCT}, + {"break",BREAK}, + {"continue",CONTINUE}, + {"do",DO}, + {"for",FOR}, + {"while",WHILE}, + {"switch",SWITCH}, + {"case",CASE}, + {"default",DEFAULT}, + {"if",IF}, + {"else",ELSE}, + {"discard",DISCARD}, + {"terminateInvocation",TERMINATE_INVOCATION}, + {"terminateRayEXT",TERMINATE_RAY}, + {"ignoreIntersectionEXT",IGNORE_INTERSECTION}, + {"return",RETURN}, + {"void",VOID}, + {"bool",BOOL}, + {"float",FLOAT}, + {"int",INT}, + {"bvec2",BVEC2}, + {"bvec3",BVEC3}, + {"bvec4",BVEC4}, + {"vec2",VEC2}, + {"vec3",VEC3}, + {"vec4",VEC4}, + {"ivec2",IVEC2}, + {"ivec3",IVEC3}, + {"ivec4",IVEC4}, + {"mat2",MAT2}, + {"mat3",MAT3}, + {"mat4",MAT4}, + {"true",BOOLCONSTANT}, + {"false",BOOLCONSTANT}, + {"layout",LAYOUT}, + {"shared",SHARED}, + {"highp",HIGH_PRECISION}, + {"mediump",MEDIUM_PRECISION}, + {"lowp",LOW_PRECISION}, + {"superp",SUPERP}, + {"precision",PRECISION}, + {"mat2x2",MAT2X2}, + {"mat2x3",MAT2X3}, + {"mat2x4",MAT2X4}, + {"mat3x2",MAT3X2}, + {"mat3x3",MAT3X3}, + {"mat3x4",MAT3X4}, + {"mat4x2",MAT4X2}, + {"mat4x3",MAT4X3}, + {"mat4x4",MAT4X4}, + {"uint",UINT}, + {"uvec2",UVEC2}, + {"uvec3",UVEC3}, + {"uvec4",UVEC4}, + + {"nonuniformEXT",NONUNIFORM}, + {"demote",DEMOTE}, + {"attribute",ATTRIBUTE}, + {"varying",VARYING}, + {"noperspective",NOPERSPECTIVE}, + {"coherent",COHERENT}, + {"devicecoherent",DEVICECOHERENT}, + {"queuefamilycoherent",QUEUEFAMILYCOHERENT}, + {"workgroupcoherent",WORKGROUPCOHERENT}, + {"subgroupcoherent",SUBGROUPCOHERENT}, + {"shadercallcoherent",SHADERCALLCOHERENT}, + {"nonprivate",NONPRIVATE}, + {"restrict",RESTRICT}, + {"readonly",READONLY}, + {"writeonly",WRITEONLY}, + {"atomic_uint",ATOMIC_UINT}, + {"volatile",VOLATILE}, + {"patch",PATCH}, + {"sample",SAMPLE}, + {"subroutine",SUBROUTINE}, + {"dmat2",DMAT2}, + {"dmat3",DMAT3}, + {"dmat4",DMAT4}, + {"dmat2x2",DMAT2X2}, + {"dmat2x3",DMAT2X3}, + {"dmat2x4",DMAT2X4}, + {"dmat3x2",DMAT3X2}, + {"dmat3x3",DMAT3X3}, + {"dmat3x4",DMAT3X4}, + {"dmat4x2",DMAT4X2}, + {"dmat4x3",DMAT4X3}, + {"dmat4x4",DMAT4X4}, + {"image1D",IMAGE1D}, + {"iimage1D",IIMAGE1D}, + {"uimage1D",UIMAGE1D}, + {"image2D",IMAGE2D}, + {"iimage2D",IIMAGE2D}, + {"uimage2D",UIMAGE2D}, + {"image3D",IMAGE3D}, + {"iimage3D",IIMAGE3D}, + {"uimage3D",UIMAGE3D}, + {"image2DRect",IMAGE2DRECT}, + {"iimage2DRect",IIMAGE2DRECT}, + {"uimage2DRect",UIMAGE2DRECT}, + {"imageCube",IMAGECUBE}, + {"iimageCube",IIMAGECUBE}, + {"uimageCube",UIMAGECUBE}, + {"imageBuffer",IMAGEBUFFER}, + {"iimageBuffer",IIMAGEBUFFER}, + {"uimageBuffer",UIMAGEBUFFER}, + {"image1DArray",IMAGE1DARRAY}, + {"iimage1DArray",IIMAGE1DARRAY}, + {"uimage1DArray",UIMAGE1DARRAY}, + {"image2DArray",IMAGE2DARRAY}, + {"iimage2DArray",IIMAGE2DARRAY}, + {"uimage2DArray",UIMAGE2DARRAY}, + {"imageCubeArray",IMAGECUBEARRAY}, + {"iimageCubeArray",IIMAGECUBEARRAY}, + {"uimageCubeArray",UIMAGECUBEARRAY}, + {"image2DMS",IMAGE2DMS}, + {"iimage2DMS",IIMAGE2DMS}, + {"uimage2DMS",UIMAGE2DMS}, + {"image2DMSArray",IMAGE2DMSARRAY}, + {"iimage2DMSArray",IIMAGE2DMSARRAY}, + {"uimage2DMSArray",UIMAGE2DMSARRAY}, + {"i64image1D",I64IMAGE1D}, + {"u64image1D",U64IMAGE1D}, + {"i64image2D",I64IMAGE2D}, + {"u64image2D",U64IMAGE2D}, + {"i64image3D",I64IMAGE3D}, + {"u64image3D",U64IMAGE3D}, + {"i64image2DRect",I64IMAGE2DRECT}, + {"u64image2DRect",U64IMAGE2DRECT}, + {"i64imageCube",I64IMAGECUBE}, + {"u64imageCube",U64IMAGECUBE}, + {"i64imageBuffer",I64IMAGEBUFFER}, + {"u64imageBuffer",U64IMAGEBUFFER}, + {"i64image1DArray",I64IMAGE1DARRAY}, + {"u64image1DArray",U64IMAGE1DARRAY}, + {"i64image2DArray",I64IMAGE2DARRAY}, + {"u64image2DArray",U64IMAGE2DARRAY}, + {"i64imageCubeArray",I64IMAGECUBEARRAY}, + {"u64imageCubeArray",U64IMAGECUBEARRAY}, + {"i64image2DMS",I64IMAGE2DMS}, + {"u64image2DMS",U64IMAGE2DMS}, + {"i64image2DMSArray",I64IMAGE2DMSARRAY}, + {"u64image2DMSArray",U64IMAGE2DMSARRAY}, + {"double",DOUBLE}, + {"dvec2",DVEC2}, + {"dvec3",DVEC3}, + {"dvec4",DVEC4}, + {"int64_t",INT64_T}, + {"uint64_t",UINT64_T}, + {"i64vec2",I64VEC2}, + {"i64vec3",I64VEC3}, + {"i64vec4",I64VEC4}, + {"u64vec2",U64VEC2}, + {"u64vec3",U64VEC3}, + {"u64vec4",U64VEC4}, // GL_EXT_shader_explicit_arithmetic_types - (*KeywordMap)["int8_t"] = INT8_T; - (*KeywordMap)["i8vec2"] = I8VEC2; - (*KeywordMap)["i8vec3"] = I8VEC3; - (*KeywordMap)["i8vec4"] = I8VEC4; - (*KeywordMap)["uint8_t"] = UINT8_T; - (*KeywordMap)["u8vec2"] = U8VEC2; - (*KeywordMap)["u8vec3"] = U8VEC3; - (*KeywordMap)["u8vec4"] = U8VEC4; - - (*KeywordMap)["int16_t"] = INT16_T; - (*KeywordMap)["i16vec2"] = I16VEC2; - (*KeywordMap)["i16vec3"] = I16VEC3; - (*KeywordMap)["i16vec4"] = I16VEC4; - (*KeywordMap)["uint16_t"] = UINT16_T; - (*KeywordMap)["u16vec2"] = U16VEC2; - (*KeywordMap)["u16vec3"] = U16VEC3; - (*KeywordMap)["u16vec4"] = U16VEC4; - - (*KeywordMap)["int32_t"] = INT32_T; - (*KeywordMap)["i32vec2"] = I32VEC2; - (*KeywordMap)["i32vec3"] = I32VEC3; - (*KeywordMap)["i32vec4"] = I32VEC4; - (*KeywordMap)["uint32_t"] = UINT32_T; - (*KeywordMap)["u32vec2"] = U32VEC2; - (*KeywordMap)["u32vec3"] = U32VEC3; - (*KeywordMap)["u32vec4"] = U32VEC4; - - (*KeywordMap)["float16_t"] = FLOAT16_T; - (*KeywordMap)["f16vec2"] = F16VEC2; - (*KeywordMap)["f16vec3"] = F16VEC3; - (*KeywordMap)["f16vec4"] = F16VEC4; - (*KeywordMap)["f16mat2"] = F16MAT2; - (*KeywordMap)["f16mat3"] = F16MAT3; - (*KeywordMap)["f16mat4"] = F16MAT4; - (*KeywordMap)["f16mat2x2"] = F16MAT2X2; - (*KeywordMap)["f16mat2x3"] = F16MAT2X3; - (*KeywordMap)["f16mat2x4"] = F16MAT2X4; - (*KeywordMap)["f16mat3x2"] = F16MAT3X2; - (*KeywordMap)["f16mat3x3"] = F16MAT3X3; - (*KeywordMap)["f16mat3x4"] = F16MAT3X4; - (*KeywordMap)["f16mat4x2"] = F16MAT4X2; - (*KeywordMap)["f16mat4x3"] = F16MAT4X3; - (*KeywordMap)["f16mat4x4"] = F16MAT4X4; - - (*KeywordMap)["float32_t"] = FLOAT32_T; - (*KeywordMap)["f32vec2"] = F32VEC2; - (*KeywordMap)["f32vec3"] = F32VEC3; - (*KeywordMap)["f32vec4"] = F32VEC4; - (*KeywordMap)["f32mat2"] = F32MAT2; - (*KeywordMap)["f32mat3"] = F32MAT3; - (*KeywordMap)["f32mat4"] = F32MAT4; - (*KeywordMap)["f32mat2x2"] = F32MAT2X2; - (*KeywordMap)["f32mat2x3"] = F32MAT2X3; - (*KeywordMap)["f32mat2x4"] = F32MAT2X4; - (*KeywordMap)["f32mat3x2"] = F32MAT3X2; - (*KeywordMap)["f32mat3x3"] = F32MAT3X3; - (*KeywordMap)["f32mat3x4"] = F32MAT3X4; - (*KeywordMap)["f32mat4x2"] = F32MAT4X2; - (*KeywordMap)["f32mat4x3"] = F32MAT4X3; - (*KeywordMap)["f32mat4x4"] = F32MAT4X4; - (*KeywordMap)["float64_t"] = FLOAT64_T; - (*KeywordMap)["f64vec2"] = F64VEC2; - (*KeywordMap)["f64vec3"] = F64VEC3; - (*KeywordMap)["f64vec4"] = F64VEC4; - (*KeywordMap)["f64mat2"] = F64MAT2; - (*KeywordMap)["f64mat3"] = F64MAT3; - (*KeywordMap)["f64mat4"] = F64MAT4; - (*KeywordMap)["f64mat2x2"] = F64MAT2X2; - (*KeywordMap)["f64mat2x3"] = F64MAT2X3; - (*KeywordMap)["f64mat2x4"] = F64MAT2X4; - (*KeywordMap)["f64mat3x2"] = F64MAT3X2; - (*KeywordMap)["f64mat3x3"] = F64MAT3X3; - (*KeywordMap)["f64mat3x4"] = F64MAT3X4; - (*KeywordMap)["f64mat4x2"] = F64MAT4X2; - (*KeywordMap)["f64mat4x3"] = F64MAT4X3; - (*KeywordMap)["f64mat4x4"] = F64MAT4X4; + {"int8_t",INT8_T}, + {"i8vec2",I8VEC2}, + {"i8vec3",I8VEC3}, + {"i8vec4",I8VEC4}, + {"uint8_t",UINT8_T}, + {"u8vec2",U8VEC2}, + {"u8vec3",U8VEC3}, + {"u8vec4",U8VEC4}, + + {"int16_t",INT16_T}, + {"i16vec2",I16VEC2}, + {"i16vec3",I16VEC3}, + {"i16vec4",I16VEC4}, + {"uint16_t",UINT16_T}, + {"u16vec2",U16VEC2}, + {"u16vec3",U16VEC3}, + {"u16vec4",U16VEC4}, + + {"int32_t",INT32_T}, + {"i32vec2",I32VEC2}, + {"i32vec3",I32VEC3}, + {"i32vec4",I32VEC4}, + {"uint32_t",UINT32_T}, + {"u32vec2",U32VEC2}, + {"u32vec3",U32VEC3}, + {"u32vec4",U32VEC4}, + + {"float16_t",FLOAT16_T}, + {"f16vec2",F16VEC2}, + {"f16vec3",F16VEC3}, + {"f16vec4",F16VEC4}, + {"f16mat2",F16MAT2}, + {"f16mat3",F16MAT3}, + {"f16mat4",F16MAT4}, + {"f16mat2x2",F16MAT2X2}, + {"f16mat2x3",F16MAT2X3}, + {"f16mat2x4",F16MAT2X4}, + {"f16mat3x2",F16MAT3X2}, + {"f16mat3x3",F16MAT3X3}, + {"f16mat3x4",F16MAT3X4}, + {"f16mat4x2",F16MAT4X2}, + {"f16mat4x3",F16MAT4X3}, + {"f16mat4x4",F16MAT4X4}, + + {"float32_t",FLOAT32_T}, + {"f32vec2",F32VEC2}, + {"f32vec3",F32VEC3}, + {"f32vec4",F32VEC4}, + {"f32mat2",F32MAT2}, + {"f32mat3",F32MAT3}, + {"f32mat4",F32MAT4}, + {"f32mat2x2",F32MAT2X2}, + {"f32mat2x3",F32MAT2X3}, + {"f32mat2x4",F32MAT2X4}, + {"f32mat3x2",F32MAT3X2}, + {"f32mat3x3",F32MAT3X3}, + {"f32mat3x4",F32MAT3X4}, + {"f32mat4x2",F32MAT4X2}, + {"f32mat4x3",F32MAT4X3}, + {"f32mat4x4",F32MAT4X4}, + {"float64_t",FLOAT64_T}, + {"f64vec2",F64VEC2}, + {"f64vec3",F64VEC3}, + {"f64vec4",F64VEC4}, + {"f64mat2",F64MAT2}, + {"f64mat3",F64MAT3}, + {"f64mat4",F64MAT4}, + {"f64mat2x2",F64MAT2X2}, + {"f64mat2x3",F64MAT2X3}, + {"f64mat2x4",F64MAT2X4}, + {"f64mat3x2",F64MAT3X2}, + {"f64mat3x3",F64MAT3X3}, + {"f64mat3x4",F64MAT3X4}, + {"f64mat4x2",F64MAT4X2}, + {"f64mat4x3",F64MAT4X3}, + {"f64mat4x4",F64MAT4X4}, // GL_EXT_spirv_intrinsics - (*KeywordMap)["spirv_instruction"] = SPIRV_INSTRUCTION; - (*KeywordMap)["spirv_execution_mode"] = SPIRV_EXECUTION_MODE; - (*KeywordMap)["spirv_execution_mode_id"] = SPIRV_EXECUTION_MODE_ID; - (*KeywordMap)["spirv_decorate"] = SPIRV_DECORATE; - (*KeywordMap)["spirv_decorate_id"] = SPIRV_DECORATE_ID; - (*KeywordMap)["spirv_decorate_string"] = SPIRV_DECORATE_STRING; - (*KeywordMap)["spirv_type"] = SPIRV_TYPE; - (*KeywordMap)["spirv_storage_class"] = SPIRV_STORAGE_CLASS; - (*KeywordMap)["spirv_by_reference"] = SPIRV_BY_REFERENCE; - (*KeywordMap)["spirv_literal"] = SPIRV_LITERAL; - - (*KeywordMap)["sampler2D"] = SAMPLER2D; - (*KeywordMap)["samplerCube"] = SAMPLERCUBE; - (*KeywordMap)["samplerCubeShadow"] = SAMPLERCUBESHADOW; - (*KeywordMap)["sampler2DArray"] = SAMPLER2DARRAY; - (*KeywordMap)["sampler2DArrayShadow"] = SAMPLER2DARRAYSHADOW; - (*KeywordMap)["isampler2D"] = ISAMPLER2D; - (*KeywordMap)["isampler3D"] = ISAMPLER3D; - (*KeywordMap)["isamplerCube"] = ISAMPLERCUBE; - (*KeywordMap)["isampler2DArray"] = ISAMPLER2DARRAY; - (*KeywordMap)["usampler2D"] = USAMPLER2D; - (*KeywordMap)["usampler3D"] = USAMPLER3D; - (*KeywordMap)["usamplerCube"] = USAMPLERCUBE; - (*KeywordMap)["usampler2DArray"] = USAMPLER2DARRAY; - (*KeywordMap)["sampler3D"] = SAMPLER3D; - (*KeywordMap)["sampler2DShadow"] = SAMPLER2DSHADOW; - - (*KeywordMap)["texture2D"] = TEXTURE2D; - (*KeywordMap)["textureCube"] = TEXTURECUBE; - (*KeywordMap)["texture2DArray"] = TEXTURE2DARRAY; - (*KeywordMap)["itexture2D"] = ITEXTURE2D; - (*KeywordMap)["itexture3D"] = ITEXTURE3D; - (*KeywordMap)["itextureCube"] = ITEXTURECUBE; - (*KeywordMap)["itexture2DArray"] = ITEXTURE2DARRAY; - (*KeywordMap)["utexture2D"] = UTEXTURE2D; - (*KeywordMap)["utexture3D"] = UTEXTURE3D; - (*KeywordMap)["utextureCube"] = UTEXTURECUBE; - (*KeywordMap)["utexture2DArray"] = UTEXTURE2DARRAY; - (*KeywordMap)["texture3D"] = TEXTURE3D; - - (*KeywordMap)["sampler"] = SAMPLER; - (*KeywordMap)["samplerShadow"] = SAMPLERSHADOW; - - (*KeywordMap)["textureCubeArray"] = TEXTURECUBEARRAY; - (*KeywordMap)["itextureCubeArray"] = ITEXTURECUBEARRAY; - (*KeywordMap)["utextureCubeArray"] = UTEXTURECUBEARRAY; - (*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY; - (*KeywordMap)["samplerCubeArrayShadow"] = SAMPLERCUBEARRAYSHADOW; - (*KeywordMap)["isamplerCubeArray"] = ISAMPLERCUBEARRAY; - (*KeywordMap)["usamplerCubeArray"] = USAMPLERCUBEARRAY; - (*KeywordMap)["sampler1DArrayShadow"] = SAMPLER1DARRAYSHADOW; - (*KeywordMap)["isampler1DArray"] = ISAMPLER1DARRAY; - (*KeywordMap)["usampler1D"] = USAMPLER1D; - (*KeywordMap)["isampler1D"] = ISAMPLER1D; - (*KeywordMap)["usampler1DArray"] = USAMPLER1DARRAY; - (*KeywordMap)["samplerBuffer"] = SAMPLERBUFFER; - (*KeywordMap)["isampler2DRect"] = ISAMPLER2DRECT; - (*KeywordMap)["usampler2DRect"] = USAMPLER2DRECT; - (*KeywordMap)["isamplerBuffer"] = ISAMPLERBUFFER; - (*KeywordMap)["usamplerBuffer"] = USAMPLERBUFFER; - (*KeywordMap)["sampler2DMS"] = SAMPLER2DMS; - (*KeywordMap)["isampler2DMS"] = ISAMPLER2DMS; - (*KeywordMap)["usampler2DMS"] = USAMPLER2DMS; - (*KeywordMap)["sampler2DMSArray"] = SAMPLER2DMSARRAY; - (*KeywordMap)["isampler2DMSArray"] = ISAMPLER2DMSARRAY; - (*KeywordMap)["usampler2DMSArray"] = USAMPLER2DMSARRAY; - (*KeywordMap)["sampler1D"] = SAMPLER1D; - (*KeywordMap)["sampler1DShadow"] = SAMPLER1DSHADOW; - (*KeywordMap)["sampler2DRect"] = SAMPLER2DRECT; - (*KeywordMap)["sampler2DRectShadow"] = SAMPLER2DRECTSHADOW; - (*KeywordMap)["sampler1DArray"] = SAMPLER1DARRAY; - - (*KeywordMap)["samplerExternalOES"] = SAMPLEREXTERNALOES; // GL_OES_EGL_image_external - - (*KeywordMap)["__samplerExternal2DY2YEXT"] = SAMPLEREXTERNAL2DY2YEXT; // GL_EXT_YUV_target - - (*KeywordMap)["itexture1DArray"] = ITEXTURE1DARRAY; - (*KeywordMap)["utexture1D"] = UTEXTURE1D; - (*KeywordMap)["itexture1D"] = ITEXTURE1D; - (*KeywordMap)["utexture1DArray"] = UTEXTURE1DARRAY; - (*KeywordMap)["textureBuffer"] = TEXTUREBUFFER; - (*KeywordMap)["itexture2DRect"] = ITEXTURE2DRECT; - (*KeywordMap)["utexture2DRect"] = UTEXTURE2DRECT; - (*KeywordMap)["itextureBuffer"] = ITEXTUREBUFFER; - (*KeywordMap)["utextureBuffer"] = UTEXTUREBUFFER; - (*KeywordMap)["texture2DMS"] = TEXTURE2DMS; - (*KeywordMap)["itexture2DMS"] = ITEXTURE2DMS; - (*KeywordMap)["utexture2DMS"] = UTEXTURE2DMS; - (*KeywordMap)["texture2DMSArray"] = TEXTURE2DMSARRAY; - (*KeywordMap)["itexture2DMSArray"] = ITEXTURE2DMSARRAY; - (*KeywordMap)["utexture2DMSArray"] = UTEXTURE2DMSARRAY; - (*KeywordMap)["texture1D"] = TEXTURE1D; - (*KeywordMap)["texture2DRect"] = TEXTURE2DRECT; - (*KeywordMap)["texture1DArray"] = TEXTURE1DARRAY; - - (*KeywordMap)["attachmentEXT"] = ATTACHMENTEXT; - (*KeywordMap)["iattachmentEXT"] = IATTACHMENTEXT; - (*KeywordMap)["uattachmentEXT"] = UATTACHMENTEXT; - - (*KeywordMap)["subpassInput"] = SUBPASSINPUT; - (*KeywordMap)["subpassInputMS"] = SUBPASSINPUTMS; - (*KeywordMap)["isubpassInput"] = ISUBPASSINPUT; - (*KeywordMap)["isubpassInputMS"] = ISUBPASSINPUTMS; - (*KeywordMap)["usubpassInput"] = USUBPASSINPUT; - (*KeywordMap)["usubpassInputMS"] = USUBPASSINPUTMS; - - (*KeywordMap)["f16sampler1D"] = F16SAMPLER1D; - (*KeywordMap)["f16sampler2D"] = F16SAMPLER2D; - (*KeywordMap)["f16sampler3D"] = F16SAMPLER3D; - (*KeywordMap)["f16sampler2DRect"] = F16SAMPLER2DRECT; - (*KeywordMap)["f16samplerCube"] = F16SAMPLERCUBE; - (*KeywordMap)["f16sampler1DArray"] = F16SAMPLER1DARRAY; - (*KeywordMap)["f16sampler2DArray"] = F16SAMPLER2DARRAY; - (*KeywordMap)["f16samplerCubeArray"] = F16SAMPLERCUBEARRAY; - (*KeywordMap)["f16samplerBuffer"] = F16SAMPLERBUFFER; - (*KeywordMap)["f16sampler2DMS"] = F16SAMPLER2DMS; - (*KeywordMap)["f16sampler2DMSArray"] = F16SAMPLER2DMSARRAY; - (*KeywordMap)["f16sampler1DShadow"] = F16SAMPLER1DSHADOW; - (*KeywordMap)["f16sampler2DShadow"] = F16SAMPLER2DSHADOW; - (*KeywordMap)["f16sampler2DRectShadow"] = F16SAMPLER2DRECTSHADOW; - (*KeywordMap)["f16samplerCubeShadow"] = F16SAMPLERCUBESHADOW; - (*KeywordMap)["f16sampler1DArrayShadow"] = F16SAMPLER1DARRAYSHADOW; - (*KeywordMap)["f16sampler2DArrayShadow"] = F16SAMPLER2DARRAYSHADOW; - (*KeywordMap)["f16samplerCubeArrayShadow"] = F16SAMPLERCUBEARRAYSHADOW; - - (*KeywordMap)["f16image1D"] = F16IMAGE1D; - (*KeywordMap)["f16image2D"] = F16IMAGE2D; - (*KeywordMap)["f16image3D"] = F16IMAGE3D; - (*KeywordMap)["f16image2DRect"] = F16IMAGE2DRECT; - (*KeywordMap)["f16imageCube"] = F16IMAGECUBE; - (*KeywordMap)["f16image1DArray"] = F16IMAGE1DARRAY; - (*KeywordMap)["f16image2DArray"] = F16IMAGE2DARRAY; - (*KeywordMap)["f16imageCubeArray"] = F16IMAGECUBEARRAY; - (*KeywordMap)["f16imageBuffer"] = F16IMAGEBUFFER; - (*KeywordMap)["f16image2DMS"] = F16IMAGE2DMS; - (*KeywordMap)["f16image2DMSArray"] = F16IMAGE2DMSARRAY; - - (*KeywordMap)["f16texture1D"] = F16TEXTURE1D; - (*KeywordMap)["f16texture2D"] = F16TEXTURE2D; - (*KeywordMap)["f16texture3D"] = F16TEXTURE3D; - (*KeywordMap)["f16texture2DRect"] = F16TEXTURE2DRECT; - (*KeywordMap)["f16textureCube"] = F16TEXTURECUBE; - (*KeywordMap)["f16texture1DArray"] = F16TEXTURE1DARRAY; - (*KeywordMap)["f16texture2DArray"] = F16TEXTURE2DARRAY; - (*KeywordMap)["f16textureCubeArray"] = F16TEXTURECUBEARRAY; - (*KeywordMap)["f16textureBuffer"] = F16TEXTUREBUFFER; - (*KeywordMap)["f16texture2DMS"] = F16TEXTURE2DMS; - (*KeywordMap)["f16texture2DMSArray"] = F16TEXTURE2DMSARRAY; - - (*KeywordMap)["f16subpassInput"] = F16SUBPASSINPUT; - (*KeywordMap)["f16subpassInputMS"] = F16SUBPASSINPUTMS; - (*KeywordMap)["__explicitInterpAMD"] = EXPLICITINTERPAMD; - (*KeywordMap)["pervertexNV"] = PERVERTEXNV; - (*KeywordMap)["pervertexEXT"] = PERVERTEXEXT; - (*KeywordMap)["precise"] = PRECISE; - - (*KeywordMap)["rayPayloadNV"] = PAYLOADNV; - (*KeywordMap)["rayPayloadEXT"] = PAYLOADEXT; - (*KeywordMap)["rayPayloadInNV"] = PAYLOADINNV; - (*KeywordMap)["rayPayloadInEXT"] = PAYLOADINEXT; - (*KeywordMap)["hitAttributeNV"] = HITATTRNV; - (*KeywordMap)["hitAttributeEXT"] = HITATTREXT; - (*KeywordMap)["callableDataNV"] = CALLDATANV; - (*KeywordMap)["callableDataEXT"] = CALLDATAEXT; - (*KeywordMap)["callableDataInNV"] = CALLDATAINNV; - (*KeywordMap)["callableDataInEXT"] = CALLDATAINEXT; - (*KeywordMap)["accelerationStructureNV"] = ACCSTRUCTNV; - (*KeywordMap)["accelerationStructureEXT"] = ACCSTRUCTEXT; - (*KeywordMap)["rayQueryEXT"] = RAYQUERYEXT; - (*KeywordMap)["perprimitiveNV"] = PERPRIMITIVENV; - (*KeywordMap)["perviewNV"] = PERVIEWNV; - (*KeywordMap)["taskNV"] = PERTASKNV; - (*KeywordMap)["perprimitiveEXT"] = PERPRIMITIVEEXT; - (*KeywordMap)["taskPayloadSharedEXT"] = TASKPAYLOADWORKGROUPEXT; - - (*KeywordMap)["fcoopmatNV"] = FCOOPMATNV; - (*KeywordMap)["icoopmatNV"] = ICOOPMATNV; - (*KeywordMap)["ucoopmatNV"] = UCOOPMATNV; - - (*KeywordMap)["coopmat"] = COOPMAT; - - (*KeywordMap)["hitObjectNV"] = HITOBJECTNV; - (*KeywordMap)["hitObjectAttributeNV"] = HITOBJECTATTRNV; - - ReservedSet = new std::unordered_set; - - ReservedSet->insert("common"); - ReservedSet->insert("partition"); - ReservedSet->insert("active"); - ReservedSet->insert("asm"); - ReservedSet->insert("class"); - ReservedSet->insert("union"); - ReservedSet->insert("enum"); - ReservedSet->insert("typedef"); - ReservedSet->insert("template"); - ReservedSet->insert("this"); - ReservedSet->insert("goto"); - ReservedSet->insert("inline"); - ReservedSet->insert("noinline"); - ReservedSet->insert("public"); - ReservedSet->insert("static"); - ReservedSet->insert("extern"); - ReservedSet->insert("external"); - ReservedSet->insert("interface"); - ReservedSet->insert("long"); - ReservedSet->insert("short"); - ReservedSet->insert("half"); - ReservedSet->insert("fixed"); - ReservedSet->insert("unsigned"); - ReservedSet->insert("input"); - ReservedSet->insert("output"); - ReservedSet->insert("hvec2"); - ReservedSet->insert("hvec3"); - ReservedSet->insert("hvec4"); - ReservedSet->insert("fvec2"); - ReservedSet->insert("fvec3"); - ReservedSet->insert("fvec4"); - ReservedSet->insert("sampler3DRect"); - ReservedSet->insert("filter"); - ReservedSet->insert("sizeof"); - ReservedSet->insert("cast"); - ReservedSet->insert("namespace"); - ReservedSet->insert("using"); -} + {"spirv_instruction",SPIRV_INSTRUCTION}, + {"spirv_execution_mode",SPIRV_EXECUTION_MODE}, + {"spirv_execution_mode_id",SPIRV_EXECUTION_MODE_ID}, + {"spirv_decorate",SPIRV_DECORATE}, + {"spirv_decorate_id",SPIRV_DECORATE_ID}, + {"spirv_decorate_string",SPIRV_DECORATE_STRING}, + {"spirv_type",SPIRV_TYPE}, + {"spirv_storage_class",SPIRV_STORAGE_CLASS}, + {"spirv_by_reference",SPIRV_BY_REFERENCE}, + {"spirv_literal",SPIRV_LITERAL}, + + {"sampler2D",SAMPLER2D}, + {"samplerCube",SAMPLERCUBE}, + {"samplerCubeShadow",SAMPLERCUBESHADOW}, + {"sampler2DArray",SAMPLER2DARRAY}, + {"sampler2DArrayShadow",SAMPLER2DARRAYSHADOW}, + {"isampler2D",ISAMPLER2D}, + {"isampler3D",ISAMPLER3D}, + {"isamplerCube",ISAMPLERCUBE}, + {"isampler2DArray",ISAMPLER2DARRAY}, + {"usampler2D",USAMPLER2D}, + {"usampler3D",USAMPLER3D}, + {"usamplerCube",USAMPLERCUBE}, + {"usampler2DArray",USAMPLER2DARRAY}, + {"sampler3D",SAMPLER3D}, + {"sampler2DShadow",SAMPLER2DSHADOW}, + + {"texture2D",TEXTURE2D}, + {"textureCube",TEXTURECUBE}, + {"texture2DArray",TEXTURE2DARRAY}, + {"itexture2D",ITEXTURE2D}, + {"itexture3D",ITEXTURE3D}, + {"itextureCube",ITEXTURECUBE}, + {"itexture2DArray",ITEXTURE2DARRAY}, + {"utexture2D",UTEXTURE2D}, + {"utexture3D",UTEXTURE3D}, + {"utextureCube",UTEXTURECUBE}, + {"utexture2DArray",UTEXTURE2DARRAY}, + {"texture3D",TEXTURE3D}, + + {"sampler",SAMPLER}, + {"samplerShadow",SAMPLERSHADOW}, + + {"textureCubeArray",TEXTURECUBEARRAY}, + {"itextureCubeArray",ITEXTURECUBEARRAY}, + {"utextureCubeArray",UTEXTURECUBEARRAY}, + {"samplerCubeArray",SAMPLERCUBEARRAY}, + {"samplerCubeArrayShadow",SAMPLERCUBEARRAYSHADOW}, + {"isamplerCubeArray",ISAMPLERCUBEARRAY}, + {"usamplerCubeArray",USAMPLERCUBEARRAY}, + {"sampler1DArrayShadow",SAMPLER1DARRAYSHADOW}, + {"isampler1DArray",ISAMPLER1DARRAY}, + {"usampler1D",USAMPLER1D}, + {"isampler1D",ISAMPLER1D}, + {"usampler1DArray",USAMPLER1DARRAY}, + {"samplerBuffer",SAMPLERBUFFER}, + {"isampler2DRect",ISAMPLER2DRECT}, + {"usampler2DRect",USAMPLER2DRECT}, + {"isamplerBuffer",ISAMPLERBUFFER}, + {"usamplerBuffer",USAMPLERBUFFER}, + {"sampler2DMS",SAMPLER2DMS}, + {"isampler2DMS",ISAMPLER2DMS}, + {"usampler2DMS",USAMPLER2DMS}, + {"sampler2DMSArray",SAMPLER2DMSARRAY}, + {"isampler2DMSArray",ISAMPLER2DMSARRAY}, + {"usampler2DMSArray",USAMPLER2DMSARRAY}, + {"sampler1D",SAMPLER1D}, + {"sampler1DShadow",SAMPLER1DSHADOW}, + {"sampler2DRect",SAMPLER2DRECT}, + {"sampler2DRectShadow",SAMPLER2DRECTSHADOW}, + {"sampler1DArray",SAMPLER1DARRAY}, + + {"samplerExternalOES", SAMPLEREXTERNALOES}, // GL_OES_EGL_image_external + {"__samplerExternal2DY2YEXT", SAMPLEREXTERNAL2DY2YEXT}, // GL_EXT_YUV_target + + {"itexture1DArray",ITEXTURE1DARRAY}, + {"utexture1D",UTEXTURE1D}, + {"itexture1D",ITEXTURE1D}, + {"utexture1DArray",UTEXTURE1DARRAY}, + {"textureBuffer",TEXTUREBUFFER}, + {"itexture2DRect",ITEXTURE2DRECT}, + {"utexture2DRect",UTEXTURE2DRECT}, + {"itextureBuffer",ITEXTUREBUFFER}, + {"utextureBuffer",UTEXTUREBUFFER}, + {"texture2DMS",TEXTURE2DMS}, + {"itexture2DMS",ITEXTURE2DMS}, + {"utexture2DMS",UTEXTURE2DMS}, + {"texture2DMSArray",TEXTURE2DMSARRAY}, + {"itexture2DMSArray",ITEXTURE2DMSARRAY}, + {"utexture2DMSArray",UTEXTURE2DMSARRAY}, + {"texture1D",TEXTURE1D}, + {"texture2DRect",TEXTURE2DRECT}, + {"texture1DArray",TEXTURE1DARRAY}, + + {"attachmentEXT",ATTACHMENTEXT}, + {"iattachmentEXT",IATTACHMENTEXT}, + {"uattachmentEXT",UATTACHMENTEXT}, + + {"subpassInput",SUBPASSINPUT}, + {"subpassInputMS",SUBPASSINPUTMS}, + {"isubpassInput",ISUBPASSINPUT}, + {"isubpassInputMS",ISUBPASSINPUTMS}, + {"usubpassInput",USUBPASSINPUT}, + {"usubpassInputMS",USUBPASSINPUTMS}, + + {"f16sampler1D",F16SAMPLER1D}, + {"f16sampler2D",F16SAMPLER2D}, + {"f16sampler3D",F16SAMPLER3D}, + {"f16sampler2DRect",F16SAMPLER2DRECT}, + {"f16samplerCube",F16SAMPLERCUBE}, + {"f16sampler1DArray",F16SAMPLER1DARRAY}, + {"f16sampler2DArray",F16SAMPLER2DARRAY}, + {"f16samplerCubeArray",F16SAMPLERCUBEARRAY}, + {"f16samplerBuffer",F16SAMPLERBUFFER}, + {"f16sampler2DMS",F16SAMPLER2DMS}, + {"f16sampler2DMSArray",F16SAMPLER2DMSARRAY}, + {"f16sampler1DShadow",F16SAMPLER1DSHADOW}, + {"f16sampler2DShadow",F16SAMPLER2DSHADOW}, + {"f16sampler2DRectShadow",F16SAMPLER2DRECTSHADOW}, + {"f16samplerCubeShadow",F16SAMPLERCUBESHADOW}, + {"f16sampler1DArrayShadow",F16SAMPLER1DARRAYSHADOW}, + {"f16sampler2DArrayShadow",F16SAMPLER2DARRAYSHADOW}, + {"f16samplerCubeArrayShadow",F16SAMPLERCUBEARRAYSHADOW}, + + {"f16image1D",F16IMAGE1D}, + {"f16image2D",F16IMAGE2D}, + {"f16image3D",F16IMAGE3D}, + {"f16image2DRect",F16IMAGE2DRECT}, + {"f16imageCube",F16IMAGECUBE}, + {"f16image1DArray",F16IMAGE1DARRAY}, + {"f16image2DArray",F16IMAGE2DARRAY}, + {"f16imageCubeArray",F16IMAGECUBEARRAY}, + {"f16imageBuffer",F16IMAGEBUFFER}, + {"f16image2DMS",F16IMAGE2DMS}, + {"f16image2DMSArray",F16IMAGE2DMSARRAY}, + + {"f16texture1D",F16TEXTURE1D}, + {"f16texture2D",F16TEXTURE2D}, + {"f16texture3D",F16TEXTURE3D}, + {"f16texture2DRect",F16TEXTURE2DRECT}, + {"f16textureCube",F16TEXTURECUBE}, + {"f16texture1DArray",F16TEXTURE1DARRAY}, + {"f16texture2DArray",F16TEXTURE2DARRAY}, + {"f16textureCubeArray",F16TEXTURECUBEARRAY}, + {"f16textureBuffer",F16TEXTUREBUFFER}, + {"f16texture2DMS",F16TEXTURE2DMS}, + {"f16texture2DMSArray",F16TEXTURE2DMSARRAY}, + + {"f16subpassInput",F16SUBPASSINPUT}, + {"f16subpassInputMS",F16SUBPASSINPUTMS}, + {"__explicitInterpAMD",EXPLICITINTERPAMD}, + {"pervertexNV",PERVERTEXNV}, + {"pervertexEXT",PERVERTEXEXT}, + {"precise",PRECISE}, + + {"rayPayloadNV",PAYLOADNV}, + {"rayPayloadEXT",PAYLOADEXT}, + {"rayPayloadInNV",PAYLOADINNV}, + {"rayPayloadInEXT",PAYLOADINEXT}, + {"hitAttributeNV",HITATTRNV}, + {"hitAttributeEXT",HITATTREXT}, + {"callableDataNV",CALLDATANV}, + {"callableDataEXT",CALLDATAEXT}, + {"callableDataInNV",CALLDATAINNV}, + {"callableDataInEXT",CALLDATAINEXT}, + {"accelerationStructureNV",ACCSTRUCTNV}, + {"accelerationStructureEXT",ACCSTRUCTEXT}, + {"rayQueryEXT",RAYQUERYEXT}, + {"perprimitiveNV",PERPRIMITIVENV}, + {"perviewNV",PERVIEWNV}, + {"taskNV",PERTASKNV}, + {"perprimitiveEXT",PERPRIMITIVEEXT}, + {"taskPayloadSharedEXT",TASKPAYLOADWORKGROUPEXT}, + + {"fcoopmatNV",FCOOPMATNV}, + {"icoopmatNV",ICOOPMATNV}, + {"ucoopmatNV",UCOOPMATNV}, + + {"coopmat",COOPMAT}, + + {"hitObjectNV",HITOBJECTNV}, + {"hitObjectAttributeNV",HITOBJECTATTRNV}, +}; +const std::unordered_set ReservedSet { + "common", + "partition", + "active", + "asm", + "class", + "union", + "enum", + "typedef", + "template", + "this", + "goto", + "inline", + "noinline", + "public", + "static", + "extern", + "external", + "interface", + "long", + "short", + "half", + "fixed", + "unsigned", + "input", + "output", + "hvec2", + "hvec3", + "hvec4", + "fvec2", + "fvec3", + "fvec4", + "sampler3DRect", + "filter", + "sizeof", + "cast", + "namespace", + "using", +}; -void TScanContext::deleteKeywordMap() -{ - delete KeywordMap; - KeywordMap = nullptr; - delete ReservedSet; - ReservedSet = nullptr; } +namespace glslang { + // Called by yylex to get the next token. // Returning 0 implies end of input. int TScanContext::tokenize(TPpContext* pp, TParserToken& token) @@ -924,11 +902,11 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) int TScanContext::tokenizeIdentifier() { - if (ReservedSet->find(tokenText) != ReservedSet->end()) + if (ReservedSet.find(tokenText) != ReservedSet.end()) return reservedWord(); - auto it = KeywordMap->find(tokenText); - if (it == KeywordMap->end()) { + auto it = KeywordMap.find(tokenText); + if (it == KeywordMap.end()) { // Should have an identifier of some sort return identifierOrType(); } @@ -1073,12 +1051,18 @@ int TScanContext::tokenizeIdentifier() parseContext.extensionTurnedOn(E_GL_NV_ray_tracing)) return keyword; return identifierOrType(); + case ACCSTRUCTEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing) || + parseContext.extensionTurnedOn(E_GL_EXT_ray_query) || + parseContext.extensionTurnedOn(E_GL_NV_displacement_micromap)) + return keyword; + return identifierOrType(); case PAYLOADEXT: case PAYLOADINEXT: case HITATTREXT: case CALLDATAEXT: case CALLDATAINEXT: - case ACCSTRUCTEXT: if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing) || parseContext.extensionTurnedOn(E_GL_EXT_ray_query)) @@ -1490,6 +1474,12 @@ int TScanContext::tokenizeIdentifier() case USAMPLERCUBE: case USAMPLER2DARRAY: afterType = true; + if (keyword == SAMPLER2DARRAY || keyword == SAMPLER2DARRAYSHADOW) { + if (!parseContext.isEsProfile() && + (parseContext.extensionTurnedOn(E_GL_EXT_texture_array) || parseContext.symbolTable.atBuiltInLevel())) { + return keyword; + } + } return nonreservedKeyword(300, 130); case SAMPLER3D: @@ -1533,6 +1523,12 @@ int TScanContext::tokenizeIdentifier() case USAMPLER1D: case USAMPLER1DARRAY: afterType = true; + if (keyword == SAMPLER1DARRAYSHADOW) { + if (!parseContext.isEsProfile() && + (parseContext.extensionTurnedOn(E_GL_EXT_texture_array) || parseContext.symbolTable.atBuiltInLevel())) { + return keyword; + } + } return es30ReservedFromGLSL(130); case ISAMPLER2DRECT: case USAMPLER2DRECT: @@ -1602,7 +1598,9 @@ int TScanContext::tokenizeIdentifier() if (parseContext.isEsProfile() && parseContext.version == 300) reservedWord(); else if ((parseContext.isEsProfile() && parseContext.version < 300) || - (!parseContext.isEsProfile() && parseContext.version < 130)) + ((!parseContext.isEsProfile() && parseContext.version < 130) && + !parseContext.symbolTable.atBuiltInLevel() && + !parseContext.extensionTurnedOn(E_GL_EXT_texture_array))) return identifierOrType(); return keyword; diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp index 51c524bb..040b21da 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -58,7 +58,6 @@ #endif #include "../Include/ShHandle.h" -#include "../../OGLCompilersDLL/InitializeDll.h" #include "preprocessor/PpContext.h" @@ -83,7 +82,10 @@ namespace { // anonymous namespace for file-local functions and symbols int NumberOfClients = 0; // global initialization lock +#ifndef DISABLE_THREAD_SUPPORT std::mutex init_lock; +#endif + using namespace glslang; @@ -295,18 +297,21 @@ int CommonIndex(EProfile profile, EShLanguage language) // // To initialize per-stage shared tables, with the common table already complete. // -void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int version, EProfile profile, const SpvVersion& spvVersion, +bool InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) { (*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]); - InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source, - infoSink, *symbolTables[language]); + if (!InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source, + infoSink, *symbolTables[language])) + return false; builtInParseables.identifyBuiltIns(version, profile, spvVersion, language, *symbolTables[language]); if (profile == EEsProfile && version >= 300) (*symbolTables[language]).setNoBuiltInRedeclarations(); if (version == 110) (*symbolTables[language]).setSeparateNameSpaces(); + + return true; } // @@ -315,6 +320,7 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi // bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source) { + bool success = true; std::unique_ptr builtInParseables(CreateBuiltInParseables(infoSink, source)); if (builtInParseables == nullptr) @@ -323,70 +329,70 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS builtInParseables->initialize(version, profile, spvVersion); // do the common tables - InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, EShLangVertex, source, + success &= InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, EShLangVertex, source, infoSink, *commonTable[EPcGeneral]); if (profile == EEsProfile) - InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, EShLangFragment, source, + success &= InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, EShLangFragment, source, infoSink, *commonTable[EPcFragment]); // do the per-stage tables // always have vertex and fragment - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangVertex, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangVertex, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangFragment, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangFragment, source, infoSink, commonTable, symbolTables); // check for tessellation if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) { - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTessControl, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTessControl, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTessEvaluation, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTessEvaluation, source, infoSink, commonTable, symbolTables); } // check for geometry if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangGeometry, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangGeometry, source, infoSink, commonTable, symbolTables); // check for compute if ((profile != EEsProfile && version >= 420) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCompute, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCompute, source, infoSink, commonTable, symbolTables); // check for ray tracing stages if (profile != EEsProfile && version >= 450) { - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGen, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGen, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangIntersect, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangIntersect, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangAnyHit, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangAnyHit, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangClosestHit, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangClosestHit, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMiss, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMiss, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCallable, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCallable, source, infoSink, commonTable, symbolTables); } // check for mesh if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMesh, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMesh, source, infoSink, commonTable, symbolTables); // check for task if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTask, source, + success &= InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTask, source, infoSink, commonTable, symbolTables); - return true; + return success; } bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, @@ -398,7 +404,8 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf return false; builtInParseables->initialize(*resources, version, profile, spvVersion, language); - InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, language, source, infoSink, symbolTable); + if (!InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, language, source, infoSink, symbolTable)) + return false; builtInParseables->identifyBuiltIns(version, profile, spvVersion, language, symbolTable, *resources); return true; @@ -416,20 +423,24 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf // This only gets done the first time any thread needs a particular symbol table // (lazy evaluation). // -void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& spvVersion, EShSource source) +bool SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& spvVersion, EShSource source) { TInfoSink infoSink; + bool success; // Make sure only one thread tries to do this at a time +#ifndef DISABLE_THREAD_SUPPORT const std::lock_guard lock(init_lock); +#endif // See if it's already been done for this version/profile combination int versionIndex = MapVersionToIndex(version); int spvVersionIndex = MapSpvVersionToIndex(spvVersion); int profileIndex = MapProfileToIndex(profile); int sourceIndex = MapSourceToIndex(source); - if (CommonSymbolTable[versionIndex][spvVersionIndex][profileIndex][sourceIndex][EPcGeneral]) - return; + if (CommonSymbolTable[versionIndex][spvVersionIndex][profileIndex][sourceIndex][EPcGeneral]) { + return true; + } // Switch to a new pool TPoolAllocator& previousAllocator = GetThreadPoolAllocator(); @@ -445,7 +456,10 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp stageTables[stage] = new TSymbolTable; // Generate the local symbol tables using the new pool - InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spvVersion, source); + if (!InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spvVersion, source)) { + success = false; + goto cleanup; + } // Switch to the process-global pool SetThreadPoolAllocator(PerProcessGPA); @@ -467,7 +481,9 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp SharedSymbolTables[versionIndex][spvVersionIndex][profileIndex][sourceIndex][stage]->readOnly(); } } + success = true; +cleanup: // Clean up the local tables before deleting the pool they used. for (int precClass = 0; precClass < EPcCount; ++precClass) delete commonTable[precClass]; @@ -476,6 +492,8 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp delete builtInPoolAllocator; SetThreadPoolAllocator(&previousAllocator); + + return success; } // Function to Print all builtins @@ -634,6 +652,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo infoSink.info.message(EPrefixError, "#version: mesh/task shaders require es profile with version 320 or above, or non-es profile with version 450 or above"); version = profile == EEsProfile ? 320 : 450; } + break; default: break; } @@ -788,7 +807,7 @@ bool ProcessDeferred( // set version/profile to defaultVersion/defaultProfile regardless of the #version // directive in the source code bool forceDefaultVersionAndProfile, - int overrideVersion, // overrides version specified by #verison or default version + int overrideVersion, // overrides version specified by #version or default version bool forwardCompatible, // give errors for use of deprecated features EShMessages messages, // warnings/errors/AST; things to print out TIntermediate& intermediate, // returned tree, etc. @@ -796,7 +815,8 @@ bool ProcessDeferred( bool requireNonempty, TShader::Includer& includer, const std::string sourceEntryPointName = "", - const TEnvironment* environment = nullptr) // optional way of fully setting all versions, overriding the above + const TEnvironment* environment = nullptr, // optional way of fully setting all versions, overriding the above + bool compileOnly = false) { // This must be undone (.pop()) by the caller, after it finishes consuming the created tree. GetThreadPoolAllocator().push(); @@ -909,7 +929,9 @@ bool ProcessDeferred( intermediate.addSourceText(strings[numPre + s], lengths[numPre + s]); } } - SetupBuiltinSymbolTable(version, profile, spvVersion, source); + if (!SetupBuiltinSymbolTable(version, profile, spvVersion, source)) { + return false; + } TSymbolTable* cachedTable = SharedSymbolTables[MapVersionToIndex(version)] [MapSpvVersionToIndex(spvVersion)] @@ -942,6 +964,7 @@ bool ProcessDeferred( std::unique_ptr parseContext(CreateParseContext(*symbolTable, intermediate, version, profile, source, stage, compiler->infoSink, spvVersion, forwardCompatible, messages, false, sourceEntryPointName)); + parseContext->compileOnly = compileOnly; TPpContext ppContext(*parseContext, names[numPre] ? names[numPre] : "", includer); // only GLSL (bison triggered, really) needs an externally set scan context @@ -1066,8 +1089,8 @@ struct DoPreprocessing { EShOptimizationLevel, EShMessages) { // This is a list of tokens that do not require a space before or after. - static const std::string unNeededSpaceTokens = ";()[]"; - static const std::string noSpaceBeforeTokens = ","; + static const std::string noNeededSpaceBeforeTokens = ";)[].,"; + static const std::string noNeededSpaceAfterTokens = ".(["; glslang::TPpToken ppToken; parseContext.setScanner(&input); @@ -1140,6 +1163,7 @@ struct DoPreprocessing { }); int lastToken = EndOfInput; // lastToken records the last token processed. + std::string lastTokenName; do { int token = ppContext.tokenize(ppToken); if (token == EndOfInput) @@ -1158,12 +1182,23 @@ struct DoPreprocessing { // Output a space in between tokens, but not at the start of a line, // and also not around special tokens. This helps with readability // and consistency. - if (!isNewString && !isNewLine && lastToken != EndOfInput && - (unNeededSpaceTokens.find((char)token) == std::string::npos) && - (unNeededSpaceTokens.find((char)lastToken) == std::string::npos) && - (noSpaceBeforeTokens.find((char)token) == std::string::npos)) { - outputBuffer += ' '; + if (!isNewString && !isNewLine && lastToken != EndOfInput) { + // left parenthesis need a leading space, except it is in a function-call-like context. + // examples: `for (xxx)`, `a * (b + c)`, `vec(2.0)`, `foo(x, y, z)` + if (token == '(') { + if (lastToken != PpAtomIdentifier || + lastTokenName == "if" || + lastTokenName == "for" || + lastTokenName == "while" || + lastTokenName == "switch") + outputBuffer += ' '; + } else if ((noNeededSpaceBeforeTokens.find((char)token) == std::string::npos) && + (noNeededSpaceAfterTokens.find((char)lastToken) == std::string::npos)) { + outputBuffer += ' '; + } } + if (token == PpAtomIdentifier) + lastTokenName = ppToken.name; lastToken = token; if (token == PpAtomConstString) outputBuffer += "\""; @@ -1279,14 +1314,15 @@ bool CompileDeferred( TIntermediate& intermediate,// returned tree, etc. TShader::Includer& includer, const std::string sourceEntryPointName = "", - TEnvironment* environment = nullptr) + TEnvironment* environment = nullptr, + bool compileOnly = false) { DoFullParse parser; return ProcessDeferred(compiler, shaderStrings, numStrings, inputLengths, stringNames, preamble, optLevel, resources, defaultVersion, defaultProfile, forceDefaultVersionAndProfile, overrideVersion, forwardCompatible, messages, intermediate, parser, - true, includer, sourceEntryPointName, environment); + true, includer, sourceEntryPointName, environment, compileOnly); } } // end anonymous namespace for local functions @@ -1296,20 +1332,14 @@ bool CompileDeferred( // int ShInitialize() { - if (! InitProcess()) - return 0; - +#ifndef DISABLE_THREAD_SUPPORT const std::lock_guard lock(init_lock); +#endif ++NumberOfClients; if (PerProcessGPA == nullptr) PerProcessGPA = new TPoolAllocator(); - glslang::TScanContext::fillInKeywordMap(); -#ifdef ENABLE_HLSL - glslang::HlslScanContext::fillInKeywordMap(); -#endif - return 1; } @@ -1318,31 +1348,22 @@ int ShInitialize() // objects. // -ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions) +ShHandle ShConstructCompiler(const EShLanguage language, int /*debugOptions unused*/) { - if (!InitThread()) - return nullptr; - - TShHandleBase* base = static_cast(ConstructCompiler(language, debugOptions)); + TShHandleBase* base = static_cast(ConstructCompiler(language, 0)); return reinterpret_cast(base); } -ShHandle ShConstructLinker(const EShExecutable executable, int debugOptions) +ShHandle ShConstructLinker(const EShExecutable executable, int /*debugOptions unused*/) { - if (!InitThread()) - return nullptr; - - TShHandleBase* base = static_cast(ConstructLinker(executable, debugOptions)); + TShHandleBase* base = static_cast(ConstructLinker(executable, 0)); return reinterpret_cast(base); } ShHandle ShConstructUniformMap() { - if (!InitThread()) - return nullptr; - TShHandleBase* base = static_cast(ConstructUniformMap()); return reinterpret_cast(base); @@ -1368,7 +1389,9 @@ void ShDestruct(ShHandle handle) // int ShFinalize() { +#ifndef DISABLE_THREAD_SUPPORT const std::lock_guard lock(init_lock); +#endif --NumberOfClients; assert(NumberOfClients >= 0); if (NumberOfClients > 0) @@ -1405,11 +1428,6 @@ int ShFinalize() PerProcessGPA = nullptr; } - glslang::TScanContext::deleteKeywordMap(); -#ifdef ENABLE_HLSL - glslang::HlslScanContext::deleteKeywordMap(); -#endif - return 1; } @@ -1431,7 +1449,8 @@ int ShCompile( int /*debugOptions*/, int defaultVersion, // use 100 for ES environment, 110 for desktop bool forwardCompatible, // give errors for use of deprecated features - EShMessages messages // warnings/errors/AST; things to print out + EShMessages messages, // warnings/errors/AST; things to print out, + const char *shaderFileName // the filename ) { // Map the generic handle to the C++ object @@ -1447,6 +1466,9 @@ int ShCompile( compiler->infoSink.info.erase(); compiler->infoSink.debug.erase(); + compiler->infoSink.info.setShaderFileName(shaderFileName); + compiler->infoSink.debug.setShaderFileName(shaderFileName); + TIntermediate intermediate(compiler->getLanguage()); TShader::ForbidIncluder includer; @@ -1710,6 +1732,10 @@ class TDeferredCompiler : public TCompiler { virtual bool compile(TIntermNode*, int = 0, EProfile = ENoProfile) { return true; } }; +TIoMapper* GetGlslIoMapper() { + return static_cast(new TGlslIoMapper()); +} + TShader::TShader(EShLanguage s) : stage(s), lengths(nullptr), stringNames(nullptr), preamble(""), overrideVersion(0) { @@ -1842,6 +1868,9 @@ void TShader::setGlobalUniformBinding(unsigned int binding) { intermediate->setG void TShader::setAtomicCounterBlockName(const char* name) { intermediate->setAtomicCounterBlockName(name); } void TShader::setAtomicCounterBlockSet(unsigned int set) { intermediate->setAtomicCounterBlockSet(set); } +void TShader::addSourceText(const char* text, size_t len) { intermediate->addSourceText(text, len); } +void TShader::setSourceFile(const char* file) { intermediate->setSourceFile(file); } + #ifdef ENABLE_HLSL // See comment above TDefaultHlslIoMapper in iomapper.cpp: void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); } @@ -1856,8 +1885,6 @@ void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlatt bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, bool forwardCompatible, EShMessages messages, Includer& includer) { - if (! InitThread()) - return false; SetThreadPoolAllocator(pool); if (! preamble) @@ -1867,7 +1894,7 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion preamble, EShOptNone, builtInResources, defaultVersion, defaultProfile, forceDefaultVersionAndProfile, overrideVersion, forwardCompatible, messages, *intermediate, includer, sourceEntryPointName, - &environment); + &environment, compileOnly); } // Fill in a string with the result of preprocessing ShaderStrings @@ -1882,8 +1909,6 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources, std::string* output_string, Includer& includer) { - if (! InitThread()) - return false; SetThreadPoolAllocator(pool); if (! preamble) @@ -2030,7 +2055,7 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages) // // Return true if no errors. // -bool TProgram::crossStageCheck(EShMessages) { +bool TProgram::crossStageCheck(EShMessages messages) { // make temporary intermediates to hold the linkage symbols for each linking interface // while we do the checks @@ -2085,6 +2110,13 @@ bool TProgram::crossStageCheck(EShMessages) { error |= (activeStages[i - 1]->getNumErrors() != 0); } + // if requested, optimize cross stage IO + if (messages & EShMsgLinkTimeOptimization) { + for (unsigned int i = 1; i < activeStages.size(); ++i) { + activeStages[i - 1]->optimizeStageIO(*infoSink, *activeStages[i]); + } + } + return !error; } @@ -2102,11 +2134,15 @@ const char* TProgram::getInfoDebugLog() // Reflection implementation. // +unsigned int TObjectReflection::layoutLocation() const { return type->getQualifier().layoutLocation; } + bool TProgram::buildReflection(int opts) { if (! linked || reflection != nullptr) return false; + SetThreadPoolAllocator(pool); + int firstStage = EShLangVertex, lastStage = EShLangFragment; if (opts & EShReflectionIntermediateIO) { @@ -2155,6 +2191,12 @@ int TProgram::getNumAtomicCounters() const { return r const TObjectReflection& TProgram::getAtomicCounter(int index) const { return reflection->getAtomicCounter(index); } void TProgram::dumpReflection() { if (reflection != nullptr) reflection->dump(); } +TIoMapResolver* TProgram::getGlslIoResolver(EShLanguage stage) { + auto *intermediate = getIntermediate(stage); + if (!intermediate) + return NULL; + return static_cast(new TDefaultGlslIoResolver(*intermediate)); +} // // I/O mapping implementation. // @@ -2162,6 +2204,9 @@ bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper) { if (! linked) return false; + + SetThreadPoolAllocator(pool); + TIoMapper* ioMapper = nullptr; TIoMapper defaultIOMapper; if (pIoMapper == nullptr) diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp index 4e130c31..1d08797a 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp @@ -45,11 +45,11 @@ namespace glslang { bool TSpirvTypeParameter::operator==(const TSpirvTypeParameter& rhs) const { - if (constant != nullptr) - return constant->getConstArray() == rhs.constant->getConstArray(); + if (getAsConstant() != nullptr) + return getAsConstant()->getConstArray() == rhs.getAsConstant()->getConstArray(); - assert(type != nullptr); - return *type == *rhs.type; + assert(getAsType() != nullptr); + return *getAsType() == *rhs.getAsType(); } // diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp index 1e007a71..b6edb469 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -149,6 +149,7 @@ void TType::buildMangledName(TString& mangledName) const mangledName += '-'; (*structure)[i].type->buildMangledName(mangledName); } + break; default: break; } @@ -168,7 +169,7 @@ void TType::buildMangledName(TString& mangledName) const if (arraySizes->getDimNode(i)->getAsSymbolNode()) snprintf(buf, maxSize, "s%lld", arraySizes->getDimNode(i)->getAsSymbolNode()->getId()); else - snprintf(buf, maxSize, "s%p", arraySizes->getDimNode(i)); + snprintf(buf, maxSize, "s%p", (void*)(arraySizes->getDimNode(i))); } else snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i)); mangledName += '['; @@ -318,6 +319,16 @@ void TSymbolTableLevel::setFunctionExtensions(const char* name, int num, const c } } +// Make a single function require an extension(s). i.e., this will only set the extensions for the symbol that matches 'name' exactly. +// This is different from setFunctionExtensions, which uses std::map::lower_bound to effectively set all symbols that start with 'name'. +// Should only be used for a version/profile that actually needs the extension(s). +void TSymbolTableLevel::setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]) +{ + if (auto candidate = level.find(name); candidate != level.end()) { + candidate->second->setExtensions(num, extensions); + } +} + // // Make all symbols in this table level read only. // diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h index fc86ad62..94c3929d 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h @@ -246,7 +246,8 @@ class TFunction : public TSymbol { TSymbol(name), mangledName(*name + '('), op(tOp), - defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0) + defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0), + linkType(ELinkNone) { returnType.shallowCopy(retType); declaredBuiltIn = retType.getQualifier().builtIn; @@ -326,6 +327,9 @@ class TFunction : public TSymbol { virtual void dump(TInfoSink& infoSink, bool complete = false) const override; + void setExport() { linkType = ELinkExport; } + TLinkType getLinkType() const { return linkType; } + protected: explicit TFunction(const TFunction&); TFunction& operator=(const TFunction&); @@ -347,6 +351,7 @@ class TFunction : public TSymbol { int defaultParamCount; TSpirvInstruction spirvInst; // SPIR-V instruction qualifiers + TLinkType linkType; }; // @@ -571,6 +576,7 @@ class TSymbolTableLevel { void relateToOperator(const char* name, TOperator op); void setFunctionExtensions(const char* name, int num, const char* const extensions[]); + void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]); void dump(TInfoSink& infoSink, bool complete = false) const; TSymbolTableLevel* clone() const; void readOnly(); @@ -872,6 +878,12 @@ class TSymbolTable { table[level]->setFunctionExtensions(name, num, extensions); } + void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]) + { + for (unsigned int level = 0; level < table.size(); ++level) + table[level]->setSingleFunctionExtensions(name, num, extensions); + } + void setVariableExtensions(const char* name, int numExts, const char* const extensions[]) { TSymbol* symbol = find(TString(name)); diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp index 38cbf3e1..0262c54d 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. -// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2017, 2022-2024 Arm Limited. // Copyright (C) 2015-2020 Google, Inc. // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // @@ -235,6 +235,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_KHR_shader_subgroup_ballot] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_shuffle] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_shuffle_relative] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_rotate] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_clustered] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_quad] = EBhDisable; extensionBehavior[E_GL_KHR_memory_scope_semantics] = EBhDisable; @@ -258,14 +259,20 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_shader_16bit_storage] = EBhDisable; extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable; extensionBehavior[E_GL_EXT_subgroup_uniform_control_flow] = EBhDisable; + extensionBehavior[E_GL_EXT_maximal_reconvergence] = EBhDisable; extensionBehavior[E_GL_EXT_fragment_shader_barycentric] = EBhDisable; + extensionBehavior[E_GL_EXT_expect_assume] = EBhDisable; + + extensionBehavior[E_GL_EXT_control_flow_attributes2] = EBhDisable; + extensionBehavior[E_GL_EXT_spec_constant_composites] = EBhDisable; extensionBehavior[E_GL_KHR_cooperative_matrix] = EBhDisable; // #line and #include extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable; extensionBehavior[E_GL_GOOGLE_include_directive] = EBhDisable; + extensionBehavior[E_GL_ARB_shading_language_include] = EBhDisable; extensionBehavior[E_GL_AMD_shader_ballot] = EBhDisable; extensionBehavior[E_GL_AMD_shader_trinary_minmax] = EBhDisable; @@ -297,18 +304,19 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable; extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable; extensionBehavior[E_GL_NV_mesh_shader] = EBhDisable; - extensionBehavior[E_GL_NV_cooperative_matrix] = EBhDisable; extensionBehavior[E_GL_NV_shader_sm_builtins] = EBhDisable; extensionBehavior[E_GL_NV_integer_cooperative_matrix] = EBhDisable; - extensionBehavior[E_GL_NV_shader_invocation_reorder] = EBhDisable; + extensionBehavior[E_GL_NV_displacement_micromap] = EBhDisable; + extensionBehavior[E_GL_NV_shader_atomic_fp16_vector] = EBhDisable; // ARM extensionBehavior[E_GL_ARM_shader_core_builtins] = EBhDisable; // QCOM extensionBehavior[E_GL_QCOM_image_processing] = EBhDisable; + extensionBehavior[E_GL_QCOM_image_processing2] = EBhDisable; // AEP extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable; @@ -357,8 +365,12 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_spirv_intrinsics] = EBhDisable; extensionBehavior[E_GL_EXT_mesh_shader] = EBhDisable; extensionBehavior[E_GL_EXT_opacity_micromap] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_quad_control] = EBhDisable; extensionBehavior[E_GL_EXT_ray_tracing_position_fetch] = EBhDisable; extensionBehavior[E_GL_EXT_shader_tile_image] = EBhDisable; + extensionBehavior[E_GL_EXT_texture_shadow_lod] = EBhDisable; + extensionBehavior[E_GL_EXT_draw_instanced] = EBhDisable; + extensionBehavior[E_GL_EXT_texture_array] = EBhDisable; // OVR extensions extensionBehavior[E_GL_OVR_multiview] = EBhDisable; @@ -436,6 +448,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_shader_non_constant_global_initializers 1\n" "#define GL_QCOM_image_processing 1\n" + "#define GL_QCOM_image_processing2 1\n" ; if (version >= 300) { @@ -444,6 +457,7 @@ void TParseVersions::getPreamble(std::string& preamble) if (version >= 310) { preamble += "#define GL_EXT_null_initializer 1\n"; preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n"; + preamble += "#define GL_EXT_maximal_reconvergence 1\n"; } } else { // !isEsProfile() @@ -487,7 +501,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_ARB_vertex_attrib_64bit 1\n" "#define GL_ARB_draw_instanced 1\n" "#define GL_ARB_fragment_coord_conventions 1\n" - "#define GL_ARB_bindless_texture 1\n" + "#define GL_EXT_shader_non_constant_global_initializers 1\n" "#define GL_EXT_shader_image_load_formatted 1\n" "#define GL_EXT_post_depth_coverage 1\n" @@ -506,6 +520,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_fragment_shading_rate 1\n" "#define GL_EXT_shared_memory_block 1\n" "#define GL_EXT_shader_integer_mix 1\n" + "#define GL_EXT_spec_constant_composites 1\n" // GL_KHR_shader_subgroup "#define GL_KHR_shader_subgroup_basic 1\n" @@ -561,6 +576,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_NV_shader_invocation_reorder 1\n" "#define GL_QCOM_image_processing 1\n" + "#define GL_QCOM_image_processing2 1\n" "#define GL_EXT_shader_explicit_arithmetic_types 1\n" "#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n" @@ -580,8 +596,16 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_shader_atomic_float2 1\n" "#define GL_EXT_fragment_shader_barycentric 1\n" + "#define GL_EXT_shader_quad_control 1\n" + "#define GL_EXT_texture_array 1\n" + + "#define GL_EXT_control_flow_attributes2 1\n" ; + if (spvVersion.spv == 0) { + preamble += "#define GL_ARB_bindless_texture 1\n"; + } + if (version >= 150) { // define GL_core_profile and GL_compatibility_profile preamble += "#define GL_core_profile 1\n"; @@ -592,6 +616,7 @@ void TParseVersions::getPreamble(std::string& preamble) if (version >= 140) { preamble += "#define GL_EXT_null_initializer 1\n"; preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n"; + preamble += "#define GL_EXT_maximal_reconvergence 1\n"; } if (version >= 130) { preamble +="#define GL_FRAGMENT_PRECISION_HIGH 1\n"; @@ -750,8 +775,8 @@ void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int for (int i = 0; i < numExtensions; ++i) { switch (getExtensionBehavior(extensions[i])) { case EBhWarn: - infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc); - // fall through + infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + [[fallthrough]]; case EBhRequire: case EBhEnable: okay = true; @@ -788,7 +813,8 @@ void TParseVersions::checkDeprecated(const TSourceLoc& loc, int profileMask, int error(loc, "deprecated, may be removed in future release", featureDesc, ""); else if (! suppressWarnings()) infoSink.info.message(EPrefixWarning, (TString(featureDesc) + " deprecated in version " + - String(depVersion) + "; may be removed in future release").c_str(), loc); + String(depVersion) + "; may be removed in future release").c_str(), + loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); } } } @@ -825,11 +851,14 @@ bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExte for (int i = 0; i < numExtensions; ++i) { TExtensionBehavior behavior = getExtensionBehavior(extensions[i]); if (behavior == EBhDisable && relaxedErrors()) { - infoSink.info.message(EPrefixWarning, "The following extension must be enabled to use this feature:", loc); + infoSink.info.message(EPrefixWarning, "The following extension must be enabled to use this feature:", loc, + messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); behavior = EBhWarn; } if (behavior == EBhWarn) { - infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc); + infoSink.info.message(EPrefixWarning, + ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), + loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); warned = true; } } @@ -968,6 +997,8 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co updateExtensionBehavior(line, "GL_OES_shader_io_blocks", behaviorString); else if (strcmp(extension, "GL_GOOGLE_include_directive") == 0) updateExtensionBehavior(line, "GL_GOOGLE_cpp_style_line_directive", behaviorString); + else if (strcmp(extension, "GL_ARB_shading_language_include") == 0) + updateExtensionBehavior(line, "GL_GOOGLE_cpp_style_line_directive", behaviorString); // subgroup_* to subgroup_basic else if (strcmp(extension, "GL_KHR_shader_subgroup_vote") == 0) updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h old mode 100755 new mode 100644 index 564995b2..75a82377 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. -// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2017, 2022-2024 Arm Limited. // Copyright (C) 2015-2018 Google, Inc. // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // @@ -171,6 +171,7 @@ const char* const E_GL_KHR_shader_subgroup_arithmetic = "GL_KHR_shader_sub 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"; @@ -215,6 +216,13 @@ const char* const E_GL_EXT_spirv_intrinsics = "GL_EXT_spirv_intr 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"; // Arrays of extensions for the above viewportEXTs duplications @@ -235,6 +243,7 @@ const int Num_OVR_multiview_EXTs = sizeof(OVR_multiview_EXTs) / sizeof(OVR_multi // #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"; @@ -266,7 +275,13 @@ const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragmen 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"; // ARM const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins"; @@ -276,12 +291,9 @@ const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader 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_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_QCOM_image_processing = "GL_QCOM_image_processing"; +const char* const E_GL_QCOM_image_processing2 = "GL_QCOM_image_processing2"; // AEP const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a"; @@ -333,6 +345,8 @@ 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"; + // Arrays of extensions for the above AEP duplications const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader }; diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp index 21ef7368..19e8faac 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/attribute.cpp @@ -123,6 +123,10 @@ TAttributeType TParseContext::attributeFromName(const TString& name) const return EatPartialCount; else if (name == "subgroup_uniform_control_flow") return EatSubgroupUniformControlFlow; + else if (name == "export") + return EatExport; + else if (name == "maximally_reconverges") + return EatMaximallyReconverges; else return EatNone; } @@ -355,8 +359,13 @@ void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttri switch (it->name) { case EatSubgroupUniformControlFlow: + requireExtensions(loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); intermediate.setSubgroupUniformControlFlow(); break; + case EatMaximallyReconverges: + requireExtensions(loc, 1, &E_GL_EXT_maximal_reconvergence, "attribute"); + intermediate.setMaximallyReconverges(); + break; default: warn(loc, "attribute does not apply to a function", "", ""); break; diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/attribute.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/attribute.h index c5b29176..3b480c6f 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/attribute.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/attribute.h @@ -120,6 +120,8 @@ namespace glslang { EatNonWritable, EatNonReadable, EatSubgroupUniformControlFlow, + EatExport, + EatMaximallyReconverges, }; class TIntermAggregate; diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y b/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y index d47f2925..35686fbc 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y @@ -110,13 +110,6 @@ using namespace glslang; %{ -/* windows only pragma */ -#ifdef _MSC_VER - #pragma warning(disable : 4065) - #pragma warning(disable : 4127) - #pragma warning(disable : 4244) -#endif - #define parseContext (*pParseContext) #define yyerror(context, msg) context->parserError(msg) @@ -492,18 +485,44 @@ function_call_header_no_parameters function_call_header_with_parameters : function_call_header assignment_expression { - TParameter param = { 0, new TType }; - param.type->shallowCopy($2->getType()); - $1.function->addParameter(param); - $$.function = $1.function; - $$.intermNode = $2; + if (parseContext.spvVersion.vulkan > 0 + && parseContext.spvVersion.vulkanRelaxed + && $2->getType().containsOpaque()) + { + $$.intermNode = parseContext.vkRelaxedRemapFunctionArgument($$.loc, $1.function, $2); + $$.function = $1.function; + } + else + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy($2->getType()); + + $1.function->addParameter(param); + $$.function = $1.function; + $$.intermNode = $2; + } } | function_call_header_with_parameters COMMA assignment_expression { - TParameter param = { 0, new TType }; - param.type->shallowCopy($3->getType()); - $1.function->addParameter(param); - $$.function = $1.function; - $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.loc); + if (parseContext.spvVersion.vulkan > 0 + && parseContext.spvVersion.vulkanRelaxed + && $3->getType().containsOpaque()) + { + TIntermNode* remappedNode = parseContext.vkRelaxedRemapFunctionArgument($2.loc, $1.function, $3); + if (remappedNode == $3) + $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.loc); + else + $$.intermNode = parseContext.intermediate.mergeAggregate($1.intermNode, remappedNode, $2.loc); + $$.function = $1.function; + } + else + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy($3->getType()); + + $1.function->addParameter(param); + $$.function = $1.function; + $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.loc); + } } ; @@ -941,24 +960,31 @@ identifier_list function_prototype : function_declarator RIGHT_PAREN { $$.function = $1; + if (parseContext.compileOnly) $$.function->setExport(); $$.loc = $2.loc; } | function_declarator RIGHT_PAREN attribute { $$.function = $1; + if (parseContext.compileOnly) $$.function->setExport(); $$.loc = $2.loc; - parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions($2.loc, 2, extensions, "attribute"); parseContext.handleFunctionAttributes($2.loc, *$3); } | attribute function_declarator RIGHT_PAREN { $$.function = $2; + if (parseContext.compileOnly) $$.function->setExport(); $$.loc = $3.loc; - parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions($3.loc, 2, extensions, "attribute"); parseContext.handleFunctionAttributes($3.loc, *$1); } | attribute function_declarator RIGHT_PAREN attribute { $$.function = $2; + if (parseContext.compileOnly) $$.function->setExport(); $$.loc = $3.loc; - parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions($3.loc, 2, extensions, "attribute"); parseContext.handleFunctionAttributes($3.loc, *$1); parseContext.handleFunctionAttributes($3.loc, *$4); } @@ -979,7 +1005,12 @@ function_header_with_parameters // Add the parameter $$ = $1; if ($2.param.type->getBasicType() != EbtVoid) - $1->addParameter($2.param); + { + if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed)) + $1->addParameter($2.param); + else + parseContext.vkRelaxedRemapFunctionParameter($1, $2.param); + } else delete $2.param.type; } @@ -997,7 +1028,10 @@ function_header_with_parameters } else { // Add the parameter $$ = $1; - $1->addParameter($3.param); + if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed)) + $1->addParameter($3.param); + else + parseContext.vkRelaxedRemapFunctionParameter($1, $3.param); } } ; @@ -1037,7 +1071,7 @@ parameter_declarator } parseContext.reservedErrorCheck($2.loc, *$2.string); - TParameter param = {$2.string, new TType($1)}; + TParameter param = {$2.string, new TType($1), {}}; $$.loc = $2.loc; $$.param = param; } @@ -1055,7 +1089,7 @@ parameter_declarator parseContext.arraySizeRequiredCheck($3.loc, *$3.arraySizes); parseContext.reservedErrorCheck($2.loc, *$2.string); - TParameter param = { $2.string, type }; + TParameter param = { $2.string, type, {} }; $$.loc = $2.loc; $$.param = param; @@ -1108,7 +1142,7 @@ parameter_declaration parameter_type_specifier : type_specifier { - TParameter param = { 0, new TType($1) }; + TParameter param = { 0, new TType($1), {} }; $$.param = param; if ($1.arraySizes) parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); @@ -1725,6 +1759,7 @@ type_parameter_specifier_list : type_specifier { $$ = new TTypeParameters; $$->arraySizes = new TArraySizes; + $$->spirvType = $1.spirvType; $$->basicType = $1.basicType; } | unary_expression { @@ -3548,11 +3583,17 @@ precision_qualifier struct_specifier : STRUCT IDENTIFIER LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE { + TType* structure = new TType($5, *$2.string); parseContext.structArrayCheck($2.loc, *structure); + TVariable* userTypeDef = new TVariable($2.string, *structure, true); if (! parseContext.symbolTable.insert(*userTypeDef)) parseContext.error($2.loc, "redefinition", $2.string->c_str(), "struct"); + else if (parseContext.spvVersion.vulkanRelaxed + && structure->containsOpaque()) + parseContext.relaxedSymbols.push_back(structure->getTypeName()); + $$.init($1.loc); $$.basicType = EbtStruct; $$.userDef = structure; @@ -3732,8 +3773,10 @@ compound_statement --parseContext.statementNestingLevel; } RIGHT_BRACE { - if ($3 && $3->getAsAggregate()) + if ($3 && $3->getAsAggregate()) { $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); + $3->getAsAggregate()->setEndLoc($5.loc); + } $$ = $3; } ; @@ -3769,8 +3812,10 @@ compound_statement_no_new_scope $$ = 0; } | LEFT_BRACE statement_list RIGHT_BRACE { - if ($2 && $2->getAsAggregate()) + if ($2 && $2->getAsAggregate()) { $2->getAsAggregate()->setOperator(EOpSequence); + $2->getAsAggregate()->setEndLoc($3.loc); + } $$ = $2; } ; @@ -3913,7 +3958,8 @@ iteration_statement $$ = $1; } | attribute iteration_statement_nonattributed { - parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); + const char * extensions[2] = { E_GL_EXT_control_flow_attributes, E_GL_EXT_control_flow_attributes2 }; + parseContext.requireExtensions($2->getLoc(), 2, extensions, "attribute"); parseContext.handleLoopAttributes(*$1, $2); $$ = $2; } @@ -4088,6 +4134,7 @@ function_definition parseContext.error($1.loc, "function does not return a value:", "", $1.function->getName().c_str()); parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); $$ = parseContext.intermediate.growAggregate($1.intermNode, $3); + $$->getAsAggregate()->setLinkType($1.function->getLinkType()); parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc); $$->getAsAggregate()->setName($1.function->getMangledName().c_str()); diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp index a265abc8..77571b94 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -67,7 +67,7 @@ /* First part of user prologue. */ -#line 69 "MachineIndependent/glslang.y" +#line 44 "MachineIndependent/glslang.y" /* Based on: @@ -723,23 +723,16 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; /* Second part of user prologue. */ -#line 136 "MachineIndependent/glslang.y" +#line 111 "MachineIndependent/glslang.y" -/* windows only pragma */ -#ifdef _MSC_VER - #pragma warning(disable : 4065) - #pragma warning(disable : 4127) - #pragma warning(disable : 4244) -#endif - #define parseContext (*pParseContext) #define yyerror(context, msg) context->parserError(msg) extern int yylex(YYSTYPE*, TParseContext&); -#line 743 "MachineIndependent/glslang_tab.cpp" +#line 736 "MachineIndependent/glslang_tab.cpp" #ifdef short @@ -1167,77 +1160,77 @@ static const yytype_int16 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 395, 395, 401, 404, 409, 412, 415, 419, 423, - 426, 430, 434, 438, 442, 446, 450, 456, 464, 467, - 470, 473, 476, 481, 489, 496, 503, 509, 513, 520, - 523, 529, 536, 546, 554, 559, 587, 596, 602, 606, - 610, 630, 631, 632, 633, 639, 640, 645, 650, 659, - 660, 665, 673, 674, 680, 689, 690, 695, 700, 705, - 713, 714, 723, 735, 736, 745, 746, 755, 756, 765, - 766, 774, 775, 783, 784, 792, 793, 793, 811, 812, - 828, 832, 836, 840, 845, 849, 853, 857, 861, 865, - 869, 876, 879, 890, 897, 903, 910, 916, 921, 928, - 932, 936, 940, 945, 950, 959, 959, 970, 974, 981, - 985, 991, 997, 1007, 1010, 1017, 1025, 1045, 1068, 1083, - 1108, 1119, 1129, 1139, 1149, 1158, 1161, 1165, 1169, 1174, - 1182, 1189, 1194, 1199, 1204, 1213, 1223, 1250, 1259, 1266, - 1274, 1281, 1288, 1296, 1304, 1314, 1324, 1331, 1342, 1348, - 1351, 1358, 1362, 1366, 1375, 1385, 1388, 1399, 1402, 1405, - 1409, 1413, 1418, 1422, 1425, 1430, 1434, 1439, 1448, 1452, - 1457, 1463, 1469, 1476, 1481, 1486, 1494, 1500, 1512, 1526, - 1532, 1537, 1545, 1553, 1561, 1569, 1577, 1585, 1593, 1601, - 1609, 1616, 1623, 1627, 1632, 1637, 1642, 1647, 1652, 1657, - 1661, 1665, 1669, 1673, 1679, 1685, 1697, 1704, 1707, 1716, - 1723, 1734, 1739, 1747, 1751, 1761, 1764, 1770, 1776, 1781, - 1789, 1799, 1803, 1807, 1811, 1816, 1820, 1825, 1830, 1835, - 1840, 1845, 1850, 1855, 1860, 1865, 1871, 1877, 1883, 1888, - 1893, 1898, 1903, 1908, 1913, 1918, 1923, 1928, 1933, 1938, - 1944, 1951, 1956, 1961, 1966, 1971, 1976, 1981, 1986, 1991, - 1996, 2001, 2006, 2014, 2022, 2030, 2036, 2042, 2048, 2054, - 2060, 2066, 2072, 2078, 2084, 2090, 2096, 2102, 2108, 2114, - 2120, 2126, 2132, 2138, 2144, 2150, 2156, 2162, 2168, 2174, - 2180, 2186, 2192, 2198, 2204, 2210, 2216, 2222, 2228, 2236, - 2244, 2252, 2260, 2268, 2276, 2284, 2292, 2300, 2308, 2316, - 2324, 2330, 2336, 2342, 2348, 2354, 2360, 2366, 2372, 2378, - 2384, 2390, 2396, 2402, 2408, 2414, 2420, 2426, 2432, 2438, - 2444, 2450, 2456, 2462, 2468, 2474, 2480, 2486, 2492, 2498, - 2504, 2510, 2516, 2522, 2528, 2534, 2540, 2544, 2548, 2552, - 2557, 2563, 2568, 2573, 2578, 2583, 2588, 2593, 2599, 2604, - 2609, 2614, 2619, 2624, 2630, 2636, 2642, 2648, 2654, 2660, - 2666, 2672, 2678, 2684, 2690, 2696, 2702, 2708, 2713, 2718, - 2723, 2728, 2733, 2738, 2744, 2749, 2754, 2759, 2764, 2769, - 2774, 2779, 2785, 2790, 2795, 2800, 2805, 2810, 2815, 2820, - 2825, 2830, 2835, 2840, 2845, 2850, 2855, 2861, 2866, 2871, - 2877, 2883, 2888, 2893, 2898, 2904, 2909, 2914, 2919, 2925, - 2930, 2935, 2940, 2946, 2951, 2956, 2961, 2967, 2973, 2979, - 2985, 2990, 2996, 3002, 3008, 3013, 3018, 3023, 3028, 3033, - 3039, 3044, 3049, 3054, 3060, 3065, 3070, 3075, 3081, 3086, - 3091, 3096, 3102, 3107, 3112, 3117, 3123, 3128, 3133, 3138, - 3144, 3149, 3154, 3159, 3165, 3170, 3175, 3180, 3186, 3191, - 3196, 3201, 3207, 3212, 3217, 3222, 3228, 3233, 3238, 3243, - 3249, 3254, 3259, 3264, 3270, 3275, 3280, 3285, 3291, 3296, - 3301, 3306, 3312, 3317, 3322, 3327, 3333, 3338, 3343, 3348, - 3353, 3358, 3363, 3368, 3373, 3378, 3383, 3388, 3393, 3398, - 3403, 3408, 3413, 3418, 3423, 3428, 3433, 3438, 3443, 3448, - 3453, 3459, 3465, 3471, 3477, 3483, 3489, 3495, 3502, 3509, - 3515, 3521, 3527, 3533, 3540, 3547, 3554, 3561, 3565, 3570, - 3575, 3591, 3596, 3601, 3609, 3609, 3620, 3620, 3630, 3633, - 3646, 3668, 3695, 3699, 3705, 3710, 3721, 3725, 3731, 3737, - 3748, 3751, 3758, 3762, 3763, 3769, 3770, 3771, 3772, 3773, - 3774, 3775, 3777, 3783, 3792, 3793, 3797, 3793, 3809, 3810, - 3814, 3814, 3821, 3821, 3835, 3838, 3846, 3854, 3865, 3866, - 3870, 3874, 3882, 3889, 3893, 3901, 3905, 3918, 3922, 3930, - 3930, 3950, 3953, 3959, 3971, 3983, 3987, 3995, 3995, 4010, - 4010, 4028, 4028, 4049, 4052, 4058, 4061, 4067, 4071, 4078, - 4083, 4088, 4095, 4098, 4102, 4107, 4111, 4121, 4125, 4134, - 4137, 4141, 4150, 4150, 4192, 4197, 4200, 4205, 4208, 4215, - 4218, 4223, 4226, 4231, 4234, 4239, 4242, 4247, 4251, 4256, - 4260, 4265, 4269, 4276, 4279, 4284, 4287, 4290, 4293, 4296, - 4301, 4310, 4321, 4326, 4334, 4338, 4343, 4347, 4352, 4356, - 4361, 4365, 4372, 4375, 4380, 4383, 4386, 4389, 4394, 4397, - 4402, 4408, 4411, 4414, 4417, 4422, 4426, 4431, 4435, 4440, - 4444, 4451, 4454, 4459, 4462, 4467, 4470, 4476, 4479, 4484, - 4487 + 0, 355, 355, 361, 364, 369, 372, 375, 379, 382, + 385, 389, 393, 397, 401, 405, 409, 415, 422, 425, + 428, 431, 434, 439, 447, 454, 461, 467, 471, 478, + 481, 487, 505, 530, 538, 543, 570, 578, 584, 588, + 592, 612, 613, 614, 615, 621, 622, 627, 632, 641, + 642, 647, 655, 656, 662, 671, 672, 677, 682, 687, + 695, 696, 705, 717, 718, 727, 728, 737, 738, 747, + 748, 756, 757, 765, 766, 774, 775, 775, 793, 794, + 810, 814, 818, 822, 827, 831, 835, 839, 843, 847, + 851, 858, 861, 872, 879, 884, 891, 896, 901, 908, + 912, 916, 920, 925, 930, 939, 939, 950, 954, 961, + 966, 974, 982, 994, 997, 1004, 1017, 1040, 1063, 1078, + 1103, 1114, 1124, 1134, 1144, 1153, 1156, 1160, 1164, 1169, + 1177, 1182, 1187, 1192, 1197, 1206, 1216, 1243, 1252, 1259, + 1266, 1273, 1280, 1288, 1296, 1306, 1316, 1323, 1333, 1339, + 1342, 1349, 1353, 1357, 1365, 1374, 1377, 1388, 1391, 1394, + 1398, 1402, 1406, 1410, 1413, 1418, 1422, 1427, 1435, 1439, + 1444, 1450, 1456, 1463, 1468, 1473, 1481, 1486, 1498, 1512, + 1518, 1523, 1531, 1539, 1547, 1555, 1563, 1571, 1579, 1587, + 1595, 1602, 1609, 1613, 1618, 1623, 1628, 1633, 1638, 1643, + 1647, 1651, 1655, 1659, 1665, 1671, 1681, 1688, 1691, 1699, + 1706, 1717, 1722, 1730, 1734, 1744, 1747, 1753, 1759, 1765, + 1773, 1783, 1787, 1791, 1795, 1800, 1804, 1809, 1814, 1819, + 1824, 1829, 1834, 1839, 1844, 1849, 1855, 1861, 1867, 1872, + 1877, 1882, 1887, 1892, 1897, 1902, 1907, 1912, 1917, 1922, + 1927, 1934, 1939, 1944, 1949, 1954, 1959, 1964, 1969, 1974, + 1979, 1984, 1989, 1997, 2005, 2013, 2019, 2025, 2031, 2037, + 2043, 2049, 2055, 2061, 2067, 2073, 2079, 2085, 2091, 2097, + 2103, 2109, 2115, 2121, 2127, 2133, 2139, 2145, 2151, 2157, + 2163, 2169, 2175, 2181, 2187, 2193, 2199, 2205, 2211, 2219, + 2227, 2235, 2243, 2251, 2259, 2267, 2275, 2283, 2291, 2299, + 2307, 2313, 2319, 2325, 2331, 2337, 2343, 2349, 2355, 2361, + 2367, 2373, 2379, 2385, 2391, 2397, 2403, 2409, 2415, 2421, + 2427, 2433, 2439, 2445, 2451, 2457, 2463, 2469, 2475, 2481, + 2487, 2493, 2499, 2505, 2511, 2517, 2523, 2527, 2531, 2535, + 2540, 2545, 2550, 2555, 2560, 2565, 2570, 2575, 2580, 2585, + 2590, 2595, 2600, 2605, 2611, 2617, 2623, 2629, 2635, 2641, + 2647, 2653, 2659, 2665, 2671, 2677, 2683, 2688, 2693, 2698, + 2703, 2708, 2713, 2718, 2723, 2728, 2733, 2738, 2743, 2748, + 2753, 2758, 2763, 2768, 2773, 2778, 2783, 2788, 2793, 2798, + 2803, 2808, 2813, 2818, 2823, 2828, 2833, 2838, 2843, 2848, + 2854, 2860, 2865, 2870, 2875, 2881, 2886, 2891, 2896, 2902, + 2907, 2912, 2917, 2923, 2928, 2933, 2938, 2944, 2950, 2956, + 2962, 2967, 2973, 2979, 2985, 2990, 2995, 3000, 3005, 3010, + 3016, 3021, 3026, 3031, 3037, 3042, 3047, 3052, 3058, 3063, + 3068, 3073, 3079, 3084, 3089, 3094, 3100, 3105, 3110, 3115, + 3121, 3126, 3131, 3136, 3142, 3147, 3152, 3157, 3163, 3168, + 3173, 3178, 3184, 3189, 3194, 3199, 3205, 3210, 3215, 3220, + 3226, 3231, 3236, 3241, 3247, 3252, 3257, 3262, 3268, 3273, + 3278, 3283, 3289, 3294, 3299, 3304, 3310, 3315, 3320, 3325, + 3330, 3335, 3340, 3345, 3350, 3355, 3360, 3365, 3370, 3375, + 3380, 3385, 3390, 3395, 3400, 3405, 3410, 3415, 3420, 3425, + 3430, 3436, 3442, 3448, 3454, 3460, 3466, 3472, 3479, 3486, + 3492, 3498, 3504, 3510, 3517, 3524, 3531, 3538, 3542, 3546, + 3551, 3567, 3572, 3577, 3585, 3585, 3602, 3602, 3612, 3615, + 3628, 3650, 3677, 3681, 3687, 3692, 3703, 3706, 3712, 3718, + 3727, 3730, 3736, 3740, 3741, 3747, 3748, 3749, 3750, 3751, + 3752, 3753, 3754, 3758, 3766, 3767, 3771, 3767, 3785, 3786, + 3790, 3790, 3797, 3797, 3811, 3814, 3824, 3832, 3843, 3844, + 3848, 3851, 3858, 3865, 3869, 3877, 3881, 3894, 3897, 3904, + 3904, 3924, 3927, 3933, 3945, 3957, 3960, 3968, 3968, 3983, + 3983, 4001, 4001, 4022, 4025, 4031, 4034, 4040, 4044, 4051, + 4056, 4061, 4068, 4071, 4075, 4079, 4083, 4092, 4096, 4105, + 4108, 4111, 4119, 4119, 4161, 4166, 4169, 4174, 4177, 4182, + 4185, 4190, 4193, 4198, 4201, 4206, 4209, 4214, 4218, 4223, + 4227, 4232, 4236, 4243, 4246, 4251, 4254, 4257, 4260, 4263, + 4268, 4277, 4288, 4293, 4301, 4305, 4310, 4314, 4319, 4323, + 4328, 4332, 4339, 4342, 4347, 4350, 4353, 4356, 4361, 4364, + 4369, 4375, 4378, 4381, 4384, 4389, 4393, 4398, 4402, 4407, + 4411, 4418, 4421, 4426, 4429, 4434, 4437, 4443, 4446, 4451, + 4454 }; #endif @@ -5210,302 +5203,328 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); switch (yyn) { case 2: /* variable_identifier: IDENTIFIER */ -#line 395 "MachineIndependent/glslang.y" +#line 355 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } -#line 5218 "MachineIndependent/glslang_tab.cpp" +#line 5211 "MachineIndependent/glslang_tab.cpp" break; case 3: /* primary_expression: variable_identifier */ -#line 401 "MachineIndependent/glslang.y" +#line 361 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5226 "MachineIndependent/glslang_tab.cpp" +#line 5219 "MachineIndependent/glslang_tab.cpp" break; case 4: /* primary_expression: LEFT_PAREN expression RIGHT_PAREN */ -#line 404 "MachineIndependent/glslang.y" +#line 364 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } -#line 5236 "MachineIndependent/glslang_tab.cpp" +#line 5229 "MachineIndependent/glslang_tab.cpp" break; case 5: /* primary_expression: FLOATCONSTANT */ -#line 409 "MachineIndependent/glslang.y" +#line 369 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 5244 "MachineIndependent/glslang_tab.cpp" +#line 5237 "MachineIndependent/glslang_tab.cpp" break; case 6: /* primary_expression: INTCONSTANT */ -#line 412 "MachineIndependent/glslang.y" +#line 372 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5252 "MachineIndependent/glslang_tab.cpp" +#line 5245 "MachineIndependent/glslang_tab.cpp" break; case 7: /* primary_expression: UINTCONSTANT */ -#line 415 "MachineIndependent/glslang.y" +#line 375 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5261 "MachineIndependent/glslang_tab.cpp" +#line 5254 "MachineIndependent/glslang_tab.cpp" break; case 8: /* primary_expression: BOOLCONSTANT */ -#line 419 "MachineIndependent/glslang.y" +#line 379 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 5269 "MachineIndependent/glslang_tab.cpp" +#line 5262 "MachineIndependent/glslang_tab.cpp" break; case 9: /* primary_expression: STRING_LITERAL */ -#line 423 "MachineIndependent/glslang.y" +#line 382 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 5277 "MachineIndependent/glslang_tab.cpp" +#line 5270 "MachineIndependent/glslang_tab.cpp" break; case 10: /* primary_expression: INT32CONSTANT */ -#line 426 "MachineIndependent/glslang.y" +#line 385 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5286 "MachineIndependent/glslang_tab.cpp" +#line 5279 "MachineIndependent/glslang_tab.cpp" break; case 11: /* primary_expression: UINT32CONSTANT */ -#line 430 "MachineIndependent/glslang.y" +#line 389 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5295 "MachineIndependent/glslang_tab.cpp" +#line 5288 "MachineIndependent/glslang_tab.cpp" break; case 12: /* primary_expression: INT64CONSTANT */ -#line 434 "MachineIndependent/glslang.y" +#line 393 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } -#line 5304 "MachineIndependent/glslang_tab.cpp" +#line 5297 "MachineIndependent/glslang_tab.cpp" break; case 13: /* primary_expression: UINT64CONSTANT */ -#line 438 "MachineIndependent/glslang.y" +#line 397 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } -#line 5313 "MachineIndependent/glslang_tab.cpp" +#line 5306 "MachineIndependent/glslang_tab.cpp" break; case 14: /* primary_expression: INT16CONSTANT */ -#line 442 "MachineIndependent/glslang.y" +#line 401 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5322 "MachineIndependent/glslang_tab.cpp" +#line 5315 "MachineIndependent/glslang_tab.cpp" break; case 15: /* primary_expression: UINT16CONSTANT */ -#line 446 "MachineIndependent/glslang.y" +#line 405 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5331 "MachineIndependent/glslang_tab.cpp" +#line 5324 "MachineIndependent/glslang_tab.cpp" break; case 16: /* primary_expression: DOUBLECONSTANT */ -#line 450 "MachineIndependent/glslang.y" +#line 409 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double literal"); if (! parseContext.symbolTable.atBuiltInLevel()) parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } -#line 5342 "MachineIndependent/glslang_tab.cpp" +#line 5335 "MachineIndependent/glslang_tab.cpp" break; case 17: /* primary_expression: FLOAT16CONSTANT */ -#line 456 "MachineIndependent/glslang.y" +#line 415 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); } -#line 5351 "MachineIndependent/glslang_tab.cpp" +#line 5344 "MachineIndependent/glslang_tab.cpp" break; case 18: /* postfix_expression: primary_expression */ -#line 464 "MachineIndependent/glslang.y" +#line 422 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5359 "MachineIndependent/glslang_tab.cpp" +#line 5352 "MachineIndependent/glslang_tab.cpp" break; case 19: /* postfix_expression: postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET */ -#line 467 "MachineIndependent/glslang.y" +#line 425 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } -#line 5367 "MachineIndependent/glslang_tab.cpp" +#line 5360 "MachineIndependent/glslang_tab.cpp" break; case 20: /* postfix_expression: function_call */ -#line 470 "MachineIndependent/glslang.y" +#line 428 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5375 "MachineIndependent/glslang_tab.cpp" +#line 5368 "MachineIndependent/glslang_tab.cpp" break; case 21: /* postfix_expression: postfix_expression DOT IDENTIFIER */ -#line 473 "MachineIndependent/glslang.y" +#line 431 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } -#line 5383 "MachineIndependent/glslang_tab.cpp" +#line 5376 "MachineIndependent/glslang_tab.cpp" break; case 22: /* postfix_expression: postfix_expression INC_OP */ -#line 476 "MachineIndependent/glslang.y" +#line 434 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5393 "MachineIndependent/glslang_tab.cpp" +#line 5386 "MachineIndependent/glslang_tab.cpp" break; case 23: /* postfix_expression: postfix_expression DEC_OP */ -#line 481 "MachineIndependent/glslang.y" +#line 439 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5403 "MachineIndependent/glslang_tab.cpp" +#line 5396 "MachineIndependent/glslang_tab.cpp" break; case 24: /* integer_expression: expression */ -#line 489 "MachineIndependent/glslang.y" +#line 447 "MachineIndependent/glslang.y" { parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5412 "MachineIndependent/glslang_tab.cpp" +#line 5405 "MachineIndependent/glslang_tab.cpp" break; case 25: /* function_call: function_call_or_method */ -#line 496 "MachineIndependent/glslang.y" +#line 454 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); delete (yyvsp[0].interm).function; } -#line 5421 "MachineIndependent/glslang_tab.cpp" +#line 5414 "MachineIndependent/glslang_tab.cpp" break; case 26: /* function_call_or_method: function_call_generic */ -#line 503 "MachineIndependent/glslang.y" +#line 461 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 5429 "MachineIndependent/glslang_tab.cpp" +#line 5422 "MachineIndependent/glslang_tab.cpp" break; case 27: /* function_call_generic: function_call_header_with_parameters RIGHT_PAREN */ -#line 509 "MachineIndependent/glslang.y" +#line 467 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5438 "MachineIndependent/glslang_tab.cpp" +#line 5431 "MachineIndependent/glslang_tab.cpp" break; case 28: /* function_call_generic: function_call_header_no_parameters RIGHT_PAREN */ -#line 513 "MachineIndependent/glslang.y" +#line 471 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5447 "MachineIndependent/glslang_tab.cpp" +#line 5440 "MachineIndependent/glslang_tab.cpp" break; case 29: /* function_call_header_no_parameters: function_call_header VOID */ -#line 520 "MachineIndependent/glslang.y" +#line 478 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } -#line 5455 "MachineIndependent/glslang_tab.cpp" +#line 5448 "MachineIndependent/glslang_tab.cpp" break; case 30: /* function_call_header_no_parameters: function_call_header */ -#line 523 "MachineIndependent/glslang.y" +#line 481 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 5463 "MachineIndependent/glslang_tab.cpp" +#line 5456 "MachineIndependent/glslang_tab.cpp" break; case 31: /* function_call_header_with_parameters: function_call_header assignment_expression */ -#line 529 "MachineIndependent/glslang.y" +#line 487 "MachineIndependent/glslang.y" { - TParameter param = { 0, new TType }; - param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); - (yyvsp[-1].interm).function->addParameter(param); - (yyval.interm).function = (yyvsp[-1].interm).function; - (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); + if (parseContext.spvVersion.vulkan > 0 + && parseContext.spvVersion.vulkanRelaxed + && (yyvsp[0].interm.intermTypedNode)->getType().containsOpaque()) + { + (yyval.interm).intermNode = parseContext.vkRelaxedRemapFunctionArgument((yyval.interm).loc, (yyvsp[-1].interm).function, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).function = (yyvsp[-1].interm).function; + } + else + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + + (yyvsp[-1].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-1].interm).function; + (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); + } } -#line 5475 "MachineIndependent/glslang_tab.cpp" +#line 5479 "MachineIndependent/glslang_tab.cpp" break; case 32: /* function_call_header_with_parameters: function_call_header_with_parameters COMMA assignment_expression */ -#line 536 "MachineIndependent/glslang.y" +#line 505 "MachineIndependent/glslang.y" { - TParameter param = { 0, new TType }; - param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); - (yyvsp[-2].interm).function->addParameter(param); - (yyval.interm).function = (yyvsp[-2].interm).function; - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + if (parseContext.spvVersion.vulkan > 0 + && parseContext.spvVersion.vulkanRelaxed + && (yyvsp[0].interm.intermTypedNode)->getType().containsOpaque()) + { + TIntermNode* remappedNode = parseContext.vkRelaxedRemapFunctionArgument((yyvsp[-1].lex).loc, (yyvsp[-2].interm).function, (yyvsp[0].interm.intermTypedNode)); + if (remappedNode == (yyvsp[0].interm.intermTypedNode)) + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + else + (yyval.interm).intermNode = parseContext.intermediate.mergeAggregate((yyvsp[-2].interm).intermNode, remappedNode, (yyvsp[-1].lex).loc); + (yyval.interm).function = (yyvsp[-2].interm).function; + } + else + { + TParameter param = { 0, new TType, {} }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + + (yyvsp[-2].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-2].interm).function; + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + } } -#line 5487 "MachineIndependent/glslang_tab.cpp" +#line 5506 "MachineIndependent/glslang_tab.cpp" break; case 33: /* function_call_header: function_identifier LEFT_PAREN */ -#line 546 "MachineIndependent/glslang.y" +#line 530 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } -#line 5495 "MachineIndependent/glslang_tab.cpp" +#line 5514 "MachineIndependent/glslang_tab.cpp" break; case 34: /* function_identifier: type_specifier */ -#line 554 "MachineIndependent/glslang.y" +#line 538 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5505 "MachineIndependent/glslang_tab.cpp" +#line 5524 "MachineIndependent/glslang_tab.cpp" break; case 35: /* function_identifier: postfix_expression */ -#line 559 "MachineIndependent/glslang.y" +#line 543 "MachineIndependent/glslang.y" { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -5533,50 +5552,50 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull); } } -#line 5537 "MachineIndependent/glslang_tab.cpp" +#line 5556 "MachineIndependent/glslang_tab.cpp" break; case 36: /* function_identifier: non_uniform_qualifier */ -#line 587 "MachineIndependent/glslang.y" +#line 570 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5547 "MachineIndependent/glslang_tab.cpp" +#line 5566 "MachineIndependent/glslang_tab.cpp" break; case 37: /* unary_expression: postfix_expression */ -#line 596 "MachineIndependent/glslang.y" +#line 578 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } -#line 5558 "MachineIndependent/glslang_tab.cpp" +#line 5577 "MachineIndependent/glslang_tab.cpp" break; case 38: /* unary_expression: INC_OP unary_expression */ -#line 602 "MachineIndependent/glslang.y" +#line 584 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5567 "MachineIndependent/glslang_tab.cpp" +#line 5586 "MachineIndependent/glslang_tab.cpp" break; case 39: /* unary_expression: DEC_OP unary_expression */ -#line 606 "MachineIndependent/glslang.y" +#line 588 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5576 "MachineIndependent/glslang_tab.cpp" +#line 5595 "MachineIndependent/glslang_tab.cpp" break; case 40: /* unary_expression: unary_operator unary_expression */ -#line 610 "MachineIndependent/glslang.y" +#line 592 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; @@ -5593,179 +5612,179 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } -#line 5597 "MachineIndependent/glslang_tab.cpp" +#line 5616 "MachineIndependent/glslang_tab.cpp" break; case 41: /* unary_operator: PLUS */ -#line 630 "MachineIndependent/glslang.y" +#line 612 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 5603 "MachineIndependent/glslang_tab.cpp" +#line 5622 "MachineIndependent/glslang_tab.cpp" break; case 42: /* unary_operator: DASH */ -#line 631 "MachineIndependent/glslang.y" +#line 613 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } -#line 5609 "MachineIndependent/glslang_tab.cpp" +#line 5628 "MachineIndependent/glslang_tab.cpp" break; case 43: /* unary_operator: BANG */ -#line 632 "MachineIndependent/glslang.y" +#line 614 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } -#line 5615 "MachineIndependent/glslang_tab.cpp" +#line 5634 "MachineIndependent/glslang_tab.cpp" break; case 44: /* unary_operator: TILDE */ -#line 633 "MachineIndependent/glslang.y" +#line 615 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 5622 "MachineIndependent/glslang_tab.cpp" +#line 5641 "MachineIndependent/glslang_tab.cpp" break; case 45: /* multiplicative_expression: unary_expression */ -#line 639 "MachineIndependent/glslang.y" +#line 621 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5628 "MachineIndependent/glslang_tab.cpp" +#line 5647 "MachineIndependent/glslang_tab.cpp" break; case 46: /* multiplicative_expression: multiplicative_expression STAR unary_expression */ -#line 640 "MachineIndependent/glslang.y" +#line 622 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5638 "MachineIndependent/glslang_tab.cpp" +#line 5657 "MachineIndependent/glslang_tab.cpp" break; case 47: /* multiplicative_expression: multiplicative_expression SLASH unary_expression */ -#line 645 "MachineIndependent/glslang.y" +#line 627 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5648 "MachineIndependent/glslang_tab.cpp" +#line 5667 "MachineIndependent/glslang_tab.cpp" break; case 48: /* multiplicative_expression: multiplicative_expression PERCENT unary_expression */ -#line 650 "MachineIndependent/glslang.y" +#line 632 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5659 "MachineIndependent/glslang_tab.cpp" +#line 5678 "MachineIndependent/glslang_tab.cpp" break; case 49: /* additive_expression: multiplicative_expression */ -#line 659 "MachineIndependent/glslang.y" +#line 641 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5665 "MachineIndependent/glslang_tab.cpp" +#line 5684 "MachineIndependent/glslang_tab.cpp" break; case 50: /* additive_expression: additive_expression PLUS multiplicative_expression */ -#line 660 "MachineIndependent/glslang.y" +#line 642 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5675 "MachineIndependent/glslang_tab.cpp" +#line 5694 "MachineIndependent/glslang_tab.cpp" break; case 51: /* additive_expression: additive_expression DASH multiplicative_expression */ -#line 665 "MachineIndependent/glslang.y" +#line 647 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5685 "MachineIndependent/glslang_tab.cpp" +#line 5704 "MachineIndependent/glslang_tab.cpp" break; case 52: /* shift_expression: additive_expression */ -#line 673 "MachineIndependent/glslang.y" +#line 655 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5691 "MachineIndependent/glslang_tab.cpp" +#line 5710 "MachineIndependent/glslang_tab.cpp" break; case 53: /* shift_expression: shift_expression LEFT_OP additive_expression */ -#line 674 "MachineIndependent/glslang.y" +#line 656 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5702 "MachineIndependent/glslang_tab.cpp" +#line 5721 "MachineIndependent/glslang_tab.cpp" break; case 54: /* shift_expression: shift_expression RIGHT_OP additive_expression */ -#line 680 "MachineIndependent/glslang.y" +#line 662 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5713 "MachineIndependent/glslang_tab.cpp" +#line 5732 "MachineIndependent/glslang_tab.cpp" break; case 55: /* relational_expression: shift_expression */ -#line 689 "MachineIndependent/glslang.y" +#line 671 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5719 "MachineIndependent/glslang_tab.cpp" +#line 5738 "MachineIndependent/glslang_tab.cpp" break; case 56: /* relational_expression: relational_expression LEFT_ANGLE shift_expression */ -#line 690 "MachineIndependent/glslang.y" +#line 672 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5729 "MachineIndependent/glslang_tab.cpp" +#line 5748 "MachineIndependent/glslang_tab.cpp" break; case 57: /* relational_expression: relational_expression RIGHT_ANGLE shift_expression */ -#line 695 "MachineIndependent/glslang.y" +#line 677 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5739 "MachineIndependent/glslang_tab.cpp" +#line 5758 "MachineIndependent/glslang_tab.cpp" break; case 58: /* relational_expression: relational_expression LE_OP shift_expression */ -#line 700 "MachineIndependent/glslang.y" +#line 682 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5749 "MachineIndependent/glslang_tab.cpp" +#line 5768 "MachineIndependent/glslang_tab.cpp" break; case 59: /* relational_expression: relational_expression GE_OP shift_expression */ -#line 705 "MachineIndependent/glslang.y" +#line 687 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5759 "MachineIndependent/glslang_tab.cpp" +#line 5778 "MachineIndependent/glslang_tab.cpp" break; case 60: /* equality_expression: relational_expression */ -#line 713 "MachineIndependent/glslang.y" +#line 695 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5765 "MachineIndependent/glslang_tab.cpp" +#line 5784 "MachineIndependent/glslang_tab.cpp" break; case 61: /* equality_expression: equality_expression EQ_OP relational_expression */ -#line 714 "MachineIndependent/glslang.y" +#line 696 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); @@ -5775,11 +5794,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5779 "MachineIndependent/glslang_tab.cpp" +#line 5798 "MachineIndependent/glslang_tab.cpp" break; case 62: /* equality_expression: equality_expression NE_OP relational_expression */ -#line 723 "MachineIndependent/glslang.y" +#line 705 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); @@ -5789,124 +5808,124 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5793 "MachineIndependent/glslang_tab.cpp" +#line 5812 "MachineIndependent/glslang_tab.cpp" break; case 63: /* and_expression: equality_expression */ -#line 735 "MachineIndependent/glslang.y" +#line 717 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5799 "MachineIndependent/glslang_tab.cpp" +#line 5818 "MachineIndependent/glslang_tab.cpp" break; case 64: /* and_expression: and_expression AMPERSAND equality_expression */ -#line 736 "MachineIndependent/glslang.y" +#line 718 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5810 "MachineIndependent/glslang_tab.cpp" +#line 5829 "MachineIndependent/glslang_tab.cpp" break; case 65: /* exclusive_or_expression: and_expression */ -#line 745 "MachineIndependent/glslang.y" +#line 727 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5816 "MachineIndependent/glslang_tab.cpp" +#line 5835 "MachineIndependent/glslang_tab.cpp" break; case 66: /* exclusive_or_expression: exclusive_or_expression CARET and_expression */ -#line 746 "MachineIndependent/glslang.y" +#line 728 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5827 "MachineIndependent/glslang_tab.cpp" +#line 5846 "MachineIndependent/glslang_tab.cpp" break; case 67: /* inclusive_or_expression: exclusive_or_expression */ -#line 755 "MachineIndependent/glslang.y" +#line 737 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5833 "MachineIndependent/glslang_tab.cpp" +#line 5852 "MachineIndependent/glslang_tab.cpp" break; case 68: /* inclusive_or_expression: inclusive_or_expression VERTICAL_BAR exclusive_or_expression */ -#line 756 "MachineIndependent/glslang.y" +#line 738 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5844 "MachineIndependent/glslang_tab.cpp" +#line 5863 "MachineIndependent/glslang_tab.cpp" break; case 69: /* logical_and_expression: inclusive_or_expression */ -#line 765 "MachineIndependent/glslang.y" +#line 747 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5850 "MachineIndependent/glslang_tab.cpp" +#line 5869 "MachineIndependent/glslang_tab.cpp" break; case 70: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression */ -#line 766 "MachineIndependent/glslang.y" +#line 748 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5860 "MachineIndependent/glslang_tab.cpp" +#line 5879 "MachineIndependent/glslang_tab.cpp" break; case 71: /* logical_xor_expression: logical_and_expression */ -#line 774 "MachineIndependent/glslang.y" +#line 756 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5866 "MachineIndependent/glslang_tab.cpp" +#line 5885 "MachineIndependent/glslang_tab.cpp" break; case 72: /* logical_xor_expression: logical_xor_expression XOR_OP logical_and_expression */ -#line 775 "MachineIndependent/glslang.y" +#line 757 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5876 "MachineIndependent/glslang_tab.cpp" +#line 5895 "MachineIndependent/glslang_tab.cpp" break; case 73: /* logical_or_expression: logical_xor_expression */ -#line 783 "MachineIndependent/glslang.y" +#line 765 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5882 "MachineIndependent/glslang_tab.cpp" +#line 5901 "MachineIndependent/glslang_tab.cpp" break; case 74: /* logical_or_expression: logical_or_expression OR_OP logical_xor_expression */ -#line 784 "MachineIndependent/glslang.y" +#line 766 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5892 "MachineIndependent/glslang_tab.cpp" +#line 5911 "MachineIndependent/glslang_tab.cpp" break; case 75: /* conditional_expression: logical_or_expression */ -#line 792 "MachineIndependent/glslang.y" +#line 774 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5898 "MachineIndependent/glslang_tab.cpp" +#line 5917 "MachineIndependent/glslang_tab.cpp" break; case 76: /* $@1: %empty */ -#line 793 "MachineIndependent/glslang.y" +#line 775 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } -#line 5906 "MachineIndependent/glslang_tab.cpp" +#line 5925 "MachineIndependent/glslang_tab.cpp" break; case 77: /* conditional_expression: logical_or_expression QUESTION $@1 expression COLON assignment_expression */ -#line 796 "MachineIndependent/glslang.y" +#line 778 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); @@ -5919,17 +5938,17 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 5923 "MachineIndependent/glslang_tab.cpp" +#line 5942 "MachineIndependent/glslang_tab.cpp" break; case 78: /* assignment_expression: conditional_expression */ -#line 811 "MachineIndependent/glslang.y" +#line 793 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5929 "MachineIndependent/glslang_tab.cpp" +#line 5948 "MachineIndependent/glslang_tab.cpp" break; case 79: /* assignment_expression: unary_expression assignment_operator assignment_expression */ -#line 812 "MachineIndependent/glslang.y" +#line 794 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); @@ -5943,119 +5962,119 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } } -#line 5947 "MachineIndependent/glslang_tab.cpp" +#line 5966 "MachineIndependent/glslang_tab.cpp" break; case 80: /* assignment_operator: EQUAL */ -#line 828 "MachineIndependent/glslang.y" +#line 810 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAssign; } -#line 5956 "MachineIndependent/glslang_tab.cpp" +#line 5975 "MachineIndependent/glslang_tab.cpp" break; case 81: /* assignment_operator: MUL_ASSIGN */ -#line 832 "MachineIndependent/glslang.y" +#line 814 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpMulAssign; } -#line 5965 "MachineIndependent/glslang_tab.cpp" +#line 5984 "MachineIndependent/glslang_tab.cpp" break; case 82: /* assignment_operator: DIV_ASSIGN */ -#line 836 "MachineIndependent/glslang.y" +#line 818 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpDivAssign; } -#line 5974 "MachineIndependent/glslang_tab.cpp" +#line 5993 "MachineIndependent/glslang_tab.cpp" break; case 83: /* assignment_operator: MOD_ASSIGN */ -#line 840 "MachineIndependent/glslang.y" +#line 822 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpModAssign; } -#line 5984 "MachineIndependent/glslang_tab.cpp" +#line 6003 "MachineIndependent/glslang_tab.cpp" break; case 84: /* assignment_operator: ADD_ASSIGN */ -#line 845 "MachineIndependent/glslang.y" +#line 827 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAddAssign; } -#line 5993 "MachineIndependent/glslang_tab.cpp" +#line 6012 "MachineIndependent/glslang_tab.cpp" break; case 85: /* assignment_operator: SUB_ASSIGN */ -#line 849 "MachineIndependent/glslang.y" +#line 831 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpSubAssign; } -#line 6002 "MachineIndependent/glslang_tab.cpp" +#line 6021 "MachineIndependent/glslang_tab.cpp" break; case 86: /* assignment_operator: LEFT_ASSIGN */ -#line 853 "MachineIndependent/glslang.y" +#line 835 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } -#line 6011 "MachineIndependent/glslang_tab.cpp" +#line 6030 "MachineIndependent/glslang_tab.cpp" break; case 87: /* assignment_operator: RIGHT_ASSIGN */ -#line 857 "MachineIndependent/glslang.y" +#line 839 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } -#line 6020 "MachineIndependent/glslang_tab.cpp" +#line 6039 "MachineIndependent/glslang_tab.cpp" break; case 88: /* assignment_operator: AND_ASSIGN */ -#line 861 "MachineIndependent/glslang.y" +#line 843 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } -#line 6029 "MachineIndependent/glslang_tab.cpp" +#line 6048 "MachineIndependent/glslang_tab.cpp" break; case 89: /* assignment_operator: XOR_ASSIGN */ -#line 865 "MachineIndependent/glslang.y" +#line 847 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } -#line 6038 "MachineIndependent/glslang_tab.cpp" +#line 6057 "MachineIndependent/glslang_tab.cpp" break; case 90: /* assignment_operator: OR_ASSIGN */ -#line 869 "MachineIndependent/glslang.y" +#line 851 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } -#line 6047 "MachineIndependent/glslang_tab.cpp" +#line 6066 "MachineIndependent/glslang_tab.cpp" break; case 91: /* expression: assignment_expression */ -#line 876 "MachineIndependent/glslang.y" +#line 858 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6055 "MachineIndependent/glslang_tab.cpp" +#line 6074 "MachineIndependent/glslang_tab.cpp" break; case 92: /* expression: expression COMMA assignment_expression */ -#line 879 "MachineIndependent/glslang.y" +#line 861 "MachineIndependent/glslang.y" { parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); @@ -6064,30 +6083,30 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 6068 "MachineIndependent/glslang_tab.cpp" +#line 6087 "MachineIndependent/glslang_tab.cpp" break; case 93: /* constant_expression: conditional_expression */ -#line 890 "MachineIndependent/glslang.y" +#line 872 "MachineIndependent/glslang.y" { parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6077 "MachineIndependent/glslang_tab.cpp" +#line 6096 "MachineIndependent/glslang_tab.cpp" break; case 94: /* declaration: function_prototype SEMICOLON */ -#line 897 "MachineIndependent/glslang.y" +#line 879 "MachineIndependent/glslang.y" { parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 6087 "MachineIndependent/glslang_tab.cpp" +#line 6106 "MachineIndependent/glslang_tab.cpp" break; case 95: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */ -#line 903 "MachineIndependent/glslang.y" +#line 884 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[-1].interm).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier"); (yyvsp[-1].interm).function->setSpirvInstruction(*(yyvsp[-2].interm.spirvInst)); // Attach SPIR-V intruction qualifier @@ -6095,31 +6114,31 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 6099 "MachineIndependent/glslang_tab.cpp" +#line 6118 "MachineIndependent/glslang_tab.cpp" break; case 96: /* declaration: spirv_execution_mode_qualifier SEMICOLON */ -#line 910 "MachineIndependent/glslang.y" +#line 891 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "SPIR-V execution mode qualifier"); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier"); (yyval.interm.intermNode) = 0; } -#line 6109 "MachineIndependent/glslang_tab.cpp" +#line 6128 "MachineIndependent/glslang_tab.cpp" break; case 97: /* declaration: init_declarator_list SEMICOLON */ -#line 916 "MachineIndependent/glslang.y" +#line 896 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } -#line 6119 "MachineIndependent/glslang_tab.cpp" +#line 6138 "MachineIndependent/glslang_tab.cpp" break; case 98: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */ -#line 921 "MachineIndependent/glslang.y" +#line 901 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope @@ -6127,75 +6146,75 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } -#line 6131 "MachineIndependent/glslang_tab.cpp" +#line 6150 "MachineIndependent/glslang_tab.cpp" break; case 99: /* declaration: block_structure SEMICOLON */ -#line 928 "MachineIndependent/glslang.y" +#line 908 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; } -#line 6140 "MachineIndependent/glslang_tab.cpp" +#line 6159 "MachineIndependent/glslang_tab.cpp" break; case 100: /* declaration: block_structure IDENTIFIER SEMICOLON */ -#line 932 "MachineIndependent/glslang.y" +#line 912 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 6149 "MachineIndependent/glslang_tab.cpp" +#line 6168 "MachineIndependent/glslang_tab.cpp" break; case 101: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */ -#line 936 "MachineIndependent/glslang.y" +#line 916 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); (yyval.interm.intermNode) = 0; } -#line 6158 "MachineIndependent/glslang_tab.cpp" +#line 6177 "MachineIndependent/glslang_tab.cpp" break; case 102: /* declaration: type_qualifier SEMICOLON */ -#line 940 "MachineIndependent/glslang.y" +#line 920 "MachineIndependent/glslang.y" { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); (yyval.interm.intermNode) = 0; } -#line 6168 "MachineIndependent/glslang_tab.cpp" +#line 6187 "MachineIndependent/glslang_tab.cpp" break; case 103: /* declaration: type_qualifier IDENTIFIER SEMICOLON */ -#line 945 "MachineIndependent/glslang.y" +#line 925 "MachineIndependent/glslang.y" { parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 6178 "MachineIndependent/glslang_tab.cpp" +#line 6197 "MachineIndependent/glslang_tab.cpp" break; case 104: /* declaration: type_qualifier IDENTIFIER identifier_list SEMICOLON */ -#line 950 "MachineIndependent/glslang.y" +#line 930 "MachineIndependent/glslang.y" { parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); (yyval.interm.intermNode) = 0; } -#line 6189 "MachineIndependent/glslang_tab.cpp" +#line 6208 "MachineIndependent/glslang_tab.cpp" break; case 105: /* $@2: %empty */ -#line 959 "MachineIndependent/glslang.y" +#line 939 "MachineIndependent/glslang.y" { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 6195 "MachineIndependent/glslang_tab.cpp" +#line 6214 "MachineIndependent/glslang_tab.cpp" break; case 106: /* block_structure: type_qualifier IDENTIFIER LEFT_BRACE $@2 struct_declaration_list RIGHT_BRACE */ -#line 959 "MachineIndependent/glslang.y" +#line 939 "MachineIndependent/glslang.y" { --parseContext.blockNestingLevel; parseContext.blockName = (yyvsp[-4].lex).string; @@ -6205,101 +6224,113 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).loc = (yyvsp[-5].interm.type).loc; (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 6209 "MachineIndependent/glslang_tab.cpp" +#line 6228 "MachineIndependent/glslang_tab.cpp" break; case 107: /* identifier_list: COMMA IDENTIFIER */ -#line 970 "MachineIndependent/glslang.y" +#line 950 "MachineIndependent/glslang.y" { (yyval.interm.identifierList) = new TIdentifierList; (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6218 "MachineIndependent/glslang_tab.cpp" +#line 6237 "MachineIndependent/glslang_tab.cpp" break; case 108: /* identifier_list: identifier_list COMMA IDENTIFIER */ -#line 974 "MachineIndependent/glslang.y" +#line 954 "MachineIndependent/glslang.y" { (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6227 "MachineIndependent/glslang_tab.cpp" +#line 6246 "MachineIndependent/glslang_tab.cpp" break; case 109: /* function_prototype: function_declarator RIGHT_PAREN */ -#line 981 "MachineIndependent/glslang.y" +#line 961 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-1].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 6236 "MachineIndependent/glslang_tab.cpp" +#line 6256 "MachineIndependent/glslang_tab.cpp" break; case 110: /* function_prototype: function_declarator RIGHT_PAREN attribute */ -#line 985 "MachineIndependent/glslang.y" +#line 966 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-2].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); (yyval.interm).loc = (yyvsp[-1].lex).loc; - parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions((yyvsp[-1].lex).loc, 2, extensions, "attribute"); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6247 "MachineIndependent/glslang_tab.cpp" +#line 6269 "MachineIndependent/glslang_tab.cpp" break; case 111: /* function_prototype: attribute function_declarator RIGHT_PAREN */ -#line 991 "MachineIndependent/glslang.y" +#line 974 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-1].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); (yyval.interm).loc = (yyvsp[0].lex).loc; - parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions((yyvsp[0].lex).loc, 2, extensions, "attribute"); parseContext.handleFunctionAttributes((yyvsp[0].lex).loc, *(yyvsp[-2].interm.attributes)); } -#line 6258 "MachineIndependent/glslang_tab.cpp" +#line 6282 "MachineIndependent/glslang_tab.cpp" break; case 112: /* function_prototype: attribute function_declarator RIGHT_PAREN attribute */ -#line 997 "MachineIndependent/glslang.y" +#line 982 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-2].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); (yyval.interm).loc = (yyvsp[-1].lex).loc; - parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); + const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence }; + parseContext.requireExtensions((yyvsp[-1].lex).loc, 2, extensions, "attribute"); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes)); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6270 "MachineIndependent/glslang_tab.cpp" +#line 6296 "MachineIndependent/glslang_tab.cpp" break; case 113: /* function_declarator: function_header */ -#line 1007 "MachineIndependent/glslang.y" +#line 994 "MachineIndependent/glslang.y" { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6278 "MachineIndependent/glslang_tab.cpp" +#line 6304 "MachineIndependent/glslang_tab.cpp" break; case 114: /* function_declarator: function_header_with_parameters */ -#line 1010 "MachineIndependent/glslang.y" +#line 997 "MachineIndependent/glslang.y" { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6286 "MachineIndependent/glslang_tab.cpp" +#line 6312 "MachineIndependent/glslang_tab.cpp" break; case 115: /* function_header_with_parameters: function_header parameter_declaration */ -#line 1017 "MachineIndependent/glslang.y" +#line 1004 "MachineIndependent/glslang.y" { // Add the parameter (yyval.interm.function) = (yyvsp[-1].interm.function); if ((yyvsp[0].interm).param.type->getBasicType() != EbtVoid) - (yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param); + { + if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed)) + (yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param); + else + parseContext.vkRelaxedRemapFunctionParameter((yyvsp[-1].interm.function), (yyvsp[0].interm).param); + } else delete (yyvsp[0].interm).param.type; } -#line 6299 "MachineIndependent/glslang_tab.cpp" +#line 6330 "MachineIndependent/glslang_tab.cpp" break; case 116: /* function_header_with_parameters: function_header_with_parameters COMMA parameter_declaration */ -#line 1025 "MachineIndependent/glslang.y" +#line 1017 "MachineIndependent/glslang.y" { // // Only first parameter of one-parameter functions can be void @@ -6314,14 +6345,17 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } else { // Add the parameter (yyval.interm.function) = (yyvsp[-2].interm.function); - (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); + if (!(parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed)) + (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); + else + parseContext.vkRelaxedRemapFunctionParameter((yyvsp[-2].interm.function), (yyvsp[0].interm).param); } } -#line 6321 "MachineIndependent/glslang_tab.cpp" +#line 6355 "MachineIndependent/glslang_tab.cpp" break; case 117: /* function_header: fully_specified_type IDENTIFIER LEFT_PAREN */ -#line 1045 "MachineIndependent/glslang.y" +#line 1040 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", @@ -6341,11 +6375,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); function = new TFunction((yyvsp[-1].lex).string, type); (yyval.interm.function) = function; } -#line 6345 "MachineIndependent/glslang_tab.cpp" +#line 6379 "MachineIndependent/glslang_tab.cpp" break; case 118: /* parameter_declarator: type_specifier IDENTIFIER */ -#line 1068 "MachineIndependent/glslang.y" +#line 1063 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6357,15 +6391,15 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } parseContext.reservedErrorCheck((yyvsp[0].lex).loc, *(yyvsp[0].lex).string); - TParameter param = {(yyvsp[0].lex).string, new TType((yyvsp[-1].interm.type))}; + TParameter param = {(yyvsp[0].lex).string, new TType((yyvsp[-1].interm.type)), {}}; (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).param = param; } -#line 6365 "MachineIndependent/glslang_tab.cpp" +#line 6399 "MachineIndependent/glslang_tab.cpp" break; case 119: /* parameter_declarator: type_specifier IDENTIFIER array_specifier */ -#line 1083 "MachineIndependent/glslang.y" +#line 1078 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6380,16 +6414,16 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.arraySizeRequiredCheck((yyvsp[0].interm).loc, *(yyvsp[0].interm).arraySizes); parseContext.reservedErrorCheck((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string); - TParameter param = { (yyvsp[-1].lex).string, type }; + TParameter param = { (yyvsp[-1].lex).string, type, {} }; (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).param = param; } -#line 6389 "MachineIndependent/glslang_tab.cpp" +#line 6423 "MachineIndependent/glslang_tab.cpp" break; case 120: /* parameter_declaration: type_qualifier parameter_declarator */ -#line 1108 "MachineIndependent/glslang.y" +#line 1103 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -6401,11 +6435,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6405 "MachineIndependent/glslang_tab.cpp" +#line 6439 "MachineIndependent/glslang_tab.cpp" break; case 121: /* parameter_declaration: parameter_declarator */ -#line 1119 "MachineIndependent/glslang.y" +#line 1114 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); @@ -6413,11 +6447,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->isCoopMat()); } -#line 6417 "MachineIndependent/glslang_tab.cpp" +#line 6451 "MachineIndependent/glslang_tab.cpp" break; case 122: /* parameter_declaration: type_qualifier parameter_type_specifier */ -#line 1129 "MachineIndependent/glslang.y" +#line 1124 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -6428,11 +6462,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6432 "MachineIndependent/glslang_tab.cpp" +#line 6466 "MachineIndependent/glslang_tab.cpp" break; case 123: /* parameter_declaration: parameter_type_specifier */ -#line 1139 "MachineIndependent/glslang.y" +#line 1134 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); @@ -6440,120 +6474,118 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->isCoopMat()); } -#line 6444 "MachineIndependent/glslang_tab.cpp" +#line 6478 "MachineIndependent/glslang_tab.cpp" break; case 124: /* parameter_type_specifier: type_specifier */ -#line 1149 "MachineIndependent/glslang.y" +#line 1144 "MachineIndependent/glslang.y" { - TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; + TParameter param = { 0, new TType((yyvsp[0].interm.type)), {} }; (yyval.interm).param = param; if ((yyvsp[0].interm.type).arraySizes) parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 6455 "MachineIndependent/glslang_tab.cpp" +#line 6489 "MachineIndependent/glslang_tab.cpp" break; case 125: /* init_declarator_list: single_declaration */ -#line 1158 "MachineIndependent/glslang.y" +#line 1153 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 6463 "MachineIndependent/glslang_tab.cpp" +#line 6497 "MachineIndependent/glslang_tab.cpp" break; case 126: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER */ -#line 1161 "MachineIndependent/glslang.y" +#line 1156 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 6472 "MachineIndependent/glslang_tab.cpp" +#line 6506 "MachineIndependent/glslang_tab.cpp" break; case 127: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier */ -#line 1165 "MachineIndependent/glslang.y" +#line 1160 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 6481 "MachineIndependent/glslang_tab.cpp" +#line 6515 "MachineIndependent/glslang_tab.cpp" break; case 128: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer */ -#line 1169 "MachineIndependent/glslang.y" +#line 1164 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-5].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6491 "MachineIndependent/glslang_tab.cpp" +#line 6525 "MachineIndependent/glslang_tab.cpp" break; case 129: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER EQUAL initializer */ -#line 1174 "MachineIndependent/glslang.y" +#line 1169 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6501 "MachineIndependent/glslang_tab.cpp" +#line 6535 "MachineIndependent/glslang_tab.cpp" break; case 130: /* single_declaration: fully_specified_type */ -#line 1182 "MachineIndependent/glslang.y" +#line 1177 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[0].interm.type); (yyval.interm).intermNode = 0; - parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); - } -#line 6513 "MachineIndependent/glslang_tab.cpp" +#line 6545 "MachineIndependent/glslang_tab.cpp" break; case 131: /* single_declaration: fully_specified_type IDENTIFIER */ -#line 1189 "MachineIndependent/glslang.y" +#line 1182 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-1].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 6523 "MachineIndependent/glslang_tab.cpp" +#line 6555 "MachineIndependent/glslang_tab.cpp" break; case 132: /* single_declaration: fully_specified_type IDENTIFIER array_specifier */ -#line 1194 "MachineIndependent/glslang.y" +#line 1187 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-2].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 6533 "MachineIndependent/glslang_tab.cpp" +#line 6565 "MachineIndependent/glslang_tab.cpp" break; case 133: /* single_declaration: fully_specified_type IDENTIFIER array_specifier EQUAL initializer */ -#line 1199 "MachineIndependent/glslang.y" +#line 1192 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6543 "MachineIndependent/glslang_tab.cpp" +#line 6575 "MachineIndependent/glslang_tab.cpp" break; case 134: /* single_declaration: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 1204 "MachineIndependent/glslang.y" +#line 1197 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-3].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6553 "MachineIndependent/glslang_tab.cpp" +#line 6585 "MachineIndependent/glslang_tab.cpp" break; case 135: /* fully_specified_type: type_specifier */ -#line 1213 "MachineIndependent/glslang.y" +#line 1206 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); @@ -6564,11 +6596,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier, (yyval.interm.type).isCoopmat()); } -#line 6568 "MachineIndependent/glslang_tab.cpp" +#line 6600 "MachineIndependent/glslang_tab.cpp" break; case 136: /* fully_specified_type: type_qualifier type_specifier */ -#line 1223 "MachineIndependent/glslang.y" +#line 1216 "MachineIndependent/glslang.y" { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, false, &(yyvsp[0].interm.type)); parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); @@ -6593,22 +6625,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } -#line 6597 "MachineIndependent/glslang_tab.cpp" +#line 6629 "MachineIndependent/glslang_tab.cpp" break; case 137: /* invariant_qualifier: INVARIANT */ -#line 1250 "MachineIndependent/glslang.y" +#line 1243 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.invariant = true; } -#line 6608 "MachineIndependent/glslang_tab.cpp" +#line 6640 "MachineIndependent/glslang_tab.cpp" break; case 138: /* interpolation_qualifier: SMOOTH */ -#line 1259 "MachineIndependent/glslang.y" +#line 1252 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); @@ -6616,11 +6648,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.smooth = true; } -#line 6620 "MachineIndependent/glslang_tab.cpp" +#line 6652 "MachineIndependent/glslang_tab.cpp" break; case 139: /* interpolation_qualifier: FLAT */ -#line 1266 "MachineIndependent/glslang.y" +#line 1259 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); @@ -6628,11 +6660,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.flat = true; } -#line 6632 "MachineIndependent/glslang_tab.cpp" +#line 6664 "MachineIndependent/glslang_tab.cpp" break; case 140: /* interpolation_qualifier: NOPERSPECTIVE */ -#line 1274 "MachineIndependent/glslang.y" +#line 1266 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); @@ -6640,11 +6672,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nopersp = true; } -#line 6644 "MachineIndependent/glslang_tab.cpp" +#line 6676 "MachineIndependent/glslang_tab.cpp" break; case 141: /* interpolation_qualifier: EXPLICITINTERPAMD */ -#line 1281 "MachineIndependent/glslang.y" +#line 1273 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); @@ -6652,11 +6684,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.explicitInterp = true; } -#line 6656 "MachineIndependent/glslang_tab.cpp" +#line 6688 "MachineIndependent/glslang_tab.cpp" break; case 142: /* interpolation_qualifier: PERVERTEXNV */ -#line 1288 "MachineIndependent/glslang.y" +#line 1280 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexNV"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6665,11 +6697,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexNV = true; } -#line 6669 "MachineIndependent/glslang_tab.cpp" +#line 6701 "MachineIndependent/glslang_tab.cpp" break; case 143: /* interpolation_qualifier: PERVERTEXEXT */ -#line 1296 "MachineIndependent/glslang.y" +#line 1288 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexEXT"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6678,11 +6710,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexEXT = true; } -#line 6682 "MachineIndependent/glslang_tab.cpp" +#line 6714 "MachineIndependent/glslang_tab.cpp" break; case 144: /* interpolation_qualifier: PERPRIMITIVENV */ -#line 1304 "MachineIndependent/glslang.y" +#line 1296 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV"); @@ -6693,11 +6725,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6697 "MachineIndependent/glslang_tab.cpp" +#line 6729 "MachineIndependent/glslang_tab.cpp" break; case 145: /* interpolation_qualifier: PERPRIMITIVEEXT */ -#line 1314 "MachineIndependent/glslang.y" +#line 1306 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveEXT"); @@ -6708,11 +6740,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6712 "MachineIndependent/glslang_tab.cpp" +#line 6744 "MachineIndependent/glslang_tab.cpp" break; case 146: /* interpolation_qualifier: PERVIEWNV */ -#line 1324 "MachineIndependent/glslang.y" +#line 1316 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV"); @@ -6720,11 +6752,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perViewNV = true; } -#line 6724 "MachineIndependent/glslang_tab.cpp" +#line 6756 "MachineIndependent/glslang_tab.cpp" break; case 147: /* interpolation_qualifier: PERTASKNV */ -#line 1331 "MachineIndependent/glslang.y" +#line 1323 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV"); @@ -6732,84 +6764,84 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perTaskNV = true; } -#line 6736 "MachineIndependent/glslang_tab.cpp" +#line 6768 "MachineIndependent/glslang_tab.cpp" break; case 148: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */ -#line 1342 "MachineIndependent/glslang.y" +#line 1333 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 6744 "MachineIndependent/glslang_tab.cpp" +#line 6776 "MachineIndependent/glslang_tab.cpp" break; case 149: /* layout_qualifier_id_list: layout_qualifier_id */ -#line 1348 "MachineIndependent/glslang.y" +#line 1339 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6752 "MachineIndependent/glslang_tab.cpp" +#line 6784 "MachineIndependent/glslang_tab.cpp" break; case 150: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */ -#line 1351 "MachineIndependent/glslang.y" +#line 1342 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-2].interm.type); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6762 "MachineIndependent/glslang_tab.cpp" +#line 6794 "MachineIndependent/glslang_tab.cpp" break; case 151: /* layout_qualifier_id: IDENTIFIER */ -#line 1358 "MachineIndependent/glslang.y" +#line 1349 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 6771 "MachineIndependent/glslang_tab.cpp" +#line 6803 "MachineIndependent/glslang_tab.cpp" break; case 152: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */ -#line 1362 "MachineIndependent/glslang.y" +#line 1353 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-2].lex).loc); parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 6780 "MachineIndependent/glslang_tab.cpp" +#line 6812 "MachineIndependent/glslang_tab.cpp" break; case 153: /* layout_qualifier_id: SHARED */ -#line 1366 "MachineIndependent/glslang.y" +#line 1357 "MachineIndependent/glslang.y" { // because "shared" is both an identifier and a keyword (yyval.interm.type).init((yyvsp[0].lex).loc); TString strShared("shared"); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 6790 "MachineIndependent/glslang_tab.cpp" +#line 6822 "MachineIndependent/glslang_tab.cpp" break; case 154: /* precise_qualifier: PRECISE */ -#line 1375 "MachineIndependent/glslang.y" +#line 1365 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.noContraction = true; } -#line 6801 "MachineIndependent/glslang_tab.cpp" +#line 6833 "MachineIndependent/glslang_tab.cpp" break; case 155: /* type_qualifier: single_type_qualifier */ -#line 1385 "MachineIndependent/glslang.y" +#line 1374 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6809 "MachineIndependent/glslang_tab.cpp" +#line 6841 "MachineIndependent/glslang_tab.cpp" break; case 156: /* type_qualifier: type_qualifier single_type_qualifier */ -#line 1388 "MachineIndependent/glslang.y" +#line 1377 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); if ((yyval.interm.type).basicType == EbtVoid) @@ -6818,151 +6850,151 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6822 "MachineIndependent/glslang_tab.cpp" +#line 6854 "MachineIndependent/glslang_tab.cpp" break; case 157: /* single_type_qualifier: storage_qualifier */ -#line 1399 "MachineIndependent/glslang.y" +#line 1388 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6830 "MachineIndependent/glslang_tab.cpp" +#line 6862 "MachineIndependent/glslang_tab.cpp" break; case 158: /* single_type_qualifier: layout_qualifier */ -#line 1402 "MachineIndependent/glslang.y" +#line 1391 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6838 "MachineIndependent/glslang_tab.cpp" +#line 6870 "MachineIndependent/glslang_tab.cpp" break; case 159: /* single_type_qualifier: precision_qualifier */ -#line 1405 "MachineIndependent/glslang.y" +#line 1394 "MachineIndependent/glslang.y" { parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6847 "MachineIndependent/glslang_tab.cpp" +#line 6879 "MachineIndependent/glslang_tab.cpp" break; case 160: /* single_type_qualifier: interpolation_qualifier */ -#line 1409 "MachineIndependent/glslang.y" +#line 1398 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6856 "MachineIndependent/glslang_tab.cpp" +#line 6888 "MachineIndependent/glslang_tab.cpp" break; case 161: /* single_type_qualifier: invariant_qualifier */ -#line 1413 "MachineIndependent/glslang.y" +#line 1402 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6865 "MachineIndependent/glslang_tab.cpp" +#line 6897 "MachineIndependent/glslang_tab.cpp" break; case 162: /* single_type_qualifier: precise_qualifier */ -#line 1418 "MachineIndependent/glslang.y" +#line 1406 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6874 "MachineIndependent/glslang_tab.cpp" +#line 6906 "MachineIndependent/glslang_tab.cpp" break; case 163: /* single_type_qualifier: non_uniform_qualifier */ -#line 1422 "MachineIndependent/glslang.y" +#line 1410 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6882 "MachineIndependent/glslang_tab.cpp" +#line 6914 "MachineIndependent/glslang_tab.cpp" break; case 164: /* single_type_qualifier: spirv_storage_class_qualifier */ -#line 1425 "MachineIndependent/glslang.y" +#line 1413 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].interm.type).loc, "spirv_storage_class"); parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6892 "MachineIndependent/glslang_tab.cpp" +#line 6924 "MachineIndependent/glslang_tab.cpp" break; case 165: /* single_type_qualifier: spirv_decorate_qualifier */ -#line 1430 "MachineIndependent/glslang.y" +#line 1418 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6901 "MachineIndependent/glslang_tab.cpp" +#line 6933 "MachineIndependent/glslang_tab.cpp" break; case 166: /* single_type_qualifier: SPIRV_BY_REFERENCE */ -#line 1434 "MachineIndependent/glslang.y" +#line 1422 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvByReference(); } -#line 6911 "MachineIndependent/glslang_tab.cpp" +#line 6943 "MachineIndependent/glslang_tab.cpp" break; case 167: /* single_type_qualifier: SPIRV_LITERAL */ -#line 1439 "MachineIndependent/glslang.y" +#line 1427 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvLiteral(); } -#line 6921 "MachineIndependent/glslang_tab.cpp" +#line 6953 "MachineIndependent/glslang_tab.cpp" break; case 168: /* storage_qualifier: CONST */ -#line 1448 "MachineIndependent/glslang.y" +#line 1435 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 6930 "MachineIndependent/glslang_tab.cpp" +#line 6962 "MachineIndependent/glslang_tab.cpp" break; case 169: /* storage_qualifier: INOUT */ -#line 1452 "MachineIndependent/glslang.y" +#line 1439 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 6940 "MachineIndependent/glslang_tab.cpp" +#line 6972 "MachineIndependent/glslang_tab.cpp" break; case 170: /* storage_qualifier: IN */ -#line 1457 "MachineIndependent/glslang.y" +#line 1444 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "in"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqIn; } -#line 6951 "MachineIndependent/glslang_tab.cpp" +#line 6983 "MachineIndependent/glslang_tab.cpp" break; case 171: /* storage_qualifier: OUT */ -#line 1463 "MachineIndependent/glslang.y" +#line 1450 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "out"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqOut; } -#line 6962 "MachineIndependent/glslang_tab.cpp" +#line 6994 "MachineIndependent/glslang_tab.cpp" break; case 172: /* storage_qualifier: CENTROID */ -#line 1469 "MachineIndependent/glslang.y" +#line 1456 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); @@ -6970,31 +7002,31 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.centroid = true; } -#line 6974 "MachineIndependent/glslang_tab.cpp" +#line 7006 "MachineIndependent/glslang_tab.cpp" break; case 173: /* storage_qualifier: UNIFORM */ -#line 1476 "MachineIndependent/glslang.y" +#line 1463 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 6984 "MachineIndependent/glslang_tab.cpp" +#line 7016 "MachineIndependent/glslang_tab.cpp" break; case 174: /* storage_qualifier: TILEIMAGEEXT */ -#line 1481 "MachineIndependent/glslang.y" +#line 1468 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "tileImageEXT"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqTileImageEXT; } -#line 6994 "MachineIndependent/glslang_tab.cpp" +#line 7026 "MachineIndependent/glslang_tab.cpp" break; case 175: /* storage_qualifier: SHARED */ -#line 1486 "MachineIndependent/glslang.y" +#line 1473 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); @@ -7003,21 +7035,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqShared; } -#line 7007 "MachineIndependent/glslang_tab.cpp" +#line 7039 "MachineIndependent/glslang_tab.cpp" break; case 176: /* storage_qualifier: BUFFER */ -#line 1494 "MachineIndependent/glslang.y" +#line 1481 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 7017 "MachineIndependent/glslang_tab.cpp" +#line 7049 "MachineIndependent/glslang_tab.cpp" break; case 177: /* storage_qualifier: ATTRIBUTE */ -#line 1500 "MachineIndependent/glslang.y" +#line 1486 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); @@ -7030,11 +7062,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7034 "MachineIndependent/glslang_tab.cpp" +#line 7066 "MachineIndependent/glslang_tab.cpp" break; case 178: /* storage_qualifier: VARYING */ -#line 1512 "MachineIndependent/glslang.y" +#line 1498 "MachineIndependent/glslang.y" { parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); @@ -7049,32 +7081,32 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7053 "MachineIndependent/glslang_tab.cpp" +#line 7085 "MachineIndependent/glslang_tab.cpp" break; case 179: /* storage_qualifier: PATCH */ -#line 1526 "MachineIndependent/glslang.y" +#line 1512 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.patch = true; } -#line 7064 "MachineIndependent/glslang_tab.cpp" +#line 7096 "MachineIndependent/glslang_tab.cpp" break; case 180: /* storage_qualifier: SAMPLE */ -#line 1532 "MachineIndependent/glslang.y" +#line 1518 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.sample = true; } -#line 7074 "MachineIndependent/glslang_tab.cpp" +#line 7106 "MachineIndependent/glslang_tab.cpp" break; case 181: /* storage_qualifier: HITATTRNV */ -#line 1537 "MachineIndependent/glslang.y" +#line 1523 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7083,11 +7115,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7087 "MachineIndependent/glslang_tab.cpp" +#line 7119 "MachineIndependent/glslang_tab.cpp" break; case 182: /* storage_qualifier: HITOBJECTATTRNV */ -#line 1545 "MachineIndependent/glslang.y" +#line 1531 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask @@ -7096,11 +7128,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitObjectAttrNV; } -#line 7100 "MachineIndependent/glslang_tab.cpp" +#line 7132 "MachineIndependent/glslang_tab.cpp" break; case 183: /* storage_qualifier: HITATTREXT */ -#line 1553 "MachineIndependent/glslang.y" +#line 1539 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7109,11 +7141,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7113 "MachineIndependent/glslang_tab.cpp" +#line 7145 "MachineIndependent/glslang_tab.cpp" break; case 184: /* storage_qualifier: PAYLOADNV */ -#line 1561 "MachineIndependent/glslang.y" +#line 1547 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7122,11 +7154,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7126 "MachineIndependent/glslang_tab.cpp" +#line 7158 "MachineIndependent/glslang_tab.cpp" break; case 185: /* storage_qualifier: PAYLOADEXT */ -#line 1569 "MachineIndependent/glslang.y" +#line 1555 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7135,11 +7167,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7139 "MachineIndependent/glslang_tab.cpp" +#line 7171 "MachineIndependent/glslang_tab.cpp" break; case 186: /* storage_qualifier: PAYLOADINNV */ -#line 1577 "MachineIndependent/glslang.y" +#line 1563 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7148,11 +7180,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7152 "MachineIndependent/glslang_tab.cpp" +#line 7184 "MachineIndependent/glslang_tab.cpp" break; case 187: /* storage_qualifier: PAYLOADINEXT */ -#line 1585 "MachineIndependent/glslang.y" +#line 1571 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7161,11 +7193,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7165 "MachineIndependent/glslang_tab.cpp" +#line 7197 "MachineIndependent/glslang_tab.cpp" break; case 188: /* storage_qualifier: CALLDATANV */ -#line 1593 "MachineIndependent/glslang.y" +#line 1579 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7174,11 +7206,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7178 "MachineIndependent/glslang_tab.cpp" +#line 7210 "MachineIndependent/glslang_tab.cpp" break; case 189: /* storage_qualifier: CALLDATAEXT */ -#line 1601 "MachineIndependent/glslang.y" +#line 1587 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7187,11 +7219,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7191 "MachineIndependent/glslang_tab.cpp" +#line 7223 "MachineIndependent/glslang_tab.cpp" break; case 190: /* storage_qualifier: CALLDATAINNV */ -#line 1609 "MachineIndependent/glslang.y" +#line 1595 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); @@ -7199,11 +7231,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7203 "MachineIndependent/glslang_tab.cpp" +#line 7235 "MachineIndependent/glslang_tab.cpp" break; case 191: /* storage_qualifier: CALLDATAINEXT */ -#line 1616 "MachineIndependent/glslang.y" +#line 1602 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); @@ -7211,138 +7243,138 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7215 "MachineIndependent/glslang_tab.cpp" +#line 7247 "MachineIndependent/glslang_tab.cpp" break; case 192: /* storage_qualifier: COHERENT */ -#line 1623 "MachineIndependent/glslang.y" +#line 1609 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.coherent = true; } -#line 7224 "MachineIndependent/glslang_tab.cpp" +#line 7256 "MachineIndependent/glslang_tab.cpp" break; case 193: /* storage_qualifier: DEVICECOHERENT */ -#line 1627 "MachineIndependent/glslang.y" +#line 1613 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); (yyval.interm.type).qualifier.devicecoherent = true; } -#line 7234 "MachineIndependent/glslang_tab.cpp" +#line 7266 "MachineIndependent/glslang_tab.cpp" break; case 194: /* storage_qualifier: QUEUEFAMILYCOHERENT */ -#line 1632 "MachineIndependent/glslang.y" +#line 1618 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); (yyval.interm.type).qualifier.queuefamilycoherent = true; } -#line 7244 "MachineIndependent/glslang_tab.cpp" +#line 7276 "MachineIndependent/glslang_tab.cpp" break; case 195: /* storage_qualifier: WORKGROUPCOHERENT */ -#line 1637 "MachineIndependent/glslang.y" +#line 1623 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); (yyval.interm.type).qualifier.workgroupcoherent = true; } -#line 7254 "MachineIndependent/glslang_tab.cpp" +#line 7286 "MachineIndependent/glslang_tab.cpp" break; case 196: /* storage_qualifier: SUBGROUPCOHERENT */ -#line 1642 "MachineIndependent/glslang.y" +#line 1628 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); (yyval.interm.type).qualifier.subgroupcoherent = true; } -#line 7264 "MachineIndependent/glslang_tab.cpp" +#line 7296 "MachineIndependent/glslang_tab.cpp" break; case 197: /* storage_qualifier: NONPRIVATE */ -#line 1647 "MachineIndependent/glslang.y" +#line 1633 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); (yyval.interm.type).qualifier.nonprivate = true; } -#line 7274 "MachineIndependent/glslang_tab.cpp" +#line 7306 "MachineIndependent/glslang_tab.cpp" break; case 198: /* storage_qualifier: SHADERCALLCOHERENT */ -#line 1652 "MachineIndependent/glslang.y" +#line 1638 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); (yyval.interm.type).qualifier.shadercallcoherent = true; } -#line 7284 "MachineIndependent/glslang_tab.cpp" +#line 7316 "MachineIndependent/glslang_tab.cpp" break; case 199: /* storage_qualifier: VOLATILE */ -#line 1657 "MachineIndependent/glslang.y" +#line 1643 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.volatil = true; } -#line 7293 "MachineIndependent/glslang_tab.cpp" +#line 7325 "MachineIndependent/glslang_tab.cpp" break; case 200: /* storage_qualifier: RESTRICT */ -#line 1661 "MachineIndependent/glslang.y" +#line 1647 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.restrict = true; } -#line 7302 "MachineIndependent/glslang_tab.cpp" +#line 7334 "MachineIndependent/glslang_tab.cpp" break; case 201: /* storage_qualifier: READONLY */ -#line 1665 "MachineIndependent/glslang.y" +#line 1651 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.readonly = true; } -#line 7311 "MachineIndependent/glslang_tab.cpp" +#line 7343 "MachineIndependent/glslang_tab.cpp" break; case 202: /* storage_qualifier: WRITEONLY */ -#line 1669 "MachineIndependent/glslang.y" +#line 1655 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.writeonly = true; } -#line 7320 "MachineIndependent/glslang_tab.cpp" +#line 7352 "MachineIndependent/glslang_tab.cpp" break; case 203: /* storage_qualifier: SUBROUTINE */ -#line 1673 "MachineIndependent/glslang.y" +#line 1659 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 7331 "MachineIndependent/glslang_tab.cpp" +#line 7363 "MachineIndependent/glslang_tab.cpp" break; case 204: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ -#line 1679 "MachineIndependent/glslang.y" +#line 1665 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 7342 "MachineIndependent/glslang_tab.cpp" +#line 7374 "MachineIndependent/glslang_tab.cpp" break; case 205: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ -#line 1685 "MachineIndependent/glslang.y" +#line 1671 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskPayloadSharedEXT"); @@ -7350,38 +7382,38 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqtaskPayloadSharedEXT; } -#line 7354 "MachineIndependent/glslang_tab.cpp" +#line 7386 "MachineIndependent/glslang_tab.cpp" break; case 206: /* non_uniform_qualifier: NONUNIFORM */ -#line 1697 "MachineIndependent/glslang.y" +#line 1681 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nonUniform = true; } -#line 7363 "MachineIndependent/glslang_tab.cpp" +#line 7395 "MachineIndependent/glslang_tab.cpp" break; case 207: /* type_name_list: IDENTIFIER */ -#line 1704 "MachineIndependent/glslang.y" +#line 1688 "MachineIndependent/glslang.y" { // TODO } -#line 7371 "MachineIndependent/glslang_tab.cpp" +#line 7403 "MachineIndependent/glslang_tab.cpp" break; case 208: /* type_name_list: type_name_list COMMA IDENTIFIER */ -#line 1707 "MachineIndependent/glslang.y" +#line 1691 "MachineIndependent/glslang.y" { // TODO: 4.0 semantics: subroutines // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } -#line 7381 "MachineIndependent/glslang_tab.cpp" +#line 7413 "MachineIndependent/glslang_tab.cpp" break; case 209: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ -#line 1716 "MachineIndependent/glslang.y" +#line 1699 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); @@ -7389,11 +7421,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.coopMatTypeParametersCheck((yyvsp[-1].interm.type).loc, (yyval.interm.type)); } -#line 7393 "MachineIndependent/glslang_tab.cpp" +#line 7425 "MachineIndependent/glslang_tab.cpp" break; case 210: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ -#line 1723 "MachineIndependent/glslang.y" +#line 1706 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.type) = (yyvsp[-2].interm.type); @@ -7402,21 +7434,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; parseContext.coopMatTypeParametersCheck((yyvsp[-2].interm.type).loc, (yyval.interm.type)); } -#line 7406 "MachineIndependent/glslang_tab.cpp" +#line 7438 "MachineIndependent/glslang_tab.cpp" break; case 211: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ -#line 1734 "MachineIndependent/glslang.y" +#line 1717 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } -#line 7416 "MachineIndependent/glslang_tab.cpp" +#line 7448 "MachineIndependent/glslang_tab.cpp" break; case 212: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1739 "MachineIndependent/glslang.y" +#line 1722 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-2].lex).loc; (yyval.interm).arraySizes = new TArraySizes; @@ -7425,20 +7457,20 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7429 "MachineIndependent/glslang_tab.cpp" +#line 7461 "MachineIndependent/glslang_tab.cpp" break; case 213: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ -#line 1747 "MachineIndependent/glslang.y" +#line 1730 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); (yyval.interm).arraySizes->addInnerSize(); } -#line 7438 "MachineIndependent/glslang_tab.cpp" +#line 7470 "MachineIndependent/glslang_tab.cpp" break; case 214: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1751 "MachineIndependent/glslang.y" +#line 1734 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); @@ -7446,45 +7478,46 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7450 "MachineIndependent/glslang_tab.cpp" +#line 7482 "MachineIndependent/glslang_tab.cpp" break; case 215: /* type_parameter_specifier_opt: type_parameter_specifier */ -#line 1761 "MachineIndependent/glslang.y" +#line 1744 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[0].interm.typeParameters); } -#line 7458 "MachineIndependent/glslang_tab.cpp" +#line 7490 "MachineIndependent/glslang_tab.cpp" break; case 216: /* type_parameter_specifier_opt: %empty */ -#line 1764 "MachineIndependent/glslang.y" +#line 1747 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = 0; } -#line 7466 "MachineIndependent/glslang_tab.cpp" +#line 7498 "MachineIndependent/glslang_tab.cpp" break; case 217: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ -#line 1770 "MachineIndependent/glslang.y" +#line 1753 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-1].interm.typeParameters); } -#line 7474 "MachineIndependent/glslang_tab.cpp" +#line 7506 "MachineIndependent/glslang_tab.cpp" break; case 218: /* type_parameter_specifier_list: type_specifier */ -#line 1776 "MachineIndependent/glslang.y" +#line 1759 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = new TTypeParameters; (yyval.interm.typeParameters)->arraySizes = new TArraySizes; + (yyval.interm.typeParameters)->spirvType = (yyvsp[0].interm.type).spirvType; (yyval.interm.typeParameters)->basicType = (yyvsp[0].interm.type).basicType; } -#line 7484 "MachineIndependent/glslang_tab.cpp" +#line 7517 "MachineIndependent/glslang_tab.cpp" break; case 219: /* type_parameter_specifier_list: unary_expression */ -#line 1781 "MachineIndependent/glslang.y" +#line 1765 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = new TTypeParameters; (yyval.interm.typeParameters)->arraySizes = new TArraySizes; @@ -7493,11 +7526,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter", true); (yyval.interm.typeParameters)->arraySizes->addInnerSize(size); } -#line 7497 "MachineIndependent/glslang_tab.cpp" +#line 7530 "MachineIndependent/glslang_tab.cpp" break; case 220: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ -#line 1789 "MachineIndependent/glslang.y" +#line 1773 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-2].interm.typeParameters); @@ -7505,300 +7538,300 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter", true); (yyval.interm.typeParameters)->arraySizes->addInnerSize(size); } -#line 7509 "MachineIndependent/glslang_tab.cpp" +#line 7542 "MachineIndependent/glslang_tab.cpp" break; case 221: /* type_specifier_nonarray: VOID */ -#line 1799 "MachineIndependent/glslang.y" +#line 1783 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtVoid; } -#line 7518 "MachineIndependent/glslang_tab.cpp" +#line 7551 "MachineIndependent/glslang_tab.cpp" break; case 222: /* type_specifier_nonarray: FLOAT */ -#line 1803 "MachineIndependent/glslang.y" +#line 1787 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7527 "MachineIndependent/glslang_tab.cpp" +#line 7560 "MachineIndependent/glslang_tab.cpp" break; case 223: /* type_specifier_nonarray: INT */ -#line 1807 "MachineIndependent/glslang.y" +#line 1791 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7536 "MachineIndependent/glslang_tab.cpp" +#line 7569 "MachineIndependent/glslang_tab.cpp" break; case 224: /* type_specifier_nonarray: UINT */ -#line 1811 "MachineIndependent/glslang.y" +#line 1795 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7546 "MachineIndependent/glslang_tab.cpp" +#line 7579 "MachineIndependent/glslang_tab.cpp" break; case 225: /* type_specifier_nonarray: BOOL */ -#line 1816 "MachineIndependent/glslang.y" +#line 1800 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; } -#line 7555 "MachineIndependent/glslang_tab.cpp" +#line 7588 "MachineIndependent/glslang_tab.cpp" break; case 226: /* type_specifier_nonarray: VEC2 */ -#line 1820 "MachineIndependent/glslang.y" +#line 1804 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 7565 "MachineIndependent/glslang_tab.cpp" +#line 7598 "MachineIndependent/glslang_tab.cpp" break; case 227: /* type_specifier_nonarray: VEC3 */ -#line 1825 "MachineIndependent/glslang.y" +#line 1809 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 7575 "MachineIndependent/glslang_tab.cpp" +#line 7608 "MachineIndependent/glslang_tab.cpp" break; case 228: /* type_specifier_nonarray: VEC4 */ -#line 1830 "MachineIndependent/glslang.y" +#line 1814 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 7585 "MachineIndependent/glslang_tab.cpp" +#line 7618 "MachineIndependent/glslang_tab.cpp" break; case 229: /* type_specifier_nonarray: BVEC2 */ -#line 1835 "MachineIndependent/glslang.y" +#line 1819 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(2); } -#line 7595 "MachineIndependent/glslang_tab.cpp" +#line 7628 "MachineIndependent/glslang_tab.cpp" break; case 230: /* type_specifier_nonarray: BVEC3 */ -#line 1840 "MachineIndependent/glslang.y" +#line 1824 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(3); } -#line 7605 "MachineIndependent/glslang_tab.cpp" +#line 7638 "MachineIndependent/glslang_tab.cpp" break; case 231: /* type_specifier_nonarray: BVEC4 */ -#line 1845 "MachineIndependent/glslang.y" +#line 1829 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(4); } -#line 7615 "MachineIndependent/glslang_tab.cpp" +#line 7648 "MachineIndependent/glslang_tab.cpp" break; case 232: /* type_specifier_nonarray: IVEC2 */ -#line 1850 "MachineIndependent/glslang.y" +#line 1834 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 7625 "MachineIndependent/glslang_tab.cpp" +#line 7658 "MachineIndependent/glslang_tab.cpp" break; case 233: /* type_specifier_nonarray: IVEC3 */ -#line 1855 "MachineIndependent/glslang.y" +#line 1839 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 7635 "MachineIndependent/glslang_tab.cpp" +#line 7668 "MachineIndependent/glslang_tab.cpp" break; case 234: /* type_specifier_nonarray: IVEC4 */ -#line 1860 "MachineIndependent/glslang.y" +#line 1844 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 7645 "MachineIndependent/glslang_tab.cpp" +#line 7678 "MachineIndependent/glslang_tab.cpp" break; case 235: /* type_specifier_nonarray: UVEC2 */ -#line 1865 "MachineIndependent/glslang.y" +#line 1849 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 7656 "MachineIndependent/glslang_tab.cpp" +#line 7689 "MachineIndependent/glslang_tab.cpp" break; case 236: /* type_specifier_nonarray: UVEC3 */ -#line 1871 "MachineIndependent/glslang.y" +#line 1855 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 7667 "MachineIndependent/glslang_tab.cpp" +#line 7700 "MachineIndependent/glslang_tab.cpp" break; case 237: /* type_specifier_nonarray: UVEC4 */ -#line 1877 "MachineIndependent/glslang.y" +#line 1861 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 7678 "MachineIndependent/glslang_tab.cpp" +#line 7711 "MachineIndependent/glslang_tab.cpp" break; case 238: /* type_specifier_nonarray: MAT2 */ -#line 1883 "MachineIndependent/glslang.y" +#line 1867 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7688 "MachineIndependent/glslang_tab.cpp" +#line 7721 "MachineIndependent/glslang_tab.cpp" break; case 239: /* type_specifier_nonarray: MAT3 */ -#line 1888 "MachineIndependent/glslang.y" +#line 1872 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7698 "MachineIndependent/glslang_tab.cpp" +#line 7731 "MachineIndependent/glslang_tab.cpp" break; case 240: /* type_specifier_nonarray: MAT4 */ -#line 1893 "MachineIndependent/glslang.y" +#line 1877 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7708 "MachineIndependent/glslang_tab.cpp" +#line 7741 "MachineIndependent/glslang_tab.cpp" break; case 241: /* type_specifier_nonarray: MAT2X2 */ -#line 1898 "MachineIndependent/glslang.y" +#line 1882 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7718 "MachineIndependent/glslang_tab.cpp" +#line 7751 "MachineIndependent/glslang_tab.cpp" break; case 242: /* type_specifier_nonarray: MAT2X3 */ -#line 1903 "MachineIndependent/glslang.y" +#line 1887 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 7728 "MachineIndependent/glslang_tab.cpp" +#line 7761 "MachineIndependent/glslang_tab.cpp" break; case 243: /* type_specifier_nonarray: MAT2X4 */ -#line 1908 "MachineIndependent/glslang.y" +#line 1892 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 7738 "MachineIndependent/glslang_tab.cpp" +#line 7771 "MachineIndependent/glslang_tab.cpp" break; case 244: /* type_specifier_nonarray: MAT3X2 */ -#line 1913 "MachineIndependent/glslang.y" +#line 1897 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 7748 "MachineIndependent/glslang_tab.cpp" +#line 7781 "MachineIndependent/glslang_tab.cpp" break; case 245: /* type_specifier_nonarray: MAT3X3 */ -#line 1918 "MachineIndependent/glslang.y" +#line 1902 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7758 "MachineIndependent/glslang_tab.cpp" +#line 7791 "MachineIndependent/glslang_tab.cpp" break; case 246: /* type_specifier_nonarray: MAT3X4 */ -#line 1923 "MachineIndependent/glslang.y" +#line 1907 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 7768 "MachineIndependent/glslang_tab.cpp" +#line 7801 "MachineIndependent/glslang_tab.cpp" break; case 247: /* type_specifier_nonarray: MAT4X2 */ -#line 1928 "MachineIndependent/glslang.y" +#line 1912 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 7778 "MachineIndependent/glslang_tab.cpp" +#line 7811 "MachineIndependent/glslang_tab.cpp" break; case 248: /* type_specifier_nonarray: MAT4X3 */ -#line 1933 "MachineIndependent/glslang.y" +#line 1917 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 7788 "MachineIndependent/glslang_tab.cpp" +#line 7821 "MachineIndependent/glslang_tab.cpp" break; case 249: /* type_specifier_nonarray: MAT4X4 */ -#line 1938 "MachineIndependent/glslang.y" +#line 1922 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7798 "MachineIndependent/glslang_tab.cpp" +#line 7831 "MachineIndependent/glslang_tab.cpp" break; case 250: /* type_specifier_nonarray: DOUBLE */ -#line 1944 "MachineIndependent/glslang.y" +#line 1927 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7806,121 +7839,121 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7810 "MachineIndependent/glslang_tab.cpp" +#line 7843 "MachineIndependent/glslang_tab.cpp" break; case 251: /* type_specifier_nonarray: FLOAT16_T */ -#line 1951 "MachineIndependent/glslang.y" +#line 1934 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; } -#line 7820 "MachineIndependent/glslang_tab.cpp" +#line 7853 "MachineIndependent/glslang_tab.cpp" break; case 252: /* type_specifier_nonarray: FLOAT32_T */ -#line 1956 "MachineIndependent/glslang.y" +#line 1939 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7830 "MachineIndependent/glslang_tab.cpp" +#line 7863 "MachineIndependent/glslang_tab.cpp" break; case 253: /* type_specifier_nonarray: FLOAT64_T */ -#line 1961 "MachineIndependent/glslang.y" +#line 1944 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7840 "MachineIndependent/glslang_tab.cpp" +#line 7873 "MachineIndependent/glslang_tab.cpp" break; case 254: /* type_specifier_nonarray: INT8_T */ -#line 1966 "MachineIndependent/glslang.y" +#line 1949 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; } -#line 7850 "MachineIndependent/glslang_tab.cpp" +#line 7883 "MachineIndependent/glslang_tab.cpp" break; case 255: /* type_specifier_nonarray: UINT8_T */ -#line 1971 "MachineIndependent/glslang.y" +#line 1954 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; } -#line 7860 "MachineIndependent/glslang_tab.cpp" +#line 7893 "MachineIndependent/glslang_tab.cpp" break; case 256: /* type_specifier_nonarray: INT16_T */ -#line 1976 "MachineIndependent/glslang.y" +#line 1959 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; } -#line 7870 "MachineIndependent/glslang_tab.cpp" +#line 7903 "MachineIndependent/glslang_tab.cpp" break; case 257: /* type_specifier_nonarray: UINT16_T */ -#line 1981 "MachineIndependent/glslang.y" +#line 1964 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; } -#line 7880 "MachineIndependent/glslang_tab.cpp" +#line 7913 "MachineIndependent/glslang_tab.cpp" break; case 258: /* type_specifier_nonarray: INT32_T */ -#line 1986 "MachineIndependent/glslang.y" +#line 1969 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7890 "MachineIndependent/glslang_tab.cpp" +#line 7923 "MachineIndependent/glslang_tab.cpp" break; case 259: /* type_specifier_nonarray: UINT32_T */ -#line 1991 "MachineIndependent/glslang.y" +#line 1974 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7900 "MachineIndependent/glslang_tab.cpp" +#line 7933 "MachineIndependent/glslang_tab.cpp" break; case 260: /* type_specifier_nonarray: INT64_T */ -#line 1996 "MachineIndependent/glslang.y" +#line 1979 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; } -#line 7910 "MachineIndependent/glslang_tab.cpp" +#line 7943 "MachineIndependent/glslang_tab.cpp" break; case 261: /* type_specifier_nonarray: UINT64_T */ -#line 2001 "MachineIndependent/glslang.y" +#line 1984 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; } -#line 7920 "MachineIndependent/glslang_tab.cpp" +#line 7953 "MachineIndependent/glslang_tab.cpp" break; case 262: /* type_specifier_nonarray: DVEC2 */ -#line 2006 "MachineIndependent/glslang.y" +#line 1989 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7929,11 +7962,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 7933 "MachineIndependent/glslang_tab.cpp" +#line 7966 "MachineIndependent/glslang_tab.cpp" break; case 263: /* type_specifier_nonarray: DVEC3 */ -#line 2014 "MachineIndependent/glslang.y" +#line 1997 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7942,11 +7975,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 7946 "MachineIndependent/glslang_tab.cpp" +#line 7979 "MachineIndependent/glslang_tab.cpp" break; case 264: /* type_specifier_nonarray: DVEC4 */ -#line 2022 "MachineIndependent/glslang.y" +#line 2005 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7955,374 +7988,374 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 7959 "MachineIndependent/glslang_tab.cpp" +#line 7992 "MachineIndependent/glslang_tab.cpp" break; case 265: /* type_specifier_nonarray: F16VEC2 */ -#line 2030 "MachineIndependent/glslang.y" +#line 2013 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(2); } -#line 7970 "MachineIndependent/glslang_tab.cpp" +#line 8003 "MachineIndependent/glslang_tab.cpp" break; case 266: /* type_specifier_nonarray: F16VEC3 */ -#line 2036 "MachineIndependent/glslang.y" +#line 2019 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(3); } -#line 7981 "MachineIndependent/glslang_tab.cpp" +#line 8014 "MachineIndependent/glslang_tab.cpp" break; case 267: /* type_specifier_nonarray: F16VEC4 */ -#line 2042 "MachineIndependent/glslang.y" +#line 2025 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(4); } -#line 7992 "MachineIndependent/glslang_tab.cpp" +#line 8025 "MachineIndependent/glslang_tab.cpp" break; case 268: /* type_specifier_nonarray: F32VEC2 */ -#line 2048 "MachineIndependent/glslang.y" +#line 2031 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 8003 "MachineIndependent/glslang_tab.cpp" +#line 8036 "MachineIndependent/glslang_tab.cpp" break; case 269: /* type_specifier_nonarray: F32VEC3 */ -#line 2054 "MachineIndependent/glslang.y" +#line 2037 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 8014 "MachineIndependent/glslang_tab.cpp" +#line 8047 "MachineIndependent/glslang_tab.cpp" break; case 270: /* type_specifier_nonarray: F32VEC4 */ -#line 2060 "MachineIndependent/glslang.y" +#line 2043 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 8025 "MachineIndependent/glslang_tab.cpp" +#line 8058 "MachineIndependent/glslang_tab.cpp" break; case 271: /* type_specifier_nonarray: F64VEC2 */ -#line 2066 "MachineIndependent/glslang.y" +#line 2049 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 8036 "MachineIndependent/glslang_tab.cpp" +#line 8069 "MachineIndependent/glslang_tab.cpp" break; case 272: /* type_specifier_nonarray: F64VEC3 */ -#line 2072 "MachineIndependent/glslang.y" +#line 2055 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 8047 "MachineIndependent/glslang_tab.cpp" +#line 8080 "MachineIndependent/glslang_tab.cpp" break; case 273: /* type_specifier_nonarray: F64VEC4 */ -#line 2078 "MachineIndependent/glslang.y" +#line 2061 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 8058 "MachineIndependent/glslang_tab.cpp" +#line 8091 "MachineIndependent/glslang_tab.cpp" break; case 274: /* type_specifier_nonarray: I8VEC2 */ -#line 2084 "MachineIndependent/glslang.y" +#line 2067 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(2); } -#line 8069 "MachineIndependent/glslang_tab.cpp" +#line 8102 "MachineIndependent/glslang_tab.cpp" break; case 275: /* type_specifier_nonarray: I8VEC3 */ -#line 2090 "MachineIndependent/glslang.y" +#line 2073 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(3); } -#line 8080 "MachineIndependent/glslang_tab.cpp" +#line 8113 "MachineIndependent/glslang_tab.cpp" break; case 276: /* type_specifier_nonarray: I8VEC4 */ -#line 2096 "MachineIndependent/glslang.y" +#line 2079 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(4); } -#line 8091 "MachineIndependent/glslang_tab.cpp" +#line 8124 "MachineIndependent/glslang_tab.cpp" break; case 277: /* type_specifier_nonarray: I16VEC2 */ -#line 2102 "MachineIndependent/glslang.y" +#line 2085 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(2); } -#line 8102 "MachineIndependent/glslang_tab.cpp" +#line 8135 "MachineIndependent/glslang_tab.cpp" break; case 278: /* type_specifier_nonarray: I16VEC3 */ -#line 2108 "MachineIndependent/glslang.y" +#line 2091 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(3); } -#line 8113 "MachineIndependent/glslang_tab.cpp" +#line 8146 "MachineIndependent/glslang_tab.cpp" break; case 279: /* type_specifier_nonarray: I16VEC4 */ -#line 2114 "MachineIndependent/glslang.y" +#line 2097 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(4); } -#line 8124 "MachineIndependent/glslang_tab.cpp" +#line 8157 "MachineIndependent/glslang_tab.cpp" break; case 280: /* type_specifier_nonarray: I32VEC2 */ -#line 2120 "MachineIndependent/glslang.y" +#line 2103 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 8135 "MachineIndependent/glslang_tab.cpp" +#line 8168 "MachineIndependent/glslang_tab.cpp" break; case 281: /* type_specifier_nonarray: I32VEC3 */ -#line 2126 "MachineIndependent/glslang.y" +#line 2109 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 8146 "MachineIndependent/glslang_tab.cpp" +#line 8179 "MachineIndependent/glslang_tab.cpp" break; case 282: /* type_specifier_nonarray: I32VEC4 */ -#line 2132 "MachineIndependent/glslang.y" +#line 2115 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 8157 "MachineIndependent/glslang_tab.cpp" +#line 8190 "MachineIndependent/glslang_tab.cpp" break; case 283: /* type_specifier_nonarray: I64VEC2 */ -#line 2138 "MachineIndependent/glslang.y" +#line 2121 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(2); } -#line 8168 "MachineIndependent/glslang_tab.cpp" +#line 8201 "MachineIndependent/glslang_tab.cpp" break; case 284: /* type_specifier_nonarray: I64VEC3 */ -#line 2144 "MachineIndependent/glslang.y" +#line 2127 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(3); } -#line 8179 "MachineIndependent/glslang_tab.cpp" +#line 8212 "MachineIndependent/glslang_tab.cpp" break; case 285: /* type_specifier_nonarray: I64VEC4 */ -#line 2150 "MachineIndependent/glslang.y" +#line 2133 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(4); } -#line 8190 "MachineIndependent/glslang_tab.cpp" +#line 8223 "MachineIndependent/glslang_tab.cpp" break; case 286: /* type_specifier_nonarray: U8VEC2 */ -#line 2156 "MachineIndependent/glslang.y" +#line 2139 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(2); } -#line 8201 "MachineIndependent/glslang_tab.cpp" +#line 8234 "MachineIndependent/glslang_tab.cpp" break; case 287: /* type_specifier_nonarray: U8VEC3 */ -#line 2162 "MachineIndependent/glslang.y" +#line 2145 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(3); } -#line 8212 "MachineIndependent/glslang_tab.cpp" +#line 8245 "MachineIndependent/glslang_tab.cpp" break; case 288: /* type_specifier_nonarray: U8VEC4 */ -#line 2168 "MachineIndependent/glslang.y" +#line 2151 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(4); } -#line 8223 "MachineIndependent/glslang_tab.cpp" +#line 8256 "MachineIndependent/glslang_tab.cpp" break; case 289: /* type_specifier_nonarray: U16VEC2 */ -#line 2174 "MachineIndependent/glslang.y" +#line 2157 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(2); } -#line 8234 "MachineIndependent/glslang_tab.cpp" +#line 8267 "MachineIndependent/glslang_tab.cpp" break; case 290: /* type_specifier_nonarray: U16VEC3 */ -#line 2180 "MachineIndependent/glslang.y" +#line 2163 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(3); } -#line 8245 "MachineIndependent/glslang_tab.cpp" +#line 8278 "MachineIndependent/glslang_tab.cpp" break; case 291: /* type_specifier_nonarray: U16VEC4 */ -#line 2186 "MachineIndependent/glslang.y" +#line 2169 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(4); } -#line 8256 "MachineIndependent/glslang_tab.cpp" +#line 8289 "MachineIndependent/glslang_tab.cpp" break; case 292: /* type_specifier_nonarray: U32VEC2 */ -#line 2192 "MachineIndependent/glslang.y" +#line 2175 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 8267 "MachineIndependent/glslang_tab.cpp" +#line 8300 "MachineIndependent/glslang_tab.cpp" break; case 293: /* type_specifier_nonarray: U32VEC3 */ -#line 2198 "MachineIndependent/glslang.y" +#line 2181 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 8278 "MachineIndependent/glslang_tab.cpp" +#line 8311 "MachineIndependent/glslang_tab.cpp" break; case 294: /* type_specifier_nonarray: U32VEC4 */ -#line 2204 "MachineIndependent/glslang.y" +#line 2187 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 8289 "MachineIndependent/glslang_tab.cpp" +#line 8322 "MachineIndependent/glslang_tab.cpp" break; case 295: /* type_specifier_nonarray: U64VEC2 */ -#line 2210 "MachineIndependent/glslang.y" +#line 2193 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(2); } -#line 8300 "MachineIndependent/glslang_tab.cpp" +#line 8333 "MachineIndependent/glslang_tab.cpp" break; case 296: /* type_specifier_nonarray: U64VEC3 */ -#line 2216 "MachineIndependent/glslang.y" +#line 2199 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(3); } -#line 8311 "MachineIndependent/glslang_tab.cpp" +#line 8344 "MachineIndependent/glslang_tab.cpp" break; case 297: /* type_specifier_nonarray: U64VEC4 */ -#line 2222 "MachineIndependent/glslang.y" +#line 2205 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(4); } -#line 8322 "MachineIndependent/glslang_tab.cpp" +#line 8355 "MachineIndependent/glslang_tab.cpp" break; case 298: /* type_specifier_nonarray: DMAT2 */ -#line 2228 "MachineIndependent/glslang.y" +#line 2211 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8331,11 +8364,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8335 "MachineIndependent/glslang_tab.cpp" +#line 8368 "MachineIndependent/glslang_tab.cpp" break; case 299: /* type_specifier_nonarray: DMAT3 */ -#line 2236 "MachineIndependent/glslang.y" +#line 2219 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8344,11 +8377,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8348 "MachineIndependent/glslang_tab.cpp" +#line 8381 "MachineIndependent/glslang_tab.cpp" break; case 300: /* type_specifier_nonarray: DMAT4 */ -#line 2244 "MachineIndependent/glslang.y" +#line 2227 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8357,11 +8390,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8361 "MachineIndependent/glslang_tab.cpp" +#line 8394 "MachineIndependent/glslang_tab.cpp" break; case 301: /* type_specifier_nonarray: DMAT2X2 */ -#line 2252 "MachineIndependent/glslang.y" +#line 2235 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8370,11 +8403,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8374 "MachineIndependent/glslang_tab.cpp" +#line 8407 "MachineIndependent/glslang_tab.cpp" break; case 302: /* type_specifier_nonarray: DMAT2X3 */ -#line 2260 "MachineIndependent/glslang.y" +#line 2243 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8383,11 +8416,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8387 "MachineIndependent/glslang_tab.cpp" +#line 8420 "MachineIndependent/glslang_tab.cpp" break; case 303: /* type_specifier_nonarray: DMAT2X4 */ -#line 2268 "MachineIndependent/glslang.y" +#line 2251 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8396,11 +8429,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8400 "MachineIndependent/glslang_tab.cpp" +#line 8433 "MachineIndependent/glslang_tab.cpp" break; case 304: /* type_specifier_nonarray: DMAT3X2 */ -#line 2276 "MachineIndependent/glslang.y" +#line 2259 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8409,11 +8442,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8413 "MachineIndependent/glslang_tab.cpp" +#line 8446 "MachineIndependent/glslang_tab.cpp" break; case 305: /* type_specifier_nonarray: DMAT3X3 */ -#line 2284 "MachineIndependent/glslang.y" +#line 2267 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8422,11 +8455,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8426 "MachineIndependent/glslang_tab.cpp" +#line 8459 "MachineIndependent/glslang_tab.cpp" break; case 306: /* type_specifier_nonarray: DMAT3X4 */ -#line 2292 "MachineIndependent/glslang.y" +#line 2275 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8435,11 +8468,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8439 "MachineIndependent/glslang_tab.cpp" +#line 8472 "MachineIndependent/glslang_tab.cpp" break; case 307: /* type_specifier_nonarray: DMAT4X2 */ -#line 2300 "MachineIndependent/glslang.y" +#line 2283 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8448,11 +8481,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8452 "MachineIndependent/glslang_tab.cpp" +#line 8485 "MachineIndependent/glslang_tab.cpp" break; case 308: /* type_specifier_nonarray: DMAT4X3 */ -#line 2308 "MachineIndependent/glslang.y" +#line 2291 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8461,11 +8494,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8465 "MachineIndependent/glslang_tab.cpp" +#line 8498 "MachineIndependent/glslang_tab.cpp" break; case 309: /* type_specifier_nonarray: DMAT4X4 */ -#line 2316 "MachineIndependent/glslang.y" +#line 2299 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8474,2261 +8507,2261 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8478 "MachineIndependent/glslang_tab.cpp" +#line 8511 "MachineIndependent/glslang_tab.cpp" break; case 310: /* type_specifier_nonarray: F16MAT2 */ -#line 2324 "MachineIndependent/glslang.y" +#line 2307 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 8489 "MachineIndependent/glslang_tab.cpp" +#line 8522 "MachineIndependent/glslang_tab.cpp" break; case 311: /* type_specifier_nonarray: F16MAT3 */ -#line 2330 "MachineIndependent/glslang.y" +#line 2313 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 8500 "MachineIndependent/glslang_tab.cpp" +#line 8533 "MachineIndependent/glslang_tab.cpp" break; case 312: /* type_specifier_nonarray: F16MAT4 */ -#line 2336 "MachineIndependent/glslang.y" +#line 2319 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8511 "MachineIndependent/glslang_tab.cpp" +#line 8544 "MachineIndependent/glslang_tab.cpp" break; case 313: /* type_specifier_nonarray: F16MAT2X2 */ -#line 2342 "MachineIndependent/glslang.y" +#line 2325 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 8522 "MachineIndependent/glslang_tab.cpp" +#line 8555 "MachineIndependent/glslang_tab.cpp" break; case 314: /* type_specifier_nonarray: F16MAT2X3 */ -#line 2348 "MachineIndependent/glslang.y" +#line 2331 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 3); } -#line 8533 "MachineIndependent/glslang_tab.cpp" +#line 8566 "MachineIndependent/glslang_tab.cpp" break; case 315: /* type_specifier_nonarray: F16MAT2X4 */ -#line 2354 "MachineIndependent/glslang.y" +#line 2337 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 4); } -#line 8544 "MachineIndependent/glslang_tab.cpp" +#line 8577 "MachineIndependent/glslang_tab.cpp" break; case 316: /* type_specifier_nonarray: F16MAT3X2 */ -#line 2360 "MachineIndependent/glslang.y" +#line 2343 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 2); } -#line 8555 "MachineIndependent/glslang_tab.cpp" +#line 8588 "MachineIndependent/glslang_tab.cpp" break; case 317: /* type_specifier_nonarray: F16MAT3X3 */ -#line 2366 "MachineIndependent/glslang.y" +#line 2349 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 8566 "MachineIndependent/glslang_tab.cpp" +#line 8599 "MachineIndependent/glslang_tab.cpp" break; case 318: /* type_specifier_nonarray: F16MAT3X4 */ -#line 2372 "MachineIndependent/glslang.y" +#line 2355 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 4); } -#line 8577 "MachineIndependent/glslang_tab.cpp" +#line 8610 "MachineIndependent/glslang_tab.cpp" break; case 319: /* type_specifier_nonarray: F16MAT4X2 */ -#line 2378 "MachineIndependent/glslang.y" +#line 2361 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 2); } -#line 8588 "MachineIndependent/glslang_tab.cpp" +#line 8621 "MachineIndependent/glslang_tab.cpp" break; case 320: /* type_specifier_nonarray: F16MAT4X3 */ -#line 2384 "MachineIndependent/glslang.y" +#line 2367 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 3); } -#line 8599 "MachineIndependent/glslang_tab.cpp" +#line 8632 "MachineIndependent/glslang_tab.cpp" break; case 321: /* type_specifier_nonarray: F16MAT4X4 */ -#line 2390 "MachineIndependent/glslang.y" +#line 2373 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8610 "MachineIndependent/glslang_tab.cpp" +#line 8643 "MachineIndependent/glslang_tab.cpp" break; case 322: /* type_specifier_nonarray: F32MAT2 */ -#line 2396 "MachineIndependent/glslang.y" +#line 2379 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 8621 "MachineIndependent/glslang_tab.cpp" +#line 8654 "MachineIndependent/glslang_tab.cpp" break; case 323: /* type_specifier_nonarray: F32MAT3 */ -#line 2402 "MachineIndependent/glslang.y" +#line 2385 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8632 "MachineIndependent/glslang_tab.cpp" +#line 8665 "MachineIndependent/glslang_tab.cpp" break; case 324: /* type_specifier_nonarray: F32MAT4 */ -#line 2408 "MachineIndependent/glslang.y" +#line 2391 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8643 "MachineIndependent/glslang_tab.cpp" +#line 8676 "MachineIndependent/glslang_tab.cpp" break; case 325: /* type_specifier_nonarray: F32MAT2X2 */ -#line 2414 "MachineIndependent/glslang.y" +#line 2397 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 8654 "MachineIndependent/glslang_tab.cpp" +#line 8687 "MachineIndependent/glslang_tab.cpp" break; case 326: /* type_specifier_nonarray: F32MAT2X3 */ -#line 2420 "MachineIndependent/glslang.y" +#line 2403 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 8665 "MachineIndependent/glslang_tab.cpp" +#line 8698 "MachineIndependent/glslang_tab.cpp" break; case 327: /* type_specifier_nonarray: F32MAT2X4 */ -#line 2426 "MachineIndependent/glslang.y" +#line 2409 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 8676 "MachineIndependent/glslang_tab.cpp" +#line 8709 "MachineIndependent/glslang_tab.cpp" break; case 328: /* type_specifier_nonarray: F32MAT3X2 */ -#line 2432 "MachineIndependent/glslang.y" +#line 2415 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 8687 "MachineIndependent/glslang_tab.cpp" +#line 8720 "MachineIndependent/glslang_tab.cpp" break; case 329: /* type_specifier_nonarray: F32MAT3X3 */ -#line 2438 "MachineIndependent/glslang.y" +#line 2421 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8698 "MachineIndependent/glslang_tab.cpp" +#line 8731 "MachineIndependent/glslang_tab.cpp" break; case 330: /* type_specifier_nonarray: F32MAT3X4 */ -#line 2444 "MachineIndependent/glslang.y" +#line 2427 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 8709 "MachineIndependent/glslang_tab.cpp" +#line 8742 "MachineIndependent/glslang_tab.cpp" break; case 331: /* type_specifier_nonarray: F32MAT4X2 */ -#line 2450 "MachineIndependent/glslang.y" +#line 2433 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 8720 "MachineIndependent/glslang_tab.cpp" +#line 8753 "MachineIndependent/glslang_tab.cpp" break; case 332: /* type_specifier_nonarray: F32MAT4X3 */ -#line 2456 "MachineIndependent/glslang.y" +#line 2439 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 8731 "MachineIndependent/glslang_tab.cpp" +#line 8764 "MachineIndependent/glslang_tab.cpp" break; case 333: /* type_specifier_nonarray: F32MAT4X4 */ -#line 2462 "MachineIndependent/glslang.y" +#line 2445 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8742 "MachineIndependent/glslang_tab.cpp" +#line 8775 "MachineIndependent/glslang_tab.cpp" break; case 334: /* type_specifier_nonarray: F64MAT2 */ -#line 2468 "MachineIndependent/glslang.y" +#line 2451 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8753 "MachineIndependent/glslang_tab.cpp" +#line 8786 "MachineIndependent/glslang_tab.cpp" break; case 335: /* type_specifier_nonarray: F64MAT3 */ -#line 2474 "MachineIndependent/glslang.y" +#line 2457 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8764 "MachineIndependent/glslang_tab.cpp" +#line 8797 "MachineIndependent/glslang_tab.cpp" break; case 336: /* type_specifier_nonarray: F64MAT4 */ -#line 2480 "MachineIndependent/glslang.y" +#line 2463 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8775 "MachineIndependent/glslang_tab.cpp" +#line 8808 "MachineIndependent/glslang_tab.cpp" break; case 337: /* type_specifier_nonarray: F64MAT2X2 */ -#line 2486 "MachineIndependent/glslang.y" +#line 2469 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8786 "MachineIndependent/glslang_tab.cpp" +#line 8819 "MachineIndependent/glslang_tab.cpp" break; case 338: /* type_specifier_nonarray: F64MAT2X3 */ -#line 2492 "MachineIndependent/glslang.y" +#line 2475 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8797 "MachineIndependent/glslang_tab.cpp" +#line 8830 "MachineIndependent/glslang_tab.cpp" break; case 339: /* type_specifier_nonarray: F64MAT2X4 */ -#line 2498 "MachineIndependent/glslang.y" +#line 2481 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8808 "MachineIndependent/glslang_tab.cpp" +#line 8841 "MachineIndependent/glslang_tab.cpp" break; case 340: /* type_specifier_nonarray: F64MAT3X2 */ -#line 2504 "MachineIndependent/glslang.y" +#line 2487 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8819 "MachineIndependent/glslang_tab.cpp" +#line 8852 "MachineIndependent/glslang_tab.cpp" break; case 341: /* type_specifier_nonarray: F64MAT3X3 */ -#line 2510 "MachineIndependent/glslang.y" +#line 2493 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8830 "MachineIndependent/glslang_tab.cpp" +#line 8863 "MachineIndependent/glslang_tab.cpp" break; case 342: /* type_specifier_nonarray: F64MAT3X4 */ -#line 2516 "MachineIndependent/glslang.y" +#line 2499 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8841 "MachineIndependent/glslang_tab.cpp" +#line 8874 "MachineIndependent/glslang_tab.cpp" break; case 343: /* type_specifier_nonarray: F64MAT4X2 */ -#line 2522 "MachineIndependent/glslang.y" +#line 2505 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8852 "MachineIndependent/glslang_tab.cpp" +#line 8885 "MachineIndependent/glslang_tab.cpp" break; case 344: /* type_specifier_nonarray: F64MAT4X3 */ -#line 2528 "MachineIndependent/glslang.y" +#line 2511 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8863 "MachineIndependent/glslang_tab.cpp" +#line 8896 "MachineIndependent/glslang_tab.cpp" break; case 345: /* type_specifier_nonarray: F64MAT4X4 */ -#line 2534 "MachineIndependent/glslang.y" +#line 2517 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8874 "MachineIndependent/glslang_tab.cpp" +#line 8907 "MachineIndependent/glslang_tab.cpp" break; case 346: /* type_specifier_nonarray: ACCSTRUCTNV */ -#line 2540 "MachineIndependent/glslang.y" +#line 2523 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8883 "MachineIndependent/glslang_tab.cpp" +#line 8916 "MachineIndependent/glslang_tab.cpp" break; case 347: /* type_specifier_nonarray: ACCSTRUCTEXT */ -#line 2544 "MachineIndependent/glslang.y" +#line 2527 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8892 "MachineIndependent/glslang_tab.cpp" +#line 8925 "MachineIndependent/glslang_tab.cpp" break; case 348: /* type_specifier_nonarray: RAYQUERYEXT */ -#line 2548 "MachineIndependent/glslang.y" +#line 2531 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtRayQuery; } -#line 8901 "MachineIndependent/glslang_tab.cpp" +#line 8934 "MachineIndependent/glslang_tab.cpp" break; case 349: /* type_specifier_nonarray: ATOMIC_UINT */ -#line 2552 "MachineIndependent/glslang.y" +#line 2535 "MachineIndependent/glslang.y" { parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAtomicUint; } -#line 8911 "MachineIndependent/glslang_tab.cpp" +#line 8944 "MachineIndependent/glslang_tab.cpp" break; case 350: /* type_specifier_nonarray: SAMPLER1D */ -#line 2557 "MachineIndependent/glslang.y" +#line 2540 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } -#line 8921 "MachineIndependent/glslang_tab.cpp" +#line 8954 "MachineIndependent/glslang_tab.cpp" break; case 351: /* type_specifier_nonarray: SAMPLER2D */ -#line 2563 "MachineIndependent/glslang.y" +#line 2545 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } -#line 8931 "MachineIndependent/glslang_tab.cpp" +#line 8964 "MachineIndependent/glslang_tab.cpp" break; case 352: /* type_specifier_nonarray: SAMPLER3D */ -#line 2568 "MachineIndependent/glslang.y" +#line 2550 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } -#line 8941 "MachineIndependent/glslang_tab.cpp" +#line 8974 "MachineIndependent/glslang_tab.cpp" break; case 353: /* type_specifier_nonarray: SAMPLERCUBE */ -#line 2573 "MachineIndependent/glslang.y" +#line 2555 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } -#line 8951 "MachineIndependent/glslang_tab.cpp" +#line 8984 "MachineIndependent/glslang_tab.cpp" break; case 354: /* type_specifier_nonarray: SAMPLER2DSHADOW */ -#line 2578 "MachineIndependent/glslang.y" +#line 2560 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } -#line 8961 "MachineIndependent/glslang_tab.cpp" +#line 8994 "MachineIndependent/glslang_tab.cpp" break; case 355: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ -#line 2583 "MachineIndependent/glslang.y" +#line 2565 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } -#line 8971 "MachineIndependent/glslang_tab.cpp" +#line 9004 "MachineIndependent/glslang_tab.cpp" break; case 356: /* type_specifier_nonarray: SAMPLER2DARRAY */ -#line 2588 "MachineIndependent/glslang.y" +#line 2570 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } -#line 8981 "MachineIndependent/glslang_tab.cpp" +#line 9014 "MachineIndependent/glslang_tab.cpp" break; case 357: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ -#line 2593 "MachineIndependent/glslang.y" +#line 2575 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } -#line 8991 "MachineIndependent/glslang_tab.cpp" +#line 9024 "MachineIndependent/glslang_tab.cpp" break; case 358: /* type_specifier_nonarray: SAMPLER1DSHADOW */ -#line 2599 "MachineIndependent/glslang.y" +#line 2580 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } -#line 9001 "MachineIndependent/glslang_tab.cpp" +#line 9034 "MachineIndependent/glslang_tab.cpp" break; case 359: /* type_specifier_nonarray: SAMPLER1DARRAY */ -#line 2604 "MachineIndependent/glslang.y" +#line 2585 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } -#line 9011 "MachineIndependent/glslang_tab.cpp" +#line 9044 "MachineIndependent/glslang_tab.cpp" break; case 360: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ -#line 2609 "MachineIndependent/glslang.y" +#line 2590 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } -#line 9021 "MachineIndependent/glslang_tab.cpp" +#line 9054 "MachineIndependent/glslang_tab.cpp" break; case 361: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ -#line 2614 "MachineIndependent/glslang.y" +#line 2595 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } -#line 9031 "MachineIndependent/glslang_tab.cpp" +#line 9064 "MachineIndependent/glslang_tab.cpp" break; case 362: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ -#line 2619 "MachineIndependent/glslang.y" +#line 2600 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } -#line 9041 "MachineIndependent/glslang_tab.cpp" +#line 9074 "MachineIndependent/glslang_tab.cpp" break; case 363: /* type_specifier_nonarray: F16SAMPLER1D */ -#line 2624 "MachineIndependent/glslang.y" +#line 2605 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); } -#line 9052 "MachineIndependent/glslang_tab.cpp" +#line 9085 "MachineIndependent/glslang_tab.cpp" break; case 364: /* type_specifier_nonarray: F16SAMPLER2D */ -#line 2630 "MachineIndependent/glslang.y" +#line 2611 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); } -#line 9063 "MachineIndependent/glslang_tab.cpp" +#line 9096 "MachineIndependent/glslang_tab.cpp" break; case 365: /* type_specifier_nonarray: F16SAMPLER3D */ -#line 2636 "MachineIndependent/glslang.y" +#line 2617 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); } -#line 9074 "MachineIndependent/glslang_tab.cpp" +#line 9107 "MachineIndependent/glslang_tab.cpp" break; case 366: /* type_specifier_nonarray: F16SAMPLERCUBE */ -#line 2642 "MachineIndependent/glslang.y" +#line 2623 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); } -#line 9085 "MachineIndependent/glslang_tab.cpp" +#line 9118 "MachineIndependent/glslang_tab.cpp" break; case 367: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ -#line 2648 "MachineIndependent/glslang.y" +#line 2629 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); } -#line 9096 "MachineIndependent/glslang_tab.cpp" +#line 9129 "MachineIndependent/glslang_tab.cpp" break; case 368: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ -#line 2654 "MachineIndependent/glslang.y" +#line 2635 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); } -#line 9107 "MachineIndependent/glslang_tab.cpp" +#line 9140 "MachineIndependent/glslang_tab.cpp" break; case 369: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ -#line 2660 "MachineIndependent/glslang.y" +#line 2641 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); } -#line 9118 "MachineIndependent/glslang_tab.cpp" +#line 9151 "MachineIndependent/glslang_tab.cpp" break; case 370: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ -#line 2666 "MachineIndependent/glslang.y" +#line 2647 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); } -#line 9129 "MachineIndependent/glslang_tab.cpp" +#line 9162 "MachineIndependent/glslang_tab.cpp" break; case 371: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ -#line 2672 "MachineIndependent/glslang.y" +#line 2653 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); } -#line 9140 "MachineIndependent/glslang_tab.cpp" +#line 9173 "MachineIndependent/glslang_tab.cpp" break; case 372: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ -#line 2678 "MachineIndependent/glslang.y" +#line 2659 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); } -#line 9151 "MachineIndependent/glslang_tab.cpp" +#line 9184 "MachineIndependent/glslang_tab.cpp" break; case 373: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ -#line 2684 "MachineIndependent/glslang.y" +#line 2665 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); } -#line 9162 "MachineIndependent/glslang_tab.cpp" +#line 9195 "MachineIndependent/glslang_tab.cpp" break; case 374: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ -#line 2690 "MachineIndependent/glslang.y" +#line 2671 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); } -#line 9173 "MachineIndependent/glslang_tab.cpp" +#line 9206 "MachineIndependent/glslang_tab.cpp" break; case 375: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ -#line 2696 "MachineIndependent/glslang.y" +#line 2677 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); } -#line 9184 "MachineIndependent/glslang_tab.cpp" +#line 9217 "MachineIndependent/glslang_tab.cpp" break; case 376: /* type_specifier_nonarray: ISAMPLER1D */ -#line 2702 "MachineIndependent/glslang.y" +#line 2683 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 9194 "MachineIndependent/glslang_tab.cpp" +#line 9227 "MachineIndependent/glslang_tab.cpp" break; case 377: /* type_specifier_nonarray: ISAMPLER2D */ -#line 2708 "MachineIndependent/glslang.y" +#line 2688 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 9204 "MachineIndependent/glslang_tab.cpp" +#line 9237 "MachineIndependent/glslang_tab.cpp" break; case 378: /* type_specifier_nonarray: ISAMPLER3D */ -#line 2713 "MachineIndependent/glslang.y" +#line 2693 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 9214 "MachineIndependent/glslang_tab.cpp" +#line 9247 "MachineIndependent/glslang_tab.cpp" break; case 379: /* type_specifier_nonarray: ISAMPLERCUBE */ -#line 2718 "MachineIndependent/glslang.y" +#line 2698 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 9224 "MachineIndependent/glslang_tab.cpp" +#line 9257 "MachineIndependent/glslang_tab.cpp" break; case 380: /* type_specifier_nonarray: ISAMPLER2DARRAY */ -#line 2723 "MachineIndependent/glslang.y" +#line 2703 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 9234 "MachineIndependent/glslang_tab.cpp" +#line 9267 "MachineIndependent/glslang_tab.cpp" break; case 381: /* type_specifier_nonarray: USAMPLER2D */ -#line 2728 "MachineIndependent/glslang.y" +#line 2708 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 9244 "MachineIndependent/glslang_tab.cpp" +#line 9277 "MachineIndependent/glslang_tab.cpp" break; case 382: /* type_specifier_nonarray: USAMPLER3D */ -#line 2733 "MachineIndependent/glslang.y" +#line 2713 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 9254 "MachineIndependent/glslang_tab.cpp" +#line 9287 "MachineIndependent/glslang_tab.cpp" break; case 383: /* type_specifier_nonarray: USAMPLERCUBE */ -#line 2738 "MachineIndependent/glslang.y" +#line 2718 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 9264 "MachineIndependent/glslang_tab.cpp" +#line 9297 "MachineIndependent/glslang_tab.cpp" break; case 384: /* type_specifier_nonarray: ISAMPLER1DARRAY */ -#line 2744 "MachineIndependent/glslang.y" +#line 2723 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 9274 "MachineIndependent/glslang_tab.cpp" +#line 9307 "MachineIndependent/glslang_tab.cpp" break; case 385: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ -#line 2749 "MachineIndependent/glslang.y" +#line 2728 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 9284 "MachineIndependent/glslang_tab.cpp" +#line 9317 "MachineIndependent/glslang_tab.cpp" break; case 386: /* type_specifier_nonarray: USAMPLER1D */ -#line 2754 "MachineIndependent/glslang.y" +#line 2733 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 9294 "MachineIndependent/glslang_tab.cpp" +#line 9327 "MachineIndependent/glslang_tab.cpp" break; case 387: /* type_specifier_nonarray: USAMPLER1DARRAY */ -#line 2759 "MachineIndependent/glslang.y" +#line 2738 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 9304 "MachineIndependent/glslang_tab.cpp" +#line 9337 "MachineIndependent/glslang_tab.cpp" break; case 388: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ -#line 2764 "MachineIndependent/glslang.y" +#line 2743 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 9314 "MachineIndependent/glslang_tab.cpp" +#line 9347 "MachineIndependent/glslang_tab.cpp" break; case 389: /* type_specifier_nonarray: TEXTURECUBEARRAY */ -#line 2769 "MachineIndependent/glslang.y" +#line 2748 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 9324 "MachineIndependent/glslang_tab.cpp" +#line 9357 "MachineIndependent/glslang_tab.cpp" break; case 390: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ -#line 2774 "MachineIndependent/glslang.y" +#line 2753 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 9334 "MachineIndependent/glslang_tab.cpp" +#line 9367 "MachineIndependent/glslang_tab.cpp" break; case 391: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ -#line 2779 "MachineIndependent/glslang.y" +#line 2758 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 9344 "MachineIndependent/glslang_tab.cpp" +#line 9377 "MachineIndependent/glslang_tab.cpp" break; case 392: /* type_specifier_nonarray: USAMPLER2DARRAY */ -#line 2785 "MachineIndependent/glslang.y" +#line 2763 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 9354 "MachineIndependent/glslang_tab.cpp" +#line 9387 "MachineIndependent/glslang_tab.cpp" break; case 393: /* type_specifier_nonarray: TEXTURE2D */ -#line 2790 "MachineIndependent/glslang.y" +#line 2768 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 9364 "MachineIndependent/glslang_tab.cpp" +#line 9397 "MachineIndependent/glslang_tab.cpp" break; case 394: /* type_specifier_nonarray: TEXTURE3D */ -#line 2795 "MachineIndependent/glslang.y" +#line 2773 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 9374 "MachineIndependent/glslang_tab.cpp" +#line 9407 "MachineIndependent/glslang_tab.cpp" break; case 395: /* type_specifier_nonarray: TEXTURE2DARRAY */ -#line 2800 "MachineIndependent/glslang.y" +#line 2778 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 9384 "MachineIndependent/glslang_tab.cpp" +#line 9417 "MachineIndependent/glslang_tab.cpp" break; case 396: /* type_specifier_nonarray: TEXTURECUBE */ -#line 2805 "MachineIndependent/glslang.y" +#line 2783 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 9394 "MachineIndependent/glslang_tab.cpp" +#line 9427 "MachineIndependent/glslang_tab.cpp" break; case 397: /* type_specifier_nonarray: ITEXTURE2D */ -#line 2810 "MachineIndependent/glslang.y" +#line 2788 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 9404 "MachineIndependent/glslang_tab.cpp" +#line 9437 "MachineIndependent/glslang_tab.cpp" break; case 398: /* type_specifier_nonarray: ITEXTURE3D */ -#line 2815 "MachineIndependent/glslang.y" +#line 2793 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 9414 "MachineIndependent/glslang_tab.cpp" +#line 9447 "MachineIndependent/glslang_tab.cpp" break; case 399: /* type_specifier_nonarray: ITEXTURECUBE */ -#line 2820 "MachineIndependent/glslang.y" +#line 2798 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 9424 "MachineIndependent/glslang_tab.cpp" +#line 9457 "MachineIndependent/glslang_tab.cpp" break; case 400: /* type_specifier_nonarray: ITEXTURE2DARRAY */ -#line 2825 "MachineIndependent/glslang.y" +#line 2803 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 9434 "MachineIndependent/glslang_tab.cpp" +#line 9467 "MachineIndependent/glslang_tab.cpp" break; case 401: /* type_specifier_nonarray: UTEXTURE2D */ -#line 2830 "MachineIndependent/glslang.y" +#line 2808 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 9444 "MachineIndependent/glslang_tab.cpp" +#line 9477 "MachineIndependent/glslang_tab.cpp" break; case 402: /* type_specifier_nonarray: UTEXTURE3D */ -#line 2835 "MachineIndependent/glslang.y" +#line 2813 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 9454 "MachineIndependent/glslang_tab.cpp" +#line 9487 "MachineIndependent/glslang_tab.cpp" break; case 403: /* type_specifier_nonarray: UTEXTURECUBE */ -#line 2840 "MachineIndependent/glslang.y" +#line 2818 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 9464 "MachineIndependent/glslang_tab.cpp" +#line 9497 "MachineIndependent/glslang_tab.cpp" break; case 404: /* type_specifier_nonarray: UTEXTURE2DARRAY */ -#line 2845 "MachineIndependent/glslang.y" +#line 2823 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 9474 "MachineIndependent/glslang_tab.cpp" +#line 9507 "MachineIndependent/glslang_tab.cpp" break; case 405: /* type_specifier_nonarray: SAMPLER */ -#line 2850 "MachineIndependent/glslang.y" +#line 2828 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(false); } -#line 9484 "MachineIndependent/glslang_tab.cpp" +#line 9517 "MachineIndependent/glslang_tab.cpp" break; case 406: /* type_specifier_nonarray: SAMPLERSHADOW */ -#line 2855 "MachineIndependent/glslang.y" +#line 2833 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(true); } -#line 9494 "MachineIndependent/glslang_tab.cpp" +#line 9527 "MachineIndependent/glslang_tab.cpp" break; case 407: /* type_specifier_nonarray: SAMPLER2DRECT */ -#line 2861 "MachineIndependent/glslang.y" +#line 2838 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 9504 "MachineIndependent/glslang_tab.cpp" +#line 9537 "MachineIndependent/glslang_tab.cpp" break; case 408: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ -#line 2866 "MachineIndependent/glslang.y" +#line 2843 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 9514 "MachineIndependent/glslang_tab.cpp" +#line 9547 "MachineIndependent/glslang_tab.cpp" break; case 409: /* type_specifier_nonarray: F16SAMPLER2DRECT */ -#line 2871 "MachineIndependent/glslang.y" +#line 2848 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); } -#line 9525 "MachineIndependent/glslang_tab.cpp" +#line 9558 "MachineIndependent/glslang_tab.cpp" break; case 410: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ -#line 2877 "MachineIndependent/glslang.y" +#line 2854 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); } -#line 9536 "MachineIndependent/glslang_tab.cpp" +#line 9569 "MachineIndependent/glslang_tab.cpp" break; case 411: /* type_specifier_nonarray: ISAMPLER2DRECT */ -#line 2883 "MachineIndependent/glslang.y" +#line 2860 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 9546 "MachineIndependent/glslang_tab.cpp" +#line 9579 "MachineIndependent/glslang_tab.cpp" break; case 412: /* type_specifier_nonarray: USAMPLER2DRECT */ -#line 2888 "MachineIndependent/glslang.y" +#line 2865 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 9556 "MachineIndependent/glslang_tab.cpp" +#line 9589 "MachineIndependent/glslang_tab.cpp" break; case 413: /* type_specifier_nonarray: SAMPLERBUFFER */ -#line 2893 "MachineIndependent/glslang.y" +#line 2870 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 9566 "MachineIndependent/glslang_tab.cpp" +#line 9599 "MachineIndependent/glslang_tab.cpp" break; case 414: /* type_specifier_nonarray: F16SAMPLERBUFFER */ -#line 2898 "MachineIndependent/glslang.y" +#line 2875 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); } -#line 9577 "MachineIndependent/glslang_tab.cpp" +#line 9610 "MachineIndependent/glslang_tab.cpp" break; case 415: /* type_specifier_nonarray: ISAMPLERBUFFER */ -#line 2904 "MachineIndependent/glslang.y" +#line 2881 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 9587 "MachineIndependent/glslang_tab.cpp" +#line 9620 "MachineIndependent/glslang_tab.cpp" break; case 416: /* type_specifier_nonarray: USAMPLERBUFFER */ -#line 2909 "MachineIndependent/glslang.y" +#line 2886 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 9597 "MachineIndependent/glslang_tab.cpp" +#line 9630 "MachineIndependent/glslang_tab.cpp" break; case 417: /* type_specifier_nonarray: SAMPLER2DMS */ -#line 2914 "MachineIndependent/glslang.y" +#line 2891 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 9607 "MachineIndependent/glslang_tab.cpp" +#line 9640 "MachineIndependent/glslang_tab.cpp" break; case 418: /* type_specifier_nonarray: F16SAMPLER2DMS */ -#line 2919 "MachineIndependent/glslang.y" +#line 2896 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); } -#line 9618 "MachineIndependent/glslang_tab.cpp" +#line 9651 "MachineIndependent/glslang_tab.cpp" break; case 419: /* type_specifier_nonarray: ISAMPLER2DMS */ -#line 2925 "MachineIndependent/glslang.y" +#line 2902 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 9628 "MachineIndependent/glslang_tab.cpp" +#line 9661 "MachineIndependent/glslang_tab.cpp" break; case 420: /* type_specifier_nonarray: USAMPLER2DMS */ -#line 2930 "MachineIndependent/glslang.y" +#line 2907 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 9638 "MachineIndependent/glslang_tab.cpp" +#line 9671 "MachineIndependent/glslang_tab.cpp" break; case 421: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ -#line 2935 "MachineIndependent/glslang.y" +#line 2912 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 9648 "MachineIndependent/glslang_tab.cpp" +#line 9681 "MachineIndependent/glslang_tab.cpp" break; case 422: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ -#line 2940 "MachineIndependent/glslang.y" +#line 2917 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); } -#line 9659 "MachineIndependent/glslang_tab.cpp" +#line 9692 "MachineIndependent/glslang_tab.cpp" break; case 423: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ -#line 2946 "MachineIndependent/glslang.y" +#line 2923 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 9669 "MachineIndependent/glslang_tab.cpp" +#line 9702 "MachineIndependent/glslang_tab.cpp" break; case 424: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ -#line 2951 "MachineIndependent/glslang.y" +#line 2928 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 9679 "MachineIndependent/glslang_tab.cpp" +#line 9712 "MachineIndependent/glslang_tab.cpp" break; case 425: /* type_specifier_nonarray: TEXTURE1D */ -#line 2956 "MachineIndependent/glslang.y" +#line 2933 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 9689 "MachineIndependent/glslang_tab.cpp" +#line 9722 "MachineIndependent/glslang_tab.cpp" break; case 426: /* type_specifier_nonarray: F16TEXTURE1D */ -#line 2961 "MachineIndependent/glslang.y" +#line 2938 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); } -#line 9700 "MachineIndependent/glslang_tab.cpp" +#line 9733 "MachineIndependent/glslang_tab.cpp" break; case 427: /* type_specifier_nonarray: F16TEXTURE2D */ -#line 2967 "MachineIndependent/glslang.y" +#line 2944 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); } -#line 9711 "MachineIndependent/glslang_tab.cpp" +#line 9744 "MachineIndependent/glslang_tab.cpp" break; case 428: /* type_specifier_nonarray: F16TEXTURE3D */ -#line 2973 "MachineIndependent/glslang.y" +#line 2950 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); } -#line 9722 "MachineIndependent/glslang_tab.cpp" +#line 9755 "MachineIndependent/glslang_tab.cpp" break; case 429: /* type_specifier_nonarray: F16TEXTURECUBE */ -#line 2979 "MachineIndependent/glslang.y" +#line 2956 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); } -#line 9733 "MachineIndependent/glslang_tab.cpp" +#line 9766 "MachineIndependent/glslang_tab.cpp" break; case 430: /* type_specifier_nonarray: TEXTURE1DARRAY */ -#line 2985 "MachineIndependent/glslang.y" +#line 2962 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 9743 "MachineIndependent/glslang_tab.cpp" +#line 9776 "MachineIndependent/glslang_tab.cpp" break; case 431: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ -#line 2990 "MachineIndependent/glslang.y" +#line 2967 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); } -#line 9754 "MachineIndependent/glslang_tab.cpp" +#line 9787 "MachineIndependent/glslang_tab.cpp" break; case 432: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ -#line 2996 "MachineIndependent/glslang.y" +#line 2973 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); } -#line 9765 "MachineIndependent/glslang_tab.cpp" +#line 9798 "MachineIndependent/glslang_tab.cpp" break; case 433: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ -#line 3002 "MachineIndependent/glslang.y" +#line 2979 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); } -#line 9776 "MachineIndependent/glslang_tab.cpp" +#line 9809 "MachineIndependent/glslang_tab.cpp" break; case 434: /* type_specifier_nonarray: ITEXTURE1D */ -#line 3008 "MachineIndependent/glslang.y" +#line 2985 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 9786 "MachineIndependent/glslang_tab.cpp" +#line 9819 "MachineIndependent/glslang_tab.cpp" break; case 435: /* type_specifier_nonarray: ITEXTURE1DARRAY */ -#line 3013 "MachineIndependent/glslang.y" +#line 2990 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 9796 "MachineIndependent/glslang_tab.cpp" +#line 9829 "MachineIndependent/glslang_tab.cpp" break; case 436: /* type_specifier_nonarray: UTEXTURE1D */ -#line 3018 "MachineIndependent/glslang.y" +#line 2995 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 9806 "MachineIndependent/glslang_tab.cpp" +#line 9839 "MachineIndependent/glslang_tab.cpp" break; case 437: /* type_specifier_nonarray: UTEXTURE1DARRAY */ -#line 3023 "MachineIndependent/glslang.y" +#line 3000 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 9816 "MachineIndependent/glslang_tab.cpp" +#line 9849 "MachineIndependent/glslang_tab.cpp" break; case 438: /* type_specifier_nonarray: TEXTURE2DRECT */ -#line 3028 "MachineIndependent/glslang.y" +#line 3005 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 9826 "MachineIndependent/glslang_tab.cpp" +#line 9859 "MachineIndependent/glslang_tab.cpp" break; case 439: /* type_specifier_nonarray: F16TEXTURE2DRECT */ -#line 3033 "MachineIndependent/glslang.y" +#line 3010 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); } -#line 9837 "MachineIndependent/glslang_tab.cpp" +#line 9870 "MachineIndependent/glslang_tab.cpp" break; case 440: /* type_specifier_nonarray: ITEXTURE2DRECT */ -#line 3039 "MachineIndependent/glslang.y" +#line 3016 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 9847 "MachineIndependent/glslang_tab.cpp" +#line 9880 "MachineIndependent/glslang_tab.cpp" break; case 441: /* type_specifier_nonarray: UTEXTURE2DRECT */ -#line 3044 "MachineIndependent/glslang.y" +#line 3021 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 9857 "MachineIndependent/glslang_tab.cpp" +#line 9890 "MachineIndependent/glslang_tab.cpp" break; case 442: /* type_specifier_nonarray: TEXTUREBUFFER */ -#line 3049 "MachineIndependent/glslang.y" +#line 3026 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 9867 "MachineIndependent/glslang_tab.cpp" +#line 9900 "MachineIndependent/glslang_tab.cpp" break; case 443: /* type_specifier_nonarray: F16TEXTUREBUFFER */ -#line 3054 "MachineIndependent/glslang.y" +#line 3031 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); } -#line 9878 "MachineIndependent/glslang_tab.cpp" +#line 9911 "MachineIndependent/glslang_tab.cpp" break; case 444: /* type_specifier_nonarray: ITEXTUREBUFFER */ -#line 3060 "MachineIndependent/glslang.y" +#line 3037 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 9888 "MachineIndependent/glslang_tab.cpp" +#line 9921 "MachineIndependent/glslang_tab.cpp" break; case 445: /* type_specifier_nonarray: UTEXTUREBUFFER */ -#line 3065 "MachineIndependent/glslang.y" +#line 3042 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 9898 "MachineIndependent/glslang_tab.cpp" +#line 9931 "MachineIndependent/glslang_tab.cpp" break; case 446: /* type_specifier_nonarray: TEXTURE2DMS */ -#line 3070 "MachineIndependent/glslang.y" +#line 3047 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 9908 "MachineIndependent/glslang_tab.cpp" +#line 9941 "MachineIndependent/glslang_tab.cpp" break; case 447: /* type_specifier_nonarray: F16TEXTURE2DMS */ -#line 3075 "MachineIndependent/glslang.y" +#line 3052 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); } -#line 9919 "MachineIndependent/glslang_tab.cpp" +#line 9952 "MachineIndependent/glslang_tab.cpp" break; case 448: /* type_specifier_nonarray: ITEXTURE2DMS */ -#line 3081 "MachineIndependent/glslang.y" +#line 3058 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 9929 "MachineIndependent/glslang_tab.cpp" +#line 9962 "MachineIndependent/glslang_tab.cpp" break; case 449: /* type_specifier_nonarray: UTEXTURE2DMS */ -#line 3086 "MachineIndependent/glslang.y" +#line 3063 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 9939 "MachineIndependent/glslang_tab.cpp" +#line 9972 "MachineIndependent/glslang_tab.cpp" break; case 450: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ -#line 3091 "MachineIndependent/glslang.y" +#line 3068 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 9949 "MachineIndependent/glslang_tab.cpp" +#line 9982 "MachineIndependent/glslang_tab.cpp" break; case 451: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ -#line 3096 "MachineIndependent/glslang.y" +#line 3073 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); } -#line 9960 "MachineIndependent/glslang_tab.cpp" +#line 9993 "MachineIndependent/glslang_tab.cpp" break; case 452: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ -#line 3102 "MachineIndependent/glslang.y" +#line 3079 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 9970 "MachineIndependent/glslang_tab.cpp" +#line 10003 "MachineIndependent/glslang_tab.cpp" break; case 453: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ -#line 3107 "MachineIndependent/glslang.y" +#line 3084 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 9980 "MachineIndependent/glslang_tab.cpp" +#line 10013 "MachineIndependent/glslang_tab.cpp" break; case 454: /* type_specifier_nonarray: IMAGE1D */ -#line 3112 "MachineIndependent/glslang.y" +#line 3089 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 9990 "MachineIndependent/glslang_tab.cpp" +#line 10023 "MachineIndependent/glslang_tab.cpp" break; case 455: /* type_specifier_nonarray: F16IMAGE1D */ -#line 3117 "MachineIndependent/glslang.y" +#line 3094 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); } -#line 10001 "MachineIndependent/glslang_tab.cpp" +#line 10034 "MachineIndependent/glslang_tab.cpp" break; case 456: /* type_specifier_nonarray: IIMAGE1D */ -#line 3123 "MachineIndependent/glslang.y" +#line 3100 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 10011 "MachineIndependent/glslang_tab.cpp" +#line 10044 "MachineIndependent/glslang_tab.cpp" break; case 457: /* type_specifier_nonarray: UIMAGE1D */ -#line 3128 "MachineIndependent/glslang.y" +#line 3105 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 10021 "MachineIndependent/glslang_tab.cpp" +#line 10054 "MachineIndependent/glslang_tab.cpp" break; case 458: /* type_specifier_nonarray: IMAGE2D */ -#line 3133 "MachineIndependent/glslang.y" +#line 3110 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 10031 "MachineIndependent/glslang_tab.cpp" +#line 10064 "MachineIndependent/glslang_tab.cpp" break; case 459: /* type_specifier_nonarray: F16IMAGE2D */ -#line 3138 "MachineIndependent/glslang.y" +#line 3115 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); } -#line 10042 "MachineIndependent/glslang_tab.cpp" +#line 10075 "MachineIndependent/glslang_tab.cpp" break; case 460: /* type_specifier_nonarray: IIMAGE2D */ -#line 3144 "MachineIndependent/glslang.y" +#line 3121 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 10052 "MachineIndependent/glslang_tab.cpp" +#line 10085 "MachineIndependent/glslang_tab.cpp" break; case 461: /* type_specifier_nonarray: UIMAGE2D */ -#line 3149 "MachineIndependent/glslang.y" +#line 3126 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 10062 "MachineIndependent/glslang_tab.cpp" +#line 10095 "MachineIndependent/glslang_tab.cpp" break; case 462: /* type_specifier_nonarray: IMAGE3D */ -#line 3154 "MachineIndependent/glslang.y" +#line 3131 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 10072 "MachineIndependent/glslang_tab.cpp" +#line 10105 "MachineIndependent/glslang_tab.cpp" break; case 463: /* type_specifier_nonarray: F16IMAGE3D */ -#line 3159 "MachineIndependent/glslang.y" +#line 3136 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); } -#line 10083 "MachineIndependent/glslang_tab.cpp" +#line 10116 "MachineIndependent/glslang_tab.cpp" break; case 464: /* type_specifier_nonarray: IIMAGE3D */ -#line 3165 "MachineIndependent/glslang.y" +#line 3142 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 10093 "MachineIndependent/glslang_tab.cpp" +#line 10126 "MachineIndependent/glslang_tab.cpp" break; case 465: /* type_specifier_nonarray: UIMAGE3D */ -#line 3170 "MachineIndependent/glslang.y" +#line 3147 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 10103 "MachineIndependent/glslang_tab.cpp" +#line 10136 "MachineIndependent/glslang_tab.cpp" break; case 466: /* type_specifier_nonarray: IMAGE2DRECT */ -#line 3175 "MachineIndependent/glslang.y" +#line 3152 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 10113 "MachineIndependent/glslang_tab.cpp" +#line 10146 "MachineIndependent/glslang_tab.cpp" break; case 467: /* type_specifier_nonarray: F16IMAGE2DRECT */ -#line 3180 "MachineIndependent/glslang.y" +#line 3157 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); } -#line 10124 "MachineIndependent/glslang_tab.cpp" +#line 10157 "MachineIndependent/glslang_tab.cpp" break; case 468: /* type_specifier_nonarray: IIMAGE2DRECT */ -#line 3186 "MachineIndependent/glslang.y" +#line 3163 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 10134 "MachineIndependent/glslang_tab.cpp" +#line 10167 "MachineIndependent/glslang_tab.cpp" break; case 469: /* type_specifier_nonarray: UIMAGE2DRECT */ -#line 3191 "MachineIndependent/glslang.y" +#line 3168 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 10144 "MachineIndependent/glslang_tab.cpp" +#line 10177 "MachineIndependent/glslang_tab.cpp" break; case 470: /* type_specifier_nonarray: IMAGECUBE */ -#line 3196 "MachineIndependent/glslang.y" +#line 3173 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 10154 "MachineIndependent/glslang_tab.cpp" +#line 10187 "MachineIndependent/glslang_tab.cpp" break; case 471: /* type_specifier_nonarray: F16IMAGECUBE */ -#line 3201 "MachineIndependent/glslang.y" +#line 3178 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); } -#line 10165 "MachineIndependent/glslang_tab.cpp" +#line 10198 "MachineIndependent/glslang_tab.cpp" break; case 472: /* type_specifier_nonarray: IIMAGECUBE */ -#line 3207 "MachineIndependent/glslang.y" +#line 3184 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 10175 "MachineIndependent/glslang_tab.cpp" +#line 10208 "MachineIndependent/glslang_tab.cpp" break; case 473: /* type_specifier_nonarray: UIMAGECUBE */ -#line 3212 "MachineIndependent/glslang.y" +#line 3189 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 10185 "MachineIndependent/glslang_tab.cpp" +#line 10218 "MachineIndependent/glslang_tab.cpp" break; case 474: /* type_specifier_nonarray: IMAGEBUFFER */ -#line 3217 "MachineIndependent/glslang.y" +#line 3194 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 10195 "MachineIndependent/glslang_tab.cpp" +#line 10228 "MachineIndependent/glslang_tab.cpp" break; case 475: /* type_specifier_nonarray: F16IMAGEBUFFER */ -#line 3222 "MachineIndependent/glslang.y" +#line 3199 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); } -#line 10206 "MachineIndependent/glslang_tab.cpp" +#line 10239 "MachineIndependent/glslang_tab.cpp" break; case 476: /* type_specifier_nonarray: IIMAGEBUFFER */ -#line 3228 "MachineIndependent/glslang.y" +#line 3205 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 10216 "MachineIndependent/glslang_tab.cpp" +#line 10249 "MachineIndependent/glslang_tab.cpp" break; case 477: /* type_specifier_nonarray: UIMAGEBUFFER */ -#line 3233 "MachineIndependent/glslang.y" +#line 3210 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } -#line 10226 "MachineIndependent/glslang_tab.cpp" +#line 10259 "MachineIndependent/glslang_tab.cpp" break; case 478: /* type_specifier_nonarray: IMAGE1DARRAY */ -#line 3238 "MachineIndependent/glslang.y" +#line 3215 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 10236 "MachineIndependent/glslang_tab.cpp" +#line 10269 "MachineIndependent/glslang_tab.cpp" break; case 479: /* type_specifier_nonarray: F16IMAGE1DARRAY */ -#line 3243 "MachineIndependent/glslang.y" +#line 3220 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); } -#line 10247 "MachineIndependent/glslang_tab.cpp" +#line 10280 "MachineIndependent/glslang_tab.cpp" break; case 480: /* type_specifier_nonarray: IIMAGE1DARRAY */ -#line 3249 "MachineIndependent/glslang.y" +#line 3226 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 10257 "MachineIndependent/glslang_tab.cpp" +#line 10290 "MachineIndependent/glslang_tab.cpp" break; case 481: /* type_specifier_nonarray: UIMAGE1DARRAY */ -#line 3254 "MachineIndependent/glslang.y" +#line 3231 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 10267 "MachineIndependent/glslang_tab.cpp" +#line 10300 "MachineIndependent/glslang_tab.cpp" break; case 482: /* type_specifier_nonarray: IMAGE2DARRAY */ -#line 3259 "MachineIndependent/glslang.y" +#line 3236 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 10277 "MachineIndependent/glslang_tab.cpp" +#line 10310 "MachineIndependent/glslang_tab.cpp" break; case 483: /* type_specifier_nonarray: F16IMAGE2DARRAY */ -#line 3264 "MachineIndependent/glslang.y" +#line 3241 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); } -#line 10288 "MachineIndependent/glslang_tab.cpp" +#line 10321 "MachineIndependent/glslang_tab.cpp" break; case 484: /* type_specifier_nonarray: IIMAGE2DARRAY */ -#line 3270 "MachineIndependent/glslang.y" +#line 3247 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 10298 "MachineIndependent/glslang_tab.cpp" +#line 10331 "MachineIndependent/glslang_tab.cpp" break; case 485: /* type_specifier_nonarray: UIMAGE2DARRAY */ -#line 3275 "MachineIndependent/glslang.y" +#line 3252 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 10308 "MachineIndependent/glslang_tab.cpp" +#line 10341 "MachineIndependent/glslang_tab.cpp" break; case 486: /* type_specifier_nonarray: IMAGECUBEARRAY */ -#line 3280 "MachineIndependent/glslang.y" +#line 3257 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 10318 "MachineIndependent/glslang_tab.cpp" +#line 10351 "MachineIndependent/glslang_tab.cpp" break; case 487: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ -#line 3285 "MachineIndependent/glslang.y" +#line 3262 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); } -#line 10329 "MachineIndependent/glslang_tab.cpp" +#line 10362 "MachineIndependent/glslang_tab.cpp" break; case 488: /* type_specifier_nonarray: IIMAGECUBEARRAY */ -#line 3291 "MachineIndependent/glslang.y" +#line 3268 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 10339 "MachineIndependent/glslang_tab.cpp" +#line 10372 "MachineIndependent/glslang_tab.cpp" break; case 489: /* type_specifier_nonarray: UIMAGECUBEARRAY */ -#line 3296 "MachineIndependent/glslang.y" +#line 3273 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 10349 "MachineIndependent/glslang_tab.cpp" +#line 10382 "MachineIndependent/glslang_tab.cpp" break; case 490: /* type_specifier_nonarray: IMAGE2DMS */ -#line 3301 "MachineIndependent/glslang.y" +#line 3278 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 10359 "MachineIndependent/glslang_tab.cpp" +#line 10392 "MachineIndependent/glslang_tab.cpp" break; case 491: /* type_specifier_nonarray: F16IMAGE2DMS */ -#line 3306 "MachineIndependent/glslang.y" +#line 3283 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); } -#line 10370 "MachineIndependent/glslang_tab.cpp" +#line 10403 "MachineIndependent/glslang_tab.cpp" break; case 492: /* type_specifier_nonarray: IIMAGE2DMS */ -#line 3312 "MachineIndependent/glslang.y" +#line 3289 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 10380 "MachineIndependent/glslang_tab.cpp" +#line 10413 "MachineIndependent/glslang_tab.cpp" break; case 493: /* type_specifier_nonarray: UIMAGE2DMS */ -#line 3317 "MachineIndependent/glslang.y" +#line 3294 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 10390 "MachineIndependent/glslang_tab.cpp" +#line 10423 "MachineIndependent/glslang_tab.cpp" break; case 494: /* type_specifier_nonarray: IMAGE2DMSARRAY */ -#line 3322 "MachineIndependent/glslang.y" +#line 3299 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 10400 "MachineIndependent/glslang_tab.cpp" +#line 10433 "MachineIndependent/glslang_tab.cpp" break; case 495: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ -#line 3327 "MachineIndependent/glslang.y" +#line 3304 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); } -#line 10411 "MachineIndependent/glslang_tab.cpp" +#line 10444 "MachineIndependent/glslang_tab.cpp" break; case 496: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ -#line 3333 "MachineIndependent/glslang.y" +#line 3310 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 10421 "MachineIndependent/glslang_tab.cpp" +#line 10454 "MachineIndependent/glslang_tab.cpp" break; case 497: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ -#line 3338 "MachineIndependent/glslang.y" +#line 3315 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 10431 "MachineIndependent/glslang_tab.cpp" +#line 10464 "MachineIndependent/glslang_tab.cpp" break; case 498: /* type_specifier_nonarray: I64IMAGE1D */ -#line 3343 "MachineIndependent/glslang.y" +#line 3320 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D); } -#line 10441 "MachineIndependent/glslang_tab.cpp" +#line 10474 "MachineIndependent/glslang_tab.cpp" break; case 499: /* type_specifier_nonarray: U64IMAGE1D */ -#line 3348 "MachineIndependent/glslang.y" +#line 3325 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D); } -#line 10451 "MachineIndependent/glslang_tab.cpp" +#line 10484 "MachineIndependent/glslang_tab.cpp" break; case 500: /* type_specifier_nonarray: I64IMAGE2D */ -#line 3353 "MachineIndependent/glslang.y" +#line 3330 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D); } -#line 10461 "MachineIndependent/glslang_tab.cpp" +#line 10494 "MachineIndependent/glslang_tab.cpp" break; case 501: /* type_specifier_nonarray: U64IMAGE2D */ -#line 3358 "MachineIndependent/glslang.y" +#line 3335 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D); } -#line 10471 "MachineIndependent/glslang_tab.cpp" +#line 10504 "MachineIndependent/glslang_tab.cpp" break; case 502: /* type_specifier_nonarray: I64IMAGE3D */ -#line 3363 "MachineIndependent/glslang.y" +#line 3340 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd3D); } -#line 10481 "MachineIndependent/glslang_tab.cpp" +#line 10514 "MachineIndependent/glslang_tab.cpp" break; case 503: /* type_specifier_nonarray: U64IMAGE3D */ -#line 3368 "MachineIndependent/glslang.y" +#line 3345 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd3D); } -#line 10491 "MachineIndependent/glslang_tab.cpp" +#line 10524 "MachineIndependent/glslang_tab.cpp" break; case 504: /* type_specifier_nonarray: I64IMAGE2DRECT */ -#line 3373 "MachineIndependent/glslang.y" +#line 3350 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdRect); } -#line 10501 "MachineIndependent/glslang_tab.cpp" +#line 10534 "MachineIndependent/glslang_tab.cpp" break; case 505: /* type_specifier_nonarray: U64IMAGE2DRECT */ -#line 3378 "MachineIndependent/glslang.y" +#line 3355 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdRect); } -#line 10511 "MachineIndependent/glslang_tab.cpp" +#line 10544 "MachineIndependent/glslang_tab.cpp" break; case 506: /* type_specifier_nonarray: I64IMAGECUBE */ -#line 3383 "MachineIndependent/glslang.y" +#line 3360 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube); } -#line 10521 "MachineIndependent/glslang_tab.cpp" +#line 10554 "MachineIndependent/glslang_tab.cpp" break; case 507: /* type_specifier_nonarray: U64IMAGECUBE */ -#line 3388 "MachineIndependent/glslang.y" +#line 3365 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube); } -#line 10531 "MachineIndependent/glslang_tab.cpp" +#line 10564 "MachineIndependent/glslang_tab.cpp" break; case 508: /* type_specifier_nonarray: I64IMAGEBUFFER */ -#line 3393 "MachineIndependent/glslang.y" +#line 3370 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdBuffer); } -#line 10541 "MachineIndependent/glslang_tab.cpp" +#line 10574 "MachineIndependent/glslang_tab.cpp" break; case 509: /* type_specifier_nonarray: U64IMAGEBUFFER */ -#line 3398 "MachineIndependent/glslang.y" +#line 3375 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdBuffer); } -#line 10551 "MachineIndependent/glslang_tab.cpp" +#line 10584 "MachineIndependent/glslang_tab.cpp" break; case 510: /* type_specifier_nonarray: I64IMAGE1DARRAY */ -#line 3403 "MachineIndependent/glslang.y" +#line 3380 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D, true); } -#line 10561 "MachineIndependent/glslang_tab.cpp" +#line 10594 "MachineIndependent/glslang_tab.cpp" break; case 511: /* type_specifier_nonarray: U64IMAGE1DARRAY */ -#line 3408 "MachineIndependent/glslang.y" +#line 3385 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D, true); } -#line 10571 "MachineIndependent/glslang_tab.cpp" +#line 10604 "MachineIndependent/glslang_tab.cpp" break; case 512: /* type_specifier_nonarray: I64IMAGE2DARRAY */ -#line 3413 "MachineIndependent/glslang.y" +#line 3390 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true); } -#line 10581 "MachineIndependent/glslang_tab.cpp" +#line 10614 "MachineIndependent/glslang_tab.cpp" break; case 513: /* type_specifier_nonarray: U64IMAGE2DARRAY */ -#line 3418 "MachineIndependent/glslang.y" +#line 3395 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true); } -#line 10591 "MachineIndependent/glslang_tab.cpp" +#line 10624 "MachineIndependent/glslang_tab.cpp" break; case 514: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ -#line 3423 "MachineIndependent/glslang.y" +#line 3400 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube, true); } -#line 10601 "MachineIndependent/glslang_tab.cpp" +#line 10634 "MachineIndependent/glslang_tab.cpp" break; case 515: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ -#line 3428 "MachineIndependent/glslang.y" +#line 3405 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube, true); } -#line 10611 "MachineIndependent/glslang_tab.cpp" +#line 10644 "MachineIndependent/glslang_tab.cpp" break; case 516: /* type_specifier_nonarray: I64IMAGE2DMS */ -#line 3433 "MachineIndependent/glslang.y" +#line 3410 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, false, false, true); } -#line 10621 "MachineIndependent/glslang_tab.cpp" +#line 10654 "MachineIndependent/glslang_tab.cpp" break; case 517: /* type_specifier_nonarray: U64IMAGE2DMS */ -#line 3438 "MachineIndependent/glslang.y" +#line 3415 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, false, false, true); } -#line 10631 "MachineIndependent/glslang_tab.cpp" +#line 10664 "MachineIndependent/glslang_tab.cpp" break; case 518: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ -#line 3443 "MachineIndependent/glslang.y" +#line 3420 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true, false, true); } -#line 10641 "MachineIndependent/glslang_tab.cpp" +#line 10674 "MachineIndependent/glslang_tab.cpp" break; case 519: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ -#line 3448 "MachineIndependent/glslang.y" +#line 3425 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true, false, true); } -#line 10651 "MachineIndependent/glslang_tab.cpp" +#line 10684 "MachineIndependent/glslang_tab.cpp" break; case 520: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ -#line 3453 "MachineIndependent/glslang.y" +#line 3430 "MachineIndependent/glslang.y" { // GL_OES_EGL_image_external (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 10662 "MachineIndependent/glslang_tab.cpp" +#line 10695 "MachineIndependent/glslang_tab.cpp" break; case 521: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ -#line 3459 "MachineIndependent/glslang.y" +#line 3436 "MachineIndependent/glslang.y" { // GL_EXT_YUV_target (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.yuv = true; } -#line 10673 "MachineIndependent/glslang_tab.cpp" +#line 10706 "MachineIndependent/glslang_tab.cpp" break; case 522: /* type_specifier_nonarray: ATTACHMENTEXT */ -#line 3465 "MachineIndependent/glslang.y" +#line 3442 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setAttachmentEXT(EbtFloat); } -#line 10684 "MachineIndependent/glslang_tab.cpp" +#line 10717 "MachineIndependent/glslang_tab.cpp" break; case 523: /* type_specifier_nonarray: IATTACHMENTEXT */ -#line 3471 "MachineIndependent/glslang.y" +#line 3448 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setAttachmentEXT(EbtInt); } -#line 10695 "MachineIndependent/glslang_tab.cpp" +#line 10728 "MachineIndependent/glslang_tab.cpp" break; case 524: /* type_specifier_nonarray: UATTACHMENTEXT */ -#line 3477 "MachineIndependent/glslang.y" +#line 3454 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setAttachmentEXT(EbtUint); } -#line 10706 "MachineIndependent/glslang_tab.cpp" +#line 10739 "MachineIndependent/glslang_tab.cpp" break; case 525: /* type_specifier_nonarray: SUBPASSINPUT */ -#line 3483 "MachineIndependent/glslang.y" +#line 3460 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 10717 "MachineIndependent/glslang_tab.cpp" +#line 10750 "MachineIndependent/glslang_tab.cpp" break; case 526: /* type_specifier_nonarray: SUBPASSINPUTMS */ -#line 3489 "MachineIndependent/glslang.y" +#line 3466 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 10728 "MachineIndependent/glslang_tab.cpp" +#line 10761 "MachineIndependent/glslang_tab.cpp" break; case 527: /* type_specifier_nonarray: F16SUBPASSINPUT */ -#line 3495 "MachineIndependent/glslang.y" +#line 3472 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -10736,11 +10769,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16); } -#line 10740 "MachineIndependent/glslang_tab.cpp" +#line 10773 "MachineIndependent/glslang_tab.cpp" break; case 528: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ -#line 3502 "MachineIndependent/glslang.y" +#line 3479 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -10748,55 +10781,55 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); } -#line 10752 "MachineIndependent/glslang_tab.cpp" +#line 10785 "MachineIndependent/glslang_tab.cpp" break; case 529: /* type_specifier_nonarray: ISUBPASSINPUT */ -#line 3509 "MachineIndependent/glslang.y" +#line 3486 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 10763 "MachineIndependent/glslang_tab.cpp" +#line 10796 "MachineIndependent/glslang_tab.cpp" break; case 530: /* type_specifier_nonarray: ISUBPASSINPUTMS */ -#line 3515 "MachineIndependent/glslang.y" +#line 3492 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 10774 "MachineIndependent/glslang_tab.cpp" +#line 10807 "MachineIndependent/glslang_tab.cpp" break; case 531: /* type_specifier_nonarray: USUBPASSINPUT */ -#line 3521 "MachineIndependent/glslang.y" +#line 3498 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 10785 "MachineIndependent/glslang_tab.cpp" +#line 10818 "MachineIndependent/glslang_tab.cpp" break; case 532: /* type_specifier_nonarray: USUBPASSINPUTMS */ -#line 3527 "MachineIndependent/glslang.y" +#line 3504 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 10796 "MachineIndependent/glslang_tab.cpp" +#line 10829 "MachineIndependent/glslang_tab.cpp" break; case 533: /* type_specifier_nonarray: FCOOPMATNV */ -#line 3533 "MachineIndependent/glslang.y" +#line 3510 "MachineIndependent/glslang.y" { parseContext.fcoopmatCheckNV((yyvsp[0].lex).loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -10804,11 +10837,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).coopmatNV = true; (yyval.interm.type).coopmatKHR = false; } -#line 10808 "MachineIndependent/glslang_tab.cpp" +#line 10841 "MachineIndependent/glslang_tab.cpp" break; case 534: /* type_specifier_nonarray: ICOOPMATNV */ -#line 3540 "MachineIndependent/glslang.y" +#line 3517 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheckNV((yyvsp[0].lex).loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -10816,11 +10849,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).coopmatNV = true; (yyval.interm.type).coopmatKHR = false; } -#line 10820 "MachineIndependent/glslang_tab.cpp" +#line 10853 "MachineIndependent/glslang_tab.cpp" break; case 535: /* type_specifier_nonarray: UCOOPMATNV */ -#line 3547 "MachineIndependent/glslang.y" +#line 3524 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheckNV((yyvsp[0].lex).loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -10828,11 +10861,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).coopmatNV = true; (yyval.interm.type).coopmatKHR = false; } -#line 10832 "MachineIndependent/glslang_tab.cpp" +#line 10865 "MachineIndependent/glslang_tab.cpp" break; case 536: /* type_specifier_nonarray: COOPMAT */ -#line 3554 "MachineIndependent/glslang.y" +#line 3531 "MachineIndependent/glslang.y" { parseContext.coopmatCheck((yyvsp[0].lex).loc, "coopmat", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -10840,39 +10873,39 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).coopmatNV = false; (yyval.interm.type).coopmatKHR = true; } -#line 10844 "MachineIndependent/glslang_tab.cpp" +#line 10877 "MachineIndependent/glslang_tab.cpp" break; case 537: /* type_specifier_nonarray: spirv_type_specifier */ -#line 3561 "MachineIndependent/glslang.y" +#line 3538 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 10853 "MachineIndependent/glslang_tab.cpp" +#line 10886 "MachineIndependent/glslang_tab.cpp" break; case 538: /* type_specifier_nonarray: HITOBJECTNV */ -#line 3565 "MachineIndependent/glslang.y" +#line 3542 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtHitObjectNV; } -#line 10862 "MachineIndependent/glslang_tab.cpp" +#line 10895 "MachineIndependent/glslang_tab.cpp" break; case 539: /* type_specifier_nonarray: struct_specifier */ -#line 3570 "MachineIndependent/glslang.y" +#line 3546 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 10872 "MachineIndependent/glslang_tab.cpp" +#line 10905 "MachineIndependent/glslang_tab.cpp" break; case 540: /* type_specifier_nonarray: TYPE_NAME */ -#line 3575 "MachineIndependent/glslang.y" +#line 3551 "MachineIndependent/glslang.y" { // // This is for user defined type names. The lexical phase looked up the @@ -10886,69 +10919,75 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 10890 "MachineIndependent/glslang_tab.cpp" +#line 10923 "MachineIndependent/glslang_tab.cpp" break; case 541: /* precision_qualifier: HIGH_PRECISION */ -#line 3591 "MachineIndependent/glslang.y" +#line 3567 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 10900 "MachineIndependent/glslang_tab.cpp" +#line 10933 "MachineIndependent/glslang_tab.cpp" break; case 542: /* precision_qualifier: MEDIUM_PRECISION */ -#line 3596 "MachineIndependent/glslang.y" +#line 3572 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 10910 "MachineIndependent/glslang_tab.cpp" +#line 10943 "MachineIndependent/glslang_tab.cpp" break; case 543: /* precision_qualifier: LOW_PRECISION */ -#line 3601 "MachineIndependent/glslang.y" +#line 3577 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 10920 "MachineIndependent/glslang_tab.cpp" +#line 10953 "MachineIndependent/glslang_tab.cpp" break; case 544: /* $@3: %empty */ -#line 3609 "MachineIndependent/glslang.y" +#line 3585 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 10926 "MachineIndependent/glslang_tab.cpp" +#line 10959 "MachineIndependent/glslang_tab.cpp" break; case 545: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ -#line 3609 "MachineIndependent/glslang.y" +#line 3585 "MachineIndependent/glslang.y" { + TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); + TVariable* userTypeDef = new TVariable((yyvsp[-4].lex).string, *structure, true); if (! parseContext.symbolTable.insert(*userTypeDef)) parseContext.error((yyvsp[-4].lex).loc, "redefinition", (yyvsp[-4].lex).string->c_str(), "struct"); + else if (parseContext.spvVersion.vulkanRelaxed + && structure->containsOpaque()) + parseContext.relaxedSymbols.push_back(structure->getTypeName()); + (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).basicType = EbtStruct; (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10942 "MachineIndependent/glslang_tab.cpp" +#line 10981 "MachineIndependent/glslang_tab.cpp" break; case 546: /* $@4: %empty */ -#line 3620 "MachineIndependent/glslang.y" +#line 3602 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 10948 "MachineIndependent/glslang_tab.cpp" +#line 10987 "MachineIndependent/glslang_tab.cpp" break; case 547: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ -#line 3620 "MachineIndependent/glslang.y" +#line 3602 "MachineIndependent/glslang.y" { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -10956,19 +10995,19 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10960 "MachineIndependent/glslang_tab.cpp" +#line 10999 "MachineIndependent/glslang_tab.cpp" break; case 548: /* struct_declaration_list: struct_declaration */ -#line 3630 "MachineIndependent/glslang.y" +#line 3612 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 10968 "MachineIndependent/glslang_tab.cpp" +#line 11007 "MachineIndependent/glslang_tab.cpp" break; case 549: /* struct_declaration_list: struct_declaration_list struct_declaration */ -#line 3633 "MachineIndependent/glslang.y" +#line 3615 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { @@ -10979,11 +11018,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 10983 "MachineIndependent/glslang_tab.cpp" +#line 11022 "MachineIndependent/glslang_tab.cpp" break; case 550: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ -#line 3646 "MachineIndependent/glslang.y" +#line 3628 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -11006,11 +11045,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 11010 "MachineIndependent/glslang_tab.cpp" +#line 11049 "MachineIndependent/glslang_tab.cpp" break; case 551: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ -#line 3668 "MachineIndependent/glslang.y" +#line 3650 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -11035,38 +11074,38 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 11039 "MachineIndependent/glslang_tab.cpp" +#line 11078 "MachineIndependent/glslang_tab.cpp" break; case 552: /* struct_declarator_list: struct_declarator */ -#line 3695 "MachineIndependent/glslang.y" +#line 3677 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 11048 "MachineIndependent/glslang_tab.cpp" +#line 11087 "MachineIndependent/glslang_tab.cpp" break; case 553: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ -#line 3699 "MachineIndependent/glslang.y" +#line 3681 "MachineIndependent/glslang.y" { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 11056 "MachineIndependent/glslang_tab.cpp" +#line 11095 "MachineIndependent/glslang_tab.cpp" break; case 554: /* struct_declarator: IDENTIFIER */ -#line 3705 "MachineIndependent/glslang.y" +#line 3687 "MachineIndependent/glslang.y" { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 11066 "MachineIndependent/glslang_tab.cpp" +#line 11105 "MachineIndependent/glslang_tab.cpp" break; case 555: /* struct_declarator: IDENTIFIER array_specifier */ -#line 3710 "MachineIndependent/glslang.y" +#line 3692 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); @@ -11075,246 +11114,250 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 11079 "MachineIndependent/glslang_tab.cpp" +#line 11118 "MachineIndependent/glslang_tab.cpp" break; case 556: /* initializer: assignment_expression */ -#line 3721 "MachineIndependent/glslang.y" +#line 3703 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11087 "MachineIndependent/glslang_tab.cpp" +#line 11126 "MachineIndependent/glslang_tab.cpp" break; case 557: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ -#line 3725 "MachineIndependent/glslang.y" +#line 3706 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 11098 "MachineIndependent/glslang_tab.cpp" +#line 11137 "MachineIndependent/glslang_tab.cpp" break; case 558: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ -#line 3731 "MachineIndependent/glslang.y" +#line 3712 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 11109 "MachineIndependent/glslang_tab.cpp" +#line 11148 "MachineIndependent/glslang_tab.cpp" break; case 559: /* initializer: LEFT_BRACE RIGHT_BRACE */ -#line 3737 "MachineIndependent/glslang.y" +#line 3718 "MachineIndependent/glslang.y" { const char* initFeature = "empty { } initializer"; parseContext.profileRequires((yyvsp[-1].lex).loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); parseContext.profileRequires((yyvsp[-1].lex).loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); (yyval.interm.intermTypedNode) = parseContext.intermediate.makeAggregate((yyvsp[-1].lex).loc); } -#line 11120 "MachineIndependent/glslang_tab.cpp" +#line 11159 "MachineIndependent/glslang_tab.cpp" break; case 560: /* initializer_list: initializer */ -#line 3748 "MachineIndependent/glslang.y" +#line 3727 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); } -#line 11128 "MachineIndependent/glslang_tab.cpp" +#line 11167 "MachineIndependent/glslang_tab.cpp" break; case 561: /* initializer_list: initializer_list COMMA initializer */ -#line 3751 "MachineIndependent/glslang.y" +#line 3730 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); } -#line 11136 "MachineIndependent/glslang_tab.cpp" +#line 11175 "MachineIndependent/glslang_tab.cpp" break; case 562: /* declaration_statement: declaration */ -#line 3758 "MachineIndependent/glslang.y" +#line 3736 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11142 "MachineIndependent/glslang_tab.cpp" +#line 11181 "MachineIndependent/glslang_tab.cpp" break; case 563: /* statement: compound_statement */ -#line 3762 "MachineIndependent/glslang.y" +#line 3740 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11148 "MachineIndependent/glslang_tab.cpp" +#line 11187 "MachineIndependent/glslang_tab.cpp" break; case 564: /* statement: simple_statement */ -#line 3763 "MachineIndependent/glslang.y" +#line 3741 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11154 "MachineIndependent/glslang_tab.cpp" +#line 11193 "MachineIndependent/glslang_tab.cpp" break; case 565: /* simple_statement: declaration_statement */ -#line 3769 "MachineIndependent/glslang.y" +#line 3747 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11160 "MachineIndependent/glslang_tab.cpp" +#line 11199 "MachineIndependent/glslang_tab.cpp" break; case 566: /* simple_statement: expression_statement */ -#line 3770 "MachineIndependent/glslang.y" +#line 3748 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11166 "MachineIndependent/glslang_tab.cpp" +#line 11205 "MachineIndependent/glslang_tab.cpp" break; case 567: /* simple_statement: selection_statement */ -#line 3771 "MachineIndependent/glslang.y" +#line 3749 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11172 "MachineIndependent/glslang_tab.cpp" +#line 11211 "MachineIndependent/glslang_tab.cpp" break; case 568: /* simple_statement: switch_statement */ -#line 3772 "MachineIndependent/glslang.y" +#line 3750 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11178 "MachineIndependent/glslang_tab.cpp" +#line 11217 "MachineIndependent/glslang_tab.cpp" break; case 569: /* simple_statement: case_label */ -#line 3773 "MachineIndependent/glslang.y" +#line 3751 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11184 "MachineIndependent/glslang_tab.cpp" +#line 11223 "MachineIndependent/glslang_tab.cpp" break; case 570: /* simple_statement: iteration_statement */ -#line 3774 "MachineIndependent/glslang.y" +#line 3752 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11190 "MachineIndependent/glslang_tab.cpp" +#line 11229 "MachineIndependent/glslang_tab.cpp" break; case 571: /* simple_statement: jump_statement */ -#line 3775 "MachineIndependent/glslang.y" +#line 3753 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11196 "MachineIndependent/glslang_tab.cpp" +#line 11235 "MachineIndependent/glslang_tab.cpp" break; case 572: /* simple_statement: demote_statement */ -#line 3777 "MachineIndependent/glslang.y" +#line 3754 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11202 "MachineIndependent/glslang_tab.cpp" +#line 11241 "MachineIndependent/glslang_tab.cpp" break; case 573: /* demote_statement: DEMOTE SEMICOLON */ -#line 3783 "MachineIndependent/glslang.y" +#line 3758 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "demote"); parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDemote, (yyvsp[-1].lex).loc); } -#line 11212 "MachineIndependent/glslang_tab.cpp" +#line 11251 "MachineIndependent/glslang_tab.cpp" break; case 574: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ -#line 3792 "MachineIndependent/glslang.y" +#line 3766 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11218 "MachineIndependent/glslang_tab.cpp" +#line 11257 "MachineIndependent/glslang_tab.cpp" break; case 575: /* $@5: %empty */ -#line 3793 "MachineIndependent/glslang.y" +#line 3767 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 11227 "MachineIndependent/glslang_tab.cpp" +#line 11266 "MachineIndependent/glslang_tab.cpp" break; case 576: /* $@6: %empty */ -#line 3797 "MachineIndependent/glslang.y" +#line 3771 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 11236 "MachineIndependent/glslang_tab.cpp" +#line 11275 "MachineIndependent/glslang_tab.cpp" break; case 577: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */ -#line 3801 "MachineIndependent/glslang.y" +#line 3775 "MachineIndependent/glslang.y" { - if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) + if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) { (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); + (yyvsp[-2].interm.intermNode)->getAsAggregate()->setEndLoc((yyvsp[0].lex).loc); + } (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 11246 "MachineIndependent/glslang_tab.cpp" +#line 11287 "MachineIndependent/glslang_tab.cpp" break; case 578: /* statement_no_new_scope: compound_statement_no_new_scope */ -#line 3809 "MachineIndependent/glslang.y" +#line 3785 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11252 "MachineIndependent/glslang_tab.cpp" +#line 11293 "MachineIndependent/glslang_tab.cpp" break; case 579: /* statement_no_new_scope: simple_statement */ -#line 3810 "MachineIndependent/glslang.y" +#line 3786 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11258 "MachineIndependent/glslang_tab.cpp" +#line 11299 "MachineIndependent/glslang_tab.cpp" break; case 580: /* $@7: %empty */ -#line 3814 "MachineIndependent/glslang.y" +#line 3790 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } -#line 11266 "MachineIndependent/glslang_tab.cpp" +#line 11307 "MachineIndependent/glslang_tab.cpp" break; case 581: /* statement_scoped: $@7 compound_statement */ -#line 3817 "MachineIndependent/glslang.y" +#line 3793 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11275 "MachineIndependent/glslang_tab.cpp" +#line 11316 "MachineIndependent/glslang_tab.cpp" break; case 582: /* $@8: %empty */ -#line 3821 "MachineIndependent/glslang.y" +#line 3797 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11285 "MachineIndependent/glslang_tab.cpp" +#line 11326 "MachineIndependent/glslang_tab.cpp" break; case 583: /* statement_scoped: $@8 simple_statement */ -#line 3826 "MachineIndependent/glslang.y" +#line 3802 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11296 "MachineIndependent/glslang_tab.cpp" +#line 11337 "MachineIndependent/glslang_tab.cpp" break; case 584: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ -#line 3835 "MachineIndependent/glslang.y" +#line 3811 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11304 "MachineIndependent/glslang_tab.cpp" +#line 11345 "MachineIndependent/glslang_tab.cpp" break; case 585: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ -#line 3838 "MachineIndependent/glslang.y" +#line 3814 "MachineIndependent/glslang.y" { - if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) + if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) { (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyvsp[-1].interm.intermNode)->getAsAggregate()->setEndLoc((yyvsp[0].lex).loc); + } (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 11314 "MachineIndependent/glslang_tab.cpp" +#line 11357 "MachineIndependent/glslang_tab.cpp" break; case 586: /* statement_list: statement */ -#line 3846 "MachineIndependent/glslang.y" +#line 3824 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || @@ -11323,11 +11366,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 11327 "MachineIndependent/glslang_tab.cpp" +#line 11370 "MachineIndependent/glslang_tab.cpp" break; case 587: /* statement_list: statement_list statement */ -#line 3854 "MachineIndependent/glslang.y" +#line 3832 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { @@ -11336,77 +11379,77 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11340 "MachineIndependent/glslang_tab.cpp" +#line 11383 "MachineIndependent/glslang_tab.cpp" break; case 588: /* expression_statement: SEMICOLON */ -#line 3865 "MachineIndependent/glslang.y" +#line 3843 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11346 "MachineIndependent/glslang_tab.cpp" +#line 11389 "MachineIndependent/glslang_tab.cpp" break; case 589: /* expression_statement: expression SEMICOLON */ -#line 3866 "MachineIndependent/glslang.y" +#line 3844 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 11352 "MachineIndependent/glslang_tab.cpp" +#line 11395 "MachineIndependent/glslang_tab.cpp" break; case 590: /* selection_statement: selection_statement_nonattributed */ -#line 3870 "MachineIndependent/glslang.y" +#line 3848 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11360 "MachineIndependent/glslang_tab.cpp" +#line 11403 "MachineIndependent/glslang_tab.cpp" break; case 591: /* selection_statement: attribute selection_statement_nonattributed */ -#line 3874 "MachineIndependent/glslang.y" +#line 3851 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11370 "MachineIndependent/glslang_tab.cpp" +#line 11413 "MachineIndependent/glslang_tab.cpp" break; case 592: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ -#line 3882 "MachineIndependent/glslang.y" +#line 3858 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 11379 "MachineIndependent/glslang_tab.cpp" +#line 11422 "MachineIndependent/glslang_tab.cpp" break; case 593: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ -#line 3889 "MachineIndependent/glslang.y" +#line 3865 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 11388 "MachineIndependent/glslang_tab.cpp" +#line 11431 "MachineIndependent/glslang_tab.cpp" break; case 594: /* selection_rest_statement: statement_scoped */ -#line 3893 "MachineIndependent/glslang.y" +#line 3869 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 11397 "MachineIndependent/glslang_tab.cpp" +#line 11440 "MachineIndependent/glslang_tab.cpp" break; case 595: /* condition: expression */ -#line 3901 "MachineIndependent/glslang.y" +#line 3877 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 11406 "MachineIndependent/glslang_tab.cpp" +#line 11449 "MachineIndependent/glslang_tab.cpp" break; case 596: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 3905 "MachineIndependent/glslang.y" +#line 3881 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); @@ -11417,29 +11460,29 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.intermTypedNode) = 0; } -#line 11421 "MachineIndependent/glslang_tab.cpp" +#line 11464 "MachineIndependent/glslang_tab.cpp" break; case 597: /* switch_statement: switch_statement_nonattributed */ -#line 3918 "MachineIndependent/glslang.y" +#line 3894 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11429 "MachineIndependent/glslang_tab.cpp" +#line 11472 "MachineIndependent/glslang_tab.cpp" break; case 598: /* switch_statement: attribute switch_statement_nonattributed */ -#line 3922 "MachineIndependent/glslang.y" +#line 3897 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11439 "MachineIndependent/glslang_tab.cpp" +#line 11482 "MachineIndependent/glslang_tab.cpp" break; case 599: /* $@9: %empty */ -#line 3930 "MachineIndependent/glslang.y" +#line 3904 "MachineIndependent/glslang.y" { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -11448,11 +11491,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 11452 "MachineIndependent/glslang_tab.cpp" +#line 11495 "MachineIndependent/glslang_tab.cpp" break; case 600: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */ -#line 3938 "MachineIndependent/glslang.y" +#line 3912 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); @@ -11462,27 +11505,27 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11466 "MachineIndependent/glslang_tab.cpp" +#line 11509 "MachineIndependent/glslang_tab.cpp" break; case 601: /* switch_statement_list: %empty */ -#line 3950 "MachineIndependent/glslang.y" +#line 3924 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11474 "MachineIndependent/glslang_tab.cpp" +#line 11517 "MachineIndependent/glslang_tab.cpp" break; case 602: /* switch_statement_list: statement_list */ -#line 3953 "MachineIndependent/glslang.y" +#line 3927 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11482 "MachineIndependent/glslang_tab.cpp" +#line 11525 "MachineIndependent/glslang_tab.cpp" break; case 603: /* case_label: CASE expression COLON */ -#line 3959 "MachineIndependent/glslang.y" +#line 3933 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11495,11 +11538,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 11499 "MachineIndependent/glslang_tab.cpp" +#line 11542 "MachineIndependent/glslang_tab.cpp" break; case 604: /* case_label: DEFAULT COLON */ -#line 3971 "MachineIndependent/glslang.y" +#line 3945 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11509,29 +11552,30 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 11513 "MachineIndependent/glslang_tab.cpp" +#line 11556 "MachineIndependent/glslang_tab.cpp" break; case 605: /* iteration_statement: iteration_statement_nonattributed */ -#line 3983 "MachineIndependent/glslang.y" +#line 3957 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11521 "MachineIndependent/glslang_tab.cpp" +#line 11564 "MachineIndependent/glslang_tab.cpp" break; case 606: /* iteration_statement: attribute iteration_statement_nonattributed */ -#line 3987 "MachineIndependent/glslang.y" +#line 3960 "MachineIndependent/glslang.y" { - parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); + const char * extensions[2] = { E_GL_EXT_control_flow_attributes, E_GL_EXT_control_flow_attributes2 }; + parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 2, extensions, "attribute"); parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11531 "MachineIndependent/glslang_tab.cpp" +#line 11575 "MachineIndependent/glslang_tab.cpp" break; case 607: /* $@10: %empty */ -#line 3995 "MachineIndependent/glslang.y" +#line 3968 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -11540,11 +11584,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11544 "MachineIndependent/glslang_tab.cpp" +#line 11588 "MachineIndependent/glslang_tab.cpp" break; case 608: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */ -#line 4003 "MachineIndependent/glslang.y" +#line 3976 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); @@ -11552,22 +11596,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11556 "MachineIndependent/glslang_tab.cpp" +#line 11600 "MachineIndependent/glslang_tab.cpp" break; case 609: /* $@11: %empty */ -#line 4010 "MachineIndependent/glslang.y" +#line 3983 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11567 "MachineIndependent/glslang_tab.cpp" +#line 11611 "MachineIndependent/glslang_tab.cpp" break; case 610: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ -#line 4016 "MachineIndependent/glslang.y" +#line 3989 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -11580,22 +11624,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11584 "MachineIndependent/glslang_tab.cpp" +#line 11628 "MachineIndependent/glslang_tab.cpp" break; case 611: /* $@12: %empty */ -#line 4028 "MachineIndependent/glslang.y" +#line 4001 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11595 "MachineIndependent/glslang_tab.cpp" +#line 11639 "MachineIndependent/glslang_tab.cpp" break; case 612: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ -#line 4034 "MachineIndependent/glslang.y" +#line 4007 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -11608,81 +11652,81 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11612 "MachineIndependent/glslang_tab.cpp" +#line 11656 "MachineIndependent/glslang_tab.cpp" break; case 613: /* for_init_statement: expression_statement */ -#line 4049 "MachineIndependent/glslang.y" +#line 4022 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11620 "MachineIndependent/glslang_tab.cpp" +#line 11664 "MachineIndependent/glslang_tab.cpp" break; case 614: /* for_init_statement: declaration_statement */ -#line 4052 "MachineIndependent/glslang.y" +#line 4025 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11628 "MachineIndependent/glslang_tab.cpp" +#line 11672 "MachineIndependent/glslang_tab.cpp" break; case 615: /* conditionopt: condition */ -#line 4058 "MachineIndependent/glslang.y" +#line 4031 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11636 "MachineIndependent/glslang_tab.cpp" +#line 11680 "MachineIndependent/glslang_tab.cpp" break; case 616: /* conditionopt: %empty */ -#line 4061 "MachineIndependent/glslang.y" +#line 4034 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = 0; } -#line 11644 "MachineIndependent/glslang_tab.cpp" +#line 11688 "MachineIndependent/glslang_tab.cpp" break; case 617: /* for_rest_statement: conditionopt SEMICOLON */ -#line 4067 "MachineIndependent/glslang.y" +#line 4040 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 11653 "MachineIndependent/glslang_tab.cpp" +#line 11697 "MachineIndependent/glslang_tab.cpp" break; case 618: /* for_rest_statement: conditionopt SEMICOLON expression */ -#line 4071 "MachineIndependent/glslang.y" +#line 4044 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 11662 "MachineIndependent/glslang_tab.cpp" +#line 11706 "MachineIndependent/glslang_tab.cpp" break; case 619: /* jump_statement: CONTINUE SEMICOLON */ -#line 4078 "MachineIndependent/glslang.y" +#line 4051 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 11672 "MachineIndependent/glslang_tab.cpp" +#line 11716 "MachineIndependent/glslang_tab.cpp" break; case 620: /* jump_statement: BREAK SEMICOLON */ -#line 4083 "MachineIndependent/glslang.y" +#line 4056 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 11682 "MachineIndependent/glslang_tab.cpp" +#line 11726 "MachineIndependent/glslang_tab.cpp" break; case 621: /* jump_statement: RETURN SEMICOLON */ -#line 4088 "MachineIndependent/glslang.y" +#line 4061 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -11690,101 +11734,101 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 11694 "MachineIndependent/glslang_tab.cpp" +#line 11738 "MachineIndependent/glslang_tab.cpp" break; case 622: /* jump_statement: RETURN expression SEMICOLON */ -#line 4095 "MachineIndependent/glslang.y" +#line 4068 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 11702 "MachineIndependent/glslang_tab.cpp" +#line 11746 "MachineIndependent/glslang_tab.cpp" break; case 623: /* jump_statement: DISCARD SEMICOLON */ -#line 4098 "MachineIndependent/glslang.y" +#line 4071 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 11711 "MachineIndependent/glslang_tab.cpp" +#line 11755 "MachineIndependent/glslang_tab.cpp" break; case 624: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ -#line 4102 "MachineIndependent/glslang.y" +#line 4075 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "terminateInvocation"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateInvocation, (yyvsp[-1].lex).loc); } -#line 11720 "MachineIndependent/glslang_tab.cpp" +#line 11764 "MachineIndependent/glslang_tab.cpp" break; case 625: /* jump_statement: TERMINATE_RAY SEMICOLON */ -#line 4107 "MachineIndependent/glslang.y" +#line 4079 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "terminateRayEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateRayKHR, (yyvsp[-1].lex).loc); } -#line 11729 "MachineIndependent/glslang_tab.cpp" +#line 11773 "MachineIndependent/glslang_tab.cpp" break; case 626: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ -#line 4111 "MachineIndependent/glslang.y" +#line 4083 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "ignoreIntersectionEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, (yyvsp[-1].lex).loc); } -#line 11738 "MachineIndependent/glslang_tab.cpp" +#line 11782 "MachineIndependent/glslang_tab.cpp" break; case 627: /* translation_unit: external_declaration */ -#line 4121 "MachineIndependent/glslang.y" +#line 4092 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 11747 "MachineIndependent/glslang_tab.cpp" +#line 11791 "MachineIndependent/glslang_tab.cpp" break; case 628: /* translation_unit: translation_unit external_declaration */ -#line 4125 "MachineIndependent/glslang.y" +#line 4096 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) != nullptr) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 11758 "MachineIndependent/glslang_tab.cpp" +#line 11802 "MachineIndependent/glslang_tab.cpp" break; case 629: /* external_declaration: function_definition */ -#line 4134 "MachineIndependent/glslang.y" +#line 4105 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11766 "MachineIndependent/glslang_tab.cpp" +#line 11810 "MachineIndependent/glslang_tab.cpp" break; case 630: /* external_declaration: declaration */ -#line 4137 "MachineIndependent/glslang.y" +#line 4108 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11774 "MachineIndependent/glslang_tab.cpp" +#line 11818 "MachineIndependent/glslang_tab.cpp" break; case 631: /* external_declaration: SEMICOLON */ -#line 4141 "MachineIndependent/glslang.y" +#line 4111 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 11784 "MachineIndependent/glslang_tab.cpp" +#line 11828 "MachineIndependent/glslang_tab.cpp" break; case 632: /* $@13: %empty */ -#line 4150 "MachineIndependent/glslang.y" +#line 4119 "MachineIndependent/glslang.y" { (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); @@ -11797,17 +11841,18 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ++parseContext.statementNestingLevel; } } -#line 11801 "MachineIndependent/glslang_tab.cpp" +#line 11845 "MachineIndependent/glslang_tab.cpp" break; case 633: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ -#line 4162 "MachineIndependent/glslang.y" +#line 4131 "MachineIndependent/glslang.y" { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) parseContext.error((yyvsp[-2].interm).loc, "function does not return a value:", "", (yyvsp[-2].interm).function->getName().c_str()); parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode)->getAsAggregate()->setLinkType((yyvsp[-2].interm).function->getLinkType()); parseContext.intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[-2].interm).function->getType(), (yyvsp[-2].interm).loc); (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[-2].interm).function->getMangledName().c_str()); @@ -11828,228 +11873,228 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; } } -#line 11832 "MachineIndependent/glslang_tab.cpp" +#line 11877 "MachineIndependent/glslang_tab.cpp" break; case 634: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ -#line 4192 "MachineIndependent/glslang.y" +#line 4161 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); } -#line 11840 "MachineIndependent/glslang_tab.cpp" +#line 11885 "MachineIndependent/glslang_tab.cpp" break; case 635: /* attribute_list: single_attribute */ -#line 4197 "MachineIndependent/glslang.y" +#line 4166 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } -#line 11848 "MachineIndependent/glslang_tab.cpp" +#line 11893 "MachineIndependent/glslang_tab.cpp" break; case 636: /* attribute_list: attribute_list COMMA single_attribute */ -#line 4200 "MachineIndependent/glslang.y" +#line 4169 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } -#line 11856 "MachineIndependent/glslang_tab.cpp" +#line 11901 "MachineIndependent/glslang_tab.cpp" break; case 637: /* single_attribute: IDENTIFIER */ -#line 4205 "MachineIndependent/glslang.y" +#line 4174 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } -#line 11864 "MachineIndependent/glslang_tab.cpp" +#line 11909 "MachineIndependent/glslang_tab.cpp" break; case 638: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ -#line 4208 "MachineIndependent/glslang.y" +#line 4177 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 11872 "MachineIndependent/glslang_tab.cpp" +#line 11917 "MachineIndependent/glslang_tab.cpp" break; case 639: /* spirv_requirements_list: spirv_requirements_parameter */ -#line 4215 "MachineIndependent/glslang.y" +#line 4182 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq); } -#line 11880 "MachineIndependent/glslang_tab.cpp" +#line 11925 "MachineIndependent/glslang_tab.cpp" break; case 640: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ -#line 4218 "MachineIndependent/glslang.y" +#line 4185 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq)); } -#line 11888 "MachineIndependent/glslang_tab.cpp" +#line 11933 "MachineIndependent/glslang_tab.cpp" break; case 641: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ -#line 4223 "MachineIndependent/glslang.y" +#line 4190 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr); } -#line 11896 "MachineIndependent/glslang_tab.cpp" +#line 11941 "MachineIndependent/glslang_tab.cpp" break; case 642: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ -#line 4226 "MachineIndependent/glslang.y" +#line 4193 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 11904 "MachineIndependent/glslang_tab.cpp" +#line 11949 "MachineIndependent/glslang_tab.cpp" break; case 643: /* spirv_extension_list: STRING_LITERAL */ -#line 4231 "MachineIndependent/glslang.y" +#line 4198 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 11912 "MachineIndependent/glslang_tab.cpp" +#line 11957 "MachineIndependent/glslang_tab.cpp" break; case 644: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ -#line 4234 "MachineIndependent/glslang.y" +#line 4201 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 11920 "MachineIndependent/glslang_tab.cpp" +#line 11965 "MachineIndependent/glslang_tab.cpp" break; case 645: /* spirv_capability_list: INTCONSTANT */ -#line 4239 "MachineIndependent/glslang.y" +#line 4206 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } -#line 11928 "MachineIndependent/glslang_tab.cpp" +#line 11973 "MachineIndependent/glslang_tab.cpp" break; case 646: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ -#line 4242 "MachineIndependent/glslang.y" +#line 4209 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } -#line 11936 "MachineIndependent/glslang_tab.cpp" +#line 11981 "MachineIndependent/glslang_tab.cpp" break; case 647: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4247 "MachineIndependent/glslang.y" +#line 4214 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11945 "MachineIndependent/glslang_tab.cpp" +#line 11990 "MachineIndependent/glslang_tab.cpp" break; case 648: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4251 "MachineIndependent/glslang.y" +#line 4218 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11955 "MachineIndependent/glslang_tab.cpp" +#line 12000 "MachineIndependent/glslang_tab.cpp" break; case 649: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4256 "MachineIndependent/glslang.y" +#line 4223 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11964 "MachineIndependent/glslang_tab.cpp" +#line 12009 "MachineIndependent/glslang_tab.cpp" break; case 650: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4260 "MachineIndependent/glslang.y" +#line 4227 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11974 "MachineIndependent/glslang_tab.cpp" +#line 12019 "MachineIndependent/glslang_tab.cpp" break; case 651: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4265 "MachineIndependent/glslang.y" +#line 4232 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11983 "MachineIndependent/glslang_tab.cpp" +#line 12028 "MachineIndependent/glslang_tab.cpp" break; case 652: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4269 "MachineIndependent/glslang.y" +#line 4236 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11993 "MachineIndependent/glslang_tab.cpp" +#line 12038 "MachineIndependent/glslang_tab.cpp" break; case 653: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ -#line 4276 "MachineIndependent/glslang.y" +#line 4243 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12001 "MachineIndependent/glslang_tab.cpp" +#line 12046 "MachineIndependent/glslang_tab.cpp" break; case 654: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ -#line 4279 "MachineIndependent/glslang.y" +#line 4246 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12009 "MachineIndependent/glslang_tab.cpp" +#line 12054 "MachineIndependent/glslang_tab.cpp" break; case 655: /* spirv_execution_mode_parameter: FLOATCONSTANT */ -#line 4284 "MachineIndependent/glslang.y" +#line 4251 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12017 "MachineIndependent/glslang_tab.cpp" +#line 12062 "MachineIndependent/glslang_tab.cpp" break; case 656: /* spirv_execution_mode_parameter: INTCONSTANT */ -#line 4287 "MachineIndependent/glslang.y" +#line 4254 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12025 "MachineIndependent/glslang_tab.cpp" +#line 12070 "MachineIndependent/glslang_tab.cpp" break; case 657: /* spirv_execution_mode_parameter: UINTCONSTANT */ -#line 4290 "MachineIndependent/glslang.y" +#line 4257 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12033 "MachineIndependent/glslang_tab.cpp" +#line 12078 "MachineIndependent/glslang_tab.cpp" break; case 658: /* spirv_execution_mode_parameter: BOOLCONSTANT */ -#line 4293 "MachineIndependent/glslang.y" +#line 4260 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12041 "MachineIndependent/glslang_tab.cpp" +#line 12086 "MachineIndependent/glslang_tab.cpp" break; case 659: /* spirv_execution_mode_parameter: STRING_LITERAL */ -#line 4296 "MachineIndependent/glslang.y" +#line 4263 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 12049 "MachineIndependent/glslang_tab.cpp" +#line 12094 "MachineIndependent/glslang_tab.cpp" break; case 660: /* spirv_execution_mode_id_parameter_list: constant_expression */ -#line 4301 "MachineIndependent/glslang.y" +#line 4268 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12059,11 +12104,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermTypedNode)); } -#line 12063 "MachineIndependent/glslang_tab.cpp" +#line 12108 "MachineIndependent/glslang_tab.cpp" break; case 661: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ -#line 4310 "MachineIndependent/glslang.y" +#line 4277 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12073,351 +12118,351 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermTypedNode)); } -#line 12077 "MachineIndependent/glslang_tab.cpp" +#line 12122 "MachineIndependent/glslang_tab.cpp" break; case 662: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4321 "MachineIndependent/glslang.y" +#line 4288 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 12087 "MachineIndependent/glslang_tab.cpp" +#line 12132 "MachineIndependent/glslang_tab.cpp" break; case 663: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4326 "MachineIndependent/glslang.y" +#line 4293 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 12098 "MachineIndependent/glslang_tab.cpp" +#line 12143 "MachineIndependent/glslang_tab.cpp" break; case 664: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4334 "MachineIndependent/glslang.y" +#line 4301 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 12107 "MachineIndependent/glslang_tab.cpp" +#line 12152 "MachineIndependent/glslang_tab.cpp" break; case 665: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4338 "MachineIndependent/glslang.y" +#line 4305 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 12117 "MachineIndependent/glslang_tab.cpp" +#line 12162 "MachineIndependent/glslang_tab.cpp" break; case 666: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4343 "MachineIndependent/glslang.y" +#line 4310 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12126 "MachineIndependent/glslang_tab.cpp" +#line 12171 "MachineIndependent/glslang_tab.cpp" break; case 667: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4347 "MachineIndependent/glslang.y" +#line 4314 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12136 "MachineIndependent/glslang_tab.cpp" +#line 12181 "MachineIndependent/glslang_tab.cpp" break; case 668: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4352 "MachineIndependent/glslang.y" +#line 4319 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12145 "MachineIndependent/glslang_tab.cpp" +#line 12190 "MachineIndependent/glslang_tab.cpp" break; case 669: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4356 "MachineIndependent/glslang.y" +#line 4323 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12155 "MachineIndependent/glslang_tab.cpp" +#line 12200 "MachineIndependent/glslang_tab.cpp" break; case 670: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4361 "MachineIndependent/glslang.y" +#line 4328 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12164 "MachineIndependent/glslang_tab.cpp" +#line 12209 "MachineIndependent/glslang_tab.cpp" break; case 671: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4365 "MachineIndependent/glslang.y" +#line 4332 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12174 "MachineIndependent/glslang_tab.cpp" +#line 12219 "MachineIndependent/glslang_tab.cpp" break; case 672: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ -#line 4372 "MachineIndependent/glslang.y" +#line 4339 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12182 "MachineIndependent/glslang_tab.cpp" +#line 12227 "MachineIndependent/glslang_tab.cpp" break; case 673: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ -#line 4375 "MachineIndependent/glslang.y" +#line 4342 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12190 "MachineIndependent/glslang_tab.cpp" +#line 12235 "MachineIndependent/glslang_tab.cpp" break; case 674: /* spirv_decorate_parameter: FLOATCONSTANT */ -#line 4380 "MachineIndependent/glslang.y" +#line 4347 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12198 "MachineIndependent/glslang_tab.cpp" +#line 12243 "MachineIndependent/glslang_tab.cpp" break; case 675: /* spirv_decorate_parameter: INTCONSTANT */ -#line 4383 "MachineIndependent/glslang.y" +#line 4350 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12206 "MachineIndependent/glslang_tab.cpp" +#line 12251 "MachineIndependent/glslang_tab.cpp" break; case 676: /* spirv_decorate_parameter: UINTCONSTANT */ -#line 4386 "MachineIndependent/glslang.y" +#line 4353 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12214 "MachineIndependent/glslang_tab.cpp" +#line 12259 "MachineIndependent/glslang_tab.cpp" break; case 677: /* spirv_decorate_parameter: BOOLCONSTANT */ -#line 4389 "MachineIndependent/glslang.y" +#line 4356 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12222 "MachineIndependent/glslang_tab.cpp" +#line 12267 "MachineIndependent/glslang_tab.cpp" break; case 678: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter */ -#line 4394 "MachineIndependent/glslang.y" +#line 4361 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12230 "MachineIndependent/glslang_tab.cpp" +#line 12275 "MachineIndependent/glslang_tab.cpp" break; case 679: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter */ -#line 4397 "MachineIndependent/glslang.y" +#line 4364 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12238 "MachineIndependent/glslang_tab.cpp" +#line 12283 "MachineIndependent/glslang_tab.cpp" break; case 680: /* spirv_decorate_id_parameter: variable_identifier */ -#line 4402 "MachineIndependent/glslang.y" +#line 4369 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getAsConstantUnion() || (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode()) (yyval.interm.intermNode) = (yyvsp[0].interm.intermTypedNode); else parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "only allow constants or variables which are not elements of a composite", "", ""); } -#line 12249 "MachineIndependent/glslang_tab.cpp" +#line 12294 "MachineIndependent/glslang_tab.cpp" break; case 681: /* spirv_decorate_id_parameter: FLOATCONSTANT */ -#line 4408 "MachineIndependent/glslang.y" +#line 4375 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12257 "MachineIndependent/glslang_tab.cpp" +#line 12302 "MachineIndependent/glslang_tab.cpp" break; case 682: /* spirv_decorate_id_parameter: INTCONSTANT */ -#line 4411 "MachineIndependent/glslang.y" +#line 4378 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12265 "MachineIndependent/glslang_tab.cpp" +#line 12310 "MachineIndependent/glslang_tab.cpp" break; case 683: /* spirv_decorate_id_parameter: UINTCONSTANT */ -#line 4414 "MachineIndependent/glslang.y" +#line 4381 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12273 "MachineIndependent/glslang_tab.cpp" +#line 12318 "MachineIndependent/glslang_tab.cpp" break; case 684: /* spirv_decorate_id_parameter: BOOLCONSTANT */ -#line 4417 "MachineIndependent/glslang.y" +#line 4384 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12281 "MachineIndependent/glslang_tab.cpp" +#line 12326 "MachineIndependent/glslang_tab.cpp" break; case 685: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ -#line 4422 "MachineIndependent/glslang.y" +#line 4389 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate( parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12290 "MachineIndependent/glslang_tab.cpp" +#line 12335 "MachineIndependent/glslang_tab.cpp" break; case 686: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ -#line 4426 "MachineIndependent/glslang.y" +#line 4393 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12298 "MachineIndependent/glslang_tab.cpp" +#line 12343 "MachineIndependent/glslang_tab.cpp" break; case 687: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4431 "MachineIndependent/glslang.y" +#line 4398 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12307 "MachineIndependent/glslang_tab.cpp" +#line 12352 "MachineIndependent/glslang_tab.cpp" break; case 688: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4435 "MachineIndependent/glslang.y" +#line 4402 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12317 "MachineIndependent/glslang_tab.cpp" +#line 12362 "MachineIndependent/glslang_tab.cpp" break; case 689: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4440 "MachineIndependent/glslang.y" +#line 4407 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12326 "MachineIndependent/glslang_tab.cpp" +#line 12371 "MachineIndependent/glslang_tab.cpp" break; case 690: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4444 "MachineIndependent/glslang.y" +#line 4411 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12336 "MachineIndependent/glslang_tab.cpp" +#line 12381 "MachineIndependent/glslang_tab.cpp" break; case 691: /* spirv_type_parameter_list: spirv_type_parameter */ -#line 4451 "MachineIndependent/glslang.y" +#line 4418 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = (yyvsp[0].interm.spirvTypeParams); } -#line 12344 "MachineIndependent/glslang_tab.cpp" +#line 12389 "MachineIndependent/glslang_tab.cpp" break; case 692: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ -#line 4454 "MachineIndependent/glslang.y" +#line 4421 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.mergeSpirvTypeParameters((yyvsp[-2].interm.spirvTypeParams), (yyvsp[0].interm.spirvTypeParams)); } -#line 12352 "MachineIndependent/glslang_tab.cpp" +#line 12397 "MachineIndependent/glslang_tab.cpp" break; case 693: /* spirv_type_parameter: constant_expression */ -#line 4459 "MachineIndependent/glslang.y" +#line 4426 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)->getAsConstantUnion()); } -#line 12360 "MachineIndependent/glslang_tab.cpp" +#line 12405 "MachineIndependent/glslang_tab.cpp" break; case 694: /* spirv_type_parameter: type_specifier_nonarray */ -#line 4462 "MachineIndependent/glslang.y" +#line 4429 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 12368 "MachineIndependent/glslang_tab.cpp" +#line 12413 "MachineIndependent/glslang_tab.cpp" break; case 695: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4467 "MachineIndependent/glslang.y" +#line 4434 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12376 "MachineIndependent/glslang_tab.cpp" +#line 12421 "MachineIndependent/glslang_tab.cpp" break; case 696: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4470 "MachineIndependent/glslang.y" +#line 4437 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12385 "MachineIndependent/glslang_tab.cpp" +#line 12430 "MachineIndependent/glslang_tab.cpp" break; case 697: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ -#line 4476 "MachineIndependent/glslang.y" +#line 4443 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); } -#line 12393 "MachineIndependent/glslang_tab.cpp" +#line 12438 "MachineIndependent/glslang_tab.cpp" break; case 698: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ -#line 4479 "MachineIndependent/glslang.y" +#line 4446 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); } -#line 12401 "MachineIndependent/glslang_tab.cpp" +#line 12446 "MachineIndependent/glslang_tab.cpp" break; case 699: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ -#line 4484 "MachineIndependent/glslang.y" +#line 4451 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); } -#line 12409 "MachineIndependent/glslang_tab.cpp" +#line 12454 "MachineIndependent/glslang_tab.cpp" break; case 700: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ -#line 4487 "MachineIndependent/glslang.y" +#line 4454 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); } -#line 12417 "MachineIndependent/glslang_tab.cpp" +#line 12462 "MachineIndependent/glslang_tab.cpp" break; -#line 12421 "MachineIndependent/glslang_tab.cpp" +#line 12466 "MachineIndependent/glslang_tab.cpp" default: break; } @@ -12641,5 +12686,5 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); return yyresult; } -#line 4492 "MachineIndependent/glslang.y" +#line 4458 "MachineIndependent/glslang.y" diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index 39455f27..d6484924 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -524,7 +524,7 @@ extern int yydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { -#line 97 "MachineIndependent/glslang.y" +#line 72 "MachineIndependent/glslang.y" struct { glslang::TSourceLoc loc; diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp index d5fc26bb..f0621bd9 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. -// Copyright (C) 2017 ARM Limited. +// Copyright (C) 2017, 2022-2024 Arm Limited. // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. @@ -565,6 +565,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break; case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break; case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break; + case EOpSubgroupRotate: out.debug << "subgroupRotate"; break; + case EOpSubgroupClusteredRotate: out.debug << "subgroupClusteredRotate"; break; case EOpSubgroupAdd: out.debug << "subgroupAdd"; break; case EOpSubgroupMul: out.debug << "subgroupMul"; break; case EOpSubgroupMin: out.debug << "subgroupMin"; break; @@ -597,6 +599,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break; case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break; case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break; + case EOpSubgroupQuadAll: out.debug << "subgroupQuadAll"; break; + case EOpSubgroupQuadAny: out.debug << "subgroupQuadAny"; break; case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break; case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break; @@ -1000,6 +1004,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break; case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break; case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break; + case EOpSubgroupRotate: out.debug << "subgroupRotate"; break; + case EOpSubgroupClusteredRotate: out.debug << "subgroupClusteredRotate"; break; case EOpSubgroupAdd: out.debug << "subgroupAdd"; break; case EOpSubgroupMul: out.debug << "subgroupMul"; break; case EOpSubgroupMin: out.debug << "subgroupMin"; break; @@ -1032,6 +1038,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break; case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break; case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break; + case EOpSubgroupQuadAll: out.debug << "subgroupQuadAll"; break; + case EOpSubgroupQuadAny: out.debug << "subgroupQuadAny"; break; case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break; case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break; @@ -1141,6 +1149,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpHitObjectGetShaderBindingTableRecordIndexNV: out.debug << "HitObjectGetShaderBindingTableRecordIndexNV"; break; case EOpHitObjectGetShaderRecordBufferHandleNV: out.debug << "HitObjectReadShaderRecordBufferHandleNV"; break; case EOpReorderThreadNV: out.debug << "ReorderThreadNV"; break; + case EOpFetchMicroTriangleVertexPositionNV: out.debug << "MicroTriangleVertexPositionNV"; break; + case EOpFetchMicroTriangleVertexBarycentricNV: out.debug << "MicroTriangleVertexBarycentricNV"; break; case EOpSpirvInst: out.debug << "spirv_instruction"; break; case EOpStencilAttachmentReadEXT: out.debug << "stencilAttachmentReadEXT"; break; @@ -1206,12 +1216,12 @@ bool TOutputTraverser::visitSelection(TVisit /* visit */, TIntermSelection* node // - shows all digits, no premature rounding static void OutputDouble(TInfoSink& out, double value, TOutputTraverser::EExtraOutput extra) { - if (IsInfinity(value)) { + if (std::isinf(value)) { if (value < 0) out.debug << "-1.#INF"; else out.debug << "+1.#INF"; - } else if (IsNan(value)) + } else if (std::isnan(value)) out.debug << "1.#IND"; else { const int maxSize = 340; @@ -1510,6 +1520,9 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) if (getSubgroupUniformControlFlow()) infoSink.debug << "subgroup_uniform_control_flow\n"; + if (getMaximallyReconverges()) + infoSink.debug << "maximally_reconverges\n"; + switch (language) { case EShLangVertex: break; @@ -1574,7 +1587,7 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) infoSink.debug << "max_vertices = " << vertices << "\n"; infoSink.debug << "max_primitives = " << primitives << "\n"; infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n"; - // Fall through + [[fallthrough]]; case EShLangTask: // Fall through case EShLangCompute: diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp index 63dedf76..3e7749d3 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp @@ -39,6 +39,7 @@ #include "gl_types.h" #include "iomapper.h" +#include "LiveTraverser.h" #include "SymbolTable.h" // @@ -60,6 +61,108 @@ namespace glslang { +struct TVarEntryInfo { + long long id; + TIntermSymbol* symbol; + bool live; + bool upgradedToPushConstant; + int newBinding; + int newSet; + int newLocation; + int newComponent; + int newIndex; + EShLanguage stage; + + void clearNewAssignments() { + upgradedToPushConstant = false; + newBinding = -1; + newSet = -1; + newLocation = -1; + newComponent = -1; + newIndex = -1; + } + + struct TOrderById { + inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { return l.id < r.id; } + }; + + struct TOrderByPriority { + // ordering: + // 1) has both binding and set + // 2) has binding but no set + // 3) has no binding but set + // 4) has no binding and no set + inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { + const TQualifier& lq = l.symbol->getQualifier(); + const TQualifier& rq = r.symbol->getQualifier(); + + // simple rules: + // has binding gives 2 points + // has set gives 1 point + // who has the most points is more important. + int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0); + int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0); + + if (lPoints == rPoints) + return l.id < r.id; + return lPoints > rPoints; + } + }; + + struct TOrderByPriorityAndLive { + // ordering: + // 1) do live variables first + // 2) has both binding and set + // 3) has binding but no set + // 4) has no binding but set + // 5) has no binding and no set + inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { + + const TQualifier& lq = l.symbol->getQualifier(); + const TQualifier& rq = r.symbol->getQualifier(); + + // simple rules: + // has binding gives 2 points + // has set gives 1 point + // who has the most points is more important. + int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0); + int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0); + + if (l.live != r.live) + return l.live > r.live; + + if (lPoints != rPoints) + return lPoints > rPoints; + + return l.id < r.id; + } + }; +}; + +// override function "operator=", if a vector being sort, +// when use vc++, the sort function will call : +// pair& operator=(const pair<_Other1, _Other2>& _Right) +// { +// first = _Right.first; +// second = _Right.second; +// return (*this); +// } +// that will make a const type handing on left. +// override this function can avoid a compiler error. +// In the future, if the vc++ compiler can handle such a situation, +// this part of the code will be removed. +struct TVarLivePair : std::pair { + TVarLivePair(const std::pair& _Right) : pair(_Right.first, _Right.second) {} + TVarLivePair& operator=(const TVarLivePair& _Right) { + const_cast(first) = _Right.first; + second = _Right.second; + return (*this); + } + TVarLivePair(const TVarLivePair& src) : pair(src) { } +}; +typedef std::vector TVarLiveVector; + + class TVarGatherTraverser : public TLiveTraverser { public: TVarGatherTraverser(const TIntermediate& i, bool traverseDeadCode, TVarLiveMap& inList, TVarLiveMap& outList, TVarLiveMap& uniformList) @@ -85,7 +188,7 @@ class TVarGatherTraverser : public TLiveTraverser { addGlobalReference(base->getAccessName()); if (target) { - TVarEntryInfo ent = {base->getId(), base, ! traverseAll}; + TVarEntryInfo ent = {base->getId(), base, ! traverseAll, {}, {}, {}, {}, {}, {}, {}}; ent.stage = intermediate.getStage(); TVarLiveMap::iterator at = target->find( ent.symbol->getAccessName()); // std::lower_bound(target->begin(), target->end(), ent, TVarEntryInfo::TOrderById()); @@ -124,7 +227,7 @@ class TVarSetTraverser : public TLiveTraverser else return; - TVarEntryInfo ent = { base->getId() }; + TVarEntryInfo ent = { base->getId(), {}, {}, {}, {}, {}, {}, {}, {}, {} }; // Fix a defect, when block has no instance name, we need to find its block name TVarLiveMap::const_iterator at = source->find(base->getAccessName()); if (at == source->end()) @@ -176,7 +279,7 @@ struct TNotifyInOutAdaptor { EShLanguage stage; TIoMapResolver& resolver; - inline TNotifyInOutAdaptor(EShLanguage s, TIoMapResolver& r) + inline TNotifyInOutAdaptor(EShLanguage s, TIoMapResolver& r) : stage(s) , resolver(r) { @@ -866,7 +969,7 @@ int TDefaultIoResolverBase::resolveInOutLocation(EShLanguage stage, TVarEntryInf } // no locations added if already present, a built-in variable, or a variable with SPIR-V decorate - if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getQualifier().hasSprivDecorate()) { + if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getQualifier().hasSpirvDecorate()) { return ent.newLocation = -1; } @@ -953,7 +1056,7 @@ int TDefaultGlslIoResolver::resolveInOutLocation(EShLanguage stage, TVarEntryInf return ent.newLocation = type.getQualifier().layoutLocation; } // no locations added if already present, a built-in variable, or a variable with SPIR-V decorate - if (type.isBuiltIn() || type.getQualifier().hasSprivDecorate()) { + if (type.isBuiltIn() || type.getQualifier().hasSpirvDecorate()) { return ent.newLocation = -1; } // no locations on blocks of built-in variables @@ -1497,6 +1600,36 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate& intermediate, TInfoSi return !hadError; } +TGlslIoMapper::TGlslIoMapper() { + memset(inVarMaps, 0, sizeof(TVarLiveMap*) * EShLangCount); + memset(outVarMaps, 0, sizeof(TVarLiveMap*) * EShLangCount); + memset(uniformVarMap, 0, sizeof(TVarLiveMap*) * EShLangCount); + memset(intermediates, 0, sizeof(TIntermediate*) * EShLangCount); + profile = ENoProfile; + version = 0; + autoPushConstantMaxSize = 128; + autoPushConstantBlockPacking = ElpStd430; +} + +TGlslIoMapper::~TGlslIoMapper() { + for (size_t stage = 0; stage < EShLangCount; stage++) { + if (inVarMaps[stage] != nullptr) { + delete inVarMaps[stage]; + inVarMaps[stage] = nullptr; + } + if (outVarMaps[stage] != nullptr) { + delete outVarMaps[stage]; + outVarMaps[stage] = nullptr; + } + if (uniformVarMap[stage] != nullptr) { + delete uniformVarMap[stage]; + uniformVarMap[stage] = nullptr; + } + if (intermediates[stage] != nullptr) + intermediates[stage] = nullptr; + } +} + // Map I/O variables to provided offsets, and make bindings for // unbound but live variables. // diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h index 35babbce..ef513d9a 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h @@ -37,7 +37,6 @@ #define _IOMAPPER_INCLUDED #include -#include "LiveTraverser.h" #include #include // @@ -49,84 +48,7 @@ class TInfoSink; namespace glslang { class TIntermediate; -struct TVarEntryInfo { - long long id; - TIntermSymbol* symbol; - bool live; - bool upgradedToPushConstant; - int newBinding; - int newSet; - int newLocation; - int newComponent; - int newIndex; - EShLanguage stage; - - void clearNewAssignments() { - upgradedToPushConstant = false; - newBinding = -1; - newSet = -1; - newLocation = -1; - newComponent = -1; - newIndex = -1; - } - - struct TOrderById { - inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { return l.id < r.id; } - }; - - struct TOrderByPriority { - // ordering: - // 1) has both binding and set - // 2) has binding but no set - // 3) has no binding but set - // 4) has no binding and no set - inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { - const TQualifier& lq = l.symbol->getQualifier(); - const TQualifier& rq = r.symbol->getQualifier(); - - // simple rules: - // has binding gives 2 points - // has set gives 1 point - // who has the most points is more important. - int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0); - int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0); - - if (lPoints == rPoints) - return l.id < r.id; - return lPoints > rPoints; - } - }; - - struct TOrderByPriorityAndLive { - // ordering: - // 1) do live variables first - // 2) has both binding and set - // 3) has binding but no set - // 4) has no binding but set - // 5) has no binding and no set - inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { - - const TQualifier& lq = l.symbol->getQualifier(); - const TQualifier& rq = r.symbol->getQualifier(); - - // simple rules: - // has binding gives 2 points - // has set gives 1 point - // who has the most points is more important. - int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0); - int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0); - - if (l.live != r.live) - return l.live > r.live; - - if (lPoints != rPoints) - return lPoints > rPoints; - - return l.id < r.id; - } - }; -}; - +struct TVarEntryInfo; // Base class for shared TIoMapResolver services, used by several derivations. struct TDefaultIoResolverBase : public glslang::TIoMapResolver { public: @@ -267,82 +189,22 @@ struct TDefaultGlslIoResolver : public TDefaultIoResolverBase { typedef std::map TVarLiveMap; -// override function "operator=", if a vector being sort, -// when use vc++, the sort function will call : -// pair& operator=(const pair<_Other1, _Other2>& _Right) -// { -// first = _Right.first; -// second = _Right.second; -// return (*this); -// } -// that will make a const type handing on left. -// override this function can avoid a compiler error. -// In the future, if the vc++ compiler can handle such a situation, -// this part of the code will be removed. -struct TVarLivePair : std::pair { - TVarLivePair(const std::pair& _Right) : pair(_Right.first, _Right.second) {} - TVarLivePair& operator=(const TVarLivePair& _Right) { - const_cast(first) = _Right.first; - second = _Right.second; - return (*this); - } - TVarLivePair(const TVarLivePair& src) : pair(src) { } -}; -typedef std::vector TVarLiveVector; - -// 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; } -}; - // I/O mapper for GLSL class TGlslIoMapper : public TIoMapper { public: - TGlslIoMapper() { - memset(inVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1)); - memset(outVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1)); - memset(uniformVarMap, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1)); - memset(intermediates, 0, sizeof(TIntermediate*) * (EShLangCount + 1)); - profile = ENoProfile; - version = 0; - autoPushConstantMaxSize = 128; - autoPushConstantBlockPacking = ElpStd430; - } - virtual ~TGlslIoMapper() { - for (size_t stage = 0; stage < EShLangCount; stage++) { - if (inVarMaps[stage] != nullptr) { - delete inVarMaps[stage]; - inVarMaps[stage] = nullptr; - } - if (outVarMaps[stage] != nullptr) { - delete outVarMaps[stage]; - outVarMaps[stage] = nullptr; - } - if (uniformVarMap[stage] != nullptr) { - delete uniformVarMap[stage]; - uniformVarMap[stage] = nullptr; - } - if (intermediates[stage] != nullptr) - intermediates[stage] = nullptr; - } - } + TGlslIoMapper(); + virtual ~TGlslIoMapper(); // If set, the uniform block with the given name will be changed to be backed by // push_constant if it's size is <= maxSize - void setAutoPushConstantBlock(const char* name, unsigned int maxSize, TLayoutPacking packing) { + bool setAutoPushConstantBlock(const char* name, unsigned int maxSize, TLayoutPacking packing) override { autoPushConstantBlockName = name; autoPushConstantMaxSize = maxSize; autoPushConstantBlockPacking = packing; + return true; } // grow the reflection stage by stage bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*) override; bool doMap(TIoMapResolver*, TInfoSink&) override; - TVarLiveMap *inVarMaps[EShLangCount], *outVarMaps[EShLangCount], - *uniformVarMap[EShLangCount]; TIntermediate* intermediates[EShLangCount]; bool hadError = false; EProfile profile; @@ -352,6 +214,8 @@ class TGlslIoMapper : public TIoMapper { TString autoPushConstantBlockName; unsigned int autoPushConstantMaxSize; TLayoutPacking autoPushConstantBlockPacking; + TVarLiveMap *inVarMaps[EShLangCount], *outVarMaps[EShLangCount], + *uniformVarMap[EShLangCount]; }; } // end namespace glslang diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp index d69300b8..b0c27e84 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -49,6 +49,7 @@ #include "localintermediate.h" #include "../Include/InfoSink.h" #include "SymbolTable.h" +#include "LiveTraverser.h" namespace glslang { @@ -113,6 +114,28 @@ void TIntermediate::mergeUniformObjects(TInfoSink& infoSink, TIntermediate& unit mergeLinkerObjects(infoSink, linkerObjects, unitLinkerObjects, unit.getStage()); } +static inline bool isSameInterface(TIntermSymbol* symbol, EShLanguage stage, TIntermSymbol* unitSymbol, EShLanguage unitStage) { + return // 1) same stage and same shader interface + (stage == unitStage && symbol->getType().getShaderInterface() == unitSymbol->getType().getShaderInterface()) || + // 2) accross stages and both are uniform or buffer + (symbol->getQualifier().storage == EvqUniform && unitSymbol->getQualifier().storage == EvqUniform) || + (symbol->getQualifier().storage == EvqBuffer && unitSymbol->getQualifier().storage == EvqBuffer) || + // 3) in/out matched across stage boundary + (stage < unitStage && symbol->getQualifier().storage == EvqVaryingOut && unitSymbol->getQualifier().storage == EvqVaryingIn) || + (unitStage < stage && symbol->getQualifier().storage == EvqVaryingIn && unitSymbol->getQualifier().storage == EvqVaryingOut); +} + +static bool isSameSymbol(TIntermSymbol* symbol1, EShLanguage stage1, TIntermSymbol* symbol2, EShLanguage stage2) { + // If they are both blocks in the same shader interface, + // match by the block-name, not the identifier name. + if (symbol1->getType().getBasicType() == EbtBlock && symbol2->getType().getBasicType() == EbtBlock) { + if (isSameInterface(symbol1, stage1, symbol2, stage2)) { + return symbol1->getType().getTypeName() == symbol2->getType().getTypeName(); + } + } else if (symbol1->getName() == symbol2->getName()) + return true; + return false; +} // // do error checking on the shader boundary in / out vars // @@ -137,7 +160,133 @@ void TIntermediate::checkStageIO(TInfoSink& infoSink, TIntermediate& unit) { // do matching and error checking mergeLinkerObjects(infoSink, linkerObjects, unitLinkerObjects, unit.getStage()); - // TODO: final check; make sure that any statically used `in` have matching `out` written to + // Check that all of our inputs have matching outputs from the previous stage. + // Only do this for Vulkan, since GL_ARB_separate_shader_objects allows for + // the in/out to not match + if (spvVersion.vulkan > 0) { + for (auto& nextStageInterm : unitLinkerObjects) { + auto* nextStageSymbol = nextStageInterm->getAsSymbolNode(); + bool found = false; + for (auto& curStageInterm : linkerObjects) { + if (isSameSymbol(curStageInterm->getAsSymbolNode(), getStage(), nextStageSymbol, unit.getStage())) { + found = true; + break; + } + } + if (!found) { + TString errmsg; + errmsg.append("Input '"); + if (nextStageSymbol->getType().getBasicType() == EbtBlock) + errmsg.append(nextStageSymbol->getType().getTypeName()); + else + errmsg.append(nextStageSymbol->getName()); + errmsg.append("' in ").append(StageName(unit.getStage())); + errmsg.append(" shader has no corresponding output in ").append(StageName(getStage())).append(" shader."); + error(infoSink, errmsg.c_str(), unit.getStage()); + } + } + } +} + +void TIntermediate::optimizeStageIO(TInfoSink&, TIntermediate& unit) +{ + // don't do any input/output demotion on compute, raytracing, or task/mesh stages + // TODO: support task/mesh + if (getStage() > EShLangFragment || unit.getStage() > EShLangFragment) { + return; + } + + class TIOTraverser : public TLiveTraverser { + public: + TIOTraverser(TIntermediate& i, bool all, TIntermSequence& sequence, TStorageQualifier storage) + : TLiveTraverser(i, all, true, false, false), sequence(sequence), storage(storage) + { + } + + virtual void visitSymbol(TIntermSymbol* symbol) + { + if (symbol->getQualifier().storage == storage) { + sequence.push_back(symbol); + } + } + + private: + TIntermSequence& sequence; + TStorageQualifier storage; + }; + + // live symbols only + TIntermSequence unitLiveInputs; + + TIOTraverser unitTraverser(unit, false, unitLiveInputs, EvqVaryingIn); + unitTraverser.pushFunction(unit.getEntryPointMangledName().c_str()); + while (! unitTraverser.destinations.empty()) { + TIntermNode* destination = unitTraverser.destinations.back(); + unitTraverser.destinations.pop_back(); + destination->traverse(&unitTraverser); + } + + TIntermSequence allOutputs; + TIntermSequence unitAllInputs; + + TIOTraverser allTraverser(*this, true, allOutputs, EvqVaryingOut); + getTreeRoot()->traverse(&allTraverser); + + TIOTraverser unitAllTraverser(unit, true, unitAllInputs, EvqVaryingIn); + unit.getTreeRoot()->traverse(&unitAllTraverser); + + // find outputs not consumed by the next stage + std::for_each(allOutputs.begin(), allOutputs.end(), [&unitLiveInputs, &unitAllInputs](TIntermNode* output) { + // don't do anything to builtins + if (output->getAsSymbolNode()->getAccessName().compare(0, 3, "gl_") == 0) + return; + + // don't demote block outputs (for now) + if (output->getAsSymbolNode()->getBasicType() == EbtBlock) + return; + + // check if the (loose) output has a matching loose input + auto isMatchingInput = [output](TIntermNode* input) { + return output->getAsSymbolNode()->getAccessName() == input->getAsSymbolNode()->getAccessName(); + }; + + // check if the (loose) output has a matching block member input + auto isMatchingInputBlockMember = [output](TIntermNode* input) { + // ignore loose inputs + if (input->getAsSymbolNode()->getBasicType() != EbtBlock) + return false; + + // don't demote loose outputs with matching input block members + auto isMatchingBlockMember = [output](TTypeLoc type) { + return type.type->getFieldName() == output->getAsSymbolNode()->getName(); + }; + const TTypeList* members = input->getAsSymbolNode()->getType().getStruct(); + return std::any_of(members->begin(), members->end(), isMatchingBlockMember); + }; + + // determine if the input/output pair should be demoted + // do the faster (and more likely) loose-loose check first + if (std::none_of(unitLiveInputs.begin(), unitLiveInputs.end(), isMatchingInput) && + std::none_of(unitAllInputs.begin(), unitAllInputs.end(), isMatchingInputBlockMember)) { + // demote any input matching the output + auto demoteMatchingInputs = [output](TIntermNode* input) { + if (output->getAsSymbolNode()->getAccessName() == input->getAsSymbolNode()->getAccessName()) { + // demote input to a plain variable + TIntermSymbol* symbol = input->getAsSymbolNode(); + symbol->getQualifier().storage = EvqGlobal; + symbol->getQualifier().clearInterstage(); + symbol->getQualifier().clearLayout(); + } + }; + + // demote all matching outputs to a plain variable + TIntermSymbol* symbol = output->getAsSymbolNode(); + symbol->getQualifier().storage = EvqGlobal; + symbol->getQualifier().clearInterstage(); + symbol->getQualifier().clearLayout(); + std::for_each(unitAllInputs.begin(), unitAllInputs.end(), demoteMatchingInputs); + } + }); } void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit) @@ -511,17 +660,6 @@ void TIntermediate::mergeBodies(TInfoSink& infoSink, TIntermSequence& globals, c globals.insert(globals.end() - 1, unitGlobals.begin(), unitGlobals.end() - 1); } -static inline bool isSameInterface(TIntermSymbol* symbol, EShLanguage stage, TIntermSymbol* unitSymbol, EShLanguage unitStage) { - return // 1) same stage and same shader interface - (stage == unitStage && symbol->getType().getShaderInterface() == unitSymbol->getType().getShaderInterface()) || - // 2) accross stages and both are uniform or buffer - (symbol->getQualifier().storage == EvqUniform && unitSymbol->getQualifier().storage == EvqUniform) || - (symbol->getQualifier().storage == EvqBuffer && unitSymbol->getQualifier().storage == EvqBuffer) || - // 3) in/out matched across stage boundary - (stage < unitStage && symbol->getQualifier().storage == EvqVaryingOut && unitSymbol->getQualifier().storage == EvqVaryingIn) || - (unitStage < stage && symbol->getQualifier().storage == EvqVaryingIn && unitSymbol->getQualifier().storage == EvqVaryingOut); -} - // // Global Unfiform block stores any default uniforms (i.e. uniforms without a block) // If two linked stages declare the same member, they are meant to be the same uniform @@ -707,24 +845,18 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin // Error check and merge the linker objects (duplicates should not be created) std::size_t initialNumLinkerObjects = linkerObjects.size(); for (unsigned int unitLinkObj = 0; unitLinkObj < unitLinkerObjects.size(); ++unitLinkObj) { + TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode(); bool merge = true; + + // Don't merge inputs backwards into previous stages + if (getStage() != unitStage && unitSymbol->getQualifier().storage == EvqVaryingIn) + merge = false; + for (std::size_t linkObj = 0; linkObj < initialNumLinkerObjects; ++linkObj) { TIntermSymbol* symbol = linkerObjects[linkObj]->getAsSymbolNode(); - TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode(); assert(symbol && unitSymbol); - bool isSameSymbol = false; - // If they are both blocks in the same shader interface, - // match by the block-name, not the identifier name. - if (symbol->getType().getBasicType() == EbtBlock && unitSymbol->getType().getBasicType() == EbtBlock) { - if (isSameInterface(symbol, getStage(), unitSymbol, unitStage)) { - isSameSymbol = symbol->getType().getTypeName() == unitSymbol->getType().getTypeName(); - } - } - else if (symbol->getName() == unitSymbol->getName()) - isSameSymbol = true; - - if (isSameSymbol) { + if (isSameSymbol(symbol, getStage(), unitSymbol, unitStage)) { // filter out copy merge = false; @@ -1350,7 +1482,7 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) error(infoSink, "At least one shader must specify a layout(max_vertices = value)"); if (primitives == TQualifier::layoutNotSet) error(infoSink, "At least one shader must specify a layout(max_primitives = value)"); - // fall through + [[fallthrough]]; case EShLangTask: if (numTaskNVBlocks > 1) error(infoSink, "Only one taskNV interface block is allowed per shader"); @@ -1689,7 +1821,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ // First range: TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation); TRange componentRange(0, 3); - TIoRange range(locationRange, componentRange, type.getBasicType(), 0); + TIoRange range(locationRange, componentRange, type.getBasicType(), 0, qualifier.centroid, qualifier.smooth, qualifier.flat, qualifier.sample, qualifier.patch); // check for collisions collision = checkLocationRange(set, range, type, typeCollision); @@ -1699,7 +1831,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ // Second range: TRange locationRange2(qualifier.layoutLocation + 1, qualifier.layoutLocation + 1); TRange componentRange2(0, 1); - TIoRange range2(locationRange2, componentRange2, type.getBasicType(), 0); + TIoRange range2(locationRange2, componentRange2, type.getBasicType(), 0, qualifier.centroid, qualifier.smooth, qualifier.flat, qualifier.sample, qualifier.patch); // check for collisions collision = checkLocationRange(set, range2, type, typeCollision); @@ -1725,7 +1857,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ TBasicType basicTy = type.getBasicType(); if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT()) basicTy = type.getSampler().type; - TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0); + TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0, qualifier.centroid, qualifier.smooth, qualifier.flat, qualifier.sample, qualifier.patch); // check for collisions, except for vertex inputs on desktop targeting OpenGL if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0) @@ -1737,6 +1869,24 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ return collision; } +// Check that two types can be stored in different components in the same location. +// They must be the same type, except signed/unsigned integers are considered compatible. +static bool checkCompatibleTypes(TBasicType t1, TBasicType t2) { + if (t1 != t2) { + if ((t1 == EbtInt8 && t2 == EbtUint8) || + (t2 == EbtInt8 && t1 == EbtUint8) || + (t1 == EbtInt16 && t2 == EbtUint16) || + (t2 == EbtInt16 && t1 == EbtUint16)|| + (t1 == EbtInt && t2 == EbtUint) || + (t2 == EbtInt && t1 == EbtUint)|| + (t1 == EbtInt64 && t2 == EbtUint64) || + (t2 == EbtInt64 && t1 == EbtUint64)) { + return true; + } + } + return t1 == t2; +} + // Compare a new (the passed in) 'range' against the existing set, and see // if there are any collisions. // @@ -1748,7 +1898,13 @@ int TIntermediate::checkLocationRange(int set, const TIoRange& range, const TTyp if (range.overlap(usedIo[set][r])) { // there is a collision; pick one return std::max(range.location.start, usedIo[set][r].location.start); - } else if (range.location.overlap(usedIo[set][r].location) && type.getBasicType() != usedIo[set][r].basicType) { + } else if (range.location.overlap(usedIo[set][r].location) && + (!checkCompatibleTypes(type.getBasicType(), usedIo[set][r].basicType) || + type.getQualifier().centroid != usedIo[set][r].centroid || + type.getQualifier().smooth != usedIo[set][r].smooth || + type.getQualifier().flat != usedIo[set][r].flat || + type.getQualifier().sample != usedIo[set][r].sample || + type.getQualifier().patch != usedIo[set][r].patch)) { // aliased-type mismatch typeCollision = true; return std::max(range.location.start, usedIo[set][r].location.start); @@ -2217,9 +2373,9 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, T } // To aid the basic HLSL rule about crossing vec4 boundaries. -bool TIntermediate::improperStraddle(const TType& type, int size, int offset) +bool TIntermediate::improperStraddle(const TType& type, int size, int offset, bool vectorLike) { - if (! type.isVector() || type.isArray()) + if (! vectorLike || type.isArray()) return false; return size <= 16 ? offset / 16 != (offset + size - 1) / 16 diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h index 2f0e65ce..a2fb9514 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h @@ -43,11 +43,12 @@ #include "../Public/ShaderLang.h" #include "Versions.h" -#include -#include #include -#include #include +#include +#include +#include +#include class TInfoSink; @@ -98,7 +99,8 @@ class TSwizzleSelectors { // A "call" is a pair: . // There can be duplicates. General assumption is the list is small. struct TCall { - TCall(const TString& pCaller, const TString& pCallee) : caller(pCaller), callee(pCallee) { } + TCall(const TString& pCaller, const TString& pCallee) + : caller(pCaller), callee(pCallee), visited(false), currentPath(false), errorGiven(false) { } TString caller; TString callee; bool visited; @@ -122,8 +124,10 @@ struct TRange { // within the same location range, component range, and index value. Locations don't alias unless // all other dimensions of their range overlap. struct TIoRange { - TIoRange(TRange location, TRange component, TBasicType basicType, int index) - : location(location), component(component), basicType(basicType), index(index) { } + TIoRange(TRange location, TRange component, TBasicType basicType, int index, bool centroid, bool smooth, bool flat, bool sample, bool patch) + : location(location), component(component), basicType(basicType), index(index), centroid(centroid), smooth(smooth), flat(flat), sample(sample), patch(patch) + { + } bool overlap(const TIoRange& rhs) const { return location.overlap(rhs.location) && component.overlap(rhs.component) && index == rhs.index; @@ -132,6 +136,11 @@ struct TIoRange { TRange component; TBasicType basicType; int index; + bool centroid; + bool smooth; + bool flat; + bool sample; + bool patch; }; // An offset range is a 2-D rectangle; the set of (binding, offset) pairs all lying @@ -344,10 +353,12 @@ class TIntermediate { needToLegalize(false), binaryDoubleOutput(false), subgroupUniformControlFlow(false), + maximallyReconverges(false), usePhysicalStorageBuffer(false), spirvRequirement(nullptr), spirvExecutionMode(nullptr), - uniformLocationBase(0) + uniformLocationBase(0), + quadDerivMode(false), reqFullQuadsMode(false) { localSize[0] = 1; localSize[1] = 1; @@ -527,6 +538,8 @@ class TIntermediate { TOperator mapTypeToConstructorOp(const TType&) const; TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right); TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&); + TIntermAggregate* mergeAggregate(TIntermNode* left, TIntermNode* right); + TIntermAggregate* mergeAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&); TIntermAggregate* makeAggregate(TIntermNode* node); TIntermAggregate* makeAggregate(TIntermNode* node, const TSourceLoc&); TIntermAggregate* makeAggregate(const TSourceLoc&); @@ -572,7 +585,8 @@ class TIntermediate { TIntermTyped* foldSwizzle(TIntermTyped* node, TSwizzleSelectors& fields, const TSourceLoc&); // Tree ops - static const TIntermTyped* findLValueBase(const TIntermTyped*, bool swizzleOkay , bool BufferReferenceOk = false); + static const TIntermTyped* traverseLValueBase(const TIntermTyped*, bool swizzleOkay, bool bufferReferenceOk = false, + std::function proc = {}); // Linkage related void addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguage, TSymbolTable&); @@ -718,6 +732,11 @@ class TIntermediate { usePhysicalStorageBuffer = true; } bool usingPhysicalStorageBuffer() const { return usePhysicalStorageBuffer; } + void setReplicatedComposites() + { + useReplicatedComposites = true; + } + bool usingReplicatedComposites() const { return useReplicatedComposites; } void setUseVariablePointers() { useVariablePointers = true; @@ -853,6 +872,10 @@ class TIntermediate { void setXfbMode() { xfbMode = true; } bool getXfbMode() const { return xfbMode; } + void setQuadDerivMode(bool mode = true) { quadDerivMode = mode; } + bool getQuadDerivMode() const { return quadDerivMode; } + void setReqFullQuadsMode(bool mode = true) { reqFullQuadsMode = mode; } + bool getReqFullQuadsMode() const { return reqFullQuadsMode; } void setMultiStream() { multiStream = true; } bool isMultiStream() const { return multiStream; } bool setOutputPrimitive(TLayoutGeometry p) @@ -959,6 +982,9 @@ class TIntermediate { void setSubgroupUniformControlFlow() { subgroupUniformControlFlow = true; } bool getSubgroupUniformControlFlow() const { return subgroupUniformControlFlow; } + void setMaximallyReconverges() { maximallyReconverges = true; } + bool getMaximallyReconverges() const { return maximallyReconverges; } + // GL_EXT_spirv_intrinsics void insertSpirvRequirement(const TSpirvRequirement* spirvReq); bool hasSpirvRequirement() const { return spirvRequirement != nullptr; } @@ -1025,6 +1051,7 @@ class TIntermediate { void mergeGlobalUniformBlocks(TInfoSink& infoSink, TIntermediate& unit, bool mergeExistingOnly); void mergeUniformObjects(TInfoSink& infoSink, TIntermediate& unit); void checkStageIO(TInfoSink&, TIntermediate&); + void optimizeStageIO(TInfoSink&, TIntermediate&); bool buildConvertOp(TBasicType dst, TBasicType src, TOperator& convertOp) const; TIntermTyped* createConversion(TBasicType convertTo, TIntermTyped* node) const; @@ -1037,6 +1064,7 @@ class TIntermediate { int checkLocationRT(int set, int location); int addUsedOffsets(int binding, int offset, int numOffsets); bool addUsedConstantId(int id); + GLSLANG_EXPORT_FOR_TESTS static int computeTypeLocationSize(const TType&, EShLanguage); static int computeTypeUniformLocationSize(const TType&); @@ -1044,7 +1072,7 @@ class TIntermediate { static int getBaseAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor); static int getScalarAlignment(const TType&, int& size, int& stride, bool rowMajor); static int getMemberAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor); - static bool improperStraddle(const TType& type, int size, int offset); + static bool improperStraddle(const TType& type, int size, int offset, bool vectorLike); static void updateOffset(const TType& parentType, const TType& memberType, int& offset, int& memberSize); static int getOffset(const TType& type, int index); static int getBlockSize(const TType& blockType); @@ -1222,7 +1250,9 @@ class TIntermediate { bool needToLegalize; bool binaryDoubleOutput; bool subgroupUniformControlFlow; + bool maximallyReconverges; bool usePhysicalStorageBuffer; + bool useReplicatedComposites { false }; TSpirvRequirement* spirvRequirement; TSpirvExecutionMode* spirvExecutionMode; @@ -1230,12 +1260,14 @@ class TIntermediate { std::map bindlessImageModeCaller; std::unordered_map uniformLocationOverrides; int uniformLocationBase; + bool quadDerivMode; + bool reqFullQuadsMode; TNumericFeatures numericFeatures; std::unordered_map blockBackingOverrides; std::unordered_set usedConstantId; // specialization constant ids used std::vector usedAtomics; // sets of bindings used by atomic counters - std::vector usedIo[4]; // sets of used locations, one for each of in, out, uniform, and buffers + std::vector usedIo[5]; // sets of used locations, one for each of in, out, uniform, and buffers std::vector usedIoRT[4]; // sets of used location, one for rayPayload/rayPayloadIN, // one for callableData/callableDataIn, one for hitObjectAttributeNV and // one for shaderrecordhitobjectNV diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h index 63841c40..5c77e42c 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h @@ -83,6 +83,11 @@ class TParseVersions { const char* featureDesc); virtual void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); + template + constexpr void ppRequireExtensions(const TSourceLoc& loc, Container extensions, const char* featureDesc) { + ppRequireExtensions(loc, static_cast(extensions.size()), extensions.data(), featureDesc); + } + virtual TExtensionBehavior getExtensionBehavior(const char*); virtual bool extensionTurnedOn(const char* const extension); virtual bool extensionsTurnedOn(int numExtensions, const char* const extensions[]); diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index 16b9d243..5b44b130 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -241,6 +241,7 @@ int TPpContext::CPPundef(TPpToken* ppToken) */ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken) { + inElseSkip = true; int depth = 0; int token = scanToken(ppToken); @@ -297,7 +298,7 @@ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken) elseSeen[elsetracker] = false; --elsetracker; } - + inElseSkip = false; return CPPif(ppToken); } } else if (nextAtom == PpAtomElse) { @@ -311,7 +312,8 @@ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken) parseContext.ppError(ppToken->loc, "#elif after #else", "#elif", ""); } } - + + inElseSkip = false; return token; } @@ -374,7 +376,7 @@ namespace { int op_div(int a, int b) { return a == INT_MIN && b == -1 ? 0 : a / b; } int op_mod(int a, int b) { return a == INT_MIN && b == -1 ? 0 : a % b; } int op_pos(int a) { return a; } - int op_neg(int a) { return -a; } + int op_neg(int a) { return a == INT_MIN ? INT_MIN : -a; } int op_cmpl(int a) { return ~a; } int op_not(int a) { return !a; } @@ -973,7 +975,8 @@ int TPpContext::readCPPline(TPpToken* ppToken) break; case PpAtomInclude: if(!parseContext.isReadingHLSL()) { - parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_include_directive, "#include"); + const std::array exts = { E_GL_GOOGLE_include_directive, E_GL_ARB_shading_language_include }; + parseContext.ppRequireExtensions(ppToken->loc, exts, "#include"); } token = CPPinclude(ppToken); break; diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp index 70f51197..f27204bc 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -88,7 +88,8 @@ TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, T preamble(nullptr), strings(nullptr), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false), rootFileName(rootFileName), currentSourceFile(rootFileName), - disableEscapeSequences(false) + disableEscapeSequences(false), + inElseSkip(false) { ifdepth = 0; for (elsetracker = 0; elsetracker < maxIfNesting; elsetracker++) diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index 590eab6b..3446f1e1 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -86,11 +86,6 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "../ParseHelper.h" #include "PpTokens.h" -/* windows only pragma */ -#ifdef _MSC_VER - #pragma warning(disable : 4127) -#endif - namespace glslang { class TPpToken { @@ -220,6 +215,7 @@ class TPpContext { virtual bool peekContinuedPasting(int) { return false; } // true when non-spaced tokens can paste virtual bool endOfReplacementList() { return false; } // true when at the end of a macro replacement list (RHS of #define) virtual bool isMacroInput() { return false; } + virtual bool isStringInput() { return false; } // Will be called when we start reading tokens from this instance virtual void notifyActivated() {} @@ -360,7 +356,8 @@ class TPpContext { // Scanner data: int previous_token; TParseContextBase& parseContext; - + std::vector lastLineTokens; + std::vector lastLineTokenLocs; // Get the next token from *stack* of input sources, popping input sources // that are out of tokens, down until an input source is found that has a token. // Return EndOfInput when there are no more tokens to be found by doing this. @@ -374,7 +371,31 @@ class TPpContext { break; popInput(); } - + if (!inputStack.empty() && inputStack.back()->isStringInput() && !inElseSkip) { + if (token == '\n') { + bool seenNumSign = false; + for (int i = 0; i < (int)lastLineTokens.size() - 1;) { + int curPos = i; + int curToken = lastLineTokens[i++]; + if (curToken == '#' && lastLineTokens[i] == '#') { + curToken = PpAtomPaste; + i++; + } + if (curToken == '#') { + if (seenNumSign) { + parseContext.ppError(lastLineTokenLocs[curPos], "(#) can be preceded in its line only by spaces or horizontal tabs", "#", ""); + } else { + seenNumSign = true; + } + } + } + lastLineTokens.clear(); + lastLineTokenLocs.clear(); + } else { + lastLineTokens.push_back(token); + lastLineTokenLocs.push_back(ppToken->loc); + } + } return token; } int getChar() { return inputStack.back()->getch(); } @@ -527,7 +548,7 @@ class TPpContext { public: tStringInput(TPpContext* pp, TInputScanner& i) : tInput(pp), input(&i) { } virtual int scan(TPpToken*) override; - + bool isStringInput() override { return true; } // Scanner used to get source stream characters. // - Escaped newlines are handled here, invisibly to the caller. // - All forms of newline are handled, and turned into just a '\n'. @@ -711,6 +732,9 @@ class TPpContext { std::istringstream strtodStream; bool disableEscapeSequences; + // True if we're skipping a section enclosed by #if/#ifdef/#elif/#else which was evaluated to + // be inactive, e.g. #if 0 + bool inElseSkip; }; } // end namespace glslang diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp index 34dec207..49dafa59 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -220,7 +220,9 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) } if (ch >= '0' && ch <= '9') { while (ch >= '0' && ch <= '9') { - exponent = exponent * 10 + (ch - '0'); + if (exponent < 500) { + exponent = exponent * 10 + (ch - '0'); + } saveName(ch); ch = getChar(); } diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h index 8521ad7d..d849be83 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.h @@ -52,4 +52,5 @@ namespace glslang { // 'noContraction' means the object is 'precise'; and for arithmetic operation // nodes, it means the operation should not be contracted. void PropagateNoContraction(const glslang::TIntermediate& intermediate); -}; + +} // end namespace glslang diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp b/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp index 6c7d3a2c..7e316092 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp @@ -704,69 +704,73 @@ class TReflectionTraverser : public TIntermTraverser { case EbtFloat: switch ((int)sampler.dim) { case Esd1D: - switch ((int)sampler.shadow) { - case false: return sampler.arrayed ? GL_SAMPLER_1D_ARRAY : GL_SAMPLER_1D; - case true: return sampler.arrayed ? GL_SAMPLER_1D_ARRAY_SHADOW : GL_SAMPLER_1D_SHADOW; - } + if (sampler.shadow) + return sampler.arrayed ? GL_SAMPLER_1D_ARRAY_SHADOW : GL_SAMPLER_1D_SHADOW; + else + return sampler.arrayed ? GL_SAMPLER_1D_ARRAY : GL_SAMPLER_1D; case Esd2D: - switch ((int)sampler.ms) { - case false: - switch ((int)sampler.shadow) { - case false: return sampler.arrayed ? GL_SAMPLER_2D_ARRAY : GL_SAMPLER_2D; - case true: return sampler.arrayed ? GL_SAMPLER_2D_ARRAY_SHADOW : GL_SAMPLER_2D_SHADOW; - } - case true: return sampler.arrayed ? GL_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_SAMPLER_2D_MULTISAMPLE; + if (sampler.ms) { + return sampler.arrayed ? GL_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_SAMPLER_2D_MULTISAMPLE; + } else { + if (sampler.shadow) + return sampler.arrayed ? GL_SAMPLER_2D_ARRAY_SHADOW : GL_SAMPLER_2D_SHADOW; + else + return sampler.arrayed ? GL_SAMPLER_2D_ARRAY : GL_SAMPLER_2D; } case Esd3D: return GL_SAMPLER_3D; case EsdCube: - switch ((int)sampler.shadow) { - case false: return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY : GL_SAMPLER_CUBE; - case true: return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW : GL_SAMPLER_CUBE_SHADOW; - } + if (sampler.shadow) + return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW : GL_SAMPLER_CUBE_SHADOW; + else + return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY : GL_SAMPLER_CUBE; case EsdRect: return sampler.shadow ? GL_SAMPLER_2D_RECT_SHADOW : GL_SAMPLER_2D_RECT; case EsdBuffer: return GL_SAMPLER_BUFFER; + default: + return 0; } case EbtFloat16: switch ((int)sampler.dim) { case Esd1D: - switch ((int)sampler.shadow) { - case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_AMD : GL_FLOAT16_SAMPLER_1D_AMD; - case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_1D_SHADOW_AMD; - } + if (sampler.shadow) + return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_1D_SHADOW_AMD; + else + return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_AMD : GL_FLOAT16_SAMPLER_1D_AMD; case Esd2D: - switch ((int)sampler.ms) { - case false: - switch ((int)sampler.shadow) { - case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_AMD; - case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_SHADOW_AMD; - } - case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD; + if (sampler.ms) { + return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD; + } else { + if (sampler.shadow) + return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_SHADOW_AMD; + else + return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_AMD; } case Esd3D: return GL_FLOAT16_SAMPLER_3D_AMD; case EsdCube: - switch ((int)sampler.shadow) { - case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_SAMPLER_CUBE_AMD; - case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD; - } + if (sampler.shadow) + return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD; + else + return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_SAMPLER_CUBE_AMD; case EsdRect: return sampler.shadow ? GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_RECT_AMD; case EsdBuffer: return GL_FLOAT16_SAMPLER_BUFFER_AMD; + default: + return 0; } case EbtInt: switch ((int)sampler.dim) { case Esd1D: return sampler.arrayed ? GL_INT_SAMPLER_1D_ARRAY : GL_INT_SAMPLER_1D; case Esd2D: - switch ((int)sampler.ms) { - case false: return sampler.arrayed ? GL_INT_SAMPLER_2D_ARRAY : GL_INT_SAMPLER_2D; - case true: return sampler.arrayed ? GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY - : GL_INT_SAMPLER_2D_MULTISAMPLE; - } + if (sampler.ms) + return sampler.arrayed ? GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY + : GL_INT_SAMPLER_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_INT_SAMPLER_2D_ARRAY : GL_INT_SAMPLER_2D; case Esd3D: return GL_INT_SAMPLER_3D; case EsdCube: @@ -775,17 +779,19 @@ class TReflectionTraverser : public TIntermTraverser { return GL_INT_SAMPLER_2D_RECT; case EsdBuffer: return GL_INT_SAMPLER_BUFFER; + default: + return 0; } case EbtUint: switch ((int)sampler.dim) { case Esd1D: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_1D_ARRAY : GL_UNSIGNED_INT_SAMPLER_1D; case Esd2D: - switch ((int)sampler.ms) { - case false: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D; - case true: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY - : GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE; - } + if (sampler.ms) + return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY + : GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D; case Esd3D: return GL_UNSIGNED_INT_SAMPLER_3D; case EsdCube: @@ -794,6 +800,8 @@ class TReflectionTraverser : public TIntermTraverser { return GL_UNSIGNED_INT_SAMPLER_2D_RECT; case EsdBuffer: return GL_UNSIGNED_INT_SAMPLER_BUFFER; + default: + return 0; } default: return 0; @@ -806,10 +814,10 @@ class TReflectionTraverser : public TIntermTraverser { case Esd1D: return sampler.arrayed ? GL_IMAGE_1D_ARRAY : GL_IMAGE_1D; case Esd2D: - switch ((int)sampler.ms) { - case false: return sampler.arrayed ? GL_IMAGE_2D_ARRAY : GL_IMAGE_2D; - case true: return sampler.arrayed ? GL_IMAGE_2D_MULTISAMPLE_ARRAY : GL_IMAGE_2D_MULTISAMPLE; - } + if (sampler.ms) + return sampler.arrayed ? GL_IMAGE_2D_MULTISAMPLE_ARRAY : GL_IMAGE_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_IMAGE_2D_ARRAY : GL_IMAGE_2D; case Esd3D: return GL_IMAGE_3D; case EsdCube: @@ -818,16 +826,18 @@ class TReflectionTraverser : public TIntermTraverser { return GL_IMAGE_2D_RECT; case EsdBuffer: return GL_IMAGE_BUFFER; + default: + return 0; } case EbtFloat16: switch ((int)sampler.dim) { case Esd1D: return sampler.arrayed ? GL_FLOAT16_IMAGE_1D_ARRAY_AMD : GL_FLOAT16_IMAGE_1D_AMD; case Esd2D: - switch ((int)sampler.ms) { - case false: return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_AMD; - case true: return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD; - } + if (sampler.ms) + return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD; + else + return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_AMD; case Esd3D: return GL_FLOAT16_IMAGE_3D_AMD; case EsdCube: @@ -836,16 +846,18 @@ class TReflectionTraverser : public TIntermTraverser { return GL_FLOAT16_IMAGE_2D_RECT_AMD; case EsdBuffer: return GL_FLOAT16_IMAGE_BUFFER_AMD; + default: + return 0; } case EbtInt: switch ((int)sampler.dim) { case Esd1D: return sampler.arrayed ? GL_INT_IMAGE_1D_ARRAY : GL_INT_IMAGE_1D; case Esd2D: - switch ((int)sampler.ms) { - case false: return sampler.arrayed ? GL_INT_IMAGE_2D_ARRAY : GL_INT_IMAGE_2D; - case true: return sampler.arrayed ? GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_INT_IMAGE_2D_MULTISAMPLE; - } + if (sampler.ms) + return sampler.arrayed ? GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_INT_IMAGE_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_INT_IMAGE_2D_ARRAY : GL_INT_IMAGE_2D; case Esd3D: return GL_INT_IMAGE_3D; case EsdCube: @@ -854,17 +866,19 @@ class TReflectionTraverser : public TIntermTraverser { return GL_INT_IMAGE_2D_RECT; case EsdBuffer: return GL_INT_IMAGE_BUFFER; + default: + return 0; } case EbtUint: switch ((int)sampler.dim) { case Esd1D: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_1D_ARRAY : GL_UNSIGNED_INT_IMAGE_1D; case Esd2D: - switch ((int)sampler.ms) { - case false: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_ARRAY : GL_UNSIGNED_INT_IMAGE_2D; - case true: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY - : GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE; - } + if (sampler.ms) + return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY + : GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE; + else + return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_ARRAY : GL_UNSIGNED_INT_IMAGE_2D; case Esd3D: return GL_UNSIGNED_INT_IMAGE_3D; case EsdCube: @@ -873,6 +887,8 @@ class TReflectionTraverser : public TIntermTraverser { return GL_UNSIGNED_INT_IMAGE_2D_RECT; case EsdBuffer: return GL_UNSIGNED_INT_IMAGE_BUFFER; + default: + return 0; } default: return 0; @@ -937,6 +953,7 @@ class TReflectionTraverser : public TIntermTraverser { case 4: return GL_FLOAT_MAT4; default: return 0; } + default: return 0; } case EbtDouble: switch (type.getMatrixCols()) { @@ -961,6 +978,7 @@ class TReflectionTraverser : public TIntermTraverser { case 4: return GL_DOUBLE_MAT4; default: return 0; } + default: return 0; } case EbtFloat16: switch (type.getMatrixCols()) { @@ -985,6 +1003,7 @@ class TReflectionTraverser : public TIntermTraverser { case 4: return GL_FLOAT16_MAT4_AMD; default: return 0; } + default: return 0; } default: return 0; diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.h index 221d93f8..8315b112 100644 --- a/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.h +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.h @@ -37,8 +37,8 @@ #define _REFLECTION_INCLUDED #include "../Public/ShaderLang.h" -#include "../Include/Types.h" - +#include "../Include/BaseTypes.h" +#include "../Include/visibility.h" #include #include @@ -65,6 +65,7 @@ class TReflection { virtual ~TReflection() {} // grow the reflection stage by stage + GLSLANG_EXPORT_FOR_TESTS bool addStage(EShLanguage, const TIntermediate&); // for mapping a uniform index to a uniform object's description diff --git a/bgfx/3rdparty/glslang/glslang/MachineIndependent/span.h b/bgfx/3rdparty/glslang/glslang/MachineIndependent/span.h new file mode 100644 index 00000000..c8bc0828 --- /dev/null +++ b/bgfx/3rdparty/glslang/glslang/MachineIndependent/span.h @@ -0,0 +1,94 @@ +#pragma once + +// +// 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. +// + +#include + +// Partial implementation of std::span for C++11 +// Replace with std::span if repo standard is bumped to C++20 +// +// This code was copied from https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/main/layers/containers/custom_containers.h +template +class span { + public: + using pointer = T *; + using const_pointer = T const *; + using iterator = pointer; + using const_iterator = const_pointer; + + span() = default; + span(pointer start, size_t n) : data_(start), count_(n) {} + template + span(Iterator start, Iterator end) : data_(&(*start)), count_(end - start) {} + template + span(Container &c) : data_(c.data()), count_(c.size()) {} + + iterator begin() { return data_; } + const_iterator begin() const { return data_; } + + iterator end() { return data_ + count_; } + const_iterator end() const { return data_ + count_; } + + T &operator[](int i) { return data_[i]; } + const T &operator[](int i) const { return data_[i]; } + + T &front() { return *data_; } + const T &front() const { return *data_; } + + T &back() { return *(data_ + (count_ - 1)); } + const T &back() const { return *(data_ + (count_ - 1)); } + + size_t size() const { return count_; } + bool empty() const { return count_ == 0; } + + pointer data() { return data_; } + const_pointer data() const { return data_; } + + private: + pointer data_ = {}; + size_t count_ = 0; +}; + +// +// Allow type inference that using the constructor doesn't allow in C++11 +template +span make_span(T *begin, size_t count) { + return span(begin, count); +} +template +span make_span(T *begin, T *end) { + return make_span(begin, end); +} diff --git a/bgfx/3rdparty/glslang/glslang/OSDependent/osinclude.h b/bgfx/3rdparty/glslang/glslang/OSDependent/osinclude.h index 0d677e4a..da1c4f69 100644 --- a/bgfx/3rdparty/glslang/glslang/OSDependent/osinclude.h +++ b/bgfx/3rdparty/glslang/glslang/OSDependent/osinclude.h @@ -35,9 +35,10 @@ #ifndef __OSINCLUDE_H #define __OSINCLUDE_H +#include "../Include/visibility.h" namespace glslang { -void OS_DumpMemoryCounters(); +GLSLANG_EXPORT void OS_DumpMemoryCounters(); } // end namespace glslang diff --git a/bgfx/3rdparty/glslang/glslang/Public/ResourceLimits.h b/bgfx/3rdparty/glslang/glslang/Public/ResourceLimits.h index f70be817..8245e12d 100644 --- a/bgfx/3rdparty/glslang/glslang/Public/ResourceLimits.h +++ b/bgfx/3rdparty/glslang/glslang/Public/ResourceLimits.h @@ -38,20 +38,21 @@ #include #include "../Include/ResourceLimits.h" +#include "../Include/visibility.h" // Return pointer to user-writable Resource to pass through API in // future-proof way. -extern TBuiltInResource* GetResources(); +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. -extern const TBuiltInResource* GetDefaultResources(); +GLSLANG_EXPORT extern const TBuiltInResource* GetDefaultResources(); // Returns the DefaultTBuiltInResource as a human-readable string. -std::string GetDefaultTBuiltInResourceString(); +GLSLANG_EXPORT std::string GetDefaultTBuiltInResourceString(); // Decodes the resource limits from |config| to |resources|. -void DecodeResourceLimits(TBuiltInResource* resources, char* config); +GLSLANG_EXPORT void DecodeResourceLimits(TBuiltInResource* resources, char* config); #endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ diff --git a/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h b/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h index e037e63f..739d7f7b 100644 --- a/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h +++ b/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h @@ -38,6 +38,7 @@ #define _COMPILER_INTERFACE_INCLUDED_ #include "../Include/ResourceLimits.h" +#include "../Include/visibility.h" #include "../MachineIndependent/Versions.h" #include @@ -49,22 +50,6 @@ #define C_DECL #endif -#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 - // // This is the platform independent interface between an OGL driver // and the shading language compiler/linker. @@ -188,6 +173,21 @@ typedef enum { 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 @@ -252,23 +252,26 @@ typedef enum { // 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 + 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 LAST_ELEMENT_MARKER(EShMsgCount), }; @@ -318,8 +321,8 @@ typedef void* ShHandle; // Driver calls these to create and destroy compiler/linker // objects. // -GLSLANG_EXPORT ShHandle ShConstructCompiler(const EShLanguage, int debugOptions); // one per shader -GLSLANG_EXPORT ShHandle ShConstructLinker(const EShExecutable, int debugOptions); // one per shader pair +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); @@ -330,18 +333,14 @@ GLSLANG_EXPORT void ShDestruct(ShHandle); // 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, - 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 - ); +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 @@ -417,6 +416,7 @@ 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(); @@ -512,6 +512,9 @@ class TShader { GLSLANG_EXPORT void setAtomicCounterBlockSet(unsigned int set); GLSLANG_EXPORT void setAtomicCounterBlockBinding(unsigned int binding); + GLSLANG_EXPORT void addSourceText(const char* text, size_t len); + GLSLANG_EXPORT 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 @@ -573,6 +576,9 @@ class TShader { 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: @@ -722,6 +728,9 @@ class TShader { TEnvironment environment; + // Indicates this shader is meant to be used without linking + bool compileOnly = false; + friend class TProgram; private: @@ -742,6 +751,8 @@ class TObjectReflection { GLSLANG_EXPORT void dump() const; static TObjectReflection badReflection() { return TObjectReflection(); } + GLSLANG_EXPORT unsigned int layoutLocation() const; + std::string name; int offset; int glDefineType; @@ -844,6 +855,20 @@ class TIoMapResolver 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(). @@ -951,6 +976,10 @@ class TProgram { const TType *getAttributeTType(int index) const { return getPipeInput(index).getType(); } GLSLANG_EXPORT void dumpReflection(); + + // Get the IO resolver to use for mapIO + GLSLANG_EXPORT 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. diff --git a/bgfx/3rdparty/glslang/glslang/Public/resource_limits_c.h b/bgfx/3rdparty/glslang/glslang/Public/resource_limits_c.h index 05aa8eb0..3cf7442f 100644 --- a/bgfx/3rdparty/glslang/glslang/Public/resource_limits_c.h +++ b/bgfx/3rdparty/glslang/glslang/Public/resource_limits_c.h @@ -30,25 +30,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #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_resource_t* glslang_resource(void); +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. -const glslang_resource_t* glslang_default_resource(void); +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. -const char* glslang_default_resource_string(); +GLSLANG_EXPORT const char* glslang_default_resource_string(); // Decodes the resource limits from |config| to |resources|. -void glslang_decode_resource_limits(glslang_resource_t* resources, char* config); +GLSLANG_EXPORT void glslang_decode_resource_limits(glslang_resource_t* resources, char* config); #ifdef __cplusplus } diff --git a/bgfx/3rdparty/glslang/glslang/ResourceLimits/resource_limits_c.cpp b/bgfx/3rdparty/glslang/glslang/ResourceLimits/resource_limits_c.cpp index 0eeac23a..8909d9ef 100644 --- a/bgfx/3rdparty/glslang/glslang/ResourceLimits/resource_limits_c.cpp +++ b/bgfx/3rdparty/glslang/glslang/ResourceLimits/resource_limits_c.cpp @@ -42,28 +42,14 @@ const glslang_resource_t* glslang_default_resource(void) return reinterpret_cast(GetDefaultResources()); } -#if defined(__clang__) || defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#elif defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable : 4996) -#endif - const char* glslang_default_resource_string() { std::string cpp_str = GetDefaultTBuiltInResourceString(); char* c_str = (char*)malloc(cpp_str.length() + 1); - strcpy(c_str, cpp_str.c_str()); + strncpy(c_str, cpp_str.c_str(), cpp_str.length() + 1); return c_str; } -#if defined(__clang__) || defined(__GNUC__) -#pragma GCC diagnostic pop -#elif defined(_MSC_VER) -#pragma warning(pop) -#endif - void glslang_decode_resource_limits(glslang_resource_t* resources, char* config) { DecodeResourceLimits(reinterpret_cast(resources), config); diff --git a/bgfx/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp b/bgfx/3rdparty/glslang/glslang/stub.cpp similarity index 85% rename from bgfx/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp rename to bgfx/3rdparty/glslang/glslang/stub.cpp index ab3762e0..b9aec6d1 100644 --- a/bgfx/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp +++ b/bgfx/3rdparty/glslang/glslang/stub.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2024 The Khronos Group Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -32,6 +32,6 @@ // POSSIBILITY OF SUCH DAMAGE. // -namespace glslang { - -} // end namespace glslang +// This empty source file exists to support building stubbed versions of +// deprecated libraries which have been integrated into the main glslang +// library. It should be deleted once the stub libraries are fully removed. diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_platform.h b/bgfx/3rdparty/khronos/vulkan-local/vk_platform.h index ed67a600..0ecd4f64 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vk_platform.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_platform.h @@ -2,7 +2,7 @@ // File: vk_platform.h // /* -** Copyright 2014-2023 The Khronos Group Inc. +** Copyright 2014-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_av1std.h b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_av1std.h new file mode 100644 index 00000000..8ce283e8 --- /dev/null +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_av1std.h @@ -0,0 +1,392 @@ +#ifndef VULKAN_VIDEO_CODEC_AV1STD_H_ +#define VULKAN_VIDEO_CODEC_AV1STD_H_ 1 + +/* +** Copyright 2015-2024 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// vulkan_video_codec_av1std is a preprocessor guard. Do not pass it to API calls. +#define vulkan_video_codec_av1std 1 +#include "vulkan_video_codecs_common.h" +#define STD_VIDEO_AV1_NUM_REF_FRAMES 8 +#define STD_VIDEO_AV1_REFS_PER_FRAME 7 +#define STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME 8 +#define STD_VIDEO_AV1_MAX_TILE_COLS 64 +#define STD_VIDEO_AV1_MAX_TILE_ROWS 64 +#define STD_VIDEO_AV1_MAX_SEGMENTS 8 +#define STD_VIDEO_AV1_SEG_LVL_MAX 8 +#define STD_VIDEO_AV1_PRIMARY_REF_NONE 7 +#define STD_VIDEO_AV1_SELECT_INTEGER_MV 2 +#define STD_VIDEO_AV1_SELECT_SCREEN_CONTENT_TOOLS 2 +#define STD_VIDEO_AV1_SKIP_MODE_FRAMES 2 +#define STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS 4 +#define STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS 2 +#define STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS 8 +#define STD_VIDEO_AV1_MAX_NUM_PLANES 3 +#define STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS 6 +#define STD_VIDEO_AV1_MAX_NUM_Y_POINTS 14 +#define STD_VIDEO_AV1_MAX_NUM_CB_POINTS 10 +#define STD_VIDEO_AV1_MAX_NUM_CR_POINTS 10 +#define STD_VIDEO_AV1_MAX_NUM_POS_LUMA 24 +#define STD_VIDEO_AV1_MAX_NUM_POS_CHROMA 25 + +typedef enum StdVideoAV1Profile { + STD_VIDEO_AV1_PROFILE_MAIN = 0, + STD_VIDEO_AV1_PROFILE_HIGH = 1, + STD_VIDEO_AV1_PROFILE_PROFESSIONAL = 2, + STD_VIDEO_AV1_PROFILE_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_PROFILE_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1Profile; + +typedef enum StdVideoAV1Level { + STD_VIDEO_AV1_LEVEL_2_0 = 0, + STD_VIDEO_AV1_LEVEL_2_1 = 1, + STD_VIDEO_AV1_LEVEL_2_2 = 2, + STD_VIDEO_AV1_LEVEL_2_3 = 3, + STD_VIDEO_AV1_LEVEL_3_0 = 4, + STD_VIDEO_AV1_LEVEL_3_1 = 5, + STD_VIDEO_AV1_LEVEL_3_2 = 6, + STD_VIDEO_AV1_LEVEL_3_3 = 7, + STD_VIDEO_AV1_LEVEL_4_0 = 8, + STD_VIDEO_AV1_LEVEL_4_1 = 9, + STD_VIDEO_AV1_LEVEL_4_2 = 10, + STD_VIDEO_AV1_LEVEL_4_3 = 11, + STD_VIDEO_AV1_LEVEL_5_0 = 12, + STD_VIDEO_AV1_LEVEL_5_1 = 13, + STD_VIDEO_AV1_LEVEL_5_2 = 14, + STD_VIDEO_AV1_LEVEL_5_3 = 15, + STD_VIDEO_AV1_LEVEL_6_0 = 16, + STD_VIDEO_AV1_LEVEL_6_1 = 17, + STD_VIDEO_AV1_LEVEL_6_2 = 18, + STD_VIDEO_AV1_LEVEL_6_3 = 19, + STD_VIDEO_AV1_LEVEL_7_0 = 20, + STD_VIDEO_AV1_LEVEL_7_1 = 21, + STD_VIDEO_AV1_LEVEL_7_2 = 22, + STD_VIDEO_AV1_LEVEL_7_3 = 23, + STD_VIDEO_AV1_LEVEL_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_LEVEL_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1Level; + +typedef enum StdVideoAV1FrameType { + STD_VIDEO_AV1_FRAME_TYPE_KEY = 0, + STD_VIDEO_AV1_FRAME_TYPE_INTER = 1, + STD_VIDEO_AV1_FRAME_TYPE_INTRA_ONLY = 2, + STD_VIDEO_AV1_FRAME_TYPE_SWITCH = 3, + STD_VIDEO_AV1_FRAME_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_FRAME_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1FrameType; + +typedef enum StdVideoAV1ReferenceName { + STD_VIDEO_AV1_REFERENCE_NAME_INTRA_FRAME = 0, + STD_VIDEO_AV1_REFERENCE_NAME_LAST_FRAME = 1, + STD_VIDEO_AV1_REFERENCE_NAME_LAST2_FRAME = 2, + STD_VIDEO_AV1_REFERENCE_NAME_LAST3_FRAME = 3, + STD_VIDEO_AV1_REFERENCE_NAME_GOLDEN_FRAME = 4, + STD_VIDEO_AV1_REFERENCE_NAME_BWDREF_FRAME = 5, + STD_VIDEO_AV1_REFERENCE_NAME_ALTREF2_FRAME = 6, + STD_VIDEO_AV1_REFERENCE_NAME_ALTREF_FRAME = 7, + STD_VIDEO_AV1_REFERENCE_NAME_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_REFERENCE_NAME_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1ReferenceName; + +typedef enum StdVideoAV1InterpolationFilter { + STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP = 0, + STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH = 1, + STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP = 2, + STD_VIDEO_AV1_INTERPOLATION_FILTER_BILINEAR = 3, + STD_VIDEO_AV1_INTERPOLATION_FILTER_SWITCHABLE = 4, + STD_VIDEO_AV1_INTERPOLATION_FILTER_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_INTERPOLATION_FILTER_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1InterpolationFilter; + +typedef enum StdVideoAV1TxMode { + STD_VIDEO_AV1_TX_MODE_ONLY_4X4 = 0, + STD_VIDEO_AV1_TX_MODE_LARGEST = 1, + STD_VIDEO_AV1_TX_MODE_SELECT = 2, + STD_VIDEO_AV1_TX_MODE_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_TX_MODE_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1TxMode; + +typedef enum StdVideoAV1FrameRestorationType { + STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_NONE = 0, + STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_WIENER = 1, + STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SGRPROJ = 2, + STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SWITCHABLE = 3, + STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1FrameRestorationType; + +typedef enum StdVideoAV1ColorPrimaries { + STD_VIDEO_AV1_COLOR_PRIMARIES_BT_709 = 1, + STD_VIDEO_AV1_COLOR_PRIMARIES_BT_UNSPECIFIED = 2, + STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_M = 4, + STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_B_G = 5, + STD_VIDEO_AV1_COLOR_PRIMARIES_BT_601 = 6, + STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_240 = 7, + STD_VIDEO_AV1_COLOR_PRIMARIES_GENERIC_FILM = 8, + STD_VIDEO_AV1_COLOR_PRIMARIES_BT_2020 = 9, + STD_VIDEO_AV1_COLOR_PRIMARIES_XYZ = 10, + STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_431 = 11, + STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_432 = 12, + STD_VIDEO_AV1_COLOR_PRIMARIES_EBU_3213 = 22, + STD_VIDEO_AV1_COLOR_PRIMARIES_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_COLOR_PRIMARIES_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1ColorPrimaries; + +typedef enum StdVideoAV1TransferCharacteristics { + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_0 = 0, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_709 = 1, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_UNSPECIFIED = 2, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_3 = 3, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_M = 4, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_B_G = 5, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_601 = 6, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_240 = 7, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LINEAR = 8, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100 = 9, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100_SQRT10 = 10, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_IEC_61966 = 11, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_1361 = 12, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SRGB = 13, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_10_BIT = 14, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_12_BIT = 15, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_2084 = 16, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_428 = 17, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_HLG = 18, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1TransferCharacteristics; + +typedef enum StdVideoAV1MatrixCoefficients { + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_IDENTITY = 0, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_709 = 1, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_UNSPECIFIED = 2, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_RESERVED_3 = 3, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_FCC = 4, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_470_B_G = 5, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_601 = 6, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_240 = 7, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_YCGCO = 8, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_NCL = 9, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_CL = 10, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_2085 = 11, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_NCL = 12, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_CL = 13, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_ICTCP = 14, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_MATRIX_COEFFICIENTS_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1MatrixCoefficients; + +typedef enum StdVideoAV1ChromaSamplePosition { + STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_UNKNOWN = 0, + STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_VERTICAL = 1, + STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_COLOCATED = 2, + STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_RESERVED = 3, + STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_INVALID = 0x7FFFFFFF, + STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_MAX_ENUM = 0x7FFFFFFF +} StdVideoAV1ChromaSamplePosition; +typedef struct StdVideoAV1ColorConfigFlags { + uint32_t mono_chrome : 1; + uint32_t color_range : 1; + uint32_t separate_uv_delta_q : 1; + uint32_t color_description_present_flag : 1; + uint32_t reserved : 28; +} StdVideoAV1ColorConfigFlags; + +typedef struct StdVideoAV1ColorConfig { + StdVideoAV1ColorConfigFlags flags; + uint8_t BitDepth; + uint8_t subsampling_x; + uint8_t subsampling_y; + uint8_t reserved1; + StdVideoAV1ColorPrimaries color_primaries; + StdVideoAV1TransferCharacteristics transfer_characteristics; + StdVideoAV1MatrixCoefficients matrix_coefficients; + StdVideoAV1ChromaSamplePosition chroma_sample_position; +} StdVideoAV1ColorConfig; + +typedef struct StdVideoAV1TimingInfoFlags { + uint32_t equal_picture_interval : 1; + uint32_t reserved : 31; +} StdVideoAV1TimingInfoFlags; + +typedef struct StdVideoAV1TimingInfo { + StdVideoAV1TimingInfoFlags flags; + uint32_t num_units_in_display_tick; + uint32_t time_scale; + uint32_t num_ticks_per_picture_minus_1; +} StdVideoAV1TimingInfo; + +typedef struct StdVideoAV1LoopFilterFlags { + uint32_t loop_filter_delta_enabled : 1; + uint32_t loop_filter_delta_update : 1; + uint32_t reserved : 30; +} StdVideoAV1LoopFilterFlags; + +typedef struct StdVideoAV1LoopFilter { + StdVideoAV1LoopFilterFlags flags; + uint8_t loop_filter_level[STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS]; + uint8_t loop_filter_sharpness; + uint8_t update_ref_delta; + int8_t loop_filter_ref_deltas[STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME]; + uint8_t update_mode_delta; + int8_t loop_filter_mode_deltas[STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS]; +} StdVideoAV1LoopFilter; + +typedef struct StdVideoAV1QuantizationFlags { + uint32_t using_qmatrix : 1; + uint32_t diff_uv_delta : 1; + uint32_t reserved : 30; +} StdVideoAV1QuantizationFlags; + +typedef struct StdVideoAV1Quantization { + StdVideoAV1QuantizationFlags flags; + uint8_t base_q_idx; + int8_t DeltaQYDc; + int8_t DeltaQUDc; + int8_t DeltaQUAc; + int8_t DeltaQVDc; + int8_t DeltaQVAc; + uint8_t qm_y; + uint8_t qm_u; + uint8_t qm_v; +} StdVideoAV1Quantization; + +typedef struct StdVideoAV1Segmentation { + uint8_t FeatureEnabled[STD_VIDEO_AV1_MAX_SEGMENTS]; + int16_t FeatureData[STD_VIDEO_AV1_MAX_SEGMENTS][STD_VIDEO_AV1_SEG_LVL_MAX]; +} StdVideoAV1Segmentation; + +typedef struct StdVideoAV1TileInfoFlags { + uint32_t uniform_tile_spacing_flag : 1; + uint32_t reserved : 31; +} StdVideoAV1TileInfoFlags; + +typedef struct StdVideoAV1TileInfo { + StdVideoAV1TileInfoFlags flags; + uint8_t TileCols; + uint8_t TileRows; + uint16_t context_update_tile_id; + uint8_t tile_size_bytes_minus_1; + uint8_t reserved1[7]; + const uint16_t* pMiColStarts; + const uint16_t* pMiRowStarts; + const uint16_t* pWidthInSbsMinus1; + const uint16_t* pHeightInSbsMinus1; +} StdVideoAV1TileInfo; + +typedef struct StdVideoAV1CDEF { + uint8_t cdef_damping_minus_3; + uint8_t cdef_bits; + uint8_t cdef_y_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS]; + uint8_t cdef_y_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS]; + uint8_t cdef_uv_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS]; + uint8_t cdef_uv_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS]; +} StdVideoAV1CDEF; + +typedef struct StdVideoAV1LoopRestoration { + StdVideoAV1FrameRestorationType FrameRestorationType[STD_VIDEO_AV1_MAX_NUM_PLANES]; + uint16_t LoopRestorationSize[STD_VIDEO_AV1_MAX_NUM_PLANES]; +} StdVideoAV1LoopRestoration; + +typedef struct StdVideoAV1GlobalMotion { + uint8_t GmType[STD_VIDEO_AV1_NUM_REF_FRAMES]; + int32_t gm_params[STD_VIDEO_AV1_NUM_REF_FRAMES][STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS]; +} StdVideoAV1GlobalMotion; + +typedef struct StdVideoAV1FilmGrainFlags { + uint32_t chroma_scaling_from_luma : 1; + uint32_t overlap_flag : 1; + uint32_t clip_to_restricted_range : 1; + uint32_t update_grain : 1; + uint32_t reserved : 28; +} StdVideoAV1FilmGrainFlags; + +typedef struct StdVideoAV1FilmGrain { + StdVideoAV1FilmGrainFlags flags; + uint8_t grain_scaling_minus_8; + uint8_t ar_coeff_lag; + uint8_t ar_coeff_shift_minus_6; + uint8_t grain_scale_shift; + uint16_t grain_seed; + uint8_t film_grain_params_ref_idx; + uint8_t num_y_points; + uint8_t point_y_value[STD_VIDEO_AV1_MAX_NUM_Y_POINTS]; + uint8_t point_y_scaling[STD_VIDEO_AV1_MAX_NUM_Y_POINTS]; + uint8_t num_cb_points; + uint8_t point_cb_value[STD_VIDEO_AV1_MAX_NUM_CB_POINTS]; + uint8_t point_cb_scaling[STD_VIDEO_AV1_MAX_NUM_CB_POINTS]; + uint8_t num_cr_points; + uint8_t point_cr_value[STD_VIDEO_AV1_MAX_NUM_CR_POINTS]; + uint8_t point_cr_scaling[STD_VIDEO_AV1_MAX_NUM_CR_POINTS]; + int8_t ar_coeffs_y_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_LUMA]; + int8_t ar_coeffs_cb_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA]; + int8_t ar_coeffs_cr_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA]; + uint8_t cb_mult; + uint8_t cb_luma_mult; + uint16_t cb_offset; + uint8_t cr_mult; + uint8_t cr_luma_mult; + uint16_t cr_offset; +} StdVideoAV1FilmGrain; + +typedef struct StdVideoAV1SequenceHeaderFlags { + uint32_t still_picture : 1; + uint32_t reduced_still_picture_header : 1; + uint32_t use_128x128_superblock : 1; + uint32_t enable_filter_intra : 1; + uint32_t enable_intra_edge_filter : 1; + uint32_t enable_interintra_compound : 1; + uint32_t enable_masked_compound : 1; + uint32_t enable_warped_motion : 1; + uint32_t enable_dual_filter : 1; + uint32_t enable_order_hint : 1; + uint32_t enable_jnt_comp : 1; + uint32_t enable_ref_frame_mvs : 1; + uint32_t frame_id_numbers_present_flag : 1; + uint32_t enable_superres : 1; + uint32_t enable_cdef : 1; + uint32_t enable_restoration : 1; + uint32_t film_grain_params_present : 1; + uint32_t timing_info_present_flag : 1; + uint32_t initial_display_delay_present_flag : 1; + uint32_t reserved : 13; +} StdVideoAV1SequenceHeaderFlags; + +typedef struct StdVideoAV1SequenceHeader { + StdVideoAV1SequenceHeaderFlags flags; + StdVideoAV1Profile seq_profile; + uint8_t frame_width_bits_minus_1; + uint8_t frame_height_bits_minus_1; + uint16_t max_frame_width_minus_1; + uint16_t max_frame_height_minus_1; + uint8_t delta_frame_id_length_minus_2; + uint8_t additional_frame_id_length_minus_1; + uint8_t order_hint_bits_minus_1; + uint8_t seq_force_integer_mv; + uint8_t seq_force_screen_content_tools; + uint8_t reserved1[5]; + const StdVideoAV1ColorConfig* pColorConfig; + const StdVideoAV1TimingInfo* pTimingInfo; +} StdVideoAV1SequenceHeader; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_av1std_decode.h b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_av1std_decode.h new file mode 100644 index 00000000..6b8130cd --- /dev/null +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_av1std_decode.h @@ -0,0 +1,109 @@ +#ifndef VULKAN_VIDEO_CODEC_AV1STD_DECODE_H_ +#define VULKAN_VIDEO_CODEC_AV1STD_DECODE_H_ 1 + +/* +** Copyright 2015-2024 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// vulkan_video_codec_av1std_decode is a preprocessor guard. Do not pass it to API calls. +#define vulkan_video_codec_av1std_decode 1 +#include "vulkan_video_codec_av1std.h" + +#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + +#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_1_0_0 +#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_av1_decode" +typedef struct StdVideoDecodeAV1PictureInfoFlags { + uint32_t error_resilient_mode : 1; + uint32_t disable_cdf_update : 1; + uint32_t use_superres : 1; + uint32_t render_and_frame_size_different : 1; + uint32_t allow_screen_content_tools : 1; + uint32_t is_filter_switchable : 1; + uint32_t force_integer_mv : 1; + uint32_t frame_size_override_flag : 1; + uint32_t buffer_removal_time_present_flag : 1; + uint32_t allow_intrabc : 1; + uint32_t frame_refs_short_signaling : 1; + uint32_t allow_high_precision_mv : 1; + uint32_t is_motion_mode_switchable : 1; + uint32_t use_ref_frame_mvs : 1; + uint32_t disable_frame_end_update_cdf : 1; + uint32_t allow_warped_motion : 1; + uint32_t reduced_tx_set : 1; + uint32_t reference_select : 1; + uint32_t skip_mode_present : 1; + uint32_t delta_q_present : 1; + uint32_t delta_lf_present : 1; + uint32_t delta_lf_multi : 1; + uint32_t segmentation_enabled : 1; + uint32_t segmentation_update_map : 1; + uint32_t segmentation_temporal_update : 1; + uint32_t segmentation_update_data : 1; + uint32_t UsesLr : 1; + uint32_t usesChromaLr : 1; + uint32_t apply_grain : 1; + uint32_t reserved : 3; +} StdVideoDecodeAV1PictureInfoFlags; + +typedef struct StdVideoDecodeAV1PictureInfo { + StdVideoDecodeAV1PictureInfoFlags flags; + StdVideoAV1FrameType frame_type; + uint32_t current_frame_id; + uint8_t OrderHint; + uint8_t primary_ref_frame; + uint8_t refresh_frame_flags; + uint8_t reserved1; + StdVideoAV1InterpolationFilter interpolation_filter; + StdVideoAV1TxMode TxMode; + uint8_t delta_q_res; + uint8_t delta_lf_res; + uint8_t SkipModeFrame[STD_VIDEO_AV1_SKIP_MODE_FRAMES]; + uint8_t coded_denom; + uint8_t reserved2[3]; + uint8_t OrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES]; + uint32_t expectedFrameId[STD_VIDEO_AV1_NUM_REF_FRAMES]; + const StdVideoAV1TileInfo* pTileInfo; + const StdVideoAV1Quantization* pQuantization; + const StdVideoAV1Segmentation* pSegmentation; + const StdVideoAV1LoopFilter* pLoopFilter; + const StdVideoAV1CDEF* pCDEF; + const StdVideoAV1LoopRestoration* pLoopRestoration; + const StdVideoAV1GlobalMotion* pGlobalMotion; + const StdVideoAV1FilmGrain* pFilmGrain; +} StdVideoDecodeAV1PictureInfo; + +typedef struct StdVideoDecodeAV1ReferenceInfoFlags { + uint32_t disable_frame_end_update_cdf : 1; + uint32_t segmentation_enabled : 1; + uint32_t reserved : 30; +} StdVideoDecodeAV1ReferenceInfoFlags; + +typedef struct StdVideoDecodeAV1ReferenceInfo { + StdVideoDecodeAV1ReferenceInfoFlags flags; + uint8_t frame_type; + uint8_t RefFrameSignBias; + uint8_t OrderHint; + uint8_t SavedOrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES]; +} StdVideoDecodeAV1ReferenceInfo; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std.h b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std.h index d3ebec6a..6d27af37 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std.h @@ -2,7 +2,7 @@ #define VULKAN_VIDEO_CODEC_H264STD_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,8 +19,9 @@ extern "C" { +// vulkan_video_codec_h264std is a preprocessor guard. Do not pass it to API calls. #define vulkan_video_codec_h264std 1 -#include +#include "vulkan_video_codecs_common.h" #define STD_VIDEO_H264_CPB_CNT_LIST_SIZE 32 #define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS 6 #define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS 16 @@ -28,6 +29,7 @@ extern "C" { #define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS 64 #define STD_VIDEO_H264_MAX_NUM_LIST_REF 32 #define STD_VIDEO_H264_MAX_CHROMA_PLANES 2 +#define STD_VIDEO_H264_NO_REFERENCE_PICTURE 0xFF typedef enum StdVideoH264ChromaFormatIdc { STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME = 0, diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_decode.h b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_decode.h index b1e79429..439cb885 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_decode.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_decode.h @@ -2,7 +2,7 @@ #define VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,13 +19,15 @@ extern "C" { +// vulkan_video_codec_h264std_decode is a preprocessor guard. Do not pass it to API calls. #define vulkan_video_codec_h264std_decode 1 +#include "vulkan_video_codec_h264std.h" #define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) -#define STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE 2 #define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 #define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_decode" +#define STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE 2 typedef enum StdVideoDecodeH264FieldOrderCount { STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP = 0, diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_encode.h b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_encode.h index 7bd96aa7..9e24aa5d 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_encode.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_encode.h @@ -2,7 +2,7 @@ #define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,11 +19,13 @@ extern "C" { +// vulkan_video_codec_h264std_encode is a preprocessor guard. Do not pass it to API calls. #define vulkan_video_codec_h264std_encode 1 -// Vulkan 0.9 provisional Vulkan video H.264 encode std specification version number -#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_8 VK_MAKE_VIDEO_STD_VERSION(0, 9, 8) +#include "vulkan_video_codec_h264std.h" -#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_8 +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0 #define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_encode" typedef struct StdVideoEncodeH264WeightTableFlags { uint32_t luma_weight_l0_flag; @@ -49,25 +51,28 @@ typedef struct StdVideoEncodeH264WeightTable { typedef struct StdVideoEncodeH264SliceHeaderFlags { uint32_t direct_spatial_mv_pred_flag : 1; uint32_t num_ref_idx_active_override_flag : 1; - uint32_t no_output_of_prior_pics_flag : 1; - uint32_t adaptive_ref_pic_marking_mode_flag : 1; - uint32_t no_prior_references_available_flag : 1; + uint32_t reserved : 30; } StdVideoEncodeH264SliceHeaderFlags; typedef struct StdVideoEncodeH264PictureInfoFlags { - uint32_t idr_flag : 1; - uint32_t is_reference_flag : 1; - uint32_t used_for_long_term_reference : 1; + uint32_t IdrPicFlag : 1; + uint32_t is_reference : 1; + uint32_t no_output_of_prior_pics_flag : 1; + uint32_t long_term_reference_flag : 1; + uint32_t adaptive_ref_pic_marking_mode_flag : 1; + uint32_t reserved : 27; } StdVideoEncodeH264PictureInfoFlags; typedef struct StdVideoEncodeH264ReferenceInfoFlags { uint32_t used_for_long_term_reference : 1; + uint32_t reserved : 31; } StdVideoEncodeH264ReferenceInfoFlags; -typedef struct StdVideoEncodeH264RefMgmtFlags { - uint32_t ref_pic_list_modification_l0_flag : 1; - uint32_t ref_pic_list_modification_l1_flag : 1; -} StdVideoEncodeH264RefMgmtFlags; +typedef struct StdVideoEncodeH264ReferenceListsInfoFlags { + uint32_t ref_pic_list_modification_flag_l0 : 1; + uint32_t ref_pic_list_modification_flag_l1 : 1; + uint32_t reserved : 30; +} StdVideoEncodeH264ReferenceListsInfoFlags; typedef struct StdVideoEncodeH264RefListModEntry { StdVideoH264ModificationOfPicNumsIdc modification_of_pic_nums_idc; @@ -76,51 +81,61 @@ typedef struct StdVideoEncodeH264RefListModEntry { } StdVideoEncodeH264RefListModEntry; typedef struct StdVideoEncodeH264RefPicMarkingEntry { - StdVideoH264MemMgmtControlOp operation; + StdVideoH264MemMgmtControlOp memory_management_control_operation; uint16_t difference_of_pic_nums_minus1; uint16_t long_term_pic_num; uint16_t long_term_frame_idx; uint16_t max_long_term_frame_idx_plus1; } StdVideoEncodeH264RefPicMarkingEntry; -typedef struct StdVideoEncodeH264RefMemMgmtCtrlOperations { - StdVideoEncodeH264RefMgmtFlags flags; +typedef struct StdVideoEncodeH264ReferenceListsInfo { + StdVideoEncodeH264ReferenceListsInfoFlags flags; + uint8_t num_ref_idx_l0_active_minus1; + uint8_t num_ref_idx_l1_active_minus1; + uint8_t RefPicList0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + uint8_t RefPicList1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; uint8_t refList0ModOpCount; - const StdVideoEncodeH264RefListModEntry* pRefList0ModOperations; uint8_t refList1ModOpCount; - const StdVideoEncodeH264RefListModEntry* pRefList1ModOperations; uint8_t refPicMarkingOpCount; + uint8_t reserved1[7]; + const StdVideoEncodeH264RefListModEntry* pRefList0ModOperations; + const StdVideoEncodeH264RefListModEntry* pRefList1ModOperations; const StdVideoEncodeH264RefPicMarkingEntry* pRefPicMarkingOperations; -} StdVideoEncodeH264RefMemMgmtCtrlOperations; +} StdVideoEncodeH264ReferenceListsInfo; typedef struct StdVideoEncodeH264PictureInfo { - StdVideoEncodeH264PictureInfoFlags flags; - uint8_t seq_parameter_set_id; - uint8_t pic_parameter_set_id; - StdVideoH264PictureType pictureType; - uint32_t frame_num; - int32_t PicOrderCnt; + StdVideoEncodeH264PictureInfoFlags flags; + uint8_t seq_parameter_set_id; + uint8_t pic_parameter_set_id; + uint16_t idr_pic_id; + StdVideoH264PictureType primary_pic_type; + uint32_t frame_num; + int32_t PicOrderCnt; + uint8_t temporal_id; + uint8_t reserved1[3]; + const StdVideoEncodeH264ReferenceListsInfo* pRefLists; } StdVideoEncodeH264PictureInfo; typedef struct StdVideoEncodeH264ReferenceInfo { StdVideoEncodeH264ReferenceInfoFlags flags; + StdVideoH264PictureType primary_pic_type; uint32_t FrameNum; int32_t PicOrderCnt; uint16_t long_term_pic_num; uint16_t long_term_frame_idx; + uint8_t temporal_id; } StdVideoEncodeH264ReferenceInfo; typedef struct StdVideoEncodeH264SliceHeader { StdVideoEncodeH264SliceHeaderFlags flags; uint32_t first_mb_in_slice; StdVideoH264SliceType slice_type; - uint16_t idr_pic_id; - uint8_t num_ref_idx_l0_active_minus1; - uint8_t num_ref_idx_l1_active_minus1; - StdVideoH264CabacInitIdc cabac_init_idc; - StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc; int8_t slice_alpha_c0_offset_div2; int8_t slice_beta_offset_div2; + int8_t slice_qp_delta; + uint8_t reserved1; + StdVideoH264CabacInitIdc cabac_init_idc; + StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc; const StdVideoEncodeH264WeightTable* pWeightTable; } StdVideoEncodeH264SliceHeader; diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std.h b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std.h index 862f8817..d0a1bacb 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std.h @@ -2,7 +2,7 @@ #define VULKAN_VIDEO_CODEC_H265STD_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,9 +19,11 @@ extern "C" { +// vulkan_video_codec_h265std is a preprocessor guard. Do not pass it to API calls. #define vulkan_video_codec_h265std 1 -#define STD_VIDEO_H265_SUBLAYERS_LIST_SIZE 7 +#include "vulkan_video_codecs_common.h" #define STD_VIDEO_H265_CPB_CNT_LIST_SIZE 32 +#define STD_VIDEO_H265_SUBLAYERS_LIST_SIZE 7 #define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS 6 #define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS 16 #define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS 6 @@ -30,18 +32,19 @@ extern "C" { #define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS 64 #define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS 2 #define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS 64 -#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE 3 -#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE 128 -#define STD_VIDEO_H265_MAX_DPB_SIZE 16 -#define STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS 32 #define STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE 6 #define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE 19 #define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE 21 +#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE 3 +#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE 128 #define STD_VIDEO_H265_MAX_NUM_LIST_REF 15 #define STD_VIDEO_H265_MAX_CHROMA_PLANES 2 #define STD_VIDEO_H265_MAX_SHORT_TERM_REF_PIC_SETS 64 +#define STD_VIDEO_H265_MAX_DPB_SIZE 16 +#define STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS 32 #define STD_VIDEO_H265_MAX_LONG_TERM_PICS 16 #define STD_VIDEO_H265_MAX_DELTA_POC 48 +#define STD_VIDEO_H265_NO_REFERENCE_PICTURE 0xFF typedef enum StdVideoH265ChromaFormatIdc { STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME = 0, diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_decode.h b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_decode.h index d8660d12..0178793e 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_decode.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_decode.h @@ -2,7 +2,7 @@ #define VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,13 +19,15 @@ extern "C" { +// vulkan_video_codec_h265std_decode is a preprocessor guard. Do not pass it to API calls. #define vulkan_video_codec_h265std_decode 1 +#include "vulkan_video_codec_h265std.h" #define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) -#define STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE 8 #define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 #define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_decode" +#define STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE 8 typedef struct StdVideoDecodeH265PictureInfoFlags { uint32_t IrapPicFlag : 1; uint32_t IdrPicFlag : 1; diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_encode.h b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_encode.h index 5a419b14..ee34491f 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_encode.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_encode.h @@ -2,7 +2,7 @@ #define VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,11 +19,13 @@ extern "C" { +// vulkan_video_codec_h265std_encode is a preprocessor guard. Do not pass it to API calls. #define vulkan_video_codec_h265std_encode 1 -// Vulkan 0.9 provisional Vulkan video H.265 encode std specification version number -#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_9 VK_MAKE_VIDEO_STD_VERSION(0, 9, 9) +#include "vulkan_video_codec_h265std.h" -#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_9 +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0 #define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_encode" typedef struct StdVideoEncodeH265WeightTableFlags { uint16_t luma_weight_l0_flag; @@ -48,11 +50,7 @@ typedef struct StdVideoEncodeH265WeightTable { typedef struct StdVideoEncodeH265SliceSegmentHeaderFlags { uint32_t first_slice_segment_in_pic_flag : 1; - uint32_t no_output_of_prior_pics_flag : 1; uint32_t dependent_slice_segment_flag : 1; - uint32_t pic_output_flag : 1; - uint32_t short_term_ref_pic_set_sps_flag : 1; - uint32_t slice_temporal_mvp_enable_flag : 1; uint32_t slice_sao_luma_flag : 1; uint32_t slice_sao_chroma_flag : 1; uint32_t num_ref_idx_active_override_flag : 1; @@ -63,77 +61,90 @@ typedef struct StdVideoEncodeH265SliceSegmentHeaderFlags { uint32_t slice_deblocking_filter_disabled_flag : 1; uint32_t collocated_from_l0_flag : 1; uint32_t slice_loop_filter_across_slices_enabled_flag : 1; + uint32_t reserved : 20; } StdVideoEncodeH265SliceSegmentHeaderFlags; -typedef struct StdVideoEncodeH265SliceSegmentLongTermRefPics { - uint8_t num_long_term_sps; - uint8_t num_long_term_pics; - uint8_t lt_idx_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS]; - uint8_t poc_lsb_lt[STD_VIDEO_H265_MAX_LONG_TERM_PICS]; - uint16_t used_by_curr_pic_lt_flag; - uint8_t delta_poc_msb_present_flag[STD_VIDEO_H265_MAX_DELTA_POC]; - uint8_t delta_poc_msb_cycle_lt[STD_VIDEO_H265_MAX_DELTA_POC]; -} StdVideoEncodeH265SliceSegmentLongTermRefPics; - typedef struct StdVideoEncodeH265SliceSegmentHeader { - StdVideoEncodeH265SliceSegmentHeaderFlags flags; - StdVideoH265SliceType slice_type; - uint32_t slice_segment_address; - uint8_t short_term_ref_pic_set_idx; - uint8_t collocated_ref_idx; - uint8_t num_ref_idx_l0_active_minus1; - uint8_t num_ref_idx_l1_active_minus1; - uint8_t MaxNumMergeCand; - int8_t slice_cb_qp_offset; - int8_t slice_cr_qp_offset; - int8_t slice_beta_offset_div2; - int8_t slice_tc_offset_div2; - int8_t slice_act_y_qp_offset; - int8_t slice_act_cb_qp_offset; - int8_t slice_act_cr_qp_offset; - const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet; - const StdVideoEncodeH265SliceSegmentLongTermRefPics* pLongTermRefPics; - const StdVideoEncodeH265WeightTable* pWeightTable; + StdVideoEncodeH265SliceSegmentHeaderFlags flags; + StdVideoH265SliceType slice_type; + uint32_t slice_segment_address; + uint8_t collocated_ref_idx; + uint8_t MaxNumMergeCand; + int8_t slice_cb_qp_offset; + int8_t slice_cr_qp_offset; + int8_t slice_beta_offset_div2; + int8_t slice_tc_offset_div2; + int8_t slice_act_y_qp_offset; + int8_t slice_act_cb_qp_offset; + int8_t slice_act_cr_qp_offset; + int8_t slice_qp_delta; + uint16_t reserved1; + const StdVideoEncodeH265WeightTable* pWeightTable; } StdVideoEncodeH265SliceSegmentHeader; -typedef struct StdVideoEncodeH265ReferenceModificationFlags { +typedef struct StdVideoEncodeH265ReferenceListsInfoFlags { uint32_t ref_pic_list_modification_flag_l0 : 1; uint32_t ref_pic_list_modification_flag_l1 : 1; -} StdVideoEncodeH265ReferenceModificationFlags; - -typedef struct StdVideoEncodeH265ReferenceModifications { - StdVideoEncodeH265ReferenceModificationFlags flags; - uint8_t referenceList0ModificationsCount; - const uint8_t* pReferenceList0Modifications; - uint8_t referenceList1ModificationsCount; - const uint8_t* pReferenceList1Modifications; -} StdVideoEncodeH265ReferenceModifications; + uint32_t reserved : 30; +} StdVideoEncodeH265ReferenceListsInfoFlags; + +typedef struct StdVideoEncodeH265ReferenceListsInfo { + StdVideoEncodeH265ReferenceListsInfoFlags flags; + uint8_t num_ref_idx_l0_active_minus1; + uint8_t num_ref_idx_l1_active_minus1; + uint8_t RefPicList0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + uint8_t RefPicList1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + uint8_t list_entry_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + uint8_t list_entry_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; +} StdVideoEncodeH265ReferenceListsInfo; typedef struct StdVideoEncodeH265PictureInfoFlags { - uint32_t is_reference_flag : 1; + uint32_t is_reference : 1; uint32_t IrapPicFlag : 1; - uint32_t long_term_flag : 1; + uint32_t used_for_long_term_reference : 1; uint32_t discardable_flag : 1; uint32_t cross_layer_bla_flag : 1; + uint32_t pic_output_flag : 1; + uint32_t no_output_of_prior_pics_flag : 1; + uint32_t short_term_ref_pic_set_sps_flag : 1; + uint32_t slice_temporal_mvp_enabled_flag : 1; + uint32_t reserved : 23; } StdVideoEncodeH265PictureInfoFlags; +typedef struct StdVideoEncodeH265LongTermRefPics { + uint8_t num_long_term_sps; + uint8_t num_long_term_pics; + uint8_t lt_idx_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS]; + uint8_t poc_lsb_lt[STD_VIDEO_H265_MAX_LONG_TERM_PICS]; + uint16_t used_by_curr_pic_lt_flag; + uint8_t delta_poc_msb_present_flag[STD_VIDEO_H265_MAX_DELTA_POC]; + uint8_t delta_poc_msb_cycle_lt[STD_VIDEO_H265_MAX_DELTA_POC]; +} StdVideoEncodeH265LongTermRefPics; + typedef struct StdVideoEncodeH265PictureInfo { - StdVideoEncodeH265PictureInfoFlags flags; - StdVideoH265PictureType PictureType; - uint8_t sps_video_parameter_set_id; - uint8_t pps_seq_parameter_set_id; - uint8_t pps_pic_parameter_set_id; - int32_t PicOrderCntVal; - uint8_t TemporalId; + StdVideoEncodeH265PictureInfoFlags flags; + StdVideoH265PictureType pic_type; + uint8_t sps_video_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + uint8_t pps_pic_parameter_set_id; + uint8_t short_term_ref_pic_set_idx; + int32_t PicOrderCntVal; + uint8_t TemporalId; + uint8_t reserved1[7]; + const StdVideoEncodeH265ReferenceListsInfo* pRefLists; + const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet; + const StdVideoEncodeH265LongTermRefPics* pLongTermRefPics; } StdVideoEncodeH265PictureInfo; typedef struct StdVideoEncodeH265ReferenceInfoFlags { uint32_t used_for_long_term_reference : 1; uint32_t unused_for_reference : 1; + uint32_t reserved : 30; } StdVideoEncodeH265ReferenceInfoFlags; typedef struct StdVideoEncodeH265ReferenceInfo { StdVideoEncodeH265ReferenceInfoFlags flags; + StdVideoH265PictureType pic_type; int32_t PicOrderCntVal; uint8_t TemporalId; } StdVideoEncodeH265ReferenceInfo; diff --git a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codecs_common.h b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codecs_common.h index 1e498265..5e6ef1db 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codecs_common.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codecs_common.h @@ -2,7 +2,7 @@ #define VULKAN_VIDEO_CODECS_COMMON_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,7 +19,12 @@ extern "C" { +// vulkan_video_codecs_common is a preprocessor guard. Do not pass it to API calls. #define vulkan_video_codecs_common 1 +#if !defined(VK_NO_STDINT_H) + #include +#endif + #define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \ ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan.h index 426cff58..ef94006b 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan.h @@ -2,7 +2,7 @@ #define VULKAN_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_android.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_android.h index d86f43f2..61ff40ba 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_android.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_android.h @@ -2,7 +2,7 @@ #define VULKAN_ANDROID_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -120,6 +120,32 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID( struct AHardwareBuffer** pBuffer); #endif + +// VK_ANDROID_external_format_resolve is a preprocessor guard. Do not pass it to API calls. +#define VK_ANDROID_external_format_resolve 1 +#define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_SPEC_VERSION 1 +#define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_EXTENSION_NAME "VK_ANDROID_external_format_resolve" +typedef struct VkPhysicalDeviceExternalFormatResolveFeaturesANDROID { + VkStructureType sType; + void* pNext; + VkBool32 externalFormatResolve; +} VkPhysicalDeviceExternalFormatResolveFeaturesANDROID; + +typedef struct VkPhysicalDeviceExternalFormatResolvePropertiesANDROID { + VkStructureType sType; + void* pNext; + VkBool32 nullColorAttachmentWithExternalFormatResolve; + VkChromaLocation externalFormatResolveChromaOffsetX; + VkChromaLocation externalFormatResolveChromaOffsetY; +} VkPhysicalDeviceExternalFormatResolvePropertiesANDROID; + +typedef struct VkAndroidHardwareBufferFormatResolvePropertiesANDROID { + VkStructureType sType; + void* pNext; + VkFormat colorAttachmentFormat; +} VkAndroidHardwareBufferFormatResolvePropertiesANDROID; + + #ifdef __cplusplus } #endif diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_beta.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_beta.h index 1871651d..f5e94750 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_beta.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_beta.h @@ -2,7 +2,7 @@ #define VULKAN_BETA_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -51,612 +51,16 @@ typedef struct VkPhysicalDevicePortabilitySubsetPropertiesKHR { -// VK_KHR_video_encode_queue is a preprocessor guard. Do not pass it to API calls. -#define VK_KHR_video_encode_queue 1 -#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 10 -#define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue" - -typedef enum VkVideoEncodeTuningModeKHR { - VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR = 1, - VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR = 2, - VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR = 3, - VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR = 4, - VK_VIDEO_ENCODE_TUNING_MODE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeTuningModeKHR; -typedef VkFlags VkVideoEncodeFlagsKHR; - -typedef enum VkVideoEncodeCapabilityFlagBitsKHR { - VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeCapabilityFlagBitsKHR; -typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; - -typedef enum VkVideoEncodeRateControlModeFlagBitsKHR { - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeRateControlModeFlagBitsKHR; -typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; - -typedef enum VkVideoEncodeFeedbackFlagBitsKHR { - VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_FEEDBACK_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeFeedbackFlagBitsKHR; -typedef VkFlags VkVideoEncodeFeedbackFlagsKHR; - -typedef enum VkVideoEncodeUsageFlagBitsKHR { - VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeUsageFlagBitsKHR; -typedef VkFlags VkVideoEncodeUsageFlagsKHR; - -typedef enum VkVideoEncodeContentFlagBitsKHR { - VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_CONTENT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeContentFlagBitsKHR; -typedef VkFlags VkVideoEncodeContentFlagsKHR; -typedef VkFlags VkVideoEncodeRateControlFlagsKHR; -typedef struct VkVideoEncodeInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoEncodeFlagsKHR flags; - VkBuffer dstBuffer; - VkDeviceSize dstBufferOffset; - VkDeviceSize dstBufferRange; - VkVideoPictureResourceInfoKHR srcPictureResource; - const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot; - uint32_t referenceSlotCount; - const VkVideoReferenceSlotInfoKHR* pReferenceSlots; - uint32_t precedingExternallyEncodedBytes; -} VkVideoEncodeInfoKHR; - -typedef struct VkVideoEncodeCapabilitiesKHR { - VkStructureType sType; - void* pNext; - VkVideoEncodeCapabilityFlagsKHR flags; - VkVideoEncodeRateControlModeFlagsKHR rateControlModes; - uint32_t maxRateControlLayers; - uint64_t maxBitrate; - uint32_t maxQualityLevels; - VkExtent2D encodeInputPictureGranularity; - VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags; -} VkVideoEncodeCapabilitiesKHR; - -typedef struct VkQueryPoolVideoEncodeFeedbackCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags; -} VkQueryPoolVideoEncodeFeedbackCreateInfoKHR; - -typedef struct VkVideoEncodeUsageInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoEncodeUsageFlagsKHR videoUsageHints; - VkVideoEncodeContentFlagsKHR videoContentHints; - VkVideoEncodeTuningModeKHR tuningMode; -} VkVideoEncodeUsageInfoKHR; - -typedef struct VkVideoEncodeRateControlLayerInfoKHR { - VkStructureType sType; - const void* pNext; - uint64_t averageBitrate; - uint64_t maxBitrate; - uint32_t frameRateNumerator; - uint32_t frameRateDenominator; -} VkVideoEncodeRateControlLayerInfoKHR; - -typedef struct VkVideoEncodeRateControlInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoEncodeRateControlFlagsKHR flags; - VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode; - uint32_t layerCount; - const VkVideoEncodeRateControlLayerInfoKHR* pLayers; - uint32_t virtualBufferSizeInMs; - uint32_t initialVirtualBufferSizeInMs; -} VkVideoEncodeRateControlInfoKHR; - -typedef struct VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR { - VkStructureType sType; - const void* pNext; - const VkVideoProfileInfoKHR* pVideoProfile; - uint32_t qualityLevel; -} VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR; - -typedef struct VkVideoEncodeQualityLevelPropertiesKHR { - VkStructureType sType; - void* pNext; - VkVideoEncodeRateControlModeFlagBitsKHR preferredRateControlMode; - uint32_t preferredRateControlLayerCount; -} VkVideoEncodeQualityLevelPropertiesKHR; - -typedef struct VkVideoEncodeQualityLevelInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t qualityLevel; -} VkVideoEncodeQualityLevelInfoKHR; - -typedef struct VkVideoEncodeSessionParametersGetInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoSessionParametersKHR videoSessionParameters; -} VkVideoEncodeSessionParametersGetInfoKHR; - -typedef struct VkVideoEncodeSessionParametersFeedbackInfoKHR { - VkStructureType sType; - void* pNext; - VkBool32 hasOverrides; -} VkVideoEncodeSessionParametersFeedbackInfoKHR; - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo, VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetEncodedVideoSessionParametersKHR)(VkDevice device, const VkVideoEncodeSessionParametersGetInfoKHR* pVideoSessionParametersInfo, VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo, size_t* pDataSize, void* pData); -typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo, - VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetEncodedVideoSessionParametersKHR( - VkDevice device, - const VkVideoEncodeSessionParametersGetInfoKHR* pVideoSessionParametersInfo, - VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo, - size_t* pDataSize, - void* pData); - -VKAPI_ATTR void VKAPI_CALL vkCmdEncodeVideoKHR( - VkCommandBuffer commandBuffer, - const VkVideoEncodeInfoKHR* pEncodeInfo); -#endif - - -// VK_EXT_video_encode_h264 is a preprocessor guard. Do not pass it to API calls. -#define VK_EXT_video_encode_h264 1 -#include "vk_video/vulkan_video_codec_h264std.h" -#include "vk_video/vulkan_video_codec_h264std_encode.h" -#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 12 -#define VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_EXT_video_encode_h264" - -typedef enum VkVideoEncodeH264CapabilityFlagBitsEXT { - VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H264_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_EXT = 0x00000010, - VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x00000020, - VK_VIDEO_ENCODE_H264_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_EXT = 0x00000040, - VK_VIDEO_ENCODE_H264_CAPABILITY_PER_SLICE_CONSTANT_QP_BIT_EXT = 0x00000080, - VK_VIDEO_ENCODE_H264_CAPABILITY_GENERATE_PREFIX_NALU_BIT_EXT = 0x00000100, - VK_VIDEO_ENCODE_H264_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH264CapabilityFlagBitsEXT; -typedef VkFlags VkVideoEncodeH264CapabilityFlagsEXT; - -typedef enum VkVideoEncodeH264StdFlagBitsEXT { - VK_VIDEO_ENCODE_H264_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H264_STD_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG_SET_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H264_STD_SCALING_MATRIX_PRESENT_FLAG_SET_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H264_STD_CHROMA_QP_INDEX_OFFSET_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H264_STD_SECOND_CHROMA_QP_INDEX_OFFSET_BIT_EXT = 0x00000010, - VK_VIDEO_ENCODE_H264_STD_PIC_INIT_QP_MINUS26_BIT_EXT = 0x00000020, - VK_VIDEO_ENCODE_H264_STD_WEIGHTED_PRED_FLAG_SET_BIT_EXT = 0x00000040, - VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_EXPLICIT_BIT_EXT = 0x00000080, - VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_IMPLICIT_BIT_EXT = 0x00000100, - VK_VIDEO_ENCODE_H264_STD_TRANSFORM_8X8_MODE_FLAG_SET_BIT_EXT = 0x00000200, - VK_VIDEO_ENCODE_H264_STD_DIRECT_SPATIAL_MV_PRED_FLAG_UNSET_BIT_EXT = 0x00000400, - VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_UNSET_BIT_EXT = 0x00000800, - VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_SET_BIT_EXT = 0x00001000, - VK_VIDEO_ENCODE_H264_STD_DIRECT_8X8_INFERENCE_FLAG_UNSET_BIT_EXT = 0x00002000, - VK_VIDEO_ENCODE_H264_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_EXT = 0x00004000, - VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_DISABLED_BIT_EXT = 0x00008000, - VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_ENABLED_BIT_EXT = 0x00010000, - VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_EXT = 0x00020000, - VK_VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_EXT = 0x00080000, - VK_VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT = 0x00100000, - VK_VIDEO_ENCODE_H264_STD_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH264StdFlagBitsEXT; -typedef VkFlags VkVideoEncodeH264StdFlagsEXT; - -typedef enum VkVideoEncodeH264RateControlFlagBitsEXT { - VK_VIDEO_ENCODE_H264_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_REGULAR_GOP_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_TEMPORAL_LAYER_PATTERN_DYADIC_BIT_EXT = 0x00000010, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH264RateControlFlagBitsEXT; -typedef VkFlags VkVideoEncodeH264RateControlFlagsEXT; -typedef struct VkVideoEncodeH264CapabilitiesEXT { - VkStructureType sType; - void* pNext; - VkVideoEncodeH264CapabilityFlagsEXT flags; - StdVideoH264LevelIdc maxLevelIdc; - uint32_t maxSliceCount; - uint32_t maxPPictureL0ReferenceCount; - uint32_t maxBPictureL0ReferenceCount; - uint32_t maxL1ReferenceCount; - uint32_t maxTemporalLayerCount; - VkBool32 expectDyadicTemporalLayerPattern; - int32_t minQp; - int32_t maxQp; - VkBool32 prefersGopRemainingFrames; - VkBool32 requiresGopRemainingFrames; - VkVideoEncodeH264StdFlagsEXT stdSyntaxFlags; -} VkVideoEncodeH264CapabilitiesEXT; - -typedef struct VkVideoEncodeH264QpEXT { - int32_t qpI; - int32_t qpP; - int32_t qpB; -} VkVideoEncodeH264QpEXT; - -typedef struct VkVideoEncodeH264QualityLevelPropertiesEXT { - VkStructureType sType; - void* pNext; - VkVideoEncodeH264RateControlFlagsEXT preferredRateControlFlags; - uint32_t preferredGopFrameCount; - uint32_t preferredIdrPeriod; - uint32_t preferredConsecutiveBFrameCount; - uint32_t preferredTemporalLayerCount; - VkVideoEncodeH264QpEXT preferredConstantQp; - uint32_t preferredMaxL0ReferenceCount; - uint32_t preferredMaxL1ReferenceCount; - VkBool32 preferredStdEntropyCodingModeFlag; -} VkVideoEncodeH264QualityLevelPropertiesEXT; - -typedef struct VkVideoEncodeH264SessionCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 useMaxLevelIdc; - StdVideoH264LevelIdc maxLevelIdc; -} VkVideoEncodeH264SessionCreateInfoEXT; - -typedef struct VkVideoEncodeH264SessionParametersAddInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t stdSPSCount; - const StdVideoH264SequenceParameterSet* pStdSPSs; - uint32_t stdPPSCount; - const StdVideoH264PictureParameterSet* pStdPPSs; -} VkVideoEncodeH264SessionParametersAddInfoEXT; - -typedef struct VkVideoEncodeH264SessionParametersCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - const VkVideoEncodeH264SessionParametersAddInfoEXT* pParametersAddInfo; -} VkVideoEncodeH264SessionParametersCreateInfoEXT; - -typedef struct VkVideoEncodeH264SessionParametersGetInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 writeStdSPS; - VkBool32 writeStdPPS; - uint32_t stdSPSId; - uint32_t stdPPSId; -} VkVideoEncodeH264SessionParametersGetInfoEXT; - -typedef struct VkVideoEncodeH264SessionParametersFeedbackInfoEXT { - VkStructureType sType; - void* pNext; - VkBool32 hasStdSPSOverrides; - VkBool32 hasStdPPSOverrides; -} VkVideoEncodeH264SessionParametersFeedbackInfoEXT; - -typedef struct VkVideoEncodeH264NaluSliceInfoEXT { - VkStructureType sType; - const void* pNext; - int32_t constantQp; - const StdVideoEncodeH264SliceHeader* pStdSliceHeader; -} VkVideoEncodeH264NaluSliceInfoEXT; - -typedef struct VkVideoEncodeH264PictureInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t naluSliceEntryCount; - const VkVideoEncodeH264NaluSliceInfoEXT* pNaluSliceEntries; - const StdVideoEncodeH264PictureInfo* pStdPictureInfo; - VkBool32 generatePrefixNalu; -} VkVideoEncodeH264PictureInfoEXT; - -typedef struct VkVideoEncodeH264DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo; -} VkVideoEncodeH264DpbSlotInfoEXT; - -typedef struct VkVideoEncodeH264ProfileInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoH264ProfileIdc stdProfileIdc; -} VkVideoEncodeH264ProfileInfoEXT; - -typedef struct VkVideoEncodeH264RateControlInfoEXT { - VkStructureType sType; - const void* pNext; - VkVideoEncodeH264RateControlFlagsEXT flags; - uint32_t gopFrameCount; - uint32_t idrPeriod; - uint32_t consecutiveBFrameCount; - uint32_t temporalLayerCount; -} VkVideoEncodeH264RateControlInfoEXT; - -typedef struct VkVideoEncodeH264FrameSizeEXT { - uint32_t frameISize; - uint32_t framePSize; - uint32_t frameBSize; -} VkVideoEncodeH264FrameSizeEXT; - -typedef struct VkVideoEncodeH264RateControlLayerInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 useMinQp; - VkVideoEncodeH264QpEXT minQp; - VkBool32 useMaxQp; - VkVideoEncodeH264QpEXT maxQp; - VkBool32 useMaxFrameSize; - VkVideoEncodeH264FrameSizeEXT maxFrameSize; -} VkVideoEncodeH264RateControlLayerInfoEXT; - -typedef struct VkVideoEncodeH264GopRemainingFrameInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 useGopRemainingFrames; - uint32_t gopRemainingI; - uint32_t gopRemainingP; - uint32_t gopRemainingB; -} VkVideoEncodeH264GopRemainingFrameInfoEXT; - - - -// VK_EXT_video_encode_h265 is a preprocessor guard. Do not pass it to API calls. -#define VK_EXT_video_encode_h265 1 -#include "vk_video/vulkan_video_codec_h265std.h" -#include "vk_video/vulkan_video_codec_h265std_encode.h" -#define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 12 -#define VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_EXT_video_encode_h265" - -typedef enum VkVideoEncodeH265CapabilityFlagBitsEXT { - VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_SEGMENT_TYPE_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_EXT = 0x00000010, - VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x00000020, - VK_VIDEO_ENCODE_H265_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_EXT = 0x00000040, - VK_VIDEO_ENCODE_H265_CAPABILITY_PER_SLICE_SEGMENT_CONSTANT_QP_BIT_EXT = 0x00000080, - VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILES_PER_SLICE_SEGMENT_BIT_EXT = 0x00000100, - VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_SEGMENTS_PER_TILE_BIT_EXT = 0x00000200, - VK_VIDEO_ENCODE_H265_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265CapabilityFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265CapabilityFlagsEXT; - -typedef enum VkVideoEncodeH265StdFlagBitsEXT { - VK_VIDEO_ENCODE_H265_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_STD_SAMPLE_ADAPTIVE_OFFSET_ENABLED_FLAG_SET_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_STD_SCALING_LIST_DATA_PRESENT_FLAG_SET_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_STD_PCM_ENABLED_FLAG_SET_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H265_STD_SPS_TEMPORAL_MVP_ENABLED_FLAG_SET_BIT_EXT = 0x00000010, - VK_VIDEO_ENCODE_H265_STD_INIT_QP_MINUS26_BIT_EXT = 0x00000020, - VK_VIDEO_ENCODE_H265_STD_WEIGHTED_PRED_FLAG_SET_BIT_EXT = 0x00000040, - VK_VIDEO_ENCODE_H265_STD_WEIGHTED_BIPRED_FLAG_SET_BIT_EXT = 0x00000080, - VK_VIDEO_ENCODE_H265_STD_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_EXT = 0x00000100, - VK_VIDEO_ENCODE_H265_STD_SIGN_DATA_HIDING_ENABLED_FLAG_SET_BIT_EXT = 0x00000200, - VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_SET_BIT_EXT = 0x00000400, - VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_UNSET_BIT_EXT = 0x00000800, - VK_VIDEO_ENCODE_H265_STD_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_FLAG_SET_BIT_EXT = 0x00001000, - VK_VIDEO_ENCODE_H265_STD_TRANSQUANT_BYPASS_ENABLED_FLAG_SET_BIT_EXT = 0x00002000, - VK_VIDEO_ENCODE_H265_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_EXT = 0x00004000, - VK_VIDEO_ENCODE_H265_STD_ENTROPY_CODING_SYNC_ENABLED_FLAG_SET_BIT_EXT = 0x00008000, - VK_VIDEO_ENCODE_H265_STD_DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_SET_BIT_EXT = 0x00010000, - VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_EXT = 0x00020000, - VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_EXT = 0x00040000, - VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_EXT = 0x00080000, - VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT = 0x00100000, - VK_VIDEO_ENCODE_H265_STD_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265StdFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265StdFlagsEXT; - -typedef enum VkVideoEncodeH265CtbSizeFlagBitsEXT { - VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_CTB_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265CtbSizeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265CtbSizeFlagsEXT; - -typedef enum VkVideoEncodeH265TransformBlockSizeFlagBitsEXT { - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265TransformBlockSizeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsEXT; - -typedef enum VkVideoEncodeH265RateControlFlagBitsEXT { - VK_VIDEO_ENCODE_H265_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_REGULAR_GOP_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_TEMPORAL_SUB_LAYER_PATTERN_DYADIC_BIT_EXT = 0x00000010, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265RateControlFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265RateControlFlagsEXT; -typedef struct VkVideoEncodeH265CapabilitiesEXT { - VkStructureType sType; - void* pNext; - VkVideoEncodeH265CapabilityFlagsEXT flags; - StdVideoH265LevelIdc maxLevelIdc; - uint32_t maxSliceSegmentCount; - VkExtent2D maxTiles; - VkVideoEncodeH265CtbSizeFlagsEXT ctbSizes; - VkVideoEncodeH265TransformBlockSizeFlagsEXT transformBlockSizes; - uint32_t maxPPictureL0ReferenceCount; - uint32_t maxBPictureL0ReferenceCount; - uint32_t maxL1ReferenceCount; - uint32_t maxSubLayerCount; - VkBool32 expectDyadicTemporalSubLayerPattern; - int32_t minQp; - int32_t maxQp; - VkBool32 prefersGopRemainingFrames; - VkBool32 requiresGopRemainingFrames; - VkVideoEncodeH265StdFlagsEXT stdSyntaxFlags; -} VkVideoEncodeH265CapabilitiesEXT; - -typedef struct VkVideoEncodeH265SessionCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 useMaxLevelIdc; - StdVideoH265LevelIdc maxLevelIdc; -} VkVideoEncodeH265SessionCreateInfoEXT; - -typedef struct VkVideoEncodeH265QpEXT { - int32_t qpI; - int32_t qpP; - int32_t qpB; -} VkVideoEncodeH265QpEXT; - -typedef struct VkVideoEncodeH265QualityLevelPropertiesEXT { - VkStructureType sType; - void* pNext; - VkVideoEncodeH265RateControlFlagsEXT preferredRateControlFlags; - uint32_t preferredGopFrameCount; - uint32_t preferredIdrPeriod; - uint32_t preferredConsecutiveBFrameCount; - uint32_t preferredSubLayerCount; - VkVideoEncodeH265QpEXT preferredConstantQp; - uint32_t preferredMaxL0ReferenceCount; - uint32_t preferredMaxL1ReferenceCount; -} VkVideoEncodeH265QualityLevelPropertiesEXT; - -typedef struct VkVideoEncodeH265SessionParametersAddInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t stdVPSCount; - const StdVideoH265VideoParameterSet* pStdVPSs; - uint32_t stdSPSCount; - const StdVideoH265SequenceParameterSet* pStdSPSs; - uint32_t stdPPSCount; - const StdVideoH265PictureParameterSet* pStdPPSs; -} VkVideoEncodeH265SessionParametersAddInfoEXT; - -typedef struct VkVideoEncodeH265SessionParametersCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t maxStdVPSCount; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - const VkVideoEncodeH265SessionParametersAddInfoEXT* pParametersAddInfo; -} VkVideoEncodeH265SessionParametersCreateInfoEXT; - -typedef struct VkVideoEncodeH265SessionParametersGetInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 writeStdVPS; - VkBool32 writeStdSPS; - VkBool32 writeStdPPS; - uint32_t stdVPSId; - uint32_t stdSPSId; - uint32_t stdPPSId; -} VkVideoEncodeH265SessionParametersGetInfoEXT; - -typedef struct VkVideoEncodeH265SessionParametersFeedbackInfoEXT { - VkStructureType sType; - void* pNext; - VkBool32 hasStdVPSOverrides; - VkBool32 hasStdSPSOverrides; - VkBool32 hasStdPPSOverrides; -} VkVideoEncodeH265SessionParametersFeedbackInfoEXT; - -typedef struct VkVideoEncodeH265NaluSliceSegmentInfoEXT { - VkStructureType sType; - const void* pNext; - int32_t constantQp; - const StdVideoEncodeH265SliceSegmentHeader* pStdSliceSegmentHeader; -} VkVideoEncodeH265NaluSliceSegmentInfoEXT; - -typedef struct VkVideoEncodeH265PictureInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t naluSliceSegmentEntryCount; - const VkVideoEncodeH265NaluSliceSegmentInfoEXT* pNaluSliceSegmentEntries; - const StdVideoEncodeH265PictureInfo* pStdPictureInfo; -} VkVideoEncodeH265PictureInfoEXT; - -typedef struct VkVideoEncodeH265DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo; -} VkVideoEncodeH265DpbSlotInfoEXT; - -typedef struct VkVideoEncodeH265ProfileInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoH265ProfileIdc stdProfileIdc; -} VkVideoEncodeH265ProfileInfoEXT; - -typedef struct VkVideoEncodeH265RateControlInfoEXT { - VkStructureType sType; - const void* pNext; - VkVideoEncodeH265RateControlFlagsEXT flags; - uint32_t gopFrameCount; - uint32_t idrPeriod; - uint32_t consecutiveBFrameCount; - uint32_t subLayerCount; -} VkVideoEncodeH265RateControlInfoEXT; - -typedef struct VkVideoEncodeH265FrameSizeEXT { - uint32_t frameISize; - uint32_t framePSize; - uint32_t frameBSize; -} VkVideoEncodeH265FrameSizeEXT; - -typedef struct VkVideoEncodeH265RateControlLayerInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 useMinQp; - VkVideoEncodeH265QpEXT minQp; - VkBool32 useMaxQp; - VkVideoEncodeH265QpEXT maxQp; - VkBool32 useMaxFrameSize; - VkVideoEncodeH265FrameSizeEXT maxFrameSize; -} VkVideoEncodeH265RateControlLayerInfoEXT; - -typedef struct VkVideoEncodeH265GopRemainingFrameInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 useGopRemainingFrames; - uint32_t gopRemainingI; - uint32_t gopRemainingP; - uint32_t gopRemainingB; -} VkVideoEncodeH265GopRemainingFrameInfoEXT; - - - // VK_AMDX_shader_enqueue is a preprocessor guard. Do not pass it to API calls. #define VK_AMDX_shader_enqueue 1 -#define VK_AMDX_SHADER_ENQUEUE_SPEC_VERSION 1 +#define VK_AMDX_SHADER_ENQUEUE_SPEC_VERSION 2 #define VK_AMDX_SHADER_ENQUEUE_EXTENSION_NAME "VK_AMDX_shader_enqueue" #define VK_SHADER_INDEX_UNUSED_AMDX (~0U) typedef struct VkPhysicalDeviceShaderEnqueueFeaturesAMDX { VkStructureType sType; void* pNext; VkBool32 shaderEnqueue; + VkBool32 shaderMeshEnqueue; } VkPhysicalDeviceShaderEnqueueFeaturesAMDX; typedef struct VkPhysicalDeviceShaderEnqueuePropertiesAMDX { @@ -667,12 +71,16 @@ typedef struct VkPhysicalDeviceShaderEnqueuePropertiesAMDX { uint32_t maxExecutionGraphShaderPayloadSize; uint32_t maxExecutionGraphShaderPayloadCount; uint32_t executionGraphDispatchAddressAlignment; + uint32_t maxExecutionGraphWorkgroupCount[3]; + uint32_t maxExecutionGraphWorkgroups; } VkPhysicalDeviceShaderEnqueuePropertiesAMDX; typedef struct VkExecutionGraphPipelineScratchSizeAMDX { VkStructureType sType; void* pNext; - VkDeviceSize size; + VkDeviceSize minSize; + VkDeviceSize maxSize; + VkDeviceSize sizeGranularity; } VkExecutionGraphPipelineScratchSizeAMDX; typedef struct VkExecutionGraphPipelineCreateInfoAMDX { @@ -713,12 +121,12 @@ typedef struct VkPipelineShaderStageNodeCreateInfoAMDX { } VkPipelineShaderStageNodeCreateInfoAMDX; typedef VkResult (VKAPI_PTR *PFN_vkCreateExecutionGraphPipelinesAMDX)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); -typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)(VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo); -typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)(VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex); -typedef void (VKAPI_PTR *PFN_vkCmdInitializeGraphScratchMemoryAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, const VkDispatchGraphCountInfoAMDX* pCountInfo); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, const VkDispatchGraphCountInfoAMDX* pCountInfo); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectCountAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceAddress countInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)(VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)(VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex); +typedef void (VKAPI_PTR *PFN_vkCmdInitializeGraphScratchMemoryAMDX)(VkCommandBuffer commandBuffer, VkPipeline executionGraph, VkDeviceAddress scratch, VkDeviceSize scratchSize); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectCountAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, VkDeviceAddress countInfo); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR VkResult VKAPI_CALL vkCreateExecutionGraphPipelinesAMDX( @@ -742,21 +150,26 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineNodeIndexAMDX( VKAPI_ATTR void VKAPI_CALL vkCmdInitializeGraphScratchMemoryAMDX( VkCommandBuffer commandBuffer, - VkDeviceAddress scratch); + VkPipeline executionGraph, + VkDeviceAddress scratch, + VkDeviceSize scratchSize); VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphAMDX( VkCommandBuffer commandBuffer, VkDeviceAddress scratch, + VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo); VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectAMDX( VkCommandBuffer commandBuffer, VkDeviceAddress scratch, + VkDeviceSize scratchSize, const VkDispatchGraphCountInfoAMDX* pCountInfo); VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectCountAMDX( VkCommandBuffer commandBuffer, VkDeviceAddress scratch, + VkDeviceSize scratchSize, VkDeviceAddress countInfo); #endif diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_core.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_core.h index bd882702..4d9776c7 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_core.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_core.h @@ -2,7 +2,7 @@ #define VULKAN_CORE_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -27,7 +27,7 @@ extern "C" { #ifndef VK_USE_64_BIT_PTR_DEFINES - #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) + #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64) #define VK_USE_64_BIT_PTR_DEFINES 1 #else #define VK_USE_64_BIT_PTR_DEFINES 0 @@ -69,21 +69,25 @@ extern "C" { #define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 263 +#define VK_HEADER_VERSION 299 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) +// VK_MAKE_VERSION is deprecated, but no reason was given in the API XML // DEPRECATED: This define is deprecated. VK_MAKE_API_VERSION should be used instead. #define VK_MAKE_VERSION(major, minor, patch) \ ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) +// VK_VERSION_MAJOR is deprecated, but no reason was given in the API XML // DEPRECATED: This define is deprecated. VK_API_VERSION_MAJOR should be used instead. #define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22U) +// VK_VERSION_MINOR is deprecated, but no reason was given in the API XML // DEPRECATED: This define is deprecated. VK_API_VERSION_MINOR should be used instead. #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) +// VK_VERSION_PATCH is deprecated, but no reason was given in the API XML // DEPRECATED: This define is deprecated. VK_API_VERSION_PATCH should be used instead. #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) @@ -182,11 +186,11 @@ typedef enum VkResult { VK_THREAD_DONE_KHR = 1000268001, VK_OPERATION_DEFERRED_KHR = 1000268002, VK_OPERATION_NOT_DEFERRED_KHR = 1000268003, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR = -1000299000, -#endif VK_ERROR_COMPRESSION_EXHAUSTED_EXT = -1000338000, - VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT = 1000482000, + VK_INCOMPATIBLE_SHADER_BINARY_EXT = 1000482000, + VK_PIPELINE_BINARY_MISSING_KHR = 1000483000, + VK_ERROR_NOT_ENOUGH_SPACE_KHR = -1000483000, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, VK_ERROR_FRAGMENTATION_EXT = VK_ERROR_FRAGMENTATION, @@ -195,6 +199,8 @@ typedef enum VkResult { VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS, VK_PIPELINE_COMPILE_REQUIRED_EXT = VK_PIPELINE_COMPILE_REQUIRED, VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT = VK_PIPELINE_COMPILE_REQUIRED, + // VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT is a deprecated alias + VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT = VK_INCOMPATIBLE_SHADER_BINARY_EXT, VK_RESULT_MAX_ENUM = 0x7FFFFFFF } VkResult; @@ -467,90 +473,34 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX = 1000029002, VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX = 1000030000, VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX = 1000030001, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT = 1000038000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000038001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT = 1000038002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_EXT = 1000038003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT = 1000038004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_EXT = 1000038005, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_GOP_REMAINING_FRAME_INFO_EXT = 1000038006, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT = 1000038007, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT = 1000038008, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT = 1000038009, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT = 1000038010, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_EXT = 1000038011, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_EXT = 1000038012, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_EXT = 1000038013, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT = 1000039000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000039001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT = 1000039002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_EXT = 1000039003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT = 1000039004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_EXT = 1000039005, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_GOP_REMAINING_FRAME_INFO_EXT = 1000039006, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_EXT = 1000039007, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT = 1000039009, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT = 1000039010, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT = 1000039011, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_EXT = 1000039012, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_EXT = 1000039013, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_EXT = 1000039014, -#endif + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR = 1000038000, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000038001, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR = 1000038002, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_KHR = 1000038003, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR = 1000038004, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_KHR = 1000038005, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_GOP_REMAINING_FRAME_INFO_KHR = 1000038006, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR = 1000038007, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR = 1000038008, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_KHR = 1000038009, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_KHR = 1000038010, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR = 1000038011, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_KHR = 1000038012, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR = 1000038013, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR = 1000039000, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000039001, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR = 1000039002, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_KHR = 1000039003, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR = 1000039004, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_KHR = 1000039005, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_GOP_REMAINING_FRAME_INFO_KHR = 1000039006, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR = 1000039007, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR = 1000039009, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_KHR = 1000039010, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_KHR = 1000039011, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR = 1000039012, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_KHR = 1000039013, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR = 1000039014, VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR = 1000040000, VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR = 1000040001, VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR = 1000040003, @@ -558,10 +508,6 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR = 1000040005, VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR = 1000040006, VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, - VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000044006, - VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT = 1000044007, - VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD = 1000044008, - VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX = 1000044009, VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP = 1000049000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV = 1000050000, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, @@ -603,6 +549,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003, VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = 1000097000, + VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX = 1000044009, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, @@ -611,6 +558,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = 1000102000, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = 1000102001, VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG = 1000110000, VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR = 1000111000, VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114000, VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114001, @@ -661,6 +609,7 @@ typedef enum VkStructureType { #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_NODE_CREATE_INFO_AMDX = 1000134004, #endif + VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD = 1000044008, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000, VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001, VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002, @@ -732,7 +681,6 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR = 1000181000, VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD = 1000183000, - VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR = 1000187000, VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000187001, @@ -745,10 +693,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR = 1000388001, VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD = 1000189000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = 1000190002, VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP = 1000191000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = 1000201000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = 1000202000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV = 1000202001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV = 1000204000, @@ -756,6 +701,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV = 1000205002, VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV = 1000206000, VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV = 1000206001, + VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV = 1000314008, + VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV = 1000314009, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL = 1000209000, VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL = 1000210000, VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL = 1000210001, @@ -771,14 +718,20 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT = 1000218000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT = 1000218001, VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT = 1000218002, + VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT = 1000044007, VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000226000, VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR = 1000226001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR = 1000226002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR = 1000226003, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR = 1000226004, + VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000044006, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD = 1000227000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD = 1000229000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR = 1000232000, + VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR = 1000232001, + VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR = 1000232002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT = 1000234000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR = 1000235000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT = 1000237000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT = 1000238000, VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT = 1000238001, @@ -803,11 +756,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT = 1000255002, VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT = 1000255001, VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT = 1000256000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT = 1000259000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT = 1000259001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT = 1000259002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT = 1000260000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT = 1000265000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT = 1000267000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR = 1000269000, VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR = 1000269001, @@ -827,6 +776,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT = 1000270009, VK_STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR = 1000271000, VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR = 1000271001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT = 1000272000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT = 1000272001, + VK_STRUCTURE_TYPE_MEMORY_MAP_PLACED_INFO_EXT = 1000272002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT = 1000273000, VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT = 1000274000, VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT = 1000274001, @@ -867,41 +819,24 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV = 1000292002, VK_STRUCTURE_TYPE_PRESENT_ID_KHR = 1000294000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR = 1000294001, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR = 1000299000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR = 1000299001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR = 1000299002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR = 1000299003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR = 1000299004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR = 1000299005, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR = 1000299006, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_PROPERTIES_KHR = 1000299007, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR = 1000299008, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_GET_INFO_KHR = 1000299009, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_FEEDBACK_INFO_KHR = 1000299010, -#endif VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV = 1000300000, VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV = 1000300001, + VK_STRUCTURE_TYPE_CUDA_MODULE_CREATE_INFO_NV = 1000307000, + VK_STRUCTURE_TYPE_CUDA_FUNCTION_CREATE_INFO_NV = 1000307001, + VK_STRUCTURE_TYPE_CUDA_LAUNCH_INFO_NV = 1000307002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV = 1000307003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV = 1000307004, VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV = 1000310000, VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT = 1000311000, VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT = 1000311001, @@ -915,8 +850,6 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_IMPORT_METAL_IO_SURFACE_INFO_EXT = 1000311009, VK_STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT = 1000311010, VK_STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT = 1000311011, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV = 1000314008, - VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV = 1000314009, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT = 1000316000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT = 1000316001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT = 1000316002, @@ -969,6 +902,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT = 1000355000, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT = 1000355001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT = 1000356000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT = 1000361000, VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA = 1000364000, VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA = 1000364001, VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA = 1000364002, @@ -992,6 +926,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV = 1000371001, VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT = 1000372000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT = 1000372001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT = 1000375000, + VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT = 1000375001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT = 1000376000, VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT = 1000376001, VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT = 1000376002, @@ -1029,10 +965,15 @@ typedef enum VkStructureType { #endif VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI = 1000404000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI = 1000404001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_VRS_FEATURES_HUAWEI = 1000404002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT = 1000411000, VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT = 1000411001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT = 1000412000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM = 1000415000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES_KHR = 1000416000, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM = 1000417000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM = 1000417001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM = 1000417002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT = 1000418000, VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT = 1000418001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE = 1000420000, @@ -1040,6 +981,11 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE = 1000420002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT = 1000421000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT = 1000422000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM = 1000424000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM = 1000424001, + VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM = 1000424002, + VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_INFO_ARM = 1000424003, + VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM = 1000424004, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM = 1000425000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM = 1000425001, VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM = 1000425002, @@ -1051,10 +997,13 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_INDIRECT_BUFFER_INFO_NV = 1000428001, VK_STRUCTURE_TYPE_PIPELINE_INDIRECT_DEVICE_ADDRESS_INFO_NV = 1000428002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV = 1000430000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR = 1000434000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT = 1000437000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM = 1000440000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM = 1000440001, VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM = 1000440002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT = 1000451000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT = 1000451001, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT = 1000453000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT = 1000455000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT = 1000455001, @@ -1078,6 +1027,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV = 1000464010, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT = 1000465000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT = 1000466000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID = 1000468000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID = 1000468001, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID = 1000468002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR = 1000470000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR = 1000470001, VK_STRUCTURE_TYPE_RENDERING_AREA_INFO_KHR = 1000470003, @@ -1086,10 +1038,23 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR = 1000338003, VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR = 1000470005, VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR = 1000470006, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD = 1000476000, + VK_STRUCTURE_TYPE_ANTI_LAG_DATA_AMD = 1000476001, + VK_STRUCTURE_TYPE_ANTI_LAG_PRESENTATION_INFO_AMD = 1000476002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR = 1000481000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT = 1000482000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT = 1000482001, VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT = 1000482002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR = 1000483000, + VK_STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR = 1000483001, + VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR = 1000483002, + VK_STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR = 1000483003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR = 1000483004, + VK_STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR = 1000483005, + VK_STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR = 1000483006, + VK_STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR = 1000483007, + VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR = 1000483008, + VK_STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR = 1000483009, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM = 1000484000, VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM = 1000484001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_AMIGO_PROFILING_FEATURES_SEC = 1000485000, @@ -1097,17 +1062,41 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM = 1000488000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV = 1000490000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV = 1000490001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV = 1000492000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV = 1000492001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT = 1000351000, VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT = 1000351002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT = 1000495000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT = 1000495001, + VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT = 1000496000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM = 1000497000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM = 1000497001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT = 1000498000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT = 1000499000, + VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV = 1000505000, + VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV = 1000505001, + VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV = 1000505002, + VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV = 1000505003, + VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV = 1000505004, + VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV = 1000505005, + VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV = 1000505006, + VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV = 1000505007, + VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV = 1000505008, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR = 1000506000, VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM = 1000510000, VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM = 1000510001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR = 1000201000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR = 1000511000, + VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR = 1000512000, + VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_KHR = 1000512001, + VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR = 1000512003, + VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000512004, + VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_KHR = 1000512005, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR = 1000515000, + VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR = 1000515001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV = 1000516000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM = 1000518000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM = 1000518001, VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM = 1000518002, @@ -1118,21 +1107,71 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM = 1000520001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM = 1000521000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT = 1000524000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR = 1000525000, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR = 1000190001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR = 1000190002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES_KHR = 1000528000, VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX = 1000529000, VK_STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX = 1000529001, VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX = 1000529002, VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX = 1000529003, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX = 1000529004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT = 1000530000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR = 1000265000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR = 1000259000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_KHR = 1000259001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR = 1000259002, + VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR = 1000184000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES_KHR = 1000544000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR = 1000545000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR = 1000545001, + VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS_KHR = 1000545002, + VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR = 1000545003, + VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR = 1000545004, + VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR = 1000545005, + VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO_KHR = 1000545006, + VK_STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT = 1000545007, + VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT = 1000545008, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV = 1000546000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV = 1000555000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR = 1000558000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV = 1000559000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR = 1000562000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR = 1000562001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR = 1000562002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_KHR = 1000562003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_VULKAN_PROPERTIES_KHR = 1000562004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV = 1000563000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT = 1000564000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV = 1000568000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT = 1000572000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT = 1000572001, + VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_EXT = 1000572002, + VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_CREATE_INFO_EXT = 1000572003, + VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_EXT = 1000572004, + VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_EXT = 1000572006, + VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_EXT = 1000572007, + VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_PIPELINE_EXT = 1000572008, + VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_SHADER_EXT = 1000572009, + VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_PIPELINE_INFO_EXT = 1000572010, + VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_INFO_EXT = 1000572011, + VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_LAYOUT_INFO_EXT = 1000572012, + VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT = 1000572013, + VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT = 1000572014, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA = 1000575000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA = 1000575001, + VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA = 1000575002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT = 1000582000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLAMP_CONTROL_CREATE_INFO_EXT = 1000582001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, + // VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT is a deprecated alias VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_RENDERING_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_INFO, VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES, VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO, - VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_NV = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD, VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, @@ -1170,6 +1209,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, + // VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT is a deprecated alias VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES, VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO, @@ -1205,6 +1245,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO, + VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_NV = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO, VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO, @@ -1224,11 +1265,15 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES, + VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES, VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES, @@ -1236,6 +1281,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO, VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO, + // VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL is a deprecated alias VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES, @@ -1256,7 +1302,11 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO, VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO, VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_KHR, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES, @@ -1333,15 +1383,10 @@ typedef enum VkImageLayout { VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT = 1000218000, VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR = 1000164003, -#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR = 1000232000, VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR = 1000299000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR = 1000299001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR = 1000299002, -#endif VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT = 1000339000, VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, @@ -1401,10 +1446,15 @@ typedef enum VkObjectType { VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL = 1000210000, VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR = 1000268000, VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV = 1000277000, + VK_OBJECT_TYPE_CUDA_MODULE_NV = 1000307000, + VK_OBJECT_TYPE_CUDA_FUNCTION_NV = 1000307001, VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA = 1000366000, VK_OBJECT_TYPE_MICROMAP_EXT = 1000396000, VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV = 1000464000, VK_OBJECT_TYPE_SHADER_EXT = 1000482000, + VK_OBJECT_TYPE_PIPELINE_BINARY_KHR = 1000483000, + VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_EXT = 1000572000, + VK_OBJECT_TYPE_INDIRECT_EXECUTION_SET_EXT = 1000572001, VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT = VK_OBJECT_TYPE_PRIVATE_DATA_SLOT, @@ -1412,6 +1462,7 @@ typedef enum VkObjectType { } VkObjectType; typedef enum VkVendorId { + VK_VENDOR_ID_KHRONOS = 0x10000, VK_VENDOR_ID_VIV = 0x10001, VK_VENDOR_ID_VSI = 0x10002, VK_VENDOR_ID_KAZAN = 0x10003, @@ -1684,7 +1735,7 @@ typedef enum VkFormat { 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_R16G16_S10_5_NV = 1000464000, + VK_FORMAT_R16G16_SFIXED5_NV = 1000464000, VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR = 1000470000, VK_FORMAT_A8_UNORM_KHR = 1000470001, VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK, @@ -1741,6 +1792,8 @@ typedef enum VkFormat { VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT = VK_FORMAT_G16_B16R16_2PLANE_444_UNORM, VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT = VK_FORMAT_A4R4G4B4_UNORM_PACK16, VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT = VK_FORMAT_A4B4G4R4_UNORM_PACK16, + // VK_FORMAT_R16G16_S10_5_NV is a deprecated alias + VK_FORMAT_R16G16_S10_5_NV = VK_FORMAT_R16G16_SFIXED5_NV, VK_FORMAT_MAX_ENUM = 0x7FFFFFFF } VkFormat; @@ -1778,9 +1831,7 @@ typedef enum VkQueryType { VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR = 1000150001, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV = 1000165000, VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL = 1000210000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR = 1000299000, -#endif VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT = 1000328000, VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT = 1000382000, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR = 1000386000, @@ -1944,12 +1995,10 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV = 1000205000, VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1000205001, VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR = 1000226000, - VK_DYNAMIC_STATE_LINE_STIPPLE_EXT = 1000259000, VK_DYNAMIC_STATE_VERTEX_INPUT_EXT = 1000352000, VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT = 1000377000, VK_DYNAMIC_STATE_LOGIC_OP_EXT = 1000377003, VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT = 1000381000, - VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT = 1000455002, VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT = 1000455003, VK_DYNAMIC_STATE_POLYGON_MODE_EXT = 1000455004, VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT = 1000455005, @@ -1960,6 +2009,7 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT = 1000455010, VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT = 1000455011, VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT = 1000455012, + VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT = 1000455002, VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT = 1000455013, VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT = 1000455014, VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT = 1000455015, @@ -1981,6 +2031,9 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV = 1000455031, VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV = 1000455032, VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT = 1000524000, + VK_DYNAMIC_STATE_LINE_STIPPLE_KHR = 1000259000, + VK_DYNAMIC_STATE_DEPTH_CLAMP_RANGE_EXT = 1000582000, + VK_DYNAMIC_STATE_LINE_STIPPLE_EXT = VK_DYNAMIC_STATE_LINE_STIPPLE_KHR, VK_DYNAMIC_STATE_CULL_MODE_EXT = VK_DYNAMIC_STATE_CULL_MODE, VK_DYNAMIC_STATE_FRONT_FACE_EXT = VK_DYNAMIC_STATE_FRONT_FACE, VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT = VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY, @@ -2092,6 +2145,7 @@ typedef enum VkSamplerAddressMode { 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_MIRROR_CLAMP_TO_EDGE_KHR is a deprecated alias VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE_KHR = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF } VkSamplerAddressMode; @@ -2129,7 +2183,8 @@ typedef enum VkAttachmentLoadOp { VK_ATTACHMENT_LOAD_OP_LOAD = 0, VK_ATTACHMENT_LOAD_OP_CLEAR = 1, VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2, - VK_ATTACHMENT_LOAD_OP_NONE_EXT = 1000400000, + VK_ATTACHMENT_LOAD_OP_NONE_KHR = 1000400000, + VK_ATTACHMENT_LOAD_OP_NONE_EXT = VK_ATTACHMENT_LOAD_OP_NONE_KHR, VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7FFFFFFF } VkAttachmentLoadOp; @@ -2165,14 +2220,17 @@ typedef enum VkIndexType { VK_INDEX_TYPE_UINT16 = 0, VK_INDEX_TYPE_UINT32 = 1, VK_INDEX_TYPE_NONE_KHR = 1000165000, - VK_INDEX_TYPE_UINT8_EXT = 1000265000, + VK_INDEX_TYPE_UINT8_KHR = 1000265000, VK_INDEX_TYPE_NONE_NV = VK_INDEX_TYPE_NONE_KHR, + VK_INDEX_TYPE_UINT8_EXT = VK_INDEX_TYPE_UINT8_KHR, VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF } VkIndexType; typedef enum VkSubpassContents { VK_SUBPASS_CONTENTS_INLINE = 0, VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, + VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_KHR = 1000451000, + VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT = VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_KHR, VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF } VkSubpassContents; @@ -2210,6 +2268,8 @@ typedef enum VkAccessFlagBits { VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV = VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR, VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV = VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR, VK_ACCESS_NONE_KHR = VK_ACCESS_NONE, + VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_EXT = VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV, + VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_EXT = VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV, VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkAccessFlagBits; typedef VkFlags VkAccessFlags; @@ -2265,12 +2325,8 @@ typedef enum VkFormatFeatureFlagBits { VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000, VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000, VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR = 0x08000000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR = 0x10000000, -#endif VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT, VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, @@ -2306,6 +2362,7 @@ typedef enum VkImageCreateFlagBits { VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT = 0x00040000, VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT = 0x00020000, VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM = 0x00008000, + VK_IMAGE_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR = 0x00100000, VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, @@ -2343,15 +2400,9 @@ typedef enum VkImageUsageFlagBits { VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x00000200, VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00000100, VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT = 0x00400000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR = 0x00002000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR = 0x00004000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR = 0x00008000, -#endif VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x00080000, VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI = 0x00040000, VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM = 0x00100000, @@ -2396,9 +2447,7 @@ typedef enum VkQueueFlagBits { VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, VK_QUEUE_PROTECTED_BIT = 0x00000010, VK_QUEUE_VIDEO_DECODE_BIT_KHR = 0x00000020, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUEUE_VIDEO_ENCODE_BIT_KHR = 0x00000040, -#endif VK_QUEUE_OPTICAL_FLOW_BIT_NV = 0x00000100, VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkQueueFlagBits; @@ -2445,9 +2494,15 @@ typedef enum VkPipelineStageFlagBits { VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT, VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT, VK_PIPELINE_STAGE_NONE_KHR = VK_PIPELINE_STAGE_NONE, + VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_EXT = VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV, VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkPipelineStageFlagBits; typedef VkFlags VkPipelineStageFlags; + +typedef enum VkMemoryMapFlagBits { + VK_MEMORY_MAP_PLACED_BIT_EXT = 0x00000001, + VK_MEMORY_MAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryMapFlagBits; typedef VkFlags VkMemoryMapFlags; typedef enum VkSparseMemoryBindFlagBits { @@ -2515,6 +2570,7 @@ typedef enum VkBufferCreateFlagBits { VK_BUFFER_CREATE_PROTECTED_BIT = 0x00000008, VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0x00000010, VK_BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000020, + VK_BUFFER_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR = 0x00000040, VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF @@ -2543,12 +2599,8 @@ typedef enum VkBufferUsageFlagBits { VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR = 0x00080000, VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR = 0x00100000, VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR = 0x00000400, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR = 0x00008000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR = 0x00010000, -#endif VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT = 0x00200000, VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00400000, VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0x04000000, @@ -2595,8 +2647,6 @@ typedef enum VkPipelineCreateFlagBits { VK_PIPELINE_CREATE_DISPATCH_BASE_BIT = 0x00000010, VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT = 0x00000100, VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT = 0x00000200, - VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00200000, - VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00400000, VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 0x00004000, VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 0x00008000, VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR = 0x00010000, @@ -2605,6 +2655,8 @@ typedef enum VkPipelineCreateFlagBits { VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR = 0x00002000, VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR = 0x00080000, VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV = 0x00000020, + VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00400000, + VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00200000, VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR = 0x00000040, VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR = 0x00000080, VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV = 0x00040000, @@ -2622,10 +2674,12 @@ typedef enum VkPipelineCreateFlagBits { VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT = 0x08000000, VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT = 0x40000000, VK_PIPELINE_CREATE_DISPATCH_BASE = VK_PIPELINE_CREATE_DISPATCH_BASE_BIT, - VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT, VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, VK_PIPELINE_CREATE_DISPATCH_BASE_KHR = VK_PIPELINE_CREATE_DISPATCH_BASE, + // VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT is a deprecated alias + VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT, + // VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR is a deprecated alias + VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT = VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT, VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT = VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT, VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF @@ -2740,6 +2794,7 @@ typedef enum VkDescriptorSetLayoutCreateFlagBits { VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT = 0x00000020, VK_DESCRIPTOR_SET_LAYOUT_CREATE_INDIRECT_BINDABLE_BIT_NV = 0x00000080, VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT = 0x00000004, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV = 0x00000040, VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE = VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT, VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF @@ -2830,6 +2885,7 @@ typedef enum VkStencilFaceFlagBits { VK_STENCIL_FACE_FRONT_BIT = 0x00000001, VK_STENCIL_FACE_BACK_BIT = 0x00000002, VK_STENCIL_FACE_FRONT_AND_BACK = 0x00000003, + // VK_STENCIL_FRONT_AND_BACK is a deprecated alias VK_STENCIL_FRONT_AND_BACK = VK_STENCIL_FACE_FRONT_AND_BACK, VK_STENCIL_FACE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkStencilFaceFlagBits; @@ -3240,7 +3296,9 @@ typedef struct VkDeviceCreateInfo { VkDeviceCreateFlags flags; uint32_t queueCreateInfoCount; const VkDeviceQueueCreateInfo* pQueueCreateInfos; + // enabledLayerCount is deprecated and should not be used uint32_t enabledLayerCount; + // ppEnabledLayerNames is deprecated and should not be used const char* const* ppEnabledLayerNames; uint32_t enabledExtensionCount; const char* const* ppEnabledExtensionNames; @@ -4969,6 +5027,8 @@ typedef enum VkSubgroupFeatureFlagBits { VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0x00000040, VK_SUBGROUP_FEATURE_QUAD_BIT = 0x00000080, VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100, + VK_SUBGROUP_FEATURE_ROTATE_BIT_KHR = 0x00000200, + VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT_KHR = 0x00000400, VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkSubgroupFeatureFlagBits; typedef VkFlags VkSubgroupFeatureFlags; @@ -5796,6 +5856,8 @@ typedef enum VkDriverId { VK_DRIVER_ID_MESA_DOZEN = 23, VK_DRIVER_ID_MESA_NVK = 24, VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA = 25, + VK_DRIVER_ID_MESA_HONEYKRISP = 26, + VK_DRIVER_ID_RESERVED_27 = 27, VK_DRIVER_ID_AMD_PROPRIETARY_KHR = VK_DRIVER_ID_AMD_PROPRIETARY, VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR = VK_DRIVER_ID_AMD_OPEN_SOURCE, VK_DRIVER_ID_MESA_RADV_KHR = VK_DRIVER_ID_MESA_RADV, @@ -5846,6 +5908,7 @@ typedef enum VkResolveModeFlagBits { VK_RESOLVE_MODE_AVERAGE_BIT = 0x00000002, VK_RESOLVE_MODE_MIN_BIT = 0x00000004, VK_RESOLVE_MODE_MAX_BIT = 0x00000008, + VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID = 0x00000010, VK_RESOLVE_MODE_NONE_KHR = VK_RESOLVE_MODE_NONE, VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT, VK_RESOLVE_MODE_AVERAGE_BIT_KHR = VK_RESOLVE_MODE_AVERAGE_BIT, @@ -6611,12 +6674,11 @@ static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT = 0x4000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR = 0x4000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR = 0x04000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR = 0x08000000ULL; -#endif static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV = 0x00020000ULL; +static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_EXT = 0x00020000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00400000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SHADING_RATE_IMAGE_BIT_NV = 0x00400000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x02000000ULL; @@ -6629,6 +6691,7 @@ static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV = 0 static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT = 0x00080000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT = 0x00100000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI = 0x8000000000ULL; +// VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI is a deprecated alias static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI = 0x8000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI = 0x10000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR = 0x10000000ULL; @@ -6684,18 +6747,16 @@ static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT = 0x40000000 static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR = 0x400000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR = 0x800000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR = 0x1000000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR = 0x2000000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR = 0x4000000000ULL; -#endif static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV = 0x00020000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV = 0x00040000ULL; +static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_EXT = 0x00020000ULL; +static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_EXT = 0x00040000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR = 0x00800000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_SHADING_RATE_IMAGE_READ_BIT_NV = 0x00800000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR = 0x00200000ULL; @@ -6725,9 +6786,11 @@ typedef enum VkRenderingFlagBits { VK_RENDERING_SUSPENDING_BIT = 0x00000002, VK_RENDERING_RESUMING_BIT = 0x00000004, VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x00000008, + VK_RENDERING_CONTENTS_INLINE_BIT_KHR = 0x00000010, VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR = VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT, VK_RENDERING_SUSPENDING_BIT_KHR = VK_RENDERING_SUSPENDING_BIT, VK_RENDERING_RESUMING_BIT_KHR = VK_RENDERING_RESUMING_BIT, + VK_RENDERING_CONTENTS_INLINE_BIT_EXT = VK_RENDERING_CONTENTS_INLINE_BIT_KHR, VK_RENDERING_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkRenderingFlagBits; typedef VkFlags VkRenderingFlags; @@ -6795,12 +6858,8 @@ static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE 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_HOST_IMAGE_TRANSFER_BIT_EXT = 0x400000000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR = 0x08000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR = 0x10000000ULL; -#endif static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV = 0x4000000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM = 0x400000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM = 0x800000000ULL; @@ -7575,6 +7634,7 @@ typedef enum VkPresentModeKHR { 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_FIFO_LATEST_READY_EXT = 1000361000, VK_PRESENT_MODE_MAX_ENUM_KHR = 0x7FFFFFFF } VkPresentModeKHR; @@ -7588,6 +7648,7 @@ typedef enum VkColorSpaceKHR { 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 is deprecated, but no reason was given in the API XML VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, @@ -7595,7 +7656,9 @@ typedef enum VkColorSpaceKHR { VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, VK_COLOR_SPACE_DISPLAY_NATIVE_AMD = 1000213000, + // VK_COLORSPACE_SRGB_NONLINEAR_KHR is a deprecated alias VK_COLORSPACE_SRGB_NONLINEAR_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, + // VK_COLOR_SPACE_DCI_P3_LINEAR_EXT is a deprecated alias VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT, VK_COLOR_SPACE_MAX_ENUM_KHR = 0x7FFFFFFF } VkColorSpaceKHR; @@ -8011,14 +8074,11 @@ typedef enum VkQueryResultStatusKHR { typedef enum VkVideoCodecOperationFlagBitsKHR { VK_VIDEO_CODEC_OPERATION_NONE_KHR = 0, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT = 0x00010000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT = 0x00020000, -#endif + VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR = 0x00010000, + VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR = 0x00020000, VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR = 0x00000001, VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR = 0x00000002, + VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR = 0x00000004, VK_VIDEO_CODEC_OPERATION_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkVideoCodecOperationFlagBitsKHR; typedef VkFlags VkVideoCodecOperationFlagsKHR; @@ -8051,9 +8111,8 @@ typedef VkFlags VkVideoCapabilityFlagsKHR; typedef enum VkVideoSessionCreateFlagBitsKHR { VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR = 0x00000001, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_PARAMETER_OPTIMIZATIONS_BIT_KHR = 0x00000002, -#endif + VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR = 0x00000004, VK_VIDEO_SESSION_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkVideoSessionCreateFlagBitsKHR; typedef VkFlags VkVideoSessionCreateFlagsKHR; @@ -8063,12 +8122,8 @@ typedef VkFlags VkVideoEndCodingFlagsKHR; typedef enum VkVideoCodingControlFlagBitsKHR { VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR = 0x00000001, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR = 0x00000002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_VIDEO_CODING_CONTROL_ENCODE_QUALITY_LEVEL_BIT_KHR = 0x00000004, -#endif VK_VIDEO_CODING_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkVideoCodingControlFlagBitsKHR; typedef VkFlags VkVideoCodingControlFlagsKHR; @@ -8293,7 +8348,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdControlVideoCodingKHR( // VK_KHR_video_decode_queue is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_video_decode_queue 1 -#define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 7 +#define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 8 #define VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME "VK_KHR_video_decode_queue" typedef enum VkVideoDecodeCapabilityFlagBitsKHR { @@ -8346,11 +8401,434 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDecodeVideoKHR( #endif +// VK_KHR_video_encode_h264 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_encode_h264 1 +#include "vk_video/vulkan_video_codec_h264std.h" +#include "vk_video/vulkan_video_codec_h264std_encode.h" +#define VK_KHR_VIDEO_ENCODE_H264_SPEC_VERSION 14 +#define VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_KHR_video_encode_h264" + +typedef enum VkVideoEncodeH264CapabilityFlagBitsKHR { + VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H264_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR = 0x00000020, + VK_VIDEO_ENCODE_H264_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR = 0x00000040, + VK_VIDEO_ENCODE_H264_CAPABILITY_PER_SLICE_CONSTANT_QP_BIT_KHR = 0x00000080, + VK_VIDEO_ENCODE_H264_CAPABILITY_GENERATE_PREFIX_NALU_BIT_KHR = 0x00000100, + VK_VIDEO_ENCODE_H264_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH264CapabilityFlagBitsKHR; +typedef VkFlags VkVideoEncodeH264CapabilityFlagsKHR; + +typedef enum VkVideoEncodeH264StdFlagBitsKHR { + VK_VIDEO_ENCODE_H264_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H264_STD_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG_SET_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H264_STD_SCALING_MATRIX_PRESENT_FLAG_SET_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H264_STD_CHROMA_QP_INDEX_OFFSET_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H264_STD_SECOND_CHROMA_QP_INDEX_OFFSET_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H264_STD_PIC_INIT_QP_MINUS26_BIT_KHR = 0x00000020, + VK_VIDEO_ENCODE_H264_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR = 0x00000040, + VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_EXPLICIT_BIT_KHR = 0x00000080, + VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_IMPLICIT_BIT_KHR = 0x00000100, + VK_VIDEO_ENCODE_H264_STD_TRANSFORM_8X8_MODE_FLAG_SET_BIT_KHR = 0x00000200, + VK_VIDEO_ENCODE_H264_STD_DIRECT_SPATIAL_MV_PRED_FLAG_UNSET_BIT_KHR = 0x00000400, + VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_UNSET_BIT_KHR = 0x00000800, + VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_SET_BIT_KHR = 0x00001000, + VK_VIDEO_ENCODE_H264_STD_DIRECT_8X8_INFERENCE_FLAG_UNSET_BIT_KHR = 0x00002000, + VK_VIDEO_ENCODE_H264_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR = 0x00004000, + VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_DISABLED_BIT_KHR = 0x00008000, + VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_ENABLED_BIT_KHR = 0x00010000, + VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_KHR = 0x00020000, + VK_VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_KHR = 0x00080000, + VK_VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR = 0x00100000, + VK_VIDEO_ENCODE_H264_STD_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH264StdFlagBitsKHR; +typedef VkFlags VkVideoEncodeH264StdFlagsKHR; + +typedef enum VkVideoEncodeH264RateControlFlagBitsKHR { + VK_VIDEO_ENCODE_H264_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_REGULAR_GOP_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_TEMPORAL_LAYER_PATTERN_DYADIC_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH264RateControlFlagBitsKHR; +typedef VkFlags VkVideoEncodeH264RateControlFlagsKHR; +typedef struct VkVideoEncodeH264CapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeH264CapabilityFlagsKHR flags; + StdVideoH264LevelIdc maxLevelIdc; + uint32_t maxSliceCount; + uint32_t maxPPictureL0ReferenceCount; + uint32_t maxBPictureL0ReferenceCount; + uint32_t maxL1ReferenceCount; + uint32_t maxTemporalLayerCount; + VkBool32 expectDyadicTemporalLayerPattern; + int32_t minQp; + int32_t maxQp; + VkBool32 prefersGopRemainingFrames; + VkBool32 requiresGopRemainingFrames; + VkVideoEncodeH264StdFlagsKHR stdSyntaxFlags; +} VkVideoEncodeH264CapabilitiesKHR; + +typedef struct VkVideoEncodeH264QpKHR { + int32_t qpI; + int32_t qpP; + int32_t qpB; +} VkVideoEncodeH264QpKHR; + +typedef struct VkVideoEncodeH264QualityLevelPropertiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeH264RateControlFlagsKHR preferredRateControlFlags; + uint32_t preferredGopFrameCount; + uint32_t preferredIdrPeriod; + uint32_t preferredConsecutiveBFrameCount; + uint32_t preferredTemporalLayerCount; + VkVideoEncodeH264QpKHR preferredConstantQp; + uint32_t preferredMaxL0ReferenceCount; + uint32_t preferredMaxL1ReferenceCount; + VkBool32 preferredStdEntropyCodingModeFlag; +} VkVideoEncodeH264QualityLevelPropertiesKHR; + +typedef struct VkVideoEncodeH264SessionCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useMaxLevelIdc; + StdVideoH264LevelIdc maxLevelIdc; +} VkVideoEncodeH264SessionCreateInfoKHR; + +typedef struct VkVideoEncodeH264SessionParametersAddInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t stdSPSCount; + const StdVideoH264SequenceParameterSet* pStdSPSs; + uint32_t stdPPSCount; + const StdVideoH264PictureParameterSet* pStdPPSs; +} VkVideoEncodeH264SessionParametersAddInfoKHR; + +typedef struct VkVideoEncodeH264SessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t maxStdSPSCount; + uint32_t maxStdPPSCount; + const VkVideoEncodeH264SessionParametersAddInfoKHR* pParametersAddInfo; +} VkVideoEncodeH264SessionParametersCreateInfoKHR; + +typedef struct VkVideoEncodeH264SessionParametersGetInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 writeStdSPS; + VkBool32 writeStdPPS; + uint32_t stdSPSId; + uint32_t stdPPSId; +} VkVideoEncodeH264SessionParametersGetInfoKHR; + +typedef struct VkVideoEncodeH264SessionParametersFeedbackInfoKHR { + VkStructureType sType; + void* pNext; + VkBool32 hasStdSPSOverrides; + VkBool32 hasStdPPSOverrides; +} VkVideoEncodeH264SessionParametersFeedbackInfoKHR; + +typedef struct VkVideoEncodeH264NaluSliceInfoKHR { + VkStructureType sType; + const void* pNext; + int32_t constantQp; + const StdVideoEncodeH264SliceHeader* pStdSliceHeader; +} VkVideoEncodeH264NaluSliceInfoKHR; + +typedef struct VkVideoEncodeH264PictureInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t naluSliceEntryCount; + const VkVideoEncodeH264NaluSliceInfoKHR* pNaluSliceEntries; + const StdVideoEncodeH264PictureInfo* pStdPictureInfo; + VkBool32 generatePrefixNalu; +} VkVideoEncodeH264PictureInfoKHR; + +typedef struct VkVideoEncodeH264DpbSlotInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo; +} VkVideoEncodeH264DpbSlotInfoKHR; + +typedef struct VkVideoEncodeH264ProfileInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoH264ProfileIdc stdProfileIdc; +} VkVideoEncodeH264ProfileInfoKHR; + +typedef struct VkVideoEncodeH264RateControlInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeH264RateControlFlagsKHR flags; + uint32_t gopFrameCount; + uint32_t idrPeriod; + uint32_t consecutiveBFrameCount; + uint32_t temporalLayerCount; +} VkVideoEncodeH264RateControlInfoKHR; + +typedef struct VkVideoEncodeH264FrameSizeKHR { + uint32_t frameISize; + uint32_t framePSize; + uint32_t frameBSize; +} VkVideoEncodeH264FrameSizeKHR; + +typedef struct VkVideoEncodeH264RateControlLayerInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useMinQp; + VkVideoEncodeH264QpKHR minQp; + VkBool32 useMaxQp; + VkVideoEncodeH264QpKHR maxQp; + VkBool32 useMaxFrameSize; + VkVideoEncodeH264FrameSizeKHR maxFrameSize; +} VkVideoEncodeH264RateControlLayerInfoKHR; + +typedef struct VkVideoEncodeH264GopRemainingFrameInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useGopRemainingFrames; + uint32_t gopRemainingI; + uint32_t gopRemainingP; + uint32_t gopRemainingB; +} VkVideoEncodeH264GopRemainingFrameInfoKHR; + + + +// VK_KHR_video_encode_h265 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_encode_h265 1 +#include "vk_video/vulkan_video_codec_h265std.h" +#include "vk_video/vulkan_video_codec_h265std_encode.h" +#define VK_KHR_VIDEO_ENCODE_H265_SPEC_VERSION 14 +#define VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_KHR_video_encode_h265" + +typedef enum VkVideoEncodeH265CapabilityFlagBitsKHR { + VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_SEGMENT_TYPE_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR = 0x00000020, + VK_VIDEO_ENCODE_H265_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR = 0x00000040, + VK_VIDEO_ENCODE_H265_CAPABILITY_PER_SLICE_SEGMENT_CONSTANT_QP_BIT_KHR = 0x00000080, + VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILES_PER_SLICE_SEGMENT_BIT_KHR = 0x00000100, + VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_SEGMENTS_PER_TILE_BIT_KHR = 0x00000200, + VK_VIDEO_ENCODE_H265_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265CapabilityFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265CapabilityFlagsKHR; + +typedef enum VkVideoEncodeH265StdFlagBitsKHR { + VK_VIDEO_ENCODE_H265_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_STD_SAMPLE_ADAPTIVE_OFFSET_ENABLED_FLAG_SET_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_STD_SCALING_LIST_DATA_PRESENT_FLAG_SET_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_STD_PCM_ENABLED_FLAG_SET_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H265_STD_SPS_TEMPORAL_MVP_ENABLED_FLAG_SET_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H265_STD_INIT_QP_MINUS26_BIT_KHR = 0x00000020, + VK_VIDEO_ENCODE_H265_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR = 0x00000040, + VK_VIDEO_ENCODE_H265_STD_WEIGHTED_BIPRED_FLAG_SET_BIT_KHR = 0x00000080, + VK_VIDEO_ENCODE_H265_STD_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_KHR = 0x00000100, + VK_VIDEO_ENCODE_H265_STD_SIGN_DATA_HIDING_ENABLED_FLAG_SET_BIT_KHR = 0x00000200, + VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_SET_BIT_KHR = 0x00000400, + VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_UNSET_BIT_KHR = 0x00000800, + VK_VIDEO_ENCODE_H265_STD_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_FLAG_SET_BIT_KHR = 0x00001000, + VK_VIDEO_ENCODE_H265_STD_TRANSQUANT_BYPASS_ENABLED_FLAG_SET_BIT_KHR = 0x00002000, + VK_VIDEO_ENCODE_H265_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR = 0x00004000, + VK_VIDEO_ENCODE_H265_STD_ENTROPY_CODING_SYNC_ENABLED_FLAG_SET_BIT_KHR = 0x00008000, + VK_VIDEO_ENCODE_H265_STD_DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_SET_BIT_KHR = 0x00010000, + VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_KHR = 0x00020000, + VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_KHR = 0x00040000, + VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_KHR = 0x00080000, + VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR = 0x00100000, + VK_VIDEO_ENCODE_H265_STD_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265StdFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265StdFlagsKHR; + +typedef enum VkVideoEncodeH265CtbSizeFlagBitsKHR { + VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_CTB_SIZE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265CtbSizeFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265CtbSizeFlagsKHR; + +typedef enum VkVideoEncodeH265TransformBlockSizeFlagBitsKHR { + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265TransformBlockSizeFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsKHR; + +typedef enum VkVideoEncodeH265RateControlFlagBitsKHR { + VK_VIDEO_ENCODE_H265_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_REGULAR_GOP_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_TEMPORAL_SUB_LAYER_PATTERN_DYADIC_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265RateControlFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265RateControlFlagsKHR; +typedef struct VkVideoEncodeH265CapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeH265CapabilityFlagsKHR flags; + StdVideoH265LevelIdc maxLevelIdc; + uint32_t maxSliceSegmentCount; + VkExtent2D maxTiles; + VkVideoEncodeH265CtbSizeFlagsKHR ctbSizes; + VkVideoEncodeH265TransformBlockSizeFlagsKHR transformBlockSizes; + uint32_t maxPPictureL0ReferenceCount; + uint32_t maxBPictureL0ReferenceCount; + uint32_t maxL1ReferenceCount; + uint32_t maxSubLayerCount; + VkBool32 expectDyadicTemporalSubLayerPattern; + int32_t minQp; + int32_t maxQp; + VkBool32 prefersGopRemainingFrames; + VkBool32 requiresGopRemainingFrames; + VkVideoEncodeH265StdFlagsKHR stdSyntaxFlags; +} VkVideoEncodeH265CapabilitiesKHR; + +typedef struct VkVideoEncodeH265SessionCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useMaxLevelIdc; + StdVideoH265LevelIdc maxLevelIdc; +} VkVideoEncodeH265SessionCreateInfoKHR; + +typedef struct VkVideoEncodeH265QpKHR { + int32_t qpI; + int32_t qpP; + int32_t qpB; +} VkVideoEncodeH265QpKHR; + +typedef struct VkVideoEncodeH265QualityLevelPropertiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeH265RateControlFlagsKHR preferredRateControlFlags; + uint32_t preferredGopFrameCount; + uint32_t preferredIdrPeriod; + uint32_t preferredConsecutiveBFrameCount; + uint32_t preferredSubLayerCount; + VkVideoEncodeH265QpKHR preferredConstantQp; + uint32_t preferredMaxL0ReferenceCount; + uint32_t preferredMaxL1ReferenceCount; +} VkVideoEncodeH265QualityLevelPropertiesKHR; + +typedef struct VkVideoEncodeH265SessionParametersAddInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t stdVPSCount; + const StdVideoH265VideoParameterSet* pStdVPSs; + uint32_t stdSPSCount; + const StdVideoH265SequenceParameterSet* pStdSPSs; + uint32_t stdPPSCount; + const StdVideoH265PictureParameterSet* pStdPPSs; +} VkVideoEncodeH265SessionParametersAddInfoKHR; + +typedef struct VkVideoEncodeH265SessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t maxStdVPSCount; + uint32_t maxStdSPSCount; + uint32_t maxStdPPSCount; + const VkVideoEncodeH265SessionParametersAddInfoKHR* pParametersAddInfo; +} VkVideoEncodeH265SessionParametersCreateInfoKHR; + +typedef struct VkVideoEncodeH265SessionParametersGetInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 writeStdVPS; + VkBool32 writeStdSPS; + VkBool32 writeStdPPS; + uint32_t stdVPSId; + uint32_t stdSPSId; + uint32_t stdPPSId; +} VkVideoEncodeH265SessionParametersGetInfoKHR; + +typedef struct VkVideoEncodeH265SessionParametersFeedbackInfoKHR { + VkStructureType sType; + void* pNext; + VkBool32 hasStdVPSOverrides; + VkBool32 hasStdSPSOverrides; + VkBool32 hasStdPPSOverrides; +} VkVideoEncodeH265SessionParametersFeedbackInfoKHR; + +typedef struct VkVideoEncodeH265NaluSliceSegmentInfoKHR { + VkStructureType sType; + const void* pNext; + int32_t constantQp; + const StdVideoEncodeH265SliceSegmentHeader* pStdSliceSegmentHeader; +} VkVideoEncodeH265NaluSliceSegmentInfoKHR; + +typedef struct VkVideoEncodeH265PictureInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t naluSliceSegmentEntryCount; + const VkVideoEncodeH265NaluSliceSegmentInfoKHR* pNaluSliceSegmentEntries; + const StdVideoEncodeH265PictureInfo* pStdPictureInfo; +} VkVideoEncodeH265PictureInfoKHR; + +typedef struct VkVideoEncodeH265DpbSlotInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo; +} VkVideoEncodeH265DpbSlotInfoKHR; + +typedef struct VkVideoEncodeH265ProfileInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoH265ProfileIdc stdProfileIdc; +} VkVideoEncodeH265ProfileInfoKHR; + +typedef struct VkVideoEncodeH265RateControlInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeH265RateControlFlagsKHR flags; + uint32_t gopFrameCount; + uint32_t idrPeriod; + uint32_t consecutiveBFrameCount; + uint32_t subLayerCount; +} VkVideoEncodeH265RateControlInfoKHR; + +typedef struct VkVideoEncodeH265FrameSizeKHR { + uint32_t frameISize; + uint32_t framePSize; + uint32_t frameBSize; +} VkVideoEncodeH265FrameSizeKHR; + +typedef struct VkVideoEncodeH265RateControlLayerInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useMinQp; + VkVideoEncodeH265QpKHR minQp; + VkBool32 useMaxQp; + VkVideoEncodeH265QpKHR maxQp; + VkBool32 useMaxFrameSize; + VkVideoEncodeH265FrameSizeKHR maxFrameSize; +} VkVideoEncodeH265RateControlLayerInfoKHR; + +typedef struct VkVideoEncodeH265GopRemainingFrameInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useGopRemainingFrames; + uint32_t gopRemainingI; + uint32_t gopRemainingP; + uint32_t gopRemainingB; +} VkVideoEncodeH265GopRemainingFrameInfoKHR; + + + // VK_KHR_video_decode_h264 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_video_decode_h264 1 -#include "vk_video/vulkan_video_codec_h264std.h" #include "vk_video/vulkan_video_codec_h264std_decode.h" -#define VK_KHR_VIDEO_DECODE_H264_SPEC_VERSION 8 +#define VK_KHR_VIDEO_DECODE_H264_SPEC_VERSION 9 #define VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME "VK_KHR_video_decode_h264" typedef enum VkVideoDecodeH264PictureLayoutFlagBitsKHR { @@ -8425,38 +8903,6 @@ typedef VkPhysicalDeviceDynamicRenderingFeatures VkPhysicalDeviceDynamicRenderin typedef VkCommandBufferInheritanceRenderingInfo VkCommandBufferInheritanceRenderingInfoKHR; -typedef struct VkRenderingFragmentShadingRateAttachmentInfoKHR { - VkStructureType sType; - const void* pNext; - VkImageView imageView; - VkImageLayout imageLayout; - VkExtent2D shadingRateAttachmentTexelSize; -} VkRenderingFragmentShadingRateAttachmentInfoKHR; - -typedef struct VkRenderingFragmentDensityMapAttachmentInfoEXT { - VkStructureType sType; - const void* pNext; - VkImageView imageView; - VkImageLayout imageLayout; -} VkRenderingFragmentDensityMapAttachmentInfoEXT; - -typedef struct VkAttachmentSampleCountInfoAMD { - VkStructureType sType; - const void* pNext; - uint32_t colorAttachmentCount; - const VkSampleCountFlagBits* pColorAttachmentSamples; - VkSampleCountFlagBits depthStencilAttachmentSamples; -} VkAttachmentSampleCountInfoAMD; - -typedef VkAttachmentSampleCountInfoAMD VkAttachmentSampleCountInfoNV; - -typedef struct VkMultiviewPerViewAttributesInfoNVX { - VkStructureType sType; - const void* pNext; - VkBool32 perViewAttributes; - VkBool32 perViewAttributesPositionXOnly; -} VkMultiviewPerViewAttributesInfoNVX; - typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderingKHR)(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo); typedef void (VKAPI_PTR *PFN_vkCmdEndRenderingKHR)(VkCommandBuffer commandBuffer); @@ -8611,7 +9057,9 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHR( #define VK_KHR_maintenance1 1 #define VK_KHR_MAINTENANCE_1_SPEC_VERSION 2 #define VK_KHR_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_maintenance1" +// VK_KHR_MAINTENANCE1_SPEC_VERSION is a deprecated alias #define VK_KHR_MAINTENANCE1_SPEC_VERSION VK_KHR_MAINTENANCE_1_SPEC_VERSION +// VK_KHR_MAINTENANCE1_EXTENSION_NAME is a deprecated alias #define VK_KHR_MAINTENANCE1_EXTENSION_NAME VK_KHR_MAINTENANCE_1_EXTENSION_NAME typedef VkCommandPoolTrimFlags VkCommandPoolTrimFlagsKHR; @@ -9093,8 +9541,11 @@ typedef enum VkPerformanceCounterScopeKHR { VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR = 0, VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR = 1, VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR = 2, + // VK_QUERY_SCOPE_COMMAND_BUFFER_KHR is a deprecated alias VK_QUERY_SCOPE_COMMAND_BUFFER_KHR = VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR, + // VK_QUERY_SCOPE_RENDER_PASS_KHR is a deprecated alias VK_QUERY_SCOPE_RENDER_PASS_KHR = VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR, + // VK_QUERY_SCOPE_COMMAND_KHR is a deprecated alias VK_QUERY_SCOPE_COMMAND_KHR = VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR, VK_PERFORMANCE_COUNTER_SCOPE_MAX_ENUM_KHR = 0x7FFFFFFF } VkPerformanceCounterScopeKHR; @@ -9112,7 +9563,9 @@ typedef enum VkPerformanceCounterStorageKHR { typedef enum VkPerformanceCounterDescriptionFlagBitsKHR { VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR = 0x00000001, VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR = 0x00000002, + // VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR is a deprecated alias VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR = VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR, + // VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR is a deprecated alias VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR = VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR, VK_PERFORMANCE_COUNTER_DESCRIPTION_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkPerformanceCounterDescriptionFlagBitsKHR; @@ -9214,7 +9667,9 @@ VKAPI_ATTR void VKAPI_CALL vkReleaseProfilingLockKHR( #define VK_KHR_maintenance2 1 #define VK_KHR_MAINTENANCE_2_SPEC_VERSION 1 #define VK_KHR_MAINTENANCE_2_EXTENSION_NAME "VK_KHR_maintenance2" +// VK_KHR_MAINTENANCE2_SPEC_VERSION is a deprecated alias #define VK_KHR_MAINTENANCE2_SPEC_VERSION VK_KHR_MAINTENANCE_2_SPEC_VERSION +// VK_KHR_MAINTENANCE2_EXTENSION_NAME is a deprecated alias #define VK_KHR_MAINTENANCE2_EXTENSION_NAME VK_KHR_MAINTENANCE_2_EXTENSION_NAME typedef VkPointClippingBehavior VkPointClippingBehaviorKHR; @@ -9481,7 +9936,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHR( #define VK_KHR_maintenance3 1 #define VK_KHR_MAINTENANCE_3_SPEC_VERSION 1 #define VK_KHR_MAINTENANCE_3_EXTENSION_NAME "VK_KHR_maintenance3" +// VK_KHR_MAINTENANCE3_SPEC_VERSION is a deprecated alias #define VK_KHR_MAINTENANCE3_SPEC_VERSION VK_KHR_MAINTENANCE_3_SPEC_VERSION +// VK_KHR_MAINTENANCE3_EXTENSION_NAME is a deprecated alias #define VK_KHR_MAINTENANCE3_EXTENSION_NAME VK_KHR_MAINTENANCE_3_EXTENSION_NAME typedef VkPhysicalDeviceMaintenance3Properties VkPhysicalDeviceMaintenance3PropertiesKHR; @@ -9564,9 +10021,8 @@ typedef struct VkPhysicalDeviceShaderClockFeaturesKHR { // VK_KHR_video_decode_h265 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_video_decode_h265 1 -#include "vk_video/vulkan_video_codec_h265std.h" #include "vk_video/vulkan_video_codec_h265std_decode.h" -#define VK_KHR_VIDEO_DECODE_H265_SPEC_VERSION 7 +#define VK_KHR_VIDEO_DECODE_H265_SPEC_VERSION 8 #define VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME "VK_KHR_video_decode_h265" typedef struct VkVideoDecodeH265ProfileInfoKHR { VkStructureType sType; @@ -9821,6 +10277,14 @@ typedef struct VkPhysicalDeviceFragmentShadingRateKHR { VkExtent2D fragmentSize; } VkPhysicalDeviceFragmentShadingRateKHR; +typedef struct VkRenderingFragmentShadingRateAttachmentInfoKHR { + VkStructureType sType; + const void* pNext; + VkImageView imageView; + VkImageLayout imageLayout; + VkExtent2D shadingRateAttachmentTexelSize; +} VkRenderingFragmentShadingRateAttachmentInfoKHR; + typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates); typedef void (VKAPI_PTR *PFN_vkCmdSetFragmentShadingRateKHR)(VkCommandBuffer commandBuffer, const VkExtent2D* pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); @@ -9837,6 +10301,58 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetFragmentShadingRateKHR( #endif +// VK_KHR_dynamic_rendering_local_read is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_dynamic_rendering_local_read 1 +#define VK_KHR_DYNAMIC_RENDERING_LOCAL_READ_SPEC_VERSION 1 +#define VK_KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME "VK_KHR_dynamic_rendering_local_read" +typedef struct VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 dynamicRenderingLocalRead; +} VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR; + +typedef struct VkRenderingAttachmentLocationInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t colorAttachmentCount; + const uint32_t* pColorAttachmentLocations; +} VkRenderingAttachmentLocationInfoKHR; + +typedef struct VkRenderingInputAttachmentIndexInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t colorAttachmentCount; + const uint32_t* pColorAttachmentInputIndices; + const uint32_t* pDepthInputAttachmentIndex; + const uint32_t* pStencilInputAttachmentIndex; +} VkRenderingInputAttachmentIndexInfoKHR; + +typedef void (VKAPI_PTR *PFN_vkCmdSetRenderingAttachmentLocationsKHR)(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfoKHR* pLocationInfo); +typedef void (VKAPI_PTR *PFN_vkCmdSetRenderingInputAttachmentIndicesKHR)(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfoKHR* pInputAttachmentIndexInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetRenderingAttachmentLocationsKHR( + VkCommandBuffer commandBuffer, + const VkRenderingAttachmentLocationInfoKHR* pLocationInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetRenderingInputAttachmentIndicesKHR( + VkCommandBuffer commandBuffer, + const VkRenderingInputAttachmentIndexInfoKHR* pInputAttachmentIndexInfo); +#endif + + +// VK_KHR_shader_quad_control is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_shader_quad_control 1 +#define VK_KHR_SHADER_QUAD_CONTROL_SPEC_VERSION 1 +#define VK_KHR_SHADER_QUAD_CONTROL_EXTENSION_NAME "VK_KHR_shader_quad_control" +typedef struct VkPhysicalDeviceShaderQuadControlFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 shaderQuadControl; +} VkPhysicalDeviceShaderQuadControlFeaturesKHR; + + + // VK_KHR_spirv_1_4 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_spirv_1_4 1 #define VK_KHR_SPIRV_1_4_SPEC_VERSION 1 @@ -10060,6 +10576,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineExecutableInternalRepresentationsKHR #define VK_KHR_map_memory2 1 #define VK_KHR_MAP_MEMORY_2_SPEC_VERSION 1 #define VK_KHR_MAP_MEMORY_2_EXTENSION_NAME "VK_KHR_map_memory2" + +typedef enum VkMemoryUnmapFlagBitsKHR { + VK_MEMORY_UNMAP_RESERVE_BIT_EXT = 0x00000001, + VK_MEMORY_UNMAP_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkMemoryUnmapFlagBitsKHR; typedef VkFlags VkMemoryUnmapFlagsKHR; typedef struct VkMemoryMapInfoKHR { VkStructureType sType; @@ -10140,6 +10661,179 @@ typedef struct VkPhysicalDevicePresentIdFeaturesKHR { +// VK_KHR_video_encode_queue is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_encode_queue 1 +#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 12 +#define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue" + +typedef enum VkVideoEncodeTuningModeKHR { + VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR = 0, + VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR = 1, + VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR = 2, + VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR = 3, + VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR = 4, + VK_VIDEO_ENCODE_TUNING_MODE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeTuningModeKHR; +typedef VkFlags VkVideoEncodeFlagsKHR; + +typedef enum VkVideoEncodeCapabilityFlagBitsKHR { + VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeCapabilityFlagBitsKHR; +typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; + +typedef enum VkVideoEncodeRateControlModeFlagBitsKHR { + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR = 0, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeRateControlModeFlagBitsKHR; +typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; + +typedef enum VkVideoEncodeFeedbackFlagBitsKHR { + VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_FEEDBACK_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeFeedbackFlagBitsKHR; +typedef VkFlags VkVideoEncodeFeedbackFlagsKHR; + +typedef enum VkVideoEncodeUsageFlagBitsKHR { + VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR = 0, + VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeUsageFlagBitsKHR; +typedef VkFlags VkVideoEncodeUsageFlagsKHR; + +typedef enum VkVideoEncodeContentFlagBitsKHR { + VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR = 0, + VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_CONTENT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeContentFlagBitsKHR; +typedef VkFlags VkVideoEncodeContentFlagsKHR; +typedef VkFlags VkVideoEncodeRateControlFlagsKHR; +typedef struct VkVideoEncodeInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeFlagsKHR flags; + VkBuffer dstBuffer; + VkDeviceSize dstBufferOffset; + VkDeviceSize dstBufferRange; + VkVideoPictureResourceInfoKHR srcPictureResource; + const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot; + uint32_t referenceSlotCount; + const VkVideoReferenceSlotInfoKHR* pReferenceSlots; + uint32_t precedingExternallyEncodedBytes; +} VkVideoEncodeInfoKHR; + +typedef struct VkVideoEncodeCapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeCapabilityFlagsKHR flags; + VkVideoEncodeRateControlModeFlagsKHR rateControlModes; + uint32_t maxRateControlLayers; + uint64_t maxBitrate; + uint32_t maxQualityLevels; + VkExtent2D encodeInputPictureGranularity; + VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags; +} VkVideoEncodeCapabilitiesKHR; + +typedef struct VkQueryPoolVideoEncodeFeedbackCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags; +} VkQueryPoolVideoEncodeFeedbackCreateInfoKHR; + +typedef struct VkVideoEncodeUsageInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeUsageFlagsKHR videoUsageHints; + VkVideoEncodeContentFlagsKHR videoContentHints; + VkVideoEncodeTuningModeKHR tuningMode; +} VkVideoEncodeUsageInfoKHR; + +typedef struct VkVideoEncodeRateControlLayerInfoKHR { + VkStructureType sType; + const void* pNext; + uint64_t averageBitrate; + uint64_t maxBitrate; + uint32_t frameRateNumerator; + uint32_t frameRateDenominator; +} VkVideoEncodeRateControlLayerInfoKHR; + +typedef struct VkVideoEncodeRateControlInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeRateControlFlagsKHR flags; + VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode; + uint32_t layerCount; + const VkVideoEncodeRateControlLayerInfoKHR* pLayers; + uint32_t virtualBufferSizeInMs; + uint32_t initialVirtualBufferSizeInMs; +} VkVideoEncodeRateControlInfoKHR; + +typedef struct VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR { + VkStructureType sType; + const void* pNext; + const VkVideoProfileInfoKHR* pVideoProfile; + uint32_t qualityLevel; +} VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR; + +typedef struct VkVideoEncodeQualityLevelPropertiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeRateControlModeFlagBitsKHR preferredRateControlMode; + uint32_t preferredRateControlLayerCount; +} VkVideoEncodeQualityLevelPropertiesKHR; + +typedef struct VkVideoEncodeQualityLevelInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t qualityLevel; +} VkVideoEncodeQualityLevelInfoKHR; + +typedef struct VkVideoEncodeSessionParametersGetInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoSessionParametersKHR videoSessionParameters; +} VkVideoEncodeSessionParametersGetInfoKHR; + +typedef struct VkVideoEncodeSessionParametersFeedbackInfoKHR { + VkStructureType sType; + void* pNext; + VkBool32 hasOverrides; +} VkVideoEncodeSessionParametersFeedbackInfoKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo, VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetEncodedVideoSessionParametersKHR)(VkDevice device, const VkVideoEncodeSessionParametersGetInfoKHR* pVideoSessionParametersInfo, VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo, size_t* pDataSize, void* pData); +typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo, + VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetEncodedVideoSessionParametersKHR( + VkDevice device, + const VkVideoEncodeSessionParametersGetInfoKHR* pVideoSessionParametersInfo, + VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo, + size_t* pDataSize, + void* pData); + +VKAPI_ATTR void VKAPI_CALL vkCmdEncodeVideoKHR( + VkCommandBuffer commandBuffer, + const VkVideoEncodeInfoKHR* pEncodeInfo); +#endif + + // VK_KHR_synchronization2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_synchronization2 1 #define VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION 1 @@ -10172,27 +10866,12 @@ typedef VkCommandBufferSubmitInfo VkCommandBufferSubmitInfoKHR; typedef VkPhysicalDeviceSynchronization2Features VkPhysicalDeviceSynchronization2FeaturesKHR; -typedef struct VkQueueFamilyCheckpointProperties2NV { - VkStructureType sType; - void* pNext; - VkPipelineStageFlags2 checkpointExecutionStageMask; -} VkQueueFamilyCheckpointProperties2NV; - -typedef struct VkCheckpointData2NV { - VkStructureType sType; - void* pNext; - VkPipelineStageFlags2 stage; - void* pCheckpointMarker; -} VkCheckpointData2NV; - typedef void (VKAPI_PTR *PFN_vkCmdSetEvent2KHR)(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo* pDependencyInfo); typedef void (VKAPI_PTR *PFN_vkCmdResetEvent2KHR)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask); typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents2KHR)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, const VkDependencyInfo* pDependencyInfos); typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier2KHR)(VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo); typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp2KHR)(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query); typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit2KHR)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence); -typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarker2AMD)(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); -typedef void (VKAPI_PTR *PFN_vkGetQueueCheckpointData2NV)(VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointData2NV* pCheckpointData); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent2KHR( @@ -10226,18 +10905,6 @@ VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit2KHR( uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence); - -VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarker2AMD( - VkCommandBuffer commandBuffer, - VkPipelineStageFlags2 stage, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - uint32_t marker); - -VKAPI_ATTR void VKAPI_CALL vkGetQueueCheckpointData2NV( - VkQueue queue, - uint32_t* pCheckpointDataCount, - VkCheckpointData2NV* pCheckpointData); #endif @@ -10444,6 +11111,31 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirementsKHR( #endif +// VK_KHR_shader_subgroup_rotate is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_shader_subgroup_rotate 1 +#define VK_KHR_SHADER_SUBGROUP_ROTATE_SPEC_VERSION 2 +#define VK_KHR_SHADER_SUBGROUP_ROTATE_EXTENSION_NAME "VK_KHR_shader_subgroup_rotate" +typedef struct VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 shaderSubgroupRotate; + VkBool32 shaderSubgroupRotateClustered; +} VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR; + + + +// VK_KHR_shader_maximal_reconvergence is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_shader_maximal_reconvergence 1 +#define VK_KHR_SHADER_MAXIMAL_RECONVERGENCE_SPEC_VERSION 1 +#define VK_KHR_SHADER_MAXIMAL_RECONVERGENCE_EXTENSION_NAME "VK_KHR_shader_maximal_reconvergence" +typedef struct VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 shaderMaximalReconvergence; +} VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR; + + + // VK_KHR_maintenance5 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_maintenance5 1 #define VK_KHR_MAINTENANCE_5_SPEC_VERSION 1 @@ -10455,6 +11147,10 @@ typedef VkFlags64 VkPipelineCreateFlagBits2KHR; static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT_KHR = 0x00000001ULL; static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR = 0x00000002ULL; static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR = 0x00000004ULL; +#ifdef VK_ENABLE_BETA_EXTENSIONS +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_EXECUTION_GRAPH_BIT_AMDX = 0x100000000ULL; +#endif +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x400000000ULL; static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = 0x00000008ULL; static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT_KHR = 0x00000010ULL; static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DEFER_COMPILE_BIT_NV = 0x00000020ULL; @@ -10483,6 +11179,8 @@ static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCE static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT_EXT = 0x40000000ULL; static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV = 0x10000000ULL; static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DESCRIPTOR_BUFFER_BIT_EXT = 0x20000000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR = 0x80000000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_EXT = 0x4000000000ULL; typedef VkFlags64 VkBufferUsageFlags2KHR; @@ -10497,7 +11195,9 @@ static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_STORAGE_BUFFER_BIT_KHR static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_INDEX_BUFFER_BIT_KHR = 0x00000040ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VERTEX_BUFFER_BIT_KHR = 0x00000080ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_INDIRECT_BUFFER_BIT_KHR = 0x00000100ULL; +#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_EXECUTION_GRAPH_SCRATCH_BIT_AMDX = 0x02000000ULL; +#endif static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_SHADER_BINDING_TABLE_BIT_KHR = 0x00000400ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_RAY_TRACING_BIT_NV = 0x00000400ULL; @@ -10505,12 +11205,8 @@ static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_BUFF static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_DECODE_SRC_BIT_KHR = 0x00002000ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_DECODE_DST_BIT_KHR = 0x00004000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_ENCODE_DST_BIT_KHR = 0x00008000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_ENCODE_SRC_BIT_KHR = 0x00010000ULL; -#endif static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_SHADER_DEVICE_ADDRESS_BIT_KHR = 0x00020000ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR = 0x00080000ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR = 0x00100000ULL; @@ -10519,6 +11215,7 @@ static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_RESOURCE_DESCRIPTOR_BUF static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0x04000000ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT = 0x00800000ULL; static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_MICROMAP_STORAGE_BIT_EXT = 0x01000000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_PREPROCESS_BUFFER_BIT_EXT = 0x80000000ULL; typedef struct VkPhysicalDeviceMaintenance5FeaturesKHR { VkStructureType sType; @@ -10621,6 +11318,128 @@ typedef struct VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR { +// VK_KHR_pipeline_binary is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_pipeline_binary 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineBinaryKHR) +#define VK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR 32U +#define VK_KHR_PIPELINE_BINARY_SPEC_VERSION 1 +#define VK_KHR_PIPELINE_BINARY_EXTENSION_NAME "VK_KHR_pipeline_binary" +typedef struct VkPhysicalDevicePipelineBinaryFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 pipelineBinaries; +} VkPhysicalDevicePipelineBinaryFeaturesKHR; + +typedef struct VkPhysicalDevicePipelineBinaryPropertiesKHR { + VkStructureType sType; + void* pNext; + VkBool32 pipelineBinaryInternalCache; + VkBool32 pipelineBinaryInternalCacheControl; + VkBool32 pipelineBinaryPrefersInternalCache; + VkBool32 pipelineBinaryPrecompiledInternalCache; + VkBool32 pipelineBinaryCompressedData; +} VkPhysicalDevicePipelineBinaryPropertiesKHR; + +typedef struct VkDevicePipelineBinaryInternalCacheControlKHR { + VkStructureType sType; + const void* pNext; + VkBool32 disableInternalCache; +} VkDevicePipelineBinaryInternalCacheControlKHR; + +typedef struct VkPipelineBinaryKeyKHR { + VkStructureType sType; + void* pNext; + uint32_t keySize; + uint8_t key[VK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR]; +} VkPipelineBinaryKeyKHR; + +typedef struct VkPipelineBinaryDataKHR { + size_t dataSize; + void* pData; +} VkPipelineBinaryDataKHR; + +typedef struct VkPipelineBinaryKeysAndDataKHR { + uint32_t binaryCount; + const VkPipelineBinaryKeyKHR* pPipelineBinaryKeys; + const VkPipelineBinaryDataKHR* pPipelineBinaryData; +} VkPipelineBinaryKeysAndDataKHR; + +typedef struct VkPipelineCreateInfoKHR { + VkStructureType sType; + void* pNext; +} VkPipelineCreateInfoKHR; + +typedef struct VkPipelineBinaryCreateInfoKHR { + VkStructureType sType; + const void* pNext; + const VkPipelineBinaryKeysAndDataKHR* pKeysAndDataInfo; + VkPipeline pipeline; + const VkPipelineCreateInfoKHR* pPipelineCreateInfo; +} VkPipelineBinaryCreateInfoKHR; + +typedef struct VkPipelineBinaryInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t binaryCount; + const VkPipelineBinaryKHR* pPipelineBinaries; +} VkPipelineBinaryInfoKHR; + +typedef struct VkReleaseCapturedPipelineDataInfoKHR { + VkStructureType sType; + void* pNext; + VkPipeline pipeline; +} VkReleaseCapturedPipelineDataInfoKHR; + +typedef struct VkPipelineBinaryDataInfoKHR { + VkStructureType sType; + void* pNext; + VkPipelineBinaryKHR pipelineBinary; +} VkPipelineBinaryDataInfoKHR; + +typedef struct VkPipelineBinaryHandlesInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t pipelineBinaryCount; + VkPipelineBinaryKHR* pPipelineBinaries; +} VkPipelineBinaryHandlesInfoKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineBinariesKHR)(VkDevice device, const VkPipelineBinaryCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineBinaryHandlesInfoKHR* pBinaries); +typedef void (VKAPI_PTR *PFN_vkDestroyPipelineBinaryKHR)(VkDevice device, VkPipelineBinaryKHR pipelineBinary, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineKeyKHR)(VkDevice device, const VkPipelineCreateInfoKHR* pPipelineCreateInfo, VkPipelineBinaryKeyKHR* pPipelineKey); +typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineBinaryDataKHR)(VkDevice device, const VkPipelineBinaryDataInfoKHR* pInfo, VkPipelineBinaryKeyKHR* pPipelineBinaryKey, size_t* pPipelineBinaryDataSize, void* pPipelineBinaryData); +typedef VkResult (VKAPI_PTR *PFN_vkReleaseCapturedPipelineDataKHR)(VkDevice device, const VkReleaseCapturedPipelineDataInfoKHR* pInfo, const VkAllocationCallbacks* pAllocator); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineBinariesKHR( + VkDevice device, + const VkPipelineBinaryCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkPipelineBinaryHandlesInfoKHR* pBinaries); + +VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineBinaryKHR( + VkDevice device, + VkPipelineBinaryKHR pipelineBinary, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineKeyKHR( + VkDevice device, + const VkPipelineCreateInfoKHR* pPipelineCreateInfo, + VkPipelineBinaryKeyKHR* pPipelineKey); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineBinaryDataKHR( + VkDevice device, + const VkPipelineBinaryDataInfoKHR* pInfo, + VkPipelineBinaryKeyKHR* pPipelineBinaryKey, + size_t* pPipelineBinaryDataSize, + void* pPipelineBinaryData); + +VKAPI_ATTR VkResult VKAPI_CALL vkReleaseCapturedPipelineDataKHR( + VkDevice device, + const VkReleaseCapturedPipelineDataInfoKHR* pInfo, + const VkAllocationCallbacks* pAllocator); +#endif + + // VK_KHR_cooperative_matrix is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_cooperative_matrix 1 #define VK_KHR_COOPERATIVE_MATRIX_SPEC_VERSION 2 @@ -10700,58 +11519,498 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR #endif -// VK_EXT_debug_report is a preprocessor guard. Do not pass it to API calls. -#define VK_EXT_debug_report 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) -#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 10 -#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" +// VK_KHR_compute_shader_derivatives is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_compute_shader_derivatives 1 +#define VK_KHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION 1 +#define VK_KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME "VK_KHR_compute_shader_derivatives" +typedef struct VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 computeDerivativeGroupQuads; + VkBool32 computeDerivativeGroupLinear; +} VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR; -typedef enum VkDebugReportObjectTypeEXT { - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, - VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, - VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, - VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, - VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, - VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, - VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, - VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, - VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, - VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000, - VK_DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT = 1000029000, - VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT = 1000029001, - VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT = 1000150000, - VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT = 1000165000, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT = 1000366000, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDebugReportObjectTypeEXT; +typedef struct VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR { + VkStructureType sType; + void* pNext; + VkBool32 meshAndTaskShaderDerivatives; +} VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR; + + + +// VK_KHR_video_decode_av1 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_decode_av1 1 +#include "vk_video/vulkan_video_codec_av1std.h" +#include "vk_video/vulkan_video_codec_av1std_decode.h" +#define VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR 7U +#define VK_KHR_VIDEO_DECODE_AV1_SPEC_VERSION 1 +#define VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME "VK_KHR_video_decode_av1" +typedef struct VkVideoDecodeAV1ProfileInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoAV1Profile stdProfile; + VkBool32 filmGrainSupport; +} VkVideoDecodeAV1ProfileInfoKHR; + +typedef struct VkVideoDecodeAV1CapabilitiesKHR { + VkStructureType sType; + void* pNext; + StdVideoAV1Level maxLevel; +} VkVideoDecodeAV1CapabilitiesKHR; + +typedef struct VkVideoDecodeAV1SessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoAV1SequenceHeader* pStdSequenceHeader; +} VkVideoDecodeAV1SessionParametersCreateInfoKHR; + +typedef struct VkVideoDecodeAV1PictureInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoDecodeAV1PictureInfo* pStdPictureInfo; + int32_t referenceNameSlotIndices[VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR]; + uint32_t frameHeaderOffset; + uint32_t tileCount; + const uint32_t* pTileOffsets; + const uint32_t* pTileSizes; +} VkVideoDecodeAV1PictureInfoKHR; + +typedef struct VkVideoDecodeAV1DpbSlotInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoDecodeAV1ReferenceInfo* pStdReferenceInfo; +} VkVideoDecodeAV1DpbSlotInfoKHR; + + + +// VK_KHR_video_maintenance1 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_maintenance1 1 +#define VK_KHR_VIDEO_MAINTENANCE_1_SPEC_VERSION 1 +#define VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_video_maintenance1" +typedef struct VkPhysicalDeviceVideoMaintenance1FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 videoMaintenance1; +} VkPhysicalDeviceVideoMaintenance1FeaturesKHR; + +typedef struct VkVideoInlineQueryInfoKHR { + VkStructureType sType; + const void* pNext; + VkQueryPool queryPool; + uint32_t firstQuery; + uint32_t queryCount; +} VkVideoInlineQueryInfoKHR; + + + +// VK_KHR_vertex_attribute_divisor is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_vertex_attribute_divisor 1 +#define VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 1 +#define VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_KHR_vertex_attribute_divisor" +typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t maxVertexAttribDivisor; + VkBool32 supportsNonZeroFirstInstance; +} VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR; + +typedef struct VkVertexInputBindingDivisorDescriptionKHR { + uint32_t binding; + uint32_t divisor; +} VkVertexInputBindingDivisorDescriptionKHR; + +typedef struct VkPipelineVertexInputDivisorStateCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t vertexBindingDivisorCount; + const VkVertexInputBindingDivisorDescriptionKHR* pVertexBindingDivisors; +} VkPipelineVertexInputDivisorStateCreateInfoKHR; + +typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 vertexAttributeInstanceRateDivisor; + VkBool32 vertexAttributeInstanceRateZeroDivisor; +} VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR; + + + +// VK_KHR_load_store_op_none is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_load_store_op_none 1 +#define VK_KHR_LOAD_STORE_OP_NONE_SPEC_VERSION 1 +#define VK_KHR_LOAD_STORE_OP_NONE_EXTENSION_NAME "VK_KHR_load_store_op_none" + + +// VK_KHR_shader_float_controls2 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_shader_float_controls2 1 +#define VK_KHR_SHADER_FLOAT_CONTROLS_2_SPEC_VERSION 1 +#define VK_KHR_SHADER_FLOAT_CONTROLS_2_EXTENSION_NAME "VK_KHR_shader_float_controls2" +typedef struct VkPhysicalDeviceShaderFloatControls2FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 shaderFloatControls2; +} VkPhysicalDeviceShaderFloatControls2FeaturesKHR; + + + +// VK_KHR_index_type_uint8 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_index_type_uint8 1 +#define VK_KHR_INDEX_TYPE_UINT8_SPEC_VERSION 1 +#define VK_KHR_INDEX_TYPE_UINT8_EXTENSION_NAME "VK_KHR_index_type_uint8" +typedef struct VkPhysicalDeviceIndexTypeUint8FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 indexTypeUint8; +} VkPhysicalDeviceIndexTypeUint8FeaturesKHR; + + + +// VK_KHR_line_rasterization is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_line_rasterization 1 +#define VK_KHR_LINE_RASTERIZATION_SPEC_VERSION 1 +#define VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME "VK_KHR_line_rasterization" + +typedef enum VkLineRasterizationModeKHR { + VK_LINE_RASTERIZATION_MODE_DEFAULT_KHR = 0, + VK_LINE_RASTERIZATION_MODE_RECTANGULAR_KHR = 1, + VK_LINE_RASTERIZATION_MODE_BRESENHAM_KHR = 2, + VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_KHR = 3, + VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT = VK_LINE_RASTERIZATION_MODE_DEFAULT_KHR, + VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_KHR, + VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT = VK_LINE_RASTERIZATION_MODE_BRESENHAM_KHR, + VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_KHR, + VK_LINE_RASTERIZATION_MODE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkLineRasterizationModeKHR; +typedef struct VkPhysicalDeviceLineRasterizationFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 rectangularLines; + VkBool32 bresenhamLines; + VkBool32 smoothLines; + VkBool32 stippledRectangularLines; + VkBool32 stippledBresenhamLines; + VkBool32 stippledSmoothLines; +} VkPhysicalDeviceLineRasterizationFeaturesKHR; + +typedef struct VkPhysicalDeviceLineRasterizationPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t lineSubPixelPrecisionBits; +} VkPhysicalDeviceLineRasterizationPropertiesKHR; + +typedef struct VkPipelineRasterizationLineStateCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkLineRasterizationModeKHR lineRasterizationMode; + VkBool32 stippledLineEnable; + uint32_t lineStippleFactor; + uint16_t lineStipplePattern; +} VkPipelineRasterizationLineStateCreateInfoKHR; + +typedef void (VKAPI_PTR *PFN_vkCmdSetLineStippleKHR)(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStippleKHR( + VkCommandBuffer commandBuffer, + uint32_t lineStippleFactor, + uint16_t lineStipplePattern); +#endif + + +// VK_KHR_calibrated_timestamps is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_calibrated_timestamps 1 +#define VK_KHR_CALIBRATED_TIMESTAMPS_SPEC_VERSION 1 +#define VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_KHR_calibrated_timestamps" + +typedef enum VkTimeDomainKHR { + VK_TIME_DOMAIN_DEVICE_KHR = 0, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR = 1, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR = 2, + VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR = 3, + VK_TIME_DOMAIN_DEVICE_EXT = VK_TIME_DOMAIN_DEVICE_KHR, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR, + VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR, + VK_TIME_DOMAIN_MAX_ENUM_KHR = 0x7FFFFFFF +} VkTimeDomainKHR; +typedef struct VkCalibratedTimestampInfoKHR { + VkStructureType sType; + const void* pNext; + VkTimeDomainKHR timeDomain; +} VkCalibratedTimestampInfoKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainKHR* pTimeDomains); +typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsKHR)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pTimeDomainCount, + VkTimeDomainKHR* pTimeDomains); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetCalibratedTimestampsKHR( + VkDevice device, + uint32_t timestampCount, + const VkCalibratedTimestampInfoKHR* pTimestampInfos, + uint64_t* pTimestamps, + uint64_t* pMaxDeviation); +#endif + + +// VK_KHR_shader_expect_assume is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_shader_expect_assume 1 +#define VK_KHR_SHADER_EXPECT_ASSUME_SPEC_VERSION 1 +#define VK_KHR_SHADER_EXPECT_ASSUME_EXTENSION_NAME "VK_KHR_shader_expect_assume" +typedef struct VkPhysicalDeviceShaderExpectAssumeFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 shaderExpectAssume; +} VkPhysicalDeviceShaderExpectAssumeFeaturesKHR; + + + +// VK_KHR_maintenance6 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_maintenance6 1 +#define VK_KHR_MAINTENANCE_6_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE_6_EXTENSION_NAME "VK_KHR_maintenance6" +typedef struct VkPhysicalDeviceMaintenance6FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 maintenance6; +} VkPhysicalDeviceMaintenance6FeaturesKHR; + +typedef struct VkPhysicalDeviceMaintenance6PropertiesKHR { + VkStructureType sType; + void* pNext; + VkBool32 blockTexelViewCompatibleMultipleLayers; + uint32_t maxCombinedImageSamplerDescriptorCount; + VkBool32 fragmentShadingRateClampCombinerInputs; +} VkPhysicalDeviceMaintenance6PropertiesKHR; + +typedef struct VkBindMemoryStatusKHR { + VkStructureType sType; + const void* pNext; + VkResult* pResult; +} VkBindMemoryStatusKHR; + +typedef struct VkBindDescriptorSetsInfoKHR { + VkStructureType sType; + const void* pNext; + VkShaderStageFlags stageFlags; + VkPipelineLayout layout; + uint32_t firstSet; + uint32_t descriptorSetCount; + const VkDescriptorSet* pDescriptorSets; + uint32_t dynamicOffsetCount; + const uint32_t* pDynamicOffsets; +} VkBindDescriptorSetsInfoKHR; + +typedef struct VkPushConstantsInfoKHR { + VkStructureType sType; + const void* pNext; + VkPipelineLayout layout; + VkShaderStageFlags stageFlags; + uint32_t offset; + uint32_t size; + const void* pValues; +} VkPushConstantsInfoKHR; + +typedef struct VkPushDescriptorSetInfoKHR { + VkStructureType sType; + const void* pNext; + VkShaderStageFlags stageFlags; + VkPipelineLayout layout; + uint32_t set; + uint32_t descriptorWriteCount; + const VkWriteDescriptorSet* pDescriptorWrites; +} VkPushDescriptorSetInfoKHR; + +typedef struct VkPushDescriptorSetWithTemplateInfoKHR { + VkStructureType sType; + const void* pNext; + VkDescriptorUpdateTemplate descriptorUpdateTemplate; + VkPipelineLayout layout; + uint32_t set; + const void* pData; +} VkPushDescriptorSetWithTemplateInfoKHR; + +typedef struct VkSetDescriptorBufferOffsetsInfoEXT { + VkStructureType sType; + const void* pNext; + VkShaderStageFlags stageFlags; + VkPipelineLayout layout; + uint32_t firstSet; + uint32_t setCount; + const uint32_t* pBufferIndices; + const VkDeviceSize* pOffsets; +} VkSetDescriptorBufferOffsetsInfoEXT; + +typedef struct VkBindDescriptorBufferEmbeddedSamplersInfoEXT { + VkStructureType sType; + const void* pNext; + VkShaderStageFlags stageFlags; + VkPipelineLayout layout; + uint32_t set; +} VkBindDescriptorBufferEmbeddedSamplersInfoEXT; + +typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets2KHR)(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo); +typedef void (VKAPI_PTR *PFN_vkCmdPushConstants2KHR)(VkCommandBuffer commandBuffer, const VkPushConstantsInfoKHR* pPushConstantsInfo); +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSet2KHR)(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo); +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplate2KHR)(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfoKHR* pPushDescriptorSetWithTemplateInfo); +typedef void (VKAPI_PTR *PFN_vkCmdSetDescriptorBufferOffsets2EXT)(VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo); +typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT)(VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets2KHR( + VkCommandBuffer commandBuffer, + const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants2KHR( + VkCommandBuffer commandBuffer, + const VkPushConstantsInfoKHR* pPushConstantsInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSet2KHR( + VkCommandBuffer commandBuffer, + const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate2KHR( + VkCommandBuffer commandBuffer, + const VkPushDescriptorSetWithTemplateInfoKHR* pPushDescriptorSetWithTemplateInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDescriptorBufferOffsets2EXT( + VkCommandBuffer commandBuffer, + const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorBufferEmbeddedSamplers2EXT( + VkCommandBuffer commandBuffer, + const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo); +#endif + + +// VK_KHR_shader_relaxed_extended_instruction is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_shader_relaxed_extended_instruction 1 +#define VK_KHR_SHADER_RELAXED_EXTENDED_INSTRUCTION_SPEC_VERSION 1 +#define VK_KHR_SHADER_RELAXED_EXTENDED_INSTRUCTION_EXTENSION_NAME "VK_KHR_shader_relaxed_extended_instruction" +typedef struct VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 shaderRelaxedExtendedInstruction; +} VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR; + + + +// VK_KHR_maintenance7 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_maintenance7 1 +#define VK_KHR_MAINTENANCE_7_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE_7_EXTENSION_NAME "VK_KHR_maintenance7" + +typedef enum VkPhysicalDeviceLayeredApiKHR { + VK_PHYSICAL_DEVICE_LAYERED_API_VULKAN_KHR = 0, + VK_PHYSICAL_DEVICE_LAYERED_API_D3D12_KHR = 1, + VK_PHYSICAL_DEVICE_LAYERED_API_METAL_KHR = 2, + VK_PHYSICAL_DEVICE_LAYERED_API_OPENGL_KHR = 3, + VK_PHYSICAL_DEVICE_LAYERED_API_OPENGLES_KHR = 4, + VK_PHYSICAL_DEVICE_LAYERED_API_MAX_ENUM_KHR = 0x7FFFFFFF +} VkPhysicalDeviceLayeredApiKHR; +typedef struct VkPhysicalDeviceMaintenance7FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 maintenance7; +} VkPhysicalDeviceMaintenance7FeaturesKHR; + +typedef struct VkPhysicalDeviceMaintenance7PropertiesKHR { + VkStructureType sType; + void* pNext; + VkBool32 robustFragmentShadingRateAttachmentAccess; + VkBool32 separateDepthStencilAttachmentAccess; + uint32_t maxDescriptorSetTotalUniformBuffersDynamic; + uint32_t maxDescriptorSetTotalStorageBuffersDynamic; + uint32_t maxDescriptorSetTotalBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindTotalUniformBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindTotalStorageBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindTotalBuffersDynamic; +} VkPhysicalDeviceMaintenance7PropertiesKHR; + +typedef struct VkPhysicalDeviceLayeredApiPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceLayeredApiKHR layeredAPI; + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; +} VkPhysicalDeviceLayeredApiPropertiesKHR; + +typedef struct VkPhysicalDeviceLayeredApiPropertiesListKHR { + VkStructureType sType; + void* pNext; + uint32_t layeredApiCount; + VkPhysicalDeviceLayeredApiPropertiesKHR* pLayeredApis; +} VkPhysicalDeviceLayeredApiPropertiesListKHR; + +typedef struct VkPhysicalDeviceLayeredApiVulkanPropertiesKHR { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceProperties2 properties; +} VkPhysicalDeviceLayeredApiVulkanPropertiesKHR; + + + +// VK_EXT_debug_report is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_debug_report 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) +#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 10 +#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" + +typedef enum VkDebugReportObjectTypeEXT { + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, + VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, + VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, + VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, + VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, + VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, + VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, + VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, + VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, + VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, + VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, + VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, + VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, + VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, + VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28, + VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, + VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, + VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000, + VK_DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT = 1000029000, + VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT = 1000029001, + VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT = 1000150000, + VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT = 1000165000, + VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_MODULE_NV_EXT = 1000307000, + VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_FUNCTION_NV_EXT = 1000307001, + VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT = 1000366000, + // VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT is a deprecated alias + VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, + // VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT is a deprecated alias + VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDebugReportObjectTypeEXT; typedef enum VkDebugReportFlagBitsEXT { VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001, @@ -11325,7 +12584,7 @@ typedef struct VkExportMemoryAllocateInfoNV { // VK_EXT_validation_flags is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_validation_flags 1 -#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 2 +#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 3 #define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" typedef enum VkValidationCheckEXT { @@ -11518,6 +12777,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkReleaseDisplayEXT( typedef enum VkSurfaceCounterFlagBitsEXT { VK_SURFACE_COUNTER_VBLANK_BIT_EXT = 0x00000001, + // VK_SURFACE_COUNTER_VBLANK_EXT is a deprecated alias VK_SURFACE_COUNTER_VBLANK_EXT = VK_SURFACE_COUNTER_VBLANK_BIT_EXT, VK_SURFACE_COUNTER_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF } VkSurfaceCounterFlagBitsEXT; @@ -11686,7 +12946,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPastPresentationTimingGOOGLE( #define VK_NV_viewport_array2 1 #define VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION 1 #define VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME "VK_NV_viewport_array2" +// VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION is a deprecated alias #define VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION +// VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME is a deprecated alias #define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME @@ -11700,6 +12962,13 @@ typedef struct VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { VkBool32 perViewPositionAllComponents; } VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; +typedef struct VkMultiviewPerViewAttributesInfoNVX { + VkStructureType sType; + const void* pNext; + VkBool32 perViewAttributes; + VkBool32 perViewAttributesPositionXOnly; +} VkMultiviewPerViewAttributesInfoNVX; + // VK_NV_viewport_swizzle is a preprocessor guard. Do not pass it to API calls. @@ -11841,13 +13110,13 @@ typedef struct VkPipelineRasterizationDepthClipStateCreateInfoEXT { // VK_EXT_swapchain_colorspace is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_swapchain_colorspace 1 -#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 4 +#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 5 #define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" // VK_EXT_hdr_metadata is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_hdr_metadata 1 -#define VK_EXT_HDR_METADATA_SPEC_VERSION 2 +#define VK_EXT_HDR_METADATA_SPEC_VERSION 3 #define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata" typedef struct VkXYColorEXT { float x; @@ -11878,6 +13147,18 @@ VKAPI_ATTR void VKAPI_CALL vkSetHdrMetadataEXT( #endif +// VK_IMG_relaxed_line_rasterization is a preprocessor guard. Do not pass it to API calls. +#define VK_IMG_relaxed_line_rasterization 1 +#define VK_IMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION 1 +#define VK_IMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME "VK_IMG_relaxed_line_rasterization" +typedef struct VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG { + VkStructureType sType; + void* pNext; + VkBool32 relaxedLineRasterization; +} VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG; + + + // VK_EXT_external_memory_dma_buf is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_external_memory_dma_buf 1 #define VK_EXT_EXTERNAL_MEMORY_DMA_BUF_SPEC_VERSION 1 @@ -12056,6 +13337,14 @@ typedef VkPhysicalDeviceSamplerFilterMinmaxProperties VkPhysicalDeviceSamplerFil #define VK_AMD_mixed_attachment_samples 1 #define VK_AMD_MIXED_ATTACHMENT_SAMPLES_SPEC_VERSION 1 #define VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME "VK_AMD_mixed_attachment_samples" +typedef struct VkAttachmentSampleCountInfoAMD { + VkStructureType sType; + const void* pNext; + uint32_t colorAttachmentCount; + const VkSampleCountFlagBits* pColorAttachmentSamples; + VkSampleCountFlagBits depthStencilAttachmentSamples; +} VkAttachmentSampleCountInfoAMD; + // VK_AMD_shader_fragment_mask is a preprocessor guard. Do not pass it to API calls. @@ -12235,6 +13524,8 @@ typedef struct VkPipelineCoverageModulationStateCreateInfoNV { const float* pCoverageModulationTable; } VkPipelineCoverageModulationStateCreateInfoNV; +typedef VkAttachmentSampleCountInfoAMD VkAttachmentSampleCountInfoNV; + // VK_NV_fill_rectangle is a preprocessor guard. Do not pass it to API calls. @@ -12992,6 +14283,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT( #define VK_AMD_BUFFER_MARKER_SPEC_VERSION 1 #define VK_AMD_BUFFER_MARKER_EXTENSION_NAME "VK_AMD_buffer_marker" typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarkerAMD)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); +typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarker2AMD)(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarkerAMD( @@ -13000,6 +14292,13 @@ VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarkerAMD( VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); + +VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarker2AMD( + VkCommandBuffer commandBuffer, + VkPipelineStageFlags2 stage, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + uint32_t marker); #endif @@ -13024,33 +14323,23 @@ typedef struct VkPipelineCompilerControlCreateInfoAMD { #define VK_EXT_calibrated_timestamps 1 #define VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION 2 #define VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_EXT_calibrated_timestamps" +typedef VkTimeDomainKHR VkTimeDomainEXT; -typedef enum VkTimeDomainEXT { - VK_TIME_DOMAIN_DEVICE_EXT = 0, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = 1, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = 2, - VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = 3, - VK_TIME_DOMAIN_MAX_ENUM_EXT = 0x7FFFFFFF -} VkTimeDomainEXT; -typedef struct VkCalibratedTimestampInfoEXT { - VkStructureType sType; - const void* pNext; - VkTimeDomainEXT timeDomain; -} VkCalibratedTimestampInfoEXT; +typedef VkCalibratedTimestampInfoKHR VkCalibratedTimestampInfoEXT; -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains); -typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainKHR* pTimeDomains); +typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, - VkTimeDomainEXT* pTimeDomains); + VkTimeDomainKHR* pTimeDomains); VKAPI_ATTR VkResult VKAPI_CALL vkGetCalibratedTimestampsEXT( VkDevice device, uint32_t timestampCount, - const VkCalibratedTimestampInfoEXT* pTimestampInfos, + const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); #endif @@ -13110,24 +14399,11 @@ typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT { uint32_t maxVertexAttribDivisor; } VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT; -typedef struct VkVertexInputBindingDivisorDescriptionEXT { - uint32_t binding; - uint32_t divisor; -} VkVertexInputBindingDivisorDescriptionEXT; +typedef VkVertexInputBindingDivisorDescriptionKHR VkVertexInputBindingDivisorDescriptionEXT; -typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t vertexBindingDivisorCount; - const VkVertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors; -} VkPipelineVertexInputDivisorStateCreateInfoEXT; +typedef VkPipelineVertexInputDivisorStateCreateInfoKHR VkPipelineVertexInputDivisorStateCreateInfoEXT; -typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT { - VkStructureType sType; - void* pNext; - VkBool32 vertexAttributeInstanceRateDivisor; - VkBool32 vertexAttributeInstanceRateZeroDivisor; -} VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; +typedef VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; @@ -13155,12 +14431,7 @@ typedef VkPipelineCreationFeedback VkPipelineCreationFeedbackEXT; #define VK_NV_compute_shader_derivatives 1 #define VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION 1 #define VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME "VK_NV_compute_shader_derivatives" -typedef struct VkPhysicalDeviceComputeShaderDerivativesFeaturesNV { - VkStructureType sType; - void* pNext; - VkBool32 computeDerivativeGroupQuads; - VkBool32 computeDerivativeGroupLinear; -} VkPhysicalDeviceComputeShaderDerivativesFeaturesNV; +typedef VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR VkPhysicalDeviceComputeShaderDerivativesFeaturesNV; @@ -13298,8 +14569,22 @@ typedef struct VkCheckpointDataNV { void* pCheckpointMarker; } VkCheckpointDataNV; +typedef struct VkQueueFamilyCheckpointProperties2NV { + VkStructureType sType; + void* pNext; + VkPipelineStageFlags2 checkpointExecutionStageMask; +} VkQueueFamilyCheckpointProperties2NV; + +typedef struct VkCheckpointData2NV { + VkStructureType sType; + void* pNext; + VkPipelineStageFlags2 stage; + void* pCheckpointMarker; +} VkCheckpointData2NV; + typedef void (VKAPI_PTR *PFN_vkCmdSetCheckpointNV)(VkCommandBuffer commandBuffer, const void* pCheckpointMarker); typedef void (VKAPI_PTR *PFN_vkGetQueueCheckpointDataNV)(VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData); +typedef void (VKAPI_PTR *PFN_vkGetQueueCheckpointData2NV)(VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointData2NV* pCheckpointData); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR void VKAPI_CALL vkCmdSetCheckpointNV( @@ -13310,6 +14595,11 @@ VKAPI_ATTR void VKAPI_CALL vkGetQueueCheckpointDataNV( VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData); + +VKAPI_ATTR void VKAPI_CALL vkGetQueueCheckpointData2NV( + VkQueue queue, + uint32_t* pCheckpointDataCount, + VkCheckpointData2NV* pCheckpointData); #endif @@ -13531,6 +14821,13 @@ typedef struct VkRenderPassFragmentDensityMapCreateInfoEXT { VkAttachmentReference fragmentDensityMapAttachment; } VkRenderPassFragmentDensityMapCreateInfoEXT; +typedef struct VkRenderingFragmentDensityMapAttachmentInfoEXT { + VkStructureType sType; + const void* pNext; + VkImageView imageView; + VkImageLayout imageLayout; +} VkRenderingFragmentDensityMapAttachmentInfoEXT; + // VK_EXT_scalar_block_layout is a preprocessor guard. Do not pass it to API calls. @@ -13545,7 +14842,9 @@ typedef VkPhysicalDeviceScalarBlockLayoutFeatures VkPhysicalDeviceScalarBlockLay #define VK_GOOGLE_hlsl_functionality1 1 #define VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION 1 #define VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME "VK_GOOGLE_hlsl_functionality1" +// VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION is a deprecated alias #define VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION +// VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME is a deprecated alias #define VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME @@ -13714,7 +15013,7 @@ typedef VkImageStencilUsageCreateInfo VkImageStencilUsageCreateInfoEXT; // VK_EXT_validation_features is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_validation_features 1 -#define VK_EXT_VALIDATION_FEATURES_SPEC_VERSION 5 +#define VK_EXT_VALIDATION_FEATURES_SPEC_VERSION 6 #define VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME "VK_EXT_validation_features" typedef enum VkValidationFeatureEnableEXT { @@ -13919,39 +15218,13 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateHeadlessSurfaceEXT( #define VK_EXT_line_rasterization 1 #define VK_EXT_LINE_RASTERIZATION_SPEC_VERSION 1 #define VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME "VK_EXT_line_rasterization" +typedef VkLineRasterizationModeKHR VkLineRasterizationModeEXT; -typedef enum VkLineRasterizationModeEXT { - VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT = 0, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT = 1, - VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT = 2, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT = 3, - VK_LINE_RASTERIZATION_MODE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkLineRasterizationModeEXT; -typedef struct VkPhysicalDeviceLineRasterizationFeaturesEXT { - VkStructureType sType; - void* pNext; - VkBool32 rectangularLines; - VkBool32 bresenhamLines; - VkBool32 smoothLines; - VkBool32 stippledRectangularLines; - VkBool32 stippledBresenhamLines; - VkBool32 stippledSmoothLines; -} VkPhysicalDeviceLineRasterizationFeaturesEXT; +typedef VkPhysicalDeviceLineRasterizationFeaturesKHR VkPhysicalDeviceLineRasterizationFeaturesEXT; -typedef struct VkPhysicalDeviceLineRasterizationPropertiesEXT { - VkStructureType sType; - void* pNext; - uint32_t lineSubPixelPrecisionBits; -} VkPhysicalDeviceLineRasterizationPropertiesEXT; +typedef VkPhysicalDeviceLineRasterizationPropertiesKHR VkPhysicalDeviceLineRasterizationPropertiesEXT; -typedef struct VkPipelineRasterizationLineStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkLineRasterizationModeEXT lineRasterizationMode; - VkBool32 stippledLineEnable; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; -} VkPipelineRasterizationLineStateCreateInfoEXT; +typedef VkPipelineRasterizationLineStateCreateInfoKHR VkPipelineRasterizationLineStateCreateInfoEXT; typedef void (VKAPI_PTR *PFN_vkCmdSetLineStippleEXT)(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); @@ -14007,11 +15280,7 @@ VKAPI_ATTR void VKAPI_CALL vkResetQueryPoolEXT( #define VK_EXT_index_type_uint8 1 #define VK_EXT_INDEX_TYPE_UINT8_SPEC_VERSION 1 #define VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME "VK_EXT_index_type_uint8" -typedef struct VkPhysicalDeviceIndexTypeUint8FeaturesEXT { - VkStructureType sType; - void* pNext; - VkBool32 indexTypeUint8; -} VkPhysicalDeviceIndexTypeUint8FeaturesEXT; +typedef VkPhysicalDeviceIndexTypeUint8FeaturesKHR VkPhysicalDeviceIndexTypeUint8FeaturesEXT; @@ -14239,6 +15508,32 @@ VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout2EXT( #endif +// VK_EXT_map_memory_placed is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_map_memory_placed 1 +#define VK_EXT_MAP_MEMORY_PLACED_SPEC_VERSION 1 +#define VK_EXT_MAP_MEMORY_PLACED_EXTENSION_NAME "VK_EXT_map_memory_placed" +typedef struct VkPhysicalDeviceMapMemoryPlacedFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 memoryMapPlaced; + VkBool32 memoryMapRangePlaced; + VkBool32 memoryUnmapReserve; +} VkPhysicalDeviceMapMemoryPlacedFeaturesEXT; + +typedef struct VkPhysicalDeviceMapMemoryPlacedPropertiesEXT { + VkStructureType sType; + void* pNext; + VkDeviceSize minPlacedMemoryMapAlignment; +} VkPhysicalDeviceMapMemoryPlacedPropertiesEXT; + +typedef struct VkMemoryMapPlacedInfoEXT { + VkStructureType sType; + const void* pNext; + void* pPlacedAddress; +} VkMemoryMapPlacedInfoEXT; + + + // VK_EXT_shader_atomic_float2 is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_shader_atomic_float2 1 #define VK_EXT_SHADER_ATOMIC_FLOAT_2_SPEC_VERSION 1 @@ -14601,7 +15896,7 @@ typedef VkPhysicalDeviceTexelBufferAlignmentProperties VkPhysicalDeviceTexelBuff // VK_QCOM_render_pass_transform is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_render_pass_transform 1 -#define VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION 3 +#define VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION 4 #define VK_QCOM_RENDER_PASS_TRANSFORM_EXTENSION_NAME "VK_QCOM_render_pass_transform" typedef struct VkRenderPassTransformBeginInfoQCOM { VkStructureType sType; @@ -14894,6 +16189,98 @@ typedef struct VkDeviceDiagnosticsConfigCreateInfoNV { #define VK_QCOM_RENDER_PASS_STORE_OPS_EXTENSION_NAME "VK_QCOM_render_pass_store_ops" +// VK_NV_cuda_kernel_launch is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_cuda_kernel_launch 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaModuleNV) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaFunctionNV) +#define VK_NV_CUDA_KERNEL_LAUNCH_SPEC_VERSION 2 +#define VK_NV_CUDA_KERNEL_LAUNCH_EXTENSION_NAME "VK_NV_cuda_kernel_launch" +typedef struct VkCudaModuleCreateInfoNV { + VkStructureType sType; + const void* pNext; + size_t dataSize; + const void* pData; +} VkCudaModuleCreateInfoNV; + +typedef struct VkCudaFunctionCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkCudaModuleNV module; + const char* pName; +} VkCudaFunctionCreateInfoNV; + +typedef struct VkCudaLaunchInfoNV { + VkStructureType sType; + const void* pNext; + VkCudaFunctionNV function; + uint32_t gridDimX; + uint32_t gridDimY; + uint32_t gridDimZ; + uint32_t blockDimX; + uint32_t blockDimY; + uint32_t blockDimZ; + uint32_t sharedMemBytes; + size_t paramCount; + const void* const * pParams; + size_t extraCount; + const void* const * pExtras; +} VkCudaLaunchInfoNV; + +typedef struct VkPhysicalDeviceCudaKernelLaunchFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 cudaKernelLaunchFeatures; +} VkPhysicalDeviceCudaKernelLaunchFeaturesNV; + +typedef struct VkPhysicalDeviceCudaKernelLaunchPropertiesNV { + VkStructureType sType; + void* pNext; + uint32_t computeCapabilityMinor; + uint32_t computeCapabilityMajor; +} VkPhysicalDeviceCudaKernelLaunchPropertiesNV; + +typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaModuleNV)(VkDevice device, const VkCudaModuleCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCudaModuleNV* pModule); +typedef VkResult (VKAPI_PTR *PFN_vkGetCudaModuleCacheNV)(VkDevice device, VkCudaModuleNV module, size_t* pCacheSize, void* pCacheData); +typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaFunctionNV)(VkDevice device, const VkCudaFunctionCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCudaFunctionNV* pFunction); +typedef void (VKAPI_PTR *PFN_vkDestroyCudaModuleNV)(VkDevice device, VkCudaModuleNV module, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkDestroyCudaFunctionNV)(VkDevice device, VkCudaFunctionNV function, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkCmdCudaLaunchKernelNV)(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV* pLaunchInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateCudaModuleNV( + VkDevice device, + const VkCudaModuleCreateInfoNV* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkCudaModuleNV* pModule); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetCudaModuleCacheNV( + VkDevice device, + VkCudaModuleNV module, + size_t* pCacheSize, + void* pCacheData); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateCudaFunctionNV( + VkDevice device, + const VkCudaFunctionCreateInfoNV* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkCudaFunctionNV* pFunction); + +VKAPI_ATTR void VKAPI_CALL vkDestroyCudaModuleNV( + VkDevice device, + VkCudaModuleNV module, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkDestroyCudaFunctionNV( + VkDevice device, + VkCudaFunctionNV function, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkCmdCudaLaunchKernelNV( + VkCommandBuffer commandBuffer, + const VkCudaLaunchInfoNV* pLaunchInfo); +#endif + + // VK_NV_low_latency is a preprocessor guard. Do not pass it to API calls. #define VK_NV_low_latency 1 #define VK_NV_LOW_LATENCY_SPEC_VERSION 1 @@ -14974,14 +16361,14 @@ typedef struct VkDescriptorAddressInfoEXT { typedef struct VkDescriptorBufferBindingInfoEXT { VkStructureType sType; - void* pNext; + const void* pNext; VkDeviceAddress address; VkBufferUsageFlags usage; } VkDescriptorBufferBindingInfoEXT; typedef struct VkDescriptorBufferBindingPushDescriptorBufferHandleEXT { VkStructureType sType; - void* pNext; + const void* pNext; VkBuffer buffer; } VkDescriptorBufferBindingPushDescriptorBufferHandleEXT; @@ -15349,7 +16736,7 @@ typedef struct VkPhysicalDeviceFragmentDensityMap2PropertiesEXT { // VK_QCOM_rotated_copy_commands is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_rotated_copy_commands 1 -#define VK_QCOM_ROTATED_COPY_COMMANDS_SPEC_VERSION 1 +#define VK_QCOM_ROTATED_COPY_COMMANDS_SPEC_VERSION 2 #define VK_QCOM_ROTATED_COPY_COMMANDS_EXTENSION_NAME "VK_QCOM_rotated_copy_commands" typedef struct VkCopyCommandTransformInfoQCOM { VkStructureType sType; @@ -15717,6 +17104,18 @@ typedef struct VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT { +// VK_EXT_present_mode_fifo_latest_ready is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_present_mode_fifo_latest_ready 1 +#define VK_EXT_PRESENT_MODE_FIFO_LATEST_READY_SPEC_VERSION 1 +#define VK_EXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME "VK_EXT_present_mode_fifo_latest_ready" +typedef struct VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 presentModeFifoLatestReady; +} VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT; + + + // VK_HUAWEI_subpass_shading is a preprocessor guard. Do not pass it to API calls. #define VK_HUAWEI_subpass_shading 1 #define VK_HUAWEI_SUBPASS_SHADING_SPEC_VERSION 3 @@ -15830,6 +17229,38 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelinePropertiesEXT( #endif +// VK_EXT_frame_boundary is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_frame_boundary 1 +#define VK_EXT_FRAME_BOUNDARY_SPEC_VERSION 1 +#define VK_EXT_FRAME_BOUNDARY_EXTENSION_NAME "VK_EXT_frame_boundary" + +typedef enum VkFrameBoundaryFlagBitsEXT { + VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT = 0x00000001, + VK_FRAME_BOUNDARY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkFrameBoundaryFlagBitsEXT; +typedef VkFlags VkFrameBoundaryFlagsEXT; +typedef struct VkPhysicalDeviceFrameBoundaryFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 frameBoundary; +} VkPhysicalDeviceFrameBoundaryFeaturesEXT; + +typedef struct VkFrameBoundaryEXT { + VkStructureType sType; + const void* pNext; + VkFrameBoundaryFlagsEXT flags; + uint64_t frameID; + uint32_t imageCount; + const VkImage* pImages; + uint32_t bufferCount; + const VkBuffer* pBuffers; + uint64_t tagName; + size_t tagSize; + const void* pTag; +} VkFrameBoundaryEXT; + + + // VK_EXT_multisampled_render_to_single_sampled is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_multisampled_render_to_single_sampled 1 #define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_SPEC_VERSION 1 @@ -16331,7 +17762,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetMicromapBuildSizesEXT( // VK_HUAWEI_cluster_culling_shader is a preprocessor guard. Do not pass it to API calls. #define VK_HUAWEI_cluster_culling_shader 1 -#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 2 +#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 3 #define VK_HUAWEI_CLUSTER_CULLING_SHADER_EXTENSION_NAME "VK_HUAWEI_cluster_culling_shader" typedef struct VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI { VkStructureType sType; @@ -16349,6 +17780,12 @@ typedef struct VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI { VkDeviceSize indirectBufferOffsetAlignment; } VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI; +typedef struct VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI { + VkStructureType sType; + void* pNext; + VkBool32 clusterShadingRate; +} VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI; + typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterHUAWEI)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterIndirectHUAWEI)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); @@ -16420,6 +17857,36 @@ typedef struct VkPhysicalDeviceShaderCorePropertiesARM { +// VK_ARM_scheduling_controls is a preprocessor guard. Do not pass it to API calls. +#define VK_ARM_scheduling_controls 1 +#define VK_ARM_SCHEDULING_CONTROLS_SPEC_VERSION 1 +#define VK_ARM_SCHEDULING_CONTROLS_EXTENSION_NAME "VK_ARM_scheduling_controls" +typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagsARM; + +// Flag bits for VkPhysicalDeviceSchedulingControlsFlagBitsARM +typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagBitsARM; +static const VkPhysicalDeviceSchedulingControlsFlagBitsARM VK_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_SHADER_CORE_COUNT_ARM = 0x00000001ULL; + +typedef struct VkDeviceQueueShaderCoreControlCreateInfoARM { + VkStructureType sType; + void* pNext; + uint32_t shaderCoreCount; +} VkDeviceQueueShaderCoreControlCreateInfoARM; + +typedef struct VkPhysicalDeviceSchedulingControlsFeaturesARM { + VkStructureType sType; + void* pNext; + VkBool32 schedulingControls; +} VkPhysicalDeviceSchedulingControlsFeaturesARM; + +typedef struct VkPhysicalDeviceSchedulingControlsPropertiesARM { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceSchedulingControlsFlagsARM schedulingControlsFlags; +} VkPhysicalDeviceSchedulingControlsPropertiesARM; + + + // VK_EXT_image_sliced_view_of_3d is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_image_sliced_view_of_3d 1 #define VK_EXT_IMAGE_SLICED_VIEW_OF_3D_SPEC_VERSION 1 @@ -16504,9 +17971,48 @@ typedef struct VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT { +// VK_ARM_render_pass_striped is a preprocessor guard. Do not pass it to API calls. +#define VK_ARM_render_pass_striped 1 +#define VK_ARM_RENDER_PASS_STRIPED_SPEC_VERSION 1 +#define VK_ARM_RENDER_PASS_STRIPED_EXTENSION_NAME "VK_ARM_render_pass_striped" +typedef struct VkPhysicalDeviceRenderPassStripedFeaturesARM { + VkStructureType sType; + void* pNext; + VkBool32 renderPassStriped; +} VkPhysicalDeviceRenderPassStripedFeaturesARM; + +typedef struct VkPhysicalDeviceRenderPassStripedPropertiesARM { + VkStructureType sType; + void* pNext; + VkExtent2D renderPassStripeGranularity; + uint32_t maxRenderPassStripes; +} VkPhysicalDeviceRenderPassStripedPropertiesARM; + +typedef struct VkRenderPassStripeInfoARM { + VkStructureType sType; + const void* pNext; + VkRect2D stripeArea; +} VkRenderPassStripeInfoARM; + +typedef struct VkRenderPassStripeBeginInfoARM { + VkStructureType sType; + const void* pNext; + uint32_t stripeInfoCount; + const VkRenderPassStripeInfoARM* pStripeInfos; +} VkRenderPassStripeBeginInfoARM; + +typedef struct VkRenderPassStripeSubmitInfoARM { + VkStructureType sType; + const void* pNext; + uint32_t stripeSemaphoreInfoCount; + const VkSemaphoreSubmitInfo* pStripeSemaphoreInfos; +} VkRenderPassStripeSubmitInfoARM; + + + // VK_QCOM_fragment_density_map_offset is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_fragment_density_map_offset 1 -#define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION 1 +#define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION 2 #define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME "VK_QCOM_fragment_density_map_offset" typedef struct VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM { VkStructureType sType; @@ -16742,6 +18248,26 @@ typedef struct VkPhysicalDeviceImageProcessingPropertiesQCOM { +// VK_EXT_nested_command_buffer is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_nested_command_buffer 1 +#define VK_EXT_NESTED_COMMAND_BUFFER_SPEC_VERSION 1 +#define VK_EXT_NESTED_COMMAND_BUFFER_EXTENSION_NAME "VK_EXT_nested_command_buffer" +typedef struct VkPhysicalDeviceNestedCommandBufferFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 nestedCommandBuffer; + VkBool32 nestedCommandBufferRendering; + VkBool32 nestedCommandBufferSimultaneousUse; +} VkPhysicalDeviceNestedCommandBufferFeaturesEXT; + +typedef struct VkPhysicalDeviceNestedCommandBufferPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxCommandBufferNestingLevel; +} VkPhysicalDeviceNestedCommandBufferPropertiesEXT; + + + // VK_EXT_external_memory_acquire_unmodified is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_external_memory_acquire_unmodified 1 #define VK_EXT_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_SPEC_VERSION 1 @@ -16817,7 +18343,6 @@ typedef struct VkColorBlendAdvancedEXT { VkBool32 clampResults; } VkColorBlendAdvancedEXT; -typedef void (VKAPI_PTR *PFN_vkCmdSetTessellationDomainOriginEXT)(VkCommandBuffer commandBuffer, VkTessellationDomainOrigin domainOrigin); typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClampEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 depthClampEnable); typedef void (VKAPI_PTR *PFN_vkCmdSetPolygonModeEXT)(VkCommandBuffer commandBuffer, VkPolygonMode polygonMode); typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationSamplesEXT)(VkCommandBuffer commandBuffer, VkSampleCountFlagBits rasterizationSamples); @@ -16828,6 +18353,7 @@ typedef void (VKAPI_PTR *PFN_vkCmdSetLogicOpEnableEXT)(VkCommandBuffer commandBu typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEnableEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkBool32* pColorBlendEnables); typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEquationEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendEquationEXT* pColorBlendEquations); typedef void (VKAPI_PTR *PFN_vkCmdSetColorWriteMaskEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorComponentFlags* pColorWriteMasks); +typedef void (VKAPI_PTR *PFN_vkCmdSetTessellationDomainOriginEXT)(VkCommandBuffer commandBuffer, VkTessellationDomainOrigin domainOrigin); typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationStreamEXT)(VkCommandBuffer commandBuffer, uint32_t rasterizationStream); typedef void (VKAPI_PTR *PFN_vkCmdSetConservativeRasterizationModeEXT)(VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode); typedef void (VKAPI_PTR *PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT)(VkCommandBuffer commandBuffer, float extraPrimitiveOverestimationSize); @@ -16850,10 +18376,6 @@ typedef void (VKAPI_PTR *PFN_vkCmdSetRepresentativeFragmentTestEnableNV)(VkComma typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageReductionModeNV)(VkCommandBuffer commandBuffer, VkCoverageReductionModeNV coverageReductionMode); #ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdSetTessellationDomainOriginEXT( - VkCommandBuffer commandBuffer, - VkTessellationDomainOrigin domainOrigin); - VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthClampEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthClampEnable); @@ -16901,6 +18423,10 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetColorWriteMaskEXT( uint32_t attachmentCount, const VkColorComponentFlags* pColorWriteMasks); +VKAPI_ATTR void VKAPI_CALL vkCmdSetTessellationDomainOriginEXT( + VkCommandBuffer commandBuffer, + VkTessellationDomainOrigin domainOrigin); + VKAPI_ATTR void VKAPI_CALL vkCmdSetRasterizationStreamEXT( VkCommandBuffer commandBuffer, uint32_t rasterizationStream); @@ -17069,7 +18595,7 @@ typedef struct VkDirectDriverLoadingInfoLUNARG { typedef struct VkDirectDriverLoadingListLUNARG { VkStructureType sType; - void* pNext; + const void* pNext; VkDirectDriverLoadingModeLUNARG mode; uint32_t driverCount; const VkDirectDriverLoadingInfoLUNARG* pDrivers; @@ -17297,7 +18823,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdOpticalFlowExecuteNV( // VK_EXT_legacy_dithering is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_legacy_dithering 1 -#define VK_EXT_LEGACY_DITHERING_SPEC_VERSION 1 +#define VK_EXT_LEGACY_DITHERING_SPEC_VERSION 2 #define VK_EXT_LEGACY_DITHERING_EXTENSION_NAME "VK_EXT_legacy_dithering" typedef struct VkPhysicalDeviceLegacyDitheringFeaturesEXT { VkStructureType sType; @@ -17319,6 +18845,53 @@ typedef struct VkPhysicalDevicePipelineProtectedAccessFeaturesEXT { +// VK_AMD_anti_lag is a preprocessor guard. Do not pass it to API calls. +#define VK_AMD_anti_lag 1 +#define VK_AMD_ANTI_LAG_SPEC_VERSION 1 +#define VK_AMD_ANTI_LAG_EXTENSION_NAME "VK_AMD_anti_lag" + +typedef enum VkAntiLagModeAMD { + VK_ANTI_LAG_MODE_DRIVER_CONTROL_AMD = 0, + VK_ANTI_LAG_MODE_ON_AMD = 1, + VK_ANTI_LAG_MODE_OFF_AMD = 2, + VK_ANTI_LAG_MODE_MAX_ENUM_AMD = 0x7FFFFFFF +} VkAntiLagModeAMD; + +typedef enum VkAntiLagStageAMD { + VK_ANTI_LAG_STAGE_INPUT_AMD = 0, + VK_ANTI_LAG_STAGE_PRESENT_AMD = 1, + VK_ANTI_LAG_STAGE_MAX_ENUM_AMD = 0x7FFFFFFF +} VkAntiLagStageAMD; +typedef struct VkPhysicalDeviceAntiLagFeaturesAMD { + VkStructureType sType; + void* pNext; + VkBool32 antiLag; +} VkPhysicalDeviceAntiLagFeaturesAMD; + +typedef struct VkAntiLagPresentationInfoAMD { + VkStructureType sType; + void* pNext; + VkAntiLagStageAMD stage; + uint64_t frameIndex; +} VkAntiLagPresentationInfoAMD; + +typedef struct VkAntiLagDataAMD { + VkStructureType sType; + const void* pNext; + VkAntiLagModeAMD mode; + uint32_t maxFPS; + const VkAntiLagPresentationInfoAMD* pPresentationInfo; +} VkAntiLagDataAMD; + +typedef void (VKAPI_PTR *PFN_vkAntiLagUpdateAMD)(VkDevice device, const VkAntiLagDataAMD* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkAntiLagUpdateAMD( + VkDevice device, + const VkAntiLagDataAMD* pData); +#endif + + // VK_EXT_shader_object is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_shader_object 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderEXT) @@ -17331,6 +18904,12 @@ typedef enum VkShaderCodeTypeEXT { VK_SHADER_CODE_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF } VkShaderCodeTypeEXT; +typedef enum VkDepthClampModeEXT { + VK_DEPTH_CLAMP_MODE_VIEWPORT_RANGE_EXT = 0, + VK_DEPTH_CLAMP_MODE_USER_DEFINED_RANGE_EXT = 1, + VK_DEPTH_CLAMP_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDepthClampModeEXT; + typedef enum VkShaderCreateFlagBitsEXT { VK_SHADER_CREATE_LINK_STAGE_BIT_EXT = 0x00000001, VK_SHADER_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = 0x00000002, @@ -17339,6 +18918,7 @@ typedef enum VkShaderCreateFlagBitsEXT { VK_SHADER_CREATE_DISPATCH_BASE_BIT_EXT = 0x00000010, VK_SHADER_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_EXT = 0x00000020, VK_SHADER_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00000040, + VK_SHADER_CREATE_INDIRECT_BINDABLE_BIT_EXT = 0x00000080, VK_SHADER_CREATE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF } VkShaderCreateFlagBitsEXT; typedef VkFlags VkShaderCreateFlagsEXT; @@ -17374,10 +18954,16 @@ typedef struct VkShaderCreateInfoEXT { typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkShaderRequiredSubgroupSizeCreateInfoEXT; +typedef struct VkDepthClampRangeEXT { + float minDepthClamp; + float maxDepthClamp; +} VkDepthClampRangeEXT; + typedef VkResult (VKAPI_PTR *PFN_vkCreateShadersEXT)(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkShaderEXT* pShaders); typedef void (VKAPI_PTR *PFN_vkDestroyShaderEXT)(VkDevice device, VkShaderEXT shader, const VkAllocationCallbacks* pAllocator); typedef VkResult (VKAPI_PTR *PFN_vkGetShaderBinaryDataEXT)(VkDevice device, VkShaderEXT shader, size_t* pDataSize, void* pData); typedef void (VKAPI_PTR *PFN_vkCmdBindShadersEXT)(VkCommandBuffer commandBuffer, uint32_t stageCount, const VkShaderStageFlagBits* pStages, const VkShaderEXT* pShaders); +typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClampRangeEXT)(VkCommandBuffer commandBuffer, VkDepthClampModeEXT depthClampMode, const VkDepthClampRangeEXT* pDepthClampRange); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR VkResult VKAPI_CALL vkCreateShadersEXT( @@ -17403,6 +18989,11 @@ VKAPI_ATTR void VKAPI_CALL vkCmdBindShadersEXT( uint32_t stageCount, const VkShaderStageFlagBits* pStages, const VkShaderEXT* pShaders); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthClampRangeEXT( + VkCommandBuffer commandBuffer, + VkDepthClampModeEXT depthClampMode, + const VkDepthClampRangeEXT* pDepthClampRange); #endif @@ -17496,12 +19087,83 @@ typedef struct VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV { +// VK_NV_extended_sparse_address_space is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_extended_sparse_address_space 1 +#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_SPEC_VERSION 1 +#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_EXTENSION_NAME "VK_NV_extended_sparse_address_space" +typedef struct VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 extendedSparseAddressSpace; +} VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; + +typedef struct VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV { + VkStructureType sType; + void* pNext; + VkDeviceSize extendedSparseAddressSpaceSize; + VkImageUsageFlags extendedSparseImageUsageFlags; + VkBufferUsageFlags extendedSparseBufferUsageFlags; +} VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV; + + + // VK_EXT_mutable_descriptor_type is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_mutable_descriptor_type 1 #define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1 #define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_EXT_mutable_descriptor_type" +// VK_EXT_legacy_vertex_attributes is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_legacy_vertex_attributes 1 +#define VK_EXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION 1 +#define VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME "VK_EXT_legacy_vertex_attributes" +typedef struct VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 legacyVertexAttributes; +} VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT; + +typedef struct VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT { + VkStructureType sType; + void* pNext; + VkBool32 nativeUnalignedPerformance; +} VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT; + + + +// VK_EXT_layer_settings is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_layer_settings 1 +#define VK_EXT_LAYER_SETTINGS_SPEC_VERSION 2 +#define VK_EXT_LAYER_SETTINGS_EXTENSION_NAME "VK_EXT_layer_settings" + +typedef enum VkLayerSettingTypeEXT { + VK_LAYER_SETTING_TYPE_BOOL32_EXT = 0, + VK_LAYER_SETTING_TYPE_INT32_EXT = 1, + VK_LAYER_SETTING_TYPE_INT64_EXT = 2, + VK_LAYER_SETTING_TYPE_UINT32_EXT = 3, + VK_LAYER_SETTING_TYPE_UINT64_EXT = 4, + VK_LAYER_SETTING_TYPE_FLOAT32_EXT = 5, + VK_LAYER_SETTING_TYPE_FLOAT64_EXT = 6, + VK_LAYER_SETTING_TYPE_STRING_EXT = 7, + VK_LAYER_SETTING_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkLayerSettingTypeEXT; +typedef struct VkLayerSettingEXT { + const char* pLayerName; + const char* pSettingName; + VkLayerSettingTypeEXT type; + uint32_t valueCount; + const void* pValues; +} VkLayerSettingEXT; + +typedef struct VkLayerSettingsCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t settingCount; + const VkLayerSettingEXT* pSettings; +} VkLayerSettingsCreateInfoEXT; + + + // VK_ARM_shader_core_builtins is a preprocessor guard. Do not pass it to API calls. #define VK_ARM_shader_core_builtins 1 #define VK_ARM_SHADER_CORE_BUILTINS_SPEC_VERSION 2 @@ -17546,6 +19208,138 @@ typedef struct VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT { +// VK_NV_low_latency2 is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_low_latency2 1 +#define VK_NV_LOW_LATENCY_2_SPEC_VERSION 2 +#define VK_NV_LOW_LATENCY_2_EXTENSION_NAME "VK_NV_low_latency2" + +typedef enum VkLatencyMarkerNV { + VK_LATENCY_MARKER_SIMULATION_START_NV = 0, + VK_LATENCY_MARKER_SIMULATION_END_NV = 1, + VK_LATENCY_MARKER_RENDERSUBMIT_START_NV = 2, + VK_LATENCY_MARKER_RENDERSUBMIT_END_NV = 3, + VK_LATENCY_MARKER_PRESENT_START_NV = 4, + VK_LATENCY_MARKER_PRESENT_END_NV = 5, + VK_LATENCY_MARKER_INPUT_SAMPLE_NV = 6, + VK_LATENCY_MARKER_TRIGGER_FLASH_NV = 7, + VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_START_NV = 8, + VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_END_NV = 9, + VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_START_NV = 10, + VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_END_NV = 11, + VK_LATENCY_MARKER_MAX_ENUM_NV = 0x7FFFFFFF +} VkLatencyMarkerNV; + +typedef enum VkOutOfBandQueueTypeNV { + VK_OUT_OF_BAND_QUEUE_TYPE_RENDER_NV = 0, + VK_OUT_OF_BAND_QUEUE_TYPE_PRESENT_NV = 1, + VK_OUT_OF_BAND_QUEUE_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkOutOfBandQueueTypeNV; +typedef struct VkLatencySleepModeInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 lowLatencyMode; + VkBool32 lowLatencyBoost; + uint32_t minimumIntervalUs; +} VkLatencySleepModeInfoNV; + +typedef struct VkLatencySleepInfoNV { + VkStructureType sType; + const void* pNext; + VkSemaphore signalSemaphore; + uint64_t value; +} VkLatencySleepInfoNV; + +typedef struct VkSetLatencyMarkerInfoNV { + VkStructureType sType; + const void* pNext; + uint64_t presentID; + VkLatencyMarkerNV marker; +} VkSetLatencyMarkerInfoNV; + +typedef struct VkLatencyTimingsFrameReportNV { + VkStructureType sType; + const void* pNext; + uint64_t presentID; + uint64_t inputSampleTimeUs; + uint64_t simStartTimeUs; + uint64_t simEndTimeUs; + uint64_t renderSubmitStartTimeUs; + uint64_t renderSubmitEndTimeUs; + uint64_t presentStartTimeUs; + uint64_t presentEndTimeUs; + uint64_t driverStartTimeUs; + uint64_t driverEndTimeUs; + uint64_t osRenderQueueStartTimeUs; + uint64_t osRenderQueueEndTimeUs; + uint64_t gpuRenderStartTimeUs; + uint64_t gpuRenderEndTimeUs; +} VkLatencyTimingsFrameReportNV; + +typedef struct VkGetLatencyMarkerInfoNV { + VkStructureType sType; + const void* pNext; + uint32_t timingCount; + VkLatencyTimingsFrameReportNV* pTimings; +} VkGetLatencyMarkerInfoNV; + +typedef struct VkLatencySubmissionPresentIdNV { + VkStructureType sType; + const void* pNext; + uint64_t presentID; +} VkLatencySubmissionPresentIdNV; + +typedef struct VkSwapchainLatencyCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 latencyModeEnable; +} VkSwapchainLatencyCreateInfoNV; + +typedef struct VkOutOfBandQueueTypeInfoNV { + VkStructureType sType; + const void* pNext; + VkOutOfBandQueueTypeNV queueType; +} VkOutOfBandQueueTypeInfoNV; + +typedef struct VkLatencySurfaceCapabilitiesNV { + VkStructureType sType; + const void* pNext; + uint32_t presentModeCount; + VkPresentModeKHR* pPresentModes; +} VkLatencySurfaceCapabilitiesNV; + +typedef VkResult (VKAPI_PTR *PFN_vkSetLatencySleepModeNV)(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV* pSleepModeInfo); +typedef VkResult (VKAPI_PTR *PFN_vkLatencySleepNV)(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV* pSleepInfo); +typedef void (VKAPI_PTR *PFN_vkSetLatencyMarkerNV)(VkDevice device, VkSwapchainKHR swapchain, const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo); +typedef void (VKAPI_PTR *PFN_vkGetLatencyTimingsNV)(VkDevice device, VkSwapchainKHR swapchain, VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo); +typedef void (VKAPI_PTR *PFN_vkQueueNotifyOutOfBandNV)(VkQueue queue, const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkSetLatencySleepModeNV( + VkDevice device, + VkSwapchainKHR swapchain, + const VkLatencySleepModeInfoNV* pSleepModeInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkLatencySleepNV( + VkDevice device, + VkSwapchainKHR swapchain, + const VkLatencySleepInfoNV* pSleepInfo); + +VKAPI_ATTR void VKAPI_CALL vkSetLatencyMarkerNV( + VkDevice device, + VkSwapchainKHR swapchain, + const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo); + +VKAPI_ATTR void VKAPI_CALL vkGetLatencyTimingsNV( + VkDevice device, + VkSwapchainKHR swapchain, + VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo); + +VKAPI_ATTR void VKAPI_CALL vkQueueNotifyOutOfBandNV( + VkQueue queue, + const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo); +#endif + + // VK_QCOM_multiview_per_view_render_areas is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_multiview_per_view_render_areas 1 #define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_SPEC_VERSION 1 @@ -17565,6 +19359,19 @@ typedef struct VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM { +// VK_NV_per_stage_descriptor_set is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_per_stage_descriptor_set 1 +#define VK_NV_PER_STAGE_DESCRIPTOR_SET_SPEC_VERSION 1 +#define VK_NV_PER_STAGE_DESCRIPTOR_SET_EXTENSION_NAME "VK_NV_per_stage_descriptor_set" +typedef struct VkPhysicalDevicePerStageDescriptorSetFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 perStageDescriptorSet; + VkBool32 dynamicPipelineLayout; +} VkPhysicalDevicePerStageDescriptorSetFeaturesNV; + + + // VK_QCOM_image_processing2 is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_image_processing2 1 #define VK_QCOM_IMAGE_PROCESSING_2_SPEC_VERSION 1 @@ -17678,6 +19485,24 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetAttachmentFeedbackLoopEnableEXT( #endif +// VK_MSFT_layered_driver is a preprocessor guard. Do not pass it to API calls. +#define VK_MSFT_layered_driver 1 +#define VK_MSFT_LAYERED_DRIVER_SPEC_VERSION 1 +#define VK_MSFT_LAYERED_DRIVER_EXTENSION_NAME "VK_MSFT_layered_driver" + +typedef enum VkLayeredDriverUnderlyingApiMSFT { + VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT = 0, + VK_LAYERED_DRIVER_UNDERLYING_API_D3D12_MSFT = 1, + VK_LAYERED_DRIVER_UNDERLYING_API_MAX_ENUM_MSFT = 0x7FFFFFFF +} VkLayeredDriverUnderlyingApiMSFT; +typedef struct VkPhysicalDeviceLayeredDriverPropertiesMSFT { + VkStructureType sType; + void* pNext; + VkLayeredDriverUnderlyingApiMSFT underlyingAPI; +} VkPhysicalDeviceLayeredDriverPropertiesMSFT; + + + // VK_NV_descriptor_pool_overallocation is a preprocessor guard. Do not pass it to API calls. #define VK_NV_descriptor_pool_overallocation 1 #define VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_SPEC_VERSION 1 @@ -17690,6 +19515,389 @@ typedef struct VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV { +// VK_NV_raw_access_chains is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_raw_access_chains 1 +#define VK_NV_RAW_ACCESS_CHAINS_SPEC_VERSION 1 +#define VK_NV_RAW_ACCESS_CHAINS_EXTENSION_NAME "VK_NV_raw_access_chains" +typedef struct VkPhysicalDeviceRawAccessChainsFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 shaderRawAccessChains; +} VkPhysicalDeviceRawAccessChainsFeaturesNV; + + + +// VK_NV_command_buffer_inheritance is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_command_buffer_inheritance 1 +#define VK_NV_COMMAND_BUFFER_INHERITANCE_SPEC_VERSION 1 +#define VK_NV_COMMAND_BUFFER_INHERITANCE_EXTENSION_NAME "VK_NV_command_buffer_inheritance" +typedef struct VkPhysicalDeviceCommandBufferInheritanceFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 commandBufferInheritance; +} VkPhysicalDeviceCommandBufferInheritanceFeaturesNV; + + + +// VK_NV_shader_atomic_float16_vector is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_shader_atomic_float16_vector 1 +#define VK_NV_SHADER_ATOMIC_FLOAT16_VECTOR_SPEC_VERSION 1 +#define VK_NV_SHADER_ATOMIC_FLOAT16_VECTOR_EXTENSION_NAME "VK_NV_shader_atomic_float16_vector" +typedef struct VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 shaderFloat16VectorAtomics; +} VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV; + + + +// VK_EXT_shader_replicated_composites is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_shader_replicated_composites 1 +#define VK_EXT_SHADER_REPLICATED_COMPOSITES_SPEC_VERSION 1 +#define VK_EXT_SHADER_REPLICATED_COMPOSITES_EXTENSION_NAME "VK_EXT_shader_replicated_composites" +typedef struct VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 shaderReplicatedComposites; +} VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT; + + + +// VK_NV_ray_tracing_validation is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_ray_tracing_validation 1 +#define VK_NV_RAY_TRACING_VALIDATION_SPEC_VERSION 1 +#define VK_NV_RAY_TRACING_VALIDATION_EXTENSION_NAME "VK_NV_ray_tracing_validation" +typedef struct VkPhysicalDeviceRayTracingValidationFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 rayTracingValidation; +} VkPhysicalDeviceRayTracingValidationFeaturesNV; + + + +// VK_EXT_device_generated_commands is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_device_generated_commands 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectExecutionSetEXT) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutEXT) +#define VK_EXT_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1 +#define VK_EXT_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_EXT_device_generated_commands" + +typedef enum VkIndirectExecutionSetInfoTypeEXT { + VK_INDIRECT_EXECUTION_SET_INFO_TYPE_PIPELINES_EXT = 0, + VK_INDIRECT_EXECUTION_SET_INFO_TYPE_SHADER_OBJECTS_EXT = 1, + VK_INDIRECT_EXECUTION_SET_INFO_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkIndirectExecutionSetInfoTypeEXT; + +typedef enum VkIndirectCommandsTokenTypeEXT { + VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT = 0, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_EXT = 1, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_SEQUENCE_INDEX_EXT = 2, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_EXT = 3, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_EXT = 4, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_EXT = 5, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_EXT = 6, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_COUNT_EXT = 7, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_COUNT_EXT = 8, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_EXT = 9, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV_EXT = 1000202002, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_NV_EXT = 1000202003, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_EXT = 1000328000, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_EXT = 1000328001, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_TRACE_RAYS2_EXT = 1000386004, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkIndirectCommandsTokenTypeEXT; + +typedef enum VkIndirectCommandsInputModeFlagBitsEXT { + VK_INDIRECT_COMMANDS_INPUT_MODE_VULKAN_INDEX_BUFFER_EXT = 0x00000001, + VK_INDIRECT_COMMANDS_INPUT_MODE_DXGI_INDEX_BUFFER_EXT = 0x00000002, + VK_INDIRECT_COMMANDS_INPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkIndirectCommandsInputModeFlagBitsEXT; +typedef VkFlags VkIndirectCommandsInputModeFlagsEXT; + +typedef enum VkIndirectCommandsLayoutUsageFlagBitsEXT { + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_EXT = 0x00000001, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_EXT = 0x00000002, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkIndirectCommandsLayoutUsageFlagBitsEXT; +typedef VkFlags VkIndirectCommandsLayoutUsageFlagsEXT; +typedef struct VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 deviceGeneratedCommands; + VkBool32 dynamicGeneratedPipelineLayout; +} VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT; + +typedef struct VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxIndirectPipelineCount; + uint32_t maxIndirectShaderObjectCount; + uint32_t maxIndirectSequenceCount; + uint32_t maxIndirectCommandsTokenCount; + uint32_t maxIndirectCommandsTokenOffset; + uint32_t maxIndirectCommandsIndirectStride; + VkIndirectCommandsInputModeFlagsEXT supportedIndirectCommandsInputModes; + VkShaderStageFlags supportedIndirectCommandsShaderStages; + VkShaderStageFlags supportedIndirectCommandsShaderStagesPipelineBinding; + VkShaderStageFlags supportedIndirectCommandsShaderStagesShaderBinding; + VkBool32 deviceGeneratedCommandsTransformFeedback; + VkBool32 deviceGeneratedCommandsMultiDrawIndirectCount; +} VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT; + +typedef struct VkGeneratedCommandsMemoryRequirementsInfoEXT { + VkStructureType sType; + const void* pNext; + VkIndirectExecutionSetEXT indirectExecutionSet; + VkIndirectCommandsLayoutEXT indirectCommandsLayout; + uint32_t maxSequenceCount; + uint32_t maxDrawCount; +} VkGeneratedCommandsMemoryRequirementsInfoEXT; + +typedef struct VkIndirectExecutionSetPipelineInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipeline initialPipeline; + uint32_t maxPipelineCount; +} VkIndirectExecutionSetPipelineInfoEXT; + +typedef struct VkIndirectExecutionSetShaderLayoutInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t setLayoutCount; + const VkDescriptorSetLayout* pSetLayouts; +} VkIndirectExecutionSetShaderLayoutInfoEXT; + +typedef struct VkIndirectExecutionSetShaderInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t shaderCount; + const VkShaderEXT* pInitialShaders; + const VkIndirectExecutionSetShaderLayoutInfoEXT* pSetLayoutInfos; + uint32_t maxShaderCount; + uint32_t pushConstantRangeCount; + const VkPushConstantRange* pPushConstantRanges; +} VkIndirectExecutionSetShaderInfoEXT; + +typedef union VkIndirectExecutionSetInfoEXT { + const VkIndirectExecutionSetPipelineInfoEXT* pPipelineInfo; + const VkIndirectExecutionSetShaderInfoEXT* pShaderInfo; +} VkIndirectExecutionSetInfoEXT; + +typedef struct VkIndirectExecutionSetCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkIndirectExecutionSetInfoTypeEXT type; + VkIndirectExecutionSetInfoEXT info; +} VkIndirectExecutionSetCreateInfoEXT; + +typedef struct VkGeneratedCommandsInfoEXT { + VkStructureType sType; + const void* pNext; + VkShaderStageFlags shaderStages; + VkIndirectExecutionSetEXT indirectExecutionSet; + VkIndirectCommandsLayoutEXT indirectCommandsLayout; + VkDeviceAddress indirectAddress; + VkDeviceSize indirectAddressSize; + VkDeviceAddress preprocessAddress; + VkDeviceSize preprocessSize; + uint32_t maxSequenceCount; + VkDeviceAddress sequenceCountAddress; + uint32_t maxDrawCount; +} VkGeneratedCommandsInfoEXT; + +typedef struct VkWriteIndirectExecutionSetPipelineEXT { + VkStructureType sType; + const void* pNext; + uint32_t index; + VkPipeline pipeline; +} VkWriteIndirectExecutionSetPipelineEXT; + +typedef struct VkIndirectCommandsPushConstantTokenEXT { + VkPushConstantRange updateRange; +} VkIndirectCommandsPushConstantTokenEXT; + +typedef struct VkIndirectCommandsVertexBufferTokenEXT { + uint32_t vertexBindingUnit; +} VkIndirectCommandsVertexBufferTokenEXT; + +typedef struct VkIndirectCommandsIndexBufferTokenEXT { + VkIndirectCommandsInputModeFlagBitsEXT mode; +} VkIndirectCommandsIndexBufferTokenEXT; + +typedef struct VkIndirectCommandsExecutionSetTokenEXT { + VkIndirectExecutionSetInfoTypeEXT type; + VkShaderStageFlags shaderStages; +} VkIndirectCommandsExecutionSetTokenEXT; + +typedef union VkIndirectCommandsTokenDataEXT { + const VkIndirectCommandsPushConstantTokenEXT* pPushConstant; + const VkIndirectCommandsVertexBufferTokenEXT* pVertexBuffer; + const VkIndirectCommandsIndexBufferTokenEXT* pIndexBuffer; + const VkIndirectCommandsExecutionSetTokenEXT* pExecutionSet; +} VkIndirectCommandsTokenDataEXT; + +typedef struct VkIndirectCommandsLayoutTokenEXT { + VkStructureType sType; + const void* pNext; + VkIndirectCommandsTokenTypeEXT type; + VkIndirectCommandsTokenDataEXT data; + uint32_t offset; +} VkIndirectCommandsLayoutTokenEXT; + +typedef struct VkIndirectCommandsLayoutCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkIndirectCommandsLayoutUsageFlagsEXT flags; + VkShaderStageFlags shaderStages; + uint32_t indirectStride; + VkPipelineLayout pipelineLayout; + uint32_t tokenCount; + const VkIndirectCommandsLayoutTokenEXT* pTokens; +} VkIndirectCommandsLayoutCreateInfoEXT; + +typedef struct VkDrawIndirectCountIndirectCommandEXT { + VkDeviceAddress bufferAddress; + uint32_t stride; + uint32_t commandCount; +} VkDrawIndirectCountIndirectCommandEXT; + +typedef struct VkBindVertexBufferIndirectCommandEXT { + VkDeviceAddress bufferAddress; + uint32_t size; + uint32_t stride; +} VkBindVertexBufferIndirectCommandEXT; + +typedef struct VkBindIndexBufferIndirectCommandEXT { + VkDeviceAddress bufferAddress; + uint32_t size; + VkIndexType indexType; +} VkBindIndexBufferIndirectCommandEXT; + +typedef struct VkGeneratedCommandsPipelineInfoEXT { + VkStructureType sType; + void* pNext; + VkPipeline pipeline; +} VkGeneratedCommandsPipelineInfoEXT; + +typedef struct VkGeneratedCommandsShaderInfoEXT { + VkStructureType sType; + void* pNext; + uint32_t shaderCount; + const VkShaderEXT* pShaders; +} VkGeneratedCommandsShaderInfoEXT; + +typedef struct VkWriteIndirectExecutionSetShaderEXT { + VkStructureType sType; + const void* pNext; + uint32_t index; + VkShaderEXT shader; +} VkWriteIndirectExecutionSetShaderEXT; + +typedef void (VKAPI_PTR *PFN_vkGetGeneratedCommandsMemoryRequirementsEXT)(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoEXT* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkCmdPreprocessGeneratedCommandsEXT)(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, VkCommandBuffer stateCommandBuffer); +typedef void (VKAPI_PTR *PFN_vkCmdExecuteGeneratedCommandsEXT)(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo); +typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectCommandsLayoutEXT)(VkDevice device, const VkIndirectCommandsLayoutCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutEXT* pIndirectCommandsLayout); +typedef void (VKAPI_PTR *PFN_vkDestroyIndirectCommandsLayoutEXT)(VkDevice device, VkIndirectCommandsLayoutEXT indirectCommandsLayout, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectExecutionSetEXT)(VkDevice device, const VkIndirectExecutionSetCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectExecutionSetEXT* pIndirectExecutionSet); +typedef void (VKAPI_PTR *PFN_vkDestroyIndirectExecutionSetEXT)(VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkUpdateIndirectExecutionSetPipelineEXT)(VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetPipelineEXT* pExecutionSetWrites); +typedef void (VKAPI_PTR *PFN_vkUpdateIndirectExecutionSetShaderEXT)(VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetShaderEXT* pExecutionSetWrites); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetGeneratedCommandsMemoryRequirementsEXT( + VkDevice device, + const VkGeneratedCommandsMemoryRequirementsInfoEXT* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkCmdPreprocessGeneratedCommandsEXT( + VkCommandBuffer commandBuffer, + const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, + VkCommandBuffer stateCommandBuffer); + +VKAPI_ATTR void VKAPI_CALL vkCmdExecuteGeneratedCommandsEXT( + VkCommandBuffer commandBuffer, + VkBool32 isPreprocessed, + const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutEXT( + VkDevice device, + const VkIndirectCommandsLayoutCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectCommandsLayoutEXT* pIndirectCommandsLayout); + +VKAPI_ATTR void VKAPI_CALL vkDestroyIndirectCommandsLayoutEXT( + VkDevice device, + VkIndirectCommandsLayoutEXT indirectCommandsLayout, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateIndirectExecutionSetEXT( + VkDevice device, + const VkIndirectExecutionSetCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectExecutionSetEXT* pIndirectExecutionSet); + +VKAPI_ATTR void VKAPI_CALL vkDestroyIndirectExecutionSetEXT( + VkDevice device, + VkIndirectExecutionSetEXT indirectExecutionSet, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkUpdateIndirectExecutionSetPipelineEXT( + VkDevice device, + VkIndirectExecutionSetEXT indirectExecutionSet, + uint32_t executionSetWriteCount, + const VkWriteIndirectExecutionSetPipelineEXT* pExecutionSetWrites); + +VKAPI_ATTR void VKAPI_CALL vkUpdateIndirectExecutionSetShaderEXT( + VkDevice device, + VkIndirectExecutionSetEXT indirectExecutionSet, + uint32_t executionSetWriteCount, + const VkWriteIndirectExecutionSetShaderEXT* pExecutionSetWrites); +#endif + + +// VK_MESA_image_alignment_control is a preprocessor guard. Do not pass it to API calls. +#define VK_MESA_image_alignment_control 1 +#define VK_MESA_IMAGE_ALIGNMENT_CONTROL_SPEC_VERSION 1 +#define VK_MESA_IMAGE_ALIGNMENT_CONTROL_EXTENSION_NAME "VK_MESA_image_alignment_control" +typedef struct VkPhysicalDeviceImageAlignmentControlFeaturesMESA { + VkStructureType sType; + void* pNext; + VkBool32 imageAlignmentControl; +} VkPhysicalDeviceImageAlignmentControlFeaturesMESA; + +typedef struct VkPhysicalDeviceImageAlignmentControlPropertiesMESA { + VkStructureType sType; + void* pNext; + uint32_t supportedImageAlignmentMask; +} VkPhysicalDeviceImageAlignmentControlPropertiesMESA; + +typedef struct VkImageAlignmentControlCreateInfoMESA { + VkStructureType sType; + const void* pNext; + uint32_t maximumRequestedAlignment; +} VkImageAlignmentControlCreateInfoMESA; + + + +// VK_EXT_depth_clamp_control is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_depth_clamp_control 1 +#define VK_EXT_DEPTH_CLAMP_CONTROL_SPEC_VERSION 1 +#define VK_EXT_DEPTH_CLAMP_CONTROL_EXTENSION_NAME "VK_EXT_depth_clamp_control" +typedef struct VkPhysicalDeviceDepthClampControlFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 depthClampControl; +} VkPhysicalDeviceDepthClampControlFeaturesEXT; + +typedef struct VkPipelineViewportDepthClampControlCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkDepthClampModeEXT depthClampMode; + const VkDepthClampRangeEXT* pDepthClampRange; +} VkPipelineViewportDepthClampControlCreateInfoEXT; + + + // VK_KHR_acceleration_structure is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_acceleration_structure 1 #define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 13 diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_directfb.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_directfb.h index 1f11a082..f06f80b7 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_directfb.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_directfb.h @@ -2,7 +2,7 @@ #define VULKAN_DIRECTFB_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h index 76e15648..f60907d1 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h @@ -2,7 +2,7 @@ #define VULKAN_FUCHSIA_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_ggp.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_ggp.h index 9783aa3b..0a8863a1 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_ggp.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_ggp.h @@ -2,7 +2,7 @@ #define VULKAN_GGP_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_ios.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_ios.h index 211429ff..22ed2c03 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_ios.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_ios.h @@ -2,7 +2,7 @@ #define VULKAN_IOS_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_macos.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_macos.h index c6509cc8..a7f5613a 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_macos.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_macos.h @@ -2,7 +2,7 @@ #define VULKAN_MACOS_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_metal.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_metal.h index 94563a00..89a55749 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_metal.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_metal.h @@ -2,7 +2,7 @@ #define VULKAN_METAL_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -52,28 +52,28 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT( #define VK_EXT_metal_objects 1 #ifdef __OBJC__ @protocol MTLDevice; -typedef id MTLDevice_id; +typedef __unsafe_unretained id MTLDevice_id; #else typedef void* MTLDevice_id; #endif #ifdef __OBJC__ @protocol MTLCommandQueue; -typedef id MTLCommandQueue_id; +typedef __unsafe_unretained id MTLCommandQueue_id; #else typedef void* MTLCommandQueue_id; #endif #ifdef __OBJC__ @protocol MTLBuffer; -typedef id MTLBuffer_id; +typedef __unsafe_unretained id MTLBuffer_id; #else typedef void* MTLBuffer_id; #endif #ifdef __OBJC__ @protocol MTLTexture; -typedef id MTLTexture_id; +typedef __unsafe_unretained id MTLTexture_id; #else typedef void* MTLTexture_id; #endif @@ -81,12 +81,12 @@ typedef void* MTLTexture_id; typedef struct __IOSurface* IOSurfaceRef; #ifdef __OBJC__ @protocol MTLSharedEvent; -typedef id MTLSharedEvent_id; +typedef __unsafe_unretained id MTLSharedEvent_id; #else typedef void* MTLSharedEvent_id; #endif -#define VK_EXT_METAL_OBJECTS_SPEC_VERSION 1 +#define VK_EXT_METAL_OBJECTS_SPEC_VERSION 2 #define VK_EXT_METAL_OBJECTS_EXTENSION_NAME "VK_EXT_metal_objects" typedef enum VkExportMetalObjectTypeFlagBitsEXT { diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_screen.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_screen.h index 981738f7..7e84d4d9 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_screen.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_screen.h @@ -2,7 +2,7 @@ #define VULKAN_SCREEN_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h index c9227e82..c145f4a8 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h @@ -2,7 +2,7 @@ #define VULKAN_VI_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_wayland.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_wayland.h index c93b2178..ec706a11 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_wayland.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_wayland.h @@ -2,7 +2,7 @@ #define VULKAN_WAYLAND_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_win32.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_win32.h index fae3b853..d7a0b2ba 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_win32.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_win32.h @@ -2,7 +2,7 @@ #define VULKAN_WIN32_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_xcb.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_xcb.h index de740552..cdf6b526 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_xcb.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_xcb.h @@ -2,7 +2,7 @@ #define VULKAN_XCB_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib.h index 1aa632f2..b3c3e27d 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib.h @@ -2,7 +2,7 @@ #define VULKAN_XLIB_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h b/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h index e164ffc9..8e99190b 100644 --- a/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h +++ b/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h @@ -2,7 +2,7 @@ #define VULKAN_XLIB_XRANDR_H_ 1 /* -** Copyright 2015-2023 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/bgfx/3rdparty/meshoptimizer/LICENSE.md b/bgfx/3rdparty/meshoptimizer/LICENSE.md index 962ed41f..ef9f5919 100644 --- a/bgfx/3rdparty/meshoptimizer/LICENSE.md +++ b/bgfx/3rdparty/meshoptimizer/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016-2023 Arseny Kapoulkine +Copyright (c) 2016-2024 Arseny Kapoulkine Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/bgfx/3rdparty/meshoptimizer/src/allocator.cpp b/bgfx/3rdparty/meshoptimizer/src/allocator.cpp index 072e8e51..b8cb33c2 100644 --- a/bgfx/3rdparty/meshoptimizer/src/allocator.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/allocator.cpp @@ -1,7 +1,7 @@ // This file is part of meshoptimizer library; see meshoptimizer.h for version/license details #include "meshoptimizer.h" -void meshopt_setAllocator(void* (MESHOPTIMIZER_ALLOC_CALLCONV *allocate)(size_t), void (MESHOPTIMIZER_ALLOC_CALLCONV *deallocate)(void*)) +void meshopt_setAllocator(void* (MESHOPTIMIZER_ALLOC_CALLCONV* allocate)(size_t), void (MESHOPTIMIZER_ALLOC_CALLCONV* deallocate)(void*)) { meshopt_Allocator::Storage::allocate = allocate; meshopt_Allocator::Storage::deallocate = deallocate; diff --git a/bgfx/3rdparty/meshoptimizer/src/clusterizer.cpp b/bgfx/3rdparty/meshoptimizer/src/clusterizer.cpp index c4672ad6..52fe5a36 100644 --- a/bgfx/3rdparty/meshoptimizer/src/clusterizer.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/clusterizer.cpp @@ -441,7 +441,7 @@ static size_t kdtreeBuild(size_t offset, KDNode* nodes, size_t node_count, const } // split axis is one where the variance is largest - unsigned int axis = vars[0] >= vars[1] && vars[0] >= vars[2] ? 0 : vars[1] >= vars[2] ? 1 : 2; + unsigned int axis = (vars[0] >= vars[1] && vars[0] >= vars[2]) ? 0 : (vars[1] >= vars[2] ? 1 : 2); float split = mean[axis]; size_t middle = kdtreePartition(indices, count, points, stride, axis, split); @@ -882,3 +882,93 @@ meshopt_Bounds meshopt_computeMeshletBounds(const unsigned int* meshlet_vertices return meshopt_computeClusterBounds(indices, triangle_count * 3, vertex_positions, vertex_count, vertex_positions_stride); } + +void meshopt_optimizeMeshlet(unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, size_t triangle_count, size_t vertex_count) +{ + using namespace meshopt; + + assert(triangle_count <= kMeshletMaxTriangles); + assert(vertex_count <= kMeshletMaxVertices); + + unsigned char* indices = meshlet_triangles; + unsigned int* vertices = meshlet_vertices; + + // cache tracks vertex timestamps (corresponding to triangle index! all 3 vertices are added at the same time and never removed) + unsigned char cache[kMeshletMaxVertices]; + memset(cache, 0, vertex_count); + + // note that we start from a value that means all vertices aren't in cache + unsigned char cache_last = 128; + const unsigned char cache_cutoff = 3; // 3 triangles = ~5..9 vertices depending on reuse + + for (size_t i = 0; i < triangle_count; ++i) + { + int next = -1; + int next_match = -1; + + for (size_t j = i; j < triangle_count; ++j) + { + unsigned char a = indices[j * 3 + 0], b = indices[j * 3 + 1], c = indices[j * 3 + 2]; + assert(a < vertex_count && b < vertex_count && c < vertex_count); + + // score each triangle by how many vertices are in cache + // note: the distance is computed using unsigned 8-bit values, so cache timestamp overflow is handled gracefully + int aok = (unsigned char)(cache_last - cache[a]) < cache_cutoff; + int bok = (unsigned char)(cache_last - cache[b]) < cache_cutoff; + int cok = (unsigned char)(cache_last - cache[c]) < cache_cutoff; + + if (aok + bok + cok > next_match) + { + next = (int)j; + next_match = aok + bok + cok; + + // note that we could end up with all 3 vertices in the cache, but 2 is enough for ~strip traversal + if (next_match >= 2) + break; + } + } + + assert(next >= 0); + + unsigned char a = indices[next * 3 + 0], b = indices[next * 3 + 1], c = indices[next * 3 + 2]; + + // shift triangles before the next one forward so that we always keep an ordered partition + // note: this could have swapped triangles [i] and [next] but that distorts the order and may skew the output sequence + memmove(indices + (i + 1) * 3, indices + i * 3, (next - i) * 3 * sizeof(unsigned char)); + + indices[i * 3 + 0] = a; + indices[i * 3 + 1] = b; + indices[i * 3 + 2] = c; + + // cache timestamp is the same between all vertices of each triangle to reduce overflow + cache_last++; + cache[a] = cache_last; + cache[b] = cache_last; + cache[c] = cache_last; + } + + // reorder meshlet vertices for access locality assuming index buffer is scanned sequentially + unsigned int order[kMeshletMaxVertices]; + + unsigned char remap[kMeshletMaxVertices]; + memset(remap, -1, vertex_count); + + size_t vertex_offset = 0; + + for (size_t i = 0; i < triangle_count * 3; ++i) + { + unsigned char& r = remap[indices[i]]; + + if (r == 0xff) + { + r = (unsigned char)(vertex_offset); + order[vertex_offset] = vertices[indices[i]]; + vertex_offset++; + } + + indices[i] = r; + } + + assert(vertex_offset <= vertex_count); + memcpy(vertices, order, vertex_offset * sizeof(unsigned int)); +} diff --git a/bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp b/bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp index e4495b85..b3004600 100644 --- a/bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp @@ -13,7 +13,7 @@ namespace meshopt const unsigned char kIndexHeader = 0xe0; const unsigned char kSequenceHeader = 0xd0; -static int gEncodeIndexVersion = 0; +static int gEncodeIndexVersion = 1; typedef unsigned int VertexFifo[16]; typedef unsigned int EdgeFifo[16][2]; @@ -33,7 +33,7 @@ static int rotateTriangle(unsigned int a, unsigned int b, unsigned int c, unsign { (void)a; - return (b == next) ? 1 : (c == next) ? 2 : 0; + return (b == next) ? 1 : (c == next ? 2 : 0); } static int getEdgeFifo(EdgeFifo fifo, unsigned int a, unsigned int b, unsigned int c, size_t offset) @@ -217,7 +217,7 @@ size_t meshopt_encodeIndexBuffer(unsigned char* buffer, size_t buffer_size, cons int fe = fer >> 2; int fc = getVertexFifo(vertexfifo, c, vertexfifooffset); - int fec = (fc >= 1 && fc < fecmax) ? fc : (c == next) ? (next++, 0) : 15; + int fec = (fc >= 1 && fc < fecmax) ? fc : (c == next ? (next++, 0) : 15); if (fec == 15 && version >= 1) { @@ -267,8 +267,8 @@ size_t meshopt_encodeIndexBuffer(unsigned char* buffer, size_t buffer_size, cons // after rotation, a is almost always equal to next, so we don't waste bits on FIFO encoding for a int fea = (a == next) ? (next++, 0) : 15; - int feb = (fb >= 0 && fb < 14) ? (fb + 1) : (b == next) ? (next++, 0) : 15; - int fec = (fc >= 0 && fc < 14) ? (fc + 1) : (c == next) ? (next++, 0) : 15; + int feb = (fb >= 0 && fb < 14) ? fb + 1 : (b == next ? (next++, 0) : 15); + int fec = (fc >= 0 && fc < 14) ? fc + 1 : (c == next ? (next++, 0) : 15); // we encode feb & fec in 4 bits using a table if possible, and as a full byte otherwise unsigned char codeaux = (unsigned char)((feb << 4) | fec); diff --git a/bgfx/3rdparty/meshoptimizer/src/indexgenerator.cpp b/bgfx/3rdparty/meshoptimizer/src/indexgenerator.cpp index a9d57fb2..0d53020e 100644 --- a/bgfx/3rdparty/meshoptimizer/src/indexgenerator.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/indexgenerator.cpp @@ -6,6 +6,7 @@ // This work is based on: // John McDonald, Mark Kilgard. Crack-Free Point-Normal Triangles using Adjacent Edge Normals. 2010 +// John Hable. Variable Rate Shading with Visibility Buffer Rendering. 2024 namespace meshopt { @@ -157,7 +158,7 @@ static T* hashLookup(T* table, size_t buckets, const Hash& hash, const T& key, c } assert(false && "Hash table is full"); // unreachable - return 0; + return NULL; } static void buildPositionRemap(unsigned int* remap, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, meshopt_Allocator& allocator) @@ -576,3 +577,99 @@ void meshopt_generateTessellationIndexBuffer(unsigned int* destination, const un memcpy(destination + i * 4, patch, sizeof(patch)); } } + +size_t meshopt_generateProvokingIndexBuffer(unsigned int* destination, unsigned int* reorder, const unsigned int* indices, size_t index_count, size_t vertex_count) +{ + assert(index_count % 3 == 0); + + meshopt_Allocator allocator; + + unsigned int* remap = allocator.allocate(vertex_count); + memset(remap, -1, vertex_count * sizeof(unsigned int)); + + // compute vertex valence; this is used to prioritize least used corner + // note: we use 8-bit counters for performance; for outlier vertices the valence is incorrect but that just affects the heuristic + unsigned char* valence = allocator.allocate(vertex_count); + memset(valence, 0, vertex_count); + + for (size_t i = 0; i < index_count; ++i) + { + unsigned int index = indices[i]; + assert(index < vertex_count); + + valence[index]++; + } + + unsigned int reorder_offset = 0; + + // assign provoking vertices; leave the rest for the next pass + for (size_t i = 0; i < index_count; i += 3) + { + unsigned int a = indices[i + 0], b = indices[i + 1], c = indices[i + 2]; + assert(a < vertex_count && b < vertex_count && c < vertex_count); + + // try to rotate triangle such that provoking vertex hasn't been seen before + // if multiple vertices are new, prioritize the one with least valence + // this reduces the risk that a future triangle will have all three vertices seen + unsigned int va = remap[a] == ~0u ? valence[a] : ~0u; + unsigned int vb = remap[b] == ~0u ? valence[b] : ~0u; + unsigned int vc = remap[c] == ~0u ? valence[c] : ~0u; + + if (vb != ~0u && vb <= va && vb <= vc) + { + // abc -> bca + unsigned int t = a; + a = b, b = c, c = t; + } + else if (vc != ~0u && vc <= va && vc <= vb) + { + // abc -> cab + unsigned int t = c; + c = b, b = a, a = t; + } + + unsigned int newidx = reorder_offset; + + // now remap[a] = ~0u or all three vertices are old + // recording remap[a] makes it possible to remap future references to the same index, conserving space + if (remap[a] == ~0u) + remap[a] = newidx; + + // we need to clone the provoking vertex to get a unique index + // if all three are used the choice is arbitrary since no future triangle will be able to reuse any of these + reorder[reorder_offset++] = a; + + // note: first vertex is final, the other two will be fixed up in next pass + destination[i + 0] = newidx; + destination[i + 1] = b; + destination[i + 2] = c; + + // update vertex valences for corner heuristic + valence[a]--; + valence[b]--; + valence[c]--; + } + + // remap or clone non-provoking vertices (iterating to skip provoking vertices) + int step = 1; + + for (size_t i = 1; i < index_count; i += step, step ^= 3) + { + unsigned int index = destination[i]; + + if (remap[index] == ~0u) + { + // we haven't seen the vertex before as a provoking vertex + // to maintain the reference to the original vertex we need to clone it + unsigned int newidx = reorder_offset; + + remap[index] = newidx; + reorder[reorder_offset++] = index; + } + + destination[i] = remap[index]; + } + + assert(reorder_offset <= vertex_count + index_count / 3); + return reorder_offset; +} diff --git a/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h b/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h index b763148a..abf39893 100644 --- a/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h +++ b/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h @@ -1,7 +1,7 @@ /** - * meshoptimizer - version 0.19 + * meshoptimizer - version 0.21 * - * Copyright (C) 2016-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) + * Copyright (C) 2016-2024, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) * Report bugs and download new versions at https://github.com/zeux/meshoptimizer * * This library is distributed under the MIT License. See notice at the end of this file. @@ -12,7 +12,7 @@ #include /* Version macro; major * 1000 + minor * 10 + patch */ -#define MESHOPTIMIZER_VERSION 190 /* 0.19 */ +#define MESHOPTIMIZER_VERSION 210 /* 0.21 */ /* If no API is defined, assume default */ #ifndef MESHOPTIMIZER_API @@ -29,11 +29,14 @@ #endif /* Experimental APIs have unstable interface and might have implementation that's not fully tested or optimized */ +#ifndef MESHOPTIMIZER_EXPERIMENTAL #define MESHOPTIMIZER_EXPERIMENTAL MESHOPTIMIZER_API +#endif /* C interface */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /** @@ -67,6 +70,7 @@ MESHOPTIMIZER_API size_t meshopt_generateVertexRemap(unsigned int* destination, * * destination must contain enough space for the resulting remap table (vertex_count elements) * indices can be NULL if the input is unindexed + * stream_count must be <= 16 */ MESHOPTIMIZER_API size_t meshopt_generateVertexRemapMulti(unsigned int* destination, const unsigned int* indices, size_t index_count, size_t vertex_count, const struct meshopt_Stream* streams, size_t stream_count); @@ -103,6 +107,7 @@ MESHOPTIMIZER_API void meshopt_generateShadowIndexBuffer(unsigned int* destinati * Note that binary equivalence considers all size bytes in each stream, including padding which should be zero-initialized. * * destination must contain enough space for the resulting index buffer (index_count elements) + * stream_count must be <= 16 */ MESHOPTIMIZER_API void meshopt_generateShadowIndexBufferMulti(unsigned int* destination, const unsigned int* indices, size_t index_count, size_t vertex_count, const struct meshopt_Stream* streams, size_t stream_count); @@ -135,6 +140,19 @@ MESHOPTIMIZER_API void meshopt_generateAdjacencyIndexBuffer(unsigned int* destin */ MESHOPTIMIZER_API void meshopt_generateTessellationIndexBuffer(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride); +/** + * Experimental: Generate index buffer that can be used for visibility buffer rendering and returns the size of the reorder table + * Each triangle's provoking vertex index is equal to primitive id; this allows passing it to the fragment shader using nointerpolate attribute. + * This is important for performance on hardware where primitive id can't be accessed efficiently in fragment shader. + * The reorder table stores the original vertex id for each vertex in the new index buffer, and should be used in the vertex shader to load vertex data. + * The provoking vertex is assumed to be the first vertex in the triangle; if this is not the case (OpenGL), rotate each triangle (abc -> bca) before rendering. + * For maximum efficiency the input index buffer should be optimized for vertex cache first. + * + * destination must contain enough space for the resulting index buffer (index_count elements) + * reorder must contain enough space for the worst case reorder table (vertex_count + index_count/3 elements) + */ +MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_generateProvokingIndexBuffer(unsigned int* destination, unsigned int* reorder, const unsigned int* indices, size_t index_count, size_t vertex_count); + /** * Vertex transform cache optimizer * Reorders indices to reduce the number of GPU vertex shader invocations @@ -252,6 +270,7 @@ MESHOPTIMIZER_API int meshopt_decodeIndexSequence(void* destination, size_t inde * Returns encoded data size on success, 0 on error; the only error condition is if buffer doesn't have enough space * This function works for a single vertex stream; for multiple vertex streams, call meshopt_encodeVertexBuffer for each stream. * Note that all vertex_size bytes of each vertex are encoded verbatim, including padding which should be zero-initialized. + * For maximum efficiency the vertex buffer being encoded has to be quantized and optimized for locality of reference (cache/fetch) first. * * buffer must contain enough space for the encoded vertex buffer (use meshopt_encodeVertexBufferBound to compute worst case size) */ @@ -309,12 +328,14 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_decodeFilterExp(void* buffer, size_t cou */ enum meshopt_EncodeExpMode { - /* When encoding exponents, use separate values for each component (maximum quality) */ - meshopt_EncodeExpSeparate, - /* When encoding exponents, use shared value for all components of each vector (better compression) */ - meshopt_EncodeExpSharedVector, - /* When encoding exponents, use shared value for each component of all vectors (best compression) */ - meshopt_EncodeExpSharedComponent, + /* When encoding exponents, use separate values for each component (maximum quality) */ + meshopt_EncodeExpSeparate, + /* When encoding exponents, use shared value for all components of each vector (better compression) */ + meshopt_EncodeExpSharedVector, + /* When encoding exponents, use shared value for each component of all vectors (best compression) */ + meshopt_EncodeExpSharedComponent, + /* When encoding exponents, use separate values for each component, but clamp to 0 (good quality if very small values are not important) */ + meshopt_EncodeExpClamped, }; MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterOct(void* destination, size_t count, size_t stride, int bits, const float* data); @@ -326,15 +347,21 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterExp(void* destination, size_ */ enum { - /* Do not move vertices that are located on the topological border (vertices on triangle edges that don't have a paired triangle). Useful for simplifying portions of the larger mesh. */ - meshopt_SimplifyLockBorder = 1 << 0, + /* Do not move vertices that are located on the topological border (vertices on triangle edges that don't have a paired triangle). Useful for simplifying portions of the larger mesh. */ + meshopt_SimplifyLockBorder = 1 << 0, + /* Improve simplification performance assuming input indices are a sparse subset of the mesh. Note that error becomes relative to subset extents. */ + meshopt_SimplifySparse = 1 << 1, + /* Treat error limit and resulting error as absolute instead of relative to mesh extents. */ + meshopt_SimplifyErrorAbsolute = 1 << 2, + /* Experimental: remove disconnected parts of the mesh during simplification incrementally, regardless of the topological restrictions inside components. */ + meshopt_SimplifyPrune = 1 << 3, }; /** * Mesh simplifier * Reduces the number of triangles in the mesh, attempting to preserve mesh appearance as much as possible * The algorithm tries to preserve mesh topology and can stop short of the target goal based on topology constraints or target error. - * If not all attributes from the input mesh are required, it's recommended to reindex the mesh using meshopt_generateShadowIndexBuffer prior to simplification. + * If not all attributes from the input mesh are required, it's recommended to reindex the mesh without them prior to simplification. * Returns the number of indices after simplification, with destination containing new index data * The resulting index buffer references vertices from the original vertex buffer. * If the original vertex data isn't required, creating a compact vertex buffer using meshopt_optimizeVertexFetch is recommended. @@ -349,14 +376,15 @@ MESHOPTIMIZER_API size_t meshopt_simplify(unsigned int* destination, const unsig /** * Experimental: Mesh simplifier with attribute metric - * The algorithm ehnahces meshopt_simplify by incorporating attribute values into the error metric used to prioritize simplification order; see meshopt_simplify documentation for details. + * The algorithm enhances meshopt_simplify by incorporating attribute values into the error metric used to prioritize simplification order; see meshopt_simplify documentation for details. * Note that the number of attributes affects memory requirements and running time; this algorithm requires ~1.5x more memory and time compared to meshopt_simplify when using 4 scalar attributes. * * vertex_attributes should have attribute_count floats for each vertex - * attribute_weights should have attribute_count floats in total; the weights determine relative priority of attributes between each other and wrt position. The recommended weight range is [1e-3..1e-1], assuming attribute data is in [0..1] range. - * TODO target_error/result_error currently use combined distance+attribute error; this may change in the future + * attribute_weights should have attribute_count floats in total; the weights determine relative priority of attributes between each other and wrt position + * attribute_count must be <= 32 + * vertex_lock can be NULL; when it's not NULL, it should have a value for each vertex; 1 denotes vertices that can't be moved */ -MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* result_error); +MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, const unsigned char* vertex_lock, size_t target_index_count, float target_error, unsigned int options, float* result_error); /** * Experimental: Mesh simplifier (sloppy) @@ -382,8 +410,10 @@ MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifySloppy(unsigned int* destinati * * destination must contain enough space for the target index buffer (target_vertex_count elements) * vertex_positions should have float3 position in the first 12 bytes of each vertex + * vertex_colors should can be NULL; when it's not NULL, it should have float3 color in the first 12 bytes of each vertex + * color_weight determines relative priority of color wrt position; 1.0 is a safe default */ -MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_vertex_count); +MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_colors, size_t vertex_colors_stride, float color_weight, size_t target_vertex_count); /** * Returns the error scaling factor used by the simplifier to convert between absolute and relative extents @@ -460,6 +490,13 @@ struct meshopt_VertexFetchStatistics */ MESHOPTIMIZER_API struct meshopt_VertexFetchStatistics meshopt_analyzeVertexFetch(const unsigned int* indices, size_t index_count, size_t vertex_count, size_t vertex_size); +/** + * Meshlet is a small mesh cluster (subset) that consists of: + * - triangles, an 8-bit micro triangle (index) buffer, that for each triangle specifies three local vertices to use; + * - vertices, a 32-bit vertex indirection buffer, that for each local vertex specifies which mesh vertex to fetch vertex attributes from. + * + * For efficiency, meshlet triangles and vertices are packed into two large arrays; this structure contains offsets and counts to access the data. + */ struct meshopt_Meshlet { /* offsets within meshlet_vertices and meshlet_triangles arrays with meshlet data */ @@ -475,6 +512,7 @@ struct meshopt_Meshlet * Meshlet builder * Splits the mesh into a set of meshlets where each meshlet has a micro index buffer indexing into meshlet vertices that refer to the original vertex buffer * The resulting data can be used to render meshes using NVidia programmable mesh shading pipeline, or in other cluster-based renderers. + * When targeting mesh shading hardware, for maximum efficiency meshlets should be further optimized using meshopt_optimizeMeshlet. * When using buildMeshlets, vertex positions need to be provided to minimize the size of the resulting clusters. * When using buildMeshletsScan, for maximum efficiency the index buffer being converted has to be optimized for vertex cache first. * @@ -482,13 +520,23 @@ struct meshopt_Meshlet * meshlet_vertices must contain enough space for all meshlets, worst case size is equal to max_meshlets * max_vertices * meshlet_triangles must contain enough space for all meshlets, worst case size is equal to max_meshlets * max_triangles * 3 * vertex_positions should have float3 position in the first 12 bytes of each vertex - * max_vertices and max_triangles must not exceed implementation limits (max_vertices <= 255 - not 256!, max_triangles <= 512) + * max_vertices and max_triangles must not exceed implementation limits (max_vertices <= 255 - not 256!, max_triangles <= 512; max_triangles must be divisible by 4) * cone_weight should be set to 0 when cone culling is not used, and a value between 0 and 1 otherwise to balance between cluster size and cone culling efficiency */ MESHOPTIMIZER_API size_t meshopt_buildMeshlets(struct meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t max_vertices, size_t max_triangles, float cone_weight); MESHOPTIMIZER_API size_t meshopt_buildMeshletsScan(struct meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const unsigned int* indices, size_t index_count, size_t vertex_count, size_t max_vertices, size_t max_triangles); MESHOPTIMIZER_API size_t meshopt_buildMeshletsBound(size_t index_count, size_t max_vertices, size_t max_triangles); +/** + * Experimental: Meshlet optimizer + * Reorders meshlet vertices and triangles to maximize locality to improve rasterizer throughput + * + * meshlet_triangles and meshlet_vertices must refer to meshlet triangle and vertex index data; when buildMeshlets* is used, these + * need to be computed from meshlet's vertex_offset and triangle_offset + * triangle_count and vertex_count must not exceed implementation limits (vertex_count <= 255 - not 256!, triangle_count <= 512) + */ +MESHOPTIMIZER_EXPERIMENTAL void meshopt_optimizeMeshlet(unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, size_t triangle_count, size_t vertex_count); + struct meshopt_Bounds { /* bounding sphere, useful for frustum and occlusion culling */ @@ -525,19 +573,21 @@ struct meshopt_Bounds * Real-Time Rendering 4th Edition, section 19.3). * * vertex_positions should have float3 position in the first 12 bytes of each vertex - * index_count/3 should be less than or equal to 512 (the function assumes clusters of limited size) + * vertex_count should specify the number of vertices in the entire mesh, not cluster or meshlet + * index_count/3 and triangle_count must not exceed implementation limits (<= 512) */ MESHOPTIMIZER_API struct meshopt_Bounds meshopt_computeClusterBounds(const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride); MESHOPTIMIZER_API struct meshopt_Bounds meshopt_computeMeshletBounds(const unsigned int* meshlet_vertices, const unsigned char* meshlet_triangles, size_t triangle_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride); /** - * Experimental: Spatial sorter + * Spatial sorter * Generates a remap table that can be used to reorder points for spatial locality. * Resulting remap table maps old vertices to new vertices and can be used in meshopt_remapVertexBuffer. * * destination must contain enough space for the resulting remap table (vertex_count elements) + * vertex_positions should have float3 position in the first 12 bytes of each vertex */ -MESHOPTIMIZER_EXPERIMENTAL void meshopt_spatialSortRemap(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride); +MESHOPTIMIZER_API void meshopt_spatialSortRemap(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride); /** * Experimental: Spatial sorter @@ -554,7 +604,7 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_spatialSortTriangles(unsigned int* desti * Note that all algorithms only allocate memory for temporary use. * allocate/deallocate are always called in a stack-like order - last pointer to be allocated is deallocated first. */ -MESHOPTIMIZER_API void meshopt_setAllocator(void* (MESHOPTIMIZER_ALLOC_CALLCONV *allocate)(size_t), void (MESHOPTIMIZER_ALLOC_CALLCONV *deallocate)(void*)); +MESHOPTIMIZER_API void meshopt_setAllocator(void* (MESHOPTIMIZER_ALLOC_CALLCONV* allocate)(size_t), void (MESHOPTIMIZER_ALLOC_CALLCONV* deallocate)(void*)); #ifdef __cplusplus } /* extern "C" */ @@ -622,6 +672,8 @@ inline void meshopt_generateAdjacencyIndexBuffer(T* destination, const T* indice template inline void meshopt_generateTessellationIndexBuffer(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride); template +inline size_t meshopt_generateProvokingIndexBuffer(T* destination, unsigned int* reorder, const T* indices, size_t index_count, size_t vertex_count); +template inline void meshopt_optimizeVertexCache(T* destination, const T* indices, size_t index_count, size_t vertex_count); template inline void meshopt_optimizeVertexCacheStrip(T* destination, const T* indices, size_t index_count, size_t vertex_count); @@ -642,11 +694,11 @@ inline size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_s template inline int meshopt_decodeIndexSequence(T* destination, size_t index_count, const unsigned char* buffer, size_t buffer_size); template -inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = 0); +inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = NULL); template -inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = 0); +inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, const unsigned char* vertex_lock, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = NULL); template -inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error = 0); +inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error = NULL); template inline size_t meshopt_stripify(T* destination, const T* indices, size_t index_count, size_t vertex_count, T restart_index); template @@ -700,15 +752,15 @@ class meshopt_Allocator template struct StorageT { - static void* (MESHOPTIMIZER_ALLOC_CALLCONV *allocate)(size_t); - static void (MESHOPTIMIZER_ALLOC_CALLCONV *deallocate)(void*); + static void* (MESHOPTIMIZER_ALLOC_CALLCONV* allocate)(size_t); + static void (MESHOPTIMIZER_ALLOC_CALLCONV* deallocate)(void*); }; typedef StorageT Storage; meshopt_Allocator() - : blocks() - , count(0) + : blocks() + , count(0) { } @@ -718,7 +770,8 @@ class meshopt_Allocator Storage::deallocate(blocks[i - 1]); } - template T* allocate(size_t size) + template + T* allocate(size_t size) { assert(count < sizeof(blocks) / sizeof(blocks[0])); T* result = static_cast(Storage::allocate(size > size_t(-1) / sizeof(T) ? size_t(-1) : size * sizeof(T))); @@ -739,8 +792,10 @@ class meshopt_Allocator }; // This makes sure that allocate/deallocate are lazily generated in translation units that need them and are deduplicated by the linker -template void* (MESHOPTIMIZER_ALLOC_CALLCONV *meshopt_Allocator::StorageT::allocate)(size_t) = operator new; -template void (MESHOPTIMIZER_ALLOC_CALLCONV *meshopt_Allocator::StorageT::deallocate)(void*) = operator delete; +template +void* (MESHOPTIMIZER_ALLOC_CALLCONV* meshopt_Allocator::StorageT::allocate)(size_t) = operator new; +template +void (MESHOPTIMIZER_ALLOC_CALLCONV* meshopt_Allocator::StorageT::deallocate)(void*) = operator delete; #endif /* Inline implementation for C++ templated wrappers */ @@ -757,7 +812,7 @@ struct meshopt_IndexAdapter meshopt_IndexAdapter(T* result_, const T* input, size_t count_) : result(result_) - , data(0) + , data(NULL) , count(count_) { size_t size = count > size_t(-1) / sizeof(unsigned int) ? size_t(-1) : count * sizeof(unsigned int); @@ -797,33 +852,33 @@ struct meshopt_IndexAdapter template inline size_t meshopt_generateVertexRemap(unsigned int* destination, const T* indices, size_t index_count, const void* vertices, size_t vertex_count, size_t vertex_size) { - meshopt_IndexAdapter in(0, indices, indices ? index_count : 0); + meshopt_IndexAdapter in(NULL, indices, indices ? index_count : 0); - return meshopt_generateVertexRemap(destination, indices ? in.data : 0, index_count, vertices, vertex_count, vertex_size); + return meshopt_generateVertexRemap(destination, indices ? in.data : NULL, index_count, vertices, vertex_count, vertex_size); } template inline size_t meshopt_generateVertexRemapMulti(unsigned int* destination, const T* indices, size_t index_count, size_t vertex_count, const meshopt_Stream* streams, size_t stream_count) { - meshopt_IndexAdapter in(0, indices, indices ? index_count : 0); + meshopt_IndexAdapter in(NULL, indices, indices ? index_count : 0); - return meshopt_generateVertexRemapMulti(destination, indices ? in.data : 0, index_count, vertex_count, streams, stream_count); + return meshopt_generateVertexRemapMulti(destination, indices ? in.data : NULL, index_count, vertex_count, streams, stream_count); } template inline void meshopt_remapIndexBuffer(T* destination, const T* indices, size_t index_count, const unsigned int* remap) { - meshopt_IndexAdapter in(0, indices, indices ? index_count : 0); + meshopt_IndexAdapter in(NULL, indices, indices ? index_count : 0); meshopt_IndexAdapter out(destination, 0, index_count); - meshopt_remapIndexBuffer(out.data, indices ? in.data : 0, index_count, remap); + meshopt_remapIndexBuffer(out.data, indices ? in.data : NULL, index_count, remap); } template inline void meshopt_generateShadowIndexBuffer(T* destination, const T* indices, size_t index_count, const void* vertices, size_t vertex_count, size_t vertex_size, size_t vertex_stride) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); meshopt_generateShadowIndexBuffer(out.data, in.data, index_count, vertices, vertex_count, vertex_size, vertex_stride); } @@ -831,8 +886,8 @@ inline void meshopt_generateShadowIndexBuffer(T* destination, const T* indices, template inline void meshopt_generateShadowIndexBufferMulti(T* destination, const T* indices, size_t index_count, size_t vertex_count, const meshopt_Stream* streams, size_t stream_count) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); meshopt_generateShadowIndexBufferMulti(out.data, in.data, index_count, vertex_count, streams, stream_count); } @@ -840,8 +895,8 @@ inline void meshopt_generateShadowIndexBufferMulti(T* destination, const T* indi template inline void meshopt_generateAdjacencyIndexBuffer(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count * 2); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count * 2); meshopt_generateAdjacencyIndexBuffer(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } @@ -849,17 +904,30 @@ inline void meshopt_generateAdjacencyIndexBuffer(T* destination, const T* indice template inline void meshopt_generateTessellationIndexBuffer(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count * 4); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count * 4); meshopt_generateTessellationIndexBuffer(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } +template +inline size_t meshopt_generateProvokingIndexBuffer(T* destination, unsigned int* reorder, const T* indices, size_t index_count, size_t vertex_count) +{ + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); + + size_t bound = vertex_count + (index_count / 3); + assert(size_t(T(bound - 1)) == bound - 1); // bound - 1 must fit in T + (void)bound; + + return meshopt_generateProvokingIndexBuffer(out.data, reorder, in.data, index_count, vertex_count); +} + template inline void meshopt_optimizeVertexCache(T* destination, const T* indices, size_t index_count, size_t vertex_count) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); meshopt_optimizeVertexCache(out.data, in.data, index_count, vertex_count); } @@ -867,8 +935,8 @@ inline void meshopt_optimizeVertexCache(T* destination, const T* indices, size_t template inline void meshopt_optimizeVertexCacheStrip(T* destination, const T* indices, size_t index_count, size_t vertex_count) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); meshopt_optimizeVertexCacheStrip(out.data, in.data, index_count, vertex_count); } @@ -876,8 +944,8 @@ inline void meshopt_optimizeVertexCacheStrip(T* destination, const T* indices, s template inline void meshopt_optimizeVertexCacheFifo(T* destination, const T* indices, size_t index_count, size_t vertex_count, unsigned int cache_size) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); meshopt_optimizeVertexCacheFifo(out.data, in.data, index_count, vertex_count, cache_size); } @@ -885,8 +953,8 @@ inline void meshopt_optimizeVertexCacheFifo(T* destination, const T* indices, si template inline void meshopt_optimizeOverdraw(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, float threshold) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); meshopt_optimizeOverdraw(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, threshold); } @@ -894,7 +962,7 @@ inline void meshopt_optimizeOverdraw(T* destination, const T* indices, size_t in template inline size_t meshopt_optimizeVertexFetchRemap(unsigned int* destination, const T* indices, size_t index_count, size_t vertex_count) { - meshopt_IndexAdapter in(0, indices, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); return meshopt_optimizeVertexFetchRemap(destination, in.data, index_count, vertex_count); } @@ -910,7 +978,7 @@ inline size_t meshopt_optimizeVertexFetch(void* destination, T* indices, size_t template inline size_t meshopt_encodeIndexBuffer(unsigned char* buffer, size_t buffer_size, const T* indices, size_t index_count) { - meshopt_IndexAdapter in(0, indices, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); return meshopt_encodeIndexBuffer(buffer, buffer_size, in.data, index_count); } @@ -927,7 +995,7 @@ inline int meshopt_decodeIndexBuffer(T* destination, size_t index_count, const u template inline size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_size, const T* indices, size_t index_count) { - meshopt_IndexAdapter in(0, indices, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); return meshopt_encodeIndexSequence(buffer, buffer_size, in.data, index_count); } @@ -944,26 +1012,26 @@ inline int meshopt_decodeIndexSequence(T* destination, size_t index_count, const template inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* result_error) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); return meshopt_simplify(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, options, result_error); } template -inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* result_error) +inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, const unsigned char* vertex_lock, size_t target_index_count, float target_error, unsigned int options, float* result_error) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); - return meshopt_simplifyWithAttributes(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, vertex_attributes, vertex_attributes_stride, attribute_weights, attribute_count, target_index_count, target_error, options, result_error); + return meshopt_simplifyWithAttributes(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, vertex_attributes, vertex_attributes_stride, attribute_weights, attribute_count, vertex_lock, target_index_count, target_error, options, result_error); } template inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); return meshopt_simplifySloppy(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, result_error); } @@ -971,8 +1039,8 @@ inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t in template inline size_t meshopt_stripify(T* destination, const T* indices, size_t index_count, size_t vertex_count, T restart_index) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, (index_count / 3) * 5); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, (index_count / 3) * 5); return meshopt_stripify(out.data, in.data, index_count, vertex_count, unsigned(restart_index)); } @@ -980,8 +1048,8 @@ inline size_t meshopt_stripify(T* destination, const T* indices, size_t index_co template inline size_t meshopt_unstripify(T* destination, const T* indices, size_t index_count, T restart_index) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, (index_count - 2) * 3); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, (index_count - 2) * 3); return meshopt_unstripify(out.data, in.data, index_count, unsigned(restart_index)); } @@ -989,7 +1057,7 @@ inline size_t meshopt_unstripify(T* destination, const T* indices, size_t index_ template inline meshopt_VertexCacheStatistics meshopt_analyzeVertexCache(const T* indices, size_t index_count, size_t vertex_count, unsigned int cache_size, unsigned int warp_size, unsigned int buffer_size) { - meshopt_IndexAdapter in(0, indices, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); return meshopt_analyzeVertexCache(in.data, index_count, vertex_count, cache_size, warp_size, buffer_size); } @@ -997,7 +1065,7 @@ inline meshopt_VertexCacheStatistics meshopt_analyzeVertexCache(const T* indices template inline meshopt_OverdrawStatistics meshopt_analyzeOverdraw(const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter in(0, indices, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); return meshopt_analyzeOverdraw(in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } @@ -1005,7 +1073,7 @@ inline meshopt_OverdrawStatistics meshopt_analyzeOverdraw(const T* indices, size template inline meshopt_VertexFetchStatistics meshopt_analyzeVertexFetch(const T* indices, size_t index_count, size_t vertex_count, size_t vertex_size) { - meshopt_IndexAdapter in(0, indices, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); return meshopt_analyzeVertexFetch(in.data, index_count, vertex_count, vertex_size); } @@ -1013,7 +1081,7 @@ inline meshopt_VertexFetchStatistics meshopt_analyzeVertexFetch(const T* indices template inline size_t meshopt_buildMeshlets(meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t max_vertices, size_t max_triangles, float cone_weight) { - meshopt_IndexAdapter in(0, indices, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); return meshopt_buildMeshlets(meshlets, meshlet_vertices, meshlet_triangles, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, max_vertices, max_triangles, cone_weight); } @@ -1021,7 +1089,7 @@ inline size_t meshopt_buildMeshlets(meshopt_Meshlet* meshlets, unsigned int* mes template inline size_t meshopt_buildMeshletsScan(meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const T* indices, size_t index_count, size_t vertex_count, size_t max_vertices, size_t max_triangles) { - meshopt_IndexAdapter in(0, indices, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); return meshopt_buildMeshletsScan(meshlets, meshlet_vertices, meshlet_triangles, in.data, index_count, vertex_count, max_vertices, max_triangles); } @@ -1029,7 +1097,7 @@ inline size_t meshopt_buildMeshletsScan(meshopt_Meshlet* meshlets, unsigned int* template inline meshopt_Bounds meshopt_computeClusterBounds(const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter in(0, indices, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); return meshopt_computeClusterBounds(in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } @@ -1037,15 +1105,15 @@ inline meshopt_Bounds meshopt_computeClusterBounds(const T* indices, size_t inde template inline void meshopt_spatialSortTriangles(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter in(0, indices, index_count); - meshopt_IndexAdapter out(destination, 0, index_count); + meshopt_IndexAdapter in(NULL, indices, index_count); + meshopt_IndexAdapter out(destination, NULL, index_count); meshopt_spatialSortTriangles(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } #endif /** - * Copyright (c) 2016-2023 Arseny Kapoulkine + * Copyright (c) 2016-2024 Arseny Kapoulkine * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/bgfx/3rdparty/meshoptimizer/src/overdrawanalyzer.cpp b/bgfx/3rdparty/meshoptimizer/src/overdrawanalyzer.cpp index 8b6f2541..31cf6f14 100644 --- a/bgfx/3rdparty/meshoptimizer/src/overdrawanalyzer.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/overdrawanalyzer.cpp @@ -53,11 +53,10 @@ static void rasterize(OverdrawBuffer* buffer, float v1x, float v1y, float v1z, f // flip backfacing triangles to simplify rasterization logic if (sign) { - // flipping v2 & v3 preserves depth gradients since they're based on v1 + // flipping v2 & v3 preserves depth gradients since they're based on v1; only v1z is used below float t; t = v2x, v2x = v3x, v3x = t; t = v2y, v2y = v3y, v3y = t; - t = v2z, v2z = v3z, v3z = t; // flip depth since we rasterize backfacing triangles to second buffer with reverse Z; only v1z is used below v1z = kViewport - v1z; diff --git a/bgfx/3rdparty/meshoptimizer/src/quantization.cpp b/bgfx/3rdparty/meshoptimizer/src/quantization.cpp index 09a314d6..149835f5 100644 --- a/bgfx/3rdparty/meshoptimizer/src/quantization.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/quantization.cpp @@ -3,9 +3,15 @@ #include +union FloatBits +{ + float f; + unsigned int ui; +}; + unsigned short meshopt_quantizeHalf(float v) { - union { float f; unsigned int ui; } u = {v}; + FloatBits u = {v}; unsigned int ui = u.ui; int s = (ui >> 16) & 0x8000; @@ -30,7 +36,7 @@ float meshopt_quantizeFloat(float v, int N) { assert(N >= 0 && N <= 23); - union { float f; unsigned int ui; } u = {v}; + FloatBits u = {v}; unsigned int ui = u.ui; const int mask = (1 << (23 - N)) - 1; @@ -64,7 +70,7 @@ float meshopt_dequantizeHalf(unsigned short h) // 112 is an exponent bias fixup; since we already applied it once, applying it twice converts 31 to 255 r += (em >= (31 << 10)) ? (112 << 23) : 0; - union { float f; unsigned int ui; } u; + FloatBits u; u.ui = s | r; return u.f; } diff --git a/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp b/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp index 0cd9d063..af64cbda 100644 --- a/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp @@ -111,10 +111,12 @@ struct PositionHasher { const float* vertex_positions; size_t vertex_stride_float; + const unsigned int* sparse_remap; size_t hash(unsigned int index) const { - const unsigned int* key = reinterpret_cast(vertex_positions + index * vertex_stride_float); + unsigned int ri = sparse_remap ? sparse_remap[index] : index; + const unsigned int* key = reinterpret_cast(vertex_positions + ri * vertex_stride_float); // scramble bits to make sure that integer coordinates have entropy in lower bits unsigned int x = key[0] ^ (key[0] >> 17); @@ -127,7 +129,25 @@ struct PositionHasher bool equal(unsigned int lhs, unsigned int rhs) const { - return memcmp(vertex_positions + lhs * vertex_stride_float, vertex_positions + rhs * vertex_stride_float, sizeof(float) * 3) == 0; + unsigned int li = sparse_remap ? sparse_remap[lhs] : lhs; + unsigned int ri = sparse_remap ? sparse_remap[rhs] : rhs; + + return memcmp(vertex_positions + li * vertex_stride_float, vertex_positions + ri * vertex_stride_float, sizeof(float) * 3) == 0; + } +}; + +struct RemapHasher +{ + unsigned int* remap; + + size_t hash(unsigned int id) const + { + return id * 0x5bd1e995; + } + + bool equal(unsigned int lhs, unsigned int rhs) const + { + return remap[lhs] == rhs; } }; @@ -164,12 +184,12 @@ static T* hashLookup2(T* table, size_t buckets, const Hash& hash, const T& key, } assert(false && "Hash table is full"); // unreachable - return 0; + return NULL; } -static void buildPositionRemap(unsigned int* remap, unsigned int* wedge, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, meshopt_Allocator& allocator) +static void buildPositionRemap(unsigned int* remap, unsigned int* wedge, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const unsigned int* sparse_remap, meshopt_Allocator& allocator) { - PositionHasher hasher = {vertex_positions_data, vertex_positions_stride / sizeof(float)}; + PositionHasher hasher = {vertex_positions_data, vertex_positions_stride / sizeof(float), sparse_remap}; size_t table_size = hashBuckets2(vertex_count); unsigned int* table = allocator.allocate(table_size); @@ -205,6 +225,57 @@ static void buildPositionRemap(unsigned int* remap, unsigned int* wedge, const f allocator.deallocate(table); } +static unsigned int* buildSparseRemap(unsigned int* indices, size_t index_count, size_t vertex_count, size_t* out_vertex_count, meshopt_Allocator& allocator) +{ + // use a bit set to compute the precise number of unique vertices + unsigned char* filter = allocator.allocate((vertex_count + 7) / 8); + memset(filter, 0, (vertex_count + 7) / 8); + + size_t unique = 0; + for (size_t i = 0; i < index_count; ++i) + { + unsigned int index = indices[i]; + assert(index < vertex_count); + + unique += (filter[index / 8] & (1 << (index % 8))) == 0; + filter[index / 8] |= 1 << (index % 8); + } + + unsigned int* remap = allocator.allocate(unique); + size_t offset = 0; + + // temporary map dense => sparse; we allocate it last so that we can deallocate it + size_t revremap_size = hashBuckets2(unique); + unsigned int* revremap = allocator.allocate(revremap_size); + memset(revremap, -1, revremap_size * sizeof(unsigned int)); + + // fill remap, using revremap as a helper, and rewrite indices in the same pass + RemapHasher hasher = {remap}; + + for (size_t i = 0; i < index_count; ++i) + { + unsigned int index = indices[i]; + + unsigned int* entry = hashLookup2(revremap, revremap_size, hasher, index, ~0u); + + if (*entry == ~0u) + { + remap[offset] = index; + *entry = unsigned(offset); + offset++; + } + + indices[i] = *entry; + } + + allocator.deallocate(revremap); + + assert(offset == unique); + *out_vertex_count = unique; + + return remap; +} + enum VertexKind { Kind_Manifold, // not on an attribute seam, not on any boundary @@ -217,14 +288,14 @@ enum VertexKind }; // manifold vertices can collapse onto anything -// border/seam vertices can only be collapsed onto border/seam respectively +// border/seam vertices can collapse onto border/seam respectively, or locked // complex vertices can collapse onto complex/locked // a rule of thumb is that collapsing kind A into kind B preserves the kind B in the target vertex // for example, while we could collapse Complex into Manifold, this would mean the target vertex isn't Manifold anymore const unsigned char kCanCollapse[Kind_Count][Kind_Count] = { {1, 1, 1, 1, 1}, - {0, 1, 0, 0, 0}, - {0, 0, 1, 0, 0}, + {0, 1, 0, 0, 1}, + {0, 0, 1, 0, 1}, {0, 0, 0, 1, 1}, {0, 0, 0, 0, 0}, }; @@ -252,7 +323,7 @@ static bool hasEdge(const EdgeAdjacency& adjacency, unsigned int a, unsigned int return false; } -static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned int* loopback, size_t vertex_count, const EdgeAdjacency& adjacency, const unsigned int* remap, const unsigned int* wedge, unsigned int options) +static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned int* loopback, size_t vertex_count, const EdgeAdjacency& adjacency, const unsigned int* remap, const unsigned int* wedge, const unsigned char* vertex_lock, const unsigned int* sparse_remap, unsigned int options) { memset(loop, -1, vertex_count * sizeof(unsigned int)); memset(loopback, -1, vertex_count * sizeof(unsigned int)); @@ -331,7 +402,7 @@ static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned if (openiv != ~0u && openiv != i && openov != ~0u && openov != i && openiw != ~0u && openiw != w && openow != ~0u && openow != w) { - if (remap[openiv] == remap[openow] && remap[openov] == remap[openiw]) + if (remap[openiv] == remap[openow] && remap[openov] == remap[openiw] && remap[openiv] != remap[openov]) { result[i] = Kind_Seam; } @@ -362,6 +433,18 @@ static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned } } + if (vertex_lock) + { + // vertex_lock may lock any wedge, not just the primary vertex, so we need to lock the primary vertex and relock any wedges + for (size_t i = 0; i < vertex_count; ++i) + if (vertex_lock[sparse_remap ? sparse_remap[i] : i]) + result[remap[i]] = Kind_Locked; + + for (size_t i = 0; i < vertex_count; ++i) + if (result[remap[i]] == Kind_Locked) + result[i] = Kind_Locked; + } + if (options & meshopt_SimplifyLockBorder) for (size_t i = 0; i < vertex_count; ++i) if (result[i] == Kind_Border) @@ -378,7 +461,7 @@ struct Vector3 float x, y, z; }; -static float rescalePositions(Vector3* result, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride) +static float rescalePositions(Vector3* result, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const unsigned int* sparse_remap = NULL) { size_t vertex_stride_float = vertex_positions_stride / sizeof(float); @@ -387,7 +470,8 @@ static float rescalePositions(Vector3* result, const float* vertex_positions_dat for (size_t i = 0; i < vertex_count; ++i) { - const float* v = vertex_positions_data + i * vertex_stride_float; + unsigned int ri = sparse_remap ? sparse_remap[i] : unsigned(i); + const float* v = vertex_positions_data + ri * vertex_stride_float; if (result) { @@ -426,25 +510,29 @@ static float rescalePositions(Vector3* result, const float* vertex_positions_dat return extent; } -static void rescaleAttributes(float* result, const float* vertex_attributes_data, size_t vertex_count, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count) +static void rescaleAttributes(float* result, const float* vertex_attributes_data, size_t vertex_count, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, const unsigned int* attribute_remap, const unsigned int* sparse_remap) { size_t vertex_attributes_stride_float = vertex_attributes_stride / sizeof(float); for (size_t i = 0; i < vertex_count; ++i) { + unsigned int ri = sparse_remap ? sparse_remap[i] : unsigned(i); + for (size_t k = 0; k < attribute_count; ++k) { - float a = vertex_attributes_data[i * vertex_attributes_stride_float + k]; + unsigned int rk = attribute_remap[k]; + float a = vertex_attributes_data[ri * vertex_attributes_stride_float + rk]; - result[i * attribute_count + k] = a * attribute_weights[k]; + result[i * attribute_count + k] = a * attribute_weights[rk]; } } } -static const size_t kMaxAttributes = 16; +static const size_t kMaxAttributes = 32; struct Quadric { + // a00*x^2 + a11*y^2 + a22*z^2 + 2*(a10*xy + a20*xz + a21*yz) + b0*x + b1*y + b2*z + c float a00, a11, a22; float a10, a20, a21; float b0, b1, b2, c; @@ -453,9 +541,17 @@ struct Quadric struct QuadricGrad { + // gx*x + gy*y + gz*z + gw float gx, gy, gz, gw; }; +struct Reservoir +{ + float x, y, z; + float r, g, b; + float w; +}; + struct Collapse { unsigned int v0; @@ -509,7 +605,7 @@ static void quadricAdd(QuadricGrad* G, const QuadricGrad* R, size_t attribute_co } } -static float quadricError(const Quadric& Q, const Vector3& v) +static float quadricEval(const Quadric& Q, const Vector3& v) { float rx = Q.b0; float ry = Q.b1; @@ -532,6 +628,12 @@ static float quadricError(const Quadric& Q, const Vector3& v) r += ry * v.y; r += rz * v.z; + return r; +} + +static float quadricError(const Quadric& Q, const Vector3& v) +{ + float r = quadricEval(Q, v); float s = Q.w == 0.f ? 0.f : 1.f / Q.w; return fabsf(r) * s; @@ -539,26 +641,7 @@ static float quadricError(const Quadric& Q, const Vector3& v) static float quadricError(const Quadric& Q, const QuadricGrad* G, size_t attribute_count, const Vector3& v, const float* va) { - float rx = Q.b0; - float ry = Q.b1; - float rz = Q.b2; - - rx += Q.a10 * v.y; - ry += Q.a21 * v.z; - rz += Q.a20 * v.x; - - rx *= 2; - ry *= 2; - rz *= 2; - - rx += Q.a00 * v.x; - ry += Q.a11 * v.y; - rz += Q.a22 * v.z; - - float r = Q.c; - r += rx * v.x; - r += ry * v.y; - r += rz * v.z; + float r = quadricEval(Q, v); // see quadricFromAttributes for general derivation; here we need to add the parts of (eval(pos) - attr)^2 that depend on attr for (size_t k = 0; k < attribute_count; ++k) @@ -566,14 +649,11 @@ static float quadricError(const Quadric& Q, const QuadricGrad* G, size_t attribu float a = va[k]; float g = v.x * G[k].gx + v.y * G[k].gy + v.z * G[k].gz + G[k].gw; - r += a * a * Q.w; - r -= 2 * a * g; + r += a * (a * Q.w - 2 * g); } - // TODO: weight normalization is breaking attribute error somehow - float s = 1;// Q.w == 0.f ? 0.f : 1.f / Q.w; - - return fabsf(r) * s; + // note: unlike position error, we do not normalize by Q.w to retain edge scaling as described in quadricFromAttributes + return fabsf(r); } static void quadricFromPlane(Quadric& Q, float a, float b, float c, float d, float w) @@ -596,22 +676,6 @@ static void quadricFromPlane(Quadric& Q, float a, float b, float c, float d, flo Q.w = w; } -static void quadricFromPoint(Quadric& Q, float x, float y, float z, float w) -{ - // we need to encode (x - X) ^ 2 + (y - Y)^2 + (z - Z)^2 into the quadric - Q.a00 = w; - Q.a11 = w; - Q.a22 = w; - Q.a10 = 0.f; - Q.a20 = 0.f; - Q.a21 = 0.f; - Q.b0 = -2.f * x * w; - Q.b1 = -2.f * y * w; - Q.b2 = -2.f * z * w; - Q.c = (x * x + y * y + z * z) * w; - Q.w = w; -} - static void quadricFromTriangle(Quadric& Q, const Vector3& p0, const Vector3& p1, const Vector3& p2, float weight) { Vector3 p10 = {p1.x - p0.x, p1.y - p0.y, p1.z - p0.z}; @@ -630,20 +694,24 @@ static void quadricFromTriangle(Quadric& Q, const Vector3& p0, const Vector3& p1 static void quadricFromTriangleEdge(Quadric& Q, const Vector3& p0, const Vector3& p1, const Vector3& p2, float weight) { Vector3 p10 = {p1.x - p0.x, p1.y - p0.y, p1.z - p0.z}; - float length = normalize(p10); - // p20p = length of projection of p2-p0 onto normalize(p1 - p0) + // edge length; keep squared length around for projection correction + float lengthsq = p10.x * p10.x + p10.y * p10.y + p10.z * p10.z; + float length = sqrtf(lengthsq); + + // p20p = length of projection of p2-p0 onto p1-p0; note that p10 is unnormalized so we need to correct it later Vector3 p20 = {p2.x - p0.x, p2.y - p0.y, p2.z - p0.z}; float p20p = p20.x * p10.x + p20.y * p10.y + p20.z * p10.z; - // normal = altitude of triangle from point p2 onto edge p1-p0 - Vector3 normal = {p20.x - p10.x * p20p, p20.y - p10.y * p20p, p20.z - p10.z * p20p}; - normalize(normal); + // perp = perpendicular vector from p2 to line segment p1-p0 + // note: since p10 is unnormalized we need to correct the projection; we scale p20 instead to take advantage of normalize below + Vector3 perp = {p20.x * lengthsq - p10.x * p20p, p20.y * lengthsq - p10.y * p20p, p20.z * lengthsq - p10.z * p20p}; + normalize(perp); - float distance = normal.x * p0.x + normal.y * p0.y + normal.z * p0.z; + float distance = perp.x * p0.x + perp.y * p0.y + perp.z * p0.z; // note: the weight is scaled linearly with edge length; this has to match the triangle weight - quadricFromPlane(Q, normal.x, normal.y, normal.z, -distance, length * weight); + quadricFromPlane(Q, perp.x, perp.y, perp.z, -distance, length * weight); } static void quadricFromAttributes(Quadric& Q, QuadricGrad* G, const Vector3& p0, const Vector3& p1, const Vector3& p2, const float* va0, const float* va1, const float* va2, size_t attribute_count) @@ -656,16 +724,21 @@ static void quadricFromAttributes(Quadric& Q, QuadricGrad* G, const Vector3& p0, Vector3 p10 = {p1.x - p0.x, p1.y - p0.y, p1.z - p0.z}; Vector3 p20 = {p2.x - p0.x, p2.y - p0.y, p2.z - p0.z}; - // weight is scaled linearly with edge length + // normal = cross(p1 - p0, p2 - p0) Vector3 normal = {p10.y * p20.z - p10.z * p20.y, p10.z * p20.x - p10.x * p20.z, p10.x * p20.y - p10.y * p20.x}; - float area = sqrtf(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); - float w = sqrtf(area); // TODO this needs more experimentation + float area = sqrtf(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z) * 0.5f; + + // quadric is weighted with the square of edge length (= area) + // this equalizes the units with the positional error (which, after normalization, is a square of distance) + // as a result, a change in weighted attribute of 1 along distance d is approximately equivalent to a change in position of d + float w = area; // we compute gradients using barycentric coordinates; barycentric coordinates can be computed as follows: // v = (d11 * d20 - d01 * d21) / denom // w = (d00 * d21 - d01 * d20) / denom // u = 1 - v - w // here v0, v1 are triangle edge vectors, v2 is a vector from point to triangle corner, and dij = dot(vi, vj) + // note: v2 and d20/d21 can not be evaluated here as v2 is effectively an unknown variable; we need these only as variables for derivation of gradients const Vector3& v0 = p10; const Vector3& v1 = p20; float d00 = v0.x * v0.x + v0.y * v0.y + v0.z * v0.z; @@ -675,7 +748,7 @@ static void quadricFromAttributes(Quadric& Q, QuadricGrad* G, const Vector3& p0, float denomr = denom == 0 ? 0.f : 1.f / denom; // precompute gradient factors - // these are derived by directly computing derivative of eval(pos) = a0 * u + a1 * v + a2 * w and factoring out common factors that are shared between attributes + // these are derived by directly computing derivative of eval(pos) = a0 * u + a1 * v + a2 * w and factoring out expressions that are shared between attributes float gx1 = (d11 * v0.x - d01 * v1.x) * denomr; float gx2 = (d00 * v1.x - d01 * v0.x) * denomr; float gy1 = (d11 * v0.y - d01 * v1.y) * denomr; @@ -700,6 +773,7 @@ static void quadricFromAttributes(Quadric& Q, QuadricGrad* G, const Vector3& p0, // quadric encodes (eval(pos)-attr)^2; this means that the resulting expansion needs to compute, for example, pos.x * pos.y * K // since quadrics already encode factors for pos.x * pos.y, we can accumulate almost everything in basic quadric fields + // note: for simplicity we scale all factors by weight here instead of outside the loop Q.a00 += w * (gx * gx); Q.a11 += w * (gy * gy); Q.a22 += w * (gz * gz); @@ -787,7 +861,7 @@ static void fillEdgeQuadrics(Quadric* vertex_quadrics, const unsigned int* indic } } -static void fillAttributeQuadrics(Quadric* attribute_quadrics, QuadricGrad* attribute_gradients, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const float* vertex_attributes, size_t attribute_count, const unsigned int* remap) +static void fillAttributeQuadrics(Quadric* attribute_quadrics, QuadricGrad* attribute_gradients, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const float* vertex_attributes, size_t attribute_count) { for (size_t i = 0; i < index_count; i += 3) { @@ -799,14 +873,13 @@ static void fillAttributeQuadrics(Quadric* attribute_quadrics, QuadricGrad* attr QuadricGrad G[kMaxAttributes]; quadricFromAttributes(QA, G, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], &vertex_attributes[i0 * attribute_count], &vertex_attributes[i1 * attribute_count], &vertex_attributes[i2 * attribute_count], attribute_count); - // TODO: This blends together attribute weights across attribute discontinuities, which is probably not a great idea - quadricAdd(attribute_quadrics[remap[i0]], QA); - quadricAdd(attribute_quadrics[remap[i1]], QA); - quadricAdd(attribute_quadrics[remap[i2]], QA); + quadricAdd(attribute_quadrics[i0], QA); + quadricAdd(attribute_quadrics[i1], QA); + quadricAdd(attribute_quadrics[i2], QA); - quadricAdd(&attribute_gradients[remap[i0] * attribute_count], G, attribute_count); - quadricAdd(&attribute_gradients[remap[i1] * attribute_count], G, attribute_count); - quadricAdd(&attribute_gradients[remap[i2] * attribute_count], G, attribute_count); + quadricAdd(&attribute_gradients[i0 * attribute_count], G, attribute_count); + quadricAdd(&attribute_gradients[i1 * attribute_count], G, attribute_count); + quadricAdd(&attribute_gradients[i2 * attribute_count], G, attribute_count); } } @@ -820,7 +893,13 @@ static bool hasTriangleFlip(const Vector3& a, const Vector3& b, const Vector3& c Vector3 nbc = {eb.y * ec.z - eb.z * ec.y, eb.z * ec.x - eb.x * ec.z, eb.x * ec.y - eb.y * ec.x}; Vector3 nbd = {eb.y * ed.z - eb.z * ed.y, eb.z * ed.x - eb.x * ed.z, eb.x * ed.y - eb.y * ed.x}; - return nbc.x * nbd.x + nbc.y * nbd.y + nbc.z * nbd.z <= 0; + float ndp = nbc.x * nbd.x + nbc.y * nbd.y + nbc.z * nbd.z; + float abc = nbc.x * nbc.x + nbc.y * nbc.y + nbc.z * nbc.z; + float abd = nbd.x * nbd.x + nbd.y * nbd.y + nbd.z * nbd.z; + + // scale is cos(angle); somewhat arbitrarily set to ~75 degrees + // note that the "pure" check is ndp <= 0 (90 degree cutoff) but that allows flipping through a series of close-to-90 collapses + return ndp <= 0.25f * sqrtf(abc * abd); } static bool hasTriangleFlips(const EdgeAdjacency& adjacency, const Vector3* vertex_positions, const unsigned int* collapse_remap, unsigned int i0, unsigned int i1) @@ -845,7 +924,13 @@ static bool hasTriangleFlips(const EdgeAdjacency& adjacency, const Vector3* vert // early-out when at least one triangle flips due to a collapse if (hasTriangleFlip(vertex_positions[a], vertex_positions[b], v0, v1)) + { +#if TRACE >= 2 + printf("edge block %d -> %d: flip welded %d %d %d\n", i0, i1, a, i0, b); +#endif + return true; + } } return false; @@ -869,7 +954,7 @@ static size_t boundEdgeCollapses(const EdgeAdjacency& adjacency, size_t vertex_c return (index_count - dual_count / 2) + 3; } -static size_t pickEdgeCollapses(Collapse* collapses, size_t collapse_capacity, const unsigned int* indices, size_t index_count, const unsigned int* remap, const unsigned char* vertex_kind, const unsigned int* loop) +static size_t pickEdgeCollapses(Collapse* collapses, size_t collapse_capacity, const unsigned int* indices, size_t index_count, const unsigned int* remap, const unsigned char* vertex_kind, const unsigned int* loop, const unsigned int* loopback) { size_t collapse_count = 0; @@ -909,6 +994,16 @@ static size_t pickEdgeCollapses(Collapse* collapses, size_t collapse_capacity, c if (k0 == k1 && (k0 == Kind_Border || k0 == Kind_Seam) && loop[i0] != i1) continue; + if (k0 == Kind_Locked || k1 == Kind_Locked) + { + // the same check as above, but for border/seam -> locked collapses + // loop[] and loopback[] track half edges so we only need to check one of them + if ((k0 == Kind_Border || k0 == Kind_Seam) && loop[i0] != i1) + continue; + if ((k1 == Kind_Border || k1 == Kind_Seam) && loopback[i1] != i0) + continue; + } + // edge can be collapsed in either direction - we will pick the one with minimum error // note: we evaluate error later during collapse ranking, here we just tag the edge as bidirectional if (kCanCollapse[k0][k1] & kCanCollapse[k1][k0]) @@ -948,31 +1043,52 @@ static void rankEdgeCollapses(Collapse* collapses, size_t collapse_count, const float ei = quadricError(vertex_quadrics[remap[i0]], vertex_positions[i1]); float ej = quadricError(vertex_quadrics[remap[j0]], vertex_positions[j1]); +#if TRACE >= 3 + float di = ei, dj = ej; +#endif + if (attribute_count) { - ei += quadricError(attribute_quadrics[remap[i0]], &attribute_gradients[remap[i0] * attribute_count], attribute_count, vertex_positions[i1], &vertex_attributes[i1 * attribute_count]); - ej += quadricError(attribute_quadrics[remap[j0]], &attribute_gradients[remap[j0] * attribute_count], attribute_count, vertex_positions[j1], &vertex_attributes[j1 * attribute_count]); + // note: ideally we would evaluate max/avg of attribute errors for seam edges, but it's not clear if it's worth the extra cost + ei += quadricError(attribute_quadrics[i0], &attribute_gradients[i0 * attribute_count], attribute_count, vertex_positions[i1], &vertex_attributes[i1 * attribute_count]); + ej += quadricError(attribute_quadrics[j0], &attribute_gradients[j0 * attribute_count], attribute_count, vertex_positions[j1], &vertex_attributes[j1 * attribute_count]); } // pick edge direction with minimal error c.v0 = ei <= ej ? i0 : j0; c.v1 = ei <= ej ? i1 : j1; c.error = ei <= ej ? ei : ej; + +#if TRACE >= 3 + if (i0 == j0) // c.bidi has been overwritten + printf("edge eval %d -> %d: error %f (pos %f, attr %f)\n", c.v0, c.v1, + sqrtf(c.error), sqrtf(ei <= ej ? di : dj), sqrtf(ei <= ej ? ei - di : ej - dj)); + else + printf("edge eval %d -> %d: error %f (pos %f, attr %f); reverse %f (pos %f, attr %f)\n", c.v0, c.v1, + sqrtf(ei <= ej ? ei : ej), sqrtf(ei <= ej ? di : dj), sqrtf(ei <= ej ? ei - di : ej - dj), + sqrtf(ei <= ej ? ej : ei), sqrtf(ei <= ej ? dj : di), sqrtf(ei <= ej ? ej - dj : ei - di)); +#endif } } static void sortEdgeCollapses(unsigned int* sort_order, const Collapse* collapses, size_t collapse_count) { - const int sort_bits = 11; + // we use counting sort to order collapses by error; since the exact sort order is not as critical, + // only top 12 bits of exponent+mantissa (8 bits of exponent and 4 bits of mantissa) are used. + // to avoid excessive stack usage, we clamp the exponent range as collapses with errors much higher than 1 are not useful. + const unsigned int sort_bits = 12; + const unsigned int sort_bins = 2048 + 512; // exponent range [-127, 32) // fill histogram for counting sort - unsigned int histogram[1 << sort_bits]; + unsigned int histogram[sort_bins]; memset(histogram, 0, sizeof(histogram)); for (size_t i = 0; i < collapse_count; ++i) { // skip sign bit since error is non-negative - unsigned int key = (collapses[i].errorui << 1) >> (32 - sort_bits); + unsigned int error = collapses[i].errorui; + unsigned int key = (error << 1) >> (32 - sort_bits); + key = key < sort_bins ? key : sort_bins - 1; histogram[key]++; } @@ -980,7 +1096,7 @@ static void sortEdgeCollapses(unsigned int* sort_order, const Collapse* collapse // compute offsets based on histogram data size_t histogram_sum = 0; - for (size_t i = 0; i < 1 << sort_bits; ++i) + for (size_t i = 0; i < sort_bins; ++i) { size_t count = histogram[i]; histogram[i] = unsigned(histogram_sum); @@ -993,13 +1109,15 @@ static void sortEdgeCollapses(unsigned int* sort_order, const Collapse* collapse for (size_t i = 0; i < collapse_count; ++i) { // skip sign bit since error is non-negative - unsigned int key = (collapses[i].errorui << 1) >> (32 - sort_bits); + unsigned int error = collapses[i].errorui; + unsigned int key = (error << 1) >> (32 - sort_bits); + key = key < sort_bins ? key : sort_bins - 1; sort_order[histogram[key]++] = unsigned(i); } } -static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* collapse_locked, Quadric* vertex_quadrics, Quadric* attribute_quadrics, QuadricGrad* attribute_gradients, size_t attribute_count, const Collapse* collapses, size_t collapse_count, const unsigned int* collapse_order, const unsigned int* remap, const unsigned int* wedge, const unsigned char* vertex_kind, const Vector3* vertex_positions, const EdgeAdjacency& adjacency, size_t triangle_collapse_goal, float error_limit, float& result_error) +static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* collapse_locked, const Collapse* collapses, size_t collapse_count, const unsigned int* collapse_order, const unsigned int* remap, const unsigned int* wedge, const unsigned char* vertex_kind, const unsigned int* loop, const unsigned int* loopback, const Vector3* vertex_positions, const EdgeAdjacency& adjacency, size_t triangle_collapse_goal, float error_limit, float& result_error) { size_t edge_collapses = 0; size_t triangle_collapses = 0; @@ -1009,7 +1127,7 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* size_t edge_collapse_goal = triangle_collapse_goal / 2; #if TRACE - size_t stats[4] = {}; + size_t stats[7] = {}; #endif for (size_t i = 0; i < collapse_count; ++i) @@ -1019,10 +1137,16 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* TRACESTATS(0); if (c.error > error_limit) + { + TRACESTATS(4); break; + } if (triangle_collapses >= triangle_collapse_goal) + { + TRACESTATS(5); break; + } // we limit the error in each pass based on the error of optimal last collapse; since many collapses will be locked // as they will share vertices with other successfull collapses, we need to increase the acceptable error by some factor @@ -1030,8 +1154,11 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* // on average, each collapse is expected to lock 6 other collapses; to avoid degenerate passes on meshes with odd // topology, we only abort if we got over 1/6 collapses accordingly. - if (c.error > error_goal && triangle_collapses > triangle_collapse_goal / 6) + if (c.error > error_goal && c.error > result_error && triangle_collapses > triangle_collapse_goal / 6) + { + TRACESTATS(6); break; + } unsigned int i0 = c.v0; unsigned int i1 = c.v1; @@ -1039,6 +1166,8 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* unsigned int r0 = remap[i0]; unsigned int r1 = remap[i1]; + unsigned char kind = vertex_kind[i0]; + // we don't collapse vertices that had source or target vertex involved in a collapse // it's important to not move the vertices twice since it complicates the tracking/remapping logic // it's important to not move other vertices towards a moved vertex to preserve error since we don't re-rank collapses mid-pass @@ -1057,35 +1186,39 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* continue; } +#if TRACE >= 2 + printf("edge commit %d -> %d: kind %d->%d, error %f\n", i0, i1, vertex_kind[i0], vertex_kind[i1], sqrtf(c.error)); +#endif + assert(collapse_remap[r0] == r0); assert(collapse_remap[r1] == r1); - quadricAdd(vertex_quadrics[r1], vertex_quadrics[r0]); - - if (attribute_count) - { - quadricAdd(attribute_quadrics[r1], attribute_quadrics[r0]); - quadricAdd(&attribute_gradients[r1 * attribute_count], &attribute_gradients[r0 * attribute_count], attribute_count); - } - - if (vertex_kind[i0] == Kind_Complex) + if (kind == Kind_Complex) { + // remap all vertices in the complex to the target vertex unsigned int v = i0; do { - collapse_remap[v] = r1; + collapse_remap[v] = i1; v = wedge[v]; } while (v != i0); } - else if (vertex_kind[i0] == Kind_Seam) + else if (kind == Kind_Seam) { - // remap v0 to v1 and seam pair of v0 to seam pair of v1 + // for seam collapses we need to move the seam pair together; this is a bit tricky to compute since we need to rely on edge loops as target vertex may be locked (and thus have more than two wedges) unsigned int s0 = wedge[i0]; - unsigned int s1 = wedge[i1]; + unsigned int s1 = loop[i0] == i1 ? loopback[s0] : loop[s0]; + assert(s0 != i0 && wedge[s0] == i0); + assert(s1 != ~0u && remap[s1] == r1); + + // additional asserts to verify that the seam pair is consistent + assert(kind != vertex_kind[i1] || s1 == wedge[i1]); + assert(loop[i0] == i1 || loopback[i0] == i1); + assert(loop[s0] == s1 || loopback[s0] == s1); - assert(s0 != i0 && s1 != i1); - assert(wedge[s0] == i0 && wedge[s1] == i1); + // note: this should never happen due to the assertion above, but when disabled if we ever hit this case we'll get a memory safety issue; for now play it safe + s1 = (s1 != ~0u) ? s1 : wedge[i1]; collapse_remap[i0] = i1; collapse_remap[s0] = s1; @@ -1097,27 +1230,63 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* collapse_remap[i0] = i1; } + // note: we technically don't need to lock r1 if it's a locked vertex, as it can't move and its quadric won't be used + // however, this results in slightly worse error on some meshes because the locked collapses get an unfair advantage wrt scheduling collapse_locked[r0] = 1; collapse_locked[r1] = 1; // border edges collapse 1 triangle, other edges collapse 2 or more - triangle_collapses += (vertex_kind[i0] == Kind_Border) ? 1 : 2; + triangle_collapses += (kind == Kind_Border) ? 1 : 2; edge_collapses++; result_error = result_error < c.error ? c.error : result_error; } #if TRACE - float error_goal_perfect = edge_collapse_goal < collapse_count ? collapses[collapse_order[edge_collapse_goal]].error : 0.f; + float error_goal_last = edge_collapse_goal < collapse_count ? 1.5f * collapses[collapse_order[edge_collapse_goal]].error : FLT_MAX; + float error_goal_limit = error_goal_last < error_limit ? error_goal_last : error_limit; - printf("removed %d triangles, error %e (goal %e); evaluated %d/%d collapses (done %d, skipped %d, invalid %d)\n", - int(triangle_collapses), sqrtf(result_error), sqrtf(error_goal_perfect), - int(stats[0]), int(collapse_count), int(edge_collapses), int(stats[1]), int(stats[2])); + printf("removed %d triangles, error %e (goal %e); evaluated %d/%d collapses (done %d, skipped %d, invalid %d); %s\n", + int(triangle_collapses), sqrtf(result_error), sqrtf(error_goal_limit), + int(stats[0]), int(collapse_count), int(edge_collapses), int(stats[1]), int(stats[2]), + stats[4] ? "error limit" : (stats[5] ? "count limit" : (stats[6] ? "error goal" : "out of collapses"))); #endif return edge_collapses; } +static void updateQuadrics(const unsigned int* collapse_remap, size_t vertex_count, Quadric* vertex_quadrics, Quadric* attribute_quadrics, QuadricGrad* attribute_gradients, size_t attribute_count, const Vector3* vertex_positions, const unsigned int* remap, float& vertex_error) +{ + for (size_t i = 0; i < vertex_count; ++i) + { + if (collapse_remap[i] == i) + continue; + + unsigned int i0 = unsigned(i); + unsigned int i1 = collapse_remap[i]; + + unsigned int r0 = remap[i0]; + unsigned int r1 = remap[i1]; + + // ensure we only update vertex_quadrics once: primary vertex must be moved if any wedge is moved + if (i0 == r0) + quadricAdd(vertex_quadrics[r1], vertex_quadrics[r0]); + + if (attribute_count) + { + quadricAdd(attribute_quadrics[i1], attribute_quadrics[i0]); + quadricAdd(&attribute_gradients[i1 * attribute_count], &attribute_gradients[i0 * attribute_count], attribute_count); + + if (i0 == r0) + { + // when attributes are used, distance error needs to be recomputed as collapses don't track it; it is safe to do this after the quadric adjustment + float derr = quadricError(vertex_quadrics[r0], vertex_positions[r1]); + vertex_error = vertex_error < derr ? derr : vertex_error; + } + } + } +} + static size_t remapIndexBuffer(unsigned int* indices, size_t index_count, const unsigned int* collapse_remap) { size_t write = 0; @@ -1149,15 +1318,179 @@ static void remapEdgeLoops(unsigned int* loop, size_t vertex_count, const unsign { for (size_t i = 0; i < vertex_count; ++i) { + // note: this is a no-op for vertices that were remapped + // ideally we would clear the loop entries for those for consistency, even though they aren't going to be used + // however, the remapping process needs loop information for remapped vertices, so this would require a separate pass if (loop[i] != ~0u) { unsigned int l = loop[i]; unsigned int r = collapse_remap[l]; // i == r is a special case when the seam edge is collapsed in a direction opposite to where loop goes - loop[i] = (i == r) ? loop[l] : r; + if (i == r) + loop[i] = (loop[l] != ~0u) ? collapse_remap[loop[l]] : ~0u; + else + loop[i] = r; + } + } +} + +static unsigned int follow(unsigned int* parents, unsigned int index) +{ + while (index != parents[index]) + { + unsigned int parent = parents[index]; + parents[index] = parents[parent]; + index = parent; + } + + return index; +} + +static size_t buildComponents(unsigned int* components, size_t vertex_count, const unsigned int* indices, size_t index_count, const unsigned int* remap) +{ + for (size_t i = 0; i < vertex_count; ++i) + components[i] = unsigned(i); + + // compute a unique (but not sequential!) index for each component via union-find + for (size_t i = 0; i < index_count; i += 3) + { + static const int next[4] = {1, 2, 0, 1}; + + for (int e = 0; e < 3; ++e) + { + unsigned int i0 = indices[i + e]; + unsigned int i1 = indices[i + next[e]]; + + unsigned int r0 = remap[i0]; + unsigned int r1 = remap[i1]; + + r0 = follow(components, r0); + r1 = follow(components, r1); + + // merge components with larger indices into components with smaller indices + // this guarantees that the root of the component is always the one with the smallest index + if (r0 != r1) + components[r0 < r1 ? r1 : r0] = r0 < r1 ? r0 : r1; + } + } + + // make sure each element points to the component root *before* we renumber the components + for (size_t i = 0; i < vertex_count; ++i) + if (remap[i] == i) + components[i] = follow(components, unsigned(i)); + + unsigned int next_component = 0; + + // renumber components using sequential indices + // a sequential pass is sufficient because component root always has the smallest index + // note: it is unsafe to use follow() in this pass because we're replacing component links with sequential indices inplace + for (size_t i = 0; i < vertex_count; ++i) + { + if (remap[i] == i) + { + unsigned int root = components[i]; + assert(root <= i); // make sure we already computed the component for non-roots + components[i] = (root == i) ? next_component++ : components[root]; + } + else + { + assert(remap[i] < i); // make sure we already computed the component + components[i] = components[remap[i]]; } } + + return next_component; +} + +static void measureComponents(float* component_errors, size_t component_count, const unsigned int* components, const Vector3* vertex_positions, size_t vertex_count) +{ + memset(component_errors, 0, component_count * 4 * sizeof(float)); + + // compute approximate sphere center for each component as an average + for (size_t i = 0; i < vertex_count; ++i) + { + unsigned int c = components[i]; + assert(components[i] < component_count); + + Vector3 v = vertex_positions[i]; // copy avoids aliasing issues + + component_errors[c * 4 + 0] += v.x; + component_errors[c * 4 + 1] += v.y; + component_errors[c * 4 + 2] += v.z; + component_errors[c * 4 + 3] += 1; // weight + } + + // complete the center computation, and reinitialize [3] as a radius + for (size_t i = 0; i < component_count; ++i) + { + float w = component_errors[i * 4 + 3]; + float iw = w == 0.f ? 0.f : 1.f / w; + + component_errors[i * 4 + 0] *= iw; + component_errors[i * 4 + 1] *= iw; + component_errors[i * 4 + 2] *= iw; + component_errors[i * 4 + 3] = 0; // radius + } + + // compute squared radius for each component + for (size_t i = 0; i < vertex_count; ++i) + { + unsigned int c = components[i]; + + float dx = vertex_positions[i].x - component_errors[c * 4 + 0]; + float dy = vertex_positions[i].y - component_errors[c * 4 + 1]; + float dz = vertex_positions[i].z - component_errors[c * 4 + 2]; + float r = dx * dx + dy * dy + dz * dz; + + component_errors[c * 4 + 3] = component_errors[c * 4 + 3] < r ? r : component_errors[c * 4 + 3]; + } + + // we've used the output buffer as scratch space, so we need to move the results to proper indices + for (size_t i = 0; i < component_count; ++i) + { +#if TRACE >= 2 + printf("component %d: center %f %f %f, error %e\n", int(i), + component_errors[i * 4 + 0], component_errors[i * 4 + 1], component_errors[i * 4 + 2], sqrtf(component_errors[i * 4 + 3])); +#endif + // note: we keep the squared error to make it match quadric error metric + component_errors[i] = component_errors[i * 4 + 3]; + } +} + +static size_t pruneComponents(unsigned int* indices, size_t index_count, const unsigned int* components, const float* component_errors, size_t component_count, float error_cutoff, float& nexterror) +{ + size_t write = 0; + + for (size_t i = 0; i < index_count; i += 3) + { + unsigned int c = components[indices[i]]; + assert(c == components[indices[i + 1]] && c == components[indices[i + 2]]); + + if (component_errors[c] > error_cutoff) + { + indices[write + 0] = indices[i + 0]; + indices[write + 1] = indices[i + 1]; + indices[write + 2] = indices[i + 2]; + write += 3; + } + } + +#if TRACE + size_t pruned_components = 0; + for (size_t i = 0; i < component_count; ++i) + pruned_components += (component_errors[i] >= nexterror && component_errors[i] <= error_cutoff); + + printf("pruned %d triangles in %d components (goal %e)\n", int((index_count - write) / 3), int(pruned_components), sqrtf(error_cutoff)); +#endif + + // update next error with the smallest error of the remaining components for future pruning + nexterror = FLT_MAX; + for (size_t i = 0; i < component_count; ++i) + if (component_errors[i] > error_cutoff) + nexterror = nexterror > component_errors[i] ? component_errors[i] : nexterror; + + return write; } struct CellHasher @@ -1312,7 +1645,7 @@ static void fillCellQuadrics(Quadric* cell_quadrics, const unsigned int* indices unsigned int c1 = vertex_cells[i1]; unsigned int c2 = vertex_cells[i2]; - bool single_cell = (c0 == c1) & (c0 == c2); + int single_cell = (c0 == c1) & (c0 == c2); Quadric Q; quadricFromTriangle(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], single_cell ? 3.f : 1.f); @@ -1330,17 +1663,41 @@ static void fillCellQuadrics(Quadric* cell_quadrics, const unsigned int* indices } } -static void fillCellQuadrics(Quadric* cell_quadrics, const Vector3* vertex_positions, size_t vertex_count, const unsigned int* vertex_cells) +static void fillCellReservoirs(Reservoir* cell_reservoirs, size_t cell_count, const Vector3* vertex_positions, const float* vertex_colors, size_t vertex_colors_stride, size_t vertex_count, const unsigned int* vertex_cells) { + static const float dummy_color[] = {0.f, 0.f, 0.f}; + + size_t vertex_colors_stride_float = vertex_colors_stride / sizeof(float); + for (size_t i = 0; i < vertex_count; ++i) { - unsigned int c = vertex_cells[i]; + unsigned int cell = vertex_cells[i]; const Vector3& v = vertex_positions[i]; + Reservoir& r = cell_reservoirs[cell]; - Quadric Q; - quadricFromPoint(Q, v.x, v.y, v.z, 1.f); + const float* color = vertex_colors ? &vertex_colors[i * vertex_colors_stride_float] : dummy_color; - quadricAdd(cell_quadrics[c], Q); + r.x += v.x; + r.y += v.y; + r.z += v.z; + r.r += color[0]; + r.g += color[1]; + r.b += color[2]; + r.w += 1.f; + } + + for (size_t i = 0; i < cell_count; ++i) + { + Reservoir& r = cell_reservoirs[i]; + + float iw = r.w == 0.f ? 0.f : 1.f / r.w; + + r.x *= iw; + r.y *= iw; + r.z *= iw; + r.r *= iw; + r.g *= iw; + r.b *= iw; } } @@ -1361,6 +1718,34 @@ static void fillCellRemap(unsigned int* cell_remap, float* cell_errors, size_t c } } +static void fillCellRemap(unsigned int* cell_remap, float* cell_errors, size_t cell_count, const unsigned int* vertex_cells, const Reservoir* cell_reservoirs, const Vector3* vertex_positions, const float* vertex_colors, size_t vertex_colors_stride, float color_weight, size_t vertex_count) +{ + static const float dummy_color[] = {0.f, 0.f, 0.f}; + + size_t vertex_colors_stride_float = vertex_colors_stride / sizeof(float); + + memset(cell_remap, -1, cell_count * sizeof(unsigned int)); + + for (size_t i = 0; i < vertex_count; ++i) + { + unsigned int cell = vertex_cells[i]; + const Vector3& v = vertex_positions[i]; + const Reservoir& r = cell_reservoirs[cell]; + + const float* color = vertex_colors ? &vertex_colors[i * vertex_colors_stride_float] : dummy_color; + + float pos_error = (v.x - r.x) * (v.x - r.x) + (v.y - r.y) * (v.y - r.y) + (v.z - r.z) * (v.z - r.z); + float col_error = (color[0] - r.r) * (color[0] - r.r) + (color[1] - r.g) * (color[1] - r.g) + (color[2] - r.b) * (color[2] - r.b); + float error = pos_error + color_weight * col_error; + + if (cell_remap[cell] == ~0u || cell_errors[cell] > error) + { + cell_remap[cell] = unsigned(i); + cell_errors[cell] = error; + } + } +} + static size_t filterTriangles(unsigned int* destination, unsigned int* tritable, size_t tritable_size, const unsigned int* indices, size_t index_count, const unsigned int* vertex_cells, const unsigned int* cell_remap) { TriangleHasher hasher = {destination}; @@ -1416,14 +1801,13 @@ static float interpolate(float y, float x0, float y0, float x1, float y1, float } // namespace meshopt -#ifndef NDEBUG -// Note: this is only exposed for debug visualization purposes; do *not* use these in debug builds -MESHOPTIMIZER_API unsigned char* meshopt_simplifyDebugKind = 0; -MESHOPTIMIZER_API unsigned int* meshopt_simplifyDebugLoop = 0; -MESHOPTIMIZER_API unsigned int* meshopt_simplifyDebugLoopBack = 0; -#endif +// Note: this is only exposed for debug visualization purposes; do *not* use +enum +{ + meshopt_SimplifyInternalDebug = 1 << 30 +}; -size_t meshopt_simplifyEdge(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes_data, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) +size_t meshopt_simplifyEdge(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes_data, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, const unsigned char* vertex_lock, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) { using namespace meshopt; @@ -1431,30 +1815,41 @@ size_t meshopt_simplifyEdge(unsigned int* destination, const unsigned int* indic assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256); assert(vertex_positions_stride % sizeof(float) == 0); assert(target_index_count <= index_count); - assert((options & ~(meshopt_SimplifyLockBorder)) == 0); + assert(target_error >= 0); + assert((options & ~(meshopt_SimplifyLockBorder | meshopt_SimplifySparse | meshopt_SimplifyErrorAbsolute | meshopt_SimplifyPrune | meshopt_SimplifyInternalDebug)) == 0); assert(vertex_attributes_stride >= attribute_count * sizeof(float) && vertex_attributes_stride <= 256); assert(vertex_attributes_stride % sizeof(float) == 0); assert(attribute_count <= kMaxAttributes); + for (size_t i = 0; i < attribute_count; ++i) + assert(attribute_weights[i] >= 0); meshopt_Allocator allocator; unsigned int* result = destination; + if (result != indices) + memcpy(result, indices, index_count * sizeof(unsigned int)); + + // build an index remap and update indices/vertex_count to minimize the subsequent work + // note: as a consequence, errors will be computed relative to the subset extent + unsigned int* sparse_remap = NULL; + if (options & meshopt_SimplifySparse) + sparse_remap = buildSparseRemap(result, index_count, vertex_count, &vertex_count, allocator); // build adjacency information EdgeAdjacency adjacency = {}; prepareEdgeAdjacency(adjacency, index_count, vertex_count, allocator); - updateEdgeAdjacency(adjacency, indices, index_count, vertex_count, NULL); + updateEdgeAdjacency(adjacency, result, index_count, vertex_count, NULL); // build position remap that maps each vertex to the one with identical position unsigned int* remap = allocator.allocate(vertex_count); unsigned int* wedge = allocator.allocate(vertex_count); - buildPositionRemap(remap, wedge, vertex_positions_data, vertex_count, vertex_positions_stride, allocator); + buildPositionRemap(remap, wedge, vertex_positions_data, vertex_count, vertex_positions_stride, sparse_remap, allocator); // classify vertices; vertex kind determines collapse rules, see kCanCollapse unsigned char* vertex_kind = allocator.allocate(vertex_count); unsigned int* loop = allocator.allocate(vertex_count); unsigned int* loopback = allocator.allocate(vertex_count); - classifyVertices(vertex_kind, loop, loopback, vertex_count, adjacency, remap, wedge, options); + classifyVertices(vertex_kind, loop, loopback, vertex_count, adjacency, remap, wedge, vertex_lock, sparse_remap, options); #if TRACE size_t unique_positions = 0; @@ -1472,14 +1867,23 @@ size_t meshopt_simplifyEdge(unsigned int* destination, const unsigned int* indic #endif Vector3* vertex_positions = allocator.allocate(vertex_count); - rescalePositions(vertex_positions, vertex_positions_data, vertex_count, vertex_positions_stride); + float vertex_scale = rescalePositions(vertex_positions, vertex_positions_data, vertex_count, vertex_positions_stride, sparse_remap); float* vertex_attributes = NULL; if (attribute_count) { + unsigned int attribute_remap[kMaxAttributes]; + + // remap attributes to only include ones with weight > 0 to minimize memory/compute overhead for quadrics + size_t attributes_used = 0; + for (size_t i = 0; i < attribute_count; ++i) + if (attribute_weights[i] > 0) + attribute_remap[attributes_used++] = unsigned(i); + + attribute_count = attributes_used; vertex_attributes = allocator.allocate(vertex_count * attribute_count); - rescaleAttributes(vertex_attributes, vertex_attributes_data, vertex_count, vertex_attributes_stride, attribute_weights, attribute_count); + rescaleAttributes(vertex_attributes, vertex_attributes_data, vertex_count, vertex_attributes_stride, attribute_weights, attribute_count, attribute_remap, sparse_remap); } Quadric* vertex_quadrics = allocator.allocate(vertex_count); @@ -1497,14 +1901,33 @@ size_t meshopt_simplifyEdge(unsigned int* destination, const unsigned int* indic memset(attribute_gradients, 0, vertex_count * attribute_count * sizeof(QuadricGrad)); } - fillFaceQuadrics(vertex_quadrics, indices, index_count, vertex_positions, remap); - fillEdgeQuadrics(vertex_quadrics, indices, index_count, vertex_positions, remap, vertex_kind, loop, loopback); + fillFaceQuadrics(vertex_quadrics, result, index_count, vertex_positions, remap); + fillEdgeQuadrics(vertex_quadrics, result, index_count, vertex_positions, remap, vertex_kind, loop, loopback); if (attribute_count) - fillAttributeQuadrics(attribute_quadrics, attribute_gradients, indices, index_count, vertex_positions, vertex_attributes, attribute_count, remap); + fillAttributeQuadrics(attribute_quadrics, attribute_gradients, result, index_count, vertex_positions, vertex_attributes, attribute_count); - if (result != indices) - memcpy(result, indices, index_count * sizeof(unsigned int)); + unsigned int* components = NULL; + float* component_errors = NULL; + size_t component_count = 0; + float component_nexterror = 0; + + if (options & meshopt_SimplifyPrune) + { + components = allocator.allocate(vertex_count); + component_count = buildComponents(components, vertex_count, result, index_count, remap); + + component_errors = allocator.allocate(component_count * 4); // overallocate for temporary use inside measureComponents + measureComponents(component_errors, component_count, components, vertex_positions, vertex_count); + + component_nexterror = FLT_MAX; + for (size_t i = 0; i < component_count; ++i) + component_nexterror = component_nexterror > component_errors[i] ? component_errors[i] : component_nexterror; + +#if TRACE + printf("components: %d (min error %e)\n", int(component_count), sqrtf(component_nexterror)); +#endif + } #if TRACE size_t pass_count = 0; @@ -1519,22 +1942,28 @@ size_t meshopt_simplifyEdge(unsigned int* destination, const unsigned int* indic size_t result_count = index_count; float result_error = 0; + float vertex_error = 0; // target_error input is linear; we need to adjust it to match quadricError units - float error_limit = target_error * target_error; + float error_scale = (options & meshopt_SimplifyErrorAbsolute) ? vertex_scale : 1.f; + float error_limit = (target_error * target_error) / (error_scale * error_scale); while (result_count > target_index_count) { // note: throughout the simplification process adjacency structure reflects welded topology for result-in-progress updateEdgeAdjacency(adjacency, result, result_count, vertex_count, remap); - size_t edge_collapse_count = pickEdgeCollapses(edge_collapses, collapse_capacity, result, result_count, remap, vertex_kind, loop); + size_t edge_collapse_count = pickEdgeCollapses(edge_collapses, collapse_capacity, result, result_count, remap, vertex_kind, loop, loopback); assert(edge_collapse_count <= collapse_capacity); // no edges can be collapsed any more due to topology restrictions if (edge_collapse_count == 0) break; +#if TRACE + printf("pass %d:%c", int(pass_count++), TRACE >= 2 ? '\n' : ' '); +#endif + rankEdgeCollapses(edge_collapses, edge_collapse_count, vertex_positions, vertex_attributes, vertex_quadrics, attribute_quadrics, attribute_gradients, attribute_count, remap); sortEdgeCollapses(collapse_order, edge_collapses, edge_collapse_count); @@ -1546,16 +1975,17 @@ size_t meshopt_simplifyEdge(unsigned int* destination, const unsigned int* indic memset(collapse_locked, 0, vertex_count); -#if TRACE - printf("pass %d: ", int(pass_count++)); -#endif - - size_t collapses = performEdgeCollapses(collapse_remap, collapse_locked, vertex_quadrics, attribute_quadrics, attribute_gradients, attribute_count, edge_collapses, edge_collapse_count, collapse_order, remap, wedge, vertex_kind, vertex_positions, adjacency, triangle_collapse_goal, error_limit, result_error); + size_t collapses = performEdgeCollapses(collapse_remap, collapse_locked, edge_collapses, edge_collapse_count, collapse_order, remap, wedge, vertex_kind, loop, loopback, vertex_positions, adjacency, triangle_collapse_goal, error_limit, result_error); // no edges can be collapsed any more due to hitting the error limit or triangle collapse limit if (collapses == 0) break; + updateQuadrics(collapse_remap, vertex_count, vertex_quadrics, attribute_quadrics, attribute_gradients, attribute_count, vertex_positions, remap, vertex_error); + + // updateQuadrics will update vertex error if we use attributes, but if we don't then result_error and vertex_error are equivalent + vertex_error = attribute_count == 0 ? result_error : vertex_error; + remapEdgeLoops(loop, vertex_count, collapse_remap); remapEdgeLoops(loopback, vertex_count, collapse_remap); @@ -1563,38 +1993,74 @@ size_t meshopt_simplifyEdge(unsigned int* destination, const unsigned int* indic assert(new_count < result_count); result_count = new_count; + + if ((options & meshopt_SimplifyPrune) && result_count > target_index_count && component_nexterror <= vertex_error) + result_count = pruneComponents(result, result_count, components, component_errors, component_count, vertex_error, component_nexterror); } + // we're done with the regular simplification but we're still short of the target; try pruning more aggressively towards error_limit + while ((options & meshopt_SimplifyPrune) && result_count > target_index_count && component_nexterror <= error_limit) + { #if TRACE - printf("result: %d triangles, error: %e; total %d passes\n", int(result_count), sqrtf(result_error), int(pass_count)); + printf("pass %d: cleanup; ", int(pass_count++)); #endif -#ifndef NDEBUG - if (meshopt_simplifyDebugKind) - memcpy(meshopt_simplifyDebugKind, vertex_kind, vertex_count); + float component_cutoff = component_nexterror * 1.5f < error_limit ? component_nexterror * 1.5f : error_limit; + + // track maximum error in eligible components as we are increasing resulting error + float component_maxerror = 0; + for (size_t i = 0; i < component_count; ++i) + if (component_errors[i] > component_maxerror && component_errors[i] <= component_cutoff) + component_maxerror = component_errors[i]; - if (meshopt_simplifyDebugLoop) - memcpy(meshopt_simplifyDebugLoop, loop, vertex_count * sizeof(unsigned int)); + size_t new_count = pruneComponents(result, result_count, components, component_errors, component_count, component_cutoff, component_nexterror); + if (new_count == result_count) + break; - if (meshopt_simplifyDebugLoopBack) - memcpy(meshopt_simplifyDebugLoopBack, loopback, vertex_count * sizeof(unsigned int)); + result_count = new_count; + result_error = result_error < component_maxerror ? component_maxerror : result_error; + vertex_error = vertex_error < component_maxerror ? component_maxerror : vertex_error; + } + +#if TRACE + printf("result: %d triangles, error: %e; total %d passes\n", int(result_count / 3), sqrtf(result_error), int(pass_count)); #endif + // if debug visualization data is requested, fill it instead of index data; for simplicity, this doesn't work with sparsity + if ((options & meshopt_SimplifyInternalDebug) && !sparse_remap) + { + assert(Kind_Count <= 8 && vertex_count < (1 << 28)); // 3 bit kind, 1 bit loop + + for (size_t i = 0; i < result_count; i += 3) + { + unsigned int a = result[i + 0], b = result[i + 1], c = result[i + 2]; + + result[i + 0] |= (vertex_kind[a] << 28) | (unsigned(loop[a] == b || loopback[b] == a) << 31); + result[i + 1] |= (vertex_kind[b] << 28) | (unsigned(loop[b] == c || loopback[c] == b) << 31); + result[i + 2] |= (vertex_kind[c] << 28) | (unsigned(loop[c] == a || loopback[a] == c) << 31); + } + } + + // convert resulting indices back into the dense space of the larger mesh + if (sparse_remap) + for (size_t i = 0; i < result_count; ++i) + result[i] = sparse_remap[result[i]]; + // result_error is quadratic; we need to remap it back to linear if (out_result_error) - *out_result_error = sqrtf(result_error); + *out_result_error = sqrtf(result_error) * error_scale; return result_count; } size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) { - return meshopt_simplifyEdge(destination, indices, index_count, vertex_positions_data, vertex_count, vertex_positions_stride, NULL, 0, NULL, 0, target_index_count, target_error, options, out_result_error); + return meshopt_simplifyEdge(destination, indices, index_count, vertex_positions_data, vertex_count, vertex_positions_stride, NULL, 0, NULL, 0, NULL, target_index_count, target_error, options, out_result_error); } -size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes_data, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) +size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes_data, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, const unsigned char* vertex_lock, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) { - return meshopt_simplifyEdge(destination, indices, index_count, vertex_positions_data, vertex_count, vertex_positions_stride, vertex_attributes_data, vertex_attributes_stride, attribute_weights, attribute_count, target_index_count, target_error, options, out_result_error); + return meshopt_simplifyEdge(destination, indices, index_count, vertex_positions_data, vertex_count, vertex_positions_stride, vertex_attributes_data, vertex_attributes_stride, attribute_weights, attribute_count, vertex_lock, target_index_count, target_error, options, out_result_error); } size_t meshopt_simplifySloppy(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* out_result_error) @@ -1647,19 +2113,19 @@ size_t meshopt_simplifySloppy(unsigned int* destination, const unsigned int* ind // we clamp the prediction of the grid size to make sure that the search converges int grid_size = next_grid_size; - grid_size = (grid_size <= min_grid) ? min_grid + 1 : (grid_size >= max_grid) ? max_grid - 1 : grid_size; + grid_size = (grid_size <= min_grid) ? min_grid + 1 : (grid_size >= max_grid ? max_grid - 1 : grid_size); computeVertexIds(vertex_ids, vertex_positions, vertex_count, grid_size); size_t triangles = countTriangles(vertex_ids, indices, index_count); #if TRACE printf("pass %d (%s): grid size %d, triangles %d, %s\n", - pass, (pass == 0) ? "guess" : (pass <= kInterpolationPasses) ? "lerp" : "binary", + pass, (pass == 0) ? "guess" : (pass <= kInterpolationPasses ? "lerp" : "binary"), grid_size, int(triangles), (triangles <= target_index_count / 3) ? "under" : "over"); #endif - float tip = interpolate(float(target_index_count / 3), float(min_grid), float(min_triangles), float(grid_size), float(triangles), float(max_grid), float(max_triangles)); + float tip = interpolate(float(size_t(target_index_count / 3)), float(min_grid), float(min_triangles), float(grid_size), float(triangles), float(max_grid), float(max_triangles)); if (triangles <= target_index_count / 3) { @@ -1729,12 +2195,15 @@ size_t meshopt_simplifySloppy(unsigned int* destination, const unsigned int* ind return write; } -size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_vertex_count) +size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_colors, size_t vertex_colors_stride, float color_weight, size_t target_vertex_count) { using namespace meshopt; assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256); assert(vertex_positions_stride % sizeof(float) == 0); + assert(vertex_colors_stride == 0 || (vertex_colors_stride >= 12 && vertex_colors_stride <= 256)); + assert(vertex_colors_stride % sizeof(float) == 0); + assert(vertex_colors == NULL || vertex_colors_stride != 0); assert(target_vertex_count <= vertex_count); size_t target_cell_count = target_vertex_count; @@ -1776,14 +2245,14 @@ size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_pos // we clamp the prediction of the grid size to make sure that the search converges int grid_size = next_grid_size; - grid_size = (grid_size <= min_grid) ? min_grid + 1 : (grid_size >= max_grid) ? max_grid - 1 : grid_size; + grid_size = (grid_size <= min_grid) ? min_grid + 1 : (grid_size >= max_grid ? max_grid - 1 : grid_size); computeVertexIds(vertex_ids, vertex_positions, vertex_count, grid_size); size_t vertices = countVertexCells(table, table_size, vertex_ids, vertex_count); #if TRACE printf("pass %d (%s): grid size %d, vertices %d, %s\n", - pass, (pass == 0) ? "guess" : (pass <= kInterpolationPasses) ? "lerp" : "binary", + pass, (pass == 0) ? "guess" : (pass <= kInterpolationPasses ? "lerp" : "binary"), grid_size, int(vertices), (vertices <= target_vertex_count) ? "under" : "over"); #endif @@ -1818,24 +2287,33 @@ size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_pos computeVertexIds(vertex_ids, vertex_positions, vertex_count, min_grid); size_t cell_count = fillVertexCells(table, table_size, vertex_cells, vertex_ids, vertex_count); - // build a quadric for each target cell - Quadric* cell_quadrics = allocator.allocate(cell_count); - memset(cell_quadrics, 0, cell_count * sizeof(Quadric)); + // accumulate points into a reservoir for each target cell + Reservoir* cell_reservoirs = allocator.allocate(cell_count); + memset(cell_reservoirs, 0, cell_count * sizeof(Reservoir)); - fillCellQuadrics(cell_quadrics, vertex_positions, vertex_count, vertex_cells); + fillCellReservoirs(cell_reservoirs, cell_count, vertex_positions, vertex_colors, vertex_colors_stride, vertex_count, vertex_cells); // for each target cell, find the vertex with the minimal error unsigned int* cell_remap = allocator.allocate(cell_count); float* cell_errors = allocator.allocate(cell_count); - fillCellRemap(cell_remap, cell_errors, cell_count, vertex_cells, cell_quadrics, vertex_positions, vertex_count); + // we scale the color weight to bring it to the same scale as position so that error addition makes sense + float color_weight_scaled = color_weight * (min_grid == 1 ? 1.f : 1.f / (min_grid - 1)); + + fillCellRemap(cell_remap, cell_errors, cell_count, vertex_cells, cell_reservoirs, vertex_positions, vertex_colors, vertex_colors_stride, color_weight_scaled * color_weight_scaled, vertex_count); // copy results to the output assert(cell_count <= target_vertex_count); memcpy(destination, cell_remap, sizeof(unsigned int) * cell_count); #if TRACE - printf("result: %d cells\n", int(cell_count)); + // compute error + float result_error = 0.f; + + for (size_t i = 0; i < cell_count; ++i) + result_error = result_error < cell_errors[i] ? cell_errors[i] : result_error; + + printf("result: %d cells, %e error\n", int(cell_count), sqrtf(result_error)); #endif return cell_count; diff --git a/bgfx/3rdparty/meshoptimizer/src/stripifier.cpp b/bgfx/3rdparty/meshoptimizer/src/stripifier.cpp index 8ce17ef3..4043195a 100644 --- a/bgfx/3rdparty/meshoptimizer/src/stripifier.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/stripifier.cpp @@ -10,15 +10,15 @@ namespace meshopt { -static unsigned int findStripFirst(const unsigned int buffer[][3], unsigned int buffer_size, const unsigned int* valence) +static unsigned int findStripFirst(const unsigned int buffer[][3], unsigned int buffer_size, const unsigned char* valence) { unsigned int index = 0; unsigned int iv = ~0u; for (size_t i = 0; i < buffer_size; ++i) { - unsigned int va = valence[buffer[i][0]], vb = valence[buffer[i][1]], vc = valence[buffer[i][2]]; - unsigned int v = (va < vb && va < vc) ? va : (vb < vc) ? vb : vc; + unsigned char va = valence[buffer[i][0]], vb = valence[buffer[i][1]], vc = valence[buffer[i][2]]; + unsigned int v = (va < vb && va < vc) ? va : (vb < vc ? vb : vc); if (v < iv) { @@ -71,8 +71,9 @@ size_t meshopt_stripify(unsigned int* destination, const unsigned int* indices, size_t strip_size = 0; // compute vertex valence; this is used to prioritize starting triangle for strips - unsigned int* valence = allocator.allocate(vertex_count); - memset(valence, 0, vertex_count * sizeof(unsigned int)); + // note: we use 8-bit counters for performance; for outlier vertices the valence is incorrect but that just affects the heuristic + unsigned char* valence = allocator.allocate(vertex_count); + memset(valence, 0, vertex_count); for (size_t i = 0; i < index_count; ++i) { @@ -151,7 +152,7 @@ size_t meshopt_stripify(unsigned int* destination, const unsigned int* indices, { // if we didn't find anything, we need to find the next new triangle // we use a heuristic to maximize the strip length - unsigned int i = findStripFirst(buffer, buffer_size, &valence[0]); + unsigned int i = findStripFirst(buffer, buffer_size, valence); unsigned int a = buffer[i][0], b = buffer[i][1], c = buffer[i][2]; // ordered removal from the buffer diff --git a/bgfx/3rdparty/meshoptimizer/src/vcacheoptimizer.cpp b/bgfx/3rdparty/meshoptimizer/src/vcacheoptimizer.cpp index d4b08ba3..e4ecc71d 100644 --- a/bgfx/3rdparty/meshoptimizer/src/vcacheoptimizer.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/vcacheoptimizer.cpp @@ -195,9 +195,8 @@ void meshopt_optimizeVertexCacheTable(unsigned int* destination, const unsigned TriangleAdjacency adjacency = {}; buildTriangleAdjacency(adjacency, indices, index_count, vertex_count, allocator); - // live triangle counts - unsigned int* live_triangles = allocator.allocate(vertex_count); - memcpy(live_triangles, adjacency.counts, vertex_count * sizeof(unsigned int)); + // live triangle counts; note, we alias adjacency.counts as we remove triangles after emitting them so the counts always match + unsigned int* live_triangles = adjacency.counts; // emitted flags unsigned char* emitted_flags = allocator.allocate(face_count); @@ -261,20 +260,16 @@ void meshopt_optimizeVertexCacheTable(unsigned int* destination, const unsigned unsigned int index = cache[i]; cache_new[cache_write] = index; - cache_write += (index != a && index != b && index != c); + cache_write += (index != a) & (index != b) & (index != c); } unsigned int* cache_temp = cache; cache = cache_new, cache_new = cache_temp; cache_count = cache_write > cache_size ? cache_size : cache_write; - // update live triangle counts - live_triangles[a]--; - live_triangles[b]--; - live_triangles[c]--; - // remove emitted triangle from adjacency data // this makes sure that we spend less time traversing these lists on subsequent iterations + // live triangle counts are updated as a byproduct of these adjustments for (size_t k = 0; k < 3; ++k) { unsigned int index = indices[current_triangle * 3 + k]; diff --git a/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp b/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp index 167034ba..1dbd2e35 100644 --- a/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp @@ -90,6 +90,14 @@ #include #endif +#ifndef TRACE +#define TRACE 0 +#endif + +#if TRACE +#include +#endif + #ifdef SIMD_WASM #define wasmx_splat_v32x4(v, i) wasm_i32x4_shuffle(v, v, i, i, i, i) #define wasmx_unpacklo_v8x16(a, b) wasm_i8x16_shuffle(a, b, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23) @@ -135,6 +143,19 @@ inline unsigned char unzigzag8(unsigned char v) return -(v & 1) ^ (v >> 1); } +#if TRACE +struct Stats +{ + size_t size; + size_t header; // bytes for header + size_t bitg[4]; // bytes for bit groups + size_t bitc[8]; // bit consistency: how many bits are shared between all bytes in a group +}; + +static Stats* bytestats = NULL; +static Stats vertexstats[256]; +#endif + static bool encodeBytesGroupZero(const unsigned char* buffer) { for (size_t i = 0; i < kByteGroupSize; ++i) @@ -220,7 +241,7 @@ static unsigned char* encodeBytes(unsigned char* data, unsigned char* data_end, size_t header_size = (buffer_size / kByteGroupSize + 3) / 4; if (size_t(data_end - data) < header_size) - return 0; + return NULL; data += header_size; @@ -229,7 +250,7 @@ static unsigned char* encodeBytes(unsigned char* data, unsigned char* data_end, for (size_t i = 0; i < buffer_size; i += kByteGroupSize) { if (size_t(data_end - data) < kByteGroupDecodeLimit) - return 0; + return NULL; int best_bits = 8; size_t best_size = encodeBytesGroupMeasure(buffer + i, 8); @@ -245,7 +266,7 @@ static unsigned char* encodeBytes(unsigned char* data, unsigned char* data_end, } } - int bitslog2 = (best_bits == 1) ? 0 : (best_bits == 2) ? 1 : (best_bits == 4) ? 2 : 3; + int bitslog2 = (best_bits == 1) ? 0 : (best_bits == 2 ? 1 : (best_bits == 4 ? 2 : 3)); assert((1 << bitslog2) == best_bits); size_t header_offset = i / kByteGroupSize; @@ -256,8 +277,16 @@ static unsigned char* encodeBytes(unsigned char* data, unsigned char* data_end, assert(data + best_size == next); data = next; + +#if TRACE + bytestats->bitg[bitslog2] += best_size; +#endif } +#if TRACE + bytestats->header += header_size; +#endif + return data; } @@ -286,9 +315,31 @@ static unsigned char* encodeVertexBlock(unsigned char* data, unsigned char* data vertex_offset += vertex_size; } +#if TRACE + const unsigned char* olddata = data; + bytestats = &vertexstats[k]; + + for (size_t ig = 0; ig < vertex_count; ig += kByteGroupSize) + { + unsigned char last = (ig == 0) ? last_vertex[k] : vertex_data[vertex_size * (ig - 1) + k]; + unsigned char delta = 0xff; + + for (size_t i = ig; i < ig + kByteGroupSize && i < vertex_count; ++i) + delta &= ~(vertex_data[vertex_size * i + k] ^ last); + + for (int j = 0; j < 8; ++j) + bytestats->bitc[j] += (vertex_count - ig < kByteGroupSize ? vertex_count - ig : kByteGroupSize) * ((delta >> j) & 1); + } +#endif + data = encodeBytes(data, data_end, buffer, (vertex_count + kByteGroupSize - 1) & ~(kByteGroupSize - 1)); if (!data) - return 0; + return NULL; + +#if TRACE + bytestats = NULL; + vertexstats[k].size += data - olddata; +#endif } memcpy(last_vertex, &vertex_data[vertex_size * (vertex_count - 1)], vertex_size); @@ -356,14 +407,14 @@ static const unsigned char* decodeBytes(const unsigned char* data, const unsigne size_t header_size = (buffer_size / kByteGroupSize + 3) / 4; if (size_t(data_end - data) < header_size) - return 0; + return NULL; data += header_size; for (size_t i = 0; i < buffer_size; i += kByteGroupSize) { if (size_t(data_end - data) < kByteGroupDecodeLimit) - return 0; + return NULL; size_t header_offset = i / kByteGroupSize; @@ -383,12 +434,13 @@ static const unsigned char* decodeVertexBlock(const unsigned char* data, const u unsigned char transposed[kVertexBlockSizeBytes]; size_t vertex_count_aligned = (vertex_count + kByteGroupSize - 1) & ~(kByteGroupSize - 1); + assert(vertex_count <= vertex_count_aligned); for (size_t k = 0; k < vertex_size; ++k) { data = decodeBytes(data, data_end, buffer, vertex_count_aligned); if (!data) - return 0; + return NULL; size_t vertex_offset = k; @@ -938,7 +990,7 @@ static const unsigned char* decodeBytesSimd(const unsigned char* data, const uns size_t header_size = (buffer_size / kByteGroupSize + 3) / 4; if (size_t(data_end - data) < header_size) - return 0; + return NULL; data += header_size; @@ -960,7 +1012,7 @@ static const unsigned char* decodeBytesSimd(const unsigned char* data, const uns for (; i < buffer_size; i += kByteGroupSize) { if (size_t(data_end - data) < kByteGroupDecodeLimit) - return 0; + return NULL; size_t header_offset = i / kByteGroupSize; @@ -988,7 +1040,7 @@ static const unsigned char* decodeVertexBlockSimd(const unsigned char* data, con { data = decodeBytesSimd(data, data_end, buffer + j * vertex_count_aligned, vertex_count_aligned); if (!data) - return 0; + return NULL; } #if defined(SIMD_SSE) || defined(SIMD_AVX) @@ -1095,6 +1147,10 @@ size_t meshopt_encodeVertexBuffer(unsigned char* buffer, size_t buffer_size, con assert(vertex_size > 0 && vertex_size <= 256); assert(vertex_size % 4 == 0); +#if TRACE + memset(vertexstats, 0, sizeof(vertexstats)); +#endif + const unsigned char* vertex_data = static_cast(vertices); unsigned char* data = buffer; @@ -1147,6 +1203,30 @@ size_t meshopt_encodeVertexBuffer(unsigned char* buffer, size_t buffer_size, con assert(data >= buffer + tail_size); assert(data <= buffer + buffer_size); +#if TRACE + size_t total_size = data - buffer; + + for (size_t k = 0; k < vertex_size; ++k) + { + const Stats& vsk = vertexstats[k]; + + printf("%2d: %7d bytes [%4.1f%%] %.1f bpv", int(k), int(vsk.size), double(vsk.size) / double(total_size) * 100, double(vsk.size) / double(vertex_count) * 8); + + size_t total_k = vsk.header + vsk.bitg[0] + vsk.bitg[1] + vsk.bitg[2] + vsk.bitg[3]; + + printf(" |\thdr [%5.1f%%] bitg 1-3 [%4.1f%% %4.1f%% %4.1f%%]", + double(vsk.header) / double(total_k) * 100, double(vsk.bitg[1]) / double(total_k) * 100, + double(vsk.bitg[2]) / double(total_k) * 100, double(vsk.bitg[3]) / double(total_k) * 100); + + printf(" |\tbitc [%3.0f%% %3.0f%% %3.0f%% %3.0f%% %3.0f%% %3.0f%% %3.0f%% %3.0f%%]", + double(vsk.bitc[0]) / double(vertex_count) * 100, double(vsk.bitc[1]) / double(vertex_count) * 100, + double(vsk.bitc[2]) / double(vertex_count) * 100, double(vsk.bitc[3]) / double(vertex_count) * 100, + double(vsk.bitc[4]) / double(vertex_count) * 100, double(vsk.bitc[5]) / double(vertex_count) * 100, + double(vsk.bitc[6]) / double(vertex_count) * 100, double(vsk.bitc[7]) / double(vertex_count) * 100); + printf("\n"); + } +#endif + return data - buffer; } @@ -1182,7 +1262,7 @@ int meshopt_decodeVertexBuffer(void* destination, size_t vertex_count, size_t ve assert(vertex_size > 0 && vertex_size <= 256); assert(vertex_size % 4 == 0); - const unsigned char* (*decode)(const unsigned char*, const unsigned char*, unsigned char*, size_t, size_t, unsigned char[256]) = 0; + const unsigned char* (*decode)(const unsigned char*, const unsigned char*, unsigned char*, size_t, size_t, unsigned char[256]) = NULL; #if defined(SIMD_SSE) && defined(SIMD_FALLBACK) decode = (cpuid & (1 << 9)) ? decodeVertexBlockSimd : decodeVertexBlock; @@ -1246,3 +1326,4 @@ int meshopt_decodeVertexBuffer(void* destination, size_t vertex_count, size_t ve #undef SIMD_WASM #undef SIMD_FALLBACK #undef SIMD_TARGET +#undef SIMD_LATENCYOPT diff --git a/bgfx/3rdparty/meshoptimizer/src/vertexfilter.cpp b/bgfx/3rdparty/meshoptimizer/src/vertexfilter.cpp index 4b5f444f..1f456bb9 100644 --- a/bgfx/3rdparty/meshoptimizer/src/vertexfilter.cpp +++ b/bgfx/3rdparty/meshoptimizer/src/vertexfilter.cpp @@ -807,7 +807,7 @@ inline int optlog2(float v) u.f = v; // +1 accounts for implicit 1. in mantissa; denormalized numbers will end up clamped to min_exp by calling code - return u.ui == 0 ? 0 : int((u.ui >> 23) & 0xff) - 127 + 1; + return v == 0 ? 0 : int((u.ui >> 23) & 0xff) - 127 + 1; } // optimized variant of ldexp @@ -1010,6 +1010,20 @@ void meshopt_encodeFilterExp(void* destination_, size_t count, size_t stride, in component_exp[j] = (min_exp < e) ? e : min_exp; } } + else if (mode == meshopt_EncodeExpClamped) + { + for (size_t j = 0; j < stride_float; ++j) + { + int e = optlog2(v[j]); + + component_exp[j] = (0 < e) ? e : 0; + } + } + else + { + // the code below assumes component_exp is initialized outside of the loop + assert(mode == meshopt_EncodeExpSharedComponent); + } for (size_t j = 0; j < stride_float; ++j) { @@ -1020,7 +1034,6 @@ void meshopt_encodeFilterExp(void* destination_, size_t count, size_t stride, in // compute renormalized rounded mantissa for each component int mmask = (1 << 24) - 1; - int m = int(v[j] * optexp2(-exp) + (v[j] >= 0 ? 0.5f : -0.5f)); d[j] = (m & mmask) | (unsigned(exp) << 24); diff --git a/bgfx/3rdparty/spirv-cross/main.cpp b/bgfx/3rdparty/spirv-cross/main.cpp index d8aff152..6361fc8a 100644 --- a/bgfx/3rdparty/spirv-cross/main.cpp +++ b/bgfx/3rdparty/spirv-cross/main.cpp @@ -675,8 +675,13 @@ struct CLIArguments bool msl_force_sample_rate_shading = false; bool msl_manual_helper_invocation_updates = true; bool msl_check_discarded_frag_stores = false; + bool msl_force_fragment_with_side_effects_execution = false; bool msl_sample_dref_lod_array_as_grad = false; bool msl_runtime_array_rich_descriptor = false; + bool msl_replace_recursive_inputs = false; + bool msl_readwrite_texture_fences = true; + bool msl_agx_manual_cube_grad_fixup = false; + bool msl_input_attachment_is_ds_attachment = false; const char *msl_combined_sampler_suffix = nullptr; bool glsl_emit_push_constant_as_ubo = false; bool glsl_emit_ubo_as_plain_uniforms = false; @@ -867,7 +872,12 @@ static void print_help_msl() "\t\tUses same values as Metal MTLArgumentBuffersTier enumeration (0 = Tier1, 1 = Tier2).\n" "\t\tNOTE: Setting this value no longer enables msl-argument-buffers implicitly.\n" "\t[--msl-runtime-array-rich-descriptor]:\n\t\tWhen declaring a runtime array of SSBOs, declare an array of {ptr, len} pairs to support OpArrayLength.\n" + "\t[--msl-replace-recursive-inputs]:\n\t\tWorks around a Metal 3.1 regression bug, which causes an infinite recursion crash during Metal's analysis of an entry point input structure that itself contains internal recursion.\n" "\t[--msl-texture-buffer-native]:\n\t\tEnable native support for texel buffers. Otherwise, it is emulated as a normal texture.\n" + "\t[--msl-input-attachment-is-ds-attachment]:\n\t\tAdds a simple depth passthrough in fragment shaders when they do not modify the depth value.\n" + "\t\tRequired to force Metal to write to the depth/stencil attachment post fragment execution.\n" + "\t\tOtherwise, Metal may optimize the write to pre fragment execution which goes against the Vulkan spec.\n" + "\t\tOnly required if an input attachment and depth/stencil attachment reference the same resource.\n" "\t[--msl-framebuffer-fetch]:\n\t\tImplement subpass inputs with frame buffer fetch.\n" "\t\tEmits [[color(N)]] inputs in fragment stage.\n" "\t\tRequires an Apple GPU.\n" @@ -952,10 +962,27 @@ static void print_help_msl() "\t\tSome Metal devices have a bug where stores to resources from a fragment shader\n" "\t\tcontinue to execute, even when the fragment is discarded. These checks\n" "\t\tprevent these stores from executing.\n" + "\t[--msl-force-frag-execution]:\n\t\tEnforces fragment execution to avoid early discard by Metal\n" + "\t\tMetal will prematurely discard fragments before execution when side effects are present.\n" + "\t\tThis condition is triggered under the following conditions (side effect operations happen before discard):\n" + "\t\t\t1. Pre fragment depth test fails.\n" + "\t\t\t2. Modify depth value in fragment shader to constant value known at compile time.\n" + "\t\t\t3. Constant value will not pass post fragment depth test.\n" + "\t\t\t4. Fragment is always discarded in fragment execution.\n" + "\t\tHowever, Vulkan expects fragment shader to be executed since it cannot be discarded until the discard\n" + "\t\tpresent in the fragment execution, which would also execute the operations with side effects.\n" "\t[--msl-sample-dref-lod-array-as-grad]:\n\t\tUse a gradient instead of a level argument.\n" "\t\tSome Metal devices have a bug where the level() argument to\n" "\t\tdepth2d_array::sample_compare() in a fragment shader is biased by some\n" "\t\tunknown amount. This prevents the bias from being added.\n" + "\t[--msl-no-readwrite-texture-fences]:\n\t\tDo not insert fences before each read of a\n" + "\t\tread_write texture. MSL does not guarantee coherence between writes and later reads\n" + "\t\tof read_write textures. If you don't rely on this, you can disable this for a\n" + "\t\tpossible performance improvement.\n" + "\t[--msl-agx-manual-cube-grad-fixup]:\n\t\tManually transform cube texture gradients.\n" + "\t\tAll released Apple Silicon GPUs to date ignore one of the three partial derivatives\n" + "\t\tbased on the selected major axis, and expect the remaining derivatives to be\n" + "\t\tpartially transformed. This fixup gives correct results on Apple Silicon.\n" "\t[--msl-combined-sampler-suffix ]:\n\t\tUses a custom suffix for combined samplers.\n"); // clang-format on } @@ -1230,9 +1257,14 @@ static string compile_iteration(const CLIArguments &args, std::vector msl_opts.force_sample_rate_shading = args.msl_force_sample_rate_shading; msl_opts.manual_helper_invocation_updates = args.msl_manual_helper_invocation_updates; msl_opts.check_discarded_frag_stores = args.msl_check_discarded_frag_stores; + msl_opts.force_fragment_with_side_effects_execution = args.msl_force_fragment_with_side_effects_execution; msl_opts.sample_dref_lod_array_as_grad = args.msl_sample_dref_lod_array_as_grad; msl_opts.ios_support_base_vertex_instance = true; msl_opts.runtime_array_rich_descriptor = args.msl_runtime_array_rich_descriptor; + msl_opts.replace_recursive_inputs = args.msl_replace_recursive_inputs; + msl_opts.input_attachment_is_ds_attachment = args.msl_input_attachment_is_ds_attachment; + msl_opts.readwrite_texture_fences = args.msl_readwrite_texture_fences; + msl_opts.agx_manual_cube_grad_fixup = args.msl_agx_manual_cube_grad_fixup; msl_comp->set_msl_options(msl_opts); for (auto &v : args.msl_discrete_descriptor_sets) msl_comp->add_discrete_descriptor_set(v); @@ -1785,13 +1817,19 @@ static int main_inner(int argc, char *argv[]) cbs.add("--msl-no-manual-helper-invocation-updates", [&args](CLIParser &) { args.msl_manual_helper_invocation_updates = false; }); cbs.add("--msl-check-discarded-frag-stores", [&args](CLIParser &) { args.msl_check_discarded_frag_stores = true; }); + cbs.add("--msl-force-frag-with-side-effects-execution", [&args](CLIParser &) { args.msl_force_fragment_with_side_effects_execution = true; }); cbs.add("--msl-sample-dref-lod-array-as-grad", [&args](CLIParser &) { args.msl_sample_dref_lod_array_as_grad = true; }); + cbs.add("--msl-no-readwrite-texture-fences", [&args](CLIParser &) { args.msl_readwrite_texture_fences = false; }); + cbs.add("--msl-agx-manual-cube-grad-fixup", [&args](CLIParser &) { args.msl_agx_manual_cube_grad_fixup = true; }); cbs.add("--msl-combined-sampler-suffix", [&args](CLIParser &parser) { args.msl_combined_sampler_suffix = parser.next_string(); }); cbs.add("--msl-runtime-array-rich-descriptor", [&args](CLIParser &) { args.msl_runtime_array_rich_descriptor = true; }); + cbs.add("--msl-replace-recursive-inputs", + [&args](CLIParser &) { args.msl_replace_recursive_inputs = true; }); + cbs.add("--msl-input-attachment-is-ds-attachment", [&args](CLIParser &) { args.msl_input_attachment_is_ds_attachment = true; }); cbs.add("--extension", [&args](CLIParser &parser) { args.extensions.push_back(parser.next_string()); }); cbs.add("--rename-entry-point", [&args](CLIParser &parser) { auto old_name = parser.next_string(); diff --git a/bgfx/3rdparty/spirv-cross/spirv.h b/bgfx/3rdparty/spirv-cross/spirv.h index 5b6e8aaf..398e6c55 100644 --- a/bgfx/3rdparty/spirv-cross/spirv.h +++ b/bgfx/3rdparty/spirv-cross/spirv.h @@ -1,5 +1,5 @@ /* -** Copyright (c) 2014-2020 The Khronos Group Inc. +** 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"), @@ -509,6 +509,9 @@ typedef enum SpvDecoration_ { SpvDecorationMaxByteOffsetId = 47, SpvDecorationNoSignedWrap = 4469, SpvDecorationNoUnsignedWrap = 4470, + SpvDecorationWeightTextureQCOM = 4487, + SpvDecorationBlockMatchTextureQCOM = 4488, + SpvDecorationBlockMatchSamplerQCOM = 4499, SpvDecorationExplicitInterpAMD = 4999, SpvDecorationOverrideCoverageNV = 5248, SpvDecorationPassthroughNV = 5250, @@ -991,6 +994,10 @@ typedef enum SpvCapability_ { SpvCapabilityRayQueryKHR = 4472, SpvCapabilityRayTraversalPrimitiveCullingKHR = 4478, SpvCapabilityRayTracingKHR = 4479, + SpvCapabilityTextureSampleWeightedQCOM = 4484, + SpvCapabilityTextureBoxFilterQCOM = 4485, + SpvCapabilityTextureBlockMatchQCOM = 4486, + SpvCapabilityTextureBlockMatch2QCOM = 4498, SpvCapabilityFloat16ImageAMD = 5008, SpvCapabilityImageGatherBiasLodAMD = 5009, SpvCapabilityFragmentMaskAMD = 5010, @@ -1596,6 +1603,14 @@ typedef enum SpvOp_ { SpvOpRayQueryConfirmIntersectionKHR = 4476, SpvOpRayQueryProceedKHR = 4477, SpvOpRayQueryGetIntersectionTypeKHR = 4479, + SpvOpImageSampleWeightedQCOM = 4480, + SpvOpImageBoxFilterQCOM = 4481, + SpvOpImageBlockMatchSSDQCOM = 4482, + SpvOpImageBlockMatchSADQCOM = 4483, + SpvOpImageBlockMatchWindowSSDQCOM = 4500, + SpvOpImageBlockMatchWindowSADQCOM = 4501, + SpvOpImageBlockMatchGatherSSDQCOM = 4502, + SpvOpImageBlockMatchGatherSADQCOM = 4503, SpvOpGroupIAddNonUniformAMD = 5000, SpvOpGroupFAddNonUniformAMD = 5001, SpvOpGroupFMinNonUniformAMD = 5002, @@ -2271,6 +2286,14 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; case SpvOpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; case SpvOpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; case SpvOpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case SpvOpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case SpvOpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; diff --git a/bgfx/3rdparty/spirv-cross/spirv.hpp b/bgfx/3rdparty/spirv-cross/spirv.hpp index e25264af..5047b9b3 100644 --- a/bgfx/3rdparty/spirv-cross/spirv.hpp +++ b/bgfx/3rdparty/spirv-cross/spirv.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2020 The Khronos Group Inc. +// 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"), @@ -505,6 +505,9 @@ enum Decoration { DecorationMaxByteOffsetId = 47, DecorationNoSignedWrap = 4469, DecorationNoUnsignedWrap = 4470, + DecorationWeightTextureQCOM = 4487, + DecorationBlockMatchTextureQCOM = 4488, + DecorationBlockMatchSamplerQCOM = 4499, DecorationExplicitInterpAMD = 4999, DecorationOverrideCoverageNV = 5248, DecorationPassthroughNV = 5250, @@ -987,6 +990,10 @@ enum Capability { CapabilityRayQueryKHR = 4472, CapabilityRayTraversalPrimitiveCullingKHR = 4478, CapabilityRayTracingKHR = 4479, + CapabilityTextureSampleWeightedQCOM = 4484, + CapabilityTextureBoxFilterQCOM = 4485, + CapabilityTextureBlockMatchQCOM = 4486, + CapabilityTextureBlockMatch2QCOM = 4498, CapabilityFloat16ImageAMD = 5008, CapabilityImageGatherBiasLodAMD = 5009, CapabilityFragmentMaskAMD = 5010, @@ -1592,6 +1599,14 @@ enum Op { OpRayQueryConfirmIntersectionKHR = 4476, OpRayQueryProceedKHR = 4477, OpRayQueryGetIntersectionTypeKHR = 4479, + OpImageSampleWeightedQCOM = 4480, + OpImageBoxFilterQCOM = 4481, + OpImageBlockMatchSSDQCOM = 4482, + OpImageBlockMatchSADQCOM = 4483, + OpImageBlockMatchWindowSSDQCOM = 4500, + OpImageBlockMatchWindowSADQCOM = 4501, + OpImageBlockMatchGatherSSDQCOM = 4502, + OpImageBlockMatchGatherSADQCOM = 4503, OpGroupIAddNonUniformAMD = 5000, OpGroupFAddNonUniformAMD = 5001, OpGroupFMinNonUniformAMD = 5002, @@ -2267,6 +2282,14 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; case OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; case OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case OpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; diff --git a/bgfx/3rdparty/spirv-cross/spirv_common.hpp b/bgfx/3rdparty/spirv-cross/spirv_common.hpp index 3bf55833..93b26697 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_common.hpp +++ b/bgfx/3rdparty/spirv-cross/spirv_common.hpp @@ -220,7 +220,7 @@ static inline std::string convert_to_string(int32_t value) // INT_MIN is ... special on some backends. If we use a decimal literal, and negate it, we // could accidentally promote the literal to long first, then negate. // To workaround it, emit int(0x80000000) instead. - if (value == std::numeric_limits::min()) + if (value == (std::numeric_limits::min)()) return "int(0x80000000)"; else return std::to_string(value); @@ -231,7 +231,7 @@ static inline std::string convert_to_string(int64_t value, const std::string &in // INT64_MIN is ... special on some backends. // If we use a decimal literal, and negate it, we might overflow the representable numbers. // To workaround it, emit int(0x80000000) instead. - if (value == std::numeric_limits::min()) + if (value == (std::numeric_limits::min)()) return join(int64_type, "(0x8000000000000000u", (long_long_literal_suffix ? "ll" : "l"), ")"); else return std::to_string(value) + (long_long_literal_suffix ? "ll" : "l"); @@ -295,6 +295,20 @@ inline std::string convert_to_string(double t, char locale_radix_point) return buf; } +#if defined(__clang__) || defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif + +class FloatFormatter +{ +public: + virtual ~FloatFormatter() = default; + virtual std::string format_float(float value) = 0; + virtual std::string format_double(double value) = 0; +}; + template struct ValueSaver { @@ -318,12 +332,6 @@ struct ValueSaver T saved; }; -#if defined(__clang__) || defined(__GNUC__) -#pragma GCC diagnostic pop -#elif defined(_MSC_VER) -#pragma warning(pop) -#endif - struct Instruction { uint16_t op = 0; @@ -540,6 +548,9 @@ struct SPIRType : IVariant type = TypeType }; + spv::Op op = spv::Op::OpNop; + explicit SPIRType(spv::Op op_) : op(op_) {} + enum BaseType { Unknown, @@ -610,7 +621,7 @@ struct SPIRType : IVariant uint32_t sampled; spv::ImageFormat format; spv::AccessQualifier access; - } image; + } image = {}; // Structs can be declared multiple times if they are used as part of interface blocks. // We want to detect this so that we only emit the struct definition once. @@ -1110,6 +1121,9 @@ struct SPIRVariable : IVariant // Set to true while we're inside the for loop. bool loop_variable_enable = false; + // Used to find global LUTs + bool is_written_to = false; + SPIRFunction::Parameter *parameter = nullptr; SPIRV_CROSS_DECLARE_CLONE(SPIRVariable) @@ -1657,6 +1671,8 @@ enum ExtendedDecorations // lack of constructors in the 'threadgroup' address space. SPIRVCrossDecorationWorkgroupStruct, + SPIRVCrossDecorationOverlappingBinding, + SPIRVCrossDecorationCount }; @@ -1685,6 +1701,7 @@ struct Meta uint32_t index = 0; spv::FPRoundingMode fp_rounding_mode = spv::FPRoundingModeMax; bool builtin = false; + bool qualified_alias_explicit_override = false; struct Extended { diff --git a/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp b/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp index dd0a84c8..61c30e9e 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp +++ b/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp @@ -40,7 +40,7 @@ void CompilerCPP::emit_buffer_block(const SPIRVariable &var) emit_block_struct(type); auto buffer_name = to_name(type.self); - statement("internal::Resource<", buffer_name, type_to_array_glsl(type), "> ", instance_name, "__;"); + statement("internal::Resource<", buffer_name, type_to_array_glsl(type, var.self), "> ", instance_name, "__;"); statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()"); resource_registrations.push_back( join("s.register_resource(", instance_name, "__", ", ", descriptor_set, ", ", binding, ");")); @@ -68,7 +68,7 @@ void CompilerCPP::emit_interface_block(const SPIRVariable &var) else buffer_name = type_to_glsl(type); - statement("internal::", qual, "<", buffer_name, type_to_array_glsl(type), "> ", instance_name, "__;"); + statement("internal::", qual, "<", buffer_name, type_to_array_glsl(type, var.self), "> ", instance_name, "__;"); statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()"); resource_registrations.push_back(join("s.register_", lowerqual, "(", instance_name, "__", ", ", location, ");")); statement(""); @@ -100,14 +100,14 @@ void CompilerCPP::emit_uniform(const SPIRVariable &var) if (type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage || type.basetype == SPIRType::AtomicCounter) { - statement("internal::Resource<", type_name, type_to_array_glsl(type), "> ", instance_name, "__;"); + statement("internal::Resource<", type_name, type_to_array_glsl(type, var.self), "> ", instance_name, "__;"); statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()"); resource_registrations.push_back( join("s.register_resource(", instance_name, "__", ", ", descriptor_set, ", ", binding, ");")); } else { - statement("internal::UniformConstant<", type_name, type_to_array_glsl(type), "> ", instance_name, "__;"); + statement("internal::UniformConstant<", type_name, type_to_array_glsl(type, var.self), "> ", instance_name, "__;"); statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()"); resource_registrations.push_back( join("s.register_uniform_constant(", instance_name, "__", ", ", location, ");")); @@ -130,7 +130,7 @@ void CompilerCPP::emit_push_constant_block(const SPIRVariable &var) auto buffer_name = to_name(type.self); auto instance_name = to_name(var.self); - statement("internal::PushConstant<", buffer_name, type_to_array_glsl(type), "> ", instance_name, ";"); + statement("internal::PushConstant<", buffer_name, type_to_array_glsl(type, var.self), "> ", instance_name, ";"); statement_no_indent("#define ", instance_name, " __res->", instance_name, ".get()"); resource_registrations.push_back(join("s.register_push_constant(", instance_name, "__", ");")); statement(""); diff --git a/bgfx/3rdparty/spirv-cross/spirv_cross.cpp b/bgfx/3rdparty/spirv-cross/spirv_cross.cpp index c1c6a11d..5471b351 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_cross.cpp +++ b/bgfx/3rdparty/spirv-cross/spirv_cross.cpp @@ -93,6 +93,97 @@ bool Compiler::variable_storage_is_aliased(const SPIRVariable &v) return !is_restrict && (ssbo || image || counter || buffer_reference); } +bool Compiler::block_is_control_dependent(const SPIRBlock &block) +{ + for (auto &i : block.ops) + { + auto ops = stream(i); + auto op = static_cast(i.op); + + switch (op) + { + case OpFunctionCall: + { + uint32_t func = ops[2]; + if (function_is_control_dependent(get(func))) + return true; + break; + } + + // Derivatives + case OpDPdx: + case OpDPdxCoarse: + case OpDPdxFine: + case OpDPdy: + case OpDPdyCoarse: + case OpDPdyFine: + case OpFwidth: + case OpFwidthCoarse: + case OpFwidthFine: + + // Anything implicit LOD + case OpImageSampleImplicitLod: + case OpImageSampleDrefImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleProjDrefImplicitLod: + case OpImageSparseSampleImplicitLod: + case OpImageSparseSampleDrefImplicitLod: + case OpImageSparseSampleProjImplicitLod: + case OpImageSparseSampleProjDrefImplicitLod: + case OpImageQueryLod: + case OpImageDrefGather: + case OpImageGather: + case OpImageSparseDrefGather: + case OpImageSparseGather: + + // Anything subgroups + case OpGroupNonUniformElect: + case OpGroupNonUniformAll: + case OpGroupNonUniformAny: + case OpGroupNonUniformAllEqual: + case OpGroupNonUniformBroadcast: + case OpGroupNonUniformBroadcastFirst: + case OpGroupNonUniformBallot: + case OpGroupNonUniformInverseBallot: + case OpGroupNonUniformBallotBitExtract: + case OpGroupNonUniformBallotBitCount: + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + case OpGroupNonUniformShuffle: + case OpGroupNonUniformShuffleXor: + case OpGroupNonUniformShuffleUp: + case OpGroupNonUniformShuffleDown: + case OpGroupNonUniformIAdd: + case OpGroupNonUniformFAdd: + case OpGroupNonUniformIMul: + case OpGroupNonUniformFMul: + case OpGroupNonUniformSMin: + case OpGroupNonUniformUMin: + case OpGroupNonUniformFMin: + case OpGroupNonUniformSMax: + case OpGroupNonUniformUMax: + case OpGroupNonUniformFMax: + case OpGroupNonUniformBitwiseAnd: + case OpGroupNonUniformBitwiseOr: + case OpGroupNonUniformBitwiseXor: + case OpGroupNonUniformLogicalAnd: + case OpGroupNonUniformLogicalOr: + case OpGroupNonUniformLogicalXor: + case OpGroupNonUniformQuadBroadcast: + case OpGroupNonUniformQuadSwap: + + // Control barriers + case OpControlBarrier: + return true; + + default: + break; + } + } + + return false; +} + bool Compiler::block_is_pure(const SPIRBlock &block) { // This is a global side effect of the function. @@ -247,18 +338,21 @@ string Compiler::to_name(uint32_t id, bool allow_alias) const bool Compiler::function_is_pure(const SPIRFunction &func) { for (auto block : func.blocks) - { if (!block_is_pure(get(block))) - { - //fprintf(stderr, "Function %s is impure!\n", to_name(func.self).c_str()); return false; - } - } - //fprintf(stderr, "Function %s is pure!\n", to_name(func.self).c_str()); return true; } +bool Compiler::function_is_control_dependent(const SPIRFunction &func) +{ + for (auto block : func.blocks) + if (block_is_control_dependent(get(block))) + return true; + + return false; +} + void Compiler::register_global_read_dependencies(const SPIRBlock &block, uint32_t id) { for (auto &i : block.ops) @@ -627,15 +721,29 @@ bool Compiler::is_matrix(const SPIRType &type) const bool Compiler::is_array(const SPIRType &type) const { - return !type.array.empty(); + return type.op == OpTypeArray || type.op == OpTypeRuntimeArray; +} + +bool Compiler::is_pointer(const SPIRType &type) const +{ + return type.op == OpTypePointer && type.basetype != SPIRType::Unknown; // Ignore function pointers. +} + +bool Compiler::is_physical_pointer(const SPIRType &type) const +{ + return type.op == OpTypePointer && type.storage == StorageClassPhysicalStorageBuffer; +} + +bool Compiler::is_physical_pointer_to_buffer_block(const SPIRType &type) const +{ + return is_physical_pointer(type) && get_pointee_type(type).self == type.parent_type && + (has_decoration(type.self, DecorationBlock) || + has_decoration(type.self, DecorationBufferBlock)); } bool Compiler::is_runtime_size_array(const SPIRType &type) { - if (type.array.empty()) - return false; - assert(type.array.size() == type.array_size_literal.size()); - return type.array_size_literal.back() && type.array.back() == 0; + return type.op == OpTypeRuntimeArray; } ShaderResources Compiler::get_shader_resources() const @@ -1048,20 +1156,25 @@ ShaderResources Compiler::get_shader_resources(const unordered_set * return res; } -bool Compiler::type_is_block_like(const SPIRType &type) const +bool Compiler::type_is_top_level_block(const SPIRType &type) const { if (type.basetype != SPIRType::Struct) return false; + return has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock); +} - if (has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock)) - { +bool Compiler::type_is_block_like(const SPIRType &type) const +{ + if (type_is_top_level_block(type)) return true; - } - // Block-like types may have Offset decorations. - for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) - if (has_member_decoration(type.self, i, DecorationOffset)) - return true; + if (type.basetype == SPIRType::Struct) + { + // Block-like types may have Offset decorations. + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + if (has_member_decoration(type.self, i, DecorationOffset)) + return true; + } return false; } @@ -1208,7 +1321,7 @@ const SPIRType &Compiler::get_pointee_type(uint32_t type_id) const uint32_t Compiler::get_variable_data_type_id(const SPIRVariable &var) const { - if (var.phi_variable) + if (var.phi_variable || var.storage == spv::StorageClass::StorageClassAtomicCounter) return var.basetype; return get_pointee_type_id(var.basetype); } @@ -1737,6 +1850,11 @@ const SmallVector &Compiler::get_case_list(const SPIRBlock &blo const auto &type = get(constant->constant_type); width = type.width; } + else if (const auto *op = maybe_get(block.condition)) + { + const auto &type = get(op->basetype); + width = type.width; + } else if (const auto *var = maybe_get(block.condition)) { const auto &type = get(var->basetype); @@ -2733,8 +2851,8 @@ void Compiler::CombinedImageSamplerHandler::register_combined_image_sampler(SPIR auto ptr_type_id = id + 1; auto combined_id = id + 2; auto &base = compiler.expression_type(image_id); - auto &type = compiler.set(type_id); - auto &ptr_type = compiler.set(ptr_type_id); + auto &type = compiler.set(type_id, OpTypeSampledImage); + auto &ptr_type = compiler.set(ptr_type_id, OpTypePointer); type = base; type.self = type_id; @@ -2993,7 +3111,7 @@ bool Compiler::CombinedImageSamplerHandler::handle(Op opcode, const uint32_t *ar { // Have to invent the sampled image type. sampled_type = compiler.ir.increase_bound_by(1); - auto &type = compiler.set(sampled_type); + auto &type = compiler.set(sampled_type, OpTypeSampledImage); type = compiler.expression_type(args[2]); type.self = sampled_type; type.basetype = SPIRType::SampledImage; @@ -3012,7 +3130,7 @@ bool Compiler::CombinedImageSamplerHandler::handle(Op opcode, const uint32_t *ar // Make a new type, pointer to OpTypeSampledImage, so we can make a variable of this type. // We will probably have this type lying around, but it doesn't hurt to make duplicates for internal purposes. - auto &type = compiler.set(type_id); + auto &type = compiler.set(type_id, OpTypePointer); auto &base = compiler.get(sampled_type); type = base; type.pointer = true; @@ -3058,11 +3176,10 @@ VariableID Compiler::build_dummy_sampler_for_combined_images() auto ptr_type_id = offset + 1; auto var_id = offset + 2; - SPIRType sampler_type; - auto &sampler = set(type_id); + auto &sampler = set(type_id, OpTypeSampler); sampler.basetype = SPIRType::Sampler; - auto &ptr_sampler = set(ptr_type_id); + auto &ptr_sampler = set(ptr_type_id, OpTypePointer); ptr_sampler = sampler; ptr_sampler.self = type_id; ptr_sampler.storage = StorageClassUniformConstant; @@ -3317,13 +3434,11 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle_terminator(const SPIRBl bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint32_t *args, uint32_t length) { // Keep track of the types of temporaries, so we can hoist them out as necessary. - uint32_t result_type, result_id; + uint32_t result_type = 0, result_id = 0; if (compiler.instruction_to_result_type(result_type, result_id, op, args, length)) { // For some opcodes, we will need to override the result id. // If we need to hoist the temporary, the temporary type is the input, not the result. - // FIXME: This will likely break with OpCopyObject + hoisting, but we'll have to - // solve it if we ever get there ... if (op == OpConvertUToAccelerationStructureKHR) { auto itr = result_id_to_type.find(args[2]); @@ -3432,6 +3547,13 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3 case OpCopyObject: { + // OpCopyObject copies the underlying non-pointer type, + // so any temp variable should be declared using the underlying type. + // If the type is a pointer, get its base type and overwrite the result type mapping. + auto &type = compiler.get(result_type); + if (type.pointer) + result_id_to_type[result_id] = type.parent_type; + if (length < 3) return false; @@ -3713,6 +3835,14 @@ void Compiler::find_function_local_luts(SPIRFunction &entry, const AnalyzeVariab auto &var = get(accessed_var.first); auto &type = expression_type(accessed_var.first); + // First check if there are writes to the variable. Later, if there are none, we'll + // reconsider it as globally accessed LUT. + if (!var.is_written_to) + { + var.is_written_to = handler.complete_write_variables_to_block.count(var.self) != 0 || + handler.partial_write_variables_to_block.count(var.self) != 0; + } + // Only consider function local variables here. // If we only have a single function in our CFG, private storage is also fine, // since it behaves like a function local variable. @@ -3737,8 +3867,7 @@ void Compiler::find_function_local_luts(SPIRFunction &entry, const AnalyzeVariab static_constant_expression = var.initializer; // There can be no stores to this variable, we have now proved we have a LUT. - if (handler.complete_write_variables_to_block.count(var.self) != 0 || - handler.partial_write_variables_to_block.count(var.self) != 0) + if (var.is_written_to) continue; } else @@ -4405,11 +4534,9 @@ bool Compiler::ActiveBuiltinHandler::handle(spv::Op opcode, const uint32_t *args for (uint32_t i = 0; i < count; i++) { // Pointers + // PtrAccessChain functions more like a pointer offset. Type remains the same. if (opcode == OpPtrAccessChain && i == 0) - { - type = &compiler.get(type->parent_type); continue; - } // Arrays if (!type->array.empty()) @@ -4597,6 +4724,29 @@ void Compiler::build_function_control_flow_graphs_and_analyze() } } } + + // Find LUTs which are not function local. Only consider this case if the CFG is multi-function, + // otherwise we treat Private as Function trivially. + // Needs to be analyzed from the outside since we have to block the LUT optimization if at least + // one function writes to it. + if (!single_function) + { + for (auto &id : global_variables) + { + auto &var = get(id); + auto &type = get_variable_data_type(var); + + if (is_array(type) && var.storage == StorageClassPrivate && + var.initializer && !var.is_written_to && + ir.ids[var.initializer].get_type() == TypeConstant) + { + get(var.initializer).is_used_as_lut = true; + var.static_expression = var.initializer; + var.statically_assigned = true; + var.remapped_variable = true; + } + } + } } Compiler::CFGBuilder::CFGBuilder(Compiler &compiler_) @@ -5013,8 +5163,7 @@ void Compiler::PhysicalStorageBufferPointerHandler::mark_aligned_access(uint32_t bool Compiler::PhysicalStorageBufferPointerHandler::type_is_bda_block_entry(uint32_t type_id) const { auto &type = compiler.get(type_id); - return type.storage == StorageClassPhysicalStorageBufferEXT && type.pointer && - type.pointer_depth == 1 && !compiler.type_is_array_of_pointers(type); + return compiler.is_physical_pointer(type); } uint32_t Compiler::PhysicalStorageBufferPointerHandler::get_minimum_scalar_alignment(const SPIRType &type) const @@ -5044,7 +5193,8 @@ void Compiler::PhysicalStorageBufferPointerHandler::setup_meta_chain(uint32_t ty access_chain_to_physical_block[var_id] = &meta; auto &type = compiler.get(type_id); - if (type.basetype != SPIRType::Struct) + + if (!compiler.is_physical_pointer_to_buffer_block(type)) non_block_types.insert(type_id); if (meta.alignment == 0) @@ -5103,9 +5253,7 @@ bool Compiler::PhysicalStorageBufferPointerHandler::handle(Op op, const uint32_t uint32_t Compiler::PhysicalStorageBufferPointerHandler::get_base_non_block_type_id(uint32_t type_id) const { auto *type = &compiler.get(type_id); - while (type->pointer && - type->storage == StorageClassPhysicalStorageBufferEXT && - !type_is_bda_block_entry(type_id)) + while (compiler.is_physical_pointer(*type) && !type_is_bda_block_entry(type_id)) { type_id = type->parent_type; type = &compiler.get(type_id); @@ -5120,12 +5268,10 @@ void Compiler::PhysicalStorageBufferPointerHandler::analyze_non_block_types_from for (auto &member : type.member_types) { auto &subtype = compiler.get(member); - if (subtype.basetype != SPIRType::Struct && subtype.pointer && - subtype.storage == spv::StorageClassPhysicalStorageBufferEXT) - { + + if (compiler.is_physical_pointer(subtype) && !compiler.is_physical_pointer_to_buffer_block(subtype)) non_block_types.insert(get_base_non_block_type_id(member)); - } - else if (subtype.basetype == SPIRType::Struct && !subtype.pointer) + else if (subtype.basetype == SPIRType::Struct && !compiler.is_pointer(subtype)) analyze_non_block_types_from_block(subtype); } } @@ -5138,9 +5284,14 @@ void Compiler::analyze_non_block_pointer_types() // Analyze any block declaration we have to make. It might contain // physical pointers to POD types which we never used, and thus never added to the list. // We'll need to add those pointer types to the set of types we declare. - ir.for_each_typed_id([&](uint32_t, SPIRType &type) { - if (has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock)) + ir.for_each_typed_id([&](uint32_t id, SPIRType &type) { + // Only analyze the raw block struct, not any pointer-to-struct, since that's just redundant. + if (type.self == id && + (has_decoration(type.self, DecorationBlock) || + has_decoration(type.self, DecorationBufferBlock))) + { handler.analyze_non_block_types_from_block(type); + } }); physical_storage_non_block_pointer_types.reserve(handler.non_block_types.size()); @@ -5460,56 +5611,51 @@ void Compiler::analyze_interlocked_resource_usage() } } -bool Compiler::type_is_array_of_pointers(const SPIRType &type) const +// Helper function +bool Compiler::check_internal_recursion(const SPIRType &type, std::unordered_set &checked_ids) { - if (!type_is_top_level_array(type)) - return false; - - // BDA types must have parent type hierarchy. - if (!type.parent_type) + if (type.basetype != SPIRType::Struct) return false; - // Punch through all array layers. - auto *parent = &get(type.parent_type); - while (type_is_top_level_array(*parent)) - parent = &get(parent->parent_type); + if (checked_ids.count(type.self)) + return true; - return type_is_top_level_pointer(*parent); + // Recurse into struct members + bool is_recursive = false; + checked_ids.insert(type.self); + uint32_t mbr_cnt = uint32_t(type.member_types.size()); + for (uint32_t mbr_idx = 0; !is_recursive && mbr_idx < mbr_cnt; mbr_idx++) + { + uint32_t mbr_type_id = type.member_types[mbr_idx]; + auto &mbr_type = get(mbr_type_id); + is_recursive |= check_internal_recursion(mbr_type, checked_ids); + } + checked_ids.erase(type.self); + return is_recursive; } -bool Compiler::type_is_top_level_pointer(const SPIRType &type) const +// Return whether the struct type contains a structural recursion nested somewhere within its content. +bool Compiler::type_contains_recursion(const SPIRType &type) { - if (!type.pointer) - return false; - - // Function pointers, should not be hit by valid SPIR-V. - // Parent type will be SPIRFunction instead. - if (type.basetype == SPIRType::Unknown) - return false; - - // Some types are synthesized in-place without complete type hierarchy and might not have parent types, - // but these types are never array-of-pointer or any complicated BDA type, infer reasonable defaults. - if (type.parent_type) - return type.pointer_depth > get(type.parent_type).pointer_depth; - else - return true; + std::unordered_set checked_ids; + return check_internal_recursion(type, checked_ids); } -bool Compiler::type_is_top_level_physical_pointer(const SPIRType &type) const +bool Compiler::type_is_array_of_pointers(const SPIRType &type) const { - return type_is_top_level_pointer(type) && type.storage == StorageClassPhysicalStorageBuffer; -} + if (!is_array(type)) + return false; -bool Compiler::type_is_top_level_array(const SPIRType &type) const -{ - if (type.array.empty()) + // BDA types must have parent type hierarchy. + if (!type.parent_type) return false; - // If we have pointer and array, we infer pointer-to-array as it's the only meaningful thing outside BDA. - if (type.parent_type) - return type.array.size() > get(type.parent_type).array.size(); - else - return !type.pointer; + // Punch through all array layers. + auto *parent = &get(type.parent_type); + while (is_array(*parent)) + parent = &get(parent->parent_type); + + return is_pointer(*parent); } bool Compiler::flush_phi_required(BlockID from, BlockID to) const diff --git a/bgfx/3rdparty/spirv-cross/spirv_cross.hpp b/bgfx/3rdparty/spirv-cross/spirv_cross.hpp index 8f7ba447..e9062b48 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_cross.hpp +++ b/bgfx/3rdparty/spirv-cross/spirv_cross.hpp @@ -683,6 +683,9 @@ class Compiler bool is_vector(const SPIRType &type) const; bool is_matrix(const SPIRType &type) const; bool is_array(const SPIRType &type) const; + bool is_pointer(const SPIRType &type) const; + bool is_physical_pointer(const SPIRType &type) const; + bool is_physical_pointer_to_buffer_block(const SPIRType &type) const; static bool is_runtime_size_array(const SPIRType &type); uint32_t expression_type_id(uint32_t id) const; const SPIRType &expression_type(uint32_t id) const; @@ -741,6 +744,8 @@ class Compiler bool function_is_pure(const SPIRFunction &func); bool block_is_pure(const SPIRBlock &block); + bool function_is_control_dependent(const SPIRFunction &func); + bool block_is_control_dependent(const SPIRBlock &block); bool execution_is_branchless(const SPIRBlock &from, const SPIRBlock &to) const; bool execution_is_direct_branch(const SPIRBlock &from, const SPIRBlock &to) const; @@ -1145,11 +1150,11 @@ class Compiler bool has_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration) const; void unset_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration); + bool check_internal_recursion(const SPIRType &type, std::unordered_set &checked_ids); + bool type_contains_recursion(const SPIRType &type); bool type_is_array_of_pointers(const SPIRType &type) const; - bool type_is_top_level_physical_pointer(const SPIRType &type) const; - bool type_is_top_level_pointer(const SPIRType &type) const; - bool type_is_top_level_array(const SPIRType &type) const; bool type_is_block_like(const SPIRType &type) const; + bool type_is_top_level_block(const SPIRType &type) const; bool type_is_opaque_value(const SPIRType &type) const; bool reflection_ssbo_instance_name_is_significant() const; diff --git a/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp b/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp index c21fdeb6..71bc7b57 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp +++ b/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp @@ -198,6 +198,8 @@ struct spvc_resources_s : ScratchMemoryAllocation SmallVector separate_images; SmallVector separate_samplers; SmallVector acceleration_structures; + SmallVector gl_plain_uniforms; + SmallVector builtin_inputs; SmallVector builtin_outputs; @@ -516,6 +518,14 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c case SPVC_COMPILER_OPTION_HLSL_FLATTEN_MATRIX_VERTEX_INPUT_SEMANTICS: options->hlsl.flatten_matrix_vertex_input_semantics = value != 0; break; + + case SPVC_COMPILER_OPTION_HLSL_USE_ENTRY_POINT_NAME: + options->hlsl.use_entry_point_name = value != 0; + break; + + case SPVC_COMPILER_OPTION_HLSL_PRESERVE_STRUCTURED_BUFFERS: + options->hlsl.preserve_structured_buffers = value != 0; + break; #endif #if SPIRV_CROSS_C_API_MSL @@ -742,6 +752,22 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c case SPVC_COMPILER_OPTION_MSL_SAMPLE_DREF_LOD_ARRAY_AS_GRAD: options->msl.sample_dref_lod_array_as_grad = value != 0; break; + + case SPVC_COMPILER_OPTION_MSL_READWRITE_TEXTURE_FENCES: + options->msl.readwrite_texture_fences = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_REPLACE_RECURSIVE_INPUTS: + options->msl.replace_recursive_inputs = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_AGX_MANUAL_CUBE_GRAD_FIXUP: + options->msl.agx_manual_cube_grad_fixup = value != 0; + break; + + case SPVC_COMPILER_OPTION_MSL_FORCE_FRAGMENT_WITH_SIDE_EFFECTS_EXECUTION: + options->msl.force_fragment_with_side_effects_execution = value != 0; + break; #endif default: @@ -1339,6 +1365,34 @@ spvc_result spvc_compiler_msl_add_resource_binding(spvc_compiler compiler, #endif } +spvc_result spvc_compiler_msl_add_resource_binding_2(spvc_compiler compiler, + const spvc_msl_resource_binding_2 *binding) +{ +#if SPIRV_CROSS_C_API_MSL + if (compiler->backend != SPVC_BACKEND_MSL) + { + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; + } + + auto &msl = *static_cast(compiler->compiler.get()); + MSLResourceBinding bind; + bind.binding = binding->binding; + bind.desc_set = binding->desc_set; + bind.stage = static_cast(binding->stage); + bind.msl_buffer = binding->msl_buffer; + bind.msl_texture = binding->msl_texture; + bind.msl_sampler = binding->msl_sampler; + bind.count = binding->count; + msl.add_msl_resource_binding(bind); + return SPVC_SUCCESS; +#else + (void)binding; + compiler->context->report_error("MSL function used on a non-MSL backend."); + return SPVC_ERROR_INVALID_ARGUMENT; +#endif +} + spvc_result spvc_compiler_msl_add_dynamic_buffer(spvc_compiler compiler, unsigned desc_set, unsigned binding, unsigned index) { #if SPIRV_CROSS_C_API_MSL @@ -1807,6 +1861,8 @@ bool spvc_resources_s::copy_resources(const ShaderResources &resources) return false; if (!copy_resources(acceleration_structures, resources.acceleration_structures)) return false; + if (!copy_resources(gl_plain_uniforms, resources.gl_plain_uniforms)) + return false; if (!copy_resources(builtin_inputs, resources.builtin_inputs)) return false; if (!copy_resources(builtin_outputs, resources.builtin_outputs)) @@ -1958,6 +2014,9 @@ spvc_result spvc_resources_get_resource_list_for_type(spvc_resources resources, list = &resources->shader_record_buffers; break; + case SPVC_RESOURCE_TYPE_GL_PLAIN_UNIFORM: + list = &resources->gl_plain_uniforms; + default: break; } @@ -2129,7 +2188,11 @@ spvc_result spvc_compiler_get_entry_points(spvc_compiler compiler, const spvc_en spvc_result spvc_compiler_set_entry_point(spvc_compiler compiler, const char *name, SpvExecutionModel model) { - compiler->compiler->set_entry_point(name, static_cast(model)); + SPVC_BEGIN_SAFE_SCOPE + { + compiler->compiler->set_entry_point(name, static_cast(model)); + } + SPVC_END_SAFE_SCOPE(compiler->context, SPVC_ERROR_INVALID_ARGUMENT) return SPVC_SUCCESS; } @@ -2540,6 +2603,16 @@ int spvc_constant_get_scalar_i32(spvc_constant constant, unsigned column, unsign return constant->scalar_i32(column, row); } +unsigned long long spvc_constant_get_scalar_u64(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_u64(column, row); +} + +long long spvc_constant_get_scalar_i64(spvc_constant constant, unsigned column, unsigned row) +{ + return constant->scalar_i64(column, row); +} + unsigned spvc_constant_get_scalar_u16(spvc_constant constant, unsigned column, unsigned row) { return constant->scalar_u16(column, row); @@ -2597,6 +2670,16 @@ void spvc_constant_set_scalar_i32(spvc_constant constant, unsigned column, unsig constant->m.c[column].r[row].i32 = value; } +void spvc_constant_set_scalar_u64(spvc_constant constant, unsigned column, unsigned row, unsigned long long value) +{ + constant->m.c[column].r[row].u64 = value; +} + +void spvc_constant_set_scalar_i64(spvc_constant constant, unsigned column, unsigned row, long long value) +{ + constant->m.c[column].r[row].i64 = value; +} + void spvc_constant_set_scalar_u16(spvc_constant constant, unsigned column, unsigned row, unsigned short value) { constant->m.c[column].r[row].u32 = uint32_t(value); @@ -2775,6 +2858,22 @@ void spvc_msl_resource_binding_init(spvc_msl_resource_binding *binding) #endif } +void spvc_msl_resource_binding_init_2(spvc_msl_resource_binding_2 *binding) +{ +#if SPIRV_CROSS_C_API_MSL + MSLResourceBinding binding_default; + binding->desc_set = binding_default.desc_set; + binding->binding = binding_default.binding; + binding->msl_buffer = binding_default.msl_buffer; + binding->msl_texture = binding_default.msl_texture; + binding->msl_sampler = binding_default.msl_sampler; + binding->stage = static_cast(binding_default.stage); + binding->count = 0; +#else + memset(binding, 0, sizeof(*binding)); +#endif +} + void spvc_hlsl_resource_binding_init(spvc_hlsl_resource_binding *binding) { #if SPIRV_CROSS_C_API_HLSL diff --git a/bgfx/3rdparty/spirv-cross/spirv_cross_c.h b/bgfx/3rdparty/spirv-cross/spirv_cross_c.h index 0d8e6e10..a414c46b 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_cross_c.h +++ b/bgfx/3rdparty/spirv-cross/spirv_cross_c.h @@ -40,7 +40,7 @@ extern "C" { /* Bumped if ABI or API breaks backwards compatibility. */ #define SPVC_C_API_VERSION_MAJOR 0 /* Bumped if APIs or enumerations are added in a backwards compatible way. */ -#define SPVC_C_API_VERSION_MINOR 57 +#define SPVC_C_API_VERSION_MINOR 64 /* Bumped if internal implementation details change. */ #define SPVC_C_API_VERSION_PATCH 0 @@ -226,6 +226,7 @@ typedef enum spvc_resource_type SPVC_RESOURCE_TYPE_ACCELERATION_STRUCTURE = 12, SPVC_RESOURCE_TYPE_RAY_QUERY = 13, SPVC_RESOURCE_TYPE_SHADER_RECORD_BUFFER = 14, + SPVC_RESOURCE_TYPE_GL_PLAIN_UNIFORM = 15, SPVC_RESOURCE_TYPE_INT_MAX = 0x7fffffff } spvc_resource_type; @@ -380,7 +381,8 @@ typedef struct spvc_msl_shader_interface_var_2 */ SPVC_PUBLIC_API void spvc_msl_shader_interface_var_init_2(spvc_msl_shader_interface_var_2 *var); -/* Maps to C++ API. */ +/* Maps to C++ API. + * Deprecated. Use spvc_msl_resource_binding_2. */ typedef struct spvc_msl_resource_binding { SpvExecutionModel stage; @@ -391,11 +393,24 @@ typedef struct spvc_msl_resource_binding unsigned msl_sampler; } spvc_msl_resource_binding; +typedef struct spvc_msl_resource_binding_2 +{ + SpvExecutionModel stage; + unsigned desc_set; + unsigned binding; + unsigned count; + unsigned msl_buffer; + unsigned msl_texture; + unsigned msl_sampler; +} spvc_msl_resource_binding_2; + /* * Initializes the resource binding struct. * The defaults are non-zero. + * Deprecated: Use spvc_msl_resource_binding_init_2. */ SPVC_PUBLIC_API void spvc_msl_resource_binding_init(spvc_msl_resource_binding *binding); +SPVC_PUBLIC_API void spvc_msl_resource_binding_init_2(spvc_msl_resource_binding_2 *binding); #define SPVC_MSL_PUSH_CONSTANT_DESC_SET (~(0u)) #define SPVC_MSL_PUSH_CONSTANT_BINDING (0) @@ -725,6 +740,13 @@ typedef enum spvc_compiler_option SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS_TIER = 84 | SPVC_COMPILER_OPTION_MSL_BIT, SPVC_COMPILER_OPTION_MSL_SAMPLE_DREF_LOD_ARRAY_AS_GRAD = 85 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_READWRITE_TEXTURE_FENCES = 86 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_REPLACE_RECURSIVE_INPUTS = 87 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_AGX_MANUAL_CUBE_GRAD_FIXUP = 88 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_FORCE_FRAGMENT_WITH_SIDE_EFFECTS_EXECUTION = 89 | SPVC_COMPILER_OPTION_MSL_BIT, + + SPVC_COMPILER_OPTION_HLSL_USE_ENTRY_POINT_NAME = 90 | SPVC_COMPILER_OPTION_HLSL_BIT, + SPVC_COMPILER_OPTION_HLSL_PRESERVE_STRUCTURED_BUFFERS = 91 | SPVC_COMPILER_OPTION_HLSL_BIT, SPVC_COMPILER_OPTION_INT_MAX = 0x7fffffff } spvc_compiler_option; @@ -832,8 +854,11 @@ SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_needs_patch_output_buffer(spvc_compi SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_needs_input_threadgroup_mem(spvc_compiler compiler); SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_vertex_attribute(spvc_compiler compiler, const spvc_msl_vertex_attribute *attrs); +/* Deprecated; use spvc_compiler_msl_add_resource_binding_2(). */ SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_resource_binding(spvc_compiler compiler, const spvc_msl_resource_binding *binding); +SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_resource_binding_2(spvc_compiler compiler, + const spvc_msl_resource_binding_2 *binding); /* Deprecated; use spvc_compiler_msl_add_shader_input_2(). */ SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_shader_input(spvc_compiler compiler, const spvc_msl_shader_interface_var *input); @@ -1049,6 +1074,8 @@ SPVC_PUBLIC_API int spvc_constant_get_scalar_i16(spvc_constant constant, unsigne SPVC_PUBLIC_API unsigned spvc_constant_get_scalar_u8(spvc_constant constant, unsigned column, unsigned row); SPVC_PUBLIC_API int spvc_constant_get_scalar_i8(spvc_constant constant, unsigned column, unsigned row); SPVC_PUBLIC_API void spvc_constant_get_subconstants(spvc_constant constant, const spvc_constant_id **constituents, size_t *count); +SPVC_PUBLIC_API unsigned long long spvc_constant_get_scalar_u64(spvc_constant constant, unsigned column, unsigned row); +SPVC_PUBLIC_API long long spvc_constant_get_scalar_i64(spvc_constant constant, unsigned column, unsigned row); SPVC_PUBLIC_API spvc_type_id spvc_constant_get_type(spvc_constant constant); /* @@ -1059,6 +1086,8 @@ SPVC_PUBLIC_API void spvc_constant_set_scalar_fp32(spvc_constant constant, unsig SPVC_PUBLIC_API void spvc_constant_set_scalar_fp64(spvc_constant constant, unsigned column, unsigned row, double value); SPVC_PUBLIC_API void spvc_constant_set_scalar_u32(spvc_constant constant, unsigned column, unsigned row, unsigned value); SPVC_PUBLIC_API void spvc_constant_set_scalar_i32(spvc_constant constant, unsigned column, unsigned row, int value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_u64(spvc_constant constant, unsigned column, unsigned row, unsigned long long value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_i64(spvc_constant constant, unsigned column, unsigned row, long long value); SPVC_PUBLIC_API void spvc_constant_set_scalar_u16(spvc_constant constant, unsigned column, unsigned row, unsigned short value); SPVC_PUBLIC_API void spvc_constant_set_scalar_i16(spvc_constant constant, unsigned column, unsigned row, signed short value); SPVC_PUBLIC_API void spvc_constant_set_scalar_u8(spvc_constant constant, unsigned column, unsigned row, unsigned char value); diff --git a/bgfx/3rdparty/spirv-cross/spirv_cross_containers.hpp b/bgfx/3rdparty/spirv-cross/spirv_cross_containers.hpp index e79b3209..c496cb75 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_cross_containers.hpp +++ b/bgfx/3rdparty/spirv-cross/spirv_cross_containers.hpp @@ -576,6 +576,7 @@ class ObjectPool : public ObjectPoolBase if (!ptr) return nullptr; + vacants.reserve(num_objects); for (unsigned i = 0; i < num_objects; i++) vacants.push_back(&ptr[i]); diff --git a/bgfx/3rdparty/spirv-cross/spirv_cross_error_handling.hpp b/bgfx/3rdparty/spirv-cross/spirv_cross_error_handling.hpp index e96ebb9a..91e6cf4f 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_cross_error_handling.hpp +++ b/bgfx/3rdparty/spirv-cross/spirv_cross_error_handling.hpp @@ -66,6 +66,11 @@ class CompilerError : public std::runtime_error : std::runtime_error(str) { } + + explicit CompilerError(const char *str) + : std::runtime_error(str) + { + } }; #define SPIRV_CROSS_THROW(x) throw CompilerError(x) diff --git a/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp b/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp index c6ddb6a4..188c0ae6 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp +++ b/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp @@ -564,7 +564,8 @@ Bitset ParsedIR::get_buffer_block_type_flags(const SPIRType &type) const Bitset ParsedIR::get_buffer_block_flags(const SPIRVariable &var) const { auto &type = get(var.basetype); - assert(type.basetype == SPIRType::Struct); + if (type.basetype != SPIRType::Struct) + SPIRV_CROSS_THROW("Cannot get buffer block flags for non-buffer variable."); // Some flags like non-writable, non-readable are actually found // as member decorations. If all members have a decoration set, propagate @@ -783,6 +784,8 @@ uint32_t ParsedIR::get_member_decoration(TypeID id, uint32_t index, Decoration d return dec.stream; case DecorationSpecId: return dec.spec_id; + case DecorationMatrixStride: + return dec.matrix_stride; case DecorationIndex: return dec.index; default: diff --git a/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp b/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp index 7f35c381..3892248a 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp +++ b/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp @@ -169,7 +169,7 @@ class ParsedIR ~LoopLock(); private: - uint32_t *lock; + uint32_t *lock = nullptr; }; // This must be held while iterating over a type ID array. diff --git a/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp b/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp index 56639f0c..d8d509f4 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp @@ -223,7 +223,7 @@ static const char *to_pls_layout(PlsFormat format) } } -static SPIRType::BaseType pls_format_to_basetype(PlsFormat format) +static std::pair pls_format_to_basetype(PlsFormat format) { switch (format) { @@ -234,17 +234,17 @@ static SPIRType::BaseType pls_format_to_basetype(PlsFormat format) case PlsRGB10A2: case PlsRGBA8: case PlsRG16: - return SPIRType::Float; + return std::make_pair(spv::OpTypeFloat, SPIRType::Float); case PlsRGBA8I: case PlsRG16I: - return SPIRType::Int; + return std::make_pair(spv::OpTypeInt, SPIRType::Int); case PlsRGB10A2UI: case PlsRGBA8UI: case PlsRG16UI: case PlsR32UI: - return SPIRType::UInt; + return std::make_pair(spv::OpTypeInt, SPIRType::UInt); } } @@ -553,7 +553,7 @@ void CompilerGLSL::find_static_extensions() SPIRV_CROSS_THROW("GL_EXT_buffer_reference requires ESSL 320."); else if (!options.es && options.version < 450) SPIRV_CROSS_THROW("GL_EXT_buffer_reference requires GLSL 450."); - require_extension_internal("GL_EXT_buffer_reference"); + require_extension_internal("GL_EXT_buffer_reference2"); } else if (ir.addressing_model != AddressingModelLogical) { @@ -639,7 +639,8 @@ void CompilerGLSL::find_static_extensions() void CompilerGLSL::require_polyfill(Polyfill polyfill, bool relaxed) { - uint32_t &polyfills = (relaxed && options.es) ? required_polyfills_relaxed : required_polyfills; + uint32_t &polyfills = (relaxed && (options.es || options.vulkan_semantics)) ? + required_polyfills_relaxed : required_polyfills; if ((polyfills & polyfill) == 0) { @@ -715,7 +716,7 @@ string CompilerGLSL::compile() if (required_polyfills != 0) emit_polyfills(required_polyfills, false); - if (options.es && required_polyfills_relaxed != 0) + if ((options.es || options.vulkan_semantics) && required_polyfills_relaxed != 0) emit_polyfills(required_polyfills_relaxed, true); emit_function(get(ir.default_entry_point), Bitset()); @@ -1529,7 +1530,7 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, const Bits { // If using PhysicalStorageBufferEXT storage class, this is a pointer, // and is 64-bit. - if (type_is_top_level_physical_pointer(type)) + if (is_physical_pointer(type)) { if (!type.pointer) SPIRV_CROSS_THROW("Types in PhysicalStorageBufferEXT must be pointers."); @@ -1544,7 +1545,7 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, const Bits else SPIRV_CROSS_THROW("AddressingModelPhysicalStorageBuffer64EXT must be used for PhysicalStorageBufferEXT."); } - else if (type_is_top_level_array(type)) + else if (is_array(type)) { uint32_t minimum_alignment = 1; if (packing_is_vec4_padded(packing)) @@ -1652,7 +1653,7 @@ uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, const Bitset &f { // If using PhysicalStorageBufferEXT storage class, this is a pointer, // and is 64-bit. - if (type_is_top_level_physical_pointer(type)) + if (is_physical_pointer(type)) { if (!type.pointer) SPIRV_CROSS_THROW("Types in PhysicalStorageBufferEXT must be pointers."); @@ -1662,7 +1663,7 @@ uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, const Bitset &f else SPIRV_CROSS_THROW("AddressingModelPhysicalStorageBuffer64EXT must be used for PhysicalStorageBufferEXT."); } - else if (type_is_top_level_array(type)) + else if (is_array(type)) { uint32_t packed_size = to_array_size_literal(type) * type_to_packed_array_stride(type, flags, packing); @@ -1768,7 +1769,9 @@ bool CompilerGLSL::buffer_is_packing_standard(const SPIRType &type, BufferPackin for (uint32_t i = 0; i < type.member_types.size(); i++) { auto &memb_type = get(type.member_types[i]); - auto member_flags = ir.meta[type.self].members[i].decoration_flags; + + auto *type_meta = ir.find_meta(type.self); + auto member_flags = type_meta ? type_meta->members[i].decoration_flags : Bitset{}; // Verify alignment rules. uint32_t packed_alignment = type_to_packed_alignment(memb_type, member_flags, packing); @@ -1797,8 +1800,20 @@ bool CompilerGLSL::buffer_is_packing_standard(const SPIRType &type, BufferPackin if (packing_is_hlsl(packing)) { // If a member straddles across a vec4 boundary, alignment is actually vec4. - uint32_t begin_word = actual_offset / 16; - uint32_t end_word = (actual_offset + packed_size - 1) / 16; + uint32_t target_offset; + + // If we intend to use explicit packing, we must check for improper straddle with that offset. + // In implicit packing, we must check with implicit offset, since the explicit offset + // might have already accounted for the straddle, and we'd miss the alignment promotion to vec4. + // This is important when packing sub-structs that don't support packoffset(). + if (packing_has_flexible_offset(packing)) + target_offset = actual_offset; + else + target_offset = offset; + + uint32_t begin_word = target_offset / 16; + uint32_t end_word = (target_offset + packed_size - 1) / 16; + if (begin_word != end_word) packed_alignment = max(packed_alignment, 16u); } @@ -1840,7 +1855,7 @@ bool CompilerGLSL::buffer_is_packing_standard(const SPIRType &type, BufferPackin } // Verify array stride rules. - if (type_is_top_level_array(memb_type) && + if (is_array(memb_type) && type_to_packed_array_stride(memb_type, member_flags, packing) != type_struct_member_array_stride(type, i)) { @@ -2133,11 +2148,11 @@ string CompilerGLSL::layout_for_variable(const SPIRVariable &var) // If SPIR-V does not comply with either layout, we cannot really work around it. if (can_use_buffer_blocks && (ubo_block || emulated_ubo)) { - attr.push_back(buffer_to_packing_standard(type, false)); + attr.push_back(buffer_to_packing_standard(type, false, true)); } else if (can_use_buffer_blocks && (push_constant_block || ssbo_block)) { - attr.push_back(buffer_to_packing_standard(type, true)); + attr.push_back(buffer_to_packing_standard(type, true, true)); } // For images, the type itself adds a layout qualifer. @@ -2158,7 +2173,9 @@ string CompilerGLSL::layout_for_variable(const SPIRVariable &var) return res; } -string CompilerGLSL::buffer_to_packing_standard(const SPIRType &type, bool support_std430_without_scalar_layout) +string CompilerGLSL::buffer_to_packing_standard(const SPIRType &type, + bool support_std430_without_scalar_layout, + bool support_enhanced_layouts) { if (support_std430_without_scalar_layout && buffer_is_packing_standard(type, BufferPackingStd430)) return "std430"; @@ -2170,6 +2187,7 @@ string CompilerGLSL::buffer_to_packing_standard(const SPIRType &type, bool suppo return "scalar"; } else if (support_std430_without_scalar_layout && + support_enhanced_layouts && buffer_is_packing_standard(type, BufferPackingStd430EnhancedLayout)) { if (options.es && !options.vulkan_semantics) @@ -2181,7 +2199,8 @@ string CompilerGLSL::buffer_to_packing_standard(const SPIRType &type, bool suppo set_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset); return "std430"; } - else if (buffer_is_packing_standard(type, BufferPackingStd140EnhancedLayout)) + else if (support_enhanced_layouts && + buffer_is_packing_standard(type, BufferPackingStd140EnhancedLayout)) { // Fallback time. We might be able to use the ARB_enhanced_layouts to deal with this difference, // however, we can only use layout(offset) on the block itself, not any substructs, so the substructs better be the appropriate layout. @@ -2195,7 +2214,9 @@ string CompilerGLSL::buffer_to_packing_standard(const SPIRType &type, bool suppo set_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset); return "std140"; } - else if (options.vulkan_semantics && buffer_is_packing_standard(type, BufferPackingScalarEnhancedLayout)) + else if (options.vulkan_semantics && + support_enhanced_layouts && + buffer_is_packing_standard(type, BufferPackingScalarEnhancedLayout)) { set_extended_decoration(type.self, SPIRVCrossDecorationExplicitOffset); require_extension_internal("GL_EXT_scalar_block_layout"); @@ -2209,6 +2230,7 @@ string CompilerGLSL::buffer_to_packing_standard(const SPIRType &type, bool suppo return "std430"; } else if (!support_std430_without_scalar_layout && options.vulkan_semantics && + support_enhanced_layouts && buffer_is_packing_standard(type, BufferPackingStd430EnhancedLayout)) { // UBOs can support std430 with GL_EXT_scalar_block_layout. @@ -2307,7 +2329,7 @@ void CompilerGLSL::emit_buffer_reference_block(uint32_t type_id, bool forward_de auto &type = get(type_id); string buffer_name; - if (forward_declaration) + if (forward_declaration && is_physical_pointer_to_buffer_block(type)) { // Block names should never alias, but from HLSL input they kind of can because block types are reused for UAVs ... // Allow aliased name since we might be declaring the block twice. Once with buffer reference (forward declared) and one proper declaration. @@ -2340,10 +2362,10 @@ void CompilerGLSL::emit_buffer_reference_block(uint32_t type_id, bool forward_de // Ensure we emit the correct name when emitting non-forward pointer type. ir.meta[type.self].decoration.alias = buffer_name; } - else if (type.basetype != SPIRType::Struct) - buffer_name = type_to_glsl(type); else - buffer_name = to_name(type.self, false); + { + buffer_name = type_to_glsl(type); + } if (!forward_declaration) { @@ -2352,13 +2374,13 @@ void CompilerGLSL::emit_buffer_reference_block(uint32_t type_id, bool forward_de if (itr != physical_storage_type_to_alignment.end()) alignment = itr->second.alignment; - if (type.basetype == SPIRType::Struct) + if (is_physical_pointer_to_buffer_block(type)) { SmallVector attributes; attributes.push_back("buffer_reference"); if (alignment) attributes.push_back(join("buffer_reference_align = ", alignment)); - attributes.push_back(buffer_to_packing_standard(type, true)); + attributes.push_back(buffer_to_packing_standard(type, true, true)); auto flags = ir.get_buffer_block_type_flags(type); string decorations; @@ -2373,14 +2395,32 @@ void CompilerGLSL::emit_buffer_reference_block(uint32_t type_id, bool forward_de statement("layout(", merge(attributes), ")", decorations, " buffer ", buffer_name); } - else if (alignment) - statement("layout(buffer_reference, buffer_reference_align = ", alignment, ") buffer ", buffer_name); else - statement("layout(buffer_reference) buffer ", buffer_name); + { + string packing_standard; + if (type.basetype == SPIRType::Struct) + { + // The non-block type is embedded in a block, so we cannot use enhanced layouts :( + packing_standard = buffer_to_packing_standard(type, true, false) + ", "; + } + else if (is_array(get_pointee_type(type))) + { + SPIRType wrap_type{OpTypeStruct}; + wrap_type.self = ir.increase_bound_by(1); + wrap_type.member_types.push_back(get_pointee_type_id(type_id)); + ir.set_member_decoration(wrap_type.self, 0, DecorationOffset, 0); + packing_standard = buffer_to_packing_standard(wrap_type, true, false) + ", "; + } + + if (alignment) + statement("layout(", packing_standard, "buffer_reference, buffer_reference_align = ", alignment, ") buffer ", buffer_name); + else + statement("layout(", packing_standard, "buffer_reference) buffer ", buffer_name); + } begin_scope(); - if (type.basetype == SPIRType::Struct) + if (is_physical_pointer_to_buffer_block(type)) { type.member_name_cache.clear(); @@ -2395,7 +2435,7 @@ void CompilerGLSL::emit_buffer_reference_block(uint32_t type_id, bool forward_de else { auto &pointee_type = get_pointee_type(type); - statement(type_to_glsl(pointee_type), " value", type_to_array_glsl(pointee_type), ";"); + statement(type_to_glsl(pointee_type), " value", type_to_array_glsl(pointee_type, 0), ";"); } end_scope_decl(); @@ -2465,12 +2505,16 @@ void CompilerGLSL::emit_buffer_block_native(const SPIRVariable &var) i++; } + // Don't declare empty blocks in GLSL, this is not allowed. + if (type_is_empty(type) && !backend.supports_empty_struct) + statement("int empty_struct_member;"); + // var.self can be used as a backup name for the block name, // so we need to make sure we don't disturb the name here on a recompile. // It will need to be reset if we have to recompile. preserve_alias_on_reset(var.self); add_resource_name(var.self); - end_scope_decl(to_name(var.self) + type_to_array_glsl(type)); + end_scope_decl(to_name(var.self) + type_to_array_glsl(type, var.self)); statement(""); } @@ -2485,7 +2529,7 @@ void CompilerGLSL::emit_buffer_block_flattened(const SPIRVariable &var) SPIRType::BaseType basic_type; if (get_common_basic_type(type, basic_type)) { - SPIRType tmp; + SPIRType tmp { OpTypeVector }; tmp.basetype = basic_type; tmp.vecsize = 4; if (basic_type != SPIRType::Float && basic_type != SPIRType::Int && basic_type != SPIRType::UInt) @@ -2525,7 +2569,7 @@ const char *CompilerGLSL::to_storage_qualifiers_glsl(const SPIRVariable &var) return var.storage == StorageClassInput ? "in " : "out "; } else if (var.storage == StorageClassUniformConstant || var.storage == StorageClassUniform || - var.storage == StorageClassPushConstant) + var.storage == StorageClassPushConstant || var.storage == StorageClassAtomicCounter) { return "uniform "; } @@ -2720,6 +2764,8 @@ void CompilerGLSL::emit_interface_block(const SPIRVariable &var) block_qualifier = "patch "; else if (has_decoration(var.self, DecorationPerPrimitiveEXT)) block_qualifier = "perprimitiveEXT "; + else if (has_decoration(var.self, DecorationPerVertexKHR)) + block_qualifier = "pervertexEXT "; else block_qualifier = ""; @@ -2737,7 +2783,7 @@ void CompilerGLSL::emit_interface_block(const SPIRVariable &var) } add_resource_name(var.self); - end_scope_decl(join(to_name(var.self), type_to_array_glsl(type))); + end_scope_decl(join(to_name(var.self), type_to_array_glsl(type, var.self))); statement(""); } } @@ -2803,6 +2849,9 @@ string CompilerGLSL::constant_value_macro_name(uint32_t id) void CompilerGLSL::emit_specialization_constant_op(const SPIRConstantOp &constant) { auto &type = get(constant.basetype); + // This will break. It is bogus and should not be legal. + if (type_is_top_level_block(type)) + return; add_resource_name(constant.self); auto name = to_name(constant.self); statement("const ", variable_decl(type, name), " = ", constant_op_expression(constant), ";"); @@ -2832,6 +2881,10 @@ void CompilerGLSL::emit_constant(const SPIRConstant &constant) { auto &type = get(constant.constant_type); + // This will break. It is bogus and should not be legal. + if (type_is_top_level_block(type)) + return; + SpecializationConstant wg_x, wg_y, wg_z; ID workgroup_size_id = get_work_group_size_specialization_constants(wg_x, wg_y, wg_z); @@ -3581,6 +3634,10 @@ void CompilerGLSL::emit_resources() { auto &id = ir.ids[id_]; + // Skip declaring any bogus constants or undefs which use block types. + // We don't declare block types directly, so this will never work. + // Should not be legal SPIR-V, so this is considered a workaround. + if (id.get_type() == TypeConstant) { auto &c = id.get(); @@ -3636,7 +3693,11 @@ void CompilerGLSL::emit_resources() auto &type = this->get(undef.basetype); // OpUndef can be void for some reason ... if (type.basetype == SPIRType::Void) - return; + continue; + + // This will break. It is bogus and should not be legal. + if (type_is_top_level_block(type)) + continue; string initializer; if (options.force_zero_initialized_variables && type_can_zero_initialize(type)) @@ -3674,31 +3735,34 @@ void CompilerGLSL::emit_resources() if (ir.addressing_model == AddressingModelPhysicalStorageBuffer64EXT) { - for (auto type : physical_storage_non_block_pointer_types) - { - emit_buffer_reference_block(type, false); - } - // Output buffer reference blocks. // Do this in two stages, one with forward declaration, // and one without. Buffer reference blocks can reference themselves // to support things like linked lists. - ir.for_each_typed_id([&](uint32_t self, SPIRType &type) { - if (type.basetype == SPIRType::Struct && type.pointer && - type.pointer_depth == 1 && !type_is_array_of_pointers(type) && - type.storage == StorageClassPhysicalStorageBufferEXT) + ir.for_each_typed_id([&](uint32_t id, SPIRType &type) { + if (is_physical_pointer(type)) { - emit_buffer_reference_block(self, true); + bool emit_type = true; + if (!is_physical_pointer_to_buffer_block(type)) + { + // Only forward-declare if we intend to emit it in the non_block_pointer types. + // Otherwise, these are just "benign" pointer types that exist as a result of access chains. + emit_type = std::find(physical_storage_non_block_pointer_types.begin(), + physical_storage_non_block_pointer_types.end(), + id) != physical_storage_non_block_pointer_types.end(); + } + + if (emit_type) + emit_buffer_reference_block(id, true); } }); - ir.for_each_typed_id([&](uint32_t self, SPIRType &type) { - if (type.basetype == SPIRType::Struct && - type.pointer && type.pointer_depth == 1 && !type_is_array_of_pointers(type) && - type.storage == StorageClassPhysicalStorageBufferEXT) - { - emit_buffer_reference_block(self, false); - } + for (auto type : physical_storage_non_block_pointer_types) + emit_buffer_reference_block(type, false); + + ir.for_each_typed_id([&](uint32_t id, SPIRType &type) { + if (is_physical_pointer_to_buffer_block(type)) + emit_buffer_reference_block(id, false); }); } @@ -3907,6 +3971,7 @@ void CompilerGLSL::emit_output_variable_initializer(const SPIRVariable &var) auto &member_type = get(member_type_id); auto array_type = member_type; array_type.parent_type = member_type_id; + array_type.op = OpTypeArray; array_type.array.push_back(array_size); array_type.array_size_literal.push_back(true); @@ -3915,7 +3980,7 @@ void CompilerGLSL::emit_output_variable_initializer(const SPIRVariable &var) auto &c = get(var.initializer); for (uint32_t j = 0; j < array_size; j++) exprs.push_back(to_expression(get(c.subconstants[j]).subconstants[i])); - statement("const ", type_to_glsl(array_type), " ", lut_name, type_to_array_glsl(array_type), " = ", + statement("const ", type_to_glsl(array_type), " ", lut_name, type_to_array_glsl(array_type, 0), " = ", type_to_glsl_constructor(array_type), "(", merge(exprs, ", "), ");"); } @@ -3930,10 +3995,9 @@ void CompilerGLSL::emit_output_variable_initializer(const SPIRVariable &var) if (is_control_point) { uint32_t ids = ir.increase_bound_by(3); - SPIRType uint_type; + auto &uint_type = set(ids, OpTypeInt); uint_type.basetype = SPIRType::UInt; uint_type.width = 32; - set(ids, uint_type); set(ids + 1, builtin_to_glsl(BuiltInInvocationId, StorageClassInput), ids, true); set(ids + 2, ids, i, false); invocation_id = ids + 1; @@ -3974,7 +4038,7 @@ void CompilerGLSL::emit_output_variable_initializer(const SPIRVariable &var) else if (is_control_point) { auto lut_name = join("_", var.self, "_init"); - statement("const ", type_to_glsl(type), " ", lut_name, type_to_array_glsl(type), + statement("const ", type_to_glsl(type), " ", lut_name, type_to_array_glsl(type, 0), " = ", to_expression(var.initializer), ";"); entry_func.fixup_hooks_in.push_back([&, lut_name]() { statement(to_expression(var.self), "[gl_InvocationID] = ", lut_name, "[gl_InvocationID];"); @@ -3999,7 +4063,7 @@ void CompilerGLSL::emit_output_variable_initializer(const SPIRVariable &var) { auto lut_name = join("_", var.self, "_init"); statement("const ", type_to_glsl(type), " ", lut_name, - type_to_array_glsl(type), " = ", to_expression(var.initializer), ";"); + type_to_array_glsl(type, var.self), " = ", to_expression(var.initializer), ";"); entry_func.fixup_hooks_in.push_back([&, lut_name, is_patch]() { if (is_patch) { @@ -4781,6 +4845,109 @@ void CompilerGLSL::emit_polyfills(uint32_t polyfills, bool relaxed) end_scope(); statement(""); } + + if (!relaxed) + { + static const Polyfill polys[3][3] = { + { PolyfillNMin16, PolyfillNMin32, PolyfillNMin64 }, + { PolyfillNMax16, PolyfillNMax32, PolyfillNMax64 }, + { PolyfillNClamp16, PolyfillNClamp32, PolyfillNClamp64 }, + }; + + static const GLSLstd450 glsl_ops[] = { GLSLstd450NMin, GLSLstd450NMax, GLSLstd450NClamp }; + static const char *spv_ops[] = { "spvNMin", "spvNMax", "spvNClamp" }; + bool has_poly = false; + + for (uint32_t i = 0; i < 3; i++) + { + for (uint32_t j = 0; j < 3; j++) + { + if ((polyfills & polys[i][j]) == 0) + continue; + + const char *types[3][4] = { + { "float16_t", "f16vec2", "f16vec3", "f16vec4" }, + { "float", "vec2", "vec3", "vec4" }, + { "double", "dvec2", "dvec3", "dvec4" }, + }; + + for (uint32_t k = 0; k < 4; k++) + { + auto *type = types[j][k]; + + if (i < 2) + { + statement("spirv_instruction(set = \"GLSL.std.450\", id = ", glsl_ops[i], ") ", + type, " ", spv_ops[i], "(", type, ", ", type, ");"); + } + else + { + statement("spirv_instruction(set = \"GLSL.std.450\", id = ", glsl_ops[i], ") ", + type, " ", spv_ops[i], "(", type, ", ", type, ", ", type, ");"); + } + + has_poly = true; + } + } + } + + if (has_poly) + statement(""); + } + else + { + // Mediump intrinsics don't work correctly, so wrap the intrinsic in an outer shell that ensures mediump + // propagation. + + static const Polyfill polys[3][3] = { + { PolyfillNMin16, PolyfillNMin32, PolyfillNMin64 }, + { PolyfillNMax16, PolyfillNMax32, PolyfillNMax64 }, + { PolyfillNClamp16, PolyfillNClamp32, PolyfillNClamp64 }, + }; + + static const char *spv_ops[] = { "spvNMin", "spvNMax", "spvNClamp" }; + + for (uint32_t i = 0; i < 3; i++) + { + for (uint32_t j = 0; j < 3; j++) + { + if ((polyfills & polys[i][j]) == 0) + continue; + + const char *types[3][4] = { + { "float16_t", "f16vec2", "f16vec3", "f16vec4" }, + { "float", "vec2", "vec3", "vec4" }, + { "double", "dvec2", "dvec3", "dvec4" }, + }; + + for (uint32_t k = 0; k < 4; k++) + { + auto *type = types[j][k]; + + if (i < 2) + { + statement("mediump ", type, " ", spv_ops[i], "Relaxed(", + "mediump ", type, " a, mediump ", type, " b)"); + begin_scope(); + statement("mediump ", type, " res = ", spv_ops[i], "(a, b);"); + statement("return res;"); + end_scope(); + statement(""); + } + else + { + statement("mediump ", type, " ", spv_ops[i], "Relaxed(", + "mediump ", type, " a, mediump ", type, " b, mediump ", type, " c)"); + begin_scope(); + statement("mediump ", type, " res = ", spv_ops[i], "(a, b, c);"); + statement("return res;"); + end_scope(); + statement(""); + } + } + } + } + } } // Returns a string representation of the ID, usable as a function arg. @@ -4980,11 +5147,8 @@ string CompilerGLSL::dereference_expression(const SPIRType &expr_type, const std return expr.substr(1); else if (backend.native_pointers) return join('*', expr); - else if (expr_type.storage == StorageClassPhysicalStorageBufferEXT && expr_type.basetype != SPIRType::Struct && - expr_type.pointer_depth == 1) - { + else if (is_physical_pointer(expr_type) && !is_physical_pointer_to_buffer_block(expr_type)) return join(enclose_expression(expr), ".value"); - } else return expr; } @@ -5051,7 +5215,8 @@ string CompilerGLSL::to_enclosed_unpacked_expression(uint32_t id, bool register_ string CompilerGLSL::to_dereferenced_expression(uint32_t id, bool register_expression_read) { auto &type = expression_type(id); - if (type.pointer && should_dereference(id)) + + if (is_pointer(type) && should_dereference(id)) return dereference_expression(type, to_enclosed_expression(id, register_expression_read)); else return to_expression(id, register_expression_read); @@ -5060,7 +5225,7 @@ string CompilerGLSL::to_dereferenced_expression(uint32_t id, bool register_expre string CompilerGLSL::to_pointer_expression(uint32_t id, bool register_expression_read) { auto &type = expression_type(id); - if (type.pointer && expression_is_lvalue(id) && !should_dereference(id)) + if (is_pointer(type) && expression_is_lvalue(id) && !should_dereference(id)) return address_of_expression(to_enclosed_expression(id, register_expression_read)); else return to_unpacked_expression(id, register_expression_read); @@ -5069,7 +5234,7 @@ string CompilerGLSL::to_pointer_expression(uint32_t id, bool register_expression string CompilerGLSL::to_enclosed_pointer_expression(uint32_t id, bool register_expression_read) { auto &type = expression_type(id); - if (type.pointer && expression_is_lvalue(id) && !should_dereference(id)) + if (is_pointer(type) && expression_is_lvalue(id) && !should_dereference(id)) return address_of_expression(to_enclosed_expression(id, register_expression_read)); else return to_enclosed_unpacked_expression(id, register_expression_read); @@ -5129,7 +5294,7 @@ string CompilerGLSL::to_rerolled_array_expression(const SPIRType &parent_type, type.basetype == SPIRType::Boolean && backend.boolean_in_struct_remapped_type != SPIRType::Boolean; - SPIRType tmp_type; + SPIRType tmp_type { OpNop }; if (remapped_boolean) { tmp_type = get(type.parent_type); @@ -5150,7 +5315,7 @@ string CompilerGLSL::to_rerolled_array_expression(const SPIRType &parent_type, for (uint32_t i = 0; i < size; i++) { auto subexpr = join(base_expr, "[", convert_to_string(i), "]"); - if (!type_is_top_level_array(parent)) + if (!is_array(parent)) { if (remapped_boolean) subexpr = join(type_to_glsl(tmp_type), "(", subexpr, ")"); @@ -5176,7 +5341,7 @@ string CompilerGLSL::to_composite_constructor_expression(const SPIRType &parent_ type.basetype == SPIRType::Boolean && backend.boolean_in_struct_remapped_type != SPIRType::Boolean; - if (type_is_top_level_array(type)) + if (is_array(type)) { reroll_array = !backend.array_is_value_type || (block_like_type && !backend.array_is_value_type_in_buffer_blocks); @@ -5729,7 +5894,7 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c, { auto &type = get(c.constant_type); - if (type_is_top_level_pointer(type)) + if (is_pointer(type)) { return backend.null_pointer_literal; } @@ -5744,21 +5909,21 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c, // with Offset = 0, using no ArrayStride on the enclosed array type. // A particular CTS test hits this scenario. bool array_type_decays = inside_block_like_struct_scope && - type_is_top_level_array(type) && + is_array(type) && !backend.array_is_value_type_in_buffer_blocks; // Allow Metal to use the array template to make arrays a value type bool needs_trailing_tracket = false; if (backend.use_initializer_list && backend.use_typed_initializer_list && type.basetype == SPIRType::Struct && - !type_is_top_level_array(type)) + !is_array(type)) { res = type_to_glsl_constructor(type) + "{ "; } else if (backend.use_initializer_list && backend.use_typed_initializer_list && backend.array_is_value_type && - type_is_top_level_array(type) && !array_type_decays) + is_array(type) && !array_type_decays) { const auto *p_type = &type; - SPIRType tmp_type; + SPIRType tmp_type { OpNop }; if (inside_struct_scope && backend.boolean_in_struct_remapped_type != SPIRType::Boolean && @@ -5799,7 +5964,7 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c, res += to_name(elem); else { - if (!type_is_top_level_array(type) && type.basetype == SPIRType::Struct) + if (!is_array(type) && type.basetype == SPIRType::Struct) { // When we get down to emitting struct members, override the block-like information. // For constants, we can freely mix and match block-like state. @@ -5897,7 +6062,7 @@ string CompilerGLSL::convert_half_to_string(const SPIRConstant &c, uint32_t col, // of complicated workarounds, just value-cast to the half type always. if (std::isnan(float_value) || std::isinf(float_value)) { - SPIRType type; + SPIRType type { OpTypeFloat }; type.basetype = SPIRType::Half; type.vecsize = 1; type.columns = 1; @@ -5913,11 +6078,11 @@ string CompilerGLSL::convert_half_to_string(const SPIRConstant &c, uint32_t col, } else { - SPIRType type; + SPIRType type { OpTypeFloat }; type.basetype = SPIRType::Half; type.vecsize = 1; type.columns = 1; - res = join(type_to_glsl(type), "(", convert_to_string(float_value, current_locale_radix_character), ")"); + res = join(type_to_glsl(type), "(", format_float(float_value), ")"); } return res; @@ -5933,8 +6098,8 @@ string CompilerGLSL::convert_float_to_string(const SPIRConstant &c, uint32_t col // Use special representation. if (!is_legacy()) { - SPIRType out_type; - SPIRType in_type; + SPIRType out_type { OpTypeFloat }; + SPIRType in_type { OpTypeInt }; out_type.basetype = SPIRType::Float; in_type.basetype = SPIRType::UInt; out_type.vecsize = 1; @@ -5985,7 +6150,7 @@ string CompilerGLSL::convert_float_to_string(const SPIRConstant &c, uint32_t col } else { - res = convert_to_string(float_value, current_locale_radix_character); + res = format_float(float_value); if (backend.float_literal_suffix) res += "f"; } @@ -6003,8 +6168,8 @@ std::string CompilerGLSL::convert_double_to_string(const SPIRConstant &c, uint32 // Use special representation. if (!is_legacy()) { - SPIRType out_type; - SPIRType in_type; + SPIRType out_type { OpTypeFloat }; + SPIRType in_type { OpTypeInt }; out_type.basetype = SPIRType::Double; in_type.basetype = SPIRType::UInt64; out_type.vecsize = 1; @@ -6068,7 +6233,7 @@ std::string CompilerGLSL::convert_double_to_string(const SPIRConstant &c, uint32 } else { - res = convert_to_string(double_value, current_locale_radix_character); + res = format_double(double_value); if (backend.double_literal_suffix) res += "lf"; } @@ -6712,7 +6877,7 @@ SPIRType CompilerGLSL::binary_op_bitcast_helper(string &cast_op0, string &cast_o // Create a fake type so we can bitcast to it. // We only deal with regular arithmetic types here like int, uints and so on. - SPIRType expected_type; + SPIRType expected_type{type0.op}; expected_type.basetype = input_type; expected_type.vecsize = type0.vecsize; expected_type.columns = type0.columns; @@ -7066,7 +7231,9 @@ void CompilerGLSL::emit_bitfield_insert_op(uint32_t result_type, uint32_t result auto op2_expr = to_unpacked_expression(op2); auto op3_expr = to_unpacked_expression(op3); - SPIRType target_type; + assert(offset_count_type == SPIRType::UInt || offset_count_type == SPIRType::Int); + SPIRType target_type { OpTypeInt }; + target_type.width = 32; target_type.vecsize = 1; target_type.basetype = offset_count_type; @@ -7787,6 +7954,7 @@ std::string CompilerGLSL::to_texture_op(const Instruction &i, bool sparse, bool args.grad_x = grad_x; args.grad_y = grad_y; args.lod = lod; + args.has_array_offsets = coffsets != 0; if (coffsets) args.offset = coffsets; @@ -7857,7 +8025,7 @@ bool CompilerGLSL::expression_is_constant_null(uint32_t id) const bool CompilerGLSL::expression_is_non_value_type_array(uint32_t ptr) { auto &type = expression_type(ptr); - if (!type_is_top_level_array(get_pointee_type(type))) + if (!is_array(get_pointee_type(type))) return false; if (!backend.array_is_value_type) @@ -8804,23 +8972,97 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, case GLSLstd450NMin: case GLSLstd450NMax: { - emit_nminmax_op(result_type, id, args[0], args[1], op); + if (options.vulkan_semantics) + { + require_extension_internal("GL_EXT_spirv_intrinsics"); + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); + Polyfill poly = {}; + switch (get(result_type).width) + { + case 16: + poly = op == GLSLstd450NMin ? PolyfillNMin16 : PolyfillNMax16; + break; + + case 32: + poly = op == GLSLstd450NMin ? PolyfillNMin32 : PolyfillNMax32; + break; + + case 64: + poly = op == GLSLstd450NMin ? PolyfillNMin64 : PolyfillNMax64; + break; + + default: + SPIRV_CROSS_THROW("Invalid bit width for NMin/NMax."); + } + + require_polyfill(poly, relaxed); + + // Function return decorations are broken, so need to do double polyfill. + if (relaxed) + require_polyfill(poly, false); + + const char *op_str; + if (relaxed) + op_str = op == GLSLstd450NMin ? "spvNMinRelaxed" : "spvNMaxRelaxed"; + else + op_str = op == GLSLstd450NMin ? "spvNMin" : "spvNMax"; + + emit_binary_func_op(result_type, id, args[0], args[1], op_str); + } + else + { + emit_nminmax_op(result_type, id, args[0], args[1], op); + } break; } case GLSLstd450NClamp: { - // Make sure we have a unique ID here to avoid aliasing the extra sub-expressions between clamp and NMin sub-op. - // IDs cannot exceed 24 bits, so we can make use of the higher bits for some unique flags. - uint32_t &max_id = extra_sub_expressions[id | EXTRA_SUB_EXPRESSION_TYPE_AUX]; - if (!max_id) - max_id = ir.increase_bound_by(1); + if (options.vulkan_semantics) + { + require_extension_internal("GL_EXT_spirv_intrinsics"); + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); + Polyfill poly = {}; + switch (get(result_type).width) + { + case 16: + poly = PolyfillNClamp16; + break; + + case 32: + poly = PolyfillNClamp32; + break; + + case 64: + poly = PolyfillNClamp64; + break; + + default: + SPIRV_CROSS_THROW("Invalid bit width for NMin/NMax."); + } + + require_polyfill(poly, relaxed); + + // Function return decorations are broken, so need to do double polyfill. + if (relaxed) + require_polyfill(poly, false); - // Inherit precision qualifiers. - ir.meta[max_id] = ir.meta[id]; + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], relaxed ? "spvNClampRelaxed" : "spvNClamp"); + } + else + { + // Make sure we have a unique ID here to avoid aliasing the extra sub-expressions between clamp and NMin sub-op. + // IDs cannot exceed 24 bits, so we can make use of the higher bits for some unique flags. + uint32_t &max_id = extra_sub_expressions[id | EXTRA_SUB_EXPRESSION_TYPE_AUX]; + if (!max_id) + max_id = ir.increase_bound_by(1); - emit_nminmax_op(result_type, max_id, args[0], args[1], GLSLstd450NMax); - emit_nminmax_op(result_type, id, max_id, args[2], GLSLstd450NMin); + // Inherit precision qualifiers. + ir.meta[max_id] = ir.meta[id]; + + emit_nminmax_op(result_type, max_id, args[0], args[1], GLSLstd450NMax); + emit_nminmax_op(result_type, id, max_id, args[2], GLSLstd450NMin); + } break; } @@ -9591,6 +9833,8 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) return "gl_TessLevelInner"; case BuiltInTessCoord: return "gl_TessCoord"; + case BuiltInPatchVertices: + return "gl_PatchVerticesIn"; case BuiltInFragCoord: return "gl_FragCoord"; case BuiltInPointCoord: @@ -9893,16 +10137,21 @@ void CompilerGLSL::access_chain_internal_append_index(std::string &expr, uint32_ if (ptr_chain && access_chain_is_arrayed) { size_t split_pos = expr.find_last_of(']'); - string expr_front = expr.substr(0, split_pos); - string expr_back = expr.substr(split_pos); - expr = expr_front + " + " + enclose_expression(idx_expr) + expr_back; - } - else - { - expr += "["; - expr += idx_expr; - expr += "]"; + size_t enclose_split = expr.find_last_of(')'); + + // If we have already enclosed the expression, don't try to be clever, it will break. + if (split_pos > enclose_split || enclose_split == string::npos) + { + string expr_front = expr.substr(0, split_pos); + string expr_back = expr.substr(split_pos); + expr = expr_front + " + " + enclose_expression(idx_expr) + expr_back; + return; + } } + + expr += "["; + expr += idx_expr; + expr += "]"; } bool CompilerGLSL::access_chain_needs_stage_io_builtin_translation(uint32_t) @@ -9937,6 +10186,7 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice // Start traversing type hierarchy at the proper non-pointer types, // but keep type_id referencing the original pointer for use below. uint32_t type_id = expression_type_id(base); + const auto *type = &get_pointee_type(type_id); if (!backend.native_pointers) { @@ -9946,13 +10196,10 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice // Wrapped buffer reference pointer types will need to poke into the internal "value" member before // continuing the access chain. if (should_dereference(base)) - { - auto &type = get(type_id); - expr = dereference_expression(type, expr); - } + expr = dereference_expression(get(type_id), expr); } - - const auto *type = &get_pointee_type(type_id); + else if (should_dereference(base) && type->basetype != SPIRType::Struct && !ptr_chain) + expr = join("(", dereference_expression(*type, expr), ")"); bool access_chain_is_arrayed = expr.find_first_of('[') != string::npos; bool row_major_matrix_needs_conversion = is_non_native_row_major_matrix(base); @@ -9993,9 +10240,21 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice index &= 0x7fffffffu; } - // Pointer chains + bool ptr_chain_array_entry = ptr_chain && i == 0 && is_array(*type); + + if (ptr_chain_array_entry) + { + // This is highly unusual code, since normally we'd use plain AccessChain, but it's still allowed. + // We are considered to have a pointer to array and one element shifts by one array at a time. + // If we use normal array indexing, we'll first decay to pointer, and lose the array-ness, + // so we have to take pointer to array explicitly. + if (!should_dereference(base)) + expr = enclose_expression(address_of_expression(expr)); + } + if (ptr_chain && i == 0) { + // Pointer chains // If we are flattening multidimensional arrays, only create opening bracket on first // array index. if (options.flatten_multidimensional_arrays) @@ -10030,7 +10289,40 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice } else { - append_index(index, is_literal, true); + if (flags & ACCESS_CHAIN_PTR_CHAIN_POINTER_ARITH_BIT) + { + SPIRType tmp_type(OpTypeInt); + tmp_type.basetype = SPIRType::UInt64; + tmp_type.width = 64; + tmp_type.vecsize = 1; + tmp_type.columns = 1; + + TypeID ptr_type_id = expression_type_id(base); + const SPIRType &ptr_type = get(ptr_type_id); + const SPIRType &pointee_type = get_pointee_type(ptr_type); + + // This only runs in native pointer backends. + // Can replace reinterpret_cast with a backend string if ever needed. + // We expect this to count as a de-reference. + // This leaks some MSL details, but feels slightly overkill to + // add yet another virtual interface just for this. + auto intptr_expr = join("reinterpret_cast<", type_to_glsl(tmp_type), ">(", expr, ")"); + intptr_expr += join(" + ", to_enclosed_unpacked_expression(index), " * ", + get_decoration(ptr_type_id, DecorationArrayStride)); + + if (flags & ACCESS_CHAIN_PTR_CHAIN_CAST_TO_SCALAR_BIT) + { + is_packed = true; + expr = join("*reinterpret_cast(", intptr_expr, ")"); + } + else + { + expr = join("*reinterpret_cast<", type_to_glsl(ptr_type), ">(", intptr_expr, ")"); + } + } + else + append_index(index, is_literal, true); } if (type->basetype == SPIRType::ControlPointArray) @@ -10040,6 +10332,12 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice } access_chain_is_arrayed = true; + + // Explicitly enclose the expression if this is one of the weird pointer-to-array cases. + // We don't want any future indexing to add to this array dereference. + // Enclosing the expression blocks that and avoids any shenanigans with operand priority. + if (ptr_chain_array_entry) + expr = join("(", expr, ")"); } // Arrays else if (!type->array.empty()) @@ -10139,10 +10437,11 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice if (!pending_array_enclose) expr += "]"; } - // Some builtins are arrays in SPIR-V but not in other languages, e.g. gl_SampleMask[] is an array in SPIR-V but not in Metal. - // By throwing away the index, we imply the index was 0, which it must be for gl_SampleMask. - else if (!builtin_translates_to_nonarray(BuiltIn(get_decoration(base, DecorationBuiltIn)))) + else if (index_is_literal || !builtin_translates_to_nonarray(BuiltIn(get_decoration(base, DecorationBuiltIn)))) { + // Some builtins are arrays in SPIR-V but not in other languages, e.g. gl_SampleMask[] is an array in SPIR-V but not in Metal. + // By throwing away the index, we imply the index was 0, which it must be for gl_SampleMask. + // For literal indices we are working on composites, so we ignore this since we have already converted to proper array. append_index(index, is_literal); } @@ -10156,6 +10455,16 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice type_id = type->parent_type; type = &get(type_id); + // If the physical type has an unnatural vecsize, + // we must assume it's a faked struct where the .data member + // is used for the real payload. + if (physical_type && (is_vector(*type) || is_scalar(*type))) + { + auto &phys = get(physical_type); + if (phys.vecsize > 4) + expr += ".data"; + } + access_chain_is_arrayed = true; } // For structs, the index refers to a constant, which indexes into the members, possibly through a redirection mapping. @@ -10241,6 +10550,16 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice expr += to_unpacked_expression(index, register_expression_read); expr += "]"; + // If the physical type has an unnatural vecsize, + // we must assume it's a faked struct where the .data member + // is used for the real payload. + if (physical_type) + { + auto &phys = get(physical_type); + if (phys.vecsize > 4 || phys.columns > 4) + expr += ".data"; + } + type_id = type->parent_type; type = &get(type_id); } @@ -10255,6 +10574,18 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice if (column_index != string::npos) { deferred_index = expr.substr(column_index); + + auto end_deferred_index = deferred_index.find_last_of(']'); + if (end_deferred_index != string::npos && end_deferred_index + 1 != deferred_index.size()) + { + // If we have any data member fixups, it must be transposed so that it refers to this index. + // E.g. [0].data followed by [1] would be shuffled to [1][0].data which is wrong, + // and needs to be [1].data[0] instead. + end_deferred_index++; + deferred_index = deferred_index.substr(end_deferred_index) + + deferred_index.substr(0, end_deferred_index); + } + expr.resize(column_index); } } @@ -10333,8 +10664,14 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice if (row_major_matrix_needs_conversion && !ignore_potential_sliced_writes) { - prepare_access_chain_for_scalar_access(expr, get(type->parent_type), effective_storage, - is_packed); + if (prepare_access_chain_for_scalar_access(expr, get(type->parent_type), effective_storage, + is_packed)) + { + // We're in a pointer context now, so just remove any member dereference. + auto first_index = deferred_index.find_first_of('['); + if (first_index != string::npos && first_index != 0) + deferred_index = deferred_index.substr(first_index); + } } if (access_meshlet_position_y) @@ -10393,8 +10730,9 @@ void CompilerGLSL::check_physical_type_cast(std::string &, const SPIRType *, uin { } -void CompilerGLSL::prepare_access_chain_for_scalar_access(std::string &, const SPIRType &, spv::StorageClass, bool &) +bool CompilerGLSL::prepare_access_chain_for_scalar_access(std::string &, const SPIRType &, spv::StorageClass, bool &) { + return false; } string CompilerGLSL::to_flattened_struct_member(const string &basename, const SPIRType &type, uint32_t index) @@ -10404,6 +10742,11 @@ string CompilerGLSL::to_flattened_struct_member(const string &basename, const SP return ret; } +uint32_t CompilerGLSL::get_physical_type_stride(const SPIRType &) const +{ + SPIRV_CROSS_THROW("Invalid to call get_physical_type_stride on a backend without native pointer support."); +} + string CompilerGLSL::access_chain(uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type, AccessChainMeta *meta, bool ptr_chain) { @@ -10453,7 +10796,27 @@ string CompilerGLSL::access_chain(uint32_t base, const uint32_t *indices, uint32 { AccessChainFlags flags = ACCESS_CHAIN_SKIP_REGISTER_EXPRESSION_READ_BIT; if (ptr_chain) + { flags |= ACCESS_CHAIN_PTR_CHAIN_BIT; + // PtrAccessChain could get complicated. + TypeID type_id = expression_type_id(base); + if (backend.native_pointers && has_decoration(type_id, DecorationArrayStride)) + { + // If there is a mismatch we have to go via 64-bit pointer arithmetic :'( + // Using packed hacks only gets us so far, and is not designed to deal with pointer to + // random values. It works for structs though. + auto &pointee_type = get_pointee_type(get(type_id)); + uint32_t physical_stride = get_physical_type_stride(pointee_type); + uint32_t requested_stride = get_decoration(type_id, DecorationArrayStride); + if (physical_stride != requested_stride) + { + flags |= ACCESS_CHAIN_PTR_CHAIN_POINTER_ARITH_BIT; + if (is_vector(pointee_type)) + flags |= ACCESS_CHAIN_PTR_CHAIN_CAST_TO_SCALAR_BIT; + } + } + } + return access_chain_internal(base, indices, count, flags, meta); } } @@ -11487,6 +11850,10 @@ uint32_t CompilerGLSL::get_integer_width_for_instruction(const Instruction &inst case OpUGreaterThanEqual: return expression_type(ops[2]).width; + case OpSMulExtended: + case OpUMulExtended: + return get(get(ops[0]).member_types[0]).width; + default: { // We can look at result type which is more robust. @@ -12044,6 +12411,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) auto &callee = get(func); auto &return_type = get(callee.return_type); bool pure = function_is_pure(callee); + bool control_dependent = function_is_control_dependent(callee); bool callee_has_out_variables = false; bool emit_return_value_as_argument = false; @@ -12075,7 +12443,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) if (emit_return_value_as_argument) { - statement(type_to_glsl(return_type), " ", to_name(id), type_to_array_glsl(return_type), ";"); + statement(type_to_glsl(return_type), " ", to_name(id), type_to_array_glsl(return_type, 0), ";"); arglist.push_back(to_name(id)); } @@ -12137,6 +12505,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) else statement(funexpr, ";"); + if (control_dependent) + register_control_dependent_expression(id); + break; } @@ -14052,6 +14423,110 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) break; } + case OpImageSampleWeightedQCOM: + case OpImageBoxFilterQCOM: + case OpImageBlockMatchSSDQCOM: + case OpImageBlockMatchSADQCOM: + { + require_extension_internal("GL_QCOM_image_processing"); + uint32_t result_type_id = ops[0]; + uint32_t id = ops[1]; + string expr; + switch (opcode) + { + case OpImageSampleWeightedQCOM: + expr = "textureWeightedQCOM"; + break; + case OpImageBoxFilterQCOM: + expr = "textureBoxFilterQCOM"; + break; + case OpImageBlockMatchSSDQCOM: + expr = "textureBlockMatchSSDQCOM"; + break; + case OpImageBlockMatchSADQCOM: + expr = "textureBlockMatchSADQCOM"; + break; + default: + SPIRV_CROSS_THROW("Invalid opcode for QCOM_image_processing."); + } + expr += "("; + + bool forward = false; + expr += to_expression(ops[2]); + expr += ", " + to_expression(ops[3]); + + switch (opcode) + { + case OpImageSampleWeightedQCOM: + expr += ", " + to_non_uniform_aware_expression(ops[4]); + break; + case OpImageBoxFilterQCOM: + expr += ", " + to_expression(ops[4]); + break; + case OpImageBlockMatchSSDQCOM: + case OpImageBlockMatchSADQCOM: + expr += ", " + to_non_uniform_aware_expression(ops[4]); + expr += ", " + to_expression(ops[5]); + expr += ", " + to_expression(ops[6]); + break; + default: + SPIRV_CROSS_THROW("Invalid opcode for QCOM_image_processing."); + } + + expr += ")"; + emit_op(result_type_id, id, expr, forward); + + inherit_expression_dependencies(id, ops[3]); + if (opcode == OpImageBlockMatchSSDQCOM || opcode == OpImageBlockMatchSADQCOM) + inherit_expression_dependencies(id, ops[5]); + + break; + } + + case OpImageBlockMatchWindowSSDQCOM: + case OpImageBlockMatchWindowSADQCOM: + case OpImageBlockMatchGatherSSDQCOM: + case OpImageBlockMatchGatherSADQCOM: + { + require_extension_internal("GL_QCOM_image_processing2"); + uint32_t result_type_id = ops[0]; + uint32_t id = ops[1]; + string expr; + switch (opcode) + { + case OpImageBlockMatchWindowSSDQCOM: + expr = "textureBlockMatchWindowSSDQCOM"; + break; + case OpImageBlockMatchWindowSADQCOM: + expr = "textureBlockMatchWindowSADQCOM"; + break; + case OpImageBlockMatchGatherSSDQCOM: + expr = "textureBlockMatchGatherSSDQCOM"; + break; + case OpImageBlockMatchGatherSADQCOM: + expr = "textureBlockMatchGatherSADQCOM"; + break; + default: + SPIRV_CROSS_THROW("Invalid opcode for QCOM_image_processing2."); + } + expr += "("; + + bool forward = false; + expr += to_expression(ops[2]); + expr += ", " + to_expression(ops[3]); + + expr += ", " + to_non_uniform_aware_expression(ops[4]); + expr += ", " + to_expression(ops[5]); + expr += ", " + to_expression(ops[6]); + + expr += ")"; + emit_op(result_type_id, id, expr, forward); + + inherit_expression_dependencies(id, ops[3]); + inherit_expression_dependencies(id, ops[5]); + break; + } + // Compute case OpControlBarrier: case OpMemoryBarrier: @@ -14937,6 +15412,17 @@ string CompilerGLSL::convert_row_major_matrix(string exp_str, const SPIRType &ex auto column_expr = exp_str.substr(column_index); exp_str.resize(column_index); + auto end_deferred_index = column_expr.find_last_of(']'); + if (end_deferred_index != string::npos && end_deferred_index + 1 != column_expr.size()) + { + // If we have any data member fixups, it must be transposed so that it refers to this index. + // E.g. [0].data followed by [1] would be shuffled to [1][0].data which is wrong, + // and needs to be [1].data[0] instead. + end_deferred_index++; + column_expr = column_expr.substr(end_deferred_index) + + column_expr.substr(0, end_deferred_index); + } + auto transposed_expr = type_to_glsl_constructor(exp_type) + "("; // Loading a column from a row-major matrix. Unroll the load. @@ -14972,7 +15458,7 @@ string CompilerGLSL::variable_decl(const SPIRType &type, const string &name, uin { string type_name = type_to_glsl(type, id); remap_variable_type_name(type, name, type_name); - return join(type_name, " ", name, type_to_array_glsl(type)); + return join(type_name, " ", name, type_to_array_glsl(type, id)); } bool CompilerGLSL::variable_decl_is_remapped_storage(const SPIRVariable &var, StorageClass storage) const @@ -15031,7 +15517,12 @@ string CompilerGLSL::flags_to_qualifiers_glsl(const SPIRType &type, const Bitset { auto &execution = get_entry_point(); - if (flags.get(DecorationRelaxedPrecision)) + if (type.basetype == SPIRType::UInt && is_legacy_es()) + { + // HACK: This is a bool. See comment in type_to_glsl(). + qual += "lowp "; + } + else if (flags.get(DecorationRelaxedPrecision)) { bool implied_fmediump = type.basetype == SPIRType::Float && options.fragment.default_float_precision == Options::Mediump && @@ -15265,9 +15756,16 @@ string CompilerGLSL::pls_decl(const PlsRemap &var) { auto &variable = get(var.id); - SPIRType type; - type.vecsize = pls_format_to_components(var.format); - type.basetype = pls_format_to_basetype(var.format); + auto op_and_basetype = pls_format_to_basetype(var.format); + + SPIRType type { op_and_basetype.first }; + type.basetype = op_and_basetype.second; + auto vecsize = pls_format_to_components(var.format); + if (vecsize > 1) + { + type.op = OpTypeVector; + type.vecsize = vecsize; + } return join(to_pls_layout(var.format), to_pls_qualifiers_glsl(variable), type_to_glsl(type), " ", to_name(variable.self)); @@ -15317,7 +15815,7 @@ string CompilerGLSL::to_array_size(const SPIRType &type, uint32_t index) return ""; } -string CompilerGLSL::type_to_array_glsl(const SPIRType &type) +string CompilerGLSL::type_to_array_glsl(const SPIRType &type, uint32_t) { if (type.pointer && type.storage == StorageClassPhysicalStorageBufferEXT && type.basetype != SPIRType::Struct) { @@ -15364,7 +15862,7 @@ string CompilerGLSL::type_to_array_glsl(const SPIRType &type) } } -string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t id) +string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t id, bool /*member*/) { auto &imagetype = get(type.image.type); string res; @@ -15516,17 +16014,29 @@ string CompilerGLSL::type_to_glsl_constructor(const SPIRType &type) // depend on a specific object's use of that type. string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) { - if (type.pointer && type.storage == StorageClassPhysicalStorageBufferEXT && type.basetype != SPIRType::Struct) + if (is_physical_pointer(type) && !is_physical_pointer_to_buffer_block(type)) { // Need to create a magic type name which compacts the entire type information. - string name = type_to_glsl(get_pointee_type(type)); - for (size_t i = 0; i < type.array.size(); i++) + auto *parent = &get_pointee_type(type); + string name = type_to_glsl(*parent); + + uint32_t array_stride = get_decoration(type.parent_type, DecorationArrayStride); + + // Resolve all array dimensions in one go since once we lose the pointer type, + // array information is left to to_array_type_glsl. The base type loses array information. + while (is_array(*parent)) { - if (type.array_size_literal[i]) - name += join(type.array[i], "_"); + if (parent->array_size_literal.back()) + name += join(type.array.back(), "_"); else - name += join("id", type.array[i], "_"); + name += join("id", type.array.back(), "_"); + + name += "stride_" + std::to_string(array_stride); + + array_stride = get_decoration(parent->parent_type, DecorationArrayStride); + parent = &get(parent->parent_type); } + name += "Pointer"; return name; } @@ -15565,7 +16075,11 @@ string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) if (type.basetype == SPIRType::UInt && is_legacy()) { if (options.es) - SPIRV_CROSS_THROW("Unsigned integers are not supported on legacy ESSL."); + // HACK: spirv-cross changes bools into uints and generates code which compares them to + // zero. Input code will have already been validated as not to have contained any uints, + // so any remaining uints must in fact be bools. However, simply returning "bool" here + // will result in invalid code. Instead, return an int. + return backend.basic_int_type; else require_extension_internal("GL_EXT_gpu_shader4"); } @@ -15865,7 +16379,7 @@ void CompilerGLSL::emit_function_prototype(SPIRFunction &func, const Bitset &ret auto &type = get(func.return_type); decl += flags_to_qualifiers_glsl(type, return_flags); decl += type_to_glsl(type); - decl += type_to_array_glsl(type); + decl += type_to_array_glsl(type, 0); decl += " "; if (func.self == ir.default_entry_point) @@ -16525,8 +17039,11 @@ bool CompilerGLSL::attempt_emit_loop_header(SPIRBlock &block, SPIRBlock::Method bool condition_is_temporary = forced_temporaries.find(block.condition) == end(forced_temporaries); + bool flushes_phi = flush_phi_required(block.self, block.true_block) || + flush_phi_required(block.self, block.false_block); + // This can work! We only did trivial things which could be forwarded in block body! - if (current_count == statement_count && condition_is_temporary) + if (!flushes_phi && current_count == statement_count && condition_is_temporary) { switch (continue_type) { @@ -16605,7 +17122,10 @@ bool CompilerGLSL::attempt_emit_loop_header(SPIRBlock &block, SPIRBlock::Method bool condition_is_temporary = forced_temporaries.find(child.condition) == end(forced_temporaries); - if (current_count == statement_count && condition_is_temporary) + bool flushes_phi = flush_phi_required(child.self, child.true_block) || + flush_phi_required(child.self, child.false_block); + + if (!flushes_phi && current_count == statement_count && condition_is_temporary) { uint32_t target_block = child.true_block; @@ -17134,7 +17654,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) if (!collapsed_switch) { - if (block_like_switch || is_legacy_es()) + if (block_like_switch || is_legacy()) { // ESSL 1.0 is not guaranteed to support do/while. if (is_legacy_es()) @@ -17164,7 +17684,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) // Default case. if (!block_like_switch) { - if (is_legacy_es()) + if (is_legacy()) statement("else"); else statement("default:"); @@ -17172,7 +17692,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) } else { - if (is_legacy_es()) + if (is_legacy()) { statement((i ? "else " : ""), "if (", to_legacy_case_label(block.condition, literals, label_suffix), ")"); @@ -17224,7 +17744,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) if (block.default_block == block.next_block) { - if (is_legacy_es()) + if (is_legacy()) statement("else"); else statement("default:"); @@ -17238,7 +17758,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) if (!collapsed_switch) { - if (block_like_switch && !is_legacy_es()) + if ((block_like_switch || is_legacy()) && !is_legacy_es()) end_scope_decl("while(false)"); else end_scope(); @@ -17574,7 +18094,7 @@ bool CompilerGLSL::unroll_array_to_complex_store(uint32_t target_id, uint32_t so else array_expr = to_expression(type.array.back()); - SPIRType target_type; + SPIRType target_type { OpTypeInt }; target_type.basetype = SPIRType::Int; statement("for (int i = 0; i < int(", array_expr, "); i++)"); @@ -17639,7 +18159,7 @@ void CompilerGLSL::unroll_array_from_complex_load(uint32_t target_id, uint32_t s statement(new_expr, "[i] = gl_in[i].", expr, ";"); else if (is_sample_mask) { - SPIRType target_type; + SPIRType target_type { OpTypeInt }; target_type.basetype = SPIRType::Int; statement(new_expr, "[i] = ", bitcast_expression(target_type, type.basetype, join(expr, "[i]")), ";"); } @@ -17718,19 +18238,8 @@ void CompilerGLSL::cast_from_variable_load(uint32_t source_id, std::string &expr expr = bitcast_expression(expr_type, expected_type, expr); } -void CompilerGLSL::cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) +SPIRType::BaseType CompilerGLSL::get_builtin_basetype(BuiltIn builtin, SPIRType::BaseType default_type) { - auto *var = maybe_get_backing_variable(target_id); - if (var) - target_id = var->self; - - // Only interested in standalone builtin variables. - if (!has_decoration(target_id, DecorationBuiltIn)) - return; - - auto builtin = static_cast(get_decoration(target_id, DecorationBuiltIn)); - auto expected_type = expr_type.basetype; - // TODO: Fill in for more builtins. switch (builtin) { @@ -17741,12 +18250,25 @@ void CompilerGLSL::cast_to_variable_store(uint32_t target_id, std::string &expr, case BuiltInSampleMask: case BuiltInPrimitiveShadingRateKHR: case BuiltInShadingRateKHR: - expected_type = SPIRType::Int; - break; + return SPIRType::Int; default: - break; + return default_type; } +} + +void CompilerGLSL::cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) +{ + auto *var = maybe_get_backing_variable(target_id); + if (var) + target_id = var->self; + + // Only interested in standalone builtin variables. + if (!has_decoration(target_id, DecorationBuiltIn)) + return; + + auto builtin = static_cast(get_decoration(target_id, DecorationBuiltIn)); + auto expected_type = get_builtin_basetype(builtin, expr_type.basetype); if (expected_type != expr_type.basetype) { @@ -18612,3 +19134,22 @@ uint32_t CompilerGLSL::type_to_location_count(const SPIRType &type) const return count; } + +std::string CompilerGLSL::format_float(float value) const +{ + if (float_formatter) + return float_formatter->format_float(value); + + // default behavior + return convert_to_string(value, current_locale_radix_character); +} + +std::string CompilerGLSL::format_double(double value) const +{ + if (float_formatter) + return float_formatter->format_double(value); + + // default behavior + return convert_to_string(value, current_locale_radix_character); +} + diff --git a/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp b/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp index 8a841f34..8a002632 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp +++ b/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp @@ -66,7 +66,9 @@ enum AccessChainFlagBits ACCESS_CHAIN_SKIP_REGISTER_EXPRESSION_READ_BIT = 1 << 3, ACCESS_CHAIN_LITERAL_MSB_FORCE_ID = 1 << 4, ACCESS_CHAIN_FLATTEN_ALL_MEMBERS_BIT = 1 << 5, - ACCESS_CHAIN_FORCE_COMPOSITE_BIT = 1 << 6 + ACCESS_CHAIN_FORCE_COMPOSITE_BIT = 1 << 6, + ACCESS_CHAIN_PTR_CHAIN_POINTER_ARITH_BIT = 1 << 7, + ACCESS_CHAIN_PTR_CHAIN_CAST_TO_SCALAR_BIT = 1 << 8 }; typedef uint32_t AccessChainFlags; @@ -287,6 +289,14 @@ class CompilerGLSL : public Compiler void mask_stage_output_by_location(uint32_t location, uint32_t component); void mask_stage_output_by_builtin(spv::BuiltIn builtin); + // Allow to control how to format float literals in the output. + // Set to "nullptr" to use the default "convert_to_string" function. + // This handle is not owned by SPIRV-Cross and must remain valid until compile() has been called. + void set_float_formatter(FloatFormatter *formatter) + { + float_formatter = formatter; + } + protected: struct ShaderSubgroupSupportHelper { @@ -430,7 +440,7 @@ class CompilerGLSL : public Compiler virtual void emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, const std::string &qualifier = "", uint32_t base_offset = 0); virtual void emit_struct_padding_target(const SPIRType &type); - virtual std::string image_type_glsl(const SPIRType &type, uint32_t id = 0); + virtual std::string image_type_glsl(const SPIRType &type, uint32_t id = 0, bool member = false); std::string constant_expression(const SPIRConstant &c, bool inside_block_like_struct_scope = false, bool inside_struct_scope = false); @@ -469,7 +479,7 @@ class CompilerGLSL : public Compiler uint32_t coord = 0, coord_components = 0, dref = 0; uint32_t grad_x = 0, grad_y = 0, lod = 0, offset = 0; uint32_t bias = 0, component = 0, sample = 0, sparse_texel = 0, min_lod = 0; - bool nonuniform_expression = false; + bool nonuniform_expression = false, has_array_offsets = false; }; virtual std::string to_function_args(const TextureFunctionArguments &args, bool *p_forward); @@ -556,8 +566,8 @@ class CompilerGLSL : public Compiler Options options; - virtual std::string type_to_array_glsl( - const SPIRType &type); // Allow Metal to use the array template to make arrays a value type + // Allow Metal to use the array template to make arrays a value type + virtual std::string type_to_array_glsl(const SPIRType &type, uint32_t variable_id); std::string to_array_size(const SPIRType &type, uint32_t index); uint32_t to_array_size_literal(const SPIRType &type, uint32_t index) const; uint32_t to_array_size_literal(const SPIRType &type) const; @@ -745,11 +755,15 @@ class CompilerGLSL : public Compiler std::string access_chain_internal(uint32_t base, const uint32_t *indices, uint32_t count, AccessChainFlags flags, AccessChainMeta *meta); + // Only meaningful on backends with physical pointer support ala MSL. + // Relevant for PtrAccessChain / BDA. + virtual uint32_t get_physical_type_stride(const SPIRType &type) const; + spv::StorageClass get_expression_effective_storage_class(uint32_t ptr); virtual bool access_chain_needs_stage_io_builtin_translation(uint32_t base); virtual void check_physical_type_cast(std::string &expr, const SPIRType *type, uint32_t physical_type); - virtual void prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, + virtual bool prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, spv::StorageClass storage, bool &is_packed); std::string access_chain(uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type, @@ -825,7 +839,9 @@ class CompilerGLSL : public Compiler bool buffer_is_packing_standard(const SPIRType &type, BufferPackingStandard packing, uint32_t *failed_index = nullptr, uint32_t start_offset = 0, uint32_t end_offset = ~(0u)); - std::string buffer_to_packing_standard(const SPIRType &type, bool support_std430_without_scalar_layout); + std::string buffer_to_packing_standard(const SPIRType &type, + bool support_std430_without_scalar_layout, + bool support_enhanced_layouts); uint32_t type_to_packed_base_size(const SPIRType &type, BufferPackingStandard packing); uint32_t type_to_packed_alignment(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing); @@ -923,6 +939,15 @@ class CompilerGLSL : public Compiler PolyfillMatrixInverse2x2 = 1 << 6, PolyfillMatrixInverse3x3 = 1 << 7, PolyfillMatrixInverse4x4 = 1 << 8, + PolyfillNMin16 = 1 << 9, + PolyfillNMin32 = 1 << 10, + PolyfillNMin64 = 1 << 11, + PolyfillNMax16 = 1 << 12, + PolyfillNMax32 = 1 << 13, + PolyfillNMax64 = 1 << 14, + PolyfillNClamp16 = 1 << 15, + PolyfillNClamp32 = 1 << 16, + PolyfillNClamp64 = 1 << 17, }; uint32_t required_polyfills = 0; @@ -993,6 +1018,7 @@ class CompilerGLSL : public Compiler // Builtins in GLSL are always specific signedness, but the SPIR-V can declare them // as either unsigned or signed. // Sometimes we will need to automatically perform casts on load and store to make this work. + virtual SPIRType::BaseType get_builtin_basetype(spv::BuiltIn builtin, SPIRType::BaseType default_type); virtual void cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type); virtual void cast_from_variable_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type); void unroll_array_from_complex_load(uint32_t target_id, uint32_t source_id, std::string &expr); @@ -1030,6 +1056,10 @@ class CompilerGLSL : public Compiler std::unordered_set masked_output_locations; std::unordered_set masked_output_builtins; + FloatFormatter *float_formatter = nullptr; + std::string format_float(float value) const; + std::string format_double(double value) const; + private: void init(); diff --git a/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp b/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp index 8ba79b63..560f177b 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp +++ b/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp @@ -849,9 +849,23 @@ void CompilerHLSL::emit_builtin_inputs_in_struct() case BuiltInSubgroupLeMask: case BuiltInSubgroupGtMask: case BuiltInSubgroupGeMask: + // Handled specially. + break; + case BuiltInBaseVertex: + if (hlsl_options.shader_model >= 68) + { + type = "uint"; + semantic = "SV_StartVertexLocation"; + } + break; + case BuiltInBaseInstance: - // Handled specially. + if (hlsl_options.shader_model >= 68) + { + type = "uint"; + semantic = "SV_StartInstanceLocation"; + } break; case BuiltInHelperInvocation: @@ -905,6 +919,17 @@ void CompilerHLSL::emit_builtin_inputs_in_struct() semantic = "SV_RenderTargetArrayIndex"; break; + case BuiltInBaryCoordKHR: + case BuiltInBaryCoordNoPerspKHR: + if (hlsl_options.shader_model < 61) + SPIRV_CROSS_THROW("SM 6.1 is required for barycentrics."); + type = builtin == BuiltInBaryCoordNoPerspKHR ? "noperspective float3" : "float3"; + if (active_input_builtins.get(BuiltInBaryCoordKHR) && active_input_builtins.get(BuiltInBaryCoordNoPerspKHR)) + semantic = builtin == BuiltInBaryCoordKHR ? "SV_Barycentrics0" : "SV_Barycentrics1"; + else + semantic = "SV_Barycentrics"; + break; + default: SPIRV_CROSS_THROW("Unsupported builtin in HLSL."); } @@ -944,7 +969,7 @@ string CompilerHLSL::to_interpolation_qualifiers(const Bitset &flags) string res; //if (flags & (1ull << DecorationSmooth)) // res += "linear "; - if (flags.get(DecorationFlat)) + if (flags.get(DecorationFlat) || flags.get(DecorationPerVertexKHR)) res += "nointerpolation "; if (flags.get(DecorationNoPerspective)) res += "noperspective "; @@ -1000,9 +1025,13 @@ void CompilerHLSL::emit_interface_block_member_in_struct(const SPIRVariable &var auto mbr_name = join(to_name(type.self), "_", to_member_name(type, member_index)); auto &mbr_type = get(type.member_types[member_index]); - statement(to_interpolation_qualifiers(get_member_decoration_bitset(type.self, member_index)), + Bitset member_decorations = get_member_decoration_bitset(type.self, member_index); + if (has_decoration(var.self, DecorationPerVertexKHR)) + member_decorations.set(DecorationPerVertexKHR); + + statement(to_interpolation_qualifiers(member_decorations), type_to_glsl(mbr_type), - " ", mbr_name, type_to_array_glsl(mbr_type), + " ", mbr_name, type_to_array_glsl(mbr_type, var.self), " : ", semantic, ";"); // Structs and arrays should consume more locations. @@ -1088,7 +1117,7 @@ void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unord else { auto decl_type = type; - if (execution.model == ExecutionModelMeshEXT) + if (execution.model == ExecutionModelMeshEXT || has_decoration(var.self, DecorationPerVertexKHR)) { decl_type.array.erase(decl_type.array.begin()); decl_type.array_size_literal.erase(decl_type.array_size_literal.begin()); @@ -1149,29 +1178,48 @@ void CompilerHLSL::emit_builtin_variables() builtins.merge_or(active_output_builtins); std::unordered_map builtin_to_initializer; - ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { - if (!is_builtin_variable(var) || var.storage != StorageClassOutput || !var.initializer) - return; - auto *c = this->maybe_get(var.initializer); - if (!c) + // We need to declare sample mask with the same type that module declares it. + // Sample mask is somewhat special in that SPIR-V has an array, and we can copy that array, so we need to + // match sign. + SPIRType::BaseType sample_mask_in_basetype = SPIRType::Void; + SPIRType::BaseType sample_mask_out_basetype = SPIRType::Void; + + ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { + if (!is_builtin_variable(var)) return; auto &type = this->get(var.basetype); - if (type.basetype == SPIRType::Struct) + auto builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn)); + + if (var.storage == StorageClassInput && builtin == BuiltInSampleMask) + sample_mask_in_basetype = type.basetype; + else if (var.storage == StorageClassOutput && builtin == BuiltInSampleMask) + sample_mask_out_basetype = type.basetype; + + if (var.initializer && var.storage == StorageClassOutput) { - uint32_t member_count = uint32_t(type.member_types.size()); - for (uint32_t i = 0; i < member_count; i++) + auto *c = this->maybe_get(var.initializer); + if (!c) + return; + + if (type.basetype == SPIRType::Struct) { - if (has_member_decoration(type.self, i, DecorationBuiltIn)) + uint32_t member_count = uint32_t(type.member_types.size()); + for (uint32_t i = 0; i < member_count; i++) { - builtin_to_initializer[get_member_decoration(type.self, i, DecorationBuiltIn)] = - c->subconstants[i]; + if (has_member_decoration(type.self, i, DecorationBuiltIn)) + { + builtin_to_initializer[get_member_decoration(type.self, i, DecorationBuiltIn)] = + c->subconstants[i]; + } } } + else if (has_decoration(var.self, DecorationBuiltIn)) + { + builtin_to_initializer[builtin] = var.initializer; + } } - else if (has_decoration(var.self, DecorationBuiltIn)) - builtin_to_initializer[get_decoration(var.self, DecorationBuiltIn)] = var.initializer; }); // Emit global variables for the interface variables which are statically used by the shader. @@ -1212,7 +1260,7 @@ void CompilerHLSL::emit_builtin_variables() case BuiltInVertexIndex: case BuiltInInstanceIndex: type = "int"; - if (hlsl_options.support_nonzero_base_vertex_base_instance) + if (hlsl_options.support_nonzero_base_vertex_base_instance || hlsl_options.shader_model >= 68) base_vertex_info.used = true; break; @@ -1288,7 +1336,11 @@ void CompilerHLSL::emit_builtin_variables() break; case BuiltInSampleMask: - type = "int"; + if (active_input_builtins.get(BuiltInSampleMask)) + type = sample_mask_in_basetype == SPIRType::UInt ? "uint" : "int"; + else + type = sample_mask_out_basetype == SPIRType::UInt ? "uint" : "int"; + array_size = 1; break; case BuiltInPrimitiveId: @@ -1304,6 +1356,13 @@ void CompilerHLSL::emit_builtin_variables() type = "uint"; break; + case BuiltInBaryCoordKHR: + case BuiltInBaryCoordNoPerspKHR: + if (hlsl_options.shader_model < 61) + SPIRV_CROSS_THROW("Need SM 6.1 for barycentrics."); + type = "float3"; + break; + default: SPIRV_CROSS_THROW(join("Unsupported builtin in HLSL: ", unsigned(builtin))); } @@ -1322,11 +1381,15 @@ void CompilerHLSL::emit_builtin_variables() // declared the input variable and we need to add the output one now. if (builtin == BuiltInSampleMask && storage == StorageClassInput && this->active_output_builtins.get(i)) { - statement("static ", type, " ", this->builtin_to_glsl(builtin, StorageClassOutput), init_expr, ";"); + type = sample_mask_out_basetype == SPIRType::UInt ? "uint" : "int"; + if (array_size) + statement("static ", type, " ", this->builtin_to_glsl(builtin, StorageClassOutput), "[", array_size, "]", init_expr, ";"); + else + statement("static ", type, " ", this->builtin_to_glsl(builtin, StorageClassOutput), init_expr, ";"); } }); - if (base_vertex_info.used) + if (base_vertex_info.used && hlsl_options.shader_model < 68) { string binding_info; if (base_vertex_info.explicit_binding) @@ -1536,6 +1599,18 @@ void CompilerHLSL::replace_illegal_names() CompilerGLSL::replace_illegal_names(); } +SPIRType::BaseType CompilerHLSL::get_builtin_basetype(BuiltIn builtin, SPIRType::BaseType default_type) +{ + switch (builtin) + { + case BuiltInSampleMask: + // We declare sample mask array with module type, so always use default_type here. + return default_type; + default: + return CompilerGLSL::get_builtin_basetype(builtin, default_type); + } +} + void CompilerHLSL::emit_resources() { auto &execution = get_entry_point(); @@ -2238,7 +2313,7 @@ void CompilerHLSL::emit_resources() // Need out variable since HLSL does not support returning arrays. auto &type = get(type_id); auto type_str = type_to_glsl(type); - auto type_arr_str = type_to_array_glsl(type); + auto type_arr_str = type_to_array_glsl(type, 0); statement("void spvSelectComposite(out ", type_str, " out_value", type_arr_str, ", bool cond, ", type_str, " true_val", type_arr_str, ", ", type_str, " false_val", type_arr_str, ")"); @@ -2393,7 +2468,7 @@ void CompilerHLSL::analyze_meshlet_writes() uint32_t op_ptr = op_type + 2; uint32_t op_var = op_type + 3; - auto &type = set(op_type); + auto &type = set(op_type, OpTypeStruct); type.basetype = SPIRType::Struct; set_name(op_type, block_name); set_decoration(op_type, DecorationBlock); @@ -2640,7 +2715,7 @@ void CompilerHLSL::emit_buffer_block(const SPIRVariable &var) type_name = is_readonly ? "ByteAddressBuffer" : is_interlocked ? "RasterizerOrderedByteAddressBuffer" : "RWByteAddressBuffer"; add_resource_name(var.self); - statement(is_coherent ? "globallycoherent " : "", type_name, " ", to_name(var.self), type_to_array_glsl(type), + statement(is_coherent ? "globallycoherent " : "", type_name, " ", to_name(var.self), type_to_array_glsl(type, var.self), to_resource_binding(var), ";"); } else @@ -2727,7 +2802,7 @@ void CompilerHLSL::emit_buffer_block(const SPIRVariable &var) } emit_struct(get(type.self)); - statement("ConstantBuffer<", to_name(type.self), "> ", to_name(var.self), type_to_array_glsl(type), + statement("ConstantBuffer<", to_name(type.self), "> ", to_name(var.self), type_to_array_glsl(type, var.self), to_resource_binding(var), ";"); } } @@ -2913,7 +2988,7 @@ void CompilerHLSL::emit_function_prototype(SPIRFunction &func, const Bitset &ret out_argument += type_to_glsl(type); out_argument += " "; out_argument += "spvReturnValue"; - out_argument += type_to_array_glsl(type); + out_argument += type_to_array_glsl(type, 0); arglist.push_back(std::move(out_argument)); } @@ -2939,7 +3014,7 @@ void CompilerHLSL::emit_function_prototype(SPIRFunction &func, const Bitset &ret { // Manufacture automatic sampler arg for SampledImage texture arglist.push_back(join(is_depth_image(arg_type, arg.id) ? "SamplerComparisonState " : "SamplerState ", - to_sampler_expression(arg.id), type_to_array_glsl(arg_type))); + to_sampler_expression(arg.id), type_to_array_glsl(arg_type, arg.id))); } // Hold a pointer to the parameter so we can invalidate the readonly field if needed. @@ -3097,23 +3172,39 @@ void CompilerHLSL::emit_hlsl_entry_point() case BuiltInVertexIndex: case BuiltInInstanceIndex: // D3D semantics are uint, but shader wants int. - if (hlsl_options.support_nonzero_base_vertex_base_instance) + if (hlsl_options.support_nonzero_base_vertex_base_instance || hlsl_options.shader_model >= 68) { - if (static_cast(i) == BuiltInInstanceIndex) - statement(builtin, " = int(stage_input.", builtin, ") + SPIRV_Cross_BaseInstance;"); + if (hlsl_options.shader_model >= 68) + { + if (static_cast(i) == BuiltInInstanceIndex) + statement(builtin, " = int(stage_input.", builtin, " + stage_input.gl_BaseInstanceARB);"); + else + statement(builtin, " = int(stage_input.", builtin, " + stage_input.gl_BaseVertexARB);"); + } else - statement(builtin, " = int(stage_input.", builtin, ") + SPIRV_Cross_BaseVertex;"); + { + if (static_cast(i) == BuiltInInstanceIndex) + statement(builtin, " = int(stage_input.", builtin, ") + SPIRV_Cross_BaseInstance;"); + else + statement(builtin, " = int(stage_input.", builtin, ") + SPIRV_Cross_BaseVertex;"); + } } else statement(builtin, " = int(stage_input.", builtin, ");"); break; case BuiltInBaseVertex: - statement(builtin, " = SPIRV_Cross_BaseVertex;"); + if (hlsl_options.shader_model >= 68) + statement(builtin, " = stage_input.gl_BaseVertexARB;"); + else + statement(builtin, " = SPIRV_Cross_BaseVertex;"); break; case BuiltInBaseInstance: - statement(builtin, " = SPIRV_Cross_BaseInstance;"); + if (hlsl_options.shader_model >= 68) + statement(builtin, " = stage_input.gl_BaseInstanceARB;"); + else + statement(builtin, " = SPIRV_Cross_BaseInstance;"); break; case BuiltInInstanceId: @@ -3121,6 +3212,10 @@ void CompilerHLSL::emit_hlsl_entry_point() statement(builtin, " = int(stage_input.", builtin, ");"); break; + case BuiltInSampleMask: + statement(builtin, "[0] = stage_input.", builtin, ";"); + break; + case BuiltInNumWorkgroups: case BuiltInPointCoord: case BuiltInSubgroupSize: @@ -3225,11 +3320,23 @@ void CompilerHLSL::emit_hlsl_entry_point() { auto type_name = to_name(type.self); auto var_name = to_name(var.self); + bool is_per_vertex = has_decoration(var.self, DecorationPerVertexKHR); + uint32_t array_size = is_per_vertex ? to_array_size_literal(type) : 0; + for (uint32_t mbr_idx = 0; mbr_idx < uint32_t(type.member_types.size()); mbr_idx++) { auto mbr_name = to_member_name(type, mbr_idx); auto flat_name = join(type_name, "_", mbr_name); - statement(var_name, ".", mbr_name, " = stage_input.", flat_name, ";"); + + if (is_per_vertex) + { + for (uint32_t i = 0; i < array_size; i++) + statement(var_name, "[", i, "].", mbr_name, " = GetAttributeAtVertex(stage_input.", flat_name, ", ", i, ");"); + } + else + { + statement(var_name, ".", mbr_name, " = stage_input.", flat_name, ";"); + } } } else @@ -3242,6 +3349,12 @@ void CompilerHLSL::emit_hlsl_entry_point() for (uint32_t col = 0; col < mtype.columns; col++) statement(name, "[", col, "] = stage_input.", name, "_", col, ";"); } + else if (has_decoration(var.self, DecorationPerVertexKHR)) + { + uint32_t array_size = to_array_size_literal(type); + for (uint32_t i = 0; i < array_size; i++) + statement(name, "[", i, "]", " = GetAttributeAtVertex(stage_input.", name, ", ", i, ");"); + } else { statement(name, " = stage_input.", name, ";"); @@ -3295,6 +3408,10 @@ void CompilerHLSL::emit_hlsl_entry_point() cull, "];"); break; + case BuiltInSampleMask: + statement("stage_output.gl_SampleMask = gl_SampleMask[0];"); + break; + default: { auto builtin_expr = builtin_to_glsl(static_cast(i), StorageClassOutput); @@ -4029,16 +4146,16 @@ void CompilerHLSL::emit_modern_uniform(const SPIRVariable &var) is_coherent = has_decoration(var.self, DecorationCoherent); statement(is_coherent ? "globallycoherent " : "", image_type_hlsl_modern(type, var.self), " ", - to_name(var.self), type_to_array_glsl(type), to_resource_binding(var), ";"); + to_name(var.self), type_to_array_glsl(type, var.self), to_resource_binding(var), ";"); if (type.basetype == SPIRType::SampledImage && type.image.dim != DimBuffer) { // For combined image samplers, also emit a combined image sampler. if (is_depth_image(type, var.self)) - statement("SamplerComparisonState ", to_sampler_expression(var.self), type_to_array_glsl(type), + statement("SamplerComparisonState ", to_sampler_expression(var.self), type_to_array_glsl(type, var.self), to_resource_binding_sampler(var), ";"); else - statement("SamplerState ", to_sampler_expression(var.self), type_to_array_glsl(type), + statement("SamplerState ", to_sampler_expression(var.self), type_to_array_glsl(type, var.self), to_resource_binding_sampler(var), ";"); } break; @@ -4046,10 +4163,10 @@ void CompilerHLSL::emit_modern_uniform(const SPIRVariable &var) case SPIRType::Sampler: if (comparison_ids.count(var.self)) - statement("SamplerComparisonState ", to_name(var.self), type_to_array_glsl(type), to_resource_binding(var), + statement("SamplerComparisonState ", to_name(var.self), type_to_array_glsl(type, var.self), to_resource_binding(var), ";"); else - statement("SamplerState ", to_name(var.self), type_to_array_glsl(type), to_resource_binding(var), ";"); + statement("SamplerState ", to_name(var.self), type_to_array_glsl(type, var.self), to_resource_binding(var), ";"); break; default: @@ -4401,6 +4518,18 @@ void CompilerHLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); break; + case GLSLstd450NMin: + CompilerGLSL::emit_glsl_op(result_type, id, GLSLstd450FMin, args, count); + break; + + case GLSLstd450NMax: + CompilerGLSL::emit_glsl_op(result_type, id, GLSLstd450FMax, args, count); + break; + + case GLSLstd450NClamp: + CompilerGLSL::emit_glsl_op(result_type, id, GLSLstd450FClamp, args, count); + break; + default: CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); break; @@ -4461,7 +4590,7 @@ void CompilerHLSL::read_access_chain(string *expr, const string &lhs, const SPIR { auto &type = get(chain.basetype); - SPIRType target_type; + SPIRType target_type { is_scalar(type) ? OpTypeInt : type.op }; target_type.basetype = SPIRType::UInt; target_type.vecsize = type.vecsize; target_type.columns = type.columns; @@ -4696,14 +4825,19 @@ void CompilerHLSL::emit_load(const Instruction &instruction) void CompilerHLSL::write_access_chain_array(const SPIRAccessChain &chain, uint32_t value, const SmallVector &composite_chain) { - auto &type = get(chain.basetype); + auto *ptype = &get(chain.basetype); + while (ptype->pointer) + { + ptype = &get(ptype->basetype); + } + auto &type = *ptype; // Need to use a reserved identifier here since it might shadow an identifier in the access chain input or other loops. auto ident = get_unique_identifier(); uint32_t id = ir.increase_bound_by(2); uint32_t int_type_id = id + 1; - SPIRType int_type; + SPIRType int_type { OpTypeInt }; int_type.basetype = SPIRType::Int; int_type.width = 32; set(int_type_id, int_type); @@ -4791,7 +4925,7 @@ void CompilerHLSL::write_access_chain(const SPIRAccessChain &chain, uint32_t val // Make sure we trigger a read of the constituents in the access chain. track_expression_read(chain.self); - SPIRType target_type; + SPIRType target_type { is_scalar(type) ? OpTypeInt : type.op }; target_type.basetype = SPIRType::UInt; target_type.vecsize = type.vecsize; target_type.columns = type.columns; @@ -6531,14 +6665,14 @@ VariableID CompilerHLSL::remap_num_workgroups_builtin() uint32_t block_pointer_type_id = offset + 2; uint32_t variable_id = offset + 3; - SPIRType uint_type; + SPIRType uint_type { OpTypeVector }; uint_type.basetype = SPIRType::UInt; uint_type.width = 32; uint_type.vecsize = 3; uint_type.columns = 1; set(uint_type_id, uint_type); - SPIRType block_type; + SPIRType block_type { OpTypeStruct }; block_type.basetype = SPIRType::Struct; block_type.member_types.push_back(uint_type_id); set(block_type_id, block_type); @@ -6631,6 +6765,7 @@ string CompilerHLSL::compile() backend.support_case_fallthrough = false; backend.force_merged_mesh_block = get_execution_model() == ExecutionModelMeshEXT; backend.force_gl_in_out_block = backend.force_merged_mesh_block; + backend.supports_empty_struct = hlsl_options.shader_model <= 30; // SM 4.1 does not support precise for some reason. backend.support_precise_qualifier = hlsl_options.shader_model >= 50 || hlsl_options.shader_model == 40; @@ -6650,6 +6785,15 @@ string CompilerHLSL::compile() if (need_subpass_input) active_input_builtins.set(BuiltInFragCoord); + // Need to offset by BaseVertex/BaseInstance in SM 6.8+. + if (hlsl_options.shader_model >= 68) + { + if (active_input_builtins.get(BuiltInVertexIndex)) + active_input_builtins.set(BuiltInBaseVertex); + if (active_input_builtins.get(BuiltInInstanceIndex)) + active_input_builtins.set(BuiltInBaseInstance); + } + uint32_t pass_count = 0; do { @@ -6746,11 +6890,6 @@ void CompilerHLSL::set_hlsl_force_storage_buffer_as_uav(uint32_t desc_set, uint3 force_uav_buffer_bindings.insert(pair); } -bool CompilerHLSL::builtin_translates_to_nonarray(spv::BuiltIn builtin) const -{ - return (builtin == BuiltInSampleMask); -} - bool CompilerHLSL::is_user_type_structured(uint32_t id) const { if (hlsl_options.preserve_structured_buffers) diff --git a/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp b/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp index a5d30b1b..bec458c6 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp +++ b/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp @@ -126,7 +126,7 @@ class CompilerHLSL : public CompilerGLSL // By default, a readonly storage buffer will be declared as ByteAddressBuffer (SRV) instead. // Alternatively, use set_hlsl_force_storage_buffer_as_uav to specify individually. bool force_storage_buffer_as_uav = false; - + // Forces any storage image type marked as NonWritable to be considered an SRV instead. // For this to work with function call parameters, NonWritable must be considered to be part of the type system // so that NonWritable image arguments are also translated to Texture rather than RWTexture. @@ -290,6 +290,8 @@ class CompilerHLSL : public CompilerGLSL const char *to_storage_qualifiers_glsl(const SPIRVariable &var) override; void replace_illegal_names() override; + SPIRType::BaseType get_builtin_basetype(spv::BuiltIn builtin, SPIRType::BaseType default_type) override; + bool is_hlsl_force_storage_buffer_as_uav(ID id) const; Options hlsl_options; @@ -400,9 +402,6 @@ class CompilerHLSL : public CompilerGLSL bool used = false; } base_vertex_info; - // Returns true for BuiltInSampleMask because gl_SampleMask[] is an array in SPIR-V, but SV_Coverage is a scalar in HLSL. - bool builtin_translates_to_nonarray(spv::BuiltIn builtin) const override; - // Returns true if the specified ID has a UserTypeGOOGLE decoration for StructuredBuffer or RWStructuredBuffer resources. bool is_user_type_structured(uint32_t id) const override; diff --git a/bgfx/3rdparty/spirv-cross/spirv_msl.cpp b/bgfx/3rdparty/spirv-cross/spirv_msl.cpp index 363d4852..aba26be8 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_msl.cpp +++ b/bgfx/3rdparty/spirv-cross/spirv_msl.cpp @@ -189,14 +189,29 @@ bool CompilerMSL::is_msl_resource_binding_used(ExecutionModel model, uint32_t de return itr != end(resource_bindings) && itr->second.second; } -// Returns the size of the array of resources used by the variable with the specified id. -// The returned value is retrieved from the resource binding added using add_msl_resource_binding(). -uint32_t CompilerMSL::get_resource_array_size(uint32_t id) const +bool CompilerMSL::is_var_runtime_size_array(const SPIRVariable &var) const { - StageSetBinding tuple = { get_entry_point().model, get_decoration(id, DecorationDescriptorSet), + auto& type = get_variable_data_type(var); + return is_runtime_size_array(type) && get_resource_array_size(type, var.self) == 0; +} + +// Returns the size of the array of resources used by the variable with the specified type and id. +// The size is first retrieved from the type, but in the case of runtime array sizing, +// the size is retrieved from the resource binding added using add_msl_resource_binding(). +uint32_t CompilerMSL::get_resource_array_size(const SPIRType &type, uint32_t id) const +{ + uint32_t array_size = to_array_size_literal(type); + + // If we have argument buffers, we need to honor the ABI by using the correct array size + // from the layout. Only use shader declared size if we're not using argument buffers. + uint32_t desc_set = get_decoration(id, DecorationDescriptorSet); + if (!descriptor_set_is_argument_buffer(desc_set) && array_size) + return array_size; + + StageSetBinding tuple = { get_entry_point().model, desc_set, get_decoration(id, DecorationBinding) }; auto itr = resource_bindings.find(tuple); - return itr != end(resource_bindings) ? itr->second.first.count : 0; + return itr != end(resource_bindings) ? itr->second.first.count : array_size; } uint32_t CompilerMSL::get_automatic_msl_resource_binding(uint32_t id) const @@ -256,11 +271,14 @@ void CompilerMSL::build_implicit_builtins() active_input_builtins.get(BuiltInInstanceIndex) || active_input_builtins.get(BuiltInBaseInstance)); bool need_local_invocation_index = msl_options.emulate_subgroups && active_input_builtins.get(BuiltInSubgroupId); bool need_workgroup_size = msl_options.emulate_subgroups && active_input_builtins.get(BuiltInNumSubgroups); + bool force_frag_depth_passthrough = + get_execution_model() == ExecutionModelFragment && !uses_explicit_early_fragment_test() && need_subpass_input && + msl_options.enable_frag_depth_builtin && msl_options.input_attachment_is_ds_attachment; if (need_subpass_input || need_sample_pos || need_subgroup_mask || need_vertex_params || need_tesc_params || need_tese_params || need_multiview || need_dispatch_base || need_vertex_base_params || need_grid_params || needs_sample_id || needs_subgroup_invocation_id || needs_subgroup_size || needs_helper_invocation || - has_additional_fixed_sample_mask() || need_local_invocation_index || need_workgroup_size) + has_additional_fixed_sample_mask() || need_local_invocation_index || need_workgroup_size || force_frag_depth_passthrough) { bool has_frag_coord = false; bool has_sample_id = false; @@ -277,6 +295,7 @@ void CompilerMSL::build_implicit_builtins() bool has_helper_invocation = false; bool has_local_invocation_index = false; bool has_workgroup_size = false; + bool has_frag_depth = false; uint32_t workgroup_id_type = 0; ir.for_each_typed_id([&](uint32_t, SPIRVariable &var) { @@ -297,6 +316,13 @@ void CompilerMSL::build_implicit_builtins() mark_implicit_builtin(StorageClassOutput, BuiltInSampleMask, var.self); does_shader_write_sample_mask = true; } + + if (force_frag_depth_passthrough && builtin == BuiltInFragDepth) + { + builtin_frag_depth_id = var.self; + mark_implicit_builtin(StorageClassOutput, BuiltInFragDepth, var.self); + has_frag_depth = true; + } } if (var.storage != StorageClassInput) @@ -473,14 +499,14 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 2; // Create gl_FragCoord. - SPIRType vec4_type; + SPIRType vec4_type { OpTypeVector }; vec4_type.basetype = SPIRType::Float; vec4_type.width = 32; vec4_type.vecsize = 4; set(type_id, vec4_type); - SPIRType vec4_type_ptr; - vec4_type_ptr = vec4_type; + SPIRType vec4_type_ptr = vec4_type; + vec4_type_ptr.op = OpTypePointer; vec4_type_ptr.pointer = true; vec4_type_ptr.pointer_depth++; vec4_type_ptr.parent_type = type_id; @@ -501,8 +527,8 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 1; // Create gl_Layer. - SPIRType uint_type_ptr; - uint_type_ptr = get_uint_type(); + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; uint_type_ptr.pointer = true; uint_type_ptr.pointer_depth++; uint_type_ptr.parent_type = get_uint_type_id(); @@ -523,8 +549,8 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 1; // Create gl_ViewIndex. - SPIRType uint_type_ptr; - uint_type_ptr = get_uint_type(); + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; uint_type_ptr.pointer = true; uint_type_ptr.pointer_depth++; uint_type_ptr.parent_type = get_uint_type_id(); @@ -546,8 +572,8 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 1; // Create gl_SampleID. - SPIRType uint_type_ptr; - uint_type_ptr = get_uint_type(); + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; uint_type_ptr.pointer = true; uint_type_ptr.pointer_depth++; uint_type_ptr.parent_type = get_uint_type_id(); @@ -566,8 +592,8 @@ void CompilerMSL::build_implicit_builtins() { uint32_t type_ptr_id = ir.increase_bound_by(1); - SPIRType uint_type_ptr; - uint_type_ptr = get_uint_type(); + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; uint_type_ptr.pointer = true; uint_type_ptr.pointer_depth++; uint_type_ptr.parent_type = get_uint_type_id(); @@ -626,8 +652,8 @@ void CompilerMSL::build_implicit_builtins() // Note that we can't just abuse gl_ViewIndex for this purpose: it's an input, but // gl_Layer is an output in vertex-pipeline shaders. uint32_t type_ptr_out_id = ir.increase_bound_by(2); - SPIRType uint_type_ptr_out; - uint_type_ptr_out = get_uint_type(); + SPIRType uint_type_ptr_out = get_uint_type(); + uint_type_ptr.op = OpTypePointer; uint_type_ptr_out.pointer = true; uint_type_ptr_out.pointer_depth++; uint_type_ptr_out.parent_type = get_uint_type_id(); @@ -658,8 +684,8 @@ void CompilerMSL::build_implicit_builtins() { uint32_t type_ptr_id = ir.increase_bound_by(1); - SPIRType uint_type_ptr; - uint_type_ptr = get_uint_type(); + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; uint_type_ptr.pointer = true; uint_type_ptr.pointer_depth++; uint_type_ptr.parent_type = get_uint_type_id(); @@ -718,8 +744,8 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 1; // Create gl_SubgroupInvocationID. - SPIRType uint_type_ptr; - uint_type_ptr = get_uint_type(); + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; uint_type_ptr.pointer = true; uint_type_ptr.pointer_depth++; uint_type_ptr.parent_type = get_uint_type_id(); @@ -740,8 +766,8 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 1; // Create gl_SubgroupSize. - SPIRType uint_type_ptr; - uint_type_ptr = get_uint_type(); + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; uint_type_ptr.pointer = true; uint_type_ptr.pointer_depth++; uint_type_ptr.parent_type = get_uint_type_id(); @@ -799,8 +825,8 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 1; // Create gl_SampleMask. - SPIRType uint_type_ptr_out; - uint_type_ptr_out = get_uint_type(); + SPIRType uint_type_ptr_out = get_uint_type(); + uint_type_ptr_out.op = OpTypePointer; uint_type_ptr_out.pointer = true; uint_type_ptr_out.pointer_depth++; uint_type_ptr_out.parent_type = get_uint_type_id(); @@ -822,14 +848,14 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 2; // Create gl_HelperInvocation. - SPIRType bool_type; + SPIRType bool_type { OpTypeBool }; bool_type.basetype = SPIRType::Boolean; bool_type.width = 8; bool_type.vecsize = 1; set(type_id, bool_type); - SPIRType bool_type_ptr_in; - bool_type_ptr_in = bool_type; + SPIRType bool_type_ptr_in = bool_type; + bool_type_ptr_in.op = spv::OpTypePointer; bool_type_ptr_in.pointer = true; bool_type_ptr_in.pointer_depth++; bool_type_ptr_in.parent_type = type_id; @@ -850,8 +876,8 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 1; // Create gl_LocalInvocationIndex. - SPIRType uint_type_ptr; - uint_type_ptr = get_uint_type(); + SPIRType uint_type_ptr = get_uint_type(); + uint_type_ptr.op = OpTypePointer; uint_type_ptr.pointer = true; uint_type_ptr.pointer_depth++; uint_type_ptr.parent_type = get_uint_type_id(); @@ -874,6 +900,7 @@ void CompilerMSL::build_implicit_builtins() // Create gl_WorkgroupSize. uint32_t type_id = build_extended_vector_type(get_uint_type_id(), 3); SPIRType uint_type_ptr = get(type_id); + uint_type_ptr.op = OpTypePointer; uint_type_ptr.pointer = true; uint_type_ptr.pointer_depth++; uint_type_ptr.parent_type = type_id; @@ -886,6 +913,36 @@ void CompilerMSL::build_implicit_builtins() builtin_workgroup_size_id = var_id; mark_implicit_builtin(StorageClassInput, BuiltInWorkgroupSize, var_id); } + + if (!has_frag_depth && force_frag_depth_passthrough) + { + uint32_t offset = ir.increase_bound_by(3); + uint32_t type_id = offset; + uint32_t type_ptr_id = offset + 1; + uint32_t var_id = offset + 2; + + // Create gl_FragDepth + SPIRType float_type { OpTypeFloat }; + float_type.basetype = SPIRType::Float; + float_type.width = 32; + float_type.vecsize = 1; + set(type_id, float_type); + + SPIRType float_type_ptr_in = float_type; + float_type_ptr_in.op = spv::OpTypePointer; + float_type_ptr_in.pointer = true; + float_type_ptr_in.pointer_depth++; + float_type_ptr_in.parent_type = type_id; + float_type_ptr_in.storage = StorageClassOutput; + + auto &ptr_in_type = set(type_ptr_id, float_type_ptr_in); + ptr_in_type.self = type_id; + set(var_id, type_ptr_id, StorageClassOutput); + set_decoration(var_id, DecorationBuiltIn, BuiltInFragDepth); + builtin_frag_depth_id = var_id; + mark_implicit_builtin(StorageClassOutput, BuiltInFragDepth, var_id); + active_output_builtins.set(BuiltInFragDepth); + } } if (needs_swizzle_buffer_def) @@ -981,14 +1038,14 @@ void CompilerMSL::build_implicit_builtins() uint32_t var_id = offset + 2; // Create gl_Position. - SPIRType vec4_type; + SPIRType vec4_type { OpTypeVector }; vec4_type.basetype = SPIRType::Float; vec4_type.width = 32; vec4_type.vecsize = 4; set(type_id, vec4_type); - SPIRType vec4_type_ptr; - vec4_type_ptr = vec4_type; + SPIRType vec4_type_ptr = vec4_type; + vec4_type_ptr.op = OpTypePointer; vec4_type_ptr.pointer = true; vec4_type_ptr.pointer_depth++; vec4_type_ptr.parent_type = type_id; @@ -1065,6 +1122,7 @@ uint32_t CompilerMSL::build_constant_uint_array_pointer() // Create a buffer to hold extra data, including the swizzle constants. SPIRType uint_type_pointer = get_uint_type(); + uint_type_pointer.op = OpTypePointer; uint_type_pointer.pointer = true; uint_type_pointer.pointer_depth++; uint_type_pointer.parent_type = get_uint_type_id(); @@ -1143,7 +1201,7 @@ uint32_t CompilerMSL::get_uint_type_id() uint_type_id = ir.increase_bound_by(1); - SPIRType type; + SPIRType type { OpTypeInt }; type.basetype = SPIRType::UInt; type.width = 32; set(uint_type_id, type); @@ -1269,8 +1327,7 @@ void CompilerMSL::emit_entry_point_declarations() args.push_back(join("max_anisotropy(", s.max_anisotropy, ")")); if (s.lod_clamp_enable) { - args.push_back(join("lod_clamp(", convert_to_string(s.lod_clamp_min, current_locale_radix_character), ", ", - convert_to_string(s.lod_clamp_max, current_locale_radix_character), ")")); + args.push_back(join("lod_clamp(", format_float(s.lod_clamp_min), ", ", format_float(s.lod_clamp_max), ")")); } // If we would emit no arguments, then omit the parentheses entirely. Otherwise, @@ -1302,48 +1359,29 @@ void CompilerMSL::emit_entry_point_declarations() uint32_t arg_id = argument_buffer_ids[desc_set]; uint32_t base_index = dynamic_buffer.second.first; - if (!type.array.empty()) + if (is_array(type)) { - // This is complicated, because we need to support arrays of arrays. - // And it's even worse if the outermost dimension is a runtime array, because now - // all this complicated goop has to go into the shader itself. (FIXME) - if (!type.array[type.array.size() - 1]) - SPIRV_CROSS_THROW("Runtime arrays with dynamic offsets are not supported yet."); - else - { - is_using_builtin_array = true; - statement(get_argument_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(var_id, true), name, - type_to_array_glsl(type), " ="); + is_using_builtin_array = true; + statement(get_argument_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(var_id, true), name, + type_to_array_glsl(type, var_id), " ="); - uint32_t dim = uint32_t(type.array.size()); - uint32_t j = 0; - for (SmallVector indices(type.array.size()); - indices[type.array.size() - 1] < to_array_size_literal(type); j++) - { - while (dim > 0) - { - begin_scope(); - --dim; - } + uint32_t array_size = get_resource_array_size(type, var_id); + if (array_size == 0) + SPIRV_CROSS_THROW("Size of runtime array with dynamic offset could not be determined from resource bindings."); - string arrays; - for (uint32_t i = uint32_t(type.array.size()); i; --i) - arrays += join("[", indices[i - 1], "]"); - statement("(", get_argument_address_space(var), " ", type_to_glsl(type), "* ", - to_restrict(var_id, false), ")((", get_argument_address_space(var), " char* ", - to_restrict(var_id, false), ")", to_name(arg_id), ".", ensure_valid_name(name, "m"), - arrays, " + ", to_name(dynamic_offsets_buffer_id), "[", base_index + j, "]),"); + begin_scope(); - while (++indices[dim] >= to_array_size_literal(type, dim) && dim < type.array.size() - 1) - { - end_scope(","); - indices[dim++] = 0; - } - } - end_scope_decl(); - statement_no_indent(""); - is_using_builtin_array = false; + for (uint32_t i = 0; i < array_size; i++) + { + statement("(", get_argument_address_space(var), " ", type_to_glsl(type), "* ", + to_restrict(var_id, false), ")((", get_argument_address_space(var), " char* ", + to_restrict(var_id, false), ")", to_name(arg_id), ".", ensure_valid_name(name, "m"), + "[", i, "]", " + ", to_name(dynamic_offsets_buffer_id), "[", base_index + i, "]),"); } + + end_scope_decl(); + statement_no_indent(""); + is_using_builtin_array = false; } else { @@ -1361,26 +1399,35 @@ void CompilerMSL::emit_entry_point_declarations() const auto &type = get_variable_data_type(var); const auto &buffer_type = get_variable_element_type(var); const string name = to_name(var.self); - if (is_runtime_size_array(type)) + + if (is_var_runtime_size_array(var)) { if (msl_options.argument_buffers_tier < Options::ArgumentBuffersTier::Tier2) { SPIRV_CROSS_THROW("Unsized array of descriptors requires argument buffer tier 2"); } + + string resource_name; + if (descriptor_set_is_argument_buffer(get_decoration(var.self, DecorationDescriptorSet))) + resource_name = ir.meta[var.self].decoration.qualified_alias; + else + resource_name = name + "_"; + switch (type.basetype) { case SPIRType::Image: case SPIRType::Sampler: case SPIRType::AccelerationStructure: - statement("spvDescriptorArray<", type_to_glsl(buffer_type), "> ", name, " {", name, "_};"); + statement("spvDescriptorArray<", type_to_glsl(buffer_type, var.self), "> ", name, " {", resource_name, "};"); break; case SPIRType::SampledImage: - statement("spvDescriptorArray<", type_to_glsl(buffer_type), "> ", name, " {", name, "_};"); + statement("spvDescriptorArray<", type_to_glsl(buffer_type, var.self), "> ", name, " {", resource_name, "};"); + // Unsupported with argument buffer for now. statement("spvDescriptorArray ", name, "Smplr {", name, "Smplr_};"); break; case SPIRType::Struct: statement("spvDescriptorArray<", get_argument_address_space(var), " ", type_to_glsl(buffer_type), "*> ", - name, " {", name, "_};"); + name, " {", resource_name, "};"); break; default: break; @@ -1393,7 +1440,8 @@ void CompilerMSL::emit_entry_point_declarations() statement(get_argument_address_space(var), " ", type_to_glsl(buffer_type), "* ", to_restrict(var.self, true), name, "[] ="); begin_scope(); - for (uint32_t i = 0; i < to_array_size_literal(type); ++i) + uint32_t array_size = get_resource_array_size(type, var.self); + for (uint32_t i = 0; i < array_size; ++i) statement(name, "_", i, ","); end_scope_decl(); statement_no_indent(""); @@ -1447,7 +1495,7 @@ void CompilerMSL::emit_entry_point_declarations() is_using_builtin_array = true; statement(desc_addr_space, " auto& ", to_restrict(var_id, true), to_name(var_id), " = (", addr_space, " ", type_to_glsl(type), "* ", desc_addr_space, " (&)", - type_to_array_glsl(type), ")", ir.meta[alias_id].decoration.qualified_alias, ";"); + type_to_array_glsl(type, var_id), ")", ir.meta[alias_id].decoration.qualified_alias, ";"); is_using_builtin_array = false; } } @@ -1458,7 +1506,7 @@ void CompilerMSL::emit_entry_point_declarations() { auto &var = get(var_id); add_local_variable_name(var_id); - statement(variable_decl(var), ";"); + statement(CompilerGLSL::variable_decl(var), ";"); var.deferred_declaration = false; } } @@ -1528,11 +1576,12 @@ string CompilerMSL::compile() preprocess_op_codes(); build_implicit_builtins(); - if (needs_manual_helper_invocation_updates() && - (active_input_builtins.get(BuiltInHelperInvocation) || needs_helper_invocation)) + if (needs_manual_helper_invocation_updates() && needs_helper_invocation) { - string discard_expr = - join(builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), " = true, discard_fragment()"); + string builtin_helper_invocation = builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput); + string discard_expr = join(builtin_helper_invocation, " = true, discard_fragment()"); + if (msl_options.force_fragment_with_side_effects_execution) + discard_expr = join("!", builtin_helper_invocation, " ? (", discard_expr, ") : (void)0"); backend.discard_literal = discard_expr; backend.demote_literal = discard_expr; } @@ -1562,6 +1611,8 @@ string CompilerMSL::compile() add_active_interface_variable(builtin_dispatch_base_id); if (builtin_sample_mask_id) add_active_interface_variable(builtin_sample_mask_id); + if (builtin_frag_depth_id) + add_active_interface_variable(builtin_frag_depth_id); // Create structs to hold input, output and uniform variables. // Do output first to ensure out. is declared at top of entry function. @@ -1669,7 +1720,7 @@ void CompilerMSL::preprocess_op_codes() (is_sample_rate() && (active_input_builtins.get(BuiltInFragCoord) || (need_subpass_input_ms && !msl_options.use_framebuffer_fetch_subpasses)))) needs_sample_id = true; - if (preproc.needs_helper_invocation) + if (preproc.needs_helper_invocation || active_input_builtins.get(BuiltInHelperInvocation)) needs_helper_invocation = true; // OpKill is removed by the parser, so we need to identify those by inspecting @@ -1681,14 +1732,15 @@ void CompilerMSL::preprocess_op_codes() // Fragment shaders that both write to storage resources and discard fragments // need checks on the writes, to work around Metal allowing these writes despite - // the fragment being dead. - if (msl_options.check_discarded_frag_stores && preproc.uses_discard && - (preproc.uses_buffer_write || preproc.uses_image_write)) + // the fragment being dead. We also require to force Metal to execute fragment + // shaders instead of being prematurely discarded. + if (preproc.uses_discard && (preproc.uses_buffer_write || preproc.uses_image_write)) { - frag_shader_needs_discard_checks = true; - needs_helper_invocation = true; + bool should_enable = (msl_options.check_discarded_frag_stores || msl_options.force_fragment_with_side_effects_execution); + frag_shader_needs_discard_checks |= msl_options.check_discarded_frag_stores; + needs_helper_invocation |= should_enable; // Fragment discard store checks imply manual HelperInvocation updates. - msl_options.manual_helper_invocation_updates = true; + msl_options.manual_helper_invocation_updates |= should_enable; } if (is_intersection_query()) @@ -1859,8 +1911,13 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: { uint32_t base_id = ops[0]; if (global_var_ids.find(base_id) != global_var_ids.end()) + { added_arg_ids.insert(base_id); + if (msl_options.input_attachment_is_ds_attachment && base_id == builtin_frag_depth_id) + writes_to_depth = true; + } + uint32_t rvalue_id = ops[1]; if (global_var_ids.find(rvalue_id) != global_var_ids.end()) added_arg_ids.insert(rvalue_id); @@ -1898,9 +1955,18 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: case OpAtomicOr: case OpAtomicXor: case OpImageWrite: + { if (needs_frag_discard_checks()) added_arg_ids.insert(builtin_helper_invocation_id); + uint32_t ptr = 0; + if (op == OpAtomicStore || op == OpImageWrite) + ptr = ops[0]; + else + ptr = ops[2]; + if (global_var_ids.find(ptr) != global_var_ids.end()) + added_arg_ids.insert(ptr); break; + } // Emulate texture2D atomic operations case OpImageTexelPointer: @@ -1908,8 +1974,15 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: // When using the pointer, we need to know which variable it is actually loaded from. uint32_t base_id = ops[2]; auto *var = maybe_get_backing_variable(base_id); - if (var && atomic_image_vars.count(var->self)) + if (var) { + if (atomic_image_vars_emulated.count(var->self) && + !get(var->basetype).array.empty()) + { + SPIRV_CROSS_THROW( + "Cannot emulate array of storage images with atomics. Use MSL 3.1 for native support."); + } + if (global_var_ids.find(base_id) != global_var_ids.end()) added_arg_ids.insert(base_id); } @@ -1984,8 +2057,7 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: } case OpDemoteToHelperInvocation: - if (needs_manual_helper_invocation_updates() && - (active_input_builtins.get(BuiltInHelperInvocation) || needs_helper_invocation)) + if (needs_manual_helper_invocation_updates() && needs_helper_invocation) added_arg_ids.insert(builtin_helper_invocation_id); break; @@ -2038,7 +2110,7 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: } if (needs_manual_helper_invocation_updates() && b.terminator == SPIRBlock::Kill && - (active_input_builtins.get(BuiltInHelperInvocation) || needs_helper_invocation)) + needs_helper_invocation) added_arg_ids.insert(builtin_helper_invocation_id); // TODO: Add all other operations which can affect memory. @@ -2315,35 +2387,56 @@ uint32_t CompilerMSL::get_target_components_for_fragment_location(uint32_t locat uint32_t CompilerMSL::build_extended_vector_type(uint32_t type_id, uint32_t components, SPIRType::BaseType basetype) { + assert(components > 1); uint32_t new_type_id = ir.increase_bound_by(1); - auto &old_type = get(type_id); - auto *type = &set(new_type_id, old_type); + const auto *p_old_type = &get(type_id); + const SPIRType *old_ptr_t = nullptr; + const SPIRType *old_array_t = nullptr; + + if (is_pointer(*p_old_type)) + { + old_ptr_t = p_old_type; + p_old_type = &get_pointee_type(*old_ptr_t); + } + + if (is_array(*p_old_type)) + { + old_array_t = p_old_type; + p_old_type = &get_type(old_array_t->parent_type); + } + + auto *type = &set(new_type_id, *p_old_type); + assert(is_scalar(*type) || is_vector(*type)); + type->op = OpTypeVector; type->vecsize = components; if (basetype != SPIRType::Unknown) type->basetype = basetype; type->self = new_type_id; - type->parent_type = type_id; + // We want parent type to point to the scalar type. + type->parent_type = is_scalar(*p_old_type) ? TypeID(p_old_type->self) : p_old_type->parent_type; + assert(is_scalar(get(type->parent_type))); type->array.clear(); type->array_size_literal.clear(); type->pointer = false; - if (is_array(old_type)) + if (old_array_t) { uint32_t array_type_id = ir.increase_bound_by(1); type = &set(array_type_id, *type); + type->op = OpTypeArray; type->parent_type = new_type_id; - type->array = old_type.array; - type->array_size_literal = old_type.array_size_literal; + type->array = old_array_t->array; + type->array_size_literal = old_array_t->array_size_literal; new_type_id = array_type_id; } - if (old_type.pointer) + if (old_ptr_t) { uint32_t ptr_type_id = ir.increase_bound_by(1); type = &set(ptr_type_id, *type); - type->self = new_type_id; + type->op = OpTypePointer; type->parent_type = new_type_id; - type->storage = old_type.storage; + type->storage = old_ptr_t->storage; type->pointer = true; type->pointer_depth++; new_type_id = ptr_type_id; @@ -2862,20 +2955,35 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass uint32_t mbr_idx, InterfaceBlockMeta &meta, const string &mbr_name_qual, const string &var_chain_qual, - uint32_t &location, uint32_t &var_mbr_idx) + uint32_t &location, uint32_t &var_mbr_idx, + const Bitset &interpolation_qual) { auto &entry_func = get(ir.default_entry_point); BuiltIn builtin = BuiltInMax; bool is_builtin = is_member_builtin(var_type, mbr_idx, &builtin); - bool is_flat = - has_member_decoration(var_type.self, mbr_idx, DecorationFlat) || has_decoration(var.self, DecorationFlat); - bool is_noperspective = has_member_decoration(var_type.self, mbr_idx, DecorationNoPerspective) || + bool is_flat = interpolation_qual.get(DecorationFlat) || + has_member_decoration(var_type.self, mbr_idx, DecorationFlat) || + has_decoration(var.self, DecorationFlat); + bool is_noperspective = interpolation_qual.get(DecorationNoPerspective) || + has_member_decoration(var_type.self, mbr_idx, DecorationNoPerspective) || has_decoration(var.self, DecorationNoPerspective); - bool is_centroid = has_member_decoration(var_type.self, mbr_idx, DecorationCentroid) || + bool is_centroid = interpolation_qual.get(DecorationCentroid) || + has_member_decoration(var_type.self, mbr_idx, DecorationCentroid) || has_decoration(var.self, DecorationCentroid); - bool is_sample = - has_member_decoration(var_type.self, mbr_idx, DecorationSample) || has_decoration(var.self, DecorationSample); + bool is_sample = interpolation_qual.get(DecorationSample) || + has_member_decoration(var_type.self, mbr_idx, DecorationSample) || + has_decoration(var.self, DecorationSample); + + Bitset inherited_qual; + if (is_flat) + inherited_qual.set(DecorationFlat); + if (is_noperspective) + inherited_qual.set(DecorationNoPerspective); + if (is_centroid) + inherited_qual.set(DecorationCentroid); + if (is_sample) + inherited_qual.set(DecorationSample); uint32_t mbr_type_id = var_type.member_types[mbr_idx]; auto &mbr_type = get(mbr_type_id); @@ -2939,7 +3047,7 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass add_composite_member_variable_to_interface_block(storage, ib_var_ref, ib_type, var, mbr_type, sub_mbr_idx, meta, mbr_name, var_chain, - location, var_mbr_idx); + location, var_mbr_idx, inherited_qual); // FIXME: Recursive structs and tessellation breaks here. var_mbr_idx++; } @@ -3420,16 +3528,13 @@ void CompilerMSL::emit_local_masked_variable(const SPIRVariable &masked_var, boo auto &type = get_variable_data_type(masked_var); add_local_variable_name(masked_var.self); - bool old_is_builtin = is_using_builtin_array; - is_using_builtin_array = true; - const uint32_t max_control_points_per_patch = 32u; uint32_t max_num_instances = (max_control_points_per_patch + get_entry_point().output_vertices - 1u) / get_entry_point().output_vertices; statement("threadgroup ", type_to_glsl(type), " ", "spvStorage", to_name(masked_var.self), "[", max_num_instances, "]", - type_to_array_glsl(type), ";"); + type_to_array_glsl(type, 0), ";"); // Assign a threadgroup slice to each PrimitiveID. // We assume here that workgroup size is rounded to 32, @@ -3438,14 +3543,12 @@ void CompilerMSL::emit_local_masked_variable(const SPIRVariable &masked_var, boo // since Metal does not allow that. :( // FIXME: We will likely need an option to support passing down target workgroup size, // so we can emit appropriate size here. - statement("threadgroup ", type_to_glsl(type), " ", - "(&", to_name(masked_var.self), ")", - type_to_array_glsl(type), " = spvStorage", to_name(masked_var.self), "[", + statement("threadgroup auto ", + "&", to_name(masked_var.self), + " = spvStorage", to_name(masked_var.self), "[", "(", to_expression(builtin_invocation_id_id), ".x / ", get_entry_point().output_vertices, ") % ", max_num_instances, "];"); - - is_using_builtin_array = old_is_builtin; }); } else @@ -3630,7 +3733,7 @@ void CompilerMSL::add_variable_to_interface_block(StorageClass storage, const st add_composite_member_variable_to_interface_block(storage, ib_var_ref, ib_type, var, var_type, mbr_idx, meta, mbr_name_qual, var_chain_qual, - location, var_mbr_idx); + location, var_mbr_idx, {}); } else { @@ -3921,7 +4024,7 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch) // declaraion is emitted, because it is cleared after each compilation pass. uint32_t next_id = ir.increase_bound_by(3); uint32_t ib_type_id = next_id++; - auto &ib_type = set(ib_type_id); + auto &ib_type = set(ib_type_id, OpTypeStruct); ib_type.basetype = SPIRType::Struct; ib_type.storage = storage; set_decoration(ib_type_id, DecorationBlock); @@ -4144,13 +4247,14 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch) continue; // Create a fake variable to put at the location. - uint32_t offset = ir.increase_bound_by(4); + uint32_t offset = ir.increase_bound_by(5); uint32_t type_id = offset; - uint32_t array_type_id = offset + 1; - uint32_t ptr_type_id = offset + 2; - uint32_t var_id = offset + 3; + uint32_t vec_type_id = offset + 1; + uint32_t array_type_id = offset + 2; + uint32_t ptr_type_id = offset + 3; + uint32_t var_id = offset + 4; - SPIRType type; + SPIRType type { OpTypeInt }; switch (input.second.format) { case MSL_SHADER_VARIABLE_FORMAT_UINT16: @@ -4164,14 +4268,23 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch) type.width = 32; break; } - type.vecsize = input.second.vecsize; set(type_id, type); + if (input.second.vecsize > 1) + { + type.op = OpTypeVector; + type.vecsize = input.second.vecsize; + set(vec_type_id, type); + type_id = vec_type_id; + } + type.op = OpTypeArray; type.array.push_back(0); type.array_size_literal.push_back(true); type.parent_type = type_id; set(array_type_id, type); + type.self = type_id; + type.op = OpTypePointer; type.pointer = true; type.pointer_depth++; type.parent_type = array_type_id; @@ -4202,13 +4315,14 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch) continue; // Create a fake variable to put at the location. - uint32_t offset = ir.increase_bound_by(4); + uint32_t offset = ir.increase_bound_by(5); uint32_t type_id = offset; - uint32_t array_type_id = offset + 1; - uint32_t ptr_type_id = offset + 2; - uint32_t var_id = offset + 3; + uint32_t vec_type_id = offset + 1; + uint32_t array_type_id = offset + 2; + uint32_t ptr_type_id = offset + 3; + uint32_t var_id = offset + 4; - SPIRType type; + SPIRType type { OpTypeInt }; switch (output.second.format) { case MSL_SHADER_VARIABLE_FORMAT_UINT16: @@ -4222,17 +4336,25 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch) type.width = 32; break; } - type.vecsize = output.second.vecsize; set(type_id, type); + if (output.second.vecsize > 1) + { + type.op = OpTypeVector; + type.vecsize = output.second.vecsize; + set(vec_type_id, type); + type_id = vec_type_id; + } if (is_tesc_shader()) { + type.op = OpTypeArray; type.array.push_back(0); type.array_size_literal.push_back(true); type.parent_type = type_id; set(array_type_id, type); } + type.op = OpTypePointer; type.pointer = true; type.pointer_depth++; type.parent_type = is_tesc_shader() ? array_type_id : type_id; @@ -4319,6 +4441,7 @@ uint32_t CompilerMSL::add_interface_block_pointer(uint32_t ib_var_id, StorageCla // do the same with our struct here. uint32_t ib_ptr_type_id = next_id++; auto &ib_ptr_type = set(ib_ptr_type_id, ib_type); + ib_ptr_type.op = OpTypePointer; ib_ptr_type.parent_type = ib_ptr_type.type_alias = ib_type.self; ib_ptr_type.pointer = true; ib_ptr_type.pointer_depth++; @@ -4373,23 +4496,24 @@ uint32_t CompilerMSL::add_interface_block_pointer(uint32_t ib_var_id, StorageCla uint32_t CompilerMSL::ensure_correct_builtin_type(uint32_t type_id, BuiltIn builtin) { auto &type = get(type_id); + auto &pointee_type = get_pointee_type(type); - if ((builtin == BuiltInSampleMask && is_array(type)) || + if ((builtin == BuiltInSampleMask && is_array(pointee_type)) || ((builtin == BuiltInLayer || builtin == BuiltInViewportIndex || builtin == BuiltInFragStencilRefEXT) && - type.basetype != SPIRType::UInt)) + pointee_type.basetype != SPIRType::UInt)) { - uint32_t next_id = ir.increase_bound_by(type.pointer ? 2 : 1); + uint32_t next_id = ir.increase_bound_by(is_pointer(type) ? 2 : 1); uint32_t base_type_id = next_id++; - auto &base_type = set(base_type_id); + auto &base_type = set(base_type_id, OpTypeInt); base_type.basetype = SPIRType::UInt; base_type.width = 32; - if (!type.pointer) + if (!is_pointer(type)) return base_type_id; uint32_t ptr_type_id = next_id++; - auto &ptr_type = set(ptr_type_id); - ptr_type = base_type; + auto &ptr_type = set(ptr_type_id, base_type); + ptr_type.op = spv::OpTypePointer; ptr_type.pointer = true; ptr_type.pointer_depth++; ptr_type.storage = type.storage; @@ -4677,7 +4801,7 @@ bool CompilerMSL::validate_member_packing_rules_msl(const SPIRType &type, uint32 return false; } - if (!mbr_type.array.empty()) + if (is_array(mbr_type)) { // If we have an array type, array stride must match exactly with SPIR-V. @@ -4762,9 +4886,17 @@ void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t in if (elems_per_stride == 3) SPIRV_CROSS_THROW("Cannot use ArrayStride of 3 elements in remapping scenarios."); - else if (elems_per_stride > 4) + else if (elems_per_stride > 4 && elems_per_stride != 8) SPIRV_CROSS_THROW("Cannot represent vectors with more than 4 elements in MSL."); + if (elems_per_stride == 8) + { + if (mbr_type.width == 16) + add_spv_func_and_recompile(SPVFuncImplPaddedStd140); + else + SPIRV_CROSS_THROW("Unexpected type in std140 wide array resolve."); + } + auto physical_type = mbr_type; physical_type.vecsize = elems_per_stride; physical_type.parent_type = 0; @@ -4796,13 +4928,20 @@ void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t in if (elems_per_stride == 3) SPIRV_CROSS_THROW("Cannot use ArrayStride of 3 elements in remapping scenarios."); - else if (elems_per_stride > 4) + else if (elems_per_stride > 4 && elems_per_stride != 8) SPIRV_CROSS_THROW("Cannot represent vectors with more than 4 elements in MSL."); - bool row_major = has_member_decoration(ib_type.self, index, DecorationRowMajor); + if (elems_per_stride == 8) + { + if (mbr_type.basetype != SPIRType::Half) + SPIRV_CROSS_THROW("Unexpected type in std140 wide matrix stride resolve."); + add_spv_func_and_recompile(SPVFuncImplPaddedStd140); + } + bool row_major = has_member_decoration(ib_type.self, index, DecorationRowMajor); auto physical_type = mbr_type; physical_type.parent_type = 0; + if (row_major) physical_type.columns = elems_per_stride; else @@ -4864,6 +5003,7 @@ void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t in { type.columns = 1; assert(type.array.empty()); + type.op = OpTypeArray; type.array.push_back(1); type.array_size_literal.push_back(true); } @@ -4880,6 +5020,7 @@ void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t in type.vecsize = type.columns; type.columns = 1; assert(type.array.empty()); + type.op = OpTypeArray; type.array.push_back(1); type.array_size_literal.push_back(true); } @@ -4902,9 +5043,18 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp bool transpose = lhs_e && lhs_e->need_transpose; - // No physical type remapping, and no packed type, so can just emit a store directly. - if (!lhs_remapped_type && !lhs_packed_type) + if (has_decoration(lhs_expression, DecorationBuiltIn) && + BuiltIn(get_decoration(lhs_expression, DecorationBuiltIn)) == BuiltInSampleMask && + is_array(type)) + { + // Storing an array to SampleMask, have to remove the array-ness before storing. + statement(to_expression(lhs_expression), " = ", to_enclosed_unpacked_expression(rhs_expression), "[0];"); + register_write(lhs_expression); + } + else if (!lhs_remapped_type && !lhs_packed_type) { + // No physical type remapping, and no packed type, so can just emit a store directly. + // We might not be dealing with remapped physical types or packed types, // but we might be doing a clean store to a row-major matrix. // In this case, we just flip transpose states, and emit the store, a transpose must be in the RHS expression, if any. @@ -5092,6 +5242,13 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp { auto lhs_expr = to_enclosed_expression(lhs_expression); auto column_index = lhs_expr.find_last_of('['); + + // Get rid of any ".data" half8 handling here, we're casting to scalar anyway. + auto end_column_index = lhs_expr.find_last_of(']'); + auto end_dot_index = lhs_expr.find_last_of('.'); + if (end_dot_index != string::npos && end_dot_index > end_column_index) + lhs_expr.resize(end_dot_index); + if (column_index != string::npos) { statement("((", cast_addr_space, " ", type_to_glsl(write_type), "*)&", @@ -5102,7 +5259,9 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp lhs_e->need_transpose = true; } - else if ((is_matrix(physical_type) || is_array(physical_type)) && physical_type.vecsize > type.vecsize) + else if ((is_matrix(physical_type) || is_array(physical_type)) && + physical_type.vecsize <= 4 && + physical_type.vecsize > type.vecsize) { assert(type.vecsize >= 1 && type.vecsize <= 3); @@ -5159,19 +5318,26 @@ string CompilerMSL::unpack_expression_type(string expr_str, const SPIRType &type ".x", ".xy", ".xyz", + "", }; + // TODO: Move everything to the template wrapper? + bool uses_std140_wrapper = physical_type && physical_type->vecsize > 4; + if (physical_type && is_vector(*physical_type) && is_array(*physical_type) && + !uses_std140_wrapper && physical_type->vecsize > type.vecsize && !expression_ends_with(expr_str, swizzle_lut[type.vecsize - 1])) { // std140 array cases for vectors. assert(type.vecsize >= 1 && type.vecsize <= 3); return enclose_expression(expr_str) + swizzle_lut[type.vecsize - 1]; } - else if (physical_type && is_matrix(*physical_type) && is_vector(type) && physical_type->vecsize > type.vecsize) + else if (physical_type && is_matrix(*physical_type) && is_vector(type) && + !uses_std140_wrapper && + physical_type->vecsize > type.vecsize) { // Extract column from padded matrix. - assert(type.vecsize >= 1 && type.vecsize <= 3); + assert(type.vecsize >= 1 && type.vecsize <= 4); return enclose_expression(expr_str) + swizzle_lut[type.vecsize - 1]; } else if (is_matrix(type)) @@ -5193,6 +5359,7 @@ string CompilerMSL::unpack_expression_type(string expr_str, const SPIRType &type string unpack_expr = join(base_type, columns, "x", vecsize, "("); const char *load_swiz = ""; + const char *data_swiz = physical_vecsize > 4 ? ".data" : ""; if (physical_vecsize != vecsize) load_swiz = swizzle_lut[vecsize - 1]; @@ -5205,7 +5372,7 @@ string CompilerMSL::unpack_expression_type(string expr_str, const SPIRType &type if (packed) unpack_expr += join(base_type, physical_vecsize, "(", expr_str, "[", i, "]", ")", load_swiz); else - unpack_expr += join(expr_str, "[", i, "]", load_swiz); + unpack_expr += join(expr_str, "[", i, "]", data_swiz, load_swiz); } unpack_expr += ")"; @@ -5223,6 +5390,8 @@ void CompilerMSL::emit_header() // This particular line can be overridden during compilation, so make it a flag and not a pragma line. if (suppress_missing_prototypes) statement("#pragma clang diagnostic ignored \"-Wmissing-prototypes\""); + if (suppress_incompatible_pointer_types_discard_qualifiers) + statement("#pragma clang diagnostic ignored \"-Wincompatible-pointer-types-discards-qualifiers\""); // Disable warning about missing braces for array template to make arrays a value type if (spv_function_implementations.count(SPVFuncImplUnsafeArray) != 0) @@ -5444,9 +5613,12 @@ void CompilerMSL::emit_custom_templates() // otherwise they will cause problems when linked together in a single Metallib. void CompilerMSL::emit_custom_functions() { - for (uint32_t i = kArrayCopyMultidimMax; i >= 2; i--) - if (spv_function_implementations.count(static_cast(SPVFuncImplArrayCopyMultidimBase + i))) - spv_function_implementations.insert(static_cast(SPVFuncImplArrayCopyMultidimBase + i - 1)); + // Use when outputting overloaded functions to cover different address spaces. + static const char *texture_addr_spaces[] = { "device", "constant", "thread" }; + static uint32_t texture_addr_space_count = sizeof(texture_addr_spaces) / sizeof(char*); + + if (spv_function_implementations.count(SPVFuncImplArrayCopyMultidim)) + spv_function_implementations.insert(SPVFuncImplArrayCopy); if (spv_function_implementations.count(SPVFuncImplDynamicImageSampler)) { @@ -5557,11 +5729,7 @@ void CompilerMSL::emit_custom_functions() break; case SPVFuncImplArrayCopy: - case SPVFuncImplArrayOfArrayCopy2Dim: - case SPVFuncImplArrayOfArrayCopy3Dim: - case SPVFuncImplArrayOfArrayCopy4Dim: - case SPVFuncImplArrayOfArrayCopy5Dim: - case SPVFuncImplArrayOfArrayCopy6Dim: + case SPVFuncImplArrayCopyMultidim: { // Unfortunately we cannot template on the address space, so combinatorial explosion it is. static const char *function_name_tags[] = { @@ -5584,36 +5752,19 @@ void CompilerMSL::emit_custom_functions() for (uint32_t variant = 0; variant < 12; variant++) { - uint8_t dimensions = spv_func - SPVFuncImplArrayCopyMultidimBase; - string tmp = "template" : ">"); + statement("inline void spvArrayCopy", function_name_tags[variant], "(", + dst_address_space[variant], " T (&dst)", dim, ", ", + src_address_space[variant], " T (&src)", dim, ")"); begin_scope(); - statement("for (uint i = 0; i < A; i++)"); + statement("for (uint i = 0; i < N; i++)"); begin_scope(); - - if (dimensions == 1) - statement("dst[i] = src[i];"); + if (is_multidim) + statement("spvArrayCopy", function_name_tags[variant], "(dst[i], src[i]);"); else - statement("spvArrayCopy", function_name_tags[variant], dimensions - 1, "(dst[i], src[i]);"); + statement("dst[i] = src[i];"); end_scope(); end_scope(); statement(""); @@ -5671,6 +5822,31 @@ void CompilerMSL::emit_custom_functions() break; } + // Fix up gradient vectors when sampling a cube texture for Apple Silicon. + // h/t Alexey Knyazev (https://github.com/KhronosGroup/MoltenVK/issues/2068#issuecomment-1817799067) for the code. + case SPVFuncImplGradientCube: + statement("static inline gradientcube spvGradientCube(float3 P, float3 dPdx, float3 dPdy)"); + begin_scope(); + statement("// Major axis selection"); + statement("float3 absP = abs(P);"); + statement("bool xMajor = absP.x >= max(absP.y, absP.z);"); + statement("bool yMajor = absP.y >= absP.z;"); + statement("float3 Q = xMajor ? P.yzx : (yMajor ? P.xzy : P);"); + statement("float3 dQdx = xMajor ? dPdx.yzx : (yMajor ? dPdx.xzy : dPdx);"); + statement("float3 dQdy = xMajor ? dPdy.yzx : (yMajor ? dPdy.xzy : dPdy);"); + statement_no_indent(""); + statement("// Skip a couple of operations compared to usual projection"); + statement("float4 d = float4(dQdx.xy, dQdy.xy) - (Q.xy / Q.z).xyxy * float4(dQdx.zz, dQdy.zz);"); + statement_no_indent(""); + statement("// Final swizzle to put the intermediate values into non-ignored components"); + statement("// X major: X and Z"); + statement("// Y major: X and Y"); + statement("// Z major: Y and Z"); + statement("return gradientcube(xMajor ? d.xxy : d.xyx, xMajor ? d.zzw : d.zwz);"); + end_scope(); + statement(""); + break; + // "fadd" intrinsic support case SPVFuncImplFAdd: statement("template"); @@ -6089,6 +6265,65 @@ void CompilerMSL::emit_custom_functions() statement(""); break; + case SPVFuncImplGatherConstOffsets: + // Because we are passing a texture reference, we have to output an overloaded version of this function for each address space. + for (uint32_t i = 0; i < texture_addr_space_count; i++) + { + statement("// Wrapper function that processes a ", texture_addr_spaces[i], " texture gather with a constant offset array."); + statement("template class Tex, " + "typename Toff, typename... Tp>"); + statement("inline vec spvGatherConstOffsets(const ", texture_addr_spaces[i], " Tex& t, sampler s, " + "Toff coffsets, component c, Tp... params) METAL_CONST_ARG(c)"); + begin_scope(); + statement("vec rslts[4];"); + statement("for (uint i = 0; i < 4; i++)"); + begin_scope(); + statement("switch (c)"); + begin_scope(); + // Work around texture::gather() requiring its component parameter to be a constant expression + statement("case component::x:"); + statement(" rslts[i] = t.gather(s, spvForward(params)..., coffsets[i], component::x);"); + statement(" break;"); + statement("case component::y:"); + statement(" rslts[i] = t.gather(s, spvForward(params)..., coffsets[i], component::y);"); + statement(" break;"); + statement("case component::z:"); + statement(" rslts[i] = t.gather(s, spvForward(params)..., coffsets[i], component::z);"); + statement(" break;"); + statement("case component::w:"); + statement(" rslts[i] = t.gather(s, spvForward(params)..., coffsets[i], component::w);"); + statement(" break;"); + end_scope(); + end_scope(); + // Pull all values from the i0j0 component of each gather footprint + statement("return vec(rslts[0].w, rslts[1].w, rslts[2].w, rslts[3].w);"); + end_scope(); + statement(""); + } + break; + + case SPVFuncImplGatherCompareConstOffsets: + // Because we are passing a texture reference, we have to output an overloaded version of this function for each address space. + for (uint32_t i = 0; i < texture_addr_space_count; i++) + { + statement("// Wrapper function that processes a ", texture_addr_spaces[i], " texture gather with a constant offset array."); + statement("template class Tex, " + "typename Toff, typename... Tp>"); + statement("inline vec spvGatherCompareConstOffsets(const ", texture_addr_spaces[i], " Tex& t, sampler s, " + "Toff coffsets, Tp... params)"); + begin_scope(); + statement("vec rslts[4];"); + statement("for (uint i = 0; i < 4; i++)"); + begin_scope(); + statement(" rslts[i] = t.gather_compare(s, spvForward(params)..., coffsets[i]);"); + end_scope(); + // Pull all values from the i0j0 component of each gather footprint + statement("return vec(rslts[0].w, rslts[1].w, rslts[2].w, rslts[3].w);"); + end_scope(); + statement(""); + } + break; + case SPVFuncImplSubgroupBroadcast: // Metal doesn't allow broadcasting boolean values directly, but we can work around that by broadcasting // them as integers. @@ -7276,21 +7511,31 @@ void CompilerMSL::emit_custom_functions() break; case SPVFuncImplVariableDescriptorArray: - statement("template"); - statement("struct spvDescriptorArray"); - begin_scope(); - statement("spvDescriptorArray(const device spvDescriptor* ptr) : ptr(ptr)"); - begin_scope(); - end_scope(); - statement("const device T& operator [] (size_t i) const"); - begin_scope(); - statement("return ptr[i].value;"); - end_scope(); - statement("const device spvDescriptor* ptr;"); - end_scope_decl(); - statement(""); + if (spv_function_implementations.count(SPVFuncImplVariableDescriptor) != 0) + { + statement("template"); + statement("struct spvDescriptorArray"); + begin_scope(); + statement("spvDescriptorArray(const device spvDescriptor* ptr) : ptr(&ptr->value)"); + begin_scope(); + end_scope(); + statement("const device T& operator [] (size_t i) const"); + begin_scope(); + statement("return ptr[i];"); + end_scope(); + statement("const device T* ptr;"); + end_scope_decl(); + statement(""); + } + else + { + statement("template"); + statement("struct spvDescriptorArray;"); + statement(""); + } - if (msl_options.runtime_array_rich_descriptor) + if (msl_options.runtime_array_rich_descriptor && + spv_function_implementations.count(SPVFuncImplVariableSizedDescriptor) != 0) { statement("template"); statement("struct spvDescriptorArray"); @@ -7312,6 +7557,58 @@ void CompilerMSL::emit_custom_functions() } break; + case SPVFuncImplPaddedStd140: + // .data is used in access chain. + statement("template "); + statement("struct spvPaddedStd140 { alignas(16) T data; };"); + statement("template "); + statement("using spvPaddedStd140Matrix = spvPaddedStd140[n];"); + statement(""); + break; + + case SPVFuncImplReduceAdd: + // Metal doesn't support __builtin_reduce_add or simd_reduce_add, so we need this. + // Metal also doesn't support the other vector builtins, which would have been useful to make this a single template. + + statement("template "); + statement("T reduce_add(vec v) { return v.x + v.y; }"); + + statement("template "); + statement("T reduce_add(vec v) { return v.x + v.y + v.z; }"); + + statement("template "); + statement("T reduce_add(vec v) { return v.x + v.y + v.z + v.w; }"); + + statement(""); + break; + + case SPVFuncImplImageFence: + statement("template "); + statement("void spvImageFence(ImageT img) { img.fence(); }"); + statement(""); + break; + + case SPVFuncImplTextureCast: + statement("template "); + statement("T spvTextureCast(U img)"); + begin_scope(); + // MSL complains if you try to cast the texture itself, but casting the reference type is ... ok? *shrug* + // Gotta go what you gotta do I suppose. + statement("return reinterpret_cast(img);"); + end_scope(); + statement(""); + break; + + case SPVFuncImplMulExtended: + // Compiler may hit an internal error with mulhi, but doesn't when encapsulated for some reason. + statement("template"); + statement("[[clang::optnone]] T spvMulExtended(V l, V r)"); + begin_scope(); + statement("return T{U(l * r), U(mulhi(l, r))};"); + end_scope(); + statement(""); + break; + default: break; } @@ -7359,7 +7656,7 @@ void CompilerMSL::declare_constant_arrays() // FIXME: However, hoisting constants to main() means we need to pass down constant arrays to leaf functions if they are used there. // If there are multiple functions in the module, drop this case to avoid breaking use cases which do not need to // link into Metal libraries. This is hacky. - if (type_is_top_level_array(type) && (!fully_inlined || is_scalar(type) || is_vector(type))) + if (is_array(type) && (!fully_inlined || is_scalar(type) || is_vector(type))) { add_resource_name(c.self); auto name = to_name(c.self); @@ -7391,7 +7688,7 @@ void CompilerMSL::declare_complex_constant_arrays() return; auto &type = this->get(c.constant_type); - if (type_is_top_level_array(type) && !(is_scalar(type) || is_vector(type))) + if (is_array(type) && !(is_scalar(type) || is_vector(type))) { add_resource_name(c.self); auto name = to_name(c.self); @@ -8130,8 +8427,9 @@ bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t l // We're not going to emit the actual member name, we let any further OpLoad take care of that. // Tag the access chain with the member index we're referencing. - bool defer_access_chain = flatten_composites && (is_matrix(result_ptr_type) || is_array(result_ptr_type) || - result_ptr_type.basetype == SPIRType::Struct); + auto &result_pointee_type = get_pointee_type(result_ptr_type); + bool defer_access_chain = flatten_composites && (is_matrix(result_pointee_type) || is_array(result_pointee_type) || + result_pointee_type.basetype == SPIRType::Struct); if (!defer_access_chain) { @@ -8315,7 +8613,7 @@ bool CompilerMSL::is_out_of_bounds_tessellation_level(uint32_t id_lhs) (builtin == BuiltInTessLevelOuter && c->scalar() == 3); } -void CompilerMSL::prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, +bool CompilerMSL::prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, spv::StorageClass storage, bool &is_packed) { // If there is any risk of writes happening with the access chain in question, @@ -8329,7 +8627,10 @@ void CompilerMSL::prepare_access_chain_for_scalar_access(std::string &expr, cons // Further indexing should happen with packed rules (array index, not swizzle). is_packed = true; + return true; } + else + return false; } bool CompilerMSL::access_chain_needs_stage_io_builtin_translation(uint32_t base) @@ -8664,7 +8965,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) uint32_t ptr = ops[2]; uint32_t mem_sem = ops[4]; uint32_t val = ops[5]; - emit_atomic_func_op(result_type, id, "atomic_exchange_explicit", opcode, mem_sem, mem_sem, false, ptr, val); + emit_atomic_func_op(result_type, id, "atomic_exchange", opcode, mem_sem, mem_sem, false, ptr, val); break; } @@ -8677,7 +8978,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) uint32_t mem_sem_fail = ops[5]; uint32_t val = ops[6]; uint32_t comp = ops[7]; - emit_atomic_func_op(result_type, id, "atomic_compare_exchange_weak_explicit", opcode, + emit_atomic_func_op(result_type, id, "atomic_compare_exchange_weak", opcode, mem_sem_pass, mem_sem_fail, true, ptr, comp, true, false, val); break; @@ -8692,7 +8993,8 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; uint32_t ptr = ops[2]; uint32_t mem_sem = ops[4]; - emit_atomic_func_op(result_type, id, "atomic_load_explicit", opcode, mem_sem, mem_sem, false, ptr, 0); + check_atomic_image(ptr); + emit_atomic_func_op(result_type, id, "atomic_load", opcode, mem_sem, mem_sem, false, ptr, 0); break; } @@ -8703,7 +9005,8 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) uint32_t ptr = ops[0]; uint32_t mem_sem = ops[2]; uint32_t val = ops[3]; - emit_atomic_func_op(result_type, id, "atomic_store_explicit", opcode, mem_sem, mem_sem, false, ptr, val); + check_atomic_image(ptr); + emit_atomic_func_op(result_type, id, "atomic_store", opcode, mem_sem, mem_sem, false, ptr, val); break; } @@ -8715,7 +9018,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) uint32_t ptr = ops[2]; \ uint32_t mem_sem = ops[4]; \ uint32_t val = valsrc; \ - emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", opcode, \ + emit_atomic_func_op(result_type, id, "atomic_fetch_" #op, opcode, \ mem_sem, mem_sem, false, ptr, val, \ false, valconst); \ } while (false) @@ -8782,7 +9085,12 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) // Metal requires explicit fences to break up RAW hazards, even within the same shader invocation if (msl_options.readwrite_texture_fences && p_var && !has_decoration(p_var->self, DecorationNonWritable)) - statement(to_expression(img_id), ".fence();"); + { + add_spv_func_and_recompile(SPVFuncImplImageFence); + // Need to wrap this with a value type, + // since the Metal headers are broken and do not consider case when the image is a reference. + statement("spvImageFence(", to_expression(img_id), ");"); + } emit_texture_op(instruction, false); break; @@ -8793,7 +9101,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) { // When using the pointer, we need to know which variable it is actually loaded from. auto *var = maybe_get_backing_variable(ops[2]); - if (var && atomic_image_vars.count(var->self)) + if (var && atomic_image_vars_emulated.count(var->self)) { uint32_t result_type = ops[0]; uint32_t id = ops[1]; @@ -8813,8 +9121,14 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) { uint32_t result_type = ops[0]; uint32_t id = ops[1]; + + // Virtual expression. Split this up in the actual image atomic. + // In GLSL and HLSL we are able to resolve the dereference inline, but MSL has + // image.op(coord, ...) syntax. auto &e = - set(id, join(to_expression(ops[2]), ", ", to_expression(ops[3])), result_type, true); + set(id, join(to_expression(ops[2]), "@", + bitcast_expression(SPIRType::UInt, ops[3])), + result_type, true); // When using the pointer, we need to know which variable it is actually loaded from. e.loaded_from = var ? var->self : ID(0); @@ -8952,18 +9266,40 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) uint32_t coord_id = ops[3]; emit_uninitialized_temporary_expression(result_type, id); + std::string coord_expr = to_expression(coord_id); auto sampler_expr = to_sampler_expression(image_id); auto *combined = maybe_get(image_id); auto image_expr = combined ? to_expression(combined->image) : to_expression(image_id); + const SPIRType &image_type = expression_type(image_id); + const SPIRType &coord_type = expression_type(coord_id); + + switch (image_type.image.dim) + { + case Dim1D: + if (!msl_options.texture_1D_as_2D) + SPIRV_CROSS_THROW("ImageQueryLod is not supported on 1D textures."); + [[fallthrough]]; + case Dim2D: + if (coord_type.vecsize > 2) + coord_expr = enclose_expression(coord_expr) + ".xy"; + break; + case DimCube: + case Dim3D: + if (coord_type.vecsize > 3) + coord_expr = enclose_expression(coord_expr) + ".xyz"; + break; + default: + SPIRV_CROSS_THROW("Bad image type given to OpImageQueryLod"); + } // TODO: It is unclear if calculcate_clamped_lod also conditionally rounds // the reported LOD based on the sampler. NEAREST miplevel should // round the LOD, but LINEAR miplevel should not round. // Let's hope this does not become an issue ... statement(to_expression(id), ".x = ", image_expr, ".calculate_clamped_lod(", sampler_expr, ", ", - to_expression(coord_id), ");"); + coord_expr, ");"); statement(to_expression(id), ".y = ", image_expr, ".calculate_unclamped_lod(", sampler_expr, ", ", - to_expression(coord_id), ");"); + coord_expr, ");"); register_control_dependent_expression(id); break; } @@ -9224,33 +9560,13 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) uint32_t op0 = ops[2]; uint32_t op1 = ops[3]; auto &type = get(result_type); + auto &op_type = get(type.member_types[0]); auto input_type = opcode == OpSMulExtended ? int_type : uint_type; - auto &output_type = get_type(result_type); string cast_op0, cast_op1; - auto expected_type = binary_op_bitcast_helper(cast_op0, cast_op1, input_type, op0, op1, false); - - emit_uninitialized_temporary_expression(result_type, result_id); - - string mullo_expr, mulhi_expr; - mullo_expr = join(cast_op0, " * ", cast_op1); - mulhi_expr = join("mulhi(", cast_op0, ", ", cast_op1, ")"); - - auto &low_type = get_type(output_type.member_types[0]); - auto &high_type = get_type(output_type.member_types[1]); - if (low_type.basetype != input_type) - { - expected_type.basetype = input_type; - mullo_expr = join(bitcast_glsl_op(low_type, expected_type), "(", mullo_expr, ")"); - } - if (high_type.basetype != input_type) - { - expected_type.basetype = input_type; - mulhi_expr = join(bitcast_glsl_op(high_type, expected_type), "(", mulhi_expr, ")"); - } - - statement(to_expression(result_id), ".", to_member_name(type, 0), " = ", mullo_expr, ";"); - statement(to_expression(result_id), ".", to_member_name(type, 1), " = ", mulhi_expr, ";"); + binary_op_bitcast_helper(cast_op0, cast_op1, input_type, op0, op1, false); + auto expr = join("spvMulExtended<", type_to_glsl(type), ", ", type_to_glsl(op_type), ">(", cast_op0, ", ", cast_op1, ")"); + emit_op(result_type, result_id, expr, true); break; } @@ -9365,16 +9681,18 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) case OpRayQueryInitializeKHR: { flush_variable_declaration(ops[0]); + register_write(ops[0]); add_spv_func_and_recompile(SPVFuncImplRayQueryIntersectionParams); statement(to_expression(ops[0]), ".reset(", "ray(", to_expression(ops[4]), ", ", to_expression(ops[6]), ", ", - to_expression(ops[5]), ", ", to_expression(ops[7]), "), ", to_expression(ops[1]), + to_expression(ops[5]), ", ", to_expression(ops[7]), "), ", to_expression(ops[1]), ", ", to_expression(ops[3]), ", spvMakeIntersectionParams(", to_expression(ops[2]), "));"); break; } case OpRayQueryProceedKHR: { flush_variable_declaration(ops[0]); + register_write(ops[2]); emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".next()"), false); break; } @@ -9435,14 +9753,17 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) } case OpRayQueryConfirmIntersectionKHR: flush_variable_declaration(ops[0]); + register_write(ops[0]); statement(to_expression(ops[0]), ".commit_triangle_intersection();"); break; case OpRayQueryGenerateIntersectionKHR: flush_variable_declaration(ops[0]); + register_write(ops[0]); statement(to_expression(ops[0]), ".commit_bounding_box_intersection(", to_expression(ops[1]), ");"); break; case OpRayQueryTerminateKHR: flush_variable_declaration(ops[0]); + register_write(ops[0]); statement(to_expression(ops[0]), ".abort();"); break; #undef MSL_RAY_QUERY_GET_OP @@ -9478,6 +9799,132 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) break; } + case OpSDot: + case OpUDot: + case OpSUDot: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t vec1 = ops[2]; + uint32_t vec2 = ops[3]; + + auto &input_type1 = expression_type(vec1); + auto &input_type2 = expression_type(vec2); + + string vec1input, vec2input; + auto input_size = input_type1.vecsize; + if (instruction.length == 5) + { + if (ops[4] == PackedVectorFormatPackedVectorFormat4x8Bit) + { + string type = opcode == OpSDot || opcode == OpSUDot ? "char4" : "uchar4"; + vec1input = join("as_type<", type, ">(", to_expression(vec1), ")"); + type = opcode == OpSDot ? "char4" : "uchar4"; + vec2input = join("as_type<", type, ">(", to_expression(vec2), ")"); + input_size = 4; + } + else + SPIRV_CROSS_THROW("Packed vector formats other than 4x8Bit for integer dot product is not supported."); + } + else + { + // Inputs are sign or zero-extended to their target width. + SPIRType::BaseType vec1_expected_type = + opcode != OpUDot ? + to_signed_basetype(input_type1.width) : + to_unsigned_basetype(input_type1.width); + + SPIRType::BaseType vec2_expected_type = + opcode != OpSDot ? + to_unsigned_basetype(input_type2.width) : + to_signed_basetype(input_type2.width); + + vec1input = bitcast_expression(vec1_expected_type, vec1); + vec2input = bitcast_expression(vec2_expected_type, vec2); + } + + auto &type = get(result_type); + + // We'll get the appropriate sign-extend or zero-extend, no matter which type we cast to here. + // The addition in reduce_add is sign-invariant. + auto result_type_cast = join(type_to_glsl(type), input_size); + + string exp = join("reduce_add(", + result_type_cast, "(", vec1input, ") * ", + result_type_cast, "(", vec2input, "))"); + + emit_op(result_type, id, exp, should_forward(vec1) && should_forward(vec2)); + inherit_expression_dependencies(id, vec1); + inherit_expression_dependencies(id, vec2); + break; + } + + case OpSDotAccSat: + case OpUDotAccSat: + case OpSUDotAccSat: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t vec1 = ops[2]; + uint32_t vec2 = ops[3]; + uint32_t acc = ops[4]; + + auto input_type1 = expression_type(vec1); + auto input_type2 = expression_type(vec2); + + string vec1input, vec2input; + if (instruction.length == 6) + { + if (ops[5] == PackedVectorFormatPackedVectorFormat4x8Bit) + { + string type = opcode == OpSDotAccSat || opcode == OpSUDotAccSat ? "char4" : "uchar4"; + vec1input = join("as_type<", type, ">(", to_expression(vec1), ")"); + type = opcode == OpSDotAccSat ? "char4" : "uchar4"; + vec2input = join("as_type<", type, ">(", to_expression(vec2), ")"); + input_type1.vecsize = 4; + input_type2.vecsize = 4; + } + else + SPIRV_CROSS_THROW("Packed vector formats other than 4x8Bit for integer dot product is not supported."); + } + else + { + // Inputs are sign or zero-extended to their target width. + SPIRType::BaseType vec1_expected_type = + opcode != OpUDotAccSat ? + to_signed_basetype(input_type1.width) : + to_unsigned_basetype(input_type1.width); + + SPIRType::BaseType vec2_expected_type = + opcode != OpSDotAccSat ? + to_unsigned_basetype(input_type2.width) : + to_signed_basetype(input_type2.width); + + vec1input = bitcast_expression(vec1_expected_type, vec1); + vec2input = bitcast_expression(vec2_expected_type, vec2); + } + + auto &type = get(result_type); + + SPIRType::BaseType pre_saturate_type = + opcode != OpUDotAccSat ? + to_signed_basetype(type.width) : + to_unsigned_basetype(type.width); + + input_type1.basetype = pre_saturate_type; + input_type2.basetype = pre_saturate_type; + + string exp = join(type_to_glsl(type), "(addsat(reduce_add(", + type_to_glsl(input_type1), "(", vec1input, ") * ", + type_to_glsl(input_type2), "(", vec2input, ")), ", + bitcast_expression(pre_saturate_type, acc), "))"); + + emit_op(result_type, id, exp, should_forward(vec1) && should_forward(vec2)); + inherit_expression_dependencies(id, vec1); + inherit_expression_dependencies(id, vec2); + break; + } + default: CompilerGLSL::emit_instruction(instruction); break; @@ -9617,8 +10064,8 @@ bool CompilerMSL::emit_array_copy(const char *expr, uint32_t lhs_id, uint32_t rh bool lhs_is_thread_storage = storage_class_array_is_thread(lhs_storage); bool rhs_is_thread_storage = storage_class_array_is_thread(rhs_storage); - bool lhs_is_array_template = lhs_is_thread_storage; - bool rhs_is_array_template = rhs_is_thread_storage; + bool lhs_is_array_template = lhs_is_thread_storage || lhs_storage == StorageClassWorkgroup; + bool rhs_is_array_template = rhs_is_thread_storage || rhs_storage == StorageClassWorkgroup; // Special considerations for stage IO variables. // If the variable is actually backed by non-user visible device storage, we use array templates for those. @@ -9633,15 +10080,13 @@ bool CompilerMSL::emit_array_copy(const char *expr, uint32_t lhs_id, uint32_t rh auto *lhs_var = maybe_get_backing_variable(lhs_id); if (lhs_var && lhs_storage == StorageClassStorageBuffer && storage_class_array_is_thread(lhs_var->storage)) lhs_is_array_template = true; - else if (lhs_var && (lhs_storage == StorageClassFunction || lhs_storage == StorageClassPrivate) && - type_is_block_like(get(lhs_var->basetype))) + else if (lhs_var && lhs_storage != StorageClassGeneric && type_is_block_like(get(lhs_var->basetype))) lhs_is_array_template = false; auto *rhs_var = maybe_get_backing_variable(rhs_id); if (rhs_var && rhs_storage == StorageClassStorageBuffer && storage_class_array_is_thread(rhs_var->storage)) rhs_is_array_template = true; - else if (rhs_var && (rhs_storage == StorageClassFunction || rhs_storage == StorageClassPrivate) && - type_is_block_like(get(rhs_var->basetype))) + else if (rhs_var && rhs_storage != StorageClassGeneric && type_is_block_like(get(rhs_var->basetype))) rhs_is_array_template = false; // If threadgroup storage qualifiers are *not* used: @@ -9688,15 +10133,7 @@ bool CompilerMSL::emit_array_copy(const char *expr, uint32_t lhs_id, uint32_t rh // we cannot easily detect this case ahead of time since it's // context dependent. We might have to force a recompile here // if this is the only use of array copies in our shader. - if (type.array.size() > 1) - { - if (type.array.size() > kArrayCopyMultidimMax) - SPIRV_CROSS_THROW("Cannot support this many dimensions for arrays of arrays."); - auto func = static_cast(SPVFuncImplArrayCopyMultidimBase + type.array.size()); - add_spv_func_and_recompile(func); - } - else - add_spv_func_and_recompile(SPVFuncImplArrayCopy); + add_spv_func_and_recompile(type.array.size() > 1 ? SPVFuncImplArrayCopyMultidim : SPVFuncImplArrayCopy); const char *tag = nullptr; if (lhs_is_thread_storage && is_constant) @@ -9728,13 +10165,13 @@ bool CompilerMSL::emit_array_copy(const char *expr, uint32_t lhs_id, uint32_t rh // Pass internal array of spvUnsafeArray<> into wrapper functions if (lhs_is_array_template && rhs_is_array_template && !msl_options.force_native_arrays) - statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ".elements, ", to_expression(rhs_id), ".elements);"); + statement("spvArrayCopy", tag, "(", lhs, ".elements, ", to_expression(rhs_id), ".elements);"); if (lhs_is_array_template && !msl_options.force_native_arrays) - statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ".elements, ", to_expression(rhs_id), ");"); + statement("spvArrayCopy", tag, "(", lhs, ".elements, ", to_expression(rhs_id), ");"); else if (rhs_is_array_template && !msl_options.force_native_arrays) - statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ", ", to_expression(rhs_id), ".elements);"); + statement("spvArrayCopy", tag, "(", lhs, ", ", to_expression(rhs_id), ".elements);"); else - statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ", ", to_expression(rhs_id), ");"); + statement("spvArrayCopy", tag, "(", lhs, ", ", to_expression(rhs_id), ");"); } return true; @@ -9755,8 +10192,8 @@ uint32_t CompilerMSL::get_physical_tess_level_array_size(spv::BuiltIn builtin) c bool CompilerMSL::maybe_emit_array_assignment(uint32_t id_lhs, uint32_t id_rhs) { // We only care about assignments of an entire array - auto &type = expression_type(id_rhs); - if (!type_is_top_level_array(get_pointee_type(type))) + auto &type = expression_type(id_lhs); + if (!is_array(get_pointee_type(type))) return false; auto *var = maybe_get(id_lhs); @@ -9811,29 +10248,51 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, { string exp; - auto &type = get_pointee_type(expression_type(obj)); + auto &ptr_type = expression_type(obj); + auto &type = get_pointee_type(ptr_type); auto expected_type = type.basetype; if (opcode == OpAtomicUMax || opcode == OpAtomicUMin) expected_type = to_unsigned_basetype(type.width); else if (opcode == OpAtomicSMax || opcode == OpAtomicSMin) expected_type = to_signed_basetype(type.width); - if (type.width == 64) + bool use_native_image_atomic; + if (msl_options.supports_msl_version(3, 1)) + use_native_image_atomic = check_atomic_image(obj); + else + use_native_image_atomic = false; + + if (type.width == 64) SPIRV_CROSS_THROW("MSL currently does not support 64-bit atomics."); auto remapped_type = type; remapped_type.basetype = expected_type; auto *var = maybe_get_backing_variable(obj); - if (!var) - SPIRV_CROSS_THROW("No backing variable for atomic operation."); - const auto &res_type = get(var->basetype); + const auto *res_type = var ? &get(var->basetype) : nullptr; + assert(type.storage != StorageClassImage || res_type); bool is_atomic_compare_exchange_strong = op1_is_pointer && op1; bool check_discard = opcode != OpAtomicLoad && needs_frag_discard_checks() && - ((res_type.storage == StorageClassUniformConstant && res_type.basetype == SPIRType::Image) || - var->storage == StorageClassStorageBuffer || var->storage == StorageClassUniform); + ptr_type.storage != StorageClassWorkgroup; + + // Even compare exchange atomics are vec4 on metal for ... reasons :v + uint32_t vec4_temporary_id = 0; + if (use_native_image_atomic && is_atomic_compare_exchange_strong) + { + uint32_t &tmp_id = extra_sub_expressions[result_id]; + if (!tmp_id) + { + tmp_id = ir.increase_bound_by(2); + + auto vec4_type = get(result_type); + vec4_type.vecsize = 4; + set(tmp_id + 1, vec4_type); + } + + vec4_temporary_id = tmp_id; + } if (check_discard) { @@ -9841,6 +10300,8 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, { // We're already emitting a CAS loop here; a conditional won't hurt. emit_uninitialized_temporary_expression(result_type, result_id); + if (vec4_temporary_id) + emit_uninitialized_temporary_expression(vec4_temporary_id + 1, vec4_temporary_id); statement("if (!", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), ")"); begin_scope(); } @@ -9848,131 +10309,196 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, exp = join("(!", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), " ? "); } - exp += string(op) + "("; - exp += "("; - // Emulate texture2D atomic operations - if (res_type.storage == StorageClassUniformConstant && res_type.basetype == SPIRType::Image) + if (use_native_image_atomic) { - exp += "device"; + auto obj_expression = to_expression(obj); + auto split_index = obj_expression.find_first_of('@'); + bool needs_reinterpret = opcode == OpAtomicUMax || opcode == OpAtomicUMin || opcode == OpAtomicSMax || opcode == OpAtomicSMin; + needs_reinterpret &= type.basetype != expected_type; + SPIRVariable *backing_var = nullptr; + + // Try to avoid waiting until not force recompile later mode to enable force recompile later + if (needs_reinterpret && (backing_var = maybe_get_backing_variable(obj))) + add_spv_func_and_recompile(SPVFuncImplTextureCast); + + // Will only be false if we're in "force recompile later" mode. + if (split_index != string::npos) + { + auto coord = obj_expression.substr(split_index + 1); + auto image_expr = obj_expression.substr(0, split_index); + + // Handle problem cases with sign where we need signed min/max on a uint image for example. + // It seems to work to cast the texture type itself, even if it is probably wildly outside of spec, + // but SPIR-V requires this to work. + if (needs_reinterpret && backing_var) + { + assert(spv_function_implementations.count(SPVFuncImplTextureCast) && "Should have been added above"); + + const auto *backing_type = &get(backing_var->basetype); + while (backing_type->op != OpTypeImage) + backing_type = &get(backing_type->parent_type); + + auto img_type = *backing_type; + auto tmp_type = type; + tmp_type.basetype = expected_type; + img_type.image.type = ir.increase_bound_by(1); + set(img_type.image.type, tmp_type); + + image_expr = join("spvTextureCast<", type_to_glsl(img_type, obj), ">(", image_expr, ")"); + } + + exp += join(image_expr, ".", op, "("); + if (ptr_type.storage == StorageClassImage && res_type->image.arrayed) + { + switch (res_type->image.dim) + { + case Dim1D: + if (msl_options.texture_1D_as_2D) + exp += join("uint2(", coord, ".x, 0), ", coord, ".y"); + else + exp += join(coord, ".x, ", coord, ".y"); + + break; + case Dim2D: + exp += join(coord, ".xy, ", coord, ".z"); + break; + default: + SPIRV_CROSS_THROW("Cannot do atomics on Cube textures."); + } + } + else if (ptr_type.storage == StorageClassImage && res_type->image.dim == Dim1D && msl_options.texture_1D_as_2D) + exp += join("uint2(", coord, ", 0)"); + else + exp += coord; + } + else + { + exp += obj_expression; + } } else { - exp += get_argument_address_space(*var); - } + exp += string(op) + "_explicit("; + exp += "("; + // Emulate texture2D atomic operations + if (ptr_type.storage == StorageClassImage) + { + auto &flags = ir.get_decoration_bitset(var->self); + if (decoration_flags_signal_volatile(flags)) + exp += "volatile "; + exp += "device"; + } + else if (var && ptr_type.storage != StorageClassPhysicalStorageBuffer) + { + exp += get_argument_address_space(*var); + } + else + { + // Fallback scenario, could happen for raw pointers. + exp += ptr_type.storage == StorageClassWorkgroup ? "threadgroup" : "device"; + } - exp += " atomic_"; - // For signed and unsigned min/max, we can signal this through the pointer type. - // There is no other way, since C++ does not have explicit signage for atomics. - exp += type_to_glsl(remapped_type); - exp += "*)"; + exp += " atomic_"; + // For signed and unsigned min/max, we can signal this through the pointer type. + // There is no other way, since C++ does not have explicit signage for atomics. + exp += type_to_glsl(remapped_type); + exp += "*)"; - exp += "&"; - exp += to_enclosed_expression(obj); + exp += "&"; + exp += to_enclosed_expression(obj); + } if (is_atomic_compare_exchange_strong) { - assert(strcmp(op, "atomic_compare_exchange_weak_explicit") == 0); + assert(strcmp(op, "atomic_compare_exchange_weak") == 0); assert(op2); assert(has_mem_order_2); exp += ", &"; - exp += to_name(result_id); + exp += to_name(vec4_temporary_id ? vec4_temporary_id : result_id); exp += ", "; exp += to_expression(op2); - exp += ", "; - exp += get_memory_order(mem_order_1); - exp += ", "; - exp += get_memory_order(mem_order_2); + + if (!use_native_image_atomic) + { + exp += ", "; + exp += get_memory_order(mem_order_1); + exp += ", "; + exp += get_memory_order(mem_order_2); + } exp += ")"; // MSL only supports the weak atomic compare exchange, so emit a CAS loop here. // The MSL function returns false if the atomic write fails OR the comparison test fails, // so we must validate that it wasn't the comparison test that failed before continuing // the CAS loop, otherwise it will loop infinitely, with the comparison test always failing. - // The function updates the comparitor value from the memory value, so the additional + // The function updates the comparator value from the memory value, so the additional // comparison test evaluates the memory value against the expected value. if (!check_discard) + { emit_uninitialized_temporary_expression(result_type, result_id); + if (vec4_temporary_id) + emit_uninitialized_temporary_expression(vec4_temporary_id + 1, vec4_temporary_id); + } + statement("do"); begin_scope(); - statement(to_name(result_id), " = ", to_expression(op1), ";"); - end_scope_decl(join("while (!", exp, " && ", to_name(result_id), " == ", to_enclosed_expression(op1), ")")); + + string scalar_expression; + if (vec4_temporary_id) + scalar_expression = join(to_expression(vec4_temporary_id), ".x"); + else + scalar_expression = to_expression(result_id); + + statement(scalar_expression, " = ", to_expression(op1), ";"); + end_scope_decl(join("while (!", exp, " && ", scalar_expression, " == ", to_enclosed_expression(op1), ")")); + if (vec4_temporary_id) + statement(to_expression(result_id), " = ", scalar_expression, ";"); + + // Vulkan: (section 9.29: ... and values returned by atomic instructions in helper invocations are undefined) if (check_discard) { end_scope(); statement("else"); begin_scope(); - exp = "atomic_load_explicit("; - exp += "("; - // Emulate texture2D atomic operations - if (res_type.storage == StorageClassUniformConstant && res_type.basetype == SPIRType::Image) - exp += "device"; - else - exp += get_argument_address_space(*var); - - exp += " atomic_"; - exp += type_to_glsl(remapped_type); - exp += "*)"; - - exp += "&"; - exp += to_enclosed_expression(obj); - - if (has_mem_order_2) - exp += string(", ") + get_memory_order(mem_order_2); - else - exp += string(", ") + get_memory_order(mem_order_1); - - exp += ")"; - - statement(to_name(result_id), " = ", exp, ";"); + statement(to_expression(result_id), " = {};"); end_scope(); } } else { - assert(strcmp(op, "atomic_compare_exchange_weak_explicit") != 0); + assert(strcmp(op, "atomic_compare_exchange_weak") != 0); + if (op1) { + exp += ", "; if (op1_is_literal) - exp += join(", ", op1); + exp += to_string(op1); else - exp += ", " + bitcast_expression(expected_type, op1); + exp += bitcast_expression(expected_type, op1); } + if (op2) exp += ", " + to_expression(op2); - exp += string(", ") + get_memory_order(mem_order_1); - if (has_mem_order_2) - exp += string(", ") + get_memory_order(mem_order_2); + if (!use_native_image_atomic) + { + exp += string(", ") + get_memory_order(mem_order_1); + if (has_mem_order_2) + exp += string(", ") + get_memory_order(mem_order_2); + } exp += ")"; + // For some particular reason, atomics return vec4 in Metal ... + if (use_native_image_atomic) + exp += ".x"; + + // Vulkan: (section 9.29: ... and values returned by atomic instructions in helper invocations are undefined) if (check_discard) { exp += " : "; - if (strcmp(op, "atomic_store_explicit") != 0) - { - exp += "atomic_load_explicit("; - exp += "("; - // Emulate texture2D atomic operations - if (res_type.storage == StorageClassUniformConstant && res_type.basetype == SPIRType::Image) - exp += "device"; - else - exp += get_argument_address_space(*var); - - exp += " atomic_"; - exp += type_to_glsl(remapped_type); - exp += "*)"; - - exp += "&"; - exp += to_enclosed_expression(obj); - - if (has_mem_order_2) - exp += string(", ") + get_memory_order(mem_order_2); - else - exp += string(", ") + get_memory_order(mem_order_1); - - exp += ")"; - } + if (strcmp(op, "atomic_store") != 0) + exp += join(type_to_glsl(get(result_type)), "{}"); else exp += "((void)0)"; exp += ")"; @@ -9981,7 +10507,7 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, if (expected_type != type.basetype) exp = bitcast_expression(type, expected_type, exp); - if (strcmp(op, "atomic_store_explicit") != 0) + if (strcmp(op, "atomic_store") != 0) emit_op(result_type, result_id, exp, false); else statement(exp, ";"); @@ -10009,19 +10535,54 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, op = get_remapped_glsl_op(op); + auto &restype = get(result_type); + switch (op) { case GLSLstd450Sinh: - emit_unary_func_op(result_type, id, args[0], "fast::sinh"); + if (restype.basetype == SPIRType::Half) + { + // MSL does not have overload for half. Force-cast back to half. + auto expr = join("half(fast::sinh(", to_unpacked_expression(args[0]), "))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); + } + else + emit_unary_func_op(result_type, id, args[0], "fast::sinh"); break; case GLSLstd450Cosh: - emit_unary_func_op(result_type, id, args[0], "fast::cosh"); + if (restype.basetype == SPIRType::Half) + { + // MSL does not have overload for half. Force-cast back to half. + auto expr = join("half(fast::cosh(", to_unpacked_expression(args[0]), "))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); + } + else + emit_unary_func_op(result_type, id, args[0], "fast::cosh"); break; case GLSLstd450Tanh: - emit_unary_func_op(result_type, id, args[0], "precise::tanh"); + if (restype.basetype == SPIRType::Half) + { + // MSL does not have overload for half. Force-cast back to half. + auto expr = join("half(fast::tanh(", to_unpacked_expression(args[0]), "))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); + } + else + emit_unary_func_op(result_type, id, args[0], "precise::tanh"); break; case GLSLstd450Atan2: - emit_binary_func_op(result_type, id, args[0], args[1], "precise::atan2"); + if (restype.basetype == SPIRType::Half) + { + // MSL does not have overload for half. Force-cast back to half. + auto expr = join("half(fast::atan2(", to_unpacked_expression(args[0]), ", ", to_unpacked_expression(args[1]), "))"); + emit_op(result_type, id, expr, should_forward(args[0]) && should_forward(args[1])); + inherit_expression_dependencies(id, args[0]); + inherit_expression_dependencies(id, args[1]); + } + else + emit_binary_func_op(result_type, id, args[0], args[1], "precise::atan2"); break; case GLSLstd450InverseSqrt: emit_unary_func_op(result_type, id, args[0], "rsqrt"); @@ -10321,6 +10882,11 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, break; } + case GLSLstd450Pow: + // powr makes x < 0.0 undefined, just like SPIR-V. + emit_binary_func_op(result_type, id, args[0], args[1], "powr"); + break; + default: CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); break; @@ -10412,7 +10978,7 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) decl += "thread "; decl += type_to_glsl(type); decl += " (&spvReturnValue)"; - decl += type_to_array_glsl(type); + decl += type_to_array_glsl(type, 0); if (!func.arguments.empty()) decl += ", "; } @@ -10479,9 +11045,9 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) // Manufacture automatic sampler arg for SampledImage texture if (arg_type.image.dim != DimBuffer) { - if (arg_type.array.empty() || is_runtime_size_array(arg_type)) + if (arg_type.array.empty() || (var ? is_var_runtime_size_array(*var) : is_runtime_size_array(arg_type))) { - decl += join(", ", sampler_type(arg_type, arg.id), " ", to_sampler_expression(name_id)); + decl += join(", ", sampler_type(arg_type, arg.id, false), " ", to_sampler_expression(name_id)); } else { @@ -10489,7 +11055,7 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) descriptor_address_space(name_id, StorageClassUniformConstant, "thread const"); - decl += join(", ", sampler_address_space, " ", sampler_type(arg_type, name_id), "& ", + decl += join(", ", sampler_address_space, " ", sampler_type(arg_type, name_id, false), "& ", to_sampler_expression(name_id)); } } @@ -10536,8 +11102,7 @@ string CompilerMSL::to_function_name(const TextureFunctionNameArguments &args) is_dynamic_img_sampler = has_extended_decoration(var->self, SPIRVCrossDecorationDynamicImageSampler); } - // Special-case gather. We have to alter the component being looked up - // in the swizzle case. + // Special-case gather. We have to alter the component being looked up in the swizzle case. if (msl_options.swizzle_texture_samples && args.base.is_gather && !is_dynamic_img_sampler && (!constexpr_sampler || !constexpr_sampler->ycbcr_conversion_enable)) { @@ -10546,6 +11111,16 @@ string CompilerMSL::to_function_name(const TextureFunctionNameArguments &args) return is_compare ? "spvGatherCompareSwizzle" : "spvGatherSwizzle"; } + // Special-case gather with an array of offsets. We have to lower into 4 separate gathers. + if (args.has_array_offsets && !is_dynamic_img_sampler && + (!constexpr_sampler || !constexpr_sampler->ycbcr_conversion_enable)) + { + bool is_compare = comparison_ids.count(img); + add_spv_func_and_recompile(is_compare ? SPVFuncImplGatherCompareConstOffsets : SPVFuncImplGatherConstOffsets); + add_spv_func_and_recompile(SPVFuncImplForwardArgs); + return is_compare ? "spvGatherCompareConstOffsets" : "spvGatherConstOffsets"; + } + auto *combined = maybe_get(img); // Texture reference @@ -10675,7 +11250,7 @@ string CompilerMSL::to_function_name(const TextureFunctionNameArguments &args) string CompilerMSL::convert_to_f32(const string &expr, uint32_t components) { - SPIRType t; + SPIRType t { components > 1 ? OpTypeVector : OpTypeFloat }; t.basetype = SPIRType::Float; t.vecsize = components; t.columns = 1; @@ -10726,6 +11301,10 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool farg_str += to_expression(combined ? combined->image : img); } + // Gathers with constant offsets call a special function, so include the texture. + if (args.has_array_offsets) + farg_str += to_expression(img); + // Sampler reference if (!args.base.is_fetch) { @@ -10742,11 +11321,17 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool used_swizzle_buffer = true; } - // Swizzled gather puts the component before the other args, to allow template - // deduction to work. - if (args.component && msl_options.swizzle_texture_samples) + // Const offsets gather puts the const offsets before the other args. + if (args.has_array_offsets) + { + forward = forward && should_forward(args.offset); + farg_str += ", " + to_expression(args.offset); + } + + // Const offsets gather or swizzled gather puts the component before the other args. + if (args.component && (args.has_array_offsets || msl_options.swizzle_texture_samples)) { - forward = should_forward(args.component); + forward = forward && should_forward(args.component); farg_str += ", " + to_component_argument(args.component); } } @@ -11051,29 +11636,38 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool // rhoX = dP/dx * extent; rhoY = dP/dy * extent // Therefore, dP/dx = dP/dy = exp2(lod)/extent. // (Subtracting 0.5 before exponentiation gives better results.) - string grad_opt, extent; + string grad_opt, extent, grad_coord; VariableID base_img = img; if (auto *combined = maybe_get(img)) base_img = combined->image; switch (imgtype.image.dim) { case Dim1D: - grad_opt = "2d"; + grad_opt = "gradient2d"; extent = join("float2(", to_expression(base_img), ".get_width(), 1.0)"); break; case Dim2D: - grad_opt = "2d"; + grad_opt = "gradient2d"; extent = join("float2(", to_expression(base_img), ".get_width(), ", to_expression(base_img), ".get_height())"); break; case DimCube: if (imgtype.image.arrayed && msl_options.emulate_cube_array) { - grad_opt = "2d"; + grad_opt = "gradient2d"; extent = join("float2(", to_expression(base_img), ".get_width())"); } else { - grad_opt = "cube"; + if (msl_options.agx_manual_cube_grad_fixup) + { + add_spv_func_and_recompile(SPVFuncImplGradientCube); + grad_opt = "spvGradientCube"; + grad_coord = tex_coords + ", "; + } + else + { + grad_opt = "gradientcube"; + } extent = join("float3(", to_expression(base_img), ".get_width())"); } break; @@ -11082,8 +11676,8 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool extent = "float3(1.0)"; break; } - farg_str += join(", gradient", grad_opt, "(exp2(", to_expression(lod), " - 0.5) / ", extent, ", exp2(", - to_expression(lod), " - 0.5) / ", extent, ")"); + farg_str += join(", ", grad_opt, "(", grad_coord, "exp2(", to_expression(lod), " - 0.5) / ", extent, + ", exp2(", to_expression(lod), " - 0.5) / ", extent, ")"); } else { @@ -11103,27 +11697,37 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool { forward = forward && should_forward(grad_x); forward = forward && should_forward(grad_y); - string grad_opt; + string grad_opt, grad_coord; switch (imgtype.image.dim) { case Dim1D: case Dim2D: - grad_opt = "2d"; + grad_opt = "gradient2d"; break; case Dim3D: - grad_opt = "3d"; + grad_opt = "gradient3d"; break; case DimCube: if (imgtype.image.arrayed && msl_options.emulate_cube_array) - grad_opt = "2d"; + { + grad_opt = "gradient2d"; + } + else if (msl_options.agx_manual_cube_grad_fixup) + { + add_spv_func_and_recompile(SPVFuncImplGradientCube); + grad_opt = "spvGradientCube"; + grad_coord = tex_coords + ", "; + } else - grad_opt = "cube"; + { + grad_opt = "gradientcube"; + } break; default: grad_opt = "unsupported_gradient_dimension"; break; } - farg_str += ", gradient" + grad_opt + "(" + to_expression(grad_x) + ", " + to_expression(grad_y) + ")"; + farg_str += join(", ", grad_opt, "(", grad_coord, to_expression(grad_x), ", ", to_expression(grad_y), ")"); } if (args.min_lod) @@ -11138,7 +11742,7 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool // Add offsets string offset_expr; const SPIRType *offset_type = nullptr; - if (args.offset && !args.base.is_fetch) + if (args.offset && !args.base.is_fetch && !args.has_array_offsets) { forward = forward && should_forward(args.offset); offset_expr = to_expression(args.offset); @@ -11177,7 +11781,7 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool } } - if (args.component) + if (args.component && !args.has_array_offsets) { // If 2D has gather component, ensure it also has an offset arg if (imgtype.image.dim == Dim2D && offset_expr.empty()) @@ -11592,7 +12196,7 @@ string CompilerMSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_ // Emulate texture2D atomic operations auto *backing_var = maybe_get_backing_variable(var_id); - if (backing_var && atomic_image_vars.count(backing_var->self)) + if (backing_var && atomic_image_vars_emulated.count(backing_var->self)) { arg_str += ", " + to_expression(var_id) + "_atomic"; } @@ -11606,21 +12210,26 @@ string CompilerMSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_ string CompilerMSL::to_sampler_expression(uint32_t id) { auto *combined = maybe_get(id); - auto expr = to_expression(combined ? combined->image : VariableID(id)); - auto index = expr.find_first_of('['); + if (combined && combined->sampler) + return to_expression(combined->sampler); - uint32_t samp_id = 0; - if (combined) - samp_id = combined->sampler; + uint32_t expr_id = combined ? uint32_t(combined->image) : id; - if (index == string::npos) - return samp_id ? to_expression(samp_id) : expr + sampler_name_suffix; - else + // Constexpr samplers are declared as local variables, + // so exclude any qualifier names on the image expression. + if (auto *var = maybe_get_backing_variable(expr_id)) { - auto image_expr = expr.substr(0, index); - auto array_expr = expr.substr(index); - return samp_id ? to_expression(samp_id) : (image_expr + sampler_name_suffix + array_expr); + uint32_t img_id = var->basevariable ? var->basevariable : VariableID(var->self); + if (find_constexpr_sampler(img_id)) + return Compiler::to_name(img_id) + sampler_name_suffix; } + + auto img_expr = to_expression(expr_id); + auto index = img_expr.find_first_of('['); + if (index == string::npos) + return img_expr + sampler_name_suffix; + else + return img_expr.substr(0, index) + sampler_name_suffix + img_expr.substr(index); } string CompilerMSL::to_swizzle_expression(uint32_t id) @@ -11669,8 +12278,7 @@ string CompilerMSL::to_buffer_size_expression(uint32_t id) auto array_expr = expr.substr(index); if (auto var = maybe_get_backing_variable(id)) { - auto &var_type = get(var->basetype); - if (is_runtime_size_array(var_type)) + if (is_var_runtime_size_array(*var)) { if (!msl_options.runtime_array_rich_descriptor) SPIRV_CROSS_THROW("OpArrayLength requires rich descriptor format"); @@ -11749,6 +12357,7 @@ void CompilerMSL::emit_fixup() string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, const string &qualifier) { + uint32_t orig_member_type_id = member_type_id; if (member_is_remapped_physical_type(type, index)) member_type_id = get_extended_member_decoration(type.self, index, SPIRVCrossDecorationPhysicalTypeID); auto &physical_type = get(member_type_id); @@ -11765,7 +12374,7 @@ string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_ if (is_matrix(physical_type)) row_major = has_member_decoration(type.self, index, DecorationRowMajor); - SPIRType row_major_physical_type; + SPIRType row_major_physical_type { OpTypeMatrix }; const SPIRType *declared_type = &physical_type; // If a struct is being declared with physical layout, @@ -11857,10 +12466,45 @@ string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_ variable_storage_requires_stage_io(StorageClassInput))); if (is_ib_in_out && is_member_builtin(type, index, &builtin)) is_using_builtin_array = true; - array_type = type_to_array_glsl(physical_type); + array_type = type_to_array_glsl(physical_type, orig_id); + } + + if (orig_id) + { + auto *data_type = declared_type; + if (is_pointer(*data_type)) + data_type = &get_pointee_type(*data_type); + + if (is_array(*data_type) && get_resource_array_size(*data_type, orig_id) == 0) + { + // Hack for declaring unsized array of resources. Need to declare dummy sized array by value inline. + // This can then be wrapped in spvDescriptorArray as usual. + array_type = "[1] /* unsized array hack */"; + } + } + + string decl_type; + if (declared_type->vecsize > 4) + { + auto orig_type = get(orig_member_type_id); + if (is_matrix(orig_type) && row_major) + swap(orig_type.vecsize, orig_type.columns); + orig_type.columns = 1; + decl_type = type_to_glsl(orig_type, orig_id, true); + + if (declared_type->columns > 1) + decl_type = join("spvPaddedStd140Matrix<", decl_type, ", ", declared_type->columns, ">"); + else + decl_type = join("spvPaddedStd140<", decl_type, ">"); } + else + decl_type = type_to_glsl(*declared_type, orig_id, true); + + const char *overlapping_binding_tag = + has_extended_member_decoration(type.self, index, SPIRVCrossDecorationOverlappingBinding) ? + "// Overlapping binding: " : ""; - auto result = join(pack_pfx, type_to_glsl(*declared_type, orig_id, true), " ", qualifier, + auto result = join(overlapping_binding_tag, pack_pfx, decl_type, " ", qualifier, to_member_name(type, index), member_attribute_qualifier(type, index), array_type, ";"); is_using_builtin_array = false; @@ -12125,17 +12769,10 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in else quals = member_location_attribute_qualifier(type, index); - if (builtin == BuiltInBaryCoordKHR || builtin == BuiltInBaryCoordNoPerspKHR) + if (builtin == BuiltInBaryCoordKHR && has_member_decoration(type.self, index, DecorationNoPerspective)) { - if (has_member_decoration(type.self, index, DecorationFlat) || - has_member_decoration(type.self, index, DecorationCentroid) || - has_member_decoration(type.self, index, DecorationSample) || - has_member_decoration(type.self, index, DecorationNoPerspective)) - { - // NoPerspective is baked into the builtin type. - SPIRV_CROSS_THROW( - "Flat, Centroid, Sample, NoPerspective decorations are not supported for BaryCoord inputs."); - } + // NoPerspective is baked into the builtin type. + SPIRV_CROSS_THROW("NoPerspective decorations are not supported for BaryCoord inputs."); } // Don't bother decorating integers with the 'flat' attribute; it's @@ -12153,7 +12790,7 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in { if (!quals.empty()) quals += ", "; - if (has_member_decoration(type.self, index, DecorationNoPerspective)) + if (has_member_decoration(type.self, index, DecorationNoPerspective) || builtin == BuiltInBaryCoordNoPerspKHR) quals += "centroid_no_perspective"; else quals += "centroid_perspective"; @@ -12162,17 +12799,23 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in { if (!quals.empty()) quals += ", "; - if (has_member_decoration(type.self, index, DecorationNoPerspective)) + if (has_member_decoration(type.self, index, DecorationNoPerspective) || builtin == BuiltInBaryCoordNoPerspKHR) quals += "sample_no_perspective"; else quals += "sample_perspective"; } - else if (has_member_decoration(type.self, index, DecorationNoPerspective)) + else if (has_member_decoration(type.self, index, DecorationNoPerspective) || builtin == BuiltInBaryCoordNoPerspKHR) { if (!quals.empty()) quals += ", "; quals += "center_no_perspective"; } + else if (builtin == BuiltInBaryCoordKHR) + { + if (!quals.empty()) + quals += ", "; + quals += "center_perspective"; + } } if (!quals.empty()) @@ -12392,14 +13035,14 @@ uint32_t CompilerMSL::get_or_allocate_builtin_output_member_location(spv::BuiltI string CompilerMSL::func_type_decl(SPIRType &type) { // The regular function return type. If not processing the entry point function, that's all we need - string return_type = type_to_glsl(type) + type_to_array_glsl(type); + string return_type = type_to_glsl(type) + type_to_array_glsl(type, 0); if (!processing_entry_point) return return_type; // If an outgoing interface block has been defined, and it should be returned, override the entry point return type bool ep_should_return_output = !get_is_rasterization_disabled(); if (stage_out_var_id && ep_should_return_output) - return_type = type_to_glsl(get_stage_out_struct_type()) + type_to_array_glsl(type); + return_type = type_to_glsl(get_stage_out_struct_type()) + type_to_array_glsl(type, 0); // Prepend a entry type, based on the execution model string entry_type; @@ -12466,6 +13109,11 @@ string CompilerMSL::get_argument_address_space(const SPIRVariable &argument) return get_type_address_space(type, argument.self, true); } +bool CompilerMSL::decoration_flags_signal_volatile(const Bitset &flags) +{ + return flags.get(DecorationVolatile) || flags.get(DecorationCoherent); +} + string CompilerMSL::get_type_address_space(const SPIRType &type, uint32_t id, bool argument) { // This can be called for variable pointer contexts as well, so be very careful about which method we choose. @@ -12575,7 +13223,10 @@ string CompilerMSL::get_type_address_space(const SPIRType &type, uint32_t id, bo addr_space = type.pointer || (argument && type.basetype == SPIRType::ControlPointArray) ? "thread" : ""; } - return join(flags.get(DecorationVolatile) || flags.get(DecorationCoherent) ? "volatile " : "", addr_space); + if (decoration_flags_signal_volatile(flags) && 0 != strcmp(addr_space, "thread")) + return join("volatile ", addr_space); + else + return addr_space; } const char *CompilerMSL::to_restrict(uint32_t id, bool space) @@ -13001,7 +13652,13 @@ string CompilerMSL::entry_point_args_argument_buffer(bool append_comma) claimed_bindings.set(buffer_binding); - ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + to_restrict(id, true) + to_name(id); + ep_args += get_argument_address_space(var) + " "; + + if (recursive_inputs.count(type.self)) + ep_args += string("void* ") + to_restrict(id, true) + to_name(id) + "_vp"; + else + ep_args += type_to_glsl(type) + "& " + to_restrict(id, true) + to_name(id); + ep_args += " [[buffer(" + convert_to_string(buffer_binding) + ")]]"; next_metal_resource_index_buffer = max(next_metal_resource_index_buffer, buffer_binding + 1); @@ -13046,7 +13703,7 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) struct Resource { SPIRVariable *var; - SPIRVariable *descriptor_alias; + SPIRVariable *discrete_descriptor_alias; string name; SPIRType::BaseType basetype; uint32_t index; @@ -13063,17 +13720,30 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) !is_hidden_variable(var)) { auto &type = get_variable_data_type(var); + uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); if (is_supported_argument_buffer_type(type) && var.storage != StorageClassPushConstant) { - uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); if (descriptor_set_is_argument_buffer(desc_set)) + { + if (is_var_runtime_size_array(var)) + { + // Runtime arrays need to be wrapped in spvDescriptorArray from argument buffer payload. + entry_point_bindings.push_back(&var); + // We'll wrap this, so to_name() will always use non-qualified name. + // We'll need the qualified name to create temporary variable instead. + ir.meta[var_id].decoration.qualified_alias_explicit_override = true; + } return; + } } - // Handle descriptor aliasing. We can handle aliasing of buffers by casting pointers, - // but not for typed resources. - SPIRVariable *descriptor_alias = nullptr; + // Handle descriptor aliasing of simple discrete cases. + // We can handle aliasing of buffers by casting pointers. + // The amount of aliasing we can perform for discrete descriptors is very limited. + // For fully mutable-style aliasing, we need argument buffers where we can exploit the fact + // that descriptors are all 8 bytes. + SPIRVariable *discrete_descriptor_alias = nullptr; if (var.storage == StorageClassUniform || var.storage == StorageClassStorageBuffer) { for (auto &resource : resources) @@ -13086,10 +13756,10 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) (resource.var->storage == StorageClassUniform || resource.var->storage == StorageClassStorageBuffer)) { - descriptor_alias = resource.var; + discrete_descriptor_alias = resource.var; // Self-reference marks that we should declare the resource, // and it's being used as an alias (so we can emit void* instead). - resource.descriptor_alias = resource.var; + resource.discrete_descriptor_alias = resource.var; // Need to promote interlocked usage so that the primary declaration is correct. if (interlocked_resources.count(var_id)) interlocked_resources.insert(resource.var->self); @@ -13111,7 +13781,7 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) // Emulate texture2D atomic operations uint32_t secondary_index = 0; - if (atomic_image_vars.count(var.self)) + if (atomic_image_vars_emulated.count(var.self)) { secondary_index = get_metal_resource_index(var, SPIRType::AtomicCounter, 0); } @@ -13126,13 +13796,13 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) entry_point_bindings.push_back(&var); for (uint32_t i = 0; i < plane_count; i++) - resources.push_back({ &var, descriptor_alias, to_name(var_id), SPIRType::Image, - get_metal_resource_index(var, SPIRType::Image, i), i, secondary_index }); + resources.push_back({&var, discrete_descriptor_alias, to_name(var_id), SPIRType::Image, + get_metal_resource_index(var, SPIRType::Image, i), i, secondary_index }); if (type.image.dim != DimBuffer && !constexpr_sampler) { - resources.push_back({ &var, descriptor_alias, to_sampler_expression(var_id), SPIRType::Sampler, - get_metal_resource_index(var, SPIRType::Sampler), 0, 0 }); + resources.push_back({&var, discrete_descriptor_alias, to_sampler_expression(var_id), SPIRType::Sampler, + get_metal_resource_index(var, SPIRType::Sampler), 0, 0 }); } } else if (!constexpr_sampler) @@ -13142,12 +13812,12 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) // Don't allocate resource indices for aliases. uint32_t resource_index = ~0u; - if (!descriptor_alias) + if (!discrete_descriptor_alias) resource_index = get_metal_resource_index(var, type.basetype); entry_point_bindings.push_back(&var); - resources.push_back({ &var, descriptor_alias, to_name(var_id), type.basetype, - resource_index, 0, secondary_index }); + resources.push_back({&var, discrete_descriptor_alias, to_name(var_id), type.basetype, + resource_index, 0, secondary_index }); } } }); @@ -13171,9 +13841,9 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) if (m.members.size() == 0) break; - if (r.descriptor_alias) + if (r.discrete_descriptor_alias) { - if (r.var == r.descriptor_alias) + if (r.var == r.discrete_descriptor_alias) { auto primary_name = join("spvBufferAliasSet", get_decoration(var_id, DecorationDescriptorSet), @@ -13197,13 +13867,8 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) if (type.array.size() > 1) SPIRV_CROSS_THROW("Arrays of arrays of buffers are not supported."); - // Metal doesn't directly support this, so we must expand the - // array. We'll declare a local array to hold these elements - // later. - uint32_t array_size = to_array_size_literal(type); - is_using_builtin_array = true; - if (is_runtime_size_array(type)) + if (is_var_runtime_size_array(var)) { add_spv_func_and_recompile(SPVFuncImplVariableDescriptorArray); if (!ep_args.empty()) @@ -13218,6 +13883,7 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) } else { + add_spv_func_and_recompile(SPVFuncImplVariableDescriptor); ep_args += "const device spvDescriptor<" + get_argument_address_space(var) + " " + type_to_glsl(type) + "*>* "; } @@ -13229,6 +13895,7 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) } else { + uint32_t array_size = get_resource_array_size(type, var_id); for (uint32_t i = 0; i < array_size; ++i) { if (!ep_args.empty()) @@ -13247,8 +13914,13 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) { if (!ep_args.empty()) ep_args += ", "; - ep_args += - get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + to_restrict(var_id, true) + r.name; + ep_args += get_argument_address_space(var) + " "; + + if (recursive_inputs.count(type.self)) + ep_args += string("void* ") + to_restrict(var_id, true) + r.name + "_vp"; + else + ep_args += type_to_glsl(type) + "& " + to_restrict(var_id, true) + r.name; + ep_args += " [[buffer(" + convert_to_string(r.index) + ")"; if (interlocked_resources.count(var_id)) ep_args += ", raster_order_group(0)"; @@ -13259,8 +13931,8 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) case SPIRType::Sampler: if (!ep_args.empty()) ep_args += ", "; - ep_args += sampler_type(type, var_id) + " " + r.name; - if (is_runtime_size_array(type)) + ep_args += sampler_type(type, var_id, false) + " " + r.name; + if (is_var_runtime_size_array(var)) ep_args += "_ [[buffer(" + convert_to_string(r.index) + ")]]"; else ep_args += " [[sampler(" + convert_to_string(r.index) + ")]]"; @@ -13274,11 +13946,11 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) const auto &basetype = get(var.basetype); if (!type_is_msl_framebuffer_fetch(basetype)) { - ep_args += image_type_glsl(type, var_id) + " " + r.name; + ep_args += image_type_glsl(type, var_id, false) + " " + r.name; if (r.plane > 0) ep_args += join(plane_name_suffix, r.plane); - if (is_runtime_size_array(type)) + if (is_var_runtime_size_array(var)) ep_args += "_ [[buffer(" + convert_to_string(r.index) + ")"; else ep_args += " [[texture(" + convert_to_string(r.index) + ")"; @@ -13291,14 +13963,16 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) { if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 3)) SPIRV_CROSS_THROW("Framebuffer fetch on Mac is not supported before MSL 2.3."); - ep_args += image_type_glsl(type, var_id) + " " + r.name; + ep_args += image_type_glsl(type, var_id, false) + " " + r.name; ep_args += " [[color(" + convert_to_string(r.index) + ")]]"; } // Emulate texture2D atomic operations - if (atomic_image_vars.count(var.self)) + if (atomic_image_vars_emulated.count(var.self)) { - ep_args += ", device atomic_" + type_to_glsl(get(basetype.image.type), 0); + auto &flags = ir.get_decoration_bitset(var.self); + const char *cv_flags = decoration_flags_signal_volatile(flags) ? "volatile " : ""; + ep_args += join(", ", cv_flags, "device atomic_", type_to_glsl(get(basetype.image.type), 0)); ep_args += "* " + r.name + "_atomic"; ep_args += " [[buffer(" + convert_to_string(r.secondary_index) + ")"; if (interlocked_resources.count(var_id)) @@ -13309,17 +13983,21 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) } case SPIRType::AccelerationStructure: { - if (is_runtime_size_array(type)) + if (is_var_runtime_size_array(var)) { add_spv_func_and_recompile(SPVFuncImplVariableDescriptor); const auto &parent_type = get(type.parent_type); - ep_args += ", const device spvDescriptor<" + type_to_glsl(parent_type) + ">* " + + if (!ep_args.empty()) + ep_args += ", "; + ep_args += "const device spvDescriptor<" + type_to_glsl(parent_type) + ">* " + to_restrict(var_id, true) + r.name + "_"; ep_args += " [[buffer(" + convert_to_string(r.index) + ")]]"; } else { - ep_args += ", " + type_to_glsl(type, var_id) + " " + r.name; + if (!ep_args.empty()) + ep_args += ", "; + ep_args += type_to_glsl(type, var_id) + " " + r.name; ep_args += " [[buffer(" + convert_to_string(r.index) + ")]]"; } break; @@ -13411,7 +14089,7 @@ void CompilerMSL::fix_up_shader_inputs_outputs() entry_func.fixup_hooks_in.push_back( [this, &type, &var, var_id]() { - bool is_array_type = !type.array.empty() && !is_runtime_size_array(type); + bool is_array_type = !type.array.empty() && !is_var_runtime_size_array(var); uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); if (descriptor_set_is_argument_buffer(desc_set)) @@ -13419,7 +14097,7 @@ void CompilerMSL::fix_up_shader_inputs_outputs() statement("constant uint", is_array_type ? "* " : "& ", to_buffer_size_expression(var_id), is_array_type ? " = &" : " = ", to_name(argument_buffer_ids[desc_set]), ".spvBufferSizeConstants", "[", - convert_to_string(get_metal_resource_index(var, SPIRType::Image)), "];"); + convert_to_string(get_metal_resource_index(var, SPIRType::UInt)), "];"); } else { @@ -13431,6 +14109,20 @@ void CompilerMSL::fix_up_shader_inputs_outputs() }); } } + + if (!msl_options.argument_buffers && + msl_options.replace_recursive_inputs && type_contains_recursion(type) && + (var.storage == StorageClassUniform || var.storage == StorageClassUniformConstant || + var.storage == StorageClassPushConstant || var.storage == StorageClassStorageBuffer)) + { + recursive_inputs.insert(type.self); + entry_func.fixup_hooks_in.push_back([this, &type, &var, var_id]() { + auto addr_space = get_argument_address_space(var); + auto var_name = to_name(var_id); + statement(addr_space, " auto& ", to_restrict(var_id, true), var_name, + " = *(", addr_space, " ", type_to_glsl(type), "*)", var_name, "_vp;"); + }); + } }); // Builtin variables @@ -13487,14 +14179,31 @@ void CompilerMSL::fix_up_shader_inputs_outputs() break; case BuiltInPatchVertices: if (is_tese_shader()) - entry_func.fixup_hooks_in.push_back([=]() { - statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", - to_expression(patch_stage_in_var_id), ".gl_in.size();"); - }); + { + if (msl_options.raw_buffer_tese_input) + { + entry_func.fixup_hooks_in.push_back( + [=]() { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + get_entry_point().output_vertices, ";"); + }); + } + else + { + entry_func.fixup_hooks_in.push_back( + [=]() + { + statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + to_expression(patch_stage_in_var_id), ".gl_in.size();"); + }); + } + } else + { entry_func.fixup_hooks_in.push_back([=]() { statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = spvIndirectParams[0];"); }); + } break; case BuiltInTessCoord: if (get_entry_point().flags.get(ExecutionModeQuads)) @@ -13910,16 +14619,33 @@ void CompilerMSL::fix_up_shader_inputs_outputs() } } else if (var.storage == StorageClassOutput && get_execution_model() == ExecutionModelFragment && - is_builtin_variable(var) && active_output_builtins.get(bi_type) && - bi_type == BuiltInSampleMask && has_additional_fixed_sample_mask()) + is_builtin_variable(var) && active_output_builtins.get(bi_type)) { - // If the additional fixed sample mask was set, we need to adjust the sample_mask - // output to reflect that. If the shader outputs the sample_mask itself too, we need - // to AND the two masks to get the final one. - string op_str = does_shader_write_sample_mask ? " &= " : " = "; - entry_func.fixup_hooks_out.push_back([=]() { - statement(to_expression(builtin_sample_mask_id), op_str, additional_fixed_sample_mask_str(), ";"); - }); + switch (bi_type) + { + case BuiltInSampleMask: + if (has_additional_fixed_sample_mask()) + { + // If the additional fixed sample mask was set, we need to adjust the sample_mask + // output to reflect that. If the shader outputs the sample_mask itself too, we need + // to AND the two masks to get the final one. + string op_str = does_shader_write_sample_mask ? " &= " : " = "; + entry_func.fixup_hooks_out.push_back([=]() { + statement(to_expression(builtin_sample_mask_id), op_str, additional_fixed_sample_mask_str(), ";"); + }); + } + break; + case BuiltInFragDepth: + if (msl_options.input_attachment_is_ds_attachment && !writes_to_depth) + { + entry_func.fixup_hooks_out.push_back([=]() { + statement(to_expression(builtin_frag_depth_id), " = ", to_expression(builtin_frag_coord_id), ".z;"); + }); + } + break; + default: + break; + } } }); } @@ -14014,7 +14740,7 @@ uint32_t CompilerMSL::get_metal_resource_index(SPIRVariable &var, SPIRType::Base } else { - if (is_runtime_size_array(type)) + if (is_var_runtime_size_array(var)) { basetype = SPIRType::Struct; binding_stride = 1; @@ -14047,24 +14773,6 @@ bool CompilerMSL::type_is_msl_framebuffer_fetch(const SPIRType &type) const msl_options.use_framebuffer_fetch_subpasses; } -bool CompilerMSL::type_is_pointer(const SPIRType &type) const -{ - if (!type.pointer) - return false; - auto &parent_type = get(type.parent_type); - // Safeguards when we forget to set pointer_depth (there is an assert for it in type_to_glsl), - // but the extra check shouldn't hurt. - return (type.pointer_depth > parent_type.pointer_depth) || !parent_type.pointer; -} - -bool CompilerMSL::type_is_pointer_to_pointer(const SPIRType &type) const -{ - if (!type.pointer) - return false; - auto &parent_type = get(type.parent_type); - return type.pointer_depth > parent_type.pointer_depth && type_is_pointer(parent_type); -} - const char *CompilerMSL::descriptor_address_space(uint32_t id, StorageClass storage, const char *plain_address_space) const { if (msl_options.argument_buffers) @@ -14104,7 +14812,6 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) auto &type = get_variable_data_type(var); auto &var_type = get(arg.type); StorageClass type_storage = var_type.storage; - bool is_pointer = var_type.pointer; // If we need to modify the name of the variable, make sure we use the original variable. // Our alias is just a shadow variable. @@ -14112,7 +14819,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) if (arg.alias_global_variable && var.basevariable) name_id = var.basevariable; - bool constref = !arg.alias_global_variable && is_pointer && arg.write_count == 0; + bool constref = !arg.alias_global_variable && is_pointer(var_type) && arg.write_count == 0; // Framebuffer fetch is plain value, const looks out of place, but it is not wrong. if (type_is_msl_framebuffer_fetch(type)) constref = false; @@ -14141,9 +14848,6 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) bool builtin = has_decoration(var.self, DecorationBuiltIn); auto builtin_type = BuiltIn(get_decoration(arg.id, DecorationBuiltIn)); - if (address_space == "threadgroup") - is_using_builtin_array = true; - if (var.basevariable && (var.basevariable == stage_in_ptr_var_id || var.basevariable == stage_out_ptr_var_id)) decl = join(cv_qualifier, type_to_glsl(type, arg.id)); else if (builtin) @@ -14172,7 +14876,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) else decl = join(cv_qualifier, type_to_glsl(type, arg.id)); } - else if (is_runtime_size_array(type)) + else if (is_var_runtime_size_array(var)) { const auto *parent_type = &get(type.parent_type); auto type_name = type_to_glsl(*parent_type, arg.id); @@ -14198,7 +14902,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) else { // The type is a pointer type we need to emit cv_qualifier late. - if (type_is_pointer(type)) + if (is_pointer(type)) { decl = type_to_glsl(type, arg.id); if (*cv_qualifier != '\0') @@ -14210,7 +14914,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) } } - if (!builtin && !is_pointer && + if (!builtin && !is_pointer(var_type) && (type_storage == StorageClassFunction || type_storage == StorageClassGeneric)) { // If the argument is a pure value and not an opaque type, we will pass by value. @@ -14233,7 +14937,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) } decl += to_expression(name_id); decl += ")"; - decl += type_to_array_glsl(type); + decl += type_to_array_glsl(type, name_id); } else { @@ -14249,11 +14953,15 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) if (!address_space.empty()) decl = join(address_space, " ", decl); - const char *argument_buffer_space = descriptor_address_space(name_id, type_storage, nullptr); - if (argument_buffer_space) + // spvDescriptorArray absorbs the address space inside the template. + if (!is_var_runtime_size_array(var)) { - decl += " "; - decl += argument_buffer_space; + const char *argument_buffer_space = descriptor_address_space(name_id, type_storage, nullptr); + if (argument_buffer_space) + { + decl += " "; + decl += argument_buffer_space; + } } // Special case, need to override the array size here if we're using tess level as an argument. @@ -14274,13 +14982,13 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) decl += join("[", array_size, "]"); } } - else if (is_runtime_size_array(type)) + else if (is_var_runtime_size_array(var)) { decl += " " + to_expression(name_id); } else { - auto array_size_decl = type_to_array_glsl(type); + auto array_size_decl = type_to_array_glsl(type, name_id); if (array_size_decl.empty()) decl += "& "; else @@ -14308,7 +15016,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) // for the reference has to go before the '&', but after the '*'. if (!address_space.empty()) { - if (type_is_pointer(type)) + if (is_pointer(type)) { if (*cv_qualifier == '\0') decl += ' '; @@ -14324,7 +15032,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) } else if (type_is_image || type_is_tlas) { - if (is_runtime_size_array(type)) + if (is_var_runtime_size_array(var)) { decl = address_space + " " + decl + " " + to_expression(name_id); } @@ -14357,9 +15065,11 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) // Emulate texture2D atomic operations auto *backing_var = maybe_get_backing_variable(name_id); - if (backing_var && atomic_image_vars.count(backing_var->self)) + if (backing_var && atomic_image_vars_emulated.count(backing_var->self)) { - decl += ", device atomic_" + type_to_glsl(get(var_type.image.type), 0); + auto &flags = ir.get_decoration_bitset(backing_var->self); + const char *cv_flags = decoration_flags_signal_volatile(flags) ? "volatile " : ""; + decl += join(", ", cv_flags, "device atomic_", type_to_glsl(get(var_type.image.type), 0)); decl += "* " + to_expression(name_id) + "_atomic"; } @@ -14375,7 +15085,7 @@ string CompilerMSL::to_name(uint32_t id, bool allow_alias) const if (current_function && (current_function->self == ir.default_entry_point)) { auto *m = ir.find_meta(id); - if (m && !m->decoration.qualified_alias.empty()) + if (m && !m->decoration.qualified_alias_explicit_override && !m->decoration.qualified_alias.empty()) return m->decoration.qualified_alias; } return Compiler::to_name(id, allow_alias); @@ -14553,6 +15263,9 @@ const std::unordered_set &CompilerMSL::get_illegal_func_names() "assert", "fmin3", "fmax3", + "divide", + "fmod", + "median3", "VARIABLE_TRACEPOINT", "STATIC_DATA_TRACEPOINT", "STATIC_DATA_TRACEPOINT_V", @@ -14758,7 +15471,7 @@ string CompilerMSL::to_member_reference(uint32_t base, const SPIRType &type, uin bool is_buffer_variable = is_block && (var->storage == StorageClassUniform || var->storage == StorageClassStorageBuffer); - declared_as_pointer = is_buffer_variable && is_array(get(var->basetype)); + declared_as_pointer = is_buffer_variable && is_array(get_pointee_type(var->basetype)); } if (declared_as_pointer || (!ptr_chain_is_resolved && should_dereference(base))) @@ -14788,7 +15501,7 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id, bool member) string type_name; // Pointer? - if (type_is_top_level_pointer(type) || type_is_array_of_pointers(type)) + if (is_pointer(type) || type_is_array_of_pointers(type)) { assert(type.pointer_depth > 0); @@ -14797,18 +15510,38 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id, bool member) auto type_address_space = get_type_address_space(type, id); const auto *p_parent_type = &get(type.parent_type); + // If we're wrapping buffer descriptors in a spvDescriptorArray, we'll have to handle it as a special case. + if (member && id) + { + auto &var = get(id); + if (is_var_runtime_size_array(var) && is_runtime_size_array(*p_parent_type)) + { + const bool ssbo = has_decoration(p_parent_type->self, DecorationBufferBlock); + bool buffer_desc = + (var.storage == StorageClassStorageBuffer || ssbo) && + msl_options.runtime_array_rich_descriptor; + + const char *wrapper_type = buffer_desc ? "spvBufferDescriptor" : "spvDescriptor"; + add_spv_func_and_recompile(SPVFuncImplVariableDescriptorArray); + add_spv_func_and_recompile(buffer_desc ? SPVFuncImplVariableSizedDescriptor : SPVFuncImplVariableDescriptor); + + type_name = join(wrapper_type, "<", type_address_space, " ", type_to_glsl(*p_parent_type, id), " *>"); + return type_name; + } + } + // Work around C pointer qualifier rules. If glsl_type is a pointer type as well // we'll need to emit the address space to the right. // We could always go this route, but it makes the code unnatural. // Prefer emitting thread T *foo over T thread* foo since it's more readable, // but we'll have to emit thread T * thread * T constant bar; for example. - if (type_is_pointer_to_pointer(type)) + if (is_pointer(type) && is_pointer(*p_parent_type)) type_name = join(type_to_glsl(*p_parent_type, id), " ", type_address_space, " "); else { // Since this is not a pointer-to-pointer, ensure we've dug down to the base type. // Some situations chain pointers even though they are not formally pointers-of-pointers. - while (type_is_pointer(*p_parent_type)) + while (is_pointer(*p_parent_type)) p_parent_type = &get(p_parent_type->parent_type); // If we're emitting BDA, just use the templated type. @@ -14816,7 +15549,7 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id, bool member) // the C-style nesting works right. // FIXME: This is somewhat of a hack. bool old_is_using_builtin_array = is_using_builtin_array; - if (type_is_top_level_physical_pointer(type)) + if (is_physical_pointer(type)) is_using_builtin_array = false; type_name = join(type_address_space, " ", type_to_glsl(*p_parent_type, id)); @@ -14855,10 +15588,10 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id, bool member) case SPIRType::Image: case SPIRType::SampledImage: - return image_type_glsl(type, id); + return image_type_glsl(type, id, member); case SPIRType::Sampler: - return sampler_type(type, id); + return sampler_type(type, id, member); case SPIRType::Void: return "void"; @@ -14997,7 +15730,7 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id) return type_to_glsl(type, id, false); } -string CompilerMSL::type_to_array_glsl(const SPIRType &type) +string CompilerMSL::type_to_array_glsl(const SPIRType &type, uint32_t variable_id) { // Allow Metal to use the array template to make arrays a value type switch (type.basetype) @@ -15005,11 +15738,20 @@ string CompilerMSL::type_to_array_glsl(const SPIRType &type) case SPIRType::AtomicCounter: case SPIRType::ControlPointArray: case SPIRType::RayQuery: - return CompilerGLSL::type_to_array_glsl(type); + return CompilerGLSL::type_to_array_glsl(type, variable_id); default: if (type_is_array_of_pointers(type) || using_builtin_array()) - return CompilerGLSL::type_to_array_glsl(type); + { + const SPIRVariable *var = variable_id ? &get(variable_id) : nullptr; + if (var && (var->storage == StorageClassUniform || var->storage == StorageClassStorageBuffer) && + is_array(get_variable_data_type(*var))) + { + return join("[", get_resource_array_size(type, variable_id), "]"); + } + else + return CompilerGLSL::type_to_array_glsl(type, variable_id); + } else return ""; } @@ -15068,26 +15810,13 @@ bool CompilerMSL::variable_decl_is_remapped_storage(const SPIRVariable &variable } } -std::string CompilerMSL::variable_decl(const SPIRVariable &variable) -{ - bool old_is_using_builtin_array = is_using_builtin_array; - - // Threadgroup arrays can't have a wrapper type. - if (variable_decl_is_remapped_storage(variable, StorageClassWorkgroup)) - is_using_builtin_array = true; - - auto expr = CompilerGLSL::variable_decl(variable); - is_using_builtin_array = old_is_using_builtin_array; - return expr; -} - // GCC workaround of lambdas calling protected funcs std::string CompilerMSL::variable_decl(const SPIRType &type, const std::string &name, uint32_t id) { return CompilerGLSL::variable_decl(type, name, id); } -std::string CompilerMSL::sampler_type(const SPIRType &type, uint32_t id) +std::string CompilerMSL::sampler_type(const SPIRType &type, uint32_t id, bool member) { auto *var = maybe_get(id); if (var && var->basevariable) @@ -15106,29 +15835,31 @@ std::string CompilerMSL::sampler_type(const SPIRType &type, uint32_t id) // Arrays of samplers in MSL must be declared with a special array syntax ala C++11 std::array. // If we have a runtime array, it could be a variable-count descriptor set binding. - uint32_t array_size = to_array_size_literal(type); - if (array_size == 0) - array_size = get_resource_array_size(id); + auto &parent = get(get_pointee_type(type).parent_type); + uint32_t array_size = get_resource_array_size(type, id); if (array_size == 0) { add_spv_func_and_recompile(SPVFuncImplVariableDescriptor); add_spv_func_and_recompile(SPVFuncImplVariableDescriptorArray); - auto &parent = get(get_pointee_type(type).parent_type); - if (processing_entry_point) - return join("const device spvDescriptor<", sampler_type(parent, id), ">*"); - return join("const spvDescriptorArray<", sampler_type(parent, id), ">"); - } - auto &parent = get(get_pointee_type(type).parent_type); - return join("array<", sampler_type(parent, id), ", ", array_size, ">"); + const char *descriptor_wrapper = processing_entry_point ? "const device spvDescriptor" : "const spvDescriptorArray"; + if (member) + descriptor_wrapper = "spvDescriptor"; + return join(descriptor_wrapper, "<", sampler_type(parent, id, false), ">", + processing_entry_point ? "*" : ""); + } + else + { + return join("array<", sampler_type(parent, id, false), ", ", array_size, ">"); + } } else return "sampler"; } // Returns an MSL string describing the SPIR-V image type -string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id) +string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id, bool member) { auto *var = maybe_get(id); if (var && var->basevariable) @@ -15159,26 +15890,35 @@ string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id) // Arrays of images in MSL must be declared with a special array syntax ala C++11 std::array. // If we have a runtime array, it could be a variable-count descriptor set binding. - uint32_t array_size = to_array_size_literal(type); - if (array_size == 0) - array_size = get_resource_array_size(id); + auto &parent = get(get_pointee_type(type).parent_type); + uint32_t array_size = get_resource_array_size(type, id); if (array_size == 0) { add_spv_func_and_recompile(SPVFuncImplVariableDescriptor); add_spv_func_and_recompile(SPVFuncImplVariableDescriptorArray); - auto &parent = get(get_pointee_type(type).parent_type); - return join("const device spvDescriptor<", image_type_glsl(parent, id), ">*"); + const char *descriptor_wrapper = processing_entry_point ? "const device spvDescriptor" : "const spvDescriptorArray"; + if (member) + { + descriptor_wrapper = "spvDescriptor"; + // This requires a specialized wrapper type that packs image and sampler side by side. + // It is possible in theory. + if (type.basetype == SPIRType::SampledImage) + SPIRV_CROSS_THROW("Argument buffer runtime array currently not supported for combined image sampler."); + } + return join(descriptor_wrapper, "<", image_type_glsl(parent, id, false), ">", + processing_entry_point ? "*" : ""); + } + else + { + return join("array<", image_type_glsl(parent, id, false), ", ", array_size, ">"); } - - auto &parent = get(get_pointee_type(type).parent_type); - return join("array<", image_type_glsl(parent, id), ", ", array_size, ">"); } string img_type_name; - // Bypass pointers because we need the real image struct - auto &img_type = get(type.self).image; + auto &img_type = type.image; + if (is_depth_image(type, id)) { switch (img_type.dim) @@ -16078,18 +16818,12 @@ string CompilerMSL::builtin_qualifier(BuiltIn builtin) SPIRV_CROSS_THROW("Subgroup ballot masks are handled specially in MSL."); case BuiltInBaryCoordKHR: - if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3)) - SPIRV_CROSS_THROW("Barycentrics are only supported in MSL 2.3 and above on iOS."); - else if (!msl_options.supports_msl_version(2, 2)) - SPIRV_CROSS_THROW("Barycentrics are only supported in MSL 2.2 and above on macOS."); - return "barycentric_coord, center_perspective"; - case BuiltInBaryCoordNoPerspKHR: if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3)) SPIRV_CROSS_THROW("Barycentrics are only supported in MSL 2.3 and above on iOS."); else if (!msl_options.supports_msl_version(2, 2)) SPIRV_CROSS_THROW("Barycentrics are only supported in MSL 2.2 and above on macOS."); - return "barycentric_coord, center_no_perspective"; + return "barycentric_coord"; default: return "unsupported-built-in"; @@ -16345,19 +17079,27 @@ uint32_t CompilerMSL::get_declared_struct_size_msl(const SPIRType &struct_type, return msl_size; } +uint32_t CompilerMSL::get_physical_type_stride(const SPIRType &type) const +{ + // This should only be relevant for plain types such as scalars and vectors? + // If we're pointing to a struct, it will recursively pick up packed/row-major state. + return get_declared_type_size_msl(type, false, false); +} + // Returns the byte size of a struct member. uint32_t CompilerMSL::get_declared_type_size_msl(const SPIRType &type, bool is_packed, bool row_major) const { // Pointers take 8 bytes each + // Match both pointer and array-of-pointer here. if (type.pointer && type.storage == StorageClassPhysicalStorageBuffer) { - uint32_t type_size = 8 * (type.vecsize == 3 ? 4 : type.vecsize); + uint32_t type_size = 8; // Work our way through potentially layered arrays, // stopping when we hit a pointer that is not also an array. int32_t dim_idx = (int32_t)type.array.size() - 1; auto *p_type = &type; - while (!type_is_pointer(*p_type) && dim_idx >= 0) + while (!is_pointer(*p_type) && dim_idx >= 0) { type_size *= to_array_size_literal(*p_type, dim_idx); p_type = &get(p_type->parent_type); @@ -16426,9 +17168,10 @@ uint32_t CompilerMSL::get_declared_input_size_msl(const SPIRType &type, uint32_t // Returns the byte alignment of a type. uint32_t CompilerMSL::get_declared_type_alignment_msl(const SPIRType &type, bool is_packed, bool row_major) const { - // Pointers aligns on multiples of 8 bytes + // Pointers align on multiples of 8 bytes. + // Deliberately ignore array-ness here. It's not relevant for alignment. if (type.pointer && type.storage == StorageClassPhysicalStorageBuffer) - return 8 * (type.vecsize == 3 ? 4 : type.vecsize); + return 8; switch (type.basetype) { @@ -16584,8 +17327,11 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui // Emulate texture2D atomic operations case OpImageTexelPointer: { - auto *var = compiler.maybe_get_backing_variable(args[2]); - image_pointers[args[1]] = var ? var->self : ID(0); + if (!compiler.msl_options.supports_msl_version(3, 1)) + { + auto *var = compiler.maybe_get_backing_variable(args[2]); + image_pointers_emulated[args[1]] = var ? var->self : ID(0); + } break; } @@ -16615,11 +17361,11 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui case OpAtomicXor: { uses_atomics = true; - auto it = image_pointers.find(args[2]); - if (it != image_pointers.end()) + auto it = image_pointers_emulated.find(args[2]); + if (it != image_pointers_emulated.end()) { uses_image_write = true; - compiler.atomic_image_vars.insert(it->second); + compiler.atomic_image_vars_emulated.insert(it->second); } else check_resource_write(args[2]); @@ -16629,10 +17375,10 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui case OpAtomicStore: { uses_atomics = true; - auto it = image_pointers.find(args[0]); - if (it != image_pointers.end()) + auto it = image_pointers_emulated.find(args[0]); + if (it != image_pointers_emulated.end()) { - compiler.atomic_image_vars.insert(it->second); + compiler.atomic_image_vars_emulated.insert(it->second); uses_image_write = true; } else @@ -16643,10 +17389,10 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui case OpAtomicLoad: { uses_atomics = true; - auto it = image_pointers.find(args[2]); - if (it != image_pointers.end()) + auto it = image_pointers_emulated.find(args[2]); + if (it != image_pointers_emulated.end()) { - compiler.atomic_image_vars.insert(it->second); + compiler.atomic_image_vars_emulated.insert(it->second); } break; } @@ -16672,8 +17418,7 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui auto *var = compiler.maybe_get_backing_variable(args[2]); if (var != nullptr) { - auto &type = compiler.get(var->basetype); - if (!is_runtime_size_array(type)) + if (!compiler.is_var_runtime_size_array(*var)) compiler.buffers_requiring_array_length.insert(var->self); } break; @@ -16826,8 +17571,8 @@ CompilerMSL::SPVFuncImpl CompilerMSL::OpCodePreprocessor::get_spv_func_impl(Op o case OpAtomicLoad: case OpAtomicStore: { - auto it = image_pointers.find(args[opcode == OpAtomicStore ? 0 : 2]); - if (it != image_pointers.end()) + auto it = image_pointers_emulated.find(args[opcode == OpAtomicStore ? 0 : 2]); + if (it != image_pointers_emulated.end()) { uint32_t tid = compiler.get(it->second).basetype; if (tid && compiler.get(tid).image.dim == Dim2D) @@ -16958,6 +17703,18 @@ CompilerMSL::SPVFuncImpl CompilerMSL::OpCodePreprocessor::get_spv_func_impl(Op o case OpGroupNonUniformQuadSwap: return SPVFuncImplQuadSwap; + case OpSDot: + case OpUDot: + case OpSUDot: + case OpSDotAccSat: + case OpUDotAccSat: + case OpSUDotAccSat: + return SPVFuncImplReduceAdd; + + case OpSMulExtended: + case OpUMulExtended: + return SPVFuncImplMulExtended; + default: break; } @@ -17086,7 +17843,7 @@ void CompilerMSL::cast_from_variable_load(uint32_t source_id, std::string &expr, // Type fixups for workgroup variables if they are booleans. if (rewrite_boolean_load) { - if (type_is_top_level_array(expr_type)) + if (is_array(expr_type)) expr = to_rerolled_array_expression(expr_type, expr, expr_type); else expr = join(type_to_glsl(expr_type), "(", expr, ")"); @@ -17145,6 +17902,7 @@ void CompilerMSL::cast_from_variable_load(uint32_t source_id, std::string &expr, case BuiltInInstanceIndex: case BuiltInBaseInstance: case BuiltInBaseVertex: + case BuiltInSampleMask: expected_type = SPIRType::UInt; expected_width = 32; break; @@ -17162,9 +17920,17 @@ void CompilerMSL::cast_from_variable_load(uint32_t source_id, std::string &expr, break; } - if (expected_type != expr_type.basetype) + if (is_array(expr_type) && builtin == BuiltInSampleMask) + { + // Needs special handling. + auto wrap_expr = join(type_to_glsl(expr_type), "({ "); + wrap_expr += join(type_to_glsl(get(expr_type.parent_type)), "(", expr, ")"); + wrap_expr += " })"; + expr = std::move(wrap_expr); + } + else if (expected_type != expr_type.basetype) { - if (!expr_type.array.empty() && (builtin == BuiltInTessLevelInner || builtin == BuiltInTessLevelOuter)) + if (is_array(expr_type) && (builtin == BuiltInTessLevelInner || builtin == BuiltInTessLevelOuter)) { // Triggers when loading TessLevel directly as an array. // Need explicit padding + cast. @@ -17223,7 +17989,7 @@ void CompilerMSL::cast_to_variable_store(uint32_t target_id, std::string &expr, // Type fixups for workgroup variables or struct members if they are booleans. if (rewrite_boolean_store) { - if (type_is_top_level_array(expr_type)) + if (is_array(expr_type)) { expr = to_rerolled_array_expression(*var_type, expr, expr_type); } @@ -17344,6 +18110,108 @@ bool CompilerMSL::is_supported_argument_buffer_type(const SPIRType &type) const return is_supported_type && !type_is_msl_framebuffer_fetch(type); } +void CompilerMSL::emit_argument_buffer_aliased_descriptor(const SPIRVariable &aliased_var, + const SPIRVariable &base_var) +{ + // To deal with buffer <-> image aliasing, we need to perform an unholy UB ritual. + // A texture type in Metal 3.0 is a pointer. However, we cannot simply cast a pointer to texture. + // What we *can* do is to cast pointer-to-pointer to pointer-to-texture. + + // We need to explicitly reach into the descriptor buffer lvalue, not any spvDescriptorArray wrapper. + auto *var_meta = ir.find_meta(base_var.self); + bool old_explicit_qualifier = var_meta && var_meta->decoration.qualified_alias_explicit_override; + if (var_meta) + var_meta->decoration.qualified_alias_explicit_override = false; + auto unqualified_name = to_name(base_var.self, false); + if (var_meta) + var_meta->decoration.qualified_alias_explicit_override = old_explicit_qualifier; + + // For non-arrayed buffers, we have already performed a de-reference. + // We need a proper lvalue to cast, so strip away the de-reference. + if (unqualified_name.size() > 2 && unqualified_name[0] == '(' && unqualified_name[1] == '*') + { + unqualified_name.erase(unqualified_name.begin(), unqualified_name.begin() + 2); + unqualified_name.pop_back(); + } + + string name; + + auto &var_type = get(aliased_var.basetype); + auto &data_type = get_variable_data_type(aliased_var); + string descriptor_storage = descriptor_address_space(aliased_var.self, aliased_var.storage, ""); + + if (aliased_var.storage == StorageClassUniformConstant) + { + if (is_var_runtime_size_array(aliased_var)) + { + // This becomes a plain pointer to spvDescriptor. + name = join("reinterpret_cast<", descriptor_storage, " ", + type_to_glsl(get_variable_data_type(aliased_var), aliased_var.self, true), ">(&", + unqualified_name, ")"); + } + else + { + name = join("reinterpret_cast<", descriptor_storage, " ", + type_to_glsl(get_variable_data_type(aliased_var), aliased_var.self, true), " &>(", + unqualified_name, ");"); + } + } + else + { + // Buffer types. + bool old_is_using_builtin_array = is_using_builtin_array; + is_using_builtin_array = true; + + bool needs_post_cast_deref = !is_array(data_type); + string ref_type = needs_post_cast_deref ? "&" : join("(&)", type_to_array_glsl(var_type, aliased_var.self)); + + if (is_var_runtime_size_array(aliased_var)) + { + name = join("reinterpret_cast<", + type_to_glsl(var_type, aliased_var.self, true), " ", descriptor_storage, " *>(&", + unqualified_name, ")"); + } + else + { + name = join(needs_post_cast_deref ? "*" : "", "reinterpret_cast<", + type_to_glsl(var_type, aliased_var.self, true), " ", descriptor_storage, " ", + ref_type, + ">(", unqualified_name, ");"); + } + + if (needs_post_cast_deref) + descriptor_storage = get_type_address_space(var_type, aliased_var.self, false); + + // These kinds of ridiculous casts trigger warnings in compiler. Just ignore them. + if (!suppress_incompatible_pointer_types_discard_qualifiers) + { + suppress_incompatible_pointer_types_discard_qualifiers = true; + force_recompile_guarantee_forward_progress(); + } + + is_using_builtin_array = old_is_using_builtin_array; + } + + if (!is_var_runtime_size_array(aliased_var)) + { + // Lower to temporary, so drop the qualification. + set_qualified_name(aliased_var.self, ""); + statement(descriptor_storage, " auto &", to_name(aliased_var.self), " = ", name); + } + else + { + // This alias may have already been used to emit an entry point declaration. If there is a mismatch, we need a recompile. + // Moving this code to be run earlier will also conflict, + // because we need the qualified alias for the base resource, + // so forcing recompile until things sync up is the least invasive method for now. + if (ir.meta[aliased_var.self].decoration.qualified_alias != name) + force_recompile(); + + // This will get wrapped in a separate temporary when a spvDescriptorArray wrapper is emitted. + set_qualified_name(aliased_var.self, name); + } +} + void CompilerMSL::analyze_argument_buffers() { // Gather all used resources and sort them out into argument buffers. @@ -17360,11 +18228,12 @@ void CompilerMSL::analyze_argument_buffers() struct Resource { SPIRVariable *var; - SPIRVariable *descriptor_alias; string name; SPIRType::BaseType basetype; uint32_t index; + uint32_t plane_count; uint32_t plane; + uint32_t overlapping_var_id; }; SmallVector resources_in_set[kMaxArgumentBuffers]; SmallVector inline_block_vars; @@ -17400,32 +18269,6 @@ void CompilerMSL::analyze_argument_buffers() } } - // Handle descriptor aliasing as well as we can. - // We can handle aliasing of buffers by casting pointers, but not for typed resources. - // Inline UBOs cannot be handled since it's not a pointer, but inline data. - SPIRVariable *descriptor_alias = nullptr; - if (var.storage == StorageClassUniform || var.storage == StorageClassStorageBuffer) - { - for (auto &resource : resources_in_set[desc_set]) - { - if (get_decoration(resource.var->self, DecorationBinding) == - get_decoration(var_id, DecorationBinding) && - resource.basetype == SPIRType::Struct && type.basetype == SPIRType::Struct && - (resource.var->storage == StorageClassUniform || - resource.var->storage == StorageClassStorageBuffer)) - { - descriptor_alias = resource.var; - // Self-reference marks that we should declare the resource, - // and it's being used as an alias (so we can emit void* instead). - resource.descriptor_alias = resource.var; - // Need to promote interlocked usage so that the primary declaration is correct. - if (interlocked_resources.count(var_id)) - interlocked_resources.insert(resource.var->self); - break; - } - } - } - uint32_t binding = get_decoration(var_id, DecorationBinding); if (type.basetype == SPIRType::SampledImage) { @@ -17439,14 +18282,14 @@ void CompilerMSL::analyze_argument_buffers() { uint32_t image_resource_index = get_metal_resource_index(var, SPIRType::Image, i); resources_in_set[desc_set].push_back( - { &var, descriptor_alias, to_name(var_id), SPIRType::Image, image_resource_index, i }); + { &var, to_name(var_id), SPIRType::Image, image_resource_index, plane_count, i, 0 }); } if (type.image.dim != DimBuffer && !constexpr_sampler) { uint32_t sampler_resource_index = get_metal_resource_index(var, SPIRType::Sampler); resources_in_set[desc_set].push_back( - { &var, descriptor_alias, to_sampler_expression(var_id), SPIRType::Sampler, sampler_resource_index, 0 }); + { &var, to_sampler_expression(var_id), SPIRType::Sampler, sampler_resource_index, 1, 0, 0 }); } } else if (inline_uniform_blocks.count(SetBindingPair{ desc_set, binding })) @@ -17459,19 +18302,17 @@ void CompilerMSL::analyze_argument_buffers() // Inline uniform blocks are always emitted at the end. add_resource_name(var_id); - uint32_t resource_index = ~0u; - if (!descriptor_alias) - resource_index = get_metal_resource_index(var, type.basetype); + uint32_t resource_index = get_metal_resource_index(var, type.basetype); resources_in_set[desc_set].push_back( - { &var, descriptor_alias, to_name(var_id), type.basetype, resource_index, 0 }); + { &var, to_name(var_id), type.basetype, resource_index, 1, 0, 0 }); // Emulate texture2D atomic operations - if (atomic_image_vars.count(var.self)) + if (atomic_image_vars_emulated.count(var.self)) { uint32_t buffer_resource_index = get_metal_resource_index(var, SPIRType::AtomicCounter, 0); resources_in_set[desc_set].push_back( - { &var, descriptor_alias, to_name(var_id) + "_atomic", SPIRType::Struct, buffer_resource_index, 0 }); + { &var, to_name(var_id) + "_atomic", SPIRType::Struct, buffer_resource_index, 1, 0, 0 }); } } @@ -17502,6 +18343,7 @@ void CompilerMSL::analyze_argument_buffers() // Create a buffer to hold extra data, including the swizzle constants. SPIRType uint_type_pointer = get_uint_type(); + uint_type_pointer.op = OpTypePointer; uint_type_pointer.pointer = true; uint_type_pointer.pointer_depth++; uint_type_pointer.parent_type = get_uint_type_id(); @@ -17518,7 +18360,7 @@ void CompilerMSL::analyze_argument_buffers() set_decoration(var_id, DecorationDescriptorSet, desc_set); set_decoration(var_id, DecorationBinding, kSwizzleBufferBinding); resources_in_set[desc_set].push_back( - { &var, nullptr, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 0 }); + { &var, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 1, 0, 0 }); } if (set_needs_buffer_sizes[desc_set]) @@ -17529,7 +18371,7 @@ void CompilerMSL::analyze_argument_buffers() set_decoration(var_id, DecorationDescriptorSet, desc_set); set_decoration(var_id, DecorationBinding, kBufferSizeBufferBinding); resources_in_set[desc_set].push_back( - { &var, nullptr, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 0 }); + { &var, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 1, 0, 0 }); } } } @@ -17541,7 +18383,7 @@ void CompilerMSL::analyze_argument_buffers() uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet); add_resource_name(var_id); resources_in_set[desc_set].push_back( - { &var, nullptr, to_name(var_id), SPIRType::Struct, get_metal_resource_index(var, SPIRType::Struct), 0 }); + { &var, to_name(var_id), SPIRType::Struct, get_metal_resource_index(var, SPIRType::Struct), 1, 0, 0 }); } for (uint32_t desc_set = 0; desc_set < kMaxArgumentBuffers; desc_set++) @@ -17557,7 +18399,7 @@ void CompilerMSL::analyze_argument_buffers() uint32_t ptr_type_id = next_id + 2; argument_buffer_ids[desc_set] = next_id; - auto &buffer_type = set(type_id); + auto &buffer_type = set(type_id, OpTypeStruct); buffer_type.basetype = SPIRType::Struct; @@ -17572,23 +18414,42 @@ void CompilerMSL::analyze_argument_buffers() else buffer_type.storage = StorageClassUniform; - set_name(type_id, join("spvDescriptorSetBuffer", desc_set)); + auto buffer_type_name = join("spvDescriptorSetBuffer", desc_set); + set_name(type_id, buffer_type_name); - auto &ptr_type = set(ptr_type_id); + auto &ptr_type = set(ptr_type_id, OpTypePointer); ptr_type = buffer_type; + ptr_type.op = spv::OpTypePointer; ptr_type.pointer = true; ptr_type.pointer_depth++; ptr_type.parent_type = type_id; uint32_t buffer_variable_id = next_id; - set(buffer_variable_id, ptr_type_id, StorageClassUniform); - set_name(buffer_variable_id, join("spvDescriptorSet", desc_set)); + auto &buffer_var = set(buffer_variable_id, ptr_type_id, StorageClassUniform); + auto buffer_name = join("spvDescriptorSet", desc_set); + set_name(buffer_variable_id, buffer_name); // Ids must be emitted in ID order. stable_sort(begin(resources), end(resources), [&](const Resource &lhs, const Resource &rhs) -> bool { return tie(lhs.index, lhs.basetype) < tie(rhs.index, rhs.basetype); }); + for (size_t i = 0; i < resources.size() - 1; i++) + { + auto &r1 = resources[i]; + auto &r2 = resources[i + 1]; + + if (r1.index == r2.index) + { + if (r1.overlapping_var_id) + r2.overlapping_var_id = r1.overlapping_var_id; + else + r2.overlapping_var_id = r1.var->self; + + set_extended_decoration(r2.var->self, SPIRVCrossDecorationOverlappingBinding, r2.overlapping_var_id); + } + } + uint32_t member_index = 0; uint32_t next_arg_buff_index = 0; for (auto &resource : resources) @@ -17596,55 +18457,58 @@ void CompilerMSL::analyze_argument_buffers() auto &var = *resource.var; auto &type = get_variable_data_type(var); + if (is_var_runtime_size_array(var) && (argument_buffer_device_storage_mask & (1u << desc_set)) == 0) + SPIRV_CROSS_THROW("Runtime sized variables must be in device storage argument buffers."); + // If needed, synthesize and add padding members. // member_index and next_arg_buff_index are incremented when padding members are added. - if (msl_options.pad_argument_buffer_resources) + if (msl_options.pad_argument_buffer_resources && resource.plane == 0 && resource.overlapping_var_id == 0) { - auto &rez_bind = get_argument_buffer_resource(desc_set, next_arg_buff_index); - if (!resource.descriptor_alias) + auto rez_bind = get_argument_buffer_resource(desc_set, next_arg_buff_index); + while (resource.index > next_arg_buff_index) { - while (resource.index > next_arg_buff_index) + switch (rez_bind.basetype) { - switch (rez_bind.basetype) - { - case SPIRType::Void: - case SPIRType::Boolean: - case SPIRType::SByte: - case SPIRType::UByte: - case SPIRType::Short: - case SPIRType::UShort: - case SPIRType::Int: - case SPIRType::UInt: - case SPIRType::Int64: - case SPIRType::UInt64: - case SPIRType::AtomicCounter: - case SPIRType::Half: - case SPIRType::Float: - case SPIRType::Double: - add_argument_buffer_padding_buffer_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - break; - case SPIRType::Image: - add_argument_buffer_padding_image_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - break; - case SPIRType::Sampler: + case SPIRType::Void: + case SPIRType::Boolean: + case SPIRType::SByte: + case SPIRType::UByte: + case SPIRType::Short: + case SPIRType::UShort: + case SPIRType::Int: + case SPIRType::UInt: + case SPIRType::Int64: + case SPIRType::UInt64: + case SPIRType::AtomicCounter: + case SPIRType::Half: + case SPIRType::Float: + case SPIRType::Double: + add_argument_buffer_padding_buffer_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + case SPIRType::Image: + add_argument_buffer_padding_image_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + case SPIRType::Sampler: + add_argument_buffer_padding_sampler_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + case SPIRType::SampledImage: + if (next_arg_buff_index == rez_bind.msl_sampler) add_argument_buffer_padding_sampler_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - break; - case SPIRType::SampledImage: - if (next_arg_buff_index == rez_bind.msl_sampler) - add_argument_buffer_padding_sampler_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - else - add_argument_buffer_padding_image_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - break; - default: - break; - } + else + add_argument_buffer_padding_image_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + default: + break; } + + // After padding, retrieve the resource again. It will either be more padding, or the actual resource. + rez_bind = get_argument_buffer_resource(desc_set, next_arg_buff_index); } // Adjust the number of slots consumed by current member itself. // Use the count value from the app, instead of the shader, in case the - // shader is only accesing part, or even one element, of the array. - next_arg_buff_index += rez_bind.count; + // shader is only accessing part, or even one element, of the array. + next_arg_buff_index += resource.plane_count * rez_bind.count; } string mbr_name = ensure_valid_name(resource.name, "m"); @@ -17658,14 +18522,14 @@ void CompilerMSL::analyze_argument_buffers() bool type_is_array = !type.array.empty(); uint32_t sampler_type_id = ir.increase_bound_by(type_is_array ? 2 : 1); - auto &new_sampler_type = set(sampler_type_id); + auto &new_sampler_type = set(sampler_type_id, OpTypeSampler); new_sampler_type.basetype = SPIRType::Sampler; new_sampler_type.storage = StorageClassUniformConstant; if (type_is_array) { uint32_t sampler_type_array_id = sampler_type_id + 1; - auto &sampler_type_array = set(sampler_type_array_id); + auto &sampler_type_array = set(sampler_type_array_id, OpTypeArray); sampler_type_array = new_sampler_type; sampler_type_array.array = type.array; sampler_type_array.array_size_literal = type.array_size_literal; @@ -17685,28 +18549,34 @@ void CompilerMSL::analyze_argument_buffers() { // Drop pointer information when we emit the resources into a struct. buffer_type.member_types.push_back(get_variable_data_type_id(var)); - if (resource.plane == 0) + if (has_extended_decoration(var.self, SPIRVCrossDecorationOverlappingBinding)) + { + if (!msl_options.supports_msl_version(3, 0)) + SPIRV_CROSS_THROW("Full mutable aliasing of argument buffer descriptors only works on Metal 3+."); + + auto &entry_func = get(ir.default_entry_point); + entry_func.fixup_hooks_in.push_back([this, resource]() { + emit_argument_buffer_aliased_descriptor(*resource.var, this->get(resource.overlapping_var_id)); + }); + } + else if (resource.plane == 0) + { set_qualified_name(var.self, join(to_name(buffer_variable_id), ".", mbr_name)); + } } else if (buffers_requiring_dynamic_offset.count(pair)) { - if (resource.descriptor_alias) - SPIRV_CROSS_THROW("Descriptor aliasing is currently not supported with dynamic offsets."); - // Don't set the qualified name here; we'll define a variable holding the corrected buffer address later. buffer_type.member_types.push_back(var.basetype); buffers_requiring_dynamic_offset[pair].second = var.self; } else if (inline_uniform_blocks.count(pair)) { - if (resource.descriptor_alias) - SPIRV_CROSS_THROW("Descriptor aliasing is currently not supported with inline UBOs."); - // Put the buffer block itself into the argument buffer. buffer_type.member_types.push_back(get_variable_data_type_id(var)); set_qualified_name(var.self, join(to_name(buffer_variable_id), ".", mbr_name)); } - else if (atomic_image_vars.count(var.self)) + else if (atomic_image_vars_emulated.count(var.self)) { // Emulate texture2D atomic operations. // Don't set the qualified name: it's already set for this variable, @@ -17716,12 +18586,13 @@ void CompilerMSL::analyze_argument_buffers() uint32_t atomic_type_id = offset; uint32_t type_ptr_id = offset + 1; - SPIRType atomic_type; + SPIRType atomic_type { OpTypeInt }; atomic_type.basetype = SPIRType::AtomicCounter; atomic_type.width = 32; atomic_type.vecsize = 1; set(atomic_type_id, atomic_type); + atomic_type.op = OpTypePointer; atomic_type.pointer = true; atomic_type.pointer_depth++; atomic_type.parent_type = atomic_type_id; @@ -17733,11 +18604,22 @@ void CompilerMSL::analyze_argument_buffers() } else { - if (!resource.descriptor_alias || resource.descriptor_alias == resource.var) - buffer_type.member_types.push_back(var.basetype); + buffer_type.member_types.push_back(var.basetype); + if (has_extended_decoration(var.self, SPIRVCrossDecorationOverlappingBinding)) + { + // Casting raw pointers is fine since their ABI is fixed, but anything opaque is deeply questionable on Metal 2. + if (get(resource.overlapping_var_id).storage == StorageClassUniformConstant && + !msl_options.supports_msl_version(3, 0)) + { + SPIRV_CROSS_THROW("Full mutable aliasing of argument buffer descriptors only works on Metal 3+."); + } - if (resource.descriptor_alias && resource.descriptor_alias != resource.var) - buffer_aliases_argument.push_back({ var.self, resource.descriptor_alias->self }); + auto &entry_func = get(ir.default_entry_point); + + entry_func.fixup_hooks_in.push_back([this, resource]() { + emit_argument_buffer_aliased_descriptor(*resource.var, this->get(resource.overlapping_var_id)); + }); + } else if (type.array.empty()) set_qualified_name(var.self, join("(*", to_name(buffer_variable_id), ".", mbr_name, ")")); else @@ -17749,8 +18631,20 @@ void CompilerMSL::analyze_argument_buffers() resource.index); set_extended_member_decoration(buffer_type.self, member_index, SPIRVCrossDecorationInterfaceOrigID, var.self); + if (has_extended_decoration(var.self, SPIRVCrossDecorationOverlappingBinding)) + set_extended_member_decoration(buffer_type.self, member_index, SPIRVCrossDecorationOverlappingBinding); member_index++; } + + if (msl_options.replace_recursive_inputs && type_contains_recursion(buffer_type)) + { + recursive_inputs.insert(type_id); + auto &entry_func = this->get(ir.default_entry_point); + auto addr_space = get_argument_address_space(buffer_var); + entry_func.fixup_hooks_in.push_back([this, addr_space, buffer_name, buffer_type_name]() { + statement(addr_space, " auto& ", buffer_name, " = *(", addr_space, " ", buffer_type_name, "*)", buffer_name, "_vp;"); + }); + } } } @@ -17758,7 +18652,7 @@ void CompilerMSL::analyze_argument_buffers() // that matches the resource index of the argument buffer index. // This is a two-step lookup, first lookup the resource binding number from the argument buffer index, // then lookup the resource binding using the binding number. -MSLResourceBinding &CompilerMSL::get_argument_buffer_resource(uint32_t desc_set, uint32_t arg_idx) +const MSLResourceBinding &CompilerMSL::get_argument_buffer_resource(uint32_t desc_set, uint32_t arg_idx) const { auto stage = get_entry_point().model; StageSetBinding arg_idx_tuple = { stage, desc_set, arg_idx }; @@ -17782,13 +18676,14 @@ void CompilerMSL::add_argument_buffer_padding_buffer_type(SPIRType &struct_type, if (!argument_buffer_padding_buffer_type_id) { uint32_t buff_type_id = ir.increase_bound_by(2); - auto &buff_type = set(buff_type_id); + auto &buff_type = set(buff_type_id, OpNop); buff_type.basetype = rez_bind.basetype; buff_type.storage = StorageClassUniformConstant; uint32_t ptr_type_id = buff_type_id + 1; - auto &ptr_type = set(ptr_type_id); + auto &ptr_type = set(ptr_type_id, OpTypePointer); ptr_type = buff_type; + ptr_type.op = spv::OpTypePointer; ptr_type.pointer = true; ptr_type.pointer_depth++; ptr_type.parent_type = buff_type_id; @@ -17806,12 +18701,12 @@ void CompilerMSL::add_argument_buffer_padding_image_type(SPIRType &struct_type, if (!argument_buffer_padding_image_type_id) { uint32_t base_type_id = ir.increase_bound_by(2); - auto &base_type = set(base_type_id); + auto &base_type = set(base_type_id, OpTypeFloat); base_type.basetype = SPIRType::Float; base_type.width = 32; uint32_t img_type_id = base_type_id + 1; - auto &img_type = set(img_type_id); + auto &img_type = set(img_type_id, OpTypeImage); img_type.basetype = SPIRType::Image; img_type.storage = StorageClassUniformConstant; @@ -17837,7 +18732,7 @@ void CompilerMSL::add_argument_buffer_padding_sampler_type(SPIRType &struct_type if (!argument_buffer_padding_sampler_type_id) { uint32_t samp_type_id = ir.increase_bound_by(1); - auto &samp_type = set(samp_type_id); + auto &samp_type = set(samp_type_id, OpTypeSampler); samp_type.basetype = SPIRType::Sampler; samp_type.storage = StorageClassUniformConstant; @@ -17856,8 +18751,8 @@ void CompilerMSL::add_argument_buffer_padding_type(uint32_t mbr_type_id, SPIRTyp if (count > 1) { uint32_t ary_type_id = ir.increase_bound_by(1); - auto &ary_type = set(ary_type_id); - ary_type = get(type_id); + auto &ary_type = set(ary_type_id, get(type_id)); + ary_type.op = OpTypeArray; ary_type.array.push_back(count); ary_type.array_size_literal.push_back(true); ary_type.parent_type = type_id; diff --git a/bgfx/3rdparty/spirv-cross/spirv_msl.hpp b/bgfx/3rdparty/spirv-cross/spirv_msl.hpp index 26167f67..14cd84b0 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_msl.hpp +++ b/bgfx/3rdparty/spirv-cross/spirv_msl.hpp @@ -287,9 +287,6 @@ static const uint32_t kArgumentBufferBinding = ~(3u); static const uint32_t kMaxArgumentBuffers = 8; -// The arbitrary maximum for the nesting of array of array copies. -static const uint32_t kArrayCopyMultidimMax = 6; - // Decompiles SPIR-V to Metal Shading Language class CompilerMSL : public CompilerGLSL { @@ -505,6 +502,40 @@ class CompilerMSL : public CompilerGLSL // Note: Only Apple's GPU compiler takes advantage of the lack of coherency, so make sure to test on Apple GPUs if you disable this. bool readwrite_texture_fences = true; + // Metal 3.1 introduced a Metal regression bug which causes infinite recursion during + // Metal's analysis of an entry point input structure that is itself recursive. Enabling + // this option will replace the recursive input declaration with a alternate variable of + // type void*, and then cast to the correct type at the top of the entry point function. + // The bug has been reported to Apple, and will hopefully be fixed in future releases. + bool replace_recursive_inputs = false; + + // If set, manual fixups of gradient vectors for cube texture lookups will be performed. + // All released Apple Silicon GPUs to date behave incorrectly when sampling a cube texture + // with explicit gradients. They will ignore one of the three partial derivatives based + // on the selected major axis, and expect the remaining derivatives to be partially + // transformed. + bool agx_manual_cube_grad_fixup = false; + + // Metal will discard fragments with side effects under certain circumstances prematurely. + // Example: CTS test dEQP-VK.fragment_operations.early_fragment.discard_no_early_fragment_tests_depth + // Test will render a full screen quad with varying depth [0,1] for each fragment. + // Each fragment will do an operation with side effects, modify the depth value and + // discard the fragment. The test expects the fragment to be run due to: + // https://registry.khronos.org/vulkan/specs/1.0-extensions/html/vkspec.html#fragops-shader-depthreplacement + // which states that the fragment shader must be run due to replacing the depth in shader. + // However, Metal may prematurely discards fragments without executing them + // (I believe this to be due to a greedy optimization on their end) making the test fail. + // This option enforces fragment execution for such cases where the fragment has operations + // with side effects. Provided as an option hoping Metal will fix this issue in the future. + bool force_fragment_with_side_effects_execution = false; + + // If set, adds a depth pass through statement to circumvent the following issue: + // When the same depth/stencil is used as input and depth/stencil attachment, we need to + // force Metal to perform the depth/stencil write after fragment execution. Otherwise, + // Metal will write to the depth attachment before fragment execution. This happens + // if the fragment does not modify the depth value. + bool input_attachment_is_ds_attachment = false; + bool is_ios() const { return platform == iOS; @@ -738,17 +769,11 @@ class CompilerMSL : public CompilerGLSL SPVFuncImplFindSMsb, SPVFuncImplFindUMsb, SPVFuncImplSSign, - SPVFuncImplArrayCopyMultidimBase, - // Unfortunately, we cannot use recursive templates in the MSL compiler properly, - // so stamp out variants up to some arbitrary maximum. - SPVFuncImplArrayCopy = SPVFuncImplArrayCopyMultidimBase + 1, - SPVFuncImplArrayOfArrayCopy2Dim = SPVFuncImplArrayCopyMultidimBase + 2, - SPVFuncImplArrayOfArrayCopy3Dim = SPVFuncImplArrayCopyMultidimBase + 3, - SPVFuncImplArrayOfArrayCopy4Dim = SPVFuncImplArrayCopyMultidimBase + 4, - SPVFuncImplArrayOfArrayCopy5Dim = SPVFuncImplArrayCopyMultidimBase + 5, - SPVFuncImplArrayOfArrayCopy6Dim = SPVFuncImplArrayCopyMultidimBase + 6, + SPVFuncImplArrayCopy, + SPVFuncImplArrayCopyMultidim, SPVFuncImplTexelBufferCoords, SPVFuncImplImage2DAtomicCoords, // Emulate texture2D atomic operations + SPVFuncImplGradientCube, SPVFuncImplFMul, SPVFuncImplFAdd, SPVFuncImplFSub, @@ -767,6 +792,8 @@ class CompilerMSL : public CompilerGLSL SPVFuncImplTextureSwizzle, SPVFuncImplGatherSwizzle, SPVFuncImplGatherCompareSwizzle, + SPVFuncImplGatherConstOffsets, + SPVFuncImplGatherCompareConstOffsets, SPVFuncImplSubgroupBroadcast, SPVFuncImplSubgroupBroadcastFirst, SPVFuncImplSubgroupBallot, @@ -808,6 +835,11 @@ class CompilerMSL : public CompilerGLSL SPVFuncImplVariableDescriptor, SPVFuncImplVariableSizedDescriptor, SPVFuncImplVariableDescriptorArray, + SPVFuncImplPaddedStd140, + SPVFuncImplReduceAdd, + SPVFuncImplImageFence, + SPVFuncImplTextureCast, + SPVFuncImplMulExtended, }; // If the underlying resource has been used for comparison then duplicate loads of that resource must be too @@ -838,19 +870,16 @@ class CompilerMSL : public CompilerGLSL void emit_block_hints(const SPIRBlock &block) override; // Allow Metal to use the array template to make arrays a value type - std::string type_to_array_glsl(const SPIRType &type) override; + std::string type_to_array_glsl(const SPIRType &type, uint32_t variable_id) override; std::string constant_op_expression(const SPIRConstantOp &cop) override; - // Threadgroup arrays can't have a wrapper type - std::string variable_decl(const SPIRVariable &variable) override; - bool variable_decl_is_remapped_storage(const SPIRVariable &variable, spv::StorageClass storage) const override; // GCC workaround of lambdas calling protected functions (for older GCC versions) std::string variable_decl(const SPIRType &type, const std::string &name, uint32_t id = 0) override; - std::string image_type_glsl(const SPIRType &type, uint32_t id = 0) override; - std::string sampler_type(const SPIRType &type, uint32_t id); + std::string image_type_glsl(const SPIRType &type, uint32_t id, bool member) override; + std::string sampler_type(const SPIRType &type, uint32_t id, bool member); std::string builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClass storage) override; std::string to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_t id) override; std::string to_name(uint32_t id, bool allow_alias = true) const override; @@ -945,7 +974,8 @@ class CompilerMSL : public CompilerGLSL uint32_t mbr_idx, InterfaceBlockMeta &meta, const std::string &mbr_name_qual, const std::string &var_chain_qual, - uint32_t &location, uint32_t &var_mbr_idx); + uint32_t &location, uint32_t &var_mbr_idx, + const Bitset &interpolation_qual); void add_tess_level_input_to_interface_block(const std::string &ib_var_ref, SPIRType &ib_type, SPIRVariable &var); void add_tess_level_input(const std::string &base_ref, const std::string &mbr_name, SPIRVariable &var); @@ -963,7 +993,8 @@ class CompilerMSL : public CompilerGLSL void emit_specialization_constants_and_structs(); void emit_interface_block(uint32_t ib_var_id); bool maybe_emit_array_assignment(uint32_t id_lhs, uint32_t id_rhs); - uint32_t get_resource_array_size(uint32_t id) const; + bool is_var_runtime_size_array(const SPIRVariable &var) const; + uint32_t get_resource_array_size(const SPIRType &type, uint32_t id) const; void fix_up_shader_inputs_outputs(); @@ -998,6 +1029,8 @@ class CompilerMSL : public CompilerGLSL uint32_t get_physical_tess_level_array_size(spv::BuiltIn builtin) const; + uint32_t get_physical_type_stride(const SPIRType &type) const override; + // MSL packing rules. These compute the effective packing rules as observed by the MSL compiler in the MSL output. // These values can change depending on various extended decorations which control packing rules. // We need to make these rules match up with SPIR-V declared rules. @@ -1030,6 +1063,7 @@ class CompilerMSL : public CompilerGLSL bool validate_member_packing_rules_msl(const SPIRType &type, uint32_t index) const; std::string get_argument_address_space(const SPIRVariable &argument); std::string get_type_address_space(const SPIRType &type, uint32_t id, bool argument = false); + static bool decoration_flags_signal_volatile(const Bitset &flags); const char *to_restrict(uint32_t id, bool space); SPIRType &get_stage_in_struct_type(); SPIRType &get_stage_out_struct_type(); @@ -1070,6 +1104,7 @@ class CompilerMSL : public CompilerGLSL uint32_t builtin_stage_input_size_id = 0; uint32_t builtin_local_invocation_index_id = 0; uint32_t builtin_workgroup_size_id = 0; + uint32_t builtin_frag_depth_id = 0; uint32_t swizzle_buffer_id = 0; uint32_t buffer_size_buffer_id = 0; uint32_t view_mask_buffer_id = 0; @@ -1089,7 +1124,7 @@ class CompilerMSL : public CompilerGLSL void analyze_sampled_image_usage(); bool access_chain_needs_stage_io_builtin_translation(uint32_t base) override; - void prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, spv::StorageClass storage, + bool prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, spv::StorageClass storage, bool &is_packed) override; void fix_up_interpolant_access_chain(const uint32_t *ops, uint32_t length); void check_physical_type_cast(std::string &expr, const SPIRType *type, uint32_t physical_type) override; @@ -1166,6 +1201,7 @@ class CompilerMSL : public CompilerGLSL bool needs_subgroup_size = false; bool needs_sample_id = false; bool needs_helper_invocation = false; + bool writes_to_depth = false; std::string qual_pos_var_name; std::string stage_in_var_name = "in"; std::string stage_out_var_name = "out"; @@ -1192,8 +1228,9 @@ class CompilerMSL : public CompilerGLSL std::unordered_set buffers_requiring_array_length; SmallVector> buffer_aliases_argument; SmallVector buffer_aliases_discrete; - std::unordered_set atomic_image_vars; // Emulate texture2D atomic operations + std::unordered_set atomic_image_vars_emulated; // Emulate texture2D atomic operations std::unordered_set pull_model_inputs; + std::unordered_set recursive_inputs; SmallVector entry_point_bindings; @@ -1208,9 +1245,12 @@ class CompilerMSL : public CompilerGLSL uint32_t argument_buffer_discrete_mask = 0; uint32_t argument_buffer_device_storage_mask = 0; + void emit_argument_buffer_aliased_descriptor(const SPIRVariable &aliased_var, + const SPIRVariable &base_var); + void analyze_argument_buffers(); bool descriptor_set_is_argument_buffer(uint32_t desc_set) const; - MSLResourceBinding &get_argument_buffer_resource(uint32_t desc_set, uint32_t arg_idx); + const MSLResourceBinding &get_argument_buffer_resource(uint32_t desc_set, uint32_t arg_idx) const; void add_argument_buffer_padding_buffer_type(SPIRType &struct_type, uint32_t &mbr_idx, uint32_t &arg_buff_index, MSLResourceBinding &rez_bind); void add_argument_buffer_padding_image_type(SPIRType &struct_type, uint32_t &mbr_idx, uint32_t &arg_buff_index, MSLResourceBinding &rez_bind); void add_argument_buffer_padding_sampler_type(SPIRType &struct_type, uint32_t &mbr_idx, uint32_t &arg_buff_index, MSLResourceBinding &rez_bind); @@ -1222,14 +1262,13 @@ class CompilerMSL : public CompilerGLSL uint32_t build_msl_interpolant_type(uint32_t type_id, bool is_noperspective); bool suppress_missing_prototypes = false; + bool suppress_incompatible_pointer_types_discard_qualifiers = false; void add_spv_func_and_recompile(SPVFuncImpl spv_func); void activate_argument_buffer_resources(); bool type_is_msl_framebuffer_fetch(const SPIRType &type) const; - bool type_is_pointer(const SPIRType &type) const; - bool type_is_pointer_to_pointer(const SPIRType &type) const; bool is_supported_argument_buffer_type(const SPIRType &type) const; bool variable_storage_requires_stage_io(spv::StorageClass storage) const; @@ -1261,7 +1300,7 @@ class CompilerMSL : public CompilerGLSL CompilerMSL &compiler; std::unordered_map result_types; - std::unordered_map image_pointers; // Emulate texture2D atomic operations + std::unordered_map image_pointers_emulated; // Emulate texture2D atomic operations bool suppress_missing_prototypes = false; bool uses_atomics = false; bool uses_image_write = false; diff --git a/bgfx/3rdparty/spirv-cross/spirv_parser.cpp b/bgfx/3rdparty/spirv-cross/spirv_parser.cpp index 01c2e381..6108dbb6 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_parser.cpp +++ b/bgfx/3rdparty/spirv-cross/spirv_parser.cpp @@ -517,7 +517,7 @@ void Parser::parse(const Instruction &instruction) case OpTypeVoid: { uint32_t id = ops[0]; - auto &type = set(id); + auto &type = set(id, op); type.basetype = SPIRType::Void; break; } @@ -525,7 +525,7 @@ void Parser::parse(const Instruction &instruction) case OpTypeBool: { uint32_t id = ops[0]; - auto &type = set(id); + auto &type = set(id, op); type.basetype = SPIRType::Boolean; type.width = 1; break; @@ -535,7 +535,7 @@ void Parser::parse(const Instruction &instruction) { uint32_t id = ops[0]; uint32_t width = ops[1]; - auto &type = set(id); + auto &type = set(id, op); if (width == 64) type.basetype = SPIRType::Double; else if (width == 32) @@ -553,7 +553,7 @@ void Parser::parse(const Instruction &instruction) uint32_t id = ops[0]; uint32_t width = ops[1]; bool signedness = ops[2] != 0; - auto &type = set(id); + auto &type = set(id, op); type.basetype = signedness ? to_signed_basetype(width) : to_unsigned_basetype(width); type.width = width; break; @@ -568,9 +568,9 @@ void Parser::parse(const Instruction &instruction) uint32_t vecsize = ops[2]; auto &base = get(ops[1]); - auto &vecbase = set(id); + auto &vecbase = set(id, base); - vecbase = base; + vecbase.op = op; vecbase.vecsize = vecsize; vecbase.self = id; vecbase.parent_type = ops[1]; @@ -583,9 +583,9 @@ void Parser::parse(const Instruction &instruction) uint32_t colcount = ops[2]; auto &base = get(ops[1]); - auto &matrixbase = set(id); + auto &matrixbase = set(id, base); - matrixbase = base; + matrixbase.op = op; matrixbase.columns = colcount; matrixbase.self = id; matrixbase.parent_type = ops[1]; @@ -595,12 +595,11 @@ void Parser::parse(const Instruction &instruction) case OpTypeArray: { uint32_t id = ops[0]; - auto &arraybase = set(id); - uint32_t tid = ops[1]; auto &base = get(tid); + auto &arraybase = set(id, base); - arraybase = base; + arraybase.op = op; arraybase.parent_type = tid; uint32_t cid = ops[2]; @@ -615,7 +614,9 @@ void Parser::parse(const Instruction &instruction) arraybase.array_size_literal.push_back(literal); arraybase.array.push_back(literal ? c->scalar() : cid); - // Do NOT set arraybase.self! + + // .self resolves down to non-array/non-pointer type. + arraybase.self = base.self; break; } @@ -624,25 +625,27 @@ void Parser::parse(const Instruction &instruction) uint32_t id = ops[0]; auto &base = get(ops[1]); - auto &arraybase = set(id); + auto &arraybase = set(id, base); // We're copying type information into Array types, so we'll need a fixup for any physical pointer // references. if (base.forward_pointer) forward_pointer_fixups.push_back({ id, ops[1] }); - arraybase = base; + arraybase.op = op; arraybase.array.push_back(0); arraybase.array_size_literal.push_back(true); arraybase.parent_type = ops[1]; - // Do NOT set arraybase.self! + + // .self resolves down to non-array/non-pointer type. + arraybase.self = base.self; break; } case OpTypeImage: { uint32_t id = ops[0]; - auto &type = set(id); + auto &type = set(id, op); type.basetype = SPIRType::Image; type.image.type = ops[1]; type.image.dim = static_cast(ops[2]); @@ -659,7 +662,7 @@ void Parser::parse(const Instruction &instruction) { uint32_t id = ops[0]; uint32_t imagetype = ops[1]; - auto &type = set(id); + auto &type = set(id, op); type = get(imagetype); type.basetype = SPIRType::SampledImage; type.self = id; @@ -669,7 +672,7 @@ void Parser::parse(const Instruction &instruction) case OpTypeSampler: { uint32_t id = ops[0]; - auto &type = set(id); + auto &type = set(id, op); type.basetype = SPIRType::Sampler; break; } @@ -682,10 +685,13 @@ void Parser::parse(const Instruction &instruction) // We won't be able to compile it, but we shouldn't crash when parsing. // We should be able to reflect. auto *base = maybe_get(ops[2]); - auto &ptrbase = set(id); + auto &ptrbase = set(id, op); if (base) + { ptrbase = *base; + ptrbase.op = op; + } ptrbase.pointer = true; ptrbase.pointer_depth++; @@ -706,7 +712,7 @@ void Parser::parse(const Instruction &instruction) case OpTypeForwardPointer: { uint32_t id = ops[0]; - auto &ptrbase = set(id); + auto &ptrbase = set(id, op); ptrbase.pointer = true; ptrbase.pointer_depth++; ptrbase.storage = static_cast(ops[1]); @@ -721,7 +727,7 @@ void Parser::parse(const Instruction &instruction) case OpTypeStruct: { uint32_t id = ops[0]; - auto &type = set(id); + auto &type = set(id, op); type.basetype = SPIRType::Struct; for (uint32_t i = 1; i < length; i++) type.member_types.push_back(ops[i]); @@ -770,7 +776,7 @@ void Parser::parse(const Instruction &instruction) case OpTypeAccelerationStructureKHR: { uint32_t id = ops[0]; - auto &type = set(id); + auto &type = set(id, op); type.basetype = SPIRType::AccelerationStructure; break; } @@ -778,7 +784,7 @@ void Parser::parse(const Instruction &instruction) case OpTypeRayQueryKHR: { uint32_t id = ops[0]; - auto &type = set(id); + auto &type = set(id, op); type.basetype = SPIRType::RayQuery; break; } @@ -1025,10 +1031,9 @@ void Parser::parse(const Instruction &instruction) { uint32_t ids = ir.increase_bound_by(2); - SPIRType type; + auto &type = set(ids, OpTypeInt); type.basetype = SPIRType::Int; type.width = 32; - set(ids, type); auto &c = set(ids + 1, ids); current_block->condition = c.self; diff --git a/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp b/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp index 9fcd3bc0..552d671a 100644 --- a/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp +++ b/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp @@ -291,7 +291,7 @@ static bool naturally_emit_type(const SPIRType &type) bool CompilerReflection::type_is_reference(const SPIRType &type) const { // Physical pointers and arrays of physical pointers need to refer to the pointee's type. - return type_is_top_level_physical_pointer(type) || + return is_physical_pointer(type) || (type_is_array_of_pointers(type) && type.storage == StorageClassPhysicalStorageBuffer); } @@ -341,7 +341,7 @@ void CompilerReflection::emit_type(uint32_t type_id, bool &emitted_open_tag) json_stream->emit_json_key_object("_" + std::to_string(type_id)); json_stream->emit_json_key_value("name", name); - if (type_is_top_level_physical_pointer(type)) + if (is_physical_pointer(type)) { json_stream->emit_json_key_value("type", "_" + std::to_string(type.parent_type)); json_stream->emit_json_key_value("physical_pointer", true); @@ -404,7 +404,7 @@ void CompilerReflection::emit_type_member(const SPIRType &type, uint32_t index) void CompilerReflection::emit_type_array(const SPIRType &type) { - if (!type_is_top_level_physical_pointer(type) && !type.array.empty()) + if (!is_physical_pointer(type) && !type.array.empty()) { json_stream->emit_json_key_array("array"); // Note that we emit the zeros here as a means of identifying @@ -444,7 +444,7 @@ void CompilerReflection::emit_type_member_qualifiers(const SPIRType &type, uint3 if (dec.decoration_flags.get(DecorationRowMajor)) json_stream->emit_json_key_value("row_major", true); - if (type_is_top_level_physical_pointer(membertype)) + if (is_physical_pointer(membertype)) json_stream->emit_json_key_value("physical_pointer", true); } } @@ -633,6 +633,12 @@ void CompilerReflection::emit_resources(const char *tag, const SmallVectoremit_json_key_value("offset", get_decoration(res.id, DecorationOffset)); + if (mask.get(DecorationWeightTextureQCOM)) + json_stream->emit_json_key_value("WeightTextureQCOM", get_decoration(res.id, DecorationWeightTextureQCOM)); + if (mask.get(DecorationBlockMatchTextureQCOM)) + json_stream->emit_json_key_value("BlockMatchTextureQCOM", get_decoration(res.id, DecorationBlockMatchTextureQCOM)); + if (mask.get(DecorationBlockMatchSamplerQCOM)) + json_stream->emit_json_key_value("BlockMatchSamplerQCOM", get_decoration(res.id, DecorationBlockMatchSamplerQCOM)); // For images, the type itself adds a layout qualifer. // Only emit the format for storage images. diff --git a/bgfx/3rdparty/spirv-headers/LICENSE b/bgfx/3rdparty/spirv-headers/LICENSE index 47974f8c..a02ace17 100644 --- a/bgfx/3rdparty/spirv-headers/LICENSE +++ b/bgfx/3rdparty/spirv-headers/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2015-2018 The Khronos Group Inc. +Files: All files except for those called out below. +Copyright (c) 2015-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 @@ -23,3 +24,80 @@ 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. + +--- + +Files: include/spirv/spir-v.xml +Copyright (c) 2015-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. + +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. + +--- + +Files: tools/buildHeaders/jsoncpp/* +The JsonCpp library's source code, including accompanying documentation, +tests and demonstration applications, are licensed under the following +conditions... + +The author (Baptiste Lepilleur) explicitly disclaims copyright in all +jurisdictions which recognize such a disclaimer. In such jurisdictions, +this software is released into the Public Domain. + +In jurisdictions which do not recognize Public Domain property (e.g. Germany as of +2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is +released under the terms of the MIT License (see below). + +In jurisdictions which recognize Public Domain property, the user of this +software may choose to accept it either as 1) Public Domain, 2) under the +conditions of the MIT License (see below), or 3) under the terms of dual +Public Domain/MIT License conditions described here, as they choose. + +The MIT License is about as close to Public Domain as a license can get, and is +described in clear, concise terms at: + + http://en.wikipedia.org/wiki/MIT_License + +The full text of the MIT License follows: + +======================================================================== +Copyright (c) 2007-2010 Baptiste Lepilleur + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +======================================================================== + +--- diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/spir-v.xml b/bgfx/3rdparty/spirv-headers/include/spirv/spir-v.xml index 989b996b..243b7203 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/spir-v.xml +++ b/bgfx/3rdparty/spirv-headers/include/spirv/spir-v.xml @@ -1,7 +1,7 @@ @@ -147,13 +153,14 @@ + - + @@ -180,13 +187,14 @@ + - + @@ -206,8 +214,8 @@ - - + + @@ -247,7 +255,8 @@ - + + @@ -266,8 +275,9 @@ - - + + + diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_gcn_shader.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_gcn_shader.h index 80165ae5..e626a7a9 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_gcn_shader.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_gcn_shader.h @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The Khronos Group Inc. +// Copyright (c) 2020-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 diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_ballot.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_ballot.h index 8a8bb6ec..563c0b62 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_ballot.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_ballot.h @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The Khronos Group Inc. +// Copyright (c) 2020-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 diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h index 12b6480f..e663330c 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The Khronos Group Inc. +// Copyright (c) 2020-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 diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_trinary_minmax.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_trinary_minmax.h index 1b14997d..dd51c5fc 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_trinary_minmax.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/AMD_shader_trinary_minmax.h @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The Khronos Group Inc. +// Copyright (c) 2020-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 diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/DebugInfo.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/DebugInfo.h index 4657556b..a3c0af45 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/DebugInfo.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/DebugInfo.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017-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"), diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/GLSL.std.450.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/GLSL.std.450.h index 54cc00e9..0594f907 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/GLSL.std.450.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/GLSL.std.450.h @@ -1,5 +1,5 @@ /* -** Copyright (c) 2014-2016 The Khronos Group Inc. +** 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"), diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h index 1a315492..b6c27fa9 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The Khronos Group Inc. +// Copyright (c) 2020-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 @@ -33,7 +33,7 @@ extern "C" { #endif enum { - NonSemanticClspvReflectionRevision = 5, + NonSemanticClspvReflectionRevision = 6, NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff }; @@ -78,6 +78,7 @@ enum NonSemanticClspvReflectionInstructions { NonSemanticClspvReflectionPrintfInfo = 38, NonSemanticClspvReflectionPrintfBufferStorageBuffer = 39, NonSemanticClspvReflectionPrintfBufferPointerPushConstant = 40, + NonSemanticClspvReflectionNormalizedSamplerMaskPushConstant = 41, NonSemanticClspvReflectionInstructionsMax = 0x7fffffff }; diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugBreak.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugBreak.h index 6ec2b5bb..8604fe78 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugBreak.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugBreak.h @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The Khronos Group Inc. +// Copyright (c) 2020-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 diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugPrintf.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugPrintf.h index 83796d75..bc24683e 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugPrintf.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugPrintf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The Khronos Group Inc. +// Copyright (c) 2020-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 diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticShaderDebugInfo100.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticShaderDebugInfo100.h index c52f32f8..b276b560 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticShaderDebugInfo100.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticShaderDebugInfo100.h @@ -1,4 +1,4 @@ -// Copyright (c) 2018 The Khronos Group Inc. +// Copyright (c) 2018-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"), diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticVkspReflection.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticVkspReflection.h new file mode 100644 index 00000000..af4a556e --- /dev/null +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticVkspReflection.h @@ -0,0 +1,57 @@ +// Copyright (c) 2020-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. +// + +#ifndef SPIRV_UNIFIED1_NonSemanticVkspReflection_H_ +#define SPIRV_UNIFIED1_NonSemanticVkspReflection_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + NonSemanticVkspReflectionRevision = 4, + NonSemanticVkspReflectionRevision_BitWidthPadding = 0x7fffffff +}; + +enum NonSemanticVkspReflectionInstructions { + NonSemanticVkspReflectionConfiguration = 1, + NonSemanticVkspReflectionStartCounter = 2, + NonSemanticVkspReflectionStopCounter = 3, + NonSemanticVkspReflectionPushConstants = 4, + NonSemanticVkspReflectionSpecializationMapEntry = 5, + NonSemanticVkspReflectionDescriptorSetBuffer = 6, + NonSemanticVkspReflectionDescriptorSetImage = 7, + NonSemanticVkspReflectionDescriptorSetSampler = 8, + NonSemanticVkspReflectionInstructionsMax = 0x7fffffff +}; + + +#ifdef __cplusplus +} +#endif + +#endif // SPIRV_UNIFIED1_NonSemanticVkspReflection_H_ diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/OpenCL.std.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/OpenCL.std.h index 2745e30d..ed74f203 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/OpenCL.std.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/OpenCL.std.h @@ -1,5 +1,5 @@ /* -** Copyright (c) 2015-2019 The Khronos Group Inc. +** Copyright (c) 2015-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"), diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/OpenCLDebugInfo100.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/OpenCLDebugInfo100.h index e3847c90..ffbd16f1 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/OpenCLDebugInfo100.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/OpenCLDebugInfo100.h @@ -1,4 +1,4 @@ -// Copyright (c) 2018 The Khronos Group Inc. +// Copyright (c) 2018-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"), diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.debuginfo.grammar.json b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.debuginfo.grammar.json index 7d6e8e5b..918a9e54 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.debuginfo.grammar.json +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.debuginfo.grammar.json @@ -1,6 +1,6 @@ { "copyright" : [ - "Copyright (c) 2017 The Khronos Group Inc.", + "Copyright (c) 2017-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\"),", diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json index 3d9f39e7..ac8fc6dd 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json @@ -1,6 +1,6 @@ { "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", + "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\"),", diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json index d6499cce..cfccc80b 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json @@ -1,5 +1,5 @@ { - "revision" : 5, + "revision" : 6, "instructions" : [ { "opname" : "Kernel", @@ -395,6 +395,16 @@ { "kind" : "IdRef", "name" : "Size"}, { "kind" : "IdRef", "name" : "BufferSize"} ] + }, + { + "opname" : "NormalizedSamplerMaskPushConstant", + "opcode" : 41, + "operands" : [ + { "kind" : "IdRef", "name" : "Kernel" }, + { "kind" : "IdRef", "name" : "Ordinal" }, + { "kind" : "IdRef", "name" : "Offset" }, + { "kind" : "IdRef", "name" : "Size" } + ] } ], "operand_kinds" : [ diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json index f3621b0b..1eb2859a 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json @@ -1,6 +1,6 @@ { "copyright" : [ - "Copyright (c) 2018 The Khronos Group Inc.", + "Copyright (c) 2018-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\"),", diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json new file mode 100644 index 00000000..0bc12d60 --- /dev/null +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json @@ -0,0 +1,138 @@ +{ + "revision" : 4, + "instructions" : [ + { + "opname" : "Configuration", + "opcode" : 1, + "operands" : [ + {"kind" : "IdRef", "name" : "enabledExtensionNames" }, + {"kind" : "IdRef", "name" : "specializationInfoDataSize" }, + {"kind" : "IdRef", "name" : "specializationInfoData" }, + {"kind" : "IdRef", "name" : "shaderName" }, + {"kind" : "IdRef", "name" : "EntryPoint" }, + {"kind" : "IdRef", "name" : "groupCountX" }, + {"kind" : "IdRef", "name" : "groupCountY" }, + {"kind" : "IdRef", "name" : "groupCountZ" }, + {"kind" : "IdRef", "name" : "dispatchId" } + ] + }, + { + "opname" : "StartCounter", + "opcode" : 2, + "operands" : [ + {"kind" : "IdRef", "name" : "name" } + ] + }, + { + "opname" : "StopCounter", + "opcode" : 3, + "operands" : [ + {"kind" : "IdRef", "name" : "counter" } + ] + }, + { + "opname" : "PushConstants", + "opcode" : 4, + "operands" : [ + { "kind" : "IdRef", "name" : "offset" }, + { "kind" : "IdRef", "name" : "size" }, + { "kind" : "IdRef", "name" : "pValues" }, + { "kind" : "IdRef", "name" : "stageFlags" } + ] + }, + { + "opname" : "SpecializationMapEntry", + "opcode" : 5, + "operands" : [ + {"kind" : "IdRef", "name" : "constantID" }, + {"kind" : "IdRef", "name" : "offset" }, + {"kind" : "IdRef", "name" : "size" } + ] + }, + { + "opname" : "DescriptorSetBuffer", + "opcode" : 6, + "operands" : [ + { "kind" : "IdRef", "name" : "ds" }, + { "kind" : "IdRef", "name" : "binding" }, + { "kind" : "IdRef", "name" : "type" }, + { "kind" : "IdRef", "name" : "flags" }, + { "kind" : "IdRef", "name" : "queueFamilyIndexCount" }, + { "kind" : "IdRef", "name" : "sharingMode" }, + { "kind" : "IdRef", "name" : "size" }, + { "kind" : "IdRef", "name" : "usage" }, + { "kind" : "IdRef", "name" : "range" }, + { "kind" : "IdRef", "name" : "offset" }, + { "kind" : "IdRef", "name" : "memorySize" }, + { "kind" : "IdRef", "name" : "memoryType" }, + { "kind" : "IdRef", "name" : "bindOffset" }, + { "kind" : "IdRef", "name" : "viewFlags" }, + { "kind" : "IdRef", "name" : "viewFormat" } + ] + }, + { + "opname" : "DescriptorSetImage", + "opcode" : 7, + "operands" : [ + { "kind" : "IdRef", "name" : "ds" }, + { "kind" : "IdRef", "name" : "binding" }, + { "kind" : "IdRef", "name" : "type" }, + { "kind" : "IdRef", "name" : "imageLayout"}, + { "kind" : "IdRef", "name" : "imageFlags"}, + { "kind" : "IdRef", "name" : "imageType"}, + { "kind" : "IdRef", "name" : "imageformat"}, + { "kind" : "IdRef", "name" : "width"}, + { "kind" : "IdRef", "name" : "height"}, + { "kind" : "IdRef", "name" : "depth"}, + { "kind" : "IdRef", "name" : "mipLevels"}, + { "kind" : "IdRef", "name" : "arrayLayers"}, + { "kind" : "IdRef", "name" : "samples"}, + { "kind" : "IdRef", "name" : "tiling"}, + { "kind" : "IdRef", "name" : "usage"}, + { "kind" : "IdRef", "name" : "sharingMode"}, + { "kind" : "IdRef", "name" : "queueFamilyIndexCount"}, + { "kind" : "IdRef", "name" : "initialLayout"}, + { "kind" : "IdRef", "name" : "aspectMask"}, + { "kind" : "IdRef", "name" : "baseMipLevel"}, + { "kind" : "IdRef", "name" : "levelCount"}, + { "kind" : "IdRef", "name" : "baseArrayLayer"}, + { "kind" : "IdRef", "name" : "layerCount"}, + { "kind" : "IdRef", "name" : "viewFlags"}, + { "kind" : "IdRef", "name" : "viewType"}, + { "kind" : "IdRef", "name" : "viewFormat"}, + { "kind" : "IdRef", "name" : "component_a"}, + { "kind" : "IdRef", "name" : "component_b"}, + { "kind" : "IdRef", "name" : "component_g"}, + { "kind" : "IdRef", "name" : "component_r"}, + { "kind" : "IdRef", "name" : "memorySize" }, + { "kind" : "IdRef", "name" : "memoryType" }, + { "kind" : "IdRef", "name" : "bindOffset"} + ] + }, + { + "opname" : "DescriptorSetSampler", + "opcode" : 8, + "operands" : [ + { "kind" : "IdRef", "name" : "ds" }, + { "kind" : "IdRef", "name" : "binding" }, + { "kind" : "IdRef", "name" : "type" }, + { "kind" : "IdRef", "name" : "flags"}, + { "kind" : "IdRef", "name" : "magFilter"}, + { "kind" : "IdRef", "name" : "minFilter"}, + { "kind" : "IdRef", "name" : "mipmapMode"}, + { "kind" : "IdRef", "name" : "addressModeU"}, + { "kind" : "IdRef", "name" : "addressModeV"}, + { "kind" : "IdRef", "name" : "addressModeW"}, + { "kind" : "IdRef", "name" : "mipLodBias"}, + { "kind" : "IdRef", "name" : "anisotropyEnable"}, + { "kind" : "IdRef", "name" : "maxAnisotropy"}, + { "kind" : "IdRef", "name" : "compareEnable"}, + { "kind" : "IdRef", "name" : "compareOp"}, + { "kind" : "IdRef", "name" : "minLod"}, + { "kind" : "IdRef", "name" : "maxLod"}, + { "kind" : "IdRef", "name" : "borderColor"}, + { "kind" : "IdRef", "name" : "unnormalizedCoordinates"} + ] + } + ] +} diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json index 699fe403..53b001c5 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json @@ -1,6 +1,6 @@ { "copyright" : [ - "Copyright (c) 2018 The Khronos Group Inc.", + "Copyright (c) 2018-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\"),", diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json index 4fe45060..21b7876b 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json @@ -1,6 +1,6 @@ { "copyright" : [ - "Copyright (c) 2014-2016 The Khronos Group Inc.", + "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\"),", diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json index b6bbc2c3..223958dc 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json @@ -1,6 +1,6 @@ { "copyright" : [ - "Copyright (c) 2014-2020 The Khronos Group Inc.", + "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\"),", @@ -27,7 +27,7 @@ "magic_number" : "0x07230203", "major_version" : 1, "minor_version" : 6, - "revision" : 1, + "revision" : 4, "instruction_printing_class" : [ { "tag" : "@exclude" @@ -330,7 +330,8 @@ "opcode" : 22, "operands" : [ { "kind" : "IdResult" }, - { "kind" : "LiteralInteger", "name" : "'Width'" } + { "kind" : "LiteralInteger", "name" : "'Width'" }, + { "kind" : "FPEncoding", "quantifier" : "?", "name" : "'Floating Point Encoding'" } ], "version": "1.0" }, @@ -753,7 +754,10 @@ { "kind" : "MemoryAccess", "quantifier" : "?" }, { "kind" : "MemoryAccess", "quantifier" : "?" } ], - "capabilities" : [ "Addresses" ], + "capabilities" : [ + "Addresses", + "UntypedPointersKHR" + ], "version": "1.0" }, { @@ -4439,6 +4443,61 @@ "capabilities" : [ "Shader" ], "version" : "1.6" }, + { + "opname" : "OpTypeUntypedPointerKHR", + "class" : "Type-Declaration", + "opcode" : 4417, + "capabilities" : [ + "UntypedPointersKHR" + ], + "version" : "None", + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "StorageClass" } + ] + }, + { + "opname" : "OpUntypedVariableKHR", + "class" : "Memory", + "opcode" : 4418, + "capabilities" : [ "UntypedPointersKHR" ], + "version" : "None", + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "StorageClass" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Data Type'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" } + ] + }, + { + "opname" : "OpUntypedAccessChainKHR", + "class" : "Memory", + "opcode" : 4419, + "capabilities" : [ "UntypedPointersKHR" ], + "version" : "None", + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base Type'" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpUntypedInBoundsAccessChainKHR", + "class" : "Memory", + "opcode" : 4420, + "capabilities" : [ "UntypedPointersKHR" ], + "version" : "None", + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base Type'" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, { "opname" : "OpSubgroupBallotKHR", "class" : "Group", @@ -4465,6 +4524,64 @@ "extensions" : [ "SPV_KHR_shader_ballot" ], "version" : "None" }, + { + "opname" : "OpUntypedPtrAccessChainKHR", + "class" : "Memory", + "opcode" : 4423, + "capabilities" : [ "UntypedPointersKHR" ], + "version" : "None", + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base Type'" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpUntypedInBoundsPtrAccessChainKHR", + "class" : "Memory", + "opcode" : 4424, + "capabilities" : [ "UntypedPointersKHR" ], + "version" : "None", + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base Type'" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Element'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" } + ] + }, + { + "opname" : "OpUntypedArrayLengthKHR", + "class" : "Memory", + "opcode" : 4425, + "capabilities" : [ "UntypedPointersKHR" ], + "version" : "None", + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Structure'" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "LiteralInteger", "name" : "'Array member'" } + ] + }, + { + "opname" : "OpUntypedPrefetchKHR", + "class" : "Memory", + "opcode" : 4426, + "capabilities" : [ "UntypedPointersKHR" ], + "version" : "None", + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer Type'" }, + { "kind" : "IdRef", "name" : "'Num Bytes'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'RW'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Locality'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Cache Type'" } + ] + }, { "opname" : "OpSubgroupAllKHR", "class" : "Group", @@ -4539,6 +4656,20 @@ "extensions" : [ "SPV_KHR_shader_ballot" ], "version" : "None" }, + { + "opname" : "OpExtInstWithForwardRefsKHR", + "class" : "Extension", + "opcode" : 4433, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Set'" }, + { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." } + ], + "extensions" : [ "SPV_KHR_relaxed_extended_instruction" ], + "version": "None" + }, { "opname" : "OpTraceRayKHR", "class" : "Reserved", @@ -4606,6 +4737,7 @@ { "opname" : "OpSDot", "class" : "Arithmetic", + "aliases" : ["OpSDotKHR"], "opcode" : 4450, "operands" : [ { "kind" : "IdResultType" }, @@ -4615,26 +4747,13 @@ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } ], "capabilities" : [ "DotProduct" ], - "version" : "1.6" - }, - { - "opname" : "OpSDotKHR", - "class" : "Arithmetic", - "opcode" : 4450, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" }, { "opname" : "OpUDot", "class" : "Arithmetic", + "aliases" : ["OpUDotKHR"], "opcode" : 4451, "operands" : [ { "kind" : "IdResultType" }, @@ -4644,26 +4763,13 @@ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } ], "capabilities" : [ "DotProduct" ], - "version" : "1.6" - }, - { - "opname" : "OpUDotKHR", - "class" : "Arithmetic", - "opcode" : 4451, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" }, { "opname" : "OpSUDot", "class" : "Arithmetic", + "aliases" : ["OpSUDotKHR"], "opcode" : 4452, "operands" : [ { "kind" : "IdResultType" }, @@ -4673,26 +4779,13 @@ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } ], "capabilities" : [ "DotProduct" ], - "version" : "1.6" - }, - { - "opname" : "OpSUDotKHR", - "class" : "Arithmetic", - "opcode" : 4452, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" }, { "opname" : "OpSDotAccSat", "class" : "Arithmetic", + "aliases" : ["OpSDotAccSatKHR"], "opcode" : 4453, "operands" : [ { "kind" : "IdResultType" }, @@ -4703,27 +4796,13 @@ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } ], "capabilities" : [ "DotProduct" ], - "version" : "1.6" - }, - { - "opname" : "OpSDotAccSatKHR", - "class" : "Arithmetic", - "opcode" : 4453, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "IdRef", "name" : "'Accumulator'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" }, { "opname" : "OpUDotAccSat", "class" : "Arithmetic", + "aliases" : ["OpUDotAccSatKHR"], "opcode" : 4454, "operands" : [ { "kind" : "IdResultType" }, @@ -4734,27 +4813,13 @@ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } ], "capabilities" : [ "DotProduct" ], - "version" : "1.6" - }, - { - "opname" : "OpUDotAccSatKHR", - "class" : "Arithmetic", - "opcode" : 4454, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "IdRef", "name" : "'Accumulator'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" }, { "opname" : "OpSUDotAccSat", "class" : "Arithmetic", + "aliases" : ["OpSUDotAccSatKHR"], "opcode" : 4455, "operands" : [ { "kind" : "IdResultType" }, @@ -4765,21 +4830,6 @@ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } ], "capabilities" : [ "DotProduct" ], - "version" : "1.6" - }, - { - "opname" : "OpSUDotAccSatKHR", - "class" : "Arithmetic", - "opcode" : 4455, - "operands" : [ - { "kind" : "IdResultType" }, - { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Vector 1'" }, - { "kind" : "IdRef", "name" : "'Vector 2'" }, - { "kind" : "IdRef", "name" : "'Accumulator'" }, - { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" } - ], - "capabilities" : [ "DotProductKHR" ], "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" }, @@ -4854,9 +4904,45 @@ "capabilities" : [ "CooperativeMatrixKHR" ], "version" : "None" }, + { + "opname" : "OpConstantCompositeReplicateEXT", + "class" : "Constant-Creation", + "opcode" : 4461, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "ReplicatedCompositesEXT" ], + "version" : "None" + }, + { + "opname" : "OpSpecConstantCompositeReplicateEXT", + "class" : "Constant-Creation", + "opcode" : 4462, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "ReplicatedCompositesEXT" ], + "version" : "None" + }, + { + "opname" : "OpCompositeConstructReplicateEXT", + "class" : "Composite", + "opcode" : 4463, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "ReplicatedCompositesEXT" ], + "version" : "None" + }, { "opname" : "OpTypeRayQueryKHR", - "class" : "Reserved", + "class" : "Type-Declaration", "opcode" : 4472, "operands" : [ { "kind" : "IdResult" } @@ -5050,6 +5136,70 @@ "capabilities" : [ "TextureBlockMatchQCOM" ], "version" : "None" }, + { + "opname" : "OpImageBlockMatchWindowSSDQCOM", + "class" : "Image", + "opcode" : 4500, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Target Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Target Coordinates'" }, + { "kind" : "IdRef", "name" : "'Reference Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Reference Coordinates'" }, + { "kind" : "IdRef", "name" : "'Block Size'" } + ], + "capabilities" : [ "TextureBlockMatch2QCOM" ], + "version" : "None" + }, + { + "opname" : "OpImageBlockMatchWindowSADQCOM", + "class" : "Image", + "opcode" : 4501, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Target Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Target Coordinates'" }, + { "kind" : "IdRef", "name" : "'Reference Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Reference Coordinates'" }, + { "kind" : "IdRef", "name" : "'Block Size'" } + ], + "capabilities" : [ "TextureBlockMatch2QCOM" ], + "version" : "None" + }, + { + "opname" : "OpImageBlockMatchGatherSSDQCOM", + "class" : "Image", + "opcode" : 4502, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Target Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Target Coordinates'" }, + { "kind" : "IdRef", "name" : "'Reference Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Reference Coordinates'" }, + { "kind" : "IdRef", "name" : "'Block Size'" } + ], + "capabilities" : [ "TextureBlockMatch2QCOM" ], + "version" : "None" + }, + { + "opname" : "OpImageBlockMatchGatherSADQCOM", + "class" : "Image", + "opcode" : 4503, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Target Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Target Coordinates'" }, + { "kind" : "IdRef", "name" : "'Reference Sampled Image'" }, + { "kind" : "IdRef", "name" : "'Reference Coordinates'" }, + { "kind" : "IdRef", "name" : "'Block Size'" } + ], + "capabilities" : [ "TextureBlockMatch2QCOM" ], + "version" : "None" + }, { "opname" : "OpGroupIAddNonUniformAMD", "class" : "Group", @@ -5212,7 +5362,21 @@ "version" : "None" }, { - "opname" : "OpFinalizeNodePayloadsAMDX", + "opname" : "OpAllocateNodePayloadsAMDX", + "class" : "Reserved", + "opcode" : 5074, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdScope", "name" : "'Visibility'" }, + { "kind" : "IdRef", "name": "'Payload Count'" }, + { "kind" : "IdRef", "name": "'Node Index'" } + ], + "capabilities" : [ "ShaderEnqueueAMDX" ], + "version" : "None" + }, + { + "opname" : "OpEnqueueNodePayloadsAMDX", "class" : "Reserved", "opcode" : 5075, "operands" : [ @@ -5221,6 +5385,17 @@ "capabilities" : [ "ShaderEnqueueAMDX" ], "version" : "None" }, + { + "opname" : "OpTypeNodePayloadArrayAMDX", + "class" : "Reserved", + "opcode" : 5076, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name": "'Payload Type'" } + ], + "capabilities" : [ "ShaderEnqueueAMDX" ], + "version" : "None" + }, { "opname" : "OpFinishWritingNodePayloadAMDX", "class" : "Reserved", @@ -5234,28 +5409,86 @@ "version" : "None" }, { - "opname" : "OpInitializeNodePayloadsAMDX", + "opname" : "OpNodePayloadArrayLengthAMDX", "class" : "Reserved", "opcode" : 5090, "operands" : [ - { "kind" : "IdRef", "name": "'Payload Array'" }, - { "kind" : "IdScope", "name": "'Visibility'" }, - { "kind" : "IdRef", "name": "'Payload Count'" }, - { "kind" : "IdRef", "name": "'Node Index'" } + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name": "'Payload Array'" } ], "capabilities" : [ "ShaderEnqueueAMDX" ], "version" : "None" }, { - "opname" : "OpHitObjectRecordHitMotionNV", + "opname" : "OpIsNodePayloadValidAMDX", "class" : "Reserved", - "opcode" : 5249, + "opcode" : 5101, "operands" : [ - { "kind" : "IdRef", "name" : "'Hit Object'" }, - { "kind" : "IdRef", "name" : "'Acceleration Structure'" }, - { "kind" : "IdRef", "name" : "'InstanceId'" }, - { "kind" : "IdRef", "name" : "'PrimitiveId'" }, - { "kind" : "IdRef", "name" : "'GeometryIndex'" }, + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name": "'Payload Type'" }, + { "kind" : "IdRef", "name": "'Node Index'" } + ], + "capabilities" : [ "ShaderEnqueueAMDX" ], + "version": "None" + }, + { + "opname" : "OpConstantStringAMDX", + "class" : "Reserved", + "opcode" : 5103, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name": "'Literal String'" } + ], + "capabilities" : [ "ShaderEnqueueAMDX" ], + "version": "None" + }, + { + "opname" : "OpSpecConstantStringAMDX", + "class" : "Reserved", + "opcode" : 5104, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "LiteralString", "name": "'Literal String'" } + ], + "capabilities" : [ "ShaderEnqueueAMDX" ], + "version": "None" + }, + { + "opname" : "OpGroupNonUniformQuadAllKHR", + "class" : "Non-Uniform", + "opcode" : 5110, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "QuadControlKHR" ], + "version" : "None" + }, + { + "opname" : "OpGroupNonUniformQuadAnyKHR", + "class" : "Non-Uniform", + "opcode" : 5111, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Predicate'" } + ], + "capabilities" : [ "QuadControlKHR" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectRecordHitMotionNV", + "class" : "Reserved", + "opcode" : 5249, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'Acceleration Structure'" }, + { "kind" : "IdRef", "name" : "'InstanceId'" }, + { "kind" : "IdRef", "name" : "'PrimitiveId'" }, + { "kind" : "IdRef", "name" : "'GeometryIndex'" }, { "kind" : "IdRef", "name" : "'Hit Kind'" }, { "kind" : "IdRef", "name" : "'SBT Record Offset'" }, { "kind" : "IdRef", "name" : "'SBT Record Stride'" }, @@ -5693,7 +5926,7 @@ }, { "opname" : "OpTypeHitObjectNV", - "class" : "Reserved", + "class" : "Type-Declaration", "opcode" : 5281, "operands" : [ { "kind" : "IdResult" } @@ -5768,22 +6001,41 @@ "version" : "None" }, { - "opname" : "OpReportIntersectionNV", + "opname" : "OpFetchMicroTriangleVertexPositionNV", "class" : "Reserved", - "opcode" : 5334, + "opcode" : 5300, "operands" : [ { "kind" : "IdResultType" }, { "kind" : "IdResult" }, - { "kind" : "IdRef", "name" : "'Hit'" }, - { "kind" : "IdRef", "name" : "'HitKind'" } + { "kind" : "IdRef", "name" : "'Accel'" }, + { "kind" : "IdRef", "name" : "'Instance Id'" }, + { "kind" : "IdRef", "name" : "'Geometry Index'" }, + { "kind" : "IdRef", "name" : "'Primitive Index'" }, + { "kind" : "IdRef", "name" : "'Barycentric'" } ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], + "capabilities" : [ "DisplacementMicromapNV" ], + "version" : "None" + }, + { + "opname" : "OpFetchMicroTriangleVertexBarycentricNV", + "class" : "Reserved", + "opcode" : 5301, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Accel'" }, + { "kind" : "IdRef", "name" : "'Instance Id'" }, + { "kind" : "IdRef", "name" : "'Geometry Index'" }, + { "kind" : "IdRef", "name" : "'Primitive Index'" }, + { "kind" : "IdRef", "name" : "'Barycentric'" } + ], + "capabilities" : [ "DisplacementMicromapNV" ], "version" : "None" }, { "opname" : "OpReportIntersectionKHR", "class" : "Reserved", + "aliases" : ["OpReportIntersectionNV"], "opcode" : 5334, "operands" : [ { "kind" : "IdResultType" }, @@ -5898,20 +6150,10 @@ "capabilities" : [ "RayQueryPositionFetchKHR" ], "version" : "None" }, - { - "opname" : "OpTypeAccelerationStructureNV", - "class" : "Reserved", - "opcode" : 5341, - "operands" : [ - { "kind" : "IdResult" } - ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR", "RayQueryKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing", "SPV_KHR_ray_query" ], - "version" : "None" - }, { "opname" : "OpTypeAccelerationStructureKHR", - "class" : "Reserved", + "class" : "Type-Declaration", + "aliases" : ["OpTypeAccelerationStructureNV"], "opcode" : 5341, "operands" : [ { "kind" : "IdResult" } @@ -5935,7 +6177,7 @@ }, { "opname" : "OpTypeCooperativeMatrixNV", - "class" : "Reserved", + "class" : "Type-Declaration", "opcode" : 5358, "operands" : [ { "kind" : "IdResult" }, @@ -6026,17 +6268,11 @@ { "opname" : "OpDemoteToHelperInvocation", "class" : "Control-Flow", + "aliases" : ["OpDemoteToHelperInvocationEXT"], "opcode" : 5380, "capabilities" : [ "DemoteToHelperInvocation" ], "version" : "1.6" }, - { - "opname" : "OpDemoteToHelperInvocationEXT", - "class" : "Control-Flow", - "opcode" : 5380, - "capabilities" : [ "DemoteToHelperInvocationEXT" ], - "version" : "1.6" - }, { "opname" : "OpIsHelperInvocationEXT", "class" : "Reserved", @@ -6045,7 +6281,7 @@ { "kind" : "IdResultType" }, { "kind" : "IdResult" } ], - "capabilities" : [ "DemoteToHelperInvocationEXT" ], + "capabilities" : [ "DemoteToHelperInvocation" ], "extensions" : [ "SPV_EXT_demote_to_helper_invocation" ], "version" : "None" }, @@ -6131,6 +6367,24 @@ "capabilities" : [ "BindlessTextureNV" ], "version" : "None" }, + { + "opname" : "OpRawAccessChainNV", + "class" : "Memory", + "opcode" : 5398, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Base'" }, + { "kind" : "IdRef", "name" : "'Byte stride'" }, + { "kind" : "IdRef", "name" : "'Element index'" }, + { "kind" : "IdRef", "name" : "'Byte offset'" }, + { "kind" : "RawAccessChainOperands", "quantifier" : "?" } + ], + "capabilities" : [ + "RawAccessChainsNV" + ], + "version" : "None" + }, { "opname" : "OpSubgroupShuffleINTEL", "class" : "Group", @@ -6520,7 +6774,7 @@ { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, { "kind" : "IdRef", "name" : "'Value'" } ], - "capabilities" : [ "AtomicFloat16MinMaxEXT", "AtomicFloat32MinMaxEXT", "AtomicFloat64MinMaxEXT" ], + "capabilities" : [ "AtomicFloat16MinMaxEXT", "AtomicFloat32MinMaxEXT", "AtomicFloat64MinMaxEXT", "AtomicFloat16VectorNV" ], "version" : "None" }, { @@ -6535,7 +6789,7 @@ { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, { "kind" : "IdRef", "name" : "'Value'" } ], - "capabilities" : [ "AtomicFloat16MinMaxEXT", "AtomicFloat32MinMaxEXT", "AtomicFloat64MinMaxEXT" ], + "capabilities" : [ "AtomicFloat16MinMaxEXT", "AtomicFloat32MinMaxEXT", "AtomicFloat64MinMaxEXT", "AtomicFloat16VectorNV" ], "version" : "None" }, { @@ -6566,17 +6820,7 @@ { "opname" : "OpDecorateString", "class" : "Annotation", - "opcode" : 5632, - "operands" : [ - { "kind" : "IdRef", "name" : "'Target'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "1.4" - }, - { - "opname" : "OpDecorateStringGOOGLE", - "class" : "Annotation", + "aliases" : ["OpDecorateStringGOOGLE"], "opcode" : 5632, "operands" : [ { "kind" : "IdRef", "name" : "'Target'" }, @@ -6588,18 +6832,7 @@ { "opname" : "OpMemberDecorateString", "class" : "Annotation", - "opcode" : 5633, - "operands" : [ - { "kind" : "IdRef", "name" : "'Struct Type'" }, - { "kind" : "LiteralInteger", "name" : "'Member'" }, - { "kind" : "Decoration" } - ], - "extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "1.4" - }, - { - "opname" : "OpMemberDecorateStringGOOGLE", - "class" : "Annotation", + "aliases" : ["OpMemberDecorateStringGOOGLE"], "opcode" : 5633, "operands" : [ { "kind" : "IdRef", "name" : "'Struct Type'" }, @@ -9507,7 +9740,7 @@ { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }, { "kind" : "IdRef", "name" : "'Value'" } ], - "capabilities" : [ "AtomicFloat16AddEXT", "AtomicFloat32AddEXT", "AtomicFloat64AddEXT" ], + "capabilities" : [ "AtomicFloat16AddEXT", "AtomicFloat32AddEXT", "AtomicFloat64AddEXT", "AtomicFloat16VectorNV" ], "extensions" : [ "SPV_EXT_shader_atomic_float_add" ], "version" : "None" }, @@ -9532,7 +9765,7 @@ "operands" : [ { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." } ], - "capabilities" : [ "LongConstantCompositeINTEL" ], + "capabilities" : [ "LongCompositesINTEL" ], "version" : "None" }, { @@ -9542,7 +9775,7 @@ "operands" : [ { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } ], - "capabilities" : [ "LongConstantCompositeINTEL" ], + "capabilities" : [ "LongCompositesINTEL" ], "version" : "None" }, { @@ -9552,9 +9785,21 @@ "operands" : [ { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } ], - "capabilities" : [ "LongConstantCompositeINTEL" ], + "capabilities" : [ "LongCompositesINTEL" ], "version" : "None" }, + { + "opname" : "OpCompositeConstructContinuedINTEL", + "class" : "Composite", + "opcode" : 6096, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" } + ], + "capabilities" : [ "LongCompositesINTEL" ], + "version": "None" + }, { "opname" : "OpConvertFToBF16INTEL", "class" : "Conversion", @@ -9603,6 +9848,30 @@ "capabilities" : [ "SplitBarrierINTEL" ], "version" : "None" }, + { + "opname" : "OpArithmeticFenceEXT", + "class" : "Miscellaneous", + "opcode" : 6145, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Target '" } + ], + "capabilities" : [ "ArithmeticFenceEXT" ], + "version" : "None" + }, + { + "opname" : "OpSubgroupBlockPrefetchINTEL", + "class" : "Group", + "opcode" : 6221, + "operands" : [ + { "kind" : "IdRef", "name" : "'Ptr'" }, + { "kind" : "IdRef", "name" : "'NumBytes'" }, + { "kind" : "MemoryAccess", "quantifier" : "?" } + ], + "capabilities" : [ "SubgroupBufferPrefetchINTEL" ], + "version" : "None" + }, { "opname" : "OpGroupIMulKHR", "class" : "Group", @@ -9714,6 +9983,34 @@ ], "capabilities" : [ "GroupUniformArithmeticKHR" ], "version" : "None" + }, + { + "opname" : "OpMaskedGatherINTEL", + "class" : "Memory", + "opcode" : 6428, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'PtrVector'" }, + { "kind" : "LiteralInteger", "name" : "'Alignment'" }, + { "kind" : "IdRef", "name" : "'Mask'" }, + { "kind" : "IdRef", "name" : "'FillEmpty'" } + ], + "capabilities" : [ "MaskedGatherScatterINTEL" ], + "version" : "None" + }, + { + "opname" : "OpMaskedScatterINTEL", + "class" : "Memory", + "opcode" : 6429, + "operands" : [ + { "kind" : "IdRef", "name" : "'InputVector'" }, + { "kind" : "IdRef", "name" : "'PtrVector'" }, + { "kind" : "LiteralInteger", "name" : "'Alignment'" }, + { "kind" : "IdRef", "name" : "'Mask'" } + ], + "capabilities" : [ "MaskedGatherScatterINTEL" ], + "version" : "None" } ], "operand_kinds" : [ @@ -9796,15 +10093,7 @@ }, { "enumerant" : "MakeTexelAvailable", - "value" : "0x0100", - "capabilities" : [ "VulkanMemoryModel" ], - "parameters" : [ - { "kind" : "IdScope" } - ], - "version" : "1.5" - }, - { - "enumerant" : "MakeTexelAvailableKHR", + "aliases" : [ "MakeTexelAvailableKHR" ], "value" : "0x0100", "capabilities" : [ "VulkanMemoryModel" ], "parameters" : [ @@ -9815,15 +10104,7 @@ }, { "enumerant" : "MakeTexelVisible", - "value" : "0x0200", - "capabilities" : [ "VulkanMemoryModel" ], - "parameters" : [ - { "kind" : "IdScope" } - ], - "version" : "1.5" - }, - { - "enumerant" : "MakeTexelVisibleKHR", + "aliases" : [ "MakeTexelVisibleKHR" ], "value" : "0x0200", "capabilities" : [ "VulkanMemoryModel" ], "parameters" : [ @@ -9834,12 +10115,7 @@ }, { "enumerant" : "NonPrivateTexel", - "value" : "0x0400", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "NonPrivateTexelKHR", + "aliases" : [ "NonPrivateTexelKHR" ], "value" : "0x0400", "capabilities" : [ "VulkanMemoryModel" ], "extensions" : [ "SPV_KHR_vulkan_memory_model" ], @@ -9847,12 +10123,7 @@ }, { "enumerant" : "VolatileTexel", - "value" : "0x0800", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "VolatileTexelKHR", + "aliases" : [ "VolatileTexelKHR" ], "value" : "0x0800", "capabilities" : [ "VulkanMemoryModel" ], "extensions" : [ "SPV_KHR_vulkan_memory_model" ], @@ -9890,43 +10161,51 @@ { "enumerant" : "None", "value" : "0x0000", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "NotNaN", "value" : "0x0001", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "NotInf", "value" : "0x0002", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "NSZ", "value" : "0x0004", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "AllowRecip", "value" : "0x0008", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Fast", "value" : "0x0010", - "version" : "1.0" + "version" : "1.0" }, { - "enumerant" : "AllowContractFastINTEL", + "enumerant" : "AllowContract", + "aliases" : ["AllowContractFastINTEL"], "value" : "0x10000", - "capabilities" : [ "FPFastMathModeINTEL" ], + "capabilities" : [ "FloatControls2", "FPFastMathModeINTEL" ], "version" : "None" }, { - "enumerant" : "AllowReassocINTEL", + "enumerant" : "AllowReassoc", + "aliases" : ["AllowReassocINTEL"], "value" : "0x20000", - "capabilities" : [ "FPFastMathModeINTEL" ], + "capabilities" : [ "FloatControls2", "FPFastMathModeINTEL" ], + "version" : "None" + }, + { + "enumerant" : "AllowTransform", + "value" : "0x40000", + "capabilities" : [ "FloatControls2" ], "version" : "None" } ] @@ -9938,17 +10217,17 @@ { "enumerant" : "None", "value" : "0x0000", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Flatten", "value" : "0x0001", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "DontFlatten", "value" : "0x0002", - "version" : "1.0" + "version" : "1.0" } ] }, @@ -9959,17 +10238,17 @@ { "enumerant" : "None", "value" : "0x0000", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Unroll", "value" : "0x0001", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "DontUnroll", "value" : "0x0002", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "DependencyInfinite", @@ -10120,32 +10399,33 @@ { "enumerant" : "None", "value" : "0x0000", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Inline", "value" : "0x0001", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "DontInline", "value" : "0x0002", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Pure", "value" : "0x0004", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Const", "value" : "0x0008", - "version" : "1.0" + "version" : "1.0" }, { - "enumerant" : "OptNoneINTEL", + "enumerant" : "OptNoneEXT", + "aliases" : ["OptNoneINTEL"], "value" : "0x10000", - "capabilities" : [ "OptNoneINTEL" ], + "capabilities" : [ "OptNoneEXT" ], "version" : "None" } ] @@ -10156,33 +10436,29 @@ "enumerants" : [ { "enumerant" : "Relaxed", + "aliases" : ["None"], "value" : "0x0000", - "version" : "1.0" - }, - { - "enumerant" : "None", - "value" : "0x0000", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Acquire", "value" : "0x0002", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Release", "value" : "0x0004", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "AcquireRelease", "value" : "0x0008", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "SequentiallyConsistent", "value" : "0x0010", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "UniformMemory", @@ -10193,17 +10469,17 @@ { "enumerant" : "SubgroupMemory", "value" : "0x0080", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "WorkgroupMemory", "value" : "0x0100", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "CrossWorkgroupMemory", "value" : "0x0200", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "AtomicCounterMemory", @@ -10214,16 +10490,11 @@ { "enumerant" : "ImageMemory", "value" : "0x0800", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "OutputMemory", - "value" : "0x1000", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "OutputMemoryKHR", + "aliases" : ["OutputMemoryKHR"], "value" : "0x1000", "capabilities" : [ "VulkanMemoryModel" ], "extensions" : [ "SPV_KHR_vulkan_memory_model" ], @@ -10231,12 +10502,7 @@ }, { "enumerant" : "MakeAvailable", - "value" : "0x2000", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "MakeAvailableKHR", + "aliases" : ["MakeAvailableKHR"], "value" : "0x2000", "capabilities" : [ "VulkanMemoryModel" ], "extensions" : [ "SPV_KHR_vulkan_memory_model" ], @@ -10244,12 +10510,7 @@ }, { "enumerant" : "MakeVisible", - "value" : "0x4000", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "MakeVisibleKHR", + "aliases" : ["MakeVisibleKHR"], "value" : "0x4000", "capabilities" : [ "VulkanMemoryModel" ], "extensions" : [ "SPV_KHR_vulkan_memory_model" ], @@ -10271,12 +10532,12 @@ { "enumerant" : "None", "value" : "0x0000", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Volatile", "value" : "0x0001", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Aligned", @@ -10284,24 +10545,16 @@ "parameters" : [ { "kind" : "LiteralInteger" } ], - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Nontemporal", "value" : "0x0004", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "MakePointerAvailable", - "value" : "0x0008", - "parameters" : [ - { "kind" : "IdScope" } - ], - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "MakePointerAvailableKHR", + "aliases" : ["MakePointerAvailableKHR"], "value" : "0x0008", "parameters" : [ { "kind" : "IdScope" } @@ -10312,15 +10565,7 @@ }, { "enumerant" : "MakePointerVisible", - "value" : "0x0010", - "parameters" : [ - { "kind" : "IdScope" } - ], - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "MakePointerVisibleKHR", + "aliases" : ["MakePointerVisibleKHR"], "value" : "0x0010", "parameters" : [ { "kind" : "IdScope" } @@ -10331,12 +10576,7 @@ }, { "enumerant" : "NonPrivatePointer", - "value" : "0x0020", - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "NonPrivatePointerKHR", + "aliases" : ["NonPrivatePointerKHR"], "value" : "0x0020", "capabilities" : [ "VulkanMemoryModel" ], "extensions" : [ "SPV_KHR_vulkan_memory_model" ], @@ -10371,7 +10611,7 @@ { "enumerant" : "None", "value" : "0x0000", - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "CmdExecTime", @@ -10489,6 +10729,28 @@ } ] }, + { + "category" : "BitEnum", + "kind" : "RawAccessChainOperands", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000" + }, + { + "enumerant" : "RobustnessPerComponentNV", + "value" : "0x0001", + "capabilities" : [ "RawAccessChainsNV" ], + "version" : "None" + }, + { + "enumerant" : "RobustnessPerElementNV", + "value" : "0x0002", + "capabilities" : [ "RawAccessChainsNV" ], + "version" : "None" + } + ] + }, { "category" : "ValueEnum", "kind" : "SourceLanguage", @@ -10496,57 +10758,67 @@ { "enumerant" : "Unknown", "value" : 0, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "ESSL", "value" : 1, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "GLSL", "value" : 2, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "OpenCL_C", "value" : 3, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "OpenCL_CPP", "value" : 4, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "HLSL", "value" : 5, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "CPP_for_OpenCL", "value" : 6, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "SYCL", "value" : 7, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "HERO_C", "value" : 8, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "NZSL", "value" : 9, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "WGSL", "value" : 10, - "version" : "1.0" + "version" : "1.0" + }, + { + "enumerant" : "Slang", + "value" : 11, + "version" : "1.0" + }, + { + "enumerant" : "Zig", + "value" : 12, + "version" : "1.0" } ] }, @@ -10609,73 +10881,43 @@ "version" : "None" }, { - "enumerant" : "RayGenerationNV", + "enumerant" : "RayGenerationKHR", + "aliases" : ["RayGenerationNV"], "value" : 5313, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, { - "enumerant" : "RayGenerationKHR", - "value" : 5313, + "enumerant" : "IntersectionKHR", + "aliases" : ["IntersectionNV"], + "value" : 5314, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, { - "enumerant" : "IntersectionNV", - "value" : 5314, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "IntersectionKHR", - "value" : 5314, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "AnyHitNV", - "value" : 5315, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "AnyHitKHR", - "value" : 5315, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, - { - "enumerant" : "ClosestHitNV", - "value" : 5316, + "enumerant" : "AnyHitKHR", + "aliases" : ["AnyHitNV"], + "value" : 5315, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, { "enumerant" : "ClosestHitKHR", + "aliases" : ["ClosestHitNV"], "value" : 5316, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, - { - "enumerant" : "MissNV", - "value" : 5317, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, { "enumerant" : "MissKHR", + "aliases" : ["MissNV"], "value" : 5317, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, - { - "enumerant" : "CallableNV", - "value" : 5318, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, { "enumerant" : "CallableKHR", + "aliases" : ["CallableNV"], "value" : 5318, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" @@ -10701,7 +10943,7 @@ { "enumerant" : "Logical", "value" : 0, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Physical32", @@ -10717,17 +10959,11 @@ }, { "enumerant" : "PhysicalStorageBuffer64", + "aliases" : ["PhysicalStorageBuffer64EXT"], "value" : 5348, "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], "capabilities" : [ "PhysicalStorageBufferAddresses" ], "version" : "1.5" - }, - { - "enumerant" : "PhysicalStorageBuffer64EXT", - "value" : 5348, - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "version" : "1.5" } ] }, @@ -10755,12 +10991,7 @@ }, { "enumerant" : "Vulkan", - "value" : 3, - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "VulkanKHR", + "aliases" : ["VulkanKHR"], "value" : 3, "capabilities" : [ "VulkanMemoryModel" ], "extensions" : [ "SPV_KHR_vulkan_memory_model" ], @@ -11138,6 +11369,15 @@ "capabilities" : [ "ShaderEnqueueAMDX" ], "version" : "None" }, + { + "enumerant" : "IsApiEntryAMDX", + "value" : 5070, + "capabilities" : [ "ShaderEnqueueAMDX" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Is Entry'" } + ], + "version" : "None" + }, { "enumerant" : "MaxNodeRecursionAMDX", "value" : 5071, @@ -11221,31 +11461,38 @@ "version": "None" }, { - "enumerant" : "OutputLinesNV", - "value" : 5269, - "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ], - "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ], - "version" : "None" + "enumerant": "QuadDerivativesKHR", + "value": 5088, + "capabilities": [ "QuadControlKHR" ], + "version": "None" }, { - "enumerant" : "OutputLinesEXT", - "value" : 5269, - "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ], - "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ], + "enumerant" : "RequireFullQuadsKHR", + "value" : 5089, + "capabilities" : [ "QuadControlKHR" ], "version" : "None" }, { - "enumerant" : "OutputPrimitivesNV", - "value" : 5270, - "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ], + "enumerant" : "SharesInputWithAMDX", + "value" : 5102, + "capabilities" : [ "ShaderEnqueueAMDX" ], "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Primitive count'" } + { "kind" : "IdRef", "name" : "'Node Name'" }, + { "kind" : "IdRef", "name" : "'Shader Index'" } ], + "version" : "None" + }, + { + "enumerant" : "OutputLinesEXT", + "aliases" : ["OutputLinesNV"], + "value" : 5269, + "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ], "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ], "version" : "None" }, { "enumerant" : "OutputPrimitivesEXT", + "aliases" : ["OutputPrimitivesNV"], "value" : 5270, "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ], "parameters" : [ @@ -11255,28 +11502,24 @@ "version" : "None" }, { - "enumerant" : "DerivativeGroupQuadsNV", + "enumerant" : "DerivativeGroupQuadsKHR", + "aliases" : ["DerivativeGroupQuadsNV"], "value" : 5289, - "capabilities" : [ "ComputeDerivativeGroupQuadsNV" ], - "extensions" : [ "SPV_NV_compute_shader_derivatives" ], + "capabilities" : [ "ComputeDerivativeGroupQuadsNV", "ComputeDerivativeGroupQuadsKHR" ], + "extensions" : [ "SPV_NV_compute_shader_derivatives", "SPV_KHR_compute_shader_derivatives" ], "version" : "None" }, { - "enumerant" : "DerivativeGroupLinearNV", + "enumerant" : "DerivativeGroupLinearKHR", + "aliases" : ["DerivativeGroupLinearNV"], "value" : 5290, - "capabilities" : [ "ComputeDerivativeGroupLinearNV" ], - "extensions" : [ "SPV_NV_compute_shader_derivatives" ], - "version" : "None" - }, - { - "enumerant" : "OutputTrianglesNV", - "value" : 5298, - "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ], - "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ], + "capabilities" : [ "ComputeDerivativeGroupLinearNV", "ComputeDerivativeGroupLinearKHR" ], + "extensions" : [ "SPV_NV_compute_shader_derivatives", "SPV_KHR_compute_shader_derivatives" ], "version" : "None" }, { "enumerant" : "OutputTrianglesEXT", + "aliases" : ["OutputTrianglesNV"], "value" : 5298, "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ], "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ], @@ -11418,6 +11661,23 @@ "version" : "None" }, { + "enumerant" : "MaximallyReconvergesKHR", + "value" : 6023, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_maximal_reconvergence" ], + "version" : "None" + }, + { + "enumerant" : "FPFastMathDefault", + "value" : 6028, + "parameters" : [ + { "kind" : "IdRef", "name" : "'Target Type'" }, + { "kind" : "IdRef", "name" : "'Fast-Math Mode'" } + ], + "capabilities" : [ "FloatControls2" ], + "version" : "None" + }, + { "enumerant" : "StreamingInterfaceINTEL", "value" : 6154, "parameters" : [ @@ -11443,6 +11703,33 @@ ], "capabilities" : [ "VectorComputeINTEL" ], "version" : "None" + }, + { + "enumerant" : "MaximumRegistersINTEL", + "value" : 6461, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Number of Registers'" } + ], + "capabilities" : [ "RegisterLimitsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "MaximumRegistersIdINTEL", + "value" : 6462, + "parameters" : [ + { "kind" : "IdRef", "name" : "'Number of Registers'" } + ], + "capabilities" : [ "RegisterLimitsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "NamedMaximumRegistersINTEL", + "value" : 6463, + "parameters" : [ + { "kind" : "NamedMaximumNumberOfRegisters", "name" : "'Named Maximum Number of Registers'" } + ], + "capabilities" : [ "RegisterLimitsINTEL" ], + "version" : "None" } ] }, @@ -11453,12 +11740,12 @@ { "enumerant" : "UniformConstant", "value" : 0, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Input", "value" : 1, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Uniform", @@ -11475,12 +11762,12 @@ { "enumerant" : "Workgroup", "value" : 4, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "CrossWorkgroup", "value" : 5, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Private", @@ -11491,7 +11778,7 @@ { "enumerant" : "Function", "value" : 7, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Generic", @@ -11514,7 +11801,7 @@ { "enumerant" : "Image", "value" : 11, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "StorageBuffer", @@ -11538,91 +11825,49 @@ "capabilities" : [ "ShaderEnqueueAMDX" ], "version" : "None" }, - { - "enumerant" : "NodeOutputPayloadAMDX", - "value" : 5076, - "capabilities" : [ "ShaderEnqueueAMDX" ], - "version" : "None" - }, - { - "enumerant" : "CallableDataNV", - "value" : 5328, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, { "enumerant" : "CallableDataKHR", + "aliases" : ["CallableDataNV"], "value" : 5328, "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, - { - "enumerant" : "IncomingCallableDataNV", - "value" : 5329, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, { "enumerant" : "IncomingCallableDataKHR", + "aliases" : ["IncomingCallableDataNV"], "value" : 5329, "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, - { - "enumerant" : "RayPayloadNV", - "value" : 5338, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, { "enumerant" : "RayPayloadKHR", + "aliases" : ["RayPayloadNV"], "value" : 5338, "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, - { - "enumerant" : "HitAttributeNV", - "value" : 5339, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, { "enumerant" : "HitAttributeKHR", + "aliases" : ["HitAttributeNV"], "value" : 5339, "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, - { - "enumerant" : "IncomingRayPayloadNV", - "value" : 5342, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, { "enumerant" : "IncomingRayPayloadKHR", + "aliases" : ["IncomingRayPayloadNV"], "value" : 5342, "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "version" : "None" }, - { - "enumerant" : "ShaderRecordBufferNV", - "value" : 5343, - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "version" : "None" - }, { "enumerant" : "ShaderRecordBufferKHR", + "aliases" : ["ShaderRecordBufferNV"], "value" : 5343, "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], @@ -11630,18 +11875,12 @@ }, { "enumerant" : "PhysicalStorageBuffer", + "aliases" : ["PhysicalStorageBufferEXT"], "value" : 5349, "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], "capabilities" : [ "PhysicalStorageBufferAddresses" ], "version" : "1.5" }, - { - "enumerant" : "PhysicalStorageBufferEXT", - "value" : 5349, - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "version" : "1.5" - }, { "enumerant" : "HitObjectAttributeNV", "value" : 5385, @@ -11695,12 +11934,12 @@ { "enumerant" : "2D", "value" : 1, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "3D", "value" : 2, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Cube", @@ -11741,31 +11980,26 @@ { "enumerant" : "None", "value" : 0, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "ClampToEdge", "value" : 1, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "Clamp", "value" : 2, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "Repeat", "value" : 3, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "RepeatMirrored", "value" : 4, - "capabilities" : [ "Kernel" ], "version": "1.0" } ] @@ -11777,13 +12011,11 @@ { "enumerant" : "Nearest", "value" : 0, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "Linear", "value" : 1, - "capabilities" : [ "Kernel" ], "version": "1.0" } ] @@ -11795,7 +12027,7 @@ { "enumerant" : "Unknown", "value" : 0, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Rgba32f", @@ -12031,7 +12263,7 @@ "capabilities" : [ "StorageImageExtendedFormats" ], "version": "1.0" }, - { + { "enumerant" : "R64ui", "value" : 40, "capabilities" : [ "Int64ImageEXT" ], @@ -12052,121 +12284,101 @@ { "enumerant" : "R", "value" : 0, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "A", "value" : 1, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "RG", "value" : 2, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "RA", "value" : 3, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "RGB", "value" : 4, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "RGBA", "value" : 5, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "BGRA", "value" : 6, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "ARGB", "value" : 7, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "Intensity", "value" : 8, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "Luminance", "value" : 9, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "Rx", "value" : 10, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "RGx", "value" : 11, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "RGBx", "value" : 12, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "Depth", "value" : 13, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "DepthStencil", "value" : 14, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "sRGB", "value" : 15, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "sRGBx", "value" : 16, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "sRGBA", "value" : 17, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "sBGRA", "value" : 18, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "ABGR", "value" : 19, - "capabilities" : [ "Kernel" ], "version": "1.0" } ] @@ -12178,115 +12390,101 @@ { "enumerant" : "SnormInt8", "value" : 0, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "SnormInt16", "value" : 1, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnormInt8", "value" : 2, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnormInt16", "value" : 3, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnormShort565", "value" : 4, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnormShort555", "value" : 5, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnormInt101010", "value" : 6, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "SignedInt8", "value" : 7, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "SignedInt16", "value" : 8, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "SignedInt32", "value" : 9, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnsignedInt8", "value" : 10, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnsignedInt16", "value" : 11, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnsignedInt32", "value" : 12, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "HalfFloat", "value" : 13, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "Float", "value" : 14, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnormInt24", "value" : 15, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnormInt101010_2", "value" : 16, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnsignedIntRaw10EXT", "value" : 19, - "capabilities" : [ "Kernel" ], "version": "1.0" }, { "enumerant" : "UnsignedIntRaw12EXT", "value" : 20, - "capabilities" : [ "Kernel" ], + "version": "1.0" + }, + { + "enumerant" : "UnormInt2_101010EXT", + "value" : 21, "version": "1.0" } ] @@ -12298,22 +12496,22 @@ { "enumerant" : "RTE", "value" : 0, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "RTZ", "value" : 1, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "RTP", "value" : 2, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "RTN", "value" : 3, - "version" : "1.0" + "version" : "1.0" } ] }, @@ -12332,7 +12530,7 @@ "value" : 1, "capabilities" : [ "FunctionFloatControlINTEL" ], "version" : "None" - } + } ] }, { @@ -12703,17 +12901,17 @@ { "enumerant" : "Restrict", "value" : 19, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Aliased", "value" : 20, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Volatile", "value" : 21, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Constant", @@ -12858,7 +13056,7 @@ { "enumerant" : "FPFastMathMode", "value" : 40, - "capabilities" : [ "Kernel" ], + "capabilities" : [ "Kernel", "FloatControls2" ], "parameters" : [ { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" } ], @@ -12949,6 +13147,12 @@ "extensions" : [ "SPV_QCOM_image_processing" ], "version" : "None" }, + { + "enumerant" : "BlockMatchSamplerQCOM", + "value" : 4499, + "extensions" : [ "SPV_QCOM_image_processing2" ], + "version" : "None" + }, { "enumerant" : "ExplicitInterpAMD", "value" : 4999, @@ -12960,7 +13164,7 @@ "value" : 5019, "capabilities" : [ "ShaderEnqueueAMDX" ], "parameters" : [ - { "kind" : "IdRef", "name" : "'Payload Array'" } + { "kind" : "IdRef", "name" : "'Payload Type'" } ], "version" : "None" }, @@ -12984,10 +13188,40 @@ "value" : 5091, "capabilities" : [ "ShaderEnqueueAMDX" ], "parameters" : [ - { "kind" : "LiteralString", "name" : "'Node Name'" } + { "kind" : "IdRef", "name" : "'Node Name'" } + ], + "version" : "None" + }, + { + "enumerant" : "PayloadNodeBaseIndexAMDX", + "value" : 5098, + "capabilities" : [ "ShaderEnqueueAMDX" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Base Index'" } + ], + "version" : "None" + }, + { + "enumerant" : "PayloadNodeSparseArrayAMDX", + "value" : 5099, + "capabilities" : [ "ShaderEnqueueAMDX" ], + "version" : "None" + }, + { + "enumerant" : "PayloadNodeArraySizeAMDX", + "value" : 5100, + "capabilities" : [ "ShaderEnqueueAMDX" ], + "parameters" : [ + { "kind" : "IdRef", "name" : "'Array Size'" } ], "version" : "None" }, + { + "enumerant" : "PayloadDispatchIndirectAMDX", + "value" : 5105, + "capabilities" : [ "ShaderEnqueueAMDX" ], + "version" : "None" + }, { "enumerant" : "OverrideCoverageNV", "value" : 5248, @@ -13016,18 +13250,11 @@ "version" : "None", "parameters" : [ { "kind" : "LiteralInteger", "name" : "'Offset'" } - ], - "version": "1.0" - }, - { - "enumerant" : "PerPrimitiveNV", - "value" : 5271, - "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ], - "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ], - "version" : "None" + ] }, { "enumerant" : "PerPrimitiveEXT", + "aliases" : ["PerPrimitiveNV"], "value" : 5271, "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ], "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ], @@ -13049,26 +13276,15 @@ }, { "enumerant" : "PerVertexKHR", + "aliases" : ["PerVertexNV"], "value" : 5285, - "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ], - "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ], - "version" : "None" - }, - { - "enumerant" : "PerVertexNV", - "value" : 5285, - "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ], + "capabilities" : [ "FragmentBarycentricKHR" ], "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ], "version" : "None" }, { "enumerant" : "NonUniform", - "value" : 5300, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "NonUniformEXT", + "aliases" : ["NonUniformEXT"], "value" : 5300, "capabilities" : [ "ShaderNonUniform" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -13076,32 +13292,20 @@ }, { "enumerant" : "RestrictPointer", + "aliases" : ["RestrictPointerEXT"], "value" : 5355, "capabilities" : [ "PhysicalStorageBufferAddresses" ], "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], "version" : "1.5" }, - { - "enumerant" : "RestrictPointerEXT", - "value" : 5355, - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "version" : "1.5" - }, { "enumerant" : "AliasedPointer", + "aliases" : ["AliasedPointerEXT"], "value" : 5356, "capabilities" : [ "PhysicalStorageBufferAddresses" ], "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], "version" : "1.5" }, - { - "enumerant" : "AliasedPointerEXT", - "value" : 5356, - "capabilities" : [ "PhysicalStorageBufferAddresses" ], - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "version" : "1.5" - }, { "enumerant" : "HitObjectShaderRecordBufferNV", "value" : 5386, @@ -13201,38 +13405,24 @@ }, { "enumerant" : "CounterBuffer", - "value" : 5634, - "parameters" : [ - { "kind" : "IdRef", "name" : "'Counter Buffer'" } - ], - "version" : "1.4" - }, - { - "enumerant" : "HlslCounterBufferGOOGLE", + "aliases" : ["HlslCounterBufferGOOGLE"], "value" : 5634, "parameters" : [ { "kind" : "IdRef", "name" : "'Counter Buffer'" } ], "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "None" + "version" : "1.4" }, { "enumerant" : "UserSemantic", + "aliases" : ["HlslSemanticGOOGLE"], "value" : 5635, "parameters" : [ { "kind" : "LiteralString", "name" : "'Semantic'" } ], + "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ], "version" : "1.4" }, - { - "enumerant" : "HlslSemanticGOOGLE", - "value" : 5635, - "parameters" : [ - { "kind" : "LiteralString", "name" : "'Semantic'" } - ], - "extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ], - "version" : "None" - }, { "enumerant" : "UserTypeGOOGLE", "value" : 5636, @@ -13371,6 +13561,30 @@ "extensions" : [ "SPV_INTEL_fpga_memory_attributes" ], "version" : "None" }, + { + "enumerant" : "StridesizeINTEL", + "value" : 5883, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Stride Size'" } + ], + "capabilities" : [ "FPGAMemoryAttributesINTEL" ], + "version" : "None" + }, + { + "enumerant" : "WordsizeINTEL", + "value" : 5884, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Word Size'" } + ], + "capabilities" : [ "FPGAMemoryAttributesINTEL" ], + "version" : "None" + }, + { + "enumerant" : "TrueDualPortINTEL", + "value" : 5885, + "capabilities" : [ "FPGAMemoryAttributesINTEL" ], + "version" : "None" + }, { "enumerant" : "BurstCoalesceINTEL", "value" : 5899, @@ -13515,31 +13729,9 @@ "version" : "None" }, { - "enumerant" : "InitModeINTEL", - "value" : 6147, - "parameters": [ - { "kind" : "InitializationModeQualifier", "name" : "'Trigger'" } - ], - "capabilities" : [ "GlobalVariableFPGADecorationsINTEL" ], - "version" : "None" - }, - { - "enumerant" : "ImplementInRegisterMapINTEL", - "value" : 6148, - "parameters": [ - { "kind" : "LiteralInteger", "name" : "Value" } - ], - "capabilities" : [ "GlobalVariableFPGADecorationsINTEL" ], - "version" : "None" - }, - { - "enumerant" : "HostAccessINTEL", - "value" : 6168, - "parameters": [ - { "kind" : "HostAccessQualifier", "name" : "'Access'" }, - { "kind" : "LiteralString", "name" : "'Name'" } - ], - "capabilities" : [ "GlobalVariableHostAccessINTEL" ], + "enumerant" : "StallFreeINTEL", + "value" : 6151, + "capabilities" : [ "FPGAClusterAttributesV2INTEL" ], "version" : "None" }, { @@ -13642,6 +13834,54 @@ "value" : 6183, "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], "version" : "None" + }, + { + "enumerant" : "HostAccessINTEL", + "value" : 6188, + "parameters": [ + { "kind" : "HostAccessQualifier", "name" : "'Access'" }, + { "kind" : "LiteralString", "name" : "'Name'" } + ], + "capabilities" : [ "GlobalVariableHostAccessINTEL" ], + "version" : "None" + }, + { + "enumerant" : "InitModeINTEL", + "value" : 6190, + "parameters": [ + { "kind" : "InitializationModeQualifier", "name" : "'Trigger'" } + ], + "capabilities" : [ "GlobalVariableFPGADecorationsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "ImplementInRegisterMapINTEL", + "value" : 6191, + "parameters": [ + { "kind" : "LiteralInteger", "name" : "Value" } + ], + "capabilities" : [ "GlobalVariableFPGADecorationsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "CacheControlLoadINTEL", + "value" : 6442, + "capabilities" : [ "CacheControlsINTEL" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Cache Level'" }, + { "kind" : "LoadCacheControl", "name" : "'Cache Control'" } + ], + "version" : "None" + }, + { + "enumerant" : "CacheControlStoreINTEL", + "value" : 6443, + "capabilities" : [ "CacheControlsINTEL" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Cache Level'" }, + { "kind" : "StoreCacheControl", "name" : "'Cache Control'" } + ], + "version" : "None" } ] }, @@ -13784,32 +14024,32 @@ { "enumerant" : "NumWorkgroups", "value" : 24, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "WorkgroupSize", "value" : 25, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "WorkgroupId", "value" : 26, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "LocalInvocationId", "value" : 27, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "GlobalInvocationId", "value" : 28, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "LocalInvocationIndex", "value" : 29, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "WorkDim", @@ -13921,12 +14161,7 @@ }, { "enumerant" : "SubgroupEqMask", - "value" : 4416, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupEqMaskKHR", + "aliases" : ["SubgroupEqMaskKHR"], "value" : 4416, "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], "extensions" : [ "SPV_KHR_shader_ballot" ], @@ -13934,12 +14169,7 @@ }, { "enumerant" : "SubgroupGeMask", - "value" : 4417, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupGeMaskKHR", + "aliases" : ["SubgroupGeMaskKHR"], "value" : 4417, "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], "extensions" : [ "SPV_KHR_shader_ballot" ], @@ -13947,12 +14177,7 @@ }, { "enumerant" : "SubgroupGtMask", - "value" : 4418, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupGtMaskKHR", + "aliases" : ["SubgroupGtMaskKHR"], "value" : 4418, "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], "extensions" : [ "SPV_KHR_shader_ballot" ], @@ -13960,12 +14185,7 @@ }, { "enumerant" : "SubgroupLeMask", - "value" : 4419, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupLeMaskKHR", + "aliases" : ["SubgroupLeMaskKHR"], "value" : 4419, "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], "extensions" : [ "SPV_KHR_shader_ballot" ], @@ -13973,12 +14193,7 @@ }, { "enumerant" : "SubgroupLtMask", - "value" : 4420, - "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], - "version" : "1.3" - }, - { - "enumerant" : "SubgroupLtMaskKHR", + "aliases" : ["SubgroupLtMaskKHR"], "value" : 4420, "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ], "extensions" : [ "SPV_KHR_shader_ballot" ], @@ -14083,7 +14298,7 @@ "version" : "None" }, { - "enumerant" : "CoalescedInputCountAMDX", + "enumerant" : "RemainingRecursionLevelsAMDX", "value" : 5021, "capabilities" : [ "ShaderEnqueueAMDX" ], "version" : "None" @@ -14194,60 +14409,36 @@ }, { "enumerant" : "BaryCoordKHR", + "aliases" : ["BaryCoordNV"], "value" : 5286, - "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ], - "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordNV", - "value" : 5286, - "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ], + "capabilities" : [ "FragmentBarycentricKHR" ], "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ], "version" : "None" }, { "enumerant" : "BaryCoordNoPerspKHR", + "aliases" : ["BaryCoordNoPerspNV"], "value" : 5287, - "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ], - "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ], - "version" : "None" - }, - { - "enumerant" : "BaryCoordNoPerspNV", - "value" : 5287, - "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ], + "capabilities" : [ "FragmentBarycentricKHR" ], "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ], "version" : "None" }, { "enumerant" : "FragSizeEXT", + "aliases" : ["FragmentSizeNV"], "value" : 5292 , - "capabilities" : [ "FragmentDensityEXT", "ShadingRateNV" ], + "capabilities" : [ "FragmentDensityEXT" ], "extensions" : [ "SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate" ], "version" : "None" }, - { - "enumerant" : "FragmentSizeNV", - "value" : 5292 , - "capabilities" : [ "ShadingRateNV", "FragmentDensityEXT" ], - "extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ], - "version" : "None" - }, { "enumerant" : "FragInvocationCountEXT", + "aliases" : ["InvocationsPerPixelNV"], "value" : 5293, - "capabilities" : [ "FragmentDensityEXT", "ShadingRateNV" ], + "capabilities" : [ "FragmentDensityEXT" ], "extensions" : [ "SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate" ], "version" : "None" }, - { - "enumerant" : "InvocationsPerPixelNV", - "value" : 5293, - "capabilities" : [ "ShadingRateNV", "FragmentDensityEXT" ], - "extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ], - "version" : "None" - }, { "enumerant" : "PrimitivePointIndicesEXT", "value" : 5294, @@ -14276,155 +14467,89 @@ "extensions" : [ "SPV_EXT_mesh_shader" ], "version" : "None" }, - { - "enumerant" : "LaunchIdNV", - "value" : 5319, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "LaunchIdKHR", + "aliases" : ["LaunchIdNV"], "value" : 5319, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "LaunchSizeNV", - "value" : 5320, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "LaunchSizeKHR", + "aliases" : ["LaunchSizeNV"], "value" : 5320, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "WorldRayOriginNV", - "value" : 5321, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "WorldRayOriginKHR", + "aliases" : ["WorldRayOriginNV"], "value" : 5321, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "WorldRayDirectionNV", - "value" : 5322, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "WorldRayDirectionKHR", + "aliases" : ["WorldRayDirectionNV"], "value" : 5322, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "ObjectRayOriginNV", - "value" : 5323, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "ObjectRayOriginKHR", + "aliases" : ["ObjectRayOriginNV"], "value" : 5323, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "ObjectRayDirectionNV", - "value" : 5324, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "ObjectRayDirectionKHR", + "aliases" : ["ObjectRayDirectionNV"], "value" : 5324, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "RayTminNV", - "value" : 5325, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "RayTminKHR", + "aliases" : ["RayTminNV"], "value" : 5325, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "RayTmaxNV", - "value" : 5326, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "RayTmaxKHR", + "aliases" : ["RayTmaxNV"], "value" : 5326, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "InstanceCustomIndexNV", - "value" : 5327, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "InstanceCustomIndexKHR", + "aliases" : ["InstanceCustomIndexNV"], "value" : 5327, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "ObjectToWorldNV", - "value" : 5330, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "ObjectToWorldKHR", + "aliases" : ["ObjectToWorldNV"], "value" : 5330, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "WorldToObjectNV", - "value" : 5331, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "WorldToObjectKHR", + "aliases" : ["WorldToObjectNV"], "value" : 5331, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], @@ -14437,15 +14562,9 @@ "extensions" : [ "SPV_NV_ray_tracing" ], "version" : "None" }, - { - "enumerant" : "HitKindNV", - "value" : 5333, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], - "version" : "None" - }, { "enumerant" : "HitKindKHR", + "aliases" : ["HitKindNV"], "value" : 5333, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], @@ -14465,14 +14584,20 @@ "version" : "None" }, { - "enumerant" : "IncomingRayFlagsNV", - "value" : 5351, - "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], - "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], + "enumerant" : "HitMicroTriangleVertexPositionsNV", + "value" : 5337, + "capabilities" : [ "RayTracingDisplacementMicromapNV" ], + "version" : "None" + }, + { + "enumerant" : "HitMicroTriangleVertexBarycentricsNV", + "value" : 5344, + "capabilities" : [ "RayTracingDisplacementMicromapNV" ], "version" : "None" }, { "enumerant" : "IncomingRayFlagsKHR", + "aliases" : ["IncomingRayFlagsNV"], "value" : 5351, "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ], "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ], @@ -14513,6 +14638,18 @@ "extensions" : [ "SPV_NV_shader_sm_builtins" ], "version" : "None" }, + { + "enumerant" : "HitKindFrontFacingMicroTriangleNV", + "value" : 5405, + "capabilities" : [ "RayTracingDisplacementMicromapNV" ], + "version" : "None" + }, + { + "enumerant" : "HitKindBackFacingMicroTriangleNV", + "value" : 5406, + "capabilities" : [ "RayTracingDisplacementMicromapNV" ], + "version" : "None" + }, { "enumerant" : "CullMaskKHR", "value" : 6021, @@ -14529,36 +14666,31 @@ { "enumerant" : "CrossDevice", "value" : 0, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Device", "value" : 1, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Workgroup", "value" : 2, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Subgroup", "value" : 3, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Invocation", "value" : 4, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "QueueFamily", - "value" : 5, - "capabilities" : [ "VulkanMemoryModel" ], - "version" : "1.5" - }, - { - "enumerant" : "QueueFamilyKHR", + "aliases" : ["QueueFamilyKHR"], "value" : 5, "capabilities" : [ "VulkanMemoryModel" ], "version" : "1.5" @@ -14653,7 +14785,7 @@ { "enumerant" : "Matrix", "value" : 0, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Shader", @@ -14676,17 +14808,17 @@ { "enumerant" : "Addresses", "value" : 4, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Linkage", "value" : 5, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Kernel", "value" : 6, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Vector16", @@ -14703,17 +14835,17 @@ { "enumerant" : "Float16", "value" : 9, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Float64", "value" : 10, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Int64", "value" : 11, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Int64Atomics", @@ -14772,7 +14904,7 @@ { "enumerant" : "Int16", "value" : 22, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "TessellationPointSize", @@ -14867,7 +14999,7 @@ { "enumerant" : "Int8", "value" : 39, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "InputAttachment", @@ -14890,7 +15022,7 @@ { "enumerant" : "Sampled1D", "value" : 43, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "Image1D", @@ -14907,7 +15039,7 @@ { "enumerant" : "SampledBuffer", "value" : 46, - "version" : "1.0" + "version" : "1.0" }, { "enumerant" : "ImageBuffer", @@ -15079,6 +15211,12 @@ "extensions" : [ "SPV_EXT_shader_tile_image" ], "version" : "None" }, + { + "enumerant" : "CooperativeMatrixLayoutsARM", + "value" : 4201, + "extensions" : [ "SPV_ARM_cooperative_matrix_layouts" ], + "version" : "None" + }, { "enumerant" : "FragmentShadingRateKHR", "value" : 4422, @@ -15116,7 +15254,7 @@ { "enumerant" : "WorkgroupMemoryExplicitLayout16BitAccessKHR", "value" : 4430, - "capabilities" : [ "Shader" ], + "capabilities" : [ "WorkgroupMemoryExplicitLayoutKHR" ], "extensions" : [ "SPV_KHR_workgroup_memory_explicit_layout" ], "version" : "None" }, @@ -15128,33 +15266,16 @@ }, { "enumerant" : "StorageBuffer16BitAccess", - "value" : 4433, - "extensions" : [ "SPV_KHR_16bit_storage" ], - "version" : "1.3" - }, - { - "enumerant" : "StorageUniformBufferBlock16", + "aliases" : ["StorageUniformBufferBlock16"], "value" : 4433, "extensions" : [ "SPV_KHR_16bit_storage" ], "version" : "1.3" }, { "enumerant" : "UniformAndStorageBuffer16BitAccess", + "aliases" : ["StorageUniform16"], "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], - "extensions" : [ "SPV_KHR_16bit_storage" ], - "version" : "1.3" - }, - { - "enumerant" : "StorageUniform16", - "value" : 4434, - "capabilities" : [ - "StorageBuffer16BitAccess", - "StorageUniformBufferBlock16" - ], + "capabilities" : [ "StorageBuffer16BitAccess" ], "extensions" : [ "SPV_KHR_16bit_storage" ], "version" : "1.3" }, @@ -15272,6 +15393,12 @@ "extensions" : [ "SPV_KHR_ray_query" ], "version" : "None" }, + { + "enumerant" : "UntypedPointersKHR", + "value" : 4473, + "extensions" : [ "SPV_KHR_untyped_pointers" ], + "version" : "None" + }, { "enumerant" : "RayTraversalPrimitiveCullingKHR", "value" : 4478, @@ -15304,6 +15431,12 @@ "extensions" : [ "SPV_QCOM_image_processing" ], "version" : "None" }, + { + "enumerant" : "TextureBlockMatch2QCOM", + "value" : 4498, + "extensions" : [ "SPV_QCOM_image_processing2" ], + "version" : "None" + }, { "enumerant" : "Float16ImageAMD", "value" : 5008, @@ -15359,6 +15492,12 @@ "extensions" : [ "SPV_AMDX_shader_enqueue" ], "version" : "None" }, + { + "enumerant" : "QuadControlKHR", + "value" : 5087, + "extensions" : [ "SPV_KHR_quad_control" ], + "version" : "None" + }, { "enumerant" : "SampleMaskOverrideCoverageNV", "value" : 5249, @@ -15375,22 +15514,16 @@ }, { "enumerant" : "ShaderViewportIndexLayerEXT", + "aliases" : ["ShaderViewportIndexLayerNV"], "value" : 5254, "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ], - "version" : "None" - }, - { - "enumerant" : "ShaderViewportIndexLayerNV", - "value" : 5254, - "capabilities" : [ "MultiViewport" ], - "extensions" : [ "SPV_NV_viewport_array2" ], + "extensions" : [ "SPV_EXT_shader_viewport_index_layer", "SPV_NV_viewport_array2" ], "version" : "None" }, { "enumerant" : "ShaderViewportMaskNV", "value" : 5255, - "capabilities" : [ "ShaderViewportIndexLayerNV" ], + "capabilities" : [ "ShaderViewportIndexLayerEXT" ], "extensions" : [ "SPV_NV_viewport_array2" ], "version" : "None" }, @@ -15437,36 +15570,27 @@ }, { "enumerant" : "FragmentBarycentricKHR", + "aliases" : ["FragmentBarycentricNV"], "value" : 5284, "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ], "version" : "None" }, { - "enumerant" : "FragmentBarycentricNV", - "value" : 5284, - "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ], - "version" : "None" - }, - { - "enumerant" : "ComputeDerivativeGroupQuadsNV", + "enumerant" : "ComputeDerivativeGroupQuadsKHR", + "aliases" : ["ComputeDerivativeGroupQuadsNV"], "value" : 5288, - "extensions" : [ "SPV_NV_compute_shader_derivatives" ], + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_NV_compute_shader_derivatives", "SPV_KHR_compute_shader_derivatives" ], "version" : "None" }, { "enumerant" : "FragmentDensityEXT", + "aliases" : ["ShadingRateNV"], "value" : 5291, "capabilities" : [ "Shader" ], "extensions" : [ "SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate" ], "version" : "None" }, - { - "enumerant" : "ShadingRateNV", - "value" : 5291, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ], - "version" : "None" - }, { "enumerant" : "GroupNonUniformPartitionedNV", "value" : 5297, @@ -15475,12 +15599,7 @@ }, { "enumerant" : "ShaderNonUniform", - "value" : 5301, - "capabilities" : [ "Shader" ], - "version" : "1.5" - }, - { - "enumerant" : "ShaderNonUniformEXT", + "aliases" : ["ShaderNonUniformEXT"], "value" : 5301, "capabilities" : [ "Shader" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15488,12 +15607,7 @@ }, { "enumerant" : "RuntimeDescriptorArray", - "value" : 5302, - "capabilities" : [ "Shader" ], - "version" : "1.5" - }, - { - "enumerant" : "RuntimeDescriptorArrayEXT", + "aliases" : ["RuntimeDescriptorArrayEXT"], "value" : 5302, "capabilities" : [ "Shader" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15501,12 +15615,7 @@ }, { "enumerant" : "InputAttachmentArrayDynamicIndexing", - "value" : 5303, - "capabilities" : [ "InputAttachment" ], - "version" : "1.5" - }, - { - "enumerant" : "InputAttachmentArrayDynamicIndexingEXT", + "aliases" : ["InputAttachmentArrayDynamicIndexingEXT"], "value" : 5303, "capabilities" : [ "InputAttachment" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15514,12 +15623,7 @@ }, { "enumerant" : "UniformTexelBufferArrayDynamicIndexing", - "value" : 5304, - "capabilities" : [ "SampledBuffer" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformTexelBufferArrayDynamicIndexingEXT", + "aliases" : ["UniformTexelBufferArrayDynamicIndexingEXT"], "value" : 5304, "capabilities" : [ "SampledBuffer" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15527,12 +15631,7 @@ }, { "enumerant" : "StorageTexelBufferArrayDynamicIndexing", - "value" : 5305, - "capabilities" : [ "ImageBuffer" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageTexelBufferArrayDynamicIndexingEXT", + "aliases" : ["StorageTexelBufferArrayDynamicIndexingEXT"], "value" : 5305, "capabilities" : [ "ImageBuffer" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15540,12 +15639,7 @@ }, { "enumerant" : "UniformBufferArrayNonUniformIndexing", - "value" : 5306, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformBufferArrayNonUniformIndexingEXT", + "aliases" : ["UniformBufferArrayNonUniformIndexingEXT"], "value" : 5306, "capabilities" : [ "ShaderNonUniform" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15553,12 +15647,7 @@ }, { "enumerant" : "SampledImageArrayNonUniformIndexing", - "value" : 5307, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "SampledImageArrayNonUniformIndexingEXT", + "aliases" : ["SampledImageArrayNonUniformIndexingEXT"], "value" : 5307, "capabilities" : [ "ShaderNonUniform" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15566,12 +15655,7 @@ }, { "enumerant" : "StorageBufferArrayNonUniformIndexing", - "value" : 5308, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageBufferArrayNonUniformIndexingEXT", + "aliases" : ["StorageBufferArrayNonUniformIndexingEXT"], "value" : 5308, "capabilities" : [ "ShaderNonUniform" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15579,12 +15663,7 @@ }, { "enumerant" : "StorageImageArrayNonUniformIndexing", - "value" : 5309, - "capabilities" : [ "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageImageArrayNonUniformIndexingEXT", + "aliases" : ["StorageImageArrayNonUniformIndexingEXT"], "value" : 5309, "capabilities" : [ "ShaderNonUniform" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15592,12 +15671,7 @@ }, { "enumerant" : "InputAttachmentArrayNonUniformIndexing", - "value" : 5310, - "capabilities" : [ "InputAttachment", "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "InputAttachmentArrayNonUniformIndexingEXT", + "aliases" : ["InputAttachmentArrayNonUniformIndexingEXT"], "value" : 5310, "capabilities" : [ "InputAttachment", "ShaderNonUniform" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15605,12 +15679,7 @@ }, { "enumerant" : "UniformTexelBufferArrayNonUniformIndexing", - "value" : 5311, - "capabilities" : [ "SampledBuffer", "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "UniformTexelBufferArrayNonUniformIndexingEXT", + "aliases" : ["UniformTexelBufferArrayNonUniformIndexingEXT"], "value" : 5311, "capabilities" : [ "SampledBuffer", "ShaderNonUniform" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15618,12 +15687,7 @@ }, { "enumerant" : "StorageTexelBufferArrayNonUniformIndexing", - "value" : 5312, - "capabilities" : [ "ImageBuffer", "ShaderNonUniform" ], - "version" : "1.5" - }, - { - "enumerant" : "StorageTexelBufferArrayNonUniformIndexingEXT", + "aliases" : ["StorageTexelBufferArrayNonUniformIndexingEXT"], "value" : 5312, "capabilities" : [ "ImageBuffer", "ShaderNonUniform" ], "extensions" : [ "SPV_EXT_descriptor_indexing" ], @@ -15652,44 +15716,32 @@ }, { "enumerant" : "VulkanMemoryModel", - "value" : 5345, - "version" : "1.5" - }, - { - "enumerant" : "VulkanMemoryModelKHR", + "aliases" : ["VulkanMemoryModelKHR"], "value" : 5345, "extensions" : [ "SPV_KHR_vulkan_memory_model" ], "version" : "1.5" }, { "enumerant" : "VulkanMemoryModelDeviceScope", - "value" : 5346, - "version" : "1.5" - }, - { - "enumerant" : "VulkanMemoryModelDeviceScopeKHR", + "aliases" : ["VulkanMemoryModelDeviceScopeKHR"], "value" : 5346, "extensions" : [ "SPV_KHR_vulkan_memory_model" ], "version" : "1.5" }, { "enumerant" : "PhysicalStorageBufferAddresses", + "aliases" : ["PhysicalStorageBufferAddressesEXT"], "value" : 5347, "capabilities" : [ "Shader" ], "extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ], "version" : "1.5" }, { - "enumerant" : "PhysicalStorageBufferAddressesEXT", - "value" : 5347, - "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_physical_storage_buffer" ], - "version" : "1.5" - }, - { - "enumerant" : "ComputeDerivativeGroupLinearNV", + "enumerant" : "ComputeDerivativeGroupLinearKHR", + "aliases" : ["ComputeDerivativeGroupLinearNV"], "value" : 5350, - "extensions" : [ "SPV_NV_compute_shader_derivatives" ], + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_NV_compute_shader_derivatives", "SPV_KHR_compute_shader_derivatives" ], "version" : "None" }, { @@ -15736,16 +15788,18 @@ }, { "enumerant" : "DemoteToHelperInvocation", + "aliases" : ["DemoteToHelperInvocationEXT"], "value" : 5379, "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_EXT_demote_to_helper_invocation" ], "version" : "1.6" }, { - "enumerant" : "DemoteToHelperInvocationEXT", - "value" : 5379, + "enumerant" : "DisplacementMicromapNV", + "value" : 5380, "capabilities" : [ "Shader" ], - "extensions" : [ "SPV_EXT_demote_to_helper_invocation" ], - "version" : "1.6" + "extensions" : [ "SPV_NV_displacement_micromap" ], + "version" : "None" }, { "enumerant" : "RayTracingOpacityMicromapEXT", @@ -15774,6 +15828,25 @@ "extensions" : [ "SPV_KHR_ray_tracing_position_fetch" ], "version" : "None" }, + { + "enumerant" : "AtomicFloat16VectorNV", + "value" : 5404, + "extensions" : [ "SPV_NV_shader_atomic_fp16_vector" ], + "version" : "None" + }, + { + "enumerant" : "RayTracingDisplacementMicromapNV", + "value" : 5409, + "capabilities" : [ "RayTracingKHR" ], + "extensions" : [ "SPV_NV_displacement_micromap" ], + "version" : "None" + }, + { + "enumerant" : "RawAccessChainsNV", + "value" : 5414, + "extensions" : [ "SPV_NV_raw_access_chains" ], + "version" : "None" + }, { "enumerant" : "SubgroupShuffleINTEL", "value" : 5568, @@ -16031,23 +16104,14 @@ }, { "enumerant" : "DotProductInputAll", - "value" : 6016, - "version" : "1.6" - }, - { - "enumerant" : "DotProductInputAllKHR", + "aliases" : ["DotProductInputAllKHR"], "value" : 6016, "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" }, { "enumerant" : "DotProductInput4x8Bit", - "value" : 6017, - "capabilities" : [ "Int8" ], - "version" : "1.6" - }, - { - "enumerant" : "DotProductInput4x8BitKHR", + "aliases" : ["DotProductInput4x8BitKHR"], "value" : 6017, "capabilities" : [ "Int8" ], "extensions" : [ "SPV_KHR_integer_dot_product" ], @@ -16055,22 +16119,14 @@ }, { "enumerant" : "DotProductInput4x8BitPacked", - "value" : 6018, - "version" : "1.6" - }, - { - "enumerant" : "DotProductInput4x8BitPackedKHR", + "aliases" : ["DotProductInput4x8BitPackedKHR"], "value" : 6018, "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" }, { "enumerant" : "DotProduct", - "value" : 6019, - "version" : "1.6" - }, - { - "enumerant" : "DotProductKHR", + "aliases" : ["DotProductKHR"], "value" : 6019, "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" @@ -16087,6 +16143,12 @@ "extensions" : [ "SPV_KHR_cooperative_matrix" ], "version" : "None" }, + { + "enumerant" : "ReplicatedCompositesEXT", + "value" : 6024, + "extensions" : [ "SPV_EXT_replicated_composites" ], + "version" : "None" + }, { "enumerant" : "BitInstructions", "value" : 6025, @@ -16100,6 +16162,12 @@ "extensions" : [ "SPV_KHR_subgroup_rotate" ], "version" : "None" }, + { + "enumerant" : "FloatControls2", + "value" : 6029, + "extensions" : [ "SPV_KHR_float_controls2" ], + "version" : "None" + }, { "enumerant" : "AtomicFloat32AddEXT", "value" : 6033, @@ -16113,15 +16181,16 @@ "version" : "None" }, { - "enumerant" : "LongConstantCompositeINTEL", + "enumerant" : "LongCompositesINTEL", "value" : 6089, - "extensions" : [ "SPV_INTEL_long_constant_composite" ], + "extensions" : [ "SPV_INTEL_long_composites" ], "version" : "None" }, { - "enumerant" : "OptNoneINTEL", + "enumerant" : "OptNoneEXT", + "aliases" : ["OptNoneINTEL"], "value" : 6094, - "extensions" : [ "SPV_INTEL_optnone" ], + "extensions" : [ "SPV_EXT_optnone", "SPV_INTEL_optnone" ], "version" : "None" }, { @@ -16149,9 +16218,16 @@ "version" : "None" }, { - "enumerant" : "GlobalVariableFPGADecorationsINTEL", - "value" : 6146, - "extensions": [ "SPV_INTEL_global_variable_fpga_decorations" ], + "enumerant" : "ArithmeticFenceEXT", + "value" : 6144, + "extensions" : [ "SPV_EXT_arithmetic_fence" ], + "version" : "None" + }, + { + "enumerant" : "FPGAClusterAttributesV2INTEL", + "value" : 6150, + "capabilities" : [ "FPGAClusterAttributesINTEL" ], + "extensions" : [ "SPV_INTEL_fpga_cluster_attributes" ], "version" : "None" }, { @@ -16161,12 +16237,6 @@ "extensions" : [ "SPV_INTEL_kernel_attributes" ], "version" : "None" }, - { - "enumerant" : "GlobalVariableHostAccessINTEL", - "value" : 6167, - "extensions": [ "SPV_INTEL_global_variable_host_access" ], - "version" : "None" - }, { "enumerant" : "FPMaxErrorINTEL", "value" : 6169, @@ -16185,11 +16255,47 @@ "extensions" : [ "SPV_INTEL_fpga_argument_interfaces" ], "version" : "None" }, + { + "enumerant" : "GlobalVariableHostAccessINTEL", + "value" : 6187, + "extensions": [ "SPV_INTEL_global_variable_host_access" ], + "version" : "None" + }, + { + "enumerant" : "GlobalVariableFPGADecorationsINTEL", + "value" : 6189, + "extensions": [ "SPV_INTEL_global_variable_fpga_decorations" ], + "version" : "None" + }, + { + "enumerant" : "SubgroupBufferPrefetchINTEL", + "value" : 6220, + "extensions": [ "SPV_INTEL_subgroup_buffer_prefetch" ], + "version" : "None" + }, { "enumerant" : "GroupUniformArithmeticKHR", "value" : 6400, "extensions" : [ "SPV_KHR_uniform_group_instructions"], "version" : "None" + }, + { + "enumerant" : "MaskedGatherScatterINTEL", + "value" : 6427, + "extensions" : [ "SPV_INTEL_masked_gather_scatter"], + "version" : "None" + }, + { + "enumerant" : "CacheControlsINTEL", + "value" : 6441, + "extensions" : [ "SPV_INTEL_cache_controls" ], + "version" : "None" + }, + { + "enumerant" : "RegisterLimitsINTEL", + "value" : 6460, + "extensions" : [ "SPV_INTEL_maximum_registers" ], + "version" : "None" } ] }, @@ -16259,11 +16365,7 @@ "enumerants" : [ { "enumerant" : "PackedVectorFormat4x8Bit", - "value" : 0, - "version" : "1.6" - }, - { - "enumerant" : "PackedVectorFormat4x8BitKHR", + "aliases" : ["PackedVectorFormat4x8BitKHR"], "value" : 0, "extensions" : [ "SPV_KHR_integer_dot_product" ], "version" : "1.6" @@ -16319,6 +16421,16 @@ "enumerant" : "ColumnMajorKHR", "value" : 1, "version" : "None" + }, + { + "enumerant" : "RowBlockedInterleavedARM", + "value" : 4202, + "version" : "None" + }, + { + "enumerant" : "ColumnBlockedInterleavedARM", + "value" : 4203, + "version" : "None" } ] }, @@ -16361,6 +16473,90 @@ } ] }, + { + "category" : "ValueEnum", + "kind" : "LoadCacheControl", + "enumerants" : [ + { + "enumerant" : "UncachedINTEL", + "value" : 0, + "capabilities" : [ "CacheControlsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "CachedINTEL", + "value" : 1, + "capabilities" : [ "CacheControlsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "StreamingINTEL", + "value" : 2, + "capabilities" : [ "CacheControlsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "InvalidateAfterReadINTEL", + "value" : 3, + "capabilities" : [ "CacheControlsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "ConstCachedINTEL", + "value" : 4, + "capabilities" : [ "CacheControlsINTEL" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "StoreCacheControl", + "enumerants" : [ + { + "enumerant" : "UncachedINTEL", + "value" : 0, + "capabilities" : [ "CacheControlsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "WriteThroughINTEL", + "value" : 1, + "capabilities" : [ "CacheControlsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "WriteBackINTEL", + "value" : 2, + "capabilities" : [ "CacheControlsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "StreamingINTEL", + "value" : 3, + "capabilities" : [ "CacheControlsINTEL" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "NamedMaximumNumberOfRegisters", + "enumerants" : [ + { + "enumerant" : "AutoINTEL", + "value" : 0, + "capabilities" : [ "RegisterLimitsINTEL" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "FPEncoding", + "enumerants" : [ + ] + }, { "category" : "Id", "kind" : "IdResultType", @@ -16396,6 +16592,11 @@ "kind" : "LiteralString", "doc" : "A null-terminated stream of characters consuming an integral number of words" }, + { + "category" : "Literal", + "kind" : "LiteralFloat", + "doc" : "A float consuming one word" + }, { "category" : "Literal", "kind" : "LiteralContextDependentNumber", diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h index d3813406..715741a2 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h @@ -1,5 +1,5 @@ /* -** Copyright (c) 2014-2020 The Khronos Group Inc. +** 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"), @@ -76,6 +76,8 @@ typedef enum SpvSourceLanguage_ { SpvSourceLanguageHERO_C = 8, SpvSourceLanguageNZSL = 9, SpvSourceLanguageWGSL = 10, + SpvSourceLanguageSlang = 11, + SpvSourceLanguageZig = 12, SpvSourceLanguageMax = 0x7fffffff, } SpvSourceLanguage; @@ -176,6 +178,7 @@ typedef enum SpvExecutionMode_ { SpvExecutionModeEarlyAndLateFragmentTestsAMD = 5017, SpvExecutionModeStencilRefReplacingEXT = 5027, SpvExecutionModeCoalescingAMDX = 5069, + SpvExecutionModeIsApiEntryAMDX = 5070, SpvExecutionModeMaxNodeRecursionAMDX = 5071, SpvExecutionModeStaticNumWorkgroupsAMDX = 5072, SpvExecutionModeShaderIndexAMDX = 5073, @@ -186,11 +189,16 @@ typedef enum SpvExecutionMode_ { SpvExecutionModeStencilRefUnchangedBackAMD = 5082, SpvExecutionModeStencilRefGreaterBackAMD = 5083, SpvExecutionModeStencilRefLessBackAMD = 5084, + SpvExecutionModeQuadDerivativesKHR = 5088, + SpvExecutionModeRequireFullQuadsKHR = 5089, + SpvExecutionModeSharesInputWithAMDX = 5102, SpvExecutionModeOutputLinesEXT = 5269, SpvExecutionModeOutputLinesNV = 5269, SpvExecutionModeOutputPrimitivesEXT = 5270, SpvExecutionModeOutputPrimitivesNV = 5270, + SpvExecutionModeDerivativeGroupQuadsKHR = 5289, SpvExecutionModeDerivativeGroupQuadsNV = 5289, + SpvExecutionModeDerivativeGroupLinearKHR = 5290, SpvExecutionModeDerivativeGroupLinearNV = 5290, SpvExecutionModeOutputTrianglesEXT = 5298, SpvExecutionModeOutputTrianglesNV = 5298, @@ -210,9 +218,14 @@ typedef enum SpvExecutionMode_ { SpvExecutionModeNoGlobalOffsetINTEL = 5895, SpvExecutionModeNumSIMDWorkitemsINTEL = 5896, SpvExecutionModeSchedulerTargetFmaxMhzINTEL = 5903, + SpvExecutionModeMaximallyReconvergesKHR = 6023, + SpvExecutionModeFPFastMathDefault = 6028, SpvExecutionModeStreamingInterfaceINTEL = 6154, SpvExecutionModeRegisterMapInterfaceINTEL = 6160, SpvExecutionModeNamedBarrierCountINTEL = 6417, + SpvExecutionModeMaximumRegistersINTEL = 6461, + SpvExecutionModeMaximumRegistersIdINTEL = 6462, + SpvExecutionModeNamedMaximumRegistersINTEL = 6463, SpvExecutionModeMax = 0x7fffffff, } SpvExecutionMode; @@ -232,7 +245,6 @@ typedef enum SpvStorageClass_ { SpvStorageClassStorageBuffer = 12, SpvStorageClassTileImageEXT = 4172, SpvStorageClassNodePayloadAMDX = 5068, - SpvStorageClassNodeOutputPayloadAMDX = 5076, SpvStorageClassCallableDataKHR = 5328, SpvStorageClassCallableDataNV = 5328, SpvStorageClassIncomingCallableDataKHR = 5329, @@ -372,6 +384,7 @@ typedef enum SpvImageChannelDataType_ { SpvImageChannelDataTypeUnormInt101010_2 = 16, SpvImageChannelDataTypeUnsignedIntRaw10EXT = 19, SpvImageChannelDataTypeUnsignedIntRaw12EXT = 20, + SpvImageChannelDataTypeUnormInt2_101010EXT = 21, SpvImageChannelDataTypeMax = 0x7fffffff, } SpvImageChannelDataType; @@ -429,8 +442,11 @@ typedef enum SpvFPFastMathModeShift_ { SpvFPFastMathModeNSZShift = 2, SpvFPFastMathModeAllowRecipShift = 3, SpvFPFastMathModeFastShift = 4, + SpvFPFastMathModeAllowContractShift = 16, SpvFPFastMathModeAllowContractFastINTELShift = 16, + SpvFPFastMathModeAllowReassocShift = 17, SpvFPFastMathModeAllowReassocINTELShift = 17, + SpvFPFastMathModeAllowTransformShift = 18, SpvFPFastMathModeMax = 0x7fffffff, } SpvFPFastMathModeShift; @@ -441,8 +457,11 @@ typedef enum SpvFPFastMathModeMask_ { SpvFPFastMathModeNSZMask = 0x00000004, SpvFPFastMathModeAllowRecipMask = 0x00000008, SpvFPFastMathModeFastMask = 0x00000010, + SpvFPFastMathModeAllowContractMask = 0x00010000, SpvFPFastMathModeAllowContractFastINTELMask = 0x00010000, + SpvFPFastMathModeAllowReassocMask = 0x00020000, SpvFPFastMathModeAllowReassocINTELMask = 0x00020000, + SpvFPFastMathModeAllowTransformMask = 0x00040000, } SpvFPFastMathModeMask; typedef enum SpvFPRoundingMode_ { @@ -532,11 +551,16 @@ typedef enum SpvDecoration_ { SpvDecorationNoUnsignedWrap = 4470, SpvDecorationWeightTextureQCOM = 4487, SpvDecorationBlockMatchTextureQCOM = 4488, + SpvDecorationBlockMatchSamplerQCOM = 4499, SpvDecorationExplicitInterpAMD = 4999, SpvDecorationNodeSharesPayloadLimitsWithAMDX = 5019, SpvDecorationNodeMaxPayloadsAMDX = 5020, SpvDecorationTrackFinishWritingAMDX = 5078, SpvDecorationPayloadNodeNameAMDX = 5091, + SpvDecorationPayloadNodeBaseIndexAMDX = 5098, + SpvDecorationPayloadNodeSparseArrayAMDX = 5099, + SpvDecorationPayloadNodeArraySizeAMDX = 5100, + SpvDecorationPayloadDispatchIndirectAMDX = 5105, SpvDecorationOverrideCoverageNV = 5248, SpvDecorationPassthroughNV = 5250, SpvDecorationViewportRelativeNV = 5252, @@ -586,6 +610,9 @@ typedef enum SpvDecoration_ { SpvDecorationMergeINTEL = 5834, SpvDecorationBankBitsINTEL = 5835, SpvDecorationForcePow2DepthINTEL = 5836, + SpvDecorationStridesizeINTEL = 5883, + SpvDecorationWordsizeINTEL = 5884, + SpvDecorationTrueDualPortINTEL = 5885, SpvDecorationBurstCoalesceINTEL = 5899, SpvDecorationCacheSizeINTEL = 5900, SpvDecorationDontStaticallyCoalesceINTEL = 5901, @@ -604,9 +631,7 @@ typedef enum SpvDecoration_ { SpvDecorationSingleElementVectorINTEL = 6085, SpvDecorationVectorComputeCallableFunctionINTEL = 6087, SpvDecorationMediaBlockIOINTEL = 6140, - SpvDecorationInitModeINTEL = 6147, - SpvDecorationImplementInRegisterMapINTEL = 6148, - SpvDecorationHostAccessINTEL = 6168, + SpvDecorationStallFreeINTEL = 6151, SpvDecorationFPMaxErrorDecorationINTEL = 6170, SpvDecorationLatencyControlLabelINTEL = 6172, SpvDecorationLatencyControlConstraintINTEL = 6173, @@ -619,6 +644,11 @@ typedef enum SpvDecoration_ { SpvDecorationMMHostInterfaceMaxBurstINTEL = 6181, SpvDecorationMMHostInterfaceWaitRequestINTEL = 6182, SpvDecorationStableKernelArgumentINTEL = 6183, + SpvDecorationHostAccessINTEL = 6188, + SpvDecorationInitModeINTEL = 6190, + SpvDecorationImplementInRegisterMapINTEL = 6191, + SpvDecorationCacheControlLoadINTEL = 6442, + SpvDecorationCacheControlStoreINTEL = 6443, SpvDecorationMax = 0x7fffffff, } SpvDecoration; @@ -694,7 +724,7 @@ typedef enum SpvBuiltIn_ { SpvBuiltInBaryCoordSmoothSampleAMD = 4997, SpvBuiltInBaryCoordPullModelAMD = 4998, SpvBuiltInFragStencilRefEXT = 5014, - SpvBuiltInCoalescedInputCountAMDX = 5021, + SpvBuiltInRemainingRecursionLevelsAMDX = 5021, SpvBuiltInShaderIndexAMDX = 5073, SpvBuiltInViewportMaskNV = 5253, SpvBuiltInSecondaryPositionNV = 5257, @@ -749,6 +779,8 @@ typedef enum SpvBuiltIn_ { SpvBuiltInHitKindNV = 5333, SpvBuiltInCurrentRayTimeNV = 5334, SpvBuiltInHitTriangleVertexPositionsKHR = 5335, + SpvBuiltInHitMicroTriangleVertexPositionsNV = 5337, + SpvBuiltInHitMicroTriangleVertexBarycentricsNV = 5344, SpvBuiltInIncomingRayFlagsKHR = 5351, SpvBuiltInIncomingRayFlagsNV = 5351, SpvBuiltInRayGeometryIndexKHR = 5352, @@ -756,6 +788,8 @@ typedef enum SpvBuiltIn_ { SpvBuiltInSMCountNV = 5375, SpvBuiltInWarpIDNV = 5376, SpvBuiltInSMIDNV = 5377, + SpvBuiltInHitKindFrontFacingMicroTriangleNV = 5405, + SpvBuiltInHitKindBackFacingMicroTriangleNV = 5406, SpvBuiltInCullMaskKHR = 6021, SpvBuiltInMax = 0x7fffffff, } SpvBuiltIn; @@ -823,6 +857,7 @@ typedef enum SpvFunctionControlShift_ { SpvFunctionControlDontInlineShift = 1, SpvFunctionControlPureShift = 2, SpvFunctionControlConstShift = 3, + SpvFunctionControlOptNoneEXTShift = 16, SpvFunctionControlOptNoneINTELShift = 16, SpvFunctionControlMax = 0x7fffffff, } SpvFunctionControlShift; @@ -833,6 +868,7 @@ typedef enum SpvFunctionControlMask_ { SpvFunctionControlDontInlineMask = 0x00000002, SpvFunctionControlPureMask = 0x00000004, SpvFunctionControlConstMask = 0x00000008, + SpvFunctionControlOptNoneEXTMask = 0x00010000, SpvFunctionControlOptNoneINTELMask = 0x00010000, } SpvFunctionControlMask; @@ -1023,6 +1059,7 @@ typedef enum SpvCapability_ { SpvCapabilityTileImageColorReadAccessEXT = 4166, SpvCapabilityTileImageDepthReadAccessEXT = 4167, SpvCapabilityTileImageStencilReadAccessEXT = 4168, + SpvCapabilityCooperativeMatrixLayoutsARM = 4201, SpvCapabilityFragmentShadingRateKHR = 4422, SpvCapabilitySubgroupBallotKHR = 4423, SpvCapabilityDrawParameters = 4427, @@ -1052,11 +1089,13 @@ typedef enum SpvCapability_ { SpvCapabilityRoundingModeRTZ = 4468, SpvCapabilityRayQueryProvisionalKHR = 4471, SpvCapabilityRayQueryKHR = 4472, + SpvCapabilityUntypedPointersKHR = 4473, SpvCapabilityRayTraversalPrimitiveCullingKHR = 4478, SpvCapabilityRayTracingKHR = 4479, SpvCapabilityTextureSampleWeightedQCOM = 4484, SpvCapabilityTextureBoxFilterQCOM = 4485, SpvCapabilityTextureBlockMatchQCOM = 4486, + SpvCapabilityTextureBlockMatch2QCOM = 4498, SpvCapabilityFloat16ImageAMD = 5008, SpvCapabilityImageGatherBiasLodAMD = 5009, SpvCapabilityFragmentMaskAMD = 5010, @@ -1065,6 +1104,7 @@ typedef enum SpvCapability_ { SpvCapabilityInt64ImageEXT = 5016, SpvCapabilityShaderClockKHR = 5055, SpvCapabilityShaderEnqueueAMDX = 5067, + SpvCapabilityQuadControlKHR = 5087, SpvCapabilitySampleMaskOverrideCoverageNV = 5249, SpvCapabilityGeometryShaderPassthroughNV = 5251, SpvCapabilityShaderViewportIndexLayerEXT = 5254, @@ -1078,6 +1118,7 @@ typedef enum SpvCapability_ { SpvCapabilityMeshShadingEXT = 5283, SpvCapabilityFragmentBarycentricKHR = 5284, SpvCapabilityFragmentBarycentricNV = 5284, + SpvCapabilityComputeDerivativeGroupQuadsKHR = 5288, SpvCapabilityComputeDerivativeGroupQuadsNV = 5288, SpvCapabilityFragmentDensityEXT = 5291, SpvCapabilityShadingRateNV = 5291, @@ -1115,6 +1156,7 @@ typedef enum SpvCapability_ { SpvCapabilityVulkanMemoryModelDeviceScopeKHR = 5346, SpvCapabilityPhysicalStorageBufferAddresses = 5347, SpvCapabilityPhysicalStorageBufferAddressesEXT = 5347, + SpvCapabilityComputeDerivativeGroupLinearKHR = 5350, SpvCapabilityComputeDerivativeGroupLinearNV = 5350, SpvCapabilityRayTracingProvisionalKHR = 5353, SpvCapabilityCooperativeMatrixNV = 5357, @@ -1124,10 +1166,14 @@ typedef enum SpvCapability_ { SpvCapabilityFragmentShaderPixelInterlockEXT = 5378, SpvCapabilityDemoteToHelperInvocation = 5379, SpvCapabilityDemoteToHelperInvocationEXT = 5379, + SpvCapabilityDisplacementMicromapNV = 5380, SpvCapabilityRayTracingOpacityMicromapEXT = 5381, SpvCapabilityShaderInvocationReorderNV = 5383, SpvCapabilityBindlessTextureNV = 5390, SpvCapabilityRayQueryPositionFetchKHR = 5391, + SpvCapabilityAtomicFloat16VectorNV = 5404, + SpvCapabilityRayTracingDisplacementMicromapNV = 5409, + SpvCapabilityRawAccessChainsNV = 5414, SpvCapabilitySubgroupShuffleINTEL = 5568, SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, SpvCapabilitySubgroupImageBlockIOINTEL = 5570, @@ -1180,23 +1226,32 @@ typedef enum SpvCapability_ { SpvCapabilityDotProductKHR = 6019, SpvCapabilityRayCullMaskKHR = 6020, SpvCapabilityCooperativeMatrixKHR = 6022, + SpvCapabilityReplicatedCompositesEXT = 6024, SpvCapabilityBitInstructions = 6025, SpvCapabilityGroupNonUniformRotateKHR = 6026, + SpvCapabilityFloatControls2 = 6029, SpvCapabilityAtomicFloat32AddEXT = 6033, SpvCapabilityAtomicFloat64AddEXT = 6034, - SpvCapabilityLongConstantCompositeINTEL = 6089, + SpvCapabilityLongCompositesINTEL = 6089, + SpvCapabilityOptNoneEXT = 6094, SpvCapabilityOptNoneINTEL = 6094, SpvCapabilityAtomicFloat16AddEXT = 6095, SpvCapabilityDebugInfoModuleINTEL = 6114, SpvCapabilityBFloat16ConversionINTEL = 6115, SpvCapabilitySplitBarrierINTEL = 6141, - SpvCapabilityGlobalVariableFPGADecorationsINTEL = 6146, + SpvCapabilityArithmeticFenceEXT = 6144, + SpvCapabilityFPGAClusterAttributesV2INTEL = 6150, SpvCapabilityFPGAKernelAttributesv2INTEL = 6161, - SpvCapabilityGlobalVariableHostAccessINTEL = 6167, SpvCapabilityFPMaxErrorINTEL = 6169, SpvCapabilityFPGALatencyControlINTEL = 6171, SpvCapabilityFPGAArgumentInterfacesINTEL = 6174, + SpvCapabilityGlobalVariableHostAccessINTEL = 6187, + SpvCapabilityGlobalVariableFPGADecorationsINTEL = 6189, + SpvCapabilitySubgroupBufferPrefetchINTEL = 6220, SpvCapabilityGroupUniformArithmeticKHR = 6400, + SpvCapabilityMaskedGatherScatterINTEL = 6427, + SpvCapabilityCacheControlsINTEL = 6441, + SpvCapabilityRegisterLimitsINTEL = 6460, SpvCapabilityMax = 0x7fffffff, } SpvCapability; @@ -1324,6 +1379,8 @@ typedef enum SpvCooperativeMatrixOperandsMask_ { typedef enum SpvCooperativeMatrixLayout_ { SpvCooperativeMatrixLayoutRowMajorKHR = 0, SpvCooperativeMatrixLayoutColumnMajorKHR = 1, + SpvCooperativeMatrixLayoutRowBlockedInterleavedARM = 4202, + SpvCooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203, SpvCooperativeMatrixLayoutMax = 0x7fffffff, } SpvCooperativeMatrixLayout; @@ -1348,6 +1405,44 @@ typedef enum SpvHostAccessQualifier_ { SpvHostAccessQualifierMax = 0x7fffffff, } SpvHostAccessQualifier; +typedef enum SpvLoadCacheControl_ { + SpvLoadCacheControlUncachedINTEL = 0, + SpvLoadCacheControlCachedINTEL = 1, + SpvLoadCacheControlStreamingINTEL = 2, + SpvLoadCacheControlInvalidateAfterReadINTEL = 3, + SpvLoadCacheControlConstCachedINTEL = 4, + SpvLoadCacheControlMax = 0x7fffffff, +} SpvLoadCacheControl; + +typedef enum SpvStoreCacheControl_ { + SpvStoreCacheControlUncachedINTEL = 0, + SpvStoreCacheControlWriteThroughINTEL = 1, + SpvStoreCacheControlWriteBackINTEL = 2, + SpvStoreCacheControlStreamingINTEL = 3, + SpvStoreCacheControlMax = 0x7fffffff, +} SpvStoreCacheControl; + +typedef enum SpvNamedMaximumNumberOfRegisters_ { + SpvNamedMaximumNumberOfRegistersAutoINTEL = 0, + SpvNamedMaximumNumberOfRegistersMax = 0x7fffffff, +} SpvNamedMaximumNumberOfRegisters; + +typedef enum SpvRawAccessChainOperandsShift_ { + SpvRawAccessChainOperandsRobustnessPerComponentNVShift = 0, + SpvRawAccessChainOperandsRobustnessPerElementNVShift = 1, + SpvRawAccessChainOperandsMax = 0x7fffffff, +} SpvRawAccessChainOperandsShift; + +typedef enum SpvRawAccessChainOperandsMask_ { + SpvRawAccessChainOperandsMaskNone = 0, + SpvRawAccessChainOperandsRobustnessPerComponentNVMask = 0x00000001, + SpvRawAccessChainOperandsRobustnessPerElementNVMask = 0x00000002, +} SpvRawAccessChainOperandsMask; + +typedef enum SpvFPEncoding_ { + SpvFPEncodingMax = 0x7fffffff, +} SpvFPEncoding; + typedef enum SpvOp_ { SpvOpNop = 0, SpvOpUndef = 1, @@ -1697,13 +1792,22 @@ typedef enum SpvOp_ { SpvOpDepthAttachmentReadEXT = 4161, SpvOpStencilAttachmentReadEXT = 4162, SpvOpTerminateInvocation = 4416, + SpvOpTypeUntypedPointerKHR = 4417, + SpvOpUntypedVariableKHR = 4418, + SpvOpUntypedAccessChainKHR = 4419, + SpvOpUntypedInBoundsAccessChainKHR = 4420, SpvOpSubgroupBallotKHR = 4421, SpvOpSubgroupFirstInvocationKHR = 4422, + SpvOpUntypedPtrAccessChainKHR = 4423, + SpvOpUntypedInBoundsPtrAccessChainKHR = 4424, + SpvOpUntypedArrayLengthKHR = 4425, + SpvOpUntypedPrefetchKHR = 4426, SpvOpSubgroupAllKHR = 4428, SpvOpSubgroupAnyKHR = 4429, SpvOpSubgroupAllEqualKHR = 4430, SpvOpGroupNonUniformRotateKHR = 4431, SpvOpSubgroupReadInvocationKHR = 4432, + SpvOpExtInstWithForwardRefsKHR = 4433, SpvOpTraceRayKHR = 4445, SpvOpExecuteCallableKHR = 4446, SpvOpConvertUToAccelerationStructureKHR = 4447, @@ -1726,6 +1830,9 @@ typedef enum SpvOp_ { SpvOpCooperativeMatrixStoreKHR = 4458, SpvOpCooperativeMatrixMulAddKHR = 4459, SpvOpCooperativeMatrixLengthKHR = 4460, + SpvOpConstantCompositeReplicateEXT = 4461, + SpvOpSpecConstantCompositeReplicateEXT = 4462, + SpvOpCompositeConstructReplicateEXT = 4463, SpvOpTypeRayQueryKHR = 4472, SpvOpRayQueryInitializeKHR = 4473, SpvOpRayQueryTerminateKHR = 4474, @@ -1737,6 +1844,10 @@ typedef enum SpvOp_ { SpvOpImageBoxFilterQCOM = 4481, SpvOpImageBlockMatchSSDQCOM = 4482, SpvOpImageBlockMatchSADQCOM = 4483, + SpvOpImageBlockMatchWindowSSDQCOM = 4500, + SpvOpImageBlockMatchWindowSADQCOM = 4501, + SpvOpImageBlockMatchGatherSSDQCOM = 4502, + SpvOpImageBlockMatchGatherSADQCOM = 4503, SpvOpGroupIAddNonUniformAMD = 5000, SpvOpGroupFAddNonUniformAMD = 5001, SpvOpGroupFMinNonUniformAMD = 5002, @@ -1748,9 +1859,16 @@ typedef enum SpvOp_ { SpvOpFragmentMaskFetchAMD = 5011, SpvOpFragmentFetchAMD = 5012, SpvOpReadClockKHR = 5056, - SpvOpFinalizeNodePayloadsAMDX = 5075, + SpvOpAllocateNodePayloadsAMDX = 5074, + SpvOpEnqueueNodePayloadsAMDX = 5075, + SpvOpTypeNodePayloadArrayAMDX = 5076, SpvOpFinishWritingNodePayloadAMDX = 5078, - SpvOpInitializeNodePayloadsAMDX = 5090, + SpvOpNodePayloadArrayLengthAMDX = 5090, + SpvOpIsNodePayloadValidAMDX = 5101, + SpvOpConstantStringAMDX = 5103, + SpvOpSpecConstantStringAMDX = 5104, + SpvOpGroupNonUniformQuadAllKHR = 5110, + SpvOpGroupNonUniformQuadAnyKHR = 5111, SpvOpHitObjectRecordHitMotionNV = 5249, SpvOpHitObjectRecordHitWithIndexMotionNV = 5250, SpvOpHitObjectRecordMissMotionNV = 5251, @@ -1789,6 +1907,8 @@ typedef enum SpvOp_ { SpvOpSetMeshOutputsEXT = 5295, SpvOpGroupNonUniformPartitionNV = 5296, SpvOpWritePackedPrimitiveIndices4x8NV = 5299, + SpvOpFetchMicroTriangleVertexPositionNV = 5300, + SpvOpFetchMicroTriangleVertexBarycentricNV = 5301, SpvOpReportIntersectionKHR = 5334, SpvOpReportIntersectionNV = 5334, SpvOpIgnoreIntersectionNV = 5335, @@ -1817,6 +1937,7 @@ typedef enum SpvOp_ { SpvOpConvertUToSampledImageNV = 5395, SpvOpConvertSampledImageToUNV = 5396, SpvOpSamplerImageAddressingModeNV = 5397, + SpvOpRawAccessChainNV = 5398, SpvOpSubgroupShuffleINTEL = 5571, SpvOpSubgroupShuffleDownINTEL = 5572, SpvOpSubgroupShuffleUpINTEL = 5573, @@ -2058,10 +2179,13 @@ typedef enum SpvOp_ { SpvOpTypeStructContinuedINTEL = 6090, SpvOpConstantCompositeContinuedINTEL = 6091, SpvOpSpecConstantCompositeContinuedINTEL = 6092, + SpvOpCompositeConstructContinuedINTEL = 6096, SpvOpConvertFToBF16INTEL = 6116, SpvOpConvertBF16ToFINTEL = 6117, SpvOpControlBarrierArriveINTEL = 6142, SpvOpControlBarrierWaitINTEL = 6143, + SpvOpArithmeticFenceEXT = 6145, + SpvOpSubgroupBlockPrefetchINTEL = 6221, SpvOpGroupIMulKHR = 6401, SpvOpGroupFMulKHR = 6402, SpvOpGroupBitwiseAndKHR = 6403, @@ -2070,6 +2194,8 @@ typedef enum SpvOp_ { SpvOpGroupLogicalAndKHR = 6406, SpvOpGroupLogicalOrKHR = 6407, SpvOpGroupLogicalXorKHR = 6408, + SpvOpMaskedGatherINTEL = 6428, + SpvOpMaskedScatterINTEL = 6429, SpvOpMax = 0x7fffffff, } SpvOp; @@ -2429,13 +2555,22 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case SpvOpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case SpvOpTerminateInvocation: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break; + case SpvOpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedInBoundsAccessChainKHR: *hasResult = true; *hasResultType = true; break; case SpvOpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; case SpvOpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedInBoundsPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedArrayLengthKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpUntypedPrefetchKHR: *hasResult = false; *hasResultType = false; break; case SpvOpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; case SpvOpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; case SpvOpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; case SpvOpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break; case SpvOpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break; case SpvOpTraceRayKHR: *hasResult = false; *hasResultType = false; break; case SpvOpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; case SpvOpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break; @@ -2452,6 +2587,9 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; case SpvOpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; case SpvOpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break; case SpvOpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; case SpvOpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; case SpvOpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; @@ -2463,6 +2601,10 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; case SpvOpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; case SpvOpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; case SpvOpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case SpvOpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case SpvOpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; @@ -2474,9 +2616,16 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; case SpvOpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; case SpvOpReadClockKHR: *hasResult = true; *hasResultType = true; break; - case SpvOpFinalizeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break; + case SpvOpAllocateNodePayloadsAMDX: *hasResult = true; *hasResultType = true; break; + case SpvOpEnqueueNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeNodePayloadArrayAMDX: *hasResult = true; *hasResultType = false; break; case SpvOpFinishWritingNodePayloadAMDX: *hasResult = true; *hasResultType = true; break; - case SpvOpInitializeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break; + case SpvOpNodePayloadArrayLengthAMDX: *hasResult = true; *hasResultType = true; break; + case SpvOpIsNodePayloadValidAMDX: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case SpvOpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case SpvOpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break; case SpvOpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; case SpvOpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; case SpvOpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; @@ -2515,14 +2664,16 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break; case SpvOpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; case SpvOpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; - case SpvOpReportIntersectionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break; + case SpvOpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break; case SpvOpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; case SpvOpTerminateRayNV: *hasResult = false; *hasResultType = false; break; case SpvOpTraceNV: *hasResult = false; *hasResultType = false; break; case SpvOpTraceMotionNV: *hasResult = false; *hasResultType = false; break; case SpvOpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; case SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break; - case SpvOpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break; case SpvOpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; case SpvOpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; case SpvOpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; @@ -2540,6 +2691,7 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break; case SpvOpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break; case SpvOpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break; + case SpvOpRawAccessChainNV: *hasResult = true; *hasResultType = true; break; case SpvOpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; case SpvOpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; case SpvOpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; @@ -2779,10 +2931,13 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; case SpvOpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; case SpvOpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpCompositeConstructContinuedINTEL: *hasResult = true; *hasResultType = true; break; case SpvOpConvertFToBF16INTEL: *hasResult = true; *hasResultType = true; break; case SpvOpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break; case SpvOpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; case SpvOpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpArithmeticFenceEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; case SpvOpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; case SpvOpGroupFMulKHR: *hasResult = true; *hasResultType = true; break; case SpvOpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break; @@ -2791,8 +2946,1821 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break; case SpvOpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break; case SpvOpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break; + } +} +inline const char* SpvSourceLanguageToString(SpvSourceLanguage value) { + switch (value) { + case SpvSourceLanguageUnknown: return "Unknown"; + case SpvSourceLanguageESSL: return "ESSL"; + case SpvSourceLanguageGLSL: return "GLSL"; + case SpvSourceLanguageOpenCL_C: return "OpenCL_C"; + case SpvSourceLanguageOpenCL_CPP: return "OpenCL_CPP"; + case SpvSourceLanguageHLSL: return "HLSL"; + case SpvSourceLanguageCPP_for_OpenCL: return "CPP_for_OpenCL"; + case SpvSourceLanguageSYCL: return "SYCL"; + case SpvSourceLanguageHERO_C: return "HERO_C"; + case SpvSourceLanguageNZSL: return "NZSL"; + case SpvSourceLanguageWGSL: return "WGSL"; + case SpvSourceLanguageSlang: return "Slang"; + case SpvSourceLanguageZig: return "Zig"; + default: return "Unknown"; + } +} + +inline const char* SpvExecutionModelToString(SpvExecutionModel value) { + switch (value) { + case SpvExecutionModelVertex: return "Vertex"; + case SpvExecutionModelTessellationControl: return "TessellationControl"; + case SpvExecutionModelTessellationEvaluation: return "TessellationEvaluation"; + case SpvExecutionModelGeometry: return "Geometry"; + case SpvExecutionModelFragment: return "Fragment"; + case SpvExecutionModelGLCompute: return "GLCompute"; + case SpvExecutionModelKernel: return "Kernel"; + case SpvExecutionModelTaskNV: return "TaskNV"; + case SpvExecutionModelMeshNV: return "MeshNV"; + case SpvExecutionModelRayGenerationKHR: return "RayGenerationKHR"; + case SpvExecutionModelIntersectionKHR: return "IntersectionKHR"; + case SpvExecutionModelAnyHitKHR: return "AnyHitKHR"; + case SpvExecutionModelClosestHitKHR: return "ClosestHitKHR"; + case SpvExecutionModelMissKHR: return "MissKHR"; + case SpvExecutionModelCallableKHR: return "CallableKHR"; + case SpvExecutionModelTaskEXT: return "TaskEXT"; + case SpvExecutionModelMeshEXT: return "MeshEXT"; + default: return "Unknown"; + } +} + +inline const char* SpvAddressingModelToString(SpvAddressingModel value) { + switch (value) { + case SpvAddressingModelLogical: return "Logical"; + case SpvAddressingModelPhysical32: return "Physical32"; + case SpvAddressingModelPhysical64: return "Physical64"; + case SpvAddressingModelPhysicalStorageBuffer64: return "PhysicalStorageBuffer64"; + default: return "Unknown"; + } +} + +inline const char* SpvMemoryModelToString(SpvMemoryModel value) { + switch (value) { + case SpvMemoryModelSimple: return "Simple"; + case SpvMemoryModelGLSL450: return "GLSL450"; + case SpvMemoryModelOpenCL: return "OpenCL"; + case SpvMemoryModelVulkan: return "Vulkan"; + default: return "Unknown"; + } +} + +inline const char* SpvExecutionModeToString(SpvExecutionMode value) { + switch (value) { + case SpvExecutionModeInvocations: return "Invocations"; + case SpvExecutionModeSpacingEqual: return "SpacingEqual"; + case SpvExecutionModeSpacingFractionalEven: return "SpacingFractionalEven"; + case SpvExecutionModeSpacingFractionalOdd: return "SpacingFractionalOdd"; + case SpvExecutionModeVertexOrderCw: return "VertexOrderCw"; + case SpvExecutionModeVertexOrderCcw: return "VertexOrderCcw"; + case SpvExecutionModePixelCenterInteger: return "PixelCenterInteger"; + case SpvExecutionModeOriginUpperLeft: return "OriginUpperLeft"; + case SpvExecutionModeOriginLowerLeft: return "OriginLowerLeft"; + case SpvExecutionModeEarlyFragmentTests: return "EarlyFragmentTests"; + case SpvExecutionModePointMode: return "PointMode"; + case SpvExecutionModeXfb: return "Xfb"; + case SpvExecutionModeDepthReplacing: return "DepthReplacing"; + case SpvExecutionModeDepthGreater: return "DepthGreater"; + case SpvExecutionModeDepthLess: return "DepthLess"; + case SpvExecutionModeDepthUnchanged: return "DepthUnchanged"; + case SpvExecutionModeLocalSize: return "LocalSize"; + case SpvExecutionModeLocalSizeHint: return "LocalSizeHint"; + case SpvExecutionModeInputPoints: return "InputPoints"; + case SpvExecutionModeInputLines: return "InputLines"; + case SpvExecutionModeInputLinesAdjacency: return "InputLinesAdjacency"; + case SpvExecutionModeTriangles: return "Triangles"; + case SpvExecutionModeInputTrianglesAdjacency: return "InputTrianglesAdjacency"; + case SpvExecutionModeQuads: return "Quads"; + case SpvExecutionModeIsolines: return "Isolines"; + case SpvExecutionModeOutputVertices: return "OutputVertices"; + case SpvExecutionModeOutputPoints: return "OutputPoints"; + case SpvExecutionModeOutputLineStrip: return "OutputLineStrip"; + case SpvExecutionModeOutputTriangleStrip: return "OutputTriangleStrip"; + case SpvExecutionModeVecTypeHint: return "VecTypeHint"; + case SpvExecutionModeContractionOff: return "ContractionOff"; + case SpvExecutionModeInitializer: return "Initializer"; + case SpvExecutionModeFinalizer: return "Finalizer"; + case SpvExecutionModeSubgroupSize: return "SubgroupSize"; + case SpvExecutionModeSubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup"; + case SpvExecutionModeSubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId"; + case SpvExecutionModeLocalSizeId: return "LocalSizeId"; + case SpvExecutionModeLocalSizeHintId: return "LocalSizeHintId"; + case SpvExecutionModeNonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; + case SpvExecutionModeNonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; + case SpvExecutionModeNonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + case SpvExecutionModeSubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR"; + case SpvExecutionModePostDepthCoverage: return "PostDepthCoverage"; + case SpvExecutionModeDenormPreserve: return "DenormPreserve"; + case SpvExecutionModeDenormFlushToZero: return "DenormFlushToZero"; + case SpvExecutionModeSignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case SpvExecutionModeRoundingModeRTE: return "RoundingModeRTE"; + case SpvExecutionModeRoundingModeRTZ: return "RoundingModeRTZ"; + case SpvExecutionModeEarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD"; + case SpvExecutionModeStencilRefReplacingEXT: return "StencilRefReplacingEXT"; + case SpvExecutionModeCoalescingAMDX: return "CoalescingAMDX"; + case SpvExecutionModeIsApiEntryAMDX: return "IsApiEntryAMDX"; + case SpvExecutionModeMaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX"; + case SpvExecutionModeStaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX"; + case SpvExecutionModeShaderIndexAMDX: return "ShaderIndexAMDX"; + case SpvExecutionModeMaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX"; + case SpvExecutionModeStencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD"; + case SpvExecutionModeStencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD"; + case SpvExecutionModeStencilRefLessFrontAMD: return "StencilRefLessFrontAMD"; + case SpvExecutionModeStencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD"; + case SpvExecutionModeStencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD"; + case SpvExecutionModeStencilRefLessBackAMD: return "StencilRefLessBackAMD"; + case SpvExecutionModeQuadDerivativesKHR: return "QuadDerivativesKHR"; + case SpvExecutionModeRequireFullQuadsKHR: return "RequireFullQuadsKHR"; + case SpvExecutionModeSharesInputWithAMDX: return "SharesInputWithAMDX"; + case SpvExecutionModeOutputLinesEXT: return "OutputLinesEXT"; + case SpvExecutionModeOutputPrimitivesEXT: return "OutputPrimitivesEXT"; + case SpvExecutionModeDerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR"; + case SpvExecutionModeDerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR"; + case SpvExecutionModeOutputTrianglesEXT: return "OutputTrianglesEXT"; + case SpvExecutionModePixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT"; + case SpvExecutionModePixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT"; + case SpvExecutionModeSampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT"; + case SpvExecutionModeSampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT"; + case SpvExecutionModeShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT"; + case SpvExecutionModeShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT"; + case SpvExecutionModeSharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL"; + case SpvExecutionModeRoundingModeRTPINTEL: return "RoundingModeRTPINTEL"; + case SpvExecutionModeRoundingModeRTNINTEL: return "RoundingModeRTNINTEL"; + case SpvExecutionModeFloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL"; + case SpvExecutionModeFloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL"; + case SpvExecutionModeMaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL"; + case SpvExecutionModeMaxWorkDimINTEL: return "MaxWorkDimINTEL"; + case SpvExecutionModeNoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; + case SpvExecutionModeNumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + case SpvExecutionModeSchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL"; + case SpvExecutionModeMaximallyReconvergesKHR: return "MaximallyReconvergesKHR"; + case SpvExecutionModeFPFastMathDefault: return "FPFastMathDefault"; + case SpvExecutionModeStreamingInterfaceINTEL: return "StreamingInterfaceINTEL"; + case SpvExecutionModeRegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL"; + case SpvExecutionModeNamedBarrierCountINTEL: return "NamedBarrierCountINTEL"; + case SpvExecutionModeMaximumRegistersINTEL: return "MaximumRegistersINTEL"; + case SpvExecutionModeMaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL"; + case SpvExecutionModeNamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvStorageClassToString(SpvStorageClass value) { + switch (value) { + case SpvStorageClassUniformConstant: return "UniformConstant"; + case SpvStorageClassInput: return "Input"; + case SpvStorageClassUniform: return "Uniform"; + case SpvStorageClassOutput: return "Output"; + case SpvStorageClassWorkgroup: return "Workgroup"; + case SpvStorageClassCrossWorkgroup: return "CrossWorkgroup"; + case SpvStorageClassPrivate: return "Private"; + case SpvStorageClassFunction: return "Function"; + case SpvStorageClassGeneric: return "Generic"; + case SpvStorageClassPushConstant: return "PushConstant"; + case SpvStorageClassAtomicCounter: return "AtomicCounter"; + case SpvStorageClassImage: return "Image"; + case SpvStorageClassStorageBuffer: return "StorageBuffer"; + case SpvStorageClassTileImageEXT: return "TileImageEXT"; + case SpvStorageClassNodePayloadAMDX: return "NodePayloadAMDX"; + case SpvStorageClassCallableDataKHR: return "CallableDataKHR"; + case SpvStorageClassIncomingCallableDataKHR: return "IncomingCallableDataKHR"; + case SpvStorageClassRayPayloadKHR: return "RayPayloadKHR"; + case SpvStorageClassHitAttributeKHR: return "HitAttributeKHR"; + case SpvStorageClassIncomingRayPayloadKHR: return "IncomingRayPayloadKHR"; + case SpvStorageClassShaderRecordBufferKHR: return "ShaderRecordBufferKHR"; + case SpvStorageClassPhysicalStorageBuffer: return "PhysicalStorageBuffer"; + case SpvStorageClassHitObjectAttributeNV: return "HitObjectAttributeNV"; + case SpvStorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case SpvStorageClassCodeSectionINTEL: return "CodeSectionINTEL"; + case SpvStorageClassDeviceOnlyINTEL: return "DeviceOnlyINTEL"; + case SpvStorageClassHostOnlyINTEL: return "HostOnlyINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvDimToString(SpvDim value) { + switch (value) { + case SpvDim1D: return "1D"; + case SpvDim2D: return "2D"; + case SpvDim3D: return "3D"; + case SpvDimCube: return "Cube"; + case SpvDimRect: return "Rect"; + case SpvDimBuffer: return "Buffer"; + case SpvDimSubpassData: return "SubpassData"; + case SpvDimTileImageDataEXT: return "TileImageDataEXT"; + default: return "Unknown"; + } +} + +inline const char* SpvSamplerAddressingModeToString(SpvSamplerAddressingMode value) { + switch (value) { + case SpvSamplerAddressingModeNone: return "None"; + case SpvSamplerAddressingModeClampToEdge: return "ClampToEdge"; + case SpvSamplerAddressingModeClamp: return "Clamp"; + case SpvSamplerAddressingModeRepeat: return "Repeat"; + case SpvSamplerAddressingModeRepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* SpvSamplerFilterModeToString(SpvSamplerFilterMode value) { + switch (value) { + case SpvSamplerFilterModeNearest: return "Nearest"; + case SpvSamplerFilterModeLinear: return "Linear"; + default: return "Unknown"; + } +} + +inline const char* SpvImageFormatToString(SpvImageFormat value) { + switch (value) { + case SpvImageFormatUnknown: return "Unknown"; + case SpvImageFormatRgba32f: return "Rgba32f"; + case SpvImageFormatRgba16f: return "Rgba16f"; + case SpvImageFormatR32f: return "R32f"; + case SpvImageFormatRgba8: return "Rgba8"; + case SpvImageFormatRgba8Snorm: return "Rgba8Snorm"; + case SpvImageFormatRg32f: return "Rg32f"; + case SpvImageFormatRg16f: return "Rg16f"; + case SpvImageFormatR11fG11fB10f: return "R11fG11fB10f"; + case SpvImageFormatR16f: return "R16f"; + case SpvImageFormatRgba16: return "Rgba16"; + case SpvImageFormatRgb10A2: return "Rgb10A2"; + case SpvImageFormatRg16: return "Rg16"; + case SpvImageFormatRg8: return "Rg8"; + case SpvImageFormatR16: return "R16"; + case SpvImageFormatR8: return "R8"; + case SpvImageFormatRgba16Snorm: return "Rgba16Snorm"; + case SpvImageFormatRg16Snorm: return "Rg16Snorm"; + case SpvImageFormatRg8Snorm: return "Rg8Snorm"; + case SpvImageFormatR16Snorm: return "R16Snorm"; + case SpvImageFormatR8Snorm: return "R8Snorm"; + case SpvImageFormatRgba32i: return "Rgba32i"; + case SpvImageFormatRgba16i: return "Rgba16i"; + case SpvImageFormatRgba8i: return "Rgba8i"; + case SpvImageFormatR32i: return "R32i"; + case SpvImageFormatRg32i: return "Rg32i"; + case SpvImageFormatRg16i: return "Rg16i"; + case SpvImageFormatRg8i: return "Rg8i"; + case SpvImageFormatR16i: return "R16i"; + case SpvImageFormatR8i: return "R8i"; + case SpvImageFormatRgba32ui: return "Rgba32ui"; + case SpvImageFormatRgba16ui: return "Rgba16ui"; + case SpvImageFormatRgba8ui: return "Rgba8ui"; + case SpvImageFormatR32ui: return "R32ui"; + case SpvImageFormatRgb10a2ui: return "Rgb10a2ui"; + case SpvImageFormatRg32ui: return "Rg32ui"; + case SpvImageFormatRg16ui: return "Rg16ui"; + case SpvImageFormatRg8ui: return "Rg8ui"; + case SpvImageFormatR16ui: return "R16ui"; + case SpvImageFormatR8ui: return "R8ui"; + case SpvImageFormatR64ui: return "R64ui"; + case SpvImageFormatR64i: return "R64i"; + default: return "Unknown"; + } +} + +inline const char* SpvImageChannelOrderToString(SpvImageChannelOrder value) { + switch (value) { + case SpvImageChannelOrderR: return "R"; + case SpvImageChannelOrderA: return "A"; + case SpvImageChannelOrderRG: return "RG"; + case SpvImageChannelOrderRA: return "RA"; + case SpvImageChannelOrderRGB: return "RGB"; + case SpvImageChannelOrderRGBA: return "RGBA"; + case SpvImageChannelOrderBGRA: return "BGRA"; + case SpvImageChannelOrderARGB: return "ARGB"; + case SpvImageChannelOrderIntensity: return "Intensity"; + case SpvImageChannelOrderLuminance: return "Luminance"; + case SpvImageChannelOrderRx: return "Rx"; + case SpvImageChannelOrderRGx: return "RGx"; + case SpvImageChannelOrderRGBx: return "RGBx"; + case SpvImageChannelOrderDepth: return "Depth"; + case SpvImageChannelOrderDepthStencil: return "DepthStencil"; + case SpvImageChannelOrdersRGB: return "sRGB"; + case SpvImageChannelOrdersRGBx: return "sRGBx"; + case SpvImageChannelOrdersRGBA: return "sRGBA"; + case SpvImageChannelOrdersBGRA: return "sBGRA"; + case SpvImageChannelOrderABGR: return "ABGR"; + default: return "Unknown"; + } +} + +inline const char* SpvImageChannelDataTypeToString(SpvImageChannelDataType value) { + switch (value) { + case SpvImageChannelDataTypeSnormInt8: return "SnormInt8"; + case SpvImageChannelDataTypeSnormInt16: return "SnormInt16"; + case SpvImageChannelDataTypeUnormInt8: return "UnormInt8"; + case SpvImageChannelDataTypeUnormInt16: return "UnormInt16"; + case SpvImageChannelDataTypeUnormShort565: return "UnormShort565"; + case SpvImageChannelDataTypeUnormShort555: return "UnormShort555"; + case SpvImageChannelDataTypeUnormInt101010: return "UnormInt101010"; + case SpvImageChannelDataTypeSignedInt8: return "SignedInt8"; + case SpvImageChannelDataTypeSignedInt16: return "SignedInt16"; + case SpvImageChannelDataTypeSignedInt32: return "SignedInt32"; + case SpvImageChannelDataTypeUnsignedInt8: return "UnsignedInt8"; + case SpvImageChannelDataTypeUnsignedInt16: return "UnsignedInt16"; + case SpvImageChannelDataTypeUnsignedInt32: return "UnsignedInt32"; + case SpvImageChannelDataTypeHalfFloat: return "HalfFloat"; + case SpvImageChannelDataTypeFloat: return "Float"; + case SpvImageChannelDataTypeUnormInt24: return "UnormInt24"; + case SpvImageChannelDataTypeUnormInt101010_2: return "UnormInt101010_2"; + case SpvImageChannelDataTypeUnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT"; + case SpvImageChannelDataTypeUnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT"; + case SpvImageChannelDataTypeUnormInt2_101010EXT: return "UnormInt2_101010EXT"; + default: return "Unknown"; + } +} + +inline const char* SpvFPRoundingModeToString(SpvFPRoundingMode value) { + switch (value) { + case SpvFPRoundingModeRTE: return "RTE"; + case SpvFPRoundingModeRTZ: return "RTZ"; + case SpvFPRoundingModeRTP: return "RTP"; + case SpvFPRoundingModeRTN: return "RTN"; + default: return "Unknown"; + } +} + +inline const char* SpvLinkageTypeToString(SpvLinkageType value) { + switch (value) { + case SpvLinkageTypeExport: return "Export"; + case SpvLinkageTypeImport: return "Import"; + case SpvLinkageTypeLinkOnceODR: return "LinkOnceODR"; + default: return "Unknown"; + } +} + +inline const char* SpvAccessQualifierToString(SpvAccessQualifier value) { + switch (value) { + case SpvAccessQualifierReadOnly: return "ReadOnly"; + case SpvAccessQualifierWriteOnly: return "WriteOnly"; + case SpvAccessQualifierReadWrite: return "ReadWrite"; + default: return "Unknown"; + } +} + +inline const char* SpvFunctionParameterAttributeToString(SpvFunctionParameterAttribute value) { + switch (value) { + case SpvFunctionParameterAttributeZext: return "Zext"; + case SpvFunctionParameterAttributeSext: return "Sext"; + case SpvFunctionParameterAttributeByVal: return "ByVal"; + case SpvFunctionParameterAttributeSret: return "Sret"; + case SpvFunctionParameterAttributeNoAlias: return "NoAlias"; + case SpvFunctionParameterAttributeNoCapture: return "NoCapture"; + case SpvFunctionParameterAttributeNoWrite: return "NoWrite"; + case SpvFunctionParameterAttributeNoReadWrite: return "NoReadWrite"; + case SpvFunctionParameterAttributeRuntimeAlignedINTEL: return "RuntimeAlignedINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvDecorationToString(SpvDecoration value) { + switch (value) { + case SpvDecorationRelaxedPrecision: return "RelaxedPrecision"; + case SpvDecorationSpecId: return "SpecId"; + case SpvDecorationBlock: return "Block"; + case SpvDecorationBufferBlock: return "BufferBlock"; + case SpvDecorationRowMajor: return "RowMajor"; + case SpvDecorationColMajor: return "ColMajor"; + case SpvDecorationArrayStride: return "ArrayStride"; + case SpvDecorationMatrixStride: return "MatrixStride"; + case SpvDecorationGLSLShared: return "GLSLShared"; + case SpvDecorationGLSLPacked: return "GLSLPacked"; + case SpvDecorationCPacked: return "CPacked"; + case SpvDecorationBuiltIn: return "BuiltIn"; + case SpvDecorationNoPerspective: return "NoPerspective"; + case SpvDecorationFlat: return "Flat"; + case SpvDecorationPatch: return "Patch"; + case SpvDecorationCentroid: return "Centroid"; + case SpvDecorationSample: return "Sample"; + case SpvDecorationInvariant: return "Invariant"; + case SpvDecorationRestrict: return "Restrict"; + case SpvDecorationAliased: return "Aliased"; + case SpvDecorationVolatile: return "Volatile"; + case SpvDecorationConstant: return "Constant"; + case SpvDecorationCoherent: return "Coherent"; + case SpvDecorationNonWritable: return "NonWritable"; + case SpvDecorationNonReadable: return "NonReadable"; + case SpvDecorationUniform: return "Uniform"; + case SpvDecorationUniformId: return "UniformId"; + case SpvDecorationSaturatedConversion: return "SaturatedConversion"; + case SpvDecorationStream: return "Stream"; + case SpvDecorationLocation: return "Location"; + case SpvDecorationComponent: return "Component"; + case SpvDecorationIndex: return "Index"; + case SpvDecorationBinding: return "Binding"; + case SpvDecorationDescriptorSet: return "DescriptorSet"; + case SpvDecorationOffset: return "Offset"; + case SpvDecorationXfbBuffer: return "XfbBuffer"; + case SpvDecorationXfbStride: return "XfbStride"; + case SpvDecorationFuncParamAttr: return "FuncParamAttr"; + case SpvDecorationFPRoundingMode: return "FPRoundingMode"; + case SpvDecorationFPFastMathMode: return "FPFastMathMode"; + case SpvDecorationLinkageAttributes: return "LinkageAttributes"; + case SpvDecorationNoContraction: return "NoContraction"; + case SpvDecorationInputAttachmentIndex: return "InputAttachmentIndex"; + case SpvDecorationAlignment: return "Alignment"; + case SpvDecorationMaxByteOffset: return "MaxByteOffset"; + case SpvDecorationAlignmentId: return "AlignmentId"; + case SpvDecorationMaxByteOffsetId: return "MaxByteOffsetId"; + case SpvDecorationNoSignedWrap: return "NoSignedWrap"; + case SpvDecorationNoUnsignedWrap: return "NoUnsignedWrap"; + case SpvDecorationWeightTextureQCOM: return "WeightTextureQCOM"; + case SpvDecorationBlockMatchTextureQCOM: return "BlockMatchTextureQCOM"; + case SpvDecorationBlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM"; + case SpvDecorationExplicitInterpAMD: return "ExplicitInterpAMD"; + case SpvDecorationNodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX"; + case SpvDecorationNodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX"; + case SpvDecorationTrackFinishWritingAMDX: return "TrackFinishWritingAMDX"; + case SpvDecorationPayloadNodeNameAMDX: return "PayloadNodeNameAMDX"; + case SpvDecorationPayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX"; + case SpvDecorationPayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX"; + case SpvDecorationPayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX"; + case SpvDecorationPayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX"; + case SpvDecorationOverrideCoverageNV: return "OverrideCoverageNV"; + case SpvDecorationPassthroughNV: return "PassthroughNV"; + case SpvDecorationViewportRelativeNV: return "ViewportRelativeNV"; + case SpvDecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case SpvDecorationPerPrimitiveEXT: return "PerPrimitiveEXT"; + case SpvDecorationPerViewNV: return "PerViewNV"; + case SpvDecorationPerTaskNV: return "PerTaskNV"; + case SpvDecorationPerVertexKHR: return "PerVertexKHR"; + case SpvDecorationNonUniform: return "NonUniform"; + case SpvDecorationRestrictPointer: return "RestrictPointer"; + case SpvDecorationAliasedPointer: return "AliasedPointer"; + case SpvDecorationHitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV"; + case SpvDecorationBindlessSamplerNV: return "BindlessSamplerNV"; + case SpvDecorationBindlessImageNV: return "BindlessImageNV"; + case SpvDecorationBoundSamplerNV: return "BoundSamplerNV"; + case SpvDecorationBoundImageNV: return "BoundImageNV"; + case SpvDecorationSIMTCallINTEL: return "SIMTCallINTEL"; + case SpvDecorationReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL"; + case SpvDecorationClobberINTEL: return "ClobberINTEL"; + case SpvDecorationSideEffectsINTEL: return "SideEffectsINTEL"; + case SpvDecorationVectorComputeVariableINTEL: return "VectorComputeVariableINTEL"; + case SpvDecorationFuncParamIOKindINTEL: return "FuncParamIOKindINTEL"; + case SpvDecorationVectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL"; + case SpvDecorationStackCallINTEL: return "StackCallINTEL"; + case SpvDecorationGlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL"; + case SpvDecorationCounterBuffer: return "CounterBuffer"; + case SpvDecorationHlslSemanticGOOGLE: return "HlslSemanticGOOGLE"; + case SpvDecorationUserTypeGOOGLE: return "UserTypeGOOGLE"; + case SpvDecorationFunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL"; + case SpvDecorationFunctionDenormModeINTEL: return "FunctionDenormModeINTEL"; + case SpvDecorationRegisterINTEL: return "RegisterINTEL"; + case SpvDecorationMemoryINTEL: return "MemoryINTEL"; + case SpvDecorationNumbanksINTEL: return "NumbanksINTEL"; + case SpvDecorationBankwidthINTEL: return "BankwidthINTEL"; + case SpvDecorationMaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL"; + case SpvDecorationSinglepumpINTEL: return "SinglepumpINTEL"; + case SpvDecorationDoublepumpINTEL: return "DoublepumpINTEL"; + case SpvDecorationMaxReplicatesINTEL: return "MaxReplicatesINTEL"; + case SpvDecorationSimpleDualPortINTEL: return "SimpleDualPortINTEL"; + case SpvDecorationMergeINTEL: return "MergeINTEL"; + case SpvDecorationBankBitsINTEL: return "BankBitsINTEL"; + case SpvDecorationForcePow2DepthINTEL: return "ForcePow2DepthINTEL"; + case SpvDecorationStridesizeINTEL: return "StridesizeINTEL"; + case SpvDecorationWordsizeINTEL: return "WordsizeINTEL"; + case SpvDecorationTrueDualPortINTEL: return "TrueDualPortINTEL"; + case SpvDecorationBurstCoalesceINTEL: return "BurstCoalesceINTEL"; + case SpvDecorationCacheSizeINTEL: return "CacheSizeINTEL"; + case SpvDecorationDontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL"; + case SpvDecorationPrefetchINTEL: return "PrefetchINTEL"; + case SpvDecorationStallEnableINTEL: return "StallEnableINTEL"; + case SpvDecorationFuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL"; + case SpvDecorationMathOpDSPModeINTEL: return "MathOpDSPModeINTEL"; + case SpvDecorationAliasScopeINTEL: return "AliasScopeINTEL"; + case SpvDecorationNoAliasINTEL: return "NoAliasINTEL"; + case SpvDecorationInitiationIntervalINTEL: return "InitiationIntervalINTEL"; + case SpvDecorationMaxConcurrencyINTEL: return "MaxConcurrencyINTEL"; + case SpvDecorationPipelineEnableINTEL: return "PipelineEnableINTEL"; + case SpvDecorationBufferLocationINTEL: return "BufferLocationINTEL"; + case SpvDecorationIOPipeStorageINTEL: return "IOPipeStorageINTEL"; + case SpvDecorationFunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL"; + case SpvDecorationSingleElementVectorINTEL: return "SingleElementVectorINTEL"; + case SpvDecorationVectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL"; + case SpvDecorationMediaBlockIOINTEL: return "MediaBlockIOINTEL"; + case SpvDecorationStallFreeINTEL: return "StallFreeINTEL"; + case SpvDecorationFPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL"; + case SpvDecorationLatencyControlLabelINTEL: return "LatencyControlLabelINTEL"; + case SpvDecorationLatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL"; + case SpvDecorationConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL"; + case SpvDecorationRegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL"; + case SpvDecorationMMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL"; + case SpvDecorationMMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL"; + case SpvDecorationMMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL"; + case SpvDecorationMMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL"; + case SpvDecorationMMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL"; + case SpvDecorationMMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL"; + case SpvDecorationStableKernelArgumentINTEL: return "StableKernelArgumentINTEL"; + case SpvDecorationHostAccessINTEL: return "HostAccessINTEL"; + case SpvDecorationInitModeINTEL: return "InitModeINTEL"; + case SpvDecorationImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL"; + case SpvDecorationCacheControlLoadINTEL: return "CacheControlLoadINTEL"; + case SpvDecorationCacheControlStoreINTEL: return "CacheControlStoreINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvBuiltInToString(SpvBuiltIn value) { + switch (value) { + case SpvBuiltInPosition: return "Position"; + case SpvBuiltInPointSize: return "PointSize"; + case SpvBuiltInClipDistance: return "ClipDistance"; + case SpvBuiltInCullDistance: return "CullDistance"; + case SpvBuiltInVertexId: return "VertexId"; + case SpvBuiltInInstanceId: return "InstanceId"; + case SpvBuiltInPrimitiveId: return "PrimitiveId"; + case SpvBuiltInInvocationId: return "InvocationId"; + case SpvBuiltInLayer: return "Layer"; + case SpvBuiltInViewportIndex: return "ViewportIndex"; + case SpvBuiltInTessLevelOuter: return "TessLevelOuter"; + case SpvBuiltInTessLevelInner: return "TessLevelInner"; + case SpvBuiltInTessCoord: return "TessCoord"; + case SpvBuiltInPatchVertices: return "PatchVertices"; + case SpvBuiltInFragCoord: return "FragCoord"; + case SpvBuiltInPointCoord: return "PointCoord"; + case SpvBuiltInFrontFacing: return "FrontFacing"; + case SpvBuiltInSampleId: return "SampleId"; + case SpvBuiltInSamplePosition: return "SamplePosition"; + case SpvBuiltInSampleMask: return "SampleMask"; + case SpvBuiltInFragDepth: return "FragDepth"; + case SpvBuiltInHelperInvocation: return "HelperInvocation"; + case SpvBuiltInNumWorkgroups: return "NumWorkgroups"; + case SpvBuiltInWorkgroupSize: return "WorkgroupSize"; + case SpvBuiltInWorkgroupId: return "WorkgroupId"; + case SpvBuiltInLocalInvocationId: return "LocalInvocationId"; + case SpvBuiltInGlobalInvocationId: return "GlobalInvocationId"; + case SpvBuiltInLocalInvocationIndex: return "LocalInvocationIndex"; + case SpvBuiltInWorkDim: return "WorkDim"; + case SpvBuiltInGlobalSize: return "GlobalSize"; + case SpvBuiltInEnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize"; + case SpvBuiltInGlobalOffset: return "GlobalOffset"; + case SpvBuiltInGlobalLinearId: return "GlobalLinearId"; + case SpvBuiltInSubgroupSize: return "SubgroupSize"; + case SpvBuiltInSubgroupMaxSize: return "SubgroupMaxSize"; + case SpvBuiltInNumSubgroups: return "NumSubgroups"; + case SpvBuiltInNumEnqueuedSubgroups: return "NumEnqueuedSubgroups"; + case SpvBuiltInSubgroupId: return "SubgroupId"; + case SpvBuiltInSubgroupLocalInvocationId: return "SubgroupLocalInvocationId"; + case SpvBuiltInVertexIndex: return "VertexIndex"; + case SpvBuiltInInstanceIndex: return "InstanceIndex"; + case SpvBuiltInCoreIDARM: return "CoreIDARM"; + case SpvBuiltInCoreCountARM: return "CoreCountARM"; + case SpvBuiltInCoreMaxIDARM: return "CoreMaxIDARM"; + case SpvBuiltInWarpIDARM: return "WarpIDARM"; + case SpvBuiltInWarpMaxIDARM: return "WarpMaxIDARM"; + case SpvBuiltInSubgroupEqMask: return "SubgroupEqMask"; + case SpvBuiltInSubgroupGeMask: return "SubgroupGeMask"; + case SpvBuiltInSubgroupGtMask: return "SubgroupGtMask"; + case SpvBuiltInSubgroupLeMask: return "SubgroupLeMask"; + case SpvBuiltInSubgroupLtMask: return "SubgroupLtMask"; + case SpvBuiltInBaseVertex: return "BaseVertex"; + case SpvBuiltInBaseInstance: return "BaseInstance"; + case SpvBuiltInDrawIndex: return "DrawIndex"; + case SpvBuiltInPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + case SpvBuiltInDeviceIndex: return "DeviceIndex"; + case SpvBuiltInViewIndex: return "ViewIndex"; + case SpvBuiltInShadingRateKHR: return "ShadingRateKHR"; + case SpvBuiltInBaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD"; + case SpvBuiltInBaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD"; + case SpvBuiltInBaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD"; + case SpvBuiltInBaryCoordSmoothAMD: return "BaryCoordSmoothAMD"; + case SpvBuiltInBaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD"; + case SpvBuiltInBaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD"; + case SpvBuiltInBaryCoordPullModelAMD: return "BaryCoordPullModelAMD"; + case SpvBuiltInFragStencilRefEXT: return "FragStencilRefEXT"; + case SpvBuiltInRemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX"; + case SpvBuiltInShaderIndexAMDX: return "ShaderIndexAMDX"; + case SpvBuiltInViewportMaskNV: return "ViewportMaskNV"; + case SpvBuiltInSecondaryPositionNV: return "SecondaryPositionNV"; + case SpvBuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case SpvBuiltInPositionPerViewNV: return "PositionPerViewNV"; + case SpvBuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case SpvBuiltInFullyCoveredEXT: return "FullyCoveredEXT"; + case SpvBuiltInTaskCountNV: return "TaskCountNV"; + case SpvBuiltInPrimitiveCountNV: return "PrimitiveCountNV"; + case SpvBuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case SpvBuiltInClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case SpvBuiltInCullDistancePerViewNV: return "CullDistancePerViewNV"; + case SpvBuiltInLayerPerViewNV: return "LayerPerViewNV"; + case SpvBuiltInMeshViewCountNV: return "MeshViewCountNV"; + case SpvBuiltInMeshViewIndicesNV: return "MeshViewIndicesNV"; + case SpvBuiltInBaryCoordKHR: return "BaryCoordKHR"; + case SpvBuiltInBaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR"; + case SpvBuiltInFragSizeEXT: return "FragSizeEXT"; + case SpvBuiltInFragInvocationCountEXT: return "FragInvocationCountEXT"; + case SpvBuiltInPrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT"; + case SpvBuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; + case SpvBuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; + case SpvBuiltInCullPrimitiveEXT: return "CullPrimitiveEXT"; + case SpvBuiltInLaunchIdKHR: return "LaunchIdKHR"; + case SpvBuiltInLaunchSizeKHR: return "LaunchSizeKHR"; + case SpvBuiltInWorldRayOriginKHR: return "WorldRayOriginKHR"; + case SpvBuiltInWorldRayDirectionKHR: return "WorldRayDirectionKHR"; + case SpvBuiltInObjectRayOriginKHR: return "ObjectRayOriginKHR"; + case SpvBuiltInObjectRayDirectionKHR: return "ObjectRayDirectionKHR"; + case SpvBuiltInRayTminKHR: return "RayTminKHR"; + case SpvBuiltInRayTmaxKHR: return "RayTmaxKHR"; + case SpvBuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; + case SpvBuiltInObjectToWorldKHR: return "ObjectToWorldKHR"; + case SpvBuiltInWorldToObjectKHR: return "WorldToObjectKHR"; + case SpvBuiltInHitTNV: return "HitTNV"; + case SpvBuiltInHitKindKHR: return "HitKindKHR"; + case SpvBuiltInCurrentRayTimeNV: return "CurrentRayTimeNV"; + case SpvBuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case SpvBuiltInHitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case SpvBuiltInHitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case SpvBuiltInIncomingRayFlagsKHR: return "IncomingRayFlagsKHR"; + case SpvBuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR"; + case SpvBuiltInWarpsPerSMNV: return "WarpsPerSMNV"; + case SpvBuiltInSMCountNV: return "SMCountNV"; + case SpvBuiltInWarpIDNV: return "WarpIDNV"; + case SpvBuiltInSMIDNV: return "SMIDNV"; + case SpvBuiltInHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case SpvBuiltInHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + case SpvBuiltInCullMaskKHR: return "CullMaskKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvScopeToString(SpvScope value) { + switch (value) { + case SpvScopeCrossDevice: return "CrossDevice"; + case SpvScopeDevice: return "Device"; + case SpvScopeWorkgroup: return "Workgroup"; + case SpvScopeSubgroup: return "Subgroup"; + case SpvScopeInvocation: return "Invocation"; + case SpvScopeQueueFamily: return "QueueFamily"; + case SpvScopeShaderCallKHR: return "ShaderCallKHR"; + default: return "Unknown"; } } + +inline const char* SpvGroupOperationToString(SpvGroupOperation value) { + switch (value) { + case SpvGroupOperationReduce: return "Reduce"; + case SpvGroupOperationInclusiveScan: return "InclusiveScan"; + case SpvGroupOperationExclusiveScan: return "ExclusiveScan"; + case SpvGroupOperationClusteredReduce: return "ClusteredReduce"; + case SpvGroupOperationPartitionedReduceNV: return "PartitionedReduceNV"; + case SpvGroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case SpvGroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; + default: return "Unknown"; + } +} + +inline const char* SpvKernelEnqueueFlagsToString(SpvKernelEnqueueFlags value) { + switch (value) { + case SpvKernelEnqueueFlagsNoWait: return "NoWait"; + case SpvKernelEnqueueFlagsWaitKernel: return "WaitKernel"; + case SpvKernelEnqueueFlagsWaitWorkGroup: return "WaitWorkGroup"; + default: return "Unknown"; + } +} + +inline const char* SpvCapabilityToString(SpvCapability value) { + switch (value) { + case SpvCapabilityMatrix: return "Matrix"; + case SpvCapabilityShader: return "Shader"; + case SpvCapabilityGeometry: return "Geometry"; + case SpvCapabilityTessellation: return "Tessellation"; + case SpvCapabilityAddresses: return "Addresses"; + case SpvCapabilityLinkage: return "Linkage"; + case SpvCapabilityKernel: return "Kernel"; + case SpvCapabilityVector16: return "Vector16"; + case SpvCapabilityFloat16Buffer: return "Float16Buffer"; + case SpvCapabilityFloat16: return "Float16"; + case SpvCapabilityFloat64: return "Float64"; + case SpvCapabilityInt64: return "Int64"; + case SpvCapabilityInt64Atomics: return "Int64Atomics"; + case SpvCapabilityImageBasic: return "ImageBasic"; + case SpvCapabilityImageReadWrite: return "ImageReadWrite"; + case SpvCapabilityImageMipmap: return "ImageMipmap"; + case SpvCapabilityPipes: return "Pipes"; + case SpvCapabilityGroups: return "Groups"; + case SpvCapabilityDeviceEnqueue: return "DeviceEnqueue"; + case SpvCapabilityLiteralSampler: return "LiteralSampler"; + case SpvCapabilityAtomicStorage: return "AtomicStorage"; + case SpvCapabilityInt16: return "Int16"; + case SpvCapabilityTessellationPointSize: return "TessellationPointSize"; + case SpvCapabilityGeometryPointSize: return "GeometryPointSize"; + case SpvCapabilityImageGatherExtended: return "ImageGatherExtended"; + case SpvCapabilityStorageImageMultisample: return "StorageImageMultisample"; + case SpvCapabilityUniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing"; + case SpvCapabilitySampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing"; + case SpvCapabilityStorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing"; + case SpvCapabilityStorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing"; + case SpvCapabilityClipDistance: return "ClipDistance"; + case SpvCapabilityCullDistance: return "CullDistance"; + case SpvCapabilityImageCubeArray: return "ImageCubeArray"; + case SpvCapabilitySampleRateShading: return "SampleRateShading"; + case SpvCapabilityImageRect: return "ImageRect"; + case SpvCapabilitySampledRect: return "SampledRect"; + case SpvCapabilityGenericPointer: return "GenericPointer"; + case SpvCapabilityInt8: return "Int8"; + case SpvCapabilityInputAttachment: return "InputAttachment"; + case SpvCapabilitySparseResidency: return "SparseResidency"; + case SpvCapabilityMinLod: return "MinLod"; + case SpvCapabilitySampled1D: return "Sampled1D"; + case SpvCapabilityImage1D: return "Image1D"; + case SpvCapabilitySampledCubeArray: return "SampledCubeArray"; + case SpvCapabilitySampledBuffer: return "SampledBuffer"; + case SpvCapabilityImageBuffer: return "ImageBuffer"; + case SpvCapabilityImageMSArray: return "ImageMSArray"; + case SpvCapabilityStorageImageExtendedFormats: return "StorageImageExtendedFormats"; + case SpvCapabilityImageQuery: return "ImageQuery"; + case SpvCapabilityDerivativeControl: return "DerivativeControl"; + case SpvCapabilityInterpolationFunction: return "InterpolationFunction"; + case SpvCapabilityTransformFeedback: return "TransformFeedback"; + case SpvCapabilityGeometryStreams: return "GeometryStreams"; + case SpvCapabilityStorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat"; + case SpvCapabilityStorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat"; + case SpvCapabilityMultiViewport: return "MultiViewport"; + case SpvCapabilitySubgroupDispatch: return "SubgroupDispatch"; + case SpvCapabilityNamedBarrier: return "NamedBarrier"; + case SpvCapabilityPipeStorage: return "PipeStorage"; + case SpvCapabilityGroupNonUniform: return "GroupNonUniform"; + case SpvCapabilityGroupNonUniformVote: return "GroupNonUniformVote"; + case SpvCapabilityGroupNonUniformArithmetic: return "GroupNonUniformArithmetic"; + case SpvCapabilityGroupNonUniformBallot: return "GroupNonUniformBallot"; + case SpvCapabilityGroupNonUniformShuffle: return "GroupNonUniformShuffle"; + case SpvCapabilityGroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative"; + case SpvCapabilityGroupNonUniformClustered: return "GroupNonUniformClustered"; + case SpvCapabilityGroupNonUniformQuad: return "GroupNonUniformQuad"; + case SpvCapabilityShaderLayer: return "ShaderLayer"; + case SpvCapabilityShaderViewportIndex: return "ShaderViewportIndex"; + case SpvCapabilityUniformDecoration: return "UniformDecoration"; + case SpvCapabilityCoreBuiltinsARM: return "CoreBuiltinsARM"; + case SpvCapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; + case SpvCapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; + case SpvCapabilityTileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case SpvCapabilityCooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case SpvCapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR"; + case SpvCapabilitySubgroupBallotKHR: return "SubgroupBallotKHR"; + case SpvCapabilityDrawParameters: return "DrawParameters"; + case SpvCapabilityWorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; + case SpvCapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; + case SpvCapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; + case SpvCapabilitySubgroupVoteKHR: return "SubgroupVoteKHR"; + case SpvCapabilityStorageBuffer16BitAccess: return "StorageBuffer16BitAccess"; + case SpvCapabilityStorageUniform16: return "StorageUniform16"; + case SpvCapabilityStoragePushConstant16: return "StoragePushConstant16"; + case SpvCapabilityStorageInputOutput16: return "StorageInputOutput16"; + case SpvCapabilityDeviceGroup: return "DeviceGroup"; + case SpvCapabilityMultiView: return "MultiView"; + case SpvCapabilityVariablePointersStorageBuffer: return "VariablePointersStorageBuffer"; + case SpvCapabilityVariablePointers: return "VariablePointers"; + case SpvCapabilityAtomicStorageOps: return "AtomicStorageOps"; + case SpvCapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; + case SpvCapabilityStorageBuffer8BitAccess: return "StorageBuffer8BitAccess"; + case SpvCapabilityUniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess"; + case SpvCapabilityStoragePushConstant8: return "StoragePushConstant8"; + case SpvCapabilityDenormPreserve: return "DenormPreserve"; + case SpvCapabilityDenormFlushToZero: return "DenormFlushToZero"; + case SpvCapabilitySignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case SpvCapabilityRoundingModeRTE: return "RoundingModeRTE"; + case SpvCapabilityRoundingModeRTZ: return "RoundingModeRTZ"; + case SpvCapabilityRayQueryProvisionalKHR: return "RayQueryProvisionalKHR"; + case SpvCapabilityRayQueryKHR: return "RayQueryKHR"; + case SpvCapabilityUntypedPointersKHR: return "UntypedPointersKHR"; + case SpvCapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; + case SpvCapabilityRayTracingKHR: return "RayTracingKHR"; + case SpvCapabilityTextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; + case SpvCapabilityTextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; + case SpvCapabilityTextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case SpvCapabilityTextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; + case SpvCapabilityFloat16ImageAMD: return "Float16ImageAMD"; + case SpvCapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case SpvCapabilityFragmentMaskAMD: return "FragmentMaskAMD"; + case SpvCapabilityStencilExportEXT: return "StencilExportEXT"; + case SpvCapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; + case SpvCapabilityInt64ImageEXT: return "Int64ImageEXT"; + case SpvCapabilityShaderClockKHR: return "ShaderClockKHR"; + case SpvCapabilityShaderEnqueueAMDX: return "ShaderEnqueueAMDX"; + case SpvCapabilityQuadControlKHR: return "QuadControlKHR"; + case SpvCapabilitySampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; + case SpvCapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case SpvCapabilityShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT"; + case SpvCapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case SpvCapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; + case SpvCapabilityPerViewAttributesNV: return "PerViewAttributesNV"; + case SpvCapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + case SpvCapabilityMeshShadingNV: return "MeshShadingNV"; + case SpvCapabilityImageFootprintNV: return "ImageFootprintNV"; + case SpvCapabilityMeshShadingEXT: return "MeshShadingEXT"; + case SpvCapabilityFragmentBarycentricKHR: return "FragmentBarycentricKHR"; + case SpvCapabilityComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR"; + case SpvCapabilityFragmentDensityEXT: return "FragmentDensityEXT"; + case SpvCapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case SpvCapabilityShaderNonUniform: return "ShaderNonUniform"; + case SpvCapabilityRuntimeDescriptorArray: return "RuntimeDescriptorArray"; + case SpvCapabilityInputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing"; + case SpvCapabilityUniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing"; + case SpvCapabilityStorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing"; + case SpvCapabilityUniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing"; + case SpvCapabilitySampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing"; + case SpvCapabilityStorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing"; + case SpvCapabilityStorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing"; + case SpvCapabilityInputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing"; + case SpvCapabilityUniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing"; + case SpvCapabilityStorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing"; + case SpvCapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case SpvCapabilityRayTracingNV: return "RayTracingNV"; + case SpvCapabilityRayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; + case SpvCapabilityVulkanMemoryModel: return "VulkanMemoryModel"; + case SpvCapabilityVulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope"; + case SpvCapabilityPhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses"; + case SpvCapabilityComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR"; + case SpvCapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; + case SpvCapabilityCooperativeMatrixNV: return "CooperativeMatrixNV"; + case SpvCapabilityFragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; + case SpvCapabilityFragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; + case SpvCapabilityShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV"; + case SpvCapabilityFragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; + case SpvCapabilityDemoteToHelperInvocation: return "DemoteToHelperInvocation"; + case SpvCapabilityDisplacementMicromapNV: return "DisplacementMicromapNV"; + case SpvCapabilityRayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; + case SpvCapabilityShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case SpvCapabilityBindlessTextureNV: return "BindlessTextureNV"; + case SpvCapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; + case SpvCapabilityAtomicFloat16VectorNV: return "AtomicFloat16VectorNV"; + case SpvCapabilityRayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV"; + case SpvCapabilityRawAccessChainsNV: return "RawAccessChainsNV"; + case SpvCapabilitySubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; + case SpvCapabilitySubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL"; + case SpvCapabilitySubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL"; + case SpvCapabilitySubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL"; + case SpvCapabilityRoundToInfinityINTEL: return "RoundToInfinityINTEL"; + case SpvCapabilityFloatingPointModeINTEL: return "FloatingPointModeINTEL"; + case SpvCapabilityIntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; + case SpvCapabilityFunctionPointersINTEL: return "FunctionPointersINTEL"; + case SpvCapabilityIndirectReferencesINTEL: return "IndirectReferencesINTEL"; + case SpvCapabilityAsmINTEL: return "AsmINTEL"; + case SpvCapabilityAtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; + case SpvCapabilityAtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; + case SpvCapabilityAtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT"; + case SpvCapabilityVectorComputeINTEL: return "VectorComputeINTEL"; + case SpvCapabilityVectorAnyINTEL: return "VectorAnyINTEL"; + case SpvCapabilityExpectAssumeKHR: return "ExpectAssumeKHR"; + case SpvCapabilitySubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL"; + case SpvCapabilitySubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL"; + case SpvCapabilitySubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL"; + case SpvCapabilityVariableLengthArrayINTEL: return "VariableLengthArrayINTEL"; + case SpvCapabilityFunctionFloatControlINTEL: return "FunctionFloatControlINTEL"; + case SpvCapabilityFPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL"; + case SpvCapabilityFPFastMathModeINTEL: return "FPFastMathModeINTEL"; + case SpvCapabilityArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL"; + case SpvCapabilityArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL"; + case SpvCapabilityUnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL"; + case SpvCapabilityFPGALoopControlsINTEL: return "FPGALoopControlsINTEL"; + case SpvCapabilityKernelAttributesINTEL: return "KernelAttributesINTEL"; + case SpvCapabilityFPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL"; + case SpvCapabilityFPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL"; + case SpvCapabilityFPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL"; + case SpvCapabilityLoopFuseINTEL: return "LoopFuseINTEL"; + case SpvCapabilityFPGADSPControlINTEL: return "FPGADSPControlINTEL"; + case SpvCapabilityMemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL"; + case SpvCapabilityFPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL"; + case SpvCapabilityFPGABufferLocationINTEL: return "FPGABufferLocationINTEL"; + case SpvCapabilityArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL"; + case SpvCapabilityUSMStorageClassesINTEL: return "USMStorageClassesINTEL"; + case SpvCapabilityRuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL"; + case SpvCapabilityIOPipesINTEL: return "IOPipesINTEL"; + case SpvCapabilityBlockingPipesINTEL: return "BlockingPipesINTEL"; + case SpvCapabilityFPGARegINTEL: return "FPGARegINTEL"; + case SpvCapabilityDotProductInputAll: return "DotProductInputAll"; + case SpvCapabilityDotProductInput4x8Bit: return "DotProductInput4x8Bit"; + case SpvCapabilityDotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked"; + case SpvCapabilityDotProduct: return "DotProduct"; + case SpvCapabilityRayCullMaskKHR: return "RayCullMaskKHR"; + case SpvCapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case SpvCapabilityReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; + case SpvCapabilityBitInstructions: return "BitInstructions"; + case SpvCapabilityGroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; + case SpvCapabilityFloatControls2: return "FloatControls2"; + case SpvCapabilityAtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; + case SpvCapabilityAtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; + case SpvCapabilityLongCompositesINTEL: return "LongCompositesINTEL"; + case SpvCapabilityOptNoneEXT: return "OptNoneEXT"; + case SpvCapabilityAtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; + case SpvCapabilityDebugInfoModuleINTEL: return "DebugInfoModuleINTEL"; + case SpvCapabilityBFloat16ConversionINTEL: return "BFloat16ConversionINTEL"; + case SpvCapabilitySplitBarrierINTEL: return "SplitBarrierINTEL"; + case SpvCapabilityArithmeticFenceEXT: return "ArithmeticFenceEXT"; + case SpvCapabilityFPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL"; + case SpvCapabilityFPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL"; + case SpvCapabilityFPMaxErrorINTEL: return "FPMaxErrorINTEL"; + case SpvCapabilityFPGALatencyControlINTEL: return "FPGALatencyControlINTEL"; + case SpvCapabilityFPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL"; + case SpvCapabilityGlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL"; + case SpvCapabilityGlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL"; + case SpvCapabilitySubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL"; + case SpvCapabilityGroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; + case SpvCapabilityMaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL"; + case SpvCapabilityCacheControlsINTEL: return "CacheControlsINTEL"; + case SpvCapabilityRegisterLimitsINTEL: return "RegisterLimitsINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvRayQueryIntersectionToString(SpvRayQueryIntersection value) { + switch (value) { + case SpvRayQueryIntersectionRayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR"; + case SpvRayQueryIntersectionRayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvRayQueryCommittedIntersectionTypeToString(SpvRayQueryCommittedIntersectionType value) { + switch (value) { + case SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR"; + case SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR"; + case SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvRayQueryCandidateIntersectionTypeToString(SpvRayQueryCandidateIntersectionType value) { + switch (value) { + case SpvRayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR"; + case SpvRayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvFPDenormModeToString(SpvFPDenormMode value) { + switch (value) { + case SpvFPDenormModePreserve: return "Preserve"; + case SpvFPDenormModeFlushToZero: return "FlushToZero"; + default: return "Unknown"; + } +} + +inline const char* SpvFPOperationModeToString(SpvFPOperationMode value) { + switch (value) { + case SpvFPOperationModeIEEE: return "IEEE"; + case SpvFPOperationModeALT: return "ALT"; + default: return "Unknown"; + } +} + +inline const char* SpvQuantizationModesToString(SpvQuantizationModes value) { + switch (value) { + case SpvQuantizationModesTRN: return "TRN"; + case SpvQuantizationModesTRN_ZERO: return "TRN_ZERO"; + case SpvQuantizationModesRND: return "RND"; + case SpvQuantizationModesRND_ZERO: return "RND_ZERO"; + case SpvQuantizationModesRND_INF: return "RND_INF"; + case SpvQuantizationModesRND_MIN_INF: return "RND_MIN_INF"; + case SpvQuantizationModesRND_CONV: return "RND_CONV"; + case SpvQuantizationModesRND_CONV_ODD: return "RND_CONV_ODD"; + default: return "Unknown"; + } +} + +inline const char* SpvOverflowModesToString(SpvOverflowModes value) { + switch (value) { + case SpvOverflowModesWRAP: return "WRAP"; + case SpvOverflowModesSAT: return "SAT"; + case SpvOverflowModesSAT_ZERO: return "SAT_ZERO"; + case SpvOverflowModesSAT_SYM: return "SAT_SYM"; + default: return "Unknown"; + } +} + +inline const char* SpvPackedVectorFormatToString(SpvPackedVectorFormat value) { + switch (value) { + case SpvPackedVectorFormatPackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit"; + default: return "Unknown"; + } +} + +inline const char* SpvCooperativeMatrixLayoutToString(SpvCooperativeMatrixLayout value) { + switch (value) { + case SpvCooperativeMatrixLayoutRowMajorKHR: return "RowMajorKHR"; + case SpvCooperativeMatrixLayoutColumnMajorKHR: return "ColumnMajorKHR"; + case SpvCooperativeMatrixLayoutRowBlockedInterleavedARM: return "RowBlockedInterleavedARM"; + case SpvCooperativeMatrixLayoutColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM"; + default: return "Unknown"; + } +} + +inline const char* SpvCooperativeMatrixUseToString(SpvCooperativeMatrixUse value) { + switch (value) { + case SpvCooperativeMatrixUseMatrixAKHR: return "MatrixAKHR"; + case SpvCooperativeMatrixUseMatrixBKHR: return "MatrixBKHR"; + case SpvCooperativeMatrixUseMatrixAccumulatorKHR: return "MatrixAccumulatorKHR"; + default: return "Unknown"; + } +} + +inline const char* SpvInitializationModeQualifierToString(SpvInitializationModeQualifier value) { + switch (value) { + case SpvInitializationModeQualifierInitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL"; + case SpvInitializationModeQualifierInitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvHostAccessQualifierToString(SpvHostAccessQualifier value) { + switch (value) { + case SpvHostAccessQualifierNoneINTEL: return "NoneINTEL"; + case SpvHostAccessQualifierReadINTEL: return "ReadINTEL"; + case SpvHostAccessQualifierWriteINTEL: return "WriteINTEL"; + case SpvHostAccessQualifierReadWriteINTEL: return "ReadWriteINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvLoadCacheControlToString(SpvLoadCacheControl value) { + switch (value) { + case SpvLoadCacheControlUncachedINTEL: return "UncachedINTEL"; + case SpvLoadCacheControlCachedINTEL: return "CachedINTEL"; + case SpvLoadCacheControlStreamingINTEL: return "StreamingINTEL"; + case SpvLoadCacheControlInvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL"; + case SpvLoadCacheControlConstCachedINTEL: return "ConstCachedINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvStoreCacheControlToString(SpvStoreCacheControl value) { + switch (value) { + case SpvStoreCacheControlUncachedINTEL: return "UncachedINTEL"; + case SpvStoreCacheControlWriteThroughINTEL: return "WriteThroughINTEL"; + case SpvStoreCacheControlWriteBackINTEL: return "WriteBackINTEL"; + case SpvStoreCacheControlStreamingINTEL: return "StreamingINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvNamedMaximumNumberOfRegistersToString(SpvNamedMaximumNumberOfRegisters value) { + switch (value) { + case SpvNamedMaximumNumberOfRegistersAutoINTEL: return "AutoINTEL"; + default: return "Unknown"; + } +} + +inline const char* SpvFPEncodingToString(SpvFPEncoding value) { + switch (value) { + default: return "Unknown"; + } +} + +inline const char* SpvOpToString(SpvOp value) { + switch (value) { + case SpvOpNop: return "OpNop"; + case SpvOpUndef: return "OpUndef"; + case SpvOpSourceContinued: return "OpSourceContinued"; + case SpvOpSource: return "OpSource"; + case SpvOpSourceExtension: return "OpSourceExtension"; + case SpvOpName: return "OpName"; + case SpvOpMemberName: return "OpMemberName"; + case SpvOpString: return "OpString"; + case SpvOpLine: return "OpLine"; + case SpvOpExtension: return "OpExtension"; + case SpvOpExtInstImport: return "OpExtInstImport"; + case SpvOpExtInst: return "OpExtInst"; + case SpvOpMemoryModel: return "OpMemoryModel"; + case SpvOpEntryPoint: return "OpEntryPoint"; + case SpvOpExecutionMode: return "OpExecutionMode"; + case SpvOpCapability: return "OpCapability"; + case SpvOpTypeVoid: return "OpTypeVoid"; + case SpvOpTypeBool: return "OpTypeBool"; + case SpvOpTypeInt: return "OpTypeInt"; + case SpvOpTypeFloat: return "OpTypeFloat"; + case SpvOpTypeVector: return "OpTypeVector"; + case SpvOpTypeMatrix: return "OpTypeMatrix"; + case SpvOpTypeImage: return "OpTypeImage"; + case SpvOpTypeSampler: return "OpTypeSampler"; + case SpvOpTypeSampledImage: return "OpTypeSampledImage"; + case SpvOpTypeArray: return "OpTypeArray"; + case SpvOpTypeRuntimeArray: return "OpTypeRuntimeArray"; + case SpvOpTypeStruct: return "OpTypeStruct"; + case SpvOpTypeOpaque: return "OpTypeOpaque"; + case SpvOpTypePointer: return "OpTypePointer"; + case SpvOpTypeFunction: return "OpTypeFunction"; + case SpvOpTypeEvent: return "OpTypeEvent"; + case SpvOpTypeDeviceEvent: return "OpTypeDeviceEvent"; + case SpvOpTypeReserveId: return "OpTypeReserveId"; + case SpvOpTypeQueue: return "OpTypeQueue"; + case SpvOpTypePipe: return "OpTypePipe"; + case SpvOpTypeForwardPointer: return "OpTypeForwardPointer"; + case SpvOpConstantTrue: return "OpConstantTrue"; + case SpvOpConstantFalse: return "OpConstantFalse"; + case SpvOpConstant: return "OpConstant"; + case SpvOpConstantComposite: return "OpConstantComposite"; + case SpvOpConstantSampler: return "OpConstantSampler"; + case SpvOpConstantNull: return "OpConstantNull"; + case SpvOpSpecConstantTrue: return "OpSpecConstantTrue"; + case SpvOpSpecConstantFalse: return "OpSpecConstantFalse"; + case SpvOpSpecConstant: return "OpSpecConstant"; + case SpvOpSpecConstantComposite: return "OpSpecConstantComposite"; + case SpvOpSpecConstantOp: return "OpSpecConstantOp"; + case SpvOpFunction: return "OpFunction"; + case SpvOpFunctionParameter: return "OpFunctionParameter"; + case SpvOpFunctionEnd: return "OpFunctionEnd"; + case SpvOpFunctionCall: return "OpFunctionCall"; + case SpvOpVariable: return "OpVariable"; + case SpvOpImageTexelPointer: return "OpImageTexelPointer"; + case SpvOpLoad: return "OpLoad"; + case SpvOpStore: return "OpStore"; + case SpvOpCopyMemory: return "OpCopyMemory"; + case SpvOpCopyMemorySized: return "OpCopyMemorySized"; + case SpvOpAccessChain: return "OpAccessChain"; + case SpvOpInBoundsAccessChain: return "OpInBoundsAccessChain"; + case SpvOpPtrAccessChain: return "OpPtrAccessChain"; + case SpvOpArrayLength: return "OpArrayLength"; + case SpvOpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics"; + case SpvOpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain"; + case SpvOpDecorate: return "OpDecorate"; + case SpvOpMemberDecorate: return "OpMemberDecorate"; + case SpvOpDecorationGroup: return "OpDecorationGroup"; + case SpvOpGroupDecorate: return "OpGroupDecorate"; + case SpvOpGroupMemberDecorate: return "OpGroupMemberDecorate"; + case SpvOpVectorExtractDynamic: return "OpVectorExtractDynamic"; + case SpvOpVectorInsertDynamic: return "OpVectorInsertDynamic"; + case SpvOpVectorShuffle: return "OpVectorShuffle"; + case SpvOpCompositeConstruct: return "OpCompositeConstruct"; + case SpvOpCompositeExtract: return "OpCompositeExtract"; + case SpvOpCompositeInsert: return "OpCompositeInsert"; + case SpvOpCopyObject: return "OpCopyObject"; + case SpvOpTranspose: return "OpTranspose"; + case SpvOpSampledImage: return "OpSampledImage"; + case SpvOpImageSampleImplicitLod: return "OpImageSampleImplicitLod"; + case SpvOpImageSampleExplicitLod: return "OpImageSampleExplicitLod"; + case SpvOpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod"; + case SpvOpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod"; + case SpvOpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod"; + case SpvOpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod"; + case SpvOpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod"; + case SpvOpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod"; + case SpvOpImageFetch: return "OpImageFetch"; + case SpvOpImageGather: return "OpImageGather"; + case SpvOpImageDrefGather: return "OpImageDrefGather"; + case SpvOpImageRead: return "OpImageRead"; + case SpvOpImageWrite: return "OpImageWrite"; + case SpvOpImage: return "OpImage"; + case SpvOpImageQueryFormat: return "OpImageQueryFormat"; + case SpvOpImageQueryOrder: return "OpImageQueryOrder"; + case SpvOpImageQuerySizeLod: return "OpImageQuerySizeLod"; + case SpvOpImageQuerySize: return "OpImageQuerySize"; + case SpvOpImageQueryLod: return "OpImageQueryLod"; + case SpvOpImageQueryLevels: return "OpImageQueryLevels"; + case SpvOpImageQuerySamples: return "OpImageQuerySamples"; + case SpvOpConvertFToU: return "OpConvertFToU"; + case SpvOpConvertFToS: return "OpConvertFToS"; + case SpvOpConvertSToF: return "OpConvertSToF"; + case SpvOpConvertUToF: return "OpConvertUToF"; + case SpvOpUConvert: return "OpUConvert"; + case SpvOpSConvert: return "OpSConvert"; + case SpvOpFConvert: return "OpFConvert"; + case SpvOpQuantizeToF16: return "OpQuantizeToF16"; + case SpvOpConvertPtrToU: return "OpConvertPtrToU"; + case SpvOpSatConvertSToU: return "OpSatConvertSToU"; + case SpvOpSatConvertUToS: return "OpSatConvertUToS"; + case SpvOpConvertUToPtr: return "OpConvertUToPtr"; + case SpvOpPtrCastToGeneric: return "OpPtrCastToGeneric"; + case SpvOpGenericCastToPtr: return "OpGenericCastToPtr"; + case SpvOpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit"; + case SpvOpBitcast: return "OpBitcast"; + case SpvOpSNegate: return "OpSNegate"; + case SpvOpFNegate: return "OpFNegate"; + case SpvOpIAdd: return "OpIAdd"; + case SpvOpFAdd: return "OpFAdd"; + case SpvOpISub: return "OpISub"; + case SpvOpFSub: return "OpFSub"; + case SpvOpIMul: return "OpIMul"; + case SpvOpFMul: return "OpFMul"; + case SpvOpUDiv: return "OpUDiv"; + case SpvOpSDiv: return "OpSDiv"; + case SpvOpFDiv: return "OpFDiv"; + case SpvOpUMod: return "OpUMod"; + case SpvOpSRem: return "OpSRem"; + case SpvOpSMod: return "OpSMod"; + case SpvOpFRem: return "OpFRem"; + case SpvOpFMod: return "OpFMod"; + case SpvOpVectorTimesScalar: return "OpVectorTimesScalar"; + case SpvOpMatrixTimesScalar: return "OpMatrixTimesScalar"; + case SpvOpVectorTimesMatrix: return "OpVectorTimesMatrix"; + case SpvOpMatrixTimesVector: return "OpMatrixTimesVector"; + case SpvOpMatrixTimesMatrix: return "OpMatrixTimesMatrix"; + case SpvOpOuterProduct: return "OpOuterProduct"; + case SpvOpDot: return "OpDot"; + case SpvOpIAddCarry: return "OpIAddCarry"; + case SpvOpISubBorrow: return "OpISubBorrow"; + case SpvOpUMulExtended: return "OpUMulExtended"; + case SpvOpSMulExtended: return "OpSMulExtended"; + case SpvOpAny: return "OpAny"; + case SpvOpAll: return "OpAll"; + case SpvOpIsNan: return "OpIsNan"; + case SpvOpIsInf: return "OpIsInf"; + case SpvOpIsFinite: return "OpIsFinite"; + case SpvOpIsNormal: return "OpIsNormal"; + case SpvOpSignBitSet: return "OpSignBitSet"; + case SpvOpLessOrGreater: return "OpLessOrGreater"; + case SpvOpOrdered: return "OpOrdered"; + case SpvOpUnordered: return "OpUnordered"; + case SpvOpLogicalEqual: return "OpLogicalEqual"; + case SpvOpLogicalNotEqual: return "OpLogicalNotEqual"; + case SpvOpLogicalOr: return "OpLogicalOr"; + case SpvOpLogicalAnd: return "OpLogicalAnd"; + case SpvOpLogicalNot: return "OpLogicalNot"; + case SpvOpSelect: return "OpSelect"; + case SpvOpIEqual: return "OpIEqual"; + case SpvOpINotEqual: return "OpINotEqual"; + case SpvOpUGreaterThan: return "OpUGreaterThan"; + case SpvOpSGreaterThan: return "OpSGreaterThan"; + case SpvOpUGreaterThanEqual: return "OpUGreaterThanEqual"; + case SpvOpSGreaterThanEqual: return "OpSGreaterThanEqual"; + case SpvOpULessThan: return "OpULessThan"; + case SpvOpSLessThan: return "OpSLessThan"; + case SpvOpULessThanEqual: return "OpULessThanEqual"; + case SpvOpSLessThanEqual: return "OpSLessThanEqual"; + case SpvOpFOrdEqual: return "OpFOrdEqual"; + case SpvOpFUnordEqual: return "OpFUnordEqual"; + case SpvOpFOrdNotEqual: return "OpFOrdNotEqual"; + case SpvOpFUnordNotEqual: return "OpFUnordNotEqual"; + case SpvOpFOrdLessThan: return "OpFOrdLessThan"; + case SpvOpFUnordLessThan: return "OpFUnordLessThan"; + case SpvOpFOrdGreaterThan: return "OpFOrdGreaterThan"; + case SpvOpFUnordGreaterThan: return "OpFUnordGreaterThan"; + case SpvOpFOrdLessThanEqual: return "OpFOrdLessThanEqual"; + case SpvOpFUnordLessThanEqual: return "OpFUnordLessThanEqual"; + case SpvOpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual"; + case SpvOpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual"; + case SpvOpShiftRightLogical: return "OpShiftRightLogical"; + case SpvOpShiftRightArithmetic: return "OpShiftRightArithmetic"; + case SpvOpShiftLeftLogical: return "OpShiftLeftLogical"; + case SpvOpBitwiseOr: return "OpBitwiseOr"; + case SpvOpBitwiseXor: return "OpBitwiseXor"; + case SpvOpBitwiseAnd: return "OpBitwiseAnd"; + case SpvOpNot: return "OpNot"; + case SpvOpBitFieldInsert: return "OpBitFieldInsert"; + case SpvOpBitFieldSExtract: return "OpBitFieldSExtract"; + case SpvOpBitFieldUExtract: return "OpBitFieldUExtract"; + case SpvOpBitReverse: return "OpBitReverse"; + case SpvOpBitCount: return "OpBitCount"; + case SpvOpDPdx: return "OpDPdx"; + case SpvOpDPdy: return "OpDPdy"; + case SpvOpFwidth: return "OpFwidth"; + case SpvOpDPdxFine: return "OpDPdxFine"; + case SpvOpDPdyFine: return "OpDPdyFine"; + case SpvOpFwidthFine: return "OpFwidthFine"; + case SpvOpDPdxCoarse: return "OpDPdxCoarse"; + case SpvOpDPdyCoarse: return "OpDPdyCoarse"; + case SpvOpFwidthCoarse: return "OpFwidthCoarse"; + case SpvOpEmitVertex: return "OpEmitVertex"; + case SpvOpEndPrimitive: return "OpEndPrimitive"; + case SpvOpEmitStreamVertex: return "OpEmitStreamVertex"; + case SpvOpEndStreamPrimitive: return "OpEndStreamPrimitive"; + case SpvOpControlBarrier: return "OpControlBarrier"; + case SpvOpMemoryBarrier: return "OpMemoryBarrier"; + case SpvOpAtomicLoad: return "OpAtomicLoad"; + case SpvOpAtomicStore: return "OpAtomicStore"; + case SpvOpAtomicExchange: return "OpAtomicExchange"; + case SpvOpAtomicCompareExchange: return "OpAtomicCompareExchange"; + case SpvOpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak"; + case SpvOpAtomicIIncrement: return "OpAtomicIIncrement"; + case SpvOpAtomicIDecrement: return "OpAtomicIDecrement"; + case SpvOpAtomicIAdd: return "OpAtomicIAdd"; + case SpvOpAtomicISub: return "OpAtomicISub"; + case SpvOpAtomicSMin: return "OpAtomicSMin"; + case SpvOpAtomicUMin: return "OpAtomicUMin"; + case SpvOpAtomicSMax: return "OpAtomicSMax"; + case SpvOpAtomicUMax: return "OpAtomicUMax"; + case SpvOpAtomicAnd: return "OpAtomicAnd"; + case SpvOpAtomicOr: return "OpAtomicOr"; + case SpvOpAtomicXor: return "OpAtomicXor"; + case SpvOpPhi: return "OpPhi"; + case SpvOpLoopMerge: return "OpLoopMerge"; + case SpvOpSelectionMerge: return "OpSelectionMerge"; + case SpvOpLabel: return "OpLabel"; + case SpvOpBranch: return "OpBranch"; + case SpvOpBranchConditional: return "OpBranchConditional"; + case SpvOpSwitch: return "OpSwitch"; + case SpvOpKill: return "OpKill"; + case SpvOpReturn: return "OpReturn"; + case SpvOpReturnValue: return "OpReturnValue"; + case SpvOpUnreachable: return "OpUnreachable"; + case SpvOpLifetimeStart: return "OpLifetimeStart"; + case SpvOpLifetimeStop: return "OpLifetimeStop"; + case SpvOpGroupAsyncCopy: return "OpGroupAsyncCopy"; + case SpvOpGroupWaitEvents: return "OpGroupWaitEvents"; + case SpvOpGroupAll: return "OpGroupAll"; + case SpvOpGroupAny: return "OpGroupAny"; + case SpvOpGroupBroadcast: return "OpGroupBroadcast"; + case SpvOpGroupIAdd: return "OpGroupIAdd"; + case SpvOpGroupFAdd: return "OpGroupFAdd"; + case SpvOpGroupFMin: return "OpGroupFMin"; + case SpvOpGroupUMin: return "OpGroupUMin"; + case SpvOpGroupSMin: return "OpGroupSMin"; + case SpvOpGroupFMax: return "OpGroupFMax"; + case SpvOpGroupUMax: return "OpGroupUMax"; + case SpvOpGroupSMax: return "OpGroupSMax"; + case SpvOpReadPipe: return "OpReadPipe"; + case SpvOpWritePipe: return "OpWritePipe"; + case SpvOpReservedReadPipe: return "OpReservedReadPipe"; + case SpvOpReservedWritePipe: return "OpReservedWritePipe"; + case SpvOpReserveReadPipePackets: return "OpReserveReadPipePackets"; + case SpvOpReserveWritePipePackets: return "OpReserveWritePipePackets"; + case SpvOpCommitReadPipe: return "OpCommitReadPipe"; + case SpvOpCommitWritePipe: return "OpCommitWritePipe"; + case SpvOpIsValidReserveId: return "OpIsValidReserveId"; + case SpvOpGetNumPipePackets: return "OpGetNumPipePackets"; + case SpvOpGetMaxPipePackets: return "OpGetMaxPipePackets"; + case SpvOpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets"; + case SpvOpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets"; + case SpvOpGroupCommitReadPipe: return "OpGroupCommitReadPipe"; + case SpvOpGroupCommitWritePipe: return "OpGroupCommitWritePipe"; + case SpvOpEnqueueMarker: return "OpEnqueueMarker"; + case SpvOpEnqueueKernel: return "OpEnqueueKernel"; + case SpvOpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount"; + case SpvOpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize"; + case SpvOpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize"; + case SpvOpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple"; + case SpvOpRetainEvent: return "OpRetainEvent"; + case SpvOpReleaseEvent: return "OpReleaseEvent"; + case SpvOpCreateUserEvent: return "OpCreateUserEvent"; + case SpvOpIsValidEvent: return "OpIsValidEvent"; + case SpvOpSetUserEventStatus: return "OpSetUserEventStatus"; + case SpvOpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo"; + case SpvOpGetDefaultQueue: return "OpGetDefaultQueue"; + case SpvOpBuildNDRange: return "OpBuildNDRange"; + case SpvOpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod"; + case SpvOpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod"; + case SpvOpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod"; + case SpvOpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod"; + case SpvOpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod"; + case SpvOpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod"; + case SpvOpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod"; + case SpvOpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod"; + case SpvOpImageSparseFetch: return "OpImageSparseFetch"; + case SpvOpImageSparseGather: return "OpImageSparseGather"; + case SpvOpImageSparseDrefGather: return "OpImageSparseDrefGather"; + case SpvOpImageSparseTexelsResident: return "OpImageSparseTexelsResident"; + case SpvOpNoLine: return "OpNoLine"; + case SpvOpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet"; + case SpvOpAtomicFlagClear: return "OpAtomicFlagClear"; + case SpvOpImageSparseRead: return "OpImageSparseRead"; + case SpvOpSizeOf: return "OpSizeOf"; + case SpvOpTypePipeStorage: return "OpTypePipeStorage"; + case SpvOpConstantPipeStorage: return "OpConstantPipeStorage"; + case SpvOpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage"; + case SpvOpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount"; + case SpvOpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups"; + case SpvOpTypeNamedBarrier: return "OpTypeNamedBarrier"; + case SpvOpNamedBarrierInitialize: return "OpNamedBarrierInitialize"; + case SpvOpMemoryNamedBarrier: return "OpMemoryNamedBarrier"; + case SpvOpModuleProcessed: return "OpModuleProcessed"; + case SpvOpExecutionModeId: return "OpExecutionModeId"; + case SpvOpDecorateId: return "OpDecorateId"; + case SpvOpGroupNonUniformElect: return "OpGroupNonUniformElect"; + case SpvOpGroupNonUniformAll: return "OpGroupNonUniformAll"; + case SpvOpGroupNonUniformAny: return "OpGroupNonUniformAny"; + case SpvOpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual"; + case SpvOpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast"; + case SpvOpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst"; + case SpvOpGroupNonUniformBallot: return "OpGroupNonUniformBallot"; + case SpvOpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot"; + case SpvOpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract"; + case SpvOpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount"; + case SpvOpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB"; + case SpvOpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB"; + case SpvOpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle"; + case SpvOpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor"; + case SpvOpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp"; + case SpvOpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown"; + case SpvOpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd"; + case SpvOpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd"; + case SpvOpGroupNonUniformIMul: return "OpGroupNonUniformIMul"; + case SpvOpGroupNonUniformFMul: return "OpGroupNonUniformFMul"; + case SpvOpGroupNonUniformSMin: return "OpGroupNonUniformSMin"; + case SpvOpGroupNonUniformUMin: return "OpGroupNonUniformUMin"; + case SpvOpGroupNonUniformFMin: return "OpGroupNonUniformFMin"; + case SpvOpGroupNonUniformSMax: return "OpGroupNonUniformSMax"; + case SpvOpGroupNonUniformUMax: return "OpGroupNonUniformUMax"; + case SpvOpGroupNonUniformFMax: return "OpGroupNonUniformFMax"; + case SpvOpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd"; + case SpvOpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr"; + case SpvOpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor"; + case SpvOpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd"; + case SpvOpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr"; + case SpvOpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor"; + case SpvOpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast"; + case SpvOpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap"; + case SpvOpCopyLogical: return "OpCopyLogical"; + case SpvOpPtrEqual: return "OpPtrEqual"; + case SpvOpPtrNotEqual: return "OpPtrNotEqual"; + case SpvOpPtrDiff: return "OpPtrDiff"; + case SpvOpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; + case SpvOpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; + case SpvOpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + case SpvOpTerminateInvocation: return "OpTerminateInvocation"; + case SpvOpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR"; + case SpvOpUntypedVariableKHR: return "OpUntypedVariableKHR"; + case SpvOpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR"; + case SpvOpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR"; + case SpvOpSubgroupBallotKHR: return "OpSubgroupBallotKHR"; + case SpvOpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR"; + case SpvOpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR"; + case SpvOpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR"; + case SpvOpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR"; + case SpvOpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR"; + case SpvOpSubgroupAllKHR: return "OpSubgroupAllKHR"; + case SpvOpSubgroupAnyKHR: return "OpSubgroupAnyKHR"; + case SpvOpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR"; + case SpvOpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; + case SpvOpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR"; + case SpvOpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR"; + case SpvOpTraceRayKHR: return "OpTraceRayKHR"; + case SpvOpExecuteCallableKHR: return "OpExecuteCallableKHR"; + case SpvOpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR"; + case SpvOpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR"; + case SpvOpTerminateRayKHR: return "OpTerminateRayKHR"; + case SpvOpSDot: return "OpSDot"; + case SpvOpUDot: return "OpUDot"; + case SpvOpSUDot: return "OpSUDot"; + case SpvOpSDotAccSat: return "OpSDotAccSat"; + case SpvOpUDotAccSat: return "OpUDotAccSat"; + case SpvOpSUDotAccSat: return "OpSUDotAccSat"; + case SpvOpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR"; + case SpvOpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR"; + case SpvOpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; + case SpvOpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; + case SpvOpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case SpvOpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case SpvOpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case SpvOpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; + case SpvOpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; + case SpvOpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; + case SpvOpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; + case SpvOpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR"; + case SpvOpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR"; + case SpvOpRayQueryProceedKHR: return "OpRayQueryProceedKHR"; + case SpvOpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR"; + case SpvOpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM"; + case SpvOpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; + case SpvOpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + case SpvOpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case SpvOpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; + case SpvOpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; + case SpvOpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; + case SpvOpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + case SpvOpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD"; + case SpvOpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD"; + case SpvOpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD"; + case SpvOpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD"; + case SpvOpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD"; + case SpvOpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD"; + case SpvOpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD"; + case SpvOpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD"; + case SpvOpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD"; + case SpvOpFragmentFetchAMD: return "OpFragmentFetchAMD"; + case SpvOpReadClockKHR: return "OpReadClockKHR"; + case SpvOpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX"; + case SpvOpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX"; + case SpvOpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX"; + case SpvOpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX"; + case SpvOpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX"; + case SpvOpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX"; + case SpvOpConstantStringAMDX: return "OpConstantStringAMDX"; + case SpvOpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX"; + case SpvOpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; + case SpvOpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + case SpvOpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; + case SpvOpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; + case SpvOpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; + case SpvOpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV"; + case SpvOpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV"; + case SpvOpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV"; + case SpvOpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV"; + case SpvOpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV"; + case SpvOpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case SpvOpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; + case SpvOpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV"; + case SpvOpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV"; + case SpvOpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV"; + case SpvOpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV"; + case SpvOpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV"; + case SpvOpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV"; + case SpvOpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV"; + case SpvOpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV"; + case SpvOpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV"; + case SpvOpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV"; + case SpvOpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV"; + case SpvOpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV"; + case SpvOpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV"; + case SpvOpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV"; + case SpvOpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV"; + case SpvOpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV"; + case SpvOpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV"; + case SpvOpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV"; + case SpvOpHitObjectIsHitNV: return "OpHitObjectIsHitNV"; + case SpvOpHitObjectIsMissNV: return "OpHitObjectIsMissNV"; + case SpvOpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV"; + case SpvOpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV"; + case SpvOpTypeHitObjectNV: return "OpTypeHitObjectNV"; + case SpvOpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; + case SpvOpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT"; + case SpvOpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT"; + case SpvOpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case SpvOpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; + case SpvOpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + case SpvOpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case SpvOpReportIntersectionKHR: return "OpReportIntersectionKHR"; + case SpvOpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; + case SpvOpTerminateRayNV: return "OpTerminateRayNV"; + case SpvOpTraceNV: return "OpTraceNV"; + case SpvOpTraceMotionNV: return "OpTraceMotionNV"; + case SpvOpTraceRayMotionNV: return "OpTraceRayMotionNV"; + case SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR"; + case SpvOpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; + case SpvOpExecuteCallableNV: return "OpExecuteCallableNV"; + case SpvOpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; + case SpvOpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; + case SpvOpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; + case SpvOpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV"; + case SpvOpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV"; + case SpvOpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT"; + case SpvOpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT"; + case SpvOpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation"; + case SpvOpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT"; + case SpvOpConvertUToImageNV: return "OpConvertUToImageNV"; + case SpvOpConvertUToSamplerNV: return "OpConvertUToSamplerNV"; + case SpvOpConvertImageToUNV: return "OpConvertImageToUNV"; + case SpvOpConvertSamplerToUNV: return "OpConvertSamplerToUNV"; + case SpvOpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV"; + case SpvOpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV"; + case SpvOpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV"; + case SpvOpRawAccessChainNV: return "OpRawAccessChainNV"; + case SpvOpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL"; + case SpvOpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL"; + case SpvOpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL"; + case SpvOpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL"; + case SpvOpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL"; + case SpvOpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL"; + case SpvOpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL"; + case SpvOpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL"; + case SpvOpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL"; + case SpvOpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL"; + case SpvOpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL"; + case SpvOpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL"; + case SpvOpAbsISubINTEL: return "OpAbsISubINTEL"; + case SpvOpAbsUSubINTEL: return "OpAbsUSubINTEL"; + case SpvOpIAddSatINTEL: return "OpIAddSatINTEL"; + case SpvOpUAddSatINTEL: return "OpUAddSatINTEL"; + case SpvOpIAverageINTEL: return "OpIAverageINTEL"; + case SpvOpUAverageINTEL: return "OpUAverageINTEL"; + case SpvOpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL"; + case SpvOpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL"; + case SpvOpISubSatINTEL: return "OpISubSatINTEL"; + case SpvOpUSubSatINTEL: return "OpUSubSatINTEL"; + case SpvOpIMul32x16INTEL: return "OpIMul32x16INTEL"; + case SpvOpUMul32x16INTEL: return "OpUMul32x16INTEL"; + case SpvOpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL"; + case SpvOpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL"; + case SpvOpAsmTargetINTEL: return "OpAsmTargetINTEL"; + case SpvOpAsmINTEL: return "OpAsmINTEL"; + case SpvOpAsmCallINTEL: return "OpAsmCallINTEL"; + case SpvOpAtomicFMinEXT: return "OpAtomicFMinEXT"; + case SpvOpAtomicFMaxEXT: return "OpAtomicFMaxEXT"; + case SpvOpAssumeTrueKHR: return "OpAssumeTrueKHR"; + case SpvOpExpectKHR: return "OpExpectKHR"; + case SpvOpDecorateString: return "OpDecorateString"; + case SpvOpMemberDecorateString: return "OpMemberDecorateString"; + case SpvOpVmeImageINTEL: return "OpVmeImageINTEL"; + case SpvOpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL"; + case SpvOpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL"; + case SpvOpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL"; + case SpvOpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL"; + case SpvOpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL"; + case SpvOpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL"; + case SpvOpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL"; + case SpvOpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL"; + case SpvOpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL"; + case SpvOpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL"; + case SpvOpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL"; + case SpvOpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL"; + case SpvOpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL"; + case SpvOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL"; + case SpvOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL"; + case SpvOpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL"; + case SpvOpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL"; + case SpvOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL"; + case SpvOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL"; + case SpvOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL"; + case SpvOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL"; + case SpvOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL"; + case SpvOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL"; + case SpvOpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL"; + case SpvOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL"; + case SpvOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL"; + case SpvOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL"; + case SpvOpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL"; + case SpvOpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL"; + case SpvOpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL"; + case SpvOpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL"; + case SpvOpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL"; + case SpvOpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL"; + case SpvOpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL"; + case SpvOpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL"; + case SpvOpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL"; + case SpvOpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL"; + case SpvOpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL"; + case SpvOpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL"; + case SpvOpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL"; + case SpvOpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL"; + case SpvOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL"; + case SpvOpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL"; + case SpvOpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL"; + case SpvOpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL"; + case SpvOpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL"; + case SpvOpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL"; + case SpvOpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL"; + case SpvOpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL"; + case SpvOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL"; + case SpvOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL"; + case SpvOpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL"; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL"; + case SpvOpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL"; + case SpvOpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL"; + case SpvOpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL"; + case SpvOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL"; + case SpvOpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL"; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL"; + case SpvOpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL"; + case SpvOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL"; + case SpvOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL"; + case SpvOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL"; + case SpvOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL"; + case SpvOpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL"; + case SpvOpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL"; + case SpvOpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL"; + case SpvOpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL"; + case SpvOpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL"; + case SpvOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL"; + case SpvOpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL"; + case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL"; + case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL"; + case SpvOpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL"; + case SpvOpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL"; + case SpvOpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL"; + case SpvOpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL"; + case SpvOpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL"; + case SpvOpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL"; + case SpvOpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL"; + case SpvOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL"; + case SpvOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL"; + case SpvOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL"; + case SpvOpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL"; + case SpvOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL"; + case SpvOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL"; + case SpvOpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL"; + case SpvOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL"; + case SpvOpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL"; + case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL"; + case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL"; + case SpvOpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL"; + case SpvOpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL"; + case SpvOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL"; + case SpvOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL"; + case SpvOpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL"; + case SpvOpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL"; + case SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL"; + case SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL"; + case SpvOpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL"; + case SpvOpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL"; + case SpvOpSaveMemoryINTEL: return "OpSaveMemoryINTEL"; + case SpvOpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL"; + case SpvOpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL"; + case SpvOpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL"; + case SpvOpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL"; + case SpvOpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL"; + case SpvOpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL"; + case SpvOpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL"; + case SpvOpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL"; + case SpvOpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL"; + case SpvOpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL"; + case SpvOpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL"; + case SpvOpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL"; + case SpvOpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL"; + case SpvOpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL"; + case SpvOpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL"; + case SpvOpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL"; + case SpvOpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL"; + case SpvOpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL"; + case SpvOpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL"; + case SpvOpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL"; + case SpvOpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL"; + case SpvOpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL"; + case SpvOpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL"; + case SpvOpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL"; + case SpvOpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL"; + case SpvOpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL"; + case SpvOpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL"; + case SpvOpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL"; + case SpvOpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL"; + case SpvOpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL"; + case SpvOpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL"; + case SpvOpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL"; + case SpvOpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL"; + case SpvOpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL"; + case SpvOpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL"; + case SpvOpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL"; + case SpvOpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL"; + case SpvOpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL"; + case SpvOpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL"; + case SpvOpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL"; + case SpvOpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL"; + case SpvOpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL"; + case SpvOpLoopControlINTEL: return "OpLoopControlINTEL"; + case SpvOpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL"; + case SpvOpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL"; + case SpvOpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL"; + case SpvOpFixedSqrtINTEL: return "OpFixedSqrtINTEL"; + case SpvOpFixedRecipINTEL: return "OpFixedRecipINTEL"; + case SpvOpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL"; + case SpvOpFixedSinINTEL: return "OpFixedSinINTEL"; + case SpvOpFixedCosINTEL: return "OpFixedCosINTEL"; + case SpvOpFixedSinCosINTEL: return "OpFixedSinCosINTEL"; + case SpvOpFixedSinPiINTEL: return "OpFixedSinPiINTEL"; + case SpvOpFixedCosPiINTEL: return "OpFixedCosPiINTEL"; + case SpvOpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL"; + case SpvOpFixedLogINTEL: return "OpFixedLogINTEL"; + case SpvOpFixedExpINTEL: return "OpFixedExpINTEL"; + case SpvOpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL"; + case SpvOpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL"; + case SpvOpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL"; + case SpvOpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL"; + case SpvOpFPGARegINTEL: return "OpFPGARegINTEL"; + case SpvOpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR"; + case SpvOpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR"; + case SpvOpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR"; + case SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR"; + case SpvOpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR"; + case SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR"; + case SpvOpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR"; + case SpvOpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR"; + case SpvOpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR"; + case SpvOpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR"; + case SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR"; + case SpvOpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR"; + case SpvOpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR"; + case SpvOpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR"; + case SpvOpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; + case SpvOpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; + case SpvOpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case SpvOpAtomicFAddEXT: return "OpAtomicFAddEXT"; + case SpvOpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL"; + case SpvOpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL"; + case SpvOpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL"; + case SpvOpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL"; + case SpvOpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL"; + case SpvOpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL"; + case SpvOpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL"; + case SpvOpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL"; + case SpvOpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL"; + case SpvOpArithmeticFenceEXT: return "OpArithmeticFenceEXT"; + case SpvOpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL"; + case SpvOpGroupIMulKHR: return "OpGroupIMulKHR"; + case SpvOpGroupFMulKHR: return "OpGroupFMulKHR"; + case SpvOpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR"; + case SpvOpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR"; + case SpvOpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR"; + case SpvOpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR"; + case SpvOpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR"; + case SpvOpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR"; + case SpvOpMaskedGatherINTEL: return "OpMaskedGatherINTEL"; + case SpvOpMaskedScatterINTEL: return "OpMaskedScatterINTEL"; + default: return "Unknown"; + } +} + #endif /* SPV_ENABLE_UTILITY_CODE */ #endif diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 index f7c3e23d..a87711eb 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2020 The Khronos Group Inc. +// 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"), @@ -72,6 +72,8 @@ enum class SourceLanguage : unsigned { HERO_C = 8, NZSL = 9, WGSL = 10, + Slang = 11, + Zig = 12, Max = 0x7fffffff, }; @@ -172,6 +174,7 @@ enum class ExecutionMode : unsigned { EarlyAndLateFragmentTestsAMD = 5017, StencilRefReplacingEXT = 5027, CoalescingAMDX = 5069, + IsApiEntryAMDX = 5070, MaxNodeRecursionAMDX = 5071, StaticNumWorkgroupsAMDX = 5072, ShaderIndexAMDX = 5073, @@ -182,11 +185,16 @@ enum class ExecutionMode : unsigned { 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, @@ -206,9 +214,14 @@ enum class ExecutionMode : unsigned { NoGlobalOffsetINTEL = 5895, NumSIMDWorkitemsINTEL = 5896, SchedulerTargetFmaxMhzINTEL = 5903, + MaximallyReconvergesKHR = 6023, + FPFastMathDefault = 6028, StreamingInterfaceINTEL = 6154, RegisterMapInterfaceINTEL = 6160, NamedBarrierCountINTEL = 6417, + MaximumRegistersINTEL = 6461, + MaximumRegistersIdINTEL = 6462, + NamedMaximumRegistersINTEL = 6463, Max = 0x7fffffff, }; @@ -228,7 +241,6 @@ enum class StorageClass : unsigned { StorageBuffer = 12, TileImageEXT = 4172, NodePayloadAMDX = 5068, - NodeOutputPayloadAMDX = 5076, CallableDataKHR = 5328, CallableDataNV = 5328, IncomingCallableDataKHR = 5329, @@ -368,6 +380,7 @@ enum class ImageChannelDataType : unsigned { UnormInt101010_2 = 16, UnsignedIntRaw10EXT = 19, UnsignedIntRaw12EXT = 20, + UnormInt2_101010EXT = 21, Max = 0x7fffffff, }; @@ -425,8 +438,11 @@ enum class FPFastMathModeShift : unsigned { NSZ = 2, AllowRecip = 3, Fast = 4, + AllowContract = 16, AllowContractFastINTEL = 16, + AllowReassoc = 17, AllowReassocINTEL = 17, + AllowTransform = 18, Max = 0x7fffffff, }; @@ -437,8 +453,11 @@ enum class FPFastMathModeMask : unsigned { NSZ = 0x00000004, AllowRecip = 0x00000008, Fast = 0x00000010, + AllowContract = 0x00010000, AllowContractFastINTEL = 0x00010000, + AllowReassoc = 0x00020000, AllowReassocINTEL = 0x00020000, + AllowTransform = 0x00040000, }; enum class FPRoundingMode : unsigned { @@ -528,11 +547,16 @@ enum class Decoration : unsigned { 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, @@ -582,6 +606,9 @@ enum class Decoration : unsigned { MergeINTEL = 5834, BankBitsINTEL = 5835, ForcePow2DepthINTEL = 5836, + StridesizeINTEL = 5883, + WordsizeINTEL = 5884, + TrueDualPortINTEL = 5885, BurstCoalesceINTEL = 5899, CacheSizeINTEL = 5900, DontStaticallyCoalesceINTEL = 5901, @@ -600,9 +627,7 @@ enum class Decoration : unsigned { SingleElementVectorINTEL = 6085, VectorComputeCallableFunctionINTEL = 6087, MediaBlockIOINTEL = 6140, - InitModeINTEL = 6147, - ImplementInRegisterMapINTEL = 6148, - HostAccessINTEL = 6168, + StallFreeINTEL = 6151, FPMaxErrorDecorationINTEL = 6170, LatencyControlLabelINTEL = 6172, LatencyControlConstraintINTEL = 6173, @@ -615,6 +640,11 @@ enum class Decoration : unsigned { MMHostInterfaceMaxBurstINTEL = 6181, MMHostInterfaceWaitRequestINTEL = 6182, StableKernelArgumentINTEL = 6183, + HostAccessINTEL = 6188, + InitModeINTEL = 6190, + ImplementInRegisterMapINTEL = 6191, + CacheControlLoadINTEL = 6442, + CacheControlStoreINTEL = 6443, Max = 0x7fffffff, }; @@ -690,7 +720,7 @@ enum class BuiltIn : unsigned { BaryCoordSmoothSampleAMD = 4997, BaryCoordPullModelAMD = 4998, FragStencilRefEXT = 5014, - CoalescedInputCountAMDX = 5021, + RemainingRecursionLevelsAMDX = 5021, ShaderIndexAMDX = 5073, ViewportMaskNV = 5253, SecondaryPositionNV = 5257, @@ -745,6 +775,8 @@ enum class BuiltIn : unsigned { HitKindNV = 5333, CurrentRayTimeNV = 5334, HitTriangleVertexPositionsKHR = 5335, + HitMicroTriangleVertexPositionsNV = 5337, + HitMicroTriangleVertexBarycentricsNV = 5344, IncomingRayFlagsKHR = 5351, IncomingRayFlagsNV = 5351, RayGeometryIndexKHR = 5352, @@ -752,6 +784,8 @@ enum class BuiltIn : unsigned { SMCountNV = 5375, WarpIDNV = 5376, SMIDNV = 5377, + HitKindFrontFacingMicroTriangleNV = 5405, + HitKindBackFacingMicroTriangleNV = 5406, CullMaskKHR = 6021, Max = 0x7fffffff, }; @@ -819,6 +853,7 @@ enum class FunctionControlShift : unsigned { DontInline = 1, Pure = 2, Const = 3, + OptNoneEXT = 16, OptNoneINTEL = 16, Max = 0x7fffffff, }; @@ -829,6 +864,7 @@ enum class FunctionControlMask : unsigned { DontInline = 0x00000002, Pure = 0x00000004, Const = 0x00000008, + OptNoneEXT = 0x00010000, OptNoneINTEL = 0x00010000, }; @@ -1019,6 +1055,7 @@ enum class Capability : unsigned { TileImageColorReadAccessEXT = 4166, TileImageDepthReadAccessEXT = 4167, TileImageStencilReadAccessEXT = 4168, + CooperativeMatrixLayoutsARM = 4201, FragmentShadingRateKHR = 4422, SubgroupBallotKHR = 4423, DrawParameters = 4427, @@ -1048,11 +1085,13 @@ enum class Capability : unsigned { RoundingModeRTZ = 4468, RayQueryProvisionalKHR = 4471, RayQueryKHR = 4472, + UntypedPointersKHR = 4473, RayTraversalPrimitiveCullingKHR = 4478, RayTracingKHR = 4479, TextureSampleWeightedQCOM = 4484, TextureBoxFilterQCOM = 4485, TextureBlockMatchQCOM = 4486, + TextureBlockMatch2QCOM = 4498, Float16ImageAMD = 5008, ImageGatherBiasLodAMD = 5009, FragmentMaskAMD = 5010, @@ -1061,6 +1100,7 @@ enum class Capability : unsigned { Int64ImageEXT = 5016, ShaderClockKHR = 5055, ShaderEnqueueAMDX = 5067, + QuadControlKHR = 5087, SampleMaskOverrideCoverageNV = 5249, GeometryShaderPassthroughNV = 5251, ShaderViewportIndexLayerEXT = 5254, @@ -1074,6 +1114,7 @@ enum class Capability : unsigned { MeshShadingEXT = 5283, FragmentBarycentricKHR = 5284, FragmentBarycentricNV = 5284, + ComputeDerivativeGroupQuadsKHR = 5288, ComputeDerivativeGroupQuadsNV = 5288, FragmentDensityEXT = 5291, ShadingRateNV = 5291, @@ -1111,6 +1152,7 @@ enum class Capability : unsigned { VulkanMemoryModelDeviceScopeKHR = 5346, PhysicalStorageBufferAddresses = 5347, PhysicalStorageBufferAddressesEXT = 5347, + ComputeDerivativeGroupLinearKHR = 5350, ComputeDerivativeGroupLinearNV = 5350, RayTracingProvisionalKHR = 5353, CooperativeMatrixNV = 5357, @@ -1120,10 +1162,14 @@ enum class Capability : unsigned { FragmentShaderPixelInterlockEXT = 5378, DemoteToHelperInvocation = 5379, DemoteToHelperInvocationEXT = 5379, + DisplacementMicromapNV = 5380, RayTracingOpacityMicromapEXT = 5381, ShaderInvocationReorderNV = 5383, BindlessTextureNV = 5390, RayQueryPositionFetchKHR = 5391, + AtomicFloat16VectorNV = 5404, + RayTracingDisplacementMicromapNV = 5409, + RawAccessChainsNV = 5414, SubgroupShuffleINTEL = 5568, SubgroupBufferBlockIOINTEL = 5569, SubgroupImageBlockIOINTEL = 5570, @@ -1176,23 +1222,32 @@ enum class Capability : unsigned { DotProductKHR = 6019, RayCullMaskKHR = 6020, CooperativeMatrixKHR = 6022, + ReplicatedCompositesEXT = 6024, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, + FloatControls2 = 6029, AtomicFloat32AddEXT = 6033, AtomicFloat64AddEXT = 6034, - LongConstantCompositeINTEL = 6089, + LongCompositesINTEL = 6089, + OptNoneEXT = 6094, OptNoneINTEL = 6094, AtomicFloat16AddEXT = 6095, DebugInfoModuleINTEL = 6114, BFloat16ConversionINTEL = 6115, SplitBarrierINTEL = 6141, - GlobalVariableFPGADecorationsINTEL = 6146, + ArithmeticFenceEXT = 6144, + FPGAClusterAttributesV2INTEL = 6150, FPGAKernelAttributesv2INTEL = 6161, - GlobalVariableHostAccessINTEL = 6167, FPMaxErrorINTEL = 6169, FPGALatencyControlINTEL = 6171, FPGAArgumentInterfacesINTEL = 6174, + GlobalVariableHostAccessINTEL = 6187, + GlobalVariableFPGADecorationsINTEL = 6189, + SubgroupBufferPrefetchINTEL = 6220, GroupUniformArithmeticKHR = 6400, + MaskedGatherScatterINTEL = 6427, + CacheControlsINTEL = 6441, + RegisterLimitsINTEL = 6460, Max = 0x7fffffff, }; @@ -1320,6 +1375,8 @@ enum class CooperativeMatrixOperandsMask : unsigned { enum class CooperativeMatrixLayout : unsigned { RowMajorKHR = 0, ColumnMajorKHR = 1, + RowBlockedInterleavedARM = 4202, + ColumnBlockedInterleavedARM = 4203, Max = 0x7fffffff, }; @@ -1344,6 +1401,44 @@ enum class HostAccessQualifier : unsigned { 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 RawAccessChainOperandsShift : unsigned { + RobustnessPerComponentNV = 0, + RobustnessPerElementNV = 1, + Max = 0x7fffffff, +}; + +enum class RawAccessChainOperandsMask : unsigned { + MaskNone = 0, + RobustnessPerComponentNV = 0x00000001, + RobustnessPerElementNV = 0x00000002, +}; + +enum class FPEncoding : unsigned { + Max = 0x7fffffff, +}; + enum class Op : unsigned { OpNop = 0, OpUndef = 1, @@ -1693,13 +1788,22 @@ enum class Op : unsigned { OpDepthAttachmentReadEXT = 4161, OpStencilAttachmentReadEXT = 4162, 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, @@ -1722,6 +1826,9 @@ enum class Op : unsigned { OpCooperativeMatrixStoreKHR = 4458, OpCooperativeMatrixMulAddKHR = 4459, OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, @@ -1733,6 +1840,10 @@ enum class Op : unsigned { OpImageBoxFilterQCOM = 4481, OpImageBlockMatchSSDQCOM = 4482, OpImageBlockMatchSADQCOM = 4483, + OpImageBlockMatchWindowSSDQCOM = 4500, + OpImageBlockMatchWindowSADQCOM = 4501, + OpImageBlockMatchGatherSSDQCOM = 4502, + OpImageBlockMatchGatherSADQCOM = 4503, OpGroupIAddNonUniformAMD = 5000, OpGroupFAddNonUniformAMD = 5001, OpGroupFMinNonUniformAMD = 5002, @@ -1744,9 +1855,16 @@ enum class Op : unsigned { OpFragmentMaskFetchAMD = 5011, OpFragmentFetchAMD = 5012, OpReadClockKHR = 5056, - OpFinalizeNodePayloadsAMDX = 5075, + OpAllocateNodePayloadsAMDX = 5074, + OpEnqueueNodePayloadsAMDX = 5075, + OpTypeNodePayloadArrayAMDX = 5076, OpFinishWritingNodePayloadAMDX = 5078, - OpInitializeNodePayloadsAMDX = 5090, + OpNodePayloadArrayLengthAMDX = 5090, + OpIsNodePayloadValidAMDX = 5101, + OpConstantStringAMDX = 5103, + OpSpecConstantStringAMDX = 5104, + OpGroupNonUniformQuadAllKHR = 5110, + OpGroupNonUniformQuadAnyKHR = 5111, OpHitObjectRecordHitMotionNV = 5249, OpHitObjectRecordHitWithIndexMotionNV = 5250, OpHitObjectRecordMissMotionNV = 5251, @@ -1785,6 +1903,8 @@ enum class Op : unsigned { OpSetMeshOutputsEXT = 5295, OpGroupNonUniformPartitionNV = 5296, OpWritePackedPrimitiveIndices4x8NV = 5299, + OpFetchMicroTriangleVertexPositionNV = 5300, + OpFetchMicroTriangleVertexBarycentricNV = 5301, OpReportIntersectionKHR = 5334, OpReportIntersectionNV = 5334, OpIgnoreIntersectionNV = 5335, @@ -1813,6 +1933,7 @@ enum class Op : unsigned { OpConvertUToSampledImageNV = 5395, OpConvertSampledImageToUNV = 5396, OpSamplerImageAddressingModeNV = 5397, + OpRawAccessChainNV = 5398, OpSubgroupShuffleINTEL = 5571, OpSubgroupShuffleDownINTEL = 5572, OpSubgroupShuffleUpINTEL = 5573, @@ -2054,10 +2175,13 @@ enum class Op : unsigned { OpTypeStructContinuedINTEL = 6090, OpConstantCompositeContinuedINTEL = 6091, OpSpecConstantCompositeContinuedINTEL = 6092, + OpCompositeConstructContinuedINTEL = 6096, OpConvertFToBF16INTEL = 6116, OpConvertBF16ToFINTEL = 6117, OpControlBarrierArriveINTEL = 6142, OpControlBarrierWaitINTEL = 6143, + OpArithmeticFenceEXT = 6145, + OpSubgroupBlockPrefetchINTEL = 6221, OpGroupIMulKHR = 6401, OpGroupFMulKHR = 6402, OpGroupBitwiseAndKHR = 6403, @@ -2066,6 +2190,8 @@ enum class Op : unsigned { OpGroupLogicalAndKHR = 6406, OpGroupLogicalOrKHR = 6407, OpGroupLogicalXorKHR = 6408, + OpMaskedGatherINTEL = 6428, + OpMaskedScatterINTEL = 6429, Max = 0x7fffffff, }; @@ -2425,13 +2551,22 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case Op::OpStencilAttachmentReadEXT: *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; @@ -2448,6 +2583,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { 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; @@ -2459,6 +2597,10 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { 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::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::OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case Op::OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case Op::OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; @@ -2470,9 +2612,16 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { 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::OpFinalizeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; 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::OpInitializeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; 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; @@ -2511,14 +2660,16 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { 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::OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpFetchMicroTriangleVertexBarycentricNV: *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::OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break; case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; case Op::OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; @@ -2536,6 +2687,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { 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::OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; case Op::OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; case Op::OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; @@ -2775,10 +2927,13 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { 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::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; case Op::OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break; case Op::OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break; @@ -2787,8 +2942,1821 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { 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 SourceLanguageUnknown: return "Unknown"; + case SourceLanguageESSL: return "ESSL"; + case SourceLanguageGLSL: return "GLSL"; + case SourceLanguageOpenCL_C: return "OpenCL_C"; + case SourceLanguageOpenCL_CPP: return "OpenCL_CPP"; + case SourceLanguageHLSL: return "HLSL"; + case SourceLanguageCPP_for_OpenCL: return "CPP_for_OpenCL"; + case SourceLanguageSYCL: return "SYCL"; + case SourceLanguageHERO_C: return "HERO_C"; + case SourceLanguageNZSL: return "NZSL"; + case SourceLanguageWGSL: return "WGSL"; + case SourceLanguageSlang: return "Slang"; + case SourceLanguageZig: return "Zig"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModelToString(ExecutionModel value) { + switch (value) { + case ExecutionModelVertex: return "Vertex"; + case ExecutionModelTessellationControl: return "TessellationControl"; + case ExecutionModelTessellationEvaluation: return "TessellationEvaluation"; + case ExecutionModelGeometry: return "Geometry"; + case ExecutionModelFragment: return "Fragment"; + case ExecutionModelGLCompute: return "GLCompute"; + case ExecutionModelKernel: return "Kernel"; + case ExecutionModelTaskNV: return "TaskNV"; + case ExecutionModelMeshNV: return "MeshNV"; + case ExecutionModelRayGenerationKHR: return "RayGenerationKHR"; + case ExecutionModelIntersectionKHR: return "IntersectionKHR"; + case ExecutionModelAnyHitKHR: return "AnyHitKHR"; + case ExecutionModelClosestHitKHR: return "ClosestHitKHR"; + case ExecutionModelMissKHR: return "MissKHR"; + case ExecutionModelCallableKHR: return "CallableKHR"; + case ExecutionModelTaskEXT: return "TaskEXT"; + case ExecutionModelMeshEXT: return "MeshEXT"; + default: return "Unknown"; + } +} + +inline const char* AddressingModelToString(AddressingModel value) { + switch (value) { + case AddressingModelLogical: return "Logical"; + case AddressingModelPhysical32: return "Physical32"; + case AddressingModelPhysical64: return "Physical64"; + case AddressingModelPhysicalStorageBuffer64: return "PhysicalStorageBuffer64"; + default: return "Unknown"; + } +} + +inline const char* MemoryModelToString(MemoryModel value) { + switch (value) { + case MemoryModelSimple: return "Simple"; + case MemoryModelGLSL450: return "GLSL450"; + case MemoryModelOpenCL: return "OpenCL"; + case MemoryModelVulkan: return "Vulkan"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModeToString(ExecutionMode value) { + switch (value) { + case ExecutionModeInvocations: return "Invocations"; + case ExecutionModeSpacingEqual: return "SpacingEqual"; + case ExecutionModeSpacingFractionalEven: return "SpacingFractionalEven"; + case ExecutionModeSpacingFractionalOdd: return "SpacingFractionalOdd"; + case ExecutionModeVertexOrderCw: return "VertexOrderCw"; + case ExecutionModeVertexOrderCcw: return "VertexOrderCcw"; + case ExecutionModePixelCenterInteger: return "PixelCenterInteger"; + case ExecutionModeOriginUpperLeft: return "OriginUpperLeft"; + case ExecutionModeOriginLowerLeft: return "OriginLowerLeft"; + case ExecutionModeEarlyFragmentTests: return "EarlyFragmentTests"; + case ExecutionModePointMode: return "PointMode"; + case ExecutionModeXfb: return "Xfb"; + case ExecutionModeDepthReplacing: return "DepthReplacing"; + case ExecutionModeDepthGreater: return "DepthGreater"; + case ExecutionModeDepthLess: return "DepthLess"; + case ExecutionModeDepthUnchanged: return "DepthUnchanged"; + case ExecutionModeLocalSize: return "LocalSize"; + case ExecutionModeLocalSizeHint: return "LocalSizeHint"; + case ExecutionModeInputPoints: return "InputPoints"; + case ExecutionModeInputLines: return "InputLines"; + case ExecutionModeInputLinesAdjacency: return "InputLinesAdjacency"; + case ExecutionModeTriangles: return "Triangles"; + case ExecutionModeInputTrianglesAdjacency: return "InputTrianglesAdjacency"; + case ExecutionModeQuads: return "Quads"; + case ExecutionModeIsolines: return "Isolines"; + case ExecutionModeOutputVertices: return "OutputVertices"; + case ExecutionModeOutputPoints: return "OutputPoints"; + case ExecutionModeOutputLineStrip: return "OutputLineStrip"; + case ExecutionModeOutputTriangleStrip: return "OutputTriangleStrip"; + case ExecutionModeVecTypeHint: return "VecTypeHint"; + case ExecutionModeContractionOff: return "ContractionOff"; + case ExecutionModeInitializer: return "Initializer"; + case ExecutionModeFinalizer: return "Finalizer"; + case ExecutionModeSubgroupSize: return "SubgroupSize"; + case ExecutionModeSubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup"; + case ExecutionModeSubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId"; + case ExecutionModeLocalSizeId: return "LocalSizeId"; + case ExecutionModeLocalSizeHintId: return "LocalSizeHintId"; + case ExecutionModeNonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; + case ExecutionModeNonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; + case ExecutionModeNonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + case ExecutionModeSubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR"; + case ExecutionModePostDepthCoverage: return "PostDepthCoverage"; + case ExecutionModeDenormPreserve: return "DenormPreserve"; + case ExecutionModeDenormFlushToZero: return "DenormFlushToZero"; + case ExecutionModeSignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case ExecutionModeRoundingModeRTE: return "RoundingModeRTE"; + case ExecutionModeRoundingModeRTZ: return "RoundingModeRTZ"; + case ExecutionModeEarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD"; + case ExecutionModeStencilRefReplacingEXT: return "StencilRefReplacingEXT"; + case ExecutionModeCoalescingAMDX: return "CoalescingAMDX"; + case ExecutionModeIsApiEntryAMDX: return "IsApiEntryAMDX"; + case ExecutionModeMaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX"; + case ExecutionModeStaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX"; + case ExecutionModeShaderIndexAMDX: return "ShaderIndexAMDX"; + case ExecutionModeMaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX"; + case ExecutionModeStencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD"; + case ExecutionModeStencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD"; + case ExecutionModeStencilRefLessFrontAMD: return "StencilRefLessFrontAMD"; + case ExecutionModeStencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD"; + case ExecutionModeStencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD"; + case ExecutionModeStencilRefLessBackAMD: return "StencilRefLessBackAMD"; + case ExecutionModeQuadDerivativesKHR: return "QuadDerivativesKHR"; + case ExecutionModeRequireFullQuadsKHR: return "RequireFullQuadsKHR"; + case ExecutionModeSharesInputWithAMDX: return "SharesInputWithAMDX"; + case ExecutionModeOutputLinesEXT: return "OutputLinesEXT"; + case ExecutionModeOutputPrimitivesEXT: return "OutputPrimitivesEXT"; + case ExecutionModeDerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR"; + case ExecutionModeDerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR"; + case ExecutionModeOutputTrianglesEXT: return "OutputTrianglesEXT"; + case ExecutionModePixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT"; + case ExecutionModePixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT"; + case ExecutionModeSampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT"; + case ExecutionModeSampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT"; + case ExecutionModeShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT"; + case ExecutionModeShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT"; + case ExecutionModeSharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL"; + case ExecutionModeRoundingModeRTPINTEL: return "RoundingModeRTPINTEL"; + case ExecutionModeRoundingModeRTNINTEL: return "RoundingModeRTNINTEL"; + case ExecutionModeFloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL"; + case ExecutionModeFloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL"; + case ExecutionModeMaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL"; + case ExecutionModeMaxWorkDimINTEL: return "MaxWorkDimINTEL"; + case ExecutionModeNoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; + case ExecutionModeNumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + case ExecutionModeSchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL"; + case ExecutionModeMaximallyReconvergesKHR: return "MaximallyReconvergesKHR"; + case ExecutionModeFPFastMathDefault: return "FPFastMathDefault"; + case ExecutionModeStreamingInterfaceINTEL: return "StreamingInterfaceINTEL"; + case ExecutionModeRegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL"; + case ExecutionModeNamedBarrierCountINTEL: return "NamedBarrierCountINTEL"; + case ExecutionModeMaximumRegistersINTEL: return "MaximumRegistersINTEL"; + case ExecutionModeMaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL"; + case ExecutionModeNamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL"; + default: return "Unknown"; + } +} + +inline const char* StorageClassToString(StorageClass value) { + switch (value) { + case StorageClassUniformConstant: return "UniformConstant"; + case StorageClassInput: return "Input"; + case StorageClassUniform: return "Uniform"; + case StorageClassOutput: return "Output"; + case StorageClassWorkgroup: return "Workgroup"; + case StorageClassCrossWorkgroup: return "CrossWorkgroup"; + case StorageClassPrivate: return "Private"; + case StorageClassFunction: return "Function"; + case StorageClassGeneric: return "Generic"; + case StorageClassPushConstant: return "PushConstant"; + case StorageClassAtomicCounter: return "AtomicCounter"; + case StorageClassImage: return "Image"; + case StorageClassStorageBuffer: return "StorageBuffer"; + case StorageClassTileImageEXT: return "TileImageEXT"; + case StorageClassNodePayloadAMDX: return "NodePayloadAMDX"; + case StorageClassCallableDataKHR: return "CallableDataKHR"; + case StorageClassIncomingCallableDataKHR: return "IncomingCallableDataKHR"; + case StorageClassRayPayloadKHR: return "RayPayloadKHR"; + case StorageClassHitAttributeKHR: return "HitAttributeKHR"; + case StorageClassIncomingRayPayloadKHR: return "IncomingRayPayloadKHR"; + case StorageClassShaderRecordBufferKHR: return "ShaderRecordBufferKHR"; + case StorageClassPhysicalStorageBuffer: return "PhysicalStorageBuffer"; + case StorageClassHitObjectAttributeNV: return "HitObjectAttributeNV"; + case StorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case StorageClassCodeSectionINTEL: return "CodeSectionINTEL"; + case StorageClassDeviceOnlyINTEL: return "DeviceOnlyINTEL"; + case StorageClassHostOnlyINTEL: return "HostOnlyINTEL"; + default: return "Unknown"; + } +} + +inline const char* DimToString(Dim value) { + switch (value) { + case Dim1D: return "1D"; + case Dim2D: return "2D"; + case Dim3D: return "3D"; + case DimCube: return "Cube"; + case DimRect: return "Rect"; + case DimBuffer: return "Buffer"; + case DimSubpassData: return "SubpassData"; + case DimTileImageDataEXT: return "TileImageDataEXT"; + default: return "Unknown"; + } +} + +inline const char* SamplerAddressingModeToString(SamplerAddressingMode value) { + switch (value) { + case SamplerAddressingModeNone: return "None"; + case SamplerAddressingModeClampToEdge: return "ClampToEdge"; + case SamplerAddressingModeClamp: return "Clamp"; + case SamplerAddressingModeRepeat: return "Repeat"; + case SamplerAddressingModeRepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* SamplerFilterModeToString(SamplerFilterMode value) { + switch (value) { + case SamplerFilterModeNearest: return "Nearest"; + case SamplerFilterModeLinear: return "Linear"; + default: return "Unknown"; + } +} + +inline const char* ImageFormatToString(ImageFormat value) { + switch (value) { + case ImageFormatUnknown: return "Unknown"; + case ImageFormatRgba32f: return "Rgba32f"; + case ImageFormatRgba16f: return "Rgba16f"; + case ImageFormatR32f: return "R32f"; + case ImageFormatRgba8: return "Rgba8"; + case ImageFormatRgba8Snorm: return "Rgba8Snorm"; + case ImageFormatRg32f: return "Rg32f"; + case ImageFormatRg16f: return "Rg16f"; + case ImageFormatR11fG11fB10f: return "R11fG11fB10f"; + case ImageFormatR16f: return "R16f"; + case ImageFormatRgba16: return "Rgba16"; + case ImageFormatRgb10A2: return "Rgb10A2"; + case ImageFormatRg16: return "Rg16"; + case ImageFormatRg8: return "Rg8"; + case ImageFormatR16: return "R16"; + case ImageFormatR8: return "R8"; + case ImageFormatRgba16Snorm: return "Rgba16Snorm"; + case ImageFormatRg16Snorm: return "Rg16Snorm"; + case ImageFormatRg8Snorm: return "Rg8Snorm"; + case ImageFormatR16Snorm: return "R16Snorm"; + case ImageFormatR8Snorm: return "R8Snorm"; + case ImageFormatRgba32i: return "Rgba32i"; + case ImageFormatRgba16i: return "Rgba16i"; + case ImageFormatRgba8i: return "Rgba8i"; + case ImageFormatR32i: return "R32i"; + case ImageFormatRg32i: return "Rg32i"; + case ImageFormatRg16i: return "Rg16i"; + case ImageFormatRg8i: return "Rg8i"; + case ImageFormatR16i: return "R16i"; + case ImageFormatR8i: return "R8i"; + case ImageFormatRgba32ui: return "Rgba32ui"; + case ImageFormatRgba16ui: return "Rgba16ui"; + case ImageFormatRgba8ui: return "Rgba8ui"; + case ImageFormatR32ui: return "R32ui"; + case ImageFormatRgb10a2ui: return "Rgb10a2ui"; + case ImageFormatRg32ui: return "Rg32ui"; + case ImageFormatRg16ui: return "Rg16ui"; + case ImageFormatRg8ui: return "Rg8ui"; + case ImageFormatR16ui: return "R16ui"; + case ImageFormatR8ui: return "R8ui"; + case ImageFormatR64ui: return "R64ui"; + case ImageFormatR64i: return "R64i"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelOrderToString(ImageChannelOrder value) { + switch (value) { + case ImageChannelOrderR: return "R"; + case ImageChannelOrderA: return "A"; + case ImageChannelOrderRG: return "RG"; + case ImageChannelOrderRA: return "RA"; + case ImageChannelOrderRGB: return "RGB"; + case ImageChannelOrderRGBA: return "RGBA"; + case ImageChannelOrderBGRA: return "BGRA"; + case ImageChannelOrderARGB: return "ARGB"; + case ImageChannelOrderIntensity: return "Intensity"; + case ImageChannelOrderLuminance: return "Luminance"; + case ImageChannelOrderRx: return "Rx"; + case ImageChannelOrderRGx: return "RGx"; + case ImageChannelOrderRGBx: return "RGBx"; + case ImageChannelOrderDepth: return "Depth"; + case ImageChannelOrderDepthStencil: return "DepthStencil"; + case ImageChannelOrdersRGB: return "sRGB"; + case ImageChannelOrdersRGBx: return "sRGBx"; + case ImageChannelOrdersRGBA: return "sRGBA"; + case ImageChannelOrdersBGRA: return "sBGRA"; + case ImageChannelOrderABGR: return "ABGR"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelDataTypeToString(ImageChannelDataType value) { + switch (value) { + case ImageChannelDataTypeSnormInt8: return "SnormInt8"; + case ImageChannelDataTypeSnormInt16: return "SnormInt16"; + case ImageChannelDataTypeUnormInt8: return "UnormInt8"; + case ImageChannelDataTypeUnormInt16: return "UnormInt16"; + case ImageChannelDataTypeUnormShort565: return "UnormShort565"; + case ImageChannelDataTypeUnormShort555: return "UnormShort555"; + case ImageChannelDataTypeUnormInt101010: return "UnormInt101010"; + case ImageChannelDataTypeSignedInt8: return "SignedInt8"; + case ImageChannelDataTypeSignedInt16: return "SignedInt16"; + case ImageChannelDataTypeSignedInt32: return "SignedInt32"; + case ImageChannelDataTypeUnsignedInt8: return "UnsignedInt8"; + case ImageChannelDataTypeUnsignedInt16: return "UnsignedInt16"; + case ImageChannelDataTypeUnsignedInt32: return "UnsignedInt32"; + case ImageChannelDataTypeHalfFloat: return "HalfFloat"; + case ImageChannelDataTypeFloat: return "Float"; + case ImageChannelDataTypeUnormInt24: return "UnormInt24"; + case ImageChannelDataTypeUnormInt101010_2: return "UnormInt101010_2"; + case ImageChannelDataTypeUnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT"; + case ImageChannelDataTypeUnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT"; + case ImageChannelDataTypeUnormInt2_101010EXT: return "UnormInt2_101010EXT"; + default: return "Unknown"; + } +} + +inline const char* FPRoundingModeToString(FPRoundingMode value) { + switch (value) { + case FPRoundingModeRTE: return "RTE"; + case FPRoundingModeRTZ: return "RTZ"; + case FPRoundingModeRTP: return "RTP"; + case FPRoundingModeRTN: return "RTN"; + default: return "Unknown"; + } +} + +inline const char* LinkageTypeToString(LinkageType value) { + switch (value) { + case LinkageTypeExport: return "Export"; + case LinkageTypeImport: return "Import"; + case LinkageTypeLinkOnceODR: return "LinkOnceODR"; + default: return "Unknown"; + } +} + +inline const char* AccessQualifierToString(AccessQualifier value) { + switch (value) { + case AccessQualifierReadOnly: return "ReadOnly"; + case AccessQualifierWriteOnly: return "WriteOnly"; + case AccessQualifierReadWrite: return "ReadWrite"; + default: return "Unknown"; + } +} + +inline const char* FunctionParameterAttributeToString(FunctionParameterAttribute value) { + switch (value) { + case FunctionParameterAttributeZext: return "Zext"; + case FunctionParameterAttributeSext: return "Sext"; + case FunctionParameterAttributeByVal: return "ByVal"; + case FunctionParameterAttributeSret: return "Sret"; + case FunctionParameterAttributeNoAlias: return "NoAlias"; + case FunctionParameterAttributeNoCapture: return "NoCapture"; + case FunctionParameterAttributeNoWrite: return "NoWrite"; + case FunctionParameterAttributeNoReadWrite: return "NoReadWrite"; + case FunctionParameterAttributeRuntimeAlignedINTEL: return "RuntimeAlignedINTEL"; + default: return "Unknown"; + } +} + +inline const char* DecorationToString(Decoration value) { + switch (value) { + case DecorationRelaxedPrecision: return "RelaxedPrecision"; + case DecorationSpecId: return "SpecId"; + case DecorationBlock: return "Block"; + case DecorationBufferBlock: return "BufferBlock"; + case DecorationRowMajor: return "RowMajor"; + case DecorationColMajor: return "ColMajor"; + case DecorationArrayStride: return "ArrayStride"; + case DecorationMatrixStride: return "MatrixStride"; + case DecorationGLSLShared: return "GLSLShared"; + case DecorationGLSLPacked: return "GLSLPacked"; + case DecorationCPacked: return "CPacked"; + case DecorationBuiltIn: return "BuiltIn"; + case DecorationNoPerspective: return "NoPerspective"; + case DecorationFlat: return "Flat"; + case DecorationPatch: return "Patch"; + case DecorationCentroid: return "Centroid"; + case DecorationSample: return "Sample"; + case DecorationInvariant: return "Invariant"; + case DecorationRestrict: return "Restrict"; + case DecorationAliased: return "Aliased"; + case DecorationVolatile: return "Volatile"; + case DecorationConstant: return "Constant"; + case DecorationCoherent: return "Coherent"; + case DecorationNonWritable: return "NonWritable"; + case DecorationNonReadable: return "NonReadable"; + case DecorationUniform: return "Uniform"; + case DecorationUniformId: return "UniformId"; + case DecorationSaturatedConversion: return "SaturatedConversion"; + case DecorationStream: return "Stream"; + case DecorationLocation: return "Location"; + case DecorationComponent: return "Component"; + case DecorationIndex: return "Index"; + case DecorationBinding: return "Binding"; + case DecorationDescriptorSet: return "DescriptorSet"; + case DecorationOffset: return "Offset"; + case DecorationXfbBuffer: return "XfbBuffer"; + case DecorationXfbStride: return "XfbStride"; + case DecorationFuncParamAttr: return "FuncParamAttr"; + case DecorationFPRoundingMode: return "FPRoundingMode"; + case DecorationFPFastMathMode: return "FPFastMathMode"; + case DecorationLinkageAttributes: return "LinkageAttributes"; + case DecorationNoContraction: return "NoContraction"; + case DecorationInputAttachmentIndex: return "InputAttachmentIndex"; + case DecorationAlignment: return "Alignment"; + case DecorationMaxByteOffset: return "MaxByteOffset"; + case DecorationAlignmentId: return "AlignmentId"; + case DecorationMaxByteOffsetId: return "MaxByteOffsetId"; + case DecorationNoSignedWrap: return "NoSignedWrap"; + case DecorationNoUnsignedWrap: return "NoUnsignedWrap"; + case DecorationWeightTextureQCOM: return "WeightTextureQCOM"; + case DecorationBlockMatchTextureQCOM: return "BlockMatchTextureQCOM"; + case DecorationBlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM"; + case DecorationExplicitInterpAMD: return "ExplicitInterpAMD"; + case DecorationNodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX"; + case DecorationNodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX"; + case DecorationTrackFinishWritingAMDX: return "TrackFinishWritingAMDX"; + case DecorationPayloadNodeNameAMDX: return "PayloadNodeNameAMDX"; + case DecorationPayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX"; + case DecorationPayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX"; + case DecorationPayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX"; + case DecorationPayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX"; + case DecorationOverrideCoverageNV: return "OverrideCoverageNV"; + case DecorationPassthroughNV: return "PassthroughNV"; + case DecorationViewportRelativeNV: return "ViewportRelativeNV"; + case DecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case DecorationPerPrimitiveEXT: return "PerPrimitiveEXT"; + case DecorationPerViewNV: return "PerViewNV"; + case DecorationPerTaskNV: return "PerTaskNV"; + case DecorationPerVertexKHR: return "PerVertexKHR"; + case DecorationNonUniform: return "NonUniform"; + case DecorationRestrictPointer: return "RestrictPointer"; + case DecorationAliasedPointer: return "AliasedPointer"; + case DecorationHitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV"; + case DecorationBindlessSamplerNV: return "BindlessSamplerNV"; + case DecorationBindlessImageNV: return "BindlessImageNV"; + case DecorationBoundSamplerNV: return "BoundSamplerNV"; + case DecorationBoundImageNV: return "BoundImageNV"; + case DecorationSIMTCallINTEL: return "SIMTCallINTEL"; + case DecorationReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL"; + case DecorationClobberINTEL: return "ClobberINTEL"; + case DecorationSideEffectsINTEL: return "SideEffectsINTEL"; + case DecorationVectorComputeVariableINTEL: return "VectorComputeVariableINTEL"; + case DecorationFuncParamIOKindINTEL: return "FuncParamIOKindINTEL"; + case DecorationVectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL"; + case DecorationStackCallINTEL: return "StackCallINTEL"; + case DecorationGlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL"; + case DecorationCounterBuffer: return "CounterBuffer"; + case DecorationHlslSemanticGOOGLE: return "HlslSemanticGOOGLE"; + case DecorationUserTypeGOOGLE: return "UserTypeGOOGLE"; + case DecorationFunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL"; + case DecorationFunctionDenormModeINTEL: return "FunctionDenormModeINTEL"; + case DecorationRegisterINTEL: return "RegisterINTEL"; + case DecorationMemoryINTEL: return "MemoryINTEL"; + case DecorationNumbanksINTEL: return "NumbanksINTEL"; + case DecorationBankwidthINTEL: return "BankwidthINTEL"; + case DecorationMaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL"; + case DecorationSinglepumpINTEL: return "SinglepumpINTEL"; + case DecorationDoublepumpINTEL: return "DoublepumpINTEL"; + case DecorationMaxReplicatesINTEL: return "MaxReplicatesINTEL"; + case DecorationSimpleDualPortINTEL: return "SimpleDualPortINTEL"; + case DecorationMergeINTEL: return "MergeINTEL"; + case DecorationBankBitsINTEL: return "BankBitsINTEL"; + case DecorationForcePow2DepthINTEL: return "ForcePow2DepthINTEL"; + case DecorationStridesizeINTEL: return "StridesizeINTEL"; + case DecorationWordsizeINTEL: return "WordsizeINTEL"; + case DecorationTrueDualPortINTEL: return "TrueDualPortINTEL"; + case DecorationBurstCoalesceINTEL: return "BurstCoalesceINTEL"; + case DecorationCacheSizeINTEL: return "CacheSizeINTEL"; + case DecorationDontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL"; + case DecorationPrefetchINTEL: return "PrefetchINTEL"; + case DecorationStallEnableINTEL: return "StallEnableINTEL"; + case DecorationFuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL"; + case DecorationMathOpDSPModeINTEL: return "MathOpDSPModeINTEL"; + case DecorationAliasScopeINTEL: return "AliasScopeINTEL"; + case DecorationNoAliasINTEL: return "NoAliasINTEL"; + case DecorationInitiationIntervalINTEL: return "InitiationIntervalINTEL"; + case DecorationMaxConcurrencyINTEL: return "MaxConcurrencyINTEL"; + case DecorationPipelineEnableINTEL: return "PipelineEnableINTEL"; + case DecorationBufferLocationINTEL: return "BufferLocationINTEL"; + case DecorationIOPipeStorageINTEL: return "IOPipeStorageINTEL"; + case DecorationFunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL"; + case DecorationSingleElementVectorINTEL: return "SingleElementVectorINTEL"; + case DecorationVectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL"; + case DecorationMediaBlockIOINTEL: return "MediaBlockIOINTEL"; + case DecorationStallFreeINTEL: return "StallFreeINTEL"; + case DecorationFPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL"; + case DecorationLatencyControlLabelINTEL: return "LatencyControlLabelINTEL"; + case DecorationLatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL"; + case DecorationConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL"; + case DecorationRegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL"; + case DecorationMMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL"; + case DecorationMMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL"; + case DecorationMMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL"; + case DecorationMMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL"; + case DecorationMMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL"; + case DecorationMMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL"; + case DecorationStableKernelArgumentINTEL: return "StableKernelArgumentINTEL"; + case DecorationHostAccessINTEL: return "HostAccessINTEL"; + case DecorationInitModeINTEL: return "InitModeINTEL"; + case DecorationImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL"; + case DecorationCacheControlLoadINTEL: return "CacheControlLoadINTEL"; + case DecorationCacheControlStoreINTEL: return "CacheControlStoreINTEL"; + default: return "Unknown"; } } + +inline const char* BuiltInToString(BuiltIn value) { + switch (value) { + case BuiltInPosition: return "Position"; + case BuiltInPointSize: return "PointSize"; + case BuiltInClipDistance: return "ClipDistance"; + case BuiltInCullDistance: return "CullDistance"; + case BuiltInVertexId: return "VertexId"; + case BuiltInInstanceId: return "InstanceId"; + case BuiltInPrimitiveId: return "PrimitiveId"; + case BuiltInInvocationId: return "InvocationId"; + case BuiltInLayer: return "Layer"; + case BuiltInViewportIndex: return "ViewportIndex"; + case BuiltInTessLevelOuter: return "TessLevelOuter"; + case BuiltInTessLevelInner: return "TessLevelInner"; + case BuiltInTessCoord: return "TessCoord"; + case BuiltInPatchVertices: return "PatchVertices"; + case BuiltInFragCoord: return "FragCoord"; + case BuiltInPointCoord: return "PointCoord"; + case BuiltInFrontFacing: return "FrontFacing"; + case BuiltInSampleId: return "SampleId"; + case BuiltInSamplePosition: return "SamplePosition"; + case BuiltInSampleMask: return "SampleMask"; + case BuiltInFragDepth: return "FragDepth"; + case BuiltInHelperInvocation: return "HelperInvocation"; + case BuiltInNumWorkgroups: return "NumWorkgroups"; + case BuiltInWorkgroupSize: return "WorkgroupSize"; + case BuiltInWorkgroupId: return "WorkgroupId"; + case BuiltInLocalInvocationId: return "LocalInvocationId"; + case BuiltInGlobalInvocationId: return "GlobalInvocationId"; + case BuiltInLocalInvocationIndex: return "LocalInvocationIndex"; + case BuiltInWorkDim: return "WorkDim"; + case BuiltInGlobalSize: return "GlobalSize"; + case BuiltInEnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize"; + case BuiltInGlobalOffset: return "GlobalOffset"; + case BuiltInGlobalLinearId: return "GlobalLinearId"; + case BuiltInSubgroupSize: return "SubgroupSize"; + case BuiltInSubgroupMaxSize: return "SubgroupMaxSize"; + case BuiltInNumSubgroups: return "NumSubgroups"; + case BuiltInNumEnqueuedSubgroups: return "NumEnqueuedSubgroups"; + case BuiltInSubgroupId: return "SubgroupId"; + case BuiltInSubgroupLocalInvocationId: return "SubgroupLocalInvocationId"; + case BuiltInVertexIndex: return "VertexIndex"; + case BuiltInInstanceIndex: return "InstanceIndex"; + case BuiltInCoreIDARM: return "CoreIDARM"; + case BuiltInCoreCountARM: return "CoreCountARM"; + case BuiltInCoreMaxIDARM: return "CoreMaxIDARM"; + case BuiltInWarpIDARM: return "WarpIDARM"; + case BuiltInWarpMaxIDARM: return "WarpMaxIDARM"; + case BuiltInSubgroupEqMask: return "SubgroupEqMask"; + case BuiltInSubgroupGeMask: return "SubgroupGeMask"; + case BuiltInSubgroupGtMask: return "SubgroupGtMask"; + case BuiltInSubgroupLeMask: return "SubgroupLeMask"; + case BuiltInSubgroupLtMask: return "SubgroupLtMask"; + case BuiltInBaseVertex: return "BaseVertex"; + case BuiltInBaseInstance: return "BaseInstance"; + case BuiltInDrawIndex: return "DrawIndex"; + case BuiltInPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + case BuiltInDeviceIndex: return "DeviceIndex"; + case BuiltInViewIndex: return "ViewIndex"; + case BuiltInShadingRateKHR: return "ShadingRateKHR"; + case BuiltInBaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD"; + case BuiltInBaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD"; + case BuiltInBaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD"; + case BuiltInBaryCoordSmoothAMD: return "BaryCoordSmoothAMD"; + case BuiltInBaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD"; + case BuiltInBaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD"; + case BuiltInBaryCoordPullModelAMD: return "BaryCoordPullModelAMD"; + case BuiltInFragStencilRefEXT: return "FragStencilRefEXT"; + case BuiltInRemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX"; + case BuiltInShaderIndexAMDX: return "ShaderIndexAMDX"; + case BuiltInViewportMaskNV: return "ViewportMaskNV"; + case BuiltInSecondaryPositionNV: return "SecondaryPositionNV"; + case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case BuiltInPositionPerViewNV: return "PositionPerViewNV"; + case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case BuiltInFullyCoveredEXT: return "FullyCoveredEXT"; + case BuiltInTaskCountNV: return "TaskCountNV"; + case BuiltInPrimitiveCountNV: return "PrimitiveCountNV"; + case BuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case BuiltInClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case BuiltInCullDistancePerViewNV: return "CullDistancePerViewNV"; + case BuiltInLayerPerViewNV: return "LayerPerViewNV"; + case BuiltInMeshViewCountNV: return "MeshViewCountNV"; + case BuiltInMeshViewIndicesNV: return "MeshViewIndicesNV"; + case BuiltInBaryCoordKHR: return "BaryCoordKHR"; + case BuiltInBaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR"; + case BuiltInFragSizeEXT: return "FragSizeEXT"; + case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT"; + case BuiltInPrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT"; + case BuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; + case BuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; + case BuiltInCullPrimitiveEXT: return "CullPrimitiveEXT"; + case BuiltInLaunchIdKHR: return "LaunchIdKHR"; + case BuiltInLaunchSizeKHR: return "LaunchSizeKHR"; + case BuiltInWorldRayOriginKHR: return "WorldRayOriginKHR"; + case BuiltInWorldRayDirectionKHR: return "WorldRayDirectionKHR"; + case BuiltInObjectRayOriginKHR: return "ObjectRayOriginKHR"; + case BuiltInObjectRayDirectionKHR: return "ObjectRayDirectionKHR"; + case BuiltInRayTminKHR: return "RayTminKHR"; + case BuiltInRayTmaxKHR: return "RayTmaxKHR"; + case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; + case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR"; + case BuiltInWorldToObjectKHR: return "WorldToObjectKHR"; + case BuiltInHitTNV: return "HitTNV"; + case BuiltInHitKindKHR: return "HitKindKHR"; + case BuiltInCurrentRayTimeNV: return "CurrentRayTimeNV"; + case BuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case BuiltInHitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case BuiltInHitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case BuiltInIncomingRayFlagsKHR: return "IncomingRayFlagsKHR"; + case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR"; + case BuiltInWarpsPerSMNV: return "WarpsPerSMNV"; + case BuiltInSMCountNV: return "SMCountNV"; + case BuiltInWarpIDNV: return "WarpIDNV"; + case BuiltInSMIDNV: return "SMIDNV"; + case BuiltInHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case BuiltInHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + case BuiltInCullMaskKHR: return "CullMaskKHR"; + default: return "Unknown"; + } +} + +inline const char* ScopeToString(Scope value) { + switch (value) { + case ScopeCrossDevice: return "CrossDevice"; + case ScopeDevice: return "Device"; + case ScopeWorkgroup: return "Workgroup"; + case ScopeSubgroup: return "Subgroup"; + case ScopeInvocation: return "Invocation"; + case ScopeQueueFamily: return "QueueFamily"; + case ScopeShaderCallKHR: return "ShaderCallKHR"; + default: return "Unknown"; + } +} + +inline const char* GroupOperationToString(GroupOperation value) { + switch (value) { + case GroupOperationReduce: return "Reduce"; + case GroupOperationInclusiveScan: return "InclusiveScan"; + case GroupOperationExclusiveScan: return "ExclusiveScan"; + case GroupOperationClusteredReduce: return "ClusteredReduce"; + case GroupOperationPartitionedReduceNV: return "PartitionedReduceNV"; + case GroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case GroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; + default: return "Unknown"; + } +} + +inline const char* KernelEnqueueFlagsToString(KernelEnqueueFlags value) { + switch (value) { + case KernelEnqueueFlagsNoWait: return "NoWait"; + case KernelEnqueueFlagsWaitKernel: return "WaitKernel"; + case KernelEnqueueFlagsWaitWorkGroup: return "WaitWorkGroup"; + default: return "Unknown"; + } +} + +inline const char* CapabilityToString(Capability value) { + switch (value) { + case CapabilityMatrix: return "Matrix"; + case CapabilityShader: return "Shader"; + case CapabilityGeometry: return "Geometry"; + case CapabilityTessellation: return "Tessellation"; + case CapabilityAddresses: return "Addresses"; + case CapabilityLinkage: return "Linkage"; + case CapabilityKernel: return "Kernel"; + case CapabilityVector16: return "Vector16"; + case CapabilityFloat16Buffer: return "Float16Buffer"; + case CapabilityFloat16: return "Float16"; + case CapabilityFloat64: return "Float64"; + case CapabilityInt64: return "Int64"; + case CapabilityInt64Atomics: return "Int64Atomics"; + case CapabilityImageBasic: return "ImageBasic"; + case CapabilityImageReadWrite: return "ImageReadWrite"; + case CapabilityImageMipmap: return "ImageMipmap"; + case CapabilityPipes: return "Pipes"; + case CapabilityGroups: return "Groups"; + case CapabilityDeviceEnqueue: return "DeviceEnqueue"; + case CapabilityLiteralSampler: return "LiteralSampler"; + case CapabilityAtomicStorage: return "AtomicStorage"; + case CapabilityInt16: return "Int16"; + case CapabilityTessellationPointSize: return "TessellationPointSize"; + case CapabilityGeometryPointSize: return "GeometryPointSize"; + case CapabilityImageGatherExtended: return "ImageGatherExtended"; + case CapabilityStorageImageMultisample: return "StorageImageMultisample"; + case CapabilityUniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing"; + case CapabilitySampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing"; + case CapabilityStorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing"; + case CapabilityStorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing"; + case CapabilityClipDistance: return "ClipDistance"; + case CapabilityCullDistance: return "CullDistance"; + case CapabilityImageCubeArray: return "ImageCubeArray"; + case CapabilitySampleRateShading: return "SampleRateShading"; + case CapabilityImageRect: return "ImageRect"; + case CapabilitySampledRect: return "SampledRect"; + case CapabilityGenericPointer: return "GenericPointer"; + case CapabilityInt8: return "Int8"; + case CapabilityInputAttachment: return "InputAttachment"; + case CapabilitySparseResidency: return "SparseResidency"; + case CapabilityMinLod: return "MinLod"; + case CapabilitySampled1D: return "Sampled1D"; + case CapabilityImage1D: return "Image1D"; + case CapabilitySampledCubeArray: return "SampledCubeArray"; + case CapabilitySampledBuffer: return "SampledBuffer"; + case CapabilityImageBuffer: return "ImageBuffer"; + case CapabilityImageMSArray: return "ImageMSArray"; + case CapabilityStorageImageExtendedFormats: return "StorageImageExtendedFormats"; + case CapabilityImageQuery: return "ImageQuery"; + case CapabilityDerivativeControl: return "DerivativeControl"; + case CapabilityInterpolationFunction: return "InterpolationFunction"; + case CapabilityTransformFeedback: return "TransformFeedback"; + case CapabilityGeometryStreams: return "GeometryStreams"; + case CapabilityStorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat"; + case CapabilityStorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat"; + case CapabilityMultiViewport: return "MultiViewport"; + case CapabilitySubgroupDispatch: return "SubgroupDispatch"; + case CapabilityNamedBarrier: return "NamedBarrier"; + case CapabilityPipeStorage: return "PipeStorage"; + case CapabilityGroupNonUniform: return "GroupNonUniform"; + case CapabilityGroupNonUniformVote: return "GroupNonUniformVote"; + case CapabilityGroupNonUniformArithmetic: return "GroupNonUniformArithmetic"; + case CapabilityGroupNonUniformBallot: return "GroupNonUniformBallot"; + case CapabilityGroupNonUniformShuffle: return "GroupNonUniformShuffle"; + case CapabilityGroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative"; + case CapabilityGroupNonUniformClustered: return "GroupNonUniformClustered"; + case CapabilityGroupNonUniformQuad: return "GroupNonUniformQuad"; + case CapabilityShaderLayer: return "ShaderLayer"; + case CapabilityShaderViewportIndex: return "ShaderViewportIndex"; + case CapabilityUniformDecoration: return "UniformDecoration"; + case CapabilityCoreBuiltinsARM: return "CoreBuiltinsARM"; + case CapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; + case CapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; + case CapabilityTileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case CapabilityCooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case CapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR"; + case CapabilitySubgroupBallotKHR: return "SubgroupBallotKHR"; + case CapabilityDrawParameters: return "DrawParameters"; + case CapabilityWorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; + case CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; + case CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; + case CapabilitySubgroupVoteKHR: return "SubgroupVoteKHR"; + case CapabilityStorageBuffer16BitAccess: return "StorageBuffer16BitAccess"; + case CapabilityStorageUniform16: return "StorageUniform16"; + case CapabilityStoragePushConstant16: return "StoragePushConstant16"; + case CapabilityStorageInputOutput16: return "StorageInputOutput16"; + case CapabilityDeviceGroup: return "DeviceGroup"; + case CapabilityMultiView: return "MultiView"; + case CapabilityVariablePointersStorageBuffer: return "VariablePointersStorageBuffer"; + case CapabilityVariablePointers: return "VariablePointers"; + case CapabilityAtomicStorageOps: return "AtomicStorageOps"; + case CapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; + case CapabilityStorageBuffer8BitAccess: return "StorageBuffer8BitAccess"; + case CapabilityUniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess"; + case CapabilityStoragePushConstant8: return "StoragePushConstant8"; + case CapabilityDenormPreserve: return "DenormPreserve"; + case CapabilityDenormFlushToZero: return "DenormFlushToZero"; + case CapabilitySignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case CapabilityRoundingModeRTE: return "RoundingModeRTE"; + case CapabilityRoundingModeRTZ: return "RoundingModeRTZ"; + case CapabilityRayQueryProvisionalKHR: return "RayQueryProvisionalKHR"; + case CapabilityRayQueryKHR: return "RayQueryKHR"; + case CapabilityUntypedPointersKHR: return "UntypedPointersKHR"; + case CapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; + case CapabilityRayTracingKHR: return "RayTracingKHR"; + case CapabilityTextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; + case CapabilityTextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; + case CapabilityTextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case CapabilityTextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; + case CapabilityFloat16ImageAMD: return "Float16ImageAMD"; + case CapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case CapabilityFragmentMaskAMD: return "FragmentMaskAMD"; + case CapabilityStencilExportEXT: return "StencilExportEXT"; + case CapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; + case CapabilityInt64ImageEXT: return "Int64ImageEXT"; + case CapabilityShaderClockKHR: return "ShaderClockKHR"; + case CapabilityShaderEnqueueAMDX: return "ShaderEnqueueAMDX"; + case CapabilityQuadControlKHR: return "QuadControlKHR"; + case CapabilitySampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; + case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case CapabilityShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT"; + case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; + case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; + case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + case CapabilityMeshShadingNV: return "MeshShadingNV"; + case CapabilityImageFootprintNV: return "ImageFootprintNV"; + case CapabilityMeshShadingEXT: return "MeshShadingEXT"; + case CapabilityFragmentBarycentricKHR: return "FragmentBarycentricKHR"; + case CapabilityComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR"; + case CapabilityFragmentDensityEXT: return "FragmentDensityEXT"; + case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case CapabilityShaderNonUniform: return "ShaderNonUniform"; + case CapabilityRuntimeDescriptorArray: return "RuntimeDescriptorArray"; + case CapabilityInputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing"; + case CapabilityUniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing"; + case CapabilityStorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing"; + case CapabilityUniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing"; + case CapabilitySampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing"; + case CapabilityStorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing"; + case CapabilityStorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing"; + case CapabilityInputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing"; + case CapabilityUniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing"; + case CapabilityStorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing"; + case CapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case CapabilityRayTracingNV: return "RayTracingNV"; + case CapabilityRayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; + case CapabilityVulkanMemoryModel: return "VulkanMemoryModel"; + case CapabilityVulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope"; + case CapabilityPhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses"; + case CapabilityComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR"; + case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; + case CapabilityCooperativeMatrixNV: return "CooperativeMatrixNV"; + case CapabilityFragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; + case CapabilityFragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; + case CapabilityShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV"; + case CapabilityFragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; + case CapabilityDemoteToHelperInvocation: return "DemoteToHelperInvocation"; + case CapabilityDisplacementMicromapNV: return "DisplacementMicromapNV"; + case CapabilityRayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; + case CapabilityShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case CapabilityBindlessTextureNV: return "BindlessTextureNV"; + case CapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; + case CapabilityAtomicFloat16VectorNV: return "AtomicFloat16VectorNV"; + case CapabilityRayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV"; + case CapabilityRawAccessChainsNV: return "RawAccessChainsNV"; + case CapabilitySubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; + case CapabilitySubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL"; + case CapabilitySubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL"; + case CapabilitySubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL"; + case CapabilityRoundToInfinityINTEL: return "RoundToInfinityINTEL"; + case CapabilityFloatingPointModeINTEL: return "FloatingPointModeINTEL"; + case CapabilityIntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; + case CapabilityFunctionPointersINTEL: return "FunctionPointersINTEL"; + case CapabilityIndirectReferencesINTEL: return "IndirectReferencesINTEL"; + case CapabilityAsmINTEL: return "AsmINTEL"; + case CapabilityAtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; + case CapabilityAtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; + case CapabilityAtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT"; + case CapabilityVectorComputeINTEL: return "VectorComputeINTEL"; + case CapabilityVectorAnyINTEL: return "VectorAnyINTEL"; + case CapabilityExpectAssumeKHR: return "ExpectAssumeKHR"; + case CapabilitySubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL"; + case CapabilitySubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL"; + case CapabilitySubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL"; + case CapabilityVariableLengthArrayINTEL: return "VariableLengthArrayINTEL"; + case CapabilityFunctionFloatControlINTEL: return "FunctionFloatControlINTEL"; + case CapabilityFPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL"; + case CapabilityFPFastMathModeINTEL: return "FPFastMathModeINTEL"; + case CapabilityArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL"; + case CapabilityArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL"; + case CapabilityUnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL"; + case CapabilityFPGALoopControlsINTEL: return "FPGALoopControlsINTEL"; + case CapabilityKernelAttributesINTEL: return "KernelAttributesINTEL"; + case CapabilityFPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL"; + case CapabilityFPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL"; + case CapabilityFPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL"; + case CapabilityLoopFuseINTEL: return "LoopFuseINTEL"; + case CapabilityFPGADSPControlINTEL: return "FPGADSPControlINTEL"; + case CapabilityMemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL"; + case CapabilityFPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL"; + case CapabilityFPGABufferLocationINTEL: return "FPGABufferLocationINTEL"; + case CapabilityArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL"; + case CapabilityUSMStorageClassesINTEL: return "USMStorageClassesINTEL"; + case CapabilityRuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL"; + case CapabilityIOPipesINTEL: return "IOPipesINTEL"; + case CapabilityBlockingPipesINTEL: return "BlockingPipesINTEL"; + case CapabilityFPGARegINTEL: return "FPGARegINTEL"; + case CapabilityDotProductInputAll: return "DotProductInputAll"; + case CapabilityDotProductInput4x8Bit: return "DotProductInput4x8Bit"; + case CapabilityDotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked"; + case CapabilityDotProduct: return "DotProduct"; + case CapabilityRayCullMaskKHR: return "RayCullMaskKHR"; + case CapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case CapabilityReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; + case CapabilityBitInstructions: return "BitInstructions"; + case CapabilityGroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; + case CapabilityFloatControls2: return "FloatControls2"; + case CapabilityAtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; + case CapabilityAtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; + case CapabilityLongCompositesINTEL: return "LongCompositesINTEL"; + case CapabilityOptNoneEXT: return "OptNoneEXT"; + case CapabilityAtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; + case CapabilityDebugInfoModuleINTEL: return "DebugInfoModuleINTEL"; + case CapabilityBFloat16ConversionINTEL: return "BFloat16ConversionINTEL"; + case CapabilitySplitBarrierINTEL: return "SplitBarrierINTEL"; + case CapabilityArithmeticFenceEXT: return "ArithmeticFenceEXT"; + case CapabilityFPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL"; + case CapabilityFPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL"; + case CapabilityFPMaxErrorINTEL: return "FPMaxErrorINTEL"; + case CapabilityFPGALatencyControlINTEL: return "FPGALatencyControlINTEL"; + case CapabilityFPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL"; + case CapabilityGlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL"; + case CapabilityGlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL"; + case CapabilitySubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL"; + case CapabilityGroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; + case CapabilityMaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL"; + case CapabilityCacheControlsINTEL: return "CacheControlsINTEL"; + case CapabilityRegisterLimitsINTEL: return "RegisterLimitsINTEL"; + default: return "Unknown"; + } +} + +inline const char* RayQueryIntersectionToString(RayQueryIntersection value) { + switch (value) { + case RayQueryIntersectionRayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR"; + case RayQueryIntersectionRayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCommittedIntersectionTypeToString(RayQueryCommittedIntersectionType value) { + switch (value) { + case RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR"; + case RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR"; + case RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCandidateIntersectionTypeToString(RayQueryCandidateIntersectionType value) { + switch (value) { + case RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR"; + case RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR"; + default: return "Unknown"; + } +} + +inline const char* FPDenormModeToString(FPDenormMode value) { + switch (value) { + case FPDenormModePreserve: return "Preserve"; + case FPDenormModeFlushToZero: return "FlushToZero"; + default: return "Unknown"; + } +} + +inline const char* FPOperationModeToString(FPOperationMode value) { + switch (value) { + case FPOperationModeIEEE: return "IEEE"; + case FPOperationModeALT: return "ALT"; + default: return "Unknown"; + } +} + +inline const char* QuantizationModesToString(QuantizationModes value) { + switch (value) { + case QuantizationModesTRN: return "TRN"; + case QuantizationModesTRN_ZERO: return "TRN_ZERO"; + case QuantizationModesRND: return "RND"; + case QuantizationModesRND_ZERO: return "RND_ZERO"; + case QuantizationModesRND_INF: return "RND_INF"; + case QuantizationModesRND_MIN_INF: return "RND_MIN_INF"; + case QuantizationModesRND_CONV: return "RND_CONV"; + case QuantizationModesRND_CONV_ODD: return "RND_CONV_ODD"; + default: return "Unknown"; + } +} + +inline const char* OverflowModesToString(OverflowModes value) { + switch (value) { + case OverflowModesWRAP: return "WRAP"; + case OverflowModesSAT: return "SAT"; + case OverflowModesSAT_ZERO: return "SAT_ZERO"; + case OverflowModesSAT_SYM: return "SAT_SYM"; + default: return "Unknown"; + } +} + +inline const char* PackedVectorFormatToString(PackedVectorFormat value) { + switch (value) { + case PackedVectorFormatPackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixLayoutToString(CooperativeMatrixLayout value) { + switch (value) { + case CooperativeMatrixLayoutRowMajorKHR: return "RowMajorKHR"; + case CooperativeMatrixLayoutColumnMajorKHR: return "ColumnMajorKHR"; + case CooperativeMatrixLayoutRowBlockedInterleavedARM: return "RowBlockedInterleavedARM"; + case CooperativeMatrixLayoutColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixUseToString(CooperativeMatrixUse value) { + switch (value) { + case CooperativeMatrixUseMatrixAKHR: return "MatrixAKHR"; + case CooperativeMatrixUseMatrixBKHR: return "MatrixBKHR"; + case CooperativeMatrixUseMatrixAccumulatorKHR: return "MatrixAccumulatorKHR"; + default: return "Unknown"; + } +} + +inline const char* InitializationModeQualifierToString(InitializationModeQualifier value) { + switch (value) { + case InitializationModeQualifierInitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL"; + case InitializationModeQualifierInitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL"; + default: return "Unknown"; + } +} + +inline const char* HostAccessQualifierToString(HostAccessQualifier value) { + switch (value) { + case HostAccessQualifierNoneINTEL: return "NoneINTEL"; + case HostAccessQualifierReadINTEL: return "ReadINTEL"; + case HostAccessQualifierWriteINTEL: return "WriteINTEL"; + case HostAccessQualifierReadWriteINTEL: return "ReadWriteINTEL"; + default: return "Unknown"; + } +} + +inline const char* LoadCacheControlToString(LoadCacheControl value) { + switch (value) { + case LoadCacheControlUncachedINTEL: return "UncachedINTEL"; + case LoadCacheControlCachedINTEL: return "CachedINTEL"; + case LoadCacheControlStreamingINTEL: return "StreamingINTEL"; + case LoadCacheControlInvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL"; + case LoadCacheControlConstCachedINTEL: return "ConstCachedINTEL"; + default: return "Unknown"; + } +} + +inline const char* StoreCacheControlToString(StoreCacheControl value) { + switch (value) { + case StoreCacheControlUncachedINTEL: return "UncachedINTEL"; + case StoreCacheControlWriteThroughINTEL: return "WriteThroughINTEL"; + case StoreCacheControlWriteBackINTEL: return "WriteBackINTEL"; + case StoreCacheControlStreamingINTEL: return "StreamingINTEL"; + default: return "Unknown"; + } +} + +inline const char* NamedMaximumNumberOfRegistersToString(NamedMaximumNumberOfRegisters value) { + switch (value) { + case NamedMaximumNumberOfRegistersAutoINTEL: return "AutoINTEL"; + default: return "Unknown"; + } +} + +inline const char* FPEncodingToString(FPEncoding value) { + switch (value) { + default: return "Unknown"; + } +} + +inline const char* OpToString(Op value) { + switch (value) { + case OpNop: return "OpNop"; + case OpUndef: return "OpUndef"; + case OpSourceContinued: return "OpSourceContinued"; + case OpSource: return "OpSource"; + case OpSourceExtension: return "OpSourceExtension"; + case OpName: return "OpName"; + case OpMemberName: return "OpMemberName"; + case OpString: return "OpString"; + case OpLine: return "OpLine"; + case OpExtension: return "OpExtension"; + case OpExtInstImport: return "OpExtInstImport"; + case OpExtInst: return "OpExtInst"; + case OpMemoryModel: return "OpMemoryModel"; + case OpEntryPoint: return "OpEntryPoint"; + case OpExecutionMode: return "OpExecutionMode"; + case OpCapability: return "OpCapability"; + case OpTypeVoid: return "OpTypeVoid"; + case OpTypeBool: return "OpTypeBool"; + case OpTypeInt: return "OpTypeInt"; + case OpTypeFloat: return "OpTypeFloat"; + case OpTypeVector: return "OpTypeVector"; + case OpTypeMatrix: return "OpTypeMatrix"; + case OpTypeImage: return "OpTypeImage"; + case OpTypeSampler: return "OpTypeSampler"; + case OpTypeSampledImage: return "OpTypeSampledImage"; + case OpTypeArray: return "OpTypeArray"; + case OpTypeRuntimeArray: return "OpTypeRuntimeArray"; + case OpTypeStruct: return "OpTypeStruct"; + case OpTypeOpaque: return "OpTypeOpaque"; + case OpTypePointer: return "OpTypePointer"; + case OpTypeFunction: return "OpTypeFunction"; + case OpTypeEvent: return "OpTypeEvent"; + case OpTypeDeviceEvent: return "OpTypeDeviceEvent"; + case OpTypeReserveId: return "OpTypeReserveId"; + case OpTypeQueue: return "OpTypeQueue"; + case OpTypePipe: return "OpTypePipe"; + case OpTypeForwardPointer: return "OpTypeForwardPointer"; + case OpConstantTrue: return "OpConstantTrue"; + case OpConstantFalse: return "OpConstantFalse"; + case OpConstant: return "OpConstant"; + case OpConstantComposite: return "OpConstantComposite"; + case OpConstantSampler: return "OpConstantSampler"; + case OpConstantNull: return "OpConstantNull"; + case OpSpecConstantTrue: return "OpSpecConstantTrue"; + case OpSpecConstantFalse: return "OpSpecConstantFalse"; + case OpSpecConstant: return "OpSpecConstant"; + case OpSpecConstantComposite: return "OpSpecConstantComposite"; + case OpSpecConstantOp: return "OpSpecConstantOp"; + case OpFunction: return "OpFunction"; + case OpFunctionParameter: return "OpFunctionParameter"; + case OpFunctionEnd: return "OpFunctionEnd"; + case OpFunctionCall: return "OpFunctionCall"; + case OpVariable: return "OpVariable"; + case OpImageTexelPointer: return "OpImageTexelPointer"; + case OpLoad: return "OpLoad"; + case OpStore: return "OpStore"; + case OpCopyMemory: return "OpCopyMemory"; + case OpCopyMemorySized: return "OpCopyMemorySized"; + case OpAccessChain: return "OpAccessChain"; + case OpInBoundsAccessChain: return "OpInBoundsAccessChain"; + case OpPtrAccessChain: return "OpPtrAccessChain"; + case OpArrayLength: return "OpArrayLength"; + case OpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics"; + case OpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain"; + case OpDecorate: return "OpDecorate"; + case OpMemberDecorate: return "OpMemberDecorate"; + case OpDecorationGroup: return "OpDecorationGroup"; + case OpGroupDecorate: return "OpGroupDecorate"; + case OpGroupMemberDecorate: return "OpGroupMemberDecorate"; + case OpVectorExtractDynamic: return "OpVectorExtractDynamic"; + case OpVectorInsertDynamic: return "OpVectorInsertDynamic"; + case OpVectorShuffle: return "OpVectorShuffle"; + case OpCompositeConstruct: return "OpCompositeConstruct"; + case OpCompositeExtract: return "OpCompositeExtract"; + case OpCompositeInsert: return "OpCompositeInsert"; + case OpCopyObject: return "OpCopyObject"; + case OpTranspose: return "OpTranspose"; + case OpSampledImage: return "OpSampledImage"; + case OpImageSampleImplicitLod: return "OpImageSampleImplicitLod"; + case OpImageSampleExplicitLod: return "OpImageSampleExplicitLod"; + case OpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod"; + case OpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod"; + case OpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod"; + case OpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod"; + case OpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod"; + case OpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod"; + case OpImageFetch: return "OpImageFetch"; + case OpImageGather: return "OpImageGather"; + case OpImageDrefGather: return "OpImageDrefGather"; + case OpImageRead: return "OpImageRead"; + case OpImageWrite: return "OpImageWrite"; + case OpImage: return "OpImage"; + case OpImageQueryFormat: return "OpImageQueryFormat"; + case OpImageQueryOrder: return "OpImageQueryOrder"; + case OpImageQuerySizeLod: return "OpImageQuerySizeLod"; + case OpImageQuerySize: return "OpImageQuerySize"; + case OpImageQueryLod: return "OpImageQueryLod"; + case OpImageQueryLevels: return "OpImageQueryLevels"; + case OpImageQuerySamples: return "OpImageQuerySamples"; + case OpConvertFToU: return "OpConvertFToU"; + case OpConvertFToS: return "OpConvertFToS"; + case OpConvertSToF: return "OpConvertSToF"; + case OpConvertUToF: return "OpConvertUToF"; + case OpUConvert: return "OpUConvert"; + case OpSConvert: return "OpSConvert"; + case OpFConvert: return "OpFConvert"; + case OpQuantizeToF16: return "OpQuantizeToF16"; + case OpConvertPtrToU: return "OpConvertPtrToU"; + case OpSatConvertSToU: return "OpSatConvertSToU"; + case OpSatConvertUToS: return "OpSatConvertUToS"; + case OpConvertUToPtr: return "OpConvertUToPtr"; + case OpPtrCastToGeneric: return "OpPtrCastToGeneric"; + case OpGenericCastToPtr: return "OpGenericCastToPtr"; + case OpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit"; + case OpBitcast: return "OpBitcast"; + case OpSNegate: return "OpSNegate"; + case OpFNegate: return "OpFNegate"; + case OpIAdd: return "OpIAdd"; + case OpFAdd: return "OpFAdd"; + case OpISub: return "OpISub"; + case OpFSub: return "OpFSub"; + case OpIMul: return "OpIMul"; + case OpFMul: return "OpFMul"; + case OpUDiv: return "OpUDiv"; + case OpSDiv: return "OpSDiv"; + case OpFDiv: return "OpFDiv"; + case OpUMod: return "OpUMod"; + case OpSRem: return "OpSRem"; + case OpSMod: return "OpSMod"; + case OpFRem: return "OpFRem"; + case OpFMod: return "OpFMod"; + case OpVectorTimesScalar: return "OpVectorTimesScalar"; + case OpMatrixTimesScalar: return "OpMatrixTimesScalar"; + case OpVectorTimesMatrix: return "OpVectorTimesMatrix"; + case OpMatrixTimesVector: return "OpMatrixTimesVector"; + case OpMatrixTimesMatrix: return "OpMatrixTimesMatrix"; + case OpOuterProduct: return "OpOuterProduct"; + case OpDot: return "OpDot"; + case OpIAddCarry: return "OpIAddCarry"; + case OpISubBorrow: return "OpISubBorrow"; + case OpUMulExtended: return "OpUMulExtended"; + case OpSMulExtended: return "OpSMulExtended"; + case OpAny: return "OpAny"; + case OpAll: return "OpAll"; + case OpIsNan: return "OpIsNan"; + case OpIsInf: return "OpIsInf"; + case OpIsFinite: return "OpIsFinite"; + case OpIsNormal: return "OpIsNormal"; + case OpSignBitSet: return "OpSignBitSet"; + case OpLessOrGreater: return "OpLessOrGreater"; + case OpOrdered: return "OpOrdered"; + case OpUnordered: return "OpUnordered"; + case OpLogicalEqual: return "OpLogicalEqual"; + case OpLogicalNotEqual: return "OpLogicalNotEqual"; + case OpLogicalOr: return "OpLogicalOr"; + case OpLogicalAnd: return "OpLogicalAnd"; + case OpLogicalNot: return "OpLogicalNot"; + case OpSelect: return "OpSelect"; + case OpIEqual: return "OpIEqual"; + case OpINotEqual: return "OpINotEqual"; + case OpUGreaterThan: return "OpUGreaterThan"; + case OpSGreaterThan: return "OpSGreaterThan"; + case OpUGreaterThanEqual: return "OpUGreaterThanEqual"; + case OpSGreaterThanEqual: return "OpSGreaterThanEqual"; + case OpULessThan: return "OpULessThan"; + case OpSLessThan: return "OpSLessThan"; + case OpULessThanEqual: return "OpULessThanEqual"; + case OpSLessThanEqual: return "OpSLessThanEqual"; + case OpFOrdEqual: return "OpFOrdEqual"; + case OpFUnordEqual: return "OpFUnordEqual"; + case OpFOrdNotEqual: return "OpFOrdNotEqual"; + case OpFUnordNotEqual: return "OpFUnordNotEqual"; + case OpFOrdLessThan: return "OpFOrdLessThan"; + case OpFUnordLessThan: return "OpFUnordLessThan"; + case OpFOrdGreaterThan: return "OpFOrdGreaterThan"; + case OpFUnordGreaterThan: return "OpFUnordGreaterThan"; + case OpFOrdLessThanEqual: return "OpFOrdLessThanEqual"; + case OpFUnordLessThanEqual: return "OpFUnordLessThanEqual"; + case OpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual"; + case OpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual"; + case OpShiftRightLogical: return "OpShiftRightLogical"; + case OpShiftRightArithmetic: return "OpShiftRightArithmetic"; + case OpShiftLeftLogical: return "OpShiftLeftLogical"; + case OpBitwiseOr: return "OpBitwiseOr"; + case OpBitwiseXor: return "OpBitwiseXor"; + case OpBitwiseAnd: return "OpBitwiseAnd"; + case OpNot: return "OpNot"; + case OpBitFieldInsert: return "OpBitFieldInsert"; + case OpBitFieldSExtract: return "OpBitFieldSExtract"; + case OpBitFieldUExtract: return "OpBitFieldUExtract"; + case OpBitReverse: return "OpBitReverse"; + case OpBitCount: return "OpBitCount"; + case OpDPdx: return "OpDPdx"; + case OpDPdy: return "OpDPdy"; + case OpFwidth: return "OpFwidth"; + case OpDPdxFine: return "OpDPdxFine"; + case OpDPdyFine: return "OpDPdyFine"; + case OpFwidthFine: return "OpFwidthFine"; + case OpDPdxCoarse: return "OpDPdxCoarse"; + case OpDPdyCoarse: return "OpDPdyCoarse"; + case OpFwidthCoarse: return "OpFwidthCoarse"; + case OpEmitVertex: return "OpEmitVertex"; + case OpEndPrimitive: return "OpEndPrimitive"; + case OpEmitStreamVertex: return "OpEmitStreamVertex"; + case OpEndStreamPrimitive: return "OpEndStreamPrimitive"; + case OpControlBarrier: return "OpControlBarrier"; + case OpMemoryBarrier: return "OpMemoryBarrier"; + case OpAtomicLoad: return "OpAtomicLoad"; + case OpAtomicStore: return "OpAtomicStore"; + case OpAtomicExchange: return "OpAtomicExchange"; + case OpAtomicCompareExchange: return "OpAtomicCompareExchange"; + case OpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak"; + case OpAtomicIIncrement: return "OpAtomicIIncrement"; + case OpAtomicIDecrement: return "OpAtomicIDecrement"; + case OpAtomicIAdd: return "OpAtomicIAdd"; + case OpAtomicISub: return "OpAtomicISub"; + case OpAtomicSMin: return "OpAtomicSMin"; + case OpAtomicUMin: return "OpAtomicUMin"; + case OpAtomicSMax: return "OpAtomicSMax"; + case OpAtomicUMax: return "OpAtomicUMax"; + case OpAtomicAnd: return "OpAtomicAnd"; + case OpAtomicOr: return "OpAtomicOr"; + case OpAtomicXor: return "OpAtomicXor"; + case OpPhi: return "OpPhi"; + case OpLoopMerge: return "OpLoopMerge"; + case OpSelectionMerge: return "OpSelectionMerge"; + case OpLabel: return "OpLabel"; + case OpBranch: return "OpBranch"; + case OpBranchConditional: return "OpBranchConditional"; + case OpSwitch: return "OpSwitch"; + case OpKill: return "OpKill"; + case OpReturn: return "OpReturn"; + case OpReturnValue: return "OpReturnValue"; + case OpUnreachable: return "OpUnreachable"; + case OpLifetimeStart: return "OpLifetimeStart"; + case OpLifetimeStop: return "OpLifetimeStop"; + case OpGroupAsyncCopy: return "OpGroupAsyncCopy"; + case OpGroupWaitEvents: return "OpGroupWaitEvents"; + case OpGroupAll: return "OpGroupAll"; + case OpGroupAny: return "OpGroupAny"; + case OpGroupBroadcast: return "OpGroupBroadcast"; + case OpGroupIAdd: return "OpGroupIAdd"; + case OpGroupFAdd: return "OpGroupFAdd"; + case OpGroupFMin: return "OpGroupFMin"; + case OpGroupUMin: return "OpGroupUMin"; + case OpGroupSMin: return "OpGroupSMin"; + case OpGroupFMax: return "OpGroupFMax"; + case OpGroupUMax: return "OpGroupUMax"; + case OpGroupSMax: return "OpGroupSMax"; + case OpReadPipe: return "OpReadPipe"; + case OpWritePipe: return "OpWritePipe"; + case OpReservedReadPipe: return "OpReservedReadPipe"; + case OpReservedWritePipe: return "OpReservedWritePipe"; + case OpReserveReadPipePackets: return "OpReserveReadPipePackets"; + case OpReserveWritePipePackets: return "OpReserveWritePipePackets"; + case OpCommitReadPipe: return "OpCommitReadPipe"; + case OpCommitWritePipe: return "OpCommitWritePipe"; + case OpIsValidReserveId: return "OpIsValidReserveId"; + case OpGetNumPipePackets: return "OpGetNumPipePackets"; + case OpGetMaxPipePackets: return "OpGetMaxPipePackets"; + case OpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets"; + case OpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets"; + case OpGroupCommitReadPipe: return "OpGroupCommitReadPipe"; + case OpGroupCommitWritePipe: return "OpGroupCommitWritePipe"; + case OpEnqueueMarker: return "OpEnqueueMarker"; + case OpEnqueueKernel: return "OpEnqueueKernel"; + case OpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount"; + case OpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize"; + case OpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize"; + case OpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple"; + case OpRetainEvent: return "OpRetainEvent"; + case OpReleaseEvent: return "OpReleaseEvent"; + case OpCreateUserEvent: return "OpCreateUserEvent"; + case OpIsValidEvent: return "OpIsValidEvent"; + case OpSetUserEventStatus: return "OpSetUserEventStatus"; + case OpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo"; + case OpGetDefaultQueue: return "OpGetDefaultQueue"; + case OpBuildNDRange: return "OpBuildNDRange"; + case OpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod"; + case OpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod"; + case OpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod"; + case OpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod"; + case OpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod"; + case OpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod"; + case OpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod"; + case OpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod"; + case OpImageSparseFetch: return "OpImageSparseFetch"; + case OpImageSparseGather: return "OpImageSparseGather"; + case OpImageSparseDrefGather: return "OpImageSparseDrefGather"; + case OpImageSparseTexelsResident: return "OpImageSparseTexelsResident"; + case OpNoLine: return "OpNoLine"; + case OpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet"; + case OpAtomicFlagClear: return "OpAtomicFlagClear"; + case OpImageSparseRead: return "OpImageSparseRead"; + case OpSizeOf: return "OpSizeOf"; + case OpTypePipeStorage: return "OpTypePipeStorage"; + case OpConstantPipeStorage: return "OpConstantPipeStorage"; + case OpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage"; + case OpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount"; + case OpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups"; + case OpTypeNamedBarrier: return "OpTypeNamedBarrier"; + case OpNamedBarrierInitialize: return "OpNamedBarrierInitialize"; + case OpMemoryNamedBarrier: return "OpMemoryNamedBarrier"; + case OpModuleProcessed: return "OpModuleProcessed"; + case OpExecutionModeId: return "OpExecutionModeId"; + case OpDecorateId: return "OpDecorateId"; + case OpGroupNonUniformElect: return "OpGroupNonUniformElect"; + case OpGroupNonUniformAll: return "OpGroupNonUniformAll"; + case OpGroupNonUniformAny: return "OpGroupNonUniformAny"; + case OpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual"; + case OpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast"; + case OpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst"; + case OpGroupNonUniformBallot: return "OpGroupNonUniformBallot"; + case OpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot"; + case OpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract"; + case OpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount"; + case OpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB"; + case OpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB"; + case OpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle"; + case OpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor"; + case OpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp"; + case OpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown"; + case OpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd"; + case OpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd"; + case OpGroupNonUniformIMul: return "OpGroupNonUniformIMul"; + case OpGroupNonUniformFMul: return "OpGroupNonUniformFMul"; + case OpGroupNonUniformSMin: return "OpGroupNonUniformSMin"; + case OpGroupNonUniformUMin: return "OpGroupNonUniformUMin"; + case OpGroupNonUniformFMin: return "OpGroupNonUniformFMin"; + case OpGroupNonUniformSMax: return "OpGroupNonUniformSMax"; + case OpGroupNonUniformUMax: return "OpGroupNonUniformUMax"; + case OpGroupNonUniformFMax: return "OpGroupNonUniformFMax"; + case OpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd"; + case OpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr"; + case OpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor"; + case OpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd"; + case OpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr"; + case OpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor"; + case OpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast"; + case OpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap"; + case OpCopyLogical: return "OpCopyLogical"; + case OpPtrEqual: return "OpPtrEqual"; + case OpPtrNotEqual: return "OpPtrNotEqual"; + case OpPtrDiff: return "OpPtrDiff"; + case OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; + case OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; + case OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + case OpTerminateInvocation: return "OpTerminateInvocation"; + case OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR"; + case OpUntypedVariableKHR: return "OpUntypedVariableKHR"; + case OpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR"; + case OpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR"; + case OpSubgroupBallotKHR: return "OpSubgroupBallotKHR"; + case OpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR"; + case OpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR"; + case OpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR"; + case OpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR"; + case OpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR"; + case OpSubgroupAllKHR: return "OpSubgroupAllKHR"; + case OpSubgroupAnyKHR: return "OpSubgroupAnyKHR"; + case OpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR"; + case OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; + case OpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR"; + case OpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR"; + case OpTraceRayKHR: return "OpTraceRayKHR"; + case OpExecuteCallableKHR: return "OpExecuteCallableKHR"; + case OpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR"; + case OpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR"; + case OpTerminateRayKHR: return "OpTerminateRayKHR"; + case OpSDot: return "OpSDot"; + case OpUDot: return "OpUDot"; + case OpSUDot: return "OpSUDot"; + case OpSDotAccSat: return "OpSDotAccSat"; + case OpUDotAccSat: return "OpUDotAccSat"; + case OpSUDotAccSat: return "OpSUDotAccSat"; + case OpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR"; + case OpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR"; + case OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; + case OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; + case OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; + case OpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; + case OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; + case OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; + case OpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR"; + case OpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR"; + case OpRayQueryProceedKHR: return "OpRayQueryProceedKHR"; + case OpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR"; + case OpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM"; + case OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; + case OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + case OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; + case OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; + case OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; + case OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + case OpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD"; + case OpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD"; + case OpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD"; + case OpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD"; + case OpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD"; + case OpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD"; + case OpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD"; + case OpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD"; + case OpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD"; + case OpFragmentFetchAMD: return "OpFragmentFetchAMD"; + case OpReadClockKHR: return "OpReadClockKHR"; + case OpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX"; + case OpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX"; + case OpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX"; + case OpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX"; + case OpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX"; + case OpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX"; + case OpConstantStringAMDX: return "OpConstantStringAMDX"; + case OpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX"; + case OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; + case OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + case OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; + case OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; + case OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; + case OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV"; + case OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV"; + case OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV"; + case OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV"; + case OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV"; + case OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; + case OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV"; + case OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV"; + case OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV"; + case OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV"; + case OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV"; + case OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV"; + case OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV"; + case OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV"; + case OpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV"; + case OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV"; + case OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV"; + case OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV"; + case OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV"; + case OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV"; + case OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV"; + case OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV"; + case OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV"; + case OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV"; + case OpHitObjectIsHitNV: return "OpHitObjectIsHitNV"; + case OpHitObjectIsMissNV: return "OpHitObjectIsMissNV"; + case OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV"; + case OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV"; + case OpTypeHitObjectNV: return "OpTypeHitObjectNV"; + case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; + case OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT"; + case OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT"; + case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; + case OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + case OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case OpReportIntersectionKHR: return "OpReportIntersectionKHR"; + case OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; + case OpTerminateRayNV: return "OpTerminateRayNV"; + case OpTraceNV: return "OpTraceNV"; + case OpTraceMotionNV: return "OpTraceMotionNV"; + case OpTraceRayMotionNV: return "OpTraceRayMotionNV"; + case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR"; + case OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; + case OpExecuteCallableNV: return "OpExecuteCallableNV"; + case OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; + case OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; + case OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; + case OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV"; + case OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV"; + case OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT"; + case OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT"; + case OpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation"; + case OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT"; + case OpConvertUToImageNV: return "OpConvertUToImageNV"; + case OpConvertUToSamplerNV: return "OpConvertUToSamplerNV"; + case OpConvertImageToUNV: return "OpConvertImageToUNV"; + case OpConvertSamplerToUNV: return "OpConvertSamplerToUNV"; + case OpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV"; + case OpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV"; + case OpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV"; + case OpRawAccessChainNV: return "OpRawAccessChainNV"; + case OpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL"; + case OpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL"; + case OpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL"; + case OpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL"; + case OpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL"; + case OpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL"; + case OpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL"; + case OpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL"; + case OpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL"; + case OpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL"; + case OpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL"; + case OpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL"; + case OpAbsISubINTEL: return "OpAbsISubINTEL"; + case OpAbsUSubINTEL: return "OpAbsUSubINTEL"; + case OpIAddSatINTEL: return "OpIAddSatINTEL"; + case OpUAddSatINTEL: return "OpUAddSatINTEL"; + case OpIAverageINTEL: return "OpIAverageINTEL"; + case OpUAverageINTEL: return "OpUAverageINTEL"; + case OpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL"; + case OpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL"; + case OpISubSatINTEL: return "OpISubSatINTEL"; + case OpUSubSatINTEL: return "OpUSubSatINTEL"; + case OpIMul32x16INTEL: return "OpIMul32x16INTEL"; + case OpUMul32x16INTEL: return "OpUMul32x16INTEL"; + case OpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL"; + case OpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL"; + case OpAsmTargetINTEL: return "OpAsmTargetINTEL"; + case OpAsmINTEL: return "OpAsmINTEL"; + case OpAsmCallINTEL: return "OpAsmCallINTEL"; + case OpAtomicFMinEXT: return "OpAtomicFMinEXT"; + case OpAtomicFMaxEXT: return "OpAtomicFMaxEXT"; + case OpAssumeTrueKHR: return "OpAssumeTrueKHR"; + case OpExpectKHR: return "OpExpectKHR"; + case OpDecorateString: return "OpDecorateString"; + case OpMemberDecorateString: return "OpMemberDecorateString"; + case OpVmeImageINTEL: return "OpVmeImageINTEL"; + case OpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL"; + case OpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL"; + case OpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL"; + case OpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL"; + case OpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL"; + case OpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL"; + case OpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL"; + case OpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL"; + case OpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL"; + case OpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL"; + case OpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL"; + case OpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL"; + case OpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL"; + case OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL"; + case OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL"; + case OpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL"; + case OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL"; + case OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL"; + case OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL"; + case OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL"; + case OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL"; + case OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL"; + case OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL"; + case OpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL"; + case OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL"; + case OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL"; + case OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL"; + case OpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL"; + case OpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL"; + case OpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL"; + case OpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL"; + case OpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL"; + case OpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL"; + case OpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL"; + case OpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL"; + case OpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL"; + case OpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL"; + case OpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL"; + case OpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL"; + case OpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL"; + case OpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL"; + case OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL"; + case OpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL"; + case OpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL"; + case OpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL"; + case OpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL"; + case OpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL"; + case OpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL"; + case OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL"; + case OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL"; + case OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL"; + case OpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL"; + case OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL"; + case OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL"; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL"; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL"; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL"; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL"; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL"; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL"; + case OpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL"; + case OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL"; + case OpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL"; + case OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL"; + case OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL"; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL"; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL"; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL"; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL"; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL"; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL"; + case OpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL"; + case OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL"; + case OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL"; + case OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL"; + case OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL"; + case OpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL"; + case OpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL"; + case OpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL"; + case OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL"; + case OpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL"; + case OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL"; + case OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL"; + case OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL"; + case OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL"; + case OpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL"; + case OpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL"; + case OpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL"; + case OpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL"; + case OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL"; + case OpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL"; + case OpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL"; + case OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL"; + case OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL"; + case OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL"; + case OpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL"; + case OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL"; + case OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL"; + case OpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL"; + case OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL"; + case OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL"; + case OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL"; + case OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL"; + case OpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL"; + case OpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL"; + case OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL"; + case OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL"; + case OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL"; + case OpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL"; + case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL"; + case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL"; + case OpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL"; + case OpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL"; + case OpSaveMemoryINTEL: return "OpSaveMemoryINTEL"; + case OpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL"; + case OpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL"; + case OpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL"; + case OpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL"; + case OpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL"; + case OpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL"; + case OpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL"; + case OpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL"; + case OpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL"; + case OpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL"; + case OpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL"; + case OpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL"; + case OpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL"; + case OpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL"; + case OpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL"; + case OpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL"; + case OpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL"; + case OpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL"; + case OpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL"; + case OpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL"; + case OpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL"; + case OpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL"; + case OpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL"; + case OpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL"; + case OpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL"; + case OpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL"; + case OpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL"; + case OpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL"; + case OpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL"; + case OpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL"; + case OpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL"; + case OpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL"; + case OpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL"; + case OpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL"; + case OpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL"; + case OpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL"; + case OpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL"; + case OpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL"; + case OpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL"; + case OpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL"; + case OpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL"; + case OpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL"; + case OpLoopControlINTEL: return "OpLoopControlINTEL"; + case OpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL"; + case OpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL"; + case OpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL"; + case OpFixedSqrtINTEL: return "OpFixedSqrtINTEL"; + case OpFixedRecipINTEL: return "OpFixedRecipINTEL"; + case OpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL"; + case OpFixedSinINTEL: return "OpFixedSinINTEL"; + case OpFixedCosINTEL: return "OpFixedCosINTEL"; + case OpFixedSinCosINTEL: return "OpFixedSinCosINTEL"; + case OpFixedSinPiINTEL: return "OpFixedSinPiINTEL"; + case OpFixedCosPiINTEL: return "OpFixedCosPiINTEL"; + case OpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL"; + case OpFixedLogINTEL: return "OpFixedLogINTEL"; + case OpFixedExpINTEL: return "OpFixedExpINTEL"; + case OpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL"; + case OpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL"; + case OpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL"; + case OpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL"; + case OpFPGARegINTEL: return "OpFPGARegINTEL"; + case OpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR"; + case OpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR"; + case OpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR"; + case OpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR"; + case OpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR"; + case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR"; + case OpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR"; + case OpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR"; + case OpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR"; + case OpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR"; + case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR"; + case OpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR"; + case OpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR"; + case OpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR"; + case OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; + case OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; + case OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case OpAtomicFAddEXT: return "OpAtomicFAddEXT"; + case OpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL"; + case OpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL"; + case OpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL"; + case OpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL"; + case OpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL"; + case OpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL"; + case OpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL"; + case OpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL"; + case OpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL"; + case OpArithmeticFenceEXT: return "OpArithmeticFenceEXT"; + case OpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL"; + case OpGroupIMulKHR: return "OpGroupIMulKHR"; + case OpGroupFMulKHR: return "OpGroupFMulKHR"; + case OpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR"; + case OpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR"; + case OpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR"; + case OpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR"; + case OpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR"; + case OpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR"; + case OpMaskedGatherINTEL: return "OpMaskedGatherINTEL"; + case OpMaskedScatterINTEL: return "OpMaskedScatterINTEL"; + default: return "Unknown"; + } +} + #endif /* SPV_ENABLE_UTILITY_CODE */ // Overload bitwise operators for mask bit combining @@ -2837,6 +4805,10 @@ constexpr CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask 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 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 diff --git a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.json b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.json index b1b60a4c..22177733 100644 --- a/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.json +++ b/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.json @@ -6,7 +6,7 @@ "Comment": [ [ - "Copyright (c) 2014-2020 The Khronos Group Inc.", + "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\"),", @@ -78,7 +78,9 @@ "SYCL": 7, "HERO_C": 8, "NZSL": 9, - "WGSL": 10 + "WGSL": 10, + "Slang": 11, + "Zig": 12 } }, { @@ -191,6 +193,7 @@ "EarlyAndLateFragmentTestsAMD": 5017, "StencilRefReplacingEXT": 5027, "CoalescingAMDX": 5069, + "IsApiEntryAMDX": 5070, "MaxNodeRecursionAMDX": 5071, "StaticNumWorkgroupsAMDX": 5072, "ShaderIndexAMDX": 5073, @@ -201,11 +204,16 @@ "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, @@ -225,9 +233,14 @@ "NoGlobalOffsetINTEL": 5895, "NumSIMDWorkitemsINTEL": 5896, "SchedulerTargetFmaxMhzINTEL": 5903, + "MaximallyReconvergesKHR": 6023, + "FPFastMathDefault": 6028, "StreamingInterfaceINTEL": 6154, "RegisterMapInterfaceINTEL": 6160, - "NamedBarrierCountINTEL": 6417 + "NamedBarrierCountINTEL": 6417, + "MaximumRegistersINTEL": 6461, + "MaximumRegistersIdINTEL": 6462, + "NamedMaximumRegistersINTEL": 6463 } }, { @@ -250,7 +263,6 @@ "StorageBuffer": 12, "TileImageEXT": 4172, "NodePayloadAMDX": 5068, - "NodeOutputPayloadAMDX": 5076, "CallableDataKHR": 5328, "CallableDataNV": 5328, "IncomingCallableDataKHR": 5329, @@ -407,7 +419,8 @@ "UnormInt24": 15, "UnormInt101010_2": 16, "UnsignedIntRaw10EXT": 19, - "UnsignedIntRaw12EXT": 20 + "UnsignedIntRaw12EXT": 20, + "UnormInt2_101010EXT": 21 } }, { @@ -447,8 +460,11 @@ "NSZ": 2, "AllowRecip": 3, "Fast": 4, + "AllowContract": 16, "AllowContractFastINTEL": 16, - "AllowReassocINTEL": 17 + "AllowReassoc": 17, + "AllowReassocINTEL": 17, + "AllowTransform": 18 } }, { @@ -554,11 +570,16 @@ "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, @@ -608,6 +629,9 @@ "MergeINTEL": 5834, "BankBitsINTEL": 5835, "ForcePow2DepthINTEL": 5836, + "StridesizeINTEL": 5883, + "WordsizeINTEL": 5884, + "TrueDualPortINTEL": 5885, "BurstCoalesceINTEL": 5899, "CacheSizeINTEL": 5900, "DontStaticallyCoalesceINTEL": 5901, @@ -626,9 +650,7 @@ "SingleElementVectorINTEL": 6085, "VectorComputeCallableFunctionINTEL": 6087, "MediaBlockIOINTEL": 6140, - "InitModeINTEL": 6147, - "ImplementInRegisterMapINTEL": 6148, - "HostAccessINTEL": 6168, + "StallFreeINTEL": 6151, "FPMaxErrorDecorationINTEL": 6170, "LatencyControlLabelINTEL": 6172, "LatencyControlConstraintINTEL": 6173, @@ -640,7 +662,12 @@ "MMHostInterfaceReadWriteModeINTEL": 6180, "MMHostInterfaceMaxBurstINTEL": 6181, "MMHostInterfaceWaitRequestINTEL": 6182, - "StableKernelArgumentINTEL": 6183 + "StableKernelArgumentINTEL": 6183, + "HostAccessINTEL": 6188, + "InitModeINTEL": 6190, + "ImplementInRegisterMapINTEL": 6191, + "CacheControlLoadINTEL": 6442, + "CacheControlStoreINTEL": 6443 } }, { @@ -719,7 +746,7 @@ "BaryCoordSmoothSampleAMD": 4997, "BaryCoordPullModelAMD": 4998, "FragStencilRefEXT": 5014, - "CoalescedInputCountAMDX": 5021, + "RemainingRecursionLevelsAMDX": 5021, "ShaderIndexAMDX": 5073, "ViewportMaskNV": 5253, "SecondaryPositionNV": 5257, @@ -774,6 +801,8 @@ "HitKindNV": 5333, "CurrentRayTimeNV": 5334, "HitTriangleVertexPositionsKHR": 5335, + "HitMicroTriangleVertexPositionsNV": 5337, + "HitMicroTriangleVertexBarycentricsNV": 5344, "IncomingRayFlagsKHR": 5351, "IncomingRayFlagsNV": 5351, "RayGeometryIndexKHR": 5352, @@ -781,6 +810,8 @@ "SMCountNV": 5375, "WarpIDNV": 5376, "SMIDNV": 5377, + "HitKindFrontFacingMicroTriangleNV": 5405, + "HitKindBackFacingMicroTriangleNV": 5406, "CullMaskKHR": 6021 } }, @@ -828,6 +859,7 @@ "DontInline": 1, "Pure": 2, "Const": 3, + "OptNoneEXT": 16, "OptNoneINTEL": 16 } }, @@ -999,6 +1031,7 @@ "TileImageColorReadAccessEXT": 4166, "TileImageDepthReadAccessEXT": 4167, "TileImageStencilReadAccessEXT": 4168, + "CooperativeMatrixLayoutsARM": 4201, "FragmentShadingRateKHR": 4422, "SubgroupBallotKHR": 4423, "DrawParameters": 4427, @@ -1028,11 +1061,13 @@ "RoundingModeRTZ": 4468, "RayQueryProvisionalKHR": 4471, "RayQueryKHR": 4472, + "UntypedPointersKHR": 4473, "RayTraversalPrimitiveCullingKHR": 4478, "RayTracingKHR": 4479, "TextureSampleWeightedQCOM": 4484, "TextureBoxFilterQCOM": 4485, "TextureBlockMatchQCOM": 4486, + "TextureBlockMatch2QCOM": 4498, "Float16ImageAMD": 5008, "ImageGatherBiasLodAMD": 5009, "FragmentMaskAMD": 5010, @@ -1041,6 +1076,7 @@ "Int64ImageEXT": 5016, "ShaderClockKHR": 5055, "ShaderEnqueueAMDX": 5067, + "QuadControlKHR": 5087, "SampleMaskOverrideCoverageNV": 5249, "GeometryShaderPassthroughNV": 5251, "ShaderViewportIndexLayerEXT": 5254, @@ -1054,6 +1090,7 @@ "MeshShadingEXT": 5283, "FragmentBarycentricKHR": 5284, "FragmentBarycentricNV": 5284, + "ComputeDerivativeGroupQuadsKHR": 5288, "ComputeDerivativeGroupQuadsNV": 5288, "FragmentDensityEXT": 5291, "ShadingRateNV": 5291, @@ -1091,6 +1128,7 @@ "VulkanMemoryModelDeviceScopeKHR": 5346, "PhysicalStorageBufferAddresses": 5347, "PhysicalStorageBufferAddressesEXT": 5347, + "ComputeDerivativeGroupLinearKHR": 5350, "ComputeDerivativeGroupLinearNV": 5350, "RayTracingProvisionalKHR": 5353, "CooperativeMatrixNV": 5357, @@ -1100,10 +1138,14 @@ "FragmentShaderPixelInterlockEXT": 5378, "DemoteToHelperInvocation": 5379, "DemoteToHelperInvocationEXT": 5379, + "DisplacementMicromapNV": 5380, "RayTracingOpacityMicromapEXT": 5381, "ShaderInvocationReorderNV": 5383, "BindlessTextureNV": 5390, "RayQueryPositionFetchKHR": 5391, + "AtomicFloat16VectorNV": 5404, + "RayTracingDisplacementMicromapNV": 5409, + "RawAccessChainsNV": 5414, "SubgroupShuffleINTEL": 5568, "SubgroupBufferBlockIOINTEL": 5569, "SubgroupImageBlockIOINTEL": 5570, @@ -1156,23 +1198,32 @@ "DotProductKHR": 6019, "RayCullMaskKHR": 6020, "CooperativeMatrixKHR": 6022, + "ReplicatedCompositesEXT": 6024, "BitInstructions": 6025, "GroupNonUniformRotateKHR": 6026, + "FloatControls2": 6029, "AtomicFloat32AddEXT": 6033, "AtomicFloat64AddEXT": 6034, - "LongConstantCompositeINTEL": 6089, + "LongCompositesINTEL": 6089, + "OptNoneEXT": 6094, "OptNoneINTEL": 6094, "AtomicFloat16AddEXT": 6095, "DebugInfoModuleINTEL": 6114, "BFloat16ConversionINTEL": 6115, "SplitBarrierINTEL": 6141, - "GlobalVariableFPGADecorationsINTEL": 6146, + "ArithmeticFenceEXT": 6144, + "FPGAClusterAttributesV2INTEL": 6150, "FPGAKernelAttributesv2INTEL": 6161, - "GlobalVariableHostAccessINTEL": 6167, "FPMaxErrorINTEL": 6169, "FPGALatencyControlINTEL": 6171, "FPGAArgumentInterfacesINTEL": 6174, - "GroupUniformArithmeticKHR": 6400 + "GlobalVariableHostAccessINTEL": 6187, + "GlobalVariableFPGADecorationsINTEL": 6189, + "SubgroupBufferPrefetchINTEL": 6220, + "GroupUniformArithmeticKHR": 6400, + "MaskedGatherScatterINTEL": 6427, + "CacheControlsINTEL": 6441, + "RegisterLimitsINTEL": 6460 } }, { @@ -1303,7 +1354,9 @@ "Values": { "RowMajorKHR": 0, - "ColumnMajorKHR": 1 + "ColumnMajorKHR": 1, + "RowBlockedInterleavedARM": 4202, + "ColumnBlockedInterleavedARM": 4203 } }, { @@ -1336,6 +1389,53 @@ "ReadWriteINTEL": 3 } }, + { + "Name": "LoadCacheControl", + "Type": "Value", + "Values": + { + "UncachedINTEL": 0, + "CachedINTEL": 1, + "StreamingINTEL": 2, + "InvalidateAfterReadINTEL": 3, + "ConstCachedINTEL": 4 + } + }, + { + "Name": "StoreCacheControl", + "Type": "Value", + "Values": + { + "UncachedINTEL": 0, + "WriteThroughINTEL": 1, + "WriteBackINTEL": 2, + "StreamingINTEL": 3 + } + }, + { + "Name": "NamedMaximumNumberOfRegisters", + "Type": "Value", + "Values": + { + "AutoINTEL": 0 + } + }, + { + "Name": "RawAccessChainOperands", + "Type": "Bit", + "Values": + { + "RobustnessPerComponentNV": 0, + "RobustnessPerElementNV": 1 + } + }, + { + "Name": "FPEncoding", + "Type": "Value", + "Values": + { + } + }, { "Name": "Op", "Type": "Value", @@ -1689,13 +1789,22 @@ "OpDepthAttachmentReadEXT": 4161, "OpStencilAttachmentReadEXT": 4162, "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, @@ -1718,6 +1827,9 @@ "OpCooperativeMatrixStoreKHR": 4458, "OpCooperativeMatrixMulAddKHR": 4459, "OpCooperativeMatrixLengthKHR": 4460, + "OpConstantCompositeReplicateEXT": 4461, + "OpSpecConstantCompositeReplicateEXT": 4462, + "OpCompositeConstructReplicateEXT": 4463, "OpTypeRayQueryKHR": 4472, "OpRayQueryInitializeKHR": 4473, "OpRayQueryTerminateKHR": 4474, @@ -1729,6 +1841,10 @@ "OpImageBoxFilterQCOM": 4481, "OpImageBlockMatchSSDQCOM": 4482, "OpImageBlockMatchSADQCOM": 4483, + "OpImageBlockMatchWindowSSDQCOM": 4500, + "OpImageBlockMatchWindowSADQCOM": 4501, + "OpImageBlockMatchGatherSSDQCOM": 4502, + "OpImageBlockMatchGatherSADQCOM": 4503, "OpGroupIAddNonUniformAMD": 5000, "OpGroupFAddNonUniformAMD": 5001, "OpGroupFMinNonUniformAMD": 5002, @@ -1740,9 +1856,16 @@ "OpFragmentMaskFetchAMD": 5011, "OpFragmentFetchAMD": 5012, "OpReadClockKHR": 5056, - "OpFinalizeNodePayloadsAMDX": 5075, + "OpAllocateNodePayloadsAMDX": 5074, + "OpEnqueueNodePayloadsAMDX": 5075, + "OpTypeNodePayloadArrayAMDX": 5076, "OpFinishWritingNodePayloadAMDX": 5078, - "OpInitializeNodePayloadsAMDX": 5090, + "OpNodePayloadArrayLengthAMDX": 5090, + "OpIsNodePayloadValidAMDX": 5101, + "OpConstantStringAMDX": 5103, + "OpSpecConstantStringAMDX": 5104, + "OpGroupNonUniformQuadAllKHR": 5110, + "OpGroupNonUniformQuadAnyKHR": 5111, "OpHitObjectRecordHitMotionNV": 5249, "OpHitObjectRecordHitWithIndexMotionNV": 5250, "OpHitObjectRecordMissMotionNV": 5251, @@ -1781,6 +1904,8 @@ "OpSetMeshOutputsEXT": 5295, "OpGroupNonUniformPartitionNV": 5296, "OpWritePackedPrimitiveIndices4x8NV": 5299, + "OpFetchMicroTriangleVertexPositionNV": 5300, + "OpFetchMicroTriangleVertexBarycentricNV": 5301, "OpReportIntersectionKHR": 5334, "OpReportIntersectionNV": 5334, "OpIgnoreIntersectionNV": 5335, @@ -1809,6 +1934,7 @@ "OpConvertUToSampledImageNV": 5395, "OpConvertSampledImageToUNV": 5396, "OpSamplerImageAddressingModeNV": 5397, + "OpRawAccessChainNV": 5398, "OpSubgroupShuffleINTEL": 5571, "OpSubgroupShuffleDownINTEL": 5572, "OpSubgroupShuffleUpINTEL": 5573, @@ -2050,10 +2176,13 @@ "OpTypeStructContinuedINTEL": 6090, "OpConstantCompositeContinuedINTEL": 6091, "OpSpecConstantCompositeContinuedINTEL": 6092, + "OpCompositeConstructContinuedINTEL": 6096, "OpConvertFToBF16INTEL": 6116, "OpConvertBF16ToFINTEL": 6117, "OpControlBarrierArriveINTEL": 6142, "OpControlBarrierWaitINTEL": 6143, + "OpArithmeticFenceEXT": 6145, + "OpSubgroupBlockPrefetchINTEL": 6221, "OpGroupIMulKHR": 6401, "OpGroupFMulKHR": 6402, "OpGroupBitwiseAndKHR": 6403, @@ -2061,7 +2190,9 @@ "OpGroupBitwiseXorKHR": 6405, "OpGroupLogicalAndKHR": 6406, "OpGroupLogicalOrKHR": 6407, - "OpGroupLogicalXorKHR": 6408 + "OpGroupLogicalXorKHR": 6408, + "OpMaskedGatherINTEL": 6428, + "OpMaskedScatterINTEL": 6429 } } ] diff --git a/bgfx/3rdparty/spirv-tools/include/generated/DebugInfo.h b/bgfx/3rdparty/spirv-tools/include/generated/DebugInfo.h index 76c61714..a37e3a94 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/DebugInfo.h +++ b/bgfx/3rdparty/spirv-tools/include/generated/DebugInfo.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017-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"), diff --git a/bgfx/3rdparty/spirv-tools/include/generated/NonSemanticShaderDebugInfo100.h b/bgfx/3rdparty/spirv-tools/include/generated/NonSemanticShaderDebugInfo100.h index 9db6951a..e09368e2 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/NonSemanticShaderDebugInfo100.h +++ b/bgfx/3rdparty/spirv-tools/include/generated/NonSemanticShaderDebugInfo100.h @@ -1,4 +1,4 @@ -// Copyright (c) 2018 The Khronos Group Inc. +// Copyright (c) 2018-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"), diff --git a/bgfx/3rdparty/spirv-tools/include/generated/OpenCLDebugInfo100.h b/bgfx/3rdparty/spirv-tools/include/generated/OpenCLDebugInfo100.h index dcb06ed4..1da00991 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/OpenCLDebugInfo100.h +++ b/bgfx/3rdparty/spirv-tools/include/generated/OpenCLDebugInfo100.h @@ -1,4 +1,4 @@ -// Copyright (c) 2018 The Khronos Group Inc. +// Copyright (c) 2018-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"), diff --git a/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc b/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc index f1284e9c..0bed940b 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc +++ b/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc @@ -1 +1 @@ -"v2023.4", "SPIRV-Tools v2023.4 v2022.4-324-gfaa88377" +"v2024.4", "SPIRV-Tools v2024.4 v2024.4.rc1-27-g4a6ce351" diff --git a/bgfx/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc b/bgfx/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc index 6fb92bf5..c5d3e804 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc +++ b/bgfx/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc @@ -1,23 +1,36 @@ +static const char* pygen_variable_aliases_OpDecorateStringGOOGLE[] = {"OpDecorateStringGOOGLE"}; +static const char* pygen_variable_aliases_OpDemoteToHelperInvocationEXT[] = {"OpDemoteToHelperInvocationEXT"}; +static const char* pygen_variable_aliases_OpMemberDecorateStringGOOGLE[] = {"OpMemberDecorateStringGOOGLE"}; +static const char* pygen_variable_aliases_OpReportIntersectionNV[] = {"OpReportIntersectionNV"}; +static const char* pygen_variable_aliases_OpSDotAccSatKHR[] = {"OpSDotAccSatKHR"}; +static const char* pygen_variable_aliases_OpSDotKHR[] = {"OpSDotKHR"}; +static const char* pygen_variable_aliases_OpSUDotAccSatKHR[] = {"OpSUDotAccSatKHR"}; +static const char* pygen_variable_aliases_OpSUDotKHR[] = {"OpSUDotKHR"}; +static const char* pygen_variable_aliases_OpTypeAccelerationStructureNV[] = {"OpTypeAccelerationStructureNV"}; +static const char* pygen_variable_aliases_OpUDotAccSatKHR[] = {"OpUDotAccSatKHR"}; +static const char* pygen_variable_aliases_OpUDotKHR[] = {"OpUDotKHR"}; + static const spv::Capability pygen_variable_caps_Addresses[] = {spv::Capability::Addresses}; static const spv::Capability pygen_variable_caps_AddressesPhysicalStorageBufferAddresses[] = {spv::Capability::Addresses, spv::Capability::PhysicalStorageBufferAddresses}; +static const spv::Capability pygen_variable_caps_AddressesUntypedPointersKHR[] = {spv::Capability::Addresses, spv::Capability::UntypedPointersKHR}; static const spv::Capability pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBuffer[] = {spv::Capability::Addresses, spv::Capability::VariablePointers, spv::Capability::VariablePointersStorageBuffer}; static const spv::Capability pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBufferPhysicalStorageBufferAddresses[] = {spv::Capability::Addresses, spv::Capability::VariablePointers, spv::Capability::VariablePointersStorageBuffer, spv::Capability::PhysicalStorageBufferAddresses}; static const spv::Capability pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL[] = {spv::Capability::ArbitraryPrecisionFixedPointINTEL}; static const spv::Capability pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL[] = {spv::Capability::ArbitraryPrecisionFloatingPointINTEL}; +static const spv::Capability pygen_variable_caps_ArithmeticFenceEXT[] = {spv::Capability::ArithmeticFenceEXT}; static const spv::Capability pygen_variable_caps_AsmINTEL[] = {spv::Capability::AsmINTEL}; -static const spv::Capability pygen_variable_caps_AtomicFloat16AddEXTAtomicFloat32AddEXTAtomicFloat64AddEXT[] = {spv::Capability::AtomicFloat16AddEXT, spv::Capability::AtomicFloat32AddEXT, spv::Capability::AtomicFloat64AddEXT}; -static const spv::Capability pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT[] = {spv::Capability::AtomicFloat16MinMaxEXT, spv::Capability::AtomicFloat32MinMaxEXT, spv::Capability::AtomicFloat64MinMaxEXT}; +static const spv::Capability pygen_variable_caps_AtomicFloat16AddEXTAtomicFloat32AddEXTAtomicFloat64AddEXTAtomicFloat16VectorNV[] = {spv::Capability::AtomicFloat16AddEXT, spv::Capability::AtomicFloat32AddEXT, spv::Capability::AtomicFloat64AddEXT, spv::Capability::AtomicFloat16VectorNV}; +static const spv::Capability pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXTAtomicFloat16VectorNV[] = {spv::Capability::AtomicFloat16MinMaxEXT, spv::Capability::AtomicFloat32MinMaxEXT, spv::Capability::AtomicFloat64MinMaxEXT, spv::Capability::AtomicFloat16VectorNV}; static const spv::Capability pygen_variable_caps_BFloat16ConversionINTEL[] = {spv::Capability::BFloat16ConversionINTEL}; static const spv::Capability pygen_variable_caps_BindlessTextureNV[] = {spv::Capability::BindlessTextureNV}; static const spv::Capability pygen_variable_caps_BlockingPipesINTEL[] = {spv::Capability::BlockingPipesINTEL}; static const spv::Capability pygen_variable_caps_CooperativeMatrixKHR[] = {spv::Capability::CooperativeMatrixKHR}; static const spv::Capability pygen_variable_caps_CooperativeMatrixNV[] = {spv::Capability::CooperativeMatrixNV}; static const spv::Capability pygen_variable_caps_DemoteToHelperInvocation[] = {spv::Capability::DemoteToHelperInvocation}; -static const spv::Capability pygen_variable_caps_DemoteToHelperInvocationEXT[] = {spv::Capability::DemoteToHelperInvocationEXT}; static const spv::Capability pygen_variable_caps_DerivativeControl[] = {spv::Capability::DerivativeControl}; static const spv::Capability pygen_variable_caps_DeviceEnqueue[] = {spv::Capability::DeviceEnqueue}; +static const spv::Capability pygen_variable_caps_DisplacementMicromapNV[] = {spv::Capability::DisplacementMicromapNV}; static const spv::Capability pygen_variable_caps_DotProduct[] = {spv::Capability::DotProduct}; -static const spv::Capability pygen_variable_caps_DotProductKHR[] = {spv::Capability::DotProductKHR}; static const spv::Capability pygen_variable_caps_ExpectAssumeKHR[] = {spv::Capability::ExpectAssumeKHR}; static const spv::Capability pygen_variable_caps_FPGARegINTEL[] = {spv::Capability::FPGARegINTEL}; static const spv::Capability pygen_variable_caps_FragmentMaskAMD[] = {spv::Capability::FragmentMaskAMD}; @@ -42,7 +55,8 @@ static const spv::Capability pygen_variable_caps_IntegerFunctions2INTEL[] = {spv static const spv::Capability pygen_variable_caps_Kernel[] = {spv::Capability::Kernel}; static const spv::Capability pygen_variable_caps_KernelImageQuery[] = {spv::Capability::Kernel, spv::Capability::ImageQuery}; static const spv::Capability pygen_variable_caps_LiteralSampler[] = {spv::Capability::LiteralSampler}; -static const spv::Capability pygen_variable_caps_LongConstantCompositeINTEL[] = {spv::Capability::LongConstantCompositeINTEL}; +static const spv::Capability pygen_variable_caps_LongCompositesINTEL[] = {spv::Capability::LongCompositesINTEL}; +static const spv::Capability pygen_variable_caps_MaskedGatherScatterINTEL[] = {spv::Capability::MaskedGatherScatterINTEL}; static const spv::Capability pygen_variable_caps_Matrix[] = {spv::Capability::Matrix}; static const spv::Capability pygen_variable_caps_MemoryAccessAliasingINTEL[] = {spv::Capability::MemoryAccessAliasingINTEL}; static const spv::Capability pygen_variable_caps_MeshShadingEXT[] = {spv::Capability::MeshShadingEXT}; @@ -50,6 +64,8 @@ static const spv::Capability pygen_variable_caps_MeshShadingNV[] = {spv::Capabil static const spv::Capability pygen_variable_caps_NamedBarrier[] = {spv::Capability::NamedBarrier}; static const spv::Capability pygen_variable_caps_PipeStorage[] = {spv::Capability::PipeStorage}; static const spv::Capability pygen_variable_caps_Pipes[] = {spv::Capability::Pipes}; +static const spv::Capability pygen_variable_caps_QuadControlKHR[] = {spv::Capability::QuadControlKHR}; +static const spv::Capability pygen_variable_caps_RawAccessChainsNV[] = {spv::Capability::RawAccessChainsNV}; static const spv::Capability pygen_variable_caps_RayQueryKHR[] = {spv::Capability::RayQueryKHR}; static const spv::Capability pygen_variable_caps_RayQueryPositionFetchKHR[] = {spv::Capability::RayQueryPositionFetchKHR}; static const spv::Capability pygen_variable_caps_RayTracingKHR[] = {spv::Capability::RayTracingKHR}; @@ -58,6 +74,7 @@ static const spv::Capability pygen_variable_caps_RayTracingMotionBlurNV[] = {spv static const spv::Capability pygen_variable_caps_RayTracingNV[] = {spv::Capability::RayTracingNV}; static const spv::Capability pygen_variable_caps_RayTracingNVRayTracingKHR[] = {spv::Capability::RayTracingNV, spv::Capability::RayTracingKHR}; static const spv::Capability pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR[] = {spv::Capability::RayTracingNV, spv::Capability::RayTracingKHR, spv::Capability::RayQueryKHR}; +static const spv::Capability pygen_variable_caps_ReplicatedCompositesEXT[] = {spv::Capability::ReplicatedCompositesEXT}; static const spv::Capability pygen_variable_caps_Shader[] = {spv::Capability::Shader}; static const spv::Capability pygen_variable_caps_ShaderBitInstructions[] = {spv::Capability::Shader, spv::Capability::BitInstructions}; static const spv::Capability pygen_variable_caps_ShaderClockKHR[] = {spv::Capability::ShaderClockKHR}; @@ -71,11 +88,13 @@ static const spv::Capability pygen_variable_caps_SubgroupAvcMotionEstimationINTE static const spv::Capability pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL[] = {spv::Capability::SubgroupAvcMotionEstimationINTEL, spv::Capability::SubgroupAvcMotionEstimationIntraINTEL}; static const spv::Capability pygen_variable_caps_SubgroupBallotKHR[] = {spv::Capability::SubgroupBallotKHR}; static const spv::Capability pygen_variable_caps_SubgroupBufferBlockIOINTEL[] = {spv::Capability::SubgroupBufferBlockIOINTEL}; +static const spv::Capability pygen_variable_caps_SubgroupBufferPrefetchINTEL[] = {spv::Capability::SubgroupBufferPrefetchINTEL}; static const spv::Capability pygen_variable_caps_SubgroupDispatch[] = {spv::Capability::SubgroupDispatch}; static const spv::Capability pygen_variable_caps_SubgroupImageBlockIOINTEL[] = {spv::Capability::SubgroupImageBlockIOINTEL}; static const spv::Capability pygen_variable_caps_SubgroupImageMediaBlockIOINTEL[] = {spv::Capability::SubgroupImageMediaBlockIOINTEL}; static const spv::Capability pygen_variable_caps_SubgroupShuffleINTEL[] = {spv::Capability::SubgroupShuffleINTEL}; static const spv::Capability pygen_variable_caps_SubgroupVoteKHR[] = {spv::Capability::SubgroupVoteKHR}; +static const spv::Capability pygen_variable_caps_TextureBlockMatch2QCOM[] = {spv::Capability::TextureBlockMatch2QCOM}; static const spv::Capability pygen_variable_caps_TextureBlockMatchQCOM[] = {spv::Capability::TextureBlockMatchQCOM}; static const spv::Capability pygen_variable_caps_TextureBoxFilterQCOM[] = {spv::Capability::TextureBoxFilterQCOM}; static const spv::Capability pygen_variable_caps_TextureSampleWeightedQCOM[] = {spv::Capability::TextureSampleWeightedQCOM}; @@ -84,6 +103,7 @@ static const spv::Capability pygen_variable_caps_TileImageDepthReadAccessEXT[] = static const spv::Capability pygen_variable_caps_TileImageStencilReadAccessEXT[] = {spv::Capability::TileImageStencilReadAccessEXT}; static const spv::Capability pygen_variable_caps_USMStorageClassesINTEL[] = {spv::Capability::USMStorageClassesINTEL}; static const spv::Capability pygen_variable_caps_UnstructuredLoopControlsINTEL[] = {spv::Capability::UnstructuredLoopControlsINTEL}; +static const spv::Capability pygen_variable_caps_UntypedPointersKHR[] = {spv::Capability::UntypedPointersKHR}; static const spv::Capability pygen_variable_caps_VariableLengthArrayINTEL[] = {spv::Capability::VariableLengthArrayINTEL}; static const spv::Capability pygen_variable_caps_VectorComputeINTEL[] = {spv::Capability::VectorComputeINTEL}; @@ -104,6 +124,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_KHR_integer_dot_product static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_query[] = {spvtools::Extension::kSPV_KHR_ray_query}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_tracing[] = {spvtools::Extension::kSPV_KHR_ray_tracing}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_tracingSPV_KHR_ray_query[] = {spvtools::Extension::kSPV_KHR_ray_tracing, spvtools::Extension::kSPV_KHR_ray_query}; +static const spvtools::Extension pygen_variable_exts_SPV_KHR_relaxed_extended_instruction[] = {spvtools::Extension::kSPV_KHR_relaxed_extended_instruction}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_shader_ballot[] = {spvtools::Extension::kSPV_KHR_shader_ballot}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_subgroup_vote[] = {spvtools::Extension::kSPV_KHR_subgroup_vote}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_terminate_invocation[] = {spvtools::Extension::kSPV_KHR_terminate_invocation}; @@ -117,725 +138,745 @@ static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_image_footpri static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_subgroup_partitioned[] = {spvtools::Extension::kSPV_NV_shader_subgroup_partitioned}; static const spv_opcode_desc_t kOpcodeTableEntries[] = { - {"Nop", spv::Op::OpNop, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Undef", spv::Op::OpUndef, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SourceContinued", spv::Op::OpSourceContinued, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Source", spv::Op::OpSource, 0, nullptr, 4, {SPV_OPERAND_TYPE_SOURCE_LANGUAGE, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SourceExtension", spv::Op::OpSourceExtension, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Name", spv::Op::OpName, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MemberName", spv::Op::OpMemberName, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"String", spv::Op::OpString, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Line", spv::Op::OpLine, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Extension", spv::Op::OpExtension, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ExtInstImport", spv::Op::OpExtInstImport, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ExtInst", spv::Op::OpExtInst, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MemoryModel", spv::Op::OpMemoryModel, 0, nullptr, 2, {SPV_OPERAND_TYPE_ADDRESSING_MODEL, SPV_OPERAND_TYPE_MEMORY_MODEL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"EntryPoint", spv::Op::OpEntryPoint, 0, nullptr, 4, {SPV_OPERAND_TYPE_EXECUTION_MODEL, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ExecutionMode", spv::Op::OpExecutionMode, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXECUTION_MODE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Capability", spv::Op::OpCapability, 0, nullptr, 1, {SPV_OPERAND_TYPE_CAPABILITY}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeVoid", spv::Op::OpTypeVoid, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeBool", spv::Op::OpTypeBool, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeInt", spv::Op::OpTypeInt, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeFloat", spv::Op::OpTypeFloat, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeVector", spv::Op::OpTypeVector, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeMatrix", spv::Op::OpTypeMatrix, 1, pygen_variable_caps_Matrix, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeImage", spv::Op::OpTypeImage, 0, nullptr, 9, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DIMENSIONALITY, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT, SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeSampler", spv::Op::OpTypeSampler, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeSampledImage", spv::Op::OpTypeSampledImage, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeArray", spv::Op::OpTypeArray, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeRuntimeArray", spv::Op::OpTypeRuntimeArray, 1, pygen_variable_caps_Shader, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeStruct", spv::Op::OpTypeStruct, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeOpaque", spv::Op::OpTypeOpaque, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypePointer", spv::Op::OpTypePointer, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeFunction", spv::Op::OpTypeFunction, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeEvent", spv::Op::OpTypeEvent, 1, pygen_variable_caps_Kernel, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeDeviceEvent", spv::Op::OpTypeDeviceEvent, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeReserveId", spv::Op::OpTypeReserveId, 1, pygen_variable_caps_Pipes, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeQueue", spv::Op::OpTypeQueue, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypePipe", spv::Op::OpTypePipe, 1, pygen_variable_caps_Pipes, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TypeForwardPointer", spv::Op::OpTypeForwardPointer, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_STORAGE_CLASS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConstantTrue", spv::Op::OpConstantTrue, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConstantFalse", spv::Op::OpConstantFalse, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Constant", spv::Op::OpConstant, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConstantComposite", spv::Op::OpConstantComposite, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConstantSampler", spv::Op::OpConstantSampler, 1, pygen_variable_caps_LiteralSampler, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConstantNull", spv::Op::OpConstantNull, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SpecConstantTrue", spv::Op::OpSpecConstantTrue, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SpecConstantFalse", spv::Op::OpSpecConstantFalse, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SpecConstant", spv::Op::OpSpecConstant, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SpecConstantComposite", spv::Op::OpSpecConstantComposite, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SpecConstantOp", spv::Op::OpSpecConstantOp, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Function", spv::Op::OpFunction, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_FUNCTION_CONTROL, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FunctionParameter", spv::Op::OpFunctionParameter, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FunctionEnd", spv::Op::OpFunctionEnd, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FunctionCall", spv::Op::OpFunctionCall, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Variable", spv::Op::OpVariable, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageTexelPointer", spv::Op::OpImageTexelPointer, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Load", spv::Op::OpLoad, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Store", spv::Op::OpStore, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CopyMemory", spv::Op::OpCopyMemory, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CopyMemorySized", spv::Op::OpCopyMemorySized, 1, pygen_variable_caps_Addresses, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AccessChain", spv::Op::OpAccessChain, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InBoundsAccessChain", spv::Op::OpInBoundsAccessChain, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PtrAccessChain", spv::Op::OpPtrAccessChain, 4, pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBufferPhysicalStorageBufferAddresses, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ArrayLength", spv::Op::OpArrayLength, 1, pygen_variable_caps_Shader, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GenericPtrMemSemantics", spv::Op::OpGenericPtrMemSemantics, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InBoundsPtrAccessChain", spv::Op::OpInBoundsPtrAccessChain, 1, pygen_variable_caps_Addresses, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Decorate", spv::Op::OpDecorate, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MemberDecorate", spv::Op::OpMemberDecorate, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DecorationGroup", spv::Op::OpDecorationGroup, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupDecorate", spv::Op::OpGroupDecorate, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupMemberDecorate", spv::Op::OpGroupMemberDecorate, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VectorExtractDynamic", spv::Op::OpVectorExtractDynamic, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VectorInsertDynamic", spv::Op::OpVectorInsertDynamic, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VectorShuffle", spv::Op::OpVectorShuffle, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CompositeConstruct", spv::Op::OpCompositeConstruct, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CompositeExtract", spv::Op::OpCompositeExtract, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CompositeInsert", spv::Op::OpCompositeInsert, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CopyObject", spv::Op::OpCopyObject, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Transpose", spv::Op::OpTranspose, 1, pygen_variable_caps_Matrix, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SampledImage", spv::Op::OpSampledImage, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSampleImplicitLod", spv::Op::OpImageSampleImplicitLod, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSampleExplicitLod", spv::Op::OpImageSampleExplicitLod, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSampleDrefImplicitLod", spv::Op::OpImageSampleDrefImplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSampleDrefExplicitLod", spv::Op::OpImageSampleDrefExplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSampleProjImplicitLod", spv::Op::OpImageSampleProjImplicitLod, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSampleProjExplicitLod", spv::Op::OpImageSampleProjExplicitLod, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSampleProjDrefImplicitLod", spv::Op::OpImageSampleProjDrefImplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSampleProjDrefExplicitLod", spv::Op::OpImageSampleProjDrefExplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageFetch", spv::Op::OpImageFetch, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageGather", spv::Op::OpImageGather, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageDrefGather", spv::Op::OpImageDrefGather, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageRead", spv::Op::OpImageRead, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageWrite", spv::Op::OpImageWrite, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Image", spv::Op::OpImage, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageQueryFormat", spv::Op::OpImageQueryFormat, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageQueryOrder", spv::Op::OpImageQueryOrder, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageQuerySizeLod", spv::Op::OpImageQuerySizeLod, 2, pygen_variable_caps_KernelImageQuery, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageQuerySize", spv::Op::OpImageQuerySize, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageQueryLod", spv::Op::OpImageQueryLod, 1, pygen_variable_caps_ImageQuery, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageQueryLevels", spv::Op::OpImageQueryLevels, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageQuerySamples", spv::Op::OpImageQuerySamples, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConvertFToU", spv::Op::OpConvertFToU, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConvertFToS", spv::Op::OpConvertFToS, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConvertSToF", spv::Op::OpConvertSToF, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConvertUToF", spv::Op::OpConvertUToF, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UConvert", spv::Op::OpUConvert, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SConvert", spv::Op::OpSConvert, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FConvert", spv::Op::OpFConvert, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"QuantizeToF16", spv::Op::OpQuantizeToF16, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConvertPtrToU", spv::Op::OpConvertPtrToU, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SatConvertSToU", spv::Op::OpSatConvertSToU, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SatConvertUToS", spv::Op::OpSatConvertUToS, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConvertUToPtr", spv::Op::OpConvertUToPtr, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PtrCastToGeneric", spv::Op::OpPtrCastToGeneric, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GenericCastToPtr", spv::Op::OpGenericCastToPtr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GenericCastToPtrExplicit", spv::Op::OpGenericCastToPtrExplicit, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_STORAGE_CLASS}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Bitcast", spv::Op::OpBitcast, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SNegate", spv::Op::OpSNegate, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FNegate", spv::Op::OpFNegate, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IAdd", spv::Op::OpIAdd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FAdd", spv::Op::OpFAdd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ISub", spv::Op::OpISub, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FSub", spv::Op::OpFSub, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IMul", spv::Op::OpIMul, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FMul", spv::Op::OpFMul, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UDiv", spv::Op::OpUDiv, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SDiv", spv::Op::OpSDiv, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FDiv", spv::Op::OpFDiv, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UMod", spv::Op::OpUMod, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SRem", spv::Op::OpSRem, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SMod", spv::Op::OpSMod, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FRem", spv::Op::OpFRem, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FMod", spv::Op::OpFMod, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VectorTimesScalar", spv::Op::OpVectorTimesScalar, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MatrixTimesScalar", spv::Op::OpMatrixTimesScalar, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VectorTimesMatrix", spv::Op::OpVectorTimesMatrix, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MatrixTimesVector", spv::Op::OpMatrixTimesVector, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MatrixTimesMatrix", spv::Op::OpMatrixTimesMatrix, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OuterProduct", spv::Op::OpOuterProduct, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Dot", spv::Op::OpDot, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IAddCarry", spv::Op::OpIAddCarry, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ISubBorrow", spv::Op::OpISubBorrow, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UMulExtended", spv::Op::OpUMulExtended, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SMulExtended", spv::Op::OpSMulExtended, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Any", spv::Op::OpAny, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"All", spv::Op::OpAll, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IsNan", spv::Op::OpIsNan, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IsInf", spv::Op::OpIsInf, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IsFinite", spv::Op::OpIsFinite, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IsNormal", spv::Op::OpIsNormal, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SignBitSet", spv::Op::OpSignBitSet, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LessOrGreater", spv::Op::OpLessOrGreater, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), SPV_SPIRV_VERSION_WORD(1,5)}, - {"Ordered", spv::Op::OpOrdered, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Unordered", spv::Op::OpUnordered, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LogicalEqual", spv::Op::OpLogicalEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LogicalNotEqual", spv::Op::OpLogicalNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LogicalOr", spv::Op::OpLogicalOr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LogicalAnd", spv::Op::OpLogicalAnd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LogicalNot", spv::Op::OpLogicalNot, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Select", spv::Op::OpSelect, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IEqual", spv::Op::OpIEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"INotEqual", spv::Op::OpINotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UGreaterThan", spv::Op::OpUGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SGreaterThan", spv::Op::OpSGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UGreaterThanEqual", spv::Op::OpUGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SGreaterThanEqual", spv::Op::OpSGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ULessThan", spv::Op::OpULessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SLessThan", spv::Op::OpSLessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ULessThanEqual", spv::Op::OpULessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SLessThanEqual", spv::Op::OpSLessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FOrdEqual", spv::Op::OpFOrdEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FUnordEqual", spv::Op::OpFUnordEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FOrdNotEqual", spv::Op::OpFOrdNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FUnordNotEqual", spv::Op::OpFUnordNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FOrdLessThan", spv::Op::OpFOrdLessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FUnordLessThan", spv::Op::OpFUnordLessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FOrdGreaterThan", spv::Op::OpFOrdGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FUnordGreaterThan", spv::Op::OpFUnordGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FOrdLessThanEqual", spv::Op::OpFOrdLessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FUnordLessThanEqual", spv::Op::OpFUnordLessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FOrdGreaterThanEqual", spv::Op::OpFOrdGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FUnordGreaterThanEqual", spv::Op::OpFUnordGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ShiftRightLogical", spv::Op::OpShiftRightLogical, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ShiftRightArithmetic", spv::Op::OpShiftRightArithmetic, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ShiftLeftLogical", spv::Op::OpShiftLeftLogical, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BitwiseOr", spv::Op::OpBitwiseOr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BitwiseXor", spv::Op::OpBitwiseXor, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BitwiseAnd", spv::Op::OpBitwiseAnd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Not", spv::Op::OpNot, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BitFieldInsert", spv::Op::OpBitFieldInsert, 2, pygen_variable_caps_ShaderBitInstructions, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BitFieldSExtract", spv::Op::OpBitFieldSExtract, 2, pygen_variable_caps_ShaderBitInstructions, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BitFieldUExtract", spv::Op::OpBitFieldUExtract, 2, pygen_variable_caps_ShaderBitInstructions, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BitReverse", spv::Op::OpBitReverse, 2, pygen_variable_caps_ShaderBitInstructions, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BitCount", spv::Op::OpBitCount, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DPdx", spv::Op::OpDPdx, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DPdy", spv::Op::OpDPdy, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Fwidth", spv::Op::OpFwidth, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DPdxFine", spv::Op::OpDPdxFine, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DPdyFine", spv::Op::OpDPdyFine, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FwidthFine", spv::Op::OpFwidthFine, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DPdxCoarse", spv::Op::OpDPdxCoarse, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DPdyCoarse", spv::Op::OpDPdyCoarse, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FwidthCoarse", spv::Op::OpFwidthCoarse, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"EmitVertex", spv::Op::OpEmitVertex, 1, pygen_variable_caps_Geometry, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"EndPrimitive", spv::Op::OpEndPrimitive, 1, pygen_variable_caps_Geometry, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"EmitStreamVertex", spv::Op::OpEmitStreamVertex, 1, pygen_variable_caps_GeometryStreams, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"EndStreamPrimitive", spv::Op::OpEndStreamPrimitive, 1, pygen_variable_caps_GeometryStreams, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ControlBarrier", spv::Op::OpControlBarrier, 0, nullptr, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MemoryBarrier", spv::Op::OpMemoryBarrier, 0, nullptr, 2, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicLoad", spv::Op::OpAtomicLoad, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicStore", spv::Op::OpAtomicStore, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicExchange", spv::Op::OpAtomicExchange, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicCompareExchange", spv::Op::OpAtomicCompareExchange, 0, nullptr, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicCompareExchangeWeak", spv::Op::OpAtomicCompareExchangeWeak, 1, pygen_variable_caps_Kernel, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), SPV_SPIRV_VERSION_WORD(1,3)}, - {"AtomicIIncrement", spv::Op::OpAtomicIIncrement, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicIDecrement", spv::Op::OpAtomicIDecrement, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicIAdd", spv::Op::OpAtomicIAdd, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicISub", spv::Op::OpAtomicISub, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicSMin", spv::Op::OpAtomicSMin, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicUMin", spv::Op::OpAtomicUMin, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicSMax", spv::Op::OpAtomicSMax, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicUMax", spv::Op::OpAtomicUMax, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicAnd", spv::Op::OpAtomicAnd, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicOr", spv::Op::OpAtomicOr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicXor", spv::Op::OpAtomicXor, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Phi", spv::Op::OpPhi, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LoopMerge", spv::Op::OpLoopMerge, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LOOP_CONTROL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SelectionMerge", spv::Op::OpSelectionMerge, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SELECTION_CONTROL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Label", spv::Op::OpLabel, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Branch", spv::Op::OpBranch, 0, nullptr, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BranchConditional", spv::Op::OpBranchConditional, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Switch", spv::Op::OpSwitch, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Kill", spv::Op::OpKill, 1, pygen_variable_caps_Shader, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Return", spv::Op::OpReturn, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ReturnValue", spv::Op::OpReturnValue, 0, nullptr, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Unreachable", spv::Op::OpUnreachable, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LifetimeStart", spv::Op::OpLifetimeStart, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LifetimeStop", spv::Op::OpLifetimeStop, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupAsyncCopy", spv::Op::OpGroupAsyncCopy, 1, pygen_variable_caps_Kernel, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupWaitEvents", spv::Op::OpGroupWaitEvents, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupAll", spv::Op::OpGroupAll, 1, pygen_variable_caps_Groups, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupAny", spv::Op::OpGroupAny, 1, pygen_variable_caps_Groups, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupBroadcast", spv::Op::OpGroupBroadcast, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupIAdd", spv::Op::OpGroupIAdd, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupFAdd", spv::Op::OpGroupFAdd, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupFMin", spv::Op::OpGroupFMin, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupUMin", spv::Op::OpGroupUMin, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupSMin", spv::Op::OpGroupSMin, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupFMax", spv::Op::OpGroupFMax, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupUMax", spv::Op::OpGroupUMax, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupSMax", spv::Op::OpGroupSMax, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ReadPipe", spv::Op::OpReadPipe, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WritePipe", spv::Op::OpWritePipe, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ReservedReadPipe", spv::Op::OpReservedReadPipe, 1, pygen_variable_caps_Pipes, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ReservedWritePipe", spv::Op::OpReservedWritePipe, 1, pygen_variable_caps_Pipes, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ReserveReadPipePackets", spv::Op::OpReserveReadPipePackets, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ReserveWritePipePackets", spv::Op::OpReserveWritePipePackets, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CommitReadPipe", spv::Op::OpCommitReadPipe, 1, pygen_variable_caps_Pipes, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CommitWritePipe", spv::Op::OpCommitWritePipe, 1, pygen_variable_caps_Pipes, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IsValidReserveId", spv::Op::OpIsValidReserveId, 1, pygen_variable_caps_Pipes, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GetNumPipePackets", spv::Op::OpGetNumPipePackets, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GetMaxPipePackets", spv::Op::OpGetMaxPipePackets, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupReserveReadPipePackets", spv::Op::OpGroupReserveReadPipePackets, 1, pygen_variable_caps_Pipes, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupReserveWritePipePackets", spv::Op::OpGroupReserveWritePipePackets, 1, pygen_variable_caps_Pipes, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupCommitReadPipe", spv::Op::OpGroupCommitReadPipe, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GroupCommitWritePipe", spv::Op::OpGroupCommitWritePipe, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"EnqueueMarker", spv::Op::OpEnqueueMarker, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"EnqueueKernel", spv::Op::OpEnqueueKernel, 1, pygen_variable_caps_DeviceEnqueue, 13, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GetKernelNDrangeSubGroupCount", spv::Op::OpGetKernelNDrangeSubGroupCount, 1, pygen_variable_caps_DeviceEnqueue, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GetKernelNDrangeMaxSubGroupSize", spv::Op::OpGetKernelNDrangeMaxSubGroupSize, 1, pygen_variable_caps_DeviceEnqueue, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GetKernelWorkGroupSize", spv::Op::OpGetKernelWorkGroupSize, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GetKernelPreferredWorkGroupSizeMultiple", spv::Op::OpGetKernelPreferredWorkGroupSizeMultiple, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RetainEvent", spv::Op::OpRetainEvent, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ReleaseEvent", spv::Op::OpReleaseEvent, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CreateUserEvent", spv::Op::OpCreateUserEvent, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"IsValidEvent", spv::Op::OpIsValidEvent, 1, pygen_variable_caps_DeviceEnqueue, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SetUserEventStatus", spv::Op::OpSetUserEventStatus, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CaptureEventProfilingInfo", spv::Op::OpCaptureEventProfilingInfo, 1, pygen_variable_caps_DeviceEnqueue, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GetDefaultQueue", spv::Op::OpGetDefaultQueue, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BuildNDRange", spv::Op::OpBuildNDRange, 1, pygen_variable_caps_DeviceEnqueue, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSparseSampleImplicitLod", spv::Op::OpImageSparseSampleImplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSparseSampleExplicitLod", spv::Op::OpImageSparseSampleExplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSparseSampleDrefImplicitLod", spv::Op::OpImageSparseSampleDrefImplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSparseSampleDrefExplicitLod", spv::Op::OpImageSparseSampleDrefExplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSparseSampleProjImplicitLod", spv::Op::OpImageSparseSampleProjImplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageSparseSampleProjExplicitLod", spv::Op::OpImageSparseSampleProjExplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageSparseSampleProjDrefImplicitLod", spv::Op::OpImageSparseSampleProjDrefImplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageSparseSampleProjDrefExplicitLod", spv::Op::OpImageSparseSampleProjDrefExplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageSparseFetch", spv::Op::OpImageSparseFetch, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSparseGather", spv::Op::OpImageSparseGather, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSparseDrefGather", spv::Op::OpImageSparseDrefGather, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSparseTexelsResident", spv::Op::OpImageSparseTexelsResident, 1, pygen_variable_caps_SparseResidency, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NoLine", spv::Op::OpNoLine, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicFlagTestAndSet", spv::Op::OpAtomicFlagTestAndSet, 1, pygen_variable_caps_Kernel, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicFlagClear", spv::Op::OpAtomicFlagClear, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageSparseRead", spv::Op::OpImageSparseRead, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SizeOf", spv::Op::OpSizeOf, 1, pygen_variable_caps_Addresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"TypePipeStorage", spv::Op::OpTypePipeStorage, 1, pygen_variable_caps_PipeStorage, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"ConstantPipeStorage", spv::Op::OpConstantPipeStorage, 1, pygen_variable_caps_PipeStorage, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"CreatePipeFromPipeStorage", spv::Op::OpCreatePipeFromPipeStorage, 1, pygen_variable_caps_PipeStorage, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"GetKernelLocalSizeForSubgroupCount", spv::Op::OpGetKernelLocalSizeForSubgroupCount, 1, pygen_variable_caps_SubgroupDispatch, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"GetKernelMaxNumSubgroups", spv::Op::OpGetKernelMaxNumSubgroups, 1, pygen_variable_caps_SubgroupDispatch, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"TypeNamedBarrier", spv::Op::OpTypeNamedBarrier, 1, pygen_variable_caps_NamedBarrier, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"NamedBarrierInitialize", spv::Op::OpNamedBarrierInitialize, 1, pygen_variable_caps_NamedBarrier, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"MemoryNamedBarrier", spv::Op::OpMemoryNamedBarrier, 1, pygen_variable_caps_NamedBarrier, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"ModuleProcessed", spv::Op::OpModuleProcessed, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"ExecutionModeId", spv::Op::OpExecutionModeId, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXECUTION_MODE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, - {"DecorateId", spv::Op::OpDecorateId, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, - {"GroupNonUniformElect", spv::Op::OpGroupNonUniformElect, 1, pygen_variable_caps_GroupNonUniform, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformAll", spv::Op::OpGroupNonUniformAll, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformAny", spv::Op::OpGroupNonUniformAny, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformAllEqual", spv::Op::OpGroupNonUniformAllEqual, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBroadcast", spv::Op::OpGroupNonUniformBroadcast, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBroadcastFirst", spv::Op::OpGroupNonUniformBroadcastFirst, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallot", spv::Op::OpGroupNonUniformBallot, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformInverseBallot", spv::Op::OpGroupNonUniformInverseBallot, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallotBitExtract", spv::Op::OpGroupNonUniformBallotBitExtract, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallotBitCount", spv::Op::OpGroupNonUniformBallotBitCount, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallotFindLSB", spv::Op::OpGroupNonUniformBallotFindLSB, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallotFindMSB", spv::Op::OpGroupNonUniformBallotFindMSB, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffle", spv::Op::OpGroupNonUniformShuffle, 1, pygen_variable_caps_GroupNonUniformShuffle, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffleXor", spv::Op::OpGroupNonUniformShuffleXor, 1, pygen_variable_caps_GroupNonUniformShuffle, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffleUp", spv::Op::OpGroupNonUniformShuffleUp, 1, pygen_variable_caps_GroupNonUniformShuffleRelative, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffleDown", spv::Op::OpGroupNonUniformShuffleDown, 1, pygen_variable_caps_GroupNonUniformShuffleRelative, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformIAdd", spv::Op::OpGroupNonUniformIAdd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformFAdd", spv::Op::OpGroupNonUniformFAdd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformIMul", spv::Op::OpGroupNonUniformIMul, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformFMul", spv::Op::OpGroupNonUniformFMul, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformSMin", spv::Op::OpGroupNonUniformSMin, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformUMin", spv::Op::OpGroupNonUniformUMin, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformFMin", spv::Op::OpGroupNonUniformFMin, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformSMax", spv::Op::OpGroupNonUniformSMax, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformUMax", spv::Op::OpGroupNonUniformUMax, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformFMax", spv::Op::OpGroupNonUniformFMax, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBitwiseAnd", spv::Op::OpGroupNonUniformBitwiseAnd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBitwiseOr", spv::Op::OpGroupNonUniformBitwiseOr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBitwiseXor", spv::Op::OpGroupNonUniformBitwiseXor, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformLogicalAnd", spv::Op::OpGroupNonUniformLogicalAnd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformLogicalOr", spv::Op::OpGroupNonUniformLogicalOr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformLogicalXor", spv::Op::OpGroupNonUniformLogicalXor, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformQuadBroadcast", spv::Op::OpGroupNonUniformQuadBroadcast, 1, pygen_variable_caps_GroupNonUniformQuad, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformQuadSwap", spv::Op::OpGroupNonUniformQuadSwap, 1, pygen_variable_caps_GroupNonUniformQuad, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"CopyLogical", spv::Op::OpCopyLogical, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"PtrEqual", spv::Op::OpPtrEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"PtrNotEqual", spv::Op::OpPtrNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"PtrDiff", spv::Op::OpPtrDiff, 3, pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBuffer, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"ColorAttachmentReadEXT", spv::Op::OpColorAttachmentReadEXT, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"DepthAttachmentReadEXT", spv::Op::OpDepthAttachmentReadEXT, 1, pygen_variable_caps_TileImageDepthReadAccessEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"StencilAttachmentReadEXT", spv::Op::OpStencilAttachmentReadEXT, 1, pygen_variable_caps_TileImageStencilReadAccessEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TerminateInvocation", spv::Op::OpTerminateInvocation, 1, pygen_variable_caps_Shader, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_terminate_invocation, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SubgroupBallotKHR", spv::Op::OpSubgroupBallotKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"SubgroupFirstInvocationKHR", spv::Op::OpSubgroupFirstInvocationKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"SubgroupAllKHR", spv::Op::OpSubgroupAllKHR, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, - {"SubgroupAnyKHR", spv::Op::OpSubgroupAnyKHR, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, - {"SubgroupAllEqualKHR", spv::Op::OpSubgroupAllEqualKHR, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, - {"GroupNonUniformRotateKHR", spv::Op::OpGroupNonUniformRotateKHR, 1, pygen_variable_caps_GroupNonUniformRotateKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupReadInvocationKHR", spv::Op::OpSubgroupReadInvocationKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"TraceRayKHR", spv::Op::OpTraceRayKHR, 1, pygen_variable_caps_RayTracingKHR, 11, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"ExecuteCallableKHR", spv::Op::OpExecuteCallableKHR, 1, pygen_variable_caps_RayTracingKHR, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"ConvertUToAccelerationStructureKHR", spv::Op::OpConvertUToAccelerationStructureKHR, 2, pygen_variable_caps_RayTracingKHRRayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"IgnoreIntersectionKHR", spv::Op::OpIgnoreIntersectionKHR, 1, pygen_variable_caps_RayTracingKHR, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TerminateRayKHR", spv::Op::OpTerminateRayKHR, 1, pygen_variable_caps_RayTracingKHR, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"SDot", spv::Op::OpSDot, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SDotKHR", spv::Op::OpSDotKHR, 1, pygen_variable_caps_DotProductKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"UDot", spv::Op::OpUDot, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"UDotKHR", spv::Op::OpUDotKHR, 1, pygen_variable_caps_DotProductKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SUDot", spv::Op::OpSUDot, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SUDotKHR", spv::Op::OpSUDotKHR, 1, pygen_variable_caps_DotProductKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SDotAccSat", spv::Op::OpSDotAccSat, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SDotAccSatKHR", spv::Op::OpSDotAccSatKHR, 1, pygen_variable_caps_DotProductKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"UDotAccSat", spv::Op::OpUDotAccSat, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"UDotAccSatKHR", spv::Op::OpUDotAccSatKHR, 1, pygen_variable_caps_DotProductKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SUDotAccSat", spv::Op::OpSUDotAccSat, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SUDotAccSatKHR", spv::Op::OpSUDotAccSatKHR, 1, pygen_variable_caps_DotProductKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"TypeCooperativeMatrixKHR", spv::Op::OpTypeCooperativeMatrixKHR, 1, pygen_variable_caps_CooperativeMatrixKHR, 6, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixLoadKHR", spv::Op::OpCooperativeMatrixLoadKHR, 1, pygen_variable_caps_CooperativeMatrixKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixStoreKHR", spv::Op::OpCooperativeMatrixStoreKHR, 1, pygen_variable_caps_CooperativeMatrixKHR, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixMulAddKHR", spv::Op::OpCooperativeMatrixMulAddKHR, 1, pygen_variable_caps_CooperativeMatrixKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixLengthKHR", spv::Op::OpCooperativeMatrixLengthKHR, 1, pygen_variable_caps_CooperativeMatrixKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeRayQueryKHR", spv::Op::OpTypeRayQueryKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryInitializeKHR", spv::Op::OpRayQueryInitializeKHR, 1, pygen_variable_caps_RayQueryKHR, 8, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryTerminateKHR", spv::Op::OpRayQueryTerminateKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGenerateIntersectionKHR", spv::Op::OpRayQueryGenerateIntersectionKHR, 1, pygen_variable_caps_RayQueryKHR, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryConfirmIntersectionKHR", spv::Op::OpRayQueryConfirmIntersectionKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryProceedKHR", spv::Op::OpRayQueryProceedKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionTypeKHR", spv::Op::OpRayQueryGetIntersectionTypeKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"ImageSampleWeightedQCOM", spv::Op::OpImageSampleWeightedQCOM, 1, pygen_variable_caps_TextureSampleWeightedQCOM, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageBoxFilterQCOM", spv::Op::OpImageBoxFilterQCOM, 1, pygen_variable_caps_TextureBoxFilterQCOM, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageBlockMatchSSDQCOM", spv::Op::OpImageBlockMatchSSDQCOM, 1, pygen_variable_caps_TextureBlockMatchQCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageBlockMatchSADQCOM", spv::Op::OpImageBlockMatchSADQCOM, 1, pygen_variable_caps_TextureBlockMatchQCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupIAddNonUniformAMD", spv::Op::OpGroupIAddNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupFAddNonUniformAMD", spv::Op::OpGroupFAddNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupFMinNonUniformAMD", spv::Op::OpGroupFMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupUMinNonUniformAMD", spv::Op::OpGroupUMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupSMinNonUniformAMD", spv::Op::OpGroupSMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupFMaxNonUniformAMD", spv::Op::OpGroupFMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupUMaxNonUniformAMD", spv::Op::OpGroupUMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupSMaxNonUniformAMD", spv::Op::OpGroupSMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"FragmentMaskFetchAMD", spv::Op::OpFragmentMaskFetchAMD, 1, pygen_variable_caps_FragmentMaskAMD, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, - {"FragmentFetchAMD", spv::Op::OpFragmentFetchAMD, 1, pygen_variable_caps_FragmentMaskAMD, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, - {"ReadClockKHR", spv::Op::OpReadClockKHR, 1, pygen_variable_caps_ShaderClockKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FinalizeNodePayloadsAMDX", spv::Op::OpFinalizeNodePayloadsAMDX, 1, pygen_variable_caps_ShaderEnqueueAMDX, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FinishWritingNodePayloadAMDX", spv::Op::OpFinishWritingNodePayloadAMDX, 1, pygen_variable_caps_ShaderEnqueueAMDX, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"InitializeNodePayloadsAMDX", spv::Op::OpInitializeNodePayloadsAMDX, 1, pygen_variable_caps_ShaderEnqueueAMDX, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectRecordHitMotionNV", spv::Op::OpHitObjectRecordHitMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 14, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectRecordHitWithIndexMotionNV", spv::Op::OpHitObjectRecordHitWithIndexMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectRecordMissMotionNV", spv::Op::OpHitObjectRecordMissMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 7, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetWorldToObjectNV", spv::Op::OpHitObjectGetWorldToObjectNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetObjectToWorldNV", spv::Op::OpHitObjectGetObjectToWorldNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetObjectRayDirectionNV", spv::Op::OpHitObjectGetObjectRayDirectionNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetObjectRayOriginNV", spv::Op::OpHitObjectGetObjectRayOriginNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectTraceRayMotionNV", spv::Op::OpHitObjectTraceRayMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetShaderRecordBufferHandleNV", spv::Op::OpHitObjectGetShaderRecordBufferHandleNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetShaderBindingTableRecordIndexNV", spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectRecordEmptyNV", spv::Op::OpHitObjectRecordEmptyNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectTraceRayNV", spv::Op::OpHitObjectTraceRayNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectRecordHitNV", spv::Op::OpHitObjectRecordHitNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectRecordHitWithIndexNV", spv::Op::OpHitObjectRecordHitWithIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectRecordMissNV", spv::Op::OpHitObjectRecordMissNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 6, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectExecuteShaderNV", spv::Op::OpHitObjectExecuteShaderNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetCurrentTimeNV", spv::Op::OpHitObjectGetCurrentTimeNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetAttributesNV", spv::Op::OpHitObjectGetAttributesNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetHitKindNV", spv::Op::OpHitObjectGetHitKindNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetPrimitiveIndexNV", spv::Op::OpHitObjectGetPrimitiveIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetGeometryIndexNV", spv::Op::OpHitObjectGetGeometryIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetInstanceIdNV", spv::Op::OpHitObjectGetInstanceIdNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetInstanceCustomIndexNV", spv::Op::OpHitObjectGetInstanceCustomIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetWorldRayDirectionNV", spv::Op::OpHitObjectGetWorldRayDirectionNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetWorldRayOriginNV", spv::Op::OpHitObjectGetWorldRayOriginNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetRayTMaxNV", spv::Op::OpHitObjectGetRayTMaxNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectGetRayTMinNV", spv::Op::OpHitObjectGetRayTMinNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectIsEmptyNV", spv::Op::OpHitObjectIsEmptyNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectIsHitNV", spv::Op::OpHitObjectIsHitNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"HitObjectIsMissNV", spv::Op::OpHitObjectIsMissNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ReorderThreadWithHitObjectNV", spv::Op::OpReorderThreadWithHitObjectNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ReorderThreadWithHintNV", spv::Op::OpReorderThreadWithHintNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeHitObjectNV", spv::Op::OpTypeHitObjectNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageSampleFootprintNV", spv::Op::OpImageSampleFootprintNV, 1, pygen_variable_caps_ImageFootprintNV, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 1, pygen_variable_exts_SPV_NV_shader_image_footprint, 0xffffffffu, 0xffffffffu}, - {"EmitMeshTasksEXT", spv::Op::OpEmitMeshTasksEXT, 1, pygen_variable_caps_MeshShadingEXT, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SetMeshOutputsEXT", spv::Op::OpSetMeshOutputsEXT, 1, pygen_variable_caps_MeshShadingEXT, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupNonUniformPartitionNV", spv::Op::OpGroupNonUniformPartitionNV, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, 0xffffffffu, 0xffffffffu}, - {"WritePackedPrimitiveIndices4x8NV", spv::Op::OpWritePackedPrimitiveIndices4x8NV, 1, pygen_variable_caps_MeshShadingNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_mesh_shader, 0xffffffffu, 0xffffffffu}, - {"ReportIntersectionKHR", spv::Op::OpReportIntersectionKHR, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"ReportIntersectionNV", spv::Op::OpReportIntersectionNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"IgnoreIntersectionNV", spv::Op::OpIgnoreIntersectionNV, 1, pygen_variable_caps_RayTracingNV, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TerminateRayNV", spv::Op::OpTerminateRayNV, 1, pygen_variable_caps_RayTracingNV, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TraceNV", spv::Op::OpTraceNV, 1, pygen_variable_caps_RayTracingNV, 11, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TraceMotionNV", spv::Op::OpTraceMotionNV, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, - {"TraceRayMotionNV", spv::Op::OpTraceRayMotionNV, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionTriangleVertexPositionsKHR", spv::Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR, 1, pygen_variable_caps_RayQueryPositionFetchKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAccelerationStructureKHR", spv::Op::OpTypeAccelerationStructureKHR, 3, pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 3, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"TypeAccelerationStructureNV", spv::Op::OpTypeAccelerationStructureNV, 3, pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 3, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"ExecuteCallableNV", spv::Op::OpExecuteCallableNV, 1, pygen_variable_caps_RayTracingNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TypeCooperativeMatrixNV", spv::Op::OpTypeCooperativeMatrixNV, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixLoadNV", spv::Op::OpCooperativeMatrixLoadNV, 1, pygen_variable_caps_CooperativeMatrixNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixStoreNV", spv::Op::OpCooperativeMatrixStoreNV, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixMulAddNV", spv::Op::OpCooperativeMatrixMulAddNV, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixLengthNV", spv::Op::OpCooperativeMatrixLengthNV, 1, pygen_variable_caps_CooperativeMatrixNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"BeginInvocationInterlockEXT", spv::Op::OpBeginInvocationInterlockEXT, 3, pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, 0xffffffffu, 0xffffffffu}, - {"EndInvocationInterlockEXT", spv::Op::OpEndInvocationInterlockEXT, 3, pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, 0xffffffffu, 0xffffffffu}, - {"DemoteToHelperInvocation", spv::Op::OpDemoteToHelperInvocation, 1, pygen_variable_caps_DemoteToHelperInvocation, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DemoteToHelperInvocationEXT", spv::Op::OpDemoteToHelperInvocationEXT, 1, pygen_variable_caps_DemoteToHelperInvocationEXT, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"IsHelperInvocationEXT", spv::Op::OpIsHelperInvocationEXT, 1, pygen_variable_caps_DemoteToHelperInvocationEXT, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, 0xffffffffu, 0xffffffffu}, - {"ConvertUToImageNV", spv::Op::OpConvertUToImageNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertUToSamplerNV", spv::Op::OpConvertUToSamplerNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertImageToUNV", spv::Op::OpConvertImageToUNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertSamplerToUNV", spv::Op::OpConvertSamplerToUNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertUToSampledImageNV", spv::Op::OpConvertUToSampledImageNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertSampledImageToUNV", spv::Op::OpConvertSampledImageToUNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SamplerImageAddressingModeNV", spv::Op::OpSamplerImageAddressingModeNV, 1, pygen_variable_caps_BindlessTextureNV, 1, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupShuffleINTEL", spv::Op::OpSubgroupShuffleINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupShuffleDownINTEL", spv::Op::OpSubgroupShuffleDownINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupShuffleUpINTEL", spv::Op::OpSubgroupShuffleUpINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupShuffleXorINTEL", spv::Op::OpSubgroupShuffleXorINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupBlockReadINTEL", spv::Op::OpSubgroupBlockReadINTEL, 1, pygen_variable_caps_SubgroupBufferBlockIOINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupBlockWriteINTEL", spv::Op::OpSubgroupBlockWriteINTEL, 1, pygen_variable_caps_SubgroupBufferBlockIOINTEL, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageBlockReadINTEL", spv::Op::OpSubgroupImageBlockReadINTEL, 1, pygen_variable_caps_SubgroupImageBlockIOINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageBlockWriteINTEL", spv::Op::OpSubgroupImageBlockWriteINTEL, 1, pygen_variable_caps_SubgroupImageBlockIOINTEL, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageMediaBlockReadINTEL", spv::Op::OpSubgroupImageMediaBlockReadINTEL, 1, pygen_variable_caps_SubgroupImageMediaBlockIOINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageMediaBlockWriteINTEL", spv::Op::OpSubgroupImageMediaBlockWriteINTEL, 1, pygen_variable_caps_SubgroupImageMediaBlockIOINTEL, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UCountLeadingZerosINTEL", spv::Op::OpUCountLeadingZerosINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UCountTrailingZerosINTEL", spv::Op::OpUCountTrailingZerosINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AbsISubINTEL", spv::Op::OpAbsISubINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AbsUSubINTEL", spv::Op::OpAbsUSubINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"IAddSatINTEL", spv::Op::OpIAddSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UAddSatINTEL", spv::Op::OpUAddSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"IAverageINTEL", spv::Op::OpIAverageINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UAverageINTEL", spv::Op::OpUAverageINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"IAverageRoundedINTEL", spv::Op::OpIAverageRoundedINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UAverageRoundedINTEL", spv::Op::OpUAverageRoundedINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ISubSatINTEL", spv::Op::OpISubSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"USubSatINTEL", spv::Op::OpUSubSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"IMul32x16INTEL", spv::Op::OpIMul32x16INTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UMul32x16INTEL", spv::Op::OpUMul32x16INTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConstantFunctionPointerINTEL", spv::Op::OpConstantFunctionPointerINTEL, 1, pygen_variable_caps_FunctionPointersINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_function_pointers, 0xffffffffu, 0xffffffffu}, - {"FunctionPointerCallINTEL", spv::Op::OpFunctionPointerCallINTEL, 1, pygen_variable_caps_FunctionPointersINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_function_pointers, 0xffffffffu, 0xffffffffu}, - {"AsmTargetINTEL", spv::Op::OpAsmTargetINTEL, 1, pygen_variable_caps_AsmINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AsmINTEL", spv::Op::OpAsmINTEL, 1, pygen_variable_caps_AsmINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AsmCallINTEL", spv::Op::OpAsmCallINTEL, 1, pygen_variable_caps_AsmINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AtomicFMinEXT", spv::Op::OpAtomicFMinEXT, 3, pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AtomicFMaxEXT", spv::Op::OpAtomicFMaxEXT, 3, pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AssumeTrueKHR", spv::Op::OpAssumeTrueKHR, 1, pygen_variable_caps_ExpectAssumeKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_expect_assume, 0xffffffffu, 0xffffffffu}, - {"ExpectKHR", spv::Op::OpExpectKHR, 1, pygen_variable_caps_ExpectAssumeKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_expect_assume, 0xffffffffu, 0xffffffffu}, - {"DecorateString", spv::Op::OpDecorateString, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"DecorateStringGOOGLE", spv::Op::OpDecorateStringGOOGLE, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"MemberDecorateString", spv::Op::OpMemberDecorateString, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"MemberDecorateStringGOOGLE", spv::Op::OpMemberDecorateStringGOOGLE, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"VmeImageINTEL", spv::Op::OpVmeImageINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeVmeImageINTEL", spv::Op::OpTypeVmeImageINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImePayloadINTEL", spv::Op::OpTypeAvcImePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcRefPayloadINTEL", spv::Op::OpTypeAvcRefPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcSicPayloadINTEL", spv::Op::OpTypeAvcSicPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcMcePayloadINTEL", spv::Op::OpTypeAvcMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcMceResultINTEL", spv::Op::OpTypeAvcMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeResultINTEL", spv::Op::OpTypeAvcImeResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeResultSingleReferenceStreamoutINTEL", spv::Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeResultDualReferenceStreamoutINTEL", spv::Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeSingleReferenceStreaminINTEL", spv::Op::OpTypeAvcImeSingleReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeDualReferenceStreaminINTEL", spv::Op::OpTypeAvcImeDualReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcRefResultINTEL", spv::Op::OpTypeAvcRefResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcSicResultINTEL", spv::Op::OpTypeAvcSicResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL", spv::Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultInterShapePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetInterShapePenaltyINTEL", spv::Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetInterDirectionPenaltyINTEL", spv::Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetMotionVectorCostFunctionINTEL", spv::Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetAcOnlyHaarINTEL", spv::Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL", spv::Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL", spv::Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL", spv::Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToImePayloadINTEL", spv::Op::OpSubgroupAvcMceConvertToImePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToImeResultINTEL", spv::Op::OpSubgroupAvcMceConvertToImeResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToRefPayloadINTEL", spv::Op::OpSubgroupAvcMceConvertToRefPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToRefResultINTEL", spv::Op::OpSubgroupAvcMceConvertToRefResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToSicPayloadINTEL", spv::Op::OpSubgroupAvcMceConvertToSicPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToSicResultINTEL", spv::Op::OpSubgroupAvcMceConvertToSicResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetMotionVectorsINTEL", spv::Op::OpSubgroupAvcMceGetMotionVectorsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterDistortionsINTEL", spv::Op::OpSubgroupAvcMceGetInterDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetBestInterDistortionsINTEL", spv::Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterMajorShapeINTEL", spv::Op::OpSubgroupAvcMceGetInterMajorShapeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterMinorShapeINTEL", spv::Op::OpSubgroupAvcMceGetInterMinorShapeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterDirectionsINTEL", spv::Op::OpSubgroupAvcMceGetInterDirectionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterMotionVectorCountINTEL", spv::Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterReferenceIdsINTEL", spv::Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL", spv::Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeInitializeINTEL", spv::Op::OpSubgroupAvcImeInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetSingleReferenceINTEL", spv::Op::OpSubgroupAvcImeSetSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetDualReferenceINTEL", spv::Op::OpSubgroupAvcImeSetDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeRefWindowSizeINTEL", spv::Op::OpSubgroupAvcImeRefWindowSizeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeAdjustRefOffsetINTEL", spv::Op::OpSubgroupAvcImeAdjustRefOffsetINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeConvertToMcePayloadINTEL", spv::Op::OpSubgroupAvcImeConvertToMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetMaxMotionVectorCountINTEL", spv::Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetUnidirectionalMixDisableINTEL", spv::Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetEarlySearchTerminationThresholdINTEL", spv::Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetWeightedSadINTEL", spv::Op::OpSubgroupAvcImeSetWeightedSadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithSingleReferenceINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithDualReferenceINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeConvertToMceResultINTEL", spv::Op::OpSubgroupAvcImeConvertToMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetSingleReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetDualReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeStripSingleReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeStripDualReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetBorderReachedINTEL", spv::Op::OpSubgroupAvcImeGetBorderReachedINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetTruncatedSearchIndicationINTEL", spv::Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL", spv::Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL", spv::Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL", spv::Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcFmeInitializeINTEL", spv::Op::OpSubgroupAvcFmeInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcBmeInitializeINTEL", spv::Op::OpSubgroupAvcBmeInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefConvertToMcePayloadINTEL", spv::Op::OpSubgroupAvcRefConvertToMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefSetBidirectionalMixDisableINTEL", spv::Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefSetBilinearFilterEnableINTEL", spv::Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefEvaluateWithSingleReferenceINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefEvaluateWithDualReferenceINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefEvaluateWithMultiReferenceINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefConvertToMceResultINTEL", spv::Op::OpSubgroupAvcRefConvertToMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicInitializeINTEL", spv::Op::OpSubgroupAvcSicInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConfigureSkcINTEL", spv::Op::OpSubgroupAvcSicConfigureSkcINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConfigureIpeLumaINTEL", spv::Op::OpSubgroupAvcSicConfigureIpeLumaINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConfigureIpeLumaChromaINTEL", spv::Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 13, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetMotionVectorMaskINTEL", spv::Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConvertToMcePayloadINTEL", spv::Op::OpSubgroupAvcSicConvertToMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetIntraLumaShapePenaltyINTEL", spv::Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetIntraLumaModeCostFunctionINTEL", spv::Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetIntraChromaModeCostFunctionINTEL", spv::Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetBilinearFilterEnableINTEL", spv::Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetSkcForwardTransformEnableINTEL", spv::Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetBlockBasedRawSkipSadINTEL", spv::Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateIpeINTEL", spv::Op::OpSubgroupAvcSicEvaluateIpeINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateWithSingleReferenceINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateWithDualReferenceINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateWithMultiReferenceINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConvertToMceResultINTEL", spv::Op::OpSubgroupAvcSicConvertToMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetIpeLumaShapeINTEL", spv::Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetBestIpeLumaDistortionINTEL", spv::Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetBestIpeChromaDistortionINTEL", spv::Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetPackedIpeLumaModesINTEL", spv::Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetIpeChromaModeINTEL", spv::Op::OpSubgroupAvcSicGetIpeChromaModeINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL", spv::Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL", spv::Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetInterRawSadsINTEL", spv::Op::OpSubgroupAvcSicGetInterRawSadsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"VariableLengthArrayINTEL", spv::Op::OpVariableLengthArrayINTEL, 1, pygen_variable_caps_VariableLengthArrayINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SaveMemoryINTEL", spv::Op::OpSaveMemoryINTEL, 1, pygen_variable_caps_VariableLengthArrayINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"RestoreMemoryINTEL", spv::Op::OpRestoreMemoryINTEL, 1, pygen_variable_caps_VariableLengthArrayINTEL, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSinCosPiINTEL", spv::Op::OpArbitraryFloatSinCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCastINTEL", spv::Op::OpArbitraryFloatCastINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCastFromIntINTEL", spv::Op::OpArbitraryFloatCastFromIntINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCastToIntINTEL", spv::Op::OpArbitraryFloatCastToIntINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatAddINTEL", spv::Op::OpArbitraryFloatAddINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSubINTEL", spv::Op::OpArbitraryFloatSubINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatMulINTEL", spv::Op::OpArbitraryFloatMulINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatDivINTEL", spv::Op::OpArbitraryFloatDivINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatGTINTEL", spv::Op::OpArbitraryFloatGTINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatGEINTEL", spv::Op::OpArbitraryFloatGEINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLTINTEL", spv::Op::OpArbitraryFloatLTINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLEINTEL", spv::Op::OpArbitraryFloatLEINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatEQINTEL", spv::Op::OpArbitraryFloatEQINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatRecipINTEL", spv::Op::OpArbitraryFloatRecipINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatRSqrtINTEL", spv::Op::OpArbitraryFloatRSqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCbrtINTEL", spv::Op::OpArbitraryFloatCbrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatHypotINTEL", spv::Op::OpArbitraryFloatHypotINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSqrtINTEL", spv::Op::OpArbitraryFloatSqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLogINTEL", spv::Op::OpArbitraryFloatLogINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLog2INTEL", spv::Op::OpArbitraryFloatLog2INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLog10INTEL", spv::Op::OpArbitraryFloatLog10INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLog1pINTEL", spv::Op::OpArbitraryFloatLog1pINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatExpINTEL", spv::Op::OpArbitraryFloatExpINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatExp2INTEL", spv::Op::OpArbitraryFloatExp2INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatExp10INTEL", spv::Op::OpArbitraryFloatExp10INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatExpm1INTEL", spv::Op::OpArbitraryFloatExpm1INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSinINTEL", spv::Op::OpArbitraryFloatSinINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCosINTEL", spv::Op::OpArbitraryFloatCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSinCosINTEL", spv::Op::OpArbitraryFloatSinCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSinPiINTEL", spv::Op::OpArbitraryFloatSinPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCosPiINTEL", spv::Op::OpArbitraryFloatCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatASinINTEL", spv::Op::OpArbitraryFloatASinINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatASinPiINTEL", spv::Op::OpArbitraryFloatASinPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatACosINTEL", spv::Op::OpArbitraryFloatACosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatACosPiINTEL", spv::Op::OpArbitraryFloatACosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatATanINTEL", spv::Op::OpArbitraryFloatATanINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatATanPiINTEL", spv::Op::OpArbitraryFloatATanPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatATan2INTEL", spv::Op::OpArbitraryFloatATan2INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatPowINTEL", spv::Op::OpArbitraryFloatPowINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatPowRINTEL", spv::Op::OpArbitraryFloatPowRINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatPowNINTEL", spv::Op::OpArbitraryFloatPowNINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"LoopControlINTEL", spv::Op::OpLoopControlINTEL, 1, pygen_variable_caps_UnstructuredLoopControlsINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 0, 0, 1, pygen_variable_exts_SPV_INTEL_unstructured_loop_controls, 0xffffffffu, 0xffffffffu}, - {"AliasDomainDeclINTEL", spv::Op::OpAliasDomainDeclINTEL, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, - {"AliasScopeDeclINTEL", spv::Op::OpAliasScopeDeclINTEL, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, - {"AliasScopeListDeclINTEL", spv::Op::OpAliasScopeListDeclINTEL, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, - {"FixedSqrtINTEL", spv::Op::OpFixedSqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedRecipINTEL", spv::Op::OpFixedRecipINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedRsqrtINTEL", spv::Op::OpFixedRsqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedSinINTEL", spv::Op::OpFixedSinINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedCosINTEL", spv::Op::OpFixedCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedSinCosINTEL", spv::Op::OpFixedSinCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedSinPiINTEL", spv::Op::OpFixedSinPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedCosPiINTEL", spv::Op::OpFixedCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedSinCosPiINTEL", spv::Op::OpFixedSinCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedLogINTEL", spv::Op::OpFixedLogINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedExpINTEL", spv::Op::OpFixedExpINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"PtrCastToCrossWorkgroupINTEL", spv::Op::OpPtrCastToCrossWorkgroupINTEL, 1, pygen_variable_caps_USMStorageClassesINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"CrossWorkgroupCastToPtrINTEL", spv::Op::OpCrossWorkgroupCastToPtrINTEL, 1, pygen_variable_caps_USMStorageClassesINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ReadPipeBlockingINTEL", spv::Op::OpReadPipeBlockingINTEL, 1, pygen_variable_caps_BlockingPipesINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, 0xffffffffu, 0xffffffffu}, - {"WritePipeBlockingINTEL", spv::Op::OpWritePipeBlockingINTEL, 1, pygen_variable_caps_BlockingPipesINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, 0xffffffffu, 0xffffffffu}, - {"FPGARegINTEL", spv::Op::OpFPGARegINTEL, 1, pygen_variable_caps_FPGARegINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_fpga_reg, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetRayTMinKHR", spv::Op::OpRayQueryGetRayTMinKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetRayFlagsKHR", spv::Op::OpRayQueryGetRayFlagsKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionTKHR", spv::Op::OpRayQueryGetIntersectionTKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionInstanceCustomIndexKHR", spv::Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionInstanceIdKHR", spv::Op::OpRayQueryGetIntersectionInstanceIdKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR", spv::Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionGeometryIndexKHR", spv::Op::OpRayQueryGetIntersectionGeometryIndexKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionPrimitiveIndexKHR", spv::Op::OpRayQueryGetIntersectionPrimitiveIndexKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionBarycentricsKHR", spv::Op::OpRayQueryGetIntersectionBarycentricsKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionFrontFaceKHR", spv::Op::OpRayQueryGetIntersectionFrontFaceKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionCandidateAABBOpaqueKHR", spv::Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionObjectRayDirectionKHR", spv::Op::OpRayQueryGetIntersectionObjectRayDirectionKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionObjectRayOriginKHR", spv::Op::OpRayQueryGetIntersectionObjectRayOriginKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetWorldRayDirectionKHR", spv::Op::OpRayQueryGetWorldRayDirectionKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetWorldRayOriginKHR", spv::Op::OpRayQueryGetWorldRayOriginKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionObjectToWorldKHR", spv::Op::OpRayQueryGetIntersectionObjectToWorldKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionWorldToObjectKHR", spv::Op::OpRayQueryGetIntersectionWorldToObjectKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"AtomicFAddEXT", spv::Op::OpAtomicFAddEXT, 3, pygen_variable_caps_AtomicFloat16AddEXTAtomicFloat32AddEXTAtomicFloat64AddEXT, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, 0xffffffffu, 0xffffffffu}, - {"TypeBufferSurfaceINTEL", spv::Op::OpTypeBufferSurfaceINTEL, 1, pygen_variable_caps_VectorComputeINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeStructContinuedINTEL", spv::Op::OpTypeStructContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConstantCompositeContinuedINTEL", spv::Op::OpConstantCompositeContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SpecConstantCompositeContinuedINTEL", spv::Op::OpSpecConstantCompositeContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertFToBF16INTEL", spv::Op::OpConvertFToBF16INTEL, 1, pygen_variable_caps_BFloat16ConversionINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertBF16ToFINTEL", spv::Op::OpConvertBF16ToFINTEL, 1, pygen_variable_caps_BFloat16ConversionINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ControlBarrierArriveINTEL", spv::Op::OpControlBarrierArriveINTEL, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ControlBarrierWaitINTEL", spv::Op::OpControlBarrierWaitINTEL, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupIMulKHR", spv::Op::OpGroupIMulKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupFMulKHR", spv::Op::OpGroupFMulKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupBitwiseAndKHR", spv::Op::OpGroupBitwiseAndKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupBitwiseOrKHR", spv::Op::OpGroupBitwiseOrKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupBitwiseXorKHR", spv::Op::OpGroupBitwiseXorKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupLogicalAndKHR", spv::Op::OpGroupLogicalAndKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupLogicalOrKHR", spv::Op::OpGroupLogicalOrKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupLogicalXorKHR", spv::Op::OpGroupLogicalXorKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu} + {"Nop", spv::Op::OpNop, 0, nullptr, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Undef", spv::Op::OpUndef, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SourceContinued", spv::Op::OpSourceContinued, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Source", spv::Op::OpSource, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_SOURCE_LANGUAGE, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SourceExtension", spv::Op::OpSourceExtension, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Name", spv::Op::OpName, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MemberName", spv::Op::OpMemberName, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"String", spv::Op::OpString, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Line", spv::Op::OpLine, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Extension", spv::Op::OpExtension, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ExtInstImport", spv::Op::OpExtInstImport, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ExtInst", spv::Op::OpExtInst, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MemoryModel", spv::Op::OpMemoryModel, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_ADDRESSING_MODEL, SPV_OPERAND_TYPE_MEMORY_MODEL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"EntryPoint", spv::Op::OpEntryPoint, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_EXECUTION_MODEL, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ExecutionMode", spv::Op::OpExecutionMode, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXECUTION_MODE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Capability", spv::Op::OpCapability, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_CAPABILITY}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeVoid", spv::Op::OpTypeVoid, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeBool", spv::Op::OpTypeBool, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeInt", spv::Op::OpTypeInt, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeFloat", spv::Op::OpTypeFloat, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_OPTIONAL_FPENCODING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeVector", spv::Op::OpTypeVector, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeMatrix", spv::Op::OpTypeMatrix, 0, nullptr, 1, pygen_variable_caps_Matrix, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeImage", spv::Op::OpTypeImage, 0, nullptr, 0, nullptr, 9, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DIMENSIONALITY, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT, SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeSampler", spv::Op::OpTypeSampler, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeSampledImage", spv::Op::OpTypeSampledImage, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeArray", spv::Op::OpTypeArray, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeRuntimeArray", spv::Op::OpTypeRuntimeArray, 0, nullptr, 1, pygen_variable_caps_Shader, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeStruct", spv::Op::OpTypeStruct, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeOpaque", spv::Op::OpTypeOpaque, 0, nullptr, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypePointer", spv::Op::OpTypePointer, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeFunction", spv::Op::OpTypeFunction, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeEvent", spv::Op::OpTypeEvent, 0, nullptr, 1, pygen_variable_caps_Kernel, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeDeviceEvent", spv::Op::OpTypeDeviceEvent, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeReserveId", spv::Op::OpTypeReserveId, 0, nullptr, 1, pygen_variable_caps_Pipes, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeQueue", spv::Op::OpTypeQueue, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypePipe", spv::Op::OpTypePipe, 0, nullptr, 1, pygen_variable_caps_Pipes, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TypeForwardPointer", spv::Op::OpTypeForwardPointer, 0, nullptr, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_STORAGE_CLASS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConstantTrue", spv::Op::OpConstantTrue, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConstantFalse", spv::Op::OpConstantFalse, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Constant", spv::Op::OpConstant, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConstantComposite", spv::Op::OpConstantComposite, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConstantSampler", spv::Op::OpConstantSampler, 0, nullptr, 1, pygen_variable_caps_LiteralSampler, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConstantNull", spv::Op::OpConstantNull, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SpecConstantTrue", spv::Op::OpSpecConstantTrue, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SpecConstantFalse", spv::Op::OpSpecConstantFalse, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SpecConstant", spv::Op::OpSpecConstant, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SpecConstantComposite", spv::Op::OpSpecConstantComposite, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SpecConstantOp", spv::Op::OpSpecConstantOp, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Function", spv::Op::OpFunction, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_FUNCTION_CONTROL, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FunctionParameter", spv::Op::OpFunctionParameter, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FunctionEnd", spv::Op::OpFunctionEnd, 0, nullptr, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FunctionCall", spv::Op::OpFunctionCall, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Variable", spv::Op::OpVariable, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageTexelPointer", spv::Op::OpImageTexelPointer, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Load", spv::Op::OpLoad, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Store", spv::Op::OpStore, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CopyMemory", spv::Op::OpCopyMemory, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CopyMemorySized", spv::Op::OpCopyMemorySized, 0, nullptr, 2, pygen_variable_caps_AddressesUntypedPointersKHR, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AccessChain", spv::Op::OpAccessChain, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InBoundsAccessChain", spv::Op::OpInBoundsAccessChain, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PtrAccessChain", spv::Op::OpPtrAccessChain, 0, nullptr, 4, pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBufferPhysicalStorageBufferAddresses, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ArrayLength", spv::Op::OpArrayLength, 0, nullptr, 1, pygen_variable_caps_Shader, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GenericPtrMemSemantics", spv::Op::OpGenericPtrMemSemantics, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InBoundsPtrAccessChain", spv::Op::OpInBoundsPtrAccessChain, 0, nullptr, 1, pygen_variable_caps_Addresses, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Decorate", spv::Op::OpDecorate, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MemberDecorate", spv::Op::OpMemberDecorate, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DecorationGroup", spv::Op::OpDecorationGroup, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupDecorate", spv::Op::OpGroupDecorate, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupMemberDecorate", spv::Op::OpGroupMemberDecorate, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VectorExtractDynamic", spv::Op::OpVectorExtractDynamic, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VectorInsertDynamic", spv::Op::OpVectorInsertDynamic, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VectorShuffle", spv::Op::OpVectorShuffle, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CompositeConstruct", spv::Op::OpCompositeConstruct, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CompositeExtract", spv::Op::OpCompositeExtract, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CompositeInsert", spv::Op::OpCompositeInsert, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CopyObject", spv::Op::OpCopyObject, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Transpose", spv::Op::OpTranspose, 0, nullptr, 1, pygen_variable_caps_Matrix, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SampledImage", spv::Op::OpSampledImage, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSampleImplicitLod", spv::Op::OpImageSampleImplicitLod, 0, nullptr, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSampleExplicitLod", spv::Op::OpImageSampleExplicitLod, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSampleDrefImplicitLod", spv::Op::OpImageSampleDrefImplicitLod, 0, nullptr, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSampleDrefExplicitLod", spv::Op::OpImageSampleDrefExplicitLod, 0, nullptr, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSampleProjImplicitLod", spv::Op::OpImageSampleProjImplicitLod, 0, nullptr, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSampleProjExplicitLod", spv::Op::OpImageSampleProjExplicitLod, 0, nullptr, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSampleProjDrefImplicitLod", spv::Op::OpImageSampleProjDrefImplicitLod, 0, nullptr, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSampleProjDrefExplicitLod", spv::Op::OpImageSampleProjDrefExplicitLod, 0, nullptr, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageFetch", spv::Op::OpImageFetch, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageGather", spv::Op::OpImageGather, 0, nullptr, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageDrefGather", spv::Op::OpImageDrefGather, 0, nullptr, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageRead", spv::Op::OpImageRead, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageWrite", spv::Op::OpImageWrite, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Image", spv::Op::OpImage, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageQueryFormat", spv::Op::OpImageQueryFormat, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageQueryOrder", spv::Op::OpImageQueryOrder, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageQuerySizeLod", spv::Op::OpImageQuerySizeLod, 0, nullptr, 2, pygen_variable_caps_KernelImageQuery, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageQuerySize", spv::Op::OpImageQuerySize, 0, nullptr, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageQueryLod", spv::Op::OpImageQueryLod, 0, nullptr, 1, pygen_variable_caps_ImageQuery, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageQueryLevels", spv::Op::OpImageQueryLevels, 0, nullptr, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageQuerySamples", spv::Op::OpImageQuerySamples, 0, nullptr, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConvertFToU", spv::Op::OpConvertFToU, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConvertFToS", spv::Op::OpConvertFToS, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConvertSToF", spv::Op::OpConvertSToF, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConvertUToF", spv::Op::OpConvertUToF, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UConvert", spv::Op::OpUConvert, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SConvert", spv::Op::OpSConvert, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FConvert", spv::Op::OpFConvert, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"QuantizeToF16", spv::Op::OpQuantizeToF16, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConvertPtrToU", spv::Op::OpConvertPtrToU, 0, nullptr, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SatConvertSToU", spv::Op::OpSatConvertSToU, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SatConvertUToS", spv::Op::OpSatConvertUToS, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConvertUToPtr", spv::Op::OpConvertUToPtr, 0, nullptr, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PtrCastToGeneric", spv::Op::OpPtrCastToGeneric, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GenericCastToPtr", spv::Op::OpGenericCastToPtr, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GenericCastToPtrExplicit", spv::Op::OpGenericCastToPtrExplicit, 0, nullptr, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_STORAGE_CLASS}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Bitcast", spv::Op::OpBitcast, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SNegate", spv::Op::OpSNegate, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FNegate", spv::Op::OpFNegate, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IAdd", spv::Op::OpIAdd, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FAdd", spv::Op::OpFAdd, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ISub", spv::Op::OpISub, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FSub", spv::Op::OpFSub, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IMul", spv::Op::OpIMul, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FMul", spv::Op::OpFMul, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UDiv", spv::Op::OpUDiv, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SDiv", spv::Op::OpSDiv, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FDiv", spv::Op::OpFDiv, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UMod", spv::Op::OpUMod, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SRem", spv::Op::OpSRem, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SMod", spv::Op::OpSMod, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FRem", spv::Op::OpFRem, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FMod", spv::Op::OpFMod, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VectorTimesScalar", spv::Op::OpVectorTimesScalar, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MatrixTimesScalar", spv::Op::OpMatrixTimesScalar, 0, nullptr, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VectorTimesMatrix", spv::Op::OpVectorTimesMatrix, 0, nullptr, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MatrixTimesVector", spv::Op::OpMatrixTimesVector, 0, nullptr, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MatrixTimesMatrix", spv::Op::OpMatrixTimesMatrix, 0, nullptr, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OuterProduct", spv::Op::OpOuterProduct, 0, nullptr, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Dot", spv::Op::OpDot, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IAddCarry", spv::Op::OpIAddCarry, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ISubBorrow", spv::Op::OpISubBorrow, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UMulExtended", spv::Op::OpUMulExtended, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SMulExtended", spv::Op::OpSMulExtended, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Any", spv::Op::OpAny, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"All", spv::Op::OpAll, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IsNan", spv::Op::OpIsNan, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IsInf", spv::Op::OpIsInf, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IsFinite", spv::Op::OpIsFinite, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IsNormal", spv::Op::OpIsNormal, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SignBitSet", spv::Op::OpSignBitSet, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LessOrGreater", spv::Op::OpLessOrGreater, 0, nullptr, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), SPV_SPIRV_VERSION_WORD(1,5)}, + {"Ordered", spv::Op::OpOrdered, 0, nullptr, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Unordered", spv::Op::OpUnordered, 0, nullptr, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LogicalEqual", spv::Op::OpLogicalEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LogicalNotEqual", spv::Op::OpLogicalNotEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LogicalOr", spv::Op::OpLogicalOr, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LogicalAnd", spv::Op::OpLogicalAnd, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LogicalNot", spv::Op::OpLogicalNot, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Select", spv::Op::OpSelect, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IEqual", spv::Op::OpIEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"INotEqual", spv::Op::OpINotEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UGreaterThan", spv::Op::OpUGreaterThan, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SGreaterThan", spv::Op::OpSGreaterThan, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UGreaterThanEqual", spv::Op::OpUGreaterThanEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SGreaterThanEqual", spv::Op::OpSGreaterThanEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ULessThan", spv::Op::OpULessThan, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SLessThan", spv::Op::OpSLessThan, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ULessThanEqual", spv::Op::OpULessThanEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SLessThanEqual", spv::Op::OpSLessThanEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FOrdEqual", spv::Op::OpFOrdEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FUnordEqual", spv::Op::OpFUnordEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FOrdNotEqual", spv::Op::OpFOrdNotEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FUnordNotEqual", spv::Op::OpFUnordNotEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FOrdLessThan", spv::Op::OpFOrdLessThan, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FUnordLessThan", spv::Op::OpFUnordLessThan, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FOrdGreaterThan", spv::Op::OpFOrdGreaterThan, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FUnordGreaterThan", spv::Op::OpFUnordGreaterThan, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FOrdLessThanEqual", spv::Op::OpFOrdLessThanEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FUnordLessThanEqual", spv::Op::OpFUnordLessThanEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FOrdGreaterThanEqual", spv::Op::OpFOrdGreaterThanEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FUnordGreaterThanEqual", spv::Op::OpFUnordGreaterThanEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ShiftRightLogical", spv::Op::OpShiftRightLogical, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ShiftRightArithmetic", spv::Op::OpShiftRightArithmetic, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ShiftLeftLogical", spv::Op::OpShiftLeftLogical, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BitwiseOr", spv::Op::OpBitwiseOr, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BitwiseXor", spv::Op::OpBitwiseXor, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BitwiseAnd", spv::Op::OpBitwiseAnd, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Not", spv::Op::OpNot, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BitFieldInsert", spv::Op::OpBitFieldInsert, 0, nullptr, 2, pygen_variable_caps_ShaderBitInstructions, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BitFieldSExtract", spv::Op::OpBitFieldSExtract, 0, nullptr, 2, pygen_variable_caps_ShaderBitInstructions, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BitFieldUExtract", spv::Op::OpBitFieldUExtract, 0, nullptr, 2, pygen_variable_caps_ShaderBitInstructions, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BitReverse", spv::Op::OpBitReverse, 0, nullptr, 2, pygen_variable_caps_ShaderBitInstructions, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BitCount", spv::Op::OpBitCount, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DPdx", spv::Op::OpDPdx, 0, nullptr, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DPdy", spv::Op::OpDPdy, 0, nullptr, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Fwidth", spv::Op::OpFwidth, 0, nullptr, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DPdxFine", spv::Op::OpDPdxFine, 0, nullptr, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DPdyFine", spv::Op::OpDPdyFine, 0, nullptr, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FwidthFine", spv::Op::OpFwidthFine, 0, nullptr, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DPdxCoarse", spv::Op::OpDPdxCoarse, 0, nullptr, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DPdyCoarse", spv::Op::OpDPdyCoarse, 0, nullptr, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FwidthCoarse", spv::Op::OpFwidthCoarse, 0, nullptr, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"EmitVertex", spv::Op::OpEmitVertex, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"EndPrimitive", spv::Op::OpEndPrimitive, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"EmitStreamVertex", spv::Op::OpEmitStreamVertex, 0, nullptr, 1, pygen_variable_caps_GeometryStreams, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"EndStreamPrimitive", spv::Op::OpEndStreamPrimitive, 0, nullptr, 1, pygen_variable_caps_GeometryStreams, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ControlBarrier", spv::Op::OpControlBarrier, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MemoryBarrier", spv::Op::OpMemoryBarrier, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicLoad", spv::Op::OpAtomicLoad, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicStore", spv::Op::OpAtomicStore, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicExchange", spv::Op::OpAtomicExchange, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicCompareExchange", spv::Op::OpAtomicCompareExchange, 0, nullptr, 0, nullptr, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicCompareExchangeWeak", spv::Op::OpAtomicCompareExchangeWeak, 0, nullptr, 1, pygen_variable_caps_Kernel, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), SPV_SPIRV_VERSION_WORD(1,3)}, + {"AtomicIIncrement", spv::Op::OpAtomicIIncrement, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicIDecrement", spv::Op::OpAtomicIDecrement, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicIAdd", spv::Op::OpAtomicIAdd, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicISub", spv::Op::OpAtomicISub, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicSMin", spv::Op::OpAtomicSMin, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicUMin", spv::Op::OpAtomicUMin, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicSMax", spv::Op::OpAtomicSMax, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicUMax", spv::Op::OpAtomicUMax, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicAnd", spv::Op::OpAtomicAnd, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicOr", spv::Op::OpAtomicOr, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicXor", spv::Op::OpAtomicXor, 0, nullptr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Phi", spv::Op::OpPhi, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LoopMerge", spv::Op::OpLoopMerge, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LOOP_CONTROL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SelectionMerge", spv::Op::OpSelectionMerge, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SELECTION_CONTROL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Label", spv::Op::OpLabel, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Branch", spv::Op::OpBranch, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BranchConditional", spv::Op::OpBranchConditional, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Switch", spv::Op::OpSwitch, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Kill", spv::Op::OpKill, 0, nullptr, 1, pygen_variable_caps_Shader, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Return", spv::Op::OpReturn, 0, nullptr, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ReturnValue", spv::Op::OpReturnValue, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Unreachable", spv::Op::OpUnreachable, 0, nullptr, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LifetimeStart", spv::Op::OpLifetimeStart, 0, nullptr, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LifetimeStop", spv::Op::OpLifetimeStop, 0, nullptr, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupAsyncCopy", spv::Op::OpGroupAsyncCopy, 0, nullptr, 1, pygen_variable_caps_Kernel, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupWaitEvents", spv::Op::OpGroupWaitEvents, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupAll", spv::Op::OpGroupAll, 0, nullptr, 1, pygen_variable_caps_Groups, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupAny", spv::Op::OpGroupAny, 0, nullptr, 1, pygen_variable_caps_Groups, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupBroadcast", spv::Op::OpGroupBroadcast, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupIAdd", spv::Op::OpGroupIAdd, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupFAdd", spv::Op::OpGroupFAdd, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupFMin", spv::Op::OpGroupFMin, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupUMin", spv::Op::OpGroupUMin, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupSMin", spv::Op::OpGroupSMin, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupFMax", spv::Op::OpGroupFMax, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupUMax", spv::Op::OpGroupUMax, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupSMax", spv::Op::OpGroupSMax, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ReadPipe", spv::Op::OpReadPipe, 0, nullptr, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WritePipe", spv::Op::OpWritePipe, 0, nullptr, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ReservedReadPipe", spv::Op::OpReservedReadPipe, 0, nullptr, 1, pygen_variable_caps_Pipes, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ReservedWritePipe", spv::Op::OpReservedWritePipe, 0, nullptr, 1, pygen_variable_caps_Pipes, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ReserveReadPipePackets", spv::Op::OpReserveReadPipePackets, 0, nullptr, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ReserveWritePipePackets", spv::Op::OpReserveWritePipePackets, 0, nullptr, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CommitReadPipe", spv::Op::OpCommitReadPipe, 0, nullptr, 1, pygen_variable_caps_Pipes, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CommitWritePipe", spv::Op::OpCommitWritePipe, 0, nullptr, 1, pygen_variable_caps_Pipes, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IsValidReserveId", spv::Op::OpIsValidReserveId, 0, nullptr, 1, pygen_variable_caps_Pipes, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GetNumPipePackets", spv::Op::OpGetNumPipePackets, 0, nullptr, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GetMaxPipePackets", spv::Op::OpGetMaxPipePackets, 0, nullptr, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupReserveReadPipePackets", spv::Op::OpGroupReserveReadPipePackets, 0, nullptr, 1, pygen_variable_caps_Pipes, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupReserveWritePipePackets", spv::Op::OpGroupReserveWritePipePackets, 0, nullptr, 1, pygen_variable_caps_Pipes, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupCommitReadPipe", spv::Op::OpGroupCommitReadPipe, 0, nullptr, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GroupCommitWritePipe", spv::Op::OpGroupCommitWritePipe, 0, nullptr, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"EnqueueMarker", spv::Op::OpEnqueueMarker, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"EnqueueKernel", spv::Op::OpEnqueueKernel, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 13, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GetKernelNDrangeSubGroupCount", spv::Op::OpGetKernelNDrangeSubGroupCount, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GetKernelNDrangeMaxSubGroupSize", spv::Op::OpGetKernelNDrangeMaxSubGroupSize, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GetKernelWorkGroupSize", spv::Op::OpGetKernelWorkGroupSize, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GetKernelPreferredWorkGroupSizeMultiple", spv::Op::OpGetKernelPreferredWorkGroupSizeMultiple, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RetainEvent", spv::Op::OpRetainEvent, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ReleaseEvent", spv::Op::OpReleaseEvent, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CreateUserEvent", spv::Op::OpCreateUserEvent, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"IsValidEvent", spv::Op::OpIsValidEvent, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SetUserEventStatus", spv::Op::OpSetUserEventStatus, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CaptureEventProfilingInfo", spv::Op::OpCaptureEventProfilingInfo, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GetDefaultQueue", spv::Op::OpGetDefaultQueue, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BuildNDRange", spv::Op::OpBuildNDRange, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSparseSampleImplicitLod", spv::Op::OpImageSparseSampleImplicitLod, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSparseSampleExplicitLod", spv::Op::OpImageSparseSampleExplicitLod, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSparseSampleDrefImplicitLod", spv::Op::OpImageSparseSampleDrefImplicitLod, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSparseSampleDrefExplicitLod", spv::Op::OpImageSparseSampleDrefExplicitLod, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSparseSampleProjImplicitLod", spv::Op::OpImageSparseSampleProjImplicitLod, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSparseSampleProjExplicitLod", spv::Op::OpImageSparseSampleProjExplicitLod, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSparseSampleProjDrefImplicitLod", spv::Op::OpImageSparseSampleProjDrefImplicitLod, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSparseSampleProjDrefExplicitLod", spv::Op::OpImageSparseSampleProjDrefExplicitLod, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSparseFetch", spv::Op::OpImageSparseFetch, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSparseGather", spv::Op::OpImageSparseGather, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSparseDrefGather", spv::Op::OpImageSparseDrefGather, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSparseTexelsResident", spv::Op::OpImageSparseTexelsResident, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NoLine", spv::Op::OpNoLine, 0, nullptr, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicFlagTestAndSet", spv::Op::OpAtomicFlagTestAndSet, 0, nullptr, 1, pygen_variable_caps_Kernel, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicFlagClear", spv::Op::OpAtomicFlagClear, 0, nullptr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageSparseRead", spv::Op::OpImageSparseRead, 0, nullptr, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SizeOf", spv::Op::OpSizeOf, 0, nullptr, 1, pygen_variable_caps_Addresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"TypePipeStorage", spv::Op::OpTypePipeStorage, 0, nullptr, 1, pygen_variable_caps_PipeStorage, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"ConstantPipeStorage", spv::Op::OpConstantPipeStorage, 0, nullptr, 1, pygen_variable_caps_PipeStorage, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"CreatePipeFromPipeStorage", spv::Op::OpCreatePipeFromPipeStorage, 0, nullptr, 1, pygen_variable_caps_PipeStorage, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"GetKernelLocalSizeForSubgroupCount", spv::Op::OpGetKernelLocalSizeForSubgroupCount, 0, nullptr, 1, pygen_variable_caps_SubgroupDispatch, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"GetKernelMaxNumSubgroups", spv::Op::OpGetKernelMaxNumSubgroups, 0, nullptr, 1, pygen_variable_caps_SubgroupDispatch, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"TypeNamedBarrier", spv::Op::OpTypeNamedBarrier, 0, nullptr, 1, pygen_variable_caps_NamedBarrier, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"NamedBarrierInitialize", spv::Op::OpNamedBarrierInitialize, 0, nullptr, 1, pygen_variable_caps_NamedBarrier, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"MemoryNamedBarrier", spv::Op::OpMemoryNamedBarrier, 0, nullptr, 1, pygen_variable_caps_NamedBarrier, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"ModuleProcessed", spv::Op::OpModuleProcessed, 0, nullptr, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"ExecutionModeId", spv::Op::OpExecutionModeId, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXECUTION_MODE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"DecorateId", spv::Op::OpDecorateId, 0, nullptr, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"GroupNonUniformElect", spv::Op::OpGroupNonUniformElect, 0, nullptr, 1, pygen_variable_caps_GroupNonUniform, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformAll", spv::Op::OpGroupNonUniformAll, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformAny", spv::Op::OpGroupNonUniformAny, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformAllEqual", spv::Op::OpGroupNonUniformAllEqual, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBroadcast", spv::Op::OpGroupNonUniformBroadcast, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBroadcastFirst", spv::Op::OpGroupNonUniformBroadcastFirst, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallot", spv::Op::OpGroupNonUniformBallot, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformInverseBallot", spv::Op::OpGroupNonUniformInverseBallot, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallotBitExtract", spv::Op::OpGroupNonUniformBallotBitExtract, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallotBitCount", spv::Op::OpGroupNonUniformBallotBitCount, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallotFindLSB", spv::Op::OpGroupNonUniformBallotFindLSB, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallotFindMSB", spv::Op::OpGroupNonUniformBallotFindMSB, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffle", spv::Op::OpGroupNonUniformShuffle, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformShuffle, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffleXor", spv::Op::OpGroupNonUniformShuffleXor, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformShuffle, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffleUp", spv::Op::OpGroupNonUniformShuffleUp, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformShuffleRelative, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffleDown", spv::Op::OpGroupNonUniformShuffleDown, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformShuffleRelative, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformIAdd", spv::Op::OpGroupNonUniformIAdd, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformFAdd", spv::Op::OpGroupNonUniformFAdd, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformIMul", spv::Op::OpGroupNonUniformIMul, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformFMul", spv::Op::OpGroupNonUniformFMul, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformSMin", spv::Op::OpGroupNonUniformSMin, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformUMin", spv::Op::OpGroupNonUniformUMin, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformFMin", spv::Op::OpGroupNonUniformFMin, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformSMax", spv::Op::OpGroupNonUniformSMax, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformUMax", spv::Op::OpGroupNonUniformUMax, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformFMax", spv::Op::OpGroupNonUniformFMax, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBitwiseAnd", spv::Op::OpGroupNonUniformBitwiseAnd, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBitwiseOr", spv::Op::OpGroupNonUniformBitwiseOr, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBitwiseXor", spv::Op::OpGroupNonUniformBitwiseXor, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformLogicalAnd", spv::Op::OpGroupNonUniformLogicalAnd, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformLogicalOr", spv::Op::OpGroupNonUniformLogicalOr, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformLogicalXor", spv::Op::OpGroupNonUniformLogicalXor, 0, nullptr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformQuadBroadcast", spv::Op::OpGroupNonUniformQuadBroadcast, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformQuad, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformQuadSwap", spv::Op::OpGroupNonUniformQuadSwap, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformQuad, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"CopyLogical", spv::Op::OpCopyLogical, 0, nullptr, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"PtrEqual", spv::Op::OpPtrEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"PtrNotEqual", spv::Op::OpPtrNotEqual, 0, nullptr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"PtrDiff", spv::Op::OpPtrDiff, 0, nullptr, 3, pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBuffer, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"ColorAttachmentReadEXT", spv::Op::OpColorAttachmentReadEXT, 0, nullptr, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"DepthAttachmentReadEXT", spv::Op::OpDepthAttachmentReadEXT, 0, nullptr, 1, pygen_variable_caps_TileImageDepthReadAccessEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"StencilAttachmentReadEXT", spv::Op::OpStencilAttachmentReadEXT, 0, nullptr, 1, pygen_variable_caps_TileImageStencilReadAccessEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TerminateInvocation", spv::Op::OpTerminateInvocation, 0, nullptr, 1, pygen_variable_caps_Shader, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_terminate_invocation, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"TypeUntypedPointerKHR", spv::Op::OpTypeUntypedPointerKHR, 0, nullptr, 1, pygen_variable_caps_UntypedPointersKHR, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UntypedVariableKHR", spv::Op::OpUntypedVariableKHR, 0, nullptr, 1, pygen_variable_caps_UntypedPointersKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UntypedAccessChainKHR", spv::Op::OpUntypedAccessChainKHR, 0, nullptr, 1, pygen_variable_caps_UntypedPointersKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UntypedInBoundsAccessChainKHR", spv::Op::OpUntypedInBoundsAccessChainKHR, 0, nullptr, 1, pygen_variable_caps_UntypedPointersKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupBallotKHR", spv::Op::OpSubgroupBallotKHR, 0, nullptr, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"SubgroupFirstInvocationKHR", spv::Op::OpSubgroupFirstInvocationKHR, 0, nullptr, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"UntypedPtrAccessChainKHR", spv::Op::OpUntypedPtrAccessChainKHR, 0, nullptr, 1, pygen_variable_caps_UntypedPointersKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UntypedInBoundsPtrAccessChainKHR", spv::Op::OpUntypedInBoundsPtrAccessChainKHR, 0, nullptr, 1, pygen_variable_caps_UntypedPointersKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UntypedArrayLengthKHR", spv::Op::OpUntypedArrayLengthKHR, 0, nullptr, 1, pygen_variable_caps_UntypedPointersKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UntypedPrefetchKHR", spv::Op::OpUntypedPrefetchKHR, 0, nullptr, 1, pygen_variable_caps_UntypedPointersKHR, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAllKHR", spv::Op::OpSubgroupAllKHR, 0, nullptr, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, + {"SubgroupAnyKHR", spv::Op::OpSubgroupAnyKHR, 0, nullptr, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, + {"SubgroupAllEqualKHR", spv::Op::OpSubgroupAllEqualKHR, 0, nullptr, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, + {"GroupNonUniformRotateKHR", spv::Op::OpGroupNonUniformRotateKHR, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformRotateKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupReadInvocationKHR", spv::Op::OpSubgroupReadInvocationKHR, 0, nullptr, 1, pygen_variable_caps_SubgroupBallotKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"ExtInstWithForwardRefsKHR", spv::Op::OpExtInstWithForwardRefsKHR, 0, nullptr, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_relaxed_extended_instruction, 0xffffffffu, 0xffffffffu}, + {"TraceRayKHR", spv::Op::OpTraceRayKHR, 0, nullptr, 1, pygen_variable_caps_RayTracingKHR, 11, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"ExecuteCallableKHR", spv::Op::OpExecuteCallableKHR, 0, nullptr, 1, pygen_variable_caps_RayTracingKHR, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"ConvertUToAccelerationStructureKHR", spv::Op::OpConvertUToAccelerationStructureKHR, 0, nullptr, 2, pygen_variable_caps_RayTracingKHRRayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"IgnoreIntersectionKHR", spv::Op::OpIgnoreIntersectionKHR, 0, nullptr, 1, pygen_variable_caps_RayTracingKHR, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TerminateRayKHR", spv::Op::OpTerminateRayKHR, 0, nullptr, 1, pygen_variable_caps_RayTracingKHR, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"SDot", spv::Op::OpSDot, 1, pygen_variable_aliases_OpSDotKHR, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"UDot", spv::Op::OpUDot, 1, pygen_variable_aliases_OpUDotKHR, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SUDot", spv::Op::OpSUDot, 1, pygen_variable_aliases_OpSUDotKHR, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SDotAccSat", spv::Op::OpSDotAccSat, 1, pygen_variable_aliases_OpSDotAccSatKHR, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"UDotAccSat", spv::Op::OpUDotAccSat, 1, pygen_variable_aliases_OpUDotAccSatKHR, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SUDotAccSat", spv::Op::OpSUDotAccSat, 1, pygen_variable_aliases_OpSUDotAccSatKHR, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"TypeCooperativeMatrixKHR", spv::Op::OpTypeCooperativeMatrixKHR, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixKHR, 6, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixLoadKHR", spv::Op::OpCooperativeMatrixLoadKHR, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixStoreKHR", spv::Op::OpCooperativeMatrixStoreKHR, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixKHR, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixMulAddKHR", spv::Op::OpCooperativeMatrixMulAddKHR, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixLengthKHR", spv::Op::OpCooperativeMatrixLengthKHR, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConstantCompositeReplicateEXT", spv::Op::OpConstantCompositeReplicateEXT, 0, nullptr, 1, pygen_variable_caps_ReplicatedCompositesEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SpecConstantCompositeReplicateEXT", spv::Op::OpSpecConstantCompositeReplicateEXT, 0, nullptr, 1, pygen_variable_caps_ReplicatedCompositesEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"CompositeConstructReplicateEXT", spv::Op::OpCompositeConstructReplicateEXT, 0, nullptr, 1, pygen_variable_caps_ReplicatedCompositesEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeRayQueryKHR", spv::Op::OpTypeRayQueryKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryInitializeKHR", spv::Op::OpRayQueryInitializeKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 8, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryTerminateKHR", spv::Op::OpRayQueryTerminateKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGenerateIntersectionKHR", spv::Op::OpRayQueryGenerateIntersectionKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryConfirmIntersectionKHR", spv::Op::OpRayQueryConfirmIntersectionKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryProceedKHR", spv::Op::OpRayQueryProceedKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionTypeKHR", spv::Op::OpRayQueryGetIntersectionTypeKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"ImageSampleWeightedQCOM", spv::Op::OpImageSampleWeightedQCOM, 0, nullptr, 1, pygen_variable_caps_TextureSampleWeightedQCOM, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBoxFilterQCOM", spv::Op::OpImageBoxFilterQCOM, 0, nullptr, 1, pygen_variable_caps_TextureBoxFilterQCOM, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBlockMatchSSDQCOM", spv::Op::OpImageBlockMatchSSDQCOM, 0, nullptr, 1, pygen_variable_caps_TextureBlockMatchQCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBlockMatchSADQCOM", spv::Op::OpImageBlockMatchSADQCOM, 0, nullptr, 1, pygen_variable_caps_TextureBlockMatchQCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBlockMatchWindowSSDQCOM", spv::Op::OpImageBlockMatchWindowSSDQCOM, 0, nullptr, 1, pygen_variable_caps_TextureBlockMatch2QCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBlockMatchWindowSADQCOM", spv::Op::OpImageBlockMatchWindowSADQCOM, 0, nullptr, 1, pygen_variable_caps_TextureBlockMatch2QCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBlockMatchGatherSSDQCOM", spv::Op::OpImageBlockMatchGatherSSDQCOM, 0, nullptr, 1, pygen_variable_caps_TextureBlockMatch2QCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBlockMatchGatherSADQCOM", spv::Op::OpImageBlockMatchGatherSADQCOM, 0, nullptr, 1, pygen_variable_caps_TextureBlockMatch2QCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupIAddNonUniformAMD", spv::Op::OpGroupIAddNonUniformAMD, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupFAddNonUniformAMD", spv::Op::OpGroupFAddNonUniformAMD, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupFMinNonUniformAMD", spv::Op::OpGroupFMinNonUniformAMD, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupUMinNonUniformAMD", spv::Op::OpGroupUMinNonUniformAMD, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupSMinNonUniformAMD", spv::Op::OpGroupSMinNonUniformAMD, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupFMaxNonUniformAMD", spv::Op::OpGroupFMaxNonUniformAMD, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupUMaxNonUniformAMD", spv::Op::OpGroupUMaxNonUniformAMD, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupSMaxNonUniformAMD", spv::Op::OpGroupSMaxNonUniformAMD, 0, nullptr, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"FragmentMaskFetchAMD", spv::Op::OpFragmentMaskFetchAMD, 0, nullptr, 1, pygen_variable_caps_FragmentMaskAMD, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, + {"FragmentFetchAMD", spv::Op::OpFragmentFetchAMD, 0, nullptr, 1, pygen_variable_caps_FragmentMaskAMD, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, + {"ReadClockKHR", spv::Op::OpReadClockKHR, 0, nullptr, 1, pygen_variable_caps_ShaderClockKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AllocateNodePayloadsAMDX", spv::Op::OpAllocateNodePayloadsAMDX, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"EnqueueNodePayloadsAMDX", spv::Op::OpEnqueueNodePayloadsAMDX, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeNodePayloadArrayAMDX", spv::Op::OpTypeNodePayloadArrayAMDX, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FinishWritingNodePayloadAMDX", spv::Op::OpFinishWritingNodePayloadAMDX, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"NodePayloadArrayLengthAMDX", spv::Op::OpNodePayloadArrayLengthAMDX, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"IsNodePayloadValidAMDX", spv::Op::OpIsNodePayloadValidAMDX, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConstantStringAMDX", spv::Op::OpConstantStringAMDX, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SpecConstantStringAMDX", spv::Op::OpSpecConstantStringAMDX, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupNonUniformQuadAllKHR", spv::Op::OpGroupNonUniformQuadAllKHR, 0, nullptr, 1, pygen_variable_caps_QuadControlKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupNonUniformQuadAnyKHR", spv::Op::OpGroupNonUniformQuadAnyKHR, 0, nullptr, 1, pygen_variable_caps_QuadControlKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordHitMotionNV", spv::Op::OpHitObjectRecordHitMotionNV, 0, nullptr, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 14, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordHitWithIndexMotionNV", spv::Op::OpHitObjectRecordHitWithIndexMotionNV, 0, nullptr, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordMissMotionNV", spv::Op::OpHitObjectRecordMissMotionNV, 0, nullptr, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 7, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetWorldToObjectNV", spv::Op::OpHitObjectGetWorldToObjectNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetObjectToWorldNV", spv::Op::OpHitObjectGetObjectToWorldNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetObjectRayDirectionNV", spv::Op::OpHitObjectGetObjectRayDirectionNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetObjectRayOriginNV", spv::Op::OpHitObjectGetObjectRayOriginNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectTraceRayMotionNV", spv::Op::OpHitObjectTraceRayMotionNV, 0, nullptr, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetShaderRecordBufferHandleNV", spv::Op::OpHitObjectGetShaderRecordBufferHandleNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetShaderBindingTableRecordIndexNV", spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordEmptyNV", spv::Op::OpHitObjectRecordEmptyNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectTraceRayNV", spv::Op::OpHitObjectTraceRayNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordHitNV", spv::Op::OpHitObjectRecordHitNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordHitWithIndexNV", spv::Op::OpHitObjectRecordHitWithIndexNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordMissNV", spv::Op::OpHitObjectRecordMissNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 6, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectExecuteShaderNV", spv::Op::OpHitObjectExecuteShaderNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetCurrentTimeNV", spv::Op::OpHitObjectGetCurrentTimeNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetAttributesNV", spv::Op::OpHitObjectGetAttributesNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetHitKindNV", spv::Op::OpHitObjectGetHitKindNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetPrimitiveIndexNV", spv::Op::OpHitObjectGetPrimitiveIndexNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetGeometryIndexNV", spv::Op::OpHitObjectGetGeometryIndexNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetInstanceIdNV", spv::Op::OpHitObjectGetInstanceIdNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetInstanceCustomIndexNV", spv::Op::OpHitObjectGetInstanceCustomIndexNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetWorldRayDirectionNV", spv::Op::OpHitObjectGetWorldRayDirectionNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetWorldRayOriginNV", spv::Op::OpHitObjectGetWorldRayOriginNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetRayTMaxNV", spv::Op::OpHitObjectGetRayTMaxNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetRayTMinNV", spv::Op::OpHitObjectGetRayTMinNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectIsEmptyNV", spv::Op::OpHitObjectIsEmptyNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectIsHitNV", spv::Op::OpHitObjectIsHitNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectIsMissNV", spv::Op::OpHitObjectIsMissNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ReorderThreadWithHitObjectNV", spv::Op::OpReorderThreadWithHitObjectNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ReorderThreadWithHintNV", spv::Op::OpReorderThreadWithHintNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeHitObjectNV", spv::Op::OpTypeHitObjectNV, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSampleFootprintNV", spv::Op::OpImageSampleFootprintNV, 0, nullptr, 1, pygen_variable_caps_ImageFootprintNV, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 1, pygen_variable_exts_SPV_NV_shader_image_footprint, 0xffffffffu, 0xffffffffu}, + {"EmitMeshTasksEXT", spv::Op::OpEmitMeshTasksEXT, 0, nullptr, 1, pygen_variable_caps_MeshShadingEXT, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SetMeshOutputsEXT", spv::Op::OpSetMeshOutputsEXT, 0, nullptr, 1, pygen_variable_caps_MeshShadingEXT, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupNonUniformPartitionNV", spv::Op::OpGroupNonUniformPartitionNV, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, 0xffffffffu, 0xffffffffu}, + {"WritePackedPrimitiveIndices4x8NV", spv::Op::OpWritePackedPrimitiveIndices4x8NV, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_mesh_shader, 0xffffffffu, 0xffffffffu}, + {"FetchMicroTriangleVertexPositionNV", spv::Op::OpFetchMicroTriangleVertexPositionNV, 0, nullptr, 1, pygen_variable_caps_DisplacementMicromapNV, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FetchMicroTriangleVertexBarycentricNV", spv::Op::OpFetchMicroTriangleVertexBarycentricNV, 0, nullptr, 1, pygen_variable_caps_DisplacementMicromapNV, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ReportIntersectionKHR", spv::Op::OpReportIntersectionKHR, 1, pygen_variable_aliases_OpReportIntersectionNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"IgnoreIntersectionNV", spv::Op::OpIgnoreIntersectionNV, 0, nullptr, 1, pygen_variable_caps_RayTracingNV, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TerminateRayNV", spv::Op::OpTerminateRayNV, 0, nullptr, 1, pygen_variable_caps_RayTracingNV, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TraceNV", spv::Op::OpTraceNV, 0, nullptr, 1, pygen_variable_caps_RayTracingNV, 11, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TraceMotionNV", spv::Op::OpTraceMotionNV, 0, nullptr, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, + {"TraceRayMotionNV", spv::Op::OpTraceRayMotionNV, 0, nullptr, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionTriangleVertexPositionsKHR", spv::Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryPositionFetchKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAccelerationStructureKHR", spv::Op::OpTypeAccelerationStructureKHR, 1, pygen_variable_aliases_OpTypeAccelerationStructureNV, 3, pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 3, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"ExecuteCallableNV", spv::Op::OpExecuteCallableNV, 0, nullptr, 1, pygen_variable_caps_RayTracingNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TypeCooperativeMatrixNV", spv::Op::OpTypeCooperativeMatrixNV, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixLoadNV", spv::Op::OpCooperativeMatrixLoadNV, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixStoreNV", spv::Op::OpCooperativeMatrixStoreNV, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixMulAddNV", spv::Op::OpCooperativeMatrixMulAddNV, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixLengthNV", spv::Op::OpCooperativeMatrixLengthNV, 0, nullptr, 1, pygen_variable_caps_CooperativeMatrixNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"BeginInvocationInterlockEXT", spv::Op::OpBeginInvocationInterlockEXT, 0, nullptr, 3, pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, 0xffffffffu, 0xffffffffu}, + {"EndInvocationInterlockEXT", spv::Op::OpEndInvocationInterlockEXT, 0, nullptr, 3, pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, 0xffffffffu, 0xffffffffu}, + {"DemoteToHelperInvocation", spv::Op::OpDemoteToHelperInvocation, 1, pygen_variable_aliases_OpDemoteToHelperInvocationEXT, 1, pygen_variable_caps_DemoteToHelperInvocation, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"IsHelperInvocationEXT", spv::Op::OpIsHelperInvocationEXT, 0, nullptr, 1, pygen_variable_caps_DemoteToHelperInvocation, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, 0xffffffffu, 0xffffffffu}, + {"ConvertUToImageNV", spv::Op::OpConvertUToImageNV, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertUToSamplerNV", spv::Op::OpConvertUToSamplerNV, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertImageToUNV", spv::Op::OpConvertImageToUNV, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertSamplerToUNV", spv::Op::OpConvertSamplerToUNV, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertUToSampledImageNV", spv::Op::OpConvertUToSampledImageNV, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertSampledImageToUNV", spv::Op::OpConvertSampledImageToUNV, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SamplerImageAddressingModeNV", spv::Op::OpSamplerImageAddressingModeNV, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 1, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"RawAccessChainNV", spv::Op::OpRawAccessChainNV, 0, nullptr, 1, pygen_variable_caps_RawAccessChainsNV, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupShuffleINTEL", spv::Op::OpSubgroupShuffleINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupShuffleINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupShuffleDownINTEL", spv::Op::OpSubgroupShuffleDownINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupShuffleINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupShuffleUpINTEL", spv::Op::OpSubgroupShuffleUpINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupShuffleINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupShuffleXorINTEL", spv::Op::OpSubgroupShuffleXorINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupShuffleINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupBlockReadINTEL", spv::Op::OpSubgroupBlockReadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupBufferBlockIOINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupBlockWriteINTEL", spv::Op::OpSubgroupBlockWriteINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupBufferBlockIOINTEL, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageBlockReadINTEL", spv::Op::OpSubgroupImageBlockReadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupImageBlockIOINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageBlockWriteINTEL", spv::Op::OpSubgroupImageBlockWriteINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupImageBlockIOINTEL, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageMediaBlockReadINTEL", spv::Op::OpSubgroupImageMediaBlockReadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupImageMediaBlockIOINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageMediaBlockWriteINTEL", spv::Op::OpSubgroupImageMediaBlockWriteINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupImageMediaBlockIOINTEL, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UCountLeadingZerosINTEL", spv::Op::OpUCountLeadingZerosINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UCountTrailingZerosINTEL", spv::Op::OpUCountTrailingZerosINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AbsISubINTEL", spv::Op::OpAbsISubINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AbsUSubINTEL", spv::Op::OpAbsUSubINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"IAddSatINTEL", spv::Op::OpIAddSatINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UAddSatINTEL", spv::Op::OpUAddSatINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"IAverageINTEL", spv::Op::OpIAverageINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UAverageINTEL", spv::Op::OpUAverageINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"IAverageRoundedINTEL", spv::Op::OpIAverageRoundedINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UAverageRoundedINTEL", spv::Op::OpUAverageRoundedINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ISubSatINTEL", spv::Op::OpISubSatINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"USubSatINTEL", spv::Op::OpUSubSatINTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"IMul32x16INTEL", spv::Op::OpIMul32x16INTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UMul32x16INTEL", spv::Op::OpUMul32x16INTEL, 0, nullptr, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConstantFunctionPointerINTEL", spv::Op::OpConstantFunctionPointerINTEL, 0, nullptr, 1, pygen_variable_caps_FunctionPointersINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_function_pointers, 0xffffffffu, 0xffffffffu}, + {"FunctionPointerCallINTEL", spv::Op::OpFunctionPointerCallINTEL, 0, nullptr, 1, pygen_variable_caps_FunctionPointersINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_function_pointers, 0xffffffffu, 0xffffffffu}, + {"AsmTargetINTEL", spv::Op::OpAsmTargetINTEL, 0, nullptr, 1, pygen_variable_caps_AsmINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AsmINTEL", spv::Op::OpAsmINTEL, 0, nullptr, 1, pygen_variable_caps_AsmINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AsmCallINTEL", spv::Op::OpAsmCallINTEL, 0, nullptr, 1, pygen_variable_caps_AsmINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AtomicFMinEXT", spv::Op::OpAtomicFMinEXT, 0, nullptr, 4, pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXTAtomicFloat16VectorNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AtomicFMaxEXT", spv::Op::OpAtomicFMaxEXT, 0, nullptr, 4, pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXTAtomicFloat16VectorNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AssumeTrueKHR", spv::Op::OpAssumeTrueKHR, 0, nullptr, 1, pygen_variable_caps_ExpectAssumeKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_expect_assume, 0xffffffffu, 0xffffffffu}, + {"ExpectKHR", spv::Op::OpExpectKHR, 0, nullptr, 1, pygen_variable_caps_ExpectAssumeKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_expect_assume, 0xffffffffu, 0xffffffffu}, + {"DecorateString", spv::Op::OpDecorateString, 1, pygen_variable_aliases_OpDecorateStringGOOGLE, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"MemberDecorateString", spv::Op::OpMemberDecorateString, 1, pygen_variable_aliases_OpMemberDecorateStringGOOGLE, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"VmeImageINTEL", spv::Op::OpVmeImageINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeVmeImageINTEL", spv::Op::OpTypeVmeImageINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImePayloadINTEL", spv::Op::OpTypeAvcImePayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcRefPayloadINTEL", spv::Op::OpTypeAvcRefPayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcSicPayloadINTEL", spv::Op::OpTypeAvcSicPayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcMcePayloadINTEL", spv::Op::OpTypeAvcMcePayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcMceResultINTEL", spv::Op::OpTypeAvcMceResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeResultINTEL", spv::Op::OpTypeAvcImeResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeResultSingleReferenceStreamoutINTEL", spv::Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeResultDualReferenceStreamoutINTEL", spv::Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeSingleReferenceStreaminINTEL", spv::Op::OpTypeAvcImeSingleReferenceStreaminINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeDualReferenceStreaminINTEL", spv::Op::OpTypeAvcImeDualReferenceStreaminINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcRefResultINTEL", spv::Op::OpTypeAvcRefResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcSicResultINTEL", spv::Op::OpTypeAvcSicResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL", spv::Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultInterShapePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetInterShapePenaltyINTEL", spv::Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetInterDirectionPenaltyINTEL", spv::Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetMotionVectorCostFunctionINTEL", spv::Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetAcOnlyHaarINTEL", spv::Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL", spv::Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL", spv::Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL", spv::Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToImePayloadINTEL", spv::Op::OpSubgroupAvcMceConvertToImePayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToImeResultINTEL", spv::Op::OpSubgroupAvcMceConvertToImeResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToRefPayloadINTEL", spv::Op::OpSubgroupAvcMceConvertToRefPayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToRefResultINTEL", spv::Op::OpSubgroupAvcMceConvertToRefResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToSicPayloadINTEL", spv::Op::OpSubgroupAvcMceConvertToSicPayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToSicResultINTEL", spv::Op::OpSubgroupAvcMceConvertToSicResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetMotionVectorsINTEL", spv::Op::OpSubgroupAvcMceGetMotionVectorsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterDistortionsINTEL", spv::Op::OpSubgroupAvcMceGetInterDistortionsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetBestInterDistortionsINTEL", spv::Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterMajorShapeINTEL", spv::Op::OpSubgroupAvcMceGetInterMajorShapeINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterMinorShapeINTEL", spv::Op::OpSubgroupAvcMceGetInterMinorShapeINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterDirectionsINTEL", spv::Op::OpSubgroupAvcMceGetInterDirectionsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterMotionVectorCountINTEL", spv::Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterReferenceIdsINTEL", spv::Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL", spv::Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeInitializeINTEL", spv::Op::OpSubgroupAvcImeInitializeINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetSingleReferenceINTEL", spv::Op::OpSubgroupAvcImeSetSingleReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetDualReferenceINTEL", spv::Op::OpSubgroupAvcImeSetDualReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeRefWindowSizeINTEL", spv::Op::OpSubgroupAvcImeRefWindowSizeINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeAdjustRefOffsetINTEL", spv::Op::OpSubgroupAvcImeAdjustRefOffsetINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeConvertToMcePayloadINTEL", spv::Op::OpSubgroupAvcImeConvertToMcePayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetMaxMotionVectorCountINTEL", spv::Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetUnidirectionalMixDisableINTEL", spv::Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetEarlySearchTerminationThresholdINTEL", spv::Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetWeightedSadINTEL", spv::Op::OpSubgroupAvcImeSetWeightedSadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithSingleReferenceINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithDualReferenceINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeConvertToMceResultINTEL", spv::Op::OpSubgroupAvcImeConvertToMceResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetSingleReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetDualReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeStripSingleReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeStripDualReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetBorderReachedINTEL", spv::Op::OpSubgroupAvcImeGetBorderReachedINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetTruncatedSearchIndicationINTEL", spv::Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL", spv::Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL", spv::Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL", spv::Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcFmeInitializeINTEL", spv::Op::OpSubgroupAvcFmeInitializeINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcBmeInitializeINTEL", spv::Op::OpSubgroupAvcBmeInitializeINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefConvertToMcePayloadINTEL", spv::Op::OpSubgroupAvcRefConvertToMcePayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefSetBidirectionalMixDisableINTEL", spv::Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefSetBilinearFilterEnableINTEL", spv::Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefEvaluateWithSingleReferenceINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefEvaluateWithDualReferenceINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefEvaluateWithMultiReferenceINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefConvertToMceResultINTEL", spv::Op::OpSubgroupAvcRefConvertToMceResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicInitializeINTEL", spv::Op::OpSubgroupAvcSicInitializeINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConfigureSkcINTEL", spv::Op::OpSubgroupAvcSicConfigureSkcINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConfigureIpeLumaINTEL", spv::Op::OpSubgroupAvcSicConfigureIpeLumaINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConfigureIpeLumaChromaINTEL", spv::Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 13, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetMotionVectorMaskINTEL", spv::Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConvertToMcePayloadINTEL", spv::Op::OpSubgroupAvcSicConvertToMcePayloadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetIntraLumaShapePenaltyINTEL", spv::Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetIntraLumaModeCostFunctionINTEL", spv::Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetIntraChromaModeCostFunctionINTEL", spv::Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetBilinearFilterEnableINTEL", spv::Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetSkcForwardTransformEnableINTEL", spv::Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetBlockBasedRawSkipSadINTEL", spv::Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateIpeINTEL", spv::Op::OpSubgroupAvcSicEvaluateIpeINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateWithSingleReferenceINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateWithDualReferenceINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateWithMultiReferenceINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConvertToMceResultINTEL", spv::Op::OpSubgroupAvcSicConvertToMceResultINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetIpeLumaShapeINTEL", spv::Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetBestIpeLumaDistortionINTEL", spv::Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetBestIpeChromaDistortionINTEL", spv::Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetPackedIpeLumaModesINTEL", spv::Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetIpeChromaModeINTEL", spv::Op::OpSubgroupAvcSicGetIpeChromaModeINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL", spv::Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL", spv::Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL, 0, nullptr, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetInterRawSadsINTEL", spv::Op::OpSubgroupAvcSicGetInterRawSadsINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"VariableLengthArrayINTEL", spv::Op::OpVariableLengthArrayINTEL, 0, nullptr, 1, pygen_variable_caps_VariableLengthArrayINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SaveMemoryINTEL", spv::Op::OpSaveMemoryINTEL, 0, nullptr, 1, pygen_variable_caps_VariableLengthArrayINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"RestoreMemoryINTEL", spv::Op::OpRestoreMemoryINTEL, 0, nullptr, 1, pygen_variable_caps_VariableLengthArrayINTEL, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSinCosPiINTEL", spv::Op::OpArbitraryFloatSinCosPiINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCastINTEL", spv::Op::OpArbitraryFloatCastINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCastFromIntINTEL", spv::Op::OpArbitraryFloatCastFromIntINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCastToIntINTEL", spv::Op::OpArbitraryFloatCastToIntINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatAddINTEL", spv::Op::OpArbitraryFloatAddINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSubINTEL", spv::Op::OpArbitraryFloatSubINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatMulINTEL", spv::Op::OpArbitraryFloatMulINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatDivINTEL", spv::Op::OpArbitraryFloatDivINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatGTINTEL", spv::Op::OpArbitraryFloatGTINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatGEINTEL", spv::Op::OpArbitraryFloatGEINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLTINTEL", spv::Op::OpArbitraryFloatLTINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLEINTEL", spv::Op::OpArbitraryFloatLEINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatEQINTEL", spv::Op::OpArbitraryFloatEQINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatRecipINTEL", spv::Op::OpArbitraryFloatRecipINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatRSqrtINTEL", spv::Op::OpArbitraryFloatRSqrtINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCbrtINTEL", spv::Op::OpArbitraryFloatCbrtINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatHypotINTEL", spv::Op::OpArbitraryFloatHypotINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSqrtINTEL", spv::Op::OpArbitraryFloatSqrtINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLogINTEL", spv::Op::OpArbitraryFloatLogINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLog2INTEL", spv::Op::OpArbitraryFloatLog2INTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLog10INTEL", spv::Op::OpArbitraryFloatLog10INTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLog1pINTEL", spv::Op::OpArbitraryFloatLog1pINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatExpINTEL", spv::Op::OpArbitraryFloatExpINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatExp2INTEL", spv::Op::OpArbitraryFloatExp2INTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatExp10INTEL", spv::Op::OpArbitraryFloatExp10INTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatExpm1INTEL", spv::Op::OpArbitraryFloatExpm1INTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSinINTEL", spv::Op::OpArbitraryFloatSinINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCosINTEL", spv::Op::OpArbitraryFloatCosINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSinCosINTEL", spv::Op::OpArbitraryFloatSinCosINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSinPiINTEL", spv::Op::OpArbitraryFloatSinPiINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCosPiINTEL", spv::Op::OpArbitraryFloatCosPiINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatASinINTEL", spv::Op::OpArbitraryFloatASinINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatASinPiINTEL", spv::Op::OpArbitraryFloatASinPiINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatACosINTEL", spv::Op::OpArbitraryFloatACosINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatACosPiINTEL", spv::Op::OpArbitraryFloatACosPiINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatATanINTEL", spv::Op::OpArbitraryFloatATanINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatATanPiINTEL", spv::Op::OpArbitraryFloatATanPiINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatATan2INTEL", spv::Op::OpArbitraryFloatATan2INTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatPowINTEL", spv::Op::OpArbitraryFloatPowINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatPowRINTEL", spv::Op::OpArbitraryFloatPowRINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatPowNINTEL", spv::Op::OpArbitraryFloatPowNINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"LoopControlINTEL", spv::Op::OpLoopControlINTEL, 0, nullptr, 1, pygen_variable_caps_UnstructuredLoopControlsINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 0, 0, 1, pygen_variable_exts_SPV_INTEL_unstructured_loop_controls, 0xffffffffu, 0xffffffffu}, + {"AliasDomainDeclINTEL", spv::Op::OpAliasDomainDeclINTEL, 0, nullptr, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, + {"AliasScopeDeclINTEL", spv::Op::OpAliasScopeDeclINTEL, 0, nullptr, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, + {"AliasScopeListDeclINTEL", spv::Op::OpAliasScopeListDeclINTEL, 0, nullptr, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, + {"FixedSqrtINTEL", spv::Op::OpFixedSqrtINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedRecipINTEL", spv::Op::OpFixedRecipINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedRsqrtINTEL", spv::Op::OpFixedRsqrtINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedSinINTEL", spv::Op::OpFixedSinINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedCosINTEL", spv::Op::OpFixedCosINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedSinCosINTEL", spv::Op::OpFixedSinCosINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedSinPiINTEL", spv::Op::OpFixedSinPiINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedCosPiINTEL", spv::Op::OpFixedCosPiINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedSinCosPiINTEL", spv::Op::OpFixedSinCosPiINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedLogINTEL", spv::Op::OpFixedLogINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedExpINTEL", spv::Op::OpFixedExpINTEL, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"PtrCastToCrossWorkgroupINTEL", spv::Op::OpPtrCastToCrossWorkgroupINTEL, 0, nullptr, 1, pygen_variable_caps_USMStorageClassesINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"CrossWorkgroupCastToPtrINTEL", spv::Op::OpCrossWorkgroupCastToPtrINTEL, 0, nullptr, 1, pygen_variable_caps_USMStorageClassesINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ReadPipeBlockingINTEL", spv::Op::OpReadPipeBlockingINTEL, 0, nullptr, 1, pygen_variable_caps_BlockingPipesINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, 0xffffffffu, 0xffffffffu}, + {"WritePipeBlockingINTEL", spv::Op::OpWritePipeBlockingINTEL, 0, nullptr, 1, pygen_variable_caps_BlockingPipesINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, 0xffffffffu, 0xffffffffu}, + {"FPGARegINTEL", spv::Op::OpFPGARegINTEL, 0, nullptr, 1, pygen_variable_caps_FPGARegINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_fpga_reg, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetRayTMinKHR", spv::Op::OpRayQueryGetRayTMinKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetRayFlagsKHR", spv::Op::OpRayQueryGetRayFlagsKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionTKHR", spv::Op::OpRayQueryGetIntersectionTKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionInstanceCustomIndexKHR", spv::Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionInstanceIdKHR", spv::Op::OpRayQueryGetIntersectionInstanceIdKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR", spv::Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionGeometryIndexKHR", spv::Op::OpRayQueryGetIntersectionGeometryIndexKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionPrimitiveIndexKHR", spv::Op::OpRayQueryGetIntersectionPrimitiveIndexKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionBarycentricsKHR", spv::Op::OpRayQueryGetIntersectionBarycentricsKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionFrontFaceKHR", spv::Op::OpRayQueryGetIntersectionFrontFaceKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionCandidateAABBOpaqueKHR", spv::Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionObjectRayDirectionKHR", spv::Op::OpRayQueryGetIntersectionObjectRayDirectionKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionObjectRayOriginKHR", spv::Op::OpRayQueryGetIntersectionObjectRayOriginKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetWorldRayDirectionKHR", spv::Op::OpRayQueryGetWorldRayDirectionKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetWorldRayOriginKHR", spv::Op::OpRayQueryGetWorldRayOriginKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionObjectToWorldKHR", spv::Op::OpRayQueryGetIntersectionObjectToWorldKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionWorldToObjectKHR", spv::Op::OpRayQueryGetIntersectionWorldToObjectKHR, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"AtomicFAddEXT", spv::Op::OpAtomicFAddEXT, 0, nullptr, 4, pygen_variable_caps_AtomicFloat16AddEXTAtomicFloat32AddEXTAtomicFloat64AddEXTAtomicFloat16VectorNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, 0xffffffffu, 0xffffffffu}, + {"TypeBufferSurfaceINTEL", spv::Op::OpTypeBufferSurfaceINTEL, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeStructContinuedINTEL", spv::Op::OpTypeStructContinuedINTEL, 0, nullptr, 1, pygen_variable_caps_LongCompositesINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConstantCompositeContinuedINTEL", spv::Op::OpConstantCompositeContinuedINTEL, 0, nullptr, 1, pygen_variable_caps_LongCompositesINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SpecConstantCompositeContinuedINTEL", spv::Op::OpSpecConstantCompositeContinuedINTEL, 0, nullptr, 1, pygen_variable_caps_LongCompositesINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"CompositeConstructContinuedINTEL", spv::Op::OpCompositeConstructContinuedINTEL, 0, nullptr, 1, pygen_variable_caps_LongCompositesINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertFToBF16INTEL", spv::Op::OpConvertFToBF16INTEL, 0, nullptr, 1, pygen_variable_caps_BFloat16ConversionINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertBF16ToFINTEL", spv::Op::OpConvertBF16ToFINTEL, 0, nullptr, 1, pygen_variable_caps_BFloat16ConversionINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ControlBarrierArriveINTEL", spv::Op::OpControlBarrierArriveINTEL, 0, nullptr, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ControlBarrierWaitINTEL", spv::Op::OpControlBarrierWaitINTEL, 0, nullptr, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArithmeticFenceEXT", spv::Op::OpArithmeticFenceEXT, 0, nullptr, 1, pygen_variable_caps_ArithmeticFenceEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupBlockPrefetchINTEL", spv::Op::OpSubgroupBlockPrefetchINTEL, 0, nullptr, 1, pygen_variable_caps_SubgroupBufferPrefetchINTEL, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupIMulKHR", spv::Op::OpGroupIMulKHR, 0, nullptr, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupFMulKHR", spv::Op::OpGroupFMulKHR, 0, nullptr, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupBitwiseAndKHR", spv::Op::OpGroupBitwiseAndKHR, 0, nullptr, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupBitwiseOrKHR", spv::Op::OpGroupBitwiseOrKHR, 0, nullptr, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupBitwiseXorKHR", spv::Op::OpGroupBitwiseXorKHR, 0, nullptr, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupLogicalAndKHR", spv::Op::OpGroupLogicalAndKHR, 0, nullptr, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupLogicalOrKHR", spv::Op::OpGroupLogicalOrKHR, 0, nullptr, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupLogicalXorKHR", spv::Op::OpGroupLogicalXorKHR, 0, nullptr, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"MaskedGatherINTEL", spv::Op::OpMaskedGatherINTEL, 0, nullptr, 1, pygen_variable_caps_MaskedGatherScatterINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"MaskedScatterINTEL", spv::Op::OpMaskedScatterINTEL, 0, nullptr, 1, pygen_variable_caps_MaskedGatherScatterINTEL, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu} }; \ No newline at end of file diff --git a/bgfx/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc b/bgfx/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc index 0515002a..720f6a5e 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc +++ b/bgfx/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc @@ -24,8 +24,12 @@ const char* ExtensionToString(Extension extension) { return "SPV_AMD_shader_trinary_minmax"; case Extension::kSPV_AMD_texture_gather_bias_lod: return "SPV_AMD_texture_gather_bias_lod"; + case Extension::kSPV_ARM_cooperative_matrix_layouts: + return "SPV_ARM_cooperative_matrix_layouts"; case Extension::kSPV_ARM_core_builtins: return "SPV_ARM_core_builtins"; + case Extension::kSPV_EXT_arithmetic_fence: + return "SPV_EXT_arithmetic_fence"; case Extension::kSPV_EXT_demote_to_helper_invocation: return "SPV_EXT_demote_to_helper_invocation"; case Extension::kSPV_EXT_descriptor_indexing: @@ -40,8 +44,14 @@ const char* ExtensionToString(Extension extension) { return "SPV_EXT_mesh_shader"; case Extension::kSPV_EXT_opacity_micromap: return "SPV_EXT_opacity_micromap"; + case Extension::kSPV_EXT_optnone: + return "SPV_EXT_optnone"; case Extension::kSPV_EXT_physical_storage_buffer: return "SPV_EXT_physical_storage_buffer"; + case Extension::kSPV_EXT_relaxed_printf_string_address_space: + return "SPV_EXT_relaxed_printf_string_address_space"; + case Extension::kSPV_EXT_replicated_composites: + return "SPV_EXT_replicated_composites"; case Extension::kSPV_EXT_shader_atomic_float16_add: return "SPV_EXT_shader_atomic_float16_add"; case Extension::kSPV_EXT_shader_atomic_float_add: @@ -72,6 +82,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_INTEL_bfloat16_conversion"; case Extension::kSPV_INTEL_blocking_pipes: return "SPV_INTEL_blocking_pipes"; + case Extension::kSPV_INTEL_cache_controls: + return "SPV_INTEL_cache_controls"; case Extension::kSPV_INTEL_debug_module: return "SPV_INTEL_debug_module"; case Extension::kSPV_INTEL_device_side_avc_motion_estimation: @@ -114,10 +126,14 @@ const char* ExtensionToString(Extension extension) { return "SPV_INTEL_io_pipes"; case Extension::kSPV_INTEL_kernel_attributes: return "SPV_INTEL_kernel_attributes"; - case Extension::kSPV_INTEL_long_constant_composite: - return "SPV_INTEL_long_constant_composite"; + case Extension::kSPV_INTEL_long_composites: + return "SPV_INTEL_long_composites"; case Extension::kSPV_INTEL_loop_fuse: return "SPV_INTEL_loop_fuse"; + case Extension::kSPV_INTEL_masked_gather_scatter: + return "SPV_INTEL_masked_gather_scatter"; + case Extension::kSPV_INTEL_maximum_registers: + return "SPV_INTEL_maximum_registers"; case Extension::kSPV_INTEL_media_block_io: return "SPV_INTEL_media_block_io"; case Extension::kSPV_INTEL_memory_access_aliasing: @@ -130,6 +146,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_INTEL_shader_integer_functions2"; case Extension::kSPV_INTEL_split_barrier: return "SPV_INTEL_split_barrier"; + case Extension::kSPV_INTEL_subgroup_buffer_prefetch: + return "SPV_INTEL_subgroup_buffer_prefetch"; case Extension::kSPV_INTEL_subgroups: return "SPV_INTEL_subgroups"; case Extension::kSPV_INTEL_unstructured_loop_controls: @@ -146,6 +164,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_KHR_8bit_storage"; case Extension::kSPV_KHR_bit_instructions: return "SPV_KHR_bit_instructions"; + case Extension::kSPV_KHR_compute_shader_derivatives: + return "SPV_KHR_compute_shader_derivatives"; case Extension::kSPV_KHR_cooperative_matrix: return "SPV_KHR_cooperative_matrix"; case Extension::kSPV_KHR_device_group: @@ -154,6 +174,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_KHR_expect_assume"; case Extension::kSPV_KHR_float_controls: return "SPV_KHR_float_controls"; + case Extension::kSPV_KHR_float_controls2: + return "SPV_KHR_float_controls2"; case Extension::kSPV_KHR_fragment_shader_barycentric: return "SPV_KHR_fragment_shader_barycentric"; case Extension::kSPV_KHR_fragment_shading_rate: @@ -162,6 +184,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_KHR_integer_dot_product"; case Extension::kSPV_KHR_linkonce_odr: return "SPV_KHR_linkonce_odr"; + case Extension::kSPV_KHR_maximal_reconvergence: + return "SPV_KHR_maximal_reconvergence"; case Extension::kSPV_KHR_multiview: return "SPV_KHR_multiview"; case Extension::kSPV_KHR_no_integer_wrap_decoration: @@ -172,6 +196,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_KHR_physical_storage_buffer"; case Extension::kSPV_KHR_post_depth_coverage: return "SPV_KHR_post_depth_coverage"; + case Extension::kSPV_KHR_quad_control: + return "SPV_KHR_quad_control"; case Extension::kSPV_KHR_ray_cull_mask: return "SPV_KHR_ray_cull_mask"; case Extension::kSPV_KHR_ray_query: @@ -180,6 +206,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_KHR_ray_tracing"; case Extension::kSPV_KHR_ray_tracing_position_fetch: return "SPV_KHR_ray_tracing_position_fetch"; + case Extension::kSPV_KHR_relaxed_extended_instruction: + return "SPV_KHR_relaxed_extended_instruction"; case Extension::kSPV_KHR_shader_atomic_counter_ops: return "SPV_KHR_shader_atomic_counter_ops"; case Extension::kSPV_KHR_shader_ballot: @@ -200,6 +228,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_KHR_terminate_invocation"; case Extension::kSPV_KHR_uniform_group_instructions: return "SPV_KHR_uniform_group_instructions"; + case Extension::kSPV_KHR_untyped_pointers: + return "SPV_KHR_untyped_pointers"; case Extension::kSPV_KHR_variable_pointers: return "SPV_KHR_variable_pointers"; case Extension::kSPV_KHR_vulkan_memory_model: @@ -214,18 +244,24 @@ const char* ExtensionToString(Extension extension) { return "SPV_NV_compute_shader_derivatives"; case Extension::kSPV_NV_cooperative_matrix: return "SPV_NV_cooperative_matrix"; + case Extension::kSPV_NV_displacement_micromap: + return "SPV_NV_displacement_micromap"; case Extension::kSPV_NV_fragment_shader_barycentric: return "SPV_NV_fragment_shader_barycentric"; case Extension::kSPV_NV_geometry_shader_passthrough: return "SPV_NV_geometry_shader_passthrough"; case Extension::kSPV_NV_mesh_shader: return "SPV_NV_mesh_shader"; + case Extension::kSPV_NV_raw_access_chains: + return "SPV_NV_raw_access_chains"; case Extension::kSPV_NV_ray_tracing: return "SPV_NV_ray_tracing"; case Extension::kSPV_NV_ray_tracing_motion_blur: return "SPV_NV_ray_tracing_motion_blur"; case Extension::kSPV_NV_sample_mask_override_coverage: return "SPV_NV_sample_mask_override_coverage"; + case Extension::kSPV_NV_shader_atomic_fp16_vector: + return "SPV_NV_shader_atomic_fp16_vector"; case Extension::kSPV_NV_shader_image_footprint: return "SPV_NV_shader_image_footprint"; case Extension::kSPV_NV_shader_invocation_reorder: @@ -242,6 +278,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_NV_viewport_array2"; case Extension::kSPV_QCOM_image_processing: return "SPV_QCOM_image_processing"; + case Extension::kSPV_QCOM_image_processing2: + return "SPV_QCOM_image_processing2"; case Extension::kSPV_VALIDATOR_ignore_type_decl_unique: return "SPV_VALIDATOR_ignore_type_decl_unique"; } @@ -251,8 +289,8 @@ const char* ExtensionToString(Extension extension) { bool GetExtensionFromString(const char* str, Extension* extension) { - static const char* known_ext_strs[] = { "SPV_AMDX_shader_enqueue", "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_core_builtins", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_physical_storage_buffer", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_tile_image", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_bfloat16_conversion", "SPV_INTEL_blocking_pipes", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fp_max_error", "SPV_INTEL_fpga_argument_interfaces", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_dsp_control", "SPV_INTEL_fpga_invocation_pipelining_attributes", "SPV_INTEL_fpga_latency_control", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_global_variable_fpga_decorations", "SPV_INTEL_global_variable_host_access", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_constant_composite", "SPV_INTEL_loop_fuse", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_runtime_aligned", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_cooperative_matrix", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_ray_tracing_position_fetch", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_image_footprint", "SPV_NV_shader_invocation_reorder", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_QCOM_image_processing", "SPV_VALIDATOR_ignore_type_decl_unique" }; - static const Extension known_ext_ids[] = { Extension::kSPV_AMDX_shader_enqueue, Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_tile_image, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_bfloat16_conversion, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fp_max_error, Extension::kSPV_INTEL_fpga_argument_interfaces, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_dsp_control, Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes, Extension::kSPV_INTEL_fpga_latency_control, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_global_variable_fpga_decorations, Extension::kSPV_INTEL_global_variable_host_access, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_constant_composite, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_runtime_aligned, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_cooperative_matrix, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_ray_tracing_position_fetch, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_invocation_reorder, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_QCOM_image_processing, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; + static const char* known_ext_strs[] = { "SPV_AMDX_shader_enqueue", "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_cooperative_matrix_layouts", "SPV_ARM_core_builtins", "SPV_EXT_arithmetic_fence", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_optnone", "SPV_EXT_physical_storage_buffer", "SPV_EXT_relaxed_printf_string_address_space", "SPV_EXT_replicated_composites", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_tile_image", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_bfloat16_conversion", "SPV_INTEL_blocking_pipes", "SPV_INTEL_cache_controls", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fp_max_error", "SPV_INTEL_fpga_argument_interfaces", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_dsp_control", "SPV_INTEL_fpga_invocation_pipelining_attributes", "SPV_INTEL_fpga_latency_control", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_global_variable_fpga_decorations", "SPV_INTEL_global_variable_host_access", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_composites", "SPV_INTEL_loop_fuse", "SPV_INTEL_masked_gather_scatter", "SPV_INTEL_maximum_registers", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_runtime_aligned", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroup_buffer_prefetch", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_compute_shader_derivatives", "SPV_KHR_cooperative_matrix", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_float_controls2", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_maximal_reconvergence", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_quad_control", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_ray_tracing_position_fetch", "SPV_KHR_relaxed_extended_instruction", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_untyped_pointers", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_displacement_micromap", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_raw_access_chains", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_atomic_fp16_vector", "SPV_NV_shader_image_footprint", "SPV_NV_shader_invocation_reorder", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_QCOM_image_processing", "SPV_QCOM_image_processing2", "SPV_VALIDATOR_ignore_type_decl_unique" }; + static const Extension known_ext_ids[] = { Extension::kSPV_AMDX_shader_enqueue, Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_cooperative_matrix_layouts, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_arithmetic_fence, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_optnone, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_relaxed_printf_string_address_space, Extension::kSPV_EXT_replicated_composites, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_tile_image, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_bfloat16_conversion, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_cache_controls, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fp_max_error, Extension::kSPV_INTEL_fpga_argument_interfaces, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_dsp_control, Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes, Extension::kSPV_INTEL_fpga_latency_control, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_global_variable_fpga_decorations, Extension::kSPV_INTEL_global_variable_host_access, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_composites, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_masked_gather_scatter, Extension::kSPV_INTEL_maximum_registers, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_runtime_aligned, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroup_buffer_prefetch, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_compute_shader_derivatives, Extension::kSPV_KHR_cooperative_matrix, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_float_controls2, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_maximal_reconvergence, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_quad_control, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_ray_tracing_position_fetch, Extension::kSPV_KHR_relaxed_extended_instruction, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_untyped_pointers, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_displacement_micromap, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_raw_access_chains, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_atomic_fp16_vector, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_invocation_reorder, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_QCOM_image_processing, Extension::kSPV_QCOM_image_processing2, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; const auto b = std::begin(known_ext_strs); const auto e = std::end(known_ext_strs); const auto found = std::equal_range( @@ -416,6 +454,8 @@ const char* CapabilityToString(spv::Capability capability) { return "TileImageDepthReadAccessEXT"; case spv::Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case spv::Capability::CooperativeMatrixLayoutsARM: + return "CooperativeMatrixLayoutsARM"; case spv::Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR"; case spv::Capability::SubgroupBallotKHR: @@ -470,6 +510,8 @@ const char* CapabilityToString(spv::Capability capability) { return "RayQueryProvisionalKHR"; case spv::Capability::RayQueryKHR: return "RayQueryKHR"; + case spv::Capability::UntypedPointersKHR: + return "UntypedPointersKHR"; case spv::Capability::RayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; case spv::Capability::RayTracingKHR: @@ -480,6 +522,8 @@ const char* CapabilityToString(spv::Capability capability) { return "TextureBoxFilterQCOM"; case spv::Capability::TextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case spv::Capability::TextureBlockMatch2QCOM: + return "TextureBlockMatch2QCOM"; case spv::Capability::Float16ImageAMD: return "Float16ImageAMD"; case spv::Capability::ImageGatherBiasLodAMD: @@ -496,6 +540,8 @@ const char* CapabilityToString(spv::Capability capability) { return "ShaderClockKHR"; case spv::Capability::ShaderEnqueueAMDX: return "ShaderEnqueueAMDX"; + case spv::Capability::QuadControlKHR: + return "QuadControlKHR"; case spv::Capability::SampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; case spv::Capability::GeometryShaderPassthroughNV: @@ -518,8 +564,8 @@ const char* CapabilityToString(spv::Capability capability) { return "MeshShadingEXT"; case spv::Capability::FragmentBarycentricKHR: return "FragmentBarycentricKHR"; - case spv::Capability::ComputeDerivativeGroupQuadsNV: - return "ComputeDerivativeGroupQuadsNV"; + case spv::Capability::ComputeDerivativeGroupQuadsKHR: + return "ComputeDerivativeGroupQuadsKHR"; case spv::Capability::FragmentDensityEXT: return "FragmentDensityEXT"; case spv::Capability::GroupNonUniformPartitionedNV: @@ -560,8 +606,8 @@ const char* CapabilityToString(spv::Capability capability) { return "VulkanMemoryModelDeviceScope"; case spv::Capability::PhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses"; - case spv::Capability::ComputeDerivativeGroupLinearNV: - return "ComputeDerivativeGroupLinearNV"; + case spv::Capability::ComputeDerivativeGroupLinearKHR: + return "ComputeDerivativeGroupLinearKHR"; case spv::Capability::RayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; case spv::Capability::CooperativeMatrixNV: @@ -576,6 +622,8 @@ const char* CapabilityToString(spv::Capability capability) { return "FragmentShaderPixelInterlockEXT"; case spv::Capability::DemoteToHelperInvocation: return "DemoteToHelperInvocation"; + case spv::Capability::DisplacementMicromapNV: + return "DisplacementMicromapNV"; case spv::Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; case spv::Capability::ShaderInvocationReorderNV: @@ -584,6 +632,12 @@ const char* CapabilityToString(spv::Capability capability) { return "BindlessTextureNV"; case spv::Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; + case spv::Capability::AtomicFloat16VectorNV: + return "AtomicFloat16VectorNV"; + case spv::Capability::RayTracingDisplacementMicromapNV: + return "RayTracingDisplacementMicromapNV"; + case spv::Capability::RawAccessChainsNV: + return "RawAccessChainsNV"; case spv::Capability::SubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; case spv::Capability::SubgroupBufferBlockIOINTEL: @@ -680,18 +734,22 @@ const char* CapabilityToString(spv::Capability capability) { return "RayCullMaskKHR"; case spv::Capability::CooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case spv::Capability::ReplicatedCompositesEXT: + return "ReplicatedCompositesEXT"; case spv::Capability::BitInstructions: return "BitInstructions"; case spv::Capability::GroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; + case spv::Capability::FloatControls2: + return "FloatControls2"; case spv::Capability::AtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; case spv::Capability::AtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; - case spv::Capability::LongConstantCompositeINTEL: - return "LongConstantCompositeINTEL"; - case spv::Capability::OptNoneINTEL: - return "OptNoneINTEL"; + case spv::Capability::LongCompositesINTEL: + return "LongCompositesINTEL"; + case spv::Capability::OptNoneEXT: + return "OptNoneEXT"; case spv::Capability::AtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; case spv::Capability::DebugInfoModuleINTEL: @@ -700,20 +758,32 @@ const char* CapabilityToString(spv::Capability capability) { return "BFloat16ConversionINTEL"; case spv::Capability::SplitBarrierINTEL: return "SplitBarrierINTEL"; - case spv::Capability::GlobalVariableFPGADecorationsINTEL: - return "GlobalVariableFPGADecorationsINTEL"; + case spv::Capability::ArithmeticFenceEXT: + return "ArithmeticFenceEXT"; + case spv::Capability::FPGAClusterAttributesV2INTEL: + return "FPGAClusterAttributesV2INTEL"; case spv::Capability::FPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL"; - case spv::Capability::GlobalVariableHostAccessINTEL: - return "GlobalVariableHostAccessINTEL"; case spv::Capability::FPMaxErrorINTEL: return "FPMaxErrorINTEL"; case spv::Capability::FPGALatencyControlINTEL: return "FPGALatencyControlINTEL"; case spv::Capability::FPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL"; + case spv::Capability::GlobalVariableHostAccessINTEL: + return "GlobalVariableHostAccessINTEL"; + case spv::Capability::GlobalVariableFPGADecorationsINTEL: + return "GlobalVariableFPGADecorationsINTEL"; + case spv::Capability::SubgroupBufferPrefetchINTEL: + return "SubgroupBufferPrefetchINTEL"; case spv::Capability::GroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; + case spv::Capability::MaskedGatherScatterINTEL: + return "MaskedGatherScatterINTEL"; + case spv::Capability::CacheControlsINTEL: + return "CacheControlsINTEL"; + case spv::Capability::RegisterLimitsINTEL: + return "RegisterLimitsINTEL"; case spv::Capability::Max: assert(0 && "Attempting to convert spv::Capability::Max to string"); return ""; diff --git a/bgfx/3rdparty/spirv-tools/include/generated/extension_enum.inc b/bgfx/3rdparty/spirv-tools/include/generated/extension_enum.inc index d9a83e13..8b597e05 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/extension_enum.inc +++ b/bgfx/3rdparty/spirv-tools/include/generated/extension_enum.inc @@ -10,7 +10,9 @@ kSPV_AMD_shader_fragment_mask, kSPV_AMD_shader_image_load_store_lod, kSPV_AMD_shader_trinary_minmax, kSPV_AMD_texture_gather_bias_lod, +kSPV_ARM_cooperative_matrix_layouts, kSPV_ARM_core_builtins, +kSPV_EXT_arithmetic_fence, kSPV_EXT_demote_to_helper_invocation, kSPV_EXT_descriptor_indexing, kSPV_EXT_fragment_fully_covered, @@ -18,7 +20,10 @@ kSPV_EXT_fragment_invocation_density, kSPV_EXT_fragment_shader_interlock, kSPV_EXT_mesh_shader, kSPV_EXT_opacity_micromap, +kSPV_EXT_optnone, kSPV_EXT_physical_storage_buffer, +kSPV_EXT_relaxed_printf_string_address_space, +kSPV_EXT_replicated_composites, kSPV_EXT_shader_atomic_float16_add, kSPV_EXT_shader_atomic_float_add, kSPV_EXT_shader_atomic_float_min_max, @@ -34,6 +39,7 @@ kSPV_INTEL_arbitrary_precision_floating_point, kSPV_INTEL_arbitrary_precision_integers, kSPV_INTEL_bfloat16_conversion, kSPV_INTEL_blocking_pipes, +kSPV_INTEL_cache_controls, kSPV_INTEL_debug_module, kSPV_INTEL_device_side_avc_motion_estimation, kSPV_INTEL_float_controls2, @@ -55,14 +61,17 @@ kSPV_INTEL_global_variable_host_access, kSPV_INTEL_inline_assembly, kSPV_INTEL_io_pipes, kSPV_INTEL_kernel_attributes, -kSPV_INTEL_long_constant_composite, +kSPV_INTEL_long_composites, kSPV_INTEL_loop_fuse, +kSPV_INTEL_masked_gather_scatter, +kSPV_INTEL_maximum_registers, kSPV_INTEL_media_block_io, kSPV_INTEL_memory_access_aliasing, kSPV_INTEL_optnone, kSPV_INTEL_runtime_aligned, kSPV_INTEL_shader_integer_functions2, kSPV_INTEL_split_barrier, +kSPV_INTEL_subgroup_buffer_prefetch, kSPV_INTEL_subgroups, kSPV_INTEL_unstructured_loop_controls, kSPV_INTEL_usm_storage_classes, @@ -71,23 +80,28 @@ kSPV_INTEL_vector_compute, kSPV_KHR_16bit_storage, kSPV_KHR_8bit_storage, kSPV_KHR_bit_instructions, +kSPV_KHR_compute_shader_derivatives, kSPV_KHR_cooperative_matrix, kSPV_KHR_device_group, kSPV_KHR_expect_assume, kSPV_KHR_float_controls, +kSPV_KHR_float_controls2, kSPV_KHR_fragment_shader_barycentric, kSPV_KHR_fragment_shading_rate, kSPV_KHR_integer_dot_product, kSPV_KHR_linkonce_odr, +kSPV_KHR_maximal_reconvergence, kSPV_KHR_multiview, kSPV_KHR_no_integer_wrap_decoration, kSPV_KHR_non_semantic_info, kSPV_KHR_physical_storage_buffer, kSPV_KHR_post_depth_coverage, +kSPV_KHR_quad_control, kSPV_KHR_ray_cull_mask, kSPV_KHR_ray_query, kSPV_KHR_ray_tracing, kSPV_KHR_ray_tracing_position_fetch, +kSPV_KHR_relaxed_extended_instruction, kSPV_KHR_shader_atomic_counter_ops, kSPV_KHR_shader_ballot, kSPV_KHR_shader_clock, @@ -98,6 +112,7 @@ kSPV_KHR_subgroup_uniform_control_flow, kSPV_KHR_subgroup_vote, kSPV_KHR_terminate_invocation, kSPV_KHR_uniform_group_instructions, +kSPV_KHR_untyped_pointers, kSPV_KHR_variable_pointers, kSPV_KHR_vulkan_memory_model, kSPV_KHR_workgroup_memory_explicit_layout, @@ -105,12 +120,15 @@ kSPV_NVX_multiview_per_view_attributes, kSPV_NV_bindless_texture, kSPV_NV_compute_shader_derivatives, kSPV_NV_cooperative_matrix, +kSPV_NV_displacement_micromap, kSPV_NV_fragment_shader_barycentric, kSPV_NV_geometry_shader_passthrough, kSPV_NV_mesh_shader, +kSPV_NV_raw_access_chains, kSPV_NV_ray_tracing, kSPV_NV_ray_tracing_motion_blur, kSPV_NV_sample_mask_override_coverage, +kSPV_NV_shader_atomic_fp16_vector, kSPV_NV_shader_image_footprint, kSPV_NV_shader_invocation_reorder, kSPV_NV_shader_sm_builtins, @@ -119,4 +137,5 @@ kSPV_NV_shading_rate, kSPV_NV_stereo_view_rendering, kSPV_NV_viewport_array2, kSPV_QCOM_image_processing, +kSPV_QCOM_image_processing2, kSPV_VALIDATOR_ignore_type_decl_unique \ No newline at end of file diff --git a/bgfx/3rdparty/spirv-tools/include/generated/generators.inc b/bgfx/3rdparty/spirv-tools/include/generated/generators.inc index f917145b..993e7152 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/generators.inc +++ b/bgfx/3rdparty/spirv-tools/include/generated/generators.inc @@ -20,7 +20,7 @@ {19, "Tellusim", "Clay Shader Compiler", "Tellusim Clay Shader Compiler"}, {20, "W3C WebGPU Group", "WHLSL Shader Translator", "W3C WebGPU Group WHLSL Shader Translator"}, {21, "Google", "Clspv", "Google Clspv"}, -{22, "Google", "MLIR SPIR-V Serializer", "Google MLIR SPIR-V Serializer"}, +{22, "LLVM", "MLIR SPIR-V Serializer", "LLVM MLIR SPIR-V Serializer"}, {23, "Google", "Tint Compiler", "Google Tint Compiler"}, {24, "Google", "ANGLE Shader Compiler", "Google ANGLE Shader Compiler"}, {25, "Netease Games", "Messiah Shader Compiler", "Netease Games Messiah Shader Compiler"}, @@ -37,4 +37,10 @@ {36, "Taichi Graphics", "Taichi", "Taichi Graphics Taichi"}, {37, "heroseh", "Hero C Compiler", "heroseh Hero C Compiler"}, {38, "Meta", "SparkSL", "Meta SparkSL"}, -{39, "SirLynix", "Nazara ShaderLang Compiler", "SirLynix Nazara ShaderLang Compiler"}, \ No newline at end of file +{39, "SirLynix", "Nazara ShaderLang Compiler", "SirLynix Nazara ShaderLang Compiler"}, +{40, "NVIDIA", "Slang Compiler", "NVIDIA Slang Compiler"}, +{41, "Zig Software Foundation", "Zig Compiler", "Zig Software Foundation Zig Compiler"}, +{42, "Rendong Liang", "spq", "Rendong Liang spq"}, +{43, "LLVM", "LLVM SPIR-V Backend", "LLVM LLVM SPIR-V Backend"}, +{44, "Robert Konrad", "Kongruent", "Robert Konrad Kongruent"}, +{45, "Kitsunebi Games", "Nuvk SPIR-V Emitter and DLSL compiler", "Kitsunebi Games Nuvk SPIR-V Emitter and DLSL compiler"}, \ No newline at end of file diff --git a/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc b/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc index f774297d..4ed11a6d 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc +++ b/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc @@ -40,5 +40,6 @@ static const spv_ext_inst_desc_t nonsemantic_clspvreflection_entries[] = { {"ProgramScopeVariablePointerPushConstant", 37, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, {"PrintfInfo", 38, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID, SPV_OPERAND_TYPE_NONE}}, {"PrintfBufferStorageBuffer", 39, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, - {"PrintfBufferPointerPushConstant", 40, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}} + {"PrintfBufferPointerPushConstant", 40, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"NormalizedSamplerMaskPushConstant", 41, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}} }; \ No newline at end of file diff --git a/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.vkspreflection.insts.inc b/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.vkspreflection.insts.inc new file mode 100644 index 00000000..f7cc0296 --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.vkspreflection.insts.inc @@ -0,0 +1,12 @@ + + +static const spv_ext_inst_desc_t nonsemantic_vkspreflection_entries[] = { + {"Configuration", 1, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"StartCounter", 2, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"StopCounter", 3, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"PushConstants", 4, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"SpecializationMapEntry", 5, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"DescriptorSetBuffer", 6, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"DescriptorSetImage", 7, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"DescriptorSetSampler", 8, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}} +}; \ No newline at end of file diff --git a/bgfx/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc b/bgfx/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc index 159fc32c..7a7490c5 100644 --- a/bgfx/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc +++ b/bgfx/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc @@ -1,11 +1,105 @@ +static const char* pygen_variable_aliases_AliasedPointerEXT[] = {"AliasedPointerEXT"}; +static const char* pygen_variable_aliases_AllowContractFastINTEL[] = {"AllowContractFastINTEL"}; +static const char* pygen_variable_aliases_AllowReassocINTEL[] = {"AllowReassocINTEL"}; +static const char* pygen_variable_aliases_AnyHitNV[] = {"AnyHitNV"}; +static const char* pygen_variable_aliases_BaryCoordNV[] = {"BaryCoordNV"}; +static const char* pygen_variable_aliases_BaryCoordNoPerspNV[] = {"BaryCoordNoPerspNV"}; +static const char* pygen_variable_aliases_CallableDataNV[] = {"CallableDataNV"}; +static const char* pygen_variable_aliases_CallableNV[] = {"CallableNV"}; +static const char* pygen_variable_aliases_ClosestHitNV[] = {"ClosestHitNV"}; +static const char* pygen_variable_aliases_ComputeDerivativeGroupLinearNV[] = {"ComputeDerivativeGroupLinearNV"}; +static const char* pygen_variable_aliases_ComputeDerivativeGroupQuadsNV[] = {"ComputeDerivativeGroupQuadsNV"}; +static const char* pygen_variable_aliases_DemoteToHelperInvocationEXT[] = {"DemoteToHelperInvocationEXT"}; +static const char* pygen_variable_aliases_DerivativeGroupLinearNV[] = {"DerivativeGroupLinearNV"}; +static const char* pygen_variable_aliases_DerivativeGroupQuadsNV[] = {"DerivativeGroupQuadsNV"}; +static const char* pygen_variable_aliases_DotProductInput4x8BitKHR[] = {"DotProductInput4x8BitKHR"}; +static const char* pygen_variable_aliases_DotProductInput4x8BitPackedKHR[] = {"DotProductInput4x8BitPackedKHR"}; +static const char* pygen_variable_aliases_DotProductInputAllKHR[] = {"DotProductInputAllKHR"}; +static const char* pygen_variable_aliases_DotProductKHR[] = {"DotProductKHR"}; +static const char* pygen_variable_aliases_FragmentBarycentricNV[] = {"FragmentBarycentricNV"}; +static const char* pygen_variable_aliases_FragmentSizeNV[] = {"FragmentSizeNV"}; +static const char* pygen_variable_aliases_HitAttributeNV[] = {"HitAttributeNV"}; +static const char* pygen_variable_aliases_HitKindNV[] = {"HitKindNV"}; +static const char* pygen_variable_aliases_HlslCounterBufferGOOGLE[] = {"HlslCounterBufferGOOGLE"}; +static const char* pygen_variable_aliases_HlslSemanticGOOGLE[] = {"HlslSemanticGOOGLE"}; +static const char* pygen_variable_aliases_IncomingCallableDataNV[] = {"IncomingCallableDataNV"}; +static const char* pygen_variable_aliases_IncomingRayFlagsNV[] = {"IncomingRayFlagsNV"}; +static const char* pygen_variable_aliases_IncomingRayPayloadNV[] = {"IncomingRayPayloadNV"}; +static const char* pygen_variable_aliases_InputAttachmentArrayDynamicIndexingEXT[] = {"InputAttachmentArrayDynamicIndexingEXT"}; +static const char* pygen_variable_aliases_InputAttachmentArrayNonUniformIndexingEXT[] = {"InputAttachmentArrayNonUniformIndexingEXT"}; +static const char* pygen_variable_aliases_InstanceCustomIndexNV[] = {"InstanceCustomIndexNV"}; +static const char* pygen_variable_aliases_IntersectionNV[] = {"IntersectionNV"}; +static const char* pygen_variable_aliases_InvocationsPerPixelNV[] = {"InvocationsPerPixelNV"}; +static const char* pygen_variable_aliases_LaunchIdNV[] = {"LaunchIdNV"}; +static const char* pygen_variable_aliases_LaunchSizeNV[] = {"LaunchSizeNV"}; +static const char* pygen_variable_aliases_MakeAvailableKHR[] = {"MakeAvailableKHR"}; +static const char* pygen_variable_aliases_MakePointerAvailableKHR[] = {"MakePointerAvailableKHR"}; +static const char* pygen_variable_aliases_MakePointerVisibleKHR[] = {"MakePointerVisibleKHR"}; +static const char* pygen_variable_aliases_MakeTexelAvailableKHR[] = {"MakeTexelAvailableKHR"}; +static const char* pygen_variable_aliases_MakeTexelVisibleKHR[] = {"MakeTexelVisibleKHR"}; +static const char* pygen_variable_aliases_MakeVisibleKHR[] = {"MakeVisibleKHR"}; +static const char* pygen_variable_aliases_MissNV[] = {"MissNV"}; +static const char* pygen_variable_aliases_NonPrivatePointerKHR[] = {"NonPrivatePointerKHR"}; +static const char* pygen_variable_aliases_NonPrivateTexelKHR[] = {"NonPrivateTexelKHR"}; +static const char* pygen_variable_aliases_NonUniformEXT[] = {"NonUniformEXT"}; +static const char* pygen_variable_aliases_None[] = {"None"}; +static const char* pygen_variable_aliases_ObjectRayDirectionNV[] = {"ObjectRayDirectionNV"}; +static const char* pygen_variable_aliases_ObjectRayOriginNV[] = {"ObjectRayOriginNV"}; +static const char* pygen_variable_aliases_ObjectToWorldNV[] = {"ObjectToWorldNV"}; +static const char* pygen_variable_aliases_OptNoneINTEL[] = {"OptNoneINTEL"}; +static const char* pygen_variable_aliases_OutputLinesNV[] = {"OutputLinesNV"}; +static const char* pygen_variable_aliases_OutputMemoryKHR[] = {"OutputMemoryKHR"}; +static const char* pygen_variable_aliases_OutputPrimitivesNV[] = {"OutputPrimitivesNV"}; +static const char* pygen_variable_aliases_OutputTrianglesNV[] = {"OutputTrianglesNV"}; +static const char* pygen_variable_aliases_PackedVectorFormat4x8BitKHR[] = {"PackedVectorFormat4x8BitKHR"}; +static const char* pygen_variable_aliases_PerPrimitiveNV[] = {"PerPrimitiveNV"}; +static const char* pygen_variable_aliases_PerVertexNV[] = {"PerVertexNV"}; +static const char* pygen_variable_aliases_PhysicalStorageBuffer64EXT[] = {"PhysicalStorageBuffer64EXT"}; +static const char* pygen_variable_aliases_PhysicalStorageBufferAddressesEXT[] = {"PhysicalStorageBufferAddressesEXT"}; +static const char* pygen_variable_aliases_PhysicalStorageBufferEXT[] = {"PhysicalStorageBufferEXT"}; +static const char* pygen_variable_aliases_QueueFamilyKHR[] = {"QueueFamilyKHR"}; +static const char* pygen_variable_aliases_RayGenerationNV[] = {"RayGenerationNV"}; +static const char* pygen_variable_aliases_RayPayloadNV[] = {"RayPayloadNV"}; +static const char* pygen_variable_aliases_RayTmaxNV[] = {"RayTmaxNV"}; +static const char* pygen_variable_aliases_RayTminNV[] = {"RayTminNV"}; +static const char* pygen_variable_aliases_RestrictPointerEXT[] = {"RestrictPointerEXT"}; +static const char* pygen_variable_aliases_RuntimeDescriptorArrayEXT[] = {"RuntimeDescriptorArrayEXT"}; +static const char* pygen_variable_aliases_SampledImageArrayNonUniformIndexingEXT[] = {"SampledImageArrayNonUniformIndexingEXT"}; +static const char* pygen_variable_aliases_ShaderNonUniformEXT[] = {"ShaderNonUniformEXT"}; +static const char* pygen_variable_aliases_ShaderRecordBufferNV[] = {"ShaderRecordBufferNV"}; +static const char* pygen_variable_aliases_ShaderViewportIndexLayerNV[] = {"ShaderViewportIndexLayerNV"}; +static const char* pygen_variable_aliases_ShadingRateNV[] = {"ShadingRateNV"}; +static const char* pygen_variable_aliases_StorageBufferArrayNonUniformIndexingEXT[] = {"StorageBufferArrayNonUniformIndexingEXT"}; +static const char* pygen_variable_aliases_StorageImageArrayNonUniformIndexingEXT[] = {"StorageImageArrayNonUniformIndexingEXT"}; +static const char* pygen_variable_aliases_StorageTexelBufferArrayDynamicIndexingEXT[] = {"StorageTexelBufferArrayDynamicIndexingEXT"}; +static const char* pygen_variable_aliases_StorageTexelBufferArrayNonUniformIndexingEXT[] = {"StorageTexelBufferArrayNonUniformIndexingEXT"}; +static const char* pygen_variable_aliases_StorageUniform16[] = {"StorageUniform16"}; +static const char* pygen_variable_aliases_StorageUniformBufferBlock16[] = {"StorageUniformBufferBlock16"}; +static const char* pygen_variable_aliases_SubgroupEqMaskKHR[] = {"SubgroupEqMaskKHR"}; +static const char* pygen_variable_aliases_SubgroupGeMaskKHR[] = {"SubgroupGeMaskKHR"}; +static const char* pygen_variable_aliases_SubgroupGtMaskKHR[] = {"SubgroupGtMaskKHR"}; +static const char* pygen_variable_aliases_SubgroupLeMaskKHR[] = {"SubgroupLeMaskKHR"}; +static const char* pygen_variable_aliases_SubgroupLtMaskKHR[] = {"SubgroupLtMaskKHR"}; +static const char* pygen_variable_aliases_UniformBufferArrayNonUniformIndexingEXT[] = {"UniformBufferArrayNonUniformIndexingEXT"}; +static const char* pygen_variable_aliases_UniformTexelBufferArrayDynamicIndexingEXT[] = {"UniformTexelBufferArrayDynamicIndexingEXT"}; +static const char* pygen_variable_aliases_UniformTexelBufferArrayNonUniformIndexingEXT[] = {"UniformTexelBufferArrayNonUniformIndexingEXT"}; +static const char* pygen_variable_aliases_VolatileTexelKHR[] = {"VolatileTexelKHR"}; +static const char* pygen_variable_aliases_VulkanKHR[] = {"VulkanKHR"}; +static const char* pygen_variable_aliases_VulkanMemoryModelDeviceScopeKHR[] = {"VulkanMemoryModelDeviceScopeKHR"}; +static const char* pygen_variable_aliases_VulkanMemoryModelKHR[] = {"VulkanMemoryModelKHR"}; +static const char* pygen_variable_aliases_WorldRayDirectionNV[] = {"WorldRayDirectionNV"}; +static const char* pygen_variable_aliases_WorldRayOriginNV[] = {"WorldRayOriginNV"}; +static const char* pygen_variable_aliases_WorldToObjectNV[] = {"WorldToObjectNV"}; + static const spv::Capability pygen_variable_caps_Addresses[] = {spv::Capability::Addresses}; static const spv::Capability pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL[] = {spv::Capability::ArbitraryPrecisionFixedPointINTEL}; static const spv::Capability pygen_variable_caps_AsmINTEL[] = {spv::Capability::AsmINTEL}; static const spv::Capability pygen_variable_caps_AtomicStorage[] = {spv::Capability::AtomicStorage}; static const spv::Capability pygen_variable_caps_BindlessTextureNV[] = {spv::Capability::BindlessTextureNV}; +static const spv::Capability pygen_variable_caps_CacheControlsINTEL[] = {spv::Capability::CacheControlsINTEL}; static const spv::Capability pygen_variable_caps_ClipDistance[] = {spv::Capability::ClipDistance}; -static const spv::Capability pygen_variable_caps_ComputeDerivativeGroupLinearNV[] = {spv::Capability::ComputeDerivativeGroupLinearNV}; -static const spv::Capability pygen_variable_caps_ComputeDerivativeGroupQuadsNV[] = {spv::Capability::ComputeDerivativeGroupQuadsNV}; +static const spv::Capability pygen_variable_caps_ComputeDerivativeGroupLinearNVComputeDerivativeGroupLinearKHR[] = {spv::Capability::ComputeDerivativeGroupLinearNV, spv::Capability::ComputeDerivativeGroupLinearKHR}; +static const spv::Capability pygen_variable_caps_ComputeDerivativeGroupQuadsNVComputeDerivativeGroupQuadsKHR[] = {spv::Capability::ComputeDerivativeGroupQuadsNV, spv::Capability::ComputeDerivativeGroupQuadsKHR}; static const spv::Capability pygen_variable_caps_CoreBuiltinsARM[] = {spv::Capability::CoreBuiltinsARM}; static const spv::Capability pygen_variable_caps_CullDistance[] = {spv::Capability::CullDistance}; static const spv::Capability pygen_variable_caps_DenormFlushToZero[] = {spv::Capability::DenormFlushToZero}; @@ -14,10 +108,10 @@ static const spv::Capability pygen_variable_caps_DeviceEnqueue[] = {spv::Capabil static const spv::Capability pygen_variable_caps_DeviceGroup[] = {spv::Capability::DeviceGroup}; static const spv::Capability pygen_variable_caps_DrawParameters[] = {spv::Capability::DrawParameters}; static const spv::Capability pygen_variable_caps_DrawParametersMeshShadingNVMeshShadingEXT[] = {spv::Capability::DrawParameters, spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; -static const spv::Capability pygen_variable_caps_FPFastMathModeINTEL[] = {spv::Capability::FPFastMathModeINTEL}; static const spv::Capability pygen_variable_caps_FPGAArgumentInterfacesINTEL[] = {spv::Capability::FPGAArgumentInterfacesINTEL}; static const spv::Capability pygen_variable_caps_FPGABufferLocationINTEL[] = {spv::Capability::FPGABufferLocationINTEL}; static const spv::Capability pygen_variable_caps_FPGAClusterAttributesINTEL[] = {spv::Capability::FPGAClusterAttributesINTEL}; +static const spv::Capability pygen_variable_caps_FPGAClusterAttributesV2INTEL[] = {spv::Capability::FPGAClusterAttributesV2INTEL}; static const spv::Capability pygen_variable_caps_FPGADSPControlINTEL[] = {spv::Capability::FPGADSPControlINTEL}; static const spv::Capability pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL[] = {spv::Capability::FPGAInvocationPipeliningAttributesINTEL}; static const spv::Capability pygen_variable_caps_FPGAKernelAttributesINTEL[] = {spv::Capability::FPGAKernelAttributesINTEL}; @@ -27,8 +121,10 @@ static const spv::Capability pygen_variable_caps_FPGALoopControlsINTEL[] = {spv: static const spv::Capability pygen_variable_caps_FPGAMemoryAccessesINTEL[] = {spv::Capability::FPGAMemoryAccessesINTEL}; static const spv::Capability pygen_variable_caps_FPGAMemoryAttributesINTEL[] = {spv::Capability::FPGAMemoryAttributesINTEL}; static const spv::Capability pygen_variable_caps_FPMaxErrorINTEL[] = {spv::Capability::FPMaxErrorINTEL}; -static const spv::Capability pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR[] = {spv::Capability::FragmentBarycentricNV, spv::Capability::FragmentBarycentricKHR}; -static const spv::Capability pygen_variable_caps_FragmentDensityEXTShadingRateNV[] = {spv::Capability::FragmentDensityEXT, spv::Capability::ShadingRateNV}; +static const spv::Capability pygen_variable_caps_FloatControls2[] = {spv::Capability::FloatControls2}; +static const spv::Capability pygen_variable_caps_FloatControls2FPFastMathModeINTEL[] = {spv::Capability::FloatControls2, spv::Capability::FPFastMathModeINTEL}; +static const spv::Capability pygen_variable_caps_FragmentBarycentricKHR[] = {spv::Capability::FragmentBarycentricKHR}; +static const spv::Capability pygen_variable_caps_FragmentDensityEXT[] = {spv::Capability::FragmentDensityEXT}; static const spv::Capability pygen_variable_caps_FragmentFullyCoveredEXT[] = {spv::Capability::FragmentFullyCoveredEXT}; static const spv::Capability pygen_variable_caps_FragmentShaderPixelInterlockEXT[] = {spv::Capability::FragmentShaderPixelInterlockEXT}; static const spv::Capability pygen_variable_caps_FragmentShaderSampleInterlockEXT[] = {spv::Capability::FragmentShaderSampleInterlockEXT}; @@ -62,6 +158,7 @@ static const spv::Capability pygen_variable_caps_Int64[] = {spv::Capability::Int static const spv::Capability pygen_variable_caps_Int64ImageEXT[] = {spv::Capability::Int64ImageEXT}; static const spv::Capability pygen_variable_caps_Int8[] = {spv::Capability::Int8}; static const spv::Capability pygen_variable_caps_Kernel[] = {spv::Capability::Kernel}; +static const spv::Capability pygen_variable_caps_KernelFloatControls2[] = {spv::Capability::Kernel, spv::Capability::FloatControls2}; static const spv::Capability pygen_variable_caps_KernelGroupNonUniform[] = {spv::Capability::Kernel, spv::Capability::GroupNonUniform}; static const spv::Capability pygen_variable_caps_KernelGroupNonUniformSubgroupBallotKHR[] = {spv::Capability::Kernel, spv::Capability::GroupNonUniform, spv::Capability::SubgroupBallotKHR}; static const spv::Capability pygen_variable_caps_KernelGroupNonUniformArithmeticGroupNonUniformBallot[] = {spv::Capability::Kernel, spv::Capability::GroupNonUniformArithmetic, spv::Capability::GroupNonUniformBallot}; @@ -77,13 +174,16 @@ static const spv::Capability pygen_variable_caps_MinLod[] = {spv::Capability::Mi static const spv::Capability pygen_variable_caps_MultiView[] = {spv::Capability::MultiView}; static const spv::Capability pygen_variable_caps_MultiViewport[] = {spv::Capability::MultiViewport}; static const spv::Capability pygen_variable_caps_MultiViewportShaderViewportIndexShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT[] = {spv::Capability::MultiViewport, spv::Capability::ShaderViewportIndex, spv::Capability::ShaderViewportIndexLayerEXT, spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; -static const spv::Capability pygen_variable_caps_OptNoneINTEL[] = {spv::Capability::OptNoneINTEL}; +static const spv::Capability pygen_variable_caps_OptNoneEXT[] = {spv::Capability::OptNoneEXT}; static const spv::Capability pygen_variable_caps_PerViewAttributesNVMeshShadingNV[] = {spv::Capability::PerViewAttributesNV, spv::Capability::MeshShadingNV}; static const spv::Capability pygen_variable_caps_PhysicalStorageBufferAddresses[] = {spv::Capability::PhysicalStorageBufferAddresses}; static const spv::Capability pygen_variable_caps_Pipes[] = {spv::Capability::Pipes}; +static const spv::Capability pygen_variable_caps_QuadControlKHR[] = {spv::Capability::QuadControlKHR}; +static const spv::Capability pygen_variable_caps_RawAccessChainsNV[] = {spv::Capability::RawAccessChainsNV}; static const spv::Capability pygen_variable_caps_RayCullMaskKHR[] = {spv::Capability::RayCullMaskKHR}; static const spv::Capability pygen_variable_caps_RayQueryKHR[] = {spv::Capability::RayQueryKHR}; static const spv::Capability pygen_variable_caps_RayQueryKHRRayTracingKHR[] = {spv::Capability::RayQueryKHR, spv::Capability::RayTracingKHR}; +static const spv::Capability pygen_variable_caps_RayTracingDisplacementMicromapNV[] = {spv::Capability::RayTracingDisplacementMicromapNV}; static const spv::Capability pygen_variable_caps_RayTracingKHR[] = {spv::Capability::RayTracingKHR}; static const spv::Capability pygen_variable_caps_RayTracingMotionBlurNV[] = {spv::Capability::RayTracingMotionBlurNV}; static const spv::Capability pygen_variable_caps_RayTracingNV[] = {spv::Capability::RayTracingNV}; @@ -91,6 +191,7 @@ static const spv::Capability pygen_variable_caps_RayTracingNVRayTracingKHR[] = { static const spv::Capability pygen_variable_caps_RayTracingOpacityMicromapEXT[] = {spv::Capability::RayTracingOpacityMicromapEXT}; static const spv::Capability pygen_variable_caps_RayTracingPositionFetchKHR[] = {spv::Capability::RayTracingPositionFetchKHR}; static const spv::Capability pygen_variable_caps_RayTraversalPrimitiveCullingKHR[] = {spv::Capability::RayTraversalPrimitiveCullingKHR}; +static const spv::Capability pygen_variable_caps_RegisterLimitsINTEL[] = {spv::Capability::RegisterLimitsINTEL}; static const spv::Capability pygen_variable_caps_RoundToInfinityINTEL[] = {spv::Capability::RoundToInfinityINTEL}; static const spv::Capability pygen_variable_caps_RoundingModeRTE[] = {spv::Capability::RoundingModeRTE}; static const spv::Capability pygen_variable_caps_RoundingModeRTZ[] = {spv::Capability::RoundingModeRTZ}; @@ -112,13 +213,12 @@ static const spv::Capability pygen_variable_caps_ShaderInvocationReorderNV[] = { static const spv::Capability pygen_variable_caps_ShaderNonUniform[] = {spv::Capability::ShaderNonUniform}; static const spv::Capability pygen_variable_caps_ShaderSMBuiltinsNV[] = {spv::Capability::ShaderSMBuiltinsNV}; static const spv::Capability pygen_variable_caps_ShaderStereoViewNV[] = {spv::Capability::ShaderStereoViewNV}; -static const spv::Capability pygen_variable_caps_ShaderViewportIndexLayerNV[] = {spv::Capability::ShaderViewportIndexLayerNV}; +static const spv::Capability pygen_variable_caps_ShaderViewportIndexLayerEXT[] = {spv::Capability::ShaderViewportIndexLayerEXT}; static const spv::Capability pygen_variable_caps_ShaderViewportMaskNV[] = {spv::Capability::ShaderViewportMaskNV}; static const spv::Capability pygen_variable_caps_ShaderViewportMaskNVMeshShadingNV[] = {spv::Capability::ShaderViewportMaskNV, spv::Capability::MeshShadingNV}; -static const spv::Capability pygen_variable_caps_ShadingRateNVFragmentDensityEXT[] = {spv::Capability::ShadingRateNV, spv::Capability::FragmentDensityEXT}; static const spv::Capability pygen_variable_caps_SignedZeroInfNanPreserve[] = {spv::Capability::SignedZeroInfNanPreserve}; static const spv::Capability pygen_variable_caps_StencilExportEXT[] = {spv::Capability::StencilExportEXT}; -static const spv::Capability pygen_variable_caps_StorageBuffer16BitAccessStorageUniformBufferBlock16[] = {spv::Capability::StorageBuffer16BitAccess, spv::Capability::StorageUniformBufferBlock16}; +static const spv::Capability pygen_variable_caps_StorageBuffer16BitAccess[] = {spv::Capability::StorageBuffer16BitAccess}; static const spv::Capability pygen_variable_caps_StorageBuffer8BitAccess[] = {spv::Capability::StorageBuffer8BitAccess}; static const spv::Capability pygen_variable_caps_StorageImageExtendedFormats[] = {spv::Capability::StorageImageExtendedFormats}; static const spv::Capability pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot[] = {spv::Capability::SubgroupBallotKHR, spv::Capability::GroupNonUniformBallot}; @@ -144,7 +244,9 @@ static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_explicit_ver static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_fragment_mask[] = {spvtools::Extension::kSPV_AMD_shader_fragment_mask}; static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_image_load_store_lod[] = {spvtools::Extension::kSPV_AMD_shader_image_load_store_lod}; static const spvtools::Extension pygen_variable_exts_SPV_AMD_texture_gather_bias_lod[] = {spvtools::Extension::kSPV_AMD_texture_gather_bias_lod}; +static const spvtools::Extension pygen_variable_exts_SPV_ARM_cooperative_matrix_layouts[] = {spvtools::Extension::kSPV_ARM_cooperative_matrix_layouts}; static const spvtools::Extension pygen_variable_exts_SPV_ARM_core_builtins[] = {spvtools::Extension::kSPV_ARM_core_builtins}; +static const spvtools::Extension pygen_variable_exts_SPV_EXT_arithmetic_fence[] = {spvtools::Extension::kSPV_EXT_arithmetic_fence}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_demote_to_helper_invocation[] = {spvtools::Extension::kSPV_EXT_demote_to_helper_invocation}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_descriptor_indexing[] = {spvtools::Extension::kSPV_EXT_descriptor_indexing}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_fragment_fully_covered[] = {spvtools::Extension::kSPV_EXT_fragment_fully_covered}; @@ -154,7 +256,9 @@ static const spvtools::Extension pygen_variable_exts_SPV_EXT_mesh_shader[] = {sp static const spvtools::Extension pygen_variable_exts_SPV_EXT_mesh_shaderSPV_KHR_shader_draw_parametersSPV_NV_mesh_shader[] = {spvtools::Extension::kSPV_EXT_mesh_shader, spvtools::Extension::kSPV_KHR_shader_draw_parameters, spvtools::Extension::kSPV_NV_mesh_shader}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader[] = {spvtools::Extension::kSPV_EXT_mesh_shader, spvtools::Extension::kSPV_NV_mesh_shader}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_opacity_micromap[] = {spvtools::Extension::kSPV_EXT_opacity_micromap}; +static const spvtools::Extension pygen_variable_exts_SPV_EXT_optnoneSPV_INTEL_optnone[] = {spvtools::Extension::kSPV_EXT_optnone, spvtools::Extension::kSPV_INTEL_optnone}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer[] = {spvtools::Extension::kSPV_EXT_physical_storage_buffer, spvtools::Extension::kSPV_KHR_physical_storage_buffer}; +static const spvtools::Extension pygen_variable_exts_SPV_EXT_replicated_composites[] = {spvtools::Extension::kSPV_EXT_replicated_composites}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_atomic_float16_add[] = {spvtools::Extension::kSPV_EXT_shader_atomic_float16_add}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_atomic_float_add[] = {spvtools::Extension::kSPV_EXT_shader_atomic_float_add}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_atomic_float_min_max[] = {spvtools::Extension::kSPV_EXT_shader_atomic_float_min_max}; @@ -169,6 +273,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_INTEL_arbitrary_precisi static const spvtools::Extension pygen_variable_exts_SPV_INTEL_arbitrary_precision_integers[] = {spvtools::Extension::kSPV_INTEL_arbitrary_precision_integers}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_bfloat16_conversion[] = {spvtools::Extension::kSPV_INTEL_bfloat16_conversion}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_blocking_pipes[] = {spvtools::Extension::kSPV_INTEL_blocking_pipes}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_cache_controls[] = {spvtools::Extension::kSPV_INTEL_cache_controls}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_debug_module[] = {spvtools::Extension::kSPV_INTEL_debug_module}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_device_side_avc_motion_estimation[] = {spvtools::Extension::kSPV_INTEL_device_side_avc_motion_estimation}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_float_controls2[] = {spvtools::Extension::kSPV_INTEL_float_controls2}; @@ -190,14 +295,16 @@ static const spvtools::Extension pygen_variable_exts_SPV_INTEL_global_variable_h static const spvtools::Extension pygen_variable_exts_SPV_INTEL_inline_assembly[] = {spvtools::Extension::kSPV_INTEL_inline_assembly}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_io_pipes[] = {spvtools::Extension::kSPV_INTEL_io_pipes}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_kernel_attributes[] = {spvtools::Extension::kSPV_INTEL_kernel_attributes}; -static const spvtools::Extension pygen_variable_exts_SPV_INTEL_long_constant_composite[] = {spvtools::Extension::kSPV_INTEL_long_constant_composite}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_long_composites[] = {spvtools::Extension::kSPV_INTEL_long_composites}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_loop_fuse[] = {spvtools::Extension::kSPV_INTEL_loop_fuse}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_masked_gather_scatter[] = {spvtools::Extension::kSPV_INTEL_masked_gather_scatter}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_maximum_registers[] = {spvtools::Extension::kSPV_INTEL_maximum_registers}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_media_block_io[] = {spvtools::Extension::kSPV_INTEL_media_block_io}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_memory_access_aliasing[] = {spvtools::Extension::kSPV_INTEL_memory_access_aliasing}; -static const spvtools::Extension pygen_variable_exts_SPV_INTEL_optnone[] = {spvtools::Extension::kSPV_INTEL_optnone}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_runtime_aligned[] = {spvtools::Extension::kSPV_INTEL_runtime_aligned}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_shader_integer_functions2[] = {spvtools::Extension::kSPV_INTEL_shader_integer_functions2}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_split_barrier[] = {spvtools::Extension::kSPV_INTEL_split_barrier}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_subgroup_buffer_prefetch[] = {spvtools::Extension::kSPV_INTEL_subgroup_buffer_prefetch}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_subgroups[] = {spvtools::Extension::kSPV_INTEL_subgroups}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_unstructured_loop_controls[] = {spvtools::Extension::kSPV_INTEL_unstructured_loop_controls}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_usm_storage_classes[] = {spvtools::Extension::kSPV_INTEL_usm_storage_classes}; @@ -206,17 +313,21 @@ static const spvtools::Extension pygen_variable_exts_SPV_INTEL_vector_compute[] static const spvtools::Extension pygen_variable_exts_SPV_KHR_16bit_storage[] = {spvtools::Extension::kSPV_KHR_16bit_storage}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_8bit_storage[] = {spvtools::Extension::kSPV_KHR_8bit_storage}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_bit_instructions[] = {spvtools::Extension::kSPV_KHR_bit_instructions}; +static const spvtools::Extension pygen_variable_exts_SPV_KHR_compute_shader_derivativesSPV_NV_compute_shader_derivatives[] = {spvtools::Extension::kSPV_KHR_compute_shader_derivatives, spvtools::Extension::kSPV_NV_compute_shader_derivatives}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_cooperative_matrix[] = {spvtools::Extension::kSPV_KHR_cooperative_matrix}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_device_group[] = {spvtools::Extension::kSPV_KHR_device_group}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_expect_assume[] = {spvtools::Extension::kSPV_KHR_expect_assume}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_float_controls[] = {spvtools::Extension::kSPV_KHR_float_controls}; +static const spvtools::Extension pygen_variable_exts_SPV_KHR_float_controls2[] = {spvtools::Extension::kSPV_KHR_float_controls2}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric[] = {spvtools::Extension::kSPV_KHR_fragment_shader_barycentric, spvtools::Extension::kSPV_NV_fragment_shader_barycentric}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_fragment_shading_rate[] = {spvtools::Extension::kSPV_KHR_fragment_shading_rate}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_integer_dot_product[] = {spvtools::Extension::kSPV_KHR_integer_dot_product}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_linkonce_odr[] = {spvtools::Extension::kSPV_KHR_linkonce_odr}; +static const spvtools::Extension pygen_variable_exts_SPV_KHR_maximal_reconvergence[] = {spvtools::Extension::kSPV_KHR_maximal_reconvergence}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_multiview[] = {spvtools::Extension::kSPV_KHR_multiview}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_no_integer_wrap_decoration[] = {spvtools::Extension::kSPV_KHR_no_integer_wrap_decoration}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_post_depth_coverage[] = {spvtools::Extension::kSPV_KHR_post_depth_coverage}; +static const spvtools::Extension pygen_variable_exts_SPV_KHR_quad_control[] = {spvtools::Extension::kSPV_KHR_quad_control}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_cull_mask[] = {spvtools::Extension::kSPV_KHR_ray_cull_mask}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_query[] = {spvtools::Extension::kSPV_KHR_ray_query}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_querySPV_KHR_ray_tracing[] = {spvtools::Extension::kSPV_KHR_ray_query, spvtools::Extension::kSPV_KHR_ray_tracing}; @@ -232,20 +343,23 @@ static const spvtools::Extension pygen_variable_exts_SPV_KHR_subgroup_rotate[] = static const spvtools::Extension pygen_variable_exts_SPV_KHR_subgroup_uniform_control_flow[] = {spvtools::Extension::kSPV_KHR_subgroup_uniform_control_flow}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_subgroup_vote[] = {spvtools::Extension::kSPV_KHR_subgroup_vote}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_uniform_group_instructions[] = {spvtools::Extension::kSPV_KHR_uniform_group_instructions}; +static const spvtools::Extension pygen_variable_exts_SPV_KHR_untyped_pointers[] = {spvtools::Extension::kSPV_KHR_untyped_pointers}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_variable_pointers[] = {spvtools::Extension::kSPV_KHR_variable_pointers}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_vulkan_memory_model[] = {spvtools::Extension::kSPV_KHR_vulkan_memory_model}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_workgroup_memory_explicit_layout[] = {spvtools::Extension::kSPV_KHR_workgroup_memory_explicit_layout}; static const spvtools::Extension pygen_variable_exts_SPV_NVX_multiview_per_view_attributes[] = {spvtools::Extension::kSPV_NVX_multiview_per_view_attributes}; static const spvtools::Extension pygen_variable_exts_SPV_NVX_multiview_per_view_attributesSPV_NV_mesh_shader[] = {spvtools::Extension::kSPV_NVX_multiview_per_view_attributes, spvtools::Extension::kSPV_NV_mesh_shader}; static const spvtools::Extension pygen_variable_exts_SPV_NV_bindless_texture[] = {spvtools::Extension::kSPV_NV_bindless_texture}; -static const spvtools::Extension pygen_variable_exts_SPV_NV_compute_shader_derivatives[] = {spvtools::Extension::kSPV_NV_compute_shader_derivatives}; static const spvtools::Extension pygen_variable_exts_SPV_NV_cooperative_matrix[] = {spvtools::Extension::kSPV_NV_cooperative_matrix}; +static const spvtools::Extension pygen_variable_exts_SPV_NV_displacement_micromap[] = {spvtools::Extension::kSPV_NV_displacement_micromap}; static const spvtools::Extension pygen_variable_exts_SPV_NV_geometry_shader_passthrough[] = {spvtools::Extension::kSPV_NV_geometry_shader_passthrough}; static const spvtools::Extension pygen_variable_exts_SPV_NV_mesh_shader[] = {spvtools::Extension::kSPV_NV_mesh_shader}; static const spvtools::Extension pygen_variable_exts_SPV_NV_mesh_shaderSPV_NV_viewport_array2[] = {spvtools::Extension::kSPV_NV_mesh_shader, spvtools::Extension::kSPV_NV_viewport_array2}; +static const spvtools::Extension pygen_variable_exts_SPV_NV_raw_access_chains[] = {spvtools::Extension::kSPV_NV_raw_access_chains}; static const spvtools::Extension pygen_variable_exts_SPV_NV_ray_tracing[] = {spvtools::Extension::kSPV_NV_ray_tracing}; static const spvtools::Extension pygen_variable_exts_SPV_NV_ray_tracing_motion_blur[] = {spvtools::Extension::kSPV_NV_ray_tracing_motion_blur}; static const spvtools::Extension pygen_variable_exts_SPV_NV_sample_mask_override_coverage[] = {spvtools::Extension::kSPV_NV_sample_mask_override_coverage}; +static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_atomic_fp16_vector[] = {spvtools::Extension::kSPV_NV_shader_atomic_fp16_vector}; static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_image_footprint[] = {spvtools::Extension::kSPV_NV_shader_image_footprint}; static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_invocation_reorder[] = {spvtools::Extension::kSPV_NV_shader_invocation_reorder}; static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_sm_builtins[] = {spvtools::Extension::kSPV_NV_shader_sm_builtins}; @@ -253,1227 +367,1217 @@ static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_subgroup_part static const spvtools::Extension pygen_variable_exts_SPV_NV_stereo_view_rendering[] = {spvtools::Extension::kSPV_NV_stereo_view_rendering}; static const spvtools::Extension pygen_variable_exts_SPV_NV_viewport_array2[] = {spvtools::Extension::kSPV_NV_viewport_array2}; static const spvtools::Extension pygen_variable_exts_SPV_QCOM_image_processing[] = {spvtools::Extension::kSPV_QCOM_image_processing}; +static const spvtools::Extension pygen_variable_exts_SPV_QCOM_image_processing2[] = {spvtools::Extension::kSPV_QCOM_image_processing2}; static const spv_operand_desc_t pygen_variable_ImageOperandsEntries[] = { - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Bias", 0x0001, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Lod", 0x0002, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Grad", 0x0004, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConstOffset", 0x0008, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Offset", 0x0010, 1, pygen_variable_caps_ImageGatherExtended, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ConstOffsets", 0x0020, 1, pygen_variable_caps_ImageGatherExtended, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Sample", 0x0040, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MinLod", 0x0080, 1, pygen_variable_caps_MinLod, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MakeTexelAvailable", 0x0100, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakeTexelAvailableKHR", 0x0100, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakeTexelVisible", 0x0200, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakeTexelVisibleKHR", 0x0200, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"NonPrivateTexel", 0x0400, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"NonPrivateTexelKHR", 0x0400, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"VolatileTexel", 0x0800, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"VolatileTexelKHR", 0x0800, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"SignExtend", 0x1000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"ZeroExtend", 0x2000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"Nontemporal", 0x4000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"Offsets", 0x10000, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Bias", 0x0001, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Lod", 0x0002, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Grad", 0x0004, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConstOffset", 0x0008, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Offset", 0x0010, 0, nullptr, 1, pygen_variable_caps_ImageGatherExtended, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ConstOffsets", 0x0020, 0, nullptr, 1, pygen_variable_caps_ImageGatherExtended, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Sample", 0x0040, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MinLod", 0x0080, 0, nullptr, 1, pygen_variable_caps_MinLod, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MakeTexelAvailable", 0x0100, 1, pygen_variable_aliases_MakeTexelAvailableKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"MakeTexelVisible", 0x0200, 1, pygen_variable_aliases_MakeTexelVisibleKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"NonPrivateTexel", 0x0400, 1, pygen_variable_aliases_NonPrivateTexelKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"VolatileTexel", 0x0800, 1, pygen_variable_aliases_VolatileTexelKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"SignExtend", 0x1000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"ZeroExtend", 0x2000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"Nontemporal", 0x4000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"Offsets", 0x10000, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_FPFastMathModeEntries[] = { - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NotNaN", 0x0001, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NotInf", 0x0002, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NSZ", 0x0004, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AllowRecip", 0x0008, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Fast", 0x0010, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AllowContractFastINTEL", 0x10000, 1, pygen_variable_caps_FPFastMathModeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"AllowReassocINTEL", 0x20000, 1, pygen_variable_caps_FPFastMathModeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NotNaN", 0x0001, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NotInf", 0x0002, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NSZ", 0x0004, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AllowRecip", 0x0008, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Fast", 0x0010, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AllowContract", 0x10000, 1, pygen_variable_aliases_AllowContractFastINTEL, 2, pygen_variable_caps_FloatControls2FPFastMathModeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"AllowReassoc", 0x20000, 1, pygen_variable_aliases_AllowReassocINTEL, 2, pygen_variable_caps_FloatControls2FPFastMathModeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"AllowTransform", 0x40000, 0, nullptr, 1, pygen_variable_caps_FloatControls2, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_SelectionControlEntries[] = { - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Flatten", 0x0001, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DontFlatten", 0x0002, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Flatten", 0x0001, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DontFlatten", 0x0002, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_LoopControlEntries[] = { - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Unroll", 0x0001, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DontUnroll", 0x0002, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DependencyInfinite", 0x0004, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"DependencyLength", 0x0008, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"MinIterations", 0x0010, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"MaxIterations", 0x0020, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"IterationMultiple", 0x0040, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"PeelCount", 0x0080, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"PartialCount", 0x0100, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"InitiationIntervalINTEL", 0x10000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MaxConcurrencyINTEL", 0x20000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"DependencyArrayINTEL", 0x40000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"PipelineEnableINTEL", 0x80000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"LoopCoalesceINTEL", 0x100000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MaxInterleavingINTEL", 0x200000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"SpeculatedIterationsINTEL", 0x400000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"NoFusionINTEL", 0x800000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"LoopCountINTEL", 0x1000000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MaxReinvocationDelayINTEL", 0x2000000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu} + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Unroll", 0x0001, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DontUnroll", 0x0002, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DependencyInfinite", 0x0004, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"DependencyLength", 0x0008, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"MinIterations", 0x0010, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"MaxIterations", 0x0020, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"IterationMultiple", 0x0040, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"PeelCount", 0x0080, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"PartialCount", 0x0100, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"InitiationIntervalINTEL", 0x10000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxConcurrencyINTEL", 0x20000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"DependencyArrayINTEL", 0x40000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"PipelineEnableINTEL", 0x80000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"LoopCoalesceINTEL", 0x100000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxInterleavingINTEL", 0x200000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"SpeculatedIterationsINTEL", 0x400000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"NoFusionINTEL", 0x800000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"LoopCountINTEL", 0x1000000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxReinvocationDelayINTEL", 0x2000000, 0, nullptr, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_FunctionControlEntries[] = { - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Inline", 0x0001, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DontInline", 0x0002, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Pure", 0x0004, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Const", 0x0008, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OptNoneINTEL", 0x10000, 1, pygen_variable_caps_OptNoneINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Inline", 0x0001, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DontInline", 0x0002, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Pure", 0x0004, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Const", 0x0008, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OptNoneEXT", 0x10000, 1, pygen_variable_aliases_OptNoneINTEL, 1, pygen_variable_caps_OptNoneEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_MemorySemanticsEntries[] = { - {"Relaxed", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Acquire", 0x0002, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Release", 0x0004, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AcquireRelease", 0x0008, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SequentiallyConsistent", 0x0010, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UniformMemory", 0x0040, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SubgroupMemory", 0x0080, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WorkgroupMemory", 0x0100, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CrossWorkgroupMemory", 0x0200, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicCounterMemory", 0x0400, 1, pygen_variable_caps_AtomicStorage, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageMemory", 0x0800, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OutputMemory", 0x1000, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"OutputMemoryKHR", 0x1000, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakeAvailable", 0x2000, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakeAvailableKHR", 0x2000, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakeVisible", 0x4000, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakeVisibleKHR", 0x4000, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"Volatile", 0x8000, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu} + {"Relaxed", 0x0000, 1, pygen_variable_aliases_None, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Acquire", 0x0002, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Release", 0x0004, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AcquireRelease", 0x0008, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SequentiallyConsistent", 0x0010, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UniformMemory", 0x0040, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SubgroupMemory", 0x0080, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WorkgroupMemory", 0x0100, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CrossWorkgroupMemory", 0x0200, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicCounterMemory", 0x0400, 0, nullptr, 1, pygen_variable_caps_AtomicStorage, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageMemory", 0x0800, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OutputMemory", 0x1000, 1, pygen_variable_aliases_OutputMemoryKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"MakeAvailable", 0x2000, 1, pygen_variable_aliases_MakeAvailableKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"MakeVisible", 0x4000, 1, pygen_variable_aliases_MakeVisibleKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"Volatile", 0x8000, 0, nullptr, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_MemoryAccessEntries[] = { - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Volatile", 0x0001, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Aligned", 0x0002, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Nontemporal", 0x0004, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MakePointerAvailable", 0x0008, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakePointerAvailableKHR", 0x0008, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakePointerVisible", 0x0010, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"MakePointerVisibleKHR", 0x0010, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"NonPrivatePointer", 0x0020, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"NonPrivatePointerKHR", 0x0020, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"AliasScopeINTELMask", 0x10000, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"NoAliasINTELMask", 0x20000, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu} + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Volatile", 0x0001, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Aligned", 0x0002, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Nontemporal", 0x0004, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MakePointerAvailable", 0x0008, 1, pygen_variable_aliases_MakePointerAvailableKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"MakePointerVisible", 0x0010, 1, pygen_variable_aliases_MakePointerVisibleKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"NonPrivatePointer", 0x0020, 1, pygen_variable_aliases_NonPrivatePointerKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"AliasScopeINTELMask", 0x10000, 0, nullptr, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"NoAliasINTELMask", 0x20000, 0, nullptr, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_KernelProfilingInfoEntries[] = { - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CmdExecTime", 0x0001, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CmdExecTime", 0x0001, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_RayFlagsEntries[] = { - {"NoneKHR", 0x0000, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"OpaqueKHR", 0x0001, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"NoOpaqueKHR", 0x0002, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"TerminateOnFirstHitKHR", 0x0004, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SkipClosestHitShaderKHR", 0x0008, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"CullBackFacingTrianglesKHR", 0x0010, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"CullFrontFacingTrianglesKHR", 0x0020, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"CullOpaqueKHR", 0x0040, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"CullNoOpaqueKHR", 0x0080, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SkipTrianglesKHR", 0x0100, 1, pygen_variable_caps_RayTraversalPrimitiveCullingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SkipAABBsKHR", 0x0200, 1, pygen_variable_caps_RayTraversalPrimitiveCullingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"ForceOpacityMicromap2StateEXT", 0x0400, 1, pygen_variable_caps_RayTracingOpacityMicromapEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"NoneKHR", 0x0000, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"OpaqueKHR", 0x0001, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"NoOpaqueKHR", 0x0002, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"TerminateOnFirstHitKHR", 0x0004, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SkipClosestHitShaderKHR", 0x0008, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"CullBackFacingTrianglesKHR", 0x0010, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"CullFrontFacingTrianglesKHR", 0x0020, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"CullOpaqueKHR", 0x0040, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"CullNoOpaqueKHR", 0x0080, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SkipTrianglesKHR", 0x0100, 0, nullptr, 1, pygen_variable_caps_RayTraversalPrimitiveCullingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SkipAABBsKHR", 0x0200, 0, nullptr, 1, pygen_variable_caps_RayTraversalPrimitiveCullingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ForceOpacityMicromap2StateEXT", 0x0400, 0, nullptr, 1, pygen_variable_caps_RayTracingOpacityMicromapEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_FragmentShadingRateEntries[] = { - {"Vertical2Pixels", 0x0001, 1, pygen_variable_caps_FragmentShadingRateKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"Vertical4Pixels", 0x0002, 1, pygen_variable_caps_FragmentShadingRateKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"Horizontal2Pixels", 0x0004, 1, pygen_variable_caps_FragmentShadingRateKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"Horizontal4Pixels", 0x0008, 1, pygen_variable_caps_FragmentShadingRateKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"Vertical2Pixels", 0x0001, 0, nullptr, 1, pygen_variable_caps_FragmentShadingRateKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"Vertical4Pixels", 0x0002, 0, nullptr, 1, pygen_variable_caps_FragmentShadingRateKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"Horizontal2Pixels", 0x0004, 0, nullptr, 1, pygen_variable_caps_FragmentShadingRateKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"Horizontal4Pixels", 0x0008, 0, nullptr, 1, pygen_variable_caps_FragmentShadingRateKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} +}; + +static const spv_operand_desc_t pygen_variable_RawAccessChainOperandsEntries[] = { + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"RobustnessPerComponentNV", 0x0001, 0, nullptr, 1, pygen_variable_caps_RawAccessChainsNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RobustnessPerElementNV", 0x0002, 0, nullptr, 1, pygen_variable_caps_RawAccessChainsNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_SourceLanguageEntries[] = { - {"Unknown", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ESSL", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GLSL", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OpenCL_C", 3, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OpenCL_CPP", 4, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"HLSL", 5, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CPP_for_OpenCL", 6, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SYCL", 7, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"HERO_C", 8, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NZSL", 9, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WGSL", 10, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"Unknown", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ESSL", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GLSL", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OpenCL_C", 3, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OpenCL_CPP", 4, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"HLSL", 5, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CPP_for_OpenCL", 6, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SYCL", 7, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"HERO_C", 8, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NZSL", 9, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WGSL", 10, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Slang", 11, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Zig", 12, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_ExecutionModelEntries[] = { - {"Vertex", 0, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TessellationControl", 1, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TessellationEvaluation", 2, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Geometry", 3, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Fragment", 4, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GLCompute", 5, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Kernel", 6, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TaskNV", 5267, 1, pygen_variable_caps_MeshShadingNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MeshNV", 5268, 1, pygen_variable_caps_MeshShadingNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RayGenerationNV", 5313, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RayGenerationKHR", 5313, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"IntersectionNV", 5314, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"IntersectionKHR", 5314, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"AnyHitNV", 5315, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"AnyHitKHR", 5315, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"ClosestHitNV", 5316, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"ClosestHitKHR", 5316, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MissNV", 5317, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MissKHR", 5317, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"CallableNV", 5318, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"CallableKHR", 5318, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"TaskEXT", 5364, 1, pygen_variable_caps_MeshShadingEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MeshEXT", 5365, 1, pygen_variable_caps_MeshShadingEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"Vertex", 0, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TessellationControl", 1, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TessellationEvaluation", 2, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Geometry", 3, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Fragment", 4, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GLCompute", 5, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Kernel", 6, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TaskNV", 5267, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MeshNV", 5268, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RayGenerationKHR", 5313, 1, pygen_variable_aliases_RayGenerationNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"IntersectionKHR", 5314, 1, pygen_variable_aliases_IntersectionNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"AnyHitKHR", 5315, 1, pygen_variable_aliases_AnyHitNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ClosestHitKHR", 5316, 1, pygen_variable_aliases_ClosestHitNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MissKHR", 5317, 1, pygen_variable_aliases_MissNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"CallableKHR", 5318, 1, pygen_variable_aliases_CallableNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"TaskEXT", 5364, 0, nullptr, 1, pygen_variable_caps_MeshShadingEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MeshEXT", 5365, 0, nullptr, 1, pygen_variable_caps_MeshShadingEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_AddressingModelEntries[] = { - {"Logical", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Physical32", 1, 1, pygen_variable_caps_Addresses, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Physical64", 2, 1, pygen_variable_caps_Addresses, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PhysicalStorageBuffer64", 5348, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"PhysicalStorageBuffer64EXT", 5348, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu} + {"Logical", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Physical32", 1, 0, nullptr, 1, pygen_variable_caps_Addresses, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Physical64", 2, 0, nullptr, 1, pygen_variable_caps_Addresses, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PhysicalStorageBuffer64", 5348, 1, pygen_variable_aliases_PhysicalStorageBuffer64EXT, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_MemoryModelEntries[] = { - {"Simple", 0, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GLSL450", 1, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OpenCL", 2, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Vulkan", 3, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"VulkanKHR", 3, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu} + {"Simple", 0, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GLSL450", 1, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OpenCL", 2, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Vulkan", 3, 1, pygen_variable_aliases_VulkanKHR, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_ExecutionModeEntries[] = { - {"Invocations", 0, 1, pygen_variable_caps_Geometry, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SpacingEqual", 1, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SpacingFractionalEven", 2, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SpacingFractionalOdd", 3, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VertexOrderCw", 4, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VertexOrderCcw", 5, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PixelCenterInteger", 6, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OriginUpperLeft", 7, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OriginLowerLeft", 8, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"EarlyFragmentTests", 9, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PointMode", 10, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Xfb", 11, 1, pygen_variable_caps_TransformFeedback, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DepthReplacing", 12, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DepthGreater", 14, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DepthLess", 15, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DepthUnchanged", 16, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LocalSize", 17, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LocalSizeHint", 18, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InputPoints", 19, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InputLines", 20, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InputLinesAdjacency", 21, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Triangles", 22, 2, pygen_variable_caps_GeometryTessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InputTrianglesAdjacency", 23, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Quads", 24, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Isolines", 25, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OutputVertices", 26, 4, pygen_variable_caps_GeometryTessellationMeshShadingNVMeshShadingEXT, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OutputPoints", 27, 3, pygen_variable_caps_GeometryMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OutputLineStrip", 28, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"OutputTriangleStrip", 29, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VecTypeHint", 30, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ContractionOff", 31, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Initializer", 33, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"Finalizer", 34, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"SubgroupSize", 35, 1, pygen_variable_caps_SubgroupDispatch, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"SubgroupsPerWorkgroup", 36, 1, pygen_variable_caps_SubgroupDispatch, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"SubgroupsPerWorkgroupId", 37, 1, pygen_variable_caps_SubgroupDispatch, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, - {"LocalSizeId", 38, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, - {"LocalSizeHintId", 39, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, - {"NonCoherentColorAttachmentReadEXT", 4169, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"NonCoherentDepthAttachmentReadEXT", 4170, 1, pygen_variable_caps_TileImageDepthReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"NonCoherentStencilAttachmentReadEXT", 4171, 1, pygen_variable_caps_TileImageStencilReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupUniformControlFlowKHR", 4421, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_subgroup_uniform_control_flow, {}, 0xffffffffu, 0xffffffffu}, - {"PostDepthCoverage", 4446, 1, pygen_variable_caps_SampleMaskPostDepthCoverage, 1, pygen_variable_exts_SPV_KHR_post_depth_coverage, {}, 0xffffffffu, 0xffffffffu}, - {"DenormPreserve", 4459, 1, pygen_variable_caps_DenormPreserve, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"DenormFlushToZero", 4460, 1, pygen_variable_caps_DenormFlushToZero, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"SignedZeroInfNanPreserve", 4461, 1, pygen_variable_caps_SignedZeroInfNanPreserve, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"RoundingModeRTE", 4462, 1, pygen_variable_caps_RoundingModeRTE, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"RoundingModeRTZ", 4463, 1, pygen_variable_caps_RoundingModeRTZ, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"EarlyAndLateFragmentTestsAMD", 5017, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_tests, {}, 0xffffffffu, 0xffffffffu}, - {"StencilRefReplacingEXT", 5027, 1, pygen_variable_caps_StencilExportEXT, 1, pygen_variable_exts_SPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, - {"CoalescingAMDX", 5069, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MaxNodeRecursionAMDX", 5071, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"StaticNumWorkgroupsAMDX", 5072, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"ShaderIndexAMDX", 5073, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"MaxNumWorkgroupsAMDX", 5077, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"StencilRefUnchangedFrontAMD", 5079, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, - {"StencilRefGreaterFrontAMD", 5080, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, - {"StencilRefLessFrontAMD", 5081, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, - {"StencilRefUnchangedBackAMD", 5082, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, - {"StencilRefGreaterBackAMD", 5083, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, - {"StencilRefLessBackAMD", 5084, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, - {"OutputLinesNV", 5269, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"OutputLinesEXT", 5269, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"OutputPrimitivesNV", 5270, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"OutputPrimitivesEXT", 5270, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"DerivativeGroupQuadsNV", 5289, 1, pygen_variable_caps_ComputeDerivativeGroupQuadsNV, 1, pygen_variable_exts_SPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu}, - {"DerivativeGroupLinearNV", 5290, 1, pygen_variable_caps_ComputeDerivativeGroupLinearNV, 1, pygen_variable_exts_SPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu}, - {"OutputTrianglesNV", 5298, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"OutputTrianglesEXT", 5298, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"PixelInterlockOrderedEXT", 5366, 1, pygen_variable_caps_FragmentShaderPixelInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, - {"PixelInterlockUnorderedEXT", 5367, 1, pygen_variable_caps_FragmentShaderPixelInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, - {"SampleInterlockOrderedEXT", 5368, 1, pygen_variable_caps_FragmentShaderSampleInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, - {"SampleInterlockUnorderedEXT", 5369, 1, pygen_variable_caps_FragmentShaderSampleInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, - {"ShadingRateInterlockOrderedEXT", 5370, 1, pygen_variable_caps_FragmentShaderShadingRateInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, - {"ShadingRateInterlockUnorderedEXT", 5371, 1, pygen_variable_caps_FragmentShaderShadingRateInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, - {"SharedLocalMemorySizeINTEL", 5618, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"RoundingModeRTPINTEL", 5620, 1, pygen_variable_caps_RoundToInfinityINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"RoundingModeRTNINTEL", 5621, 1, pygen_variable_caps_RoundToInfinityINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"FloatingPointModeALTINTEL", 5622, 1, pygen_variable_caps_RoundToInfinityINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"FloatingPointModeIEEEINTEL", 5623, 1, pygen_variable_caps_RoundToInfinityINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MaxWorkgroupSizeINTEL", 5893, 1, pygen_variable_caps_KernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MaxWorkDimINTEL", 5894, 1, pygen_variable_caps_KernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"NoGlobalOffsetINTEL", 5895, 1, pygen_variable_caps_KernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"NumSIMDWorkitemsINTEL", 5896, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"SchedulerTargetFmaxMhzINTEL", 5903, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"StreamingInterfaceINTEL", 6154, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"RegisterMapInterfaceINTEL", 6160, 1, pygen_variable_caps_FPGAKernelAttributesv2INTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"NamedBarrierCountINTEL", 6417, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu} + {"Invocations", 0, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SpacingEqual", 1, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SpacingFractionalEven", 2, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SpacingFractionalOdd", 3, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VertexOrderCw", 4, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VertexOrderCcw", 5, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PixelCenterInteger", 6, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OriginUpperLeft", 7, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OriginLowerLeft", 8, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"EarlyFragmentTests", 9, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PointMode", 10, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Xfb", 11, 0, nullptr, 1, pygen_variable_caps_TransformFeedback, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DepthReplacing", 12, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DepthGreater", 14, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DepthLess", 15, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DepthUnchanged", 16, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LocalSize", 17, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LocalSizeHint", 18, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InputPoints", 19, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InputLines", 20, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InputLinesAdjacency", 21, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Triangles", 22, 0, nullptr, 2, pygen_variable_caps_GeometryTessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InputTrianglesAdjacency", 23, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Quads", 24, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Isolines", 25, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OutputVertices", 26, 0, nullptr, 4, pygen_variable_caps_GeometryTessellationMeshShadingNVMeshShadingEXT, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OutputPoints", 27, 0, nullptr, 3, pygen_variable_caps_GeometryMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OutputLineStrip", 28, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"OutputTriangleStrip", 29, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VecTypeHint", 30, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ContractionOff", 31, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Initializer", 33, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"Finalizer", 34, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"SubgroupSize", 35, 0, nullptr, 1, pygen_variable_caps_SubgroupDispatch, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"SubgroupsPerWorkgroup", 36, 0, nullptr, 1, pygen_variable_caps_SubgroupDispatch, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"SubgroupsPerWorkgroupId", 37, 0, nullptr, 1, pygen_variable_caps_SubgroupDispatch, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"LocalSizeId", 38, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"LocalSizeHintId", 39, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"NonCoherentColorAttachmentReadEXT", 4169, 0, nullptr, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"NonCoherentDepthAttachmentReadEXT", 4170, 0, nullptr, 1, pygen_variable_caps_TileImageDepthReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"NonCoherentStencilAttachmentReadEXT", 4171, 0, nullptr, 1, pygen_variable_caps_TileImageStencilReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupUniformControlFlowKHR", 4421, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_subgroup_uniform_control_flow, {}, 0xffffffffu, 0xffffffffu}, + {"PostDepthCoverage", 4446, 0, nullptr, 1, pygen_variable_caps_SampleMaskPostDepthCoverage, 1, pygen_variable_exts_SPV_KHR_post_depth_coverage, {}, 0xffffffffu, 0xffffffffu}, + {"DenormPreserve", 4459, 0, nullptr, 1, pygen_variable_caps_DenormPreserve, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"DenormFlushToZero", 4460, 0, nullptr, 1, pygen_variable_caps_DenormFlushToZero, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"SignedZeroInfNanPreserve", 4461, 0, nullptr, 1, pygen_variable_caps_SignedZeroInfNanPreserve, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"RoundingModeRTE", 4462, 0, nullptr, 1, pygen_variable_caps_RoundingModeRTE, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"RoundingModeRTZ", 4463, 0, nullptr, 1, pygen_variable_caps_RoundingModeRTZ, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"EarlyAndLateFragmentTestsAMD", 5017, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_tests, {}, 0xffffffffu, 0xffffffffu}, + {"StencilRefReplacingEXT", 5027, 0, nullptr, 1, pygen_variable_caps_StencilExportEXT, 1, pygen_variable_exts_SPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, + {"CoalescingAMDX", 5069, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"IsApiEntryAMDX", 5070, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"MaxNodeRecursionAMDX", 5071, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"StaticNumWorkgroupsAMDX", 5072, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"ShaderIndexAMDX", 5073, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"MaxNumWorkgroupsAMDX", 5077, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"StencilRefUnchangedFrontAMD", 5079, 0, nullptr, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, + {"StencilRefGreaterFrontAMD", 5080, 0, nullptr, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, + {"StencilRefLessFrontAMD", 5081, 0, nullptr, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, + {"StencilRefUnchangedBackAMD", 5082, 0, nullptr, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, + {"StencilRefGreaterBackAMD", 5083, 0, nullptr, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, + {"StencilRefLessBackAMD", 5084, 0, nullptr, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, + {"QuadDerivativesKHR", 5088, 0, nullptr, 1, pygen_variable_caps_QuadControlKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RequireFullQuadsKHR", 5089, 0, nullptr, 1, pygen_variable_caps_QuadControlKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SharesInputWithAMDX", 5102, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"OutputLinesEXT", 5269, 1, pygen_variable_aliases_OutputLinesNV, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"OutputPrimitivesEXT", 5270, 1, pygen_variable_aliases_OutputPrimitivesNV, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"DerivativeGroupQuadsKHR", 5289, 1, pygen_variable_aliases_DerivativeGroupQuadsNV, 2, pygen_variable_caps_ComputeDerivativeGroupQuadsNVComputeDerivativeGroupQuadsKHR, 2, pygen_variable_exts_SPV_KHR_compute_shader_derivativesSPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu}, + {"DerivativeGroupLinearKHR", 5290, 1, pygen_variable_aliases_DerivativeGroupLinearNV, 2, pygen_variable_caps_ComputeDerivativeGroupLinearNVComputeDerivativeGroupLinearKHR, 2, pygen_variable_exts_SPV_KHR_compute_shader_derivativesSPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu}, + {"OutputTrianglesEXT", 5298, 1, pygen_variable_aliases_OutputTrianglesNV, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"PixelInterlockOrderedEXT", 5366, 0, nullptr, 1, pygen_variable_caps_FragmentShaderPixelInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, + {"PixelInterlockUnorderedEXT", 5367, 0, nullptr, 1, pygen_variable_caps_FragmentShaderPixelInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, + {"SampleInterlockOrderedEXT", 5368, 0, nullptr, 1, pygen_variable_caps_FragmentShaderSampleInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, + {"SampleInterlockUnorderedEXT", 5369, 0, nullptr, 1, pygen_variable_caps_FragmentShaderSampleInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, + {"ShadingRateInterlockOrderedEXT", 5370, 0, nullptr, 1, pygen_variable_caps_FragmentShaderShadingRateInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, + {"ShadingRateInterlockUnorderedEXT", 5371, 0, nullptr, 1, pygen_variable_caps_FragmentShaderShadingRateInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, + {"SharedLocalMemorySizeINTEL", 5618, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"RoundingModeRTPINTEL", 5620, 0, nullptr, 1, pygen_variable_caps_RoundToInfinityINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"RoundingModeRTNINTEL", 5621, 0, nullptr, 1, pygen_variable_caps_RoundToInfinityINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"FloatingPointModeALTINTEL", 5622, 0, nullptr, 1, pygen_variable_caps_RoundToInfinityINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"FloatingPointModeIEEEINTEL", 5623, 0, nullptr, 1, pygen_variable_caps_RoundToInfinityINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxWorkgroupSizeINTEL", 5893, 0, nullptr, 1, pygen_variable_caps_KernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxWorkDimINTEL", 5894, 0, nullptr, 1, pygen_variable_caps_KernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"NoGlobalOffsetINTEL", 5895, 0, nullptr, 1, pygen_variable_caps_KernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"NumSIMDWorkitemsINTEL", 5896, 0, nullptr, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"SchedulerTargetFmaxMhzINTEL", 5903, 0, nullptr, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaximallyReconvergesKHR", 6023, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_maximal_reconvergence, {}, 0xffffffffu, 0xffffffffu}, + {"FPFastMathDefault", 6028, 0, nullptr, 1, pygen_variable_caps_FloatControls2, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"StreamingInterfaceINTEL", 6154, 0, nullptr, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"RegisterMapInterfaceINTEL", 6160, 0, nullptr, 1, pygen_variable_caps_FPGAKernelAttributesv2INTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"NamedBarrierCountINTEL", 6417, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaximumRegistersINTEL", 6461, 0, nullptr, 1, pygen_variable_caps_RegisterLimitsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaximumRegistersIdINTEL", 6462, 0, nullptr, 1, pygen_variable_caps_RegisterLimitsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"NamedMaximumRegistersINTEL", 6463, 0, nullptr, 1, pygen_variable_caps_RegisterLimitsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_StorageClassEntries[] = { - {"UniformConstant", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Input", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Uniform", 2, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Output", 3, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Workgroup", 4, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CrossWorkgroup", 5, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Private", 6, 2, pygen_variable_caps_ShaderVectorComputeINTEL, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Function", 7, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Generic", 8, 1, pygen_variable_caps_GenericPointer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PushConstant", 9, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicCounter", 10, 1, pygen_variable_caps_AtomicStorage, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Image", 11, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"StorageBuffer", 12, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_KHR_storage_buffer_storage_classSPV_KHR_variable_pointers, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"TileImageEXT", 4172, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"NodePayloadAMDX", 5068, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"NodeOutputPayloadAMDX", 5076, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"CallableDataNV", 5328, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"CallableDataKHR", 5328, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"IncomingCallableDataNV", 5329, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"IncomingCallableDataKHR", 5329, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"RayPayloadNV", 5338, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"RayPayloadKHR", 5338, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"HitAttributeNV", 5339, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"HitAttributeKHR", 5339, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"IncomingRayPayloadNV", 5342, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"IncomingRayPayloadKHR", 5342, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderRecordBufferNV", 5343, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderRecordBufferKHR", 5343, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"PhysicalStorageBuffer", 5349, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"PhysicalStorageBufferEXT", 5349, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"HitObjectAttributeNV", 5385, 1, pygen_variable_caps_ShaderInvocationReorderNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"TaskPayloadWorkgroupEXT", 5402, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"CodeSectionINTEL", 5605, 1, pygen_variable_caps_FunctionPointersINTEL, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu}, - {"DeviceOnlyINTEL", 5936, 1, pygen_variable_caps_USMStorageClassesINTEL, 1, pygen_variable_exts_SPV_INTEL_usm_storage_classes, {}, 0xffffffffu, 0xffffffffu}, - {"HostOnlyINTEL", 5937, 1, pygen_variable_caps_USMStorageClassesINTEL, 1, pygen_variable_exts_SPV_INTEL_usm_storage_classes, {}, 0xffffffffu, 0xffffffffu} + {"UniformConstant", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Input", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Uniform", 2, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Output", 3, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Workgroup", 4, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CrossWorkgroup", 5, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Private", 6, 0, nullptr, 2, pygen_variable_caps_ShaderVectorComputeINTEL, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Function", 7, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Generic", 8, 0, nullptr, 1, pygen_variable_caps_GenericPointer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PushConstant", 9, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicCounter", 10, 0, nullptr, 1, pygen_variable_caps_AtomicStorage, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Image", 11, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"StorageBuffer", 12, 0, nullptr, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_KHR_storage_buffer_storage_classSPV_KHR_variable_pointers, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"TileImageEXT", 4172, 0, nullptr, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"NodePayloadAMDX", 5068, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"CallableDataKHR", 5328, 1, pygen_variable_aliases_CallableDataNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"IncomingCallableDataKHR", 5329, 1, pygen_variable_aliases_IncomingCallableDataNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"RayPayloadKHR", 5338, 1, pygen_variable_aliases_RayPayloadNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"HitAttributeKHR", 5339, 1, pygen_variable_aliases_HitAttributeNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"IncomingRayPayloadKHR", 5342, 1, pygen_variable_aliases_IncomingRayPayloadNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderRecordBufferKHR", 5343, 1, pygen_variable_aliases_ShaderRecordBufferNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"PhysicalStorageBuffer", 5349, 1, pygen_variable_aliases_PhysicalStorageBufferEXT, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"HitObjectAttributeNV", 5385, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"TaskPayloadWorkgroupEXT", 5402, 0, nullptr, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"CodeSectionINTEL", 5605, 0, nullptr, 1, pygen_variable_caps_FunctionPointersINTEL, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu}, + {"DeviceOnlyINTEL", 5936, 0, nullptr, 1, pygen_variable_caps_USMStorageClassesINTEL, 1, pygen_variable_exts_SPV_INTEL_usm_storage_classes, {}, 0xffffffffu, 0xffffffffu}, + {"HostOnlyINTEL", 5937, 0, nullptr, 1, pygen_variable_caps_USMStorageClassesINTEL, 1, pygen_variable_exts_SPV_INTEL_usm_storage_classes, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_DimEntries[] = { - {"1D", 0, 1, pygen_variable_caps_Sampled1D, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"2D", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"3D", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Cube", 3, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rect", 4, 1, pygen_variable_caps_SampledRect, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Buffer", 5, 1, pygen_variable_caps_SampledBuffer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SubpassData", 6, 1, pygen_variable_caps_InputAttachment, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TileImageDataEXT", 4173, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"1D", 0, 0, nullptr, 1, pygen_variable_caps_Sampled1D, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"2D", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"3D", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Cube", 3, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rect", 4, 0, nullptr, 1, pygen_variable_caps_SampledRect, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Buffer", 5, 0, nullptr, 1, pygen_variable_caps_SampledBuffer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SubpassData", 6, 0, nullptr, 1, pygen_variable_caps_InputAttachment, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TileImageDataEXT", 4173, 0, nullptr, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_SamplerAddressingModeEntries[] = { - {"None", 0, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ClampToEdge", 1, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Clamp", 2, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Repeat", 3, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RepeatMirrored", 4, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"None", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ClampToEdge", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Clamp", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Repeat", 3, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RepeatMirrored", 4, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_SamplerFilterModeEntries[] = { - {"Nearest", 0, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Linear", 1, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"Nearest", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Linear", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_ImageFormatEntries[] = { - {"Unknown", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba32f", 1, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba16f", 2, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R32f", 3, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba8", 4, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba8Snorm", 5, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg32f", 6, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg16f", 7, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R11fG11fB10f", 8, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R16f", 9, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba16", 10, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgb10A2", 11, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg16", 12, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg8", 13, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R16", 14, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R8", 15, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba16Snorm", 16, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg16Snorm", 17, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg8Snorm", 18, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R16Snorm", 19, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R8Snorm", 20, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba32i", 21, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba16i", 22, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba8i", 23, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R32i", 24, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg32i", 25, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg16i", 26, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg8i", 27, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R16i", 28, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R8i", 29, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba32ui", 30, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba16ui", 31, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgba8ui", 32, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R32ui", 33, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rgb10a2ui", 34, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg32ui", 35, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg16ui", 36, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rg8ui", 37, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R16ui", 38, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R8ui", 39, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R64ui", 40, 1, pygen_variable_caps_Int64ImageEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"R64i", 41, 1, pygen_variable_caps_Int64ImageEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"Unknown", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba32f", 1, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba16f", 2, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R32f", 3, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba8", 4, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba8Snorm", 5, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg32f", 6, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg16f", 7, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R11fG11fB10f", 8, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R16f", 9, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba16", 10, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgb10A2", 11, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg16", 12, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg8", 13, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R16", 14, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R8", 15, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba16Snorm", 16, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg16Snorm", 17, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg8Snorm", 18, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R16Snorm", 19, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R8Snorm", 20, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba32i", 21, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba16i", 22, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba8i", 23, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R32i", 24, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg32i", 25, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg16i", 26, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg8i", 27, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R16i", 28, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R8i", 29, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba32ui", 30, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba16ui", 31, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgba8ui", 32, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R32ui", 33, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rgb10a2ui", 34, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg32ui", 35, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg16ui", 36, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rg8ui", 37, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R16ui", 38, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R8ui", 39, 0, nullptr, 1, pygen_variable_caps_StorageImageExtendedFormats, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R64ui", 40, 0, nullptr, 1, pygen_variable_caps_Int64ImageEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"R64i", 41, 0, nullptr, 1, pygen_variable_caps_Int64ImageEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_ImageChannelOrderEntries[] = { - {"R", 0, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"A", 1, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RG", 2, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RA", 3, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RGB", 4, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RGBA", 5, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BGRA", 6, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ARGB", 7, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Intensity", 8, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Luminance", 9, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Rx", 10, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RGx", 11, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RGBx", 12, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Depth", 13, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DepthStencil", 14, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"sRGB", 15, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"sRGBx", 16, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"sRGBA", 17, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"sBGRA", 18, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ABGR", 19, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"R", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"A", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RG", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RA", 3, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RGB", 4, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RGBA", 5, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BGRA", 6, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ARGB", 7, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Intensity", 8, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Luminance", 9, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Rx", 10, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RGx", 11, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RGBx", 12, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Depth", 13, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DepthStencil", 14, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"sRGB", 15, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"sRGBx", 16, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"sRGBA", 17, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"sBGRA", 18, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ABGR", 19, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_ImageChannelDataTypeEntries[] = { - {"SnormInt8", 0, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SnormInt16", 1, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnormInt8", 2, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnormInt16", 3, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnormShort565", 4, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnormShort555", 5, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnormInt101010", 6, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SignedInt8", 7, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SignedInt16", 8, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SignedInt32", 9, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnsignedInt8", 10, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnsignedInt16", 11, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnsignedInt32", 12, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"HalfFloat", 13, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Float", 14, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnormInt24", 15, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnormInt101010_2", 16, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnsignedIntRaw10EXT", 19, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UnsignedIntRaw12EXT", 20, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"SnormInt8", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SnormInt16", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnormInt8", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnormInt16", 3, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnormShort565", 4, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnormShort555", 5, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnormInt101010", 6, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SignedInt8", 7, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SignedInt16", 8, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SignedInt32", 9, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnsignedInt8", 10, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnsignedInt16", 11, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnsignedInt32", 12, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"HalfFloat", 13, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Float", 14, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnormInt24", 15, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnormInt101010_2", 16, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnsignedIntRaw10EXT", 19, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnsignedIntRaw12EXT", 20, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UnormInt2_101010EXT", 21, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_FPRoundingModeEntries[] = { - {"RTE", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RTZ", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RTP", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RTN", 3, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"RTE", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RTZ", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RTP", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RTN", 3, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_FPDenormModeEntries[] = { - {"Preserve", 0, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"FlushToZero", 1, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"Preserve", 0, 0, nullptr, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"FlushToZero", 1, 0, nullptr, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_QuantizationModesEntries[] = { - {"TRN", 0, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"TRN_ZERO", 1, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RND", 2, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RND_ZERO", 3, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RND_INF", 4, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RND_MIN_INF", 5, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RND_CONV", 6, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RND_CONV_ODD", 7, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"TRN", 0, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"TRN_ZERO", 1, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RND", 2, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RND_ZERO", 3, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RND_INF", 4, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RND_MIN_INF", 5, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RND_CONV", 6, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RND_CONV_ODD", 7, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_FPOperationModeEntries[] = { - {"IEEE", 0, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"ALT", 1, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"IEEE", 0, 0, nullptr, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ALT", 1, 0, nullptr, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_OverflowModesEntries[] = { - {"WRAP", 0, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SAT", 1, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SAT_ZERO", 2, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SAT_SYM", 3, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"WRAP", 0, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SAT", 1, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SAT_ZERO", 2, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SAT_SYM", 3, 0, nullptr, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_LinkageTypeEntries[] = { - {"Export", 0, 1, pygen_variable_caps_Linkage, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Import", 1, 1, pygen_variable_caps_Linkage, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LinkOnceODR", 2, 1, pygen_variable_caps_Linkage, 1, pygen_variable_exts_SPV_KHR_linkonce_odr, {}, 0xffffffffu, 0xffffffffu} + {"Export", 0, 0, nullptr, 1, pygen_variable_caps_Linkage, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Import", 1, 0, nullptr, 1, pygen_variable_caps_Linkage, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LinkOnceODR", 2, 0, nullptr, 1, pygen_variable_caps_Linkage, 1, pygen_variable_exts_SPV_KHR_linkonce_odr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_AccessQualifierEntries[] = { - {"ReadOnly", 0, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WriteOnly", 1, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ReadWrite", 2, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"ReadOnly", 0, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WriteOnly", 1, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ReadWrite", 2, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_HostAccessQualifierEntries[] = { - {"NoneINTEL", 0, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"ReadINTEL", 1, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"WriteINTEL", 2, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"ReadWriteINTEL", 3, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"NoneINTEL", 0, 0, nullptr, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ReadINTEL", 1, 0, nullptr, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"WriteINTEL", 2, 0, nullptr, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ReadWriteINTEL", 3, 0, nullptr, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_FunctionParameterAttributeEntries[] = { - {"Zext", 0, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Sext", 1, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ByVal", 2, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Sret", 3, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NoAlias", 4, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NoCapture", 5, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NoWrite", 6, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NoReadWrite", 7, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"RuntimeAlignedINTEL", 5940, 1, pygen_variable_caps_RuntimeAlignedAttributeINTEL, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"Zext", 0, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Sext", 1, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ByVal", 2, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Sret", 3, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NoAlias", 4, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NoCapture", 5, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NoWrite", 6, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NoReadWrite", 7, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"RuntimeAlignedINTEL", 5940, 0, nullptr, 1, pygen_variable_caps_RuntimeAlignedAttributeINTEL, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_DecorationEntries[] = { - {"RelaxedPrecision", 0, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SpecId", 1, 2, pygen_variable_caps_ShaderKernel, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Block", 2, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BufferBlock", 3, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), SPV_SPIRV_VERSION_WORD(1,3)}, - {"RowMajor", 4, 1, pygen_variable_caps_Matrix, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ColMajor", 5, 1, pygen_variable_caps_Matrix, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ArrayStride", 6, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MatrixStride", 7, 1, pygen_variable_caps_Matrix, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GLSLShared", 8, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GLSLPacked", 9, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CPacked", 10, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"BuiltIn", 11, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_BUILT_IN}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NoPerspective", 13, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Flat", 14, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Patch", 15, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Centroid", 16, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Sample", 17, 1, pygen_variable_caps_SampleRateShading, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Invariant", 18, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Restrict", 19, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Aliased", 20, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Volatile", 21, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Constant", 22, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Coherent", 23, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NonWritable", 24, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NonReadable", 25, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Uniform", 26, 2, pygen_variable_caps_ShaderUniformDecoration, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UniformId", 27, 2, pygen_variable_caps_ShaderUniformDecoration, 0, nullptr, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"SaturatedConversion", 28, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Stream", 29, 1, pygen_variable_caps_GeometryStreams, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Location", 30, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Component", 31, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Index", 32, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Binding", 33, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DescriptorSet", 34, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Offset", 35, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"XfbBuffer", 36, 1, pygen_variable_caps_TransformFeedback, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"XfbStride", 37, 1, pygen_variable_caps_TransformFeedback, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FuncParamAttr", 38, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FPRoundingMode", 39, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_FP_ROUNDING_MODE}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FPFastMathMode", 40, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LinkageAttributes", 41, 1, pygen_variable_caps_Linkage, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_LINKAGE_TYPE}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NoContraction", 42, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InputAttachmentIndex", 43, 1, pygen_variable_caps_InputAttachment, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Alignment", 44, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MaxByteOffset", 45, 1, pygen_variable_caps_Addresses, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"AlignmentId", 46, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, - {"MaxByteOffsetId", 47, 1, pygen_variable_caps_Addresses, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, - {"NoSignedWrap", 4469, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_no_integer_wrap_decoration, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"NoUnsignedWrap", 4470, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_no_integer_wrap_decoration, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"WeightTextureQCOM", 4487, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, - {"BlockMatchTextureQCOM", 4488, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, - {"ExplicitInterpAMD", 4999, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, - {"NodeSharesPayloadLimitsWithAMDX", 5019, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"NodeMaxPayloadsAMDX", 5020, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"TrackFinishWritingAMDX", 5078, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"PayloadNodeNameAMDX", 5091, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, - {"OverrideCoverageNV", 5248, 1, pygen_variable_caps_SampleMaskOverrideCoverageNV, 1, pygen_variable_exts_SPV_NV_sample_mask_override_coverage, {}, 0xffffffffu, 0xffffffffu}, - {"PassthroughNV", 5250, 1, pygen_variable_caps_GeometryShaderPassthroughNV, 1, pygen_variable_exts_SPV_NV_geometry_shader_passthrough, {}, 0xffffffffu, 0xffffffffu}, - {"ViewportRelativeNV", 5252, 1, pygen_variable_caps_ShaderViewportMaskNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SecondaryViewportRelativeNV", 5256, 1, pygen_variable_caps_ShaderStereoViewNV, 1, pygen_variable_exts_SPV_NV_stereo_view_rendering, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PerPrimitiveNV", 5271, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"PerPrimitiveEXT", 5271, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"PerViewNV", 5272, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"PerTaskNV", 5273, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"PerVertexKHR", 5285, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, - {"PerVertexNV", 5285, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, - {"NonUniform", 5300, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"NonUniformEXT", 5300, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"RestrictPointer", 5355, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"RestrictPointerEXT", 5355, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"AliasedPointer", 5356, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"AliasedPointerEXT", 5356, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"HitObjectShaderRecordBufferNV", 5386, 1, pygen_variable_caps_ShaderInvocationReorderNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"BindlessSamplerNV", 5398, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"BindlessImageNV", 5399, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"BoundSamplerNV", 5400, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"BoundImageNV", 5401, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SIMTCallINTEL", 5599, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"ReferencedIndirectlyINTEL", 5602, 1, pygen_variable_caps_IndirectReferencesINTEL, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu}, - {"ClobberINTEL", 5607, 1, pygen_variable_caps_AsmINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, - {"SideEffectsINTEL", 5608, 1, pygen_variable_caps_AsmINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"VectorComputeVariableINTEL", 5624, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"FuncParamIOKindINTEL", 5625, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"VectorComputeFunctionINTEL", 5626, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"StackCallINTEL", 5627, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"GlobalVariableOffsetINTEL", 5628, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"CounterBuffer", 5634, 0, nullptr, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"HlslCounterBufferGOOGLE", 5634, 0, nullptr, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"UserSemantic", 5635, 0, nullptr, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, {SPV_OPERAND_TYPE_LITERAL_STRING}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"HlslSemanticGOOGLE", 5635, 0, nullptr, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, - {"UserTypeGOOGLE", 5636, 0, nullptr, 1, pygen_variable_exts_SPV_GOOGLE_user_type, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, - {"FunctionRoundingModeINTEL", 5822, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_FP_ROUNDING_MODE}, 0xffffffffu, 0xffffffffu}, - {"FunctionDenormModeINTEL", 5823, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_FPDENORM_MODE}, 0xffffffffu, 0xffffffffu}, - {"RegisterINTEL", 5825, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"MemoryINTEL", 5826, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, - {"NumbanksINTEL", 5827, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"BankwidthINTEL", 5828, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MaxPrivateCopiesINTEL", 5829, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"SinglepumpINTEL", 5830, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"DoublepumpINTEL", 5831, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"MaxReplicatesINTEL", 5832, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"SimpleDualPortINTEL", 5833, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"MergeINTEL", 5834, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, - {"BankBitsINTEL", 5835, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"ForcePow2DepthINTEL", 5836, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"BurstCoalesceINTEL", 5899, 1, pygen_variable_caps_FPGAMemoryAccessesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"CacheSizeINTEL", 5900, 1, pygen_variable_caps_FPGAMemoryAccessesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"DontStaticallyCoalesceINTEL", 5901, 1, pygen_variable_caps_FPGAMemoryAccessesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"PrefetchINTEL", 5902, 1, pygen_variable_caps_FPGAMemoryAccessesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"StallEnableINTEL", 5905, 1, pygen_variable_caps_FPGAClusterAttributesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"FuseLoopsInFunctionINTEL", 5907, 1, pygen_variable_caps_LoopFuseINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MathOpDSPModeINTEL", 5909, 1, pygen_variable_caps_FPGADSPControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"AliasScopeINTEL", 5914, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"NoAliasINTEL", 5915, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, - {"InitiationIntervalINTEL", 5917, 1, pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MaxConcurrencyINTEL", 5918, 1, pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"PipelineEnableINTEL", 5919, 1, pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"BufferLocationINTEL", 5921, 1, pygen_variable_caps_FPGABufferLocationINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"IOPipeStorageINTEL", 5944, 1, pygen_variable_caps_IOPipesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"FunctionFloatingPointModeINTEL", 6080, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_FPOPERATION_MODE}, 0xffffffffu, 0xffffffffu}, - {"SingleElementVectorINTEL", 6085, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"VectorComputeCallableFunctionINTEL", 6087, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MediaBlockIOINTEL", 6140, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"InitModeINTEL", 6147, 1, pygen_variable_caps_GlobalVariableFPGADecorationsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_INITIALIZATION_MODE_QUALIFIER}, 0xffffffffu, 0xffffffffu}, - {"ImplementInRegisterMapINTEL", 6148, 1, pygen_variable_caps_GlobalVariableFPGADecorationsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"HostAccessINTEL", 6168, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER, SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, - {"FPMaxErrorDecorationINTEL", 6170, 1, pygen_variable_caps_FPMaxErrorINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_FLOAT}, 0xffffffffu, 0xffffffffu}, - {"LatencyControlLabelINTEL", 6172, 1, pygen_variable_caps_FPGALatencyControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"LatencyControlConstraintINTEL", 6173, 1, pygen_variable_caps_FPGALatencyControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"ConduitKernelArgumentINTEL", 6175, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RegisterMapKernelArgumentINTEL", 6176, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MMHostInterfaceAddressWidthINTEL", 6177, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MMHostInterfaceDataWidthINTEL", 6178, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MMHostInterfaceLatencyINTEL", 6179, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MMHostInterfaceReadWriteModeINTEL", 6180, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 0xffffffffu, 0xffffffffu}, - {"MMHostInterfaceMaxBurstINTEL", 6181, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MMHostInterfaceWaitRequestINTEL", 6182, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"StableKernelArgumentINTEL", 6183, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"RelaxedPrecision", 0, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SpecId", 1, 0, nullptr, 2, pygen_variable_caps_ShaderKernel, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Block", 2, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BufferBlock", 3, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), SPV_SPIRV_VERSION_WORD(1,3)}, + {"RowMajor", 4, 0, nullptr, 1, pygen_variable_caps_Matrix, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ColMajor", 5, 0, nullptr, 1, pygen_variable_caps_Matrix, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ArrayStride", 6, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MatrixStride", 7, 0, nullptr, 1, pygen_variable_caps_Matrix, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GLSLShared", 8, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GLSLPacked", 9, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CPacked", 10, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"BuiltIn", 11, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_BUILT_IN}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NoPerspective", 13, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Flat", 14, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Patch", 15, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Centroid", 16, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Sample", 17, 0, nullptr, 1, pygen_variable_caps_SampleRateShading, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Invariant", 18, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Restrict", 19, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Aliased", 20, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Volatile", 21, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Constant", 22, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Coherent", 23, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NonWritable", 24, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NonReadable", 25, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Uniform", 26, 0, nullptr, 2, pygen_variable_caps_ShaderUniformDecoration, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UniformId", 27, 0, nullptr, 2, pygen_variable_caps_ShaderUniformDecoration, 0, nullptr, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"SaturatedConversion", 28, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Stream", 29, 0, nullptr, 1, pygen_variable_caps_GeometryStreams, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Location", 30, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Component", 31, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Index", 32, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Binding", 33, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DescriptorSet", 34, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Offset", 35, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"XfbBuffer", 36, 0, nullptr, 1, pygen_variable_caps_TransformFeedback, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"XfbStride", 37, 0, nullptr, 1, pygen_variable_caps_TransformFeedback, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FuncParamAttr", 38, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FPRoundingMode", 39, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_FP_ROUNDING_MODE}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FPFastMathMode", 40, 0, nullptr, 2, pygen_variable_caps_KernelFloatControls2, 0, nullptr, {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LinkageAttributes", 41, 0, nullptr, 1, pygen_variable_caps_Linkage, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_LINKAGE_TYPE}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NoContraction", 42, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InputAttachmentIndex", 43, 0, nullptr, 1, pygen_variable_caps_InputAttachment, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Alignment", 44, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MaxByteOffset", 45, 0, nullptr, 1, pygen_variable_caps_Addresses, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"AlignmentId", 46, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"MaxByteOffsetId", 47, 0, nullptr, 1, pygen_variable_caps_Addresses, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"NoSignedWrap", 4469, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_no_integer_wrap_decoration, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"NoUnsignedWrap", 4470, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_no_integer_wrap_decoration, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"WeightTextureQCOM", 4487, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, + {"BlockMatchTextureQCOM", 4488, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, + {"BlockMatchSamplerQCOM", 4499, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing2, {}, 0xffffffffu, 0xffffffffu}, + {"ExplicitInterpAMD", 4999, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, + {"NodeSharesPayloadLimitsWithAMDX", 5019, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"NodeMaxPayloadsAMDX", 5020, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"TrackFinishWritingAMDX", 5078, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"PayloadNodeNameAMDX", 5091, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"PayloadNodeBaseIndexAMDX", 5098, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"PayloadNodeSparseArrayAMDX", 5099, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"PayloadNodeArraySizeAMDX", 5100, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"PayloadDispatchIndirectAMDX", 5105, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"OverrideCoverageNV", 5248, 0, nullptr, 1, pygen_variable_caps_SampleMaskOverrideCoverageNV, 1, pygen_variable_exts_SPV_NV_sample_mask_override_coverage, {}, 0xffffffffu, 0xffffffffu}, + {"PassthroughNV", 5250, 0, nullptr, 1, pygen_variable_caps_GeometryShaderPassthroughNV, 1, pygen_variable_exts_SPV_NV_geometry_shader_passthrough, {}, 0xffffffffu, 0xffffffffu}, + {"ViewportRelativeNV", 5252, 0, nullptr, 1, pygen_variable_caps_ShaderViewportMaskNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SecondaryViewportRelativeNV", 5256, 0, nullptr, 1, pygen_variable_caps_ShaderStereoViewNV, 1, pygen_variable_exts_SPV_NV_stereo_view_rendering, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"PerPrimitiveEXT", 5271, 1, pygen_variable_aliases_PerPrimitiveNV, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"PerViewNV", 5272, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"PerTaskNV", 5273, 0, nullptr, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"PerVertexKHR", 5285, 1, pygen_variable_aliases_PerVertexNV, 1, pygen_variable_caps_FragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, + {"NonUniform", 5300, 1, pygen_variable_aliases_NonUniformEXT, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"RestrictPointer", 5355, 1, pygen_variable_aliases_RestrictPointerEXT, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"AliasedPointer", 5356, 1, pygen_variable_aliases_AliasedPointerEXT, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"HitObjectShaderRecordBufferNV", 5386, 0, nullptr, 1, pygen_variable_caps_ShaderInvocationReorderNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"BindlessSamplerNV", 5398, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"BindlessImageNV", 5399, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"BoundSamplerNV", 5400, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"BoundImageNV", 5401, 0, nullptr, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SIMTCallINTEL", 5599, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"ReferencedIndirectlyINTEL", 5602, 0, nullptr, 1, pygen_variable_caps_IndirectReferencesINTEL, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu}, + {"ClobberINTEL", 5607, 0, nullptr, 1, pygen_variable_caps_AsmINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, + {"SideEffectsINTEL", 5608, 0, nullptr, 1, pygen_variable_caps_AsmINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"VectorComputeVariableINTEL", 5624, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"FuncParamIOKindINTEL", 5625, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"VectorComputeFunctionINTEL", 5626, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"StackCallINTEL", 5627, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"GlobalVariableOffsetINTEL", 5628, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"CounterBuffer", 5634, 1, pygen_variable_aliases_HlslCounterBufferGOOGLE, 0, nullptr, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"UserSemantic", 5635, 1, pygen_variable_aliases_HlslSemanticGOOGLE, 0, nullptr, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, {SPV_OPERAND_TYPE_LITERAL_STRING}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"UserTypeGOOGLE", 5636, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_GOOGLE_user_type, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, + {"FunctionRoundingModeINTEL", 5822, 0, nullptr, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_FP_ROUNDING_MODE}, 0xffffffffu, 0xffffffffu}, + {"FunctionDenormModeINTEL", 5823, 0, nullptr, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_FPDENORM_MODE}, 0xffffffffu, 0xffffffffu}, + {"RegisterINTEL", 5825, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"MemoryINTEL", 5826, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, + {"NumbanksINTEL", 5827, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"BankwidthINTEL", 5828, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxPrivateCopiesINTEL", 5829, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"SinglepumpINTEL", 5830, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"DoublepumpINTEL", 5831, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"MaxReplicatesINTEL", 5832, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"SimpleDualPortINTEL", 5833, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"MergeINTEL", 5834, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, + {"BankBitsINTEL", 5835, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"ForcePow2DepthINTEL", 5836, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"StridesizeINTEL", 5883, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"WordsizeINTEL", 5884, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"TrueDualPortINTEL", 5885, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAttributesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"BurstCoalesceINTEL", 5899, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAccessesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"CacheSizeINTEL", 5900, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAccessesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"DontStaticallyCoalesceINTEL", 5901, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAccessesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"PrefetchINTEL", 5902, 0, nullptr, 1, pygen_variable_caps_FPGAMemoryAccessesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"StallEnableINTEL", 5905, 0, nullptr, 1, pygen_variable_caps_FPGAClusterAttributesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"FuseLoopsInFunctionINTEL", 5907, 0, nullptr, 1, pygen_variable_caps_LoopFuseINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MathOpDSPModeINTEL", 5909, 0, nullptr, 1, pygen_variable_caps_FPGADSPControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"AliasScopeINTEL", 5914, 0, nullptr, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"NoAliasINTEL", 5915, 0, nullptr, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"InitiationIntervalINTEL", 5917, 0, nullptr, 1, pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxConcurrencyINTEL", 5918, 0, nullptr, 1, pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"PipelineEnableINTEL", 5919, 0, nullptr, 1, pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"BufferLocationINTEL", 5921, 0, nullptr, 1, pygen_variable_caps_FPGABufferLocationINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"IOPipeStorageINTEL", 5944, 0, nullptr, 1, pygen_variable_caps_IOPipesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"FunctionFloatingPointModeINTEL", 6080, 0, nullptr, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_FPOPERATION_MODE}, 0xffffffffu, 0xffffffffu}, + {"SingleElementVectorINTEL", 6085, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"VectorComputeCallableFunctionINTEL", 6087, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MediaBlockIOINTEL", 6140, 0, nullptr, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"StallFreeINTEL", 6151, 0, nullptr, 1, pygen_variable_caps_FPGAClusterAttributesV2INTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"FPMaxErrorDecorationINTEL", 6170, 0, nullptr, 1, pygen_variable_caps_FPMaxErrorINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_FLOAT}, 0xffffffffu, 0xffffffffu}, + {"LatencyControlLabelINTEL", 6172, 0, nullptr, 1, pygen_variable_caps_FPGALatencyControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"LatencyControlConstraintINTEL", 6173, 0, nullptr, 1, pygen_variable_caps_FPGALatencyControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"ConduitKernelArgumentINTEL", 6175, 0, nullptr, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RegisterMapKernelArgumentINTEL", 6176, 0, nullptr, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceAddressWidthINTEL", 6177, 0, nullptr, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceDataWidthINTEL", 6178, 0, nullptr, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceLatencyINTEL", 6179, 0, nullptr, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceReadWriteModeINTEL", 6180, 0, nullptr, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceMaxBurstINTEL", 6181, 0, nullptr, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceWaitRequestINTEL", 6182, 0, nullptr, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"StableKernelArgumentINTEL", 6183, 0, nullptr, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"HostAccessINTEL", 6188, 0, nullptr, 1, pygen_variable_caps_GlobalVariableHostAccessINTEL, 0, nullptr, {SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER, SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu}, + {"InitModeINTEL", 6190, 0, nullptr, 1, pygen_variable_caps_GlobalVariableFPGADecorationsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_INITIALIZATION_MODE_QUALIFIER}, 0xffffffffu, 0xffffffffu}, + {"ImplementInRegisterMapINTEL", 6191, 0, nullptr, 1, pygen_variable_caps_GlobalVariableFPGADecorationsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"CacheControlLoadINTEL", 6442, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL}, 0xffffffffu, 0xffffffffu}, + {"CacheControlStoreINTEL", 6443, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_STORE_CACHE_CONTROL}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_BuiltInEntries[] = { - {"Position", 0, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PointSize", 1, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ClipDistance", 3, 1, pygen_variable_caps_ClipDistance, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CullDistance", 4, 1, pygen_variable_caps_CullDistance, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VertexId", 5, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InstanceId", 6, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PrimitiveId", 7, 6, pygen_variable_caps_GeometryTessellationRayTracingNVRayTracingKHRMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InvocationId", 8, 2, pygen_variable_caps_GeometryTessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Layer", 9, 5, pygen_variable_caps_GeometryShaderLayerShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ViewportIndex", 10, 5, pygen_variable_caps_MultiViewportShaderViewportIndexShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TessLevelOuter", 11, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TessLevelInner", 12, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TessCoord", 13, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PatchVertices", 14, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FragCoord", 15, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"PointCoord", 16, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FrontFacing", 17, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SampleId", 18, 1, pygen_variable_caps_SampleRateShading, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SamplePosition", 19, 1, pygen_variable_caps_SampleRateShading, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SampleMask", 20, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"FragDepth", 22, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"HelperInvocation", 23, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NumWorkgroups", 24, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WorkgroupSize", 25, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WorkgroupId", 26, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LocalInvocationId", 27, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GlobalInvocationId", 28, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LocalInvocationIndex", 29, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WorkDim", 30, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GlobalSize", 31, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"EnqueuedWorkgroupSize", 32, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GlobalOffset", 33, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GlobalLinearId", 34, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SubgroupSize", 36, 3, pygen_variable_caps_KernelGroupNonUniformSubgroupBallotKHR, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SubgroupMaxSize", 37, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NumSubgroups", 38, 2, pygen_variable_caps_KernelGroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"NumEnqueuedSubgroups", 39, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SubgroupId", 40, 2, pygen_variable_caps_KernelGroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SubgroupLocalInvocationId", 41, 3, pygen_variable_caps_KernelGroupNonUniformSubgroupBallotKHR, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"VertexIndex", 42, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InstanceIndex", 43, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CoreIDARM", 4160, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CoreCountARM", 4161, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CoreMaxIDARM", 4162, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WarpIDARM", 4163, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WarpMaxIDARM", 4164, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SubgroupEqMask", 4416, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"SubgroupEqMaskKHR", 4416, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"SubgroupGeMask", 4417, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"SubgroupGeMaskKHR", 4417, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"SubgroupGtMask", 4418, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"SubgroupGtMaskKHR", 4418, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"SubgroupLeMask", 4419, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"SubgroupLeMaskKHR", 4419, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"SubgroupLtMask", 4420, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"SubgroupLtMaskKHR", 4420, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"BaseVertex", 4424, 1, pygen_variable_caps_DrawParameters, 1, pygen_variable_exts_SPV_KHR_shader_draw_parameters, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"BaseInstance", 4425, 1, pygen_variable_caps_DrawParameters, 1, pygen_variable_exts_SPV_KHR_shader_draw_parameters, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"DrawIndex", 4426, 3, pygen_variable_caps_DrawParametersMeshShadingNVMeshShadingEXT, 3, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_KHR_shader_draw_parametersSPV_NV_mesh_shader, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"PrimitiveShadingRateKHR", 4432, 1, pygen_variable_caps_FragmentShadingRateKHR, 1, pygen_variable_exts_SPV_KHR_fragment_shading_rate, {}, 0xffffffffu, 0xffffffffu}, - {"DeviceIndex", 4438, 1, pygen_variable_caps_DeviceGroup, 1, pygen_variable_exts_SPV_KHR_device_group, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"ViewIndex", 4440, 1, pygen_variable_caps_MultiView, 1, pygen_variable_exts_SPV_KHR_multiview, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"ShadingRateKHR", 4444, 1, pygen_variable_caps_FragmentShadingRateKHR, 1, pygen_variable_exts_SPV_KHR_fragment_shading_rate, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordNoPerspAMD", 4992, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordNoPerspCentroidAMD", 4993, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordNoPerspSampleAMD", 4994, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordSmoothAMD", 4995, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordSmoothCentroidAMD", 4996, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordSmoothSampleAMD", 4997, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordPullModelAMD", 4998, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, - {"FragStencilRefEXT", 5014, 1, pygen_variable_caps_StencilExportEXT, 1, pygen_variable_exts_SPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, - {"CoalescedInputCountAMDX", 5021, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderIndexAMDX", 5073, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"ViewportMaskNV", 5253, 2, pygen_variable_caps_ShaderViewportMaskNVMeshShadingNV, 2, pygen_variable_exts_SPV_NV_mesh_shaderSPV_NV_viewport_array2, {}, 0xffffffffu, 0xffffffffu}, - {"SecondaryPositionNV", 5257, 1, pygen_variable_caps_ShaderStereoViewNV, 1, pygen_variable_exts_SPV_NV_stereo_view_rendering, {}, 0xffffffffu, 0xffffffffu}, - {"SecondaryViewportMaskNV", 5258, 1, pygen_variable_caps_ShaderStereoViewNV, 1, pygen_variable_exts_SPV_NV_stereo_view_rendering, {}, 0xffffffffu, 0xffffffffu}, - {"PositionPerViewNV", 5261, 2, pygen_variable_caps_PerViewAttributesNVMeshShadingNV, 2, pygen_variable_exts_SPV_NVX_multiview_per_view_attributesSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"ViewportMaskPerViewNV", 5262, 2, pygen_variable_caps_PerViewAttributesNVMeshShadingNV, 2, pygen_variable_exts_SPV_NVX_multiview_per_view_attributesSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"FullyCoveredEXT", 5264, 1, pygen_variable_caps_FragmentFullyCoveredEXT, 1, pygen_variable_exts_SPV_EXT_fragment_fully_covered, {}, 0xffffffffu, 0xffffffffu}, - {"TaskCountNV", 5274, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"PrimitiveCountNV", 5275, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"PrimitiveIndicesNV", 5276, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"ClipDistancePerViewNV", 5277, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"CullDistancePerViewNV", 5278, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"LayerPerViewNV", 5279, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"MeshViewCountNV", 5280, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"MeshViewIndicesNV", 5281, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordKHR", 5286, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordNV", 5286, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordNoPerspKHR", 5287, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, - {"BaryCoordNoPerspNV", 5287, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, - {"FragSizeEXT", 5292, 2, pygen_variable_caps_FragmentDensityEXTShadingRateNV, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentSizeNV", 5292, 2, pygen_variable_caps_ShadingRateNVFragmentDensityEXT, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu}, - {"FragInvocationCountEXT", 5293, 2, pygen_variable_caps_FragmentDensityEXTShadingRateNV, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu}, - {"InvocationsPerPixelNV", 5293, 2, pygen_variable_caps_ShadingRateNVFragmentDensityEXT, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu}, - {"PrimitivePointIndicesEXT", 5294, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"PrimitiveLineIndicesEXT", 5295, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"PrimitiveTriangleIndicesEXT", 5296, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"CullPrimitiveEXT", 5299, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"LaunchIdNV", 5319, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"LaunchIdKHR", 5319, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"LaunchSizeNV", 5320, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"LaunchSizeKHR", 5320, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"WorldRayOriginNV", 5321, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"WorldRayOriginKHR", 5321, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"WorldRayDirectionNV", 5322, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"WorldRayDirectionKHR", 5322, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"ObjectRayOriginNV", 5323, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"ObjectRayOriginKHR", 5323, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"ObjectRayDirectionNV", 5324, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"ObjectRayDirectionKHR", 5324, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"RayTminNV", 5325, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"RayTminKHR", 5325, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"RayTmaxNV", 5326, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"RayTmaxKHR", 5326, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"InstanceCustomIndexNV", 5327, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"InstanceCustomIndexKHR", 5327, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"ObjectToWorldNV", 5330, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"ObjectToWorldKHR", 5330, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"WorldToObjectNV", 5331, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"WorldToObjectKHR", 5331, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"HitTNV", 5332, 1, pygen_variable_caps_RayTracingNV, 1, pygen_variable_exts_SPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"HitKindNV", 5333, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"HitKindKHR", 5333, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"CurrentRayTimeNV", 5334, 1, pygen_variable_caps_RayTracingMotionBlurNV, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, {}, 0xffffffffu, 0xffffffffu}, - {"HitTriangleVertexPositionsKHR", 5335, 1, pygen_variable_caps_RayTracingPositionFetchKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"IncomingRayFlagsNV", 5351, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"IncomingRayFlagsKHR", 5351, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"RayGeometryIndexKHR", 5352, 1, pygen_variable_caps_RayTracingKHR, 1, pygen_variable_exts_SPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"WarpsPerSMNV", 5374, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, - {"SMCountNV", 5375, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, - {"WarpIDNV", 5376, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, - {"SMIDNV", 5377, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, - {"CullMaskKHR", 6021, 1, pygen_variable_caps_RayCullMaskKHR, 1, pygen_variable_exts_SPV_KHR_ray_cull_mask, {}, 0xffffffffu, 0xffffffffu} + {"Position", 0, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PointSize", 1, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ClipDistance", 3, 0, nullptr, 1, pygen_variable_caps_ClipDistance, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CullDistance", 4, 0, nullptr, 1, pygen_variable_caps_CullDistance, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VertexId", 5, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InstanceId", 6, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PrimitiveId", 7, 0, nullptr, 6, pygen_variable_caps_GeometryTessellationRayTracingNVRayTracingKHRMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InvocationId", 8, 0, nullptr, 2, pygen_variable_caps_GeometryTessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Layer", 9, 0, nullptr, 5, pygen_variable_caps_GeometryShaderLayerShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ViewportIndex", 10, 0, nullptr, 5, pygen_variable_caps_MultiViewportShaderViewportIndexShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TessLevelOuter", 11, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TessLevelInner", 12, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TessCoord", 13, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PatchVertices", 14, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FragCoord", 15, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"PointCoord", 16, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FrontFacing", 17, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SampleId", 18, 0, nullptr, 1, pygen_variable_caps_SampleRateShading, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SamplePosition", 19, 0, nullptr, 1, pygen_variable_caps_SampleRateShading, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SampleMask", 20, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"FragDepth", 22, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"HelperInvocation", 23, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NumWorkgroups", 24, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WorkgroupSize", 25, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WorkgroupId", 26, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LocalInvocationId", 27, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GlobalInvocationId", 28, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LocalInvocationIndex", 29, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WorkDim", 30, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GlobalSize", 31, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"EnqueuedWorkgroupSize", 32, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GlobalOffset", 33, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GlobalLinearId", 34, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SubgroupSize", 36, 0, nullptr, 3, pygen_variable_caps_KernelGroupNonUniformSubgroupBallotKHR, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SubgroupMaxSize", 37, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NumSubgroups", 38, 0, nullptr, 2, pygen_variable_caps_KernelGroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"NumEnqueuedSubgroups", 39, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SubgroupId", 40, 0, nullptr, 2, pygen_variable_caps_KernelGroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SubgroupLocalInvocationId", 41, 0, nullptr, 3, pygen_variable_caps_KernelGroupNonUniformSubgroupBallotKHR, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"VertexIndex", 42, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InstanceIndex", 43, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CoreIDARM", 4160, 0, nullptr, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CoreCountARM", 4161, 0, nullptr, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CoreMaxIDARM", 4162, 0, nullptr, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WarpIDARM", 4163, 0, nullptr, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WarpMaxIDARM", 4164, 0, nullptr, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SubgroupEqMask", 4416, 1, pygen_variable_aliases_SubgroupEqMaskKHR, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"SubgroupGeMask", 4417, 1, pygen_variable_aliases_SubgroupGeMaskKHR, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"SubgroupGtMask", 4418, 1, pygen_variable_aliases_SubgroupGtMaskKHR, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"SubgroupLeMask", 4419, 1, pygen_variable_aliases_SubgroupLeMaskKHR, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"SubgroupLtMask", 4420, 1, pygen_variable_aliases_SubgroupLtMaskKHR, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"BaseVertex", 4424, 0, nullptr, 1, pygen_variable_caps_DrawParameters, 1, pygen_variable_exts_SPV_KHR_shader_draw_parameters, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"BaseInstance", 4425, 0, nullptr, 1, pygen_variable_caps_DrawParameters, 1, pygen_variable_exts_SPV_KHR_shader_draw_parameters, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"DrawIndex", 4426, 0, nullptr, 3, pygen_variable_caps_DrawParametersMeshShadingNVMeshShadingEXT, 3, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_KHR_shader_draw_parametersSPV_NV_mesh_shader, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"PrimitiveShadingRateKHR", 4432, 0, nullptr, 1, pygen_variable_caps_FragmentShadingRateKHR, 1, pygen_variable_exts_SPV_KHR_fragment_shading_rate, {}, 0xffffffffu, 0xffffffffu}, + {"DeviceIndex", 4438, 0, nullptr, 1, pygen_variable_caps_DeviceGroup, 1, pygen_variable_exts_SPV_KHR_device_group, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"ViewIndex", 4440, 0, nullptr, 1, pygen_variable_caps_MultiView, 1, pygen_variable_exts_SPV_KHR_multiview, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"ShadingRateKHR", 4444, 0, nullptr, 1, pygen_variable_caps_FragmentShadingRateKHR, 1, pygen_variable_exts_SPV_KHR_fragment_shading_rate, {}, 0xffffffffu, 0xffffffffu}, + {"BaryCoordNoPerspAMD", 4992, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, + {"BaryCoordNoPerspCentroidAMD", 4993, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, + {"BaryCoordNoPerspSampleAMD", 4994, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, + {"BaryCoordSmoothAMD", 4995, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, + {"BaryCoordSmoothCentroidAMD", 4996, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, + {"BaryCoordSmoothSampleAMD", 4997, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, + {"BaryCoordPullModelAMD", 4998, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, + {"FragStencilRefEXT", 5014, 0, nullptr, 1, pygen_variable_caps_StencilExportEXT, 1, pygen_variable_exts_SPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, + {"RemainingRecursionLevelsAMDX", 5021, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderIndexAMDX", 5073, 0, nullptr, 1, pygen_variable_caps_ShaderEnqueueAMDX, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ViewportMaskNV", 5253, 0, nullptr, 2, pygen_variable_caps_ShaderViewportMaskNVMeshShadingNV, 2, pygen_variable_exts_SPV_NV_mesh_shaderSPV_NV_viewport_array2, {}, 0xffffffffu, 0xffffffffu}, + {"SecondaryPositionNV", 5257, 0, nullptr, 1, pygen_variable_caps_ShaderStereoViewNV, 1, pygen_variable_exts_SPV_NV_stereo_view_rendering, {}, 0xffffffffu, 0xffffffffu}, + {"SecondaryViewportMaskNV", 5258, 0, nullptr, 1, pygen_variable_caps_ShaderStereoViewNV, 1, pygen_variable_exts_SPV_NV_stereo_view_rendering, {}, 0xffffffffu, 0xffffffffu}, + {"PositionPerViewNV", 5261, 0, nullptr, 2, pygen_variable_caps_PerViewAttributesNVMeshShadingNV, 2, pygen_variable_exts_SPV_NVX_multiview_per_view_attributesSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"ViewportMaskPerViewNV", 5262, 0, nullptr, 2, pygen_variable_caps_PerViewAttributesNVMeshShadingNV, 2, pygen_variable_exts_SPV_NVX_multiview_per_view_attributesSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"FullyCoveredEXT", 5264, 0, nullptr, 1, pygen_variable_caps_FragmentFullyCoveredEXT, 1, pygen_variable_exts_SPV_EXT_fragment_fully_covered, {}, 0xffffffffu, 0xffffffffu}, + {"TaskCountNV", 5274, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"PrimitiveCountNV", 5275, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"PrimitiveIndicesNV", 5276, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"ClipDistancePerViewNV", 5277, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"CullDistancePerViewNV", 5278, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"LayerPerViewNV", 5279, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"MeshViewCountNV", 5280, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"MeshViewIndicesNV", 5281, 0, nullptr, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"BaryCoordKHR", 5286, 1, pygen_variable_aliases_BaryCoordNV, 1, pygen_variable_caps_FragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, + {"BaryCoordNoPerspKHR", 5287, 1, pygen_variable_aliases_BaryCoordNoPerspNV, 1, pygen_variable_caps_FragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, + {"FragSizeEXT", 5292, 1, pygen_variable_aliases_FragmentSizeNV, 1, pygen_variable_caps_FragmentDensityEXT, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu}, + {"FragInvocationCountEXT", 5293, 1, pygen_variable_aliases_InvocationsPerPixelNV, 1, pygen_variable_caps_FragmentDensityEXT, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu}, + {"PrimitivePointIndicesEXT", 5294, 0, nullptr, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"PrimitiveLineIndicesEXT", 5295, 0, nullptr, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"PrimitiveTriangleIndicesEXT", 5296, 0, nullptr, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"CullPrimitiveEXT", 5299, 0, nullptr, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"LaunchIdKHR", 5319, 1, pygen_variable_aliases_LaunchIdNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"LaunchSizeKHR", 5320, 1, pygen_variable_aliases_LaunchSizeNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"WorldRayOriginKHR", 5321, 1, pygen_variable_aliases_WorldRayOriginNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"WorldRayDirectionKHR", 5322, 1, pygen_variable_aliases_WorldRayDirectionNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"ObjectRayOriginKHR", 5323, 1, pygen_variable_aliases_ObjectRayOriginNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"ObjectRayDirectionKHR", 5324, 1, pygen_variable_aliases_ObjectRayDirectionNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"RayTminKHR", 5325, 1, pygen_variable_aliases_RayTminNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"RayTmaxKHR", 5326, 1, pygen_variable_aliases_RayTmaxNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"InstanceCustomIndexKHR", 5327, 1, pygen_variable_aliases_InstanceCustomIndexNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"ObjectToWorldKHR", 5330, 1, pygen_variable_aliases_ObjectToWorldNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"WorldToObjectKHR", 5331, 1, pygen_variable_aliases_WorldToObjectNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"HitTNV", 5332, 0, nullptr, 1, pygen_variable_caps_RayTracingNV, 1, pygen_variable_exts_SPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"HitKindKHR", 5333, 1, pygen_variable_aliases_HitKindNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"CurrentRayTimeNV", 5334, 0, nullptr, 1, pygen_variable_caps_RayTracingMotionBlurNV, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, {}, 0xffffffffu, 0xffffffffu}, + {"HitTriangleVertexPositionsKHR", 5335, 0, nullptr, 1, pygen_variable_caps_RayTracingPositionFetchKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"HitMicroTriangleVertexPositionsNV", 5337, 0, nullptr, 1, pygen_variable_caps_RayTracingDisplacementMicromapNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"HitMicroTriangleVertexBarycentricsNV", 5344, 0, nullptr, 1, pygen_variable_caps_RayTracingDisplacementMicromapNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"IncomingRayFlagsKHR", 5351, 1, pygen_variable_aliases_IncomingRayFlagsNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"RayGeometryIndexKHR", 5352, 0, nullptr, 1, pygen_variable_caps_RayTracingKHR, 1, pygen_variable_exts_SPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"WarpsPerSMNV", 5374, 0, nullptr, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, + {"SMCountNV", 5375, 0, nullptr, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, + {"WarpIDNV", 5376, 0, nullptr, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, + {"SMIDNV", 5377, 0, nullptr, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, + {"HitKindFrontFacingMicroTriangleNV", 5405, 0, nullptr, 1, pygen_variable_caps_RayTracingDisplacementMicromapNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"HitKindBackFacingMicroTriangleNV", 5406, 0, nullptr, 1, pygen_variable_caps_RayTracingDisplacementMicromapNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"CullMaskKHR", 6021, 0, nullptr, 1, pygen_variable_caps_RayCullMaskKHR, 1, pygen_variable_exts_SPV_KHR_ray_cull_mask, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_ScopeEntries[] = { - {"CrossDevice", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Device", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Workgroup", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Subgroup", 3, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Invocation", 4, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"QueueFamily", 5, 1, pygen_variable_caps_VulkanMemoryModel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"QueueFamilyKHR", 5, 1, pygen_variable_caps_VulkanMemoryModel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"ShaderCallKHR", 6, 1, pygen_variable_caps_RayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"CrossDevice", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Device", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Workgroup", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Subgroup", 3, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Invocation", 4, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"QueueFamily", 5, 1, pygen_variable_aliases_QueueFamilyKHR, 1, pygen_variable_caps_VulkanMemoryModel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"ShaderCallKHR", 6, 0, nullptr, 1, pygen_variable_caps_RayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_GroupOperationEntries[] = { - {"Reduce", 0, 3, pygen_variable_caps_KernelGroupNonUniformArithmeticGroupNonUniformBallot, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InclusiveScan", 1, 3, pygen_variable_caps_KernelGroupNonUniformArithmeticGroupNonUniformBallot, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ExclusiveScan", 2, 3, pygen_variable_caps_KernelGroupNonUniformArithmeticGroupNonUniformBallot, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ClusteredReduce", 3, 1, pygen_variable_caps_GroupNonUniformClustered, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"PartitionedReduceNV", 6, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, {}, 0xffffffffu, 0xffffffffu}, - {"PartitionedInclusiveScanNV", 7, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, {}, 0xffffffffu, 0xffffffffu}, - {"PartitionedExclusiveScanNV", 8, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, {}, 0xffffffffu, 0xffffffffu} + {"Reduce", 0, 0, nullptr, 3, pygen_variable_caps_KernelGroupNonUniformArithmeticGroupNonUniformBallot, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InclusiveScan", 1, 0, nullptr, 3, pygen_variable_caps_KernelGroupNonUniformArithmeticGroupNonUniformBallot, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ExclusiveScan", 2, 0, nullptr, 3, pygen_variable_caps_KernelGroupNonUniformArithmeticGroupNonUniformBallot, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ClusteredReduce", 3, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformClustered, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"PartitionedReduceNV", 6, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, {}, 0xffffffffu, 0xffffffffu}, + {"PartitionedInclusiveScanNV", 7, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, {}, 0xffffffffu, 0xffffffffu}, + {"PartitionedExclusiveScanNV", 8, 0, nullptr, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_KernelEnqueueFlagsEntries[] = { - {"NoWait", 0, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WaitKernel", 1, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"WaitWorkGroup", 2, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} + {"NoWait", 0, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WaitKernel", 1, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"WaitWorkGroup", 2, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { - {"Matrix", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Shader", 1, 1, pygen_variable_caps_Matrix, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Geometry", 2, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Tessellation", 3, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Addresses", 4, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Linkage", 5, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Kernel", 6, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Vector16", 7, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Float16Buffer", 8, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Float16", 9, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Float64", 10, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Int64", 11, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Int64Atomics", 12, 1, pygen_variable_caps_Int64, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageBasic", 13, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageReadWrite", 14, 1, pygen_variable_caps_ImageBasic, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageMipmap", 15, 1, pygen_variable_caps_ImageBasic, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Pipes", 17, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Groups", 18, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DeviceEnqueue", 19, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"LiteralSampler", 20, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"AtomicStorage", 21, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Int16", 22, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TessellationPointSize", 23, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GeometryPointSize", 24, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageGatherExtended", 25, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"StorageImageMultisample", 27, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"UniformBufferArrayDynamicIndexing", 28, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SampledImageArrayDynamicIndexing", 29, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"StorageBufferArrayDynamicIndexing", 30, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"StorageImageArrayDynamicIndexing", 31, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ClipDistance", 32, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"CullDistance", 33, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageCubeArray", 34, 1, pygen_variable_caps_SampledCubeArray, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SampleRateShading", 35, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageRect", 36, 1, pygen_variable_caps_SampledRect, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SampledRect", 37, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GenericPointer", 38, 1, pygen_variable_caps_Addresses, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Int8", 39, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InputAttachment", 40, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SparseResidency", 41, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MinLod", 42, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Sampled1D", 43, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"Image1D", 44, 1, pygen_variable_caps_Sampled1D, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SampledCubeArray", 45, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SampledBuffer", 46, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageBuffer", 47, 1, pygen_variable_caps_SampledBuffer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageMSArray", 48, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"StorageImageExtendedFormats", 49, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"ImageQuery", 50, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"DerivativeControl", 51, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"InterpolationFunction", 52, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"TransformFeedback", 53, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"GeometryStreams", 54, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"StorageImageReadWithoutFormat", 55, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"StorageImageWriteWithoutFormat", 56, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"MultiViewport", 57, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, - {"SubgroupDispatch", 58, 1, pygen_variable_caps_DeviceEnqueue, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"NamedBarrier", 59, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"PipeStorage", 60, 1, pygen_variable_caps_Pipes, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"GroupNonUniform", 61, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformVote", 62, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformArithmetic", 63, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallot", 64, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffle", 65, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffleRelative", 66, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformClustered", 67, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformQuad", 68, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"ShaderLayer", 69, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"ShaderViewportIndex", 70, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"UniformDecoration", 71, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"CoreBuiltinsARM", 4165, 0, nullptr, 1, pygen_variable_exts_SPV_ARM_core_builtins, {}, 0xffffffffu, 0xffffffffu}, - {"TileImageColorReadAccessEXT", 4166, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_tile_image, {}, 0xffffffffu, 0xffffffffu}, - {"TileImageDepthReadAccessEXT", 4167, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_tile_image, {}, 0xffffffffu, 0xffffffffu}, - {"TileImageStencilReadAccessEXT", 4168, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_tile_image, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentShadingRateKHR", 4422, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_fragment_shading_rate, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupBallotKHR", 4423, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, 0xffffffffu, 0xffffffffu}, - {"DrawParameters", 4427, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_shader_draw_parameters, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"WorkgroupMemoryExplicitLayoutKHR", 4428, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_workgroup_memory_explicit_layout, {}, 0xffffffffu, 0xffffffffu}, - {"WorkgroupMemoryExplicitLayout8BitAccessKHR", 4429, 1, pygen_variable_caps_WorkgroupMemoryExplicitLayoutKHR, 1, pygen_variable_exts_SPV_KHR_workgroup_memory_explicit_layout, {}, 0xffffffffu, 0xffffffffu}, - {"WorkgroupMemoryExplicitLayout16BitAccessKHR", 4430, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_workgroup_memory_explicit_layout, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupVoteKHR", 4431, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, {}, 0xffffffffu, 0xffffffffu}, - {"StorageBuffer16BitAccess", 4433, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"StorageUniformBufferBlock16", 4433, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"UniformAndStorageBuffer16BitAccess", 4434, 2, pygen_variable_caps_StorageBuffer16BitAccessStorageUniformBufferBlock16, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"StorageUniform16", 4434, 2, pygen_variable_caps_StorageBuffer16BitAccessStorageUniformBufferBlock16, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"StoragePushConstant16", 4435, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"StorageInputOutput16", 4436, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"DeviceGroup", 4437, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_device_group, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"MultiView", 4439, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_multiview, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"VariablePointersStorageBuffer", 4441, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_variable_pointers, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"VariablePointers", 4442, 1, pygen_variable_caps_VariablePointersStorageBuffer, 1, pygen_variable_exts_SPV_KHR_variable_pointers, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"AtomicStorageOps", 4445, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_shader_atomic_counter_ops, {}, 0xffffffffu, 0xffffffffu}, - {"SampleMaskPostDepthCoverage", 4447, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_post_depth_coverage, {}, 0xffffffffu, 0xffffffffu}, - {"StorageBuffer8BitAccess", 4448, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_8bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"UniformAndStorageBuffer8BitAccess", 4449, 1, pygen_variable_caps_StorageBuffer8BitAccess, 1, pygen_variable_exts_SPV_KHR_8bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"StoragePushConstant8", 4450, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_8bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"DenormPreserve", 4464, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"DenormFlushToZero", 4465, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"SignedZeroInfNanPreserve", 4466, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"RoundingModeRTE", 4467, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"RoundingModeRTZ", 4468, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"RayQueryProvisionalKHR", 4471, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_query, {}, 0xffffffffu, 0xffffffffu}, - {"RayQueryKHR", 4472, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_query, {}, 0xffffffffu, 0xffffffffu}, - {"RayTraversalPrimitiveCullingKHR", 4478, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_querySPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"RayTracingKHR", 4479, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"TextureSampleWeightedQCOM", 4484, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, - {"TextureBoxFilterQCOM", 4485, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, - {"TextureBlockMatchQCOM", 4486, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, - {"Float16ImageAMD", 5008, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_gpu_shader_half_float_fetch, {}, 0xffffffffu, 0xffffffffu}, - {"ImageGatherBiasLodAMD", 5009, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_texture_gather_bias_lod, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentMaskAMD", 5010, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, {}, 0xffffffffu, 0xffffffffu}, - {"StencilExportEXT", 5013, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, - {"ImageReadWriteLodAMD", 5015, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_shader_image_load_store_lod, {}, 0xffffffffu, 0xffffffffu}, - {"Int64ImageEXT", 5016, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_shader_image_int64, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderClockKHR", 5055, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_shader_clock, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderEnqueueAMDX", 5067, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMDX_shader_enqueue, {}, 0xffffffffu, 0xffffffffu}, - {"SampleMaskOverrideCoverageNV", 5249, 1, pygen_variable_caps_SampleRateShading, 1, pygen_variable_exts_SPV_NV_sample_mask_override_coverage, {}, 0xffffffffu, 0xffffffffu}, - {"GeometryShaderPassthroughNV", 5251, 1, pygen_variable_caps_Geometry, 1, pygen_variable_exts_SPV_NV_geometry_shader_passthrough, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderViewportIndexLayerEXT", 5254, 1, pygen_variable_caps_MultiViewport, 2, pygen_variable_exts_SPV_EXT_shader_viewport_index_layerSPV_NV_viewport_array2, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderViewportIndexLayerNV", 5254, 1, pygen_variable_caps_MultiViewport, 2, pygen_variable_exts_SPV_EXT_shader_viewport_index_layerSPV_NV_viewport_array2, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderViewportMaskNV", 5255, 1, pygen_variable_caps_ShaderViewportIndexLayerNV, 1, pygen_variable_exts_SPV_NV_viewport_array2, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderStereoViewNV", 5259, 1, pygen_variable_caps_ShaderViewportMaskNV, 1, pygen_variable_exts_SPV_NV_stereo_view_rendering, {}, 0xffffffffu, 0xffffffffu}, - {"PerViewAttributesNV", 5260, 1, pygen_variable_caps_MultiView, 1, pygen_variable_exts_SPV_NVX_multiview_per_view_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentFullyCoveredEXT", 5265, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_fully_covered, {}, 0xffffffffu, 0xffffffffu}, - {"MeshShadingNV", 5266, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"ImageFootprintNV", 5282, 0, nullptr, 1, pygen_variable_exts_SPV_NV_shader_image_footprint, {}, 0xffffffffu, 0xffffffffu}, - {"MeshShadingEXT", 5283, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentBarycentricKHR", 5284, 0, nullptr, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentBarycentricNV", 5284, 0, nullptr, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, - {"ComputeDerivativeGroupQuadsNV", 5288, 0, nullptr, 1, pygen_variable_exts_SPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentDensityEXT", 5291, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu}, - {"ShadingRateNV", 5291, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu}, - {"GroupNonUniformPartitionedNV", 5297, 0, nullptr, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderNonUniform", 5301, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"ShaderNonUniformEXT", 5301, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"RuntimeDescriptorArray", 5302, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"RuntimeDescriptorArrayEXT", 5302, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"InputAttachmentArrayDynamicIndexing", 5303, 1, pygen_variable_caps_InputAttachment, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"InputAttachmentArrayDynamicIndexingEXT", 5303, 1, pygen_variable_caps_InputAttachment, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"UniformTexelBufferArrayDynamicIndexing", 5304, 1, pygen_variable_caps_SampledBuffer, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"UniformTexelBufferArrayDynamicIndexingEXT", 5304, 1, pygen_variable_caps_SampledBuffer, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"StorageTexelBufferArrayDynamicIndexing", 5305, 1, pygen_variable_caps_ImageBuffer, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"StorageTexelBufferArrayDynamicIndexingEXT", 5305, 1, pygen_variable_caps_ImageBuffer, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"UniformBufferArrayNonUniformIndexing", 5306, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"UniformBufferArrayNonUniformIndexingEXT", 5306, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"SampledImageArrayNonUniformIndexing", 5307, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"SampledImageArrayNonUniformIndexingEXT", 5307, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"StorageBufferArrayNonUniformIndexing", 5308, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"StorageBufferArrayNonUniformIndexingEXT", 5308, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"StorageImageArrayNonUniformIndexing", 5309, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"StorageImageArrayNonUniformIndexingEXT", 5309, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"InputAttachmentArrayNonUniformIndexing", 5310, 2, pygen_variable_caps_InputAttachmentShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"InputAttachmentArrayNonUniformIndexingEXT", 5310, 2, pygen_variable_caps_InputAttachmentShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"UniformTexelBufferArrayNonUniformIndexing", 5311, 2, pygen_variable_caps_SampledBufferShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"UniformTexelBufferArrayNonUniformIndexingEXT", 5311, 2, pygen_variable_caps_SampledBufferShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"StorageTexelBufferArrayNonUniformIndexing", 5312, 2, pygen_variable_caps_ImageBufferShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"StorageTexelBufferArrayNonUniformIndexingEXT", 5312, 2, pygen_variable_caps_ImageBufferShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"RayTracingPositionFetchKHR", 5336, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing_position_fetch, {}, 0xffffffffu, 0xffffffffu}, - {"RayTracingNV", 5340, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"RayTracingMotionBlurNV", 5341, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, {}, 0xffffffffu, 0xffffffffu}, - {"VulkanMemoryModel", 5345, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"VulkanMemoryModelKHR", 5345, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"VulkanMemoryModelDeviceScope", 5346, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"VulkanMemoryModelDeviceScopeKHR", 5346, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"PhysicalStorageBufferAddresses", 5347, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"PhysicalStorageBufferAddressesEXT", 5347, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, - {"ComputeDerivativeGroupLinearNV", 5350, 0, nullptr, 1, pygen_variable_exts_SPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu}, - {"RayTracingProvisionalKHR", 5353, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixNV", 5357, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentShaderSampleInterlockEXT", 5363, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentShaderShadingRateInterlockEXT", 5372, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderSMBuiltinsNV", 5373, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, - {"FragmentShaderPixelInterlockEXT", 5378, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, - {"DemoteToHelperInvocation", 5379, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DemoteToHelperInvocationEXT", 5379, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"RayTracingOpacityMicromapEXT", 5381, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 1, pygen_variable_exts_SPV_EXT_opacity_micromap, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderInvocationReorderNV", 5383, 1, pygen_variable_caps_RayTracingKHR, 1, pygen_variable_exts_SPV_NV_shader_invocation_reorder, {}, 0xffffffffu, 0xffffffffu}, - {"BindlessTextureNV", 5390, 0, nullptr, 1, pygen_variable_exts_SPV_NV_bindless_texture, {}, 0xffffffffu, 0xffffffffu}, - {"RayQueryPositionFetchKHR", 5391, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing_position_fetch, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupShuffleINTEL", 5568, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupBufferBlockIOINTEL", 5569, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageBlockIOINTEL", 5570, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageMediaBlockIOINTEL", 5579, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_media_block_io, {}, 0xffffffffu, 0xffffffffu}, - {"RoundToInfinityINTEL", 5582, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_float_controls2, {}, 0xffffffffu, 0xffffffffu}, - {"FloatingPointModeINTEL", 5583, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_float_controls2, {}, 0xffffffffu, 0xffffffffu}, - {"IntegerFunctions2INTEL", 5584, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_INTEL_shader_integer_functions2, {}, 0xffffffffu, 0xffffffffu}, - {"FunctionPointersINTEL", 5603, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu}, - {"IndirectReferencesINTEL", 5604, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu}, - {"AsmINTEL", 5606, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_inline_assembly, {}, 0xffffffffu, 0xffffffffu}, - {"AtomicFloat32MinMaxEXT", 5612, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_min_max, {}, 0xffffffffu, 0xffffffffu}, - {"AtomicFloat64MinMaxEXT", 5613, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_min_max, {}, 0xffffffffu, 0xffffffffu}, - {"AtomicFloat16MinMaxEXT", 5616, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_min_max, {}, 0xffffffffu, 0xffffffffu}, - {"VectorComputeINTEL", 5617, 1, pygen_variable_caps_VectorAnyINTEL, 1, pygen_variable_exts_SPV_INTEL_vector_compute, {}, 0xffffffffu, 0xffffffffu}, - {"VectorAnyINTEL", 5619, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_vector_compute, {}, 0xffffffffu, 0xffffffffu}, - {"ExpectAssumeKHR", 5629, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_expect_assume, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMotionEstimationINTEL", 5696, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_device_side_avc_motion_estimation, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMotionEstimationIntraINTEL", 5697, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_device_side_avc_motion_estimation, {}, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMotionEstimationChromaINTEL", 5698, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_device_side_avc_motion_estimation, {}, 0xffffffffu, 0xffffffffu}, - {"VariableLengthArrayINTEL", 5817, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_variable_length_array, {}, 0xffffffffu, 0xffffffffu}, - {"FunctionFloatControlINTEL", 5821, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_float_controls2, {}, 0xffffffffu, 0xffffffffu}, - {"FPGAMemoryAttributesINTEL", 5824, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"FPFastMathModeINTEL", 5837, 1, pygen_variable_caps_Kernel, 1, pygen_variable_exts_SPV_INTEL_fp_fast_math_mode, {}, 0xffffffffu, 0xffffffffu}, - {"ArbitraryPrecisionIntegersINTEL", 5844, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_arbitrary_precision_integers, {}, 0xffffffffu, 0xffffffffu}, - {"ArbitraryPrecisionFloatingPointINTEL", 5845, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_arbitrary_precision_floating_point, {}, 0xffffffffu, 0xffffffffu}, - {"UnstructuredLoopControlsINTEL", 5886, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_unstructured_loop_controls, {}, 0xffffffffu, 0xffffffffu}, - {"FPGALoopControlsINTEL", 5888, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {}, 0xffffffffu, 0xffffffffu}, - {"KernelAttributesINTEL", 5892, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"FPGAKernelAttributesINTEL", 5897, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"FPGAMemoryAccessesINTEL", 5898, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_accesses, {}, 0xffffffffu, 0xffffffffu}, - {"FPGAClusterAttributesINTEL", 5904, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_cluster_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"LoopFuseINTEL", 5906, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_loop_fuse, {}, 0xffffffffu, 0xffffffffu}, - {"FPGADSPControlINTEL", 5908, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_dsp_control, {}, 0xffffffffu, 0xffffffffu}, - {"MemoryAccessAliasingINTEL", 5910, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {}, 0xffffffffu, 0xffffffffu}, - {"FPGAInvocationPipeliningAttributesINTEL", 5916, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_invocation_pipelining_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"FPGABufferLocationINTEL", 5920, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_buffer_location, {}, 0xffffffffu, 0xffffffffu}, - {"ArbitraryPrecisionFixedPointINTEL", 5922, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_arbitrary_precision_fixed_point, {}, 0xffffffffu, 0xffffffffu}, - {"USMStorageClassesINTEL", 5935, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_usm_storage_classes, {}, 0xffffffffu, 0xffffffffu}, - {"RuntimeAlignedAttributeINTEL", 5939, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_runtime_aligned, {}, 0xffffffffu, 0xffffffffu}, - {"IOPipesINTEL", 5943, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_io_pipes, {}, 0xffffffffu, 0xffffffffu}, - {"BlockingPipesINTEL", 5945, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, {}, 0xffffffffu, 0xffffffffu}, - {"FPGARegINTEL", 5948, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_reg, {}, 0xffffffffu, 0xffffffffu}, - {"DotProductInputAll", 6016, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DotProductInputAllKHR", 6016, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DotProductInput4x8Bit", 6017, 1, pygen_variable_caps_Int8, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DotProductInput4x8BitKHR", 6017, 1, pygen_variable_caps_Int8, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DotProductInput4x8BitPacked", 6018, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DotProductInput4x8BitPackedKHR", 6018, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DotProduct", 6019, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DotProductKHR", 6019, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"RayCullMaskKHR", 6020, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_ray_cull_mask, {}, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixKHR", 6022, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_cooperative_matrix, {}, 0xffffffffu, 0xffffffffu}, - {"BitInstructions", 6025, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_bit_instructions, {}, 0xffffffffu, 0xffffffffu}, - {"GroupNonUniformRotateKHR", 6026, 1, pygen_variable_caps_GroupNonUniform, 1, pygen_variable_exts_SPV_KHR_subgroup_rotate, {}, 0xffffffffu, 0xffffffffu}, - {"AtomicFloat32AddEXT", 6033, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, {}, 0xffffffffu, 0xffffffffu}, - {"AtomicFloat64AddEXT", 6034, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, {}, 0xffffffffu, 0xffffffffu}, - {"LongConstantCompositeINTEL", 6089, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_long_constant_composite, {}, 0xffffffffu, 0xffffffffu}, - {"OptNoneINTEL", 6094, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_optnone, {}, 0xffffffffu, 0xffffffffu}, - {"AtomicFloat16AddEXT", 6095, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float16_add, {}, 0xffffffffu, 0xffffffffu}, - {"DebugInfoModuleINTEL", 6114, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_debug_module, {}, 0xffffffffu, 0xffffffffu}, - {"BFloat16ConversionINTEL", 6115, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_bfloat16_conversion, {}, 0xffffffffu, 0xffffffffu}, - {"SplitBarrierINTEL", 6141, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_split_barrier, {}, 0xffffffffu, 0xffffffffu}, - {"GlobalVariableFPGADecorationsINTEL", 6146, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_global_variable_fpga_decorations, {}, 0xffffffffu, 0xffffffffu}, - {"FPGAKernelAttributesv2INTEL", 6161, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, - {"GlobalVariableHostAccessINTEL", 6167, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_global_variable_host_access, {}, 0xffffffffu, 0xffffffffu}, - {"FPMaxErrorINTEL", 6169, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fp_max_error, {}, 0xffffffffu, 0xffffffffu}, - {"FPGALatencyControlINTEL", 6171, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_latency_control, {}, 0xffffffffu, 0xffffffffu}, - {"FPGAArgumentInterfacesINTEL", 6174, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_argument_interfaces, {}, 0xffffffffu, 0xffffffffu}, - {"GroupUniformArithmeticKHR", 6400, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_uniform_group_instructions, {}, 0xffffffffu, 0xffffffffu} + {"Matrix", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Shader", 1, 0, nullptr, 1, pygen_variable_caps_Matrix, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Geometry", 2, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Tessellation", 3, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Addresses", 4, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Linkage", 5, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Kernel", 6, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Vector16", 7, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Float16Buffer", 8, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Float16", 9, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Float64", 10, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Int64", 11, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Int64Atomics", 12, 0, nullptr, 1, pygen_variable_caps_Int64, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageBasic", 13, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageReadWrite", 14, 0, nullptr, 1, pygen_variable_caps_ImageBasic, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageMipmap", 15, 0, nullptr, 1, pygen_variable_caps_ImageBasic, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Pipes", 17, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Groups", 18, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DeviceEnqueue", 19, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"LiteralSampler", 20, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"AtomicStorage", 21, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Int16", 22, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TessellationPointSize", 23, 0, nullptr, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GeometryPointSize", 24, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageGatherExtended", 25, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"StorageImageMultisample", 27, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"UniformBufferArrayDynamicIndexing", 28, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SampledImageArrayDynamicIndexing", 29, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"StorageBufferArrayDynamicIndexing", 30, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"StorageImageArrayDynamicIndexing", 31, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ClipDistance", 32, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"CullDistance", 33, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageCubeArray", 34, 0, nullptr, 1, pygen_variable_caps_SampledCubeArray, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SampleRateShading", 35, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageRect", 36, 0, nullptr, 1, pygen_variable_caps_SampledRect, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SampledRect", 37, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GenericPointer", 38, 0, nullptr, 1, pygen_variable_caps_Addresses, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Int8", 39, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InputAttachment", 40, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SparseResidency", 41, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MinLod", 42, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Sampled1D", 43, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"Image1D", 44, 0, nullptr, 1, pygen_variable_caps_Sampled1D, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SampledCubeArray", 45, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SampledBuffer", 46, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageBuffer", 47, 0, nullptr, 1, pygen_variable_caps_SampledBuffer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageMSArray", 48, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"StorageImageExtendedFormats", 49, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"ImageQuery", 50, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"DerivativeControl", 51, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"InterpolationFunction", 52, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"TransformFeedback", 53, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"GeometryStreams", 54, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"StorageImageReadWithoutFormat", 55, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"StorageImageWriteWithoutFormat", 56, 0, nullptr, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"MultiViewport", 57, 0, nullptr, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,0), 0xffffffffu}, + {"SubgroupDispatch", 58, 0, nullptr, 1, pygen_variable_caps_DeviceEnqueue, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"NamedBarrier", 59, 0, nullptr, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"PipeStorage", 60, 0, nullptr, 1, pygen_variable_caps_Pipes, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"GroupNonUniform", 61, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformVote", 62, 0, nullptr, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformArithmetic", 63, 0, nullptr, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallot", 64, 0, nullptr, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffle", 65, 0, nullptr, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffleRelative", 66, 0, nullptr, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformClustered", 67, 0, nullptr, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformQuad", 68, 0, nullptr, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"ShaderLayer", 69, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"ShaderViewportIndex", 70, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"UniformDecoration", 71, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"CoreBuiltinsARM", 4165, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_ARM_core_builtins, {}, 0xffffffffu, 0xffffffffu}, + {"TileImageColorReadAccessEXT", 4166, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_tile_image, {}, 0xffffffffu, 0xffffffffu}, + {"TileImageDepthReadAccessEXT", 4167, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_tile_image, {}, 0xffffffffu, 0xffffffffu}, + {"TileImageStencilReadAccessEXT", 4168, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_tile_image, {}, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixLayoutsARM", 4201, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_ARM_cooperative_matrix_layouts, {}, 0xffffffffu, 0xffffffffu}, + {"FragmentShadingRateKHR", 4422, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_fragment_shading_rate, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupBallotKHR", 4423, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, 0xffffffffu, 0xffffffffu}, + {"DrawParameters", 4427, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_shader_draw_parameters, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"WorkgroupMemoryExplicitLayoutKHR", 4428, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_workgroup_memory_explicit_layout, {}, 0xffffffffu, 0xffffffffu}, + {"WorkgroupMemoryExplicitLayout8BitAccessKHR", 4429, 0, nullptr, 1, pygen_variable_caps_WorkgroupMemoryExplicitLayoutKHR, 1, pygen_variable_exts_SPV_KHR_workgroup_memory_explicit_layout, {}, 0xffffffffu, 0xffffffffu}, + {"WorkgroupMemoryExplicitLayout16BitAccessKHR", 4430, 0, nullptr, 1, pygen_variable_caps_WorkgroupMemoryExplicitLayoutKHR, 1, pygen_variable_exts_SPV_KHR_workgroup_memory_explicit_layout, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupVoteKHR", 4431, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, {}, 0xffffffffu, 0xffffffffu}, + {"StorageBuffer16BitAccess", 4433, 1, pygen_variable_aliases_StorageUniformBufferBlock16, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"UniformAndStorageBuffer16BitAccess", 4434, 1, pygen_variable_aliases_StorageUniform16, 1, pygen_variable_caps_StorageBuffer16BitAccess, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"StoragePushConstant16", 4435, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"StorageInputOutput16", 4436, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_16bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"DeviceGroup", 4437, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_device_group, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"MultiView", 4439, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_multiview, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"VariablePointersStorageBuffer", 4441, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_variable_pointers, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"VariablePointers", 4442, 0, nullptr, 1, pygen_variable_caps_VariablePointersStorageBuffer, 1, pygen_variable_exts_SPV_KHR_variable_pointers, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"AtomicStorageOps", 4445, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_shader_atomic_counter_ops, {}, 0xffffffffu, 0xffffffffu}, + {"SampleMaskPostDepthCoverage", 4447, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_post_depth_coverage, {}, 0xffffffffu, 0xffffffffu}, + {"StorageBuffer8BitAccess", 4448, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_8bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"UniformAndStorageBuffer8BitAccess", 4449, 0, nullptr, 1, pygen_variable_caps_StorageBuffer8BitAccess, 1, pygen_variable_exts_SPV_KHR_8bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"StoragePushConstant8", 4450, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_8bit_storage, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"DenormPreserve", 4464, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"DenormFlushToZero", 4465, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"SignedZeroInfNanPreserve", 4466, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"RoundingModeRTE", 4467, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"RoundingModeRTZ", 4468, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"RayQueryProvisionalKHR", 4471, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_query, {}, 0xffffffffu, 0xffffffffu}, + {"RayQueryKHR", 4472, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_query, {}, 0xffffffffu, 0xffffffffu}, + {"UntypedPointersKHR", 4473, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_untyped_pointers, {}, 0xffffffffu, 0xffffffffu}, + {"RayTraversalPrimitiveCullingKHR", 4478, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_querySPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"RayTracingKHR", 4479, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"TextureSampleWeightedQCOM", 4484, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, + {"TextureBoxFilterQCOM", 4485, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, + {"TextureBlockMatchQCOM", 4486, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, + {"TextureBlockMatch2QCOM", 4498, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing2, {}, 0xffffffffu, 0xffffffffu}, + {"Float16ImageAMD", 5008, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_gpu_shader_half_float_fetch, {}, 0xffffffffu, 0xffffffffu}, + {"ImageGatherBiasLodAMD", 5009, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_texture_gather_bias_lod, {}, 0xffffffffu, 0xffffffffu}, + {"FragmentMaskAMD", 5010, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, {}, 0xffffffffu, 0xffffffffu}, + {"StencilExportEXT", 5013, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, + {"ImageReadWriteLodAMD", 5015, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_shader_image_load_store_lod, {}, 0xffffffffu, 0xffffffffu}, + {"Int64ImageEXT", 5016, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_shader_image_int64, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderClockKHR", 5055, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_shader_clock, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderEnqueueAMDX", 5067, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMDX_shader_enqueue, {}, 0xffffffffu, 0xffffffffu}, + {"QuadControlKHR", 5087, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_quad_control, {}, 0xffffffffu, 0xffffffffu}, + {"SampleMaskOverrideCoverageNV", 5249, 0, nullptr, 1, pygen_variable_caps_SampleRateShading, 1, pygen_variable_exts_SPV_NV_sample_mask_override_coverage, {}, 0xffffffffu, 0xffffffffu}, + {"GeometryShaderPassthroughNV", 5251, 0, nullptr, 1, pygen_variable_caps_Geometry, 1, pygen_variable_exts_SPV_NV_geometry_shader_passthrough, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderViewportIndexLayerEXT", 5254, 1, pygen_variable_aliases_ShaderViewportIndexLayerNV, 1, pygen_variable_caps_MultiViewport, 2, pygen_variable_exts_SPV_EXT_shader_viewport_index_layerSPV_NV_viewport_array2, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderViewportMaskNV", 5255, 0, nullptr, 1, pygen_variable_caps_ShaderViewportIndexLayerEXT, 1, pygen_variable_exts_SPV_NV_viewport_array2, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderStereoViewNV", 5259, 0, nullptr, 1, pygen_variable_caps_ShaderViewportMaskNV, 1, pygen_variable_exts_SPV_NV_stereo_view_rendering, {}, 0xffffffffu, 0xffffffffu}, + {"PerViewAttributesNV", 5260, 0, nullptr, 1, pygen_variable_caps_MultiView, 1, pygen_variable_exts_SPV_NVX_multiview_per_view_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"FragmentFullyCoveredEXT", 5265, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_fully_covered, {}, 0xffffffffu, 0xffffffffu}, + {"MeshShadingNV", 5266, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"ImageFootprintNV", 5282, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_NV_shader_image_footprint, {}, 0xffffffffu, 0xffffffffu}, + {"MeshShadingEXT", 5283, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu}, + {"FragmentBarycentricKHR", 5284, 1, pygen_variable_aliases_FragmentBarycentricNV, 0, nullptr, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu}, + {"ComputeDerivativeGroupQuadsKHR", 5288, 1, pygen_variable_aliases_ComputeDerivativeGroupQuadsNV, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_KHR_compute_shader_derivativesSPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu}, + {"FragmentDensityEXT", 5291, 1, pygen_variable_aliases_ShadingRateNV, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu}, + {"GroupNonUniformPartitionedNV", 5297, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderNonUniform", 5301, 1, pygen_variable_aliases_ShaderNonUniformEXT, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"RuntimeDescriptorArray", 5302, 1, pygen_variable_aliases_RuntimeDescriptorArrayEXT, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"InputAttachmentArrayDynamicIndexing", 5303, 1, pygen_variable_aliases_InputAttachmentArrayDynamicIndexingEXT, 1, pygen_variable_caps_InputAttachment, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"UniformTexelBufferArrayDynamicIndexing", 5304, 1, pygen_variable_aliases_UniformTexelBufferArrayDynamicIndexingEXT, 1, pygen_variable_caps_SampledBuffer, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"StorageTexelBufferArrayDynamicIndexing", 5305, 1, pygen_variable_aliases_StorageTexelBufferArrayDynamicIndexingEXT, 1, pygen_variable_caps_ImageBuffer, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"UniformBufferArrayNonUniformIndexing", 5306, 1, pygen_variable_aliases_UniformBufferArrayNonUniformIndexingEXT, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"SampledImageArrayNonUniformIndexing", 5307, 1, pygen_variable_aliases_SampledImageArrayNonUniformIndexingEXT, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"StorageBufferArrayNonUniformIndexing", 5308, 1, pygen_variable_aliases_StorageBufferArrayNonUniformIndexingEXT, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"StorageImageArrayNonUniformIndexing", 5309, 1, pygen_variable_aliases_StorageImageArrayNonUniformIndexingEXT, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"InputAttachmentArrayNonUniformIndexing", 5310, 1, pygen_variable_aliases_InputAttachmentArrayNonUniformIndexingEXT, 2, pygen_variable_caps_InputAttachmentShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"UniformTexelBufferArrayNonUniformIndexing", 5311, 1, pygen_variable_aliases_UniformTexelBufferArrayNonUniformIndexingEXT, 2, pygen_variable_caps_SampledBufferShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"StorageTexelBufferArrayNonUniformIndexing", 5312, 1, pygen_variable_aliases_StorageTexelBufferArrayNonUniformIndexingEXT, 2, pygen_variable_caps_ImageBufferShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"RayTracingPositionFetchKHR", 5336, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing_position_fetch, {}, 0xffffffffu, 0xffffffffu}, + {"RayTracingNV", 5340, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"RayTracingMotionBlurNV", 5341, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, {}, 0xffffffffu, 0xffffffffu}, + {"VulkanMemoryModel", 5345, 1, pygen_variable_aliases_VulkanMemoryModelKHR, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"VulkanMemoryModelDeviceScope", 5346, 1, pygen_variable_aliases_VulkanMemoryModelDeviceScopeKHR, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"PhysicalStorageBufferAddresses", 5347, 1, pygen_variable_aliases_PhysicalStorageBufferAddressesEXT, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"ComputeDerivativeGroupLinearKHR", 5350, 1, pygen_variable_aliases_ComputeDerivativeGroupLinearNV, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_KHR_compute_shader_derivativesSPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu}, + {"RayTracingProvisionalKHR", 5353, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixNV", 5357, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, {}, 0xffffffffu, 0xffffffffu}, + {"FragmentShaderSampleInterlockEXT", 5363, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, + {"FragmentShaderShadingRateInterlockEXT", 5372, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderSMBuiltinsNV", 5373, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}, + {"FragmentShaderPixelInterlockEXT", 5378, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu}, + {"DemoteToHelperInvocation", 5379, 1, pygen_variable_aliases_DemoteToHelperInvocationEXT, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"DisplacementMicromapNV", 5380, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_displacement_micromap, {}, 0xffffffffu, 0xffffffffu}, + {"RayTracingOpacityMicromapEXT", 5381, 0, nullptr, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 1, pygen_variable_exts_SPV_EXT_opacity_micromap, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderInvocationReorderNV", 5383, 0, nullptr, 1, pygen_variable_caps_RayTracingKHR, 1, pygen_variable_exts_SPV_NV_shader_invocation_reorder, {}, 0xffffffffu, 0xffffffffu}, + {"BindlessTextureNV", 5390, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_NV_bindless_texture, {}, 0xffffffffu, 0xffffffffu}, + {"RayQueryPositionFetchKHR", 5391, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing_position_fetch, {}, 0xffffffffu, 0xffffffffu}, + {"AtomicFloat16VectorNV", 5404, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_NV_shader_atomic_fp16_vector, {}, 0xffffffffu, 0xffffffffu}, + {"RayTracingDisplacementMicromapNV", 5409, 0, nullptr, 1, pygen_variable_caps_RayTracingKHR, 1, pygen_variable_exts_SPV_NV_displacement_micromap, {}, 0xffffffffu, 0xffffffffu}, + {"RawAccessChainsNV", 5414, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_NV_raw_access_chains, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupShuffleINTEL", 5568, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupBufferBlockIOINTEL", 5569, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageBlockIOINTEL", 5570, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageMediaBlockIOINTEL", 5579, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_media_block_io, {}, 0xffffffffu, 0xffffffffu}, + {"RoundToInfinityINTEL", 5582, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_float_controls2, {}, 0xffffffffu, 0xffffffffu}, + {"FloatingPointModeINTEL", 5583, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_float_controls2, {}, 0xffffffffu, 0xffffffffu}, + {"IntegerFunctions2INTEL", 5584, 0, nullptr, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_INTEL_shader_integer_functions2, {}, 0xffffffffu, 0xffffffffu}, + {"FunctionPointersINTEL", 5603, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu}, + {"IndirectReferencesINTEL", 5604, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu}, + {"AsmINTEL", 5606, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_inline_assembly, {}, 0xffffffffu, 0xffffffffu}, + {"AtomicFloat32MinMaxEXT", 5612, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_min_max, {}, 0xffffffffu, 0xffffffffu}, + {"AtomicFloat64MinMaxEXT", 5613, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_min_max, {}, 0xffffffffu, 0xffffffffu}, + {"AtomicFloat16MinMaxEXT", 5616, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_min_max, {}, 0xffffffffu, 0xffffffffu}, + {"VectorComputeINTEL", 5617, 0, nullptr, 1, pygen_variable_caps_VectorAnyINTEL, 1, pygen_variable_exts_SPV_INTEL_vector_compute, {}, 0xffffffffu, 0xffffffffu}, + {"VectorAnyINTEL", 5619, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_vector_compute, {}, 0xffffffffu, 0xffffffffu}, + {"ExpectAssumeKHR", 5629, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_expect_assume, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMotionEstimationINTEL", 5696, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_device_side_avc_motion_estimation, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMotionEstimationIntraINTEL", 5697, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_device_side_avc_motion_estimation, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMotionEstimationChromaINTEL", 5698, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_device_side_avc_motion_estimation, {}, 0xffffffffu, 0xffffffffu}, + {"VariableLengthArrayINTEL", 5817, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_variable_length_array, {}, 0xffffffffu, 0xffffffffu}, + {"FunctionFloatControlINTEL", 5821, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_float_controls2, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAMemoryAttributesINTEL", 5824, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"FPFastMathModeINTEL", 5837, 0, nullptr, 1, pygen_variable_caps_Kernel, 1, pygen_variable_exts_SPV_INTEL_fp_fast_math_mode, {}, 0xffffffffu, 0xffffffffu}, + {"ArbitraryPrecisionIntegersINTEL", 5844, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_arbitrary_precision_integers, {}, 0xffffffffu, 0xffffffffu}, + {"ArbitraryPrecisionFloatingPointINTEL", 5845, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_arbitrary_precision_floating_point, {}, 0xffffffffu, 0xffffffffu}, + {"UnstructuredLoopControlsINTEL", 5886, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_unstructured_loop_controls, {}, 0xffffffffu, 0xffffffffu}, + {"FPGALoopControlsINTEL", 5888, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {}, 0xffffffffu, 0xffffffffu}, + {"KernelAttributesINTEL", 5892, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAKernelAttributesINTEL", 5897, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAMemoryAccessesINTEL", 5898, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_accesses, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAClusterAttributesINTEL", 5904, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_cluster_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"LoopFuseINTEL", 5906, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_loop_fuse, {}, 0xffffffffu, 0xffffffffu}, + {"FPGADSPControlINTEL", 5908, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_dsp_control, {}, 0xffffffffu, 0xffffffffu}, + {"MemoryAccessAliasingINTEL", 5910, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAInvocationPipeliningAttributesINTEL", 5916, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_invocation_pipelining_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"FPGABufferLocationINTEL", 5920, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_buffer_location, {}, 0xffffffffu, 0xffffffffu}, + {"ArbitraryPrecisionFixedPointINTEL", 5922, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_arbitrary_precision_fixed_point, {}, 0xffffffffu, 0xffffffffu}, + {"USMStorageClassesINTEL", 5935, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_usm_storage_classes, {}, 0xffffffffu, 0xffffffffu}, + {"RuntimeAlignedAttributeINTEL", 5939, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_runtime_aligned, {}, 0xffffffffu, 0xffffffffu}, + {"IOPipesINTEL", 5943, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_io_pipes, {}, 0xffffffffu, 0xffffffffu}, + {"BlockingPipesINTEL", 5945, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, {}, 0xffffffffu, 0xffffffffu}, + {"FPGARegINTEL", 5948, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_reg, {}, 0xffffffffu, 0xffffffffu}, + {"DotProductInputAll", 6016, 1, pygen_variable_aliases_DotProductInputAllKHR, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"DotProductInput4x8Bit", 6017, 1, pygen_variable_aliases_DotProductInput4x8BitKHR, 1, pygen_variable_caps_Int8, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"DotProductInput4x8BitPacked", 6018, 1, pygen_variable_aliases_DotProductInput4x8BitPackedKHR, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"DotProduct", 6019, 1, pygen_variable_aliases_DotProductKHR, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"RayCullMaskKHR", 6020, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_ray_cull_mask, {}, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixKHR", 6022, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_cooperative_matrix, {}, 0xffffffffu, 0xffffffffu}, + {"ReplicatedCompositesEXT", 6024, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_replicated_composites, {}, 0xffffffffu, 0xffffffffu}, + {"BitInstructions", 6025, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_bit_instructions, {}, 0xffffffffu, 0xffffffffu}, + {"GroupNonUniformRotateKHR", 6026, 0, nullptr, 1, pygen_variable_caps_GroupNonUniform, 1, pygen_variable_exts_SPV_KHR_subgroup_rotate, {}, 0xffffffffu, 0xffffffffu}, + {"FloatControls2", 6029, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_float_controls2, {}, 0xffffffffu, 0xffffffffu}, + {"AtomicFloat32AddEXT", 6033, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, {}, 0xffffffffu, 0xffffffffu}, + {"AtomicFloat64AddEXT", 6034, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, {}, 0xffffffffu, 0xffffffffu}, + {"LongCompositesINTEL", 6089, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_long_composites, {}, 0xffffffffu, 0xffffffffu}, + {"OptNoneEXT", 6094, 1, pygen_variable_aliases_OptNoneINTEL, 0, nullptr, 2, pygen_variable_exts_SPV_EXT_optnoneSPV_INTEL_optnone, {}, 0xffffffffu, 0xffffffffu}, + {"AtomicFloat16AddEXT", 6095, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float16_add, {}, 0xffffffffu, 0xffffffffu}, + {"DebugInfoModuleINTEL", 6114, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_debug_module, {}, 0xffffffffu, 0xffffffffu}, + {"BFloat16ConversionINTEL", 6115, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_bfloat16_conversion, {}, 0xffffffffu, 0xffffffffu}, + {"SplitBarrierINTEL", 6141, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_split_barrier, {}, 0xffffffffu, 0xffffffffu}, + {"ArithmeticFenceEXT", 6144, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_arithmetic_fence, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAClusterAttributesV2INTEL", 6150, 0, nullptr, 1, pygen_variable_caps_FPGAClusterAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_cluster_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAKernelAttributesv2INTEL", 6161, 0, nullptr, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"FPMaxErrorINTEL", 6169, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fp_max_error, {}, 0xffffffffu, 0xffffffffu}, + {"FPGALatencyControlINTEL", 6171, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_latency_control, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAArgumentInterfacesINTEL", 6174, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_argument_interfaces, {}, 0xffffffffu, 0xffffffffu}, + {"GlobalVariableHostAccessINTEL", 6187, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_global_variable_host_access, {}, 0xffffffffu, 0xffffffffu}, + {"GlobalVariableFPGADecorationsINTEL", 6189, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_global_variable_fpga_decorations, {}, 0xffffffffu, 0xffffffffu}, + {"SubgroupBufferPrefetchINTEL", 6220, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroup_buffer_prefetch, {}, 0xffffffffu, 0xffffffffu}, + {"GroupUniformArithmeticKHR", 6400, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_uniform_group_instructions, {}, 0xffffffffu, 0xffffffffu}, + {"MaskedGatherScatterINTEL", 6427, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_masked_gather_scatter, {}, 0xffffffffu, 0xffffffffu}, + {"CacheControlsINTEL", 6441, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_cache_controls, {}, 0xffffffffu, 0xffffffffu}, + {"RegisterLimitsINTEL", 6460, 0, nullptr, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_maximum_registers, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_RayQueryIntersectionEntries[] = { - {"RayQueryCandidateIntersectionKHR", 0, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RayQueryCommittedIntersectionKHR", 1, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"RayQueryCandidateIntersectionKHR", 0, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RayQueryCommittedIntersectionKHR", 1, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_RayQueryCommittedIntersectionTypeEntries[] = { - {"RayQueryCommittedIntersectionNoneKHR", 0, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RayQueryCommittedIntersectionTriangleKHR", 1, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RayQueryCommittedIntersectionGeneratedKHR", 2, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"RayQueryCommittedIntersectionNoneKHR", 0, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RayQueryCommittedIntersectionTriangleKHR", 1, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RayQueryCommittedIntersectionGeneratedKHR", 2, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_RayQueryCandidateIntersectionTypeEntries[] = { - {"RayQueryCandidateIntersectionTriangleKHR", 0, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"RayQueryCandidateIntersectionAABBKHR", 1, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"RayQueryCandidateIntersectionTriangleKHR", 0, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RayQueryCandidateIntersectionAABBKHR", 1, 0, nullptr, 1, pygen_variable_caps_RayQueryKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_PackedVectorFormatEntries[] = { - {"PackedVectorFormat4x8Bit", 0, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"PackedVectorFormat4x8BitKHR", 0, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu} + {"PackedVectorFormat4x8Bit", 0, 1, pygen_variable_aliases_PackedVectorFormat4x8BitKHR, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CooperativeMatrixOperandsEntries[] = { - {"NoneKHR", 0x0000, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MatrixASignedComponentsKHR", 0x0001, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MatrixBSignedComponentsKHR", 0x0002, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MatrixCSignedComponentsKHR", 0x0004, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MatrixResultSignedComponentsKHR", 0x0008, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"SaturatingAccumulationKHR", 0x0010, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"NoneKHR", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MatrixASignedComponentsKHR", 0x0001, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MatrixBSignedComponentsKHR", 0x0002, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MatrixCSignedComponentsKHR", 0x0004, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MatrixResultSignedComponentsKHR", 0x0008, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"SaturatingAccumulationKHR", 0x0010, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CooperativeMatrixLayoutEntries[] = { - {"RowMajorKHR", 0, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"ColumnMajorKHR", 1, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"RowMajorKHR", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ColumnMajorKHR", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RowBlockedInterleavedARM", 4202, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ColumnBlockedInterleavedARM", 4203, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CooperativeMatrixUseEntries[] = { - {"MatrixAKHR", 0, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MatrixBKHR", 1, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MatrixAccumulatorKHR", 2, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"MatrixAKHR", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MatrixBKHR", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MatrixAccumulatorKHR", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_InitializationModeQualifierEntries[] = { - {"InitOnDeviceReprogramINTEL", 0, 1, pygen_variable_caps_GlobalVariableFPGADecorationsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"InitOnDeviceResetINTEL", 1, 1, pygen_variable_caps_GlobalVariableFPGADecorationsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"InitOnDeviceReprogramINTEL", 0, 0, nullptr, 1, pygen_variable_caps_GlobalVariableFPGADecorationsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"InitOnDeviceResetINTEL", 1, 0, nullptr, 1, pygen_variable_caps_GlobalVariableFPGADecorationsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} +}; + +static const spv_operand_desc_t pygen_variable_LoadCacheControlEntries[] = { + {"UncachedINTEL", 0, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"CachedINTEL", 1, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"StreamingINTEL", 2, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"InvalidateAfterReadINTEL", 3, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ConstCachedINTEL", 4, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} +}; + +static const spv_operand_desc_t pygen_variable_StoreCacheControlEntries[] = { + {"UncachedINTEL", 0, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"WriteThroughINTEL", 1, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"WriteBackINTEL", 2, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"StreamingINTEL", 3, 0, nullptr, 1, pygen_variable_caps_CacheControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} +}; + +static const spv_operand_desc_t pygen_variable_NamedMaximumNumberOfRegistersEntries[] = { + {"AutoINTEL", 0, 0, nullptr, 1, pygen_variable_caps_RegisterLimitsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} +}; + +static const spv_operand_desc_t pygen_variable_FPEncodingEntries[] = { + {"place holder", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(999,0), 0} }; static const spv_operand_desc_t pygen_variable_DebugInfoFlagsEntries[] = { - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsProtected", 0x01, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsPrivate", 0x02, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsPublic", 0x03, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsLocal", 0x04, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsDefinition", 0x08, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagFwdDecl", 0x10, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagArtificial", 0x20, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagExplicit", 0x40, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagPrototyped", 0x80, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagObjectPointer", 0x100, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagStaticMember", 0x200, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIndirectVariable", 0x400, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagLValueReference", 0x800, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagRValueReference", 0x1000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsOptimized", 0x2000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsProtected", 0x01, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsPrivate", 0x02, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsPublic", 0x03, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsLocal", 0x04, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsDefinition", 0x08, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagFwdDecl", 0x10, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagArtificial", 0x20, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagExplicit", 0x40, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagPrototyped", 0x80, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagObjectPointer", 0x100, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagStaticMember", 0x200, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIndirectVariable", 0x400, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagLValueReference", 0x800, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagRValueReference", 0x1000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsOptimized", 0x2000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_DebugBaseTypeAttributeEncodingEntries[] = { - {"Unspecified", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Address", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Boolean", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Float", 4, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Signed", 5, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SignedChar", 6, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Unsigned", 7, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"UnsignedChar", 8, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"Unspecified", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Address", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Boolean", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Float", 4, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Signed", 5, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SignedChar", 6, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Unsigned", 7, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"UnsignedChar", 8, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_DebugCompositeTypeEntries[] = { - {"Class", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Structure", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Union", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"Class", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Structure", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Union", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_DebugTypeQualifierEntries[] = { - {"ConstType", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"VolatileType", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"RestrictType", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"ConstType", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"VolatileType", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"RestrictType", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_DebugOperationEntries[] = { - {"Deref", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Plus", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Minus", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"PlusUconst", 3, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitPiece", 4, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Swap", 5, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Xderef", 6, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"StackValue", 7, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Constu", 8, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"Deref", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Plus", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Minus", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"PlusUconst", 3, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitPiece", 4, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Swap", 5, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Xderef", 6, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"StackValue", 7, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Constu", 8, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CLDEBUG100_DebugInfoFlagsEntries[] = { - {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsProtected", 0x01, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsPrivate", 0x02, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsPublic", 0x03, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsLocal", 0x04, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsDefinition", 0x08, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagFwdDecl", 0x10, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagArtificial", 0x20, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagExplicit", 0x40, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagPrototyped", 0x80, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagObjectPointer", 0x100, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagStaticMember", 0x200, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIndirectVariable", 0x400, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagLValueReference", 0x800, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagRValueReference", 0x1000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsOptimized", 0x2000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagIsEnumClass", 0x4000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagTypePassByValue", 0x8000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FlagTypePassByReference", 0x10000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"None", 0x0000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsProtected", 0x01, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsPrivate", 0x02, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsPublic", 0x03, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsLocal", 0x04, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsDefinition", 0x08, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagFwdDecl", 0x10, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagArtificial", 0x20, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagExplicit", 0x40, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagPrototyped", 0x80, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagObjectPointer", 0x100, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagStaticMember", 0x200, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIndirectVariable", 0x400, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagLValueReference", 0x800, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagRValueReference", 0x1000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsOptimized", 0x2000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagIsEnumClass", 0x4000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagTypePassByValue", 0x8000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FlagTypePassByReference", 0x10000, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CLDEBUG100_DebugBaseTypeAttributeEncodingEntries[] = { - {"Unspecified", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Address", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Boolean", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Float", 3, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Signed", 4, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SignedChar", 5, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Unsigned", 6, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"UnsignedChar", 7, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"Unspecified", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Address", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Boolean", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Float", 3, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Signed", 4, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SignedChar", 5, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Unsigned", 6, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"UnsignedChar", 7, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CLDEBUG100_DebugCompositeTypeEntries[] = { - {"Class", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Structure", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Union", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"Class", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Structure", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Union", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CLDEBUG100_DebugTypeQualifierEntries[] = { - {"ConstType", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"VolatileType", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"RestrictType", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicType", 3, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"ConstType", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"VolatileType", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"RestrictType", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicType", 3, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CLDEBUG100_DebugOperationEntries[] = { - {"Deref", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Plus", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Minus", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"PlusUconst", 3, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitPiece", 4, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Swap", 5, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Xderef", 6, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"StackValue", 7, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Constu", 8, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Fragment", 9, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"Deref", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Plus", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Minus", 2, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"PlusUconst", 3, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitPiece", 4, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Swap", 5, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Xderef", 6, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"StackValue", 7, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Constu", 8, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Fragment", 9, 0, nullptr, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_CLDEBUG100_DebugImportedEntityEntries[] = { - {"ImportedModule", 0, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImportedDeclaration", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"ImportedModule", 0, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImportedDeclaration", 1, 0, nullptr, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_group_t pygen_variable_OperandInfoTable[] = { @@ -1487,6 +1591,7 @@ static const spv_operand_desc_group_t pygen_variable_OperandInfoTable[] = { {SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO, ARRAY_SIZE(pygen_variable_KernelProfilingInfoEntries), pygen_variable_KernelProfilingInfoEntries}, {SPV_OPERAND_TYPE_RAY_FLAGS, ARRAY_SIZE(pygen_variable_RayFlagsEntries), pygen_variable_RayFlagsEntries}, {SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE, ARRAY_SIZE(pygen_variable_FragmentShadingRateEntries), pygen_variable_FragmentShadingRateEntries}, + {SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS, ARRAY_SIZE(pygen_variable_RawAccessChainOperandsEntries), pygen_variable_RawAccessChainOperandsEntries}, {SPV_OPERAND_TYPE_SOURCE_LANGUAGE, ARRAY_SIZE(pygen_variable_SourceLanguageEntries), pygen_variable_SourceLanguageEntries}, {SPV_OPERAND_TYPE_EXECUTION_MODEL, ARRAY_SIZE(pygen_variable_ExecutionModelEntries), pygen_variable_ExecutionModelEntries}, {SPV_OPERAND_TYPE_ADDRESSING_MODEL, ARRAY_SIZE(pygen_variable_AddressingModelEntries), pygen_variable_AddressingModelEntries}, @@ -1522,6 +1627,10 @@ static const spv_operand_desc_group_t pygen_variable_OperandInfoTable[] = { {SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_LAYOUT, ARRAY_SIZE(pygen_variable_CooperativeMatrixLayoutEntries), pygen_variable_CooperativeMatrixLayoutEntries}, {SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_USE, ARRAY_SIZE(pygen_variable_CooperativeMatrixUseEntries), pygen_variable_CooperativeMatrixUseEntries}, {SPV_OPERAND_TYPE_INITIALIZATION_MODE_QUALIFIER, ARRAY_SIZE(pygen_variable_InitializationModeQualifierEntries), pygen_variable_InitializationModeQualifierEntries}, + {SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL, ARRAY_SIZE(pygen_variable_LoadCacheControlEntries), pygen_variable_LoadCacheControlEntries}, + {SPV_OPERAND_TYPE_STORE_CACHE_CONTROL, ARRAY_SIZE(pygen_variable_StoreCacheControlEntries), pygen_variable_StoreCacheControlEntries}, + {SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS, ARRAY_SIZE(pygen_variable_NamedMaximumNumberOfRegistersEntries), pygen_variable_NamedMaximumNumberOfRegistersEntries}, + {SPV_OPERAND_TYPE_FPENCODING, ARRAY_SIZE(pygen_variable_FPEncodingEntries), pygen_variable_FPEncodingEntries}, {SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS, ARRAY_SIZE(pygen_variable_DebugInfoFlagsEntries), pygen_variable_DebugInfoFlagsEntries}, {SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING, ARRAY_SIZE(pygen_variable_DebugBaseTypeAttributeEncodingEntries), pygen_variable_DebugBaseTypeAttributeEncodingEntries}, {SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE, ARRAY_SIZE(pygen_variable_DebugCompositeTypeEntries), pygen_variable_DebugCompositeTypeEntries}, @@ -1535,7 +1644,9 @@ static const spv_operand_desc_group_t pygen_variable_OperandInfoTable[] = { {SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY, ARRAY_SIZE(pygen_variable_CLDEBUG100_DebugImportedEntityEntries), pygen_variable_CLDEBUG100_DebugImportedEntityEntries}, {SPV_OPERAND_TYPE_OPTIONAL_IMAGE, ARRAY_SIZE(pygen_variable_ImageOperandsEntries), pygen_variable_ImageOperandsEntries}, {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, ARRAY_SIZE(pygen_variable_MemoryAccessEntries), pygen_variable_MemoryAccessEntries}, + {SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS, ARRAY_SIZE(pygen_variable_RawAccessChainOperandsEntries), pygen_variable_RawAccessChainOperandsEntries}, {SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER, ARRAY_SIZE(pygen_variable_AccessQualifierEntries), pygen_variable_AccessQualifierEntries}, {SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT, ARRAY_SIZE(pygen_variable_PackedVectorFormatEntries), pygen_variable_PackedVectorFormatEntries}, - {SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS, ARRAY_SIZE(pygen_variable_CooperativeMatrixOperandsEntries), pygen_variable_CooperativeMatrixOperandsEntries} + {SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS, ARRAY_SIZE(pygen_variable_CooperativeMatrixOperandsEntries), pygen_variable_CooperativeMatrixOperandsEntries}, + {SPV_OPERAND_TYPE_OPTIONAL_FPENCODING, ARRAY_SIZE(pygen_variable_FPEncodingEntries), pygen_variable_FPEncodingEntries} }; \ No newline at end of file diff --git a/bgfx/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp b/bgfx/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp deleted file mode 100644 index 34e169a9..00000000 --- a/bgfx/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) 2018 The Khronos Group Inc. -// Copyright (c) 2018 Valve Corporation -// Copyright (c) 2018 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_ -#define INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_ - -// Shader Instrumentation Interface -// -// This file provides an external interface for applications that wish to -// communicate with shaders instrumented by passes created by: -// -// CreateInstBindlessCheckPass -// CreateInstBuffAddrCheckPass -// CreateInstDebugPrintfPass -// -// More detailed documentation of these routines can be found in optimizer.hpp - -namespace spvtools { - -// Stream Output Buffer Offsets -// -// The following values provide offsets into the output buffer struct -// generated by InstrumentPass::GenDebugStreamWrite. This method is utilized -// by InstBindlessCheckPass, InstBuffAddrCheckPass, and InstDebugPrintfPass. -// -// The 1st member of the debug output buffer contains a set of flags -// controlling the behavior of instrumentation code. -static const int kDebugOutputFlagsOffset = 0; - -// Values stored at kDebugOutputFlagsOffset -enum kInstFlags : unsigned int { - kInstBufferOOBEnable = 0x1, -}; - -// The 2nd member of the debug output buffer contains the next available word -// in the data stream to be written. Shaders will atomically read and update -// this value so as not to overwrite each others records. This value must be -// initialized to zero -static const int kDebugOutputSizeOffset = 1; - -// The 3rd member of the output buffer is the start of the stream of records -// written by the instrumented shaders. Each record represents a validation -// error. The format of the records is documented below. -static const int kDebugOutputDataOffset = 2; - -// Common Stream Record Offsets -// -// The following are offsets to fields which are common to all records written -// to the output stream. -// -// Each record first contains the size of the record in 32-bit words, including -// the size word. -static const int kInstCommonOutSize = 0; - -// This is the shader id passed by the layer when the instrumentation pass is -// created. -static const int kInstCommonOutShaderId = 1; - -// This is the ordinal position of the instruction within the SPIR-V shader -// which generated the validation error. -static const int kInstCommonOutInstructionIdx = 2; - -// This is the stage which generated the validation error. This word is used -// to determine the contents of the next two words in the record. -// 0:Vert, 1:TessCtrl, 2:TessEval, 3:Geom, 4:Frag, 5:Compute -static const int kInstCommonOutStageIdx = 3; -static const int kInstCommonOutCnt = 4; - -// Stage-specific Stream Record Offsets -// -// Each stage will contain different values in the next set of words of the -// record used to identify which instantiation of the shader generated the -// validation error. -// -// Vertex Shader Output Record Offsets -static const int kInstVertOutVertexIndex = kInstCommonOutCnt; -static const int kInstVertOutInstanceIndex = kInstCommonOutCnt + 1; -static const int kInstVertOutUnused = kInstCommonOutCnt + 2; - -// Frag Shader Output Record Offsets -static const int kInstFragOutFragCoordX = kInstCommonOutCnt; -static const int kInstFragOutFragCoordY = kInstCommonOutCnt + 1; -static const int kInstFragOutUnused = kInstCommonOutCnt + 2; - -// Compute Shader Output Record Offsets -static const int kInstCompOutGlobalInvocationIdX = kInstCommonOutCnt; -static const int kInstCompOutGlobalInvocationIdY = kInstCommonOutCnt + 1; -static const int kInstCompOutGlobalInvocationIdZ = kInstCommonOutCnt + 2; - -// Tessellation Control Shader Output Record Offsets -static const int kInstTessCtlOutInvocationId = kInstCommonOutCnt; -static const int kInstTessCtlOutPrimitiveId = kInstCommonOutCnt + 1; -static const int kInstTessCtlOutUnused = kInstCommonOutCnt + 2; - -// Tessellation Eval Shader Output Record Offsets -static const int kInstTessEvalOutPrimitiveId = kInstCommonOutCnt; -static const int kInstTessEvalOutTessCoordU = kInstCommonOutCnt + 1; -static const int kInstTessEvalOutTessCoordV = kInstCommonOutCnt + 2; - -// Geometry Shader Output Record Offsets -static const int kInstGeomOutPrimitiveId = kInstCommonOutCnt; -static const int kInstGeomOutInvocationId = kInstCommonOutCnt + 1; -static const int kInstGeomOutUnused = kInstCommonOutCnt + 2; - -// Ray Tracing Shader Output Record Offsets -static const int kInstRayTracingOutLaunchIdX = kInstCommonOutCnt; -static const int kInstRayTracingOutLaunchIdY = kInstCommonOutCnt + 1; -static const int kInstRayTracingOutLaunchIdZ = kInstCommonOutCnt + 2; - -// Mesh Shader Output Record Offsets -static const int kInstMeshOutGlobalInvocationIdX = kInstCommonOutCnt; -static const int kInstMeshOutGlobalInvocationIdY = kInstCommonOutCnt + 1; -static const int kInstMeshOutGlobalInvocationIdZ = kInstCommonOutCnt + 2; - -// Task Shader Output Record Offsets -static const int kInstTaskOutGlobalInvocationIdX = kInstCommonOutCnt; -static const int kInstTaskOutGlobalInvocationIdY = kInstCommonOutCnt + 1; -static const int kInstTaskOutGlobalInvocationIdZ = kInstCommonOutCnt + 2; - -// Size of Common and Stage-specific Members -static const int kInstStageOutCnt = kInstCommonOutCnt + 3; - -// Validation Error Code Offset -// -// This identifies the validation error. It also helps to identify -// how many words follow in the record and their meaning. -static const int kInstValidationOutError = kInstStageOutCnt; - -// Validation-specific Output Record Offsets -// -// Each different validation will generate a potentially different -// number of words at the end of the record giving more specifics -// about the validation error. -// -// A bindless bounds error will output the index and the bound. -static const int kInstBindlessBoundsOutDescSet = kInstStageOutCnt + 1; -static const int kInstBindlessBoundsOutDescBinding = kInstStageOutCnt + 2; -static const int kInstBindlessBoundsOutDescIndex = kInstStageOutCnt + 3; -static const int kInstBindlessBoundsOutDescBound = kInstStageOutCnt + 4; -static const int kInstBindlessBoundsOutUnused = kInstStageOutCnt + 5; -static const int kInstBindlessBoundsOutCnt = kInstStageOutCnt + 6; - -// A descriptor uninitialized error will output the index. -static const int kInstBindlessUninitOutDescSet = kInstStageOutCnt + 1; -static const int kInstBindlessUninitOutBinding = kInstStageOutCnt + 2; -static const int kInstBindlessUninitOutDescIndex = kInstStageOutCnt + 3; -static const int kInstBindlessUninitOutUnused = kInstStageOutCnt + 4; -static const int kInstBindlessUninitOutUnused2 = kInstStageOutCnt + 5; -static const int kInstBindlessUninitOutCnt = kInstStageOutCnt + 6; - -// A buffer out-of-bounds error will output the descriptor -// index, the buffer offset and the buffer size -static const int kInstBindlessBuffOOBOutDescSet = kInstStageOutCnt + 1; -static const int kInstBindlessBuffOOBOutDescBinding = kInstStageOutCnt + 2; -static const int kInstBindlessBuffOOBOutDescIndex = kInstStageOutCnt + 3; -static const int kInstBindlessBuffOOBOutBuffOff = kInstStageOutCnt + 4; -static const int kInstBindlessBuffOOBOutBuffSize = kInstStageOutCnt + 5; -static const int kInstBindlessBuffOOBOutCnt = kInstStageOutCnt + 6; - -// A buffer address unalloc error will output the 64-bit pointer in -// two 32-bit pieces, lower bits first. -static const int kInstBuffAddrUnallocOutDescPtrLo = kInstStageOutCnt + 1; -static const int kInstBuffAddrUnallocOutDescPtrHi = kInstStageOutCnt + 2; -static const int kInstBuffAddrUnallocOutCnt = kInstStageOutCnt + 3; - -// Maximum Output Record Member Count -static const int kInstMaxOutCnt = kInstStageOutCnt + 6; - -// Validation Error Codes -// -// These are the possible validation error codes. -static const int kInstErrorBindlessBounds = 1; -static const int kInstErrorBindlessUninit = 2; -static const int kInstErrorBuffAddrUnallocRef = 3; -static const int kInstErrorOOB = 4; -static const int kInstErrorMax = kInstErrorOOB; - -// Direct Input Buffer Offsets -// -// The following values provide member offsets into the input buffers -// consumed by InstrumentPass::GenDebugDirectRead(). This method is utilized -// by InstBindlessCheckPass. -// -// The only object in an input buffer is a runtime array of unsigned -// integers. Each validation will have its own formatting of this array. -static const int kDebugInputDataOffset = 0; - -// Debug Buffer Bindings -// -// These are the bindings for the different buffers which are -// read or written by the instrumentation passes. -// -// This is the output buffer written by InstBindlessCheckPass, -// InstBuffAddrCheckPass, and possibly other future validations. -static const int kDebugOutputBindingStream = 0; - -// The binding for the input buffer read by InstBindlessCheckPass. -static const int kDebugInputBindingBindless = 1; - -// The binding for the input buffer read by InstBuffAddrCheckPass. -static const int kDebugInputBindingBuffAddr = 2; - -// This is the output buffer written by InstDebugPrintfPass. -static const int kDebugOutputPrintfStream = 3; - -// clang-format off -// Bindless Validation Input Buffer Format -// -// An input buffer for bindless validation has this structure: -// GLSL: -// layout(buffer_reference, std430, buffer_reference_align = 8) buffer DescriptorSetData { -// uint num_bindings; -// uint data[]; -// }; -// -// layout(set = 7, binding = 1, std430) buffer inst_bindless_InputBuffer -// { -// DescriptorSetData desc_sets[32]; -// } inst_bindless_input_buffer; -// -// -// To look up the length of a binding: -// uint length = inst_bindless_input_buffer[set].data[binding]; -// Scalar bindings have a length of 1. -// -// To look up the initialization state of a descriptor in a binding: -// uint num_bindings = inst_bindless_input_buffer[set].num_bindings; -// uint binding_state_start = inst_bindless_input_buffer[set].data[num_bindings + binding]; -// uint init_state = inst_bindless_input_buffer[set].data[binding_state_start + index]; -// -// For scalar bindings, use 0 for the index. -// clang-format on -// -// The size of the inst_bindless_input_buffer array, regardless of how many -// descriptor sets the device supports. -static const int kDebugInputBindlessMaxDescSets = 32; - -// Buffer Device Address Input Buffer Format -// -// An input buffer for buffer device address validation consists of a single -// array of unsigned 64-bit integers we will call Data[]. This array is -// formatted as follows: -// -// At offset kDebugInputBuffAddrPtrOffset is a list of sorted valid buffer -// addresses. The list is terminated with the address 0xffffffffffffffff. -// If 0x0 is not a valid buffer address, this address is inserted at the -// start of the list. -// -static const int kDebugInputBuffAddrPtrOffset = 1; -// -// At offset kDebugInputBuffAddrLengthOffset in Data[] is a single uint64 which -// gives an offset to the start of the buffer length data. More -// specifically, for a buffer whose pointer is located at input buffer offset -// i, the length is located at: -// -// Data[ i - kDebugInputBuffAddrPtrOffset -// + Data[ kDebugInputBuffAddrLengthOffset ] ] -// -// The length associated with the 0xffffffffffffffff address is zero. If -// not a valid buffer, the length associated with the 0x0 address is zero. -static const int kDebugInputBuffAddrLengthOffset = 0; - -} // namespace spvtools - -#endif // INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_ diff --git a/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.h b/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.h index 9010a381..0624e023 100644 --- a/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.h +++ b/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.h @@ -33,15 +33,19 @@ extern "C" { #else #define SPIRV_TOOLS_EXPORT __declspec(dllimport) #endif +#define SPIRV_TOOLS_LOCAL #else #if defined(SPIRV_TOOLS_IMPLEMENTATION) #define SPIRV_TOOLS_EXPORT __attribute__((visibility("default"))) +#define SPIRV_TOOLS_LOCAL __attribute__((visibility("hidden"))) #else #define SPIRV_TOOLS_EXPORT +#define SPIRV_TOOLS_LOCAL #endif #endif #else #define SPIRV_TOOLS_EXPORT +#define SPIRV_TOOLS_LOCAL #endif // Helpers @@ -171,6 +175,7 @@ typedef enum spv_operand_type_t { SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS, // SPIR-V Sec 3.29 SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO, // SPIR-V Sec 3.30 SPV_OPERAND_TYPE_CAPABILITY, // SPIR-V Sec 3.31 + SPV_OPERAND_TYPE_FPENCODING, // SPIR-V Sec 3.51 // NOTE: New concrete enum values should be added at the end. @@ -232,6 +237,8 @@ typedef enum spv_operand_type_t { // assemble regardless of where they occur -- literals, IDs, immediate // integers, etc. SPV_OPERAND_TYPE_OPTIONAL_CIV, + // An optional floating point encoding enum + SPV_OPERAND_TYPE_OPTIONAL_FPENCODING, // A variable operand represents zero or more logical operands. // In an instruction definition, this may only appear at the end of the @@ -298,6 +305,16 @@ typedef enum spv_operand_type_t { SPV_OPERAND_TYPE_INITIALIZATION_MODE_QUALIFIER, // Enum type from SPV_INTEL_global_variable_host_access SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER, + // Enum type from SPV_INTEL_cache_controls + SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL, + // Enum type from SPV_INTEL_cache_controls + SPV_OPERAND_TYPE_STORE_CACHE_CONTROL, + // Enum type from SPV_INTEL_maximum_registers + SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS, + // Enum type from SPV_NV_raw_access_chains + SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS, + // Optional enum type from SPV_NV_raw_access_chains + SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS, // This is a sentinel value, and does not represent an operand type. // It should come last. @@ -324,6 +341,7 @@ typedef enum spv_ext_inst_type_t { SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100, SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION, SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100, + SPV_EXT_INST_TYPE_NONSEMANTIC_VKSPREFLECTION, // Multiple distinct extended instruction set types could return this // value, if they are prefixed with NonSemantic. and are otherwise @@ -368,6 +386,11 @@ typedef enum spv_binary_to_text_options_t { SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES = SPV_BIT(6), // Add some comments to the generated assembly SPV_BINARY_TO_TEXT_OPTION_COMMENT = SPV_BIT(7), + // Use nested indentation for more readable SPIR-V + SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT = SPV_BIT(8), + // Reorder blocks to match the structured control flow of SPIR-V to increase + // readability. + SPV_BINARY_TO_TEXT_OPTION_REORDER_BLOCKS = SPV_BIT(9), SPV_FORCE_32_BIT_ENUM(spv_binary_to_text_options_t) } spv_binary_to_text_options_t; @@ -963,9 +986,16 @@ SPIRV_TOOLS_EXPORT bool spvOptimizerRegisterPassFromFlag( spv_optimizer_t* optimizer, const char* flag); // Registers passes specified by length number of flags in an optimizer object. +// Passes may remove interface variables that are unused. SPIRV_TOOLS_EXPORT bool spvOptimizerRegisterPassesFromFlags( spv_optimizer_t* optimizer, const char** flags, const size_t flag_count); +// Registers passes specified by length number of flags in an optimizer object. +// Passes will not remove interface variables. +SPIRV_TOOLS_EXPORT bool +spvOptimizerRegisterPassesFromFlagsWhilePreservingTheInterface( + spv_optimizer_t* optimizer, const char** flags, const size_t flag_count); + // Optimizes the SPIR-V code of size |word_count| pointed to by |binary| and // returns an optimized spv_binary in |optimized_binary|. // diff --git a/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp b/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp index ee6c8469..6a64e936 100644 --- a/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp +++ b/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp @@ -20,7 +20,7 @@ #include #include -#include "spirv-tools/libspirv.h" +#include "libspirv.h" namespace spvtools { @@ -37,7 +37,7 @@ using InstructionParser = std::function; // C++ RAII wrapper around the C context object spv_context. -class Context { +class SPIRV_TOOLS_EXPORT Context { public: // Constructs a context targeting the given environment |env|. // @@ -73,7 +73,7 @@ class Context { }; // A RAII wrapper around a validator options object. -class ValidatorOptions { +class SPIRV_TOOLS_EXPORT ValidatorOptions { public: ValidatorOptions() : options_(spvValidatorOptionsCreate()) {} ~ValidatorOptions() { spvValidatorOptionsDestroy(options_); } @@ -163,7 +163,7 @@ class ValidatorOptions { }; // A C++ wrapper around an optimization options object. -class OptimizerOptions { +class SPIRV_TOOLS_EXPORT OptimizerOptions { public: OptimizerOptions() : options_(spvOptimizerOptionsCreate()) {} ~OptimizerOptions() { spvOptimizerOptionsDestroy(options_); } @@ -205,7 +205,7 @@ class OptimizerOptions { }; // A C++ wrapper around a reducer options object. -class ReducerOptions { +class SPIRV_TOOLS_EXPORT ReducerOptions { public: ReducerOptions() : options_(spvReducerOptionsCreate()) {} ~ReducerOptions() { spvReducerOptionsDestroy(options_); } @@ -236,7 +236,7 @@ class ReducerOptions { }; // A C++ wrapper around a fuzzer options object. -class FuzzerOptions { +class SPIRV_TOOLS_EXPORT FuzzerOptions { public: FuzzerOptions() : options_(spvFuzzerOptionsCreate()) {} ~FuzzerOptions() { spvFuzzerOptionsDestroy(options_); } @@ -283,7 +283,7 @@ class FuzzerOptions { // provides methods for assembling, disassembling, and validating. // // Instances of this class provide basic thread-safety guarantee. -class SpirvTools { +class SPIRV_TOOLS_EXPORT SpirvTools { public: enum { // Default assembling option used by assemble(): @@ -388,7 +388,8 @@ class SpirvTools { bool IsValid() const; private: - struct Impl; // Opaque struct for holding the data fields used by this class. + struct SPIRV_TOOLS_LOCAL + Impl; // Opaque struct for holding the data fields used by this class. std::unique_ptr impl_; // Unique pointer to implementation data. }; diff --git a/bgfx/3rdparty/spirv-tools/include/spirv-tools/linker.hpp b/bgfx/3rdparty/spirv-tools/include/spirv-tools/linker.hpp index 5b60cb9f..9037b948 100644 --- a/bgfx/3rdparty/spirv-tools/include/spirv-tools/linker.hpp +++ b/bgfx/3rdparty/spirv-tools/include/spirv-tools/linker.hpp @@ -16,7 +16,6 @@ #define INCLUDE_SPIRV_TOOLS_LINKER_HPP_ #include - #include #include @@ -24,7 +23,7 @@ namespace spvtools { -class LinkerOptions { +class SPIRV_TOOLS_EXPORT LinkerOptions { public: // Returns whether a library or an executable should be produced by the // linking phase. @@ -63,11 +62,17 @@ class LinkerOptions { use_highest_version_ = use_highest_vers; } + bool GetAllowPtrTypeMismatch() const { return allow_ptr_type_mismatch_; } + void SetAllowPtrTypeMismatch(bool allow_ptr_type_mismatch) { + allow_ptr_type_mismatch_ = allow_ptr_type_mismatch; + } + private: bool create_library_{false}; bool verify_ids_{false}; bool allow_partial_linkage_{false}; bool use_highest_version_{false}; + bool allow_ptr_type_mismatch_{false}; }; // Links one or more SPIR-V modules into a new SPIR-V module. That is, combine @@ -84,14 +89,15 @@ class LinkerOptions { // * Some entry points were defined multiple times; // * Some imported symbols did not have an exported counterpart; // * Possibly other reasons. -spv_result_t Link(const Context& context, - const std::vector>& binaries, - std::vector* linked_binary, - const LinkerOptions& options = LinkerOptions()); -spv_result_t Link(const Context& context, const uint32_t* const* binaries, - const size_t* binary_sizes, size_t num_binaries, - std::vector* linked_binary, - const LinkerOptions& options = LinkerOptions()); +SPIRV_TOOLS_EXPORT spv_result_t +Link(const Context& context, const std::vector>& binaries, + std::vector* linked_binary, + const LinkerOptions& options = LinkerOptions()); +SPIRV_TOOLS_EXPORT spv_result_t +Link(const Context& context, const uint32_t* const* binaries, + const size_t* binary_sizes, size_t num_binaries, + std::vector* linked_binary, + const LinkerOptions& options = LinkerOptions()); } // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/include/spirv-tools/linter.hpp b/bgfx/3rdparty/spirv-tools/include/spirv-tools/linter.hpp index 52ed5a46..ccbcf0c1 100644 --- a/bgfx/3rdparty/spirv-tools/include/spirv-tools/linter.hpp +++ b/bgfx/3rdparty/spirv-tools/include/spirv-tools/linter.hpp @@ -24,7 +24,7 @@ namespace spvtools { // provides a method for linting. // // Instances of this class provides basic thread-safety guarantee. -class Linter { +class SPIRV_TOOLS_EXPORT Linter { public: explicit Linter(spv_target_env env); @@ -40,7 +40,7 @@ class Linter { bool Run(const uint32_t* binary, size_t binary_size); private: - struct Impl; + struct SPIRV_TOOLS_LOCAL Impl; std::unique_ptr impl_; }; } // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp b/bgfx/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp index 260fa72c..9427b01e 100644 --- a/bgfx/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp +++ b/bgfx/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp @@ -37,14 +37,14 @@ struct DescriptorSetAndBinding; // provides methods for registering optimization passes and optimizing. // // Instances of this class provides basic thread-safety guarantee. -class Optimizer { +class SPIRV_TOOLS_EXPORT Optimizer { public: // The token for an optimization pass. It is returned via one of the // Create*Pass() standalone functions at the end of this header file and // consumed by the RegisterPass() method. Tokens are one-time objects that // only support move; copying is not allowed. struct PassToken { - struct Impl; // Opaque struct for holding internal data. + struct SPIRV_TOOLS_LOCAL Impl; // Opaque struct for holding internal data. PassToken(std::unique_ptr); @@ -100,8 +100,6 @@ class Optimizer { // // If |preserve_interface| is true, all non-io variables in the entry point // interface are considered live and are not eliminated. - // |preserve_interface| should be true if HLSL is generated - // from the SPIR-V bytecode. Optimizer& RegisterPerformancePasses(); Optimizer& RegisterPerformancePasses(bool preserve_interface); @@ -111,8 +109,6 @@ class Optimizer { // // If |preserve_interface| is true, all non-io variables in the entry point // interface are considered live and are not eliminated. - // |preserve_interface| should be true if HLSL is generated - // from the SPIR-V bytecode. Optimizer& RegisterSizePasses(); Optimizer& RegisterSizePasses(bool preserve_interface); @@ -127,8 +123,6 @@ class Optimizer { // // If |preserve_interface| is true, all non-io variables in the entry point // interface are considered live and are not eliminated. - // |preserve_interface| should be true if HLSL is generated - // from the SPIR-V bytecode. Optimizer& RegisterLegalizationPasses(); Optimizer& RegisterLegalizationPasses(bool preserve_interface); @@ -139,8 +133,13 @@ class Optimizer { // error message is emitted to the MessageConsumer object (use // Optimizer::SetMessageConsumer to define a message consumer, if needed). // + // If |preserve_interface| is true, all non-io variables in the entry point + // interface are considered live and are not eliminated. + // // If all the passes are registered successfully, it returns true. bool RegisterPassesFromFlags(const std::vector& flags); + bool RegisterPassesFromFlags(const std::vector& flags, + bool preserve_interface); // Registers the optimization pass associated with |flag|. This only accepts // |flag| values of the form "--pass_name[=pass_args]". If no such pass @@ -157,7 +156,11 @@ class Optimizer { // // --legalize-hlsl: Registers all passes that legalize SPIR-V generated by an // HLSL front-end. + // + // If |preserve_interface| is true, all non-io variables in the entry point + // interface are considered live and are not eliminated. bool RegisterPassFromFlag(const std::string& flag); + bool RegisterPassFromFlag(const std::string& flag, bool preserve_interface); // Validates that |flag| has a valid format. Strings accepted: // @@ -236,7 +239,7 @@ class Optimizer { Optimizer& SetValidateAfterAll(bool validate); private: - struct Impl; // Opaque struct for holding internal data. + struct SPIRV_TOOLS_LOCAL Impl; // Opaque struct for holding internal data. std::unique_ptr impl_; // Unique pointer to internal data. }; @@ -744,68 +747,6 @@ Optimizer::PassToken CreateReduceLoadSizePass( // them into a single instruction where possible. Optimizer::PassToken CreateCombineAccessChainsPass(); -// Create a pass to instrument bindless descriptor checking -// This pass instruments all bindless references to check that descriptor -// array indices are inbounds, and if the descriptor indexing extension is -// enabled, that the descriptor has been initialized. If the reference is -// invalid, a record is written to the debug output buffer (if space allows) -// and a null value is returned. This pass is designed to support bindless -// validation in the Vulkan validation layers. -// -// TODO(greg-lunarg): Add support for buffer references. Currently only does -// checking for image references. -// -// Dead code elimination should be run after this pass as the original, -// potentially invalid code is not removed and could cause undefined behavior, -// including crashes. It may also be beneficial to run Simplification -// (ie Constant Propagation), DeadBranchElim and BlockMerge after this pass to -// optimize instrument code involving the testing of compile-time constants. -// It is also generally recommended that this pass (and all -// instrumentation passes) be run after any legalization and optimization -// passes. This will give better analysis for the instrumentation and avoid -// potentially de-optimizing the instrument code, for example, inlining -// the debug record output function throughout the module. -// -// The instrumentation will read and write buffers in debug -// descriptor set |desc_set|. It will write |shader_id| in each output record -// to identify the shader module which generated the record. -Optimizer::PassToken CreateInstBindlessCheckPass(uint32_t desc_set, - uint32_t shader_id); - -// Create a pass to instrument physical buffer address checking -// This pass instruments all physical buffer address references to check that -// all referenced bytes fall in a valid buffer. If the reference is -// invalid, a record is written to the debug output buffer (if space allows) -// and a null value is returned. This pass is designed to support buffer -// address validation in the Vulkan validation layers. -// -// Dead code elimination should be run after this pass as the original, -// potentially invalid code is not removed and could cause undefined behavior, -// including crashes. Instruction simplification would likely also be -// beneficial. It is also generally recommended that this pass (and all -// instrumentation passes) be run after any legalization and optimization -// passes. This will give better analysis for the instrumentation and avoid -// potentially de-optimizing the instrument code, for example, inlining -// the debug record output function throughout the module. -// -// The instrumentation will read and write buffers in debug -// descriptor set |desc_set|. It will write |shader_id| in each output record -// to identify the shader module which generated the record. -Optimizer::PassToken CreateInstBuffAddrCheckPass(uint32_t desc_set, - uint32_t shader_id); - -// Create a pass to instrument OpDebugPrintf instructions. -// This pass replaces all OpDebugPrintf instructions with instructions to write -// a record containing the string id and the all specified values into a special -// printf output buffer (if space allows). This pass is designed to support -// the printf validation in the Vulkan validation layers. -// -// The instrumentation will write buffers in debug descriptor set |desc_set|. -// It will write |shader_id| in each output record to identify the shader -// module which generated the record. -Optimizer::PassToken CreateInstDebugPrintfPass(uint32_t desc_set, - uint32_t shader_id); - // Create a pass to upgrade to the VulkanKHR memory model. // This pass upgrades the Logical GLSL450 memory model to Logical VulkanKHR. // Additionally, it modifies memory, image, atomic and barrier operations to @@ -874,14 +815,19 @@ Optimizer::PassToken CreateReplaceDescArrayAccessUsingVarIndexPass(); // Create descriptor scalar replacement pass. // This pass replaces every array variable |desc| that has a DescriptorSet and -// Binding decorations with a new variable for each element of the array. -// Suppose |desc| was bound at binding |b|. Then the variable corresponding to -// |desc[i]| will have binding |b+i|. The descriptor set will be the same. It -// is assumed that no other variable already has a binding that will used by one -// of the new variables. If not, the pass will generate invalid Spir-V. All -// accesses to |desc| must be OpAccessChain instructions with a literal index -// for the first index. +// Binding decorations with a new variable for each element of the +// array/composite. Suppose |desc| was bound at binding |b|. Then the variable +// corresponding to |desc[i]| will have binding |b+i|. The descriptor set will +// be the same. It is assumed that no other variable already has a binding that +// will used by one of the new variables. If not, the pass will generate +// invalid Spir-V. All accesses to |desc| must be OpAccessChain instructions +// with a literal index for the first index. This variant flattens both +// composites and arrays. Optimizer::PassToken CreateDescriptorScalarReplacementPass(); +// This variant flattens only composites. +Optimizer::PassToken CreateDescriptorCompositeScalarReplacementPass(); +// This variant flattens only arrays. +Optimizer::PassToken CreateDescriptorArrayScalarReplacementPass(); // Create a pass to replace each OpKill instruction with a function call to a // function that has a single OpKill. Also replace each OpTerminateInvocation @@ -903,6 +849,12 @@ Optimizer::PassToken CreateAmdExtToKhrPass(); // propagated into their final positions. Optimizer::PassToken CreateInterpolateFixupPass(); +// Replace OpExtInst instructions with OpExtInstWithForwardRefsKHR when +// the instruction contains a forward reference to another debug instuction. +// Replace OpExtInstWithForwardRefsKHR with OpExtInst when there are no forward +// reference to another debug instruction. +Optimizer::PassToken CreateOpExtInstWithForwardReferenceFixupPass(); + // Removes unused components from composite input variables. Current // implementation just removes trailing unused components from input arrays // and structs. The pass performs best after maximizing dead code removal. @@ -992,11 +944,30 @@ Optimizer::PassToken CreateFixFuncCallArgumentsPass(); // the unknown capability interacts with one of the trimmed capabilities. Optimizer::PassToken CreateTrimCapabilitiesPass(); +// Creates a struct-packing pass. +// This pass re-assigns all offset layout decorators to tightly pack +// the struct with OpName matching `structToPack` according to the given packing +// rule. Accepted packing rules are: std140, std140EnhancedLayout, std430, +// std430EnhancedLayout, hlslCbuffer, hlslCbufferPackOffset, scalar, +// scalarEnhancedLayout. +Optimizer::PassToken CreateStructPackingPass(const char* structToPack, + const char* packingRule); + // Creates a switch-descriptorset pass. // This pass changes any DescriptorSet decorations with the value |ds_from| to // use the new value |ds_to|. Optimizer::PassToken CreateSwitchDescriptorSetPass(uint32_t ds_from, uint32_t ds_to); + +// Creates an invocation interlock placement pass. +// This pass ensures that an entry point will have at most one +// OpBeginInterlockInvocationEXT and one OpEndInterlockInvocationEXT, in that +// order. +Optimizer::PassToken CreateInvocationInterlockPlacementPass(); + +// Creates a pass to add/remove maximal reconvergence execution mode. +// This pass either adds or removes maximal reconvergence from all entry points. +Optimizer::PassToken CreateModifyMaximalReconvergencePass(bool add); } // namespace spvtools #endif // INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_ diff --git a/bgfx/3rdparty/spirv-tools/source/binary.cpp b/bgfx/3rdparty/spirv-tools/source/binary.cpp index 3cfdee04..772e98c0 100644 --- a/bgfx/3rdparty/spirv-tools/source/binary.cpp +++ b/bgfx/3rdparty/spirv-tools/source/binary.cpp @@ -473,7 +473,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, if (!word) return diagnostic(SPV_ERROR_INVALID_ID) << "Id is 0"; parsed_operand.type = SPV_OPERAND_TYPE_ID; - if (opcode == spv::Op::OpExtInst && parsed_operand.offset == 3) { + if (spvIsExtendedInstruction(opcode) && parsed_operand.offset == 3) { // The current word is the extended instruction set Id. // Set the extended instruction set type for the current instruction. auto ext_inst_type_iter = _.import_id_to_ext_inst_type.find(word); @@ -494,7 +494,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, break; case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { - assert(spv::Op::OpExtInst == opcode); + assert(spvIsExtendedInstruction(opcode)); assert(inst->ext_inst_type != SPV_EXT_INST_TYPE_NONE); spv_ext_inst_desc ext_inst; if (grammar_.lookupExtInst(inst->ext_inst_type, word, &ext_inst) == @@ -670,7 +670,13 @@ spv_result_t Parser::parseOperand(size_t inst_offset, case SPV_OPERAND_TYPE_QUANTIZATION_MODES: case SPV_OPERAND_TYPE_OVERFLOW_MODES: case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT: - case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: { + case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: + case SPV_OPERAND_TYPE_FPENCODING: + case SPV_OPERAND_TYPE_OPTIONAL_FPENCODING: + case SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL: + case SPV_OPERAND_TYPE_STORE_CACHE_CONTROL: + case SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS: { // A single word that is a plain enum value. // Map an optional operand type to its corresponding concrete type. @@ -678,6 +684,8 @@ spv_result_t Parser::parseOperand(size_t inst_offset, parsed_operand.type = SPV_OPERAND_TYPE_ACCESS_QUALIFIER; if (type == SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT) parsed_operand.type = SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT; + if (type == SPV_OPERAND_TYPE_OPTIONAL_FPENCODING) + parsed_operand.type = SPV_OPERAND_TYPE_FPENCODING; spv_operand_desc entry; if (grammar_.lookupOperand(type, word, &entry)) { @@ -698,7 +706,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, << ", if you are creating a new source language please use " "value 0 " "(Unknown) and when ready, add your source language to " - "SPRIV-Headers"; + "SPIRV-Headers"; } // Prepare to accept operands to this operand, if needed. spvPushOperandTypes(entry->operandTypes, expected_operands); @@ -710,6 +718,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, case SPV_OPERAND_TYPE_IMAGE: case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: + case SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS: case SPV_OPERAND_TYPE_SELECTION_CONTROL: case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS: case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: @@ -720,10 +729,12 @@ spv_result_t Parser::parseOperand(size_t inst_offset, // Map an optional operand type to its corresponding concrete type. if (type == SPV_OPERAND_TYPE_OPTIONAL_IMAGE) parsed_operand.type = SPV_OPERAND_TYPE_IMAGE; - else if (type == SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS) + if (type == SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS) parsed_operand.type = SPV_OPERAND_TYPE_MEMORY_ACCESS; if (type == SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS) parsed_operand.type = SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_OPERANDS; + if (type == SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS) + parsed_operand.type = SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS; // Check validity of set mask bits. Also prepare for operands for those // masks if they have any. To get operand order correct, scan from diff --git a/bgfx/3rdparty/spirv-tools/source/disassemble.cpp b/bgfx/3rdparty/spirv-tools/source/disassemble.cpp index 5173fbf6..db99151a 100644 --- a/bgfx/3rdparty/spirv-tools/source/disassemble.cpp +++ b/bgfx/3rdparty/spirv-tools/source/disassemble.cpp @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include @@ -43,6 +45,70 @@ namespace spvtools { namespace { +// Indices to ControlFlowGraph's list of blocks from one block to its successors +struct BlockSuccessors { + // Merge block in OpLoopMerge and OpSelectionMerge + uint32_t merge_block_id = 0; + // The continue block in OpLoopMerge + uint32_t continue_block_id = 0; + // The true and false blocks in OpBranchConditional + uint32_t true_block_id = 0; + uint32_t false_block_id = 0; + // The body block of a loop, as specified by OpBranch after a merge + // instruction + uint32_t body_block_id = 0; + // The same-nesting-level block that follows this one, indicated by an + // OpBranch with no merge instruction. + uint32_t next_block_id = 0; + // The cases (including default) of an OpSwitch + std::vector case_block_ids; +}; + +class ParsedInstruction { + public: + ParsedInstruction(const spv_parsed_instruction_t* instruction) { + // Make a copy of the parsed instruction, including stable memory for its + // operands. + instruction_ = *instruction; + operands_ = + std::make_unique(instruction->num_operands); + memcpy(operands_.get(), instruction->operands, + instruction->num_operands * sizeof(*instruction->operands)); + instruction_.operands = operands_.get(); + } + + const spv_parsed_instruction_t* get() const { return &instruction_; } + + private: + spv_parsed_instruction_t instruction_; + std::unique_ptr operands_; +}; + +// One block in the CFG +struct SingleBlock { + // The byte offset in the SPIR-V where the block starts. Used for printing in + // a comment. + size_t byte_offset; + + // Block instructions + std::vector instructions; + + // Successors of this block + BlockSuccessors successors; + + // The nesting level for this block. + uint32_t nest_level = 0; + bool nest_level_assigned = false; + + // Whether the block was reachable + bool reachable = false; +}; + +// CFG for one function +struct ControlFlowGraph { + std::vector blocks; +}; + // A Disassembler instance converts a SPIR-V binary to its assembly // representation. class Disassembler { @@ -50,6 +116,10 @@ class Disassembler { Disassembler(const AssemblyGrammar& grammar, uint32_t options, NameMapper name_mapper) : print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)), + nested_indent_( + spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT, options)), + reorder_blocks_( + spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_REORDER_BLOCKS, options)), text_(), out_(print_ ? out_stream() : out_stream(text_)), instruction_disassembler_(grammar, out_.get(), options, name_mapper), @@ -70,7 +140,13 @@ class Disassembler { spv_result_t SaveTextResult(spv_text* text_result) const; private: + void EmitCFG(); + const bool print_; // Should we also print to the standard output stream? + const bool nested_indent_; // Should the blocks be indented according to the + // control flow structure? + const bool + reorder_blocks_; // Should the blocks be reordered for readability? spv_endianness_t endian_; // The detected endianness of the binary. std::stringstream text_; // Captures the text, if not printing. out_stream out_; // The Output stream. Either to text_ or standard output. @@ -80,6 +156,9 @@ class Disassembler { bool inserted_decoration_space_ = false; bool inserted_debug_space_ = false; bool inserted_type_space_ = false; + + // The CFG for the current function + ControlFlowGraph current_function_cfg_; }; spv_result_t Disassembler::HandleHeader(spv_endianness_t endian, @@ -106,13 +185,336 @@ spv_result_t Disassembler::HandleInstruction( inserted_debug_space_, inserted_type_space_); - instruction_disassembler_.EmitInstruction(inst, byte_offset_); + // When nesting needs to be calculated or when the blocks are reordered, we + // have to have the full picture of the CFG first. Defer processing of the + // instructions until the entire function is visited. This is not done + // without those options (even if simpler) to improve debuggability; for + // example to be able to see whatever is parsed so far even if there is a + // parse error. + if (nested_indent_ || reorder_blocks_) { + switch (static_cast(inst.opcode)) { + case spv::Op::OpLabel: { + // Add a new block to the CFG + SingleBlock new_block; + new_block.byte_offset = byte_offset_; + new_block.instructions.emplace_back(&inst); + current_function_cfg_.blocks.push_back(std::move(new_block)); + break; + } + case spv::Op::OpFunctionEnd: + // Process the CFG and output the instructions + EmitCFG(); + // Output OpFunctionEnd itself too + [[fallthrough]]; + default: + if (!current_function_cfg_.blocks.empty()) { + // If in a function, stash the instruction for later. + current_function_cfg_.blocks.back().instructions.emplace_back(&inst); + } else { + // Otherwise emit the instruction right away. + instruction_disassembler_.EmitInstruction(inst, byte_offset_); + } + break; + } + } else { + instruction_disassembler_.EmitInstruction(inst, byte_offset_); + } byte_offset_ += inst.num_words * sizeof(uint32_t); return SPV_SUCCESS; } +// Helper to get the operand of an instruction as an id. +uint32_t GetOperand(const spv_parsed_instruction_t* instruction, + uint32_t operand) { + return instruction->words[instruction->operands[operand].offset]; +} + +std::unordered_map BuildControlFlowGraph( + ControlFlowGraph& cfg) { + std::unordered_map id_to_index; + + for (size_t index = 0; index < cfg.blocks.size(); ++index) { + SingleBlock& block = cfg.blocks[index]; + + // For future use, build the ID->index map + assert(static_cast(block.instructions[0].get()->opcode) == + spv::Op::OpLabel); + const uint32_t id = block.instructions[0].get()->result_id; + + id_to_index[id] = static_cast(index); + + // Look for a merge instruction first. The function of OpBranch depends on + // that. + if (block.instructions.size() >= 3) { + const spv_parsed_instruction_t* maybe_merge = + block.instructions[block.instructions.size() - 2].get(); + + switch (static_cast(maybe_merge->opcode)) { + case spv::Op::OpLoopMerge: + block.successors.merge_block_id = GetOperand(maybe_merge, 0); + block.successors.continue_block_id = GetOperand(maybe_merge, 1); + break; + + case spv::Op::OpSelectionMerge: + block.successors.merge_block_id = GetOperand(maybe_merge, 0); + break; + + default: + break; + } + } + + // Then look at the last instruction; it must be a branch + assert(block.instructions.size() >= 2); + + const spv_parsed_instruction_t* branch = block.instructions.back().get(); + switch (static_cast(branch->opcode)) { + case spv::Op::OpBranch: + if (block.successors.merge_block_id != 0) { + block.successors.body_block_id = GetOperand(branch, 0); + } else { + block.successors.next_block_id = GetOperand(branch, 0); + } + break; + + case spv::Op::OpBranchConditional: + block.successors.true_block_id = GetOperand(branch, 1); + block.successors.false_block_id = GetOperand(branch, 2); + break; + + case spv::Op::OpSwitch: + for (uint32_t case_index = 1; case_index < branch->num_operands; + case_index += 2) { + block.successors.case_block_ids.push_back( + GetOperand(branch, case_index)); + } + break; + + default: + break; + } + } + + return id_to_index; +} + +// Helper to deal with nesting and non-existing ids / previously-assigned +// levels. It assigns a given nesting level `level` to the block identified by +// `id` (unless that block already has a nesting level assigned). +void Nest(ControlFlowGraph& cfg, + const std::unordered_map& id_to_index, + uint32_t id, uint32_t level) { + if (id == 0) { + return; + } + + const uint32_t block_index = id_to_index.at(id); + SingleBlock& block = cfg.blocks[block_index]; + + if (!block.nest_level_assigned) { + block.nest_level = level; + block.nest_level_assigned = true; + } +} + +// For a given block, assign nesting level to its successors. +void NestSuccessors(ControlFlowGraph& cfg, const SingleBlock& block, + const std::unordered_map& id_to_index) { + assert(block.nest_level_assigned); + + // Nest loops as such: + // + // %loop = OpLabel + // OpLoopMerge %merge %cont ... + // OpBranch %body + // %body = OpLabel + // Op... + // %cont = OpLabel + // Op... + // %merge = OpLabel + // Op... + // + // Nest conditional branches as such: + // + // %header = OpLabel + // OpSelectionMerge %merge ... + // OpBranchConditional ... %true %false + // %true = OpLabel + // Op... + // %false = OpLabel + // Op... + // %merge = OpLabel + // Op... + // + // Nest switch/case as such: + // + // %header = OpLabel + // OpSelectionMerge %merge ... + // OpSwitch ... %default ... %case0 ... %case1 ... + // %default = OpLabel + // Op... + // %case0 = OpLabel + // Op... + // %case1 = OpLabel + // Op... + // ... + // %merge = OpLabel + // Op... + // + // The following can be observed: + // + // - In all cases, the merge block has the same nesting as this block + // - The continue block of loops is nested 1 level deeper + // - The body/branches/cases are nested 2 levels deeper + // + // Back branches to the header block, branches to the merge block, etc + // are correctly handled by processing the header block first (that is + // _this_ block, already processed), then following the above rules + // (in the same order) for any block that is not already processed. + Nest(cfg, id_to_index, block.successors.merge_block_id, block.nest_level); + Nest(cfg, id_to_index, block.successors.continue_block_id, + block.nest_level + 1); + Nest(cfg, id_to_index, block.successors.true_block_id, block.nest_level + 2); + Nest(cfg, id_to_index, block.successors.false_block_id, block.nest_level + 2); + Nest(cfg, id_to_index, block.successors.body_block_id, block.nest_level + 2); + Nest(cfg, id_to_index, block.successors.next_block_id, block.nest_level); + for (uint32_t case_block_id : block.successors.case_block_ids) { + Nest(cfg, id_to_index, case_block_id, block.nest_level + 2); + } +} + +struct StackEntry { + // The index of the block (in ControlFlowGraph::blocks) to process. + uint32_t block_index; + // Whether this is the pre or post visit of the block. Because a post-visit + // traversal is needed, the same block is pushed back on the stack on + // pre-visit so it can be visited again on post-visit. + bool post_visit = false; +}; + +// Helper to deal with DFS traversal and non-existing ids +void VisitSuccesor(std::stack* dfs_stack, + const std::unordered_map& id_to_index, + uint32_t id) { + if (id != 0) { + dfs_stack->push({id_to_index.at(id), false}); + } +} + +// Given the control flow graph, calculates and returns the reverse post-order +// ordering of the blocks. The blocks are then disassembled in that order for +// readability. +std::vector OrderBlocks( + ControlFlowGraph& cfg, + const std::unordered_map& id_to_index) { + std::vector post_order; + + // Nest level of a function's first block is 0. + cfg.blocks[0].nest_level = 0; + cfg.blocks[0].nest_level_assigned = true; + + // Stack of block indices as they are visited. + std::stack dfs_stack; + dfs_stack.push({0, false}); + + std::set visited; + + while (!dfs_stack.empty()) { + const uint32_t block_index = dfs_stack.top().block_index; + const bool post_visit = dfs_stack.top().post_visit; + dfs_stack.pop(); + + // If this is the second time the block is visited, that's the post-order + // visit. + if (post_visit) { + post_order.push_back(block_index); + continue; + } + + // If already visited, another path got to it first (like a case + // fallthrough), avoid reprocessing it. + if (visited.count(block_index) > 0) { + continue; + } + visited.insert(block_index); + + // Push it back in the stack for post-order visit + dfs_stack.push({block_index, true}); + + SingleBlock& block = cfg.blocks[block_index]; + + // Assign nest levels of successors right away. The successors are either + // nested under this block, or are back or forward edges to blocks outside + // this nesting level (no farther than the merge block), whose nesting + // levels are already assigned before this block is visited. + NestSuccessors(cfg, block, id_to_index); + block.reachable = true; + + // The post-order visit yields the order in which the blocks are naturally + // ordered _backwards_. So blocks to be ordered last should be visited + // first. In other words, they should be pushed to the DFS stack last. + VisitSuccesor(&dfs_stack, id_to_index, block.successors.true_block_id); + VisitSuccesor(&dfs_stack, id_to_index, block.successors.false_block_id); + VisitSuccesor(&dfs_stack, id_to_index, block.successors.body_block_id); + VisitSuccesor(&dfs_stack, id_to_index, block.successors.next_block_id); + for (uint32_t case_block_id : block.successors.case_block_ids) { + VisitSuccesor(&dfs_stack, id_to_index, case_block_id); + } + VisitSuccesor(&dfs_stack, id_to_index, block.successors.continue_block_id); + VisitSuccesor(&dfs_stack, id_to_index, block.successors.merge_block_id); + } + + std::vector order(post_order.rbegin(), post_order.rend()); + + // Finally, dump all unreachable blocks at the end + for (size_t index = 0; index < cfg.blocks.size(); ++index) { + SingleBlock& block = cfg.blocks[index]; + + if (!block.reachable) { + order.push_back(static_cast(index)); + block.nest_level = 0; + block.nest_level_assigned = true; + } + } + + return order; +} + +void Disassembler::EmitCFG() { + // Build the CFG edges. At the same time, build an ID->block index map to + // simplify building the CFG edges. + const std::unordered_map id_to_index = + BuildControlFlowGraph(current_function_cfg_); + + // Walk the CFG in reverse post-order to find the best ordering of blocks for + // presentation + std::vector block_order = + OrderBlocks(current_function_cfg_, id_to_index); + assert(block_order.size() == current_function_cfg_.blocks.size()); + + // Walk the CFG either in block order or input order based on whether the + // reorder_blocks_ option is given. + for (uint32_t index = 0; index < current_function_cfg_.blocks.size(); + ++index) { + const uint32_t block_index = reorder_blocks_ ? block_order[index] : index; + const SingleBlock& block = current_function_cfg_.blocks[block_index]; + + // Emit instructions for this block + size_t byte_offset = block.byte_offset; + assert(block.nest_level_assigned); + + for (const ParsedInstruction& inst : block.instructions) { + instruction_disassembler_.EmitInstructionInBlock(*inst.get(), byte_offset, + block.nest_level); + byte_offset += inst.get()->num_words * sizeof(uint32_t); + } + } + + current_function_cfg_.blocks.clear(); +} + spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const { if (!print_) { size_t length = text_.str().size(); @@ -194,7 +596,29 @@ spv_result_t DisassembleTargetInstruction( return SPV_SUCCESS; } +uint32_t GetLineLengthWithoutColor(const std::string line) { + // Currently, every added color is in the form \x1b...m, so instead of doing a + // lot of string comparisons with spvtools::clr::* strings, we just ignore + // those ranges. + uint32_t length = 0; + for (size_t i = 0; i < line.size(); ++i) { + if (line[i] == '\x1b') { + do { + ++i; + } while (i < line.size() && line[i] != 'm'); + continue; + } + + ++length; + } + + return length; +} + constexpr int kStandardIndent = 15; +constexpr int kBlockNestIndent = 2; +constexpr int kBlockBodyIndentOffset = 2; +constexpr uint32_t kCommentColumn = 50; } // namespace namespace disassemble { @@ -209,10 +633,13 @@ InstructionDisassembler::InstructionDisassembler(const AssemblyGrammar& grammar, indent_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_INDENT, options) ? kStandardIndent : 0), + nested_indent_( + spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT, options)), comment_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COMMENT, options)), show_byte_offset_( spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET, options)), - name_mapper_(std::move(name_mapper)) {} + name_mapper_(std::move(name_mapper)), + last_instruction_comment_alignment_(0) {} void InstructionDisassembler::EmitHeaderSpirv() { stream_ << "; SPIR-V\n"; } @@ -244,55 +671,160 @@ void InstructionDisassembler::EmitHeaderSchema(uint32_t schema) { void InstructionDisassembler::EmitInstruction( const spv_parsed_instruction_t& inst, size_t inst_byte_offset) { + EmitInstructionImpl(inst, inst_byte_offset, 0, false); +} + +void InstructionDisassembler::EmitInstructionInBlock( + const spv_parsed_instruction_t& inst, size_t inst_byte_offset, + uint32_t block_indent) { + EmitInstructionImpl(inst, inst_byte_offset, block_indent, true); +} + +void InstructionDisassembler::EmitInstructionImpl( + const spv_parsed_instruction_t& inst, size_t inst_byte_offset, + uint32_t block_indent, bool is_in_block) { auto opcode = static_cast(inst.opcode); + // To better align the comments (if any), write the instruction to a line + // first so its length can be readily available. + std::ostringstream line; + + if (nested_indent_ && opcode == spv::Op::OpLabel) { + // Separate the blocks by an empty line to make them easier to separate + stream_ << std::endl; + } + if (inst.result_id) { SetBlue(); const std::string id_name = name_mapper_(inst.result_id); if (indent_) - stream_ << std::setw(std::max(0, indent_ - 3 - int(id_name.size()))); - stream_ << "%" << id_name; + line << std::setw(std::max(0, indent_ - 3 - int(id_name.size()))); + line << "%" << id_name; ResetColor(); - stream_ << " = "; + line << " = "; } else { - stream_ << std::string(indent_, ' '); + line << std::string(indent_, ' '); + } + + if (nested_indent_ && is_in_block) { + // Output OpLabel at the specified nest level, and instructions inside + // blocks nested a little more. + uint32_t indent = block_indent; + bool body_indent = opcode != spv::Op::OpLabel; + + line << std::string( + indent * kBlockNestIndent + (body_indent ? kBlockBodyIndentOffset : 0), + ' '); } - stream_ << "Op" << spvOpcodeString(opcode); + line << "Op" << spvOpcodeString(opcode); for (uint16_t i = 0; i < inst.num_operands; i++) { const spv_operand_type_t type = inst.operands[i].type; assert(type != SPV_OPERAND_TYPE_NONE); if (type == SPV_OPERAND_TYPE_RESULT_ID) continue; - stream_ << " "; - EmitOperand(inst, i); + line << " "; + EmitOperand(line, inst, i); + } + + // For the sake of comment generation, store information from some + // instructions for the future. + if (comment_) { + GenerateCommentForDecoratedId(inst); + } + + std::ostringstream comments; + const char* comment_separator = ""; + + if (show_byte_offset_) { + SetGrey(comments); + auto saved_flags = comments.flags(); + auto saved_fill = comments.fill(); + comments << comment_separator << "0x" << std::setw(8) << std::hex + << std::setfill('0') << inst_byte_offset; + comments.flags(saved_flags); + comments.fill(saved_fill); + ResetColor(comments); + comment_separator = ", "; } if (comment_ && opcode == spv::Op::OpName) { const spv_parsed_operand_t& operand = inst.operands[0]; const uint32_t word = inst.words[operand.offset]; - stream_ << " ; id %" << word; + comments << comment_separator << "id %" << word; + comment_separator = ", "; } - if (show_byte_offset_) { - SetGrey(); - auto saved_flags = stream_.flags(); - auto saved_fill = stream_.fill(); - stream_ << " ; 0x" << std::setw(8) << std::hex << std::setfill('0') - << inst_byte_offset; - stream_.flags(saved_flags); - stream_.fill(saved_fill); - ResetColor(); + if (comment_ && inst.result_id && id_comments_.count(inst.result_id) > 0) { + comments << comment_separator << id_comments_[inst.result_id].str(); + comment_separator = ", "; + } + + stream_ << line.str(); + + if (!comments.str().empty()) { + // Align the comments + const uint32_t line_length = GetLineLengthWithoutColor(line.str()); + uint32_t align = std::max( + {line_length + 2, last_instruction_comment_alignment_, kCommentColumn}); + // Round up the alignment to a multiple of 4 for more niceness. + align = (align + 3) & ~0x3u; + last_instruction_comment_alignment_ = align; + + stream_ << std::string(align - line_length, ' ') << "; " << comments.str(); + } else { + last_instruction_comment_alignment_ = 0; } + stream_ << "\n"; } +void InstructionDisassembler::GenerateCommentForDecoratedId( + const spv_parsed_instruction_t& inst) { + assert(comment_); + auto opcode = static_cast(inst.opcode); + + std::ostringstream partial; + uint32_t id = 0; + const char* separator = ""; + + switch (opcode) { + case spv::Op::OpDecorate: + // Take everything after `OpDecorate %id` and associate it with id. + id = inst.words[inst.operands[0].offset]; + for (uint16_t i = 1; i < inst.num_operands; i++) { + partial << separator; + separator = " "; + EmitOperand(partial, inst, i); + } + break; + default: + break; + } + + if (id == 0) { + return; + } + + // Add the new comment to the comments of this id + std::ostringstream& id_comment = id_comments_[id]; + if (!id_comment.str().empty()) { + id_comment << ", "; + } + id_comment << partial.str(); +} + void InstructionDisassembler::EmitSectionComment( const spv_parsed_instruction_t& inst, bool& inserted_decoration_space, bool& inserted_debug_space, bool& inserted_type_space) { auto opcode = static_cast(inst.opcode); if (comment_ && opcode == spv::Op::OpFunction) { stream_ << std::endl; + if (nested_indent_) { + // Double the empty lines between Function sections since nested_indent_ + // also separates blocks by a blank. + stream_ << std::endl; + } stream_ << std::string(indent_, ' '); stream_ << "; Function " << name_mapper_(inst.result_id) << std::endl; } @@ -316,36 +848,37 @@ void InstructionDisassembler::EmitSectionComment( } } -void InstructionDisassembler::EmitOperand(const spv_parsed_instruction_t& inst, - const uint16_t operand_index) { +void InstructionDisassembler::EmitOperand(std::ostream& stream, + const spv_parsed_instruction_t& inst, + const uint16_t operand_index) const { assert(operand_index < inst.num_operands); const spv_parsed_operand_t& operand = inst.operands[operand_index]; const uint32_t word = inst.words[operand.offset]; switch (operand.type) { case SPV_OPERAND_TYPE_RESULT_ID: assert(false && " is not supposed to be handled here"); - SetBlue(); - stream_ << "%" << name_mapper_(word); + SetBlue(stream); + stream << "%" << name_mapper_(word); break; case SPV_OPERAND_TYPE_ID: case SPV_OPERAND_TYPE_TYPE_ID: case SPV_OPERAND_TYPE_SCOPE_ID: case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID: - SetYellow(); - stream_ << "%" << name_mapper_(word); + SetYellow(stream); + stream << "%" << name_mapper_(word); break; case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { spv_ext_inst_desc ext_inst; - SetRed(); + SetRed(stream); if (grammar_.lookupExtInst(inst.ext_inst_type, word, &ext_inst) == SPV_SUCCESS) { - stream_ << ext_inst->name; + stream << ext_inst->name; } else { if (!spvExtInstIsNonSemantic(inst.ext_inst_type)) { assert(false && "should have caught this earlier"); } else { // for non-semantic instruction sets we can just print the number - stream_ << word; + stream << word; } } } break; @@ -353,27 +886,27 @@ void InstructionDisassembler::EmitOperand(const spv_parsed_instruction_t& inst, spv_opcode_desc opcode_desc; if (grammar_.lookupOpcode(spv::Op(word), &opcode_desc)) assert(false && "should have caught this earlier"); - SetRed(); - stream_ << opcode_desc->name; + SetRed(stream); + stream << opcode_desc->name; } break; case SPV_OPERAND_TYPE_LITERAL_INTEGER: case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: case SPV_OPERAND_TYPE_LITERAL_FLOAT: { - SetRed(); - EmitNumericLiteral(&stream_, inst, operand); - ResetColor(); + SetRed(stream); + EmitNumericLiteral(&stream, inst, operand); + ResetColor(stream); } break; case SPV_OPERAND_TYPE_LITERAL_STRING: { - stream_ << "\""; - SetGreen(); + stream << "\""; + SetGreen(stream); std::string str = spvDecodeLiteralStringOperand(inst, operand_index); for (char const& c : str) { - if (c == '"' || c == '\\') stream_ << '\\'; - stream_ << c; + if (c == '"' || c == '\\') stream << '\\'; + stream << c; } - ResetColor(); - stream_ << '"'; + ResetColor(stream); + stream << '"'; } break; case SPV_OPERAND_TYPE_CAPABILITY: case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: @@ -411,11 +944,12 @@ void InstructionDisassembler::EmitOperand(const spv_parsed_instruction_t& inst, case SPV_OPERAND_TYPE_FPDENORM_MODE: case SPV_OPERAND_TYPE_FPOPERATION_MODE: case SPV_OPERAND_TYPE_QUANTIZATION_MODES: + case SPV_OPERAND_TYPE_FPENCODING: case SPV_OPERAND_TYPE_OVERFLOW_MODES: { spv_operand_desc entry; if (grammar_.lookupOperand(operand.type, word, &entry)) assert(false && "should have caught this earlier"); - stream_ << entry->name; + stream << entry->name; } break; case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: case SPV_OPERAND_TYPE_FUNCTION_CONTROL: @@ -425,26 +959,28 @@ void InstructionDisassembler::EmitOperand(const spv_parsed_instruction_t& inst, case SPV_OPERAND_TYPE_SELECTION_CONTROL: case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS: - EmitMaskOperand(operand.type, word); + case SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS: + EmitMaskOperand(stream, operand.type, word); break; default: if (spvOperandIsConcreteMask(operand.type)) { - EmitMaskOperand(operand.type, word); + EmitMaskOperand(stream, operand.type, word); } else if (spvOperandIsConcrete(operand.type)) { spv_operand_desc entry; if (grammar_.lookupOperand(operand.type, word, &entry)) assert(false && "should have caught this earlier"); - stream_ << entry->name; + stream << entry->name; } else { assert(false && "unhandled or invalid case"); } break; } - ResetColor(); + ResetColor(stream); } -void InstructionDisassembler::EmitMaskOperand(const spv_operand_type_t type, - const uint32_t word) { +void InstructionDisassembler::EmitMaskOperand(std::ostream& stream, + const spv_operand_type_t type, + const uint32_t word) const { // Scan the mask from least significant bit to most significant bit. For each // set bit, emit the name of that bit. Separate multiple names with '|'. uint32_t remaining_word = word; @@ -456,8 +992,8 @@ void InstructionDisassembler::EmitMaskOperand(const spv_operand_type_t type, spv_operand_desc entry; if (grammar_.lookupOperand(type, mask, &entry)) assert(false && "should have caught this earlier"); - if (num_emitted) stream_ << "|"; - stream_ << entry->name; + if (num_emitted) stream << "|"; + stream << entry->name; num_emitted++; } } @@ -466,28 +1002,35 @@ void InstructionDisassembler::EmitMaskOperand(const spv_operand_type_t type, // of the 0 value. In many cases, that's "None". spv_operand_desc entry; if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry)) - stream_ << entry->name; + stream << entry->name; } } -void InstructionDisassembler::ResetColor() { - if (color_) stream_ << spvtools::clr::reset{print_}; +void InstructionDisassembler::ResetColor(std::ostream& stream) const { + if (color_) stream << spvtools::clr::reset{print_}; } -void InstructionDisassembler::SetGrey() { - if (color_) stream_ << spvtools::clr::grey{print_}; +void InstructionDisassembler::SetGrey(std::ostream& stream) const { + if (color_) stream << spvtools::clr::grey{print_}; } -void InstructionDisassembler::SetBlue() { - if (color_) stream_ << spvtools::clr::blue{print_}; +void InstructionDisassembler::SetBlue(std::ostream& stream) const { + if (color_) stream << spvtools::clr::blue{print_}; } -void InstructionDisassembler::SetYellow() { - if (color_) stream_ << spvtools::clr::yellow{print_}; +void InstructionDisassembler::SetYellow(std::ostream& stream) const { + if (color_) stream << spvtools::clr::yellow{print_}; } -void InstructionDisassembler::SetRed() { - if (color_) stream_ << spvtools::clr::red{print_}; +void InstructionDisassembler::SetRed(std::ostream& stream) const { + if (color_) stream << spvtools::clr::red{print_}; } -void InstructionDisassembler::SetGreen() { - if (color_) stream_ << spvtools::clr::green{print_}; +void InstructionDisassembler::SetGreen(std::ostream& stream) const { + if (color_) stream << spvtools::clr::green{print_}; } + +void InstructionDisassembler::ResetColor() { ResetColor(stream_); } +void InstructionDisassembler::SetGrey() { SetGrey(stream_); } +void InstructionDisassembler::SetBlue() { SetBlue(stream_); } +void InstructionDisassembler::SetYellow() { SetYellow(stream_); } +void InstructionDisassembler::SetRed() { SetRed(stream_); } +void InstructionDisassembler::SetGreen() { SetGreen(stream_); } } // namespace disassemble std::string spvInstructionBinaryToText(const spv_target_env env, diff --git a/bgfx/3rdparty/spirv-tools/source/disassemble.h b/bgfx/3rdparty/spirv-tools/source/disassemble.h index b520a1ea..9baeaa43 100644 --- a/bgfx/3rdparty/spirv-tools/source/disassemble.h +++ b/bgfx/3rdparty/spirv-tools/source/disassemble.h @@ -16,6 +16,7 @@ #define SOURCE_DISASSEMBLE_H_ #include +#include #include #include "source/name_mapper.h" @@ -57,6 +58,11 @@ class InstructionDisassembler { // Emits the assembly text for the given instruction. void EmitInstruction(const spv_parsed_instruction_t& inst, size_t inst_byte_offset); + // Same as EmitInstruction, but only for block instructions (including + // OpLabel) and useful for nested indentation. If nested indentation is not + // desired, EmitInstruction can still be used for block instructions. + void EmitInstructionInBlock(const spv_parsed_instruction_t& inst, + size_t inst_byte_offset, uint32_t block_indent); // Emits a comment between different sections of the module. void EmitSectionComment(const spv_parsed_instruction_t& inst, @@ -74,22 +80,46 @@ class InstructionDisassembler { void SetGreen(); private: + void ResetColor(std::ostream& stream) const; + void SetGrey(std::ostream& stream) const; + void SetBlue(std::ostream& stream) const; + void SetYellow(std::ostream& stream) const; + void SetRed(std::ostream& stream) const; + void SetGreen(std::ostream& stream) const; + + void EmitInstructionImpl(const spv_parsed_instruction_t& inst, + size_t inst_byte_offset, uint32_t block_indent, + bool is_in_block); + // Emits an operand for the given instruction, where the instruction // is at offset words from the start of the binary. - void EmitOperand(const spv_parsed_instruction_t& inst, - const uint16_t operand_index); + void EmitOperand(std::ostream& stream, const spv_parsed_instruction_t& inst, + const uint16_t operand_index) const; // Emits a mask expression for the given mask word of the specified type. - void EmitMaskOperand(const spv_operand_type_t type, const uint32_t word); + void EmitMaskOperand(std::ostream& stream, const spv_operand_type_t type, + const uint32_t word) const; + + // Generate part of the instruction as a comment to be added to + // |id_comments_|. + void GenerateCommentForDecoratedId(const spv_parsed_instruction_t& inst); const spvtools::AssemblyGrammar& grammar_; std::ostream& stream_; - const bool print_; // Should we also print to the standard output stream? - const bool color_; // Should we print in colour? - const int indent_; // How much to indent. 0 means don't indent - const int comment_; // Should we comment the source + const bool print_; // Should we also print to the standard output stream? + const bool color_; // Should we print in colour? + const int indent_; // How much to indent. 0 means don't indent + const bool nested_indent_; // Whether indentation should indicate nesting + const int comment_; // Should we comment the source const bool show_byte_offset_; // Should we print byte offset, in hex? spvtools::NameMapper name_mapper_; + + // Some comments are generated as instructions (such as OpDecorate) are + // visited so that when the instruction with that result id is visited, the + // comment can be output. + std::unordered_map id_comments_; + // Align the comments in consecutive lines for more readability. + uint32_t last_instruction_comment_alignment_; }; } // namespace disassemble diff --git a/bgfx/3rdparty/spirv-tools/source/ext_inst.cpp b/bgfx/3rdparty/spirv-tools/source/ext_inst.cpp index 4e279545..9a5ba84e 100644 --- a/bgfx/3rdparty/spirv-tools/source/ext_inst.cpp +++ b/bgfx/3rdparty/spirv-tools/source/ext_inst.cpp @@ -30,6 +30,7 @@ #include "glsl.std.450.insts.inc" #include "nonsemantic.clspvreflection.insts.inc" #include "nonsemantic.shader.debuginfo.100.insts.inc" +#include "nonsemantic.vkspreflection.insts.inc" #include "opencl.debuginfo.100.insts.inc" #include "opencl.std.insts.inc" @@ -62,6 +63,9 @@ static const spv_ext_inst_group_t kGroups_1_0[] = { {SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION, ARRAY_SIZE(nonsemantic_clspvreflection_entries), nonsemantic_clspvreflection_entries}, + {SPV_EXT_INST_TYPE_NONSEMANTIC_VKSPREFLECTION, + ARRAY_SIZE(nonsemantic_vkspreflection_entries), + nonsemantic_vkspreflection_entries}, }; static const spv_ext_inst_table_t kTable_1_0 = {ARRAY_SIZE(kGroups_1_0), @@ -138,6 +142,9 @@ spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) { if (!strncmp("NonSemantic.ClspvReflection.", name, 28)) { return SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION; } + if (!strncmp("NonSemantic.VkspReflection.", name, 27)) { + return SPV_EXT_INST_TYPE_NONSEMANTIC_VKSPREFLECTION; + } // ensure to add any known non-semantic extended instruction sets // above this point, and update spvExtInstIsNonSemantic() if (!strncmp("NonSemantic.", name, 12)) { @@ -149,7 +156,8 @@ spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) { bool spvExtInstIsNonSemantic(const spv_ext_inst_type_t type) { if (type == SPV_EXT_INST_TYPE_NONSEMANTIC_UNKNOWN || type == SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100 || - type == SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION) { + type == SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION || + type == SPV_EXT_INST_TYPE_NONSEMANTIC_VKSPREFLECTION) { return true; } return false; diff --git a/bgfx/3rdparty/spirv-tools/source/link/linker.cpp b/bgfx/3rdparty/spirv-tools/source/link/linker.cpp index 58930e45..e6aa72e3 100644 --- a/bgfx/3rdparty/spirv-tools/source/link/linker.cpp +++ b/bgfx/3rdparty/spirv-tools/source/link/linker.cpp @@ -31,6 +31,7 @@ #include "source/opt/build_module.h" #include "source/opt/compact_ids_pass.h" #include "source/opt/decoration_manager.h" +#include "source/opt/ir_builder.h" #include "source/opt/ir_loader.h" #include "source/opt/pass_manager.h" #include "source/opt/remove_duplicates_pass.h" @@ -46,12 +47,14 @@ namespace spvtools { namespace { using opt::Instruction; +using opt::InstructionBuilder; using opt::IRContext; using opt::Module; using opt::PassManager; using opt::RemoveDuplicatesPass; using opt::analysis::DecorationManager; using opt::analysis::DefUseManager; +using opt::analysis::Function; using opt::analysis::Type; using opt::analysis::TypeManager; @@ -126,6 +129,7 @@ spv_result_t GetImportExportPairs(const MessageConsumer& consumer, // checked. spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer, const LinkageTable& linkings_to_do, + bool allow_ptr_type_mismatch, opt::IRContext* context); // Remove linkage specific instructions, such as prototypes of imported @@ -502,6 +506,7 @@ spv_result_t GetImportExportPairs(const MessageConsumer& consumer, spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer, const LinkageTable& linkings_to_do, + bool allow_ptr_type_mismatch, opt::IRContext* context) { spv_position_t position = {}; @@ -513,7 +518,34 @@ spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer, type_manager.GetType(linking_entry.imported_symbol.type_id); Type* exported_symbol_type = type_manager.GetType(linking_entry.exported_symbol.type_id); - if (!(*imported_symbol_type == *exported_symbol_type)) + if (!(*imported_symbol_type == *exported_symbol_type)) { + Function* imported_symbol_type_func = imported_symbol_type->AsFunction(); + Function* exported_symbol_type_func = exported_symbol_type->AsFunction(); + + if (imported_symbol_type_func && exported_symbol_type_func) { + const auto& imported_params = imported_symbol_type_func->param_types(); + const auto& exported_params = exported_symbol_type_func->param_types(); + // allow_ptr_type_mismatch allows linking functions where the pointer + // type of arguments doesn't match. Everything else still needs to be + // equal. This is to workaround LLVM-17+ not having typed pointers and + // generated SPIR-Vs not knowing the actual pointer types in some cases. + if (allow_ptr_type_mismatch && + imported_params.size() == exported_params.size()) { + bool correct = true; + for (size_t i = 0; i < imported_params.size(); i++) { + const auto& imported_param = imported_params[i]; + const auto& exported_param = exported_params[i]; + + if (!imported_param->IsSame(exported_param) && + (imported_param->kind() != Type::kPointer || + exported_param->kind() != Type::kPointer)) { + correct = false; + break; + } + } + if (correct) continue; + } + } return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_BINARY) << "Type mismatch on symbol \"" << linking_entry.imported_symbol.name @@ -521,6 +553,7 @@ spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer, << linking_entry.imported_symbol.id << " and exported variable/function %" << linking_entry.exported_symbol.id << "."; + } } // Ensure the import and export decorations are similar @@ -696,6 +729,57 @@ spv_result_t VerifyLimits(const MessageConsumer& consumer, return SPV_SUCCESS; } +spv_result_t FixFunctionCallTypes(opt::IRContext& context, + const LinkageTable& linkings) { + auto mod = context.module(); + const auto type_manager = context.get_type_mgr(); + const auto def_use_mgr = context.get_def_use_mgr(); + + for (auto& func : *mod) { + func.ForEachInst([&](Instruction* inst) { + if (inst->opcode() != spv::Op::OpFunctionCall) return; + opt::Operand& target = inst->GetInOperand(0); + + // only fix calls to imported functions + auto linking = std::find_if( + linkings.begin(), linkings.end(), [&](const auto& entry) { + return entry.exported_symbol.id == target.AsId(); + }); + if (linking == linkings.end()) return; + + auto builder = InstructionBuilder(&context, inst); + for (uint32_t i = 1; i < inst->NumInOperands(); ++i) { + auto exported_func_param = + def_use_mgr->GetDef(linking->exported_symbol.parameter_ids[i - 1]); + const Type* target_type = + type_manager->GetType(exported_func_param->type_id()); + if (target_type->kind() != Type::kPointer) continue; + + opt::Operand& arg = inst->GetInOperand(i); + const Type* param_type = + type_manager->GetType(def_use_mgr->GetDef(arg.AsId())->type_id()); + + // No need to cast if it already matches + if (*param_type == *target_type) continue; + + auto new_id = context.TakeNextId(); + + // cast to the expected pointer type + builder.AddInstruction(MakeUnique( + &context, spv::Op::OpBitcast, exported_func_param->type_id(), + new_id, + opt::Instruction::OperandList( + {{SPV_OPERAND_TYPE_ID, {arg.AsId()}}}))); + + inst->SetInOperand(i, {new_id}); + } + }); + } + context.InvalidateAnalyses(opt::IRContext::kAnalysisDefUse | + opt::IRContext::kAnalysisInstrToBlockMapping); + return SPV_SUCCESS; +} + } // namespace spv_result_t Link(const Context& context, @@ -773,7 +857,14 @@ spv_result_t Link(const Context& context, const uint32_t* const* binaries, if (res != SPV_SUCCESS) return res; } - // Phase 4: Find the import/export pairs + // Phase 4: Remove duplicates + PassManager manager; + manager.SetMessageConsumer(consumer); + manager.AddPass(); + opt::Pass::Status pass_res = manager.Run(&linked_context); + if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA; + + // Phase 5: Find the import/export pairs LinkageTable linkings_to_do; res = GetImportExportPairs(consumer, linked_context, *linked_context.get_def_use_mgr(), @@ -781,18 +872,12 @@ spv_result_t Link(const Context& context, const uint32_t* const* binaries, options.GetAllowPartialLinkage(), &linkings_to_do); if (res != SPV_SUCCESS) return res; - // Phase 5: Ensure the import and export have the same types and decorations. - res = - CheckImportExportCompatibility(consumer, linkings_to_do, &linked_context); + // Phase 6: Ensure the import and export have the same types and decorations. + res = CheckImportExportCompatibility(consumer, linkings_to_do, + options.GetAllowPtrTypeMismatch(), + &linked_context); if (res != SPV_SUCCESS) return res; - // Phase 6: Remove duplicates - PassManager manager; - manager.SetMessageConsumer(consumer); - manager.AddPass(); - opt::Pass::Status pass_res = manager.Run(&linked_context); - if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA; - // Phase 7: Remove all names and decorations of import variables/functions for (const auto& linking_entry : linkings_to_do) { linked_context.KillNamesAndDecorates(linking_entry.imported_symbol.id); @@ -815,21 +900,27 @@ spv_result_t Link(const Context& context, const uint32_t* const* binaries, &linked_context); if (res != SPV_SUCCESS) return res; - // Phase 10: Compact the IDs used in the module + // Phase 10: Optionally fix function call types + if (options.GetAllowPtrTypeMismatch()) { + res = FixFunctionCallTypes(linked_context, linkings_to_do); + if (res != SPV_SUCCESS) return res; + } + + // Phase 11: Compact the IDs used in the module manager.AddPass(); pass_res = manager.Run(&linked_context); if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA; - // Phase 11: Recompute EntryPoint variables + // Phase 12: Recompute EntryPoint variables manager.AddPass(); pass_res = manager.Run(&linked_context); if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA; - // Phase 12: Warn if SPIR-V limits were exceeded + // Phase 13: Warn if SPIR-V limits were exceeded res = VerifyLimits(consumer, linked_context); if (res != SPV_SUCCESS) return res; - // Phase 13: Output the module + // Phase 14: Output the module linked_context.module()->ToBinary(linked_binary, true); return SPV_SUCCESS; diff --git a/bgfx/3rdparty/spirv-tools/source/name_mapper.cpp b/bgfx/3rdparty/spirv-tools/source/name_mapper.cpp index b2d0f445..7e5f0917 100644 --- a/bgfx/3rdparty/spirv-tools/source/name_mapper.cpp +++ b/bgfx/3rdparty/spirv-tools/source/name_mapper.cpp @@ -25,24 +25,15 @@ #include "source/binary.h" #include "source/latest_version_spirv_header.h" #include "source/parsed_operand.h" +#include "source/to_string.h" #include "spirv-tools/libspirv.h" namespace spvtools { -namespace { -// Converts a uint32_t to its string decimal representation. -std::string to_string(uint32_t id) { - // Use stringstream, since some versions of Android compilers lack - // std::to_string. - std::stringstream os; - os << id; - return os.str(); +NameMapper GetTrivialNameMapper() { + return [](uint32_t i) { return spvtools::to_string(i); }; } -} // anonymous namespace - -NameMapper GetTrivialNameMapper() { return to_string; } - FriendlyNameMapper::FriendlyNameMapper(const spv_const_context context, const uint32_t* code, const size_t wordCount) @@ -218,6 +209,7 @@ spv_result_t FriendlyNameMapper::ParseInstruction( } break; case spv::Op::OpTypeFloat: { const auto bit_width = inst.words[2]; + // TODO: Handle optional fpencoding enum once actually used. switch (bit_width) { case 16: SaveName(result_id, "half"); @@ -255,6 +247,11 @@ spv_result_t FriendlyNameMapper::ParseInstruction( inst.words[2]) + "_" + NameForId(inst.words[3])); break; + case spv::Op::OpTypeUntypedPointerKHR: + SaveName(result_id, std::string("_ptr_") + + NameForEnumOperand(SPV_OPERAND_TYPE_STORAGE_CLASS, + inst.words[2])); + break; case spv::Op::OpTypePipe: SaveName(result_id, std::string("Pipe") + diff --git a/bgfx/3rdparty/spirv-tools/source/opcode.cpp b/bgfx/3rdparty/spirv-tools/source/opcode.cpp index ffbb2e8b..ea03bd67 100644 --- a/bgfx/3rdparty/spirv-tools/source/opcode.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opcode.cpp @@ -102,7 +102,7 @@ spv_result_t spvOpcodeTableNameLookup(spv_target_env env, const auto version = spvVersionForTargetEnv(env); for (uint64_t opcodeIndex = 0; opcodeIndex < table->count; ++opcodeIndex) { const spv_opcode_desc_t& entry = table->entries[opcodeIndex]; - // We considers the current opcode as available as long as + // We consider the current opcode as available as long as // 1. The target environment satisfies the minimal requirement of the // opcode; or // 2. There is at least one extension enabling this opcode. @@ -110,13 +110,34 @@ spv_result_t spvOpcodeTableNameLookup(spv_target_env env, // Note that the second rule assumes the extension enabling this instruction // is indeed requested in the SPIR-V code; checking that should be // validator's work. - if (((version >= entry.minVersion && version <= entry.lastVersion) || - entry.numExtensions > 0u || entry.numCapabilities > 0u) && - nameLength == strlen(entry.name) && - !strncmp(name, entry.name, nameLength)) { - // NOTE: Found out Opcode! - *pEntry = &entry; - return SPV_SUCCESS; + if ((version >= entry.minVersion && version <= entry.lastVersion) || + entry.numExtensions > 0u || entry.numCapabilities > 0u) { + // Exact match case. + if (nameLength == strlen(entry.name) && + !strncmp(name, entry.name, nameLength)) { + *pEntry = &entry; + return SPV_SUCCESS; + } + // Lack of binary search really hurts here. There isn't an easy filter to + // apply before checking aliases since we need to handle promotion from + // vendor to KHR/EXT and KHR/EXT to core. It would require a sure-fire way + // of dropping suffices. Fortunately, most lookup are based on token + // value. + // + // If this was a binary search we could iterate between the lower and + // upper bounds. + if (entry.numAliases > 0) { + for (uint32_t aliasIndex = 0; aliasIndex < entry.numAliases; + aliasIndex++) { + // Skip Op prefix. Should this be encoded in the table instead? + const auto alias = entry.aliases[aliasIndex] + 2; + const size_t aliasLength = strlen(alias); + if (nameLength == aliasLength && !strncmp(name, alias, nameLength)) { + *pEntry = &entry; + return SPV_SUCCESS; + } + } + } } } @@ -133,8 +154,8 @@ spv_result_t spvOpcodeTableValueLookup(spv_target_env env, const auto beg = table->entries; const auto end = table->entries + table->count; - spv_opcode_desc_t needle = {"", opcode, 0, nullptr, 0, {}, - false, false, 0, nullptr, ~0u, ~0u}; + spv_opcode_desc_t needle = {"", opcode, 0, nullptr, 0, {}, 0, + {}, false, false, 0, nullptr, ~0u, ~0u}; auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) { return lhs.opcode < rhs.opcode; @@ -189,6 +210,7 @@ const char* spvOpcodeString(const uint32_t opcode) { spv_opcode_desc_t needle = {"", static_cast(opcode), 0, nullptr, 0, {}, + 0, {}, false, false, 0, nullptr, ~0u, ~0u}; @@ -225,6 +247,7 @@ int32_t spvOpcodeIsSpecConstant(const spv::Op opcode) { case spv::Op::OpSpecConstantFalse: case spv::Op::OpSpecConstant: case spv::Op::OpSpecConstantComposite: + case spv::Op::OpSpecConstantCompositeReplicateEXT: case spv::Op::OpSpecConstantOp: return true; default: @@ -238,6 +261,7 @@ int32_t spvOpcodeIsConstant(const spv::Op opcode) { case spv::Op::OpConstantFalse: case spv::Op::OpConstant: case spv::Op::OpConstantComposite: + case spv::Op::OpConstantCompositeReplicateEXT: case spv::Op::OpConstantSampler: case spv::Op::OpConstantNull: case spv::Op::OpConstantFunctionPointerINTEL: @@ -245,6 +269,7 @@ int32_t spvOpcodeIsConstant(const spv::Op opcode) { case spv::Op::OpSpecConstantFalse: case spv::Op::OpSpecConstant: case spv::Op::OpSpecConstantComposite: + case spv::Op::OpSpecConstantCompositeReplicateEXT: case spv::Op::OpSpecConstantOp: return true; default: @@ -273,6 +298,7 @@ int32_t spvOpcodeIsComposite(const spv::Op opcode) { case spv::Op::OpTypeMatrix: case spv::Op::OpTypeArray: case spv::Op::OpTypeStruct: + case spv::Op::OpTypeRuntimeArray: case spv::Op::OpTypeCooperativeMatrixNV: case spv::Op::OpTypeCooperativeMatrixKHR: return true; @@ -284,8 +310,11 @@ int32_t spvOpcodeIsComposite(const spv::Op opcode) { bool spvOpcodeReturnsLogicalVariablePointer(const spv::Op opcode) { switch (opcode) { case spv::Op::OpVariable: + case spv::Op::OpUntypedVariableKHR: case spv::Op::OpAccessChain: case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpUntypedAccessChainKHR: + case spv::Op::OpUntypedInBoundsAccessChainKHR: case spv::Op::OpFunctionParameter: case spv::Op::OpImageTexelPointer: case spv::Op::OpCopyObject: @@ -293,8 +322,10 @@ bool spvOpcodeReturnsLogicalVariablePointer(const spv::Op opcode) { case spv::Op::OpPhi: case spv::Op::OpFunctionCall: case spv::Op::OpPtrAccessChain: + case spv::Op::OpUntypedPtrAccessChainKHR: case spv::Op::OpLoad: case spv::Op::OpConstantNull: + case spv::Op::OpRawAccessChainNV: return true; default: return false; @@ -304,11 +335,15 @@ bool spvOpcodeReturnsLogicalVariablePointer(const spv::Op opcode) { int32_t spvOpcodeReturnsLogicalPointer(const spv::Op opcode) { switch (opcode) { case spv::Op::OpVariable: + case spv::Op::OpUntypedVariableKHR: case spv::Op::OpAccessChain: case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpUntypedAccessChainKHR: + case spv::Op::OpUntypedInBoundsAccessChainKHR: case spv::Op::OpFunctionParameter: case spv::Op::OpImageTexelPointer: case spv::Op::OpCopyObject: + case spv::Op::OpRawAccessChainNV: return true; default: return false; @@ -346,6 +381,7 @@ int32_t spvOpcodeGeneratesType(spv::Op op) { // spv::Op::OpTypeAccelerationStructureNV case spv::Op::OpTypeRayQueryKHR: case spv::Op::OpTypeHitObjectNV: + case spv::Op::OpTypeUntypedPointerKHR: return true; default: // In particular, OpTypeForwardPointer does not generate a type, @@ -534,6 +570,8 @@ bool spvOpcodeIsNonUniformGroupOperation(spv::Op opcode) { case spv::Op::OpGroupNonUniformQuadBroadcast: case spv::Op::OpGroupNonUniformQuadSwap: case spv::Op::OpGroupNonUniformRotateKHR: + case spv::Op::OpGroupNonUniformQuadAllKHR: + case spv::Op::OpGroupNonUniformQuadAnyKHR: return true; default: return false; @@ -713,6 +751,16 @@ bool spvOpcodeIsImageSample(const spv::Op opcode) { } } +bool spvIsExtendedInstruction(const spv::Op opcode) { + switch (opcode) { + case spv::Op::OpExtInst: + case spv::Op::OpExtInstWithForwardRefsKHR: + return true; + default: + return false; + } +} + std::vector spvOpcodeMemorySemanticsOperandIndices(spv::Op opcode) { switch (opcode) { case spv::Op::OpMemoryBarrier: @@ -752,6 +800,7 @@ bool spvOpcodeIsAccessChain(spv::Op opcode) { case spv::Op::OpInBoundsAccessChain: case spv::Op::OpPtrAccessChain: case spv::Op::OpInBoundsPtrAccessChain: + case spv::Op::OpRawAccessChainNV: return true; default: return false; @@ -774,3 +823,16 @@ bool spvOpcodeIsBit(spv::Op opcode) { return false; } } + +bool spvOpcodeGeneratesUntypedPointer(spv::Op opcode) { + switch (opcode) { + case spv::Op::OpUntypedVariableKHR: + case spv::Op::OpUntypedAccessChainKHR: + case spv::Op::OpUntypedInBoundsAccessChainKHR: + case spv::Op::OpUntypedPtrAccessChainKHR: + case spv::Op::OpUntypedInBoundsPtrAccessChainKHR: + return true; + default: + return false; + } +} diff --git a/bgfx/3rdparty/spirv-tools/source/opcode.h b/bgfx/3rdparty/spirv-tools/source/opcode.h index 217aeb2b..08fc56d8 100644 --- a/bgfx/3rdparty/spirv-tools/source/opcode.h +++ b/bgfx/3rdparty/spirv-tools/source/opcode.h @@ -146,6 +146,9 @@ bool spvOpcodeIsLinearAlgebra(spv::Op opcode); // Returns true for opcodes that represent image sample instructions. bool spvOpcodeIsImageSample(spv::Op opcode); +// Returns true if the opcode is either OpExtInst or OpExtInstWithForwardRefsKHR +bool spvIsExtendedInstruction(spv::Op opcode); + // Returns a vector containing the indices of the memory semantics // operands for |opcode|. std::vector spvOpcodeMemorySemanticsOperandIndices(spv::Op opcode); @@ -159,4 +162,7 @@ bool spvOpcodeIsBit(spv::Op opcode); // Gets the name of an instruction, without the "Op" prefix. const char* spvOpcodeString(const spv::Op opcode); +// Returns true for opcodes that generate an untyped pointer result. +bool spvOpcodeGeneratesUntypedPointer(spv::Op opcode); + #endif // SOURCE_OPCODE_H_ diff --git a/bgfx/3rdparty/spirv-tools/source/operand.cpp b/bgfx/3rdparty/spirv-tools/source/operand.cpp index 5349a2d4..9bee647f 100644 --- a/bgfx/3rdparty/spirv-tools/source/operand.cpp +++ b/bgfx/3rdparty/spirv-tools/source/operand.cpp @@ -64,11 +64,29 @@ spv_result_t spvOperandTableNameLookup(spv_target_env, // We consider the current operand as available as long as // it is in the grammar. It might not be *valid* to use, // but that should be checked by the validator, not by parsing. + // + // Exact match case if (nameLength == strlen(entry.name) && !strncmp(entry.name, name, nameLength)) { *pEntry = &entry; return SPV_SUCCESS; } + + // Check the aliases. Ideally we would have a version of the table sorted + // by name and then we could iterate between the lower and upper bounds to + // restrict the amount comparisons. Fortunately, name-based lookups are + // mostly restricted to the assembler. + if (entry.numAliases > 0) { + for (uint32_t aliasIndex = 0; aliasIndex < entry.numAliases; + aliasIndex++) { + const auto alias = entry.aliases[aliasIndex]; + const size_t aliasLength = strlen(alias); + if (nameLength == aliasLength && !strncmp(name, alias, nameLength)) { + *pEntry = &entry; + return SPV_SUCCESS; + } + } + } } } @@ -83,7 +101,8 @@ spv_result_t spvOperandTableValueLookup(spv_target_env, if (!table) return SPV_ERROR_INVALID_TABLE; if (!pEntry) return SPV_ERROR_INVALID_POINTER; - spv_operand_desc_t needle = {"", value, 0, nullptr, 0, nullptr, {}, ~0u, ~0u}; + spv_operand_desc_t needle = {"", value, 0, nullptr, 0, nullptr, + 0, nullptr, {}, ~0u, ~0u}; auto comp = [](const spv_operand_desc_t& lhs, const spv_operand_desc_t& rhs) { return lhs.value < rhs.value; @@ -216,6 +235,15 @@ const char* spvOperandTypeStr(spv_operand_type_t type) { return "initialization mode qualifier"; case SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER: return "host access qualifier"; + case SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL: + return "load cache control"; + case SPV_OPERAND_TYPE_STORE_CACHE_CONTROL: + return "store cache control"; + case SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS: + return "named maximum number of registers"; + case SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS: + case SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS: + return "raw access chain operands"; case SPV_OPERAND_TYPE_IMAGE: case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: return "image"; @@ -243,6 +271,9 @@ const char* spvOperandTypeStr(spv_operand_type_t type) { return "OpenCL.DebugInfo.100 debug operation"; case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY: return "OpenCL.DebugInfo.100 debug imported entity"; + case SPV_OPERAND_TYPE_FPENCODING: + case SPV_OPERAND_TYPE_OPTIONAL_FPENCODING: + return "FP encoding"; // The next values are for values returned from an instruction, not actually // an operand. So the specific strings don't matter. But let's add them @@ -354,6 +385,10 @@ bool spvOperandIsConcrete(spv_operand_type_t type) { case SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_USE: case SPV_OPERAND_TYPE_INITIALIZATION_MODE_QUALIFIER: case SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER: + case SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL: + case SPV_OPERAND_TYPE_STORE_CACHE_CONTROL: + case SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS: + case SPV_OPERAND_TYPE_FPENCODING: return true; default: break; @@ -373,6 +408,7 @@ bool spvOperandIsConcreteMask(spv_operand_type_t type) { case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS: case SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_OPERANDS: + case SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS: return true; default: break; @@ -393,6 +429,8 @@ bool spvOperandIsOptional(spv_operand_type_t type) { case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: case SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS: case SPV_OPERAND_TYPE_OPTIONAL_CIV: + case SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS: + case SPV_OPERAND_TYPE_OPTIONAL_FPENCODING: return true; default: break; @@ -568,11 +606,13 @@ std::function spvOperandCanBeForwardDeclaredFunction( } std::function spvDbgInfoExtOperandCanBeForwardDeclaredFunction( - spv_ext_inst_type_t ext_type, uint32_t key) { + spv::Op opcode, spv_ext_inst_type_t ext_type, uint32_t key) { // The Vulkan debug info extended instruction set is non-semantic so allows no - // forward references ever + // forward references except if used through OpExtInstWithForwardRefsKHR. if (ext_type == SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) { - return [](unsigned) { return false; }; + return [opcode](unsigned) { + return opcode == spv::Op::OpExtInstWithForwardRefsKHR; + }; } // TODO(https://gitlab.khronos.org/spirv/SPIR-V/issues/532): Forward diff --git a/bgfx/3rdparty/spirv-tools/source/operand.h b/bgfx/3rdparty/spirv-tools/source/operand.h index a3010d93..3d42a059 100644 --- a/bgfx/3rdparty/spirv-tools/source/operand.h +++ b/bgfx/3rdparty/spirv-tools/source/operand.h @@ -57,12 +57,6 @@ spv_result_t spvOperandTableValueLookup(spv_target_env, // Gets the name string of the non-variable operand type. const char* spvOperandTypeStr(spv_operand_type_t type); -// Returns true if the given type is concrete. -bool spvOperandIsConcrete(spv_operand_type_t type); - -// Returns true if the given type is concrete and also a mask. -bool spvOperandIsConcreteMask(spv_operand_type_t type); - // Returns true if an operand of the given type is optional. bool spvOperandIsOptional(spv_operand_type_t type); @@ -146,6 +140,6 @@ std::function spvOperandCanBeForwardDeclaredFunction( // of the operand can be forward declared. This function will // used in the SSA validation stage of the pipeline std::function spvDbgInfoExtOperandCanBeForwardDeclaredFunction( - spv_ext_inst_type_t ext_type, uint32_t key); + spv::Op opcode, spv_ext_inst_type_t ext_type, uint32_t key); #endif // SOURCE_OPERAND_H_ diff --git a/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp index 87324cdb..79654224 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp @@ -40,6 +40,9 @@ constexpr uint32_t kCopyMemorySourceAddrInIdx = 1; constexpr uint32_t kLoadSourceAddrInIdx = 0; constexpr uint32_t kDebugDeclareOperandVariableIndex = 5; constexpr uint32_t kGlobalVariableVariableIndex = 12; +constexpr uint32_t kExtInstSetInIdx = 0; +constexpr uint32_t kExtInstOpInIdx = 1; +constexpr uint32_t kInterpolantInIdx = 2; // Sorting functor to present annotation instructions in an easy-to-process // order. The functor orders by opcode first and falls back on unique id @@ -134,7 +137,12 @@ void AggressiveDCEPass::AddStores(Function* func, uint32_t ptrId) { } break; // If default, assume it stores e.g. frexp, modf, function call - case spv::Op::OpStore: + case spv::Op::OpStore: { + const uint32_t kStoreTargetAddrInIdx = 0; + if (user->GetSingleWordInOperand(kStoreTargetAddrInIdx) == ptrId) + AddToWorklist(user); + break; + } default: AddToWorklist(user); break; @@ -262,6 +270,7 @@ void AggressiveDCEPass::AddBreaksAndContinuesToWorklist( } bool AggressiveDCEPass::AggressiveDCE(Function* func) { + if (func->IsDeclaration()) return false; std::list structured_order; cfg()->ComputeStructuredOrder(func, &*func->begin(), &structured_order); live_local_vars_.clear(); @@ -416,6 +425,19 @@ uint32_t AggressiveDCEPass::GetLoadedVariableFromNonFunctionCalls( case spv::Op::OpCopyMemorySized: return GetVariableId( inst->GetSingleWordInOperand(kCopyMemorySourceAddrInIdx)); + case spv::Op::OpExtInst: { + if (inst->GetSingleWordInOperand(kExtInstSetInIdx) == + context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450()) { + auto ext_inst = inst->GetSingleWordInOperand(kExtInstOpInIdx); + switch (ext_inst) { + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtOffset: + case GLSLstd450InterpolateAtSample: + return inst->GetSingleWordInOperand(kInterpolantInIdx); + } + } + break; + } default: break; } @@ -941,6 +963,8 @@ Pass::Status AggressiveDCEPass::Process() { void AggressiveDCEPass::InitExtensions() { extensions_allowlist_.clear(); + + // clang-format off extensions_allowlist_.insert({ "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_trinary_minmax", @@ -983,11 +1007,13 @@ void AggressiveDCEPass::InitExtensions() { "SPV_NV_shader_image_footprint", "SPV_NV_shading_rate", "SPV_NV_mesh_shader", + "SPV_EXT_mesh_shader", "SPV_NV_ray_tracing", "SPV_KHR_ray_tracing", "SPV_KHR_ray_query", "SPV_EXT_fragment_invocation_density", "SPV_EXT_physical_storage_buffer", + "SPV_KHR_physical_storage_buffer", "SPV_KHR_terminate_invocation", "SPV_KHR_shader_clock", "SPV_KHR_vulkan_memory_model", @@ -999,7 +1025,13 @@ void AggressiveDCEPass::InitExtensions() { "SPV_KHR_fragment_shader_barycentric", "SPV_NV_bindless_texture", "SPV_EXT_shader_atomic_float_add", + "SPV_EXT_fragment_shader_interlock", + "SPV_KHR_compute_shader_derivatives", + "SPV_NV_cooperative_matrix", + "SPV_KHR_cooperative_matrix", + "SPV_KHR_ray_tracing_position_fetch" }); + // clang-format on } Instruction* AggressiveDCEPass::GetHeaderBranch(BasicBlock* blk) { diff --git a/bgfx/3rdparty/spirv-tools/source/opt/block_merge_util.cpp b/bgfx/3rdparty/spirv-tools/source/opt/block_merge_util.cpp index fe23e36f..42f695f2 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/block_merge_util.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/block_merge_util.cpp @@ -98,6 +98,17 @@ bool CanMergeWithSuccessor(IRContext* context, BasicBlock* block) { return false; } + // Note: This means that the instructions in a break block will execute as if + // they were still diverged according to the loop iteration. This restricts + // potential transformations an implementation may perform on the IR to match + // shader author expectations. Similarly, instructions in the loop construct + // cannot be moved into the continue construct unless it can be proven that + // invocations are always converged. + if (succ_is_merge && context->get_feature_mgr()->HasExtension( + kSPV_KHR_maximal_reconvergence)) { + return false; + } + if (pred_is_merge && IsContinue(context, lab_id)) { // Cannot merge a continue target with a merge block. return false; diff --git a/bgfx/3rdparty/spirv-tools/source/opt/build_module.h b/bgfx/3rdparty/spirv-tools/source/opt/build_module.h index 29eaf661..0f906c88 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/build_module.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/build_module.h @@ -24,7 +24,7 @@ namespace spvtools { -// Builds an Module returns the owning IRContext from the given SPIR-V +// Builds a Module and returns the owning IRContext from the given SPIR-V // |binary|. |size| specifies number of words in |binary|. The |binary| will be // decoded according to the given target |env|. Returns nullptr if errors occur // and sends the errors to |consumer|. When |extra_line_tracking| is true, @@ -41,7 +41,7 @@ std::unique_ptr BuildModule(spv_target_env env, const uint32_t* binary, size_t size); -// Builds an Module and returns the owning IRContext from the given +// Builds a Module and returns the owning IRContext from the given // SPIR-V assembly |text|. The |text| will be encoded according to the given // target |env|. Returns nullptr if errors occur and sends the errors to // |consumer|. diff --git a/bgfx/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp b/bgfx/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp index e676974c..a5d4cbe7 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp @@ -676,7 +676,6 @@ ConstantFoldingRule FoldUnaryOp(UnaryScalarFoldingRule scalar_rule) { return [scalar_rule](IRContext* context, Instruction* inst, const std::vector& constants) -> const analysis::Constant* { - analysis::ConstantManager* const_mgr = context->get_constant_mgr(); analysis::TypeManager* type_mgr = context->get_type_mgr(); const analysis::Type* result_type = type_mgr->GetType(inst->type_id()); @@ -716,6 +715,64 @@ ConstantFoldingRule FoldUnaryOp(UnaryScalarFoldingRule scalar_rule) { }; } +// Returns a |ConstantFoldingRule| that folds binary scalar ops +// using |scalar_rule| and binary vectors ops by applying +// |scalar_rule| to the elements of the vector. The folding rule assumes that op +// has two inputs. For regular instruction, those are in operands 0 and 1. For +// extended instruction, they are in operands 1 and 2. If an element in +// |constants| is not nullprt, then the constant's type is |Float|, |Integer|, +// or |Vector| whose element type is |Float| or |Integer|. +ConstantFoldingRule FoldBinaryOp(BinaryScalarFoldingRule scalar_rule) { + return [scalar_rule](IRContext* context, Instruction* inst, + const std::vector& constants) + -> const analysis::Constant* { + assert(constants.size() == inst->NumInOperands()); + assert(constants.size() == (inst->opcode() == spv::Op::OpExtInst ? 3 : 2)); + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + analysis::TypeManager* type_mgr = context->get_type_mgr(); + const analysis::Type* result_type = type_mgr->GetType(inst->type_id()); + const analysis::Vector* vector_type = result_type->AsVector(); + + const analysis::Constant* arg1 = + (inst->opcode() == spv::Op::OpExtInst) ? constants[1] : constants[0]; + const analysis::Constant* arg2 = + (inst->opcode() == spv::Op::OpExtInst) ? constants[2] : constants[1]; + + if (arg1 == nullptr || arg2 == nullptr) { + return nullptr; + } + + if (vector_type == nullptr) { + return scalar_rule(result_type, arg1, arg2, const_mgr); + } + + std::vector a_components; + std::vector b_components; + std::vector results_components; + + a_components = arg1->GetVectorComponents(const_mgr); + b_components = arg2->GetVectorComponents(const_mgr); + assert(a_components.size() == b_components.size()); + + // Fold each component of the vector. + for (uint32_t i = 0; i < a_components.size(); ++i) { + results_components.push_back(scalar_rule(vector_type->element_type(), + a_components[i], b_components[i], + const_mgr)); + if (results_components[i] == nullptr) { + return nullptr; + } + } + + // Build the constant object and return it. + std::vector ids; + for (const analysis::Constant* member : results_components) { + ids.push_back(const_mgr->GetDefiningInstruction(member)->result_id()); + } + return const_mgr->GetConstant(vector_type, ids); + }; +} + // Returns a |ConstantFoldingRule| that folds unary floating point scalar ops // using |scalar_rule| and unary float point vectors ops by applying // |scalar_rule| to the elements of the vector. The |ConstantFoldingRule| @@ -1587,6 +1644,74 @@ BinaryScalarFoldingRule FoldFTranscendentalBinary(double (*fp)(double, return nullptr; }; } + +enum Sign { Signed, Unsigned }; + +// Returns a BinaryScalarFoldingRule that applies `op` to the scalars. +// The `signedness` is used to determine if the operands should be interpreted +// as signed or unsigned. If the operands are signed, the value will be sign +// extended before the value is passed to `op`. Otherwise the values will be +// zero extended. +template +BinaryScalarFoldingRule FoldBinaryIntegerOperation(uint64_t (*op)(uint64_t, + uint64_t)) { + return + [op](const analysis::Type* result_type, const analysis::Constant* a, + const analysis::Constant* b, + analysis::ConstantManager* const_mgr) -> const analysis::Constant* { + assert(result_type != nullptr && a != nullptr && b != nullptr); + const analysis::Integer* integer_type = result_type->AsInteger(); + assert(integer_type != nullptr); + assert(a->type()->kind() == analysis::Type::kInteger); + assert(b->type()->kind() == analysis::Type::kInteger); + assert(integer_type->width() == a->type()->AsInteger()->width()); + assert(integer_type->width() == b->type()->AsInteger()->width()); + + // In SPIR-V, all operations support unsigned types, but the way they + // are interpreted depends on the opcode. This is why we use the + // template argument to determine how to interpret the operands. + uint64_t ia = (signedness == Signed ? a->GetSignExtendedValue() + : a->GetZeroExtendedValue()); + uint64_t ib = (signedness == Signed ? b->GetSignExtendedValue() + : b->GetZeroExtendedValue()); + uint64_t result = op(ia, ib); + + const analysis::Constant* result_constant = + const_mgr->GenerateIntegerConstant(integer_type, result); + return result_constant; + }; +} + +// A scalar folding rule that folds OpSConvert. +const analysis::Constant* FoldScalarSConvert( + const analysis::Type* result_type, const analysis::Constant* a, + analysis::ConstantManager* const_mgr) { + assert(result_type != nullptr); + assert(a != nullptr); + assert(const_mgr != nullptr); + const analysis::Integer* integer_type = result_type->AsInteger(); + assert(integer_type && "The result type of an SConvert"); + int64_t value = a->GetSignExtendedValue(); + return const_mgr->GenerateIntegerConstant(integer_type, value); +} + +// A scalar folding rule that folds OpUConvert. +const analysis::Constant* FoldScalarUConvert( + const analysis::Type* result_type, const analysis::Constant* a, + analysis::ConstantManager* const_mgr) { + assert(result_type != nullptr); + assert(a != nullptr); + assert(const_mgr != nullptr); + const analysis::Integer* integer_type = result_type->AsInteger(); + assert(integer_type && "The result type of an UConvert"); + uint64_t value = a->GetZeroExtendedValue(); + + // If the operand was an unsigned value with less than 32-bit, it would have + // been sign extended earlier, and we need to clear those bits. + auto* operand_type = a->type()->AsInteger(); + value = utils::ClearHighBits(value, 64 - operand_type->width()); + return const_mgr->GenerateIntegerConstant(integer_type, value); +} } // namespace void ConstantFoldingRules::AddFoldingRules() { @@ -1604,6 +1729,8 @@ void ConstantFoldingRules::AddFoldingRules() { rules_[spv::Op::OpConvertFToU].push_back(FoldFToI()); rules_[spv::Op::OpConvertSToF].push_back(FoldIToF()); rules_[spv::Op::OpConvertUToF].push_back(FoldIToF()); + rules_[spv::Op::OpSConvert].push_back(FoldUnaryOp(FoldScalarSConvert)); + rules_[spv::Op::OpUConvert].push_back(FoldUnaryOp(FoldScalarUConvert)); rules_[spv::Op::OpDot].push_back(FoldOpDotWithConstants()); rules_[spv::Op::OpFAdd].push_back(FoldFAdd()); @@ -1662,6 +1789,46 @@ void ConstantFoldingRules::AddFoldingRules() { rules_[spv::Op::OpSNegate].push_back(FoldSNegate()); rules_[spv::Op::OpQuantizeToF16].push_back(FoldQuantizeToF16()); + rules_[spv::Op::OpIAdd].push_back( + FoldBinaryOp(FoldBinaryIntegerOperation( + [](uint64_t a, uint64_t b) { return a + b; }))); + rules_[spv::Op::OpISub].push_back( + FoldBinaryOp(FoldBinaryIntegerOperation( + [](uint64_t a, uint64_t b) { return a - b; }))); + rules_[spv::Op::OpIMul].push_back( + FoldBinaryOp(FoldBinaryIntegerOperation( + [](uint64_t a, uint64_t b) { return a * b; }))); + rules_[spv::Op::OpUDiv].push_back( + FoldBinaryOp(FoldBinaryIntegerOperation( + [](uint64_t a, uint64_t b) { return (b != 0 ? a / b : 0); }))); + rules_[spv::Op::OpSDiv].push_back(FoldBinaryOp( + FoldBinaryIntegerOperation([](uint64_t a, uint64_t b) { + return (b != 0 ? static_cast(static_cast(a) / + static_cast(b)) + : 0); + }))); + rules_[spv::Op::OpUMod].push_back( + FoldBinaryOp(FoldBinaryIntegerOperation( + [](uint64_t a, uint64_t b) { return (b != 0 ? a % b : 0); }))); + + rules_[spv::Op::OpSRem].push_back(FoldBinaryOp( + FoldBinaryIntegerOperation([](uint64_t a, uint64_t b) { + return (b != 0 ? static_cast(static_cast(a) % + static_cast(b)) + : 0); + }))); + + rules_[spv::Op::OpSMod].push_back(FoldBinaryOp( + FoldBinaryIntegerOperation([](uint64_t a, uint64_t b) { + if (b == 0) return static_cast(0ull); + + int64_t signed_a = static_cast(a); + int64_t signed_b = static_cast(b); + int64_t result = signed_a % signed_b; + if ((signed_b < 0) != (result < 0)) result += signed_b; + return static_cast(result); + }))); + // Add rules for GLSLstd450 FeatureManager* feature_manager = context_->get_feature_mgr(); uint32_t ext_inst_glslstd450_id = diff --git a/bgfx/3rdparty/spirv-tools/source/opt/constants.cpp b/bgfx/3rdparty/spirv-tools/source/opt/constants.cpp index a487a45b..7dc02dea 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/constants.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/constants.cpp @@ -498,7 +498,7 @@ const Constant* ConstantManager::GetIntConst(uint64_t val, int32_t bitWidth, int32_t num_of_bit_to_ignore = 64 - bitWidth; val = static_cast(val << num_of_bit_to_ignore) >> num_of_bit_to_ignore; - } else { + } else if (bitWidth < 64) { // Clear the upper bit that are not used. uint64_t mask = ((1ull << bitWidth) - 1); val &= mask; @@ -511,7 +511,7 @@ const Constant* ConstantManager::GetIntConst(uint64_t val, int32_t bitWidth, // If the value is more than 32-bit, we need to split the operands into two // 32-bit integers. return GetConstant( - int_type, {static_cast(val >> 32), static_cast(val)}); + int_type, {static_cast(val), static_cast(val >> 32)}); } uint32_t ConstantManager::GetUIntConstId(uint32_t val) { @@ -525,6 +525,28 @@ uint32_t ConstantManager::GetNullConstId(const Type* type) { return GetDefiningInstruction(c)->result_id(); } +const Constant* ConstantManager::GenerateIntegerConstant( + const analysis::Integer* integer_type, uint64_t result) { + assert(integer_type != nullptr); + + std::vector words; + if (integer_type->width() == 64) { + // In the 64-bit case, two words are needed to represent the value. + words = {static_cast(result), + static_cast(result >> 32)}; + } else { + // In all other cases, only a single word is needed. + assert(integer_type->width() <= 32); + if (integer_type->IsSigned()) { + result = utils::SignExtendValue(result, integer_type->width()); + } else { + result = utils::ZeroExtendValue(result, integer_type->width()); + } + words = {static_cast(result)}; + } + return GetConstant(integer_type, words); +} + std::vector Constant::GetVectorComponents( analysis::ConstantManager* const_mgr) const { std::vector components; diff --git a/bgfx/3rdparty/spirv-tools/source/opt/constants.h b/bgfx/3rdparty/spirv-tools/source/opt/constants.h index adc76ba2..3b8e239c 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/constants.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/constants.h @@ -671,6 +671,11 @@ class ConstantManager { // Returns the id of a OpConstantNull with type of |type|. uint32_t GetNullConstId(const Type* type); + // Returns a constant whose value is `value` and type is `type`. This constant + // will be generated by `const_mgr`. The type must be a scalar integer type. + const Constant* GenerateIntegerConstant(const analysis::Integer* integer_type, + uint64_t result); + private: // Creates a Constant instance with the given type and a vector of constant // defining words. Returns a unique pointer to the created Constant instance diff --git a/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp index cb0065d2..e243bedf 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp @@ -171,6 +171,19 @@ bool ConvertToHalfPass::RemoveRelaxedDecoration(uint32_t id) { bool ConvertToHalfPass::GenHalfArith(Instruction* inst) { bool modified = false; + // If this is a OpCompositeExtract instruction and has a struct operand, we + // should not relax this instruction. Doing so could cause a mismatch between + // the result type and the struct member type. + bool hasStructOperand = false; + if (inst->opcode() == spv::Op::OpCompositeExtract) { + inst->ForEachInId([&hasStructOperand, this](uint32_t* idp) { + Instruction* op_inst = get_def_use_mgr()->GetDef(*idp); + if (IsStruct(op_inst)) hasStructOperand = true; + }); + if (hasStructOperand) { + return false; + } + } // Convert all float32 based operands to float16 equivalent and change // instruction type to float16 equivalent. inst->ForEachInId([&inst, &modified, this](uint32_t* idp) { @@ -303,12 +316,19 @@ bool ConvertToHalfPass::CloseRelaxInst(Instruction* inst) { if (closure_ops_.count(inst->opcode()) == 0) return false; // Can relax if all float operands are relaxed bool relax = true; - inst->ForEachInId([&relax, this](uint32_t* idp) { + bool hasStructOperand = false; + inst->ForEachInId([&relax, &hasStructOperand, this](uint32_t* idp) { Instruction* op_inst = get_def_use_mgr()->GetDef(*idp); - if (IsStruct(op_inst)) relax = false; + if (IsStruct(op_inst)) hasStructOperand = true; if (!IsFloat(op_inst, 32)) return; if (!IsRelaxed(*idp)) relax = false; }); + // If the instruction has a struct operand, we should not relax it, even if + // all its uses are relaxed. Doing so could cause a mismatch between the + // result type and the struct member type. + if (hasStructOperand) { + return false; + } if (relax) { AddRelaxed(inst->result_id()); return true; diff --git a/bgfx/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp index c82db41c..d2da4d1e 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp @@ -329,12 +329,10 @@ bool ConvertToSampledImagePass::ConvertImageVariableToSampledImage( if (sampled_image_type == nullptr) return false; auto storage_class = GetStorageClass(*image_variable); if (storage_class == spv::StorageClass::Max) return false; - analysis::Pointer sampled_image_pointer(sampled_image_type, storage_class); - // Make sure |image_variable| is behind its type i.e., avoid the forward // reference. - uint32_t type_id = - context()->get_type_mgr()->GetTypeInstruction(&sampled_image_pointer); + uint32_t type_id = context()->get_type_mgr()->FindPointerToType( + sampled_image_type_id, storage_class); MoveInstructionNextToType(image_variable, type_id); return true; } diff --git a/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp b/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp index 66a268fb..0a420744 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp @@ -28,6 +28,9 @@ constexpr uint32_t kStoreObjectInOperand = 1; constexpr uint32_t kCompositeExtractObjectInOperand = 0; constexpr uint32_t kTypePointerStorageClassInIdx = 0; constexpr uint32_t kTypePointerPointeeInIdx = 1; +constexpr uint32_t kExtInstSetInIdx = 0; +constexpr uint32_t kExtInstOpInIdx = 1; +constexpr uint32_t kInterpolantInIdx = 2; bool IsDebugDeclareOrValue(Instruction* di) { auto dbg_opcode = di->GetCommonDebugOpcode(); @@ -35,6 +38,32 @@ bool IsDebugDeclareOrValue(Instruction* di) { dbg_opcode == CommonDebugInfoDebugValue; } +// Returns the number of members in |type|. If |type| is not a composite type +// or the number of components is not known at compile time, the return value +// will be 0. +uint32_t GetNumberOfMembers(const analysis::Type* type, IRContext* context) { + if (const analysis::Struct* struct_type = type->AsStruct()) { + return static_cast(struct_type->element_types().size()); + } else if (const analysis::Array* array_type = type->AsArray()) { + const analysis::Constant* length_const = + context->get_constant_mgr()->FindDeclaredConstant( + array_type->LengthId()); + + if (length_const == nullptr) { + // This can happen if the length is an OpSpecConstant. + return 0; + } + assert(length_const->type()->AsInteger()); + return length_const->GetU32(); + } else if (const analysis::Vector* vector_type = type->AsVector()) { + return vector_type->element_count(); + } else if (const analysis::Matrix* matrix_type = type->AsMatrix()) { + return matrix_type->element_count(); + } else { + return 0; + } +} + } // namespace Pass::Status CopyPropagateArrays::Process() { @@ -48,28 +77,38 @@ Pass::Status CopyPropagateArrays::Process() { for (auto var_inst = entry_bb->begin(); var_inst->opcode() == spv::Op::OpVariable; ++var_inst) { - if (!IsPointerToArrayType(var_inst->type_id())) { - continue; - } + worklist_.push(&*var_inst); + } + } + + while (!worklist_.empty()) { + Instruction* var_inst = worklist_.front(); + worklist_.pop(); + + // Find the only store to the entire memory location, if it exists. + Instruction* store_inst = FindStoreInstruction(&*var_inst); - // Find the only store to the entire memory location, if it exists. - Instruction* store_inst = FindStoreInstruction(&*var_inst); + if (!store_inst) { + continue; + } + + std::unique_ptr source_object = + FindSourceObjectIfPossible(&*var_inst, store_inst); - if (!store_inst) { + if (source_object != nullptr) { + if (!IsPointerToArrayType(var_inst->type_id()) && + source_object->GetStorageClass() != spv::StorageClass::Input) { continue; } - std::unique_ptr source_object = - FindSourceObjectIfPossible(&*var_inst, store_inst); + if (CanUpdateUses(&*var_inst, source_object->GetPointerTypeId(this))) { + modified = true; - if (source_object != nullptr) { - if (CanUpdateUses(&*var_inst, source_object->GetPointerTypeId(this))) { - modified = true; - PropagateObject(&*var_inst, source_object.get(), store_inst); - } + PropagateObject(&*var_inst, source_object.get(), store_inst); } } } + return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); } @@ -178,6 +217,8 @@ bool CopyPropagateArrays::HasNoStores(Instruction* ptr_inst) { return true; } else if (use->opcode() == spv::Op::OpEntryPoint) { return true; + } else if (IsInterpolationInstruction(use)) { + return true; } // Some other instruction. Be conservative. return false; @@ -199,6 +240,13 @@ bool CopyPropagateArrays::HasValidReferencesOnly(Instruction* ptr_inst, // time to do the multiple traverses can add up. Consider collecting // those loads and doing a single traversal. return dominator_analysis->Dominates(store_inst, use); + } else if (IsInterpolationInstruction(use)) { + // GLSL InterpolateAt* instructions work similarly to loads + uint32_t interpolant = use->GetSingleWordInOperand(kInterpolantInIdx); + if (interpolant != + store_inst->GetSingleWordInOperand(kStorePointerInOperand)) + return false; + return dominator_analysis->Dominates(store_inst, use); } else if (use->opcode() == spv::Op::OpAccessChain) { return HasValidReferencesOnly(use, store_inst); } else if (use->IsDecoration() || use->opcode() == spv::Op::OpName) { @@ -357,22 +405,9 @@ CopyPropagateArrays::BuildMemoryObjectFromInsert(Instruction* insert_inst) { analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); const analysis::Type* result_type = type_mgr->GetType(insert_inst->type_id()); - uint32_t number_of_elements = 0; - if (const analysis::Struct* struct_type = result_type->AsStruct()) { - number_of_elements = - static_cast(struct_type->element_types().size()); - } else if (const analysis::Array* array_type = result_type->AsArray()) { - const analysis::Constant* length_const = - const_mgr->FindDeclaredConstant(array_type->LengthId()); - number_of_elements = length_const->GetU32(); - } else if (const analysis::Vector* vector_type = result_type->AsVector()) { - number_of_elements = vector_type->element_count(); - } else if (const analysis::Matrix* matrix_type = result_type->AsMatrix()) { - number_of_elements = matrix_type->element_count(); - } + uint32_t number_of_elements = GetNumberOfMembers(result_type, context()); if (number_of_elements == 0) { return nullptr; @@ -476,6 +511,21 @@ bool CopyPropagateArrays::IsPointerToArrayType(uint32_t type_id) { return false; } +bool CopyPropagateArrays::IsInterpolationInstruction(Instruction* inst) { + if (inst->opcode() == spv::Op::OpExtInst && + inst->GetSingleWordInOperand(kExtInstSetInIdx) == + context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450()) { + uint32_t ext_inst = inst->GetSingleWordInOperand(kExtInstOpInIdx); + switch (ext_inst) { + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtOffset: + case GLSLstd450InterpolateAtSample: + return true; + } + } + return false; +} + bool CopyPropagateArrays::CanUpdateUses(Instruction* original_ptr_inst, uint32_t type_id) { analysis::TypeManager* type_mgr = context()->get_type_mgr(); @@ -509,6 +559,11 @@ bool CopyPropagateArrays::CanUpdateUses(Instruction* original_ptr_inst, } return true; } + case spv::Op::OpExtInst: + if (IsInterpolationInstruction(use)) { + return true; + } + return false; case spv::Op::OpAccessChain: { analysis::Pointer* pointer_type = type->AsPointer(); const analysis::Type* pointee_type = pointer_type->pointee_type(); @@ -657,6 +712,18 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, } else { context()->AnalyzeUses(use); } + + AddUsesToWorklist(use); + } break; + case spv::Op::OpExtInst: { + if (IsInterpolationInstruction(use)) { + // Replace the actual use. + context()->ForgetUses(use); + use->SetOperand(index, {new_ptr_inst->result_id()}); + context()->AnalyzeUses(use); + } else { + assert(false && "Don't know how to rewrite instruction"); + } } break; case spv::Op::OpAccessChain: { // Update the actual use. @@ -738,6 +805,8 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, uint32_t pointee_type_id = pointer_type->GetSingleWordInOperand(kTypePointerPointeeInIdx); uint32_t copy = GenerateCopy(original_ptr_inst, pointee_type_id, use); + assert(copy != 0 && + "Should not be updating uses unless we know it can be done."); context()->ForgetUses(use); use->SetInOperand(index, {copy}); @@ -784,6 +853,22 @@ uint32_t CopyPropagateArrays::GetMemberTypeId( return id; } +void CopyPropagateArrays::AddUsesToWorklist(Instruction* inst) { + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + + def_use_mgr->ForEachUse(inst, [this](Instruction* use, uint32_t) { + if (use->opcode() == spv::Op::OpStore) { + uint32_t var_id; + Instruction* target_pointer = GetPtr(use, &var_id); + if (target_pointer->opcode() != spv::Op::OpVariable) { + return; + } + + worklist_.push(target_pointer); + } + }); +} + void CopyPropagateArrays::MemoryObject::PushIndirection( const std::vector& access_chain) { access_chain_.insert(access_chain_.end(), access_chain.begin(), @@ -800,23 +885,8 @@ uint32_t CopyPropagateArrays::MemoryObject::GetNumberOfMembers() { std::vector access_indices = GetAccessIds(); type = type_mgr->GetMemberType(type, access_indices); - if (const analysis::Struct* struct_type = type->AsStruct()) { - return static_cast(struct_type->element_types().size()); - } else if (const analysis::Array* array_type = type->AsArray()) { - const analysis::Constant* length_const = - context->get_constant_mgr()->FindDeclaredConstant( - array_type->LengthId()); - assert(length_const->type()->AsInteger()); - return length_const->GetU32(); - } else if (const analysis::Vector* vector_type = type->AsVector()) { - return vector_type->element_count(); - } else if (const analysis::Matrix* matrix_type = type->AsMatrix()) { - return matrix_type->element_count(); - } else { - return 0; - } + return opt::GetNumberOfMembers(type, context); } - template CopyPropagateArrays::MemoryObject::MemoryObject(Instruction* var_inst, iterator begin, iterator end) diff --git a/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h b/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h index 7486f808..bf4bfb5c 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h @@ -101,7 +101,8 @@ class CopyPropagateArrays : public MemPass { bool IsMember() const { return !access_chain_.empty(); } // Returns the number of members in the object represented by |this|. If - // |this| does not represent a composite type, the return value will be 0. + // |this| does not represent a composite type or the number of components is + // not known at compile time, the return value will be 0. uint32_t GetNumberOfMembers(); // Returns the owning variable that the memory object is contained in. @@ -207,7 +208,7 @@ class CopyPropagateArrays : public MemPass { // Returns the memory object that at some point was equivalent to the result // of |insert_inst|. If a memory object cannot be identified, the return - // value is |nullptr\. The opcode of |insert_inst| must be + // value is |nullptr|. The opcode of |insert_inst| must be // |OpCompositeInsert|. This function looks for a series of // |OpCompositeInsert| instructions that insert the elements one at a time in // order from beginning to end. @@ -221,6 +222,10 @@ class CopyPropagateArrays : public MemPass { // Return true if |type_id| is a pointer type whose pointee type is an array. bool IsPointerToArrayType(uint32_t type_id); + // Return true if |inst| is one of the InterpolateAt* GLSL.std.450 extended + // instructions. + bool IsInterpolationInstruction(Instruction* inst); + // Returns true if there are not stores using |ptr_inst| or something derived // from it. bool HasNoStores(Instruction* ptr_inst); @@ -253,6 +258,14 @@ class CopyPropagateArrays : public MemPass { // same way the indexes are used in an |OpCompositeExtract| instruction. uint32_t GetMemberTypeId(uint32_t id, const std::vector& access_chain) const; + + // If the result of inst is stored to a variable, add that variable to the + // worklist. + void AddUsesToWorklist(Instruction* inst); + + // OpVariable worklist. An instruction is added to this list if we would like + // to run copy propagation on it. + std::queue worklist_; }; } // namespace opt diff --git a/bgfx/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp index a4869037..f985e4c2 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp @@ -213,7 +213,8 @@ bool DeadInsertElimPass::EliminateDeadInsertsOnePass(Function* func) { } break; default: { // Mark inserts in chain for all components - MarkInsertChain(&*ii, nullptr, 0, nullptr); + std::unordered_set visited_phis; + MarkInsertChain(&*ii, nullptr, 0, &visited_phis); } break; } }); diff --git a/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp b/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp index 1e614c6f..24094b36 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp @@ -768,15 +768,29 @@ void DebugInfoManager::ConvertDebugGlobalToLocalVariable( local_var->opcode() == spv::Op::OpFunctionParameter); // Convert |dbg_global_var| to DebugLocalVariable + // All of the operands up to the scope operand are the same for the type + // instructions. The flag operand needs to move from operand + // kDebugGlobalVariableOperandFlagsIndex to + // kDebugLocalVariableOperandFlagsIndex. No other operands are needed to + // define the DebugLocalVariable. + + // Modify the opcode. dbg_global_var->SetInOperand(kExtInstInstructionInIdx, {CommonDebugInfoDebugLocalVariable}); + + // Move the flags operand. auto flags = dbg_global_var->GetSingleWordOperand( kDebugGlobalVariableOperandFlagsIndex); - for (uint32_t i = dbg_global_var->NumInOperands() - 1; - i >= kDebugLocalVariableOperandFlagsIndex; --i) { + dbg_global_var->SetOperand(kDebugLocalVariableOperandFlagsIndex, {flags}); + + // Remove the extra operands. Starting at the end to avoid copying too much + // data. + for (uint32_t i = dbg_global_var->NumOperands() - 1; + i > kDebugLocalVariableOperandFlagsIndex; --i) { dbg_global_var->RemoveOperand(i); } - dbg_global_var->SetOperand(kDebugLocalVariableOperandFlagsIndex, {flags}); + + // Update the def-use manager. context()->ForgetUses(dbg_global_var); context()->AnalyzeUses(dbg_global_var); diff --git a/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.h b/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.h index 08cb2f34..2be016a7 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.h @@ -142,7 +142,7 @@ class DecorationManager { uint32_t decoration_value); // Add |decoration, decoration_value| of |inst_id, member| to module. - void AddMemberDecoration(uint32_t member, uint32_t inst_id, + void AddMemberDecoration(uint32_t inst_id, uint32_t member, uint32_t decoration, uint32_t decoration_value); friend bool operator==(const DecorationManager&, const DecorationManager&); diff --git a/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.h b/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.h index a8dbbc60..13cf9bd3 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.h @@ -27,28 +27,6 @@ namespace spvtools { namespace opt { namespace analysis { -// Class for representing a use of id. Note that: -// * Result type id is a use. -// * Ids referenced in OpSectionMerge & OpLoopMerge are considered as use. -// * Ids referenced in OpPhi's in operands are considered as use. -struct Use { - Instruction* inst; // Instruction using the id. - uint32_t operand_index; // logical operand index of the id use. This can be - // the index of result type id. -}; - -inline bool operator==(const Use& lhs, const Use& rhs) { - return lhs.inst == rhs.inst && lhs.operand_index == rhs.operand_index; -} - -inline bool operator!=(const Use& lhs, const Use& rhs) { return !(lhs == rhs); } - -inline bool operator<(const Use& lhs, const Use& rhs) { - if (lhs.inst < rhs.inst) return true; - if (lhs.inst > rhs.inst) return false; - return lhs.operand_index < rhs.operand_index; -} - // Definition should never be null. User can be null, however, such an entry // should be used only for searching (e.g. all users of a particular definition) // and never stored in a container. diff --git a/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.cpp b/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.cpp index 8da0c864..124a3d3a 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.cpp @@ -31,11 +31,14 @@ bool IsDecorationBinding(Instruction* inst) { Pass::Status DescriptorScalarReplacement::Process() { bool modified = false; - std::vector vars_to_kill; for (Instruction& var : context()->types_values()) { - if (descsroautil::IsDescriptorArray(context(), &var)) { + bool is_candidate = + flatten_arrays_ && descsroautil::IsDescriptorArray(context(), &var); + is_candidate |= flatten_composites_ && + descsroautil::IsDescriptorStruct(context(), &var); + if (is_candidate) { modified = true; if (!ReplaceCandidate(&var)) { return Status::Failure; @@ -54,9 +57,10 @@ Pass::Status DescriptorScalarReplacement::Process() { bool DescriptorScalarReplacement::ReplaceCandidate(Instruction* var) { std::vector access_chain_work_list; std::vector load_work_list; + std::vector entry_point_work_list; bool failed = !get_def_use_mgr()->WhileEachUser( - var->result_id(), - [this, &access_chain_work_list, &load_work_list](Instruction* use) { + var->result_id(), [this, &access_chain_work_list, &load_work_list, + &entry_point_work_list](Instruction* use) { if (use->opcode() == spv::Op::OpName) { return true; } @@ -73,6 +77,9 @@ bool DescriptorScalarReplacement::ReplaceCandidate(Instruction* var) { case spv::Op::OpLoad: load_work_list.push_back(use); return true; + case spv::Op::OpEntryPoint: + entry_point_work_list.push_back(use); + return true; default: context()->EmitErrorMessage( "Variable cannot be replaced: invalid instruction", use); @@ -95,6 +102,11 @@ bool DescriptorScalarReplacement::ReplaceCandidate(Instruction* var) { return false; } } + for (Instruction* use : entry_point_work_list) { + if (!ReplaceEntryPoint(var, use)) { + return false; + } + } return true; } @@ -147,6 +159,42 @@ bool DescriptorScalarReplacement::ReplaceAccessChain(Instruction* var, return true; } +bool DescriptorScalarReplacement::ReplaceEntryPoint(Instruction* var, + Instruction* use) { + // Build a new |OperandList| for |use| that removes |var| and adds its + // replacement variables. + Instruction::OperandList new_operands; + + // Copy all operands except |var|. + bool found = false; + for (uint32_t idx = 0; idx < use->NumOperands(); idx++) { + Operand& op = use->GetOperand(idx); + if (op.type == SPV_OPERAND_TYPE_ID && op.words[0] == var->result_id()) { + found = true; + } else { + new_operands.emplace_back(op); + } + } + + if (!found) { + context()->EmitErrorMessage( + "Variable cannot be replaced: invalid instruction", use); + return false; + } + + // Add all new replacement variables. + uint32_t num_replacement_vars = + descsroautil::GetNumberOfElementsForArrayOrStruct(context(), var); + for (uint32_t i = 0; i < num_replacement_vars; i++) { + new_operands.push_back( + {SPV_OPERAND_TYPE_ID, {GetReplacementVariable(var, i)}}); + } + + use->ReplaceOperands(new_operands); + context()->UpdateDefUse(use); + return true; +} + uint32_t DescriptorScalarReplacement::GetReplacementVariable(Instruction* var, uint32_t idx) { auto replacement_vars = replacement_variables_.find(var); diff --git a/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.h b/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.h index 6a24fd87..d6af4df5 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.h @@ -32,9 +32,16 @@ namespace opt { // Documented in optimizer.hpp class DescriptorScalarReplacement : public Pass { public: - DescriptorScalarReplacement() {} - - const char* name() const override { return "descriptor-scalar-replacement"; } + DescriptorScalarReplacement(bool flatten_composites, bool flatten_arrays) + : flatten_composites_(flatten_composites), + flatten_arrays_(flatten_arrays) {} + + const char* name() const override { + if (flatten_composites_ && flatten_arrays_) + return "descriptor-scalar-replacement"; + if (flatten_composites_) return "descriptor-compososite-scalar-replacement"; + return "descriptor-array-scalar-replacement"; + } Status Process() override; @@ -64,6 +71,11 @@ class DescriptorScalarReplacement : public Pass { // otherwise. bool ReplaceLoadedValue(Instruction* var, Instruction* value); + // Replaces the given composite variable |var| in the OpEntryPoint with the + // new replacement variables, one for each element of the array |var|. Returns + // |true| if successful, and |false| otherwise. + bool ReplaceEntryPoint(Instruction* var, Instruction* use); + // Replaces the given OpCompositeExtract |extract| and all of its references // with an OpLoad of a replacement variable. |var| is the variable with // composite type whose value is being used by |extract|. Assumes that @@ -136,6 +148,9 @@ class DescriptorScalarReplacement : public Pass { // array |var|. If the entry is |0|, then the variable has not been // created yet. std::map> replacement_variables_; + + bool flatten_composites_; + bool flatten_arrays_; }; } // namespace opt diff --git a/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp b/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp index dba3de9c..62d94764 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp @@ -29,41 +29,58 @@ uint32_t GetLengthOfArrayType(IRContext* context, Instruction* type) { return length_const->GetU32(); } -} // namespace - -namespace descsroautil { +bool HasDescriptorDecorations(IRContext* context, Instruction* var) { + const auto& decoration_mgr = context->get_decoration_mgr(); + return decoration_mgr->HasDecoration( + var->result_id(), uint32_t(spv::Decoration::DescriptorSet)) && + decoration_mgr->HasDecoration(var->result_id(), + uint32_t(spv::Decoration::Binding)); +} -bool IsDescriptorArray(IRContext* context, Instruction* var) { +Instruction* GetVariableType(IRContext* context, Instruction* var) { if (var->opcode() != spv::Op::OpVariable) { - return false; + return nullptr; } uint32_t ptr_type_id = var->type_id(); Instruction* ptr_type_inst = context->get_def_use_mgr()->GetDef(ptr_type_id); if (ptr_type_inst->opcode() != spv::Op::OpTypePointer) { - return false; + return nullptr; } uint32_t var_type_id = ptr_type_inst->GetSingleWordInOperand(1); - Instruction* var_type_inst = context->get_def_use_mgr()->GetDef(var_type_id); - if (var_type_inst->opcode() != spv::Op::OpTypeArray && - var_type_inst->opcode() != spv::Op::OpTypeStruct) { - return false; + return context->get_def_use_mgr()->GetDef(var_type_id); +} + +} // namespace + +namespace descsroautil { + +bool IsDescriptorArray(IRContext* context, Instruction* var) { + Instruction* var_type_inst = GetVariableType(context, var); + if (var_type_inst == nullptr) return false; + return var_type_inst->opcode() == spv::Op::OpTypeArray && + HasDescriptorDecorations(context, var); +} + +bool IsDescriptorStruct(IRContext* context, Instruction* var) { + Instruction* var_type_inst = GetVariableType(context, var); + if (var_type_inst == nullptr) return false; + + while (var_type_inst->opcode() == spv::Op::OpTypeArray) { + var_type_inst = context->get_def_use_mgr()->GetDef( + var_type_inst->GetInOperand(0).AsId()); } + if (var_type_inst->opcode() != spv::Op::OpTypeStruct) return false; + // All structures with descriptor assignments must be replaced by variables, // one for each of their members - with the exceptions of buffers. if (IsTypeOfStructuredBuffer(context, var_type_inst)) { return false; } - if (!context->get_decoration_mgr()->HasDecoration( - var->result_id(), uint32_t(spv::Decoration::DescriptorSet))) { - return false; - } - - return context->get_decoration_mgr()->HasDecoration( - var->result_id(), uint32_t(spv::Decoration::Binding)); + return HasDescriptorDecorations(context, var); } bool IsTypeOfStructuredBuffer(IRContext* context, const Instruction* type) { diff --git a/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.h b/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.h index 2f45c0c2..04233565 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.h @@ -27,6 +27,10 @@ namespace descsroautil { // descriptor array. bool IsDescriptorArray(IRContext* context, Instruction* var); +// Returns true if |var| is an OpVariable instruction that represents a +// struct containing descriptors. +bool IsDescriptorStruct(IRContext* context, Instruction* var); + // Returns true if |type| is a type that could be used for a structured buffer // as opposed to a type that would be used for a structure of resource // descriptors. diff --git a/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp index 99711a16..e71032d4 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp @@ -92,16 +92,19 @@ void EliminateDeadOutputStoresPass::KillAllDeadStoresOfLocRef( }); // Compute offset and final type of reference. If no location found // or any stored locations are live, return without removing stores. - auto ptr_type = type_mgr->GetType(var->type_id())->AsPointer(); + + Instruction* ptr_type = get_def_use_mgr()->GetDef(var->type_id()); assert(ptr_type && "unexpected var type"); - auto var_type = ptr_type->pointee_type(); + const uint32_t kPointerTypePointeeIdx = 1; + uint32_t var_type_id = + ptr_type->GetSingleWordInOperand(kPointerTypePointeeIdx); uint32_t ref_loc = start_loc; - auto curr_type = var_type; if (ref->opcode() == spv::Op::OpAccessChain || ref->opcode() == spv::Op::OpInBoundsAccessChain) { - live_mgr->AnalyzeAccessChainLoc(ref, &curr_type, &ref_loc, &no_loc, - is_patch, /* input */ false); + var_type_id = live_mgr->AnalyzeAccessChainLoc( + ref, var_type_id, &ref_loc, &no_loc, is_patch, /* input */ false); } + const analysis::Type* curr_type = type_mgr->GetType(var_type_id); if (no_loc || AnyLocsAreLive(ref_loc, live_mgr->GetLocSize(curr_type))) return; // Kill all stores based on this reference diff --git a/bgfx/3rdparty/spirv-tools/source/opt/fix_storage_class.cpp b/bgfx/3rdparty/spirv-tools/source/opt/fix_storage_class.cpp index 5597e825..b64026e6 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/fix_storage_class.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/fix_storage_class.cpp @@ -141,22 +141,26 @@ bool FixStorageClass::IsPointerResultType(Instruction* inst) { if (inst->type_id() == 0) { return false; } - const analysis::Type* ret_type = - context()->get_type_mgr()->GetType(inst->type_id()); - return ret_type->AsPointer() != nullptr; + + Instruction* type_def = get_def_use_mgr()->GetDef(inst->type_id()); + return type_def->opcode() == spv::Op::OpTypePointer; } bool FixStorageClass::IsPointerToStorageClass(Instruction* inst, spv::StorageClass storage_class) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Type* pType = type_mgr->GetType(inst->type_id()); - const analysis::Pointer* result_type = pType->AsPointer(); + if (inst->type_id() == 0) { + return false; + } - if (result_type == nullptr) { + Instruction* type_def = get_def_use_mgr()->GetDef(inst->type_id()); + if (type_def->opcode() != spv::Op::OpTypePointer) { return false; } - return (result_type->storage_class() == storage_class); + const uint32_t kPointerTypeStorageClassIndex = 0; + spv::StorageClass pointer_storage_class = static_cast( + type_def->GetSingleWordInOperand(kPointerTypeStorageClassIndex)); + return pointer_storage_class == storage_class; } bool FixStorageClass::ChangeResultType(Instruction* inst, @@ -233,6 +237,9 @@ bool FixStorageClass::PropagateType(Instruction* inst, uint32_t type_id, } uint32_t copy_id = GenerateCopy(obj_inst, pointee_type_id, inst); + if (copy_id == 0) { + return false; + } inst->SetInOperand(1, {copy_id}); context()->UpdateDefUse(inst); } @@ -301,9 +308,11 @@ uint32_t FixStorageClass::WalkAccessChainType(Instruction* inst, uint32_t id) { break; } - Instruction* orig_type_inst = get_def_use_mgr()->GetDef(id); - assert(orig_type_inst->opcode() == spv::Op::OpTypePointer); - id = orig_type_inst->GetSingleWordInOperand(1); + Instruction* id_type_inst = get_def_use_mgr()->GetDef(id); + assert(id_type_inst->opcode() == spv::Op::OpTypePointer); + id = id_type_inst->GetSingleWordInOperand(1); + spv::StorageClass input_storage_class = + static_cast(id_type_inst->GetSingleWordInOperand(0)); for (uint32_t i = start_idx; i < inst->NumInOperands(); ++i) { Instruction* type_inst = get_def_use_mgr()->GetDef(id); @@ -312,13 +321,20 @@ uint32_t FixStorageClass::WalkAccessChainType(Instruction* inst, uint32_t id) { case spv::Op::OpTypeRuntimeArray: case spv::Op::OpTypeMatrix: case spv::Op::OpTypeVector: + case spv::Op::OpTypeCooperativeMatrixKHR: id = type_inst->GetSingleWordInOperand(0); break; case spv::Op::OpTypeStruct: { const analysis::Constant* index_const = context()->get_constant_mgr()->FindDeclaredConstant( inst->GetSingleWordInOperand(i)); - uint32_t index = index_const->GetU32(); + // It is highly unlikely that any type would have more fields than could + // be indexed by a 32-bit integer, and GetSingleWordInOperand only takes + // a 32-bit value, so we would not be able to handle it anyway. But the + // specification does allow any scalar integer type, treated as signed, + // so we simply downcast the index to 32-bits. + uint32_t index = + static_cast(index_const->GetSignExtendedValue()); id = type_inst->GetSingleWordInOperand(index); break; } @@ -329,9 +345,19 @@ uint32_t FixStorageClass::WalkAccessChainType(Instruction* inst, uint32_t id) { "Tried to extract from an object where it cannot be done."); } - return context()->get_type_mgr()->FindPointerToType( - id, static_cast( - orig_type_inst->GetSingleWordInOperand(0))); + Instruction* orig_type_inst = get_def_use_mgr()->GetDef(inst->type_id()); + spv::StorageClass orig_storage_class = + static_cast(orig_type_inst->GetSingleWordInOperand(0)); + assert(orig_type_inst->opcode() == spv::Op::OpTypePointer); + if (orig_type_inst->GetSingleWordInOperand(1) == id && + input_storage_class == orig_storage_class) { + // The existing type is correct. Avoid the search for the type. Note that if + // there is a duplicate type, the search below could return a different type + // forcing more changes to the code than necessary. + return inst->type_id(); + } + + return context()->get_type_mgr()->FindPointerToType(id, input_storage_class); } // namespace opt diff --git a/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp b/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp index c2a97b6e..942da683 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp @@ -70,58 +70,6 @@ uint32_t InstructionFolder::UnaryOperate(spv::Op opcode, uint32_t InstructionFolder::BinaryOperate(spv::Op opcode, uint32_t a, uint32_t b) const { switch (opcode) { - // Arthimetics - case spv::Op::OpIAdd: - return a + b; - case spv::Op::OpISub: - return a - b; - case spv::Op::OpIMul: - return a * b; - case spv::Op::OpUDiv: - if (b != 0) { - return a / b; - } else { - // Dividing by 0 is undefined, so we will just pick 0. - return 0; - } - case spv::Op::OpSDiv: - if (b != 0u) { - return (static_cast(a)) / (static_cast(b)); - } else { - // Dividing by 0 is undefined, so we will just pick 0. - return 0; - } - case spv::Op::OpSRem: { - // The sign of non-zero result comes from the first operand: a. This is - // guaranteed by C++11 rules for integer division operator. The division - // result is rounded toward zero, so the result of '%' has the sign of - // the first operand. - if (b != 0u) { - return static_cast(a) % static_cast(b); - } else { - // Remainder when dividing with 0 is undefined, so we will just pick 0. - return 0; - } - } - case spv::Op::OpSMod: { - // The sign of non-zero result comes from the second operand: b - if (b != 0u) { - int32_t rem = BinaryOperate(spv::Op::OpSRem, a, b); - int32_t b_prim = static_cast(b); - return (rem + b_prim) % b_prim; - } else { - // Mod with 0 is undefined, so we will just pick 0. - return 0; - } - } - case spv::Op::OpUMod: - if (b != 0u) { - return (a % b); - } else { - // Mod with 0 is undefined, so we will just pick 0. - return 0; - } - // Shifting case spv::Op::OpShiftRightLogical: if (b >= 32) { diff --git a/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp index f6d61554..ddfe59f7 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp @@ -115,20 +115,9 @@ bool FoldSpecConstantOpAndCompositePass::ProcessOpSpecConstantOp( "The first in-operand of OpSpecConstantOp instruction must be of " "SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER type"); - switch (static_cast(inst->GetSingleWordInOperand(0))) { - case spv::Op::OpCompositeExtract: - case spv::Op::OpVectorShuffle: - case spv::Op::OpCompositeInsert: - case spv::Op::OpQuantizeToF16: - folded_inst = FoldWithInstructionFolder(pos); - break; - default: - // TODO: This should use the instruction folder as well, but some folding - // rules are missing. - - // Component-wise operations. - folded_inst = DoComponentWiseOperation(pos); - break; + folded_inst = FoldWithInstructionFolder(pos); + if (!folded_inst) { + folded_inst = DoComponentWiseOperation(pos); } if (!folded_inst) return false; @@ -176,8 +165,9 @@ Instruction* FoldSpecConstantOpAndCompositePass::FoldWithInstructionFolder( Instruction* new_const_inst = context()->get_instruction_folder().FoldInstructionToConstant( inst.get(), identity_map); - assert(new_const_inst != nullptr && - "Failed to fold instruction that must be folded."); + + // new_const_inst == null indicates we cannot fold this spec constant + if (!new_const_inst) return nullptr; // Get the instruction before |pos| to insert after. |pos| cannot be the // first instruction in the list because its type has to come first. @@ -257,18 +247,7 @@ utils::SmallVector EncodeIntegerAsWords(const analysis::Type& type, // Truncate first_word if the |type| has width less than uint32. if (bit_width < bits_per_word) { - const uint32_t num_high_bits_to_mask = bits_per_word - bit_width; - const bool is_negative_after_truncation = - result_type_signed && - utils::IsBitAtPositionSet(first_word, bit_width - 1); - - if (is_negative_after_truncation) { - // Truncate and sign-extend |first_word|. No padding words will be - // added and |pad_value| can be left as-is. - first_word = utils::SetHighBits(first_word, num_high_bits_to_mask); - } else { - first_word = utils::ClearHighBits(first_word, num_high_bits_to_mask); - } + first_word = utils::SignExtendValue(first_word, bit_width); } utils::SmallVector words = {first_word}; diff --git a/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp b/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp index 293236d9..b1152f47 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp @@ -112,6 +112,12 @@ bool IsValidResult(T val) { } } +// Returns true if `type` is a cooperative matrix. +bool IsCooperativeMatrix(const analysis::Type* type) { + return type->kind() == analysis::Type::kCooperativeMatrixKHR || + type->kind() == analysis::Type::kCooperativeMatrixNV; +} + const analysis::Constant* ConstInput( const std::vector& constants) { return constants[0] ? constants[0] : constants[1]; @@ -180,8 +186,14 @@ std::vector GetWordsFromNumericScalarOrVectorConstant( const analysis::Constant* ConvertWordsToNumericScalarOrVectorConstant( analysis::ConstantManager* const_mgr, const std::vector& words, const analysis::Type* type) { - if (type->AsInteger() || type->AsFloat()) - return const_mgr->GetConstant(type, words); + const spvtools::opt::analysis::Integer* int_type = type->AsInteger(); + + if (int_type && int_type->width() <= 32) { + assert(words.size() == 1); + return const_mgr->GenerateIntegerConstant(int_type, words[0]); + } + + if (int_type || type->AsFloat()) return const_mgr->GetConstant(type, words); if (const auto* vec_type = type->AsVector()) return const_mgr->GetNumericVectorConstantWithWords(vec_type, words); return nullptr; @@ -307,6 +319,11 @@ FoldingRule ReciprocalFDiv() { analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + if (!inst->IsFloatingPointFoldingAllowed()) return false; uint32_t width = ElementWidth(type); @@ -388,6 +405,11 @@ FoldingRule MergeNegateMulDivArithmetic() { analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -400,36 +422,37 @@ FoldingRule MergeNegateMulDivArithmetic() { if (width != 32 && width != 64) return false; spv::Op opcode = op_inst->opcode(); - if (opcode == spv::Op::OpFMul || opcode == spv::Op::OpFDiv || - opcode == spv::Op::OpIMul || opcode == spv::Op::OpSDiv || - opcode == spv::Op::OpUDiv) { - std::vector op_constants = - const_mgr->GetOperandConstants(op_inst); - // Merge negate into mul or div if one operand is constant. - if (op_constants[0] || op_constants[1]) { - bool zero_is_variable = op_constants[0] == nullptr; - const analysis::Constant* c = ConstInput(op_constants); - uint32_t neg_id = NegateConstant(const_mgr, c); - uint32_t non_const_id = zero_is_variable - ? op_inst->GetSingleWordInOperand(0u) - : op_inst->GetSingleWordInOperand(1u); - // Change this instruction to a mul/div. - inst->SetOpcode(op_inst->opcode()); - if (opcode == spv::Op::OpFDiv || opcode == spv::Op::OpUDiv || - opcode == spv::Op::OpSDiv) { - uint32_t op0 = zero_is_variable ? non_const_id : neg_id; - uint32_t op1 = zero_is_variable ? neg_id : non_const_id; - inst->SetInOperands( - {{SPV_OPERAND_TYPE_ID, {op0}}, {SPV_OPERAND_TYPE_ID, {op1}}}); - } else { - inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {non_const_id}}, - {SPV_OPERAND_TYPE_ID, {neg_id}}}); - } - return true; - } + if (opcode != spv::Op::OpFMul && opcode != spv::Op::OpFDiv && + opcode != spv::Op::OpIMul && opcode != spv::Op::OpSDiv) { + return false; } - return false; + std::vector op_constants = + const_mgr->GetOperandConstants(op_inst); + // Merge negate into mul or div if one operand is constant. + if (op_constants[0] == nullptr && op_constants[1] == nullptr) { + return false; + } + + bool zero_is_variable = op_constants[0] == nullptr; + const analysis::Constant* c = ConstInput(op_constants); + uint32_t neg_id = NegateConstant(const_mgr, c); + uint32_t non_const_id = zero_is_variable + ? op_inst->GetSingleWordInOperand(0u) + : op_inst->GetSingleWordInOperand(1u); + // Change this instruction to a mul/div. + inst->SetOpcode(op_inst->opcode()); + if (opcode == spv::Op::OpFDiv || opcode == spv::Op::OpUDiv || + opcode == spv::Op::OpSDiv) { + uint32_t op0 = zero_is_variable ? non_const_id : neg_id; + uint32_t op1 = zero_is_variable ? neg_id : non_const_id; + inst->SetInOperands( + {{SPV_OPERAND_TYPE_ID, {op0}}, {SPV_OPERAND_TYPE_ID, {op1}}}); + } else { + inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {non_const_id}}, + {SPV_OPERAND_TYPE_ID, {neg_id}}}); + } + return true; }; } @@ -449,6 +472,11 @@ FoldingRule MergeNegateAddSubArithmetic() { analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -680,6 +708,11 @@ FoldingRule MergeMulMulArithmetic() { analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -734,6 +767,11 @@ FoldingRule MergeMulDivArithmetic() { const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + if (!inst->IsFloatingPointFoldingAllowed()) return false; uint32_t width = ElementWidth(type); @@ -807,6 +845,11 @@ FoldingRule MergeMulNegateArithmetic() { analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + bool uses_float = HasFloatingPoint(type); if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -847,6 +890,11 @@ FoldingRule MergeDivDivArithmetic() { analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + if (!inst->IsFloatingPointFoldingAllowed()) return false; uint32_t width = ElementWidth(type); @@ -920,6 +968,11 @@ FoldingRule MergeDivMulArithmetic() { const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + if (!inst->IsFloatingPointFoldingAllowed()) return false; uint32_t width = ElementWidth(type); @@ -1062,6 +1115,11 @@ FoldingRule MergeSubNegateArithmetic() { analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + bool uses_float = HasFloatingPoint(type); if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -1110,6 +1168,11 @@ FoldingRule MergeAddAddArithmetic() { inst->opcode() == spv::Op::OpIAdd); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); bool uses_float = HasFloatingPoint(type); if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -1158,6 +1221,11 @@ FoldingRule MergeAddSubArithmetic() { inst->opcode() == spv::Op::OpIAdd); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); bool uses_float = HasFloatingPoint(type); if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -1218,6 +1286,11 @@ FoldingRule MergeSubAddArithmetic() { inst->opcode() == spv::Op::OpISub); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); bool uses_float = HasFloatingPoint(type); if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -1284,6 +1357,11 @@ FoldingRule MergeSubSubArithmetic() { inst->opcode() == spv::Op::OpISub); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); bool uses_float = HasFloatingPoint(type); if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -1377,6 +1455,11 @@ FoldingRule MergeGenericAddSubArithmetic() { inst->opcode() == spv::Op::OpIAdd); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); + + if (IsCooperativeMatrix(type)) { + return false; + } + bool uses_float = HasFloatingPoint(type); if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false; @@ -1459,132 +1542,6 @@ FoldingRule FactorAddMuls() { }; } -// Replaces |inst| inplace with an FMA instruction |(x*y)+a|. -void ReplaceWithFma(Instruction* inst, uint32_t x, uint32_t y, uint32_t a) { - uint32_t ext = - inst->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450(); - - if (ext == 0) { - inst->context()->AddExtInstImport("GLSL.std.450"); - ext = inst->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450(); - assert(ext != 0 && - "Could not add the GLSL.std.450 extended instruction set"); - } - - std::vector operands; - operands.push_back({SPV_OPERAND_TYPE_ID, {ext}}); - operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {GLSLstd450Fma}}); - operands.push_back({SPV_OPERAND_TYPE_ID, {x}}); - operands.push_back({SPV_OPERAND_TYPE_ID, {y}}); - operands.push_back({SPV_OPERAND_TYPE_ID, {a}}); - - inst->SetOpcode(spv::Op::OpExtInst); - inst->SetInOperands(std::move(operands)); -} - -// Folds a multiple and add into an Fma. -// -// Cases: -// (x * y) + a = Fma x y a -// a + (x * y) = Fma x y a -bool MergeMulAddArithmetic(IRContext* context, Instruction* inst, - const std::vector&) { - assert(inst->opcode() == spv::Op::OpFAdd); - - if (!inst->IsFloatingPointFoldingAllowed()) { - return false; - } - - analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); - for (int i = 0; i < 2; i++) { - uint32_t op_id = inst->GetSingleWordInOperand(i); - Instruction* op_inst = def_use_mgr->GetDef(op_id); - - if (op_inst->opcode() != spv::Op::OpFMul) { - continue; - } - - if (!op_inst->IsFloatingPointFoldingAllowed()) { - continue; - } - - uint32_t x = op_inst->GetSingleWordInOperand(0); - uint32_t y = op_inst->GetSingleWordInOperand(1); - uint32_t a = inst->GetSingleWordInOperand((i + 1) % 2); - ReplaceWithFma(inst, x, y, a); - return true; - } - return false; -} - -// Replaces |sub| inplace with an FMA instruction |(x*y)+a| where |a| first gets -// negated if |negate_addition| is true, otherwise |x| gets negated. -void ReplaceWithFmaAndNegate(Instruction* sub, uint32_t x, uint32_t y, - uint32_t a, bool negate_addition) { - uint32_t ext = - sub->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450(); - - if (ext == 0) { - sub->context()->AddExtInstImport("GLSL.std.450"); - ext = sub->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450(); - assert(ext != 0 && - "Could not add the GLSL.std.450 extended instruction set"); - } - - InstructionBuilder ir_builder( - sub->context(), sub, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - - Instruction* neg = ir_builder.AddUnaryOp(sub->type_id(), spv::Op::OpFNegate, - negate_addition ? a : x); - uint32_t neg_op = neg->result_id(); // -a : -x - - std::vector operands; - operands.push_back({SPV_OPERAND_TYPE_ID, {ext}}); - operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {GLSLstd450Fma}}); - operands.push_back({SPV_OPERAND_TYPE_ID, {negate_addition ? x : neg_op}}); - operands.push_back({SPV_OPERAND_TYPE_ID, {y}}); - operands.push_back({SPV_OPERAND_TYPE_ID, {negate_addition ? neg_op : a}}); - - sub->SetOpcode(spv::Op::OpExtInst); - sub->SetInOperands(std::move(operands)); -} - -// Folds a multiply and subtract into an Fma and negation. -// -// Cases: -// (x * y) - a = Fma x y -a -// a - (x * y) = Fma -x y a -bool MergeMulSubArithmetic(IRContext* context, Instruction* sub, - const std::vector&) { - assert(sub->opcode() == spv::Op::OpFSub); - - if (!sub->IsFloatingPointFoldingAllowed()) { - return false; - } - - analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); - for (int i = 0; i < 2; i++) { - uint32_t op_id = sub->GetSingleWordInOperand(i); - Instruction* mul = def_use_mgr->GetDef(op_id); - - if (mul->opcode() != spv::Op::OpFMul) { - continue; - } - - if (!mul->IsFloatingPointFoldingAllowed()) { - continue; - } - - uint32_t x = mul->GetSingleWordInOperand(0); - uint32_t y = mul->GetSingleWordInOperand(1); - uint32_t a = sub->GetSingleWordInOperand((i + 1) % 2); - ReplaceWithFmaAndNegate(sub, x, y, a, i == 0); - return true; - } - return false; -} - FoldingRule IntMultipleBy1() { return [](IRContext*, Instruction* inst, const std::vector& constants) { @@ -1733,27 +1690,26 @@ bool CompositeConstructFeedingExtract( } // Walks the indexes chain from |start| to |end| of an OpCompositeInsert or -// OpCompositeExtract instruction, and returns the type of the final element -// being accessed. -const analysis::Type* GetElementType(uint32_t type_id, - Instruction::iterator start, - Instruction::iterator end, - const analysis::TypeManager* type_mgr) { - const analysis::Type* type = type_mgr->GetType(type_id); +// OpCompositeExtract instruction, and returns the type id of the final element +// being accessed. Returns 0 if a valid type could not be found. +uint32_t GetElementType(uint32_t type_id, Instruction::iterator start, + Instruction::iterator end, + const analysis::DefUseManager* def_use_manager) { for (auto index : make_range(std::move(start), std::move(end))) { + const Instruction* type_inst = def_use_manager->GetDef(type_id); assert(index.type == SPV_OPERAND_TYPE_LITERAL_INTEGER && index.words.size() == 1); - if (auto* array_type = type->AsArray()) { - type = array_type->element_type(); - } else if (auto* matrix_type = type->AsMatrix()) { - type = matrix_type->element_type(); - } else if (auto* struct_type = type->AsStruct()) { - type = struct_type->element_types()[index.words[0]]; + if (type_inst->opcode() == spv::Op::OpTypeArray) { + type_id = type_inst->GetSingleWordInOperand(0); + } else if (type_inst->opcode() == spv::Op::OpTypeMatrix) { + type_id = type_inst->GetSingleWordInOperand(0); + } else if (type_inst->opcode() == spv::Op::OpTypeStruct) { + type_id = type_inst->GetSingleWordInOperand(index.words[0]); } else { - type = nullptr; + return 0; } } - return type; + return type_id; } // Returns true of |inst_1| and |inst_2| have the same indexes that will be used @@ -1838,16 +1794,11 @@ bool CompositeExtractFeedingConstruct( // The last check it to see that the object being extracted from is the // correct type. Instruction* original_inst = def_use_mgr->GetDef(original_id); - analysis::TypeManager* type_mgr = context->get_type_mgr(); - const analysis::Type* original_type = + uint32_t original_type_id = GetElementType(original_inst->type_id(), first_element_inst->begin() + 3, - first_element_inst->end() - 1, type_mgr); - - if (original_type == nullptr) { - return false; - } + first_element_inst->end() - 1, def_use_mgr); - if (inst->type_id() != type_mgr->GetId(original_type)) { + if (inst->type_id() != original_type_id) { return false; } @@ -2067,7 +2018,8 @@ FoldingRule FMixFeedingExtract() { } // Returns the number of elements in the composite type |type|. Returns 0 if -// |type| is a scalar value. +// |type| is a scalar value. Return UINT32_MAX when the size is unknown at +// compile time. uint32_t GetNumberOfElements(const analysis::Type* type) { if (auto* vector_type = type->AsVector()) { return vector_type->element_count(); @@ -2079,21 +2031,27 @@ uint32_t GetNumberOfElements(const analysis::Type* type) { return static_cast(struct_type->element_types().size()); } if (auto* array_type = type->AsArray()) { - return array_type->length_info().words[0]; + if (array_type->length_info().words[0] == + analysis::Array::LengthInfo::kConstant && + array_type->length_info().words.size() == 2) { + return array_type->length_info().words[1]; + } + return UINT32_MAX; } return 0; } // Returns a map with the set of values that were inserted into an object by // the chain of OpCompositeInsertInstruction starting with |inst|. -// The map will map the index to the value inserted at that index. +// The map will map the index to the value inserted at that index. An empty map +// will be returned if the map could not be properly generated. std::map GetInsertedValues(Instruction* inst) { analysis::DefUseManager* def_use_mgr = inst->context()->get_def_use_mgr(); std::map values_inserted; Instruction* current_inst = inst; while (current_inst->opcode() == spv::Op::OpCompositeInsert) { if (current_inst->NumInOperands() > inst->NumInOperands()) { - // This is the catch the case + // This is to catch the case // %2 = OpCompositeInsert %m2x2int %v2int_1_0 %m2x2int_undef 0 // %3 = OpCompositeInsert %m2x2int %int_4 %2 0 0 // %4 = OpCompositeInsert %m2x2int %v2int_2_3 %3 1 @@ -2130,13 +2088,15 @@ bool DoInsertedValuesCoverEntireObject( return true; } -// Returns the type of the element that immediately contains the element being -// inserted by the OpCompositeInsert instruction |inst|. -const analysis::Type* GetContainerType(Instruction* inst) { +// Returns id of the type of the element that immediately contains the element +// being inserted by the OpCompositeInsert instruction |inst|. Returns 0 if it +// could not be found. +uint32_t GetContainerTypeId(Instruction* inst) { assert(inst->opcode() == spv::Op::OpCompositeInsert); - analysis::TypeManager* type_mgr = inst->context()->get_type_mgr(); - return GetElementType(inst->type_id(), inst->begin() + 4, inst->end() - 1, - type_mgr); + analysis::DefUseManager* def_use_manager = inst->context()->get_def_use_mgr(); + uint32_t container_type_id = GetElementType( + inst->type_id(), inst->begin() + 4, inst->end() - 1, def_use_manager); + return container_type_id; } // Returns an OpCompositeConstruct instruction that build an object with @@ -2183,18 +2143,20 @@ bool CompositeInsertToCompositeConstruct( if (inst->NumInOperands() < 3) return false; std::map values_inserted = GetInsertedValues(inst); - const analysis::Type* container_type = GetContainerType(inst); - if (container_type == nullptr) { + uint32_t container_type_id = GetContainerTypeId(inst); + if (container_type_id == 0) { return false; } + analysis::TypeManager* type_mgr = context->get_type_mgr(); + const analysis::Type* container_type = type_mgr->GetType(container_type_id); + assert(container_type && "GetContainerTypeId returned a bad id."); if (!DoInsertedValuesCoverEntireObject(container_type, values_inserted)) { return false; } - analysis::TypeManager* type_mgr = context->get_type_mgr(); - Instruction* construct = BuildCompositeConstruct( - type_mgr->GetId(container_type), values_inserted, inst); + Instruction* construct = + BuildCompositeConstruct(container_type_id, values_inserted, inst); InsertConstructedObject(inst, construct); return true; } @@ -2934,7 +2896,6 @@ void FoldingRules::AddFoldingRules() { rules_[spv::Op::OpFAdd].push_back(MergeAddSubArithmetic()); rules_[spv::Op::OpFAdd].push_back(MergeGenericAddSubArithmetic()); rules_[spv::Op::OpFAdd].push_back(FactorAddMuls()); - rules_[spv::Op::OpFAdd].push_back(MergeMulAddArithmetic); rules_[spv::Op::OpFDiv].push_back(RedundantFDiv()); rules_[spv::Op::OpFDiv].push_back(ReciprocalFDiv()); @@ -2955,7 +2916,6 @@ void FoldingRules::AddFoldingRules() { rules_[spv::Op::OpFSub].push_back(MergeSubNegateArithmetic()); rules_[spv::Op::OpFSub].push_back(MergeSubAddArithmetic()); rules_[spv::Op::OpFSub].push_back(MergeSubSubArithmetic()); - rules_[spv::Op::OpFSub].push_back(MergeMulSubArithmetic); rules_[spv::Op::OpIAdd].push_back(RedundantIAdd()); rules_[spv::Op::OpIAdd].push_back(MergeAddNegateArithmetic()); diff --git a/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.cpp index 3f160b24..31864334 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.cpp @@ -213,6 +213,19 @@ uint32_t InlinePass::CreateReturnVar( {(uint32_t)spv::StorageClass::Function}}})); new_vars->push_back(std::move(var_inst)); get_decoration_mgr()->CloneDecorations(calleeFn->result_id(), returnVarId); + + // Decorate the return var with AliasedPointer if the storage class of the + // pointee type is PhysicalStorageBuffer. + auto const pointee_type = + type_mgr->GetType(returnVarTypeId)->AsPointer()->pointee_type(); + if (pointee_type->AsPointer() != nullptr) { + if (pointee_type->AsPointer()->storage_class() == + spv::StorageClass::PhysicalStorageBuffer) { + get_decoration_mgr()->AddDecoration( + returnVarId, uint32_t(spv::Decoration::AliasedPointer)); + } + } + return returnVarId; } diff --git a/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp deleted file mode 100644 index 339fb1b6..00000000 --- a/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp +++ /dev/null @@ -1,1332 +0,0 @@ -// Copyright (c) 2018 The Khronos Group Inc. -// Copyright (c) 2018 Valve Corporation -// Copyright (c) 2018 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "inst_bindless_check_pass.h" - -#include "source/spirv_constant.h" - -namespace spvtools { -namespace opt { -namespace { -// Input Operand Indices -constexpr int kSpvImageSampleImageIdInIdx = 0; -constexpr int kSpvSampledImageImageIdInIdx = 0; -constexpr int kSpvSampledImageSamplerIdInIdx = 1; -constexpr int kSpvImageSampledImageIdInIdx = 0; -constexpr int kSpvCopyObjectOperandIdInIdx = 0; -constexpr int kSpvLoadPtrIdInIdx = 0; -constexpr int kSpvAccessChainBaseIdInIdx = 0; -constexpr int kSpvAccessChainIndex0IdInIdx = 1; -constexpr int kSpvTypeArrayTypeIdInIdx = 0; -constexpr int kSpvVariableStorageClassInIdx = 0; -constexpr int kSpvTypePtrTypeIdInIdx = 1; -constexpr int kSpvTypeImageDim = 1; -constexpr int kSpvTypeImageDepth = 2; -constexpr int kSpvTypeImageArrayed = 3; -constexpr int kSpvTypeImageMS = 4; -} // namespace - -void InstBindlessCheckPass::SetupInputBufferIds() { - if (input_buffer_id_ != 0) { - return; - } - AddStorageBufferExt(); - if (!get_feature_mgr()->HasExtension(kSPV_KHR_physical_storage_buffer)) { - context()->AddExtension("SPV_KHR_physical_storage_buffer"); - } - context()->AddCapability(spv::Capability::PhysicalStorageBufferAddresses); - Instruction* memory_model = get_module()->GetMemoryModel(); - // TODO should this be just Physical64? - memory_model->SetInOperand( - 0u, {uint32_t(spv::AddressingModel::PhysicalStorageBuffer64)}); - - analysis::DecorationManager* deco_mgr = get_decoration_mgr(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - constexpr uint32_t width = 32u; - - // declare the DescriptorSetData struct - analysis::Struct* desc_set_struct = - GetStruct({type_mgr->GetUIntType(), GetUintRuntimeArrayType(width)}); - desc_set_type_id_ = type_mgr->GetTypeInstruction(desc_set_struct); - // By the Vulkan spec, a pre-existing struct containing a RuntimeArray - // must be a block, and will therefore be decorated with Block. Therefore - // the undecorated type returned here will not be pre-existing and can - // safely be decorated. Since this type is now decorated, it is out of - // sync with the TypeManager and therefore the TypeManager must be - // invalidated after this pass. - assert(context()->get_def_use_mgr()->NumUses(desc_set_type_id_) == 0 && - "used struct type returned"); - deco_mgr->AddDecoration(desc_set_type_id_, uint32_t(spv::Decoration::Block)); - deco_mgr->AddMemberDecoration(desc_set_type_id_, 0, - uint32_t(spv::Decoration::Offset), 0); - deco_mgr->AddMemberDecoration(desc_set_type_id_, 1, - uint32_t(spv::Decoration::Offset), 4); - context()->AddDebug2Inst( - NewGlobalName(desc_set_type_id_, "DescriptorSetData")); - context()->AddDebug2Inst(NewMemberName(desc_set_type_id_, 0, "num_bindings")); - context()->AddDebug2Inst(NewMemberName(desc_set_type_id_, 1, "data")); - - // declare buffer address reference to DescriptorSetData - desc_set_ptr_id_ = type_mgr->FindPointerToType( - desc_set_type_id_, spv::StorageClass::PhysicalStorageBuffer); - // runtime array of buffer addresses - analysis::Type* rarr_ty = GetArray(type_mgr->GetType(desc_set_ptr_id_), - kDebugInputBindlessMaxDescSets); - deco_mgr->AddDecorationVal(type_mgr->GetId(rarr_ty), - uint32_t(spv::Decoration::ArrayStride), 8u); - - // declare the InputBuffer type, a struct wrapper around the runtime array - analysis::Struct* input_buffer_struct = GetStruct({rarr_ty}); - input_buffer_struct_id_ = type_mgr->GetTypeInstruction(input_buffer_struct); - deco_mgr->AddDecoration(input_buffer_struct_id_, - uint32_t(spv::Decoration::Block)); - deco_mgr->AddMemberDecoration(input_buffer_struct_id_, 0, - uint32_t(spv::Decoration::Offset), 0); - context()->AddDebug2Inst( - NewGlobalName(input_buffer_struct_id_, "InputBuffer")); - context()->AddDebug2Inst( - NewMemberName(input_buffer_struct_id_, 0, "desc_sets")); - - input_buffer_ptr_id_ = type_mgr->FindPointerToType( - input_buffer_struct_id_, spv::StorageClass::StorageBuffer); - - // declare the input_buffer global variable - input_buffer_id_ = TakeNextId(); - - const std::vector var_operands = { - {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {uint32_t(spv::StorageClass::StorageBuffer)}}, - }; - auto new_var_op = spvtools::MakeUnique( - context(), spv::Op::OpVariable, input_buffer_ptr_id_, input_buffer_id_, - var_operands); - - context()->AddGlobalValue(std::move(new_var_op)); - context()->AddDebug2Inst(NewGlobalName(input_buffer_id_, "input_buffer")); - deco_mgr->AddDecorationVal( - input_buffer_id_, uint32_t(spv::Decoration::DescriptorSet), desc_set_); - deco_mgr->AddDecorationVal(input_buffer_id_, - uint32_t(spv::Decoration::Binding), - GetInputBufferBinding()); - if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { - // Add the new buffer to all entry points. - for (auto& entry : get_module()->entry_points()) { - entry.AddOperand({SPV_OPERAND_TYPE_ID, {input_buffer_id_}}); - context()->AnalyzeUses(&entry); - } - } -} - -// clang-format off -// GLSL: -//bool inst_bindless_check_desc(uint shader_id, uint inst_num, uvec4 stage_info, uint desc_set, uint binding, uint desc_index, -// uint byte_offset) -//{ -// uint error = 0u; -// uint param5 = 0u; -// uint param6 = 0u; -// uint num_bindings = 0u; -// uint init_state = 0u; -// if (desc_set >= 32u) { -// error = 1u; -// } -// inst_bindless_DescriptorSetData set_data; -// if (error == 0u) { -// set_data = inst_bindless_input_buffer.desc_sets[desc_set]; -// uvec2 ptr_vec = uvec2(set_data); -// if ((ptr_vec.x == 0u) && (ptr_vec.y == 0u)) { -// error = 1u; -// } -// } -// if (error == 0u) { -// num_bindings = set_data.num_bindings; -// if (binding >= num_bindings) { -// error = 1u; -// } -// } -// if (error == 0u) { -// if (desc_index >= set_data.data[binding]) { -// error = 1u; -// param5 = set_data.data[binding]; -// } -// } -// if (0u == error) { -// uint state_index = set_data.data[num_bindings + binding] + desc_index; -// init_state = set_data.data[state_index]; -// if (init_state == 0u) { -// error = 2u; -// } -// } -// if (error == 0u) { -// if (byte_offset >= init_state) { -// error = 4u; -// param5 = byte_offset; -// param6 = init_state; -// } -// } -// if (0u != error) { -// inst_bindless_stream_write_6(shader_id, inst_num, stage_info, error, desc_set, binding, desc_index, param5, param6); -// return false; -// } -// return true; -//} -// clang-format on -uint32_t InstBindlessCheckPass::GenDescCheckFunctionId() { - enum { - kShaderId = 0, - kInstructionIndex = 1, - kStageInfo = 2, - kDescSet = 3, - kDescBinding = 4, - kDescIndex = 5, - kByteOffset = 6, - kNumArgs - }; - if (desc_check_func_id_ != 0) { - return desc_check_func_id_; - } - - SetupInputBufferIds(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - const analysis::Integer* uint_type = GetInteger(32, false); - const analysis::Vector v4uint(uint_type, 4); - const analysis::Type* v4uint_type = type_mgr->GetRegisteredType(&v4uint); - std::vector param_types(kNumArgs, uint_type); - param_types[2] = v4uint_type; - - const uint32_t func_id = TakeNextId(); - std::unique_ptr func = - StartFunction(func_id, type_mgr->GetBoolType(), param_types); - - const std::vector param_ids = AddParameters(*func, param_types); - - const uint32_t func_uint_ptr = - type_mgr->FindPointerToType(GetUintId(), spv::StorageClass::Function); - // Create block - auto new_blk_ptr = MakeUnique(NewLabel(TakeNextId())); - InstructionBuilder builder( - context(), new_blk_ptr.get(), - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - Instruction* inst; - const uint32_t zero_id = builder.GetUintConstantId(0); - const uint32_t false_id = builder.GetBoolConstantId(false); - const uint32_t true_id = builder.GetBoolConstantId(true); - const uint32_t uint_ptr = type_mgr->FindPointerToType( - GetUintId(), spv::StorageClass::PhysicalStorageBuffer); - - inst = builder.AddBinaryOp(func_uint_ptr, spv::Op::OpVariable, - uint32_t(spv::StorageClass::Function), zero_id); - const uint32_t error_var = inst->result_id(); - - inst = builder.AddBinaryOp(func_uint_ptr, spv::Op::OpVariable, - uint32_t(spv::StorageClass::Function), zero_id); - const uint32_t param5_var = inst->result_id(); - - inst = builder.AddBinaryOp(func_uint_ptr, spv::Op::OpVariable, - uint32_t(spv::StorageClass::Function), zero_id); - const uint32_t param6_var = inst->result_id(); - - inst = builder.AddBinaryOp(func_uint_ptr, spv::Op::OpVariable, - uint32_t(spv::StorageClass::Function), zero_id); - const uint32_t num_bindings_var = inst->result_id(); - inst = builder.AddBinaryOp(func_uint_ptr, spv::Op::OpVariable, - uint32_t(spv::StorageClass::Function), zero_id); - const uint32_t init_status_var = inst->result_id(); - - const uint32_t desc_set_ptr_ptr = type_mgr->FindPointerToType( - desc_set_ptr_id_, spv::StorageClass::Function); - - inst = builder.AddUnaryOp(desc_set_ptr_ptr, spv::Op::OpVariable, - uint32_t(spv::StorageClass::Function)); - const uint32_t desc_set_ptr_var = inst->result_id(); - get_decoration_mgr()->AddDecoration( - desc_set_ptr_var, uint32_t(spv::Decoration::AliasedPointer)); - - uint32_t check_label_id = TakeNextId(); - auto check_label = NewLabel(check_label_id); - uint32_t skip_label_id = TakeNextId(); - auto skip_label = NewLabel(skip_label_id); - inst = builder.AddBinaryOp( - GetBoolId(), spv::Op::OpUGreaterThanEqual, param_ids[kDescSet], - builder.GetUintConstantId(kDebugInputBindlessMaxDescSets)); - const uint32_t desc_cmp_id = inst->result_id(); - - (void)builder.AddConditionalBranch(desc_cmp_id, check_label_id, skip_label_id, - skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - // set error - new_blk_ptr = MakeUnique(std::move(check_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddStore(error_var, - builder.GetUintConstantId(kInstErrorBindlessBounds)); - builder.AddBranch(skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - // check descriptor set table entry is non-null - new_blk_ptr = MakeUnique(std::move(skip_label)); - builder.SetInsertPoint(&*new_blk_ptr); - - check_label_id = TakeNextId(); - check_label = NewLabel(check_label_id); - skip_label_id = TakeNextId(); - skip_label = NewLabel(skip_label_id); - inst = builder.AddLoad(GetUintId(), error_var); - uint32_t error_val_id = inst->result_id(); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, error_val_id, - zero_id); - uint32_t no_error_id = inst->result_id(); - (void)builder.AddConditionalBranch(no_error_id, check_label_id, skip_label_id, - skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - new_blk_ptr = MakeUnique(std::move(check_label)); - builder.SetInsertPoint(&*new_blk_ptr); - - { - const uint32_t desc_set_ptr_ptr_sb = type_mgr->FindPointerToType( - desc_set_ptr_id_, spv::StorageClass::StorageBuffer); - - inst = builder.AddAccessChain(desc_set_ptr_ptr_sb, input_buffer_id_, - {zero_id, param_ids[kDescSet]}); - const uint32_t set_access_chain_id = inst->result_id(); - - inst = builder.AddLoad(desc_set_ptr_id_, set_access_chain_id); - const uint32_t desc_set_ptr_id = inst->result_id(); - - builder.AddStore(desc_set_ptr_var, desc_set_ptr_id); - - inst = builder.AddUnaryOp(GetVecUintId(2), spv::Op::OpBitcast, - desc_set_ptr_id); - const uint32_t ptr_as_uvec_id = inst->result_id(); - - inst = builder.AddCompositeExtract(GetUintId(), ptr_as_uvec_id, {0}); - const uint32_t uvec_x = inst->result_id(); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, uvec_x, zero_id); - const uint32_t x_is_zero_id = inst->result_id(); - - inst = builder.AddCompositeExtract(GetUintId(), ptr_as_uvec_id, {1}); - const uint32_t uvec_y = inst->result_id(); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, uvec_y, zero_id); - const uint32_t y_is_zero_id = inst->result_id(); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpLogicalAnd, x_is_zero_id, - y_is_zero_id); - const uint32_t is_null_id = inst->result_id(); - - const uint32_t error_label_id = TakeNextId(); - auto error_label = NewLabel(error_label_id); - const uint32_t merge_label_id = TakeNextId(); - auto merge_label = NewLabel(merge_label_id); - (void)builder.AddConditionalBranch(is_null_id, error_label_id, - merge_label_id, merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - // set error - new_blk_ptr = MakeUnique(std::move(error_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddStore(error_var, - builder.GetUintConstantId(kInstErrorBindlessBounds)); - builder.AddBranch(merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - new_blk_ptr = MakeUnique(std::move(merge_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddBranch(skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - } - - new_blk_ptr = MakeUnique(std::move(skip_label)); - builder.SetInsertPoint(&*new_blk_ptr); - - check_label_id = TakeNextId(); - check_label = NewLabel(check_label_id); - skip_label_id = TakeNextId(); - skip_label = NewLabel(skip_label_id); - - inst = builder.AddLoad(GetUintId(), error_var); - error_val_id = inst->result_id(); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, error_val_id, - zero_id); - no_error_id = inst->result_id(); - (void)builder.AddConditionalBranch(no_error_id, check_label_id, skip_label_id, - skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - // check binding is in range - new_blk_ptr = MakeUnique(std::move(check_label)); - builder.SetInsertPoint(&*new_blk_ptr); - { - inst = builder.AddLoad(desc_set_ptr_id_, desc_set_ptr_var); - const uint32_t desc_set_ptr_id = inst->result_id(); - - inst = builder.AddAccessChain(uint_ptr, desc_set_ptr_id, {zero_id}); - const uint32_t binding_access_chain_id = inst->result_id(); - - inst = builder.AddLoad(GetUintId(), binding_access_chain_id, 8); - const uint32_t num_bindings_id = inst->result_id(); - - builder.AddStore(num_bindings_var, num_bindings_id); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpUGreaterThanEqual, - param_ids[kDescBinding], num_bindings_id); - const uint32_t bindings_cmp_id = inst->result_id(); - - const uint32_t error_label_id = TakeNextId(); - auto error_label = NewLabel(error_label_id); - const uint32_t merge_label_id = TakeNextId(); - auto merge_label = NewLabel(merge_label_id); - (void)builder.AddConditionalBranch(bindings_cmp_id, error_label_id, - merge_label_id, merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - // set error - new_blk_ptr = MakeUnique(std::move(error_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddStore(error_var, - builder.GetUintConstantId(kInstErrorBindlessBounds)); - builder.AddBranch(merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - new_blk_ptr = MakeUnique(std::move(merge_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddBranch(skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - } - - // read binding length - new_blk_ptr = MakeUnique(std::move(skip_label)); - builder.SetInsertPoint(&*new_blk_ptr); - - check_label_id = TakeNextId(); - check_label = NewLabel(check_label_id); - skip_label_id = TakeNextId(); - skip_label = NewLabel(skip_label_id); - - inst = builder.AddLoad(GetUintId(), error_var); - error_val_id = inst->result_id(); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, error_val_id, - zero_id); - no_error_id = inst->result_id(); - (void)builder.AddConditionalBranch(no_error_id, check_label_id, skip_label_id, - skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - new_blk_ptr = MakeUnique(std::move(check_label)); - builder.SetInsertPoint(&*new_blk_ptr); - { - inst = builder.AddLoad(desc_set_ptr_id_, desc_set_ptr_var); - const uint32_t desc_set_ptr_id = inst->result_id(); - - inst = builder.AddAccessChain( - uint_ptr, desc_set_ptr_id, - {{builder.GetUintConstantId(1), param_ids[kDescBinding]}}); - const uint32_t length_ac_id = inst->result_id(); - - inst = builder.AddLoad(GetUintId(), length_ac_id, sizeof(uint32_t)); - const uint32_t length_id = inst->result_id(); - - // Check descriptor index in bounds - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpUGreaterThanEqual, - param_ids[kDescIndex], length_id); - const uint32_t desc_idx_range_id = inst->result_id(); - - const uint32_t error_label_id = TakeNextId(); - auto error_label = NewLabel(error_label_id); - const uint32_t merge_label_id = TakeNextId(); - auto merge_label = NewLabel(merge_label_id); - (void)builder.AddConditionalBranch(desc_idx_range_id, error_label_id, - merge_label_id, merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - // set error - new_blk_ptr = MakeUnique(std::move(error_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddStore(error_var, - builder.GetUintConstantId(kInstErrorBindlessBounds)); - builder.AddStore(param5_var, length_id); - builder.AddBranch(merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - new_blk_ptr = MakeUnique(std::move(merge_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddBranch(skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - } - - new_blk_ptr = MakeUnique(std::move(skip_label)); - builder.SetInsertPoint(&*new_blk_ptr); - inst = builder.AddLoad(GetUintId(), error_var); - error_val_id = inst->result_id(); - - check_label_id = TakeNextId(); - check_label = NewLabel(check_label_id); - skip_label_id = TakeNextId(); - skip_label = NewLabel(skip_label_id); - - inst = builder.AddLoad(GetUintId(), error_var); - error_val_id = inst->result_id(); - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, zero_id, - error_val_id); - no_error_id = inst->result_id(); - - (void)builder.AddConditionalBranch(no_error_id, check_label_id, skip_label_id, - skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - // Read descriptor init status - new_blk_ptr = MakeUnique(std::move(check_label)); - builder.SetInsertPoint(&*new_blk_ptr); - { - inst = builder.AddLoad(desc_set_ptr_id_, desc_set_ptr_var); - const uint32_t desc_set_ptr_id = inst->result_id(); - - inst = builder.AddLoad(GetUintId(), num_bindings_var); - const uint32_t num_bindings_id = inst->result_id(); - - inst = - builder.AddIAdd(GetUintId(), num_bindings_id, param_ids[kDescBinding]); - const uint32_t state_offset_id = inst->result_id(); - - inst = builder.AddAccessChain( - uint_ptr, desc_set_ptr_id, - {{builder.GetUintConstantId(1), state_offset_id}}); - const uint32_t state_start_ac_id = inst->result_id(); - - inst = builder.AddLoad(GetUintId(), state_start_ac_id, sizeof(uint32_t)); - const uint32_t state_start_id = inst->result_id(); - - inst = builder.AddIAdd(GetUintId(), state_start_id, param_ids[kDescIndex]); - const uint32_t state_entry_id = inst->result_id(); - - // Note: length starts from the beginning of the buffer, not the beginning - // of the data array - inst = builder.AddAccessChain( - uint_ptr, desc_set_ptr_id, - {{builder.GetUintConstantId(1), state_entry_id}}); - const uint32_t init_ac_id = inst->result_id(); - - inst = builder.AddLoad(GetUintId(), init_ac_id, sizeof(uint32_t)); - const uint32_t init_status_id = inst->result_id(); - - builder.AddStore(init_status_var, init_status_id); - - // Check for uninitialized descriptor - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, init_status_id, - zero_id); - const uint32_t uninit_check_id = inst->result_id(); - const uint32_t error_label_id = TakeNextId(); - auto error_label = NewLabel(error_label_id); - const uint32_t merge_label_id = TakeNextId(); - auto merge_label = NewLabel(merge_label_id); - (void)builder.AddConditionalBranch(uninit_check_id, error_label_id, - merge_label_id, merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - new_blk_ptr = MakeUnique(std::move(error_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddStore(error_var, - builder.GetUintConstantId(kInstErrorBindlessUninit)); - builder.AddBranch(merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - new_blk_ptr = MakeUnique(std::move(merge_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddBranch(skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - } - - // Check for OOB. - new_blk_ptr = MakeUnique(std::move(skip_label)); - builder.SetInsertPoint(&*new_blk_ptr); - - check_label_id = TakeNextId(); - check_label = NewLabel(check_label_id); - skip_label_id = TakeNextId(); - skip_label = NewLabel(skip_label_id); - - inst = builder.AddLoad(GetUintId(), error_var); - error_val_id = inst->result_id(); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, error_val_id, - zero_id); - no_error_id = inst->result_id(); - (void)builder.AddConditionalBranch(no_error_id, check_label_id, skip_label_id, - skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - new_blk_ptr = MakeUnique(std::move(check_label)); - builder.SetInsertPoint(&*new_blk_ptr); - { - inst = builder.AddLoad(GetUintId(), init_status_var); - const uint32_t init_status_id = inst->result_id(); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpUGreaterThanEqual, - param_ids[kByteOffset], init_status_id); - const uint32_t buf_offset_range_id = inst->result_id(); - - const uint32_t error_label_id = TakeNextId(); - const uint32_t merge_label_id = TakeNextId(); - auto error_label = NewLabel(error_label_id); - auto merge_label = NewLabel(merge_label_id); - (void)builder.AddConditionalBranch(buf_offset_range_id, error_label_id, - merge_label_id, merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - // set error - new_blk_ptr = MakeUnique(std::move(error_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddStore(error_var, builder.GetUintConstantId(kInstErrorOOB)); - builder.AddStore(param5_var, param_ids[kByteOffset]); - builder.AddStore(param6_var, init_status_id); - builder.AddBranch(merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - new_blk_ptr = MakeUnique(std::move(merge_label)); - builder.SetInsertPoint(&*new_blk_ptr); - builder.AddBranch(skip_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - } - - // check for error - new_blk_ptr = MakeUnique(std::move(skip_label)); - builder.SetInsertPoint(&*new_blk_ptr); - inst = builder.AddLoad(GetUintId(), error_var); - error_val_id = inst->result_id(); - - inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpINotEqual, zero_id, - error_val_id); - const uint32_t is_error_id = inst->result_id(); - - const uint32_t error_label_id = TakeNextId(); - auto error_label = NewLabel(error_label_id); - const uint32_t merge_label_id = TakeNextId(); - auto merge_label = NewLabel(merge_label_id); - (void)builder.AddConditionalBranch(is_error_id, error_label_id, - merge_label_id, merge_label_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - new_blk_ptr = MakeUnique(std::move(error_label)); - builder.SetInsertPoint(&*new_blk_ptr); - - // error output - inst = builder.AddLoad(GetUintId(), param5_var); - const uint32_t param5_val_id = inst->result_id(); - - inst = builder.AddLoad(GetUintId(), param6_var); - const uint32_t param6_val_id = inst->result_id(); - - GenDebugStreamWrite( - param_ids[kShaderId], param_ids[kInstructionIndex], param_ids[kStageInfo], - {error_val_id, param_ids[kDescSet], param_ids[kDescBinding], - param_ids[kDescIndex], param5_val_id, param6_val_id}, - &builder); - (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, false_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - // Success return - new_blk_ptr = MakeUnique(std::move(merge_label)); - builder.SetInsertPoint(&*new_blk_ptr); - (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, true_id); - func->AddBasicBlock(std::move(new_blk_ptr)); - - func->SetFunctionEnd(EndFunction()); - - context()->AddFunction(std::move(func)); - context()->AddDebug2Inst(NewGlobalName(func_id, "desc_check")); - - desc_check_func_id_ = func_id; - // Make sure function doesn't get processed by - // InstrumentPass::InstProcessCallTreeFromRoots() - param2output_func_id_[3] = func_id; - return desc_check_func_id_; -} - -// clang-format off -// GLSL: -// result = inst_bindless_desc_check(shader_id, inst_idx, stage_info, desc_set, binding, desc_idx, offset); -// -// clang-format on -uint32_t InstBindlessCheckPass::GenDescCheckCall( - uint32_t inst_idx, uint32_t stage_idx, uint32_t var_id, - uint32_t desc_idx_id, uint32_t offset_id, InstructionBuilder* builder) { - const uint32_t func_id = GenDescCheckFunctionId(); - const std::vector args = { - builder->GetUintConstantId(shader_id_), - builder->GetUintConstantId(inst_idx), - GenStageInfo(stage_idx, builder), - builder->GetUintConstantId(var2desc_set_[var_id]), - builder->GetUintConstantId(var2binding_[var_id]), - GenUintCastCode(desc_idx_id, builder), - offset_id}; - return GenReadFunctionCall(GetBoolId(), func_id, args, builder); -} - -uint32_t InstBindlessCheckPass::CloneOriginalImage( - uint32_t old_image_id, InstructionBuilder* builder) { - Instruction* new_image_inst; - Instruction* old_image_inst = get_def_use_mgr()->GetDef(old_image_id); - if (old_image_inst->opcode() == spv::Op::OpLoad) { - new_image_inst = builder->AddLoad( - old_image_inst->type_id(), - old_image_inst->GetSingleWordInOperand(kSpvLoadPtrIdInIdx)); - } else if (old_image_inst->opcode() == spv::Op::OpSampledImage) { - uint32_t clone_id = CloneOriginalImage( - old_image_inst->GetSingleWordInOperand(kSpvSampledImageImageIdInIdx), - builder); - new_image_inst = builder->AddBinaryOp( - old_image_inst->type_id(), spv::Op::OpSampledImage, clone_id, - old_image_inst->GetSingleWordInOperand(kSpvSampledImageSamplerIdInIdx)); - } else if (old_image_inst->opcode() == spv::Op::OpImage) { - uint32_t clone_id = CloneOriginalImage( - old_image_inst->GetSingleWordInOperand(kSpvImageSampledImageIdInIdx), - builder); - new_image_inst = builder->AddUnaryOp(old_image_inst->type_id(), - spv::Op::OpImage, clone_id); - } else { - assert(old_image_inst->opcode() == spv::Op::OpCopyObject && - "expecting OpCopyObject"); - uint32_t clone_id = CloneOriginalImage( - old_image_inst->GetSingleWordInOperand(kSpvCopyObjectOperandIdInIdx), - builder); - // Since we are cloning, no need to create new copy - new_image_inst = get_def_use_mgr()->GetDef(clone_id); - } - uid2offset_[new_image_inst->unique_id()] = - uid2offset_[old_image_inst->unique_id()]; - uint32_t new_image_id = new_image_inst->result_id(); - get_decoration_mgr()->CloneDecorations(old_image_id, new_image_id); - return new_image_id; -} - -uint32_t InstBindlessCheckPass::CloneOriginalReference( - RefAnalysis* ref, InstructionBuilder* builder) { - // If original is image based, start by cloning descriptor load - uint32_t new_image_id = 0; - if (ref->desc_load_id != 0) { - uint32_t old_image_id = - ref->ref_inst->GetSingleWordInOperand(kSpvImageSampleImageIdInIdx); - new_image_id = CloneOriginalImage(old_image_id, builder); - } - // Clone original reference - std::unique_ptr new_ref_inst(ref->ref_inst->Clone(context())); - uint32_t ref_result_id = ref->ref_inst->result_id(); - uint32_t new_ref_id = 0; - if (ref_result_id != 0) { - new_ref_id = TakeNextId(); - new_ref_inst->SetResultId(new_ref_id); - } - // Update new ref with new image if created - if (new_image_id != 0) - new_ref_inst->SetInOperand(kSpvImageSampleImageIdInIdx, {new_image_id}); - // Register new reference and add to new block - Instruction* added_inst = builder->AddInstruction(std::move(new_ref_inst)); - uid2offset_[added_inst->unique_id()] = - uid2offset_[ref->ref_inst->unique_id()]; - if (new_ref_id != 0) - get_decoration_mgr()->CloneDecorations(ref_result_id, new_ref_id); - return new_ref_id; -} - -uint32_t InstBindlessCheckPass::GetImageId(Instruction* inst) { - switch (inst->opcode()) { - case spv::Op::OpImageSampleImplicitLod: - case spv::Op::OpImageSampleExplicitLod: - case spv::Op::OpImageSampleDrefImplicitLod: - case spv::Op::OpImageSampleDrefExplicitLod: - case spv::Op::OpImageSampleProjImplicitLod: - case spv::Op::OpImageSampleProjExplicitLod: - case spv::Op::OpImageSampleProjDrefImplicitLod: - case spv::Op::OpImageSampleProjDrefExplicitLod: - case spv::Op::OpImageGather: - case spv::Op::OpImageDrefGather: - case spv::Op::OpImageQueryLod: - case spv::Op::OpImageSparseSampleImplicitLod: - case spv::Op::OpImageSparseSampleExplicitLod: - case spv::Op::OpImageSparseSampleDrefImplicitLod: - case spv::Op::OpImageSparseSampleDrefExplicitLod: - case spv::Op::OpImageSparseSampleProjImplicitLod: - case spv::Op::OpImageSparseSampleProjExplicitLod: - case spv::Op::OpImageSparseSampleProjDrefImplicitLod: - case spv::Op::OpImageSparseSampleProjDrefExplicitLod: - case spv::Op::OpImageSparseGather: - case spv::Op::OpImageSparseDrefGather: - case spv::Op::OpImageFetch: - case spv::Op::OpImageRead: - case spv::Op::OpImageQueryFormat: - case spv::Op::OpImageQueryOrder: - case spv::Op::OpImageQuerySizeLod: - case spv::Op::OpImageQuerySize: - case spv::Op::OpImageQueryLevels: - case spv::Op::OpImageQuerySamples: - case spv::Op::OpImageSparseFetch: - case spv::Op::OpImageSparseRead: - case spv::Op::OpImageWrite: - return inst->GetSingleWordInOperand(kSpvImageSampleImageIdInIdx); - default: - break; - } - return 0; -} - -Instruction* InstBindlessCheckPass::GetPointeeTypeInst(Instruction* ptr_inst) { - uint32_t pte_ty_id = GetPointeeTypeId(ptr_inst); - return get_def_use_mgr()->GetDef(pte_ty_id); -} - -bool InstBindlessCheckPass::AnalyzeDescriptorReference(Instruction* ref_inst, - RefAnalysis* ref) { - ref->ref_inst = ref_inst; - if (ref_inst->opcode() == spv::Op::OpLoad || - ref_inst->opcode() == spv::Op::OpStore) { - ref->desc_load_id = 0; - ref->ptr_id = ref_inst->GetSingleWordInOperand(kSpvLoadPtrIdInIdx); - Instruction* ptr_inst = get_def_use_mgr()->GetDef(ref->ptr_id); - if (ptr_inst->opcode() != spv::Op::OpAccessChain) return false; - ref->var_id = ptr_inst->GetSingleWordInOperand(kSpvAccessChainBaseIdInIdx); - Instruction* var_inst = get_def_use_mgr()->GetDef(ref->var_id); - if (var_inst->opcode() != spv::Op::OpVariable) return false; - spv::StorageClass storage_class = spv::StorageClass( - var_inst->GetSingleWordInOperand(kSpvVariableStorageClassInIdx)); - switch (storage_class) { - case spv::StorageClass::Uniform: - case spv::StorageClass::StorageBuffer: - break; - default: - return false; - break; - } - // Check for deprecated storage block form - if (storage_class == spv::StorageClass::Uniform) { - uint32_t var_ty_id = var_inst->type_id(); - Instruction* var_ty_inst = get_def_use_mgr()->GetDef(var_ty_id); - uint32_t ptr_ty_id = - var_ty_inst->GetSingleWordInOperand(kSpvTypePtrTypeIdInIdx); - Instruction* ptr_ty_inst = get_def_use_mgr()->GetDef(ptr_ty_id); - spv::Op ptr_ty_op = ptr_ty_inst->opcode(); - uint32_t block_ty_id = - (ptr_ty_op == spv::Op::OpTypeArray || - ptr_ty_op == spv::Op::OpTypeRuntimeArray) - ? ptr_ty_inst->GetSingleWordInOperand(kSpvTypeArrayTypeIdInIdx) - : ptr_ty_id; - assert(get_def_use_mgr()->GetDef(block_ty_id)->opcode() == - spv::Op::OpTypeStruct && - "unexpected block type"); - bool block_found = get_decoration_mgr()->FindDecoration( - block_ty_id, uint32_t(spv::Decoration::Block), - [](const Instruction&) { return true; }); - if (!block_found) { - // If block decoration not found, verify deprecated form of SSBO - bool buffer_block_found = get_decoration_mgr()->FindDecoration( - block_ty_id, uint32_t(spv::Decoration::BufferBlock), - [](const Instruction&) { return true; }); - USE_ASSERT(buffer_block_found && "block decoration not found"); - storage_class = spv::StorageClass::StorageBuffer; - } - } - ref->strg_class = uint32_t(storage_class); - Instruction* desc_type_inst = GetPointeeTypeInst(var_inst); - switch (desc_type_inst->opcode()) { - case spv::Op::OpTypeArray: - case spv::Op::OpTypeRuntimeArray: - // A load through a descriptor array will have at least 3 operands. We - // do not want to instrument loads of descriptors here which are part of - // an image-based reference. - if (ptr_inst->NumInOperands() < 3) return false; - ref->desc_idx_id = - ptr_inst->GetSingleWordInOperand(kSpvAccessChainIndex0IdInIdx); - break; - default: - break; - } - auto decos = - context()->get_decoration_mgr()->GetDecorationsFor(ref->var_id, false); - for (const auto& deco : decos) { - spv::Decoration d = spv::Decoration(deco->GetSingleWordInOperand(1u)); - if (d == spv::Decoration::DescriptorSet) { - ref->set = deco->GetSingleWordInOperand(2u); - } else if (d == spv::Decoration::Binding) { - ref->binding = deco->GetSingleWordInOperand(2u); - } - } - return true; - } - // Reference is not load or store. If not an image-based reference, return. - ref->image_id = GetImageId(ref_inst); - if (ref->image_id == 0) return false; - // Search for descriptor load - uint32_t desc_load_id = ref->image_id; - Instruction* desc_load_inst; - for (;;) { - desc_load_inst = get_def_use_mgr()->GetDef(desc_load_id); - if (desc_load_inst->opcode() == spv::Op::OpSampledImage) - desc_load_id = - desc_load_inst->GetSingleWordInOperand(kSpvSampledImageImageIdInIdx); - else if (desc_load_inst->opcode() == spv::Op::OpImage) - desc_load_id = - desc_load_inst->GetSingleWordInOperand(kSpvImageSampledImageIdInIdx); - else if (desc_load_inst->opcode() == spv::Op::OpCopyObject) - desc_load_id = - desc_load_inst->GetSingleWordInOperand(kSpvCopyObjectOperandIdInIdx); - else - break; - } - if (desc_load_inst->opcode() != spv::Op::OpLoad) { - // TODO(greg-lunarg): Handle additional possibilities? - return false; - } - ref->desc_load_id = desc_load_id; - ref->ptr_id = desc_load_inst->GetSingleWordInOperand(kSpvLoadPtrIdInIdx); - Instruction* ptr_inst = get_def_use_mgr()->GetDef(ref->ptr_id); - if (ptr_inst->opcode() == spv::Op::OpVariable) { - ref->desc_idx_id = 0; - ref->var_id = ref->ptr_id; - } else if (ptr_inst->opcode() == spv::Op::OpAccessChain) { - if (ptr_inst->NumInOperands() != 2) { - assert(false && "unexpected bindless index number"); - return false; - } - ref->desc_idx_id = - ptr_inst->GetSingleWordInOperand(kSpvAccessChainIndex0IdInIdx); - ref->var_id = ptr_inst->GetSingleWordInOperand(kSpvAccessChainBaseIdInIdx); - Instruction* var_inst = get_def_use_mgr()->GetDef(ref->var_id); - if (var_inst->opcode() != spv::Op::OpVariable) { - assert(false && "unexpected bindless base"); - return false; - } - } else { - // TODO(greg-lunarg): Handle additional possibilities? - return false; - } - auto decos = - context()->get_decoration_mgr()->GetDecorationsFor(ref->var_id, false); - for (const auto& deco : decos) { - spv::Decoration d = spv::Decoration(deco->GetSingleWordInOperand(1u)); - if (d == spv::Decoration::DescriptorSet) { - ref->set = deco->GetSingleWordInOperand(2u); - } else if (d == spv::Decoration::Binding) { - ref->binding = deco->GetSingleWordInOperand(2u); - } - } - return true; -} - -uint32_t InstBindlessCheckPass::FindStride(uint32_t ty_id, - uint32_t stride_deco) { - uint32_t stride = 0xdeadbeef; - bool found = get_decoration_mgr()->FindDecoration( - ty_id, stride_deco, [&stride](const Instruction& deco_inst) { - stride = deco_inst.GetSingleWordInOperand(2u); - return true; - }); - USE_ASSERT(found && "stride not found"); - return stride; -} - -uint32_t InstBindlessCheckPass::ByteSize(uint32_t ty_id, uint32_t matrix_stride, - bool col_major, bool in_matrix) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - const analysis::Type* sz_ty = type_mgr->GetType(ty_id); - if (sz_ty->kind() == analysis::Type::kPointer) { - // Assuming PhysicalStorageBuffer pointer - return 8; - } - if (sz_ty->kind() == analysis::Type::kMatrix) { - assert(matrix_stride != 0 && "missing matrix stride"); - const analysis::Matrix* m_ty = sz_ty->AsMatrix(); - if (col_major) { - return m_ty->element_count() * matrix_stride; - } else { - const analysis::Vector* v_ty = m_ty->element_type()->AsVector(); - return v_ty->element_count() * matrix_stride; - } - } - uint32_t size = 1; - if (sz_ty->kind() == analysis::Type::kVector) { - const analysis::Vector* v_ty = sz_ty->AsVector(); - size = v_ty->element_count(); - const analysis::Type* comp_ty = v_ty->element_type(); - // if vector in row major matrix, the vector is strided so return the - // number of bytes spanned by the vector - if (in_matrix && !col_major && matrix_stride > 0) { - uint32_t comp_ty_id = type_mgr->GetId(comp_ty); - return (size - 1) * matrix_stride + ByteSize(comp_ty_id, 0, false, false); - } - sz_ty = comp_ty; - } - switch (sz_ty->kind()) { - case analysis::Type::kFloat: { - const analysis::Float* f_ty = sz_ty->AsFloat(); - size *= f_ty->width(); - } break; - case analysis::Type::kInteger: { - const analysis::Integer* i_ty = sz_ty->AsInteger(); - size *= i_ty->width(); - } break; - default: { assert(false && "unexpected type"); } break; - } - size /= 8; - return size; -} - -uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, - InstructionBuilder* builder) { - // Find outermost buffer type and its access chain index - Instruction* var_inst = get_def_use_mgr()->GetDef(ref->var_id); - Instruction* desc_ty_inst = GetPointeeTypeInst(var_inst); - uint32_t buff_ty_id; - uint32_t ac_in_idx = 1; - switch (desc_ty_inst->opcode()) { - case spv::Op::OpTypeArray: - case spv::Op::OpTypeRuntimeArray: - buff_ty_id = desc_ty_inst->GetSingleWordInOperand(0); - ++ac_in_idx; - break; - default: - assert(desc_ty_inst->opcode() == spv::Op::OpTypeStruct && - "unexpected descriptor type"); - buff_ty_id = desc_ty_inst->result_id(); - break; - } - // Process remaining access chain indices - Instruction* ac_inst = get_def_use_mgr()->GetDef(ref->ptr_id); - uint32_t curr_ty_id = buff_ty_id; - uint32_t sum_id = 0u; - uint32_t matrix_stride = 0u; - bool col_major = false; - uint32_t matrix_stride_id = 0u; - bool in_matrix = false; - while (ac_in_idx < ac_inst->NumInOperands()) { - uint32_t curr_idx_id = ac_inst->GetSingleWordInOperand(ac_in_idx); - Instruction* curr_ty_inst = get_def_use_mgr()->GetDef(curr_ty_id); - uint32_t curr_offset_id = 0; - switch (curr_ty_inst->opcode()) { - case spv::Op::OpTypeArray: - case spv::Op::OpTypeRuntimeArray: { - // Get array stride and multiply by current index - uint32_t arr_stride = - FindStride(curr_ty_id, uint32_t(spv::Decoration::ArrayStride)); - uint32_t arr_stride_id = builder->GetUintConstantId(arr_stride); - uint32_t curr_idx_32b_id = Gen32BitCvtCode(curr_idx_id, builder); - Instruction* curr_offset_inst = builder->AddBinaryOp( - GetUintId(), spv::Op::OpIMul, arr_stride_id, curr_idx_32b_id); - curr_offset_id = curr_offset_inst->result_id(); - // Get element type for next step - curr_ty_id = curr_ty_inst->GetSingleWordInOperand(0); - } break; - case spv::Op::OpTypeMatrix: { - assert(matrix_stride != 0 && "missing matrix stride"); - matrix_stride_id = builder->GetUintConstantId(matrix_stride); - uint32_t vec_ty_id = curr_ty_inst->GetSingleWordInOperand(0); - // If column major, multiply column index by matrix stride, otherwise - // by vector component size and save matrix stride for vector (row) - // index - uint32_t col_stride_id; - if (col_major) { - col_stride_id = matrix_stride_id; - } else { - Instruction* vec_ty_inst = get_def_use_mgr()->GetDef(vec_ty_id); - uint32_t comp_ty_id = vec_ty_inst->GetSingleWordInOperand(0u); - uint32_t col_stride = ByteSize(comp_ty_id, 0u, false, false); - col_stride_id = builder->GetUintConstantId(col_stride); - } - uint32_t curr_idx_32b_id = Gen32BitCvtCode(curr_idx_id, builder); - Instruction* curr_offset_inst = builder->AddBinaryOp( - GetUintId(), spv::Op::OpIMul, col_stride_id, curr_idx_32b_id); - curr_offset_id = curr_offset_inst->result_id(); - // Get element type for next step - curr_ty_id = vec_ty_id; - in_matrix = true; - } break; - case spv::Op::OpTypeVector: { - // If inside a row major matrix type, multiply index by matrix stride, - // else multiply by component size - uint32_t comp_ty_id = curr_ty_inst->GetSingleWordInOperand(0u); - uint32_t curr_idx_32b_id = Gen32BitCvtCode(curr_idx_id, builder); - if (in_matrix && !col_major) { - Instruction* curr_offset_inst = builder->AddBinaryOp( - GetUintId(), spv::Op::OpIMul, matrix_stride_id, curr_idx_32b_id); - curr_offset_id = curr_offset_inst->result_id(); - } else { - uint32_t comp_ty_sz = ByteSize(comp_ty_id, 0u, false, false); - uint32_t comp_ty_sz_id = builder->GetUintConstantId(comp_ty_sz); - Instruction* curr_offset_inst = builder->AddBinaryOp( - GetUintId(), spv::Op::OpIMul, comp_ty_sz_id, curr_idx_32b_id); - curr_offset_id = curr_offset_inst->result_id(); - } - // Get element type for next step - curr_ty_id = comp_ty_id; - } break; - case spv::Op::OpTypeStruct: { - // Get buffer byte offset for the referenced member - Instruction* curr_idx_inst = get_def_use_mgr()->GetDef(curr_idx_id); - assert(curr_idx_inst->opcode() == spv::Op::OpConstant && - "unexpected struct index"); - uint32_t member_idx = curr_idx_inst->GetSingleWordInOperand(0); - uint32_t member_offset = 0xdeadbeef; - bool found = get_decoration_mgr()->FindDecoration( - curr_ty_id, uint32_t(spv::Decoration::Offset), - [&member_idx, &member_offset](const Instruction& deco_inst) { - if (deco_inst.GetSingleWordInOperand(1u) != member_idx) - return false; - member_offset = deco_inst.GetSingleWordInOperand(3u); - return true; - }); - USE_ASSERT(found && "member offset not found"); - curr_offset_id = builder->GetUintConstantId(member_offset); - // Look for matrix stride for this member if there is one. The matrix - // stride is not on the matrix type, but in a OpMemberDecorate on the - // enclosing struct type at the member index. If none found, reset - // stride to 0. - found = get_decoration_mgr()->FindDecoration( - curr_ty_id, uint32_t(spv::Decoration::MatrixStride), - [&member_idx, &matrix_stride](const Instruction& deco_inst) { - if (deco_inst.GetSingleWordInOperand(1u) != member_idx) - return false; - matrix_stride = deco_inst.GetSingleWordInOperand(3u); - return true; - }); - if (!found) matrix_stride = 0; - // Look for column major decoration - found = get_decoration_mgr()->FindDecoration( - curr_ty_id, uint32_t(spv::Decoration::ColMajor), - [&member_idx, &col_major](const Instruction& deco_inst) { - if (deco_inst.GetSingleWordInOperand(1u) != member_idx) - return false; - col_major = true; - return true; - }); - if (!found) col_major = false; - // Get element type for next step - curr_ty_id = curr_ty_inst->GetSingleWordInOperand(member_idx); - } break; - default: { assert(false && "unexpected non-composite type"); } break; - } - if (sum_id == 0) - sum_id = curr_offset_id; - else { - Instruction* sum_inst = - builder->AddIAdd(GetUintId(), sum_id, curr_offset_id); - sum_id = sum_inst->result_id(); - } - ++ac_in_idx; - } - // Add in offset of last byte of referenced object - uint32_t bsize = ByteSize(curr_ty_id, matrix_stride, col_major, in_matrix); - uint32_t last = bsize - 1; - uint32_t last_id = builder->GetUintConstantId(last); - Instruction* sum_inst = builder->AddIAdd(GetUintId(), sum_id, last_id); - return sum_inst->result_id(); -} - -void InstBindlessCheckPass::GenCheckCode( - uint32_t check_id, uint32_t error_id, uint32_t offset_id, - uint32_t length_id, uint32_t stage_idx, RefAnalysis* ref, - std::vector>* new_blocks) { - BasicBlock* back_blk_ptr = &*new_blocks->back(); - InstructionBuilder builder( - context(), back_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - // Gen conditional branch on check_id. Valid branch generates original - // reference. Invalid generates debug output and zero result (if needed). - uint32_t merge_blk_id = TakeNextId(); - uint32_t valid_blk_id = TakeNextId(); - uint32_t invalid_blk_id = TakeNextId(); - std::unique_ptr merge_label(NewLabel(merge_blk_id)); - std::unique_ptr valid_label(NewLabel(valid_blk_id)); - std::unique_ptr invalid_label(NewLabel(invalid_blk_id)); - (void)builder.AddConditionalBranch( - check_id, valid_blk_id, invalid_blk_id, merge_blk_id, - uint32_t(spv::SelectionControlMask::MaskNone)); - // Gen valid bounds branch - std::unique_ptr new_blk_ptr( - new BasicBlock(std::move(valid_label))); - builder.SetInsertPoint(&*new_blk_ptr); - uint32_t new_ref_id = CloneOriginalReference(ref, &builder); - uint32_t null_id = 0; - uint32_t ref_type_id = ref->ref_inst->type_id(); - (void)builder.AddBranch(merge_blk_id); - new_blocks->push_back(std::move(new_blk_ptr)); - // Gen invalid block - new_blk_ptr.reset(new BasicBlock(std::move(invalid_label))); - builder.SetInsertPoint(&*new_blk_ptr); - if (error_id != 0) { - const uint32_t u_shader_id = builder.GetUintConstantId(shader_id_); - const uint32_t u_inst_id = - builder.GetUintConstantId(ref->ref_inst->unique_id()); - const uint32_t shader_info_id = GenStageInfo(stage_idx, &builder); - const uint32_t u_set_id = builder.GetUintConstantId(ref->set); - const uint32_t u_binding_id = builder.GetUintConstantId(ref->binding); - const uint32_t u_index_id = GenUintCastCode(ref->desc_idx_id, &builder); - const uint32_t u_length_id = GenUintCastCode(length_id, &builder); - if (offset_id != 0) { - const uint32_t u_offset_id = GenUintCastCode(offset_id, &builder); - // Buffer OOB - GenDebugStreamWrite(u_shader_id, u_inst_id, shader_info_id, - {error_id, u_set_id, u_binding_id, u_index_id, - u_offset_id, u_length_id}, - &builder); - } else { - // Uninitialized Descriptor - Return additional unused zero so all error - // modes will use same debug stream write function - GenDebugStreamWrite(u_shader_id, u_inst_id, shader_info_id, - {error_id, u_set_id, u_binding_id, u_index_id, - u_length_id, builder.GetUintConstantId(0)}, - &builder); - } - } - // Generate a ConstantNull, converting to uint64 if the type cannot be a null. - if (new_ref_id != 0) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Type* ref_type = type_mgr->GetType(ref_type_id); - if (ref_type->AsPointer() != nullptr) { - context()->AddCapability(spv::Capability::Int64); - uint32_t null_u64_id = GetNullId(GetUint64Id()); - Instruction* null_ptr_inst = builder.AddUnaryOp( - ref_type_id, spv::Op::OpConvertUToPtr, null_u64_id); - null_id = null_ptr_inst->result_id(); - } else { - null_id = GetNullId(ref_type_id); - } - } - // Remember last invalid block id - uint32_t last_invalid_blk_id = new_blk_ptr->GetLabelInst()->result_id(); - // Gen zero for invalid reference - (void)builder.AddBranch(merge_blk_id); - new_blocks->push_back(std::move(new_blk_ptr)); - // Gen merge block - new_blk_ptr.reset(new BasicBlock(std::move(merge_label))); - builder.SetInsertPoint(&*new_blk_ptr); - // Gen phi of new reference and zero, if necessary, and replace the - // result id of the original reference with that of the Phi. Kill original - // reference. - if (new_ref_id != 0) { - Instruction* phi_inst = builder.AddPhi( - ref_type_id, {new_ref_id, valid_blk_id, null_id, last_invalid_blk_id}); - context()->ReplaceAllUsesWith(ref->ref_inst->result_id(), - phi_inst->result_id()); - } - new_blocks->push_back(std::move(new_blk_ptr)); - context()->KillInst(ref->ref_inst); -} - -void InstBindlessCheckPass::GenDescCheckCode( - BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, uint32_t stage_idx, - std::vector>* new_blocks) { - // Look for reference through descriptor. If not, return. - RefAnalysis ref; - if (!AnalyzeDescriptorReference(&*ref_inst_itr, &ref)) return; - std::unique_ptr new_blk_ptr; - // Move original block's preceding instructions into first new block - MovePreludeCode(ref_inst_itr, ref_block_itr, &new_blk_ptr); - InstructionBuilder builder( - context(), &*new_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - new_blocks->push_back(std::move(new_blk_ptr)); - // Determine if we can only do initialization check - uint32_t ref_id = builder.GetUintConstantId(0u); - spv::Op op = ref.ref_inst->opcode(); - if (ref.desc_load_id != 0) { - uint32_t num_in_oprnds = ref.ref_inst->NumInOperands(); - if ((op == spv::Op::OpImageRead && num_in_oprnds == 2) || - (op == spv::Op::OpImageFetch && num_in_oprnds == 2) || - (op == spv::Op::OpImageWrite && num_in_oprnds == 3)) { - Instruction* image_inst = get_def_use_mgr()->GetDef(ref.image_id); - uint32_t image_ty_id = image_inst->type_id(); - Instruction* image_ty_inst = get_def_use_mgr()->GetDef(image_ty_id); - if (spv::Dim(image_ty_inst->GetSingleWordInOperand(kSpvTypeImageDim)) == - spv::Dim::Buffer) { - if ((image_ty_inst->GetSingleWordInOperand(kSpvTypeImageDepth) == 0) && - (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageArrayed) == - 0) && - (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageMS) == 0)) { - ref_id = GenUintCastCode(ref.ref_inst->GetSingleWordInOperand(1), - &builder); - } - } - } - } else { - // For now, only do bounds check for non-aggregate types. Otherwise - // just do descriptor initialization check. - // TODO(greg-lunarg): Do bounds check for aggregate loads and stores - Instruction* ref_ptr_inst = get_def_use_mgr()->GetDef(ref.ptr_id); - Instruction* pte_type_inst = GetPointeeTypeInst(ref_ptr_inst); - spv::Op pte_type_op = pte_type_inst->opcode(); - if (pte_type_op != spv::Op::OpTypeArray && - pte_type_op != spv::Op::OpTypeRuntimeArray && - pte_type_op != spv::Op::OpTypeStruct) { - ref_id = GenLastByteIdx(&ref, &builder); - } - } - // Read initialization/bounds from debug input buffer. If index id not yet - // set, binding is single descriptor, so set index to constant 0. - if (ref.desc_idx_id == 0) ref.desc_idx_id = builder.GetUintConstantId(0u); - uint32_t check_id = - GenDescCheckCall(ref.ref_inst->unique_id(), stage_idx, ref.var_id, - ref.desc_idx_id, ref_id, &builder); - - // Generate runtime initialization/bounds test code with true branch - // being full reference and false branch being zero - // for the referenced value. - GenCheckCode(check_id, 0, 0, 0, stage_idx, &ref, new_blocks); - - // Move original block's remaining code into remainder/merge block and add - // to new blocks - BasicBlock* back_blk_ptr = &*new_blocks->back(); - MovePostludeCode(ref_block_itr, back_blk_ptr); -} - -void InstBindlessCheckPass::InitializeInstBindlessCheck() { - // Initialize base class - InitializeInstrument(); - for (auto& anno : get_module()->annotations()) { - if (anno.opcode() == spv::Op::OpDecorate) { - if (spv::Decoration(anno.GetSingleWordInOperand(1u)) == - spv::Decoration::DescriptorSet) { - var2desc_set_[anno.GetSingleWordInOperand(0u)] = - anno.GetSingleWordInOperand(2u); - } else if (spv::Decoration(anno.GetSingleWordInOperand(1u)) == - spv::Decoration::Binding) { - var2binding_[anno.GetSingleWordInOperand(0u)] = - anno.GetSingleWordInOperand(2u); - } - } - } -} - -Pass::Status InstBindlessCheckPass::ProcessImpl() { - bool modified = false; - InstProcessFunction pfn = - [this](BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, uint32_t stage_idx, - std::vector>* new_blocks) { - return GenDescCheckCode(ref_inst_itr, ref_block_itr, stage_idx, - new_blocks); - }; - - modified = InstProcessEntryPointCallTree(pfn); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -Pass::Status InstBindlessCheckPass::Process() { - InitializeInstBindlessCheck(); - return ProcessImpl(); -} - -} // namespace opt -} // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h b/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h deleted file mode 100644 index 289f02f1..00000000 --- a/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) 2018 The Khronos Group Inc. -// Copyright (c) 2018 Valve Corporation -// Copyright (c) 2018 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_INST_BINDLESS_CHECK_PASS_H_ -#define LIBSPIRV_OPT_INST_BINDLESS_CHECK_PASS_H_ - -#include "instrument_pass.h" - -namespace spvtools { -namespace opt { - -// This class/pass is designed to support the bindless (descriptor indexing) -// GPU-assisted validation layer of -// https://github.com/KhronosGroup/Vulkan-ValidationLayers. Its internal and -// external design may change as the layer evolves. -class InstBindlessCheckPass : public InstrumentPass { - public: - InstBindlessCheckPass(uint32_t desc_set, uint32_t shader_id) - : InstrumentPass(desc_set, shader_id, kInstValidationIdBindless, true) {} - - ~InstBindlessCheckPass() override = default; - - // See optimizer.hpp for pass user documentation. - Status Process() override; - - const char* name() const override { return "inst-bindless-check-pass"; } - - private: - void GenDescCheckCode(BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, - uint32_t stage_idx, - std::vector>* new_blocks); - - void SetupInputBufferIds(); - - uint32_t GenDescCheckFunctionId(); - - uint32_t GenDescCheckCall(uint32_t inst_idx, uint32_t stage_idx, - uint32_t var_id, uint32_t index_id, - uint32_t byte_offset, InstructionBuilder* builder); - - // Analysis data for descriptor reference components, generated by - // AnalyzeDescriptorReference. It is necessary and sufficient for further - // analysis and regeneration of the reference. - typedef struct RefAnalysis { - uint32_t desc_load_id{0}; - uint32_t image_id{0}; - uint32_t load_id{0}; - uint32_t ptr_id{0}; - uint32_t var_id{0}; - uint32_t set{0}; - uint32_t binding{0}; - uint32_t desc_idx_id{0}; - uint32_t strg_class{0}; - Instruction* ref_inst{nullptr}; - } RefAnalysis; - - // Return size of type |ty_id| in bytes. Use |matrix_stride| and |col_major| - // for matrix type, or for vector type if vector is |in_matrix|. - uint32_t ByteSize(uint32_t ty_id, uint32_t matrix_stride, bool col_major, - bool in_matrix); - - // Return stride of type |ty_id| with decoration |stride_deco|. Return 0 - // if not found - uint32_t FindStride(uint32_t ty_id, uint32_t stride_deco); - - // Generate index of last byte referenced by buffer reference |ref| - uint32_t GenLastByteIdx(RefAnalysis* ref, InstructionBuilder* builder); - - // Clone original image computation starting at |image_id| into |builder|. - // This may generate more than one instruction if necessary. - uint32_t CloneOriginalImage(uint32_t image_id, InstructionBuilder* builder); - - // Clone original original reference encapsulated by |ref| into |builder|. - // This may generate more than one instruction if necessary. - uint32_t CloneOriginalReference(RefAnalysis* ref, - InstructionBuilder* builder); - - // If |inst| references through an image, return the id of the image it - // references through. Else return 0. - uint32_t GetImageId(Instruction* inst); - - // Get pointee type inst of pointer value |ptr_inst|. - Instruction* GetPointeeTypeInst(Instruction* ptr_inst); - - // Analyze descriptor reference |ref_inst| and save components into |ref|. - // Return true if |ref_inst| is a descriptor reference, false otherwise. - bool AnalyzeDescriptorReference(Instruction* ref_inst, RefAnalysis* ref); - - // Generate instrumentation code for generic test result |check_id|, starting - // with |builder| of block |new_blk_ptr|, adding new blocks to |new_blocks|. - // Generate conditional branch to a valid or invalid branch. Generate valid - // block which does original reference |ref|. Generate invalid block which - // writes debug error output utilizing |ref|, |error_id|, |length_id| and - // |stage_idx|. Generate merge block for valid and invalid branches. Kill - // original reference. - void GenCheckCode(uint32_t check_id, uint32_t error_id, uint32_t offset_id, - uint32_t length_id, uint32_t stage_idx, RefAnalysis* ref, - std::vector>* new_blocks); - - // Initialize state for instrumenting bindless checking - void InitializeInstBindlessCheck(); - - // Apply GenDescIdxCheckCode to every instruction in module. Then apply - // GenDescInitCheckCode to every instruction in module. - Pass::Status ProcessImpl(); - - // Mapping from variable to descriptor set - std::unordered_map var2desc_set_; - - // Mapping from variable to binding - std::unordered_map var2binding_; - - uint32_t desc_check_func_id_{0}; - uint32_t desc_set_type_id_{0}; - uint32_t desc_set_ptr_id_{0}; - uint32_t input_buffer_struct_id_{0}; - uint32_t input_buffer_ptr_id_{0}; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INST_BINDLESS_CHECK_PASS_H_ diff --git a/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp deleted file mode 100644 index 6b90e588..00000000 --- a/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp +++ /dev/null @@ -1,466 +0,0 @@ -// Copyright (c) 2019 The Khronos Group Inc. -// Copyright (c) 2019 Valve Corporation -// Copyright (c) 2019 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "inst_buff_addr_check_pass.h" - -namespace spvtools { -namespace opt { - -bool InstBuffAddrCheckPass::InstrumentFunction(Function* func, - uint32_t stage_idx, - InstProcessFunction& pfn) { - // The bindless instrumentation pass adds functions that use - // BufferDeviceAddress They should not be instrumented by this pass. - Instruction* func_name_inst = - context()->GetNames(func->DefInst().result_id()).begin()->second; - if (func_name_inst) { - static const std::string kPrefix{"inst_bindless_"}; - std::string func_name = func_name_inst->GetOperand(1).AsString(); - if (func_name.size() >= kPrefix.size() && - func_name.compare(0, kPrefix.size(), kPrefix) == 0) { - return false; - } - } - return InstrumentPass::InstrumentFunction(func, stage_idx, pfn); -} - -uint32_t InstBuffAddrCheckPass::CloneOriginalReference( - Instruction* ref_inst, InstructionBuilder* builder) { - // Clone original ref with new result id (if load) - assert((ref_inst->opcode() == spv::Op::OpLoad || - ref_inst->opcode() == spv::Op::OpStore) && - "unexpected ref"); - std::unique_ptr new_ref_inst(ref_inst->Clone(context())); - uint32_t ref_result_id = ref_inst->result_id(); - uint32_t new_ref_id = 0; - if (ref_result_id != 0) { - new_ref_id = TakeNextId(); - new_ref_inst->SetResultId(new_ref_id); - } - // Register new reference and add to new block - Instruction* added_inst = builder->AddInstruction(std::move(new_ref_inst)); - uid2offset_[added_inst->unique_id()] = uid2offset_[ref_inst->unique_id()]; - if (new_ref_id != 0) - get_decoration_mgr()->CloneDecorations(ref_result_id, new_ref_id); - return new_ref_id; -} - -bool InstBuffAddrCheckPass::IsPhysicalBuffAddrReference(Instruction* ref_inst) { - if (ref_inst->opcode() != spv::Op::OpLoad && - ref_inst->opcode() != spv::Op::OpStore) - return false; - uint32_t ptr_id = ref_inst->GetSingleWordInOperand(0); - analysis::DefUseManager* du_mgr = get_def_use_mgr(); - Instruction* ptr_inst = du_mgr->GetDef(ptr_id); - if (ptr_inst->opcode() != spv::Op::OpAccessChain) return false; - uint32_t ptr_ty_id = ptr_inst->type_id(); - Instruction* ptr_ty_inst = du_mgr->GetDef(ptr_ty_id); - if (spv::StorageClass(ptr_ty_inst->GetSingleWordInOperand(0)) != - spv::StorageClass::PhysicalStorageBufferEXT) - return false; - return true; -} - -// TODO(greg-lunarg): Refactor with InstBindlessCheckPass::GenCheckCode() ?? -void InstBuffAddrCheckPass::GenCheckCode( - uint32_t check_id, uint32_t error_id, uint32_t ref_uptr_id, - uint32_t stage_idx, Instruction* ref_inst, - std::vector>* new_blocks) { - BasicBlock* back_blk_ptr = &*new_blocks->back(); - InstructionBuilder builder( - context(), back_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - // Gen conditional branch on check_id. Valid branch generates original - // reference. Invalid generates debug output and zero result (if needed). - uint32_t merge_blk_id = TakeNextId(); - uint32_t valid_blk_id = TakeNextId(); - uint32_t invalid_blk_id = TakeNextId(); - std::unique_ptr merge_label(NewLabel(merge_blk_id)); - std::unique_ptr valid_label(NewLabel(valid_blk_id)); - std::unique_ptr invalid_label(NewLabel(invalid_blk_id)); - (void)builder.AddConditionalBranch( - check_id, valid_blk_id, invalid_blk_id, merge_blk_id, - uint32_t(spv::SelectionControlMask::MaskNone)); - // Gen valid branch - std::unique_ptr new_blk_ptr( - new BasicBlock(std::move(valid_label))); - builder.SetInsertPoint(&*new_blk_ptr); - uint32_t new_ref_id = CloneOriginalReference(ref_inst, &builder); - (void)builder.AddBranch(merge_blk_id); - new_blocks->push_back(std::move(new_blk_ptr)); - // Gen invalid block - new_blk_ptr.reset(new BasicBlock(std::move(invalid_label))); - builder.SetInsertPoint(&*new_blk_ptr); - // Convert uptr from uint64 to 2 uint32 - Instruction* lo_uptr_inst = - builder.AddUnaryOp(GetUintId(), spv::Op::OpUConvert, ref_uptr_id); - Instruction* rshift_uptr_inst = - builder.AddBinaryOp(GetUint64Id(), spv::Op::OpShiftRightLogical, - ref_uptr_id, builder.GetUintConstantId(32)); - Instruction* hi_uptr_inst = builder.AddUnaryOp( - GetUintId(), spv::Op::OpUConvert, rshift_uptr_inst->result_id()); - GenDebugStreamWrite( - builder.GetUintConstantId(shader_id_), - builder.GetUintConstantId(uid2offset_[ref_inst->unique_id()]), - GenStageInfo(stage_idx, &builder), - {error_id, lo_uptr_inst->result_id(), hi_uptr_inst->result_id()}, - &builder); - // Gen zero for invalid load. If pointer type, need to convert uint64 - // zero to pointer; cannot create ConstantNull of pointer type. - uint32_t null_id = 0; - if (new_ref_id != 0) { - uint32_t ref_type_id = ref_inst->type_id(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Type* ref_type = type_mgr->GetType(ref_type_id); - if (ref_type->AsPointer() != nullptr) { - uint32_t null_u64_id = GetNullId(GetUint64Id()); - Instruction* null_ptr_inst = builder.AddUnaryOp( - ref_type_id, spv::Op::OpConvertUToPtr, null_u64_id); - null_id = null_ptr_inst->result_id(); - } else { - null_id = GetNullId(ref_type_id); - } - } - (void)builder.AddBranch(merge_blk_id); - new_blocks->push_back(std::move(new_blk_ptr)); - // Gen merge block - new_blk_ptr.reset(new BasicBlock(std::move(merge_label))); - builder.SetInsertPoint(&*new_blk_ptr); - // Gen phi of new reference and zero, if necessary, and replace the - // result id of the original reference with that of the Phi. Kill original - // reference. - if (new_ref_id != 0) { - Instruction* phi_inst = - builder.AddPhi(ref_inst->type_id(), - {new_ref_id, valid_blk_id, null_id, invalid_blk_id}); - context()->ReplaceAllUsesWith(ref_inst->result_id(), phi_inst->result_id()); - } - new_blocks->push_back(std::move(new_blk_ptr)); - context()->KillInst(ref_inst); -} - -uint32_t InstBuffAddrCheckPass::GetTypeLength(uint32_t type_id) { - Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); - switch (type_inst->opcode()) { - case spv::Op::OpTypeFloat: - case spv::Op::OpTypeInt: - return type_inst->GetSingleWordInOperand(0) / 8u; - case spv::Op::OpTypeVector: - case spv::Op::OpTypeMatrix: - return type_inst->GetSingleWordInOperand(1) * - GetTypeLength(type_inst->GetSingleWordInOperand(0)); - case spv::Op::OpTypePointer: - assert(spv::StorageClass(type_inst->GetSingleWordInOperand(0)) == - spv::StorageClass::PhysicalStorageBufferEXT && - "unexpected pointer type"); - return 8u; - case spv::Op::OpTypeArray: { - uint32_t const_id = type_inst->GetSingleWordInOperand(1); - Instruction* const_inst = get_def_use_mgr()->GetDef(const_id); - uint32_t cnt = const_inst->GetSingleWordInOperand(0); - return cnt * GetTypeLength(type_inst->GetSingleWordInOperand(0)); - } - case spv::Op::OpTypeStruct: { - // Figure out the location of the last byte of the last member of the - // structure. - uint32_t last_offset = 0, last_len = 0; - - get_decoration_mgr()->ForEachDecoration( - type_id, uint32_t(spv::Decoration::Offset), - [&last_offset](const Instruction& deco_inst) { - last_offset = deco_inst.GetSingleWordInOperand(3); - }); - type_inst->ForEachInId([&last_len, this](const uint32_t* iid) { - last_len = GetTypeLength(*iid); - }); - return last_offset + last_len; - } - case spv::Op::OpTypeRuntimeArray: - default: - assert(false && "unexpected type"); - return 0; - } -} - -void InstBuffAddrCheckPass::AddParam(uint32_t type_id, - std::vector* param_vec, - std::unique_ptr* input_func) { - uint32_t pid = TakeNextId(); - param_vec->push_back(pid); - std::unique_ptr param_inst(new Instruction( - get_module()->context(), spv::Op::OpFunctionParameter, type_id, pid, {})); - get_def_use_mgr()->AnalyzeInstDefUse(&*param_inst); - (*input_func)->AddParameter(std::move(param_inst)); -} - -uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { - if (search_test_func_id_ == 0) { - // Generate function "bool search_and_test(uint64_t ref_ptr, uint32_t len)" - // which searches input buffer for buffer which most likely contains the - // pointer value |ref_ptr| and verifies that the entire reference of - // length |len| bytes is contained in the buffer. - search_test_func_id_ = TakeNextId(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - std::vector param_types = { - type_mgr->GetType(GetUint64Id()), type_mgr->GetType(GetUintId())}; - analysis::Function func_ty(type_mgr->GetType(GetBoolId()), param_types); - analysis::Type* reg_func_ty = type_mgr->GetRegisteredType(&func_ty); - std::unique_ptr func_inst( - new Instruction(get_module()->context(), spv::Op::OpFunction, - GetBoolId(), search_test_func_id_, - {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {uint32_t(spv::FunctionControlMask::MaskNone)}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, - {type_mgr->GetTypeInstruction(reg_func_ty)}}})); - get_def_use_mgr()->AnalyzeInstDefUse(&*func_inst); - std::unique_ptr input_func = - MakeUnique(std::move(func_inst)); - std::vector param_vec; - // Add ref_ptr and length parameters - AddParam(GetUint64Id(), ¶m_vec, &input_func); - AddParam(GetUintId(), ¶m_vec, &input_func); - // Empty first block. - uint32_t first_blk_id = TakeNextId(); - std::unique_ptr first_blk_label(NewLabel(first_blk_id)); - std::unique_ptr first_blk_ptr = - MakeUnique(std::move(first_blk_label)); - InstructionBuilder builder( - context(), &*first_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - uint32_t hdr_blk_id = TakeNextId(); - // Branch to search loop header - std::unique_ptr hdr_blk_label(NewLabel(hdr_blk_id)); - (void)builder.AddBranch(hdr_blk_id); - input_func->AddBasicBlock(std::move(first_blk_ptr)); - // Linear search loop header block - // TODO(greg-lunarg): Implement binary search - std::unique_ptr hdr_blk_ptr = - MakeUnique(std::move(hdr_blk_label)); - builder.SetInsertPoint(&*hdr_blk_ptr); - // Phi for search index. Starts with 1. - uint32_t cont_blk_id = TakeNextId(); - std::unique_ptr cont_blk_label(NewLabel(cont_blk_id)); - // Deal with def-use cycle caused by search loop index computation. - // Create Add and Phi instructions first, then do Def analysis on Add. - // Add Phi and Add instructions and do Use analysis later. - uint32_t idx_phi_id = TakeNextId(); - uint32_t idx_inc_id = TakeNextId(); - std::unique_ptr idx_inc_inst(new Instruction( - context(), spv::Op::OpIAdd, GetUintId(), idx_inc_id, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {idx_phi_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, - {builder.GetUintConstantId(1u)}}})); - std::unique_ptr idx_phi_inst(new Instruction( - context(), spv::Op::OpPhi, GetUintId(), idx_phi_id, - {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, - {builder.GetUintConstantId(1u)}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {first_blk_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {idx_inc_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {cont_blk_id}}})); - get_def_use_mgr()->AnalyzeInstDef(&*idx_inc_inst); - // Add (previously created) search index phi - (void)builder.AddInstruction(std::move(idx_phi_inst)); - // LoopMerge - uint32_t bound_test_blk_id = TakeNextId(); - std::unique_ptr bound_test_blk_label( - NewLabel(bound_test_blk_id)); - (void)builder.AddLoopMerge(bound_test_blk_id, cont_blk_id, - uint32_t(spv::LoopControlMask::MaskNone)); - // Branch to continue/work block - (void)builder.AddBranch(cont_blk_id); - input_func->AddBasicBlock(std::move(hdr_blk_ptr)); - // Continue/Work Block. Read next buffer pointer and break if greater - // than ref_ptr arg. - std::unique_ptr cont_blk_ptr = - MakeUnique(std::move(cont_blk_label)); - builder.SetInsertPoint(&*cont_blk_ptr); - // Add (previously created) search index increment now. - (void)builder.AddInstruction(std::move(idx_inc_inst)); - // Load next buffer address from debug input buffer - uint32_t ibuf_id = GetInputBufferId(); - uint32_t ibuf_ptr_id = GetInputBufferPtrId(); - Instruction* uptr_ac_inst = builder.AddTernaryOp( - ibuf_ptr_id, spv::Op::OpAccessChain, ibuf_id, - builder.GetUintConstantId(kDebugInputDataOffset), idx_inc_id); - uint32_t ibuf_type_id = GetInputBufferTypeId(); - Instruction* uptr_load_inst = builder.AddUnaryOp( - ibuf_type_id, spv::Op::OpLoad, uptr_ac_inst->result_id()); - // If loaded address greater than ref_ptr arg, break, else branch back to - // loop header - Instruction* uptr_test_inst = - builder.AddBinaryOp(GetBoolId(), spv::Op::OpUGreaterThan, - uptr_load_inst->result_id(), param_vec[0]); - (void)builder.AddConditionalBranch( - uptr_test_inst->result_id(), bound_test_blk_id, hdr_blk_id, kInvalidId, - uint32_t(spv::SelectionControlMask::MaskNone)); - input_func->AddBasicBlock(std::move(cont_blk_ptr)); - // Bounds test block. Read length of selected buffer and test that - // all len arg bytes are in buffer. - std::unique_ptr bound_test_blk_ptr = - MakeUnique(std::move(bound_test_blk_label)); - builder.SetInsertPoint(&*bound_test_blk_ptr); - // Decrement index to point to previous/candidate buffer address - Instruction* cand_idx_inst = - builder.AddBinaryOp(GetUintId(), spv::Op::OpISub, idx_inc_id, - builder.GetUintConstantId(1u)); - // Load candidate buffer address - Instruction* cand_ac_inst = - builder.AddTernaryOp(ibuf_ptr_id, spv::Op::OpAccessChain, ibuf_id, - builder.GetUintConstantId(kDebugInputDataOffset), - cand_idx_inst->result_id()); - Instruction* cand_load_inst = builder.AddUnaryOp( - ibuf_type_id, spv::Op::OpLoad, cand_ac_inst->result_id()); - // Compute offset of ref_ptr from candidate buffer address - Instruction* offset_inst = - builder.AddBinaryOp(ibuf_type_id, spv::Op::OpISub, param_vec[0], - cand_load_inst->result_id()); - // Convert ref length to uint64 - Instruction* ref_len_64_inst = - builder.AddUnaryOp(ibuf_type_id, spv::Op::OpUConvert, param_vec[1]); - // Add ref length to ref offset to compute end of reference - Instruction* ref_end_inst = builder.AddBinaryOp( - ibuf_type_id, spv::Op::OpIAdd, offset_inst->result_id(), - ref_len_64_inst->result_id()); - // Load starting index of lengths in input buffer and convert to uint32 - Instruction* len_start_ac_inst = - builder.AddTernaryOp(ibuf_ptr_id, spv::Op::OpAccessChain, ibuf_id, - builder.GetUintConstantId(kDebugInputDataOffset), - builder.GetUintConstantId(0u)); - Instruction* len_start_load_inst = builder.AddUnaryOp( - ibuf_type_id, spv::Op::OpLoad, len_start_ac_inst->result_id()); - Instruction* len_start_32_inst = builder.AddUnaryOp( - GetUintId(), spv::Op::OpUConvert, len_start_load_inst->result_id()); - // Decrement search index to get candidate buffer length index - Instruction* cand_len_idx_inst = builder.AddBinaryOp( - GetUintId(), spv::Op::OpISub, cand_idx_inst->result_id(), - builder.GetUintConstantId(1u)); - // Add candidate length index to start index - Instruction* len_idx_inst = builder.AddBinaryOp( - GetUintId(), spv::Op::OpIAdd, cand_len_idx_inst->result_id(), - len_start_32_inst->result_id()); - // Load candidate buffer length - Instruction* len_ac_inst = - builder.AddTernaryOp(ibuf_ptr_id, spv::Op::OpAccessChain, ibuf_id, - builder.GetUintConstantId(kDebugInputDataOffset), - len_idx_inst->result_id()); - Instruction* len_load_inst = builder.AddUnaryOp( - ibuf_type_id, spv::Op::OpLoad, len_ac_inst->result_id()); - // Test if reference end within candidate buffer length - Instruction* len_test_inst = builder.AddBinaryOp( - GetBoolId(), spv::Op::OpULessThanEqual, ref_end_inst->result_id(), - len_load_inst->result_id()); - // Return test result - (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, - len_test_inst->result_id()); - // Close block - input_func->AddBasicBlock(std::move(bound_test_blk_ptr)); - // Close function and add function to module - std::unique_ptr func_end_inst(new Instruction( - get_module()->context(), spv::Op::OpFunctionEnd, 0, 0, {})); - get_def_use_mgr()->AnalyzeInstDefUse(&*func_end_inst); - input_func->SetFunctionEnd(std::move(func_end_inst)); - context()->AddFunction(std::move(input_func)); - context()->AddDebug2Inst( - NewGlobalName(search_test_func_id_, "search_and_test")); - } - return search_test_func_id_; -} - -uint32_t InstBuffAddrCheckPass::GenSearchAndTest(Instruction* ref_inst, - InstructionBuilder* builder, - uint32_t* ref_uptr_id) { - // Enable Int64 if necessary - context()->AddCapability(spv::Capability::Int64); - // Convert reference pointer to uint64 - uint32_t ref_ptr_id = ref_inst->GetSingleWordInOperand(0); - Instruction* ref_uptr_inst = - builder->AddUnaryOp(GetUint64Id(), spv::Op::OpConvertPtrToU, ref_ptr_id); - *ref_uptr_id = ref_uptr_inst->result_id(); - // Compute reference length in bytes - analysis::DefUseManager* du_mgr = get_def_use_mgr(); - Instruction* ref_ptr_inst = du_mgr->GetDef(ref_ptr_id); - uint32_t ref_ptr_ty_id = ref_ptr_inst->type_id(); - Instruction* ref_ptr_ty_inst = du_mgr->GetDef(ref_ptr_ty_id); - uint32_t ref_len = GetTypeLength(ref_ptr_ty_inst->GetSingleWordInOperand(1)); - uint32_t ref_len_id = builder->GetUintConstantId(ref_len); - // Gen call to search and test function - Instruction* call_inst = builder->AddFunctionCall( - GetBoolId(), GetSearchAndTestFuncId(), {*ref_uptr_id, ref_len_id}); - uint32_t retval = call_inst->result_id(); - return retval; -} - -void InstBuffAddrCheckPass::GenBuffAddrCheckCode( - BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, uint32_t stage_idx, - std::vector>* new_blocks) { - // Look for reference through indexed descriptor. If found, analyze and - // save components. If not, return. - Instruction* ref_inst = &*ref_inst_itr; - if (!IsPhysicalBuffAddrReference(ref_inst)) return; - // Move original block's preceding instructions into first new block - std::unique_ptr new_blk_ptr; - MovePreludeCode(ref_inst_itr, ref_block_itr, &new_blk_ptr); - InstructionBuilder builder( - context(), &*new_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - new_blocks->push_back(std::move(new_blk_ptr)); - uint32_t error_id = builder.GetUintConstantId(kInstErrorBuffAddrUnallocRef); - // Generate code to do search and test if all bytes of reference - // are within a listed buffer. Return reference pointer converted to uint64. - uint32_t ref_uptr_id; - uint32_t valid_id = GenSearchAndTest(ref_inst, &builder, &ref_uptr_id); - // Generate test of search results with true branch - // being full reference and false branch being debug output and zero - // for the referenced value. - GenCheckCode(valid_id, error_id, ref_uptr_id, stage_idx, ref_inst, - new_blocks); - // Move original block's remaining code into remainder/merge block and add - // to new blocks - BasicBlock* back_blk_ptr = &*new_blocks->back(); - MovePostludeCode(ref_block_itr, back_blk_ptr); -} - -void InstBuffAddrCheckPass::InitInstBuffAddrCheck() { - // Initialize base class - InitializeInstrument(); - // Initialize class - search_test_func_id_ = 0; -} - -Pass::Status InstBuffAddrCheckPass::ProcessImpl() { - // Perform bindless bounds check on each entry point function in module - InstProcessFunction pfn = - [this](BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, uint32_t stage_idx, - std::vector>* new_blocks) { - return GenBuffAddrCheckCode(ref_inst_itr, ref_block_itr, stage_idx, - new_blocks); - }; - bool modified = InstProcessEntryPointCallTree(pfn); - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -Pass::Status InstBuffAddrCheckPass::Process() { - if (!get_feature_mgr()->HasCapability( - spv::Capability::PhysicalStorageBufferAddressesEXT)) - return Status::SuccessWithoutChange; - InitInstBuffAddrCheck(); - return ProcessImpl(); -} - -} // namespace opt -} // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h b/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h deleted file mode 100644 index 9c4b3ed9..00000000 --- a/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) 2019 The Khronos Group Inc. -// Copyright (c) 2019 Valve Corporation -// Copyright (c) 2019 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_INST_BUFFER_ADDRESS_PASS_H_ -#define LIBSPIRV_OPT_INST_BUFFER_ADDRESS_PASS_H_ - -#include "instrument_pass.h" - -namespace spvtools { -namespace opt { - -// This class/pass is designed to support the GPU-assisted validation layer of -// the Buffer Device Address (BDA) extension in -// https://github.com/KhronosGroup/Vulkan-ValidationLayers. The internal and -// external design of this class may change as the layer evolves. -class InstBuffAddrCheckPass : public InstrumentPass { - public: - // For test harness only - InstBuffAddrCheckPass() : InstrumentPass(7, 23, kInstValidationIdBuffAddr) {} - // For all other interfaces - InstBuffAddrCheckPass(uint32_t desc_set, uint32_t shader_id) - : InstrumentPass(desc_set, shader_id, kInstValidationIdBuffAddr) {} - - ~InstBuffAddrCheckPass() override = default; - - // See optimizer.hpp for pass user documentation. - Status Process() override; - - const char* name() const override { return "inst-buff-addr-check-pass"; } - - bool InstrumentFunction(Function* func, uint32_t stage_idx, - InstProcessFunction& pfn) override; - - private: - // Return byte length of type |type_id|. Must be int, float, vector, matrix, - // struct, array or physical pointer. Uses std430 alignment and sizes. - uint32_t GetTypeLength(uint32_t type_id); - - // Add |type_id| param to |input_func| and add id to |param_vec|. - void AddParam(uint32_t type_id, std::vector* param_vec, - std::unique_ptr* input_func); - - // Return id for search and test function. Generate it if not already gen'd. - uint32_t GetSearchAndTestFuncId(); - - // Generate code into |builder| to do search of the BDA debug input buffer - // for the buffer used by |ref_inst| and test that all bytes of reference - // are within the buffer. Returns id of boolean value which is true if - // search and test is successful, false otherwise. - uint32_t GenSearchAndTest(Instruction* ref_inst, InstructionBuilder* builder, - uint32_t* ref_uptr_id); - - // This function does checking instrumentation on a single - // instruction which references through a physical storage buffer address. - // GenBuffAddrCheckCode generates code that checks that all bytes that - // are referenced fall within a buffer that was queried via - // the Vulkan API call vkGetBufferDeviceAddressEXT(). - // - // The function is designed to be passed to - // InstrumentPass::InstProcessEntryPointCallTree(), which applies the - // function to each instruction in a module and replaces the instruction - // with instrumented code if warranted. - // - // If |ref_inst_itr| is a physical storage buffer reference, return in - // |new_blocks| the result of instrumenting it with validation code within - // its block at |ref_block_itr|. The validation code first executes a check - // for the specific condition called for. If the check passes, it executes - // the remainder of the reference, otherwise writes a record to the debug - // output buffer stream including |function_idx, instruction_idx, stage_idx| - // and replaces the reference with the null value of the original type. The - // block at |ref_block_itr| can just be replaced with the blocks in - // |new_blocks|, which will contain at least two blocks. The last block will - // comprise all instructions following |ref_inst_itr|, - // preceded by a phi instruction if needed. - // - // This instrumentation function utilizes GenDebugStreamWrite() to write its - // error records. The validation-specific part of the error record will - // have the format: - // - // Validation Error Code (=kInstErrorBuffAddr) - // Buffer Address (lowest 32 bits) - // Buffer Address (highest 32 bits) - // - void GenBuffAddrCheckCode( - BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, uint32_t stage_idx, - std::vector>* new_blocks); - - // Return true if |ref_inst| is a physical buffer address reference, false - // otherwise. - bool IsPhysicalBuffAddrReference(Instruction* ref_inst); - - // Clone original reference |ref_inst| into |builder| and return id of result - uint32_t CloneOriginalReference(Instruction* ref_inst, - InstructionBuilder* builder); - - // Generate instrumentation code for boolean test result |check_id|, - // adding new blocks to |new_blocks|. Generate conditional branch to valid - // or invalid reference blocks. Generate valid reference block which does - // original reference |ref_inst|. Then generate invalid reference block which - // writes debug error output utilizing |ref_inst|, |error_id| and - // |stage_idx|. Generate merge block for valid and invalid reference blocks. - // Kill original reference. - void GenCheckCode(uint32_t check_id, uint32_t error_id, uint32_t length_id, - uint32_t stage_idx, Instruction* ref_inst, - std::vector>* new_blocks); - - // Initialize state for instrumenting physical buffer address checking - void InitInstBuffAddrCheck(); - - // Apply GenBuffAddrCheckCode to every instruction in module. - Pass::Status ProcessImpl(); - - // Id of search and test function, if already gen'd, else zero. - uint32_t search_test_func_id_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INST_BUFFER_ADDRESS_PASS_H_ diff --git a/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp deleted file mode 100644 index f7c22745..00000000 --- a/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// Copyright (c) 2020 Valve Corporation -// Copyright (c) 2020 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "inst_debug_printf_pass.h" - -#include "source/util/string_utils.h" -#include "spirv/unified1/NonSemanticDebugPrintf.h" - -namespace spvtools { -namespace opt { - -void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst, - std::vector* val_ids, - InstructionBuilder* builder) { - uint32_t val_ty_id = val_inst->type_id(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Type* val_ty = type_mgr->GetType(val_ty_id); - switch (val_ty->kind()) { - case analysis::Type::kVector: { - analysis::Vector* v_ty = val_ty->AsVector(); - const analysis::Type* c_ty = v_ty->element_type(); - uint32_t c_ty_id = type_mgr->GetId(c_ty); - for (uint32_t c = 0; c < v_ty->element_count(); ++c) { - Instruction* c_inst = - builder->AddCompositeExtract(c_ty_id, val_inst->result_id(), {c}); - GenOutputValues(c_inst, val_ids, builder); - } - return; - } - case analysis::Type::kBool: { - // Select between uint32 zero or one - uint32_t zero_id = builder->GetUintConstantId(0); - uint32_t one_id = builder->GetUintConstantId(1); - Instruction* sel_inst = builder->AddSelect( - GetUintId(), val_inst->result_id(), one_id, zero_id); - val_ids->push_back(sel_inst->result_id()); - return; - } - case analysis::Type::kFloat: { - analysis::Float* f_ty = val_ty->AsFloat(); - switch (f_ty->width()) { - case 16: { - // Convert float16 to float32 and recurse - Instruction* f32_inst = builder->AddUnaryOp( - GetFloatId(), spv::Op::OpFConvert, val_inst->result_id()); - GenOutputValues(f32_inst, val_ids, builder); - return; - } - case 64: { - // Bitcast float64 to uint64 and recurse - Instruction* ui64_inst = builder->AddUnaryOp( - GetUint64Id(), spv::Op::OpBitcast, val_inst->result_id()); - GenOutputValues(ui64_inst, val_ids, builder); - return; - } - case 32: { - // Bitcase float32 to uint32 - Instruction* bc_inst = builder->AddUnaryOp( - GetUintId(), spv::Op::OpBitcast, val_inst->result_id()); - val_ids->push_back(bc_inst->result_id()); - return; - } - default: - assert(false && "unsupported float width"); - return; - } - } - case analysis::Type::kInteger: { - analysis::Integer* i_ty = val_ty->AsInteger(); - switch (i_ty->width()) { - case 64: { - Instruction* ui64_inst = val_inst; - if (i_ty->IsSigned()) { - // Bitcast sint64 to uint64 - ui64_inst = builder->AddUnaryOp(GetUint64Id(), spv::Op::OpBitcast, - val_inst->result_id()); - } - // Break uint64 into 2x uint32 - Instruction* lo_ui64_inst = builder->AddUnaryOp( - GetUintId(), spv::Op::OpUConvert, ui64_inst->result_id()); - Instruction* rshift_ui64_inst = builder->AddBinaryOp( - GetUint64Id(), spv::Op::OpShiftRightLogical, - ui64_inst->result_id(), builder->GetUintConstantId(32)); - Instruction* hi_ui64_inst = builder->AddUnaryOp( - GetUintId(), spv::Op::OpUConvert, rshift_ui64_inst->result_id()); - val_ids->push_back(lo_ui64_inst->result_id()); - val_ids->push_back(hi_ui64_inst->result_id()); - return; - } - case 8: { - Instruction* ui8_inst = val_inst; - if (i_ty->IsSigned()) { - // Bitcast sint8 to uint8 - ui8_inst = builder->AddUnaryOp(GetUint8Id(), spv::Op::OpBitcast, - val_inst->result_id()); - } - // Convert uint8 to uint32 - Instruction* ui32_inst = builder->AddUnaryOp( - GetUintId(), spv::Op::OpUConvert, ui8_inst->result_id()); - val_ids->push_back(ui32_inst->result_id()); - return; - } - case 32: { - Instruction* ui32_inst = val_inst; - if (i_ty->IsSigned()) { - // Bitcast sint32 to uint32 - ui32_inst = builder->AddUnaryOp(GetUintId(), spv::Op::OpBitcast, - val_inst->result_id()); - } - // uint32 needs no further processing - val_ids->push_back(ui32_inst->result_id()); - return; - } - default: - // TODO(greg-lunarg): Support non-32-bit int - assert(false && "unsupported int width"); - return; - } - } - default: - assert(false && "unsupported type"); - return; - } -} - -void InstDebugPrintfPass::GenOutputCode( - Instruction* printf_inst, uint32_t stage_idx, - std::vector>* new_blocks) { - BasicBlock* back_blk_ptr = &*new_blocks->back(); - InstructionBuilder builder( - context(), back_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - // Gen debug printf record validation-specific values. The format string - // will have its id written. Vectors will need to be broken down into - // component values. float16 will need to be converted to float32. Pointer - // and uint64 will need to be converted to two uint32 values. float32 will - // need to be bitcast to uint32. int32 will need to be bitcast to uint32. - std::vector val_ids; - bool is_first_operand = false; - printf_inst->ForEachInId( - [&is_first_operand, &val_ids, &builder, this](const uint32_t* iid) { - // skip set operand - if (!is_first_operand) { - is_first_operand = true; - return; - } - Instruction* opnd_inst = get_def_use_mgr()->GetDef(*iid); - if (opnd_inst->opcode() == spv::Op::OpString) { - uint32_t string_id_id = builder.GetUintConstantId(*iid); - val_ids.push_back(string_id_id); - } else { - GenOutputValues(opnd_inst, &val_ids, &builder); - } - }); - GenDebugStreamWrite( - builder.GetUintConstantId(shader_id_), - builder.GetUintConstantId(uid2offset_[printf_inst->unique_id()]), - GenStageInfo(stage_idx, &builder), val_ids, &builder); - context()->KillInst(printf_inst); -} - -void InstDebugPrintfPass::GenDebugPrintfCode( - BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, uint32_t stage_idx, - std::vector>* new_blocks) { - // If not DebugPrintf OpExtInst, return. - Instruction* printf_inst = &*ref_inst_itr; - if (printf_inst->opcode() != spv::Op::OpExtInst) return; - if (printf_inst->GetSingleWordInOperand(0) != ext_inst_printf_id_) return; - if (printf_inst->GetSingleWordInOperand(1) != - NonSemanticDebugPrintfDebugPrintf) - return; - // Initialize DefUse manager before dismantling module - (void)get_def_use_mgr(); - // Move original block's preceding instructions into first new block - std::unique_ptr new_blk_ptr; - MovePreludeCode(ref_inst_itr, ref_block_itr, &new_blk_ptr); - new_blocks->push_back(std::move(new_blk_ptr)); - // Generate instructions to output printf args to printf buffer - GenOutputCode(printf_inst, stage_idx, new_blocks); - // Caller expects at least two blocks with last block containing remaining - // code, so end block after instrumentation, create remainder block, and - // branch to it - uint32_t rem_blk_id = TakeNextId(); - std::unique_ptr rem_label(NewLabel(rem_blk_id)); - BasicBlock* back_blk_ptr = &*new_blocks->back(); - InstructionBuilder builder( - context(), back_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - (void)builder.AddBranch(rem_blk_id); - // Gen remainder block - new_blk_ptr.reset(new BasicBlock(std::move(rem_label))); - builder.SetInsertPoint(&*new_blk_ptr); - // Move original block's remaining code into remainder block and add - // to new blocks - MovePostludeCode(ref_block_itr, &*new_blk_ptr); - new_blocks->push_back(std::move(new_blk_ptr)); -} - -void InstDebugPrintfPass::InitializeInstDebugPrintf() { - // Initialize base class - InitializeInstrument(); -} - -Pass::Status InstDebugPrintfPass::ProcessImpl() { - // Perform printf instrumentation on each entry point function in module - InstProcessFunction pfn = - [this](BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, uint32_t stage_idx, - std::vector>* new_blocks) { - return GenDebugPrintfCode(ref_inst_itr, ref_block_itr, stage_idx, - new_blocks); - }; - (void)InstProcessEntryPointCallTree(pfn); - // Remove DebugPrintf OpExtInstImport instruction - Instruction* ext_inst_import_inst = - get_def_use_mgr()->GetDef(ext_inst_printf_id_); - context()->KillInst(ext_inst_import_inst); - // If no remaining non-semantic instruction sets, remove non-semantic debug - // info extension from module and feature manager - bool non_sem_set_seen = false; - for (auto c_itr = context()->module()->ext_inst_import_begin(); - c_itr != context()->module()->ext_inst_import_end(); ++c_itr) { - const std::string set_name = c_itr->GetInOperand(0).AsString(); - if (spvtools::utils::starts_with(set_name, "NonSemantic.")) { - non_sem_set_seen = true; - break; - } - } - if (!non_sem_set_seen) { - context()->RemoveExtension(kSPV_KHR_non_semantic_info); - } - return Status::SuccessWithChange; -} - -Pass::Status InstDebugPrintfPass::Process() { - ext_inst_printf_id_ = - get_module()->GetExtInstImportId("NonSemantic.DebugPrintf"); - if (ext_inst_printf_id_ == 0) return Status::SuccessWithoutChange; - InitializeInstDebugPrintf(); - return ProcessImpl(); -} - -} // namespace opt -} // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.h b/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.h deleted file mode 100644 index 70b0a72b..00000000 --- a/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.h +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) 2020 The Khronos Group Inc. -// Copyright (c) 2020 Valve Corporation -// Copyright (c) 2020 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_INST_DEBUG_PRINTF_PASS_H_ -#define LIBSPIRV_OPT_INST_DEBUG_PRINTF_PASS_H_ - -#include "instrument_pass.h" - -namespace spvtools { -namespace opt { - -// This class/pass is designed to support the debug printf GPU-assisted layer -// of https://github.com/KhronosGroup/Vulkan-ValidationLayers. Its internal and -// external design may change as the layer evolves. -class InstDebugPrintfPass : public InstrumentPass { - public: - // For test harness only - InstDebugPrintfPass() : InstrumentPass(7, 23, kInstValidationIdDebugPrintf) {} - // For all other interfaces - InstDebugPrintfPass(uint32_t desc_set, uint32_t shader_id) - : InstrumentPass(desc_set, shader_id, kInstValidationIdDebugPrintf) {} - - ~InstDebugPrintfPass() override = default; - - // See optimizer.hpp for pass user documentation. - Status Process() override; - - const char* name() const override { return "inst-printf-pass"; } - - private: - // Generate instructions for OpDebugPrintf. - // - // If |ref_inst_itr| is an OpDebugPrintf, return in |new_blocks| the result - // of replacing it with buffer write instructions within its block at - // |ref_block_itr|. The instructions write a record to the printf - // output buffer stream including |function_idx, instruction_idx, stage_idx| - // and removes the OpDebugPrintf. The block at |ref_block_itr| can just be - // replaced with the block in |new_blocks|. Besides the buffer writes, this - // block will comprise all instructions preceding and following - // |ref_inst_itr|. - // - // This function is designed to be passed to - // InstrumentPass::InstProcessEntryPointCallTree(), which applies the - // function to each instruction in a module and replaces the instruction - // if warranted. - // - // This instrumentation function utilizes GenDebugStreamWrite() to write its - // error records. The validation-specific part of the error record will - // consist of a uint32 which is the id of the format string plus a sequence - // of uint32s representing the values of the remaining operands of the - // DebugPrintf. - void GenDebugPrintfCode(BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, - uint32_t stage_idx, - std::vector>* new_blocks); - - // Generate a sequence of uint32 instructions in |builder| (if necessary) - // representing the value of |val_inst|, which must be a buffer pointer, a - // uint64, or a scalar or vector of type uint32, float32 or float16. Append - // the ids of all values to the end of |val_ids|. - void GenOutputValues(Instruction* val_inst, std::vector* val_ids, - InstructionBuilder* builder); - - // Generate instructions to write a record containing the operands of - // |printf_inst| arguments to printf buffer, adding new code to the end of - // the last block in |new_blocks|. Kill OpDebugPrintf instruction. - void GenOutputCode(Instruction* printf_inst, uint32_t stage_idx, - std::vector>* new_blocks); - - // Initialize state for instrumenting bindless checking - void InitializeInstDebugPrintf(); - - // Apply GenDebugPrintfCode to every instruction in module. - Pass::Status ProcessImpl(); - - uint32_t ext_inst_printf_id_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INST_DEBUG_PRINTF_PASS_H_ diff --git a/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp deleted file mode 100644 index bd01ee64..00000000 --- a/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp +++ /dev/null @@ -1,1197 +0,0 @@ -// Copyright (c) 2018 The Khronos Group Inc. -// Copyright (c) 2018 Valve Corporation -// Copyright (c) 2018 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "instrument_pass.h" - -#include "source/cfa.h" -#include "source/spirv_constant.h" - -namespace spvtools { -namespace opt { -namespace { -// Indices of operands in SPIR-V instructions -constexpr int kEntryPointFunctionIdInIdx = 1; -} // namespace - -void InstrumentPass::MovePreludeCode( - BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, - std::unique_ptr* new_blk_ptr) { - same_block_pre_.clear(); - same_block_post_.clear(); - // Initialize new block. Reuse label from original block. - new_blk_ptr->reset(new BasicBlock(std::move(ref_block_itr->GetLabel()))); - // Move contents of original ref block up to ref instruction. - for (auto cii = ref_block_itr->begin(); cii != ref_inst_itr; - cii = ref_block_itr->begin()) { - Instruction* inst = &*cii; - inst->RemoveFromList(); - std::unique_ptr mv_ptr(inst); - // Remember same-block ops for possible regeneration. - if (IsSameBlockOp(&*mv_ptr)) { - auto* sb_inst_ptr = mv_ptr.get(); - same_block_pre_[mv_ptr->result_id()] = sb_inst_ptr; - } - (*new_blk_ptr)->AddInstruction(std::move(mv_ptr)); - } -} - -void InstrumentPass::MovePostludeCode( - UptrVectorIterator ref_block_itr, BasicBlock* new_blk_ptr) { - // Move contents of original ref block. - for (auto cii = ref_block_itr->begin(); cii != ref_block_itr->end(); - cii = ref_block_itr->begin()) { - Instruction* inst = &*cii; - inst->RemoveFromList(); - std::unique_ptr mv_inst(inst); - // Regenerate any same-block instruction that has not been seen in the - // current block. - if (same_block_pre_.size() > 0) { - CloneSameBlockOps(&mv_inst, &same_block_post_, &same_block_pre_, - new_blk_ptr); - // Remember same-block ops in this block. - if (IsSameBlockOp(&*mv_inst)) { - const uint32_t rid = mv_inst->result_id(); - same_block_post_[rid] = rid; - } - } - new_blk_ptr->AddInstruction(std::move(mv_inst)); - } -} - -std::unique_ptr InstrumentPass::NewLabel(uint32_t label_id) { - auto new_label = - MakeUnique(context(), spv::Op::OpLabel, 0, label_id, - std::initializer_list{}); - get_def_use_mgr()->AnalyzeInstDefUse(&*new_label); - return new_label; -} - -std::unique_ptr InstrumentPass::StartFunction( - uint32_t func_id, const analysis::Type* return_type, - const std::vector& param_types) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Function* func_type = GetFunction(return_type, param_types); - - const std::vector operands{ - {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {uint32_t(spv::FunctionControlMask::MaskNone)}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_mgr->GetId(func_type)}}, - }; - auto func_inst = - MakeUnique(context(), spv::Op::OpFunction, - type_mgr->GetId(return_type), func_id, operands); - get_def_use_mgr()->AnalyzeInstDefUse(&*func_inst); - return MakeUnique(std::move(func_inst)); -} - -std::unique_ptr InstrumentPass::EndFunction() { - auto end = MakeUnique(context(), spv::Op::OpFunctionEnd, 0, 0, - std::initializer_list{}); - get_def_use_mgr()->AnalyzeInstDefUse(end.get()); - return end; -} - -std::vector InstrumentPass::AddParameters( - Function& func, const std::vector& param_types) { - std::vector param_ids; - param_ids.reserve(param_types.size()); - for (const analysis::Type* param : param_types) { - uint32_t pid = TakeNextId(); - param_ids.push_back(pid); - auto param_inst = - MakeUnique(context(), spv::Op::OpFunctionParameter, - context()->get_type_mgr()->GetId(param), pid, - std::initializer_list{}); - get_def_use_mgr()->AnalyzeInstDefUse(param_inst.get()); - func.AddParameter(std::move(param_inst)); - } - return param_ids; -} - -std::unique_ptr InstrumentPass::NewName( - uint32_t id, const std::string& name_str) { - return MakeUnique( - context(), spv::Op::OpName, 0, 0, - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {id}}, - {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}}); -} - -std::unique_ptr InstrumentPass::NewGlobalName( - uint32_t id, const std::string& name_str) { - std::string prefixed_name; - switch (validation_id_) { - case kInstValidationIdBindless: - prefixed_name = "inst_bindless_"; - break; - case kInstValidationIdBuffAddr: - prefixed_name = "inst_buff_addr_"; - break; - case kInstValidationIdDebugPrintf: - prefixed_name = "inst_printf_"; - break; - default: - assert(false); // add new instrumentation pass here - prefixed_name = "inst_pass_"; - break; - } - prefixed_name += name_str; - return NewName(id, prefixed_name); -} - -std::unique_ptr InstrumentPass::NewMemberName( - uint32_t id, uint32_t member_index, const std::string& name_str) { - return MakeUnique( - context(), spv::Op::OpMemberName, 0, 0, - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {id}}, - {SPV_OPERAND_TYPE_LITERAL_INTEGER, {member_index}}, - {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}}); -} - -uint32_t InstrumentPass::Gen32BitCvtCode(uint32_t val_id, - InstructionBuilder* builder) { - // Convert integer value to 32-bit if necessary - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - uint32_t val_ty_id = get_def_use_mgr()->GetDef(val_id)->type_id(); - analysis::Integer* val_ty = type_mgr->GetType(val_ty_id)->AsInteger(); - if (val_ty->width() == 32) return val_id; - bool is_signed = val_ty->IsSigned(); - analysis::Integer val_32b_ty(32, is_signed); - analysis::Type* val_32b_reg_ty = type_mgr->GetRegisteredType(&val_32b_ty); - uint32_t val_32b_reg_ty_id = type_mgr->GetId(val_32b_reg_ty); - if (is_signed) - return builder->AddUnaryOp(val_32b_reg_ty_id, spv::Op::OpSConvert, val_id) - ->result_id(); - else - return builder->AddUnaryOp(val_32b_reg_ty_id, spv::Op::OpUConvert, val_id) - ->result_id(); -} - -uint32_t InstrumentPass::GenUintCastCode(uint32_t val_id, - InstructionBuilder* builder) { - // Convert value to 32-bit if necessary - uint32_t val_32b_id = Gen32BitCvtCode(val_id, builder); - // Cast value to unsigned if necessary - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - uint32_t val_ty_id = get_def_use_mgr()->GetDef(val_32b_id)->type_id(); - analysis::Integer* val_ty = type_mgr->GetType(val_ty_id)->AsInteger(); - if (!val_ty->IsSigned()) return val_32b_id; - return builder->AddUnaryOp(GetUintId(), spv::Op::OpBitcast, val_32b_id) - ->result_id(); -} - -void InstrumentPass::GenDebugOutputFieldCode(uint32_t base_offset_id, - uint32_t field_offset, - uint32_t field_value_id, - InstructionBuilder* builder) { - // Cast value to 32-bit unsigned if necessary - uint32_t val_id = GenUintCastCode(field_value_id, builder); - // Store value - Instruction* data_idx_inst = builder->AddIAdd( - GetUintId(), base_offset_id, builder->GetUintConstantId(field_offset)); - uint32_t buf_id = GetOutputBufferId(); - uint32_t buf_uint_ptr_id = GetOutputBufferPtrId(); - Instruction* achain_inst = builder->AddAccessChain( - buf_uint_ptr_id, buf_id, - {builder->GetUintConstantId(kDebugOutputDataOffset), - data_idx_inst->result_id()}); - (void)builder->AddStore(achain_inst->result_id(), val_id); -} - -uint32_t InstrumentPass::GenVarLoad(uint32_t var_id, - InstructionBuilder* builder) { - Instruction* var_inst = get_def_use_mgr()->GetDef(var_id); - uint32_t type_id = GetPointeeTypeId(var_inst); - Instruction* load_inst = builder->AddLoad(type_id, var_id); - return load_inst->result_id(); -} - -uint32_t InstrumentPass::GenStageInfo(uint32_t stage_idx, - InstructionBuilder* builder) { - std::vector ids(4, builder->GetUintConstantId(0)); - ids[0] = builder->GetUintConstantId(stage_idx); - // %289 = OpCompositeConstruct %v4uint %uint_0 %285 %288 %uint_0 - // TODO(greg-lunarg): Add support for all stages - switch (spv::ExecutionModel(stage_idx)) { - case spv::ExecutionModel::Vertex: { - // Load and store VertexId and InstanceId - uint32_t load_id = GenVarLoad( - context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::VertexIndex)), - builder); - ids[1] = GenUintCastCode(load_id, builder); - - load_id = GenVarLoad(context()->GetBuiltinInputVarId( - uint32_t(spv::BuiltIn::InstanceIndex)), - builder); - ids[2] = GenUintCastCode(load_id, builder); - } break; - case spv::ExecutionModel::GLCompute: - case spv::ExecutionModel::TaskNV: - case spv::ExecutionModel::MeshNV: - case spv::ExecutionModel::TaskEXT: - case spv::ExecutionModel::MeshEXT: { - // Load and store GlobalInvocationId. - uint32_t load_id = GenVarLoad(context()->GetBuiltinInputVarId(uint32_t( - spv::BuiltIn::GlobalInvocationId)), - builder); - for (uint32_t u = 0; u < 3u; ++u) { - ids[u + 1] = builder->AddCompositeExtract(GetUintId(), load_id, {u}) - ->result_id(); - } - } break; - case spv::ExecutionModel::Geometry: { - // Load and store PrimitiveId and InvocationId. - uint32_t load_id = GenVarLoad( - context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::PrimitiveId)), - builder); - ids[1] = load_id; - load_id = GenVarLoad( - context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::InvocationId)), - builder); - ids[2] = load_id; - } break; - case spv::ExecutionModel::TessellationControl: { - // Load and store InvocationId and PrimitiveId - uint32_t load_id = GenVarLoad( - context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::InvocationId)), - builder); - ids[1] = load_id; - load_id = GenVarLoad( - context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::PrimitiveId)), - builder); - ids[2] = load_id; - } break; - case spv::ExecutionModel::TessellationEvaluation: { - // Load and store PrimitiveId and TessCoord.uv - uint32_t load_id = GenVarLoad( - context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::PrimitiveId)), - builder); - ids[1] = load_id; - load_id = GenVarLoad( - context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::TessCoord)), - builder); - Instruction* uvec3_cast_inst = - builder->AddUnaryOp(GetVec3UintId(), spv::Op::OpBitcast, load_id); - uint32_t uvec3_cast_id = uvec3_cast_inst->result_id(); - for (uint32_t u = 0; u < 2u; ++u) { - ids[u + 2] = - builder->AddCompositeExtract(GetUintId(), uvec3_cast_id, {u}) - ->result_id(); - } - } break; - case spv::ExecutionModel::Fragment: { - // Load FragCoord and convert to Uint - Instruction* frag_coord_inst = builder->AddLoad( - GetVec4FloatId(), - context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::FragCoord))); - Instruction* uint_frag_coord_inst = builder->AddUnaryOp( - GetVec4UintId(), spv::Op::OpBitcast, frag_coord_inst->result_id()); - for (uint32_t u = 0; u < 2u; ++u) { - ids[u + 1] = - builder - ->AddCompositeExtract(GetUintId(), - uint_frag_coord_inst->result_id(), {u}) - ->result_id(); - } - } break; - case spv::ExecutionModel::RayGenerationNV: - case spv::ExecutionModel::IntersectionNV: - case spv::ExecutionModel::AnyHitNV: - case spv::ExecutionModel::ClosestHitNV: - case spv::ExecutionModel::MissNV: - case spv::ExecutionModel::CallableNV: { - // Load and store LaunchIdNV. - uint32_t launch_id = GenVarLoad( - context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::LaunchIdNV)), - builder); - for (uint32_t u = 0; u < 3u; ++u) { - ids[u + 1] = builder->AddCompositeExtract(GetUintId(), launch_id, {u}) - ->result_id(); - } - } break; - default: { assert(false && "unsupported stage"); } break; - } - return builder->AddCompositeConstruct(GetVec4UintId(), ids)->result_id(); -} - -void InstrumentPass::GenDebugStreamWrite( - uint32_t shader_id, uint32_t instruction_idx_id, uint32_t stage_info_id, - const std::vector& validation_ids, InstructionBuilder* builder) { - // Call debug output function. Pass func_idx, instruction_idx and - // validation ids as args. - uint32_t val_id_cnt = static_cast(validation_ids.size()); - std::vector args = {shader_id, instruction_idx_id, stage_info_id}; - (void)args.insert(args.end(), validation_ids.begin(), validation_ids.end()); - (void)builder->AddFunctionCall(GetVoidId(), - GetStreamWriteFunctionId(val_id_cnt), args); -} - -bool InstrumentPass::AllConstant(const std::vector& ids) { - for (auto& id : ids) { - Instruction* id_inst = context()->get_def_use_mgr()->GetDef(id); - if (!spvOpcodeIsConstant(id_inst->opcode())) return false; - } - return true; -} - -uint32_t InstrumentPass::GenDebugDirectRead( - const std::vector& offset_ids, InstructionBuilder* builder) { - // Call debug input function. Pass func_idx and offset ids as args. - const uint32_t off_id_cnt = static_cast(offset_ids.size()); - const uint32_t input_func_id = GetDirectReadFunctionId(off_id_cnt); - return GenReadFunctionCall(GetUintId(), input_func_id, offset_ids, builder); -} - -uint32_t InstrumentPass::GenReadFunctionCall( - uint32_t return_id, uint32_t func_id, - const std::vector& func_call_args, - InstructionBuilder* ref_builder) { - // If optimizing direct reads and the call has already been generated, - // use its result - if (opt_direct_reads_) { - uint32_t res_id = call2id_[func_call_args]; - if (res_id != 0) return res_id; - } - // If the function arguments are all constants, the call can be moved to the - // first block of the function where its result can be reused. One example - // where this is profitable is for uniform buffer references, of which there - // are often many. - InstructionBuilder builder(ref_builder->GetContext(), - &*ref_builder->GetInsertPoint(), - ref_builder->GetPreservedAnalysis()); - bool insert_in_first_block = opt_direct_reads_ && AllConstant(func_call_args); - if (insert_in_first_block) { - Instruction* insert_before = &*curr_func_->begin()->tail(); - builder.SetInsertPoint(insert_before); - } - uint32_t res_id = - builder.AddFunctionCall(return_id, func_id, func_call_args)->result_id(); - if (insert_in_first_block) call2id_[func_call_args] = res_id; - return res_id; -} - -bool InstrumentPass::IsSameBlockOp(const Instruction* inst) const { - return inst->opcode() == spv::Op::OpSampledImage || - inst->opcode() == spv::Op::OpImage; -} - -void InstrumentPass::CloneSameBlockOps( - std::unique_ptr* inst, - std::unordered_map* same_blk_post, - std::unordered_map* same_blk_pre, - BasicBlock* block_ptr) { - bool changed = false; - (*inst)->ForEachInId([&same_blk_post, &same_blk_pre, &block_ptr, &changed, - this](uint32_t* iid) { - const auto map_itr = (*same_blk_post).find(*iid); - if (map_itr == (*same_blk_post).end()) { - const auto map_itr2 = (*same_blk_pre).find(*iid); - if (map_itr2 != (*same_blk_pre).end()) { - // Clone pre-call same-block ops, map result id. - const Instruction* in_inst = map_itr2->second; - std::unique_ptr sb_inst(in_inst->Clone(context())); - const uint32_t rid = sb_inst->result_id(); - const uint32_t nid = this->TakeNextId(); - get_decoration_mgr()->CloneDecorations(rid, nid); - sb_inst->SetResultId(nid); - get_def_use_mgr()->AnalyzeInstDefUse(&*sb_inst); - (*same_blk_post)[rid] = nid; - *iid = nid; - changed = true; - CloneSameBlockOps(&sb_inst, same_blk_post, same_blk_pre, block_ptr); - block_ptr->AddInstruction(std::move(sb_inst)); - } - } else { - // Reset same-block op operand if necessary - if (*iid != map_itr->second) { - *iid = map_itr->second; - changed = true; - } - } - }); - if (changed) get_def_use_mgr()->AnalyzeInstUse(&**inst); -} - -void InstrumentPass::UpdateSucceedingPhis( - std::vector>& new_blocks) { - const auto first_blk = new_blocks.begin(); - const auto last_blk = new_blocks.end() - 1; - const uint32_t first_id = (*first_blk)->id(); - const uint32_t last_id = (*last_blk)->id(); - const BasicBlock& const_last_block = *last_blk->get(); - const_last_block.ForEachSuccessorLabel( - [&first_id, &last_id, this](const uint32_t succ) { - BasicBlock* sbp = this->id2block_[succ]; - sbp->ForEachPhiInst([&first_id, &last_id, this](Instruction* phi) { - bool changed = false; - phi->ForEachInId([&first_id, &last_id, &changed](uint32_t* id) { - if (*id == first_id) { - *id = last_id; - changed = true; - } - }); - if (changed) get_def_use_mgr()->AnalyzeInstUse(phi); - }); - }); -} - -uint32_t InstrumentPass::GetOutputBufferPtrId() { - if (output_buffer_ptr_id_ == 0) { - output_buffer_ptr_id_ = context()->get_type_mgr()->FindPointerToType( - GetUintId(), spv::StorageClass::StorageBuffer); - } - return output_buffer_ptr_id_; -} - -uint32_t InstrumentPass::GetInputBufferTypeId() { - return (validation_id_ == kInstValidationIdBuffAddr) ? GetUint64Id() - : GetUintId(); -} - -uint32_t InstrumentPass::GetInputBufferPtrId() { - if (input_buffer_ptr_id_ == 0) { - input_buffer_ptr_id_ = context()->get_type_mgr()->FindPointerToType( - GetInputBufferTypeId(), spv::StorageClass::StorageBuffer); - } - return input_buffer_ptr_id_; -} - -uint32_t InstrumentPass::GetOutputBufferBinding() { - switch (validation_id_) { - case kInstValidationIdBindless: - return kDebugOutputBindingStream; - case kInstValidationIdBuffAddr: - return kDebugOutputBindingStream; - case kInstValidationIdDebugPrintf: - return kDebugOutputPrintfStream; - default: - assert(false && "unexpected validation id"); - } - return 0; -} - -uint32_t InstrumentPass::GetInputBufferBinding() { - switch (validation_id_) { - case kInstValidationIdBindless: - return kDebugInputBindingBindless; - case kInstValidationIdBuffAddr: - return kDebugInputBindingBuffAddr; - default: - assert(false && "unexpected validation id"); - } - return 0; -} - -analysis::Integer* InstrumentPass::GetInteger(uint32_t width, bool is_signed) { - analysis::Integer i(width, is_signed); - analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&i); - assert(type && type->AsInteger()); - return type->AsInteger(); -} - -analysis::Struct* InstrumentPass::GetStruct( - const std::vector& fields) { - analysis::Struct s(fields); - analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&s); - assert(type && type->AsStruct()); - return type->AsStruct(); -} - -analysis::RuntimeArray* InstrumentPass::GetRuntimeArray( - const analysis::Type* element) { - analysis::RuntimeArray r(element); - analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&r); - assert(type && type->AsRuntimeArray()); - return type->AsRuntimeArray(); -} - -analysis::Array* InstrumentPass::GetArray(const analysis::Type* element, - uint32_t length) { - uint32_t length_id = context()->get_constant_mgr()->GetUIntConstId(length); - analysis::Array::LengthInfo length_info{ - length_id, {analysis::Array::LengthInfo::Case::kConstant, length}}; - - analysis::Array r(element, length_info); - - analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&r); - assert(type && type->AsArray()); - return type->AsArray(); -} - -analysis::Function* InstrumentPass::GetFunction( - const analysis::Type* return_val, - const std::vector& args) { - analysis::Function func(return_val, args); - analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&func); - assert(type && type->AsFunction()); - return type->AsFunction(); -} - -analysis::RuntimeArray* InstrumentPass::GetUintXRuntimeArrayType( - uint32_t width, analysis::RuntimeArray** rarr_ty) { - if (*rarr_ty == nullptr) { - *rarr_ty = GetRuntimeArray(GetInteger(width, false)); - uint32_t uint_arr_ty_id = - context()->get_type_mgr()->GetTypeInstruction(*rarr_ty); - // By the Vulkan spec, a pre-existing RuntimeArray of uint must be part of - // a block, and will therefore be decorated with an ArrayStride. Therefore - // the undecorated type returned here will not be pre-existing and can - // safely be decorated. Since this type is now decorated, it is out of - // sync with the TypeManager and therefore the TypeManager must be - // invalidated after this pass. - assert(get_def_use_mgr()->NumUses(uint_arr_ty_id) == 0 && - "used RuntimeArray type returned"); - get_decoration_mgr()->AddDecorationVal( - uint_arr_ty_id, uint32_t(spv::Decoration::ArrayStride), width / 8u); - } - return *rarr_ty; -} - -analysis::RuntimeArray* InstrumentPass::GetUintRuntimeArrayType( - uint32_t width) { - analysis::RuntimeArray** rarr_ty = - (width == 64) ? &uint64_rarr_ty_ : &uint32_rarr_ty_; - return GetUintXRuntimeArrayType(width, rarr_ty); -} - -void InstrumentPass::AddStorageBufferExt() { - if (storage_buffer_ext_defined_) return; - if (!get_feature_mgr()->HasExtension(kSPV_KHR_storage_buffer_storage_class)) { - context()->AddExtension("SPV_KHR_storage_buffer_storage_class"); - } - storage_buffer_ext_defined_ = true; -} - -// Return id for output buffer -uint32_t InstrumentPass::GetOutputBufferId() { - if (output_buffer_id_ == 0) { - // If not created yet, create one - analysis::DecorationManager* deco_mgr = get_decoration_mgr(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::RuntimeArray* reg_uint_rarr_ty = GetUintRuntimeArrayType(32); - analysis::Integer* reg_uint_ty = GetInteger(32, false); - analysis::Type* reg_buf_ty = - GetStruct({reg_uint_ty, reg_uint_ty, reg_uint_rarr_ty}); - uint32_t obufTyId = type_mgr->GetTypeInstruction(reg_buf_ty); - // By the Vulkan spec, a pre-existing struct containing a RuntimeArray - // must be a block, and will therefore be decorated with Block. Therefore - // the undecorated type returned here will not be pre-existing and can - // safely be decorated. Since this type is now decorated, it is out of - // sync with the TypeManager and therefore the TypeManager must be - // invalidated after this pass. - assert(context()->get_def_use_mgr()->NumUses(obufTyId) == 0 && - "used struct type returned"); - deco_mgr->AddDecoration(obufTyId, uint32_t(spv::Decoration::Block)); - deco_mgr->AddMemberDecoration(obufTyId, kDebugOutputFlagsOffset, - uint32_t(spv::Decoration::Offset), 0); - deco_mgr->AddMemberDecoration(obufTyId, kDebugOutputSizeOffset, - uint32_t(spv::Decoration::Offset), 4); - deco_mgr->AddMemberDecoration(obufTyId, kDebugOutputDataOffset, - uint32_t(spv::Decoration::Offset), 8); - uint32_t obufTyPtrId_ = - type_mgr->FindPointerToType(obufTyId, spv::StorageClass::StorageBuffer); - output_buffer_id_ = TakeNextId(); - std::unique_ptr newVarOp(new Instruction( - context(), spv::Op::OpVariable, obufTyPtrId_, output_buffer_id_, - {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {uint32_t(spv::StorageClass::StorageBuffer)}}})); - context()->AddGlobalValue(std::move(newVarOp)); - context()->AddDebug2Inst(NewGlobalName(obufTyId, "OutputBuffer")); - context()->AddDebug2Inst(NewMemberName(obufTyId, 0, "flags")); - context()->AddDebug2Inst(NewMemberName(obufTyId, 1, "written_count")); - context()->AddDebug2Inst(NewMemberName(obufTyId, 2, "data")); - context()->AddDebug2Inst(NewGlobalName(output_buffer_id_, "output_buffer")); - deco_mgr->AddDecorationVal( - output_buffer_id_, uint32_t(spv::Decoration::DescriptorSet), desc_set_); - deco_mgr->AddDecorationVal(output_buffer_id_, - uint32_t(spv::Decoration::Binding), - GetOutputBufferBinding()); - AddStorageBufferExt(); - if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { - // Add the new buffer to all entry points. - for (auto& entry : get_module()->entry_points()) { - entry.AddOperand({SPV_OPERAND_TYPE_ID, {output_buffer_id_}}); - context()->AnalyzeUses(&entry); - } - } - } - return output_buffer_id_; -} - -uint32_t InstrumentPass::GetInputBufferId() { - if (input_buffer_id_ == 0) { - // If not created yet, create one - analysis::DecorationManager* deco_mgr = get_decoration_mgr(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - uint32_t width = (validation_id_ == kInstValidationIdBuffAddr) ? 64u : 32u; - analysis::Type* reg_uint_rarr_ty = GetUintRuntimeArrayType(width); - analysis::Struct* reg_buf_ty = GetStruct({reg_uint_rarr_ty}); - uint32_t ibufTyId = type_mgr->GetTypeInstruction(reg_buf_ty); - // By the Vulkan spec, a pre-existing struct containing a RuntimeArray - // must be a block, and will therefore be decorated with Block. Therefore - // the undecorated type returned here will not be pre-existing and can - // safely be decorated. Since this type is now decorated, it is out of - // sync with the TypeManager and therefore the TypeManager must be - // invalidated after this pass. - assert(context()->get_def_use_mgr()->NumUses(ibufTyId) == 0 && - "used struct type returned"); - deco_mgr->AddDecoration(ibufTyId, uint32_t(spv::Decoration::Block)); - deco_mgr->AddMemberDecoration(ibufTyId, 0, - uint32_t(spv::Decoration::Offset), 0); - uint32_t ibufTyPtrId_ = - type_mgr->FindPointerToType(ibufTyId, spv::StorageClass::StorageBuffer); - input_buffer_id_ = TakeNextId(); - std::unique_ptr newVarOp(new Instruction( - context(), spv::Op::OpVariable, ibufTyPtrId_, input_buffer_id_, - {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {uint32_t(spv::StorageClass::StorageBuffer)}}})); - context()->AddGlobalValue(std::move(newVarOp)); - context()->AddDebug2Inst(NewGlobalName(ibufTyId, "InputBuffer")); - context()->AddDebug2Inst(NewMemberName(ibufTyId, 0, "data")); - context()->AddDebug2Inst(NewGlobalName(input_buffer_id_, "input_buffer")); - deco_mgr->AddDecorationVal( - input_buffer_id_, uint32_t(spv::Decoration::DescriptorSet), desc_set_); - deco_mgr->AddDecorationVal(input_buffer_id_, - uint32_t(spv::Decoration::Binding), - GetInputBufferBinding()); - AddStorageBufferExt(); - if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { - // Add the new buffer to all entry points. - for (auto& entry : get_module()->entry_points()) { - entry.AddOperand({SPV_OPERAND_TYPE_ID, {input_buffer_id_}}); - context()->AnalyzeUses(&entry); - } - } - } - return input_buffer_id_; -} - -uint32_t InstrumentPass::GetFloatId() { - if (float_id_ == 0) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Float float_ty(32); - analysis::Type* reg_float_ty = type_mgr->GetRegisteredType(&float_ty); - float_id_ = type_mgr->GetTypeInstruction(reg_float_ty); - } - return float_id_; -} - -uint32_t InstrumentPass::GetVec4FloatId() { - if (v4float_id_ == 0) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Float float_ty(32); - analysis::Type* reg_float_ty = type_mgr->GetRegisteredType(&float_ty); - analysis::Vector v4float_ty(reg_float_ty, 4); - analysis::Type* reg_v4float_ty = type_mgr->GetRegisteredType(&v4float_ty); - v4float_id_ = type_mgr->GetTypeInstruction(reg_v4float_ty); - } - return v4float_id_; -} - -uint32_t InstrumentPass::GetUintId() { - if (uint_id_ == 0) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Integer uint_ty(32, false); - analysis::Type* reg_uint_ty = type_mgr->GetRegisteredType(&uint_ty); - uint_id_ = type_mgr->GetTypeInstruction(reg_uint_ty); - } - return uint_id_; -} - -uint32_t InstrumentPass::GetUint64Id() { - if (uint64_id_ == 0) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Integer uint64_ty(64, false); - analysis::Type* reg_uint64_ty = type_mgr->GetRegisteredType(&uint64_ty); - uint64_id_ = type_mgr->GetTypeInstruction(reg_uint64_ty); - } - return uint64_id_; -} - -uint32_t InstrumentPass::GetUint8Id() { - if (uint8_id_ == 0) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Integer uint8_ty(8, false); - analysis::Type* reg_uint8_ty = type_mgr->GetRegisteredType(&uint8_ty); - uint8_id_ = type_mgr->GetTypeInstruction(reg_uint8_ty); - } - return uint8_id_; -} - -uint32_t InstrumentPass::GetVecUintId(uint32_t len) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Integer uint_ty(32, false); - analysis::Type* reg_uint_ty = type_mgr->GetRegisteredType(&uint_ty); - analysis::Vector v_uint_ty(reg_uint_ty, len); - analysis::Type* reg_v_uint_ty = type_mgr->GetRegisteredType(&v_uint_ty); - uint32_t v_uint_id = type_mgr->GetTypeInstruction(reg_v_uint_ty); - return v_uint_id; -} - -uint32_t InstrumentPass::GetVec4UintId() { - if (v4uint_id_ == 0) v4uint_id_ = GetVecUintId(4u); - return v4uint_id_; -} - -uint32_t InstrumentPass::GetVec3UintId() { - if (v3uint_id_ == 0) v3uint_id_ = GetVecUintId(3u); - return v3uint_id_; -} - -uint32_t InstrumentPass::GetBoolId() { - if (bool_id_ == 0) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Bool bool_ty; - analysis::Type* reg_bool_ty = type_mgr->GetRegisteredType(&bool_ty); - bool_id_ = type_mgr->GetTypeInstruction(reg_bool_ty); - } - return bool_id_; -} - -uint32_t InstrumentPass::GetVoidId() { - if (void_id_ == 0) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Void void_ty; - analysis::Type* reg_void_ty = type_mgr->GetRegisteredType(&void_ty); - void_id_ = type_mgr->GetTypeInstruction(reg_void_ty); - } - return void_id_; -} - -uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t param_cnt) { - enum { - kShaderId = 0, - kInstructionIndex = 1, - kStageInfo = 2, - kFirstParam = 3, - }; - // Total param count is common params plus validation-specific - // params - if (param2output_func_id_[param_cnt] == 0) { - // Create function - param2output_func_id_[param_cnt] = TakeNextId(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - - const analysis::Type* uint_type = GetInteger(32, false); - const analysis::Vector v4uint(uint_type, 4); - const analysis::Type* v4uint_type = type_mgr->GetRegisteredType(&v4uint); - - std::vector param_types(kFirstParam + param_cnt, - uint_type); - param_types[kStageInfo] = v4uint_type; - std::unique_ptr output_func = StartFunction( - param2output_func_id_[param_cnt], type_mgr->GetVoidType(), param_types); - - std::vector param_ids = AddParameters(*output_func, param_types); - - // Create first block - auto new_blk_ptr = MakeUnique(NewLabel(TakeNextId())); - - InstructionBuilder builder( - context(), &*new_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - // Gen test if debug output buffer size will not be exceeded. - const uint32_t val_spec_offset = kInstStageOutCnt; - const uint32_t obuf_record_sz = val_spec_offset + param_cnt; - const uint32_t buf_id = GetOutputBufferId(); - const uint32_t buf_uint_ptr_id = GetOutputBufferPtrId(); - Instruction* obuf_curr_sz_ac_inst = builder.AddAccessChain( - buf_uint_ptr_id, buf_id, - {builder.GetUintConstantId(kDebugOutputSizeOffset)}); - // Fetch the current debug buffer written size atomically, adding the - // size of the record to be written. - uint32_t obuf_record_sz_id = builder.GetUintConstantId(obuf_record_sz); - uint32_t mask_none_id = - builder.GetUintConstantId(uint32_t(spv::MemoryAccessMask::MaskNone)); - uint32_t scope_invok_id = - builder.GetUintConstantId(uint32_t(spv::Scope::Invocation)); - Instruction* obuf_curr_sz_inst = builder.AddQuadOp( - GetUintId(), spv::Op::OpAtomicIAdd, obuf_curr_sz_ac_inst->result_id(), - scope_invok_id, mask_none_id, obuf_record_sz_id); - uint32_t obuf_curr_sz_id = obuf_curr_sz_inst->result_id(); - // Compute new written size - Instruction* obuf_new_sz_inst = - builder.AddIAdd(GetUintId(), obuf_curr_sz_id, - builder.GetUintConstantId(obuf_record_sz)); - // Fetch the data bound - Instruction* obuf_bnd_inst = - builder.AddIdLiteralOp(GetUintId(), spv::Op::OpArrayLength, - GetOutputBufferId(), kDebugOutputDataOffset); - // Test that new written size is less than or equal to debug output - // data bound - Instruction* obuf_safe_inst = builder.AddBinaryOp( - GetBoolId(), spv::Op::OpULessThanEqual, obuf_new_sz_inst->result_id(), - obuf_bnd_inst->result_id()); - uint32_t merge_blk_id = TakeNextId(); - uint32_t write_blk_id = TakeNextId(); - std::unique_ptr merge_label(NewLabel(merge_blk_id)); - std::unique_ptr write_label(NewLabel(write_blk_id)); - (void)builder.AddConditionalBranch( - obuf_safe_inst->result_id(), write_blk_id, merge_blk_id, merge_blk_id, - uint32_t(spv::SelectionControlMask::MaskNone)); - // Close safety test block and gen write block - output_func->AddBasicBlock(std::move(new_blk_ptr)); - new_blk_ptr = MakeUnique(std::move(write_label)); - builder.SetInsertPoint(&*new_blk_ptr); - // Generate common and stage-specific debug record members - GenDebugOutputFieldCode(obuf_curr_sz_id, kInstCommonOutSize, - builder.GetUintConstantId(obuf_record_sz), - &builder); - // Store Shader Id - GenDebugOutputFieldCode(obuf_curr_sz_id, kInstCommonOutShaderId, - param_ids[kShaderId], &builder); - // Store Instruction Idx - GenDebugOutputFieldCode(obuf_curr_sz_id, kInstCommonOutInstructionIdx, - param_ids[kInstructionIndex], &builder); - // Store stage info. Stage Idx + 3 words of stage-specific data. - for (uint32_t i = 0; i < 4; ++i) { - Instruction* field = - builder.AddCompositeExtract(GetUintId(), param_ids[kStageInfo], {i}); - GenDebugOutputFieldCode(obuf_curr_sz_id, kInstCommonOutStageIdx + i, - field->result_id(), &builder); - } - // Gen writes of validation specific data - for (uint32_t i = 0; i < param_cnt; ++i) { - GenDebugOutputFieldCode(obuf_curr_sz_id, val_spec_offset + i, - param_ids[kFirstParam + i], &builder); - } - // Close write block and gen merge block - (void)builder.AddBranch(merge_blk_id); - output_func->AddBasicBlock(std::move(new_blk_ptr)); - new_blk_ptr = MakeUnique(std::move(merge_label)); - builder.SetInsertPoint(&*new_blk_ptr); - // Close merge block and function and add function to module - (void)builder.AddNullaryOp(0, spv::Op::OpReturn); - - output_func->AddBasicBlock(std::move(new_blk_ptr)); - output_func->SetFunctionEnd(EndFunction()); - context()->AddFunction(std::move(output_func)); - - std::string name("stream_write_"); - name += std::to_string(param_cnt); - - context()->AddDebug2Inst( - NewGlobalName(param2output_func_id_[param_cnt], name)); - } - return param2output_func_id_[param_cnt]; -} - -uint32_t InstrumentPass::GetDirectReadFunctionId(uint32_t param_cnt) { - uint32_t func_id = param2input_func_id_[param_cnt]; - if (func_id != 0) return func_id; - // Create input function for param_cnt. - func_id = TakeNextId(); - analysis::Integer* uint_type = GetInteger(32, false); - std::vector param_types(param_cnt, uint_type); - - std::unique_ptr input_func = - StartFunction(func_id, uint_type, param_types); - std::vector param_ids = AddParameters(*input_func, param_types); - - // Create block - auto new_blk_ptr = MakeUnique(NewLabel(TakeNextId())); - InstructionBuilder builder( - context(), &*new_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - // For each offset parameter, generate new offset with parameter, adding last - // loaded value if it exists, and load value from input buffer at new offset. - // Return last loaded value. - uint32_t ibuf_type_id = GetInputBufferTypeId(); - uint32_t buf_id = GetInputBufferId(); - uint32_t buf_ptr_id = GetInputBufferPtrId(); - uint32_t last_value_id = 0; - for (uint32_t p = 0; p < param_cnt; ++p) { - uint32_t offset_id; - if (p == 0) { - offset_id = param_ids[0]; - } else { - if (ibuf_type_id != GetUintId()) { - last_value_id = - builder.AddUnaryOp(GetUintId(), spv::Op::OpUConvert, last_value_id) - ->result_id(); - } - offset_id = builder.AddIAdd(GetUintId(), last_value_id, param_ids[p]) - ->result_id(); - } - Instruction* ac_inst = builder.AddAccessChain( - buf_ptr_id, buf_id, - {builder.GetUintConstantId(kDebugInputDataOffset), offset_id}); - last_value_id = - builder.AddLoad(ibuf_type_id, ac_inst->result_id())->result_id(); - } - (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, last_value_id); - // Close block and function and add function to module - input_func->AddBasicBlock(std::move(new_blk_ptr)); - input_func->SetFunctionEnd(EndFunction()); - context()->AddFunction(std::move(input_func)); - - std::string name("direct_read_"); - name += std::to_string(param_cnt); - context()->AddDebug2Inst(NewGlobalName(func_id, name)); - - param2input_func_id_[param_cnt] = func_id; - return func_id; -} - -void InstrumentPass::SplitBlock( - BasicBlock::iterator inst_itr, UptrVectorIterator block_itr, - std::vector>* new_blocks) { - // Make sure def/use analysis is done before we start moving instructions - // out of function - (void)get_def_use_mgr(); - // Move original block's preceding instructions into first new block - std::unique_ptr first_blk_ptr; - MovePreludeCode(inst_itr, block_itr, &first_blk_ptr); - InstructionBuilder builder( - context(), &*first_blk_ptr, - IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - uint32_t split_blk_id = TakeNextId(); - std::unique_ptr split_label(NewLabel(split_blk_id)); - (void)builder.AddBranch(split_blk_id); - new_blocks->push_back(std::move(first_blk_ptr)); - // Move remaining instructions into split block and add to new blocks - std::unique_ptr split_blk_ptr( - new BasicBlock(std::move(split_label))); - MovePostludeCode(block_itr, &*split_blk_ptr); - new_blocks->push_back(std::move(split_blk_ptr)); -} - -bool InstrumentPass::InstrumentFunction(Function* func, uint32_t stage_idx, - InstProcessFunction& pfn) { - curr_func_ = func; - call2id_.clear(); - bool first_block_split = false; - bool modified = false; - // Apply instrumentation function to each instruction. - // Using block iterators here because of block erasures and insertions. - std::vector> new_blks; - for (auto bi = func->begin(); bi != func->end(); ++bi) { - for (auto ii = bi->begin(); ii != bi->end();) { - // Split all executable instructions out of first block into a following - // block. This will allow function calls to be inserted into the first - // block without interfering with the instrumentation algorithm. - if (opt_direct_reads_ && !first_block_split) { - if (ii->opcode() != spv::Op::OpVariable) { - SplitBlock(ii, bi, &new_blks); - first_block_split = true; - } - } else { - pfn(ii, bi, stage_idx, &new_blks); - } - // If no new code, continue - if (new_blks.size() == 0) { - ++ii; - continue; - } - // Add new blocks to label id map - for (auto& blk : new_blks) id2block_[blk->id()] = &*blk; - // If there are new blocks we know there will always be two or - // more, so update succeeding phis with label of new last block. - size_t newBlocksSize = new_blks.size(); - assert(newBlocksSize > 1); - UpdateSucceedingPhis(new_blks); - // Replace original block with new block(s) - bi = bi.Erase(); - for (auto& bb : new_blks) { - bb->SetParent(func); - } - bi = bi.InsertBefore(&new_blks); - // Reset block iterator to last new block - for (size_t i = 0; i < newBlocksSize - 1; i++) ++bi; - modified = true; - // Restart instrumenting at beginning of last new block, - // but skip over any new phi or copy instruction. - ii = bi->begin(); - if (ii->opcode() == spv::Op::OpPhi || - ii->opcode() == spv::Op::OpCopyObject) - ++ii; - new_blks.clear(); - } - } - return modified; -} - -bool InstrumentPass::InstProcessCallTreeFromRoots(InstProcessFunction& pfn, - std::queue* roots, - uint32_t stage_idx) { - bool modified = false; - std::unordered_set done; - // Don't process input and output functions - for (auto& ifn : param2input_func_id_) done.insert(ifn.second); - for (auto& ofn : param2output_func_id_) done.insert(ofn.second); - // Process all functions from roots - while (!roots->empty()) { - const uint32_t fi = roots->front(); - roots->pop(); - if (done.insert(fi).second) { - Function* fn = id2function_.at(fi); - // Add calls first so we don't add new output function - context()->AddCalls(fn, roots); - modified = InstrumentFunction(fn, stage_idx, pfn) || modified; - } - } - return modified; -} - -bool InstrumentPass::InstProcessEntryPointCallTree(InstProcessFunction& pfn) { - // Make sure all entry points have the same execution model. Do not - // instrument if they do not. - // TODO(greg-lunarg): Handle mixed stages. Technically, a shader module - // can contain entry points with different execution models, although - // such modules will likely be rare as GLSL and HLSL are geared toward - // one model per module. In such cases we will need - // to clone any functions which are in the call trees of entrypoints - // with differing execution models. - spv::ExecutionModel stage = context()->GetStage(); - // Check for supported stages - if (stage != spv::ExecutionModel::Vertex && - stage != spv::ExecutionModel::Fragment && - stage != spv::ExecutionModel::Geometry && - stage != spv::ExecutionModel::GLCompute && - stage != spv::ExecutionModel::TessellationControl && - stage != spv::ExecutionModel::TessellationEvaluation && - stage != spv::ExecutionModel::TaskNV && - stage != spv::ExecutionModel::MeshNV && - stage != spv::ExecutionModel::RayGenerationNV && - stage != spv::ExecutionModel::IntersectionNV && - stage != spv::ExecutionModel::AnyHitNV && - stage != spv::ExecutionModel::ClosestHitNV && - stage != spv::ExecutionModel::MissNV && - stage != spv::ExecutionModel::CallableNV && - stage != spv::ExecutionModel::TaskEXT && - stage != spv::ExecutionModel::MeshEXT) { - if (consumer()) { - std::string message = "Stage not supported by instrumentation"; - consumer()(SPV_MSG_ERROR, 0, {0, 0, 0}, message.c_str()); - } - return false; - } - // Add together the roots of all entry points - std::queue roots; - for (auto& e : get_module()->entry_points()) { - roots.push(e.GetSingleWordInOperand(kEntryPointFunctionIdInIdx)); - } - bool modified = InstProcessCallTreeFromRoots(pfn, &roots, uint32_t(stage)); - return modified; -} - -void InstrumentPass::InitializeInstrument() { - output_buffer_id_ = 0; - output_buffer_ptr_id_ = 0; - input_buffer_ptr_id_ = 0; - input_buffer_id_ = 0; - float_id_ = 0; - v4float_id_ = 0; - uint_id_ = 0; - uint64_id_ = 0; - uint8_id_ = 0; - v4uint_id_ = 0; - v3uint_id_ = 0; - bool_id_ = 0; - void_id_ = 0; - storage_buffer_ext_defined_ = false; - uint32_rarr_ty_ = nullptr; - uint64_rarr_ty_ = nullptr; - - // clear collections - id2function_.clear(); - id2block_.clear(); - - // clear maps - param2input_func_id_.clear(); - param2output_func_id_.clear(); - - // Initialize function and block maps. - for (auto& fn : *get_module()) { - id2function_[fn.result_id()] = &fn; - for (auto& blk : fn) { - id2block_[blk.id()] = &blk; - } - } - - // Remember original instruction offsets - uint32_t module_offset = 0; - Module* module = get_module(); - for (auto& i : context()->capabilities()) { - (void)i; - ++module_offset; - } - for (auto& i : module->extensions()) { - (void)i; - ++module_offset; - } - for (auto& i : module->ext_inst_imports()) { - (void)i; - ++module_offset; - } - ++module_offset; // memory_model - for (auto& i : module->entry_points()) { - (void)i; - ++module_offset; - } - for (auto& i : module->execution_modes()) { - (void)i; - ++module_offset; - } - for (auto& i : module->debugs1()) { - (void)i; - ++module_offset; - } - for (auto& i : module->debugs2()) { - (void)i; - ++module_offset; - } - for (auto& i : module->debugs3()) { - (void)i; - ++module_offset; - } - for (auto& i : module->ext_inst_debuginfo()) { - (void)i; - ++module_offset; - } - for (auto& i : module->annotations()) { - (void)i; - ++module_offset; - } - for (auto& i : module->types_values()) { - module_offset += 1; - module_offset += static_cast(i.dbg_line_insts().size()); - } - - auto curr_fn = get_module()->begin(); - for (; curr_fn != get_module()->end(); ++curr_fn) { - // Count function instruction - module_offset += 1; - curr_fn->ForEachParam( - [&module_offset](const Instruction*) { module_offset += 1; }, true); - for (auto& blk : *curr_fn) { - // Count label - module_offset += 1; - for (auto& inst : blk) { - module_offset += static_cast(inst.dbg_line_insts().size()); - uid2offset_[inst.unique_id()] = module_offset; - module_offset += 1; - } - } - // Count function end instruction - module_offset += 1; - } -} - -} // namespace opt -} // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.h b/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.h deleted file mode 100644 index 092b361d..00000000 --- a/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.h +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright (c) 2018 The Khronos Group Inc. -// Copyright (c) 2018 Valve Corporation -// Copyright (c) 2018 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef LIBSPIRV_OPT_INSTRUMENT_PASS_H_ -#define LIBSPIRV_OPT_INSTRUMENT_PASS_H_ - -#include -#include -#include - -#include "source/opt/ir_builder.h" -#include "source/opt/pass.h" -#include "spirv-tools/instrument.hpp" - -// This is a base class to assist in the creation of passes which instrument -// shader modules. More specifically, passes which replace instructions with a -// larger and more capable set of instructions. Commonly, these new -// instructions will add testing of operands and execute different -// instructions depending on the outcome, including outputting of debug -// information into a buffer created especially for that purpose. -// -// This class contains helper functions to create an InstProcessFunction, -// which is the heart of any derived class implementing a specific -// instrumentation pass. It takes an instruction as an argument, decides -// if it should be instrumented, and generates code to replace it. This class -// also supplies function InstProcessEntryPointCallTree which applies the -// InstProcessFunction to every reachable instruction in a module and replaces -// the instruction with new instructions if generated. -// -// Chief among the helper functions are output code generation functions, -// used to generate code in the shader which writes data to output buffers -// associated with that validation. Currently one such function, -// GenDebugStreamWrite, exists. Other such functions may be added in the -// future. Each is accompanied by documentation describing the format of -// its output buffer. -// -// A validation pass may read or write multiple buffers. All such buffers -// are located in a single debug descriptor set whose index is passed at the -// creation of the instrumentation pass. The bindings of the buffers used by -// a validation pass are permanently assigned and fixed and documented by -// the kDebugOutput* static consts. - -namespace spvtools { -namespace opt { -namespace { -// Validation Ids -// These are used to identify the general validation being done and map to -// its output buffers. -constexpr uint32_t kInstValidationIdBindless = 0; -constexpr uint32_t kInstValidationIdBuffAddr = 1; -constexpr uint32_t kInstValidationIdDebugPrintf = 2; -} // namespace - -class InstrumentPass : public Pass { - using cbb_ptr = const BasicBlock*; - - public: - using InstProcessFunction = - std::function, - uint32_t, std::vector>*)>; - - ~InstrumentPass() override = default; - - IRContext::Analysis GetPreservedAnalyses() override { - return IRContext::kAnalysisDefUse | IRContext::kAnalysisDecorations | - IRContext::kAnalysisCombinators | IRContext::kAnalysisNameMap | - IRContext::kAnalysisBuiltinVarId | IRContext::kAnalysisConstants; - } - - protected: - // Create instrumentation pass for |validation_id| which utilizes descriptor - // set |desc_set| for debug input and output buffers and writes |shader_id| - // into debug output records. |opt_direct_reads| indicates that the pass - // will see direct input buffer reads and should prepare to optimize them. - InstrumentPass(uint32_t desc_set, uint32_t shader_id, uint32_t validation_id, - bool opt_direct_reads = false) - : Pass(), - desc_set_(desc_set), - shader_id_(shader_id), - validation_id_(validation_id), - opt_direct_reads_(opt_direct_reads) {} - - // Initialize state for instrumentation of module. - void InitializeInstrument(); - - // Call |pfn| on all instructions in all functions in the call tree of the - // entry points in |module|. If code is generated for an instruction, replace - // the instruction's block with the new blocks that are generated. Continue - // processing at the top of the last new block. - bool InstProcessEntryPointCallTree(InstProcessFunction& pfn); - - // Move all code in |ref_block_itr| preceding the instruction |ref_inst_itr| - // to be instrumented into block |new_blk_ptr|. - void MovePreludeCode(BasicBlock::iterator ref_inst_itr, - UptrVectorIterator ref_block_itr, - std::unique_ptr* new_blk_ptr); - - // Move all code in |ref_block_itr| succeeding the instruction |ref_inst_itr| - // to be instrumented into block |new_blk_ptr|. - void MovePostludeCode(UptrVectorIterator ref_block_itr, - BasicBlock* new_blk_ptr); - - // Generate instructions in |builder| which will atomically fetch and - // increment the size of the debug output buffer stream of the current - // validation and write a record to the end of the stream, if enough space - // in the buffer remains. The record will contain the index of the function - // and instruction within that function |func_idx, instruction_idx| which - // generated the record. It will also contain additional information to - // identify the instance of the shader, depending on the stage |stage_idx| - // of the shader. Finally, the record will contain validation-specific - // data contained in |validation_ids| which will identify the validation - // error as well as the values involved in the error. - // - // The output buffer binding written to by the code generated by the function - // is determined by the validation id specified when each specific - // instrumentation pass is created. - // - // The output buffer is a sequence of 32-bit values with the following - // format (where all elements are unsigned 32-bit unless otherwise noted): - // - // Size - // Record0 - // Record1 - // Record2 - // ... - // - // Size is the number of 32-bit values that have been written or - // attempted to be written to the output buffer, excluding the Size. It is - // initialized to 0. If the size of attempts to write the buffer exceeds - // the actual size of the buffer, it is possible that this field can exceed - // the actual size of the buffer. - // - // Each Record* is a variable-length sequence of 32-bit values with the - // following format defined using static const offsets in the .cpp file: - // - // Record Size - // Shader ID - // Instruction Index - // Stage - // Stage-specific Word 0 - // Stage-specific Word 1 - // ... - // Validation Error Code - // Validation-specific Word 0 - // Validation-specific Word 1 - // Validation-specific Word 2 - // ... - // - // Each record consists of three subsections: members common across all - // validation, members specific to the stage, and members specific to a - // validation. - // - // The Record Size is the number of 32-bit words in the record, including - // the Record Size word. - // - // Shader ID is a value that identifies which shader has generated the - // validation error. It is passed when the instrumentation pass is created. - // - // The Instruction Index is the position of the instruction within the - // SPIR-V file which is in error. - // - // The Stage is the pipeline stage which has generated the error as defined - // by the SpvExecutionModel_ enumeration. This is used to interpret the - // following Stage-specific words. - // - // The Stage-specific Words identify which invocation of the shader generated - // the error. Every stage will write a fixed number of words. Vertex shaders - // will write the Vertex and Instance ID. Fragment shaders will write - // FragCoord.xy. Compute shaders will write the GlobalInvocation ID. - // The tessellation eval shader will write the Primitive ID and TessCoords.uv. - // The tessellation control shader and geometry shader will write the - // Primitive ID and Invocation ID. - // - // The Validation Error Code specifies the exact error which has occurred. - // These are enumerated with the kInstError* static consts. This allows - // multiple validation layers to use the same, single output buffer. - // - // The Validation-specific Words are a validation-specific number of 32-bit - // words which give further information on the validation error that - // occurred. These are documented further in each file containing the - // validation-specific class which derives from this base class. - // - // Because the code that is generated checks against the size of the buffer - // before writing, the size of the debug out buffer can be used by the - // validation layer to control the number of error records that are written. - void GenDebugStreamWrite(uint32_t shader_id, uint32_t instruction_idx_id, - uint32_t stage_info_id, - const std::vector& validation_ids, - InstructionBuilder* builder); - - // Return true if all instructions in |ids| are constants or spec constants. - bool AllConstant(const std::vector& ids); - - // Generate in |builder| instructions to read the unsigned integer from the - // input buffer specified by the offsets in |offset_ids|. Given offsets - // o0, o1, ... oN, and input buffer ibuf, return the id for the value: - // - // ibuf[...ibuf[ibuf[o0]+o1]...+oN] - // - // The binding and the format of the input buffer is determined by each - // specific validation, which is specified at the creation of the pass. - uint32_t GenDebugDirectRead(const std::vector& offset_ids, - InstructionBuilder* builder); - - uint32_t GenReadFunctionCall(uint32_t return_id, uint32_t func_id, - const std::vector& args, - InstructionBuilder* builder); - - // Generate code to convert integer |value_id| to 32bit, if needed. Return - // an id to the 32bit equivalent. - uint32_t Gen32BitCvtCode(uint32_t value_id, InstructionBuilder* builder); - - // Generate code to cast integer |value_id| to 32bit unsigned, if needed. - // Return an id to the Uint equivalent. - uint32_t GenUintCastCode(uint32_t value_id, InstructionBuilder* builder); - - std::unique_ptr StartFunction( - uint32_t func_id, const analysis::Type* return_type, - const std::vector& param_types); - - std::vector AddParameters( - Function& func, const std::vector& param_types); - - std::unique_ptr EndFunction(); - - // Return new label. - std::unique_ptr NewLabel(uint32_t label_id); - - // Set the name function parameter or local variable - std::unique_ptr NewName(uint32_t id, - const std::string& name_str); - - // Set the name for a function or global variable, names will be - // prefixed to identify which instrumentation pass generated them. - std::unique_ptr NewGlobalName(uint32_t id, - const std::string& name_str); - - // Set the name for a structure member - std::unique_ptr NewMemberName(uint32_t id, uint32_t member_index, - const std::string& name_str); - - // Return id for 32-bit unsigned type - uint32_t GetUintId(); - - // Return id for 64-bit unsigned type - uint32_t GetUint64Id(); - - // Return id for 8-bit unsigned type - uint32_t GetUint8Id(); - - // Return id for 32-bit unsigned type - uint32_t GetBoolId(); - - // Return id for void type - uint32_t GetVoidId(); - - // Get registered type structures - analysis::Integer* GetInteger(uint32_t width, bool is_signed); - analysis::Struct* GetStruct(const std::vector& fields); - analysis::RuntimeArray* GetRuntimeArray(const analysis::Type* element); - analysis::Array* GetArray(const analysis::Type* element, uint32_t size); - analysis::Function* GetFunction( - const analysis::Type* return_val, - const std::vector& args); - - // Return pointer to type for runtime array of uint - analysis::RuntimeArray* GetUintXRuntimeArrayType( - uint32_t width, analysis::RuntimeArray** rarr_ty); - - // Return pointer to type for runtime array of uint - analysis::RuntimeArray* GetUintRuntimeArrayType(uint32_t width); - - // Return id for buffer uint type - uint32_t GetOutputBufferPtrId(); - - // Return id for buffer uint type - uint32_t GetInputBufferTypeId(); - - // Return id for buffer uint type - uint32_t GetInputBufferPtrId(); - - // Return binding for output buffer for current validation. - uint32_t GetOutputBufferBinding(); - - // Return binding for input buffer for current validation. - uint32_t GetInputBufferBinding(); - - // Add storage buffer extension if needed - void AddStorageBufferExt(); - - // Return id for debug output buffer - uint32_t GetOutputBufferId(); - - // Return id for debug input buffer - uint32_t GetInputBufferId(); - - // Return id for 32-bit float type - uint32_t GetFloatId(); - - // Return id for v4float type - uint32_t GetVec4FloatId(); - - // Return id for uint vector type of |length| - uint32_t GetVecUintId(uint32_t length); - - // Return id for v4uint type - uint32_t GetVec4UintId(); - - // Return id for v3uint type - uint32_t GetVec3UintId(); - - // Return id for output function. Define if it doesn't exist with - // |val_spec_param_cnt| validation-specific uint32 parameters. - uint32_t GetStreamWriteFunctionId(uint32_t val_spec_param_cnt); - - // Return id for input function taking |param_cnt| uint32 parameters. Define - // if it doesn't exist. - uint32_t GetDirectReadFunctionId(uint32_t param_cnt); - - // Split block |block_itr| into two new blocks where the second block - // contains |inst_itr| and place in |new_blocks|. - void SplitBlock(BasicBlock::iterator inst_itr, - UptrVectorIterator block_itr, - std::vector>* new_blocks); - - // Apply instrumentation function |pfn| to every instruction in |func|. - // If code is generated for an instruction, replace the instruction's - // block with the new blocks that are generated. Continue processing at the - // top of the last new block. - virtual bool InstrumentFunction(Function* func, uint32_t stage_idx, - InstProcessFunction& pfn); - - // Call |pfn| on all functions in the call tree of the function - // ids in |roots|. - bool InstProcessCallTreeFromRoots(InstProcessFunction& pfn, - std::queue* roots, - uint32_t stage_idx); - - // Gen code into |builder| to write |field_value_id| into debug output - // buffer at |base_offset_id| + |field_offset|. - void GenDebugOutputFieldCode(uint32_t base_offset_id, uint32_t field_offset, - uint32_t field_value_id, - InstructionBuilder* builder); - - // Generate instructions into |builder| which will load |var_id| and return - // its result id. - uint32_t GenVarLoad(uint32_t var_id, InstructionBuilder* builder); - - uint32_t GenStageInfo(uint32_t stage_idx, InstructionBuilder* builder); - - // Return true if instruction must be in the same block that its result - // is used. - bool IsSameBlockOp(const Instruction* inst) const; - - // Clone operands which must be in same block as consumer instructions. - // Look in same_blk_pre for instructions that need cloning. Look in - // same_blk_post for instructions already cloned. Add cloned instruction - // to same_blk_post. - void CloneSameBlockOps( - std::unique_ptr* inst, - std::unordered_map* same_blk_post, - std::unordered_map* same_blk_pre, - BasicBlock* block_ptr); - - // Update phis in succeeding blocks to point to new last block - void UpdateSucceedingPhis( - std::vector>& new_blocks); - - // Debug descriptor set index - uint32_t desc_set_; - - // Shader module ID written into output record - uint32_t shader_id_; - - // Map from function id to function pointer. - std::unordered_map id2function_; - - // Map from block's label id to block. TODO(dnovillo): This is superfluous wrt - // CFG. It has functionality not present in CFG. Consolidate. - std::unordered_map id2block_; - - // Map from instruction's unique id to offset in original file. - std::unordered_map uid2offset_; - - // result id for OpConstantFalse - uint32_t validation_id_; - - // id for output buffer variable - uint32_t output_buffer_id_; - - // ptr type id for output buffer element - uint32_t output_buffer_ptr_id_; - - // ptr type id for input buffer element - uint32_t input_buffer_ptr_id_; - - // id for debug output function - std::unordered_map param2output_func_id_; - - // ids for debug input functions - std::unordered_map param2input_func_id_; - - // id for input buffer variable - uint32_t input_buffer_id_; - - // id for 32-bit float type - uint32_t float_id_; - - // id for v4float type - uint32_t v4float_id_; - - // id for v4uint type - uint32_t v4uint_id_; - - // id for v3uint type - uint32_t v3uint_id_; - - // id for 32-bit unsigned type - uint32_t uint_id_; - - // id for 64-bit unsigned type - uint32_t uint64_id_; - - // id for 8-bit unsigned type - uint32_t uint8_id_; - - // id for bool type - uint32_t bool_id_; - - // id for void type - uint32_t void_id_; - - // boolean to remember storage buffer extension - bool storage_buffer_ext_defined_; - - // runtime array of uint type - analysis::RuntimeArray* uint64_rarr_ty_; - - // runtime array of uint type - analysis::RuntimeArray* uint32_rarr_ty_; - - // Pre-instrumentation same-block insts - std::unordered_map same_block_pre_; - - // Post-instrumentation same-block op ids - std::unordered_map same_block_post_; - - // Map function calls to result id. Clear for every function. - // This is for debug input reads with constant arguments that - // have been generated into the first block of the function. - // This mechanism is used to avoid multiple identical debug - // input buffer reads. - struct vector_hash_ { - std::size_t operator()(const std::vector& v) const { - std::size_t hash = v.size(); - for (auto& u : v) { - hash ^= u + 0x9e3779b9 + (hash << 11) + (hash >> 21); - } - return hash; - } - }; - std::unordered_map, uint32_t, vector_hash_> call2id_; - - // Function currently being instrumented - Function* curr_func_; - - // Optimize direct debug input buffer reads. Specifically, move all such - // reads with constant args to first block and reuse them. - bool opt_direct_reads_; -}; - -} // namespace opt -} // namespace spvtools - -#endif // LIBSPIRV_OPT_INSTRUMENT_PASS_H_ diff --git a/bgfx/3rdparty/spirv-tools/source/opt/invocation_interlock_placement_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/invocation_interlock_placement_pass.cpp new file mode 100644 index 00000000..642e2d23 --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/opt/invocation_interlock_placement_pass.cpp @@ -0,0 +1,493 @@ +// Copyright (c) 2023 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "source/opt/invocation_interlock_placement_pass.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "source/enum_set.h" +#include "source/enum_string_mapping.h" +#include "source/opt/ir_context.h" +#include "source/opt/reflect.h" +#include "source/spirv_target_env.h" +#include "source/util/string_utils.h" + +namespace spvtools { +namespace opt { + +namespace { +constexpr uint32_t kEntryPointExecutionModelInIdx = 0; +constexpr uint32_t kEntryPointFunctionIdInIdx = 1; +constexpr uint32_t kFunctionCallFunctionIdInIdx = 0; +} // namespace + +bool InvocationInterlockPlacementPass::hasSingleNextBlock(uint32_t block_id, + bool reverse_cfg) { + if (reverse_cfg) { + // We are traversing forward, so check whether there is a single successor. + BasicBlock* block = cfg()->block(block_id); + + switch (block->tail()->opcode()) { + case spv::Op::OpBranchConditional: + return false; + case spv::Op::OpSwitch: + return block->tail()->NumInOperandWords() == 1; + default: + return !block->tail()->IsReturnOrAbort(); + } + } else { + // We are traversing backward, so check whether there is a single + // predecessor. + return cfg()->preds(block_id).size() == 1; + } +} + +void InvocationInterlockPlacementPass::forEachNext( + uint32_t block_id, bool reverse_cfg, std::function f) { + if (reverse_cfg) { + BasicBlock* block = cfg()->block(block_id); + + block->ForEachSuccessorLabel([f](uint32_t succ_id) { f(succ_id); }); + } else { + for (uint32_t pred_id : cfg()->preds(block_id)) { + f(pred_id); + } + } +} + +void InvocationInterlockPlacementPass::addInstructionAtBlockBoundary( + BasicBlock* block, spv::Op opcode, bool at_end) { + if (at_end) { + assert(block->begin()->opcode() != spv::Op::OpPhi && + "addInstructionAtBlockBoundary expects to be called with at_end == " + "true only if there is a single successor to block"); + // Insert a begin instruction at the end of the block. + Instruction* begin_inst = new Instruction(context(), opcode); + begin_inst->InsertAfter(&*--block->tail()); + } else { + assert(block->begin()->opcode() != spv::Op::OpPhi && + "addInstructionAtBlockBoundary expects to be called with at_end == " + "false only if there is a single predecessor to block"); + // Insert an end instruction at the beginning of the block. + Instruction* end_inst = new Instruction(context(), opcode); + end_inst->InsertBefore(&*block->begin()); + } +} + +bool InvocationInterlockPlacementPass::killDuplicateBegin(BasicBlock* block) { + bool found = false; + + return context()->KillInstructionIf( + block->begin(), block->end(), [&found](Instruction* inst) { + if (inst->opcode() == spv::Op::OpBeginInvocationInterlockEXT) { + if (found) { + return true; + } + found = true; + } + return false; + }); +} + +bool InvocationInterlockPlacementPass::killDuplicateEnd(BasicBlock* block) { + std::vector to_kill; + block->ForEachInst([&to_kill](Instruction* inst) { + if (inst->opcode() == spv::Op::OpEndInvocationInterlockEXT) { + to_kill.push_back(inst); + } + }); + + if (to_kill.size() <= 1) { + return false; + } + + to_kill.pop_back(); + + for (Instruction* inst : to_kill) { + context()->KillInst(inst); + } + + return true; +} + +void InvocationInterlockPlacementPass::recordBeginOrEndInFunction( + Function* func) { + if (extracted_functions_.count(func)) { + return; + } + + bool had_begin = false; + bool had_end = false; + + func->ForEachInst([this, &had_begin, &had_end](Instruction* inst) { + switch (inst->opcode()) { + case spv::Op::OpBeginInvocationInterlockEXT: + had_begin = true; + break; + case spv::Op::OpEndInvocationInterlockEXT: + had_end = true; + break; + case spv::Op::OpFunctionCall: { + uint32_t function_id = + inst->GetSingleWordInOperand(kFunctionCallFunctionIdInIdx); + Function* inner_func = context()->GetFunction(function_id); + recordBeginOrEndInFunction(inner_func); + ExtractionResult result = extracted_functions_[inner_func]; + had_begin = had_begin || result.had_begin; + had_end = had_end || result.had_end; + break; + } + default: + break; + } + }); + + ExtractionResult result = {had_begin, had_end}; + extracted_functions_[func] = result; +} + +bool InvocationInterlockPlacementPass:: + removeBeginAndEndInstructionsFromFunction(Function* func) { + bool modified = false; + func->ForEachInst([this, &modified](Instruction* inst) { + switch (inst->opcode()) { + case spv::Op::OpBeginInvocationInterlockEXT: + context()->KillInst(inst); + modified = true; + break; + case spv::Op::OpEndInvocationInterlockEXT: + context()->KillInst(inst); + modified = true; + break; + default: + break; + } + }); + return modified; +} + +bool InvocationInterlockPlacementPass::extractInstructionsFromCalls( + std::vector blocks) { + bool modified = false; + + for (BasicBlock* block : blocks) { + block->ForEachInst([this, &modified](Instruction* inst) { + if (inst->opcode() == spv::Op::OpFunctionCall) { + uint32_t function_id = + inst->GetSingleWordInOperand(kFunctionCallFunctionIdInIdx); + Function* func = context()->GetFunction(function_id); + ExtractionResult result = extracted_functions_[func]; + + if (result.had_begin) { + Instruction* new_inst = new Instruction( + context(), spv::Op::OpBeginInvocationInterlockEXT); + new_inst->InsertBefore(inst); + modified = true; + } + if (result.had_end) { + Instruction* new_inst = + new Instruction(context(), spv::Op::OpEndInvocationInterlockEXT); + new_inst->InsertAfter(inst); + modified = true; + } + } + }); + } + return modified; +} + +void InvocationInterlockPlacementPass::recordExistingBeginAndEndBlock( + std::vector blocks) { + for (BasicBlock* block : blocks) { + block->ForEachInst([this, block](Instruction* inst) { + switch (inst->opcode()) { + case spv::Op::OpBeginInvocationInterlockEXT: + begin_.insert(block->id()); + break; + case spv::Op::OpEndInvocationInterlockEXT: + end_.insert(block->id()); + break; + default: + break; + } + }); + } +} + +InvocationInterlockPlacementPass::BlockSet +InvocationInterlockPlacementPass::computeReachableBlocks( + BlockSet& previous_inside, const BlockSet& starting_nodes, + bool reverse_cfg) { + BlockSet inside = starting_nodes; + + std::deque worklist; + worklist.insert(worklist.begin(), starting_nodes.begin(), + starting_nodes.end()); + + while (!worklist.empty()) { + uint32_t block_id = worklist.front(); + worklist.pop_front(); + + forEachNext(block_id, reverse_cfg, + [&inside, &previous_inside, &worklist](uint32_t next_id) { + previous_inside.insert(next_id); + if (inside.insert(next_id).second) { + worklist.push_back(next_id); + } + }); + } + + return inside; +} + +bool InvocationInterlockPlacementPass::removeUnneededInstructions( + BasicBlock* block) { + bool modified = false; + if (!predecessors_after_begin_.count(block->id()) && + after_begin_.count(block->id())) { + // None of the previous blocks are in the critical section, but this block + // is. This can only happen if this block already has at least one begin + // instruction. Leave the first begin instruction, and remove any others. + modified |= killDuplicateBegin(block); + } else if (predecessors_after_begin_.count(block->id())) { + // At least one previous block is in the critical section; remove all + // begin instructions in this block. + modified |= context()->KillInstructionIf( + block->begin(), block->end(), [](Instruction* inst) { + return inst->opcode() == spv::Op::OpBeginInvocationInterlockEXT; + }); + } + + if (!successors_before_end_.count(block->id()) && + before_end_.count(block->id())) { + // Same as above + modified |= killDuplicateEnd(block); + } else if (successors_before_end_.count(block->id())) { + modified |= context()->KillInstructionIf( + block->begin(), block->end(), [](Instruction* inst) { + return inst->opcode() == spv::Op::OpEndInvocationInterlockEXT; + }); + } + return modified; +} + +BasicBlock* InvocationInterlockPlacementPass::splitEdge(BasicBlock* block, + uint32_t succ_id) { + // Create a new block to replace the critical edge. + auto new_succ_temp = MakeUnique( + MakeUnique(context(), spv::Op::OpLabel, 0, TakeNextId(), + std::initializer_list{})); + auto* new_succ = new_succ_temp.get(); + + // Insert the new block into the function. + block->GetParent()->InsertBasicBlockAfter(std::move(new_succ_temp), block); + + new_succ->AddInstruction(MakeUnique( + context(), spv::Op::OpBranch, 0, 0, + std::initializer_list{ + Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, {succ_id})})); + + assert(block->tail()->opcode() == spv::Op::OpBranchConditional || + block->tail()->opcode() == spv::Op::OpSwitch); + + // Update the first branch to successor to instead branch to + // the new successor. If there are multiple edges, we arbitrarily choose the + // first time it appears in the list. The other edges to `succ_id` will have + // to be split by another call to `splitEdge`. + block->tail()->WhileEachInId([new_succ, succ_id](uint32_t* branch_id) { + if (*branch_id == succ_id) { + *branch_id = new_succ->id(); + return false; + } + return true; + }); + + return new_succ; +} + +bool InvocationInterlockPlacementPass::placeInstructionsForEdge( + BasicBlock* block, uint32_t next_id, BlockSet& inside, + BlockSet& previous_inside, spv::Op opcode, bool reverse_cfg) { + bool modified = false; + + if (previous_inside.count(next_id) && !inside.count(block->id())) { + // This block is not in the critical section but the next has at least one + // other previous block that is, so this block should be enter it as well. + // We need to add begin or end instructions to the edge. + + modified = true; + + if (hasSingleNextBlock(block->id(), reverse_cfg)) { + // This is the only next block. + + // Additionally, because `next_id` is in `previous_inside`, we know that + // `next_id` has at least one previous block in `inside`. And because + // 'block` is not in `inside`, that means the `next_id` has to have at + // least one other previous block in `inside`. + + // This is solely for a debug assertion. It is essentially recomputing the + // value of `previous_inside` to verify that it was computed correctly + // such that the above statement is true. + bool next_has_previous_inside = false; + // By passing !reverse_cfg to forEachNext, we are actually iterating over + // the previous blocks. + forEachNext(next_id, !reverse_cfg, + [&next_has_previous_inside, inside](uint32_t previous_id) { + if (inside.count(previous_id)) { + next_has_previous_inside = true; + } + }); + assert(next_has_previous_inside && + "`previous_inside` must be the set of blocks with at least one " + "previous block in `inside`"); + + addInstructionAtBlockBoundary(block, opcode, reverse_cfg); + } else { + // This block has multiple next blocks. Split the edge and insert the + // instruction in the new next block. + BasicBlock* new_branch; + if (reverse_cfg) { + new_branch = splitEdge(block, next_id); + } else { + new_branch = splitEdge(cfg()->block(next_id), block->id()); + } + + auto inst = new Instruction(context(), opcode); + inst->InsertBefore(&*new_branch->tail()); + } + } + + return modified; +} + +bool InvocationInterlockPlacementPass::placeInstructions(BasicBlock* block) { + bool modified = false; + + block->ForEachSuccessorLabel([this, block, &modified](uint32_t succ_id) { + modified |= placeInstructionsForEdge( + block, succ_id, after_begin_, predecessors_after_begin_, + spv::Op::OpBeginInvocationInterlockEXT, /* reverse_cfg= */ true); + modified |= placeInstructionsForEdge(cfg()->block(succ_id), block->id(), + before_end_, successors_before_end_, + spv::Op::OpEndInvocationInterlockEXT, + /* reverse_cfg= */ false); + }); + + return modified; +} + +bool InvocationInterlockPlacementPass::processFragmentShaderEntry( + Function* entry_func) { + bool modified = false; + + // Save the original order of blocks in the function, so we don't iterate over + // newly-added blocks. + std::vector original_blocks; + for (auto bi = entry_func->begin(); bi != entry_func->end(); ++bi) { + original_blocks.push_back(&*bi); + } + + modified |= extractInstructionsFromCalls(original_blocks); + recordExistingBeginAndEndBlock(original_blocks); + + after_begin_ = computeReachableBlocks(predecessors_after_begin_, begin_, + /* reverse_cfg= */ true); + before_end_ = computeReachableBlocks(successors_before_end_, end_, + /* reverse_cfg= */ false); + + for (BasicBlock* block : original_blocks) { + modified |= removeUnneededInstructions(block); + modified |= placeInstructions(block); + } + return modified; +} + +bool InvocationInterlockPlacementPass::isFragmentShaderInterlockEnabled() { + if (!context()->get_feature_mgr()->HasExtension( + kSPV_EXT_fragment_shader_interlock)) { + return false; + } + + if (context()->get_feature_mgr()->HasCapability( + spv::Capability::FragmentShaderSampleInterlockEXT)) { + return true; + } + + if (context()->get_feature_mgr()->HasCapability( + spv::Capability::FragmentShaderPixelInterlockEXT)) { + return true; + } + + if (context()->get_feature_mgr()->HasCapability( + spv::Capability::FragmentShaderShadingRateInterlockEXT)) { + return true; + } + + return false; +} + +Pass::Status InvocationInterlockPlacementPass::Process() { + // Skip this pass if the necessary extension or capability is missing + if (!isFragmentShaderInterlockEnabled()) { + return Status::SuccessWithoutChange; + } + + bool modified = false; + + std::unordered_set entry_points; + for (Instruction& entry_inst : context()->module()->entry_points()) { + uint32_t entry_id = + entry_inst.GetSingleWordInOperand(kEntryPointFunctionIdInIdx); + entry_points.insert(context()->GetFunction(entry_id)); + } + + for (auto fi = context()->module()->begin(); fi != context()->module()->end(); + ++fi) { + Function* func = &*fi; + recordBeginOrEndInFunction(func); + if (!entry_points.count(func) && extracted_functions_.count(func)) { + modified |= removeBeginAndEndInstructionsFromFunction(func); + } + } + + for (Instruction& entry_inst : context()->module()->entry_points()) { + uint32_t entry_id = + entry_inst.GetSingleWordInOperand(kEntryPointFunctionIdInIdx); + Function* entry_func = context()->GetFunction(entry_id); + + auto execution_model = spv::ExecutionModel( + entry_inst.GetSingleWordInOperand(kEntryPointExecutionModelInIdx)); + + if (execution_model != spv::ExecutionModel::Fragment) { + continue; + } + + modified |= processFragmentShaderEntry(entry_func); + } + + return modified ? Pass::Status::SuccessWithChange + : Pass::Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/opt/invocation_interlock_placement_pass.h b/bgfx/3rdparty/spirv-tools/source/opt/invocation_interlock_placement_pass.h new file mode 100644 index 00000000..4e85be85 --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/opt/invocation_interlock_placement_pass.h @@ -0,0 +1,158 @@ +// Copyright (c) 2023 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_DEDUPE_INTERLOCK_INVOCATION_PASS_H_ +#define SOURCE_OPT_DEDUPE_INTERLOCK_INVOCATION_PASS_H_ + +#include +#include +#include +#include +#include +#include + +#include "source/enum_set.h" +#include "source/extensions.h" +#include "source/opt/ir_context.h" +#include "source/opt/module.h" +#include "source/opt/pass.h" +#include "source/spirv_target_env.h" + +namespace spvtools { +namespace opt { + +// This pass will ensure that an entry point will only have at most one +// OpBeginInterlockInvocationEXT and one OpEndInterlockInvocationEXT, in that +// order +class InvocationInterlockPlacementPass : public Pass { + public: + InvocationInterlockPlacementPass() {} + InvocationInterlockPlacementPass(const InvocationInterlockPlacementPass&) = + delete; + InvocationInterlockPlacementPass(InvocationInterlockPlacementPass&&) = delete; + + const char* name() const override { return "dedupe-interlock-invocation"; } + Status Process() override; + + private: + using BlockSet = std::unordered_set; + + // Specifies whether a function originally had a begin or end instruction. + struct ExtractionResult { + bool had_begin : 1; + bool had_end : 2; + }; + + // Check if a block has only a single next block, depending on the directing + // that we are traversing the CFG. If reverse_cfg is true, we are walking + // forward through the CFG, and will return if the block has only one + // successor. Otherwise, we are walking backward through the CFG, and will + // return if the block has only one predecessor. + bool hasSingleNextBlock(uint32_t block_id, bool reverse_cfg); + + // Iterate over each of a block's predecessors or successors, depending on + // direction. If reverse_cfg is true, we are walking forward through the CFG, + // and need to iterate over the successors. Otherwise, we are walking backward + // through the CFG, and need to iterate over the predecessors. + void forEachNext(uint32_t block_id, bool reverse_cfg, + std::function f); + + // Add either a begin or end instruction to the edge of the basic block. If + // at_end is true, add the instruction to the end of the block; otherwise add + // the instruction to the beginning of the basic block. + void addInstructionAtBlockBoundary(BasicBlock* block, spv::Op opcode, + bool at_end); + + // Remove every OpBeginInvocationInterlockEXT instruction in block after the + // first. Returns whether any instructions were removed. + bool killDuplicateBegin(BasicBlock* block); + // Remove every OpBeginInvocationInterlockEXT instruction in block before the + // last. Returns whether any instructions were removed. + bool killDuplicateEnd(BasicBlock* block); + + // Records whether a function will potentially execute a begin or end + // instruction. + void recordBeginOrEndInFunction(Function* func); + + // Recursively removes any begin or end instructions from func and any + // function func calls. Returns whether any instructions were removed. + bool removeBeginAndEndInstructionsFromFunction(Function* func); + + // For every function call in any of the passed blocks, move any begin or end + // instructions outside of the function call. Returns whether any extractions + // occurred. + bool extractInstructionsFromCalls(std::vector blocks); + + // Finds the sets of blocks that contain OpBeginInvocationInterlockEXT and + // OpEndInvocationInterlockEXT, storing them in the member variables begin_ + // and end_ respectively. + void recordExistingBeginAndEndBlock(std::vector blocks); + + // Compute the set of blocks including or after the barrier instruction, and + // the set of blocks with any previous blocks inside the barrier instruction. + // If reverse_cfg is true, move forward through the CFG, computing + // after_begin_ and predecessors_after_begin_computing after_begin_ and + // predecessors_after_begin_, otherwise, move backward through the CFG, + // computing before_end_ and successors_before_end_. + BlockSet computeReachableBlocks(BlockSet& in_set, + const BlockSet& starting_nodes, + bool reverse_cfg); + + // Remove unneeded begin and end instructions in block. + bool removeUnneededInstructions(BasicBlock* block); + + // Given a block which branches to multiple successors, and a specific + // successor, creates a new empty block, and update the branch instruction to + // branch to the new block instead. + BasicBlock* splitEdge(BasicBlock* block, uint32_t succ_id); + + // For the edge from block to next_id, places a begin or end instruction on + // the edge, based on the direction we are walking the CFG, specified in + // reverse_cfg. + bool placeInstructionsForEdge(BasicBlock* block, uint32_t next_id, + BlockSet& inside, BlockSet& previous_inside, + spv::Op opcode, bool reverse_cfg); + // Calls placeInstructionsForEdge for each edge in block. + bool placeInstructions(BasicBlock* block); + + // Processes a single fragment shader entry function. + bool processFragmentShaderEntry(Function* entry_func); + + // Returns whether the module has the SPV_EXT_fragment_shader_interlock + // extension and one of the FragmentShader*InterlockEXT capabilities. + bool isFragmentShaderInterlockEnabled(); + + // Maps a function to whether that function originally held a begin or end + // instruction. + std::unordered_map extracted_functions_; + + // The set of blocks which have an OpBeginInvocationInterlockEXT instruction. + BlockSet begin_; + // The set of blocks which have an OpEndInvocationInterlockEXT instruction. + BlockSet end_; + // The set of blocks which either have a begin instruction, or have a + // predecessor which has a begin instruction. + BlockSet after_begin_; + // The set of blocks which either have an end instruction, or have a successor + // which have an end instruction. + BlockSet before_end_; + // The set of blocks which have a predecessor in after_begin_. + BlockSet predecessors_after_begin_; + // The set of blocks which have a successor in before_end_. + BlockSet successors_before_end_; +}; + +} // namespace opt +} // namespace spvtools +#endif // SOURCE_OPT_DEDUPE_INTERLOCK_INVOCATION_PASS_H_ diff --git a/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp b/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp index 239d316c..d864b7c0 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp @@ -88,6 +88,9 @@ void IRContext::BuildInvalidAnalyses(IRContext::Analysis set) { if (set & kAnalysisDebugInfo) { BuildDebugInfoManager(); } + if (set & kAnalysisLiveness) { + BuildLivenessManager(); + } } void IRContext::InvalidateAnalysesExceptFor( diff --git a/bgfx/3rdparty/spirv-tools/source/opt/ir_context.h b/bgfx/3rdparty/spirv-tools/source/opt/ir_context.h index 7ff411a1..38576966 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/ir_context.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/ir_context.h @@ -84,7 +84,7 @@ class IRContext { kAnalysisTypes = 1 << 15, kAnalysisDebugInfo = 1 << 16, kAnalysisLiveness = 1 << 17, - kAnalysisEnd = 1 << 17 + kAnalysisEnd = 1 << 18 }; using ProcessFunction = std::function; @@ -202,8 +202,9 @@ class IRContext { inline IteratorRange debugs3() const; // Iterators for debug info instructions (excluding OpLine & OpNoLine) - // contained in this module. These are OpExtInst for DebugInfo extension - // placed between section 9 and 10. + // contained in this module. These are OpExtInst & + // OpExtInstWithForwardRefsKHR for DebugInfo extension placed between section + // 9 and 10. inline Module::inst_iterator ext_inst_debuginfo_begin(); inline Module::inst_iterator ext_inst_debuginfo_end(); inline IteratorRange ext_inst_debuginfo(); @@ -229,6 +230,8 @@ class IRContext { inline void AddExtInstImport(std::unique_ptr&& e); // Set the memory model for this module. inline void SetMemoryModel(std::unique_ptr&& m); + // Get the memory model for this module. + inline const Instruction* GetMemoryModel() const; // Appends an entry point instruction to this module. inline void AddEntryPoint(std::unique_ptr&& e); // Appends an execution mode instruction to this module. @@ -252,6 +255,8 @@ class IRContext { inline void AddType(std::unique_ptr&& t); // Appends a constant, global variable, or OpUndef instruction to this module. inline void AddGlobalValue(std::unique_ptr&& v); + // Prepends a function declaration to this module. + inline void AddFunctionDeclaration(std::unique_ptr&& f); // Appends a function to this module. inline void AddFunction(std::unique_ptr&& f); @@ -1154,6 +1159,10 @@ void IRContext::SetMemoryModel(std::unique_ptr&& m) { module()->SetMemoryModel(std::move(m)); } +const Instruction* IRContext::GetMemoryModel() const { + return module()->GetMemoryModel(); +} + void IRContext::AddEntryPoint(std::unique_ptr&& e) { module()->AddEntryPoint(std::move(e)); } @@ -1213,6 +1222,10 @@ void IRContext::AddGlobalValue(std::unique_ptr&& v) { module()->AddGlobalValue(std::move(v)); } +void IRContext::AddFunctionDeclaration(std::unique_ptr&& f) { + module()->AddFunctionDeclaration(std::move(f)); +} + void IRContext::AddFunction(std::unique_ptr&& f) { module()->AddFunction(std::move(f)); } diff --git a/bgfx/3rdparty/spirv-tools/source/opt/ir_loader.cpp b/bgfx/3rdparty/spirv-tools/source/opt/ir_loader.cpp index e9b7bbfc..a7850488 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/ir_loader.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/ir_loader.cpp @@ -42,7 +42,7 @@ IrLoader::IrLoader(const MessageConsumer& consumer, Module* m) bool IsLineInst(const spv_parsed_instruction_t* inst) { const auto opcode = static_cast(inst->opcode); if (IsOpLineInst(opcode)) return true; - if (opcode != spv::Op::OpExtInst) return false; + if (!spvIsExtendedInstruction(opcode)) return false; if (inst->ext_inst_type != SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) return false; const uint32_t ext_inst_index = inst->words[kExtInstSetIndex]; @@ -65,7 +65,7 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { // create a new instruction, but simply keep the information in // struct DebugScope. const auto opcode = static_cast(inst->opcode); - if (opcode == spv::Op::OpExtInst && + if (spvIsExtendedInstruction(opcode) && spvExtInstIsDebugInfo(inst->ext_inst_type)) { const uint32_t ext_inst_index = inst->words[kExtInstSetIndex]; if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 || @@ -209,10 +209,10 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { } else if (IsConstantInst(opcode) || opcode == spv::Op::OpVariable || opcode == spv::Op::OpUndef) { module_->AddGlobalValue(std::move(spv_inst)); - } else if (opcode == spv::Op::OpExtInst && + } else if (spvIsExtendedInstruction(opcode) && spvExtInstIsDebugInfo(inst->ext_inst_type)) { module_->AddExtInstDebugInfo(std::move(spv_inst)); - } else if (opcode == spv::Op::OpExtInst && + } else if (spvIsExtendedInstruction(opcode) && spvExtInstIsNonSemantic(inst->ext_inst_type)) { // If there are no functions, add the non-semantic instructions to the // global values. Otherwise append it to the list of the last function. @@ -235,7 +235,7 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { last_dbg_scope_ = DebugScope(kNoDebugScope, kNoInlinedAt); if (last_dbg_scope_.GetLexicalScope() != kNoDebugScope) spv_inst->SetDebugScope(last_dbg_scope_); - if (opcode == spv::Op::OpExtInst && + if (spvIsExtendedInstruction(opcode) && spvExtInstIsDebugInfo(inst->ext_inst_type)) { const uint32_t ext_inst_index = inst->words[kExtInstSetIndex]; if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100) { diff --git a/bgfx/3rdparty/spirv-tools/source/opt/liveness.cpp b/bgfx/3rdparty/spirv-tools/source/opt/liveness.cpp index 336f3ae5..dae705dc 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/liveness.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/liveness.cpp @@ -123,21 +123,29 @@ uint32_t LivenessManager::GetLocSize(const analysis::Type* type) const { return 1; } -const analysis::Type* LivenessManager::GetComponentType( - uint32_t index, const analysis::Type* agg_type) const { - auto arr_type = agg_type->AsArray(); - if (arr_type) return arr_type->element_type(); - auto struct_type = agg_type->AsStruct(); - if (struct_type) return struct_type->element_types()[index]; - auto mat_type = agg_type->AsMatrix(); - if (mat_type) return mat_type->element_type(); - auto vec_type = agg_type->AsVector(); - assert(vec_type && "unexpected non-aggregate type"); - return vec_type->element_type(); +uint32_t LivenessManager::GetComponentType(uint32_t index, + uint32_t agg_type_id) const { + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + Instruction* agg_type_inst = def_use_mgr->GetDef(agg_type_id); + + const uint32_t kArrayElementInIdx = 0; + switch (agg_type_inst->opcode()) { + case spv::Op::OpTypeArray: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeVector: + return agg_type_inst->GetSingleWordInOperand(kArrayElementInIdx); + case spv::Op::OpTypeStruct: + return agg_type_inst->GetSingleWordInOperand(index); + default: + assert(false && "unexpected aggregate type"); + return 0; + } } uint32_t LivenessManager::GetLocOffset(uint32_t index, - const analysis::Type* agg_type) const { + uint32_t agg_type_id) const { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + const analysis::Type* agg_type = type_mgr->GetType(agg_type_id); auto arr_type = agg_type->AsArray(); if (arr_type) return index * GetLocSize(arr_type->element_type()); auto struct_type = agg_type->AsStruct(); @@ -161,12 +169,11 @@ uint32_t LivenessManager::GetLocOffset(uint32_t index, return 0; } -void LivenessManager::AnalyzeAccessChainLoc(const Instruction* ac, - const analysis::Type** curr_type, - uint32_t* offset, bool* no_loc, - bool is_patch, bool input) { +uint32_t LivenessManager::AnalyzeAccessChainLoc(const Instruction* ac, + uint32_t curr_type_id, + uint32_t* offset, bool* no_loc, + bool is_patch, bool input) { analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); analysis::DecorationManager* deco_mgr = context()->get_decoration_mgr(); // For tesc, tese and geom input variables, and tesc output variables, // first array index does not contribute to offset. @@ -178,15 +185,18 @@ void LivenessManager::AnalyzeAccessChainLoc(const Instruction* ac, (!input && stage == spv::ExecutionModel::TessellationControl)) skip_first_index = !is_patch; uint32_t ocnt = 0; - ac->WhileEachInOperand([this, &ocnt, def_use_mgr, type_mgr, deco_mgr, - curr_type, offset, no_loc, + ac->WhileEachInOperand([this, &ocnt, def_use_mgr, deco_mgr, &curr_type_id, + offset, no_loc, skip_first_index](const uint32_t* opnd) { if (ocnt >= 1) { // Skip first index's contribution to offset if indicated + Instruction* curr_type_inst = def_use_mgr->GetDef(curr_type_id); if (ocnt == 1 && skip_first_index) { - auto arr_type = (*curr_type)->AsArray(); - assert(arr_type && "unexpected wrapper type"); - *curr_type = arr_type->element_type(); + assert(curr_type_inst->opcode() == spv::Op::OpTypeArray && + "unexpected wrapper type"); + const uint32_t kArrayElementTypeInIdx = 0; + curr_type_id = + curr_type_inst->GetSingleWordInOperand(kArrayElementTypeInIdx); ocnt++; return true; } @@ -196,12 +206,10 @@ void LivenessManager::AnalyzeAccessChainLoc(const Instruction* ac, // If current type is struct, look for location decoration on member and // reset offset if found. auto index = idx_inst->GetSingleWordInOperand(0); - auto str_type = (*curr_type)->AsStruct(); - if (str_type) { + if (curr_type_inst->opcode() == spv::Op::OpTypeStruct) { uint32_t loc = 0; - auto str_type_id = type_mgr->GetId(str_type); bool no_mem_loc = deco_mgr->WhileEachDecoration( - str_type_id, uint32_t(spv::Decoration::Location), + curr_type_id, uint32_t(spv::Decoration::Location), [&loc, index, no_loc](const Instruction& deco) { assert(deco.opcode() == spv::Op::OpMemberDecorate && "unexpected decoration"); @@ -216,19 +224,20 @@ void LivenessManager::AnalyzeAccessChainLoc(const Instruction* ac, }); if (!no_mem_loc) { *offset = loc; - *curr_type = GetComponentType(index, *curr_type); + curr_type_id = curr_type_inst->GetSingleWordInOperand(index); ocnt++; return true; } } // Update offset and current type based on constant index. - *offset += GetLocOffset(index, *curr_type); - *curr_type = GetComponentType(index, *curr_type); + *offset += GetLocOffset(index, curr_type_id); + curr_type_id = GetComponentType(index, curr_type_id); } ocnt++; return true; }); + return curr_type_id; } void LivenessManager::MarkRefLive(const Instruction* ref, Instruction* var) { @@ -268,8 +277,15 @@ void LivenessManager::MarkRefLive(const Instruction* ref, Instruction* var) { // through constant indices and mark those locs live. Assert if no location // found. uint32_t offset = loc; - auto curr_type = var_type; - AnalyzeAccessChainLoc(ref, &curr_type, &offset, &no_loc, is_patch); + Instruction* ptr_type_inst = + context()->get_def_use_mgr()->GetDef(var->type_id()); + assert(ptr_type && "unexpected var type"); + const uint32_t kPointerTypePointeeIdx = 1; + uint32_t var_type_id = + ptr_type_inst->GetSingleWordInOperand(kPointerTypePointeeIdx); + uint32_t curr_type_id = + AnalyzeAccessChainLoc(ref, var_type_id, &offset, &no_loc, is_patch); + auto curr_type = type_mgr->GetType(curr_type_id); assert(!no_loc && "missing input variable location"); MarkLocsLive(offset, GetLocSize(curr_type)); } @@ -277,15 +293,18 @@ void LivenessManager::MarkRefLive(const Instruction* ref, Instruction* var) { void LivenessManager::ComputeLiveness() { InitializeAnalysis(); analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); // Process all input variables for (auto& var : context()->types_values()) { if (var.opcode() != spv::Op::OpVariable) { continue; } - analysis::Type* var_type = type_mgr->GetType(var.type_id()); - analysis::Pointer* ptr_type = var_type->AsPointer(); - if (ptr_type->storage_class() != spv::StorageClass::Input) { + Instruction* var_type_inst = def_use_mgr->GetDef(var.type_id()); + assert(var_type_inst->opcode() == spv::Op::OpTypePointer && + "Expected a pointer type"); + const uint32_t kPointerTypeStorageClassInIdx = 0; + spv::StorageClass sc = static_cast( + var_type_inst->GetSingleWordInOperand(kPointerTypeStorageClassInIdx)); + if (sc != spv::StorageClass::Input) { continue; } // If var is builtin, mark live if analyzed and continue to next variable @@ -295,14 +314,15 @@ void LivenessManager::ComputeLiveness() { // continue to next variable. Input interface blocks will only appear // in tesc, tese and geom shaders. Will need to strip off one level of // arrayness to get to block type. - auto pte_type = ptr_type->pointee_type(); - auto arr_type = pte_type->AsArray(); - if (arr_type) { - auto elt_type = arr_type->element_type(); - auto str_type = elt_type->AsStruct(); - if (str_type) { - auto str_type_id = type_mgr->GetId(str_type); - if (AnalyzeBuiltIn(str_type_id)) continue; + const uint32_t kPointerTypePointeeTypeInIdx = 1; + uint32_t pte_type_id = + var_type_inst->GetSingleWordInOperand(kPointerTypePointeeTypeInIdx); + Instruction* pte_type_inst = def_use_mgr->GetDef(pte_type_id); + if (pte_type_inst->opcode() == spv::Op::OpTypeArray) { + uint32_t array_elt_type_id = pte_type_inst->GetSingleWordInOperand(0); + Instruction* arr_elt_type = def_use_mgr->GetDef(array_elt_type_id); + if (arr_elt_type->opcode() == spv::Op::OpTypeStruct) { + if (AnalyzeBuiltIn(array_elt_type_id)) continue; } } // Mark all used locations of var live diff --git a/bgfx/3rdparty/spirv-tools/source/opt/liveness.h b/bgfx/3rdparty/spirv-tools/source/opt/liveness.h index 7d8a9fb4..70500059 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/liveness.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/liveness.h @@ -41,13 +41,13 @@ class LivenessManager { // Return true if builtin |bi| is being analyzed. bool IsAnalyzedBuiltin(uint32_t bi); - // Determine starting loc |offset| and the type |cur_type| of - // access chain |ac|. Set |no_loc| to true if no loc found. - // |is_patch| indicates if patch variable. |input| is true - // if input variable, otherwise output variable. - void AnalyzeAccessChainLoc(const Instruction* ac, - const analysis::Type** curr_type, uint32_t* offset, - bool* no_loc, bool is_patch, bool input = true); + // Return the result type of |ac| when applied to |cur_type_id|. Set + // |no_loc| to true if no loc found. Set |is_patch| indicates if the variable + // is a patch variable. Set |input| if the variable is an input variable. + // Otherwise it is assumed that the variable is an output variable. + uint32_t AnalyzeAccessChainLoc(const Instruction* ac, uint32_t curr_type_id, + uint32_t* offset, bool* no_loc, bool is_patch, + bool input = true); // Return size of |type_id| in units of locations uint32_t GetLocSize(const analysis::Type* type) const; @@ -68,13 +68,12 @@ class LivenessManager { // Mark |count| locations starting at location |start|. void MarkLocsLive(uint32_t start, uint32_t count); - // Return type of component of aggregate type |agg_type| at |index| - const analysis::Type* GetComponentType(uint32_t index, - const analysis::Type* agg_type) const; + // Return type of the member |index| in the aggregate type |agg_type_id|. + uint32_t GetComponentType(uint32_t index, uint32_t agg_type_id) const; - // Return offset of |index| into aggregate type |agg_type| in units of - // input locations - uint32_t GetLocOffset(uint32_t index, const analysis::Type* agg_type) const; + // Return offset of member |index| in the aggregate type |agg_type_id| in + // units of input locations. + uint32_t GetLocOffset(uint32_t index, uint32_t agg_type_id) const; // Populate live_locs_ and live_builtins_ void ComputeLiveness(); diff --git a/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp index d024af60..ad027747 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp @@ -420,14 +420,17 @@ void LocalAccessChainConvertPass::InitExtensions() { "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_NV_fragment_shader_barycentric", "SPV_NV_compute_shader_derivatives", "SPV_NV_shader_image_footprint", - "SPV_NV_shading_rate", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", - "SPV_KHR_ray_tracing", "SPV_KHR_ray_query", + "SPV_NV_shading_rate", "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader", + "SPV_NV_ray_tracing", "SPV_KHR_ray_tracing", "SPV_KHR_ray_query", "SPV_EXT_fragment_invocation_density", "SPV_KHR_terminate_invocation", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_integer_dot_product", "SPV_EXT_shader_image_int64", "SPV_KHR_non_semantic_info", "SPV_KHR_uniform_group_instructions", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_vulkan_memory_model", - "SPV_NV_bindless_texture", "SPV_EXT_shader_atomic_float_add"}); + "SPV_NV_bindless_texture", "SPV_EXT_shader_atomic_float_add", + "SPV_EXT_fragment_shader_interlock", + "SPV_KHR_compute_shader_derivatives", "SPV_NV_cooperative_matrix", + "SPV_KHR_cooperative_matrix", "SPV_KHR_ray_tracing_position_fetch"}); } bool LocalAccessChainConvertPass::AnyIndexIsOutOfBounds( diff --git a/bgfx/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp index 5e524c45..7df17d5d 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp @@ -273,11 +273,13 @@ void LocalSingleBlockLoadStoreElimPass::InitExtensions() { "SPV_NV_shader_image_footprint", "SPV_NV_shading_rate", "SPV_NV_mesh_shader", + "SPV_EXT_mesh_shader", "SPV_NV_ray_tracing", "SPV_KHR_ray_tracing", "SPV_KHR_ray_query", "SPV_EXT_fragment_invocation_density", "SPV_EXT_physical_storage_buffer", + "SPV_KHR_physical_storage_buffer", "SPV_KHR_terminate_invocation", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_integer_dot_product", @@ -287,7 +289,12 @@ void LocalSingleBlockLoadStoreElimPass::InitExtensions() { "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_vulkan_memory_model", "SPV_NV_bindless_texture", - "SPV_EXT_shader_atomic_float_add"}); + "SPV_EXT_shader_atomic_float_add", + "SPV_EXT_fragment_shader_interlock", + "SPV_KHR_compute_shader_derivatives", + "SPV_NV_cooperative_matrix", + "SPV_KHR_cooperative_matrix", + "SPV_KHR_ray_tracing_position_fetch"}); } } // namespace opt diff --git a/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp index fefe2ce9..bb7bba87 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp @@ -124,10 +124,12 @@ void LocalSingleStoreElimPass::InitExtensionAllowList() { "SPV_NV_shader_image_footprint", "SPV_NV_shading_rate", "SPV_NV_mesh_shader", + "SPV_EXT_mesh_shader", "SPV_NV_ray_tracing", "SPV_KHR_ray_query", "SPV_EXT_fragment_invocation_density", "SPV_EXT_physical_storage_buffer", + "SPV_KHR_physical_storage_buffer", "SPV_KHR_terminate_invocation", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_integer_dot_product", @@ -137,7 +139,12 @@ void LocalSingleStoreElimPass::InitExtensionAllowList() { "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_vulkan_memory_model", "SPV_NV_bindless_texture", - "SPV_EXT_shader_atomic_float_add"}); + "SPV_EXT_shader_atomic_float_add", + "SPV_EXT_fragment_shader_interlock", + "SPV_KHR_compute_shader_derivatives", + "SPV_NV_cooperative_matrix", + "SPV_KHR_cooperative_matrix", + "SPV_KHR_ray_tracing_position_fetch"}); } bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) { std::vector users; diff --git a/bgfx/3rdparty/spirv-tools/source/opt/log.h b/bgfx/3rdparty/spirv-tools/source/opt/log.h index 68051002..4fb66fd4 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/log.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/log.h @@ -23,7 +23,7 @@ #include "spirv-tools/libspirv.hpp" // Asserts the given condition is true. Otherwise, sends a message to the -// consumer and exits the problem with failure code. Accepts the following +// consumer and exits the program with failure code. Accepts the following // formats: // // SPIRV_ASSERT(, ); @@ -36,7 +36,9 @@ #if !defined(NDEBUG) #define SPIRV_ASSERT(consumer, ...) SPIRV_ASSERT_IMPL(consumer, __VA_ARGS__) #else -#define SPIRV_ASSERT(consumer, ...) +// Adding a use to avoid errors in the release build related to unused +// consumers. +#define SPIRV_ASSERT(consumer, ...) (void)(consumer) #endif // Logs a debug message to the consumer. Accepts the following formats: @@ -49,26 +51,11 @@ #if !defined(NDEBUG) && defined(SPIRV_LOG_DEBUG) #define SPIRV_DEBUG(consumer, ...) SPIRV_DEBUG_IMPL(consumer, __VA_ARGS__) #else -#define SPIRV_DEBUG(consumer, ...) +// Adding a use to avoid errors in the release build related to unused +// consumers. +#define SPIRV_DEBUG(consumer, ...) (void)(consumer) #endif -// Logs an error message to the consumer saying the given feature is -// unimplemented. -#define SPIRV_UNIMPLEMENTED(consumer, feature) \ - do { \ - spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ - {static_cast(__LINE__), 0, 0}, \ - "unimplemented: " feature); \ - } while (0) - -// Logs an error message to the consumer saying the code location -// should be unreachable. -#define SPIRV_UNREACHABLE(consumer) \ - do { \ - spvtools::Log(consumer, SPV_MSG_INTERNAL_ERROR, __FILE__, \ - {static_cast(__LINE__), 0, 0}, "unreachable"); \ - } while (0) - // Helper macros for concatenating arguments. #define SPIRV_CONCATENATE(a, b) SPIRV_CONCATENATE_(a, b) #define SPIRV_CONCATENATE_(a, b) a##b diff --git a/bgfx/3rdparty/spirv-tools/source/opt/mem_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/mem_pass.cpp index 9972c4f7..65f45ec3 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/mem_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/mem_pass.cpp @@ -43,6 +43,8 @@ bool MemPass::IsBaseTargetType(const Instruction* typeInst) const { case spv::Op::OpTypeSampler: case spv::Op::OpTypeSampledImage: case spv::Op::OpTypePointer: + case spv::Op::OpTypeCooperativeMatrixNV: + case spv::Op::OpTypeCooperativeMatrixKHR: return true; default: break; @@ -413,6 +415,7 @@ void MemPass::RemoveBlock(Function::iterator* bi) { } bool MemPass::RemoveUnreachableBlocks(Function* func) { + if (func->IsDeclaration()) return false; bool modified = false; // Mark reachable all blocks reachable from the function's entry block. diff --git a/bgfx/3rdparty/spirv-tools/source/opt/modify_maximal_reconvergence.cpp b/bgfx/3rdparty/spirv-tools/source/opt/modify_maximal_reconvergence.cpp new file mode 100644 index 00000000..dd79b628 --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/opt/modify_maximal_reconvergence.cpp @@ -0,0 +1,103 @@ +// Copyright (c) 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "modify_maximal_reconvergence.h" + +#include "source/opt/ir_context.h" +#include "source/util/make_unique.h" + +namespace spvtools { +namespace opt { + +Pass::Status ModifyMaximalReconvergence::Process() { + bool changed = false; + if (add_) { + changed = AddMaximalReconvergence(); + } else { + changed = RemoveMaximalReconvergence(); + } + return changed ? Pass::Status::SuccessWithChange + : Pass::Status::SuccessWithoutChange; +} + +bool ModifyMaximalReconvergence::AddMaximalReconvergence() { + bool changed = false; + bool has_extension = false; + bool has_shader = + context()->get_feature_mgr()->HasCapability(spv::Capability::Shader); + for (auto extension : context()->extensions()) { + if (extension.GetOperand(0).AsString() == "SPV_KHR_maximal_reconvergence") { + has_extension = true; + break; + } + } + + std::unordered_set entry_points_with_mode; + for (auto mode : get_module()->execution_modes()) { + if (spv::ExecutionMode(mode.GetSingleWordInOperand(1)) == + spv::ExecutionMode::MaximallyReconvergesKHR) { + entry_points_with_mode.insert(mode.GetSingleWordInOperand(0)); + } + } + + for (auto entry_point : get_module()->entry_points()) { + const uint32_t id = entry_point.GetSingleWordInOperand(1); + if (!entry_points_with_mode.count(id)) { + changed = true; + if (!has_extension) { + context()->AddExtension("SPV_KHR_maximal_reconvergence"); + has_extension = true; + } + if (!has_shader) { + context()->AddCapability(spv::Capability::Shader); + has_shader = true; + } + context()->AddExecutionMode(MakeUnique( + context(), spv::Op::OpExecutionMode, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {id}}, + {SPV_OPERAND_TYPE_EXECUTION_MODE, + {static_cast( + spv::ExecutionMode::MaximallyReconvergesKHR)}}})); + entry_points_with_mode.insert(id); + } + } + + return changed; +} + +bool ModifyMaximalReconvergence::RemoveMaximalReconvergence() { + bool changed = false; + std::vector to_remove; + Instruction* mode = &*get_module()->execution_mode_begin(); + while (mode) { + if (mode->opcode() != spv::Op::OpExecutionMode && + mode->opcode() != spv::Op::OpExecutionModeId) { + break; + } + if (spv::ExecutionMode(mode->GetSingleWordInOperand(1)) == + spv::ExecutionMode::MaximallyReconvergesKHR) { + mode = context()->KillInst(mode); + changed = true; + } else { + mode = mode->NextNode(); + } + } + + changed |= + context()->RemoveExtension(Extension::kSPV_KHR_maximal_reconvergence); + return changed; +} +} // namespace opt +} // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/opt/modify_maximal_reconvergence.h b/bgfx/3rdparty/spirv-tools/source/opt/modify_maximal_reconvergence.h new file mode 100644 index 00000000..8d9a698e --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/opt/modify_maximal_reconvergence.h @@ -0,0 +1,53 @@ +// Copyright (c) 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LIBSPIRV_OPT_MODIFY_MAXIMAL_RECONVERGENCE_H_ +#define LIBSPIRV_OPT_MODIFY_MAXIMAL_RECONVERGENCE_H_ + +#include "pass.h" + +namespace spvtools { +namespace opt { + +// Modifies entry points to either add or remove MaximallyReconvergesKHR +// +// This pass will either add or remove MaximallyReconvergesKHR to all entry +// points in the module. When adding the execution mode, it does not attempt to +// determine whether any ray tracing invocation repack instructions might be +// executed because it is a runtime restriction. That is left to the user. +class ModifyMaximalReconvergence : public Pass { + public: + const char* name() const override { return "modify-maximal-reconvergence"; } + Status Process() override; + + explicit ModifyMaximalReconvergence(bool add = true) : Pass(), add_(add) {} + + IRContext::Analysis GetPreservedAnalyses() override { + return IRContext::kAnalysisDefUse | + IRContext::kAnalysisInstrToBlockMapping | + IRContext::kAnalysisDecorations | IRContext::kAnalysisCombinators | + IRContext::kAnalysisCFG | IRContext::kAnalysisNameMap | + IRContext::kAnalysisConstants | IRContext::kAnalysisTypes; + } + + private: + bool AddMaximalReconvergence(); + bool RemoveMaximalReconvergence(); + + bool add_; +}; +} // namespace opt +} // namespace spvtools + +#endif // LIBSPIRV_OPT_MODIFY_MAXIMAL_RECONVERGENCE_H_ diff --git a/bgfx/3rdparty/spirv-tools/source/opt/module.h b/bgfx/3rdparty/spirv-tools/source/opt/module.h index b9d69129..98c16dc4 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/module.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/module.h @@ -120,6 +120,9 @@ class Module { // Appends a constant, global variable, or OpUndef instruction to this module. inline void AddGlobalValue(std::unique_ptr v); + // Prepends a function declaration to this module. + inline void AddFunctionDeclaration(std::unique_ptr f); + // Appends a function to this module. inline void AddFunction(std::unique_ptr f); @@ -380,6 +383,11 @@ inline void Module::AddGlobalValue(std::unique_ptr v) { types_values_.push_back(std::move(v)); } +inline void Module::AddFunctionDeclaration(std::unique_ptr f) { + // function declarations must come before function definitions. + functions_.emplace(functions_.begin(), std::move(f)); +} + inline void Module::AddFunction(std::unique_ptr f) { functions_.emplace_back(std::move(f)); } diff --git a/bgfx/3rdparty/spirv-tools/source/opt/opextinst_forward_ref_fixup_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/opextinst_forward_ref_fixup_pass.cpp new file mode 100644 index 00000000..8684feb4 --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/opt/opextinst_forward_ref_fixup_pass.cpp @@ -0,0 +1,112 @@ +// Copyright (c) 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "source/opt/opextinst_forward_ref_fixup_pass.h" + +#include +#include + +#include "source/extensions.h" +#include "source/opt/ir_context.h" +#include "source/opt/module.h" +#include "type_manager.h" + +namespace spvtools { +namespace opt { +namespace { + +// Returns true if the instruction |inst| has a forward reference to another +// debug instruction. +// |debug_ids| contains the list of IDs belonging to debug instructions. +// |seen_ids| contains the list of IDs already seen. +bool HasForwardReference(const Instruction& inst, + const std::unordered_set& debug_ids, + const std::unordered_set& seen_ids) { + const uint32_t num_in_operands = inst.NumInOperands(); + for (uint32_t i = 0; i < num_in_operands; ++i) { + const Operand& op = inst.GetInOperand(i); + if (!spvIsIdType(op.type)) continue; + + if (debug_ids.count(op.AsId()) == 0) continue; + + if (seen_ids.count(op.AsId()) == 0) return true; + } + + return false; +} + +// Replace |inst| opcode with OpExtInstWithForwardRefsKHR or OpExtInst +// if required to comply with forward references. +bool ReplaceOpcodeIfRequired(Instruction& inst, bool hasForwardReferences) { + if (hasForwardReferences && + inst.opcode() != spv::Op::OpExtInstWithForwardRefsKHR) + inst.SetOpcode(spv::Op::OpExtInstWithForwardRefsKHR); + else if (!hasForwardReferences && inst.opcode() != spv::Op::OpExtInst) + inst.SetOpcode(spv::Op::OpExtInst); + else + return false; + return true; +} + +// Returns all the result IDs of the instructions in |range|. +std::unordered_set gatherResultIds( + const IteratorRange& range) { + std::unordered_set output; + for (const auto& it : range) output.insert(it.result_id()); + return output; +} + +} // namespace + +Pass::Status OpExtInstWithForwardReferenceFixupPass::Process() { + std::unordered_set seen_ids = + gatherResultIds(get_module()->ext_inst_imports()); + std::unordered_set debug_ids = + gatherResultIds(get_module()->ext_inst_debuginfo()); + for (uint32_t id : seen_ids) debug_ids.insert(id); + + bool moduleChanged = false; + bool hasAtLeastOneForwardReference = false; + IRContext* ctx = context(); + for (Instruction& inst : get_module()->ext_inst_debuginfo()) { + if (inst.opcode() != spv::Op::OpExtInst && + inst.opcode() != spv::Op::OpExtInstWithForwardRefsKHR) + continue; + + seen_ids.insert(inst.result_id()); + bool hasForwardReferences = HasForwardReference(inst, debug_ids, seen_ids); + hasAtLeastOneForwardReference |= hasForwardReferences; + + if (ReplaceOpcodeIfRequired(inst, hasForwardReferences)) { + moduleChanged = true; + ctx->AnalyzeUses(&inst); + } + } + + if (hasAtLeastOneForwardReference != + ctx->get_feature_mgr()->HasExtension( + kSPV_KHR_relaxed_extended_instruction)) { + if (hasAtLeastOneForwardReference) + ctx->AddExtension("SPV_KHR_relaxed_extended_instruction"); + else + ctx->RemoveExtension(Extension::kSPV_KHR_relaxed_extended_instruction); + moduleChanged = true; + } + + return moduleChanged ? Status::SuccessWithChange + : Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/opt/opextinst_forward_ref_fixup_pass.h b/bgfx/3rdparty/spirv-tools/source/opt/opextinst_forward_ref_fixup_pass.h new file mode 100644 index 00000000..26e5b81c --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/opt/opextinst_forward_ref_fixup_pass.h @@ -0,0 +1,48 @@ +// Copyright (c) 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_OPEXTINST_FORWARD_REF_FIXUP_H +#define SOURCE_OPT_OPEXTINST_FORWARD_REF_FIXUP_H + +#include "source/opt/ir_context.h" +#include "source/opt/module.h" +#include "source/opt/pass.h" + +namespace spvtools { +namespace opt { + +class OpExtInstWithForwardReferenceFixupPass : public Pass { + public: + const char* name() const override { return "fix-opextinst-opcodes"; } + Status Process() override; + + IRContext::Analysis GetPreservedAnalyses() override { + return IRContext::kAnalysisInstrToBlockMapping | + IRContext::kAnalysisDecorations | IRContext::kAnalysisCombinators | + IRContext::kAnalysisCFG | IRContext::kAnalysisDominatorAnalysis | + IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap | + IRContext::kAnalysisScalarEvolution | + IRContext::kAnalysisRegisterPressure | + IRContext::kAnalysisValueNumberTable | + IRContext::kAnalysisStructuredCFG | + IRContext::kAnalysisBuiltinVarId | + IRContext::kAnalysisIdToFuncMapping | IRContext::kAnalysisTypes | + IRContext::kAnalysisDefUse | IRContext::kAnalysisConstants; + } +}; + +} // namespace opt +} // namespace spvtools + +#endif // SOURCE_OPT_OPEXTINST_FORWARD_REF_FIXUP_H diff --git a/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp b/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp index b8f52834..94b15c6a 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp @@ -33,6 +33,15 @@ namespace spvtools { +std::vector GetVectorOfStrings(const char** strings, + const size_t string_count) { + std::vector result; + for (uint32_t i = 0; i < string_count; i++) { + result.emplace_back(strings[i]); + } + return result; +} + struct Optimizer::PassToken::Impl { Impl(std::unique_ptr p) : pass(std::move(p)) {} @@ -158,7 +167,10 @@ Optimizer& Optimizer::RegisterLegalizationPasses(bool preserve_interface) { .RegisterPass(CreateDeadInsertElimPass()) .RegisterPass(CreateReduceLoadSizePass()) .RegisterPass(CreateAggressiveDCEPass(preserve_interface)) - .RegisterPass(CreateInterpolateFixupPass()); + .RegisterPass(CreateRemoveUnusedInterfaceVariablesPass()) + .RegisterPass(CreateInterpolateFixupPass()) + .RegisterPass(CreateInvocationInterlockPlacementPass()) + .RegisterPass(CreateOpExtInstWithForwardReferenceFixupPass()); } Optimizer& Optimizer::RegisterLegalizationPasses() { @@ -255,8 +267,13 @@ Optimizer& Optimizer::RegisterSizePasses(bool preserve_interface) { Optimizer& Optimizer::RegisterSizePasses() { return RegisterSizePasses(false); } bool Optimizer::RegisterPassesFromFlags(const std::vector& flags) { + return RegisterPassesFromFlags(flags, false); +} + +bool Optimizer::RegisterPassesFromFlags(const std::vector& flags, + bool preserve_interface) { for (const auto& flag : flags) { - if (!RegisterPassFromFlag(flag)) { + if (!RegisterPassFromFlag(flag, preserve_interface)) { return false; } } @@ -280,6 +297,11 @@ bool Optimizer::FlagHasValidForm(const std::string& flag) const { } bool Optimizer::RegisterPassFromFlag(const std::string& flag) { + return RegisterPassFromFlag(flag, false); +} + +bool Optimizer::RegisterPassFromFlag(const std::string& flag, + bool preserve_interface) { if (!FlagHasValidForm(flag)) { return false; } @@ -302,6 +324,8 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { RegisterPass(CreateStripReflectInfoPass()); } else if (pass_name == "strip-nonsemantic") { RegisterPass(CreateStripNonSemanticInfoPass()); + } else if (pass_name == "fix-opextinst-opcodes") { + RegisterPass(CreateOpExtInstWithForwardReferenceFixupPass()); } else if (pass_name == "set-spec-const-default-value") { if (pass_args.size() > 0) { auto spec_ids_vals = @@ -340,8 +364,12 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { RegisterPass(CreateSpreadVolatileSemanticsPass()); } else if (pass_name == "descriptor-scalar-replacement") { RegisterPass(CreateDescriptorScalarReplacementPass()); + } else if (pass_name == "descriptor-composite-scalar-replacement") { + RegisterPass(CreateDescriptorCompositeScalarReplacementPass()); + } else if (pass_name == "descriptor-array-scalar-replacement") { + RegisterPass(CreateDescriptorArrayScalarReplacementPass()); } else if (pass_name == "eliminate-dead-code-aggressive") { - RegisterPass(CreateAggressiveDCEPass()); + RegisterPass(CreateAggressiveDCEPass(preserve_interface)); } else if (pass_name == "eliminate-insert-extract") { RegisterPass(CreateInsertExtractElimPass()); } else if (pass_name == "eliminate-local-single-block") { @@ -430,24 +458,10 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { RegisterPass(CreateWorkaround1209Pass()); } else if (pass_name == "replace-invalid-opcode") { RegisterPass(CreateReplaceInvalidOpcodePass()); - } else if (pass_name == "inst-bindless-check" || - pass_name == "inst-desc-idx-check" || - pass_name == "inst-buff-oob-check") { - // preserve legacy names - RegisterPass(CreateInstBindlessCheckPass(7, 23)); - RegisterPass(CreateSimplificationPass()); - RegisterPass(CreateDeadBranchElimPass()); - RegisterPass(CreateBlockMergePass()); - RegisterPass(CreateAggressiveDCEPass(true)); - } else if (pass_name == "inst-buff-addr-check") { - RegisterPass(CreateInstBuffAddrCheckPass(7, 23)); - RegisterPass(CreateAggressiveDCEPass(true)); } else if (pass_name == "convert-relaxed-to-half") { RegisterPass(CreateConvertRelaxedToHalfPass()); } else if (pass_name == "relax-float-ops") { RegisterPass(CreateRelaxFloatOpsPass()); - } else if (pass_name == "inst-debug-printf") { - RegisterPass(CreateInstDebugPrintfPass(7, 23)); } else if (pass_name == "simplify-instructions") { RegisterPass(CreateSimplificationPass()); } else if (pass_name == "ssa-rewrite") { @@ -509,11 +523,11 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { } else if (pass_name == "fix-storage-class") { RegisterPass(CreateFixStorageClassPass()); } else if (pass_name == "O") { - RegisterPerformancePasses(); + RegisterPerformancePasses(preserve_interface); } else if (pass_name == "Os") { - RegisterSizePasses(); + RegisterSizePasses(preserve_interface); } else if (pass_name == "legalize-hlsl") { - RegisterLegalizationPasses(); + RegisterLegalizationPasses(preserve_interface); } else if (pass_name == "remove-unused-interface-variables") { RegisterPass(CreateRemoveUnusedInterfaceVariablesPass()); } else if (pass_name == "graphics-robust-access") { @@ -550,13 +564,33 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { pass_args.c_str()); return false; } + } else if (pass_name == "struct-packing") { + if (pass_args.size() == 0) { + Error(consumer(), nullptr, {}, + "--struct-packing requires a name:rule argument."); + return false; + } + + auto separator_pos = pass_args.find(':'); + if (separator_pos == std::string::npos || separator_pos == 0 || + separator_pos + 1 == pass_args.size()) { + Errorf(consumer(), nullptr, {}, + "Invalid argument for --struct-packing: %s", pass_args.c_str()); + return false; + } + + const std::string struct_name = pass_args.substr(0, separator_pos); + const std::string rule_name = pass_args.substr(separator_pos + 1); + + RegisterPass( + CreateStructPackingPass(struct_name.c_str(), rule_name.c_str())); } else if (pass_name == "switch-descriptorset") { if (pass_args.size() == 0) { Error(consumer(), nullptr, {}, "--switch-descriptorset requires a from:to argument."); return false; } - uint32_t from_set, to_set; + uint32_t from_set = 0, to_set = 0; const char* start = pass_args.data(); const char* end = pass_args.data() + pass_args.size(); @@ -583,6 +617,25 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { return false; } RegisterPass(CreateSwitchDescriptorSetPass(from_set, to_set)); + } else if (pass_name == "modify-maximal-reconvergence") { + if (pass_args.size() == 0) { + Error(consumer(), nullptr, {}, + "--modify-maximal-reconvergence requires an argument"); + return false; + } + if (pass_args == "add") { + RegisterPass(CreateModifyMaximalReconvergencePass(true)); + } else if (pass_args == "remove") { + RegisterPass(CreateModifyMaximalReconvergencePass(false)); + } else { + Errorf(consumer(), nullptr, {}, + "Invalid argument for --modify-maximal-reconvergence: %s (must be " + "'add' or 'remove')", + pass_args.c_str()); + return false; + } + } else if (pass_name == "trim-capabilities") { + RegisterPass(CreateTrimCapabilitiesPass()); } else { Errorf(consumer(), nullptr, {}, "Unknown flag '--%s'. Use --help for a list of valid flags", @@ -980,24 +1033,6 @@ Optimizer::PassToken CreateUpgradeMemoryModelPass() { MakeUnique()); } -Optimizer::PassToken CreateInstBindlessCheckPass(uint32_t desc_set, - uint32_t shader_id) { - return MakeUnique( - MakeUnique(desc_set, shader_id)); -} - -Optimizer::PassToken CreateInstDebugPrintfPass(uint32_t desc_set, - uint32_t shader_id) { - return MakeUnique( - MakeUnique(desc_set, shader_id)); -} - -Optimizer::PassToken CreateInstBuffAddrCheckPass(uint32_t desc_set, - uint32_t shader_id) { - return MakeUnique( - MakeUnique(desc_set, shader_id)); -} - Optimizer::PassToken CreateConvertRelaxedToHalfPass() { return MakeUnique( MakeUnique()); @@ -1035,7 +1070,20 @@ Optimizer::PassToken CreateSpreadVolatileSemanticsPass() { Optimizer::PassToken CreateDescriptorScalarReplacementPass() { return MakeUnique( - MakeUnique()); + MakeUnique( + /* flatten_composites= */ true, /* flatten_arrays= */ true)); +} + +Optimizer::PassToken CreateDescriptorCompositeScalarReplacementPass() { + return MakeUnique( + MakeUnique( + /* flatten_composites= */ true, /* flatten_arrays= */ false)); +} + +Optimizer::PassToken CreateDescriptorArrayScalarReplacementPass() { + return MakeUnique( + MakeUnique( + /* flatten_composites= */ false, /* flatten_arrays= */ true)); } Optimizer::PassToken CreateWrapOpKillPass() { @@ -1111,10 +1159,34 @@ Optimizer::PassToken CreateTrimCapabilitiesPass() { MakeUnique()); } +Optimizer::PassToken CreateStructPackingPass(const char* structToPack, + const char* packingRule) { + return MakeUnique( + MakeUnique( + structToPack, + opt::StructPackingPass::ParsePackingRuleFromString(packingRule))); +} + Optimizer::PassToken CreateSwitchDescriptorSetPass(uint32_t from, uint32_t to) { return MakeUnique( MakeUnique(from, to)); } + +Optimizer::PassToken CreateInvocationInterlockPlacementPass() { + return MakeUnique( + MakeUnique()); +} + +Optimizer::PassToken CreateModifyMaximalReconvergencePass(bool add) { + return MakeUnique( + MakeUnique(add)); +} + +Optimizer::PassToken CreateOpExtInstWithForwardReferenceFixupPass() { + return MakeUnique( + MakeUnique()); +} + } // namespace spvtools extern "C" { @@ -1163,13 +1235,19 @@ SPIRV_TOOLS_EXPORT bool spvOptimizerRegisterPassFromFlag( SPIRV_TOOLS_EXPORT bool spvOptimizerRegisterPassesFromFlags( spv_optimizer_t* optimizer, const char** flags, const size_t flag_count) { - std::vector opt_flags; - for (uint32_t i = 0; i < flag_count; i++) { - opt_flags.emplace_back(flags[i]); - } + std::vector opt_flags = + spvtools::GetVectorOfStrings(flags, flag_count); + return reinterpret_cast(optimizer) + ->RegisterPassesFromFlags(opt_flags, false); +} - return reinterpret_cast(optimizer)-> - RegisterPassesFromFlags(opt_flags); +SPIRV_TOOLS_EXPORT bool +spvOptimizerRegisterPassesFromFlagsWhilePreservingTheInterface( + spv_optimizer_t* optimizer, const char** flags, const size_t flag_count) { + std::vector opt_flags = + spvtools::GetVectorOfStrings(flags, flag_count); + return reinterpret_cast(optimizer) + ->RegisterPassesFromFlags(opt_flags, true); } SPIRV_TOOLS_EXPORT diff --git a/bgfx/3rdparty/spirv-tools/source/opt/pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/pass.cpp index 75c37407..0f260e2e 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/pass.cpp @@ -83,7 +83,6 @@ uint32_t Pass::GetNullId(uint32_t type_id) { uint32_t Pass::GenerateCopy(Instruction* object_to_copy, uint32_t new_type_id, Instruction* insertion_position) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); uint32_t original_type_id = object_to_copy->type_id(); @@ -95,57 +94,63 @@ uint32_t Pass::GenerateCopy(Instruction* object_to_copy, uint32_t new_type_id, context(), insertion_position, IRContext::kAnalysisInstrToBlockMapping | IRContext::kAnalysisDefUse); - analysis::Type* original_type = type_mgr->GetType(original_type_id); - analysis::Type* new_type = type_mgr->GetType(new_type_id); - - if (const analysis::Array* original_array_type = original_type->AsArray()) { - uint32_t original_element_type_id = - type_mgr->GetId(original_array_type->element_type()); - - analysis::Array* new_array_type = new_type->AsArray(); - assert(new_array_type != nullptr && "Can't copy an array to a non-array."); - uint32_t new_element_type_id = - type_mgr->GetId(new_array_type->element_type()); - - std::vector element_ids; - const analysis::Constant* length_const = - const_mgr->FindDeclaredConstant(original_array_type->LengthId()); - assert(length_const->AsIntConstant()); - uint32_t array_length = length_const->AsIntConstant()->GetU32(); - for (uint32_t i = 0; i < array_length; i++) { - Instruction* extract = ir_builder.AddCompositeExtract( - original_element_type_id, object_to_copy->result_id(), {i}); - element_ids.push_back( - GenerateCopy(extract, new_element_type_id, insertion_position)); - } + Instruction* original_type = get_def_use_mgr()->GetDef(original_type_id); + Instruction* new_type = get_def_use_mgr()->GetDef(new_type_id); - return ir_builder.AddCompositeConstruct(new_type_id, element_ids) - ->result_id(); - } else if (const analysis::Struct* original_struct_type = - original_type->AsStruct()) { - analysis::Struct* new_struct_type = new_type->AsStruct(); - - const std::vector& original_types = - original_struct_type->element_types(); - const std::vector& new_types = - new_struct_type->element_types(); - std::vector element_ids; - for (uint32_t i = 0; i < original_types.size(); i++) { - Instruction* extract = ir_builder.AddCompositeExtract( - type_mgr->GetId(original_types[i]), object_to_copy->result_id(), {i}); - element_ids.push_back(GenerateCopy(extract, type_mgr->GetId(new_types[i]), - insertion_position)); + if (new_type->opcode() != original_type->opcode()) { + return 0; + } + + switch (original_type->opcode()) { + case spv::Op::OpTypeArray: { + uint32_t original_element_type_id = + original_type->GetSingleWordInOperand(0); + uint32_t new_element_type_id = new_type->GetSingleWordInOperand(0); + + std::vector element_ids; + uint32_t length_id = original_type->GetSingleWordInOperand(1); + const analysis::Constant* length_const = + const_mgr->FindDeclaredConstant(length_id); + assert(length_const->AsIntConstant()); + uint32_t array_length = length_const->AsIntConstant()->GetU32(); + for (uint32_t i = 0; i < array_length; i++) { + Instruction* extract = ir_builder.AddCompositeExtract( + original_element_type_id, object_to_copy->result_id(), {i}); + uint32_t new_id = + GenerateCopy(extract, new_element_type_id, insertion_position); + if (new_id == 0) { + return 0; + } + element_ids.push_back(new_id); + } + + return ir_builder.AddCompositeConstruct(new_type_id, element_ids) + ->result_id(); + } + case spv::Op::OpTypeStruct: { + std::vector element_ids; + for (uint32_t i = 0; i < original_type->NumInOperands(); i++) { + uint32_t orig_member_type_id = original_type->GetSingleWordInOperand(i); + uint32_t new_member_type_id = new_type->GetSingleWordInOperand(i); + Instruction* extract = ir_builder.AddCompositeExtract( + orig_member_type_id, object_to_copy->result_id(), {i}); + uint32_t new_id = + GenerateCopy(extract, new_member_type_id, insertion_position); + if (new_id == 0) { + return 0; + } + element_ids.push_back(new_id); + } + return ir_builder.AddCompositeConstruct(new_type_id, element_ids) + ->result_id(); } - return ir_builder.AddCompositeConstruct(new_type_id, element_ids) - ->result_id(); - } else { - // If we do not have an aggregate type, then we have a problem. Either we - // found multiple instances of the same type, or we are copying to an - // incompatible type. Either way the code is illegal. - assert(false && - "Don't know how to copy this type. Code is likely illegal."); + default: + // If we do not have an aggregate type, then we have a problem. Either we + // found multiple instances of the same type, or we are copying to an + // incompatible type. Either way the code is illegal. Leave the code as + // is and let the caller deal with it. + return 0; } - return 0; } } // namespace opt diff --git a/bgfx/3rdparty/spirv-tools/source/opt/pass.h b/bgfx/3rdparty/spirv-tools/source/opt/pass.h index b2303e23..3e6c4d07 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/pass.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/pass.h @@ -145,7 +145,8 @@ class Pass { // Returns the id whose value is the same as |object_to_copy| except its type // is |new_type_id|. Any instructions needed to generate this value will be - // inserted before |insertion_position|. + // inserted before |insertion_position|. Returns 0 if a copy could not be + // done. uint32_t GenerateCopy(Instruction* object_to_copy, uint32_t new_type_id, Instruction* insertion_position); diff --git a/bgfx/3rdparty/spirv-tools/source/opt/passes.h b/bgfx/3rdparty/spirv-tools/source/opt/passes.h index 83caa4a7..3311529a 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/passes.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/passes.h @@ -48,11 +48,9 @@ #include "source/opt/if_conversion.h" #include "source/opt/inline_exhaustive_pass.h" #include "source/opt/inline_opaque_pass.h" -#include "source/opt/inst_bindless_check_pass.h" -#include "source/opt/inst_buff_addr_check_pass.h" -#include "source/opt/inst_debug_printf_pass.h" #include "source/opt/interface_var_sroa.h" #include "source/opt/interp_fixup_pass.h" +#include "source/opt/invocation_interlock_placement_pass.h" #include "source/opt/licm_pass.h" #include "source/opt/local_access_chain_convert_pass.h" #include "source/opt/local_redundancy_elimination.h" @@ -64,7 +62,9 @@ #include "source/opt/loop_unroller.h" #include "source/opt/loop_unswitch_pass.h" #include "source/opt/merge_return_pass.h" +#include "source/opt/modify_maximal_reconvergence.h" #include "source/opt/null_pass.h" +#include "source/opt/opextinst_forward_ref_fixup_pass.h" #include "source/opt/private_to_local_pass.h" #include "source/opt/reduce_load_size.h" #include "source/opt/redundancy_elimination.h" @@ -82,6 +82,7 @@ #include "source/opt/strength_reduction_pass.h" #include "source/opt/strip_debug_info_pass.h" #include "source/opt/strip_nonsemantic_info_pass.h" +#include "source/opt/struct_packing_pass.h" #include "source/opt/switch_descriptorset_pass.h" #include "source/opt/trim_capabilities_pass.h" #include "source/opt/unify_const_pass.h" diff --git a/bgfx/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp index d4df1b2e..c3a4b775 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp @@ -21,6 +21,8 @@ class RemoveUnusedInterfaceVariablesContext { RemoveUnusedInterfaceVariablesPass& parent_; Instruction& entry_; std::unordered_set used_variables_; + std::vector operands_to_add_; + IRContext::ProcessFunction pfn_ = std::bind(&RemoveUnusedInterfaceVariablesContext::processFunction, this, std::placeholders::_1); @@ -38,8 +40,10 @@ class RemoveUnusedInterfaceVariablesContext { (parent_.get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4) || storage_class == spv::StorageClass::Input || - storage_class == spv::StorageClass::Output)) + storage_class == spv::StorageClass::Output)) { used_variables_.insert(*id); + operands_to_add_.push_back(*id); + } }); return false; } @@ -71,7 +75,7 @@ class RemoveUnusedInterfaceVariablesContext { void Modify() { for (int i = entry_.NumInOperands() - 1; i >= 3; --i) entry_.RemoveInOperand(i); - for (auto id : used_variables_) { + for (auto id : operands_to_add_) { entry_.AddOperand(Operand(SPV_OPERAND_TYPE_ID, {id})); } } diff --git a/bgfx/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp index f81bced5..118d8465 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp @@ -43,7 +43,7 @@ Pass::Status StripDebugInfoPass::Process() { // see if this string is used anywhere by a non-semantic instruction bool no_nonsemantic_use = def_use->WhileEachUser(&inst, [def_use](Instruction* use) { - if (use->opcode() == spv::Op::OpExtInst) { + if (spvIsExtendedInstruction(use->opcode())) { auto ext_inst_set = def_use->GetDef(use->GetSingleWordInOperand(0u)); const std::string extension_name = diff --git a/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp index 3886835a..659849ef 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp @@ -96,7 +96,7 @@ Pass::Status StripNonSemanticInfoPass::Process() { if (!non_semantic_sets.empty()) { context()->module()->ForEachInst( [&non_semantic_sets, &to_remove](Instruction* inst) { - if (inst->opcode() == spv::Op::OpExtInst) { + if (spvIsExtendedInstruction(inst->opcode())) { if (non_semantic_sets.find(inst->GetSingleWordInOperand(0)) != non_semantic_sets.end()) { to_remove.push_back(inst); diff --git a/bgfx/3rdparty/spirv-tools/source/opt/struct_packing_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/struct_packing_pass.cpp new file mode 100644 index 00000000..3bf2b2ab --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/opt/struct_packing_pass.cpp @@ -0,0 +1,482 @@ +// Copyright (c) 2024 Epic Games, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "struct_packing_pass.h" + +#include + +#include "source/opt/instruction.h" +#include "source/opt/ir_context.h" + +namespace spvtools { +namespace opt { + +/* +Std140 packing rules from the original GLSL 140 specification (see +https://registry.khronos.org/OpenGL/extensions/ARB/ARB_uniform_buffer_object.txt) + +When using the "std140" storage layout, structures will be laid out in +buffer storage with its members stored in monotonically increasing order +based on their location in the declaration. A structure and each +structure member have a base offset and a base alignment, from which an +aligned offset is computed by rounding the base offset up to a multiple of +the base alignment. The base offset of the first member of a structure is +taken from the aligned offset of the structure itself. The base offset of +all other structure members is derived by taking the offset of the last +basic machine unit consumed by the previous member and adding one. Each +structure member is stored in memory at its aligned offset. The members +of a top-level uniform block are laid out in buffer storage by treating +the uniform block as a structure with a base offset of zero. + +(1) If the member is a scalar consuming basic machine units, the + base alignment is . + +(2) If the member is a two- or four-component vector with components + consuming basic machine units, the base alignment is 2 or + 4, respectively. + +(3) If the member is a three-component vector with components consuming + basic machine units, the base alignment is 4. + +(4) If the member is an array of scalars or vectors, the base alignment + and array stride are set to match the base alignment of a single + array element, according to rules (1), (2), and (3), and rounded up + to the base alignment of a vec4. The array may have padding at the + end; the base offset of the member following the array is rounded up + to the next multiple of the base alignment. + +(5) If the member is a column-major matrix with columns and + rows, the matrix is stored identically to an array of column + vectors with components each, according to rule (4). + +(6) If the member is an array of column-major matrices with + columns and rows, the matrix is stored identically to a row of + * column vectors with components each, according to rule + (4). + +(7) If the member is a row-major matrix with columns and rows, + the matrix is stored identically to an array of row vectors + with components each, according to rule (4). + +(8) If the member is an array of row-major matrices with columns + and rows, the matrix is stored identically to a row of * + row vectors with components each, according to rule (4). + +(9) If the member is a structure, the base alignment of the structure is + , where is the largest base alignment value of any of its + members, and rounded up to the base alignment of a vec4. The + individual members of this sub-structure are then assigned offsets + by applying this set of rules recursively, where the base offset of + the first member of the sub-structure is equal to the aligned offset + of the structure. The structure may have padding at the end; the + base offset of the member following the sub-structure is rounded up + to the next multiple of the base alignment of the structure. + +(10) If the member is an array of structures, the elements of + the array are laid out in order, according to rule (9). +*/ + +static bool isPackingVec4Padded(StructPackingPass::PackingRules rules) { + switch (rules) { + case StructPackingPass::PackingRules::Std140: + case StructPackingPass::PackingRules::Std140EnhancedLayout: + case StructPackingPass::PackingRules::HlslCbuffer: + case StructPackingPass::PackingRules::HlslCbufferPackOffset: + return true; + default: + return false; + } +} + +static bool isPackingScalar(StructPackingPass::PackingRules rules) { + switch (rules) { + case StructPackingPass::PackingRules::Scalar: + case StructPackingPass::PackingRules::ScalarEnhancedLayout: + return true; + default: + return false; + } +} + +static bool isPackingHlsl(StructPackingPass::PackingRules rules) { + switch (rules) { + case StructPackingPass::PackingRules::HlslCbuffer: + case StructPackingPass::PackingRules::HlslCbufferPackOffset: + return true; + default: + return false; + } +} + +static uint32_t getPackedBaseSize(const analysis::Type& type) { + switch (type.kind()) { + case analysis::Type::kBool: + return 1; + case analysis::Type::kInteger: + return type.AsInteger()->width() / 8; + case analysis::Type::kFloat: + return type.AsFloat()->width() / 8; + case analysis::Type::kVector: + return getPackedBaseSize(*type.AsVector()->element_type()); + case analysis::Type::kMatrix: + return getPackedBaseSize(*type.AsMatrix()->element_type()); + default: + break; // we only expect bool, int, float, vec, and mat here + } + assert(0 && "Unrecognized type to get base size"); + return 0; +} + +static uint32_t getScalarElementCount(const analysis::Type& type) { + switch (type.kind()) { + case analysis::Type::kVector: + return type.AsVector()->element_count(); + case analysis::Type::kMatrix: + return getScalarElementCount(*type.AsMatrix()->element_type()); + case analysis::Type::kStruct: + assert(0 && "getScalarElementCount() does not recognized struct types"); + return 0; + default: + return 1; + } +} + +// Aligns the specified value to a multiple of alignment, whereas the +// alignment must be a power-of-two. +static uint32_t alignPow2(uint32_t value, uint32_t alignment) { + return (value + alignment - 1) & ~(alignment - 1); +} + +void StructPackingPass::buildConstantsMap() { + constantsMap_.clear(); + for (Instruction* instr : context()->module()->GetConstants()) { + constantsMap_[instr->result_id()] = instr; + } +} + +uint32_t StructPackingPass::getPackedAlignment( + const analysis::Type& type) const { + switch (type.kind()) { + case analysis::Type::kArray: { + // Get alignment of base type and round up to minimum alignment + const uint32_t minAlignment = isPackingVec4Padded(packingRules_) ? 16 : 1; + return std::max( + minAlignment, getPackedAlignment(*type.AsArray()->element_type())); + } + case analysis::Type::kStruct: { + // Rule 9. Struct alignment is maximum alignmnet of its members + uint32_t alignment = 1; + + for (const analysis::Type* elementType : + type.AsStruct()->element_types()) { + alignment = + std::max(alignment, getPackedAlignment(*elementType)); + } + + if (isPackingVec4Padded(packingRules_)) + alignment = std::max(alignment, 16u); + + return alignment; + } + default: { + const uint32_t baseAlignment = getPackedBaseSize(type); + + // Scalar block layout always uses alignment for the most basic component + if (isPackingScalar(packingRules_)) return baseAlignment; + + if (const analysis::Matrix* matrixType = type.AsMatrix()) { + // Rule 5/7 + if (isPackingVec4Padded(packingRules_) || + matrixType->element_count() == 3) + return baseAlignment * 4; + else + return baseAlignment * matrixType->element_count(); + } else if (const analysis::Vector* vectorType = type.AsVector()) { + // Rule 1 + if (vectorType->element_count() == 1) return baseAlignment; + + // Rule 2 + if (vectorType->element_count() == 2 || + vectorType->element_count() == 4) + return baseAlignment * vectorType->element_count(); + + // Rule 3 + if (vectorType->element_count() == 3) return baseAlignment * 4; + } else { + // Rule 1 + return baseAlignment; + } + } + } + assert(0 && "Unrecognized type to get packed alignment"); + return 0; +} + +static uint32_t getPadAlignment(const analysis::Type& type, + uint32_t packedAlignment) { + // The next member following a struct member is aligned to the base alignment + // of a previous struct member. + return type.kind() == analysis::Type::kStruct ? packedAlignment : 1; +} + +uint32_t StructPackingPass::getPackedSize(const analysis::Type& type) const { + switch (type.kind()) { + case analysis::Type::kArray: { + if (const analysis::Array* arrayType = type.AsArray()) { + uint32_t size = + getPackedArrayStride(*arrayType) * getArrayLength(*arrayType); + + // For arrays of vector and matrices in HLSL, the last element has a + // size depending on its vector/matrix size to allow packing other + // vectors in the last element. + const analysis::Type* arraySubType = arrayType->element_type(); + if (isPackingHlsl(packingRules_) && + arraySubType->kind() != analysis::Type::kStruct) { + size -= (4 - getScalarElementCount(*arraySubType)) * + getPackedBaseSize(*arraySubType); + } + return size; + } + break; + } + case analysis::Type::kStruct: { + uint32_t size = 0; + uint32_t padAlignment = 1; + for (const analysis::Type* memberType : + type.AsStruct()->element_types()) { + const uint32_t packedAlignment = getPackedAlignment(*memberType); + const uint32_t alignment = + std::max(packedAlignment, padAlignment); + padAlignment = getPadAlignment(*memberType, packedAlignment); + size = alignPow2(size, alignment); + size += getPackedSize(*memberType); + } + return size; + } + default: { + const uint32_t baseAlignment = getPackedBaseSize(type); + if (isPackingScalar(packingRules_)) { + return getScalarElementCount(type) * baseAlignment; + } else { + uint32_t size = 0; + if (const analysis::Matrix* matrixType = type.AsMatrix()) { + const analysis::Vector* matrixSubType = + matrixType->element_type()->AsVector(); + assert(matrixSubType != nullptr && + "Matrix sub-type is expected to be a vector type"); + if (isPackingVec4Padded(packingRules_) || + matrixType->element_count() == 3) + size = matrixSubType->element_count() * baseAlignment * 4; + else + size = matrixSubType->element_count() * baseAlignment * + matrixType->element_count(); + + // For matrices in HLSL, the last element has a size depending on its + // vector size to allow packing other vectors in the last element. + if (isPackingHlsl(packingRules_)) { + size -= (4 - matrixSubType->element_count()) * + getPackedBaseSize(*matrixSubType); + } + } else if (const analysis::Vector* vectorType = type.AsVector()) { + size = vectorType->element_count() * baseAlignment; + } else { + size = baseAlignment; + } + return size; + } + } + } + assert(0 && "Unrecognized type to get packed size"); + return 0; +} + +uint32_t StructPackingPass::getPackedArrayStride( + const analysis::Array& arrayType) const { + // Array stride is equal to aligned size of element type + const uint32_t elementSize = getPackedSize(*arrayType.element_type()); + const uint32_t alignment = getPackedAlignment(arrayType); + return alignPow2(elementSize, alignment); +} + +uint32_t StructPackingPass::getArrayLength( + const analysis::Array& arrayType) const { + return getConstantInt(arrayType.LengthId()); +} + +uint32_t StructPackingPass::getConstantInt(spv::Id id) const { + auto it = constantsMap_.find(id); + assert(it != constantsMap_.end() && + "Failed to map SPIR-V instruction ID to constant value"); + [[maybe_unused]] const analysis::Type* constType = + context()->get_type_mgr()->GetType(it->second->type_id()); + assert(constType != nullptr && + "Failed to map SPIR-V instruction result type to definition"); + assert(constType->kind() == analysis::Type::kInteger && + "Failed to map SPIR-V instruction result type to integer type"); + return it->second->GetOperand(2).words[0]; +} + +StructPackingPass::PackingRules StructPackingPass::ParsePackingRuleFromString( + const std::string& s) { + if (s == "std140") return PackingRules::Std140; + if (s == "std140EnhancedLayout") return PackingRules::Std140EnhancedLayout; + if (s == "std430") return PackingRules::Std430; + if (s == "std430EnhancedLayout") return PackingRules::Std430EnhancedLayout; + if (s == "hlslCbuffer") return PackingRules::HlslCbuffer; + if (s == "hlslCbufferPackOffset") return PackingRules::HlslCbufferPackOffset; + if (s == "scalar") return PackingRules::Scalar; + if (s == "scalarEnhancedLayout") return PackingRules::ScalarEnhancedLayout; + return PackingRules::Undefined; +} + +StructPackingPass::StructPackingPass(const char* structToPack, + PackingRules rules) + : structToPack_{structToPack != nullptr ? structToPack : ""}, + packingRules_{rules} {} + +Pass::Status StructPackingPass::Process() { + if (packingRules_ == PackingRules::Undefined) { + if (consumer()) { + consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, + "Cannot pack struct with undefined rule"); + } + return Status::Failure; + } + + // Build Id-to-instruction map for easier access + buildConstantsMap(); + + // Find structure of interest + const uint32_t structIdToPack = findStructIdByName(structToPack_.c_str()); + + const Instruction* structDef = + context()->get_def_use_mgr()->GetDef(structIdToPack); + if (structDef == nullptr || structDef->opcode() != spv::Op::OpTypeStruct) { + if (consumer()) { + const std::string message = + "Failed to find struct with name " + structToPack_; + consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str()); + } + return Status::Failure; + } + + // Find all struct member types + std::vector structMemberTypes = + findStructMemberTypes(*structDef); + + return assignStructMemberOffsets(structIdToPack, structMemberTypes); +} + +uint32_t StructPackingPass::findStructIdByName(const char* structName) const { + for (Instruction& instr : context()->module()->debugs2()) { + if (instr.opcode() == spv::Op::OpName && + instr.GetOperand(1).AsString() == structName) { + return instr.GetOperand(0).AsId(); + } + } + return 0; +} + +std::vector StructPackingPass::findStructMemberTypes( + const Instruction& structDef) const { + // Found struct type to pack, now collect all types of its members + assert(structDef.NumOperands() > 0 && + "Number of operands in OpTypeStruct instruction must not be zero"); + const uint32_t numMembers = structDef.NumOperands() - 1; + std::vector structMemberTypes; + structMemberTypes.resize(numMembers); + for (uint32_t i = 0; i < numMembers; ++i) { + const spv::Id memberTypeId = structDef.GetOperand(1 + i).AsId(); + if (const analysis::Type* memberType = + context()->get_type_mgr()->GetType(memberTypeId)) { + structMemberTypes[i] = memberType; + } + } + return structMemberTypes; +} + +Pass::Status StructPackingPass::assignStructMemberOffsets( + uint32_t structIdToPack, + const std::vector& structMemberTypes) { + // Returns true if the specified instruction is a OpMemberDecorate for the + // struct we're looking for with an offset decoration + auto isMemberOffsetDecoration = + [structIdToPack](const Instruction& instr) -> bool { + return instr.opcode() == spv::Op::OpMemberDecorate && + instr.GetOperand(0).AsId() == structIdToPack && + static_cast(instr.GetOperand(2).words[0]) == + spv::Decoration::Offset; + }; + + bool modified = false; + + // Find and re-assign all member offset decorations + for (auto it = context()->module()->annotation_begin(), + itEnd = context()->module()->annotation_end(); + it != itEnd; ++it) { + if (isMemberOffsetDecoration(*it)) { + // Found first member decoration with offset, we expect all other + // offsets right after the first one + uint32_t prevMemberIndex = 0; + uint32_t currentOffset = 0; + uint32_t padAlignment = 1; + do { + const uint32_t memberIndex = it->GetOperand(1).words[0]; + if (memberIndex < prevMemberIndex) { + // Failure: we expect all members to appear in consecutive order + return Status::Failure; + } + + // Apply alignment rules to current offset + const analysis::Type& memberType = *structMemberTypes[memberIndex]; + uint32_t packedAlignment = getPackedAlignment(memberType); + uint32_t packedSize = getPackedSize(memberType); + + if (isPackingHlsl(packingRules_)) { + // If a member crosses vec4 boundaries, alignment is size of vec4 + if (currentOffset / 16 != (currentOffset + packedSize - 1) / 16) + packedAlignment = std::max(packedAlignment, 16u); + } + + const uint32_t alignment = + std::max(packedAlignment, padAlignment); + currentOffset = alignPow2(currentOffset, alignment); + padAlignment = getPadAlignment(memberType, packedAlignment); + + // Override packed offset in instruction + if (it->GetOperand(3).words[0] < currentOffset) { + // Failure: packing resulted in higher offset for member than + // previously generated + return Status::Failure; + } + + it->GetOperand(3).words[0] = currentOffset; + modified = true; + + // Move to next member + ++it; + prevMemberIndex = memberIndex; + currentOffset += packedSize; + } while (it != itEnd && isMemberOffsetDecoration(*it)); + + // We're done with all decorations for the struct of interest + break; + } + } + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/opt/struct_packing_pass.h b/bgfx/3rdparty/spirv-tools/source/opt/struct_packing_pass.h new file mode 100644 index 00000000..3f30f98a --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/opt/struct_packing_pass.h @@ -0,0 +1,81 @@ +// Copyright (c) 2024 Epic Games, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_STRUCT_PACKING_PASS_ +#define SOURCE_OPT_STRUCT_PACKING_PASS_ + +#include + +#include "source/opt/ir_context.h" +#include "source/opt/module.h" +#include "source/opt/pass.h" + +namespace spvtools { +namespace opt { + +// This pass re-assigns all field offsets under the specified packing rules. +class StructPackingPass final : public Pass { + public: + enum class PackingRules { + Undefined, + Std140, + Std140EnhancedLayout, + Std430, + Std430EnhancedLayout, + HlslCbuffer, + HlslCbufferPackOffset, + Scalar, + ScalarEnhancedLayout, + }; + + static PackingRules ParsePackingRuleFromString(const std::string& s); + + StructPackingPass(const char* structToPack, PackingRules rules); + const char* name() const override { return "struct-packing"; } + Status Process() override; + + IRContext::Analysis GetPreservedAnalyses() override { + return IRContext::kAnalysisCombinators | IRContext::kAnalysisCFG | + IRContext::kAnalysisDominatorAnalysis | + IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap | + IRContext::kAnalysisScalarEvolution | + IRContext::kAnalysisStructuredCFG | IRContext::kAnalysisConstants | + IRContext::kAnalysisDebugInfo | IRContext::kAnalysisLiveness; + } + + private: + void buildConstantsMap(); + uint32_t findStructIdByName(const char* structName) const; + std::vector findStructMemberTypes( + const Instruction& structDef) const; + Status assignStructMemberOffsets( + uint32_t structIdToPack, + const std::vector& structMemberTypes); + + uint32_t getPackedAlignment(const analysis::Type& type) const; + uint32_t getPackedSize(const analysis::Type& type) const; + uint32_t getPackedArrayStride(const analysis::Array& arrayType) const; + uint32_t getArrayLength(const analysis::Array& arrayType) const; + uint32_t getConstantInt(spv::Id id) const; + + private: + std::string structToPack_; + PackingRules packingRules_ = PackingRules::Undefined; + std::unordered_map constantsMap_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // SOURCE_OPT_STRUCT_PACKING_PASS_ diff --git a/bgfx/3rdparty/spirv-tools/source/opt/trim_capabilities_pass.cpp b/bgfx/3rdparty/spirv-tools/source/opt/trim_capabilities_pass.cpp index f8e4d818..8a853514 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/trim_capabilities_pass.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/trim_capabilities_pass.cpp @@ -27,6 +27,7 @@ #include "source/enum_set.h" #include "source/enum_string_mapping.h" +#include "source/ext_inst.h" #include "source/opt/ir_context.h" #include "source/opt/reflect.h" #include "source/spirv_target_env.h" @@ -36,10 +37,22 @@ namespace spvtools { namespace opt { namespace { +constexpr uint32_t kOpTypeFloatSizeIndex = 0; constexpr uint32_t kOpTypePointerStorageClassIndex = 0; constexpr uint32_t kTypeArrayTypeIndex = 0; constexpr uint32_t kOpTypeScalarBitWidthIndex = 0; -constexpr uint32_t kTypePointerTypeIdInIdx = 1; +constexpr uint32_t kTypePointerTypeIdInIndex = 1; +constexpr uint32_t kOpTypeIntSizeIndex = 0; +constexpr uint32_t kOpTypeImageDimIndex = 1; +constexpr uint32_t kOpTypeImageArrayedIndex = kOpTypeImageDimIndex + 2; +constexpr uint32_t kOpTypeImageMSIndex = kOpTypeImageArrayedIndex + 1; +constexpr uint32_t kOpTypeImageSampledIndex = kOpTypeImageMSIndex + 1; +constexpr uint32_t kOpTypeImageFormatIndex = kOpTypeImageSampledIndex + 1; +constexpr uint32_t kOpImageReadImageIndex = 0; +constexpr uint32_t kOpImageSparseReadImageIndex = 0; +constexpr uint32_t kOpExtInstSetInIndex = 0; +constexpr uint32_t kOpExtInstInstructionInIndex = 1; +constexpr uint32_t kOpExtInstImportNameInIndex = 0; // DFS visit of the type defined by `instruction`. // If `condition` is true, children of the current node are visited. @@ -60,7 +73,7 @@ static void DFSWhile(const Instruction* instruction, UnaryPredicate condition) { if (item->opcode() == spv::Op::OpTypePointer) { instructions_to_visit.push( - item->GetSingleWordInOperand(kTypePointerTypeIdInIdx)); + item->GetSingleWordInOperand(kTypePointerTypeIdInIndex)); continue; } @@ -128,6 +141,26 @@ static bool Has16BitCapability(const FeatureManager* feature_manager) { // Handler names follow the following convention: // Handler__() +static std::optional Handler_OpTypeFloat_Float16( + const Instruction* instruction) { + assert(instruction->opcode() == spv::Op::OpTypeFloat && + "This handler only support OpTypeFloat opcodes."); + + const uint32_t size = + instruction->GetSingleWordInOperand(kOpTypeFloatSizeIndex); + return size == 16 ? std::optional(spv::Capability::Float16) : std::nullopt; +} + +static std::optional Handler_OpTypeFloat_Float64( + const Instruction* instruction) { + assert(instruction->opcode() == spv::Op::OpTypeFloat && + "This handler only support OpTypeFloat opcodes."); + + const uint32_t size = + instruction->GetSingleWordInOperand(kOpTypeFloatSizeIndex); + return size == 64 ? std::optional(spv::Capability::Float64) : std::nullopt; +} + static std::optional Handler_OpTypePointer_StorageInputOutput16(const Instruction* instruction) { assert(instruction->opcode() == spv::Op::OpTypePointer && @@ -255,13 +288,97 @@ static std::optional Handler_OpTypePointer_StorageUniform16( : std::nullopt; } +static std::optional Handler_OpTypeInt_Int16( + const Instruction* instruction) { + assert(instruction->opcode() == spv::Op::OpTypeInt && + "This handler only support OpTypeInt opcodes."); + + const uint32_t size = + instruction->GetSingleWordInOperand(kOpTypeIntSizeIndex); + return size == 16 ? std::optional(spv::Capability::Int16) : std::nullopt; +} + +static std::optional Handler_OpTypeInt_Int64( + const Instruction* instruction) { + assert(instruction->opcode() == spv::Op::OpTypeInt && + "This handler only support OpTypeInt opcodes."); + + const uint32_t size = + instruction->GetSingleWordInOperand(kOpTypeIntSizeIndex); + return size == 64 ? std::optional(spv::Capability::Int64) : std::nullopt; +} + +static std::optional Handler_OpTypeImage_ImageMSArray( + const Instruction* instruction) { + assert(instruction->opcode() == spv::Op::OpTypeImage && + "This handler only support OpTypeImage opcodes."); + + const uint32_t arrayed = + instruction->GetSingleWordInOperand(kOpTypeImageArrayedIndex); + const uint32_t ms = instruction->GetSingleWordInOperand(kOpTypeImageMSIndex); + const uint32_t sampled = + instruction->GetSingleWordInOperand(kOpTypeImageSampledIndex); + + return arrayed == 1 && sampled == 2 && ms == 1 + ? std::optional(spv::Capability::ImageMSArray) + : std::nullopt; +} + +static std::optional +Handler_OpImageRead_StorageImageReadWithoutFormat( + const Instruction* instruction) { + assert(instruction->opcode() == spv::Op::OpImageRead && + "This handler only support OpImageRead opcodes."); + const auto* def_use_mgr = instruction->context()->get_def_use_mgr(); + + const uint32_t image_index = + instruction->GetSingleWordInOperand(kOpImageReadImageIndex); + const uint32_t type_index = def_use_mgr->GetDef(image_index)->type_id(); + const Instruction* type = def_use_mgr->GetDef(type_index); + const uint32_t dim = type->GetSingleWordInOperand(kOpTypeImageDimIndex); + const uint32_t format = type->GetSingleWordInOperand(kOpTypeImageFormatIndex); + + const bool is_unknown = spv::ImageFormat(format) == spv::ImageFormat::Unknown; + const bool requires_capability_for_unknown = + spv::Dim(dim) != spv::Dim::SubpassData; + return is_unknown && requires_capability_for_unknown + ? std::optional(spv::Capability::StorageImageReadWithoutFormat) + : std::nullopt; +} + +static std::optional +Handler_OpImageSparseRead_StorageImageReadWithoutFormat( + const Instruction* instruction) { + assert(instruction->opcode() == spv::Op::OpImageSparseRead && + "This handler only support OpImageSparseRead opcodes."); + const auto* def_use_mgr = instruction->context()->get_def_use_mgr(); + + const uint32_t image_index = + instruction->GetSingleWordInOperand(kOpImageSparseReadImageIndex); + const uint32_t type_index = def_use_mgr->GetDef(image_index)->type_id(); + const Instruction* type = def_use_mgr->GetDef(type_index); + const uint32_t format = type->GetSingleWordInOperand(kOpTypeImageFormatIndex); + + return spv::ImageFormat(format) == spv::ImageFormat::Unknown + ? std::optional(spv::Capability::StorageImageReadWithoutFormat) + : std::nullopt; +} + // Opcode of interest to determine capabilities requirements. -constexpr std::array, 4> kOpcodeHandlers{{ +constexpr std::array, 12> kOpcodeHandlers{{ // clang-format off - {spv::Op::OpTypePointer, Handler_OpTypePointer_StorageInputOutput16}, - {spv::Op::OpTypePointer, Handler_OpTypePointer_StoragePushConstant16}, - {spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniformBufferBlock16}, - {spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniform16} + {spv::Op::OpImageRead, Handler_OpImageRead_StorageImageReadWithoutFormat}, + {spv::Op::OpImageSparseRead, Handler_OpImageSparseRead_StorageImageReadWithoutFormat}, + {spv::Op::OpTypeFloat, Handler_OpTypeFloat_Float16 }, + {spv::Op::OpTypeFloat, Handler_OpTypeFloat_Float64 }, + {spv::Op::OpTypeImage, Handler_OpTypeImage_ImageMSArray}, + {spv::Op::OpTypeInt, Handler_OpTypeInt_Int16 }, + {spv::Op::OpTypeInt, Handler_OpTypeInt_Int64 }, + {spv::Op::OpTypePointer, Handler_OpTypePointer_StorageInputOutput16}, + {spv::Op::OpTypePointer, Handler_OpTypePointer_StoragePushConstant16}, + {spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniform16}, + {spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniform16}, + {spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniformBufferBlock16}, // clang-format on }}; @@ -286,6 +403,33 @@ ExtensionSet getExtensionsRelatedTo(const CapabilitySet& capabilities, return output; } + +bool hasOpcodeConflictingCapabilities(spv::Op opcode) { + switch (opcode) { + case spv::Op::OpBeginInvocationInterlockEXT: + case spv::Op::OpEndInvocationInterlockEXT: + case spv::Op::OpGroupNonUniformIAdd: + case spv::Op::OpGroupNonUniformFAdd: + case spv::Op::OpGroupNonUniformIMul: + case spv::Op::OpGroupNonUniformFMul: + case spv::Op::OpGroupNonUniformSMin: + case spv::Op::OpGroupNonUniformUMin: + case spv::Op::OpGroupNonUniformFMin: + case spv::Op::OpGroupNonUniformSMax: + case spv::Op::OpGroupNonUniformUMax: + case spv::Op::OpGroupNonUniformFMax: + case spv::Op::OpGroupNonUniformBitwiseAnd: + case spv::Op::OpGroupNonUniformBitwiseOr: + case spv::Op::OpGroupNonUniformBitwiseXor: + case spv::Op::OpGroupNonUniformLogicalAnd: + case spv::Op::OpGroupNonUniformLogicalOr: + case spv::Op::OpGroupNonUniformLogicalXor: + return true; + default: + return false; + } +} + } // namespace TrimCapabilitiesPass::TrimCapabilitiesPass() @@ -303,10 +447,7 @@ TrimCapabilitiesPass::TrimCapabilitiesPass() void TrimCapabilitiesPass::addInstructionRequirementsForOpcode( spv::Op opcode, CapabilitySet* capabilities, ExtensionSet* extensions) const { - // Ignoring OpBeginInvocationInterlockEXT and OpEndInvocationInterlockEXT - // because they have three possible capabilities, only one of which is needed - if (opcode == spv::Op::OpBeginInvocationInterlockEXT || - opcode == spv::Op::OpEndInvocationInterlockEXT) { + if (hasOpcodeConflictingCapabilities(opcode)) { return; } @@ -335,6 +476,17 @@ void TrimCapabilitiesPass::addInstructionRequirementsForOperand( return; } + // If the Vulkan memory model is declared and any instruction uses Device + // scope, the VulkanMemoryModelDeviceScope capability must be declared. This + // rule cannot be covered by the grammar, so must be checked explicitly. + if (operand.type == SPV_OPERAND_TYPE_SCOPE_ID) { + const Instruction* memory_model = context()->GetMemoryModel(); + if (memory_model && memory_model->GetSingleWordInOperand(1u) == + uint32_t(spv::MemoryModel::Vulkan)) { + capabilities->insert(spv::Capability::VulkanMemoryModelDeviceScope); + } + } + // case 1: Operand is a single value, can directly lookup. if (!spvOperandIsConcreteMask(operand.type)) { const spv_operand_desc_t* desc = {}; @@ -366,6 +518,35 @@ void TrimCapabilitiesPass::addInstructionRequirementsForOperand( } } +void TrimCapabilitiesPass::addInstructionRequirementsForExtInst( + Instruction* instruction, CapabilitySet* capabilities) const { + assert(instruction->opcode() == spv::Op::OpExtInst && + "addInstructionRequirementsForExtInst must be passed an OpExtInst " + "instruction"); + + const auto* def_use_mgr = context()->get_def_use_mgr(); + + const Instruction* extInstImport = def_use_mgr->GetDef( + instruction->GetSingleWordInOperand(kOpExtInstSetInIndex)); + uint32_t extInstruction = + instruction->GetSingleWordInOperand(kOpExtInstInstructionInIndex); + + const Operand& extInstSet = + extInstImport->GetInOperand(kOpExtInstImportNameInIndex); + + spv_ext_inst_type_t instructionSet = + spvExtInstImportTypeGet(extInstSet.AsString().c_str()); + + spv_ext_inst_desc desc = {}; + auto result = + context()->grammar().lookupExtInst(instructionSet, extInstruction, &desc); + if (result != SPV_SUCCESS) { + return; + } + + addSupportedCapabilitiesToSet(desc, capabilities); +} + void TrimCapabilitiesPass::addInstructionRequirements( Instruction* instruction, CapabilitySet* capabilities, ExtensionSet* extensions) const { @@ -375,8 +556,12 @@ void TrimCapabilitiesPass::addInstructionRequirements( return; } - addInstructionRequirementsForOpcode(instruction->opcode(), capabilities, - extensions); + if (instruction->opcode() == spv::Op::OpExtInst) { + addInstructionRequirementsForExtInst(instruction, capabilities); + } else { + addInstructionRequirementsForOpcode(instruction->opcode(), capabilities, + extensions); + } // Second case: one of the opcode operand is gated by a capability. const uint32_t operandCount = instruction->NumOperands(); diff --git a/bgfx/3rdparty/spirv-tools/source/opt/trim_capabilities_pass.h b/bgfx/3rdparty/spirv-tools/source/opt/trim_capabilities_pass.h index 16b5781a..91d32a56 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/trim_capabilities_pass.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/trim_capabilities_pass.h @@ -74,18 +74,37 @@ class TrimCapabilitiesPass : public Pass { // contains unsupported instruction, the pass could yield bad results. static constexpr std::array kSupportedCapabilities{ // clang-format off + spv::Capability::ComputeDerivativeGroupLinearKHR, + spv::Capability::ComputeDerivativeGroupQuadsKHR, + spv::Capability::Float16, + spv::Capability::Float64, spv::Capability::FragmentShaderPixelInterlockEXT, spv::Capability::FragmentShaderSampleInterlockEXT, spv::Capability::FragmentShaderShadingRateInterlockEXT, + spv::Capability::GroupNonUniform, + spv::Capability::GroupNonUniformArithmetic, + spv::Capability::GroupNonUniformClustered, + spv::Capability::GroupNonUniformPartitionedNV, + spv::Capability::GroupNonUniformVote, spv::Capability::Groups, + spv::Capability::ImageMSArray, + spv::Capability::Int16, + spv::Capability::Int64, + spv::Capability::InterpolationFunction, spv::Capability::Linkage, spv::Capability::MinLod, + spv::Capability::PhysicalStorageBufferAddresses, + spv::Capability::RayQueryKHR, + spv::Capability::RayTracingKHR, + spv::Capability::RayTraversalPrimitiveCullingKHR, spv::Capability::Shader, spv::Capability::ShaderClockKHR, + spv::Capability::StorageImageReadWithoutFormat, spv::Capability::StorageInputOutput16, spv::Capability::StoragePushConstant16, spv::Capability::StorageUniform16, - spv::Capability::StorageUniformBufferBlock16 + spv::Capability::StorageUniformBufferBlock16, + spv::Capability::VulkanMemoryModelDeviceScope, // clang-format on }; @@ -142,6 +161,9 @@ class TrimCapabilitiesPass : public Pass { CapabilitySet* capabilities, ExtensionSet* extensions) const; + void addInstructionRequirementsForExtInst(Instruction* instruction, + CapabilitySet* capabilities) const; + // Given an `instruction`, determines the capabilities it requires, and output // them in `capabilities`. The returned capabilities form a subset of // kSupportedCapabilities. diff --git a/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp b/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp index 2dcc2594..79648ad4 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp +++ b/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp @@ -245,6 +245,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { {(type->AsInteger()->IsSigned() ? 1u : 0u)}}}); break; case Type::kFloat: + // TODO: Handle FP encoding enums once actually used. typeInst = MakeUnique( context(), spv::Op::OpTypeFloat, 0, id, std::initializer_list{ @@ -454,12 +455,7 @@ uint32_t TypeManager::FindPointerToType(uint32_t type_id, spv::StorageClass storage_class) { Type* pointeeTy = GetType(type_id); Pointer pointerTy(pointeeTy, storage_class); - if (pointeeTy->IsUniqueType()) { - // Non-ambiguous type. Get the pointer type through the type manager. - return GetTypeInstruction(&pointerTy); - } - // Ambiguous type, do a linear search. Module::inst_iterator type_itr = context()->module()->types_values_begin(); for (; type_itr != context()->module()->types_values_end(); ++type_itr) { const Instruction* type_inst = &*type_itr; @@ -472,8 +468,10 @@ uint32_t TypeManager::FindPointerToType(uint32_t type_id, } // Must create the pointer type. - // TODO(1841): Handle id overflow. uint32_t resultId = context()->TakeNextId(); + if (resultId == 0) { + return 0; + } std::unique_ptr type_inst( new Instruction(context(), spv::Op::OpTypePointer, 0, resultId, {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, @@ -517,13 +515,24 @@ void TypeManager::CreateDecoration(uint32_t target, context()->get_def_use_mgr()->AnalyzeInstUse(inst); } -Type* TypeManager::RebuildType(const Type& type) { +Type* TypeManager::RebuildType(uint32_t type_id, const Type& type) { + assert(type_id != 0); + // The comparison and hash on the type pool will avoid inserting the rebuilt // type if an equivalent type already exists. The rebuilt type will be deleted // when it goes out of scope at the end of the function in that case. Repeated // insertions of the same Type will, at most, keep one corresponding object in // the type pool. std::unique_ptr rebuilt_ty; + + // If |type_id| is already present in the type pool, return the existing type. + // This saves extra work in the type builder and prevents running into + // circular issues (https://github.com/KhronosGroup/SPIRV-Tools/issues/5623). + Type* pool_ty = GetType(type_id); + if (pool_ty != nullptr) { + return pool_ty; + } + switch (type.kind()) { #define DefineNoSubtypeCase(kind) \ case Type::k##kind: \ @@ -550,43 +559,46 @@ Type* TypeManager::RebuildType(const Type& type) { case Type::kVector: { const Vector* vec_ty = type.AsVector(); const Type* ele_ty = vec_ty->element_type(); - rebuilt_ty = - MakeUnique(RebuildType(*ele_ty), vec_ty->element_count()); + rebuilt_ty = MakeUnique(RebuildType(GetId(ele_ty), *ele_ty), + vec_ty->element_count()); break; } case Type::kMatrix: { const Matrix* mat_ty = type.AsMatrix(); const Type* ele_ty = mat_ty->element_type(); - rebuilt_ty = - MakeUnique(RebuildType(*ele_ty), mat_ty->element_count()); + rebuilt_ty = MakeUnique(RebuildType(GetId(ele_ty), *ele_ty), + mat_ty->element_count()); break; } case Type::kImage: { const Image* image_ty = type.AsImage(); const Type* ele_ty = image_ty->sampled_type(); - rebuilt_ty = - MakeUnique(RebuildType(*ele_ty), image_ty->dim(), - image_ty->depth(), image_ty->is_arrayed(), - image_ty->is_multisampled(), image_ty->sampled(), - image_ty->format(), image_ty->access_qualifier()); + rebuilt_ty = MakeUnique( + RebuildType(GetId(ele_ty), *ele_ty), image_ty->dim(), + image_ty->depth(), image_ty->is_arrayed(), + image_ty->is_multisampled(), image_ty->sampled(), image_ty->format(), + image_ty->access_qualifier()); break; } case Type::kSampledImage: { const SampledImage* image_ty = type.AsSampledImage(); const Type* ele_ty = image_ty->image_type(); - rebuilt_ty = MakeUnique(RebuildType(*ele_ty)); + rebuilt_ty = + MakeUnique(RebuildType(GetId(ele_ty), *ele_ty)); break; } case Type::kArray: { const Array* array_ty = type.AsArray(); - rebuilt_ty = - MakeUnique(array_ty->element_type(), array_ty->length_info()); + const Type* ele_ty = array_ty->element_type(); + rebuilt_ty = MakeUnique(RebuildType(GetId(ele_ty), *ele_ty), + array_ty->length_info()); break; } case Type::kRuntimeArray: { const RuntimeArray* array_ty = type.AsRuntimeArray(); const Type* ele_ty = array_ty->element_type(); - rebuilt_ty = MakeUnique(RebuildType(*ele_ty)); + rebuilt_ty = + MakeUnique(RebuildType(GetId(ele_ty), *ele_ty)); break; } case Type::kStruct: { @@ -594,7 +606,7 @@ Type* TypeManager::RebuildType(const Type& type) { std::vector subtypes; subtypes.reserve(struct_ty->element_types().size()); for (const auto* ele_ty : struct_ty->element_types()) { - subtypes.push_back(RebuildType(*ele_ty)); + subtypes.push_back(RebuildType(GetId(ele_ty), *ele_ty)); } rebuilt_ty = MakeUnique(subtypes); Struct* rebuilt_struct = rebuilt_ty->AsStruct(); @@ -611,7 +623,7 @@ Type* TypeManager::RebuildType(const Type& type) { case Type::kPointer: { const Pointer* pointer_ty = type.AsPointer(); const Type* ele_ty = pointer_ty->pointee_type(); - rebuilt_ty = MakeUnique(RebuildType(*ele_ty), + rebuilt_ty = MakeUnique(RebuildType(GetId(ele_ty), *ele_ty), pointer_ty->storage_class()); break; } @@ -621,9 +633,10 @@ Type* TypeManager::RebuildType(const Type& type) { std::vector param_types; param_types.reserve(function_ty->param_types().size()); for (const auto* param_ty : function_ty->param_types()) { - param_types.push_back(RebuildType(*param_ty)); + param_types.push_back(RebuildType(GetId(param_ty), *param_ty)); } - rebuilt_ty = MakeUnique(RebuildType(*ret_ty), param_types); + rebuilt_ty = MakeUnique(RebuildType(GetId(ret_ty), *ret_ty), + param_types); break; } case Type::kForwardPointer: { @@ -633,7 +646,7 @@ Type* TypeManager::RebuildType(const Type& type) { const Pointer* target_ptr = forward_ptr_ty->target_pointer(); if (target_ptr) { rebuilt_ty->AsForwardPointer()->SetTargetPointer( - RebuildType(*target_ptr)->AsPointer()); + RebuildType(GetId(target_ptr), *target_ptr)->AsPointer()); } break; } @@ -641,16 +654,17 @@ Type* TypeManager::RebuildType(const Type& type) { const CooperativeMatrixNV* cm_type = type.AsCooperativeMatrixNV(); const Type* component_type = cm_type->component_type(); rebuilt_ty = MakeUnique( - RebuildType(*component_type), cm_type->scope_id(), cm_type->rows_id(), - cm_type->columns_id()); + RebuildType(GetId(component_type), *component_type), + cm_type->scope_id(), cm_type->rows_id(), cm_type->columns_id()); break; } case Type::kCooperativeMatrixKHR: { const CooperativeMatrixKHR* cm_type = type.AsCooperativeMatrixKHR(); const Type* component_type = cm_type->component_type(); rebuilt_ty = MakeUnique( - RebuildType(*component_type), cm_type->scope_id(), cm_type->rows_id(), - cm_type->columns_id(), cm_type->use_id()); + RebuildType(GetId(component_type), *component_type), + cm_type->scope_id(), cm_type->rows_id(), cm_type->columns_id(), + cm_type->use_id()); break; } default: @@ -669,7 +683,7 @@ Type* TypeManager::RebuildType(const Type& type) { void TypeManager::RegisterType(uint32_t id, const Type& type) { // Rebuild |type| so it and all its constituent types are owned by the type // pool. - Type* rebuilt = RebuildType(type); + Type* rebuilt = RebuildType(id, type); assert(rebuilt->IsSame(&type)); id_to_type_[id] = rebuilt; if (GetId(rebuilt) == 0) { @@ -901,7 +915,7 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { type = new HitObjectNV(); break; default: - SPIRV_UNIMPLEMENTED(consumer_, "unhandled type"); + assert(false && "Type not handled by the type manager."); break; } @@ -943,12 +957,10 @@ void TypeManager::AttachDecoration(const Instruction& inst, Type* type) { } if (Struct* st = type->AsStruct()) { st->AddMemberDecoration(index, std::move(data)); - } else { - SPIRV_UNIMPLEMENTED(consumer_, "OpMemberDecorate non-struct type"); } } break; default: - SPIRV_UNREACHABLE(consumer_); + assert(false && "Unexpected opcode for a decoration instruction."); break; } } diff --git a/bgfx/3rdparty/spirv-tools/source/opt/type_manager.h b/bgfx/3rdparty/spirv-tools/source/opt/type_manager.h index a70c371d..948b691b 100644 --- a/bgfx/3rdparty/spirv-tools/source/opt/type_manager.h +++ b/bgfx/3rdparty/spirv-tools/source/opt/type_manager.h @@ -260,7 +260,9 @@ class TypeManager { // Returns an equivalent pointer to |type| built in terms of pointers owned by // |type_pool_|. For example, if |type| is a vec3 of bool, it will be rebuilt // replacing the bool subtype with one owned by |type_pool_|. - Type* RebuildType(const Type& type); + // + // The re-built type will have ID |type_id|. + Type* RebuildType(uint32_t type_id, const Type& type); // Completes the incomplete type |type|, by replaces all references to // ForwardPointer by the defining Pointer. diff --git a/bgfx/3rdparty/spirv-tools/source/table.h b/bgfx/3rdparty/spirv-tools/source/table.h index 8097f13f..47625c5f 100644 --- a/bgfx/3rdparty/spirv-tools/source/table.h +++ b/bgfx/3rdparty/spirv-tools/source/table.h @@ -22,6 +22,8 @@ typedef struct spv_opcode_desc_t { const char* name; const spv::Op opcode; + const uint32_t numAliases; + const char** aliases; const uint32_t numCapabilities; const spv::Capability* capabilities; // operandTypes[0..numTypes-1] describe logical operands for the instruction. @@ -47,6 +49,8 @@ typedef struct spv_opcode_desc_t { typedef struct spv_operand_desc_t { const char* name; const uint32_t value; + const uint32_t numAliases; + const char** aliases; const uint32_t numCapabilities; const spv::Capability* capabilities; // A set of extensions that enable this feature. If empty then this operand @@ -74,7 +78,7 @@ typedef struct spv_ext_inst_desc_t { const uint32_t ext_inst; const uint32_t numCapabilities; const spv::Capability* capabilities; - const spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger? + const spv_operand_type_t operandTypes[40]; // vksp needs at least 40 } spv_ext_inst_desc_t; typedef struct spv_ext_inst_group_t { diff --git a/bgfx/3rdparty/spirv-tools/source/text.cpp b/bgfx/3rdparty/spirv-tools/source/text.cpp index 737c223b..fda46ec2 100644 --- a/bgfx/3rdparty/spirv-tools/source/text.cpp +++ b/bgfx/3rdparty/spirv-tools/source/text.cpp @@ -227,8 +227,7 @@ spv_result_t spvTextEncodeOperand(const spvtools::AssemblyGrammar& grammar, // Set the extended instruction type. // The import set id is the 3rd operand of OpExtInst. - if (spv::Op(pInst->opcode) == spv::Op::OpExtInst && - pInst->words.size() == 4) { + if (spvIsExtendedInstruction(pInst->opcode) && pInst->words.size() == 4) { auto ext_inst_type = context->getExtInstTypeForId(pInst->words[3]); if (ext_inst_type == SPV_EXT_INST_TYPE_NONE) { return context->diagnostic() @@ -411,6 +410,7 @@ spv_result_t spvTextEncodeOperand(const spvtools::AssemblyGrammar& grammar, case SPV_OPERAND_TYPE_IMAGE: case SPV_OPERAND_TYPE_OPTIONAL_IMAGE: case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS: + case SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS: case SPV_OPERAND_TYPE_SELECTION_CONTROL: case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS: diff --git a/bgfx/3rdparty/spirv-tools/source/text_handler.cpp b/bgfx/3rdparty/spirv-tools/source/text_handler.cpp index 35c4b83c..a778c2c1 100644 --- a/bgfx/3rdparty/spirv-tools/source/text_handler.cpp +++ b/bgfx/3rdparty/spirv-tools/source/text_handler.cpp @@ -329,8 +329,9 @@ spv_result_t AssemblyContext::recordTypeDefinition( types_[value] = {pInst->words[2], pInst->words[3] != 0, IdTypeClass::kScalarIntegerType}; } else if (pInst->opcode == spv::Op::OpTypeFloat) { - if (pInst->words.size() != 3) + if ((pInst->words.size() != 3) && (pInst->words.size() != 4)) return diagnostic() << "Invalid OpTypeFloat instruction"; + // TODO(kpet) Do we need to record the FP Encoding here? types_[value] = {pInst->words[2], false, IdTypeClass::kScalarFloatType}; } else { types_[value] = {0, false, IdTypeClass::kOtherType}; diff --git a/bgfx/3rdparty/spirv-tools/source/to_string.cpp b/bgfx/3rdparty/spirv-tools/source/to_string.cpp new file mode 100644 index 00000000..b707070b --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/to_string.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "source/to_string.h" + +#include + +namespace spvtools { + +std::string to_string(uint32_t n) { + // This implementation avoids using standard library features that access + // the locale. Using the locale requires taking a mutex which causes + // annoying serialization. + + constexpr int max_digits = 10; // max uint has 10 digits + // Contains the resulting digits, with least significant digit in the last + // entry. + char buf[max_digits]; + int write_index = max_digits - 1; + if (n == 0) { + buf[write_index] = '0'; + } else { + while (n > 0) { + int units = n % 10; + buf[write_index--] = "0123456789"[units]; + n = (n - units) / 10; + } + write_index++; + } + assert(write_index >= 0); + return std::string(buf + write_index, max_digits - write_index); +} +} // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/to_string.h b/bgfx/3rdparty/spirv-tools/source/to_string.h new file mode 100644 index 00000000..83702f92 --- /dev/null +++ b/bgfx/3rdparty/spirv-tools/source/to_string.h @@ -0,0 +1,29 @@ +// Copyright (c) 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_TO_STRING_H_ +#define SOURCE_TO_STRING_H_ + +#include +#include + +namespace spvtools { + +// Returns the decimal representation of a number as a string, +// without using the locale. +std::string to_string(uint32_t n); + +} // namespace spvtools + +#endif // SOURCE_TO_STRING_H_ diff --git a/bgfx/3rdparty/spirv-tools/source/util/bitutils.h b/bgfx/3rdparty/spirv-tools/source/util/bitutils.h index 9ced2f96..2763bc27 100644 --- a/bgfx/3rdparty/spirv-tools/source/util/bitutils.h +++ b/bgfx/3rdparty/spirv-tools/source/util/bitutils.h @@ -97,7 +97,7 @@ template size_t CountSetBits(T word) { static_assert(std::is_integral::value, "CountSetBits requires integer type"); - size_t count = 0; + uint32_t count = 0; while (word) { word &= word - 1; ++count; @@ -181,6 +181,31 @@ T ClearHighBits(T word, size_t num_bits_to_set) { false); } +// Returns the value obtained by extracting the |number_of_bits| least +// significant bits from |value|, and sign-extending it to 64-bits. +template +T SignExtendValue(T value, uint32_t number_of_bits) { + const uint32_t bit_width = sizeof(value) * 8; + if (number_of_bits == bit_width) return value; + + bool is_negative = utils::IsBitAtPositionSet(value, number_of_bits - 1); + if (is_negative) { + value = utils::SetHighBits(value, bit_width - number_of_bits); + } else { + value = utils::ClearHighBits(value, bit_width - number_of_bits); + } + return value; +} + +// Returns the value obtained by extracting the |number_of_bits| least +// significant bits from |value|, and zero-extending it to 64-bits. +template +T ZeroExtendValue(T value, uint32_t number_of_bits) { + const uint32_t bit_width = sizeof(value) * 8; + if (number_of_bits == bit_width) return value; + return utils::ClearHighBits(value, bit_width - number_of_bits); +} + } // namespace utils } // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/val/decoration.h b/bgfx/3rdparty/spirv-tools/source/val/decoration.h index 384cc575..77e0f615 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/decoration.h +++ b/bgfx/3rdparty/spirv-tools/source/val/decoration.h @@ -15,6 +15,7 @@ #ifndef SOURCE_VAL_DECORATION_H_ #define SOURCE_VAL_DECORATION_H_ +#include #include #include #include @@ -55,6 +56,12 @@ namespace val { // params_ = vector { 2 } // struct_member_index_ = 2 // +// Example 4: Decoration for a Builtin: +// OpDecorate %var BuiltIn FragDepth +// dec_type_ = spv::Decoration::BuiltIn +// params_ = vector { FragDepth } +// struct_member_index_ = kInvalidMember +// class Decoration { public: enum { kInvalidMember = -1 }; @@ -68,6 +75,10 @@ class Decoration { spv::Decoration dec_type() const { return dec_type_; } std::vector& params() { return params_; } const std::vector& params() const { return params_; } + spv::BuiltIn builtin() const { + assert(dec_type_ == spv::Decoration::BuiltIn); + return spv::BuiltIn(params_[0]); + } inline bool operator<(const Decoration& rhs) const { // Note: Sort by struct_member_index_ first, then type, so look up can be diff --git a/bgfx/3rdparty/spirv-tools/source/val/instruction.h b/bgfx/3rdparty/spirv-tools/source/val/instruction.h index c524bd37..59e8af13 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/instruction.h +++ b/bgfx/3rdparty/spirv-tools/source/val/instruction.h @@ -22,6 +22,7 @@ #include #include "source/ext_inst.h" +#include "source/opcode.h" #include "source/table.h" #include "spirv-tools/libspirv.h" @@ -87,13 +88,13 @@ class Instruction { } bool IsNonSemantic() const { - return opcode() == spv::Op::OpExtInst && + return spvIsExtendedInstruction(opcode()) && spvExtInstIsNonSemantic(inst_.ext_inst_type); } /// True if this is an OpExtInst for debug info extension. bool IsDebugInfo() const { - return opcode() == spv::Op::OpExtInst && + return spvIsExtendedInstruction(opcode()) && spvExtInstIsDebugInfo(inst_.ext_inst_type); } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate.cpp index a5f320b9..32368075 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate.cpp @@ -141,6 +141,13 @@ spv_result_t ValidateEntryPoints(ValidationState_t& _) { } } + if (auto error = ValidateFloatControls2(_)) { + return error; + } + if (auto error = ValidateDuplicateExecutionModes(_)) { + return error; + } + return SPV_SUCCESS; } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate.h b/bgfx/3rdparty/spirv-tools/source/val/validate.h index 6b7d7cda..78093ce5 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate.h +++ b/bgfx/3rdparty/spirv-tools/source/val/validate.h @@ -82,6 +82,25 @@ spv_result_t ValidateAdjacency(ValidationState_t& _); /// @return SPV_SUCCESS if no errors are found. spv_result_t ValidateInterfaces(ValidationState_t& _); +/// @brief Validates entry point call tree requirements of +/// SPV_KHR_float_controls2 +/// +/// Checks that no entry point using FPFastMathDefault uses: +/// * FPFastMathMode Fast +/// * NoContraction +/// +/// @param[in] _ the validation state of the module +/// +/// @return SPV_SUCCESS if no errors are found. +spv_result_t ValidateFloatControls2(ValidationState_t& _); + +/// @brief Validates duplicated execution modes for each entry point. +/// +/// @param[in] _ the validation state of the module +/// +/// @return SPV_SUCCESS if no errors are found. +spv_result_t ValidateDuplicateExecutionModes(ValidationState_t& _); + /// @brief Validates memory instructions /// /// @param[in] _ the validation state of the module diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_adjacency.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_adjacency.cpp index 7e371c2f..52519bfa 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_adjacency.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_adjacency.cpp @@ -52,6 +52,7 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) { adjacency_status == IN_NEW_FUNCTION ? IN_ENTRY_BLOCK : PHI_VALID; break; case spv::Op::OpExtInst: + case spv::Op::OpExtInstWithForwardRefsKHR: // If it is a debug info instruction, we do not change the status to // allow debug info instructions before OpVariable in a function. // TODO(https://gitlab.khronos.org/spirv/SPIR-V/issues/533): We need @@ -116,6 +117,15 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) { "first instructions in the first block."; } break; + case spv::Op::OpUntypedVariableKHR: + if (inst.GetOperandAs(2) == + spv::StorageClass::Function && + adjacency_status != IN_ENTRY_BLOCK) { + return _.diag(SPV_ERROR_INVALID_DATA, &inst) + << "All OpUntypedVariableKHR instructions in a function must " + "be the first instructions in the first block."; + } + break; default: adjacency_status = PHI_AND_VAR_INVALID; break; diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_annotation.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_annotation.cpp index 73d0285a..cf6f96b8 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_annotation.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_annotation.cpp @@ -123,12 +123,14 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, spv::Decoration dec, case spv::Decoration::ArrayStride: if (target->opcode() != spv::Op::OpTypeArray && target->opcode() != spv::Op::OpTypeRuntimeArray && - target->opcode() != spv::Op::OpTypePointer) { + target->opcode() != spv::Op::OpTypePointer && + target->opcode() != spv::Op::OpTypeUntypedPointerKHR) { return fail(0) << "must be an array or pointer type"; } break; case spv::Decoration::BuiltIn: if (target->opcode() != spv::Op::OpVariable && + target->opcode() != spv::Op::OpUntypedVariableKHR && !spvOpcodeIsConstant(target->opcode())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "BuiltIns can only target variables, structure members or " @@ -139,7 +141,8 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, spv::Decoration dec, if (!spvOpcodeIsConstant(target->opcode())) { return fail(0) << "must be a constant for WorkgroupSize"; } - } else if (target->opcode() != spv::Op::OpVariable) { + } else if (target->opcode() != spv::Op::OpVariable && + target->opcode() != spv::Op::OpUntypedVariableKHR) { return fail(0) << "must be a variable"; } break; @@ -161,10 +164,12 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, spv::Decoration dec, case spv::Decoration::RestrictPointer: case spv::Decoration::AliasedPointer: if (target->opcode() != spv::Op::OpVariable && - target->opcode() != spv::Op::OpFunctionParameter) { + target->opcode() != spv::Op::OpUntypedVariableKHR && + target->opcode() != spv::Op::OpFunctionParameter && + target->opcode() != spv::Op::OpRawAccessChainNV) { return fail(0) << "must be a memory object declaration"; } - if (_.GetIdOpcode(target->type_id()) != spv::Op::OpTypePointer) { + if (!_.IsPointerType(target->type_id())) { return fail(0) << "must be a pointer type"; } break; @@ -175,7 +180,8 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, spv::Decoration dec, case spv::Decoration::Binding: case spv::Decoration::DescriptorSet: case spv::Decoration::InputAttachmentIndex: - if (target->opcode() != spv::Op::OpVariable) { + if (target->opcode() != spv::Op::OpVariable && + target->opcode() != spv::Op::OpUntypedVariableKHR) { return fail(0) << "must be a variable"; } break; @@ -267,6 +273,34 @@ spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) { } } + if (decoration == spv::Decoration::FPFastMathMode) { + if (_.HasDecoration(target_id, spv::Decoration::NoContraction)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "FPFastMathMode and NoContraction cannot decorate the same " + "target"; + } + auto mask = inst->GetOperandAs(2); + if ((mask & spv::FPFastMathModeMask::AllowTransform) != + spv::FPFastMathModeMask::MaskNone && + ((mask & (spv::FPFastMathModeMask::AllowContract | + spv::FPFastMathModeMask::AllowReassoc)) != + (spv::FPFastMathModeMask::AllowContract | + spv::FPFastMathModeMask::AllowReassoc))) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "AllowReassoc and AllowContract must be specified when " + "AllowTransform is specified"; + } + } + + // This is checked from both sides since we register decorations as we go. + if (decoration == spv::Decoration::NoContraction) { + if (_.HasDecoration(target_id, spv::Decoration::FPFastMathMode)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "FPFastMathMode and NoContraction cannot decorate the same " + "target"; + } + } + if (DecorationTakesIdParameters(decoration)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Decorations taking ID parameters may not be used with " diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_atomics.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_atomics.cpp index b745a9ec..990ed315 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_atomics.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_atomics.cpp @@ -144,12 +144,13 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { case spv::Op::OpAtomicFlagClear: { const uint32_t result_type = inst->type_id(); - // All current atomics only are scalar result // Validate return type first so can just check if pointer type is same // (if applicable) if (HasReturnType(opcode)) { if (HasOnlyFloatReturnType(opcode) && - !_.IsFloatScalarType(result_type)) { + (!(_.HasCapability(spv::Capability::AtomicFloat16VectorNV) && + _.IsFloat16Vector2Or4Type(result_type)) && + !_.IsFloatScalarType(result_type))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": expected Result Type to be float scalar type"; @@ -160,6 +161,9 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { << ": expected Result Type to be integer scalar type"; } else if (HasIntOrFloatReturnType(opcode) && !_.IsFloatScalarType(result_type) && + !(opcode == spv::Op::OpAtomicExchange && + _.HasCapability(spv::Capability::AtomicFloat16VectorNV) && + _.IsFloat16Vector2Or4Type(result_type)) && !_.IsIntScalarType(result_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) @@ -179,7 +183,44 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { if (!_.GetPointerTypeInfo(pointer_type, &data_type, &storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) - << ": expected Pointer to be of type OpTypePointer"; + << ": expected Pointer to be a pointer type"; + } + + // If the pointer is an untyped pointer, get the data type elsewhere. + if (data_type == 0) { + switch (opcode) { + case spv::Op::OpAtomicLoad: + case spv::Op::OpAtomicExchange: + case spv::Op::OpAtomicFAddEXT: + case spv::Op::OpAtomicCompareExchange: + case spv::Op::OpAtomicCompareExchangeWeak: + case spv::Op::OpAtomicIIncrement: + case spv::Op::OpAtomicIDecrement: + case spv::Op::OpAtomicIAdd: + case spv::Op::OpAtomicISub: + case spv::Op::OpAtomicSMin: + case spv::Op::OpAtomicUMin: + case spv::Op::OpAtomicFMinEXT: + case spv::Op::OpAtomicSMax: + case spv::Op::OpAtomicUMax: + case spv::Op::OpAtomicFMaxEXT: + case spv::Op::OpAtomicAnd: + case spv::Op::OpAtomicOr: + case spv::Op::OpAtomicXor: + data_type = inst->type_id(); + break; + case spv::Op::OpAtomicFlagTestAndSet: + case spv::Op::OpAtomicFlagClear: + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Untyped pointers are not supported by atomic flag " + "instructions"; + break; + case spv::Op::OpAtomicStore: + data_type = _.FindDef(inst->GetOperandAs(3))->type_id(); + break; + default: + break; + } } // Can't use result_type because OpAtomicStore doesn't have a result @@ -222,12 +263,21 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { if (opcode == spv::Op::OpAtomicFAddEXT) { // result type being float checked already - if ((_.GetBitWidth(result_type) == 16) && - (!_.HasCapability(spv::Capability::AtomicFloat16AddEXT))) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << spvOpcodeString(opcode) - << ": float add atomics require the AtomicFloat32AddEXT " - "capability"; + if (_.GetBitWidth(result_type) == 16) { + if (_.IsFloat16Vector2Or4Type(result_type)) { + if (!_.HasCapability(spv::Capability::AtomicFloat16VectorNV)) + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << spvOpcodeString(opcode) + << ": float vector atomics require the " + "AtomicFloat16VectorNV capability"; + } else { + if (!_.HasCapability(spv::Capability::AtomicFloat16AddEXT)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << spvOpcodeString(opcode) + << ": float add atomics require the AtomicFloat32AddEXT " + "capability"; + } + } } if ((_.GetBitWidth(result_type) == 32) && (!_.HasCapability(spv::Capability::AtomicFloat32AddEXT))) { @@ -245,12 +295,21 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { } } else if (opcode == spv::Op::OpAtomicFMinEXT || opcode == spv::Op::OpAtomicFMaxEXT) { - if ((_.GetBitWidth(result_type) == 16) && - (!_.HasCapability(spv::Capability::AtomicFloat16MinMaxEXT))) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << spvOpcodeString(opcode) - << ": float min/max atomics require the " - "AtomicFloat16MinMaxEXT capability"; + if (_.GetBitWidth(result_type) == 16) { + if (_.IsFloat16Vector2Or4Type(result_type)) { + if (!_.HasCapability(spv::Capability::AtomicFloat16VectorNV)) + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << spvOpcodeString(opcode) + << ": float vector atomics require the " + "AtomicFloat16VectorNV capability"; + } else { + if (!_.HasCapability(spv::Capability::AtomicFloat16MinMaxEXT)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << spvOpcodeString(opcode) + << ": float min/max atomics require the " + "AtomicFloat16MinMaxEXT capability"; + } + } } if ((_.GetBitWidth(result_type) == 32) && (!_.HasCapability(spv::Capability::AtomicFloat32MinMaxEXT))) { diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_builtins.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_builtins.cpp index 3e817125..1305dc1f 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_builtins.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_builtins.cpp @@ -97,12 +97,16 @@ spv_result_t GetUnderlyingType(ValidationState_t& _, spv::StorageClass GetStorageClass(const Instruction& inst) { switch (inst.opcode()) { case spv::Op::OpTypePointer: + case spv::Op::OpTypeUntypedPointerKHR: case spv::Op::OpTypeForwardPointer: { return spv::StorageClass(inst.word(2)); } case spv::Op::OpVariable: { return spv::StorageClass(inst.word(3)); } + case spv::Op::OpUntypedVariableKHR: { + return spv::StorageClass(inst.word(4)); + } case spv::Op::OpGenericCastToPtrExplicit: { return spv::StorageClass(inst.word(4)); } @@ -118,13 +122,15 @@ typedef enum VUIDError_ { VUIDErrorMax, } VUIDError; -const static uint32_t NumVUIDBuiltins = 36; +const static uint32_t NumVUIDBuiltins = 39; typedef struct { spv::BuiltIn builtIn; uint32_t vuid[VUIDErrorMax]; // execution mode, storage class, type VUIDs } BuiltinVUIDMapping; +// Many built-ins have the same checks (Storage Class, Type, etc) +// This table provides a nice LUT for the VUIDs std::array builtinVUIDInfo = {{ // clang-format off {spv::BuiltIn::SubgroupEqMask, {0, 4370, 4371}}, @@ -163,8 +169,11 @@ std::array builtinVUIDInfo = {{ {spv::BuiltIn::CullMaskKHR, {6735, 6736, 6737}}, {spv::BuiltIn::BaryCoordKHR, {4154, 4155, 4156}}, {spv::BuiltIn::BaryCoordNoPerspKHR, {4160, 4161, 4162}}, - // clang-format off -} }; + {spv::BuiltIn::PrimitivePointIndicesEXT, {7041, 7043, 7044}}, + {spv::BuiltIn::PrimitiveLineIndicesEXT, {7047, 7049, 7050}}, + {spv::BuiltIn::PrimitiveTriangleIndicesEXT, {7053, 7055, 7056}}, + // clang-format on +}}; uint32_t GetVUIDForBuiltin(spv::BuiltIn builtIn, VUIDError type) { uint32_t vuid = 0; @@ -356,6 +365,9 @@ class BuiltInsValidator { spv_result_t ValidateRayTracingBuiltinsAtDefinition( const Decoration& decoration, const Instruction& inst); + spv_result_t ValidateMeshShadingEXTBuiltinsAtDefinition( + const Decoration& decoration, const Instruction& inst); + // The following section contains functions which are called when id defined // by |referenced_inst| is // 1. referenced by |referenced_from_inst| @@ -546,6 +558,11 @@ class BuiltInsValidator { const Instruction& referenced_inst, const Instruction& referenced_from_inst); + spv_result_t ValidateMeshShadingEXTBuiltinsAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst); + // Validates that |built_in_inst| is not (even indirectly) referenced from // within a function which can be called with |execution_model|. // @@ -581,6 +598,10 @@ class BuiltInsValidator { spv_result_t ValidateI32Arr( const Decoration& decoration, const Instruction& inst, const std::function& diag); + spv_result_t ValidateArrayedI32Vec( + const Decoration& decoration, const Instruction& inst, + uint32_t num_components, + const std::function& diag); spv_result_t ValidateOptionalArrayedI32( const Decoration& decoration, const Instruction& inst, const std::function& diag); @@ -724,7 +745,7 @@ std::string BuiltInsValidator::GetReferenceDesc( ss << " which is decorated with BuiltIn "; ss << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]); + (uint32_t)decoration.builtin()); if (function_id_) { ss << " in function <" << function_id_ << ">"; if (execution_model != spv::ExecutionModel::Max) { @@ -909,6 +930,45 @@ spv_result_t BuiltInsValidator::ValidateI32Vec( return SPV_SUCCESS; } +spv_result_t BuiltInsValidator::ValidateArrayedI32Vec( + const Decoration& decoration, const Instruction& inst, + uint32_t num_components, + const std::function& diag) { + uint32_t underlying_type = 0; + if (spv_result_t error = + GetUnderlyingType(_, decoration, inst, &underlying_type)) { + return error; + } + + const Instruction* const type_inst = _.FindDef(underlying_type); + if (type_inst->opcode() != spv::Op::OpTypeArray) { + return diag(GetDefinitionDesc(decoration, inst) + " is not an array."); + } + + const uint32_t component_type = type_inst->word(2); + if (!_.IsIntVectorType(component_type)) { + return diag(GetDefinitionDesc(decoration, inst) + " is not an int vector."); + } + + const uint32_t actual_num_components = _.GetDimension(component_type); + if (_.GetDimension(component_type) != num_components) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) << " has " + << actual_num_components << " components."; + return diag(ss.str()); + } + + const uint32_t bit_width = _.GetBitWidth(component_type); + if (bit_width != 32) { + std::ostringstream ss; + ss << GetDefinitionDesc(decoration, inst) + << " has components with bit width " << bit_width << "."; + return diag(ss.str()); + } + + return SPV_SUCCESS; +} + spv_result_t BuiltInsValidator::ValidateOptionalArrayedF32Vec( const Decoration& decoration, const Instruction& inst, uint32_t num_components, @@ -1064,7 +1124,7 @@ spv_result_t BuiltInsValidator::ValidateF32ArrHelper( if (num_components != 0) { uint64_t actual_num_components = 0; - if (!_.GetConstantValUint64(type_inst->word(3), &actual_num_components)) { + if (!_.EvalConstantValUint64(type_inst->word(3), &actual_num_components)) { assert(0 && "Array type definition is corrupt"); } if (actual_num_components != num_components) { @@ -1114,7 +1174,7 @@ spv_result_t BuiltInsValidator::ValidateNotCalledWithExecutionModel( const char* execution_model_str = _.grammar().lookupOperandName( SPV_OPERAND_TYPE_EXECUTION_MODEL, uint32_t(execution_model)); const char* built_in_str = _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0]); + SPV_OPERAND_TYPE_BUILT_IN, (uint32_t)decoration.builtin()); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << (vuid < 0 ? std::string("") : _.VkErrorID(vuid)) << comment << " " << GetIdDesc(referenced_inst) << " depends on " @@ -1145,13 +1205,14 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst) { - uint32_t operand = decoration.params()[0]; + uint32_t operand = (uint32_t)decoration.builtin(); if (spvIsVulkanEnv(_.context()->target_env)) { const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && storage_class != spv::StorageClass::Input && storage_class != spv::StorageClass::Output) { - uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4190 : 4199; + uint32_t vuid = + (decoration.builtin() == spv::BuiltIn::ClipDistance) ? 4190 : 4199; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -1165,7 +1226,8 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( if (storage_class == spv::StorageClass::Input) { assert(function_id_ == 0); - uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4188 : 4197; + uint32_t vuid = + (decoration.builtin() == spv::BuiltIn::ClipDistance) ? 4188 : 4197; id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be " @@ -1191,7 +1253,8 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( if (storage_class == spv::StorageClass::Output) { assert(function_id_ == 0); - uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4189 : 4198; + uint32_t vuid = + (decoration.builtin() == spv::BuiltIn::ClipDistance) ? 4189 : 4198; id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be " @@ -1210,7 +1273,7 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( [this, &decoration, &referenced_from_inst]( const std::string& message) -> spv_result_t { uint32_t vuid = - (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) + (decoration.builtin() == spv::BuiltIn::ClipDistance) ? 4191 : 4200; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) @@ -1218,7 +1281,7 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit float array. " << message; })) { @@ -1238,7 +1301,7 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( [this, &decoration, &referenced_from_inst]( const std::string& message) -> spv_result_t { uint32_t vuid = - (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) + (decoration.builtin() == spv::BuiltIn::ClipDistance) ? 4191 : 4200; return _.diag(SPV_ERROR_INVALID_DATA, @@ -1247,7 +1310,7 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit float array. " << message; })) { @@ -1259,7 +1322,7 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( [this, &decoration, &referenced_from_inst]( const std::string& message) -> spv_result_t { uint32_t vuid = - (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) + (decoration.builtin() == spv::BuiltIn::ClipDistance) ? 4191 : 4200; return _.diag(SPV_ERROR_INVALID_DATA, @@ -1268,7 +1331,7 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit float array. " << message; })) { @@ -1279,8 +1342,9 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( } default: { - uint32_t vuid = - (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4187 : 4196; + uint32_t vuid = (decoration.builtin() == spv::BuiltIn::ClipDistance) + ? 4187 + : 4196; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -2486,7 +2550,7 @@ spv_result_t BuiltInsValidator::ValidateTessLevelAtReference( const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst) { - uint32_t operand = decoration.params()[0]; + uint32_t operand = (uint32_t)decoration.builtin(); if (spvIsVulkanEnv(_.context()->target_env)) { const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && @@ -2505,7 +2569,8 @@ spv_result_t BuiltInsValidator::ValidateTessLevelAtReference( if (storage_class == spv::StorageClass::Input) { assert(function_id_ == 0); - uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::TessLevelOuter) ? 4391 : 4395; + uint32_t vuid = + (decoration.builtin() == spv::BuiltIn::TessLevelOuter) ? 4391 : 4395; id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be " @@ -2518,7 +2583,8 @@ spv_result_t BuiltInsValidator::ValidateTessLevelAtReference( if (storage_class == spv::StorageClass::Output) { assert(function_id_ == 0); - uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::TessLevelOuter) ? 4392 : 4396; + uint32_t vuid = + (decoration.builtin() == spv::BuiltIn::TessLevelOuter) ? 4392 : 4396; id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be " @@ -2668,12 +2734,13 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtDefinition( [this, &decoration, &inst](const std::string& message) -> spv_result_t { uint32_t vuid = - (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::Layer) ? 4276 : 4408; + (decoration.builtin() == spv::BuiltIn::Layer) ? 4276 : 4408; return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0]) + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << "variable needs to be a 32-bit int scalar. " << message; })) { @@ -2685,12 +2752,13 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtDefinition( [this, &decoration, &inst](const std::string& message) -> spv_result_t { uint32_t vuid = - (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::Layer) ? 4276 : 4408; + (decoration.builtin() == spv::BuiltIn::Layer) ? 4276 : 4408; return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0]) + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << "variable needs to be a 32-bit int scalar. " << message; })) { @@ -2707,7 +2775,7 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference( const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst) { - uint32_t operand = decoration.params()[0]; + uint32_t operand = (uint32_t)decoration.builtin(); if (spvIsVulkanEnv(_.context()->target_env)) { const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && @@ -2821,7 +2889,7 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference( spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); if (spv_result_t error = ValidateF32Vec( decoration, inst, 3, [this, &inst, builtin](const std::string& message) -> spv_result_t { @@ -2851,7 +2919,7 @@ spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && storage_class != spv::StorageClass::Input) { @@ -2895,7 +2963,7 @@ spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtReference( spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); if (spv_result_t error = ValidateI32Vec( decoration, inst, 3, [this, &inst, builtin](const std::string& message) -> spv_result_t { @@ -2924,7 +2992,7 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && storage_class != spv::StorageClass::Input) { @@ -2975,7 +3043,7 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference( spv_result_t BuiltInsValidator::ValidateComputeI32InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); if (decoration.struct_member_index() != Decoration::kInvalidMember) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << "BuiltIn " @@ -3009,7 +3077,7 @@ spv_result_t BuiltInsValidator::ValidateComputeI32InputAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && storage_class != spv::StorageClass::Input) { @@ -3060,7 +3128,7 @@ spv_result_t BuiltInsValidator::ValidateComputeI32InputAtReference( spv_result_t BuiltInsValidator::ValidateI32InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); if (decoration.struct_member_index() != Decoration::kInvalidMember) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << "BuiltIn " @@ -3103,7 +3171,7 @@ spv_result_t BuiltInsValidator::ValidateI32InputAtDefinition( spv_result_t BuiltInsValidator::ValidateI32Vec4InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); if (decoration.struct_member_index() != Decoration::kInvalidMember) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << "BuiltIn " @@ -3191,7 +3259,7 @@ spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtReference( << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " to be used only with GLCompute, MeshNV, TaskNV, MeshEXT or " << "TaskEXT execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, @@ -3217,14 +3285,15 @@ spv_result_t BuiltInsValidator::ValidateBaseInstanceOrVertexAtDefinition( decoration, inst, [this, &inst, &decoration](const std::string& message) -> spv_result_t { - uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::BaseInstance) - ? 4183 - : 4186; + uint32_t vuid = + (decoration.builtin() == spv::BuiltIn::BaseInstance) ? 4183 + : 4186; return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit int scalar. " << message; })) { @@ -3239,7 +3308,7 @@ spv_result_t BuiltInsValidator::ValidateBaseInstanceOrVertexAtReference( const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst) { - uint32_t operand = decoration.params()[0]; + uint32_t operand = (uint32_t)decoration.builtin(); if (spvIsVulkanEnv(_.context()->target_env)) { const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && @@ -3290,8 +3359,9 @@ spv_result_t BuiltInsValidator::ValidateDrawIndexAtDefinition( return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(4209) << "According to the Vulkan spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit int scalar. " << message; })) { @@ -3306,7 +3376,7 @@ spv_result_t BuiltInsValidator::ValidateDrawIndexAtReference( const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst) { - uint32_t operand = decoration.params()[0]; + uint32_t operand = (uint32_t)decoration.builtin(); if (spvIsVulkanEnv(_.context()->target_env)) { const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && @@ -3360,8 +3430,9 @@ spv_result_t BuiltInsValidator::ValidateViewIndexAtDefinition( return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(4403) << "According to the Vulkan spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit int scalar. " << message; })) { @@ -3376,7 +3447,7 @@ spv_result_t BuiltInsValidator::ValidateViewIndexAtReference( const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst) { - uint32_t operand = decoration.params()[0]; + uint32_t operand = (uint32_t)decoration.builtin(); if (spvIsVulkanEnv(_.context()->target_env)) { const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && @@ -3424,8 +3495,9 @@ spv_result_t BuiltInsValidator::ValidateDeviceIndexAtDefinition( return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(4206) << "According to the Vulkan spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit int scalar. " << message; })) { @@ -3440,7 +3512,7 @@ spv_result_t BuiltInsValidator::ValidateDeviceIndexAtReference( const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst) { - uint32_t operand = decoration.params()[0]; + uint32_t operand = (uint32_t)decoration.builtin(); if (spvIsVulkanEnv(_.context()->target_env)) { const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && @@ -3470,7 +3542,7 @@ spv_result_t BuiltInsValidator::ValidateFragInvocationCountAtDefinition(const De const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); if (spv_result_t error = ValidateI32( decoration, inst, [this, &inst, &builtin](const std::string& message) -> spv_result_t { @@ -3497,7 +3569,7 @@ spv_result_t BuiltInsValidator::ValidateFragInvocationCountAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && storage_class != spv::StorageClass::Input) { @@ -3540,7 +3612,7 @@ spv_result_t BuiltInsValidator::ValidateFragInvocationCountAtReference( spv_result_t BuiltInsValidator::ValidateFragSizeAtDefinition(const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); if (spv_result_t error = ValidateI32Vec( decoration, inst, 2, [this, &inst, &builtin](const std::string& message) -> spv_result_t { @@ -3567,7 +3639,7 @@ spv_result_t BuiltInsValidator::ValidateFragSizeAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && storage_class != spv::StorageClass::Input) { @@ -3610,7 +3682,7 @@ spv_result_t BuiltInsValidator::ValidateFragSizeAtReference( spv_result_t BuiltInsValidator::ValidateFragStencilRefAtDefinition(const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); if (spv_result_t error = ValidateI( decoration, inst, [this, &inst, &builtin](const std::string& message) -> spv_result_t { @@ -3637,7 +3709,7 @@ spv_result_t BuiltInsValidator::ValidateFragStencilRefAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && storage_class != spv::StorageClass::Output) { @@ -3680,7 +3752,7 @@ spv_result_t BuiltInsValidator::ValidateFragStencilRefAtReference( spv_result_t BuiltInsValidator::ValidateFullyCoveredAtDefinition(const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); if (spv_result_t error = ValidateBool( decoration, inst, [this, &inst, &builtin](const std::string& message) -> spv_result_t { @@ -3707,7 +3779,7 @@ spv_result_t BuiltInsValidator::ValidateFullyCoveredAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && storage_class != spv::StorageClass::Input) { @@ -3758,8 +3830,9 @@ spv_result_t BuiltInsValidator::ValidateNVSMOrARMCoreBuiltinsAtDefinition( << "According to the " << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit int scalar. " << message; })) { @@ -3783,7 +3856,7 @@ spv_result_t BuiltInsValidator::ValidateNVSMOrARMCoreBuiltinsAtReference( << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " to be only used for " "variables with Input storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, @@ -3812,8 +3885,9 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateAtDefinition( return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(4486) << "According to the Vulkan spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit int scalar. " << message; })) { @@ -3836,7 +3910,7 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateAtReference( return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4485) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " to be only used for variables with Output storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) @@ -3853,8 +3927,9 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateAtReference( default: { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4484) << "Vulkan spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << " to be used only with Vertex, Geometry, or MeshNV " "execution models. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, @@ -3885,8 +3960,9 @@ spv_result_t BuiltInsValidator::ValidateShadingRateAtDefinition( return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(4492) << "According to the Vulkan spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) << " variable needs to be a 32-bit int scalar. " << message; })) { @@ -3909,7 +3985,7 @@ spv_result_t BuiltInsValidator::ValidateShadingRateAtReference( return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4491) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) @@ -3921,7 +3997,7 @@ spv_result_t BuiltInsValidator::ValidateShadingRateAtReference( return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4490) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " to be used only with the Fragment execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); @@ -3942,7 +4018,7 @@ spv_result_t BuiltInsValidator::ValidateShadingRateAtReference( spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); switch (builtin) { case spv::BuiltIn::HitTNV: case spv::BuiltIn::RayTminKHR: @@ -4065,7 +4141,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = decoration.builtin(); const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); if (storage_class != spv::StorageClass::Max && storage_class != spv::StorageClass::Input) { @@ -4073,7 +4149,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtReference( return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) @@ -4086,10 +4162,11 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtReference( return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec does not allow BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - decoration.params()[0]) + (uint32_t)decoration.builtin()) << " to be used with the execution model " << _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_EXECUTION_MODEL, uint32_t(execution_model)) + SPV_OPERAND_TYPE_EXECUTION_MODEL, + uint32_t(execution_model)) << ".\n" << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); @@ -4108,9 +4185,125 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtReference( return SPV_SUCCESS; } +spv_result_t BuiltInsValidator::ValidateMeshShadingEXTBuiltinsAtDefinition( + const Decoration& decoration, const Instruction& inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const spv::BuiltIn builtin = decoration.builtin(); + uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorType); + if (builtin == spv::BuiltIn::PrimitivePointIndicesEXT) { + if (spv_result_t error = ValidateI32Arr( + decoration, inst, + [this, &inst, &decoration, + &vuid](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA, &inst) + << _.VkErrorID(vuid) << "According to the " + << spvLogStringForEnv(_.context()->target_env) + << " spec BuiltIn " + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) + << " variable needs to be a 32-bit int array." + << message; + })) { + return error; + } + } + if (builtin == spv::BuiltIn::PrimitiveLineIndicesEXT) { + if (spv_result_t error = ValidateArrayedI32Vec( + decoration, inst, 2, + [this, &inst, &decoration, + &vuid](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA, &inst) + << _.VkErrorID(vuid) << "According to the " + << spvLogStringForEnv(_.context()->target_env) + << " spec BuiltIn " + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) + << " variable needs to be a 2-component 32-bit int " + "array." + << message; + })) { + return error; + } + } + if (builtin == spv::BuiltIn::PrimitiveTriangleIndicesEXT) { + if (spv_result_t error = ValidateArrayedI32Vec( + decoration, inst, 3, + [this, &inst, &decoration, + &vuid](const std::string& message) -> spv_result_t { + return _.diag(SPV_ERROR_INVALID_DATA, &inst) + << _.VkErrorID(vuid) << "According to the " + << spvLogStringForEnv(_.context()->target_env) + << " spec BuiltIn " + << _.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, + (uint32_t)decoration.builtin()) + << " variable needs to be a 3-component 32-bit int " + "array." + << message; + })) { + return error; + } + } + } + // Seed at reference checks with this built-in. + return ValidateMeshShadingEXTBuiltinsAtReference(decoration, inst, inst, + inst); +} + +spv_result_t BuiltInsValidator::ValidateMeshShadingEXTBuiltinsAtReference( + const Decoration& decoration, const Instruction& built_in_inst, + const Instruction& referenced_inst, + const Instruction& referenced_from_inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const spv::BuiltIn builtin = decoration.builtin(); + const spv::StorageClass storage_class = + GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Output) { + uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); + return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) + << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) + << " spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + uint32_t(builtin)) + << " to be only used for variables with Output storage class. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst) + << " " << GetStorageClassDesc(referenced_from_inst); + } + + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::MeshEXT) { + uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel); + return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) + << _.VkErrorID(vuid) + << spvLogStringForEnv(_.context()->target_env) + << " spec allows BuiltIn " + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, + uint32_t(builtin)) + << " to be used only with MeshEXT execution model. " + << GetReferenceDesc(decoration, built_in_inst, referenced_inst, + referenced_from_inst, execution_model); + } + } + } + + if (function_id_ == 0) { + // Propagate this rule to all dependant ids in the global scope. + id_to_at_reference_checks_[referenced_from_inst.id()].push_back( + std::bind(&BuiltInsValidator::ValidateMeshShadingEXTBuiltinsAtReference, + this, decoration, built_in_inst, referenced_from_inst, + std::placeholders::_1)); + } + + return SPV_SUCCESS; +} + spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition( const Decoration& decoration, const Instruction& inst) { - const spv::BuiltIn label = spv::BuiltIn(decoration.params()[0]); + const spv::BuiltIn label = decoration.builtin(); if (!spvIsVulkanEnv(_.context()->target_env)) { // Early return. All currently implemented rules are based on Vulkan spec. @@ -4283,6 +4476,11 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition( case spv::BuiltIn::CullMaskKHR: { return ValidateRayTracingBuiltinsAtDefinition(decoration, inst); } + case spv::BuiltIn::PrimitivePointIndicesEXT: + case spv::BuiltIn::PrimitiveLineIndicesEXT: + case spv::BuiltIn::PrimitiveTriangleIndicesEXT: { + return ValidateMeshShadingEXTBuiltinsAtDefinition(decoration, inst); + } case spv::BuiltIn::PrimitiveShadingRateKHR: { return ValidatePrimitiveShadingRateAtDefinition(decoration, inst); } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp index 7b3f7480..b7e570de 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp @@ -190,6 +190,8 @@ spv_result_t ValidateBranchConditional(ValidationState_t& _, "ID of an OpLabel instruction"; } + // A similar requirement for SPV_KHR_maximal_reconvergence is deferred until + // entry point call trees have been reconrded. if (_.version() >= SPV_SPIRV_VERSION_WORD(1, 6) && true_id == false_id) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "In SPIR-V 1.6 or later, True Label and False Label must be " @@ -248,7 +250,8 @@ spv_result_t ValidateReturnValue(ValidationState_t& _, } if (_.addressing_model() == spv::AddressingModel::Logical && - spv::Op::OpTypePointer == value_type->opcode() && + (spv::Op::OpTypePointer == value_type->opcode() || + spv::Op::OpTypeUntypedPointerKHR == value_type->opcode()) && !_.features().variable_pointers && !_.options()->relax_logical_pointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpReturnValue value's type " @@ -465,13 +468,13 @@ std::string ConstructErrorString(const Construct& construct, // headed by |target_block| branches to multiple case constructs. spv_result_t FindCaseFallThrough( ValidationState_t& _, BasicBlock* target_block, uint32_t* case_fall_through, - const BasicBlock* merge, const std::unordered_set& case_targets, - Function* function) { + const Construct& switch_construct, + const std::unordered_set& case_targets) { + const auto* merge = switch_construct.exit_block(); std::vector stack; stack.push_back(target_block); std::unordered_set visited; bool target_reachable = target_block->structurally_reachable(); - int target_depth = function->GetBlockDepth(target_block); while (!stack.empty()) { auto block = stack.back(); stack.pop_back(); @@ -489,9 +492,14 @@ spv_result_t FindCaseFallThrough( } else { // Exiting the case construct to non-merge block. if (!case_targets.count(block->id())) { - int depth = function->GetBlockDepth(block); - if ((depth < target_depth) || - (depth == target_depth && block->is_type(kBlockTypeContinue))) { + // We have already filtered out the following: + // * The switch's merge + // * Other case targets + // * Blocks in the same case construct + // + // So the only remaining valid branches are the structured exits from + // the overall selection construct of the switch. + if (switch_construct.IsStructuredExit(_, block)) { continue; } @@ -523,9 +531,10 @@ spv_result_t FindCaseFallThrough( } spv_result_t StructuredSwitchChecks(ValidationState_t& _, Function* function, - const Instruction* switch_inst, - const BasicBlock* header, - const BasicBlock* merge) { + const Construct& switch_construct) { + const auto* header = switch_construct.entry_block(); + const auto* merge = switch_construct.exit_block(); + const auto* switch_inst = header->terminator(); std::unordered_set case_targets; for (uint32_t i = 1; i < switch_inst->operands().size(); i += 2) { uint32_t target = switch_inst->GetOperandAs(i); @@ -543,6 +552,7 @@ spv_result_t StructuredSwitchChecks(ValidationState_t& _, Function* function, break; } } + std::unordered_map seen_to_fall_through; for (uint32_t i = 1; i < switch_inst->operands().size(); i += 2) { uint32_t target = switch_inst->GetOperandAs(i); @@ -563,7 +573,7 @@ spv_result_t StructuredSwitchChecks(ValidationState_t& _, Function* function, } if (auto error = FindCaseFallThrough(_, target_block, &case_fall_through, - merge, case_targets, function)) { + switch_construct, case_targets)) { return error; } @@ -836,6 +846,9 @@ spv_result_t StructuredControlFlowChecks( const auto* continue_target = next_inst.block(); if (header->id() != continue_id) { for (auto pred : *continue_target->predecessors()) { + if (!pred->structurally_reachable()) { + continue; + } // Ignore back-edges from within the continue construct. bool is_back_edge = false; for (auto back_edge : back_edges) { @@ -860,9 +873,7 @@ spv_result_t StructuredControlFlowChecks( // Checks rules for case constructs. if (construct.type() == ConstructType::kSelection && header->terminator()->opcode() == spv::Op::OpSwitch) { - const auto terminator = header->terminator(); - if (auto error = - StructuredSwitchChecks(_, function, terminator, header, merge)) { + if (auto error = StructuredSwitchChecks(_, function, construct)) { return error; } } @@ -875,6 +886,95 @@ spv_result_t StructuredControlFlowChecks( return SPV_SUCCESS; } +spv_result_t MaximalReconvergenceChecks(ValidationState_t& _) { + // Find all the entry points with the MaximallyReconvergencesKHR execution + // mode. + std::unordered_set maximal_funcs; + std::unordered_set maximal_entry_points; + for (auto entry_point : _.entry_points()) { + const auto* exec_modes = _.GetExecutionModes(entry_point); + if (exec_modes && + exec_modes->count(spv::ExecutionMode::MaximallyReconvergesKHR)) { + maximal_entry_points.insert(entry_point); + maximal_funcs.insert(entry_point); + } + } + + if (maximal_entry_points.empty()) { + return SPV_SUCCESS; + } + + // Find all the functions reachable from a maximal reconvergence entry point. + for (const auto& func : _.functions()) { + const auto& entry_points = _.EntryPointReferences(func.id()); + for (auto id : entry_points) { + if (maximal_entry_points.count(id)) { + maximal_funcs.insert(func.id()); + break; + } + } + } + + // Check for conditional branches with the same true and false targets. + for (const auto& inst : _.ordered_instructions()) { + if (inst.opcode() == spv::Op::OpBranchConditional) { + const auto true_id = inst.GetOperandAs(1); + const auto false_id = inst.GetOperandAs(2); + if (true_id == false_id && maximal_funcs.count(inst.function()->id())) { + return _.diag(SPV_ERROR_INVALID_ID, &inst) + << "In entry points using the MaximallyReconvergesKHR execution " + "mode, True Label and False Label must be different labels"; + } + } + } + + // Check for invalid multiple predecessors. Only loop headers, continue + // targets, merge targets or switch targets or defaults may have multiple + // unique predecessors. + for (const auto& func : _.functions()) { + if (!maximal_funcs.count(func.id())) continue; + + for (const auto* block : func.ordered_blocks()) { + std::unordered_set unique_preds; + const auto* preds = block->predecessors(); + if (!preds) continue; + + for (const auto* pred : *preds) { + unique_preds.insert(pred->id()); + } + if (unique_preds.size() < 2) continue; + + const auto* terminator = block->terminator(); + const auto index = terminator - &_.ordered_instructions()[0]; + const auto* pre_terminator = &_.ordered_instructions()[index - 1]; + if (pre_terminator->opcode() == spv::Op::OpLoopMerge) continue; + + const auto* label = _.FindDef(block->id()); + bool ok = false; + for (const auto& pair : label->uses()) { + const auto* use_inst = pair.first; + switch (use_inst->opcode()) { + case spv::Op::OpSelectionMerge: + case spv::Op::OpLoopMerge: + case spv::Op::OpSwitch: + ok = true; + break; + default: + break; + } + } + if (!ok) { + return _.diag(SPV_ERROR_INVALID_CFG, label) + << "In entry points using the MaximallyReconvergesKHR " + "execution mode, this basic block must not have multiple " + "unique predecessors"; + } + } + } + + return SPV_SUCCESS; +} + spv_result_t PerformCfgChecks(ValidationState_t& _) { for (auto& function : _.functions()) { // Check all referenced blocks are defined within a function @@ -999,6 +1099,11 @@ spv_result_t PerformCfgChecks(ValidationState_t& _) { return error; } } + + if (auto error = MaximalReconvergenceChecks(_)) { + return error; + } + return SPV_SUCCESS; } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp index ed043b68..26486dac 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp @@ -94,7 +94,7 @@ spv_result_t GetExtractInsertValueType(ValidationState_t& _, break; } - if (!_.GetConstantValUint64(type_inst->word(3), &array_size)) { + if (!_.EvalConstantValUint64(type_inst->word(3), &array_size)) { assert(0 && "Array type definition is corrupt"); } if (component_index >= array_size) { @@ -289,7 +289,7 @@ spv_result_t ValidateCompositeConstruct(ValidationState_t& _, } uint64_t array_size = 0; - if (!_.GetConstantValUint64(array_inst->word(3), &array_size)) { + if (!_.EvalConstantValUint64(array_inst->word(3), &array_size)) { assert(0 && "Array type definition is corrupt"); } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_constants.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_constants.cpp index 4deaa496..1d40eedf 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_constants.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_constants.cpp @@ -324,6 +324,7 @@ bool IsTypeNullable(const std::vector& instruction, } return true; } + case spv::Op::OpTypeUntypedPointerKHR: case spv::Op::OpTypePointer: if (spv::StorageClass(instruction[2]) == spv::StorageClass::PhysicalStorageBuffer) { diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_decorations.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_decorations.cpp index 605b79eb..7f374bbd 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_decorations.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_decorations.cpp @@ -71,26 +71,6 @@ uint32_t GetArrayStride(uint32_t array_id, ValidationState_t& vstate) { return 0; } -// Returns true if the given variable has a BuiltIn decoration. -bool isBuiltInVar(uint32_t var_id, ValidationState_t& vstate) { - const auto& decorations = vstate.id_decorations(var_id); - return std::any_of(decorations.begin(), decorations.end(), - [](const Decoration& d) { - return spv::Decoration::BuiltIn == d.dec_type(); - }); -} - -// Returns true if the given structure type has any members with BuiltIn -// decoration. -bool isBuiltInStruct(uint32_t struct_id, ValidationState_t& vstate) { - const auto& decorations = vstate.id_decorations(struct_id); - return std::any_of( - decorations.begin(), decorations.end(), [](const Decoration& d) { - return spv::Decoration::BuiltIn == d.dec_type() && - Decoration::kInvalidMember != d.struct_member_index(); - }); -} - // Returns true if the given structure type has a Block decoration. bool isBlock(uint32_t struct_id, ValidationState_t& vstate) { const auto& decorations = vstate.id_decorations(struct_id); @@ -244,6 +224,7 @@ uint32_t getBaseAlignment(uint32_t member_id, bool roundUp, break; } case spv::Op::OpTypePointer: + case spv::Op::OpTypeUntypedPointerKHR: baseAlignment = vstate.pointer_size_and_alignment(); break; default: @@ -290,6 +271,7 @@ uint32_t getScalarAlignment(uint32_t type_id, ValidationState_t& vstate) { return max_member_alignment; } break; case spv::Op::OpTypePointer: + case spv::Op::OpTypeUntypedPointerKHR: return vstate.pointer_size_and_alignment(); default: assert(0); @@ -379,6 +361,7 @@ uint32_t getSize(uint32_t member_id, const LayoutConstraints& inherited, return offset + getSize(lastMember, constraint, constraints, vstate); } case spv::Op::OpTypePointer: + case spv::Op::OpTypeUntypedPointerKHR: return vstate.pointer_size_and_alignment(); default: assert(0); @@ -452,9 +435,9 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, return ds; }; - // If we are checking physical storage buffer pointers, we may not actually - // have a struct here. Instead, pretend we have a struct with a single member - // at offset 0. + // If we are checking the layout of untyped pointers or physical storage + // buffer pointers, we may not actually have a struct here. Instead, pretend + // we have a struct with a single member at offset 0. const auto& struct_type = vstate.FindDef(struct_id); std::vector members; if (struct_type->opcode() == spv::Op::OpTypeStruct) { @@ -471,8 +454,8 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, }; std::vector member_offsets; - // With physical storage buffers, we might be checking layouts that do not - // originate from a structure. + // With untyped pointers or physical storage buffers, we might be checking + // layouts that do not originate from a structure. if (struct_type->opcode() == spv::Op::OpTypeStruct) { member_offsets.reserve(members.size()); for (uint32_t memberIdx = 0, numMembers = uint32_t(members.size()); @@ -623,6 +606,14 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, seen[next_offset % 16] = true; } + } else if (spv::Op::OpTypeMatrix == element_inst->opcode()) { + // Matrix stride would be on the array element in the struct. + const auto stride = constraint.matrix_stride; + if (!IsAlignedTo(stride, alignment)) { + return fail(memberIdx) + << "is a matrix with stride " << stride + << " not satisfying alignment to " << alignment; + } } // Proceed to the element in case it is an array. @@ -675,7 +666,16 @@ bool checkForRequiredDecoration(uint32_t struct_id, spv::Op type, ValidationState_t& vstate) { const auto& members = getStructMembers(struct_id, vstate); for (size_t memberIdx = 0; memberIdx < members.size(); memberIdx++) { - const auto id = members[memberIdx]; + auto id = members[memberIdx]; + if (type == spv::Op::OpTypeMatrix) { + // Matrix decorations also apply to arrays of matrices. + auto memberInst = vstate.FindDef(id); + while (memberInst->opcode() == spv::Op::OpTypeArray || + memberInst->opcode() == spv::Op::OpTypeRuntimeArray) { + memberInst = vstate.FindDef(memberInst->GetOperandAs(1u)); + } + id = memberInst->id(); + } if (type != vstate.FindDef(id)->opcode()) continue; bool found = false; for (auto& dec : vstate.id_decorations(id)) { @@ -769,16 +769,23 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { int num_workgroup_variables_with_aliased = 0; for (const auto& desc : descs) { std::unordered_set seen_vars; + std::unordered_set input_var_builtin; + std::unordered_set output_var_builtin; for (auto interface : desc.interfaces) { Instruction* var_instr = vstate.FindDef(interface); - if (!var_instr || spv::Op::OpVariable != var_instr->opcode()) { + if (!var_instr || + (spv::Op::OpVariable != var_instr->opcode() && + spv::Op::OpUntypedVariableKHR != var_instr->opcode())) { return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) - << "Interfaces passed to OpEntryPoint must be of type " - "OpTypeVariable. Found Op" + << "Interfaces passed to OpEntryPoint must be variables. " + "Found Op" << spvOpcodeString(var_instr->opcode()) << "."; } + const bool untyped_pointers = + var_instr->opcode() == spv::Op::OpUntypedVariableKHR; + const auto sc_index = 2u; const spv::StorageClass storage_class = - var_instr->GetOperandAs(2); + var_instr->GetOperandAs(sc_index); if (vstate.version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { // Starting in 1.4, OpEntryPoint must list all global variables // it statically uses and those interfaces must be unique. @@ -805,45 +812,96 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { } } - const uint32_t ptr_id = var_instr->word(1); - Instruction* ptr_instr = vstate.FindDef(ptr_id); // It is guaranteed (by validator ID checks) that ptr_instr is // OpTypePointer. Word 3 of this instruction is the type being pointed - // to. - const uint32_t type_id = ptr_instr->word(3); + // to. For untyped variables, the pointee type comes from the data type + // operand. + const uint32_t type_id = + untyped_pointers ? var_instr->word(4) + : vstate.FindDef(var_instr->word(1))->word(3); Instruction* type_instr = vstate.FindDef(type_id); - if (type_instr && spv::Op::OpTypeStruct == type_instr->opcode() && - isBuiltInStruct(type_id, vstate)) { - if (!isBlock(type_id, vstate)) { - return vstate.diag(SPV_ERROR_INVALID_DATA, vstate.FindDef(type_id)) - << vstate.VkErrorID(4919) - << "Interface struct has no Block decoration but has " - "BuiltIn members. " - "Location decorations must be used on each member of " - "OpVariable with a structure type that is a block not " - "decorated with Location."; + const bool is_struct = + type_instr && spv::Op::OpTypeStruct == type_instr->opcode(); + + // Search all Built-in (on the variable or the struct) + bool has_built_in = false; + for (auto& dec : + vstate.id_decorations(is_struct ? type_id : interface)) { + if (dec.dec_type() != spv::Decoration::BuiltIn) continue; + has_built_in = true; + + if (!spvIsVulkanEnv(vstate.context()->target_env)) continue; + + const spv::BuiltIn builtin = dec.builtin(); + if (storage_class == spv::StorageClass::Input) { + if (!input_var_builtin.insert(builtin).second) { + return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) + << vstate.VkErrorID(9658) + << "OpEntryPoint contains duplicate input variables " + "with " + << vstate.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, (uint32_t)builtin) + << " builtin"; + } } - if (storage_class == spv::StorageClass::Input) - ++num_builtin_block_inputs; - if (storage_class == spv::StorageClass::Output) - ++num_builtin_block_outputs; - if (num_builtin_block_inputs > 1 || num_builtin_block_outputs > 1) - break; - if (auto error = CheckBuiltInVariable(interface, vstate)) - return error; - } else if (isBuiltInVar(interface, vstate)) { + if (storage_class == spv::StorageClass::Output) { + if (!output_var_builtin.insert(builtin).second) { + return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) + << vstate.VkErrorID(9659) + << "OpEntryPoint contains duplicate output variables " + "with " + << vstate.grammar().lookupOperandName( + SPV_OPERAND_TYPE_BUILT_IN, (uint32_t)builtin) + << " builtin"; + } + } + } + + if (has_built_in) { if (auto error = CheckBuiltInVariable(interface, vstate)) return error; + + if (is_struct) { + if (!isBlock(type_id, vstate)) { + return vstate.diag(SPV_ERROR_INVALID_DATA, + vstate.FindDef(type_id)) + << vstate.VkErrorID(4919) + << "Interface struct has no Block decoration but has " + "BuiltIn members. " + "Location decorations must be used on each member of " + "OpVariable with a structure type that is a block not " + "decorated with Location."; + } + if (storage_class == spv::StorageClass::Input) + ++num_builtin_block_inputs; + if (storage_class == spv::StorageClass::Output) + ++num_builtin_block_outputs; + if (num_builtin_block_inputs > 1 || num_builtin_block_outputs > 1) + break; + } } if (storage_class == spv::StorageClass::Workgroup) { ++num_workgroup_variables; - if (type_instr && spv::Op::OpTypeStruct == type_instr->opcode()) { - if (hasDecoration(type_id, spv::Decoration::Block, vstate)) - ++num_workgroup_variables_with_block; - if (hasDecoration(var_instr->id(), spv::Decoration::Aliased, - vstate)) - ++num_workgroup_variables_with_aliased; + if (type_instr) { + if (spv::Op::OpTypeStruct == type_instr->opcode()) { + if (hasDecoration(type_id, spv::Decoration::Block, vstate)) { + ++num_workgroup_variables_with_block; + } else if (untyped_pointers && + vstate.HasCapability(spv::Capability::Shader)) { + return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) + << "Untyped workgroup variables in shaders must be " + "block decorated"; + } + if (hasDecoration(var_instr->id(), spv::Decoration::Aliased, + vstate)) + ++num_workgroup_variables_with_aliased; + } else if (untyped_pointers && + vstate.HasCapability(spv::Capability::Shader)) { + return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) + << "Untyped workgroup variables in shaders must be block " + "decorated structs"; + } } } @@ -922,29 +980,44 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { } } - if (vstate.HasCapability( - spv::Capability::WorkgroupMemoryExplicitLayoutKHR) && + const bool workgroup_blocks_allowed = vstate.HasCapability( + spv::Capability::WorkgroupMemoryExplicitLayoutKHR); + if (workgroup_blocks_allowed && + !vstate.HasCapability(spv::Capability::UntypedPointersKHR) && num_workgroup_variables > 0 && num_workgroup_variables_with_block > 0) { if (num_workgroup_variables != num_workgroup_variables_with_block) { - return vstate.diag(SPV_ERROR_INVALID_BINARY, vstate.FindDef(entry_point)) + return vstate.diag(SPV_ERROR_INVALID_BINARY, + vstate.FindDef(entry_point)) << "When declaring WorkgroupMemoryExplicitLayoutKHR, " - "either all or none of the Workgroup Storage Class variables " + "either all or none of the Workgroup Storage Class " + "variables " "in the entry point interface must point to struct types " - "decorated with Block. Entry point id " + "decorated with Block (unless the " + "UntypedPointersKHR capability is declared). " + "Entry point id " << entry_point << " does not meet this requirement."; } if (num_workgroup_variables_with_block > 1 && num_workgroup_variables_with_block != num_workgroup_variables_with_aliased) { - return vstate.diag(SPV_ERROR_INVALID_BINARY, vstate.FindDef(entry_point)) + return vstate.diag(SPV_ERROR_INVALID_BINARY, + vstate.FindDef(entry_point)) << "When declaring WorkgroupMemoryExplicitLayoutKHR, " "if more than one Workgroup Storage Class variable in " "the entry point interface point to a type decorated " - "with Block, all of them must be decorated with Aliased. " - "Entry point id " + "with Block, all of them must be decorated with Aliased " + "(unless the UntypedPointerWorkgroupKHR capability is " + "declared). Entry point id " << entry_point << " does not meet this requirement."; } + } else if (!workgroup_blocks_allowed && + num_workgroup_variables_with_block > 0) { + return vstate.diag(SPV_ERROR_INVALID_BINARY, + vstate.FindDef(entry_point)) + << "Workgroup Storage Class variables can't be decorated with " + "Block unless declaring the WorkgroupMemoryExplicitLayoutKHR " + "capability."; } } } @@ -1041,11 +1114,17 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { const auto& words = inst.words(); auto type_id = inst.type_id(); const Instruction* type_inst = vstate.FindDef(type_id); - if (spv::Op::OpVariable == inst.opcode()) { + bool scalar_block_layout = false; + MemberConstraints constraints; + if (spv::Op::OpVariable == inst.opcode() || + spv::Op::OpUntypedVariableKHR == inst.opcode()) { + const bool untyped_pointer = + inst.opcode() == spv::Op::OpUntypedVariableKHR; const auto var_id = inst.id(); // For storage class / decoration combinations, see Vulkan 14.5.4 "Offset // and Stride Assignment". - const auto storageClass = inst.GetOperandAs(2); + const auto storageClassVal = words[3]; + const auto storageClass = spv::StorageClass(storageClassVal); const bool uniform = storageClass == spv::StorageClass::Uniform; const bool uniform_constant = storageClass == spv::StorageClass::UniformConstant; @@ -1124,20 +1203,24 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { if (uniform || push_constant || storage_buffer || phys_storage_buffer || workgroup) { const auto ptrInst = vstate.FindDef(words[1]); - assert(spv::Op::OpTypePointer == ptrInst->opcode()); - auto id = ptrInst->words()[3]; - auto id_inst = vstate.FindDef(id); - // Jump through one level of arraying. - if (!workgroup && (id_inst->opcode() == spv::Op::OpTypeArray || - id_inst->opcode() == spv::Op::OpTypeRuntimeArray)) { - id = id_inst->GetOperandAs(1u); - id_inst = vstate.FindDef(id); + assert(spv::Op::OpTypePointer == ptrInst->opcode() || + spv::Op::OpTypeUntypedPointerKHR == ptrInst->opcode()); + auto id = untyped_pointer ? (words.size() > 4 ? words[4] : 0) + : ptrInst->words()[3]; + if (id != 0) { + auto id_inst = vstate.FindDef(id); + // Jump through one level of arraying. + if (!workgroup && + (id_inst->opcode() == spv::Op::OpTypeArray || + id_inst->opcode() == spv::Op::OpTypeRuntimeArray)) { + id = id_inst->GetOperandAs(1u); + id_inst = vstate.FindDef(id); + } + // Struct requirement is checked on variables so just move on here. + if (spv::Op::OpTypeStruct != id_inst->opcode()) continue; + ComputeMemberConstraintsForStruct(&constraints, id, + LayoutConstraints(), vstate); } - // Struct requirement is checked on variables so just move on here. - if (spv::Op::OpTypeStruct != id_inst->opcode()) continue; - MemberConstraints constraints; - ComputeMemberConstraintsForStruct(&constraints, id, LayoutConstraints(), - vstate); // Prepare for messages const char* sc_str = uniform ? "Uniform" @@ -1207,88 +1290,91 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { } } - for (const auto& dec : vstate.id_decorations(id)) { - const bool blockDeco = spv::Decoration::Block == dec.dec_type(); - const bool bufferDeco = - spv::Decoration::BufferBlock == dec.dec_type(); - const bool blockRules = uniform && blockDeco; - const bool bufferRules = - (uniform && bufferDeco) || - ((push_constant || storage_buffer || - phys_storage_buffer || workgroup) && blockDeco); - if (uniform && blockDeco) { - vstate.RegisterPointerToUniformBlock(ptrInst->id()); - vstate.RegisterStructForUniformBlock(id); - } - if ((uniform && bufferDeco) || - ((storage_buffer || phys_storage_buffer) && blockDeco)) { - vstate.RegisterPointerToStorageBuffer(ptrInst->id()); - vstate.RegisterStructForStorageBuffer(id); - } - - if (blockRules || bufferRules) { - const char* deco_str = blockDeco ? "Block" : "BufferBlock"; - spv_result_t recursive_status = SPV_SUCCESS; - const bool scalar_block_layout = workgroup ? - vstate.options()->workgroup_scalar_block_layout : - vstate.options()->scalar_block_layout; - - if (isMissingOffsetInStruct(id, vstate)) { - return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) - << "Structure id " << id << " decorated as " << deco_str - << " must be explicitly laid out with Offset " - "decorations."; + if (id != 0) { + for (const auto& dec : vstate.id_decorations(id)) { + const bool blockDeco = spv::Decoration::Block == dec.dec_type(); + const bool bufferDeco = + spv::Decoration::BufferBlock == dec.dec_type(); + const bool blockRules = uniform && blockDeco; + const bool bufferRules = (uniform && bufferDeco) || + ((push_constant || storage_buffer || + phys_storage_buffer || workgroup) && + blockDeco); + if (uniform && blockDeco) { + vstate.RegisterPointerToUniformBlock(ptrInst->id()); + vstate.RegisterStructForUniformBlock(id); } - - if (!checkForRequiredDecoration( - id, - [](spv::Decoration d) { - return d == spv::Decoration::ArrayStride; - }, - spv::Op::OpTypeArray, vstate)) { - return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) - << "Structure id " << id << " decorated as " << deco_str - << " must be explicitly laid out with ArrayStride " - "decorations."; + if ((uniform && bufferDeco) || + ((storage_buffer || phys_storage_buffer) && blockDeco)) { + vstate.RegisterPointerToStorageBuffer(ptrInst->id()); + vstate.RegisterStructForStorageBuffer(id); } - if (!checkForRequiredDecoration( - id, - [](spv::Decoration d) { - return d == spv::Decoration::MatrixStride; - }, - spv::Op::OpTypeMatrix, vstate)) { - return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) - << "Structure id " << id << " decorated as " << deco_str - << " must be explicitly laid out with MatrixStride " - "decorations."; - } + if (blockRules || bufferRules) { + const char* deco_str = blockDeco ? "Block" : "BufferBlock"; + spv_result_t recursive_status = SPV_SUCCESS; + scalar_block_layout = + workgroup ? vstate.options()->workgroup_scalar_block_layout + : vstate.options()->scalar_block_layout; + + if (isMissingOffsetInStruct(id, vstate)) { + return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) + << "Structure id " << id << " decorated as " << deco_str + << " must be explicitly laid out with Offset " + "decorations."; + } - if (!checkForRequiredDecoration( - id, - [](spv::Decoration d) { - return d == spv::Decoration::RowMajor || - d == spv::Decoration::ColMajor; - }, - spv::Op::OpTypeMatrix, vstate)) { - return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) - << "Structure id " << id << " decorated as " << deco_str - << " must be explicitly laid out with RowMajor or " - "ColMajor decorations."; - } + if (!checkForRequiredDecoration( + id, + [](spv::Decoration d) { + return d == spv::Decoration::ArrayStride; + }, + spv::Op::OpTypeArray, vstate)) { + return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) + << "Structure id " << id << " decorated as " << deco_str + << " must be explicitly laid out with ArrayStride " + "decorations."; + } - if (spvIsVulkanEnv(vstate.context()->target_env)) { - if (blockRules && (SPV_SUCCESS != (recursive_status = checkLayout( - id, sc_str, deco_str, true, + if (!checkForRequiredDecoration( + id, + [](spv::Decoration d) { + return d == spv::Decoration::MatrixStride; + }, + spv::Op::OpTypeMatrix, vstate)) { + return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) + << "Structure id " << id << " decorated as " << deco_str + << " must be explicitly laid out with MatrixStride " + "decorations."; + } + + if (!checkForRequiredDecoration( + id, + [](spv::Decoration d) { + return d == spv::Decoration::RowMajor || + d == spv::Decoration::ColMajor; + }, + spv::Op::OpTypeMatrix, vstate)) { + return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) + << "Structure id " << id << " decorated as " << deco_str + << " must be explicitly laid out with RowMajor or " + "ColMajor decorations."; + } + + if (spvIsVulkanEnv(vstate.context()->target_env)) { + if (blockRules && + (SPV_SUCCESS != + (recursive_status = checkLayout(id, sc_str, deco_str, true, scalar_block_layout, 0, constraints, vstate)))) { - return recursive_status; - } else if (bufferRules && - (SPV_SUCCESS != - (recursive_status = checkLayout( - id, sc_str, deco_str, false, scalar_block_layout, - 0, constraints, vstate)))) { - return recursive_status; + return recursive_status; + } else if (bufferRules && + (SPV_SUCCESS != (recursive_status = checkLayout( + id, sc_str, deco_str, false, + scalar_block_layout, 0, + constraints, vstate)))) { + return recursive_status; + } } } } @@ -1297,20 +1383,98 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { } else if (type_inst && type_inst->opcode() == spv::Op::OpTypePointer && type_inst->GetOperandAs(1u) == spv::StorageClass::PhysicalStorageBuffer) { - const bool scalar_block_layout = vstate.options()->scalar_block_layout; - MemberConstraints constraints; const bool buffer = true; - const auto data_type_id = type_inst->GetOperandAs(2u); - const auto* data_type_inst = vstate.FindDef(data_type_id); + const auto pointee_type_id = type_inst->GetOperandAs(2u); + const auto* data_type_inst = vstate.FindDef(pointee_type_id); + scalar_block_layout = vstate.options()->scalar_block_layout; if (data_type_inst->opcode() == spv::Op::OpTypeStruct) { - ComputeMemberConstraintsForStruct(&constraints, data_type_id, + ComputeMemberConstraintsForStruct(&constraints, pointee_type_id, LayoutConstraints(), vstate); } - if (auto res = checkLayout(data_type_id, "PhysicalStorageBuffer", "Block", - !buffer, scalar_block_layout, 0, constraints, - vstate)) { + if (auto res = checkLayout(pointee_type_id, "PhysicalStorageBuffer", + "Block", !buffer, scalar_block_layout, 0, + constraints, vstate)) { return res; } + } else if (vstate.HasCapability(spv::Capability::UntypedPointersKHR) && + spvIsVulkanEnv(vstate.context()->target_env)) { + // Untyped variables are checked above. Here we check that instructions + // using an untyped pointer have a valid layout. + uint32_t ptr_ty_id = 0; + uint32_t data_type_id = 0; + switch (inst.opcode()) { + case spv::Op::OpUntypedAccessChainKHR: + case spv::Op::OpUntypedInBoundsAccessChainKHR: + case spv::Op::OpUntypedPtrAccessChainKHR: + case spv::Op::OpUntypedInBoundsPtrAccessChainKHR: + ptr_ty_id = inst.type_id(); + data_type_id = inst.GetOperandAs(2); + break; + case spv::Op::OpLoad: + if (vstate.GetIdOpcode(vstate.GetOperandTypeId(&inst, 2)) == + spv::Op::OpTypeUntypedPointerKHR) { + const auto ptr_id = inst.GetOperandAs(2); + ptr_ty_id = vstate.FindDef(ptr_id)->type_id(); + data_type_id = inst.type_id(); + } + break; + case spv::Op::OpStore: + if (vstate.GetIdOpcode(vstate.GetOperandTypeId(&inst, 0)) == + spv::Op::OpTypeUntypedPointerKHR) { + const auto ptr_id = inst.GetOperandAs(0); + ptr_ty_id = vstate.FindDef(ptr_id)->type_id(); + data_type_id = vstate.GetOperandTypeId(&inst, 1); + } + break; + case spv::Op::OpUntypedArrayLengthKHR: + ptr_ty_id = vstate.FindDef(inst.GetOperandAs(3))->type_id(); + data_type_id = inst.GetOperandAs(2); + break; + default: + break; + } + + if (ptr_ty_id == 0 || data_type_id == 0) { + // Not an untyped pointer. + continue; + } + + const auto sc = + vstate.FindDef(ptr_ty_id)->GetOperandAs(1); + + const char* sc_str = + sc == spv::StorageClass::Uniform + ? "Uniform" + : (sc == spv::StorageClass::PushConstant + ? "PushConstant" + : (sc == spv::StorageClass::Workgroup ? "Workgroup" + : "StorageBuffer")); + + const auto data_type = vstate.FindDef(data_type_id); + scalar_block_layout = + sc == spv::StorageClass::Workgroup + ? vstate.options()->workgroup_scalar_block_layout + : vstate.options()->scalar_block_layout; + // Assume uniform storage class uses block rules unless we see a + // BufferBlock decorated struct in the data type. + bool bufferRules = sc == spv::StorageClass::Uniform ? false : true; + if (data_type->opcode() == spv::Op::OpTypeStruct) { + if (sc == spv::StorageClass::Uniform) { + bufferRules = + vstate.HasDecoration(data_type_id, spv::Decoration::BufferBlock); + } + ComputeMemberConstraintsForStruct(&constraints, data_type_id, + LayoutConstraints(), vstate); + } + const char* deco_str = + bufferRules + ? (sc == spv::StorageClass::Uniform ? "BufferBlock" : "Block") + : "Block"; + if (auto result = + checkLayout(data_type_id, sc_str, deco_str, !bufferRules, + scalar_block_layout, 0, constraints, vstate)) { + return result; + } } } return SPV_SUCCESS; @@ -1318,21 +1482,14 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { // Returns true if |decoration| cannot be applied to the same id more than once. bool AtMostOncePerId(spv::Decoration decoration) { - return decoration == spv::Decoration::ArrayStride; + return decoration != spv::Decoration::UserSemantic && + decoration != spv::Decoration::FuncParamAttr; } // Returns true if |decoration| cannot be applied to the same member more than // once. bool AtMostOncePerMember(spv::Decoration decoration) { - switch (decoration) { - case spv::Decoration::Offset: - case spv::Decoration::MatrixStride: - case spv::Decoration::RowMajor: - case spv::Decoration::ColMajor: - return true; - default: - return false; - } + return decoration != spv::Decoration::UserSemantic; } spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) { @@ -1549,23 +1706,29 @@ spv_result_t CheckNonWritableDecoration(ValidationState_t& vstate, const auto opcode = inst.opcode(); const auto type_id = inst.type_id(); if (opcode != spv::Op::OpVariable && - opcode != spv::Op::OpFunctionParameter) { + opcode != spv::Op::OpUntypedVariableKHR && + opcode != spv::Op::OpFunctionParameter && + opcode != spv::Op::OpRawAccessChainNV) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << "Target of NonWritable decoration must be a memory object " "declaration (a variable or a function parameter)"; } - const auto var_storage_class = opcode == spv::Op::OpVariable - ? inst.GetOperandAs(2) - : spv::StorageClass::Max; + const auto var_storage_class = + opcode == spv::Op::OpVariable + ? inst.GetOperandAs(2) + : opcode == spv::Op::OpUntypedVariableKHR + ? inst.GetOperandAs(3) + : spv::StorageClass::Max; if ((var_storage_class == spv::StorageClass::Function || var_storage_class == spv::StorageClass::Private) && vstate.features().nonwritable_var_in_function_or_private) { // New permitted feature in SPIR-V 1.4. } else if ( - // It may point to a UBO, SSBO, or storage image. + // It may point to a UBO, SSBO, storage image, or raw access chain. vstate.IsPointerToUniformBlock(type_id) || vstate.IsPointerToStorageBuffer(type_id) || - vstate.IsPointerToStorageImage(type_id)) { + vstate.IsPointerToStorageImage(type_id) || + opcode == spv::Op::OpRawAccessChainNV) { } else { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << "Target of NonWritable decoration is invalid: must point to a " @@ -1646,6 +1809,7 @@ spv_result_t CheckIntegerWrapDecoration(ValidationState_t& vstate, case spv::Op::OpSNegate: return SPV_SUCCESS; case spv::Op::OpExtInst: + case spv::Op::OpExtInstWithForwardRefsKHR: // TODO(dneto): Only certain extended instructions allow these // decorations. For now allow anything. return SPV_SUCCESS; @@ -1712,7 +1876,7 @@ spv_result_t CheckComponentDecoration(ValidationState_t& vstate, if (spvIsVulkanEnv(vstate.context()->target_env)) { // Strip the array, if present. - if (vstate.GetIdOpcode(type_id) == spv::Op::OpTypeArray) { + while (vstate.GetIdOpcode(type_id) == spv::Op::OpTypeArray) { type_id = vstate.FindDef(type_id)->word(2u); } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp index 90cf6645..1a473ba8 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp @@ -60,12 +60,14 @@ spv_result_t DerivativesPass(ValidationState_t& _, const Instruction* inst) { ->RegisterExecutionModelLimitation([opcode](spv::ExecutionModel model, std::string* message) { if (model != spv::ExecutionModel::Fragment && - model != spv::ExecutionModel::GLCompute) { + model != spv::ExecutionModel::GLCompute && + model != spv::ExecutionModel::MeshEXT && + model != spv::ExecutionModel::TaskEXT) { if (message) { *message = std::string( - "Derivative instructions require Fragment or GLCompute " - "execution model: ") + + "Derivative instructions require Fragment, GLCompute, " + "MeshEXT or TaskEXT execution model: ") + spvOpcodeString(opcode); } return false; @@ -79,19 +81,23 @@ spv_result_t DerivativesPass(ValidationState_t& _, const Instruction* inst) { const auto* models = state.GetExecutionModels(entry_point->id()); const auto* modes = state.GetExecutionModes(entry_point->id()); if (models && - models->find(spv::ExecutionModel::GLCompute) != models->end() && + (models->find(spv::ExecutionModel::GLCompute) != + models->end() || + models->find(spv::ExecutionModel::MeshEXT) != models->end() || + models->find(spv::ExecutionModel::TaskEXT) != models->end()) && (!modes || - (modes->find(spv::ExecutionMode::DerivativeGroupLinearNV) == + (modes->find(spv::ExecutionMode::DerivativeGroupLinearKHR) == modes->end() && - modes->find(spv::ExecutionMode::DerivativeGroupQuadsNV) == + modes->find(spv::ExecutionMode::DerivativeGroupQuadsKHR) == modes->end()))) { if (message) { - *message = std::string( - "Derivative instructions require " - "DerivativeGroupQuadsNV " - "or DerivativeGroupLinearNV execution mode for " - "GLCompute execution model: ") + - spvOpcodeString(opcode); + *message = + std::string( + "Derivative instructions require " + "DerivativeGroupQuadsKHR " + "or DerivativeGroupLinearKHR execution mode for " + "GLCompute, MeshEXT or TaskEXT execution model: ") + + spvOpcodeString(opcode); } return false; } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_extensions.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_extensions.cpp index 0ac62bfc..74974a4f 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_extensions.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_extensions.cpp @@ -147,7 +147,7 @@ bool DoesDebugInfoOperandMatchExpectation( const Instruction* inst, uint32_t word_index) { if (inst->words().size() <= word_index) return false; auto* debug_inst = _.FindDef(inst->word(word_index)); - if (debug_inst->opcode() != spv::Op::OpExtInst || + if (!spvIsExtendedInstruction(debug_inst->opcode()) || (debug_inst->ext_inst_type() != SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 && debug_inst->ext_inst_type() != SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) || @@ -165,7 +165,7 @@ bool DoesDebugInfoOperandMatchExpectation( const Instruction* inst, uint32_t word_index) { if (inst->words().size() <= word_index) return false; auto* debug_inst = _.FindDef(inst->word(word_index)); - if (debug_inst->opcode() != spv::Op::OpExtInst || + if (!spvIsExtendedInstruction(debug_inst->opcode()) || (debug_inst->ext_inst_type() != SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) || !expectation( @@ -409,7 +409,7 @@ spv_result_t ValidateClspvReflectionArgumentInfo(ValidationState_t& _, spv_result_t ValidateKernelDecl(ValidationState_t& _, const Instruction* inst) { const auto decl_id = inst->GetOperandAs(4); const auto decl = _.FindDef(decl_id); - if (!decl || decl->opcode() != spv::Op::OpExtInst) { + if (!decl || !spvIsExtendedInstruction(decl->opcode())) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Kernel must be a Kernel extended instruction"; } @@ -432,7 +432,7 @@ spv_result_t ValidateKernelDecl(ValidationState_t& _, const Instruction* inst) { spv_result_t ValidateArgInfo(ValidationState_t& _, const Instruction* inst, uint32_t info_index) { auto info = _.FindDef(inst->GetOperandAs(info_index)); - if (!info || info->opcode() != spv::Op::OpExtInst) { + if (!info || !spvIsExtendedInstruction(info->opcode())) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "ArgInfo must be an ArgumentInfo extended instruction"; } @@ -482,8 +482,8 @@ spv_result_t ValidateClspvReflectionArgumentBuffer(ValidationState_t& _, return SPV_SUCCESS; } -spv_result_t ValidateClspvReflectionArgumentOffsetBuffer(ValidationState_t& _, - const Instruction* inst) { +spv_result_t ValidateClspvReflectionArgumentOffsetBuffer( + ValidationState_t& _, const Instruction* inst) { const auto num_operands = inst->operands().size(); if (auto error = ValidateKernelDecl(_, inst)) { return error; @@ -802,7 +802,7 @@ spv_result_t ValidateClspvReflectionPushConstantData(ValidationState_t& _, } spv_result_t ValidateClspvReflectionPrintfInfo(ValidationState_t& _, - const Instruction* inst) { + const Instruction* inst) { if (!IsUint32Constant(_, inst->GetOperandAs(4))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "PrintfID must be a 32-bit unsigned integer OpConstant"; @@ -823,8 +823,8 @@ spv_result_t ValidateClspvReflectionPrintfInfo(ValidationState_t& _, return SPV_SUCCESS; } -spv_result_t ValidateClspvReflectionPrintfStorageBuffer(ValidationState_t& _, - const Instruction* inst) { +spv_result_t ValidateClspvReflectionPrintfStorageBuffer( + ValidationState_t& _, const Instruction* inst) { if (!IsUint32Constant(_, inst->GetOperandAs(4))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "DescriptorSet must be a 32-bit unsigned integer OpConstant"; @@ -843,8 +843,8 @@ spv_result_t ValidateClspvReflectionPrintfStorageBuffer(ValidationState_t& _, return SPV_SUCCESS; } -spv_result_t ValidateClspvReflectionPrintfPushConstant(ValidationState_t& _, - const Instruction* inst) { +spv_result_t ValidateClspvReflectionPrintfPushConstant( + ValidationState_t& _, const Instruction* inst) { if (!IsUint32Constant(_, inst->GetOperandAs(4))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Offset must be a 32-bit unsigned integer OpConstant"; @@ -1980,7 +1980,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { "CrossWorkgroup, Workgroup or Function"; } - if (result_type != p_data_type) { + if (!_.ContainsUntypedPointer(p_type) && result_type != p_data_type) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected data type of the pointer to be equal to Result " @@ -2042,15 +2042,17 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { "CrossWorkgroup, Workgroup or Function"; } - if (!_.IsIntScalarOrVectorType(p_data_type) || - _.GetBitWidth(p_data_type) != 32) { + if ((!_.IsIntScalarOrVectorType(p_data_type) || + _.GetBitWidth(p_data_type) != 32) && + !_.ContainsUntypedPointer(p_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected data type of the pointer to be a 32-bit int " "scalar or vector type"; } - if (_.GetDimension(p_data_type) != num_components) { + if (!_.ContainsUntypedPointer(p_type) && + _.GetDimension(p_data_type) != num_components) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected data type of the pointer to have the same number " @@ -2701,8 +2703,9 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { "Generic, CrossWorkgroup, Workgroup or Function"; } - if (!_.IsFloatScalarType(p_data_type) || - _.GetBitWidth(p_data_type) != 16) { + if ((!_.IsFloatScalarType(p_data_type) || + _.GetBitWidth(p_data_type) != 16) && + !_.ContainsUntypedPointer(p_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand P data type to be 16-bit float scalar"; @@ -2763,8 +2766,9 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { "Generic, CrossWorkgroup, Workgroup or Function"; } - if (!_.IsFloatScalarType(p_data_type) || - _.GetBitWidth(p_data_type) != 16) { + if ((!_.IsFloatScalarType(p_data_type) || + _.GetBitWidth(p_data_type) != 16) && + !_.ContainsUntypedPointer(p_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand P data type to be 16-bit float scalar"; @@ -2855,8 +2859,9 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { "CrossWorkgroup, Workgroup or Function"; } - if (!_.IsFloatScalarType(p_data_type) || - _.GetBitWidth(p_data_type) != 16) { + if ((!_.IsFloatScalarType(p_data_type) || + _.GetBitWidth(p_data_type) != 16) && + !_.ContainsUntypedPointer(p_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand P data type to be 16-bit float scalar"; @@ -2962,14 +2967,41 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand Format to be a pointer"; } - if (format_storage_class != spv::StorageClass::UniformConstant) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << ext_inst_name() << ": " - << "expected Format storage class to be UniformConstant"; + if (_.HasExtension( + Extension::kSPV_EXT_relaxed_printf_string_address_space)) { + if (format_storage_class != spv::StorageClass::UniformConstant && + // Extension SPV_EXT_relaxed_printf_string_address_space allows + // format strings in Global, Local, Private and Generic address + // spaces + + // Global + format_storage_class != spv::StorageClass::CrossWorkgroup && + // Local + format_storage_class != spv::StorageClass::Workgroup && + // Private + format_storage_class != spv::StorageClass::Function && + // Generic + format_storage_class != spv::StorageClass::Generic) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": " + << "expected Format storage class to be UniformConstant, " + "Crossworkgroup, Workgroup, Function, or Generic"; + } + } else { + if (format_storage_class != spv::StorageClass::UniformConstant) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << ext_inst_name() << ": " + << "expected Format storage class to be UniformConstant"; + } } - if (!_.IsIntScalarType(format_data_type) || - _.GetBitWidth(format_data_type) != 8) { + // If pointer points to an array, get the type of an element + if (_.IsIntArrayType(format_data_type)) + format_data_type = _.GetComponentType(format_data_type); + + if ((!_.IsIntScalarType(format_data_type) || + _.GetBitWidth(format_data_type) != 8) && + !_.ContainsUntypedPointer(format_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected Format data type to be 8-bit int"; @@ -3100,7 +3132,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { uint32_t vector_count = inst->word(6); uint64_t const_val; - if (!_.GetConstantValUint64(vector_count, &const_val)) { + if (!_.EvalConstantValUint64(vector_count, &const_val)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": Vector Count must be 32-bit integer OpConstant"; @@ -3168,16 +3200,16 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } case CommonDebugInfoDebugTypePointer: { - auto validate_base_type = - ValidateOperandBaseType(_, inst, 5, ext_inst_name); + auto validate_base_type = ValidateOperandDebugType( + _, "Base Type", inst, 5, ext_inst_name, false); if (validate_base_type != SPV_SUCCESS) return validate_base_type; CHECK_CONST_UINT_OPERAND("Storage Class", 6); CHECK_CONST_UINT_OPERAND("Flags", 7); break; } case CommonDebugInfoDebugTypeQualifier: { - auto validate_base_type = - ValidateOperandBaseType(_, inst, 5, ext_inst_name); + auto validate_base_type = ValidateOperandDebugType( + _, "Base Type", inst, 5, ext_inst_name, false); if (validate_base_type != SPV_SUCCESS) return validate_base_type; CHECK_CONST_UINT_OPERAND("Type Qualifier", 6); break; @@ -3191,7 +3223,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { uint32_t component_count = inst->word(6); if (vulkanDebugInfo) { uint64_t const_val; - if (!_.GetConstantValUint64(component_count, &const_val)) { + if (!_.EvalConstantValUint64(component_count, &const_val)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": Component Count must be 32-bit integer OpConstant"; @@ -3706,7 +3738,7 @@ spv_result_t ExtensionPass(ValidationState_t& _, const Instruction* inst) { const spv::Op opcode = inst->opcode(); if (opcode == spv::Op::OpExtension) return ValidateExtension(_, inst); if (opcode == spv::Op::OpExtInstImport) return ValidateExtInstImport(_, inst); - if (opcode == spv::Op::OpExtInst) return ValidateExtInst(_, inst); + if (spvIsExtendedInstruction(opcode)) return ValidateExtInst(_, inst); return SPV_SUCCESS; } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_function.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_function.cpp index 639817fe..26b36682 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_function.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_function.cpp @@ -156,7 +156,9 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _, param_nonarray_type_id = _.FindDef(param_nonarray_type_id)->GetOperandAs(1u); } - if (_.GetIdOpcode(param_nonarray_type_id) == spv::Op::OpTypePointer) { + if (_.GetIdOpcode(param_nonarray_type_id) == spv::Op::OpTypePointer || + _.GetIdOpcode(param_nonarray_type_id) == + spv::Op::OpTypeUntypedPointerKHR) { auto param_nonarray_type = _.FindDef(param_nonarray_type_id); if (param_nonarray_type->GetOperandAs(1u) == spv::StorageClass::PhysicalStorageBuffer) { @@ -185,7 +187,7 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _, << ": can't specify both Aliased and Restrict for " "PhysicalStorageBuffer pointer."; } - } else { + } else if (param_nonarray_type->opcode() == spv::Op::OpTypePointer) { const auto pointee_type_id = param_nonarray_type->GetOperandAs(2); const auto pointee_type = _.FindDef(pointee_type_id); @@ -288,7 +290,8 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _, } if (_.addressing_model() == spv::AddressingModel::Logical) { - if (parameter_type->opcode() == spv::Op::OpTypePointer && + if ((parameter_type->opcode() == spv::Op::OpTypePointer || + parameter_type->opcode() == spv::Op::OpTypeUntypedPointerKHR) && !_.options()->relax_logical_pointer) { spv::StorageClass sc = parameter_type->GetOperandAs(1u); @@ -317,9 +320,11 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _, // Validate memory object declaration requirements. if (argument->opcode() != spv::Op::OpVariable && + argument->opcode() != spv::Op::OpUntypedVariableKHR && argument->opcode() != spv::Op::OpFunctionParameter) { - const bool ssbo_vptr = _.features().variable_pointers && - sc == spv::StorageClass::StorageBuffer; + const bool ssbo_vptr = + _.HasCapability(spv::Capability::VariablePointersStorageBuffer) && + sc == spv::StorageClass::StorageBuffer; const bool wg_vptr = _.HasCapability(spv::Capability::VariablePointers) && sc == spv::StorageClass::Workgroup; diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_id.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_id.cpp index bcfeb591..0d1e8412 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_id.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_id.cpp @@ -120,15 +120,16 @@ spv_result_t CheckIdDefinitionDominateUse(ValidationState_t& _) { // instruction operand's ID can be forward referenced. spv_result_t IdPass(ValidationState_t& _, Instruction* inst) { auto can_have_forward_declared_ids = - inst->opcode() == spv::Op::OpExtInst && + spvIsExtendedInstruction(inst->opcode()) && spvExtInstIsDebugInfo(inst->ext_inst_type()) ? spvDbgInfoExtOperandCanBeForwardDeclaredFunction( - inst->ext_inst_type(), inst->word(4)) + inst->opcode(), inst->ext_inst_type(), inst->word(4)) : spvOperandCanBeForwardDeclaredFunction(inst->opcode()); // Keep track of a result id defined by this instruction. 0 means it // does not define an id. uint32_t result_id = 0; + bool has_forward_declared_ids = false; for (unsigned i = 0; i < inst->operands().size(); i++) { const spv_parsed_operand_t& operand = inst->operand(i); @@ -164,6 +165,8 @@ spv_result_t IdPass(ValidationState_t& _, Instruction* inst) { !spvOpcodeIsDecoration(opcode) && opcode != spv::Op::OpFunction && opcode != spv::Op::OpCooperativeMatrixLengthNV && opcode != spv::Op::OpCooperativeMatrixLengthKHR && + !spvOpcodeGeneratesUntypedPointer(opcode) && + opcode != spv::Op::OpUntypedArrayLengthKHR && !(opcode == spv::Op::OpSpecConstantOp && (spv::Op(inst->word(3)) == spv::Op::OpCooperativeMatrixLengthNV || @@ -177,12 +180,15 @@ spv_result_t IdPass(ValidationState_t& _, Instruction* inst) { !inst->IsNonSemantic() && !spvOpcodeIsDecoration(opcode) && !spvOpcodeIsBranch(opcode) && opcode != spv::Op::OpPhi && opcode != spv::Op::OpExtInst && + opcode != spv::Op::OpExtInstWithForwardRefsKHR && opcode != spv::Op::OpExtInstImport && opcode != spv::Op::OpSelectionMerge && opcode != spv::Op::OpLoopMerge && opcode != spv::Op::OpFunction && opcode != spv::Op::OpCooperativeMatrixLengthNV && opcode != spv::Op::OpCooperativeMatrixLengthKHR && + !spvOpcodeGeneratesUntypedPointer(opcode) && + opcode != spv::Op::OpUntypedArrayLengthKHR && !(opcode == spv::Op::OpSpecConstantOp && (spv::Op(inst->word(3)) == spv::Op::OpCooperativeMatrixLengthNV || @@ -200,6 +206,7 @@ spv_result_t IdPass(ValidationState_t& _, Instruction* inst) { ret = SPV_SUCCESS; } } else if (can_have_forward_declared_ids(i)) { + has_forward_declared_ids = true; if (spvOpcodeGeneratesType(inst->opcode()) && !_.IsForwardPointer(operand_word)) { ret = _.diag(SPV_ERROR_INVALID_ID, inst) @@ -229,12 +236,35 @@ spv_result_t IdPass(ValidationState_t& _, Instruction* inst) { << " has not been defined"; } break; + case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: + // Ideally, this check would live in validate_extensions.cpp. But since + // forward references are only allowed on non-semantic instructions, and + // ID validation is done first, we would fail with a "ID had not been + // defined" error before we could give a more helpful message. For this + // reason, this test is done here, so we can be more helpful to the + // user. + if (inst->opcode() == spv::Op::OpExtInstWithForwardRefsKHR && + !inst->IsNonSemantic()) + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "OpExtInstWithForwardRefsKHR is only allowed with " + "non-semantic instructions."; + ret = SPV_SUCCESS; + break; default: ret = SPV_SUCCESS; break; } if (SPV_SUCCESS != ret) return ret; } + const bool must_have_forward_declared_ids = + inst->opcode() == spv::Op::OpExtInstWithForwardRefsKHR; + if (must_have_forward_declared_ids && !has_forward_declared_ids) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Opcode OpExtInstWithForwardRefsKHR must have at least one " + "forward " + "declared ID."; + } + if (result_id) _.RemoveIfForwardDeclared(result_id); return SPV_SUCCESS; diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_image.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_image.cpp index 7c8dfee7..04100dd7 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_image.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_image.cpp @@ -495,7 +495,7 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, } uint64_t array_size = 0; - if (!_.GetConstantValUint64(type_inst->word(3), &array_size)) { + if (!_.EvalConstantValUint64(type_inst->word(3), &array_size)) { assert(0 && "Array type definition is corrupt"); } @@ -693,16 +693,11 @@ spv_result_t ValidateImageReadWrite(ValidationState_t& _, << "storage image"; } - if (info.multisampled == 1 && + if (info.multisampled == 1 && info.arrayed == 1 && info.sampled == 2 && !_.HasCapability(spv::Capability::ImageMSArray)) { -#if 0 - // TODO(atgoo@github.com) The description of this rule in the spec - // is unclear and Glslang doesn't declare ImageMSArray. Need to clarify - // and reenable. return _.diag(SPV_ERROR_INVALID_DATA, inst) - << "Capability ImageMSArray is required to access storage " - << "image"; -#endif + << "Capability ImageMSArray is required to access storage " + << "image"; } } else if (info.sampled != 0) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -919,7 +914,15 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { if (info.dim == spv::Dim::SubpassData && info.arrayed != 0) { return _.diag(SPV_ERROR_INVALID_DATA, inst) - << _.VkErrorID(6214) << "Dim SubpassData requires Arrayed to be 0"; + << _.VkErrorID(6214) + << "Dim SubpassData requires Arrayed to be 0 in the Vulkan " + "environment"; + } + + if (info.dim == spv::Dim::Rect) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << _.VkErrorID(9638) + << "Dim must not be Rect in the Vulkan environment"; } } @@ -987,6 +990,10 @@ bool IsAllowedSampledImageOperand(spv::Op opcode, ValidationState_t& _) { case spv::Op::OpImageBoxFilterQCOM: case spv::Op::OpImageBlockMatchSSDQCOM: case spv::Op::OpImageBlockMatchSADQCOM: + case spv::Op::OpImageBlockMatchWindowSADQCOM: + case spv::Op::OpImageBlockMatchWindowSSDQCOM: + case spv::Op::OpImageBlockMatchGatherSADQCOM: + case spv::Op::OpImageBlockMatchGatherSSDQCOM: return true; case spv::Op::OpStore: if (_.HasCapability(spv::Capability::BindlessTextureNV)) return true; @@ -998,7 +1005,8 @@ bool IsAllowedSampledImageOperand(spv::Op opcode, ValidationState_t& _) { spv_result_t ValidateSampledImage(ValidationState_t& _, const Instruction* inst) { - if (_.GetIdOpcode(inst->type_id()) != spv::Op::OpTypeSampledImage) { + auto type_inst = _.FindDef(inst->type_id()); + if (type_inst->opcode() != spv::Op::OpTypeSampledImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be OpTypeSampledImage."; } @@ -1015,8 +1023,25 @@ spv_result_t ValidateSampledImage(ValidationState_t& _, << "Corrupt image type definition"; } - // TODO(atgoo@github.com) Check compatibility of result type and received - // image. + // Image operands must match except for depth. + auto sampled_image_id = type_inst->GetOperandAs(1); + if (sampled_image_id != image_type) { + ImageTypeInfo sampled_info; + if (!GetImageTypeInfo(_, sampled_image_id, &sampled_info)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Corrupt image type definition"; + } + if (info.sampled_type != sampled_info.sampled_type || + info.dim != sampled_info.dim || info.arrayed != sampled_info.arrayed || + info.multisampled != sampled_info.multisampled || + info.sampled != sampled_info.sampled || + info.format != sampled_info.format || + info.access_qualifier != sampled_info.access_qualifier) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Image operands must match result image operands except for " + "depth"; + } + } if (spvIsVulkanEnv(_.context()->target_env)) { if (info.sampled != 1) { @@ -1108,25 +1133,33 @@ spv_result_t ValidateSampledImage(ValidationState_t& _, spv_result_t ValidateImageTexelPointer(ValidationState_t& _, const Instruction* inst) { const auto result_type = _.FindDef(inst->type_id()); - if (result_type->opcode() != spv::Op::OpTypePointer) { + if (result_type->opcode() != spv::Op::OpTypePointer && + result_type->opcode() != spv::Op::OpTypeUntypedPointerKHR) { return _.diag(SPV_ERROR_INVALID_DATA, inst) - << "Expected Result Type to be OpTypePointer"; + << "Expected Result Type to be a pointer"; } const auto storage_class = result_type->GetOperandAs(1); if (storage_class != spv::StorageClass::Image) { return _.diag(SPV_ERROR_INVALID_DATA, inst) - << "Expected Result Type to be OpTypePointer whose Storage Class " + << "Expected Result Type to be a pointer whose Storage Class " "operand is Image"; } - const auto ptr_type = result_type->GetOperandAs(2); - const auto ptr_opcode = _.GetIdOpcode(ptr_type); - if (ptr_opcode != spv::Op::OpTypeInt && ptr_opcode != spv::Op::OpTypeFloat && - ptr_opcode != spv::Op::OpTypeVoid) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << "Expected Result Type to be OpTypePointer whose Type operand " - "must be a scalar numerical type or OpTypeVoid"; + uint32_t ptr_type = 0; + if (result_type->opcode() == spv::Op::OpTypePointer) { + ptr_type = result_type->GetOperandAs(2); + const auto ptr_opcode = _.GetIdOpcode(ptr_type); + if (ptr_opcode != spv::Op::OpTypeInt && + ptr_opcode != spv::Op::OpTypeFloat && + ptr_opcode != spv::Op::OpTypeVoid && + !(ptr_opcode == spv::Op::OpTypeVector && + _.HasCapability(spv::Capability::AtomicFloat16VectorNV) && + _.IsFloat16Vector2Or4Type(ptr_type))) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Expected Result Type to be a pointer whose Type operand " + "must be a scalar numerical type or OpTypeVoid"; + } } const auto image_ptr = _.FindDef(_.GetOperandTypeId(inst, 2)); @@ -1147,7 +1180,15 @@ spv_result_t ValidateImageTexelPointer(ValidationState_t& _, << "Corrupt image type definition"; } - if (info.sampled_type != ptr_type) { + if (result_type->opcode() == spv::Op::OpTypePointer && + info.sampled_type != ptr_type && + !(_.HasCapability(spv::Capability::AtomicFloat16VectorNV) && + _.IsFloat16Vector2Or4Type(ptr_type) && + _.GetIdOpcode(info.sampled_type) == spv::Op::OpTypeFloat && + ((_.GetDimension(ptr_type) == 2 && + info.format == spv::ImageFormat::Rg16f) || + (_.GetDimension(ptr_type) == 4 && + info.format == spv::ImageFormat::Rgba16f)))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image 'Sampled Type' to be the same as the Type " "pointed to by Result Type"; @@ -1205,7 +1246,7 @@ spv_result_t ValidateImageTexelPointer(ValidationState_t& _, if (info.multisampled == 0) { uint64_t ms = 0; - if (!_.GetConstantValUint64(inst->GetOperandAs(4), &ms) || + if (!_.EvalConstantValUint64(inst->GetOperandAs(4), &ms) || ms != 0) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Sample for Image with MS 0 to be a valid for " @@ -1218,7 +1259,10 @@ spv_result_t ValidateImageTexelPointer(ValidationState_t& _, (info.format != spv::ImageFormat::R64ui) && (info.format != spv::ImageFormat::R32f) && (info.format != spv::ImageFormat::R32i) && - (info.format != spv::ImageFormat::R32ui)) { + (info.format != spv::ImageFormat::R32ui) && + !((info.format == spv::ImageFormat::Rg16f || + info.format == spv::ImageFormat::Rgba16f) && + _.HasCapability(spv::Capability::AtomicFloat16VectorNV))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4658) << "Expected the Image Format in Image to be R64i, R64ui, R32f, " @@ -1982,11 +2026,13 @@ spv_result_t ValidateImageQueryLod(ValidationState_t& _, ->RegisterExecutionModelLimitation( [&](spv::ExecutionModel model, std::string* message) { if (model != spv::ExecutionModel::Fragment && - model != spv::ExecutionModel::GLCompute) { + model != spv::ExecutionModel::GLCompute && + model != spv::ExecutionModel::MeshEXT && + model != spv::ExecutionModel::TaskEXT) { if (message) { *message = std::string( - "OpImageQueryLod requires Fragment or GLCompute execution " - "model"); + "OpImageQueryLod requires Fragment, GLCompute, MeshEXT or " + "TaskEXT execution model"); } return false; } @@ -1998,16 +2044,20 @@ spv_result_t ValidateImageQueryLod(ValidationState_t& _, std::string* message) { const auto* models = state.GetExecutionModels(entry_point->id()); const auto* modes = state.GetExecutionModes(entry_point->id()); - if (models->find(spv::ExecutionModel::GLCompute) != models->end() && - modes->find(spv::ExecutionMode::DerivativeGroupLinearNV) == - modes->end() && - modes->find(spv::ExecutionMode::DerivativeGroupQuadsNV) == - modes->end()) { + if (models && + (models->find(spv::ExecutionModel::GLCompute) != models->end() || + models->find(spv::ExecutionModel::MeshEXT) != models->end() || + models->find(spv::ExecutionModel::TaskEXT) != models->end()) && + (!modes || + (modes->find(spv::ExecutionMode::DerivativeGroupLinearKHR) == + modes->end() && + modes->find(spv::ExecutionMode::DerivativeGroupQuadsKHR) == + modes->end()))) { if (message) { *message = std::string( - "OpImageQueryLod requires DerivativeGroupQuadsNV " - "or DerivativeGroupLinearNV execution mode for GLCompute " - "execution model"); + "OpImageQueryLod requires DerivativeGroupQuadsKHR " + "or DerivativeGroupLinearKHR execution mode for GLCompute, " + "MeshEXT or TaskEXT execution model"); } return false; } @@ -2149,7 +2199,8 @@ spv_result_t ValidateImageProcessingQCOMDecoration(ValidationState_t& _, int id, spv::Decoration decor) { const Instruction* si_inst = nullptr; const Instruction* ld_inst = _.FindDef(id); - if (ld_inst->opcode() == spv::Op::OpSampledImage) { + bool is_intf_obj = (ld_inst->opcode() == spv::Op::OpSampledImage); + if (is_intf_obj == true) { si_inst = ld_inst; int t_idx = si_inst->GetOperandAs(2); // texture ld_inst = _.FindDef(t_idx); @@ -2160,7 +2211,57 @@ spv_result_t ValidateImageProcessingQCOMDecoration(ValidationState_t& _, int id, int texture_id = ld_inst->GetOperandAs(2); // variable to load if (!_.HasDecoration(texture_id, decor)) { return _.diag(SPV_ERROR_INVALID_DATA, ld_inst) - << "Missing decoration WeightTextureQCOM/BlockMatchTextureQCOM"; + << "Missing decoration " << _.SpvDecorationString(decor); + } + + return SPV_SUCCESS; +} + +spv_result_t ValidateImageProcessing2QCOMWindowDecoration(ValidationState_t& _, + int id) { + const Instruction* ld_inst = _.FindDef(id); + bool is_intf_obj = (ld_inst->opcode() != spv::Op::OpSampledImage); + if (is_intf_obj == true) { + if (ld_inst->opcode() != spv::Op::OpLoad) { + return _.diag(SPV_ERROR_INVALID_DATA, ld_inst) << "Expect to see OpLoad"; + } + int texture_id = ld_inst->GetOperandAs(2); // variable to load + spv::Decoration decor = spv::Decoration::BlockMatchTextureQCOM; + if (!_.HasDecoration(texture_id, decor)) { + return _.diag(SPV_ERROR_INVALID_DATA, ld_inst) + << "Missing decoration " << _.SpvDecorationString(decor); + } + decor = spv::Decoration::BlockMatchSamplerQCOM; + if (!_.HasDecoration(texture_id, decor)) { + return _.diag(SPV_ERROR_INVALID_DATA, ld_inst) + << "Missing decoration " << _.SpvDecorationString(decor); + } + } else { + const Instruction* si_inst = ld_inst; + int t_idx = si_inst->GetOperandAs(2); // texture + const Instruction* t_ld_inst = _.FindDef(t_idx); + if (t_ld_inst->opcode() != spv::Op::OpLoad) { + return _.diag(SPV_ERROR_INVALID_DATA, t_ld_inst) + << "Expect to see OpLoad"; + } + int texture_id = t_ld_inst->GetOperandAs(2); // variable to load + spv::Decoration decor = spv::Decoration::BlockMatchTextureQCOM; + if (!_.HasDecoration(texture_id, decor)) { + return _.diag(SPV_ERROR_INVALID_DATA, ld_inst) + << "Missing decoration " << _.SpvDecorationString(decor); + } + int s_idx = si_inst->GetOperandAs(3); // sampler + const Instruction* s_ld_inst = _.FindDef(s_idx); + if (s_ld_inst->opcode() != spv::Op::OpLoad) { + return _.diag(SPV_ERROR_INVALID_DATA, s_ld_inst) + << "Expect to see OpLoad"; + } + int sampler_id = s_ld_inst->GetOperandAs(2); // variable to load + decor = spv::Decoration::BlockMatchSamplerQCOM; + if (!_.HasDecoration(sampler_id, decor)) { + return _.diag(SPV_ERROR_INVALID_DATA, ld_inst) + << "Missing decoration " << _.SpvDecorationString(decor); + } } return SPV_SUCCESS; @@ -2188,6 +2289,26 @@ spv_result_t ValidateImageProcessingQCOM(ValidationState_t& _, _, ref_idx, spv::Decoration::BlockMatchTextureQCOM); break; } + case spv::Op::OpImageBlockMatchWindowSSDQCOM: + case spv::Op::OpImageBlockMatchWindowSADQCOM: { + int tgt_idx = inst->GetOperandAs(2); // target + res = ValidateImageProcessing2QCOMWindowDecoration(_, tgt_idx); + if (res != SPV_SUCCESS) break; + int ref_idx = inst->GetOperandAs(4); // reference + res = ValidateImageProcessing2QCOMWindowDecoration(_, ref_idx); + break; + } + case spv::Op::OpImageBlockMatchGatherSSDQCOM: + case spv::Op::OpImageBlockMatchGatherSADQCOM: { + int tgt_idx = inst->GetOperandAs(2); // target + res = ValidateImageProcessingQCOMDecoration( + _, tgt_idx, spv::Decoration::BlockMatchTextureQCOM); + if (res != SPV_SUCCESS) break; + int ref_idx = inst->GetOperandAs(4); // reference + res = ValidateImageProcessingQCOMDecoration( + _, ref_idx, spv::Decoration::BlockMatchTextureQCOM); + break; + } default: break; } @@ -2205,12 +2326,14 @@ spv_result_t ImagePass(ValidationState_t& _, const Instruction* inst) { ->RegisterExecutionModelLimitation([opcode](spv::ExecutionModel model, std::string* message) { if (model != spv::ExecutionModel::Fragment && - model != spv::ExecutionModel::GLCompute) { + model != spv::ExecutionModel::GLCompute && + model != spv::ExecutionModel::MeshEXT && + model != spv::ExecutionModel::TaskEXT) { if (message) { *message = std::string( - "ImplicitLod instructions require Fragment or GLCompute " - "execution model: ") + + "ImplicitLod instructions require Fragment, GLCompute, " + "MeshEXT or TaskEXT execution model: ") + spvOpcodeString(opcode); } return false; @@ -2224,19 +2347,22 @@ spv_result_t ImagePass(ValidationState_t& _, const Instruction* inst) { const auto* models = state.GetExecutionModels(entry_point->id()); const auto* modes = state.GetExecutionModes(entry_point->id()); if (models && - models->find(spv::ExecutionModel::GLCompute) != models->end() && + (models->find(spv::ExecutionModel::GLCompute) != models->end() || + models->find(spv::ExecutionModel::MeshEXT) != models->end() || + models->find(spv::ExecutionModel::TaskEXT) != models->end()) && (!modes || - (modes->find(spv::ExecutionMode::DerivativeGroupLinearNV) == + (modes->find(spv::ExecutionMode::DerivativeGroupLinearKHR) == modes->end() && - modes->find(spv::ExecutionMode::DerivativeGroupQuadsNV) == + modes->find(spv::ExecutionMode::DerivativeGroupQuadsKHR) == modes->end()))) { if (message) { - *message = - std::string( - "ImplicitLod instructions require DerivativeGroupQuadsNV " - "or DerivativeGroupLinearNV execution mode for GLCompute " - "execution model: ") + - spvOpcodeString(opcode); + *message = std::string( + "ImplicitLod instructions require " + "DerivativeGroupQuadsKHR " + "or DerivativeGroupLinearKHR execution mode for " + "GLCompute, " + "MeshEXT or TaskEXT execution model: ") + + spvOpcodeString(opcode); } return false; } @@ -2318,6 +2444,10 @@ spv_result_t ImagePass(ValidationState_t& _, const Instruction* inst) { case spv::Op::OpImageBoxFilterQCOM: case spv::Op::OpImageBlockMatchSSDQCOM: case spv::Op::OpImageBlockMatchSADQCOM: + case spv::Op::OpImageBlockMatchWindowSADQCOM: + case spv::Op::OpImageBlockMatchWindowSSDQCOM: + case spv::Op::OpImageBlockMatchGatherSADQCOM: + case spv::Op::OpImageBlockMatchGatherSSDQCOM: return ValidateImageProcessingQCOM(_, inst); default: @@ -2370,6 +2500,10 @@ bool IsImageInstruction(const spv::Op opcode) { case spv::Op::OpImageBoxFilterQCOM: case spv::Op::OpImageBlockMatchSSDQCOM: case spv::Op::OpImageBlockMatchSADQCOM: + case spv::Op::OpImageBlockMatchWindowSADQCOM: + case spv::Op::OpImageBlockMatchWindowSSDQCOM: + case spv::Op::OpImageBlockMatchGatherSADQCOM: + case spv::Op::OpImageBlockMatchGatherSSDQCOM: return true; default: break; @@ -2388,6 +2522,11 @@ spv_result_t ValidateQCOMImageProcessingTextureUsages(ValidationState_t& _, case spv::Op::OpImageBlockMatchSSDQCOM: case spv::Op::OpImageBlockMatchSADQCOM: break; + case spv::Op::OpImageBlockMatchWindowSADQCOM: + case spv::Op::OpImageBlockMatchWindowSSDQCOM: + case spv::Op::OpImageBlockMatchGatherSADQCOM: + case spv::Op::OpImageBlockMatchGatherSSDQCOM: + break; default: for (size_t i = 0; i < inst->operands().size(); ++i) { int id = inst->GetOperandAs(i); diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_instruction.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_instruction.cpp index 8710ffa4..5bc4d2ce 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_instruction.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_instruction.cpp @@ -470,7 +470,8 @@ spv_result_t InstructionPass(ValidationState_t& _, const Instruction* inst) { } _.set_addressing_model(inst->GetOperandAs(0)); _.set_memory_model(inst->GetOperandAs(1)); - } else if (opcode == spv::Op::OpExecutionMode) { + } else if (opcode == spv::Op::OpExecutionMode || + opcode == spv::Op::OpExecutionModeId) { const uint32_t entry_point = inst->word(1); _.RegisterExecutionModeForEntryPoint(entry_point, spv::ExecutionMode(inst->word(2))); diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_interfaces.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_interfaces.cpp index 291b4b82..8b96dc82 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_interfaces.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_interfaces.cpp @@ -34,11 +34,13 @@ const uint32_t kMaxLocations = 4096 * 4; bool is_interface_variable(const Instruction* inst, bool is_spv_1_4) { if (is_spv_1_4) { // Starting in SPIR-V 1.4, all global variables are interface variables. - return inst->opcode() == spv::Op::OpVariable && + return (inst->opcode() == spv::Op::OpVariable || + inst->opcode() == spv::Op::OpUntypedVariableKHR) && inst->GetOperandAs(2u) != spv::StorageClass::Function; } else { - return inst->opcode() == spv::Op::OpVariable && + return (inst->opcode() == spv::Op::OpVariable || + inst->opcode() == spv::Op::OpUntypedVariableKHR) && (inst->GetOperandAs(2u) == spv::StorageClass::Input || inst->GetOperandAs(2u) == @@ -242,8 +244,9 @@ spv_result_t GetLocationsForVariable( std::unordered_set* output_index1_locations) { const bool is_fragment = entry_point->GetOperandAs(0) == spv::ExecutionModel::Fragment; - const bool is_output = - variable->GetOperandAs(2) == spv::StorageClass::Output; + const auto sc_index = 2u; + const bool is_output = variable->GetOperandAs(sc_index) == + spv::StorageClass::Output; auto ptr_type_id = variable->GetOperandAs(0); auto ptr_type = _.FindDef(ptr_type_id); auto type_id = ptr_type->GetOperandAs(2); @@ -254,37 +257,24 @@ spv_result_t GetLocationsForVariable( // equal. Also track Patch and PerTaskNV decorations. bool has_location = false; uint32_t location = 0; - bool has_component = false; uint32_t component = 0; bool has_index = false; uint32_t index = 0; bool has_patch = false; bool has_per_task_nv = false; bool has_per_vertex_khr = false; + // Duplicate Location, Component, Index are checked elsewhere. for (auto& dec : _.id_decorations(variable->id())) { if (dec.dec_type() == spv::Decoration::Location) { - if (has_location && dec.params()[0] != location) { - return _.diag(SPV_ERROR_INVALID_DATA, variable) - << "Variable has conflicting location decorations"; - } has_location = true; location = dec.params()[0]; } else if (dec.dec_type() == spv::Decoration::Component) { - if (has_component && dec.params()[0] != component) { - return _.diag(SPV_ERROR_INVALID_DATA, variable) - << "Variable has conflicting component decorations"; - } - has_component = true; component = dec.params()[0]; } else if (dec.dec_type() == spv::Decoration::Index) { if (!is_output || !is_fragment) { return _.diag(SPV_ERROR_INVALID_DATA, variable) << "Index can only be applied to Fragment output variables"; } - if (has_index && dec.params()[0] != index) { - return _.diag(SPV_ERROR_INVALID_DATA, variable) - << "Variable has conflicting index decorations"; - } has_index = true; index = dec.params()[0]; } else if (dec.dec_type() == spv::Decoration::BuiltIn) { @@ -532,11 +522,15 @@ spv_result_t ValidateLocations(ValidationState_t& _, std::unordered_set input_locations; std::unordered_set output_locations_index0; std::unordered_set output_locations_index1; + std::unordered_set patch_locations_index0; + std::unordered_set patch_locations_index1; std::unordered_set seen; for (uint32_t i = 3; i < entry_point->operands().size(); ++i) { auto interface_id = entry_point->GetOperandAs(i); auto interface_var = _.FindDef(interface_id); - auto storage_class = interface_var->GetOperandAs(2); + const auto sc_index = 2u; + auto storage_class = + interface_var->GetOperandAs(sc_index); if (storage_class != spv::StorageClass::Input && storage_class != spv::StorageClass::Output) { continue; @@ -547,6 +541,26 @@ spv_result_t ValidateLocations(ValidationState_t& _, continue; } + // The two Tessellation stages have a "Patch" variable that interface with + // the Location mechanism, but are not suppose to be tied to the "normal" + // input/output Location. + // TODO - SPIR-V allows the Patch decoration to be applied to struct + // members, but is not allowed in GLSL/HLSL + bool has_patch = false; + for (auto& dec : _.id_decorations(interface_var->id())) { + if (dec.dec_type() == spv::Decoration::Patch) { + has_patch = true; + if (auto error = GetLocationsForVariable(_, entry_point, interface_var, + &patch_locations_index0, + &patch_locations_index1)) + return error; + break; + } + } + if (has_patch) { + continue; + } + auto locations = (storage_class == spv::StorageClass::Input) ? &input_locations : &output_locations_index0; @@ -558,6 +572,64 @@ spv_result_t ValidateLocations(ValidationState_t& _, return SPV_SUCCESS; } +spv_result_t ValidateStorageClass(ValidationState_t& _, + const Instruction* entry_point) { + bool has_push_constant = false; + bool has_ray_payload = false; + bool has_hit_attribute = false; + bool has_callable_data = false; + for (uint32_t i = 3; i < entry_point->operands().size(); ++i) { + auto interface_id = entry_point->GetOperandAs(i); + auto interface_var = _.FindDef(interface_id); + auto storage_class = interface_var->GetOperandAs(2); + switch (storage_class) { + case spv::StorageClass::PushConstant: { + if (has_push_constant) { + return _.diag(SPV_ERROR_INVALID_DATA, entry_point) + << _.VkErrorID(6673) + << "Entry-point has more than one variable with the " + "PushConstant storage class in the interface"; + } + has_push_constant = true; + break; + } + case spv::StorageClass::IncomingRayPayloadKHR: { + if (has_ray_payload) { + return _.diag(SPV_ERROR_INVALID_DATA, entry_point) + << _.VkErrorID(4700) + << "Entry-point has more than one variable with the " + "IncomingRayPayloadKHR storage class in the interface"; + } + has_ray_payload = true; + break; + } + case spv::StorageClass::HitAttributeKHR: { + if (has_hit_attribute) { + return _.diag(SPV_ERROR_INVALID_DATA, entry_point) + << _.VkErrorID(4702) + << "Entry-point has more than one variable with the " + "HitAttributeKHR storage class in the interface"; + } + has_hit_attribute = true; + break; + } + case spv::StorageClass::IncomingCallableDataKHR: { + if (has_callable_data) { + return _.diag(SPV_ERROR_INVALID_DATA, entry_point) + << _.VkErrorID(4706) + << "Entry-point has more than one variable with the " + "IncomingCallableDataKHR storage class in the interface"; + } + has_callable_data = true; + break; + } + default: + break; + } + } + return SPV_SUCCESS; +} + } // namespace spv_result_t ValidateInterfaces(ValidationState_t& _) { @@ -576,6 +648,9 @@ spv_result_t ValidateInterfaces(ValidationState_t& _) { if (auto error = ValidateLocations(_, &inst)) { return error; } + if (auto error = ValidateStorageClass(_, &inst)) { + return error; + } } if (inst.opcode() == spv::Op::OpTypeVoid) break; } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_layout.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_layout.cpp index dbc1f1e5..05a86751 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_layout.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_layout.cpp @@ -35,6 +35,7 @@ spv_result_t ModuleScopedInstructions(ValidationState_t& _, const Instruction* inst, spv::Op opcode) { switch (opcode) { case spv::Op::OpExtInst: + case spv::Op::OpExtInstWithForwardRefsKHR: if (spvExtInstIsDebugInfo(inst->ext_inst_type())) { const uint32_t ext_inst_index = inst->word(4); bool local_debug_info = false; @@ -243,6 +244,7 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, break; case spv::Op::OpExtInst: + case spv::Op::OpExtInstWithForwardRefsKHR: if (spvExtInstIsDebugInfo(inst->ext_inst_type())) { const uint32_t ext_inst_index = inst->word(4); bool local_debug_info = false; diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_logicals.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_logicals.cpp index 4479e439..8a2e5d8c 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_logicals.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_logicals.cpp @@ -159,9 +159,11 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { const spv::Op type_opcode = type_inst->opcode(); switch (type_opcode) { + case spv::Op::OpTypeUntypedPointerKHR: case spv::Op::OpTypePointer: { if (_.addressing_model() == spv::AddressingModel::Logical && - !_.features().variable_pointers) + !_.HasCapability( + spv::Capability::VariablePointersStorageBuffer)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Using pointers with OpSelect requires capability " << "VariablePointers or VariablePointersStorageBuffer"; diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_memory.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_memory.cpp index 5b25eeb3..830c3ea1 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_memory.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_memory.cpp @@ -349,7 +349,8 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst, if (mask & uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR)) { if (inst->opcode() == spv::Op::OpStore || - inst->opcode() == spv::Op::OpCooperativeMatrixStoreNV) { + inst->opcode() == spv::Op::OpCooperativeMatrixStoreNV || + inst->opcode() == spv::Op::OpCooperativeMatrixStoreKHR) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "MakePointerVisibleKHR cannot be used with OpStore."; } @@ -406,42 +407,80 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst, } spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { + const bool untyped_pointer = inst->opcode() == spv::Op::OpUntypedVariableKHR; + auto result_type = _.FindDef(inst->type_id()); - if (!result_type || result_type->opcode() != spv::Op::OpTypePointer) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "OpVariable Result Type " << _.getIdName(inst->type_id()) - << " is not a pointer type."; + if (untyped_pointer) { + if (!result_type || + result_type->opcode() != spv::Op::OpTypeUntypedPointerKHR) + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Result type must be an untyped pointer"; + } else { + if (!result_type || result_type->opcode() != spv::Op::OpTypePointer) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "OpVariable Result Type " << _.getIdName(inst->type_id()) + << " is not a pointer type."; + } + } + + const auto storage_class_index = 2u; + auto storage_class = + inst->GetOperandAs(storage_class_index); + uint32_t value_id = 0; + if (untyped_pointer) { + const auto has_data_type = 3u < inst->operands().size(); + if (has_data_type) { + value_id = inst->GetOperandAs(3u); + auto data_type = _.FindDef(value_id); + if (!data_type || !spvOpcodeGeneratesType(data_type->opcode())) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Data type must be a type instruction"; + } + } else { + if (storage_class == spv::StorageClass::Function || + storage_class == spv::StorageClass::Private || + storage_class == spv::StorageClass::Workgroup) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Data type must be specified for Function, Private, and " + "Workgroup storage classes"; + } + if (spvIsVulkanEnv(_.context()->target_env)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Vulkan requires that data type be specified"; + } + } } - const auto type_index = 2; - const auto value_id = result_type->GetOperandAs(type_index); - auto value_type = _.FindDef(value_id); + // For OpVariable the data type comes from pointee type of the result type, + // while for OpUntypedVariableKHR the data type comes from the operand. + if (!untyped_pointer) { + value_id = result_type->GetOperandAs(2); + } + auto value_type = value_id == 0 ? nullptr : _.FindDef(value_id); - const auto initializer_index = 3; - const auto storage_class_index = 2; + const auto initializer_index = untyped_pointer ? 4u : 3u; if (initializer_index < inst->operands().size()) { const auto initializer_id = inst->GetOperandAs(initializer_index); const auto initializer = _.FindDef(initializer_id); const auto is_module_scope_var = - initializer && (initializer->opcode() == spv::Op::OpVariable) && + initializer && + (initializer->opcode() == spv::Op::OpVariable || + initializer->opcode() == spv::Op::OpUntypedVariableKHR) && (initializer->GetOperandAs(storage_class_index) != spv::StorageClass::Function); const auto is_constant = initializer && spvOpcodeIsConstant(initializer->opcode()); if (!initializer || !(is_constant || is_module_scope_var)) { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "OpVariable Initializer " << _.getIdName(initializer_id) + << "Variable Initializer " << _.getIdName(initializer_id) << " is not a constant or module-scope variable."; } if (initializer->type_id() != value_id) { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "Initializer type must match the type pointed to by the Result " - "Type"; + << "Initializer type must match the data type"; } } - auto storage_class = - inst->GetOperandAs(storage_class_index); if (storage_class != spv::StorageClass::Workgroup && storage_class != spv::StorageClass::CrossWorkgroup && storage_class != spv::StorageClass::Private && @@ -465,7 +504,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } } } - if (!builtin && + if (!builtin && value_type && ContainsInvalidBool(_, value_type, storage_input_or_output)) { if (storage_input_or_output) { return _.diag(SPV_ERROR_INVALID_ID, inst) @@ -494,7 +533,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { if (storage_class == spv::StorageClass::Generic) { return _.diag(SPV_ERROR_INVALID_BINARY, inst) - << "OpVariable storage class cannot be Generic"; + << "Variable storage class cannot be Generic"; } if (inst->function() && storage_class != spv::StorageClass::Function) { @@ -516,17 +555,17 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { result_type->GetOperandAs(result_storage_class_index); if (storage_class != result_storage_class) { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "From SPIR-V spec, section 3.32.8 on OpVariable:\n" - << "Its Storage Class operand must be the same as the Storage Class " - << "operand of the result type."; + << "Storage class must match result type storage class"; } // Variable pointer related restrictions. - const auto pointee = _.FindDef(result_type->word(3)); + const auto pointee = untyped_pointer + ? value_id == 0 ? nullptr : _.FindDef(value_id) + : _.FindDef(result_type->word(3)); if (_.addressing_model() == spv::AddressingModel::Logical && !_.options()->relax_logical_pointer) { // VariablePointersStorageBuffer is implied by VariablePointers. - if (pointee->opcode() == spv::Op::OpTypePointer) { + if (pointee && pointee->opcode() == spv::Op::OpTypePointer) { if (!_.HasCapability(spv::Capability::VariablePointersStorageBuffer)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "In Logical addressing, variables may not allocate a pointer " @@ -545,7 +584,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { // Vulkan Push Constant Interface section: Check type of PushConstant // variables. if (storage_class == spv::StorageClass::PushConstant) { - if (pointee->opcode() != spv::Op::OpTypeStruct) { + if (pointee && pointee->opcode() != spv::Op::OpTypeStruct) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(6808) << "PushConstant OpVariable " << _.getIdName(inst->id()) << " has illegal type.\n" @@ -557,11 +596,11 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { // Vulkan Descriptor Set Interface: Check type of UniformConstant and // Uniform variables. if (storage_class == spv::StorageClass::UniformConstant) { - if (!IsAllowedTypeOrArrayOfSame( - _, pointee, - {spv::Op::OpTypeImage, spv::Op::OpTypeSampler, - spv::Op::OpTypeSampledImage, - spv::Op::OpTypeAccelerationStructureKHR})) { + if (pointee && !IsAllowedTypeOrArrayOfSame( + _, pointee, + {spv::Op::OpTypeImage, spv::Op::OpTypeSampler, + spv::Op::OpTypeSampledImage, + spv::Op::OpTypeAccelerationStructureKHR})) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4655) << "UniformConstant OpVariable " << _.getIdName(inst->id()) << " has illegal type.\n" @@ -574,7 +613,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } if (storage_class == spv::StorageClass::Uniform) { - if (!IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) { + if (pointee && + !IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(6807) << "Uniform OpVariable " << _.getIdName(inst->id()) << " has illegal type.\n" @@ -587,7 +627,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } if (storage_class == spv::StorageClass::StorageBuffer) { - if (!IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) { + if (pointee && + !IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(6807) << "StorageBuffer OpVariable " << _.getIdName(inst->id()) << " has illegal type.\n" @@ -620,11 +661,17 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } } } + } - // Initializers in Vulkan are only allowed in some storage clases - if (inst->operands().size() > 3) { + // Vulkan Appendix A: Check that if contains initializer, then + // storage class is Output, Private, or Function. + if (inst->operands().size() > initializer_index && + storage_class != spv::StorageClass::Output && + storage_class != spv::StorageClass::Private && + storage_class != spv::StorageClass::Function) { + if (spvIsVulkanEnv(_.context()->target_env)) { if (storage_class == spv::StorageClass::Workgroup) { - auto init_id = inst->GetOperandAs(3); + auto init_id = inst->GetOperandAs(initializer_index); auto init = _.FindDef(init_id); if (init->opcode() != spv::Op::OpConstantNull) { return _.diag(SPV_ERROR_INVALID_ID, inst) @@ -651,7 +698,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } } - if (inst->operands().size() > 3) { + if (initializer_index < inst->operands().size()) { if (storage_class == spv::StorageClass::TaskPayloadWorkgroupEXT) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpVariable, " << _.getIdName(inst->id()) @@ -675,10 +722,10 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } auto pointee_base = pointee; - while (pointee_base->opcode() == spv::Op::OpTypeArray) { + while (pointee_base && pointee_base->opcode() == spv::Op::OpTypeArray) { pointee_base = _.FindDef(pointee_base->GetOperandAs(1u)); } - if (pointee_base->opcode() == spv::Op::OpTypePointer) { + if (pointee_base && pointee_base->opcode() == spv::Op::OpTypePointer) { if (pointee_base->GetOperandAs(1u) == spv::StorageClass::PhysicalStorageBuffer) { // check for AliasedPointer/RestrictPointer @@ -768,7 +815,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { // Cooperative matrix types can only be allocated in Function or Private if ((storage_class != spv::StorageClass::Function && storage_class != spv::StorageClass::Private) && - ContainsCooperativeMatrix(_, pointee)) { + pointee && ContainsCooperativeMatrix(_, pointee)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Cooperative matrix types (or types containing them) can only be " "allocated " @@ -784,7 +831,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { (!_.HasCapability(spv::Capability::Float16) && _.ContainsSizedIntOrFloatType(value_id, spv::Op::OpTypeFloat, 16))) { auto underlying_type = value_type; - while (underlying_type->opcode() == spv::Op::OpTypePointer) { + while (underlying_type && + underlying_type->opcode() == spv::Op::OpTypePointer) { storage_class = underlying_type->GetOperandAs(1u); underlying_type = _.FindDef(underlying_type->GetOperandAs(2u)); @@ -800,7 +848,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } break; case spv::StorageClass::Uniform: - if (!_.HasCapability( + if (underlying_type && + !_.HasCapability( spv::Capability::UniformAndStorageBuffer16BitAccess)) { if (underlying_type->opcode() == spv::Op::OpTypeArray || underlying_type->opcode() == spv::Op::OpTypeRuntimeArray) { @@ -848,7 +897,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { if (!_.HasCapability(spv::Capability::Int8) && _.ContainsSizedIntOrFloatType(value_id, spv::Op::OpTypeInt, 8)) { auto underlying_type = value_type; - while (underlying_type->opcode() == spv::Op::OpTypePointer) { + while (underlying_type && + underlying_type->opcode() == spv::Op::OpTypePointer) { storage_class = underlying_type->GetOperandAs(1u); underlying_type = _.FindDef(underlying_type->GetOperandAs(2u)); @@ -864,7 +914,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } break; case spv::StorageClass::Uniform: - if (!_.HasCapability( + if (underlying_type && + !_.HasCapability( spv::Capability::UniformAndStorageBuffer8BitAccess)) { if (underlying_type->opcode() == spv::Op::OpTypeArray || underlying_type->opcode() == spv::Op::OpTypeRuntimeArray) { @@ -929,21 +980,23 @@ spv_result_t ValidateLoad(ValidationState_t& _, const Instruction* inst) { } const auto pointer_type = _.FindDef(pointer->type_id()); - if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) { + if (!pointer_type || + (pointer_type->opcode() != spv::Op::OpTypePointer && + pointer_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpLoad type for pointer " << _.getIdName(pointer_id) << " is not a pointer type."; } - uint32_t pointee_data_type; - spv::StorageClass storage_class; - if (!_.GetPointerTypeInfo(pointer_type->id(), &pointee_data_type, - &storage_class) || - result_type->id() != pointee_data_type) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "OpLoad Result Type " << _.getIdName(inst->type_id()) - << " does not match Pointer " << _.getIdName(pointer->id()) - << "s type."; + if (pointer_type->opcode() == spv::Op::OpTypePointer) { + const auto pointee_type = + _.FindDef(pointer_type->GetOperandAs(2)); + if (!pointee_type || result_type->id() != pointee_type->id()) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "OpLoad Result Type " << _.getIdName(inst->type_id()) + << " does not match Pointer " << _.getIdName(pointer->id()) + << "s type."; + } } if (!_.options()->before_hlsl_legalization && @@ -986,17 +1039,23 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { << " is not a logical pointer."; } const auto pointer_type = _.FindDef(pointer->type_id()); - if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) { + if (!pointer_type || + (pointer_type->opcode() != spv::Op::OpTypePointer && + pointer_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpStore type for pointer " << _.getIdName(pointer_id) << " is not a pointer type."; } - const auto type_id = pointer_type->GetOperandAs(2); - const auto type = _.FindDef(type_id); - if (!type || spv::Op::OpTypeVoid == type->opcode()) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "OpStore Pointer " << _.getIdName(pointer_id) - << "s type is void."; + + Instruction* type = nullptr; + if (pointer_type->opcode() == spv::Op::OpTypePointer) { + const auto type_id = pointer_type->GetOperandAs(2); + type = _.FindDef(type_id); + if (!type || spv::Op::OpTypeVoid == type->opcode()) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "OpStore Pointer " << _.getIdName(pointer_id) + << "s type is void."; + } } // validate storage class @@ -1073,7 +1132,7 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { << "s type is void."; } - if (type->id() != object_type->id()) { + if (type && (type->id() != object_type->id())) { if (!_.options()->relax_struct_store || type->opcode() != spv::Op::OpTypeStruct || object_type->opcode() != spv::Op::OpTypeStruct) { @@ -1106,6 +1165,23 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { } } + if (spvIsVulkanEnv(_.context()->target_env) && + !_.options()->before_hlsl_legalization) { + const auto isForbiddenType = [](const Instruction* type_inst) { + auto opcode = type_inst->opcode(); + return opcode == spv::Op::OpTypeImage || + opcode == spv::Op::OpTypeSampler || + opcode == spv::Op::OpTypeSampledImage || + opcode == spv::Op::OpTypeAccelerationStructureKHR; + }; + if (_.ContainsType(object_type->id(), isForbiddenType)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << _.VkErrorID(6924) + << "Cannot store to OpTypeImage, OpTypeSampler, " + "OpTypeSampledImage, or OpTypeAccelerationStructureKHR objects"; + } + } + return SPV_SUCCESS; } @@ -1178,7 +1254,8 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { const auto target_pointer_type = _.FindDef(target->type_id()); if (!target_pointer_type || - target_pointer_type->opcode() != spv::Op::OpTypePointer) { + (target_pointer_type->opcode() != spv::Op::OpTypePointer && + target_pointer_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Target operand " << _.getIdName(target_id) << " is not a pointer."; @@ -1186,35 +1263,52 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { const auto source_pointer_type = _.FindDef(source->type_id()); if (!source_pointer_type || - source_pointer_type->opcode() != spv::Op::OpTypePointer) { + (source_pointer_type->opcode() != spv::Op::OpTypePointer && + source_pointer_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Source operand " << _.getIdName(source_id) << " is not a pointer."; } if (inst->opcode() == spv::Op::OpCopyMemory) { - const auto target_type = - _.FindDef(target_pointer_type->GetOperandAs(2)); - if (!target_type || target_type->opcode() == spv::Op::OpTypeVoid) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "Target operand " << _.getIdName(target_id) - << " cannot be a void pointer."; + const bool target_typed = + target_pointer_type->opcode() == spv::Op::OpTypePointer; + const bool source_typed = + source_pointer_type->opcode() == spv::Op::OpTypePointer; + Instruction* target_type = nullptr; + Instruction* source_type = nullptr; + if (target_typed) { + target_type = _.FindDef(target_pointer_type->GetOperandAs(2)); + + if (!target_type || target_type->opcode() == spv::Op::OpTypeVoid) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Target operand " << _.getIdName(target_id) + << " cannot be a void pointer."; + } } - const auto source_type = - _.FindDef(source_pointer_type->GetOperandAs(2)); - if (!source_type || source_type->opcode() == spv::Op::OpTypeVoid) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "Source operand " << _.getIdName(source_id) - << " cannot be a void pointer."; + if (source_typed) { + source_type = _.FindDef(source_pointer_type->GetOperandAs(2)); + if (!source_type || source_type->opcode() == spv::Op::OpTypeVoid) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Source operand " << _.getIdName(source_id) + << " cannot be a void pointer."; + } } - if (target_type->id() != source_type->id()) { + if (target_type && source_type && target_type->id() != source_type->id()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Target " << _.getIdName(source_id) << "s type does not match Source " << _.getIdName(source_type->id()) << "s type."; } + + if (!target_type && !source_type) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "One of Source or Target must be a typed pointer"; + } + + if (auto error = CheckMemoryAccess(_, inst, 2)) return error; } else { const auto size_id = inst->GetOperandAs(2); const auto size = _.FindDef(size_id); @@ -1230,7 +1324,6 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { << "Size operand " << _.getIdName(size_id) << " must be a scalar integer type."; } - bool is_zero = true; switch (size->opcode()) { case spv::Op::OpConstantNull: @@ -1257,18 +1350,125 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { // Cannot infer any other opcodes. break; } + + if (_.HasCapability(spv::Capability::Shader)) { + bool is_int = false; + bool is_const = false; + uint32_t value = 0; + std::tie(is_int, is_const, value) = _.EvalInt32IfConst(size_id); + if (is_const) { + if (value % 4 != 0) { + const auto source_sc = + source_pointer_type->GetOperandAs(1); + const auto target_sc = + target_pointer_type->GetOperandAs(1); + const bool int8 = _.HasCapability(spv::Capability::Int8); + const bool ubo_int8 = _.HasCapability( + spv::Capability::UniformAndStorageBuffer8BitAccess); + const bool ssbo_int8 = + _.HasCapability(spv::Capability::StorageBuffer8BitAccess) || + ubo_int8; + const bool pc_int8 = + _.HasCapability(spv::Capability::StoragePushConstant8); + const bool wg_int8 = _.HasCapability( + spv::Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR); + const bool int16 = _.HasCapability(spv::Capability::Int16) || int8; + const bool ubo_int16 = + _.HasCapability( + spv::Capability::UniformAndStorageBuffer16BitAccess) || + ubo_int8; + const bool ssbo_int16 = + _.HasCapability(spv::Capability::StorageBuffer16BitAccess) || + ubo_int16 || ssbo_int8; + const bool pc_int16 = + _.HasCapability(spv::Capability::StoragePushConstant16) || + pc_int8; + const bool io_int16 = + _.HasCapability(spv::Capability::StorageInputOutput16); + const bool wg_int16 = _.HasCapability( + spv::Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR); + + bool source_int16_match = false; + bool target_int16_match = false; + bool source_int8_match = false; + bool target_int8_match = false; + switch (source_sc) { + case spv::StorageClass::StorageBuffer: + source_int16_match = ssbo_int16; + source_int8_match = ssbo_int8; + break; + case spv::StorageClass::Uniform: + source_int16_match = ubo_int16; + source_int8_match = ubo_int8; + break; + case spv::StorageClass::PushConstant: + source_int16_match = pc_int16; + source_int8_match = pc_int8; + break; + case spv::StorageClass::Input: + case spv::StorageClass::Output: + source_int16_match = io_int16; + break; + case spv::StorageClass::Workgroup: + source_int16_match = wg_int16; + source_int8_match = wg_int8; + break; + default: + break; + } + switch (target_sc) { + case spv::StorageClass::StorageBuffer: + target_int16_match = ssbo_int16; + target_int8_match = ssbo_int8; + break; + case spv::StorageClass::Uniform: + target_int16_match = ubo_int16; + target_int8_match = ubo_int8; + break; + case spv::StorageClass::PushConstant: + target_int16_match = pc_int16; + target_int8_match = pc_int8; + break; + // Input is read-only so it cannot be the target pointer. + case spv::StorageClass::Output: + target_int16_match = io_int16; + break; + case spv::StorageClass::Workgroup: + target_int16_match = wg_int16; + target_int8_match = wg_int8; + break; + default: + break; + } + if (!int8 && !int16 && !(source_int16_match && target_int16_match)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Size must be a multiple of 4"; + } + if (value % 2 != 0) { + if (!int8 && !(source_int8_match && target_int8_match)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Size must be a multiple of 2"; + } + } + } + } + } + + if (auto error = CheckMemoryAccess(_, inst, 3)) return error; } if (auto error = ValidateCopyMemoryMemoryAccess(_, inst)) return error; // Get past the pointers to avoid checking a pointer copy. - auto sub_type = _.FindDef(target_pointer_type->GetOperandAs(2)); - while (sub_type->opcode() == spv::Op::OpTypePointer) { - sub_type = _.FindDef(sub_type->GetOperandAs(2)); - } - if (_.HasCapability(spv::Capability::Shader) && - _.ContainsLimitedUseIntOrFloatType(sub_type->id())) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "Cannot copy memory of objects containing 8- or 16-bit types"; + if (target_pointer_type->opcode() == spv::Op::OpTypePointer) { + auto sub_type = _.FindDef(target_pointer_type->GetOperandAs(2)); + while (sub_type->opcode() == spv::Op::OpTypePointer) { + sub_type = _.FindDef(sub_type->GetOperandAs(2)); + } + if (_.HasCapability(spv::Capability::Shader) && + _.ContainsLimitedUseIntOrFloatType(sub_type->id())) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Cannot copy memory of objects containing 8- or 16-bit types"; + } } return SPV_SUCCESS; @@ -1279,27 +1479,50 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, std::string instr_name = "Op" + std::string(spvOpcodeString(static_cast(inst->opcode()))); - // The result type must be OpTypePointer. + const bool untyped_pointer = spvOpcodeGeneratesUntypedPointer(inst->opcode()); + + // The result type must be OpTypePointer for regular access chains and an + // OpTypeUntypedPointerKHR for untyped access chains. auto result_type = _.FindDef(inst->type_id()); - if (spv::Op::OpTypePointer != result_type->opcode()) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "The Result Type of " << instr_name << " " - << _.getIdName(inst->id()) << " must be OpTypePointer. Found Op" - << spvOpcodeString(static_cast(result_type->opcode())) - << "."; + if (untyped_pointer) { + if (!result_type || + spv::Op::OpTypeUntypedPointerKHR != result_type->opcode()) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "The Result Type of " << instr_name << " " + << _.getIdName(inst->id()) + << " must be OpTypeUntypedPointerKHR. Found Op" + << spvOpcodeString(static_cast(result_type->opcode())) + << "."; + } + } else { + if (!result_type || spv::Op::OpTypePointer != result_type->opcode()) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "The Result Type of " << instr_name << " " + << _.getIdName(inst->id()) << " must be OpTypePointer. Found Op" + << spvOpcodeString(static_cast(result_type->opcode())) + << "."; + } } - // Result type is a pointer. Find out what it's pointing to. - // This will be used to make sure the indexing results in the same type. - // OpTypePointer word 3 is the type being pointed to. - const auto result_type_pointee = _.FindDef(result_type->word(3)); + if (untyped_pointer) { + // Base type must be a non-pointer type. + const auto base_type = _.FindDef(inst->GetOperandAs(2)); + if (!base_type || !spvOpcodeGeneratesType(base_type->opcode()) || + base_type->opcode() == spv::Op::OpTypePointer || + base_type->opcode() == spv::Op::OpTypeUntypedPointerKHR) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Base type must be a non-pointer type"; + } + } // Base must be a pointer, pointing to the base of a composite object. - const auto base_index = 2; + const auto base_index = untyped_pointer ? 3 : 2; const auto base_id = inst->GetOperandAs(base_index); const auto base = _.FindDef(base_id); const auto base_type = _.FindDef(base->type_id()); - if (!base_type || spv::Op::OpTypePointer != base_type->opcode()) { + if (!base_type || !(spv::Op::OpTypePointer == base_type->opcode() || + (untyped_pointer && spv::Op::OpTypeUntypedPointerKHR == + base_type->opcode()))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "The Base " << _.getIdName(base_id) << " in " << instr_name << " instruction must be a pointer."; @@ -1317,14 +1540,18 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, } // The type pointed to by OpTypePointer (word 3) must be a composite type. - auto type_pointee = _.FindDef(base_type->word(3)); + auto type_pointee = untyped_pointer + ? _.FindDef(inst->GetOperandAs(2)) + : _.FindDef(base_type->word(3)); // Check Universal Limit (SPIR-V Spec. Section 2.17). // The number of indexes passed to OpAccessChain may not exceed 255 // The instruction includes 4 words + N words (for N indexes) size_t num_indexes = inst->words().size() - 4; if (inst->opcode() == spv::Op::OpPtrAccessChain || - inst->opcode() == spv::Op::OpInBoundsPtrAccessChain) { + inst->opcode() == spv::Op::OpInBoundsPtrAccessChain || + inst->opcode() == spv::Op::OpUntypedPtrAccessChainKHR || + inst->opcode() == spv::Op::OpUntypedInBoundsPtrAccessChainKHR) { // In pointer access chains, the element operand is required, but not // counted as an index. --num_indexes; @@ -1343,9 +1570,11 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, // instruction. The second index will apply similarly to that result, and so // on. Once any non-composite type is reached, there must be no remaining // (unused) indexes. - auto starting_index = 4; + auto starting_index = untyped_pointer ? 5 : 4; if (inst->opcode() == spv::Op::OpPtrAccessChain || - inst->opcode() == spv::Op::OpInBoundsPtrAccessChain) { + inst->opcode() == spv::Op::OpInBoundsPtrAccessChain || + inst->opcode() == spv::Op::OpUntypedPtrAccessChainKHR || + inst->opcode() == spv::Op::OpUntypedInBoundsPtrAccessChainKHR) { ++starting_index; } for (size_t i = starting_index; i < inst->words().size(); ++i) { @@ -1374,33 +1603,30 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, case spv::Op::OpTypeStruct: { // In case of structures, there is an additional constraint on the // index: the index must be an OpConstant. - if (spv::Op::OpConstant != cur_word_instr->opcode()) { + int64_t cur_index; + if (!_.EvalConstantValInt64(cur_word, &cur_index)) { return _.diag(SPV_ERROR_INVALID_ID, cur_word_instr) << "The passed to " << instr_name << " to index into a " "structure must be an OpConstant."; } - // Get the index value from the OpConstant (word 3 of OpConstant). - // OpConstant could be a signed integer. But it's okay to treat it as - // unsigned because a negative constant int would never be seen as - // correct as a struct offset, since structs can't have more than 2 - // billion members. - const uint32_t cur_index = cur_word_instr->word(3); + // The index points to the struct member we want, therefore, the index // should be less than the number of struct members. - const uint32_t num_struct_members = - static_cast(type_pointee->words().size() - 2); - if (cur_index >= num_struct_members) { + const int64_t num_struct_members = + static_cast(type_pointee->words().size() - 2); + if (cur_index >= num_struct_members || cur_index < 0) { return _.diag(SPV_ERROR_INVALID_ID, cur_word_instr) << "Index is out of bounds: " << instr_name - << " can not find index " << cur_index + << " cannot find index " << cur_index << " into the structure " << _.getIdName(type_pointee->id()) << ". This structure has " << num_struct_members << " members. Largest valid index is " << num_struct_members - 1 << "."; } // Struct members IDs start at word 2 of OpTypeStruct. - auto structMemberId = type_pointee->word(cur_index + 2); + const size_t word_index = static_cast(cur_index) + 2; + auto structMemberId = type_pointee->word(word_index); type_pointee = _.FindDef(structMemberId); break; } @@ -1413,18 +1639,145 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, } } } - // At this point, we have fully walked down from the base using the indeces. - // The type being pointed to should be the same as the result type. - if (type_pointee->id() != result_type_pointee->id()) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << instr_name << " result type (Op" - << spvOpcodeString( - static_cast(result_type_pointee->opcode())) - << ") does not match the type that results from indexing into the " - "base " - " (Op" - << spvOpcodeString(static_cast(type_pointee->opcode())) - << ")."; + + if (!untyped_pointer) { + // Result type is a pointer. Find out what it's pointing to. + // This will be used to make sure the indexing results in the same type. + // OpTypePointer word 3 is the type being pointed to. + const auto result_type_pointee = _.FindDef(result_type->word(3)); + // At this point, we have fully walked down from the base using the indeces. + // The type being pointed to should be the same as the result type. + if (type_pointee->id() != result_type_pointee->id()) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << instr_name << " result type (Op" + << spvOpcodeString( + static_cast(result_type_pointee->opcode())) + << ") does not match the type that results from indexing into the " + "base " + " (Op" + << spvOpcodeString(static_cast(type_pointee->opcode())) + << ")."; + } + } + + return SPV_SUCCESS; +} + +spv_result_t ValidateRawAccessChain(ValidationState_t& _, + const Instruction* inst) { + std::string instr_name = "Op" + std::string(spvOpcodeString(inst->opcode())); + + // The result type must be OpTypePointer. + const auto result_type = _.FindDef(inst->type_id()); + if (spv::Op::OpTypePointer != result_type->opcode()) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "The Result Type of " << instr_name << " " + << _.getIdName(inst->id()) << " must be OpTypePointer. Found Op" + << spvOpcodeString(result_type->opcode()) << '.'; + } + + // The pointed storage class must be valid. + const auto storage_class = result_type->GetOperandAs(1); + if (storage_class != spv::StorageClass::StorageBuffer && + storage_class != spv::StorageClass::PhysicalStorageBuffer && + storage_class != spv::StorageClass::Uniform) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "The Result Type of " << instr_name << " " + << _.getIdName(inst->id()) + << " must point to a storage class of " + "StorageBuffer, PhysicalStorageBuffer, or Uniform."; + } + + // The pointed type must not be one in the list below. + const auto result_type_pointee = + _.FindDef(result_type->GetOperandAs(2)); + if (result_type_pointee->opcode() == spv::Op::OpTypeArray || + result_type_pointee->opcode() == spv::Op::OpTypeMatrix || + result_type_pointee->opcode() == spv::Op::OpTypeStruct) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "The Result Type of " << instr_name << " " + << _.getIdName(inst->id()) + << " must not point to " + "OpTypeArray, OpTypeMatrix, or OpTypeStruct."; + } + + // Validate Stride is a OpConstant. + const auto stride = _.FindDef(inst->GetOperandAs(3)); + if (stride->opcode() != spv::Op::OpConstant) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "The Stride of " << instr_name << " " + << _.getIdName(inst->id()) << " must be OpConstant. Found Op" + << spvOpcodeString(stride->opcode()) << '.'; + } + // Stride type must be OpTypeInt + const auto stride_type = _.FindDef(stride->type_id()); + if (stride_type->opcode() != spv::Op::OpTypeInt) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "The type of Stride of " << instr_name << " " + << _.getIdName(inst->id()) << " must be OpTypeInt. Found Op" + << spvOpcodeString(stride_type->opcode()) << '.'; + } + + // Index and Offset type must be OpTypeInt with a width of 32 + const auto ValidateType = [&](const char* name, + int operandIndex) -> spv_result_t { + const auto value = _.FindDef(inst->GetOperandAs(operandIndex)); + const auto value_type = _.FindDef(value->type_id()); + if (value_type->opcode() != spv::Op::OpTypeInt) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "The type of " << name << " of " << instr_name << " " + << _.getIdName(inst->id()) << " must be OpTypeInt. Found Op" + << spvOpcodeString(value_type->opcode()) << '.'; + } + const auto width = value_type->GetOperandAs(1); + if (width != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "The integer width of " << name << " of " << instr_name + << " " << _.getIdName(inst->id()) << " must be 32. Found " + << width << '.'; + } + return SPV_SUCCESS; + }; + spv_result_t result; + result = ValidateType("Index", 4); + if (result != SPV_SUCCESS) { + return result; + } + result = ValidateType("Offset", 5); + if (result != SPV_SUCCESS) { + return result; + } + + uint32_t access_operands = 0; + if (inst->operands().size() >= 7) { + access_operands = inst->GetOperandAs(6); + } + if (access_operands & + uint32_t(spv::RawAccessChainOperandsMask::RobustnessPerElementNV)) { + uint64_t stride_value = 0; + if (_.EvalConstantValUint64(stride->id(), &stride_value) && + stride_value == 0) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Stride must not be zero when per-element robustness is used."; + } + } + if (access_operands & + uint32_t(spv::RawAccessChainOperandsMask::RobustnessPerComponentNV) || + access_operands & + uint32_t(spv::RawAccessChainOperandsMask::RobustnessPerElementNV)) { + if (storage_class == spv::StorageClass::PhysicalStorageBuffer) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Storage class cannot be PhysicalStorageBuffer when " + "raw access chain robustness is used."; + } + } + if (access_operands & + uint32_t(spv::RawAccessChainOperandsMask::RobustnessPerComponentNV) && + access_operands & + uint32_t(spv::RawAccessChainOperandsMask::RobustnessPerElementNV)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Per-component robustness and per-element robustness are " + "mutually exclusive."; } return SPV_SUCCESS; @@ -1432,7 +1785,8 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, spv_result_t ValidatePtrAccessChain(ValidationState_t& _, const Instruction* inst) { - if (_.addressing_model() == spv::AddressingModel::Logical) { + if (_.addressing_model() == spv::AddressingModel::Logical && + inst->opcode() == spv::Op::OpPtrAccessChain) { if (!_.features().variable_pointers) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Generating variable pointers requires capability " @@ -1443,9 +1797,13 @@ spv_result_t ValidatePtrAccessChain(ValidationState_t& _, // Need to call first, will make sure Base is a valid ID if (auto error = ValidateAccessChain(_, inst)) return error; + const bool untyped_pointer = spvOpcodeGeneratesUntypedPointer(inst->opcode()); + const auto base_id = inst->GetOperandAs(2); const auto base = _.FindDef(base_id); - const auto base_type = _.FindDef(base->type_id()); + const auto base_type = untyped_pointer + ? _.FindDef(inst->GetOperandAs(2)) + : _.FindDef(base->type_id()); const auto base_type_storage_class = base_type->GetOperandAs(1); @@ -1463,15 +1821,17 @@ spv_result_t ValidatePtrAccessChain(ValidationState_t& _, } if (spvIsVulkanEnv(_.context()->target_env)) { + const auto untyped_cap = + untyped_pointer && _.HasCapability(spv::Capability::UntypedPointersKHR); if (base_type_storage_class == spv::StorageClass::Workgroup) { - if (!_.HasCapability(spv::Capability::VariablePointers)) { + if (!_.HasCapability(spv::Capability::VariablePointers) && !untyped_cap) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(7651) << "OpPtrAccessChain Base operand pointing to Workgroup " "storage class must use VariablePointers capability"; } } else if (base_type_storage_class == spv::StorageClass::StorageBuffer) { - if (!_.features().variable_pointers) { + if (!_.features().variable_pointers && !untyped_cap) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(7652) << "OpPtrAccessChain Base operand pointing to StorageBuffer " @@ -1479,7 +1839,8 @@ spv_result_t ValidatePtrAccessChain(ValidationState_t& _, "VariablePointersStorageBuffer capability"; } } else if (base_type_storage_class != - spv::StorageClass::PhysicalStorageBuffer) { + spv::StorageClass::PhysicalStorageBuffer && + !untyped_cap) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(7650) << "OpPtrAccessChain Base operand must point to Workgroup, " @@ -1506,18 +1867,28 @@ spv_result_t ValidateArrayLength(ValidationState_t& state, << " must be OpTypeInt with width 32 and signedness 0."; } - // The structure that is passed in must be an pointer to a structure, whose - // last element is a runtime array. - auto pointer = state.FindDef(inst->GetOperandAs(2)); - auto pointer_type = state.FindDef(pointer->type_id()); - if (pointer_type->opcode() != spv::Op::OpTypePointer) { + const bool untyped = inst->opcode() == spv::Op::OpUntypedArrayLengthKHR; + auto pointer_ty_id = state.GetOperandTypeId(inst, (untyped ? 3 : 2)); + auto pointer_ty = state.FindDef(pointer_ty_id); + if (untyped) { + if (pointer_ty->opcode() != spv::Op::OpTypeUntypedPointerKHR) { + return state.diag(SPV_ERROR_INVALID_ID, inst) + << "Pointer must be an untyped pointer"; + } + } else if (pointer_ty->opcode() != spv::Op::OpTypePointer) { return state.diag(SPV_ERROR_INVALID_ID, inst) << "The Structure's type in " << instr_name << " " << state.getIdName(inst->id()) << " must be a pointer to an OpTypeStruct."; } - auto structure_type = state.FindDef(pointer_type->GetOperandAs(2)); + Instruction* structure_type = nullptr; + if (untyped) { + structure_type = state.FindDef(inst->GetOperandAs(2)); + } else { + structure_type = state.FindDef(pointer_ty->GetOperandAs(2)); + } + if (structure_type->opcode() != spv::Op::OpTypeStruct) { return state.diag(SPV_ERROR_INVALID_ID, inst) << "The Structure's type in " << instr_name << " " @@ -1536,11 +1907,12 @@ spv_result_t ValidateArrayLength(ValidationState_t& state, // The array member must the index of the last element (the run time // array). - if (inst->GetOperandAs(3) != num_of_members - 1) { + const auto index = untyped ? 4 : 3; + if (inst->GetOperandAs(index) != num_of_members - 1) { return state.diag(SPV_ERROR_INVALID_ID, inst) << "The array member in " << instr_name << " " << state.getIdName(inst->id()) - << " must be an the last member of the struct."; + << " must be the last member of the struct."; } return SPV_SUCCESS; } @@ -1725,12 +2097,16 @@ spv_result_t ValidateCooperativeMatrixLoadStoreKHR(ValidationState_t& _, const auto pointer_type_id = pointer->type_id(); const auto pointer_type = _.FindDef(pointer_type_id); - if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) { + if (!pointer_type || + !(pointer_type->opcode() == spv::Op::OpTypePointer || + pointer_type->opcode() == spv::Op::OpTypeUntypedPointerKHR)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << opname << " type for pointer " << _.getIdName(pointer_id) << " is not a pointer type."; } + const bool untyped = + pointer_type->opcode() == spv::Op::OpTypeUntypedPointerKHR; const auto storage_class_index = 1u; const auto storage_class = pointer_type->GetOperandAs(storage_class_index); @@ -1745,27 +2121,36 @@ spv_result_t ValidateCooperativeMatrixLoadStoreKHR(ValidationState_t& _, << " is not Workgroup, StorageBuffer, or PhysicalStorageBuffer."; } - const auto pointee_id = pointer_type->GetOperandAs(2); - const auto pointee_type = _.FindDef(pointee_id); - if (!pointee_type || !(_.IsIntScalarOrVectorType(pointee_id) || - _.IsFloatScalarOrVectorType(pointee_id))) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << opname << " Pointer " << _.getIdName(pointer->id()) - << "s Type must be a scalar or vector type."; + if (!untyped) { + const auto pointee_id = pointer_type->GetOperandAs(2); + const auto pointee_type = _.FindDef(pointee_id); + if (!pointee_type || !(_.IsIntScalarOrVectorType(pointee_id) || + _.IsFloatScalarOrVectorType(pointee_id))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << opname << " Pointer " << _.getIdName(pointer->id()) + << "s Type must be a scalar or vector type."; + } } const auto layout_index = (inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR) ? 3u : 2u; - const auto colmajor_id = inst->GetOperandAs(layout_index); - const auto colmajor = _.FindDef(colmajor_id); - if (!colmajor || !_.IsIntScalarType(colmajor->type_id()) || - !(spvOpcodeIsConstant(colmajor->opcode()) || - spvOpcodeIsSpecConstant(colmajor->opcode()))) { + const auto layout_id = inst->GetOperandAs(layout_index); + const auto layout_inst = _.FindDef(layout_id); + if (!layout_inst || !_.IsIntScalarType(layout_inst->type_id()) || + !spvOpcodeIsConstant(layout_inst->opcode())) { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "MemoryLayout operand " << _.getIdName(colmajor_id) + << "MemoryLayout operand " << _.getIdName(layout_id) << " must be a 32-bit integer constant instruction."; } + bool stride_required = false; + uint64_t layout; + if (_.EvalConstantValUint64(layout_id, &layout)) { + stride_required = + (layout == (uint64_t)spv::CooperativeMatrixLayout::RowMajorKHR) || + (layout == (uint64_t)spv::CooperativeMatrixLayout::ColumnMajorKHR); + } + const auto stride_index = (inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR) ? 4u : 3u; if (inst->operands().size() > stride_index) { @@ -1776,6 +2161,9 @@ spv_result_t ValidateCooperativeMatrixLoadStoreKHR(ValidationState_t& _, << "Stride operand " << _.getIdName(stride_id) << " must be a scalar integer type."; } + } else if (stride_required) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "MemoryLayout " << layout << " requires a Stride."; } const auto memory_access_index = @@ -1817,7 +2205,8 @@ spv_result_t ValidatePtrComparison(ValidationState_t& _, << "The types of Operand 1 and Operand 2 must match"; } const auto op1_type = _.FindDef(op1->type_id()); - if (!op1_type || op1_type->opcode() != spv::Op::OpTypePointer) { + if (!op1_type || (op1_type->opcode() != spv::Op::OpTypePointer && + op1_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Operand type must be a pointer"; } @@ -1849,6 +2238,7 @@ spv_result_t ValidatePtrComparison(ValidationState_t& _, spv_result_t MemoryPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { case spv::Op::OpVariable: + case spv::Op::OpUntypedVariableKHR: if (auto error = ValidateVariable(_, inst)) return error; break; case spv::Op::OpLoad: @@ -1862,14 +2252,22 @@ spv_result_t MemoryPass(ValidationState_t& _, const Instruction* inst) { if (auto error = ValidateCopyMemory(_, inst)) return error; break; case spv::Op::OpPtrAccessChain: + case spv::Op::OpUntypedPtrAccessChainKHR: + case spv::Op::OpUntypedInBoundsPtrAccessChainKHR: if (auto error = ValidatePtrAccessChain(_, inst)) return error; break; case spv::Op::OpAccessChain: case spv::Op::OpInBoundsAccessChain: case spv::Op::OpInBoundsPtrAccessChain: + case spv::Op::OpUntypedAccessChainKHR: + case spv::Op::OpUntypedInBoundsAccessChainKHR: if (auto error = ValidateAccessChain(_, inst)) return error; break; + case spv::Op::OpRawAccessChainNV: + if (auto error = ValidateRawAccessChain(_, inst)) return error; + break; case spv::Op::OpArrayLength: + case spv::Op::OpUntypedArrayLengthKHR: if (auto error = ValidateArrayLength(_, inst)) return error; break; case spv::Op::OpCooperativeMatrixLoadNV: diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp index c4f22a61..dab7b5a1 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp @@ -203,15 +203,12 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, "storage class"; } -#if 0 - // TODO(atgoo@github.com): this check fails Vulkan CTS, reenable once fixed. if (opcode == spv::Op::OpControlBarrier && value && !includes_storage_class) { return _.diag(SPV_ERROR_INVALID_DATA, inst) - << spvOpcodeString(opcode) + << _.VkErrorID(4650) << spvOpcodeString(opcode) << ": expected Memory Semantics to include a Vulkan-supported " "storage class if Memory Semantics is not None"; } -#endif } if (opcode == spv::Op::OpAtomicFlagClear && diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp index d71fd2d2..a404134b 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp @@ -50,10 +50,22 @@ spv_result_t ValidateShaderClock(ValidationState_t& _, bool is_int32 = false, is_const_int32 = false; uint32_t value = 0; std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(scope); - if (is_const_int32 && spv::Scope(value) != spv::Scope::Subgroup && - spv::Scope(value) != spv::Scope::Device) { - return _.diag(SPV_ERROR_INVALID_DATA, inst) - << _.VkErrorID(4652) << "Scope must be Subgroup or Device"; + if (is_const_int32) { + spv::Scope scope_val{value}; + if (spvIsVulkanEnv(_.context()->target_env)) { + if (scope_val != spv::Scope::Subgroup && + scope_val != spv::Scope::Device) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << _.VkErrorID(4652) << "Scope must be Subgroup or Device"; + } + } else if (spvIsOpenCLEnv(_.context()->target_env)) { + if (scope_val != spv::Scope::Workgroup && + scope_val != spv::Scope::Subgroup && + scope_val != spv::Scope::Device) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Scope must be Subgroup, Workgroup, or Device"; + } + } } // Result Type must be a 64 - bit unsigned integer type or diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp index d757d4f8..8502fda5 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp @@ -340,29 +340,93 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, const auto mode = inst->GetOperandAs(1); if (inst->opcode() == spv::Op::OpExecutionModeId) { + bool valid_mode = false; + switch (mode) { + case spv::ExecutionMode::SubgroupsPerWorkgroupId: + case spv::ExecutionMode::LocalSizeHintId: + case spv::ExecutionMode::LocalSizeId: + case spv::ExecutionMode::FPFastMathDefault: + case spv::ExecutionMode::MaximumRegistersIdINTEL: + valid_mode = true; + break; + default: + valid_mode = false; + break; + } + if (!valid_mode) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "OpExecutionModeId is only valid when the Mode operand is an " + "execution mode that takes Extra Operands that are id " + "operands."; + } + size_t operand_count = inst->operands().size(); for (size_t i = 2; i < operand_count; ++i) { - const auto operand_id = inst->GetOperandAs(2); + const auto operand_id = inst->GetOperandAs(i); const auto* operand_inst = _.FindDef(operand_id); - if (mode == spv::ExecutionMode::SubgroupsPerWorkgroupId || - mode == spv::ExecutionMode::LocalSizeHintId || - mode == spv::ExecutionMode::LocalSizeId) { - if (!spvOpcodeIsConstant(operand_inst->opcode())) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "For OpExecutionModeId all Extra Operand ids must be " - "constant " - "instructions."; - } - } else { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "OpExecutionModeId is only valid when the Mode operand is an " - "execution mode that takes Extra Operands that are id " - "operands."; + switch (mode) { + case spv::ExecutionMode::SubgroupsPerWorkgroupId: + case spv::ExecutionMode::LocalSizeHintId: + case spv::ExecutionMode::LocalSizeId: + if (!spvOpcodeIsConstant(operand_inst->opcode())) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "For OpExecutionModeId all Extra Operand ids must be " + "constant instructions."; + } + break; + case spv::ExecutionMode::FPFastMathDefault: + if (i == 2) { + if (!_.IsFloatScalarType(operand_id)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "The Target Type operand must be a floating-point " + "scalar type"; + } + } else { + bool is_int32 = false; + bool is_const = false; + uint32_t value = 0; + std::tie(is_int32, is_const, value) = + _.EvalInt32IfConst(operand_id); + if (is_int32 && is_const) { + // Valid values include up to 0x00040000 (AllowTransform). + uint32_t invalid_mask = 0xfff80000; + if ((invalid_mask & value) != 0) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "The Fast Math Default operand is an invalid bitmask " + "value"; + } + if (value & + static_cast(spv::FPFastMathModeMask::Fast)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "The Fast Math Default operand must not include Fast"; + } + const auto reassoc_contract = + spv::FPFastMathModeMask::AllowContract | + spv::FPFastMathModeMask::AllowReassoc; + if ((value & static_cast( + spv::FPFastMathModeMask::AllowTransform)) != 0 && + ((value & static_cast(reassoc_contract)) != + static_cast(reassoc_contract))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "The Fast Math Default operand must include " + "AllowContract and AllowReassoc when AllowTransform " + "is specified"; + } + } else { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "The Fast Math Default operand must be a " + "non-specialization constant"; + } + } + break; + default: + break; } } } else if (mode == spv::ExecutionMode::SubgroupsPerWorkgroupId || mode == spv::ExecutionMode::LocalSizeHintId || - mode == spv::ExecutionMode::LocalSizeId) { + mode == spv::ExecutionMode::LocalSizeId || + mode == spv::ExecutionMode::FPFastMathDefault) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "OpExecutionMode is only valid when the Mode operand is an " "execution mode that takes no Extra Operands, or takes Extra " @@ -494,6 +558,17 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, "model."; } break; + case spv::ExecutionMode::QuadDerivativesKHR: + if (!std::all_of(models->begin(), models->end(), + [](const spv::ExecutionModel& model) { + return (model == spv::ExecutionModel::Fragment || + model == spv::ExecutionModel::GLCompute); + })) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Execution mode can only be used with the Fragment or " + "GLCompute execution model."; + } + break; case spv::ExecutionMode::PixelCenterInteger: case spv::ExecutionMode::OriginUpperLeft: case spv::ExecutionMode::OriginLowerLeft: @@ -518,6 +593,7 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, case spv::ExecutionMode::StencilRefUnchangedBackAMD: case spv::ExecutionMode::StencilRefGreaterBackAMD: case spv::ExecutionMode::StencilRefLessBackAMD: + case spv::ExecutionMode::RequireFullQuadsKHR: if (!std::all_of(models->begin(), models->end(), [](const spv::ExecutionModel& model) { return model == spv::ExecutionModel::Fragment; @@ -579,6 +655,20 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, break; } + if (mode == spv::ExecutionMode::FPFastMathDefault) { + const auto* modes = _.GetExecutionModes(entry_point_id); + if (modes && modes->count(spv::ExecutionMode::ContractionOff)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "FPFastMathDefault and ContractionOff execution modes cannot " + "be applied to the same entry point"; + } + if (modes && modes->count(spv::ExecutionMode::SignedZeroInfNanPreserve)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "FPFastMathDefault and SignedZeroInfNanPreserve execution " + "modes cannot be applied to the same entry point"; + } + } + if (spvIsVulkanEnv(_.context()->target_env)) { if (mode == spv::ExecutionMode::OriginLowerLeft) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -634,8 +724,91 @@ spv_result_t ValidateMemoryModel(ValidationState_t& _, return SPV_SUCCESS; } +bool PerEntryExecutionMode(spv::ExecutionMode mode) { + switch (mode) { + // These execution modes can be specified multiple times per entry point. + case spv::ExecutionMode::DenormPreserve: + case spv::ExecutionMode::DenormFlushToZero: + case spv::ExecutionMode::SignedZeroInfNanPreserve: + case spv::ExecutionMode::RoundingModeRTE: + case spv::ExecutionMode::RoundingModeRTZ: + case spv::ExecutionMode::FPFastMathDefault: + case spv::ExecutionMode::RoundingModeRTPINTEL: + case spv::ExecutionMode::RoundingModeRTNINTEL: + case spv::ExecutionMode::FloatingPointModeALTINTEL: + case spv::ExecutionMode::FloatingPointModeIEEEINTEL: + return false; + default: + return true; + } +} + } // namespace +spv_result_t ValidateFloatControls2(ValidationState_t& _) { + std::unordered_set fp_fast_math_default_entry_points; + for (auto entry_point : _.entry_points()) { + const auto* exec_modes = _.GetExecutionModes(entry_point); + if (exec_modes && + exec_modes->count(spv::ExecutionMode::FPFastMathDefault)) { + fp_fast_math_default_entry_points.insert(entry_point); + } + } + + std::vector> worklist; + for (const auto& inst : _.ordered_instructions()) { + if (inst.opcode() != spv::Op::OpDecorate) { + continue; + } + + const auto decoration = inst.GetOperandAs(1); + const auto target_id = inst.GetOperandAs(0); + const auto target = _.FindDef(target_id); + if (decoration == spv::Decoration::NoContraction) { + worklist.push_back(std::make_pair(target, decoration)); + } else if (decoration == spv::Decoration::FPFastMathMode) { + auto mask = inst.GetOperandAs(2); + if ((mask & spv::FPFastMathModeMask::Fast) != + spv::FPFastMathModeMask::MaskNone) { + worklist.push_back(std::make_pair(target, decoration)); + } + } + } + + std::unordered_set visited; + while (!worklist.empty()) { + const auto inst = worklist.back().first; + const auto decoration = worklist.back().second; + worklist.pop_back(); + + if (!visited.insert(inst).second) { + continue; + } + + const auto function = inst->function(); + if (function) { + const auto& entry_points = _.FunctionEntryPoints(function->id()); + for (auto entry_point : entry_points) { + if (fp_fast_math_default_entry_points.count(entry_point)) { + const std::string dec = decoration == spv::Decoration::NoContraction + ? "NoContraction" + : "FPFastMathMode Fast"; + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << dec + << " cannot be used by an entry point with the " + "FPFastMathDefault execution mode"; + } + } + } else { + for (const auto& pair : inst->uses()) { + worklist.push_back(std::make_pair(pair.first, decoration)); + } + } + } + + return SPV_SUCCESS; +} + spv_result_t ModeSettingPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { case spv::Op::OpEntryPoint: @@ -654,5 +827,52 @@ spv_result_t ModeSettingPass(ValidationState_t& _, const Instruction* inst) { return SPV_SUCCESS; } +spv_result_t ValidateDuplicateExecutionModes(ValidationState_t& _) { + using PerEntryKey = std::tuple; + using PerOperandKey = std::tuple; + std::set seen_per_entry; + std::set seen_per_operand; + + const auto lookupMode = [&_](spv::ExecutionMode mode) -> std::string { + spv_operand_desc desc = nullptr; + if (_.grammar().lookupOperand(SPV_OPERAND_TYPE_EXECUTION_MODE, + static_cast(mode), + &desc) == SPV_SUCCESS) { + return std::string(desc->name); + } + return "Unknown"; + }; + + for (const auto& inst : _.ordered_instructions()) { + if (inst.opcode() != spv::Op::OpExecutionMode && + inst.opcode() != spv::Op::OpExecutionModeId) { + continue; + } + + const auto entry = inst.GetOperandAs(0); + const auto mode = inst.GetOperandAs(1); + if (PerEntryExecutionMode(mode)) { + if (!seen_per_entry.insert(std::make_tuple(mode, entry)).second) { + return _.diag(SPV_ERROR_INVALID_ID, &inst) + << lookupMode(mode) + << " execution mode must not be specified multiple times per " + "entry point"; + } + } else { + // Execution modes allowed multiple times all take a single operand. + const auto operand = inst.GetOperandAs(2); + if (!seen_per_operand.insert(std::make_tuple(mode, entry, operand)) + .second) { + return _.diag(SPV_ERROR_INVALID_ID, &inst) + << lookupMode(mode) + << " execution mode must not be specified multiple times for " + "the same entry point and operands"; + } + } + } + + return SPV_SUCCESS; +} + } // namespace val } // namespace spvtools diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp index 2c36ce33..75967d2f 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp @@ -389,20 +389,25 @@ spv_result_t ValidateGroupNonUniformRotateKHR(ValidationState_t& _, if (inst->words().size() > 6) { const uint32_t cluster_size_op_id = inst->GetOperandAs(5); - const uint32_t cluster_size_type = _.GetTypeId(cluster_size_op_id); + const Instruction* cluster_size_inst = _.FindDef(cluster_size_op_id); + const uint32_t cluster_size_type = + cluster_size_inst ? cluster_size_inst->type_id() : 0; if (!_.IsUnsignedIntScalarType(cluster_size_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "ClusterSize must be a scalar of integer type, whose " "Signedness operand is 0."; } - uint64_t cluster_size; - if (!_.GetConstantValUint64(cluster_size_op_id, &cluster_size)) { + if (!spvOpcodeIsConstant(cluster_size_inst->opcode())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "ClusterSize must come from a constant instruction."; } - if ((cluster_size == 0) || ((cluster_size & (cluster_size - 1)) != 0)) { + uint64_t cluster_size; + const bool valid_const = + _.EvalConstantValUint64(cluster_size_op_id, &cluster_size); + if (valid_const && + ((cluster_size == 0) || ((cluster_size & (cluster_size - 1)) != 0))) { return _.diag(SPV_WARNING, inst) << "Behavior is undefined unless ClusterSize is at least 1 and a " "power of 2."; @@ -422,9 +427,14 @@ spv_result_t NonUniformPass(ValidationState_t& _, const Instruction* inst) { const spv::Op opcode = inst->opcode(); if (spvOpcodeIsNonUniformGroupOperation(opcode)) { - const uint32_t execution_scope = inst->GetOperandAs(2); - if (auto error = ValidateExecutionScope(_, inst, execution_scope)) { - return error; + // OpGroupNonUniformQuadAllKHR and OpGroupNonUniformQuadAnyKHR don't have + // scope paramter + if ((opcode != spv::Op::OpGroupNonUniformQuadAllKHR) && + (opcode != spv::Op::OpGroupNonUniformQuadAnyKHR)) { + const uint32_t execution_scope = inst->GetOperandAs(2); + if (auto error = ValidateExecutionScope(_, inst, execution_scope)) { + return error; + } } } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_scopes.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_scopes.cpp index 40c49d1f..6b493538 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_scopes.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_scopes.cpp @@ -97,8 +97,10 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _, // Vulkan 1.1 specific rules if (_.context()->target_env != SPV_ENV_VULKAN_1_0) { // Scope for Non Uniform Group Operations must be limited to Subgroup - if (spvOpcodeIsNonUniformGroupOperation(opcode) && - value != spv::Scope::Subgroup) { + if ((spvOpcodeIsNonUniformGroupOperation(opcode) && + (opcode != spv::Op::OpGroupNonUniformQuadAllKHR) && + (opcode != spv::Op::OpGroupNonUniformQuadAnyKHR)) && + (value != spv::Scope::Subgroup)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4642) << spvOpcodeString(opcode) << ": in Vulkan environment Execution scope is limited to " @@ -178,6 +180,8 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _, // Scope for execution must be limited to Workgroup or Subgroup for // non-uniform operations if (spvOpcodeIsNonUniformGroupOperation(opcode) && + opcode != spv::Op::OpGroupNonUniformQuadAllKHR && + opcode != spv::Op::OpGroupNonUniformQuadAnyKHR && value != spv::Scope::Subgroup && value != spv::Scope::Workgroup) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) diff --git a/bgfx/3rdparty/spirv-tools/source/val/validate_type.cpp b/bgfx/3rdparty/spirv-tools/source/val/validate_type.cpp index 7edd12ff..32024b73 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validate_type.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validate_type.cpp @@ -24,21 +24,6 @@ namespace spvtools { namespace val { namespace { -// Returns, as an int64_t, the literal value from an OpConstant or the -// default value of an OpSpecConstant, assuming it is an integral type. -// For signed integers, relies the rule that literal value is sign extended -// to fill out to word granularity. Assumes that the constant value -// has -int64_t ConstantLiteralAsInt64(uint32_t width, - const std::vector& const_words) { - const uint32_t lo_word = const_words[3]; - if (width <= 32) return int32_t(lo_word); - assert(width <= 64); - assert(const_words.size() > 4); - const uint32_t hi_word = const_words[4]; // Must exist, per spec. - return static_cast(uint64_t(lo_word) | uint64_t(hi_word) << 32); -} - // Validates that type declarations are unique, unless multiple declarations // of the same data type are allowed by the specification. // (see section 2.8 Types and Variables) @@ -51,6 +36,7 @@ spv_result_t ValidateUniqueness(ValidationState_t& _, const Instruction* inst) { const auto opcode = inst->opcode(); if (opcode != spv::Op::OpTypeArray && opcode != spv::Op::OpTypeRuntimeArray && opcode != spv::Op::OpTypeStruct && opcode != spv::Op::OpTypePointer && + opcode != spv::Op::OpTypeUntypedPointerKHR && !_.RegisterUniqueTypeDeclaration(inst)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Duplicate non-aggregate type declarations are not allowed. " @@ -252,29 +238,17 @@ spv_result_t ValidateTypeArray(ValidationState_t& _, const Instruction* inst) { << " is not a constant integer type."; } - switch (length->opcode()) { - case spv::Op::OpSpecConstant: - case spv::Op::OpConstant: { - auto& type_words = const_result_type->words(); - const bool is_signed = type_words[3] > 0; - const uint32_t width = type_words[2]; - const int64_t ivalue = ConstantLiteralAsInt64(width, length->words()); - if (ivalue == 0 || (ivalue < 0 && is_signed)) { - return _.diag(SPV_ERROR_INVALID_ID, inst) - << "OpTypeArray Length " << _.getIdName(length_id) - << " default value must be at least 1: found " << ivalue; - } - } break; - case spv::Op::OpConstantNull: + int64_t length_value; + if (_.EvalConstantValInt64(length_id, &length_value)) { + auto& type_words = const_result_type->words(); + const bool is_signed = type_words[3] > 0; + if (length_value == 0 || (length_value < 0 && is_signed)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpTypeArray Length " << _.getIdName(length_id) - << " default value must be at least 1."; - case spv::Op::OpSpecConstantOp: - // Assume it's OK, rather than try to evaluate the operation. - break; - default: - assert(0 && "bug in spvOpcodeIsConstant() or result type isn't int"); + << " default value must be at least 1: found " << length_value; + } } + return SPV_SUCCESS; } @@ -610,6 +584,33 @@ spv_result_t ValidateTypeCooperativeMatrix(ValidationState_t& _, return SPV_SUCCESS; } + +spv_result_t ValidateTypeUntypedPointerKHR(ValidationState_t& _, + const Instruction* inst) { + if (spvIsVulkanEnv(_.context()->target_env)) { + const auto sc = inst->GetOperandAs(1); + switch (sc) { + case spv::StorageClass::Workgroup: + if (!_.HasCapability( + spv::Capability::WorkgroupMemoryExplicitLayoutKHR)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Workgroup storage class untyped pointers in Vulkan " + "require WorkgroupMemoryExplicitLayoutKHR be declared"; + } + break; + case spv::StorageClass::StorageBuffer: + case spv::StorageClass::PhysicalStorageBuffer: + case spv::StorageClass::Uniform: + case spv::StorageClass::PushConstant: + break; + default: + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "In Vulkan, untyped pointers can only be used in an " + "explicitly laid out storage class"; + } + } + return SPV_SUCCESS; +} } // namespace spv_result_t TypePass(ValidationState_t& _, const Instruction* inst) { @@ -655,6 +656,9 @@ spv_result_t TypePass(ValidationState_t& _, const Instruction* inst) { case spv::Op::OpTypeCooperativeMatrixKHR: if (auto error = ValidateTypeCooperativeMatrix(_, inst)) return error; break; + case spv::Op::OpTypeUntypedPointerKHR: + if (auto error = ValidateTypeUntypedPointerKHR(_, inst)) return error; + break; default: break; } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validation_state.cpp b/bgfx/3rdparty/spirv-tools/source/val/validation_state.cpp index 6685985b..2afcacc3 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validation_state.cpp +++ b/bgfx/3rdparty/spirv-tools/source/val/validation_state.cpp @@ -73,9 +73,11 @@ ModuleLayoutSection InstructionLayoutSection( case spv::Op::OpTypeForwardPointer: return kLayoutTypes; case spv::Op::OpVariable: + case spv::Op::OpUntypedVariableKHR: if (current_section == kLayoutTypes) return kLayoutTypes; return kLayoutFunctionDefinitions; case spv::Op::OpExtInst: + case spv::Op::OpExtInstWithForwardRefsKHR: // spv::Op::OpExtInst is only allowed in types section for certain // extended instruction sets. This will be checked separately. if (current_section == kLayoutTypes) return kLayoutTypes; @@ -615,7 +617,8 @@ void ValidationState_t::RegisterQCOMImageProcessingTextureConsumer( uint32_t texture_id, const Instruction* consumer0, const Instruction* consumer1) { if (HasDecoration(texture_id, spv::Decoration::WeightTextureQCOM) || - HasDecoration(texture_id, spv::Decoration::BlockMatchTextureQCOM)) { + HasDecoration(texture_id, spv::Decoration::BlockMatchTextureQCOM) || + HasDecoration(texture_id, spv::Decoration::BlockMatchSamplerQCOM)) { qcom_image_processing_consumers_.insert(consumer0->id()); if (consumer1) { qcom_image_processing_consumers_.insert(consumer1->id()); @@ -867,6 +870,9 @@ uint32_t ValidationState_t::GetComponentType(uint32_t id) const { case spv::Op::OpTypeBool: return id; + case spv::Op::OpTypeArray: + return inst->word(2); + case spv::Op::OpTypeVector: return inst->word(2); @@ -954,6 +960,20 @@ bool ValidationState_t::IsFloatVectorType(uint32_t id) const { return false; } +bool ValidationState_t::IsFloat16Vector2Or4Type(uint32_t id) const { + const Instruction* inst = FindDef(id); + assert(inst); + + if (inst->opcode() == spv::Op::OpTypeVector) { + uint32_t vectorDim = GetDimension(id); + return IsFloatScalarType(GetComponentType(id)) && + (vectorDim == 2 || vectorDim == 4) && + (GetBitWidth(GetComponentType(id)) == 16); + } + + return false; +} + bool ValidationState_t::IsFloatScalarOrVectorType(uint32_t id) const { const Instruction* inst = FindDef(id); if (!inst) { @@ -976,6 +996,19 @@ bool ValidationState_t::IsIntScalarType(uint32_t id) const { return inst && inst->opcode() == spv::Op::OpTypeInt; } +bool ValidationState_t::IsIntArrayType(uint32_t id) const { + const Instruction* inst = FindDef(id); + if (!inst) { + return false; + } + + if (inst->opcode() == spv::Op::OpTypeArray) { + return IsIntScalarType(GetComponentType(id)); + } + + return false; +} + bool ValidationState_t::IsIntVectorType(uint32_t id) const { const Instruction* inst = FindDef(id); if (!inst) { @@ -1153,7 +1186,9 @@ bool ValidationState_t::GetStructMemberTypes( bool ValidationState_t::IsPointerType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == spv::Op::OpTypePointer; + assert(inst); + return inst->opcode() == spv::Op::OpTypePointer || + inst->opcode() == spv::Op::OpTypeUntypedPointerKHR; } bool ValidationState_t::GetPointerTypeInfo( @@ -1163,6 +1198,12 @@ bool ValidationState_t::GetPointerTypeInfo( const Instruction* inst = FindDef(id); assert(inst); + if (inst->opcode() == spv::Op::OpTypeUntypedPointerKHR) { + *storage_class = spv::StorageClass(inst->word(2)); + *data_type = 0; + return true; + } + if (inst->opcode() != spv::Op::OpTypePointer) return false; *storage_class = spv::StorageClass(inst->word(2)); @@ -1195,7 +1236,7 @@ bool ValidationState_t::IsCooperativeMatrixAType(uint32_t id) const { if (!IsCooperativeMatrixKHRType(id)) return false; const Instruction* inst = FindDef(id); uint64_t matrixUse = 0; - if (GetConstantValUint64(inst->word(6), &matrixUse)) { + if (EvalConstantValUint64(inst->word(6), &matrixUse)) { return matrixUse == static_cast(spv::CooperativeMatrixUse::MatrixAKHR); } @@ -1206,7 +1247,7 @@ bool ValidationState_t::IsCooperativeMatrixBType(uint32_t id) const { if (!IsCooperativeMatrixKHRType(id)) return false; const Instruction* inst = FindDef(id); uint64_t matrixUse = 0; - if (GetConstantValUint64(inst->word(6), &matrixUse)) { + if (EvalConstantValUint64(inst->word(6), &matrixUse)) { return matrixUse == static_cast(spv::CooperativeMatrixUse::MatrixBKHR); } @@ -1216,7 +1257,7 @@ bool ValidationState_t::IsCooperativeMatrixAccType(uint32_t id) const { if (!IsCooperativeMatrixKHRType(id)) return false; const Instruction* inst = FindDef(id); uint64_t matrixUse = 0; - if (GetConstantValUint64(inst->word(6), &matrixUse)) { + if (EvalConstantValUint64(inst->word(6), &matrixUse)) { return matrixUse == static_cast( spv::CooperativeMatrixUse::MatrixAccumulatorKHR); } @@ -1326,20 +1367,23 @@ uint32_t ValidationState_t::GetOperandTypeId(const Instruction* inst, return GetTypeId(inst->GetOperandAs(operand_index)); } -bool ValidationState_t::GetConstantValUint64(uint32_t id, uint64_t* val) const { +bool ValidationState_t::EvalConstantValUint64(uint32_t id, + uint64_t* val) const { const Instruction* inst = FindDef(id); if (!inst) { assert(0 && "Instruction not found"); return false; } - if (inst->opcode() != spv::Op::OpConstant && - inst->opcode() != spv::Op::OpSpecConstant) - return false; - if (!IsIntScalarType(inst->type_id())) return false; - if (inst->words().size() == 4) { + if (inst->opcode() == spv::Op::OpConstantNull) { + *val = 0; + } else if (inst->opcode() != spv::Op::OpConstant) { + // Spec constant values cannot be evaluated so don't consider constant for + // static validation + return false; + } else if (inst->words().size() == 4) { *val = inst->word(3); } else { assert(inst->words().size() == 5); @@ -1349,6 +1393,32 @@ bool ValidationState_t::GetConstantValUint64(uint32_t id, uint64_t* val) const { return true; } +bool ValidationState_t::EvalConstantValInt64(uint32_t id, int64_t* val) const { + const Instruction* inst = FindDef(id); + if (!inst) { + assert(0 && "Instruction not found"); + return false; + } + + if (!IsIntScalarType(inst->type_id())) return false; + + if (inst->opcode() == spv::Op::OpConstantNull) { + *val = 0; + } else if (inst->opcode() != spv::Op::OpConstant) { + // Spec constant values cannot be evaluated so don't consider constant for + // static validation + return false; + } else if (inst->words().size() == 4) { + *val = int32_t(inst->word(3)); + } else { + assert(inst->words().size() == 5); + const uint32_t lo_word = inst->word(3); + const uint32_t hi_word = inst->word(4); + *val = static_cast(uint64_t(lo_word) | uint64_t(hi_word) << 32); + } + return true; +} + std::tuple ValidationState_t::EvalInt32IfConst( uint32_t id) const { const Instruction* const inst = FindDef(id); @@ -1644,6 +1714,39 @@ bool ValidationState_t::ContainsRuntimeArray(uint32_t id) const { return ContainsType(id, f, /* traverse_all_types = */ false); } +bool ValidationState_t::ContainsUntypedPointer(uint32_t id) const { + const auto inst = FindDef(id); + if (!inst) return false; + if (!spvOpcodeGeneratesType(inst->opcode())) return false; + if (inst->opcode() == spv::Op::OpTypeUntypedPointerKHR) return true; + + switch (inst->opcode()) { + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeImage: + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypeCooperativeMatrixNV: + return ContainsUntypedPointer(inst->GetOperandAs(1u)); + case spv::Op::OpTypePointer: + if (IsForwardPointer(id)) return false; + return ContainsUntypedPointer(inst->GetOperandAs(2u)); + case spv::Op::OpTypeFunction: + case spv::Op::OpTypeStruct: { + for (uint32_t i = 1; i < inst->operands().size(); ++i) { + if (ContainsUntypedPointer(inst->GetOperandAs(i))) + return true; + } + return false; + } + default: + return false; + } + + return false; +} + bool ValidationState_t::IsValidStorageClass( spv::StorageClass storage_class) const { if (spvIsVulkanEnv(context()->target_env)) { @@ -2125,6 +2228,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-None-04644); case 4645: return VUID_WRAP(VUID-StandaloneSpirv-None-04645); + case 4650: + return VUID_WRAP(VUID-StandaloneSpirv-OpControlBarrier-04650); case 4651: return VUID_WRAP(VUID-StandaloneSpirv-OpVariable-04651); case 4652: @@ -2171,14 +2276,20 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-RayPayloadKHR-04698); case 4699: return VUID_WRAP(VUID-StandaloneSpirv-IncomingRayPayloadKHR-04699); + case 4700: + return VUID_WRAP(VUID-StandaloneSpirv-IncomingRayPayloadKHR-04700); case 4701: return VUID_WRAP(VUID-StandaloneSpirv-HitAttributeKHR-04701); + case 4702: + return VUID_WRAP(VUID-StandaloneSpirv-HitAttributeKHR-04702); case 4703: return VUID_WRAP(VUID-StandaloneSpirv-HitAttributeKHR-04703); case 4704: return VUID_WRAP(VUID-StandaloneSpirv-CallableDataKHR-04704); case 4705: return VUID_WRAP(VUID-StandaloneSpirv-IncomingCallableDataKHR-04705); + case 4706: + return VUID_WRAP(VUID-StandaloneSpirv-IncomingCallableDataKHR-04706); case 7119: return VUID_WRAP(VUID-StandaloneSpirv-ShaderRecordBufferKHR-07119); case 4708: @@ -2237,6 +2348,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-OpTypeSampledImage-06671); case 6672: return VUID_WRAP(VUID-StandaloneSpirv-Location-06672); + case 6673: + return VUID_WRAP(VUID-StandaloneSpirv-OpVariable-06673); case 6674: return VUID_WRAP(VUID-StandaloneSpirv-OpEntryPoint-06674); case 6675: @@ -2255,8 +2368,28 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06807); case 6808: return VUID_WRAP(VUID-StandaloneSpirv-PushConstant-06808); + case 6924: + return VUID_WRAP(VUID-StandaloneSpirv-OpTypeImage-06924); case 6925: return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06925); + case 7041: + return VUID_WRAP(VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07041); + case 7043: + return VUID_WRAP(VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07043); + case 7044: + return VUID_WRAP(VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07044); + case 7047: + return VUID_WRAP(VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07047); + case 7049: + return VUID_WRAP(VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07049); + case 7050: + return VUID_WRAP(VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07050); + case 7053: + return VUID_WRAP(VUID-PrimitiveTriangleIndicesEXT-PrimitiveTriangleIndicesEXT-07053); + case 7055: + return VUID_WRAP(VUID-PrimitiveTriangleIndicesEXT-PrimitiveTriangleIndicesEXT-07055); + case 7056: + return VUID_WRAP(VUID-PrimitiveTriangleIndicesEXT-PrimitiveTriangleIndicesEXT-07056); case 7102: return VUID_WRAP(VUID-StandaloneSpirv-MeshEXT-07102); case 7320: @@ -2279,6 +2412,12 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-OpEntryPoint-08722); case 8973: return VUID_WRAP(VUID-StandaloneSpirv-Pointer-08973); + case 9638: + return VUID_WRAP(VUID-StandaloneSpirv-OpTypeImage-09638); + case 9658: + return VUID_WRAP(VUID-StandaloneSpirv-OpEntryPoint-09658); + case 9659: + return VUID_WRAP(VUID-StandaloneSpirv-OpEntryPoint-09659); default: return ""; // unknown id } diff --git a/bgfx/3rdparty/spirv-tools/source/val/validation_state.h b/bgfx/3rdparty/spirv-tools/source/val/validation_state.h index 0cd6c789..372b5b7b 100644 --- a/bgfx/3rdparty/spirv-tools/source/val/validation_state.h +++ b/bgfx/3rdparty/spirv-tools/source/val/validation_state.h @@ -602,9 +602,11 @@ class ValidationState_t { bool IsVoidType(uint32_t id) const; bool IsFloatScalarType(uint32_t id) const; bool IsFloatVectorType(uint32_t id) const; + bool IsFloat16Vector2Or4Type(uint32_t id) const; bool IsFloatScalarOrVectorType(uint32_t id) const; bool IsFloatMatrixType(uint32_t id) const; bool IsIntScalarType(uint32_t id) const; + bool IsIntArrayType(uint32_t id) const; bool IsIntVectorType(uint32_t id) const; bool IsIntScalarOrVectorType(uint32_t id) const; bool IsUnsignedIntScalarType(uint32_t id) const; @@ -647,9 +649,8 @@ class ValidationState_t { const std::function& f, bool traverse_all_types = true) const; - // Gets value from OpConstant and OpSpecConstant as uint64. - // Returns false on failure (no instruction, wrong instruction, not int). - bool GetConstantValUint64(uint32_t id, uint64_t* val) const; + // Returns true if |id| is type id that contains an untyped pointer. + bool ContainsUntypedPointer(uint32_t id) const; // Returns type_id if id has type or zero otherwise. uint32_t GetTypeId(uint32_t id) const; @@ -725,6 +726,14 @@ class ValidationState_t { pointer_to_storage_image_.insert(type_id); } + // Tries to evaluate a any scalar integer OpConstant as uint64. + // OpConstantNull is defined as zero for scalar int (will return true) + // OpSpecConstant* return false since their values cannot be relied upon + // during validation. + bool EvalConstantValUint64(uint32_t id, uint64_t* val) const; + // Same as EvalConstantValUint64 but returns a signed int + bool EvalConstantValInt64(uint32_t id, int64_t* val) const; + // Tries to evaluate a 32-bit signed or unsigned scalar integer constant. // Returns tuple . // OpSpecConstant* return |is_const_int32| as false since their values cannot diff --git a/bgfx/3rdparty/stb/stb_textedit.h b/bgfx/3rdparty/stb/stb_textedit.h index 76446709..b7a761c8 100644 --- a/bgfx/3rdparty/stb/stb_textedit.h +++ b/bgfx/3rdparty/stb/stb_textedit.h @@ -1,10 +1,14 @@ // [DEAR IMGUI] -// This is a slightly modified version of stb_textedit.h 1.13. +// This is a slightly modified version of stb_textedit.h 1.14. // Those changes would need to be pushed into nothings/stb: // - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321) +// - Fix in stb_textedit_find_charpos to handle last line (see https://github.com/ocornut/imgui/issues/6000 + #6783) +// - Added name to struct or it may be forward declared in our code. +// - Added UTF-8 support (see https://github.com/nothings/stb/issues/188 + https://github.com/ocornut/imgui/pull/7925) // Grep for [DEAR IMGUI] to find the changes. +// - Also renamed macros used or defined outside of IMSTB_TEXTEDIT_IMPLEMENTATION block from STB_TEXTEDIT_* to IMSTB_TEXTEDIT_* -// stb_textedit.h - v1.13 - public domain - Sean Barrett +// stb_textedit.h - v1.14 - public domain - Sean Barrett // Development of this library was sponsored by RAD Game Tools // // This C header file implements the guts of a multi-line text-editing @@ -19,7 +23,7 @@ // texts, as its performance does not scale and it has limited undo). // // Non-trivial behaviors are modelled after Windows text controls. -// +// // // LICENSE // @@ -29,16 +33,17 @@ // DEPENDENCIES // // Uses the C runtime function 'memmove', which you can override -// by defining STB_TEXTEDIT_memmove before the implementation. +// by defining IMSTB_TEXTEDIT_memmove before the implementation. // Uses no other functions. Performs no runtime allocations. // // // VERSION HISTORY // +// 1.14 (2021-07-11) page up/down, various fixes // 1.13 (2019-02-07) fix bug in undo size management // 1.12 (2018-01-29) user can change STB_TEXTEDIT_KEYTYPE, fix redo to avoid crash // 1.11 (2017-03-03) fix HOME on last line, dragging off single-line textfield -// 1.10 (2016-10-25) supress warnings about casting away const with -Wcast-qual +// 1.10 (2016-10-25) suppress warnings about casting away const with -Wcast-qual // 1.9 (2016-08-27) customizable move-by-word // 1.8 (2016-04-02) better keyboard handling when mouse button is down // 1.7 (2015-09-13) change y range handling in case baseline is non-0 @@ -58,6 +63,7 @@ // Ulf Winklemann: move-by-word in 1.1 // Fabian Giesen: secondary key inputs in 1.5 // Martins Mozeiko: STB_TEXTEDIT_memmove in 1.6 +// Louis Schnellbach: page up/down in 1.14 // // Bugfixes: // Scott Graham @@ -93,8 +99,8 @@ // moderate sizes. The undo system does no memory allocations, so // it grows STB_TexteditState by the worst-case storage which is (in bytes): // -// [4 + 3 * sizeof(STB_TEXTEDIT_POSITIONTYPE)] * STB_TEXTEDIT_UNDOSTATE_COUNT -// + sizeof(STB_TEXTEDIT_CHARTYPE) * STB_TEXTEDIT_UNDOCHAR_COUNT +// [4 + 3 * sizeof(STB_TEXTEDIT_POSITIONTYPE)] * STB_TEXTEDIT_UNDOSTATECOUNT +// + sizeof(STB_TEXTEDIT_CHARTYPE) * STB_TEXTEDIT_UNDOCHARCOUNT // // // Implementation mode: @@ -205,6 +211,7 @@ // int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) // int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int len) // void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXEDIT_KEYTYPE key) +// void stb_textedit_text(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int text_len) // // Each of these functions potentially updates the string and updates the // state. @@ -217,20 +224,20 @@ // call this with the mouse x,y on a mouse down; it will update the cursor // and reset the selection start/end to the cursor point. the x,y must // be relative to the text widget, with (0,0) being the top left. -// +// // drag: // call this with the mouse x,y on a mouse drag/up; it will update the // cursor and the selection end point -// +// // cut: // call this to delete the current selection; returns true if there was // one. you should FIRST copy the current selection to the system paste buffer. // (To copy, just copy the current selection out of the string yourself.) -// +// // paste: // call this to paste text at the current cursor point or over the current // selection if there is one. -// +// // key: // call this for keyboard inputs sent to the textfield. you can use it // for "key down" events or for "translated" key events. if you need to @@ -239,9 +246,14 @@ // various definitions like STB_TEXTEDIT_K_LEFT have the is-key-event bit // set, and make STB_TEXTEDIT_KEYTOCHAR check that the is-key-event bit is // clear. STB_TEXTEDIT_KEYTYPE defaults to int, but you can #define it to -// anything other type you wante before including. +// anything other type you want before including. +// if the STB_TEXTEDIT_KEYTOTEXT function is defined, selected keys are +// transformed into text and stb_textedit_text() is automatically called. +// +// text: [DEAR IMGUI] added 2024-09 +// call this to text inputs sent to the textfield. +// // -// // When rendering, you can read the cursor position and selection state from // the STB_TexteditState. // @@ -271,8 +283,8 @@ //// //// -#ifndef INCLUDE_STB_TEXTEDIT_H -#define INCLUDE_STB_TEXTEDIT_H +#ifndef INCLUDE_IMSTB_TEXTEDIT_H +#define INCLUDE_IMSTB_TEXTEDIT_H //////////////////////////////////////////////////////////////////////// // @@ -283,38 +295,38 @@ // and undo state. // -#ifndef STB_TEXTEDIT_UNDOSTATECOUNT -#define STB_TEXTEDIT_UNDOSTATECOUNT 99 +#ifndef IMSTB_TEXTEDIT_UNDOSTATECOUNT +#define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99 #endif -#ifndef STB_TEXTEDIT_UNDOCHARCOUNT -#define STB_TEXTEDIT_UNDOCHARCOUNT 999 +#ifndef IMSTB_TEXTEDIT_UNDOCHARCOUNT +#define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999 #endif -#ifndef STB_TEXTEDIT_CHARTYPE -#define STB_TEXTEDIT_CHARTYPE int +#ifndef IMSTB_TEXTEDIT_CHARTYPE +#define IMSTB_TEXTEDIT_CHARTYPE int #endif -#ifndef STB_TEXTEDIT_POSITIONTYPE -#define STB_TEXTEDIT_POSITIONTYPE int +#ifndef IMSTB_TEXTEDIT_POSITIONTYPE +#define IMSTB_TEXTEDIT_POSITIONTYPE int #endif typedef struct { // private data - STB_TEXTEDIT_POSITIONTYPE where; - STB_TEXTEDIT_POSITIONTYPE insert_length; - STB_TEXTEDIT_POSITIONTYPE delete_length; + IMSTB_TEXTEDIT_POSITIONTYPE where; + IMSTB_TEXTEDIT_POSITIONTYPE insert_length; + IMSTB_TEXTEDIT_POSITIONTYPE delete_length; int char_storage; } StbUndoRecord; typedef struct { // private data - StbUndoRecord undo_rec [STB_TEXTEDIT_UNDOSTATECOUNT]; - STB_TEXTEDIT_CHARTYPE undo_char[STB_TEXTEDIT_UNDOCHARCOUNT]; + StbUndoRecord undo_rec [IMSTB_TEXTEDIT_UNDOSTATECOUNT]; + IMSTB_TEXTEDIT_CHARTYPE undo_char[IMSTB_TEXTEDIT_UNDOCHARCOUNT]; short undo_point, redo_point; int undo_char_point, redo_char_point; } StbUndoState; -typedef struct +typedef struct STB_TexteditState { ///////////////////// // @@ -368,7 +380,7 @@ typedef struct float ymin,ymax; // height of row above and below baseline int num_chars; } StbTexteditRow; -#endif //INCLUDE_STB_TEXTEDIT_H +#endif //INCLUDE_IMSTB_TEXTEDIT_H //////////////////////////////////////////////////////////////////////////// @@ -381,11 +393,11 @@ typedef struct // implementation isn't include-guarded, since it might have indirectly // included just the "header" portion -#ifdef STB_TEXTEDIT_IMPLEMENTATION +#ifdef IMSTB_TEXTEDIT_IMPLEMENTATION -#ifndef STB_TEXTEDIT_memmove +#ifndef IMSTB_TEXTEDIT_memmove #include -#define STB_TEXTEDIT_memmove memmove +#define IMSTB_TEXTEDIT_memmove memmove #endif @@ -395,7 +407,7 @@ typedef struct // // traverse the layout to locate the nearest character to a display position -static int stb_text_locate_coord(STB_TEXTEDIT_STRING *str, float x, float y) +static int stb_text_locate_coord(IMSTB_TEXTEDIT_STRING *str, float x, float y) { StbTexteditRow r; int n = STB_TEXTEDIT_STRINGLEN(str); @@ -434,13 +446,13 @@ static int stb_text_locate_coord(STB_TEXTEDIT_STRING *str, float x, float y) if (x < r.x1) { // search characters in row for one that straddles 'x' prev_x = r.x0; - for (k=0; k < r.num_chars; ++k) { + for (k=0; k < r.num_chars; k = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, i + k) - i) { float w = STB_TEXTEDIT_GETWIDTH(str, i, k); if (x < prev_x+w) { if (x < prev_x+w/2) return k+i; else - return k+i+1; + return IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, i + k); } prev_x += w; } @@ -455,7 +467,7 @@ static int stb_text_locate_coord(STB_TEXTEDIT_STRING *str, float x, float y) } // API click: on mouse down, move the cursor to the clicked location, and reset the selection -static void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) +static void stb_textedit_click(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) { // In single-line mode, just always make y = 0. This lets the drag keep working if the mouse // goes off the top or bottom of the text @@ -473,7 +485,7 @@ static void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *stat } // API drag: on mouse drag, move the cursor and selection endpoint to the clicked location -static void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) +static void stb_textedit_drag(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) { int p = 0; @@ -499,11 +511,11 @@ static void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state // // forward declarations -static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state); -static void stb_text_redo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state); -static void stb_text_makeundo_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length); +static void stb_text_undo(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state); +static void stb_text_redo(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state); +static void stb_text_makeundo_delete(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length); static void stb_text_makeundo_insert(STB_TexteditState *state, int where, int length); -static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length); +static void stb_text_makeundo_replace(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length); typedef struct { @@ -515,36 +527,21 @@ typedef struct // find the x/y location of a character, and remember info about the previous row in // case we get a move-up event (for page up, we'll have to rescan) -static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *str, int n, int single_line) +static void stb_textedit_find_charpos(StbFindState *find, IMSTB_TEXTEDIT_STRING *str, int n, int single_line) { StbTexteditRow r; int prev_start = 0; int z = STB_TEXTEDIT_STRINGLEN(str); int i=0, first; - if (n == z) { - // if it's at the end, then find the last line -- simpler than trying to - // explicitly handle this case in the regular code - if (single_line) { - STB_TEXTEDIT_LAYOUTROW(&r, str, 0); - find->y = 0; - find->first_char = 0; - find->length = z; - find->height = r.ymax - r.ymin; - find->x = r.x1; - } else { - find->y = 0; - find->x = 0; - find->height = 1; - while (i < z) { - STB_TEXTEDIT_LAYOUTROW(&r, str, i); - prev_start = i; - i += r.num_chars; - } - find->first_char = i; - find->length = 0; - find->prev_first = prev_start; - } + if (n == z && single_line) { + // special case if it's at the end (may not be needed?) + STB_TEXTEDIT_LAYOUTROW(&r, str, 0); + find->y = 0; + find->first_char = 0; + find->length = z; + find->height = r.ymax - r.ymin; + find->x = r.x1; return; } @@ -555,9 +552,16 @@ static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *s STB_TEXTEDIT_LAYOUTROW(&r, str, i); if (n < i + r.num_chars) break; + if (i + r.num_chars == z && z > 0 && STB_TEXTEDIT_GETCHAR(str, z - 1) != STB_TEXTEDIT_NEWLINE) // [DEAR IMGUI] special handling for last line + break; // [DEAR IMGUI] prev_start = i; i += r.num_chars; find->y += r.baseline_y_delta; + if (i == z) // [DEAR IMGUI] + { + r.num_chars = 0; // [DEAR IMGUI] + break; // [DEAR IMGUI] + } } find->first_char = first = i; @@ -567,14 +571,14 @@ static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *s // now scan to find xpos find->x = r.x0; - for (i=0; first+i < n; ++i) + for (i=0; first+i < n; i = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, first + i) - first) find->x += STB_TEXTEDIT_GETWIDTH(str, first, i); } #define STB_TEXT_HAS_SELECTION(s) ((s)->select_start != (s)->select_end) // make the selection/cursor state valid if client altered the string -static void stb_textedit_clamp(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) +static void stb_textedit_clamp(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state) { int n = STB_TEXTEDIT_STRINGLEN(str); if (STB_TEXT_HAS_SELECTION(state)) { @@ -588,7 +592,7 @@ static void stb_textedit_clamp(STB_TEXTEDIT_STRING *str, STB_TexteditState *stat } // delete characters while updating undo -static void stb_textedit_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int len) +static void stb_textedit_delete(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int len) { stb_text_makeundo_delete(str, state, where, len); STB_TEXTEDIT_DELETECHARS(str, where, len); @@ -596,7 +600,7 @@ static void stb_textedit_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *sta } // delete the section -static void stb_textedit_delete_selection(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) +static void stb_textedit_delete_selection(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state) { stb_textedit_clamp(str, state); if (STB_TEXT_HAS_SELECTION(state)) { @@ -633,7 +637,7 @@ static void stb_textedit_move_to_first(STB_TexteditState *state) } // move cursor to last character of selection -static void stb_textedit_move_to_last(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) +static void stb_textedit_move_to_last(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state) { if (STB_TEXT_HAS_SELECTION(state)) { stb_textedit_sortselection(state); @@ -644,14 +648,25 @@ static void stb_textedit_move_to_last(STB_TEXTEDIT_STRING *str, STB_TexteditStat } } +// [DEAR IMGUI] +// Functions must be implemented for UTF8 support +// Code in this file that uses those functions is modified for [DEAR IMGUI] and deviates from the original stb_textedit. +// There is not necessarily a '[DEAR IMGUI]' at the usage sites. +#ifndef IMSTB_TEXTEDIT_GETPREVCHARINDEX +#define IMSTB_TEXTEDIT_GETPREVCHARINDEX(obj, idx) (idx - 1) +#endif +#ifndef IMSTB_TEXTEDIT_GETNEXTCHARINDEX +#define IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx) (idx + 1) +#endif + #ifdef STB_TEXTEDIT_IS_SPACE -static int is_word_boundary( STB_TEXTEDIT_STRING *str, int idx ) +static int is_word_boundary( IMSTB_TEXTEDIT_STRING *str, int idx ) { return idx > 0 ? (STB_TEXTEDIT_IS_SPACE( STB_TEXTEDIT_GETCHAR(str,idx-1) ) && !STB_TEXTEDIT_IS_SPACE( STB_TEXTEDIT_GETCHAR(str, idx) ) ) : 1; } #ifndef STB_TEXTEDIT_MOVEWORDLEFT -static int stb_textedit_move_to_word_previous( STB_TEXTEDIT_STRING *str, int c ) +static int stb_textedit_move_to_word_previous( IMSTB_TEXTEDIT_STRING *str, int c ) { --c; // always move at least one character while( c >= 0 && !is_word_boundary( str, c ) ) @@ -666,7 +681,7 @@ static int stb_textedit_move_to_word_previous( STB_TEXTEDIT_STRING *str, int c ) #endif #ifndef STB_TEXTEDIT_MOVEWORDRIGHT -static int stb_textedit_move_to_word_next( STB_TEXTEDIT_STRING *str, int c ) +static int stb_textedit_move_to_word_next( IMSTB_TEXTEDIT_STRING *str, int c ) { const int len = STB_TEXTEDIT_STRINGLEN(str); ++c; // always move at least one character @@ -693,7 +708,7 @@ static void stb_textedit_prep_selection_at_cursor(STB_TexteditState *state) } // API cut: delete selection -static int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) +static int stb_textedit_cut(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state) { if (STB_TEXT_HAS_SELECTION(state)) { stb_textedit_delete_selection(str,state); // implicitly clamps @@ -704,7 +719,7 @@ static int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) } // API paste: replace existing selection with passed-in text -static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int len) +static int stb_textedit_paste_internal(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, IMSTB_TEXTEDIT_CHARTYPE *text, int len) { // if there's a selection, the paste should delete it stb_textedit_clamp(str, state); @@ -716,9 +731,7 @@ static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditSta state->has_preferred_x = 0; return 1; } - // remove the undo since we didn't actually insert the characters - if (state->undostate.undo_point) - --state->undostate.undo_point; + // note: paste failure will leave deleted selection, may be restored with an undo (see https://github.com/nothings/stb/issues/734 for details) return 0; } @@ -726,36 +739,44 @@ static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditSta #define STB_TEXTEDIT_KEYTYPE int #endif +// [DEAR IMGUI] Added stb_textedit_text(), extracted out and called by stb_textedit_key() for backward compatibility. +static void stb_textedit_text(IMSTB_TEXTEDIT_STRING* str, STB_TexteditState* state, const IMSTB_TEXTEDIT_CHARTYPE* text, int text_len) +{ + // can't add newline in single-line mode + if (text[0] == '\n' && state->single_line) + return; + + if (state->insert_mode && !STB_TEXT_HAS_SELECTION(state) && state->cursor < STB_TEXTEDIT_STRINGLEN(str)) { + stb_text_makeundo_replace(str, state, state->cursor, 1, 1); + STB_TEXTEDIT_DELETECHARS(str, state->cursor, 1); + if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, text, text_len)) { + state->cursor += text_len; + state->has_preferred_x = 0; + } + } + else { + stb_textedit_delete_selection(str, state); // implicitly clamps + if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, text, text_len)) { + stb_text_makeundo_insert(state, state->cursor, text_len); + state->cursor += text_len; + state->has_preferred_x = 0; + } + } +} + // API key: process a keyboard input -static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_KEYTYPE key) +static void stb_textedit_key(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_KEYTYPE key) { retry: switch (key) { default: { +#ifdef STB_TEXTEDIT_KEYTOTEXT int c = STB_TEXTEDIT_KEYTOTEXT(key); if (c > 0) { - STB_TEXTEDIT_CHARTYPE ch = (STB_TEXTEDIT_CHARTYPE) c; - - // can't add newline in single-line mode - if (c == '\n' && state->single_line) - break; - - if (state->insert_mode && !STB_TEXT_HAS_SELECTION(state) && state->cursor < STB_TEXTEDIT_STRINGLEN(str)) { - stb_text_makeundo_replace(str, state, state->cursor, 1, 1); - STB_TEXTEDIT_DELETECHARS(str, state->cursor, 1); - if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) { - ++state->cursor; - state->has_preferred_x = 0; - } - } else { - stb_textedit_delete_selection(str,state); // implicitly clamps - if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) { - stb_text_makeundo_insert(state, state->cursor, 1); - ++state->cursor; - state->has_preferred_x = 0; - } - } + IMSTB_TEXTEDIT_CHARTYPE ch = (IMSTB_TEXTEDIT_CHARTYPE)c; + stb_textedit_text(str, state, &ch, 1); } +#endif break; } @@ -764,7 +785,7 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, state->insert_mode = !state->insert_mode; break; #endif - + case STB_TEXTEDIT_K_UNDO: stb_text_undo(str, state); state->has_preferred_x = 0; @@ -779,9 +800,9 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, // if currently there's a selection, move cursor to start of selection if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_move_to_first(state); - else + else if (state->cursor > 0) - --state->cursor; + state->cursor = IMSTB_TEXTEDIT_GETPREVCHARINDEX(str, state->cursor); state->has_preferred_x = 0; break; @@ -790,7 +811,7 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_move_to_last(str, state); else - ++state->cursor; + state->cursor = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor); stb_textedit_clamp(str, state); state->has_preferred_x = 0; break; @@ -800,7 +821,7 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, stb_textedit_prep_selection_at_cursor(state); // move selection left if (state->select_end > 0) - --state->select_end; + state->select_end = IMSTB_TEXTEDIT_GETPREVCHARINDEX(str, state->select_end); state->cursor = state->select_end; state->has_preferred_x = 0; break; @@ -828,7 +849,7 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, #ifdef STB_TEXTEDIT_MOVEWORDRIGHT case STB_TEXTEDIT_K_WORDRIGHT: - if (STB_TEXT_HAS_SELECTION(state)) + if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_move_to_last(str, state); else { state->cursor = STB_TEXTEDIT_MOVEWORDRIGHT(str, state->cursor); @@ -850,7 +871,7 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, case STB_TEXTEDIT_K_RIGHT | STB_TEXTEDIT_K_SHIFT: stb_textedit_prep_selection_at_cursor(state); // move selection right - ++state->select_end; + state->select_end = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->select_end); stb_textedit_clamp(str, state); state->cursor = state->select_end; state->has_preferred_x = 0; @@ -899,14 +920,14 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, x = row.x0; for (i=0; i < row.num_chars; ++i) { float dx = STB_TEXTEDIT_GETWIDTH(str, start, i); - #ifdef STB_TEXTEDIT_GETWIDTH_NEWLINE - if (dx == STB_TEXTEDIT_GETWIDTH_NEWLINE) + #ifdef IMSTB_TEXTEDIT_GETWIDTH_NEWLINE + if (dx == IMSTB_TEXTEDIT_GETWIDTH_NEWLINE) break; #endif x += dx; if (x > goal_x) break; - ++state->cursor; + state->cursor = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor); } stb_textedit_clamp(str, state); @@ -922,7 +943,7 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, } break; } - + case STB_TEXTEDIT_K_UP: case STB_TEXTEDIT_K_UP | STB_TEXTEDIT_K_SHIFT: case STB_TEXTEDIT_K_PGUP: @@ -961,14 +982,14 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, x = row.x0; for (i=0; i < row.num_chars; ++i) { float dx = STB_TEXTEDIT_GETWIDTH(str, find.prev_first, i); - #ifdef STB_TEXTEDIT_GETWIDTH_NEWLINE - if (dx == STB_TEXTEDIT_GETWIDTH_NEWLINE) + #ifdef IMSTB_TEXTEDIT_GETWIDTH_NEWLINE + if (dx == IMSTB_TEXTEDIT_GETWIDTH_NEWLINE) break; #endif x += dx; if (x > goal_x) break; - ++state->cursor; + state->cursor = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor); } stb_textedit_clamp(str, state); @@ -996,7 +1017,7 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, else { int n = STB_TEXTEDIT_STRINGLEN(str); if (state->cursor < n) - stb_textedit_delete(str, state, state->cursor, 1); + stb_textedit_delete(str, state, state->cursor, IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor) - state->cursor); } state->has_preferred_x = 0; break; @@ -1008,13 +1029,14 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, else { stb_textedit_clamp(str, state); if (state->cursor > 0) { - stb_textedit_delete(str, state, state->cursor-1, 1); - --state->cursor; + int prev = IMSTB_TEXTEDIT_GETPREVCHARINDEX(str, state->cursor); + stb_textedit_delete(str, state, prev, state->cursor - prev); + state->cursor = prev; } } state->has_preferred_x = 0; break; - + #ifdef STB_TEXTEDIT_K_TEXTSTART2 case STB_TEXTEDIT_K_TEXTSTART2: #endif @@ -1031,7 +1053,7 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, state->select_start = state->select_end = 0; state->has_preferred_x = 0; break; - + #ifdef STB_TEXTEDIT_K_TEXTSTART2 case STB_TEXTEDIT_K_TEXTSTART2 | STB_TEXTEDIT_K_SHIFT: #endif @@ -1119,8 +1141,8 @@ static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, static void stb_textedit_flush_redo(StbUndoState *state) { - state->redo_point = STB_TEXTEDIT_UNDOSTATECOUNT; - state->redo_char_point = STB_TEXTEDIT_UNDOCHARCOUNT; + state->redo_point = IMSTB_TEXTEDIT_UNDOSTATECOUNT; + state->redo_char_point = IMSTB_TEXTEDIT_UNDOCHARCOUNT; } // discard the oldest entry in the undo list @@ -1132,13 +1154,13 @@ static void stb_textedit_discard_undo(StbUndoState *state) int n = state->undo_rec[0].insert_length, i; // delete n characters from all other records state->undo_char_point -= n; - STB_TEXTEDIT_memmove(state->undo_char, state->undo_char + n, (size_t) (state->undo_char_point*sizeof(STB_TEXTEDIT_CHARTYPE))); + IMSTB_TEXTEDIT_memmove(state->undo_char, state->undo_char + n, (size_t) (state->undo_char_point*sizeof(IMSTB_TEXTEDIT_CHARTYPE))); for (i=0; i < state->undo_point; ++i) if (state->undo_rec[i].char_storage >= 0) state->undo_rec[i].char_storage -= n; // @OPTIMIZE: get rid of char_storage and infer it } --state->undo_point; - STB_TEXTEDIT_memmove(state->undo_rec, state->undo_rec+1, (size_t) (state->undo_point*sizeof(state->undo_rec[0]))); + IMSTB_TEXTEDIT_memmove(state->undo_rec, state->undo_rec+1, (size_t) (state->undo_point*sizeof(state->undo_rec[0]))); } } @@ -1148,7 +1170,7 @@ static void stb_textedit_discard_undo(StbUndoState *state) // fill up even though the undo buffer didn't static void stb_textedit_discard_redo(StbUndoState *state) { - int k = STB_TEXTEDIT_UNDOSTATECOUNT-1; + int k = IMSTB_TEXTEDIT_UNDOSTATECOUNT-1; if (state->redo_point <= k) { // if the k'th undo state has characters, clean those up @@ -1156,7 +1178,7 @@ static void stb_textedit_discard_redo(StbUndoState *state) int n = state->undo_rec[k].insert_length, i; // move the remaining redo character data to the end of the buffer state->redo_char_point += n; - STB_TEXTEDIT_memmove(state->undo_char + state->redo_char_point, state->undo_char + state->redo_char_point-n, (size_t) ((STB_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point)*sizeof(STB_TEXTEDIT_CHARTYPE))); + IMSTB_TEXTEDIT_memmove(state->undo_char + state->redo_char_point, state->undo_char + state->redo_char_point-n, (size_t) ((IMSTB_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point)*sizeof(IMSTB_TEXTEDIT_CHARTYPE))); // adjust the position of all the other records to account for above memmove for (i=state->redo_point; i < k; ++i) if (state->undo_rec[i].char_storage >= 0) @@ -1164,12 +1186,12 @@ static void stb_textedit_discard_redo(StbUndoState *state) } // now move all the redo records towards the end of the buffer; the first one is at 'redo_point' // [DEAR IMGUI] - size_t move_size = (size_t)((STB_TEXTEDIT_UNDOSTATECOUNT - state->redo_point - 1) * sizeof(state->undo_rec[0])); + size_t move_size = (size_t)((IMSTB_TEXTEDIT_UNDOSTATECOUNT - state->redo_point - 1) * sizeof(state->undo_rec[0])); const char* buf_begin = (char*)state->undo_rec; (void)buf_begin; const char* buf_end = (char*)state->undo_rec + sizeof(state->undo_rec); (void)buf_end; IM_ASSERT(((char*)(state->undo_rec + state->redo_point)) >= buf_begin); IM_ASSERT(((char*)(state->undo_rec + state->redo_point + 1) + move_size) <= buf_end); - STB_TEXTEDIT_memmove(state->undo_rec + state->redo_point+1, state->undo_rec + state->redo_point, move_size); + IMSTB_TEXTEDIT_memmove(state->undo_rec + state->redo_point+1, state->undo_rec + state->redo_point, move_size); // now move redo_point to point to the new one ++state->redo_point; @@ -1183,32 +1205,32 @@ static StbUndoRecord *stb_text_create_undo_record(StbUndoState *state, int numch // if we have no free records, we have to make room, by sliding the // existing records down - if (state->undo_point == STB_TEXTEDIT_UNDOSTATECOUNT) + if (state->undo_point == IMSTB_TEXTEDIT_UNDOSTATECOUNT) stb_textedit_discard_undo(state); // if the characters to store won't possibly fit in the buffer, we can't undo - if (numchars > STB_TEXTEDIT_UNDOCHARCOUNT) { + if (numchars > IMSTB_TEXTEDIT_UNDOCHARCOUNT) { state->undo_point = 0; state->undo_char_point = 0; return NULL; } // if we don't have enough free characters in the buffer, we have to make room - while (state->undo_char_point + numchars > STB_TEXTEDIT_UNDOCHARCOUNT) + while (state->undo_char_point + numchars > IMSTB_TEXTEDIT_UNDOCHARCOUNT) stb_textedit_discard_undo(state); return &state->undo_rec[state->undo_point++]; } -static STB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos, int insert_len, int delete_len) +static IMSTB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos, int insert_len, int delete_len) { StbUndoRecord *r = stb_text_create_undo_record(state, insert_len); if (r == NULL) return NULL; r->where = pos; - r->insert_length = (STB_TEXTEDIT_POSITIONTYPE) insert_len; - r->delete_length = (STB_TEXTEDIT_POSITIONTYPE) delete_len; + r->insert_length = (IMSTB_TEXTEDIT_POSITIONTYPE) insert_len; + r->delete_length = (IMSTB_TEXTEDIT_POSITIONTYPE) delete_len; if (insert_len == 0) { r->char_storage = -1; @@ -1220,7 +1242,7 @@ static STB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos, } } -static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) +static void stb_text_undo(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state) { StbUndoState *s = &state->undostate; StbUndoRecord u, *r; @@ -1247,7 +1269,7 @@ static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) // characters stored for *undoing* don't leave room for redo // if the last is true, we have to bail - if (s->undo_char_point + u.delete_length >= STB_TEXTEDIT_UNDOCHARCOUNT) { + if (s->undo_char_point + u.delete_length >= IMSTB_TEXTEDIT_UNDOCHARCOUNT) { // the undo records take up too much character space; there's no space to store the redo characters r->insert_length = 0; } else { @@ -1256,7 +1278,7 @@ static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) // there's definitely room to store the characters eventually while (s->undo_char_point + u.delete_length > s->redo_char_point) { // should never happen: - if (s->redo_point == STB_TEXTEDIT_UNDOSTATECOUNT) + if (s->redo_point == IMSTB_TEXTEDIT_UNDOSTATECOUNT) return; // there's currently not enough room, so discard a redo record stb_textedit_discard_redo(s); @@ -1288,11 +1310,11 @@ static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) s->redo_point--; } -static void stb_text_redo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) +static void stb_text_redo(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state) { StbUndoState *s = &state->undostate; StbUndoRecord *u, r; - if (s->redo_point == STB_TEXTEDIT_UNDOSTATECOUNT) + if (s->redo_point == IMSTB_TEXTEDIT_UNDOSTATECOUNT) return; // we need to do two things: apply the redo record, and create an undo record @@ -1344,20 +1366,20 @@ static void stb_text_makeundo_insert(STB_TexteditState *state, int where, int le stb_text_createundo(&state->undostate, where, 0, length); } -static void stb_text_makeundo_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length) +static void stb_text_makeundo_delete(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length) { int i; - STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, length, 0); + IMSTB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, length, 0); if (p) { for (i=0; i < length; ++i) p[i] = STB_TEXTEDIT_GETCHAR(str, where+i); } } -static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length) +static void stb_text_makeundo_replace(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length) { int i; - STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, old_length, new_length); + IMSTB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, old_length, new_length); if (p) { for (i=0; i < old_length; ++i) p[i] = STB_TEXTEDIT_GETCHAR(str, where+i); @@ -1369,8 +1391,8 @@ static void stb_textedit_clear_state(STB_TexteditState *state, int is_single_lin { state->undostate.undo_point = 0; state->undostate.undo_char_point = 0; - state->undostate.redo_point = STB_TEXTEDIT_UNDOSTATECOUNT; - state->undostate.redo_char_point = STB_TEXTEDIT_UNDOCHARCOUNT; + state->undostate.redo_point = IMSTB_TEXTEDIT_UNDOSTATECOUNT; + state->undostate.redo_char_point = IMSTB_TEXTEDIT_UNDOCHARCOUNT; state->select_end = state->select_start = 0; state->cursor = 0; state->has_preferred_x = 0; @@ -1393,16 +1415,16 @@ static void stb_textedit_initialize_state(STB_TexteditState *state, int is_singl #pragma GCC diagnostic ignored "-Wcast-qual" #endif -static int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE const *ctext, int len) +static int stb_textedit_paste(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, IMSTB_TEXTEDIT_CHARTYPE const *ctext, int len) { - return stb_textedit_paste_internal(str, state, (STB_TEXTEDIT_CHARTYPE *) ctext, len); + return stb_textedit_paste_internal(str, state, (IMSTB_TEXTEDIT_CHARTYPE *) ctext, len); } #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop #endif -#endif//STB_TEXTEDIT_IMPLEMENTATION +#endif//IMSTB_TEXTEDIT_IMPLEMENTATION /* ------------------------------------------------------------------------------ @@ -1410,38 +1432,38 @@ This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------ ALTERNATIVE A - MIT License Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ ALTERNATIVE B - Public Domain (www.unlicense.org) This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS 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 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ diff --git a/bgfx/3rdparty/stb/stb_truetype.h b/bgfx/3rdparty/stb/stb_truetype.h index 86968395..90a5c2e2 100644 --- a/bgfx/3rdparty/stb/stb_truetype.h +++ b/bgfx/3rdparty/stb/stb_truetype.h @@ -1,5 +1,5 @@ -// stb_truetype.h - v1.24 - public domain -// authored from 2009-2020 by Sean Barrett / RAD Game Tools +// stb_truetype.h - v1.26 - public domain +// authored from 2009-2021 by Sean Barrett / RAD Game Tools // // ======================================================================= // @@ -53,11 +53,13 @@ // Johan Duparc Thomas Fields // Hou Qiming Derek Vinyard // Rob Loach Cort Stratton -// Kenney Phillis Jr. Brian Costabile -// Ken Voskuil (kaesve) +// Kenney Phillis Jr. Brian Costabile +// Ken Voskuil (kaesve) Yakov Galka // // VERSION HISTORY // +// 1.26 (2021-08-28) fix broken rasterizer +// 1.25 (2021-07-11) many fixes // 1.24 (2020-02-05) fix warning // 1.23 (2020-02-02) query SVG data for glyphs; query whole kerning table (but only kern not GPOS) // 1.22 (2019-08-11) minimize missing-glyph duplication; fix kerning if both 'GPOS' and 'kern' are defined @@ -270,8 +272,8 @@ //// SAMPLE PROGRAMS //// // -// Incomplete text-in-3d-api example, which draws quads properly aligned to be lossless -// +// Incomplete text-in-3d-api example, which draws quads properly aligned to be lossless. +// See "tests/truetype_demo_win32.c" for a complete version. #if 0 #define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation #include "stb_truetype.h" @@ -297,6 +299,8 @@ void my_stbtt_initfont(void) void my_stbtt_print(float x, float y, char *text) { // assume orthographic projection with units = screen pixels, origin at top left + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, ftex); glBegin(GL_QUADS); @@ -304,10 +308,10 @@ void my_stbtt_print(float x, float y, char *text) if (*text >= 32 && *text < 128) { stbtt_aligned_quad q; stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl & d3d10+,0=d3d9 - glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y0); - glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y0); - glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y1); - glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y1); + glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y0); + glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y0); + glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y1); + glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y1); } ++text; } @@ -853,6 +857,7 @@ STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, s STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices); // frees the data allocated above +STBTT_DEF unsigned char *stbtt_FindSVGDoc(const stbtt_fontinfo *info, int gl); STBTT_DEF int stbtt_GetCodepointSVG(const stbtt_fontinfo *info, int unicode_codepoint, const char **svg); STBTT_DEF int stbtt_GetGlyphSVG(const stbtt_fontinfo *info, int gl, const char **svg); // fills svg with the character's SVG data. @@ -1539,12 +1544,12 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep search += 2; { - stbtt_uint16 offset, start; + stbtt_uint16 offset, start, last; stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1); - STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item)); start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item); - if (unicode_codepoint < start) + last = ttUSHORT(data + endCount + 2*item); + if (unicode_codepoint < start || unicode_codepoint > last) return 0; offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item); @@ -1576,7 +1581,8 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep } return 0; // not found } - + // @TODO + STBTT_assert(0); return 0; } @@ -1870,7 +1876,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s if (comp_verts) STBTT_free(comp_verts, info->userdata); return 0; } - if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); + if (num_vertices > 0 && vertices) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex)); if (vertices) STBTT_free(vertices, info->userdata); vertices = tmp; @@ -2133,7 +2139,7 @@ static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, st subrs = stbtt__cid_get_glyph_subrs(info, glyph_index); has_subrs = 1; } - // fallthrough + // FALLTHROUGH case 0x1D: // callgsubr if (sp < 1) return STBTT__CSERR("call(g|)subr stack"); v = (int) s[--sp]; @@ -2238,7 +2244,7 @@ static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, st } break; default: - if (b0 != 255 && b0 != 28 && (b0 < 32 || b0 > 254)) + if (b0 != 255 && b0 != 28 && b0 < 32) return STBTT__CSERR("reserved operator"); // push immediate @@ -2350,7 +2356,7 @@ STBTT_DEF int stbtt_GetKerningTable(const stbtt_fontinfo *info, stbtt_kerningent return length; } -static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) +static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) { stbtt_uint8 *data = info->data + info->kern; stbtt_uint32 needle, straw; @@ -2380,243 +2386,225 @@ static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph return 0; } -static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyph) -{ - stbtt_uint16 coverageFormat = ttUSHORT(coverageTable); - switch(coverageFormat) { - case 1: { - stbtt_uint16 glyphCount = ttUSHORT(coverageTable + 2); - - // Binary search. - stbtt_int32 l=0, r=glyphCount-1, m; - int straw, needle=glyph; - while (l <= r) { - stbtt_uint8 *glyphArray = coverageTable + 4; - stbtt_uint16 glyphID; - m = (l + r) >> 1; - glyphID = ttUSHORT(glyphArray + 2 * m); - straw = glyphID; - if (needle < straw) - r = m - 1; - else if (needle > straw) - l = m + 1; - else { - return m; - } +static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyph) +{ + stbtt_uint16 coverageFormat = ttUSHORT(coverageTable); + switch (coverageFormat) { + case 1: { + stbtt_uint16 glyphCount = ttUSHORT(coverageTable + 2); + + // Binary search. + stbtt_int32 l=0, r=glyphCount-1, m; + int straw, needle=glyph; + while (l <= r) { + stbtt_uint8 *glyphArray = coverageTable + 4; + stbtt_uint16 glyphID; + m = (l + r) >> 1; + glyphID = ttUSHORT(glyphArray + 2 * m); + straw = glyphID; + if (needle < straw) + r = m - 1; + else if (needle > straw) + l = m + 1; + else { + return m; } - } break; - - case 2: { - stbtt_uint16 rangeCount = ttUSHORT(coverageTable + 2); - stbtt_uint8 *rangeArray = coverageTable + 4; - - // Binary search. - stbtt_int32 l=0, r=rangeCount-1, m; - int strawStart, strawEnd, needle=glyph; - while (l <= r) { - stbtt_uint8 *rangeRecord; - m = (l + r) >> 1; - rangeRecord = rangeArray + 6 * m; - strawStart = ttUSHORT(rangeRecord); - strawEnd = ttUSHORT(rangeRecord + 2); - if (needle < strawStart) - r = m - 1; - else if (needle > strawEnd) - l = m + 1; - else { - stbtt_uint16 startCoverageIndex = ttUSHORT(rangeRecord + 4); - return startCoverageIndex + glyph - strawStart; - } + } + break; + } + + case 2: { + stbtt_uint16 rangeCount = ttUSHORT(coverageTable + 2); + stbtt_uint8 *rangeArray = coverageTable + 4; + + // Binary search. + stbtt_int32 l=0, r=rangeCount-1, m; + int strawStart, strawEnd, needle=glyph; + while (l <= r) { + stbtt_uint8 *rangeRecord; + m = (l + r) >> 1; + rangeRecord = rangeArray + 6 * m; + strawStart = ttUSHORT(rangeRecord); + strawEnd = ttUSHORT(rangeRecord + 2); + if (needle < strawStart) + r = m - 1; + else if (needle > strawEnd) + l = m + 1; + else { + stbtt_uint16 startCoverageIndex = ttUSHORT(rangeRecord + 4); + return startCoverageIndex + glyph - strawStart; } - } break; + } + break; + } - default: { - // There are no other cases. - STBTT_assert(0); - } break; - } + default: return -1; // unsupported + } - return -1; + return -1; } static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph) { - stbtt_uint16 classDefFormat = ttUSHORT(classDefTable); - switch(classDefFormat) - { - case 1: { - stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2); - stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4); - stbtt_uint8 *classDef1ValueArray = classDefTable + 6; - - if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount) - return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID)); - - classDefTable = classDef1ValueArray + 2 * glyphCount; - } break; - - case 2: { - stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2); - stbtt_uint8 *classRangeRecords = classDefTable + 4; - - // Binary search. - stbtt_int32 l=0, r=classRangeCount-1, m; - int strawStart, strawEnd, needle=glyph; - while (l <= r) { - stbtt_uint8 *classRangeRecord; - m = (l + r) >> 1; - classRangeRecord = classRangeRecords + 6 * m; - strawStart = ttUSHORT(classRangeRecord); - strawEnd = ttUSHORT(classRangeRecord + 2); - if (needle < strawStart) - r = m - 1; - else if (needle > strawEnd) - l = m + 1; - else - return (stbtt_int32)ttUSHORT(classRangeRecord + 4); - } + stbtt_uint16 classDefFormat = ttUSHORT(classDefTable); + switch (classDefFormat) + { + case 1: { + stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2); + stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4); + stbtt_uint8 *classDef1ValueArray = classDefTable + 6; - classDefTable = classRangeRecords + 6 * classRangeCount; - } break; + if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount) + return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID)); + break; + } - default: { - // There are no other cases. - STBTT_assert(0); - } break; - } + case 2: { + stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2); + stbtt_uint8 *classRangeRecords = classDefTable + 4; + + // Binary search. + stbtt_int32 l=0, r=classRangeCount-1, m; + int strawStart, strawEnd, needle=glyph; + while (l <= r) { + stbtt_uint8 *classRangeRecord; + m = (l + r) >> 1; + classRangeRecord = classRangeRecords + 6 * m; + strawStart = ttUSHORT(classRangeRecord); + strawEnd = ttUSHORT(classRangeRecord + 2); + if (needle < strawStart) + r = m - 1; + else if (needle > strawEnd) + l = m + 1; + else + return (stbtt_int32)ttUSHORT(classRangeRecord + 4); + } + break; + } - return -1; + default: + return -1; // Unsupported definition type, return an error. + } + + // "All glyphs not assigned to a class fall into class 0". (OpenType spec) + return 0; } // Define to STBTT_assert(x) if you want to break on unimplemented formats. #define STBTT_GPOS_TODO_assert(x) -static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) -{ - stbtt_uint16 lookupListOffset; - stbtt_uint8 *lookupList; - stbtt_uint16 lookupCount; - stbtt_uint8 *data; - stbtt_int32 i; - - if (!info->gpos) return 0; - - data = info->data + info->gpos; - - if (ttUSHORT(data+0) != 1) return 0; // Major version 1 - if (ttUSHORT(data+2) != 0) return 0; // Minor version 0 - - lookupListOffset = ttUSHORT(data+8); - lookupList = data + lookupListOffset; - lookupCount = ttUSHORT(lookupList); - - for (i=0; i> 1; - pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m; - secondGlyph = ttUSHORT(pairValue); - straw = secondGlyph; - if (needle < straw) - r = m - 1; - else if (needle > straw) - l = m + 1; - else { - stbtt_int16 xAdvance = ttSHORT(pairValue + 2); - return xAdvance; - } - } - } break; - - case 2: { - stbtt_uint16 valueFormat1 = ttUSHORT(table + 4); - stbtt_uint16 valueFormat2 = ttUSHORT(table + 6); - - stbtt_uint16 classDef1Offset = ttUSHORT(table + 8); - stbtt_uint16 classDef2Offset = ttUSHORT(table + 10); - int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1); - int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2); - - stbtt_uint16 class1Count = ttUSHORT(table + 12); - stbtt_uint16 class2Count = ttUSHORT(table + 14); - STBTT_assert(glyph1class < class1Count); - STBTT_assert(glyph2class < class2Count); - - // TODO: Support more formats. - STBTT_GPOS_TODO_assert(valueFormat1 == 4); - if (valueFormat1 != 4) return 0; - STBTT_GPOS_TODO_assert(valueFormat2 == 0); - if (valueFormat2 != 0) return 0; - - if (glyph1class >= 0 && glyph1class < class1Count && glyph2class >= 0 && glyph2class < class2Count) { - stbtt_uint8 *class1Records = table + 16; - stbtt_uint8 *class2Records = class1Records + 2 * (glyph1class * class2Count); - stbtt_int16 xAdvance = ttSHORT(class2Records + 2 * glyph2class); - return xAdvance; - } - } break; - - default: { - // There are no other cases. - STBTT_assert(0); - break; - }; - } - } - break; - }; +static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) +{ + stbtt_uint16 lookupListOffset; + stbtt_uint8 *lookupList; + stbtt_uint16 lookupCount; + stbtt_uint8 *data; + stbtt_int32 i, sti; + + if (!info->gpos) return 0; + + data = info->data + info->gpos; + + if (ttUSHORT(data+0) != 1) return 0; // Major version 1 + if (ttUSHORT(data+2) != 0) return 0; // Minor version 0 + + lookupListOffset = ttUSHORT(data+8); + lookupList = data + lookupListOffset; + lookupCount = ttUSHORT(lookupList); + + for (i=0; i= pairSetCount) return 0; + + needle=glyph2; + r=pairValueCount-1; + l=0; + + // Binary search. + while (l <= r) { + stbtt_uint16 secondGlyph; + stbtt_uint8 *pairValue; + m = (l + r) >> 1; + pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m; + secondGlyph = ttUSHORT(pairValue); + straw = secondGlyph; + if (needle < straw) + r = m - 1; + else if (needle > straw) + l = m + 1; + else { + stbtt_int16 xAdvance = ttSHORT(pairValue + 2); + return xAdvance; + } + } + } else + return 0; + break; + } + + case 2: { + stbtt_uint16 valueFormat1 = ttUSHORT(table + 4); + stbtt_uint16 valueFormat2 = ttUSHORT(table + 6); + if (valueFormat1 == 4 && valueFormat2 == 0) { // Support more formats? + stbtt_uint16 classDef1Offset = ttUSHORT(table + 8); + stbtt_uint16 classDef2Offset = ttUSHORT(table + 10); + int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1); + int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2); + + stbtt_uint16 class1Count = ttUSHORT(table + 12); + stbtt_uint16 class2Count = ttUSHORT(table + 14); + stbtt_uint8 *class1Records, *class2Records; + stbtt_int16 xAdvance; + + if (glyph1class < 0 || glyph1class >= class1Count) return 0; // malformed + if (glyph2class < 0 || glyph2class >= class2Count) return 0; // malformed + + class1Records = table + 16; + class2Records = class1Records + 2 * (glyph1class * class2Count); + xAdvance = ttSHORT(class2Records + 2 * glyph2class); + return xAdvance; + } else + return 0; + break; + } default: - // TODO: Implement other stuff. - break; - } - } + return 0; // Unsupported position format + } + } + } - return 0; + return 0; } STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int g1, int g2) @@ -3074,6 +3062,23 @@ static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edg } } +static float stbtt__sized_trapezoid_area(float height, float top_width, float bottom_width) +{ + STBTT_assert(top_width >= 0); + STBTT_assert(bottom_width >= 0); + return (top_width + bottom_width) / 2.0f * height; +} + +static float stbtt__position_trapezoid_area(float height, float tx0, float tx1, float bx0, float bx1) +{ + return stbtt__sized_trapezoid_area(height, tx1 - tx0, bx1 - bx0); +} + +static float stbtt__sized_triangle_area(float height, float width) +{ + return height * width / 2; +} + static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top) { float y_bottom = y_top+1; @@ -3128,13 +3133,13 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, float height; // simple case, only spans one pixel int x = (int) x_top; - height = sy1 - sy0; + height = (sy1 - sy0) * e->direction; STBTT_assert(x >= 0 && x < len); - scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height; - scanline_fill[x] += e->direction * height; // everything right of this pixel is filled + scanline[x] += stbtt__position_trapezoid_area(height, x_top, x+1.0f, x_bottom, x+1.0f); + scanline_fill[x] += height; // everything right of this pixel is filled } else { int x,x1,x2; - float y_crossing, step, sign, area; + float y_crossing, y_final, step, sign, area; // covers 2+ pixels if (x_top > x_bottom) { // flip scanline vertically; signed area is the same @@ -3147,29 +3152,79 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, dy = -dy; t = x0, x0 = xb, xb = t; } + STBTT_assert(dy >= 0); + STBTT_assert(dx >= 0); x1 = (int) x_top; x2 = (int) x_bottom; // compute intersection with y axis at x1+1 - y_crossing = (x1+1 - x0) * dy + y_top; + y_crossing = y_top + dy * (x1+1 - x0); + + // compute intersection with y axis at x2 + y_final = y_top + dy * (x2 - x0); + + // x1 x_top x2 x_bottom + // y_top +------|-----+------------+------------+--------|---+------------+ + // | | | | | | + // | | | | | | + // sy0 | Txxxxx|............|............|............|............| + // y_crossing | *xxxxx.......|............|............|............| + // | | xxxxx..|............|............|............| + // | | /- xx*xxxx........|............|............| + // | | dy < | xxxxxx..|............|............| + // y_final | | \- | xx*xxx.........|............| + // sy1 | | | | xxxxxB...|............| + // | | | | | | + // | | | | | | + // y_bottom +------------+------------+------------+------------+------------+ + // + // goal is to measure the area covered by '.' in each pixel + + // if x2 is right at the right edge of x1, y_crossing can blow up, github #1057 + // @TODO: maybe test against sy1 rather than y_bottom? + if (y_crossing > y_bottom) + y_crossing = y_bottom; sign = e->direction; - // area of the rectangle covered from y0..y_crossing + + // area of the rectangle covered from sy0..y_crossing area = sign * (y_crossing-sy0); - // area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing) - scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2); - step = sign * dy; + // area of the triangle (x_top,sy0), (x1+1,sy0), (x1+1,y_crossing) + scanline[x1] += stbtt__sized_triangle_area(area, x1+1 - x_top); + + // check if final y_crossing is blown up; no test case for this + if (y_final > y_bottom) { + y_final = y_bottom; + dy = (y_final - y_crossing ) / (x2 - (x1+1)); // if denom=0, y_final = y_crossing, so y_final <= y_bottom + } + + // in second pixel, area covered by line segment found in first pixel + // is always a rectangle 1 wide * the height of that line segment; this + // is exactly what the variable 'area' stores. it also gets a contribution + // from the line segment within it. the THIRD pixel will get the first + // pixel's rectangle contribution, the second pixel's rectangle contribution, + // and its own contribution. the 'own contribution' is the same in every pixel except + // the leftmost and rightmost, a trapezoid that slides down in each pixel. + // the second pixel's contribution to the third pixel will be the + // rectangle 1 wide times the height change in the second pixel, which is dy. + + step = sign * dy * 1; // dy is dy/dx, change in y for every 1 change in x, + // which multiplied by 1-pixel-width is how much pixel area changes for each step in x + // so the area advances by 'step' every time + for (x = x1+1; x < x2; ++x) { - scanline[x] += area + step/2; + scanline[x] += area + step/2; // area of trapezoid is 1*step/2 area += step; } - y_crossing += dy * (x2 - (x1+1)); - - STBTT_assert(STBTT_fabs(area) <= 1.01f); + STBTT_assert(STBTT_fabs(area) <= 1.01f); // accumulated error from area += step unless we round step down + STBTT_assert(sy1 > y_final-0.01f); - scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing); + // area covered in the last pixel is the rectangle from all the pixels to the left, + // plus the trapezoid filled by the line segment in this pixel all the way to the right edge + scanline[x2] += area + sign * stbtt__position_trapezoid_area(sy1-y_final, (float) x2, x2+1.0f, x_bottom, x2+1.0f); + // the rest of the line is filled based on the total height of the line segment in this pixel scanline_fill[x2] += sign * (sy1-sy0); } } else { @@ -3177,6 +3232,9 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, // clipping logic. since this does not match the intended use // of this library, we use a different, very slow brute // force implementation + // note though that this does happen some of the time because + // x_top and x_bottom can be extrapolated at the top & bottom of + // the shape and actually lie outside the bounding box int x; for (x=0; x < len; ++x) { // cases: @@ -4413,15 +4471,14 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex float y_frac; int winding = 0; - orig[0] = x; - orig[1] = y; - // make sure y never passes through a vertex of the shape y_frac = (float) STBTT_fmod(y, 1.0f); if (y_frac < 0.01f) y += 0.01f; else if (y_frac > 0.99f) y -= 0.01f; + + orig[0] = x; orig[1] = y; // test a ray from (-infinity,y) to (x,y) @@ -4483,35 +4540,35 @@ static float stbtt__cuberoot( float x ) return (float) STBTT_pow( x,1.0f/3.0f); } -// x^3 + c*x^2 + b*x + a = 0 +// x^3 + a*x^2 + b*x + c = 0 static int stbtt__solve_cubic(float a, float b, float c, float* r) { - float s = -a / 3; - float p = b - a*a / 3; - float q = a * (2*a*a - 9*b) / 27 + c; + float s = -a / 3; + float p = b - a*a / 3; + float q = a * (2*a*a - 9*b) / 27 + c; float p3 = p*p*p; - float d = q*q + 4*p3 / 27; - if (d >= 0) { - float z = (float) STBTT_sqrt(d); - float u = (-q + z) / 2; - float v = (-q - z) / 2; - u = stbtt__cuberoot(u); - v = stbtt__cuberoot(v); - r[0] = s + u + v; - return 1; - } else { - float u = (float) STBTT_sqrt(-p/3); - float v = (float) STBTT_acos(-STBTT_sqrt(-27/p3) * q / 2) / 3; // p3 must be negative, since d is negative - float m = (float) STBTT_cos(v); + float d = q*q + 4*p3 / 27; + if (d >= 0) { + float z = (float) STBTT_sqrt(d); + float u = (-q + z) / 2; + float v = (-q - z) / 2; + u = stbtt__cuberoot(u); + v = stbtt__cuberoot(v); + r[0] = s + u + v; + return 1; + } else { + float u = (float) STBTT_sqrt(-p/3); + float v = (float) STBTT_acos(-STBTT_sqrt(-27/p3) * q / 2) / 3; // p3 must be negative, since d is negative + float m = (float) STBTT_cos(v); float n = (float) STBTT_cos(v-3.141592/2)*1.732050808f; - r[0] = s + u * 2 * m; - r[1] = s - u * (m + n); - r[2] = s - u * (m - n); + r[0] = s + u * 2 * m; + r[1] = s - u * (m + n); + r[2] = s - u * (m - n); //STBTT_assert( STBTT_fabs(((r[0]+a)*r[0]+b)*r[0]+c) < 0.05f); // these asserts may not be safe at all scales, though they're in bezier t parameter units so maybe? //STBTT_assert( STBTT_fabs(((r[1]+a)*r[1]+b)*r[1]+c) < 0.05f); //STBTT_assert( STBTT_fabs(((r[2]+a)*r[2]+b)*r[2]+c) < 0.05f); - return 3; + return 3; } } @@ -4547,6 +4604,8 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc scale_y = -scale_y; { + // distance from singular values (in the same units as the pixel grid) + const float eps = 1./1024, eps2 = eps*eps; int x,y,i,j; float *precompute; stbtt_vertex *verts; @@ -4559,15 +4618,15 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; float x1 = verts[j].x*scale_x, y1 = verts[j].y*scale_y; float dist = (float) STBTT_sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0)); - precompute[i] = (dist == 0) ? 0.0f : 1.0f / dist; + precompute[i] = (dist < eps) ? 0.0f : 1.0f / dist; } else if (verts[i].type == STBTT_vcurve) { float x2 = verts[j].x *scale_x, y2 = verts[j].y *scale_y; float x1 = verts[i].cx*scale_x, y1 = verts[i].cy*scale_y; float x0 = verts[i].x *scale_x, y0 = verts[i].y *scale_y; float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; float len2 = bx*bx + by*by; - if (len2 != 0.0f) - precompute[i] = 1.0f / (bx*bx + by*by); + if (len2 >= eps2) + precompute[i] = 1.0f / len2; else precompute[i] = 0.0f; } else @@ -4588,18 +4647,17 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc for (i=0; i < num_verts; ++i) { float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; - // check against every point here rather than inside line/curve primitives -- @TODO: wrong if multiple 'moves' in a row produce a garbage point, and given culling, probably more efficient to do within line/curve - float dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy); - if (dist2 < min_dist*min_dist) - min_dist = (float) STBTT_sqrt(dist2); - - if (verts[i].type == STBTT_vline) { + if (verts[i].type == STBTT_vline && precompute[i] != 0.0f) { float x1 = verts[i-1].x*scale_x, y1 = verts[i-1].y*scale_y; + float dist,dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy); + if (dist2 < min_dist*min_dist) + min_dist = (float) STBTT_sqrt(dist2); + // coarse culling against bbox //if (sx > STBTT_min(x0,x1)-min_dist && sx < STBTT_max(x0,x1)+min_dist && // sy > STBTT_min(y0,y1)-min_dist && sy < STBTT_max(y0,y1)+min_dist) - float dist = (float) STBTT_fabs((x1-x0)*(y0-sy) - (y1-y0)*(x0-sx)) * precompute[i]; + dist = (float) STBTT_fabs((x1-x0)*(y0-sy) - (y1-y0)*(x0-sx)) * precompute[i]; STBTT_assert(i != 0); if (dist < min_dist) { // check position along line @@ -4626,14 +4684,15 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc float ax = x1-x0, ay = y1-y0; float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; float mx = x0 - sx, my = y0 - sy; - float res[3],px,py,t,it; + float res[3] = {0.f,0.f,0.f}; + float px,py,t,it,dist2; float a_inv = precompute[i]; if (a_inv == 0.0) { // if a_inv is 0, it's 2nd degree so use quadratic formula float a = 3*(ax*bx + ay*by); float b = 2*(ax*ax + ay*ay) + (mx*bx+my*by); float c = mx*ax+my*ay; - if (a == 0.0) { // if a is 0, it's linear - if (b != 0.0) { + if (STBTT_fabs(a) < eps2) { // if a is 0, it's linear + if (STBTT_fabs(b) >= eps2) { res[num++] = -c/b; } } else { @@ -4653,6 +4712,10 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc float d = (mx*ax+my*ay) * a_inv; num = stbtt__solve_cubic(b, c, d, res); } + dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy); + if (dist2 < min_dist*min_dist) + min_dist = (float) STBTT_sqrt(dist2); + if (num >= 1 && res[0] >= 0.0f && res[0] <= 1.0f) { t = res[0], it = 1.0f - t; px = it*it*x0 + 2*t*it*x1 + t*t*x2; @@ -4912,6 +4975,12 @@ STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const // FULL VERSION HISTORY // +// 1.25 (2021-07-11) many fixes +// 1.24 (2020-02-05) fix warning +// 1.23 (2020-02-02) query SVG data for glyphs; query whole kerning table (but only kern not GPOS) +// 1.22 (2019-08-11) minimize missing-glyph duplication; fix kerning if both 'GPOS' and 'kern' are defined +// 1.21 (2019-02-25) fix warning +// 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics() // 1.19 (2018-02-11) OpenType GPOS kerning (horizontal only), STBTT_fmod // 1.18 (2018-01-29) add missing function // 1.17 (2017-07-23) make more arguments const; doc fix diff --git a/bgfx/3rdparty/webgpu/include/webgpu/EnumClassBitmasks.h b/bgfx/3rdparty/webgpu/include/webgpu/EnumClassBitmasks.h deleted file mode 100644 index 93d2be45..00000000 --- a/bgfx/3rdparty/webgpu/include/webgpu/EnumClassBitmasks.h +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2017 The Dawn Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef DAWN_ENUM_CLASS_BITMASKS_H_ -#define DAWN_ENUM_CLASS_BITMASKS_H_ - -#include - -namespace wgpu { - - template - struct IsDawnBitmask { - static constexpr bool enable = false; - }; - - template - struct LowerBitmask { - static constexpr bool enable = false; - }; - - template - struct LowerBitmask::enable>::type> { - static constexpr bool enable = true; - using type = T; - constexpr static T Lower(T t) { - return t; - } - }; - - template - struct BoolConvertible { - using Integral = typename std::underlying_type::type; - - constexpr BoolConvertible(Integral value) : value(value) { - } - constexpr operator bool() const { - return value != 0; - } - constexpr operator T() const { - return static_cast(value); - } - - Integral value; - }; - - template - struct LowerBitmask> { - static constexpr bool enable = true; - using type = T; - static constexpr type Lower(BoolConvertible t) { - return t; - } - }; - - template ::enable && - LowerBitmask::enable>::type> - constexpr BoolConvertible::type> operator|(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return static_cast(LowerBitmask::Lower(left)) | - static_cast(LowerBitmask::Lower(right)); - } - - template ::enable && - LowerBitmask::enable>::type> - constexpr BoolConvertible::type> operator&(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return static_cast(LowerBitmask::Lower(left)) & - static_cast(LowerBitmask::Lower(right)); - } - - template ::enable && - LowerBitmask::enable>::type> - constexpr BoolConvertible::type> operator^(T1 left, T2 right) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return static_cast(LowerBitmask::Lower(left)) ^ - static_cast(LowerBitmask::Lower(right)); - } - - template - constexpr BoolConvertible::type> operator~(T1 t) { - using T = typename LowerBitmask::type; - using Integral = typename std::underlying_type::type; - return ~static_cast(LowerBitmask::Lower(t)); - } - - template ::enable && - LowerBitmask::enable>::type> - constexpr T& operator&=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l & r; - return l; - } - - template ::enable && - LowerBitmask::enable>::type> - constexpr T& operator|=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l | r; - return l; - } - - template ::enable && - LowerBitmask::enable>::type> - constexpr T& operator^=(T& l, T2 right) { - T r = LowerBitmask::Lower(right); - l = l ^ r; - return l; - } - - template - constexpr bool HasZeroOrOneBits(T value) { - using Integral = typename std::underlying_type::type; - return (static_cast(value) & (static_cast(value) - 1)) == 0; - } - -} // namespace wgpu - -#endif // DAWN_ENUM_CLASS_BITMASKS_H_ diff --git a/bgfx/3rdparty/webgpu/include/webgpu/webgpu.h b/bgfx/3rdparty/webgpu/include/webgpu/webgpu.h deleted file mode 100644 index 19f1f27b..00000000 --- a/bgfx/3rdparty/webgpu/include/webgpu/webgpu.h +++ /dev/null @@ -1,1362 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2019, "WebGPU native" developers -// 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. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef WEBGPU_H_ -#define WEBGPU_H_ - -#if defined(WGPU_SHARED_LIBRARY) -# if defined(_WIN32) -# if defined(WGPU_IMPLEMENTATION) -# define WGPU_EXPORT __declspec(dllexport) -# else -# define WGPU_EXPORT __declspec(dllimport) -# endif -# else // defined(_WIN32) -# if defined(WGPU_IMPLEMENTATION) -# define WGPU_EXPORT __attribute__((visibility("default"))) -# else -# define WGPU_EXPORT -# endif -# endif // defined(_WIN32) -#else // defined(WGPU_SHARED_LIBRARY) -# define WGPU_EXPORT -#endif // defined(WGPU_SHARED_LIBRARY) - -#include -#include -#include - -#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL) -// TODO(crbug.com/520): Remove WGPU_STRIDE_UNDEFINED in favor of WGPU_COPY_STRIDE_UNDEFINED. -#define WGPU_STRIDE_UNDEFINED (0xffffffffUL) -#define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL) - -typedef uint32_t WGPUFlags; - -typedef struct WGPUBindGroupImpl* WGPUBindGroup; -typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout; -typedef struct WGPUBufferImpl* WGPUBuffer; -typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer; -typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder; -typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder; -typedef struct WGPUComputePipelineImpl* WGPUComputePipeline; -typedef struct WGPUDeviceImpl* WGPUDevice; -typedef struct WGPUFenceImpl* WGPUFence; -typedef struct WGPUInstanceImpl* WGPUInstance; -typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout; -typedef struct WGPUQuerySetImpl* WGPUQuerySet; -typedef struct WGPUQueueImpl* WGPUQueue; -typedef struct WGPURenderBundleImpl* WGPURenderBundle; -typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder; -typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder; -typedef struct WGPURenderPipelineImpl* WGPURenderPipeline; -typedef struct WGPUSamplerImpl* WGPUSampler; -typedef struct WGPUShaderModuleImpl* WGPUShaderModule; -typedef struct WGPUSurfaceImpl* WGPUSurface; -typedef struct WGPUSwapChainImpl* WGPUSwapChain; -typedef struct WGPUTextureImpl* WGPUTexture; -typedef struct WGPUTextureViewImpl* WGPUTextureView; - -typedef enum WGPUAdapterType { - WGPUAdapterType_DiscreteGPU = 0x00000000, - WGPUAdapterType_IntegratedGPU = 0x00000001, - WGPUAdapterType_CPU = 0x00000002, - WGPUAdapterType_Unknown = 0x00000003, - WGPUAdapterType_Force32 = 0x7FFFFFFF -} WGPUAdapterType; - -typedef enum WGPUAddressMode { - WGPUAddressMode_Repeat = 0x00000000, - WGPUAddressMode_MirrorRepeat = 0x00000001, - WGPUAddressMode_ClampToEdge = 0x00000002, - WGPUAddressMode_Force32 = 0x7FFFFFFF -} WGPUAddressMode; - -typedef enum WGPUBackendType { - WGPUBackendType_Null = 0x00000000, - WGPUBackendType_D3D11 = 0x00000001, - WGPUBackendType_D3D12 = 0x00000002, - WGPUBackendType_Metal = 0x00000003, - WGPUBackendType_Vulkan = 0x00000004, - WGPUBackendType_OpenGL = 0x00000005, - WGPUBackendType_OpenGLES = 0x00000006, - WGPUBackendType_Force32 = 0x7FFFFFFF -} WGPUBackendType; - -typedef enum WGPUBindingType { - WGPUBindingType_Undefined = 0x00000000, - WGPUBindingType_UniformBuffer = 0x00000001, - WGPUBindingType_StorageBuffer = 0x00000002, - WGPUBindingType_ReadonlyStorageBuffer = 0x00000003, - WGPUBindingType_Sampler = 0x00000004, - WGPUBindingType_ComparisonSampler = 0x00000005, - WGPUBindingType_SampledTexture = 0x00000006, - WGPUBindingType_MultisampledTexture = 0x00000007, - WGPUBindingType_ReadonlyStorageTexture = 0x00000008, - WGPUBindingType_WriteonlyStorageTexture = 0x00000009, - WGPUBindingType_Force32 = 0x7FFFFFFF -} WGPUBindingType; - -typedef enum WGPUBlendFactor { - WGPUBlendFactor_Zero = 0x00000000, - WGPUBlendFactor_One = 0x00000001, - WGPUBlendFactor_SrcColor = 0x00000002, - WGPUBlendFactor_OneMinusSrcColor = 0x00000003, - WGPUBlendFactor_SrcAlpha = 0x00000004, - WGPUBlendFactor_OneMinusSrcAlpha = 0x00000005, - WGPUBlendFactor_DstColor = 0x00000006, - WGPUBlendFactor_OneMinusDstColor = 0x00000007, - WGPUBlendFactor_DstAlpha = 0x00000008, - WGPUBlendFactor_OneMinusDstAlpha = 0x00000009, - WGPUBlendFactor_SrcAlphaSaturated = 0x0000000A, - WGPUBlendFactor_BlendColor = 0x0000000B, - WGPUBlendFactor_OneMinusBlendColor = 0x0000000C, - WGPUBlendFactor_Force32 = 0x7FFFFFFF -} WGPUBlendFactor; - -typedef enum WGPUBlendOperation { - WGPUBlendOperation_Add = 0x00000000, - WGPUBlendOperation_Subtract = 0x00000001, - WGPUBlendOperation_ReverseSubtract = 0x00000002, - WGPUBlendOperation_Min = 0x00000003, - WGPUBlendOperation_Max = 0x00000004, - WGPUBlendOperation_Force32 = 0x7FFFFFFF -} WGPUBlendOperation; - -typedef enum WGPUBufferBindingType { - WGPUBufferBindingType_Undefined = 0x00000000, - WGPUBufferBindingType_Uniform = 0x00000001, - WGPUBufferBindingType_Storage = 0x00000002, - WGPUBufferBindingType_ReadOnlyStorage = 0x00000003, - WGPUBufferBindingType_Force32 = 0x7FFFFFFF -} WGPUBufferBindingType; - -typedef enum WGPUBufferMapAsyncStatus { - WGPUBufferMapAsyncStatus_Success = 0x00000000, - WGPUBufferMapAsyncStatus_Error = 0x00000001, - WGPUBufferMapAsyncStatus_Unknown = 0x00000002, - WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003, - WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000004, - WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000005, - WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF -} WGPUBufferMapAsyncStatus; - -typedef enum WGPUCompareFunction { - WGPUCompareFunction_Undefined = 0x00000000, - WGPUCompareFunction_Never = 0x00000001, - WGPUCompareFunction_Less = 0x00000002, - WGPUCompareFunction_LessEqual = 0x00000003, - WGPUCompareFunction_Greater = 0x00000004, - WGPUCompareFunction_GreaterEqual = 0x00000005, - WGPUCompareFunction_Equal = 0x00000006, - WGPUCompareFunction_NotEqual = 0x00000007, - WGPUCompareFunction_Always = 0x00000008, - WGPUCompareFunction_Force32 = 0x7FFFFFFF -} WGPUCompareFunction; - -typedef enum WGPUCreateReadyPipelineStatus { - WGPUCreateReadyPipelineStatus_Success = 0x00000000, - WGPUCreateReadyPipelineStatus_Error = 0x00000001, - WGPUCreateReadyPipelineStatus_DeviceLost = 0x00000002, - WGPUCreateReadyPipelineStatus_DeviceDestroyed = 0x00000003, - WGPUCreateReadyPipelineStatus_Unknown = 0x00000004, - WGPUCreateReadyPipelineStatus_Force32 = 0x7FFFFFFF -} WGPUCreateReadyPipelineStatus; - -typedef enum WGPUCullMode { - WGPUCullMode_None = 0x00000000, - WGPUCullMode_Front = 0x00000001, - WGPUCullMode_Back = 0x00000002, - WGPUCullMode_Force32 = 0x7FFFFFFF -} WGPUCullMode; - -typedef enum WGPUErrorFilter { - WGPUErrorFilter_None = 0x00000000, - WGPUErrorFilter_Validation = 0x00000001, - WGPUErrorFilter_OutOfMemory = 0x00000002, - WGPUErrorFilter_Force32 = 0x7FFFFFFF -} WGPUErrorFilter; - -typedef enum WGPUErrorType { - WGPUErrorType_NoError = 0x00000000, - WGPUErrorType_Validation = 0x00000001, - WGPUErrorType_OutOfMemory = 0x00000002, - WGPUErrorType_Unknown = 0x00000003, - WGPUErrorType_DeviceLost = 0x00000004, - WGPUErrorType_Force32 = 0x7FFFFFFF -} WGPUErrorType; - -typedef enum WGPUFenceCompletionStatus { - WGPUFenceCompletionStatus_Success = 0x00000000, - WGPUFenceCompletionStatus_Error = 0x00000001, - WGPUFenceCompletionStatus_Unknown = 0x00000002, - WGPUFenceCompletionStatus_DeviceLost = 0x00000003, - WGPUFenceCompletionStatus_Force32 = 0x7FFFFFFF -} WGPUFenceCompletionStatus; - -typedef enum WGPUFilterMode { - WGPUFilterMode_Nearest = 0x00000000, - WGPUFilterMode_Linear = 0x00000001, - WGPUFilterMode_Force32 = 0x7FFFFFFF -} WGPUFilterMode; - -typedef enum WGPUFrontFace { - WGPUFrontFace_CCW = 0x00000000, - WGPUFrontFace_CW = 0x00000001, - WGPUFrontFace_Force32 = 0x7FFFFFFF -} WGPUFrontFace; - -typedef enum WGPUIndexFormat { - WGPUIndexFormat_Undefined = 0x00000000, - WGPUIndexFormat_Uint16 = 0x00000001, - WGPUIndexFormat_Uint32 = 0x00000002, - WGPUIndexFormat_Force32 = 0x7FFFFFFF -} WGPUIndexFormat; - -typedef enum WGPUInputStepMode { - WGPUInputStepMode_Vertex = 0x00000000, - WGPUInputStepMode_Instance = 0x00000001, - WGPUInputStepMode_Force32 = 0x7FFFFFFF -} WGPUInputStepMode; - -typedef enum WGPULoadOp { - WGPULoadOp_Clear = 0x00000000, - WGPULoadOp_Load = 0x00000001, - WGPULoadOp_Force32 = 0x7FFFFFFF -} WGPULoadOp; - -typedef enum WGPUPipelineStatisticName { - WGPUPipelineStatisticName_VertexShaderInvocations = 0x00000000, - WGPUPipelineStatisticName_ClipperInvocations = 0x00000001, - WGPUPipelineStatisticName_ClipperPrimitivesOut = 0x00000002, - WGPUPipelineStatisticName_FragmentShaderInvocations = 0x00000003, - WGPUPipelineStatisticName_ComputeShaderInvocations = 0x00000004, - WGPUPipelineStatisticName_Force32 = 0x7FFFFFFF -} WGPUPipelineStatisticName; - -typedef enum WGPUPresentMode { - WGPUPresentMode_Immediate = 0x00000000, - WGPUPresentMode_Mailbox = 0x00000001, - WGPUPresentMode_Fifo = 0x00000002, - WGPUPresentMode_Force32 = 0x7FFFFFFF -} WGPUPresentMode; - -typedef enum WGPUPrimitiveTopology { - WGPUPrimitiveTopology_PointList = 0x00000000, - WGPUPrimitiveTopology_LineList = 0x00000001, - WGPUPrimitiveTopology_LineStrip = 0x00000002, - WGPUPrimitiveTopology_TriangleList = 0x00000003, - WGPUPrimitiveTopology_TriangleStrip = 0x00000004, - WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF -} WGPUPrimitiveTopology; - -typedef enum WGPUQueryType { - WGPUQueryType_Occlusion = 0x00000000, - WGPUQueryType_PipelineStatistics = 0x00000001, - WGPUQueryType_Timestamp = 0x00000002, - WGPUQueryType_Force32 = 0x7FFFFFFF -} WGPUQueryType; - -typedef enum WGPUSType { - WGPUSType_Invalid = 0x00000000, - WGPUSType_SurfaceDescriptorFromMetalLayer = 0x00000001, - WGPUSType_SurfaceDescriptorFromWindowsHWND = 0x00000002, - WGPUSType_SurfaceDescriptorFromXlib = 0x00000003, - WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004, - WGPUSType_ShaderModuleSPIRVDescriptor = 0x00000005, - WGPUSType_ShaderModuleWGSLDescriptor = 0x00000006, - WGPUSType_SamplerDescriptorDummyAnisotropicFiltering = 0x00000007, - WGPUSType_RenderPipelineDescriptorDummyExtension = 0x00000008, - WGPUSType_Force32 = 0x7FFFFFFF -} WGPUSType; - -typedef enum WGPUSamplerBindingType { - WGPUSamplerBindingType_Undefined = 0x00000000, - WGPUSamplerBindingType_Filtering = 0x00000001, - WGPUSamplerBindingType_NonFiltering = 0x00000002, - WGPUSamplerBindingType_Comparison = 0x00000003, - WGPUSamplerBindingType_Force32 = 0x7FFFFFFF -} WGPUSamplerBindingType; - -typedef enum WGPUStencilOperation { - WGPUStencilOperation_Keep = 0x00000000, - WGPUStencilOperation_Zero = 0x00000001, - WGPUStencilOperation_Replace = 0x00000002, - WGPUStencilOperation_Invert = 0x00000003, - WGPUStencilOperation_IncrementClamp = 0x00000004, - WGPUStencilOperation_DecrementClamp = 0x00000005, - WGPUStencilOperation_IncrementWrap = 0x00000006, - WGPUStencilOperation_DecrementWrap = 0x00000007, - WGPUStencilOperation_Force32 = 0x7FFFFFFF -} WGPUStencilOperation; - -typedef enum WGPUStorageTextureAccess { - WGPUStorageTextureAccess_Undefined = 0x00000000, - WGPUStorageTextureAccess_ReadOnly = 0x00000001, - WGPUStorageTextureAccess_WriteOnly = 0x00000002, - WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF -} WGPUStorageTextureAccess; - -typedef enum WGPUStoreOp { - WGPUStoreOp_Store = 0x00000000, - WGPUStoreOp_Clear = 0x00000001, - WGPUStoreOp_Force32 = 0x7FFFFFFF -} WGPUStoreOp; - -typedef enum WGPUTextureAspect { - WGPUTextureAspect_All = 0x00000000, - WGPUTextureAspect_StencilOnly = 0x00000001, - WGPUTextureAspect_DepthOnly = 0x00000002, - WGPUTextureAspect_Force32 = 0x7FFFFFFF -} WGPUTextureAspect; - -typedef enum WGPUTextureComponentType { - WGPUTextureComponentType_Float = 0x00000000, - WGPUTextureComponentType_Sint = 0x00000001, - WGPUTextureComponentType_Uint = 0x00000002, - WGPUTextureComponentType_DepthComparison = 0x00000003, - WGPUTextureComponentType_Force32 = 0x7FFFFFFF -} WGPUTextureComponentType; - -typedef enum WGPUTextureDimension { - WGPUTextureDimension_1D = 0x00000000, - WGPUTextureDimension_2D = 0x00000001, - WGPUTextureDimension_3D = 0x00000002, - WGPUTextureDimension_Force32 = 0x7FFFFFFF -} WGPUTextureDimension; - -typedef enum WGPUTextureFormat { - WGPUTextureFormat_Undefined = 0x00000000, - WGPUTextureFormat_R8Unorm = 0x00000001, - WGPUTextureFormat_R8Snorm = 0x00000002, - WGPUTextureFormat_R8Uint = 0x00000003, - WGPUTextureFormat_R8Sint = 0x00000004, - WGPUTextureFormat_R16Uint = 0x00000005, - WGPUTextureFormat_R16Sint = 0x00000006, - WGPUTextureFormat_R16Float = 0x00000007, - WGPUTextureFormat_RG8Unorm = 0x00000008, - WGPUTextureFormat_RG8Snorm = 0x00000009, - WGPUTextureFormat_RG8Uint = 0x0000000A, - WGPUTextureFormat_RG8Sint = 0x0000000B, - WGPUTextureFormat_R32Float = 0x0000000C, - WGPUTextureFormat_R32Uint = 0x0000000D, - WGPUTextureFormat_R32Sint = 0x0000000E, - WGPUTextureFormat_RG16Uint = 0x0000000F, - WGPUTextureFormat_RG16Sint = 0x00000010, - WGPUTextureFormat_RG16Float = 0x00000011, - WGPUTextureFormat_RGBA8Unorm = 0x00000012, - WGPUTextureFormat_RGBA8UnormSrgb = 0x00000013, - WGPUTextureFormat_RGBA8Snorm = 0x00000014, - WGPUTextureFormat_RGBA8Uint = 0x00000015, - WGPUTextureFormat_RGBA8Sint = 0x00000016, - WGPUTextureFormat_BGRA8Unorm = 0x00000017, - WGPUTextureFormat_BGRA8UnormSrgb = 0x00000018, - WGPUTextureFormat_RGB10A2Unorm = 0x00000019, - WGPUTextureFormat_RG11B10Ufloat = 0x0000001A, - WGPUTextureFormat_RGB9E5Ufloat = 0x0000001B, - WGPUTextureFormat_RG32Float = 0x0000001C, - WGPUTextureFormat_RG32Uint = 0x0000001D, - WGPUTextureFormat_RG32Sint = 0x0000001E, - WGPUTextureFormat_RGBA16Uint = 0x0000001F, - WGPUTextureFormat_RGBA16Sint = 0x00000020, - WGPUTextureFormat_RGBA16Float = 0x00000021, - WGPUTextureFormat_RGBA32Float = 0x00000022, - WGPUTextureFormat_RGBA32Uint = 0x00000023, - WGPUTextureFormat_RGBA32Sint = 0x00000024, - WGPUTextureFormat_Depth32Float = 0x00000025, - WGPUTextureFormat_Depth24Plus = 0x00000026, - WGPUTextureFormat_Depth24PlusStencil8 = 0x00000027, - WGPUTextureFormat_BC1RGBAUnorm = 0x00000028, - WGPUTextureFormat_BC1RGBAUnormSrgb = 0x00000029, - WGPUTextureFormat_BC2RGBAUnorm = 0x0000002A, - WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002B, - WGPUTextureFormat_BC3RGBAUnorm = 0x0000002C, - WGPUTextureFormat_BC3RGBAUnormSrgb = 0x0000002D, - WGPUTextureFormat_BC4RUnorm = 0x0000002E, - WGPUTextureFormat_BC4RSnorm = 0x0000002F, - WGPUTextureFormat_BC5RGUnorm = 0x00000030, - WGPUTextureFormat_BC5RGSnorm = 0x00000031, - WGPUTextureFormat_BC6HRGBUfloat = 0x00000032, - WGPUTextureFormat_BC6HRGBFloat = 0x00000033, - WGPUTextureFormat_BC7RGBAUnorm = 0x00000034, - WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000035, - WGPUTextureFormat_Force32 = 0x7FFFFFFF -} WGPUTextureFormat; - -typedef enum WGPUTextureSampleType { - WGPUTextureSampleType_Undefined = 0x00000000, - WGPUTextureSampleType_Float = 0x00000001, - WGPUTextureSampleType_UnfilterableFloat = 0x00000002, - WGPUTextureSampleType_Depth = 0x00000003, - WGPUTextureSampleType_Sint = 0x00000004, - WGPUTextureSampleType_Uint = 0x00000005, - WGPUTextureSampleType_Force32 = 0x7FFFFFFF -} WGPUTextureSampleType; - -typedef enum WGPUTextureViewDimension { - WGPUTextureViewDimension_Undefined = 0x00000000, - WGPUTextureViewDimension_1D = 0x00000001, - WGPUTextureViewDimension_2D = 0x00000002, - WGPUTextureViewDimension_2DArray = 0x00000003, - WGPUTextureViewDimension_Cube = 0x00000004, - WGPUTextureViewDimension_CubeArray = 0x00000005, - WGPUTextureViewDimension_3D = 0x00000006, - WGPUTextureViewDimension_Force32 = 0x7FFFFFFF -} WGPUTextureViewDimension; - -typedef enum WGPUVertexFormat { - WGPUVertexFormat_UChar2 = 0x00000000, - WGPUVertexFormat_UChar4 = 0x00000001, - WGPUVertexFormat_Char2 = 0x00000002, - WGPUVertexFormat_Char4 = 0x00000003, - WGPUVertexFormat_UChar2Norm = 0x00000004, - WGPUVertexFormat_UChar4Norm = 0x00000005, - WGPUVertexFormat_Char2Norm = 0x00000006, - WGPUVertexFormat_Char4Norm = 0x00000007, - WGPUVertexFormat_UShort2 = 0x00000008, - WGPUVertexFormat_UShort4 = 0x00000009, - WGPUVertexFormat_Short2 = 0x0000000A, - WGPUVertexFormat_Short4 = 0x0000000B, - WGPUVertexFormat_UShort2Norm = 0x0000000C, - WGPUVertexFormat_UShort4Norm = 0x0000000D, - WGPUVertexFormat_Short2Norm = 0x0000000E, - WGPUVertexFormat_Short4Norm = 0x0000000F, - WGPUVertexFormat_Half2 = 0x00000010, - WGPUVertexFormat_Half4 = 0x00000011, - WGPUVertexFormat_Float = 0x00000012, - WGPUVertexFormat_Float2 = 0x00000013, - WGPUVertexFormat_Float3 = 0x00000014, - WGPUVertexFormat_Float4 = 0x00000015, - WGPUVertexFormat_UInt = 0x00000016, - WGPUVertexFormat_UInt2 = 0x00000017, - WGPUVertexFormat_UInt3 = 0x00000018, - WGPUVertexFormat_UInt4 = 0x00000019, - WGPUVertexFormat_Int = 0x0000001A, - WGPUVertexFormat_Int2 = 0x0000001B, - WGPUVertexFormat_Int3 = 0x0000001C, - WGPUVertexFormat_Int4 = 0x0000001D, - WGPUVertexFormat_Force32 = 0x7FFFFFFF -} WGPUVertexFormat; - -typedef enum WGPUBufferUsage { - WGPUBufferUsage_None = 0x00000000, - WGPUBufferUsage_MapRead = 0x00000001, - WGPUBufferUsage_MapWrite = 0x00000002, - WGPUBufferUsage_CopySrc = 0x00000004, - WGPUBufferUsage_CopyDst = 0x00000008, - WGPUBufferUsage_Index = 0x00000010, - WGPUBufferUsage_Vertex = 0x00000020, - WGPUBufferUsage_Uniform = 0x00000040, - WGPUBufferUsage_Storage = 0x00000080, - WGPUBufferUsage_Indirect = 0x00000100, - WGPUBufferUsage_QueryResolve = 0x00000200, - WGPUBufferUsage_Force32 = 0x7FFFFFFF -} WGPUBufferUsage; -typedef WGPUFlags WGPUBufferUsageFlags; - -typedef enum WGPUColorWriteMask { - WGPUColorWriteMask_None = 0x00000000, - WGPUColorWriteMask_Red = 0x00000001, - WGPUColorWriteMask_Green = 0x00000002, - WGPUColorWriteMask_Blue = 0x00000004, - WGPUColorWriteMask_Alpha = 0x00000008, - WGPUColorWriteMask_All = 0x0000000F, - WGPUColorWriteMask_Force32 = 0x7FFFFFFF -} WGPUColorWriteMask; -typedef WGPUFlags WGPUColorWriteMaskFlags; - -typedef enum WGPUMapMode { - WGPUMapMode_None = 0x00000000, - WGPUMapMode_Read = 0x00000001, - WGPUMapMode_Write = 0x00000002, - WGPUMapMode_Force32 = 0x7FFFFFFF -} WGPUMapMode; -typedef WGPUFlags WGPUMapModeFlags; - -typedef enum WGPUShaderStage { - WGPUShaderStage_None = 0x00000000, - WGPUShaderStage_Vertex = 0x00000001, - WGPUShaderStage_Fragment = 0x00000002, - WGPUShaderStage_Compute = 0x00000004, - WGPUShaderStage_Force32 = 0x7FFFFFFF -} WGPUShaderStage; -typedef WGPUFlags WGPUShaderStageFlags; - -typedef enum WGPUTextureUsage { - WGPUTextureUsage_None = 0x00000000, - WGPUTextureUsage_CopySrc = 0x00000001, - WGPUTextureUsage_CopyDst = 0x00000002, - WGPUTextureUsage_Sampled = 0x00000004, - WGPUTextureUsage_Storage = 0x00000008, - WGPUTextureUsage_OutputAttachment = 0x00000010, - WGPUTextureUsage_RenderAttachment = 0x00000010, - WGPUTextureUsage_Present = 0x00000020, - WGPUTextureUsage_Force32 = 0x7FFFFFFF -} WGPUTextureUsage; -typedef WGPUFlags WGPUTextureUsageFlags; - - -typedef struct WGPUChainedStruct { - struct WGPUChainedStruct const * next; - WGPUSType sType; -} WGPUChainedStruct; - -typedef struct WGPUAdapterProperties { - WGPUChainedStruct const * nextInChain; - uint32_t deviceID; - uint32_t vendorID; - char const * name; - char const * driverDescription; - WGPUAdapterType adapterType; - WGPUBackendType backendType; -} WGPUAdapterProperties; - -typedef struct WGPUBindGroupEntry { - uint32_t binding; - WGPUBuffer buffer; - uint64_t offset; - uint64_t size; - WGPUSampler sampler; - WGPUTextureView textureView; -} WGPUBindGroupEntry; - -typedef struct WGPUBlendDescriptor { - WGPUBlendOperation operation; - WGPUBlendFactor srcFactor; - WGPUBlendFactor dstFactor; -} WGPUBlendDescriptor; - -typedef struct WGPUBufferBindingLayout { - WGPUChainedStruct const * nextInChain; - WGPUBufferBindingType type; - bool hasDynamicOffset; - uint64_t minBindingSize; -} WGPUBufferBindingLayout; - -typedef struct WGPUBufferDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUBufferUsageFlags usage; - uint64_t size; - bool mappedAtCreation; -} WGPUBufferDescriptor; - -typedef struct WGPUColor { - double r; - double g; - double b; - double a; -} WGPUColor; - -typedef struct WGPUCommandBufferDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; -} WGPUCommandBufferDescriptor; - -typedef struct WGPUCommandEncoderDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; -} WGPUCommandEncoderDescriptor; - -typedef struct WGPUComputePassDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; -} WGPUComputePassDescriptor; - -typedef struct WGPUCopyTextureForBrowserOptions { - WGPUChainedStruct const * nextInChain; - bool flipY; -} WGPUCopyTextureForBrowserOptions; - -typedef struct WGPUDeviceProperties { - bool textureCompressionBC; - bool shaderFloat16; - bool pipelineStatisticsQuery; - bool timestampQuery; -} WGPUDeviceProperties; - -typedef struct WGPUExtent3D { - uint32_t width; - uint32_t height; - uint32_t depth; -} WGPUExtent3D; - -typedef struct WGPUFenceDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - uint64_t initialValue; -} WGPUFenceDescriptor; - -typedef struct WGPUInstanceDescriptor { - WGPUChainedStruct const * nextInChain; -} WGPUInstanceDescriptor; - -typedef struct WGPUOrigin3D { - uint32_t x; - uint32_t y; - uint32_t z; -} WGPUOrigin3D; - -typedef struct WGPUPipelineLayoutDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - uint32_t bindGroupLayoutCount; - WGPUBindGroupLayout const * bindGroupLayouts; -} WGPUPipelineLayoutDescriptor; - -typedef struct WGPUProgrammableStageDescriptor { - WGPUChainedStruct const * nextInChain; - WGPUShaderModule module; - char const * entryPoint; -} WGPUProgrammableStageDescriptor; - -typedef struct WGPUQuerySetDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUQueryType type; - uint32_t count; - WGPUPipelineStatisticName const * pipelineStatistics; - uint32_t pipelineStatisticsCount; -} WGPUQuerySetDescriptor; - -typedef struct WGPURasterizationStateDescriptor { - WGPUChainedStruct const * nextInChain; - WGPUFrontFace frontFace; - WGPUCullMode cullMode; - int32_t depthBias; - float depthBiasSlopeScale; - float depthBiasClamp; -} WGPURasterizationStateDescriptor; - -typedef struct WGPURenderBundleDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; -} WGPURenderBundleDescriptor; - -typedef struct WGPURenderBundleEncoderDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - uint32_t colorFormatsCount; - WGPUTextureFormat const * colorFormats; - WGPUTextureFormat depthStencilFormat; - uint32_t sampleCount; -} WGPURenderBundleEncoderDescriptor; - -typedef struct WGPURenderPassDepthStencilAttachmentDescriptor { - WGPUTextureView attachment; - WGPULoadOp depthLoadOp; - WGPUStoreOp depthStoreOp; - float clearDepth; - bool depthReadOnly; - WGPULoadOp stencilLoadOp; - WGPUStoreOp stencilStoreOp; - uint32_t clearStencil; - bool stencilReadOnly; -} WGPURenderPassDepthStencilAttachmentDescriptor; - -typedef struct WGPUSamplerBindingLayout { - WGPUChainedStruct const * nextInChain; - WGPUSamplerBindingType type; -} WGPUSamplerBindingLayout; - -typedef struct WGPUSamplerDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUAddressMode addressModeU; - WGPUAddressMode addressModeV; - WGPUAddressMode addressModeW; - WGPUFilterMode magFilter; - WGPUFilterMode minFilter; - WGPUFilterMode mipmapFilter; - float lodMinClamp; - float lodMaxClamp; - WGPUCompareFunction compare; - uint16_t maxAnisotropy; -} WGPUSamplerDescriptor; - -typedef struct WGPUSamplerDescriptorDummyAnisotropicFiltering { - WGPUChainedStruct chain; - float maxAnisotropy; -} WGPUSamplerDescriptorDummyAnisotropicFiltering; - -typedef struct WGPUShaderModuleDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; -} WGPUShaderModuleDescriptor; - -typedef struct WGPUShaderModuleSPIRVDescriptor { - WGPUChainedStruct chain; - uint32_t codeSize; - uint32_t const * code; -} WGPUShaderModuleSPIRVDescriptor; - -typedef struct WGPUShaderModuleWGSLDescriptor { - WGPUChainedStruct chain; - char const * source; -} WGPUShaderModuleWGSLDescriptor; - -typedef struct WGPUStencilStateFaceDescriptor { - WGPUCompareFunction compare; - WGPUStencilOperation failOp; - WGPUStencilOperation depthFailOp; - WGPUStencilOperation passOp; -} WGPUStencilStateFaceDescriptor; - -typedef struct WGPUStorageTextureBindingLayout { - WGPUChainedStruct const * nextInChain; - WGPUStorageTextureAccess access; - WGPUTextureFormat format; - WGPUTextureViewDimension viewDimension; -} WGPUStorageTextureBindingLayout; - -typedef struct WGPUSurfaceDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; -} WGPUSurfaceDescriptor; - -typedef struct WGPUSurfaceDescriptorFromCanvasHTMLSelector { - WGPUChainedStruct chain; - char const * selector; -} WGPUSurfaceDescriptorFromCanvasHTMLSelector; - -typedef struct WGPUSurfaceDescriptorFromMetalLayer { - WGPUChainedStruct chain; - void * layer; -} WGPUSurfaceDescriptorFromMetalLayer; - -typedef struct WGPUSurfaceDescriptorFromWindowsHWND { - WGPUChainedStruct chain; - void * hinstance; - void * hwnd; -} WGPUSurfaceDescriptorFromWindowsHWND; - -typedef struct WGPUSurfaceDescriptorFromXlib { - WGPUChainedStruct chain; - void * display; - uint32_t window; -} WGPUSurfaceDescriptorFromXlib; - -typedef struct WGPUSwapChainDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUTextureUsageFlags usage; - WGPUTextureFormat format; - uint32_t width; - uint32_t height; - WGPUPresentMode presentMode; - uint64_t implementation; -} WGPUSwapChainDescriptor; - -typedef struct WGPUTextureBindingLayout { - WGPUChainedStruct const * nextInChain; - WGPUTextureSampleType sampleType; - WGPUTextureViewDimension viewDimension; - bool multisampled; -} WGPUTextureBindingLayout; - -typedef struct WGPUTextureDataLayout { - WGPUChainedStruct const * nextInChain; - uint64_t offset; - uint32_t bytesPerRow; - uint32_t rowsPerImage; -} WGPUTextureDataLayout; - -typedef struct WGPUTextureViewDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUTextureFormat format; - WGPUTextureViewDimension dimension; - uint32_t baseMipLevel; - uint32_t mipLevelCount; - uint32_t baseArrayLayer; - uint32_t arrayLayerCount; - WGPUTextureAspect aspect; -} WGPUTextureViewDescriptor; - -typedef struct WGPUVertexAttributeDescriptor { - WGPUVertexFormat format; - uint64_t offset; - uint32_t shaderLocation; -} WGPUVertexAttributeDescriptor; - -typedef struct WGPUBindGroupDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUBindGroupLayout layout; - uint32_t entryCount; - WGPUBindGroupEntry const * entries; -} WGPUBindGroupDescriptor; - -typedef struct WGPUBindGroupLayoutEntry { - uint32_t binding; - WGPUShaderStageFlags visibility; - WGPUBindingType type; - bool hasDynamicOffset; - uint64_t minBufferBindingSize; - WGPUTextureViewDimension viewDimension; - WGPUTextureComponentType textureComponentType; - WGPUTextureFormat storageTextureFormat; - WGPUBufferBindingLayout buffer; - WGPUSamplerBindingLayout sampler; - WGPUTextureBindingLayout texture; - WGPUStorageTextureBindingLayout storageTexture; -} WGPUBindGroupLayoutEntry; - -typedef struct WGPUBufferCopyView { - WGPUChainedStruct const * nextInChain; - WGPUTextureDataLayout layout; - WGPUBuffer buffer; -} WGPUBufferCopyView; - -typedef struct WGPUColorStateDescriptor { - WGPUChainedStruct const * nextInChain; - WGPUTextureFormat format; - WGPUBlendDescriptor alphaBlend; - WGPUBlendDescriptor colorBlend; - WGPUColorWriteMaskFlags writeMask; -} WGPUColorStateDescriptor; - -typedef struct WGPUComputePipelineDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUPipelineLayout layout; - WGPUProgrammableStageDescriptor computeStage; -} WGPUComputePipelineDescriptor; - -typedef struct WGPUDepthStencilStateDescriptor { - WGPUChainedStruct const * nextInChain; - WGPUTextureFormat format; - bool depthWriteEnabled; - WGPUCompareFunction depthCompare; - WGPUStencilStateFaceDescriptor stencilFront; - WGPUStencilStateFaceDescriptor stencilBack; - uint32_t stencilReadMask; - uint32_t stencilWriteMask; -} WGPUDepthStencilStateDescriptor; - -typedef struct WGPURenderPassColorAttachmentDescriptor { - WGPUTextureView attachment; - WGPUTextureView resolveTarget; - WGPULoadOp loadOp; - WGPUStoreOp storeOp; - WGPUColor clearColor; -} WGPURenderPassColorAttachmentDescriptor; - -typedef struct WGPURenderPipelineDescriptorDummyExtension { - WGPUChainedStruct chain; - WGPUProgrammableStageDescriptor dummyStage; -} WGPURenderPipelineDescriptorDummyExtension; - -typedef struct WGPUTextureCopyView { - WGPUChainedStruct const * nextInChain; - WGPUTexture texture; - uint32_t mipLevel; - WGPUOrigin3D origin; - WGPUTextureAspect aspect; -} WGPUTextureCopyView; - -typedef struct WGPUTextureDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUTextureUsageFlags usage; - WGPUTextureDimension dimension; - WGPUExtent3D size; - WGPUTextureFormat format; - uint32_t mipLevelCount; - uint32_t sampleCount; -} WGPUTextureDescriptor; - -typedef struct WGPUVertexBufferLayoutDescriptor { - uint64_t arrayStride; - WGPUInputStepMode stepMode; - uint32_t attributeCount; - WGPUVertexAttributeDescriptor const * attributes; -} WGPUVertexBufferLayoutDescriptor; - -typedef struct WGPUBindGroupLayoutDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - uint32_t entryCount; - WGPUBindGroupLayoutEntry const * entries; -} WGPUBindGroupLayoutDescriptor; - -typedef struct WGPURenderPassDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - uint32_t colorAttachmentCount; - WGPURenderPassColorAttachmentDescriptor const * colorAttachments; - WGPURenderPassDepthStencilAttachmentDescriptor const * depthStencilAttachment; - WGPUQuerySet occlusionQuerySet; -} WGPURenderPassDescriptor; - -typedef struct WGPUVertexStateDescriptor { - WGPUChainedStruct const * nextInChain; - WGPUIndexFormat indexFormat; - uint32_t vertexBufferCount; - WGPUVertexBufferLayoutDescriptor const * vertexBuffers; -} WGPUVertexStateDescriptor; - -typedef struct WGPURenderPipelineDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUPipelineLayout layout; - WGPUProgrammableStageDescriptor vertexStage; - WGPUProgrammableStageDescriptor const * fragmentStage; - WGPUVertexStateDescriptor const * vertexState; - WGPUPrimitiveTopology primitiveTopology; - WGPURasterizationStateDescriptor const * rasterizationState; - uint32_t sampleCount; - WGPUDepthStencilStateDescriptor const * depthStencilState; - uint32_t colorStateCount; - WGPUColorStateDescriptor const * colorStates; - uint32_t sampleMask; - bool alphaToCoverageEnabled; -} WGPURenderPipelineDescriptor; - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata); -typedef void (*WGPUCreateReadyComputePipelineCallback)(WGPUCreateReadyPipelineStatus status, WGPUComputePipeline pipeline, char const * message, void * userdata); -typedef void (*WGPUCreateReadyRenderPipelineCallback)(WGPUCreateReadyPipelineStatus status, WGPURenderPipeline pipeline, char const * message, void * userdata); -typedef void (*WGPUDeviceLostCallback)(char const * message, void * userdata); -typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata); -typedef void (*WGPUFenceOnCompletionCallback)(WGPUFenceCompletionStatus status, void * userdata); - -typedef void (*WGPUProc)(void); - -#if !defined(WGPU_SKIP_PROCS) - -typedef WGPUInstance (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const * descriptor); -typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName); - -// Procs of BindGroup -typedef void (*WGPUProcBindGroupReference)(WGPUBindGroup bindGroup); -typedef void (*WGPUProcBindGroupRelease)(WGPUBindGroup bindGroup); - -// Procs of BindGroupLayout -typedef void (*WGPUProcBindGroupLayoutReference)(WGPUBindGroupLayout bindGroupLayout); -typedef void (*WGPUProcBindGroupLayoutRelease)(WGPUBindGroupLayout bindGroupLayout); - -// Procs of Buffer -typedef void (*WGPUProcBufferDestroy)(WGPUBuffer buffer); -typedef void const * (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size); -typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size); -typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata); -typedef void (*WGPUProcBufferUnmap)(WGPUBuffer buffer); -typedef void (*WGPUProcBufferReference)(WGPUBuffer buffer); -typedef void (*WGPUProcBufferRelease)(WGPUBuffer buffer); - -// Procs of CommandBuffer -typedef void (*WGPUProcCommandBufferReference)(WGPUCommandBuffer commandBuffer); -typedef void (*WGPUProcCommandBufferRelease)(WGPUCommandBuffer commandBuffer); - -// Procs of CommandEncoder -typedef WGPUComputePassEncoder (*WGPUProcCommandEncoderBeginComputePass)(WGPUCommandEncoder commandEncoder, WGPUComputePassDescriptor const * descriptor); -typedef WGPURenderPassEncoder (*WGPUProcCommandEncoderBeginRenderPass)(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor); -typedef void (*WGPUProcCommandEncoderCopyBufferToBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size); -typedef void (*WGPUProcCommandEncoderCopyBufferToTexture)(WGPUCommandEncoder commandEncoder, WGPUBufferCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize); -typedef void (*WGPUProcCommandEncoderCopyTextureToBuffer)(WGPUCommandEncoder commandEncoder, WGPUTextureCopyView const * source, WGPUBufferCopyView const * destination, WGPUExtent3D const * copySize); -typedef void (*WGPUProcCommandEncoderCopyTextureToTexture)(WGPUCommandEncoder commandEncoder, WGPUTextureCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize); -typedef WGPUCommandBuffer (*WGPUProcCommandEncoderFinish)(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * descriptor); -typedef void (*WGPUProcCommandEncoderInjectValidationError)(WGPUCommandEncoder commandEncoder, char const * message); -typedef void (*WGPUProcCommandEncoderInsertDebugMarker)(WGPUCommandEncoder commandEncoder, char const * markerLabel); -typedef void (*WGPUProcCommandEncoderPopDebugGroup)(WGPUCommandEncoder commandEncoder); -typedef void (*WGPUProcCommandEncoderPushDebugGroup)(WGPUCommandEncoder commandEncoder, char const * groupLabel); -typedef void (*WGPUProcCommandEncoderResolveQuerySet)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset); -typedef void (*WGPUProcCommandEncoderWriteTimestamp)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -typedef void (*WGPUProcCommandEncoderReference)(WGPUCommandEncoder commandEncoder); -typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder commandEncoder); - -// Procs of ComputePassEncoder -typedef void (*WGPUProcComputePassEncoderDispatch)(WGPUComputePassEncoder computePassEncoder, uint32_t x, uint32_t y, uint32_t z); -typedef void (*WGPUProcComputePassEncoderDispatchIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef void (*WGPUProcComputePassEncoderEndPass)(WGPUComputePassEncoder computePassEncoder); -typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, char const * markerLabel); -typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder); -typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, char const * groupLabel); -typedef void (*WGPUProcComputePassEncoderSetBindGroup)(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -typedef void (*WGPUProcComputePassEncoderSetPipeline)(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline); -typedef void (*WGPUProcComputePassEncoderWriteTimestamp)(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -typedef void (*WGPUProcComputePassEncoderReference)(WGPUComputePassEncoder computePassEncoder); -typedef void (*WGPUProcComputePassEncoderRelease)(WGPUComputePassEncoder computePassEncoder); - -// Procs of ComputePipeline -typedef WGPUBindGroupLayout (*WGPUProcComputePipelineGetBindGroupLayout)(WGPUComputePipeline computePipeline, uint32_t groupIndex); -typedef void (*WGPUProcComputePipelineReference)(WGPUComputePipeline computePipeline); -typedef void (*WGPUProcComputePipelineRelease)(WGPUComputePipeline computePipeline); - -// Procs of Device -typedef WGPUBindGroup (*WGPUProcDeviceCreateBindGroup)(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor); -typedef WGPUBindGroupLayout (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor); -typedef WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor); -typedef WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPUCommandEncoderDescriptor const * descriptor); -typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor); -typedef WGPUBuffer (*WGPUProcDeviceCreateErrorBuffer)(WGPUDevice device); -typedef WGPUPipelineLayout (*WGPUProcDeviceCreatePipelineLayout)(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor); -typedef WGPUQuerySet (*WGPUProcDeviceCreateQuerySet)(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor); -typedef void (*WGPUProcDeviceCreateReadyComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateReadyComputePipelineCallback callback, void * userdata); -typedef void (*WGPUProcDeviceCreateReadyRenderPipeline)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateReadyRenderPipelineCallback callback, void * userdata); -typedef WGPURenderBundleEncoder (*WGPUProcDeviceCreateRenderBundleEncoder)(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor); -typedef WGPURenderPipeline (*WGPUProcDeviceCreateRenderPipeline)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor); -typedef WGPUSampler (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPUSamplerDescriptor const * descriptor); -typedef WGPUShaderModule (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor); -typedef WGPUSwapChain (*WGPUProcDeviceCreateSwapChain)(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor); -typedef WGPUTexture (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor); -typedef WGPUQueue (*WGPUProcDeviceGetDefaultQueue)(WGPUDevice device); -typedef void (*WGPUProcDeviceInjectError)(WGPUDevice device, WGPUErrorType type, char const * message); -typedef void (*WGPUProcDeviceLoseForTesting)(WGPUDevice device); -typedef bool (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUErrorCallback callback, void * userdata); -typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter); -typedef void (*WGPUProcDeviceSetDeviceLostCallback)(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata); -typedef void (*WGPUProcDeviceSetUncapturedErrorCallback)(WGPUDevice device, WGPUErrorCallback callback, void * userdata); -typedef void (*WGPUProcDeviceTick)(WGPUDevice device); -typedef void (*WGPUProcDeviceReference)(WGPUDevice device); -typedef void (*WGPUProcDeviceRelease)(WGPUDevice device); - -// Procs of Fence -typedef uint64_t (*WGPUProcFenceGetCompletedValue)(WGPUFence fence); -typedef void (*WGPUProcFenceOnCompletion)(WGPUFence fence, uint64_t value, WGPUFenceOnCompletionCallback callback, void * userdata); -typedef void (*WGPUProcFenceReference)(WGPUFence fence); -typedef void (*WGPUProcFenceRelease)(WGPUFence fence); - -// Procs of Instance -typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor); -typedef void (*WGPUProcInstanceReference)(WGPUInstance instance); -typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance); - -// Procs of PipelineLayout -typedef void (*WGPUProcPipelineLayoutReference)(WGPUPipelineLayout pipelineLayout); -typedef void (*WGPUProcPipelineLayoutRelease)(WGPUPipelineLayout pipelineLayout); - -// Procs of QuerySet -typedef void (*WGPUProcQuerySetDestroy)(WGPUQuerySet querySet); -typedef void (*WGPUProcQuerySetReference)(WGPUQuerySet querySet); -typedef void (*WGPUProcQuerySetRelease)(WGPUQuerySet querySet); - -// Procs of Queue -typedef void (*WGPUProcQueueCopyTextureForBrowser)(WGPUQueue queue, WGPUTextureCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options); -typedef WGPUFence (*WGPUProcQueueCreateFence)(WGPUQueue queue, WGPUFenceDescriptor const * descriptor); -typedef void (*WGPUProcQueueSignal)(WGPUQueue queue, WGPUFence fence, uint64_t signalValue); -typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands); -typedef void (*WGPUProcQueueWriteBuffer)(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size); -typedef void (*WGPUProcQueueWriteTexture)(WGPUQueue queue, WGPUTextureCopyView const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize); -typedef void (*WGPUProcQueueReference)(WGPUQueue queue); -typedef void (*WGPUProcQueueRelease)(WGPUQueue queue); - -// Procs of RenderBundle -typedef void (*WGPUProcRenderBundleReference)(WGPURenderBundle renderBundle); -typedef void (*WGPUProcRenderBundleRelease)(WGPURenderBundle renderBundle); - -// Procs of RenderBundleEncoder -typedef void (*WGPUProcRenderBundleEncoderDraw)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -typedef void (*WGPUProcRenderBundleEncoderDrawIndexed)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); -typedef void (*WGPUProcRenderBundleEncoderDrawIndexedIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef void (*WGPUProcRenderBundleEncoderDrawIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef WGPURenderBundle (*WGPUProcRenderBundleEncoderFinish)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const * descriptor); -typedef void (*WGPUProcRenderBundleEncoderInsertDebugMarker)(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel); -typedef void (*WGPUProcRenderBundleEncoderPopDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder); -typedef void (*WGPUProcRenderBundleEncoderPushDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel); -typedef void (*WGPUProcRenderBundleEncoderSetBindGroup)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -typedef void (*WGPUProcRenderBundleEncoderSetIndexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderBundleEncoderSetIndexBufferWithFormat)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderBundleEncoderSetPipeline)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline); -typedef void (*WGPUProcRenderBundleEncoderSetVertexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderBundleEncoderReference)(WGPURenderBundleEncoder renderBundleEncoder); -typedef void (*WGPUProcRenderBundleEncoderRelease)(WGPURenderBundleEncoder renderBundleEncoder); - -// Procs of RenderPassEncoder -typedef void (*WGPUProcRenderPassEncoderBeginOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex); -typedef void (*WGPUProcRenderPassEncoderDraw)(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -typedef void (*WGPUProcRenderPassEncoderDrawIndexed)(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); -typedef void (*WGPUProcRenderPassEncoderDrawIndexedIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderEndPass)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, uint32_t bundlesCount, WGPURenderBundle const * bundles); -typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel); -typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel); -typedef void (*WGPUProcRenderPassEncoderSetBindGroup)(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -typedef void (*WGPUProcRenderPassEncoderSetBlendColor)(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color); -typedef void (*WGPUProcRenderPassEncoderSetIndexBuffer)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderPassEncoderSetIndexBufferWithFormat)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderPassEncoderSetPipeline)(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline); -typedef void (*WGPUProcRenderPassEncoderSetScissorRect)(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height); -typedef void (*WGPUProcRenderPassEncoderSetStencilReference)(WGPURenderPassEncoder renderPassEncoder, uint32_t reference); -typedef void (*WGPUProcRenderPassEncoderSetVertexBuffer)(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); -typedef void (*WGPUProcRenderPassEncoderSetViewport)(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth); -typedef void (*WGPUProcRenderPassEncoderWriteTimestamp)(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -typedef void (*WGPUProcRenderPassEncoderReference)(WGPURenderPassEncoder renderPassEncoder); -typedef void (*WGPUProcRenderPassEncoderRelease)(WGPURenderPassEncoder renderPassEncoder); - -// Procs of RenderPipeline -typedef WGPUBindGroupLayout (*WGPUProcRenderPipelineGetBindGroupLayout)(WGPURenderPipeline renderPipeline, uint32_t groupIndex); -typedef void (*WGPUProcRenderPipelineReference)(WGPURenderPipeline renderPipeline); -typedef void (*WGPUProcRenderPipelineRelease)(WGPURenderPipeline renderPipeline); - -// Procs of Sampler -typedef void (*WGPUProcSamplerReference)(WGPUSampler sampler); -typedef void (*WGPUProcSamplerRelease)(WGPUSampler sampler); - -// Procs of ShaderModule -typedef void (*WGPUProcShaderModuleReference)(WGPUShaderModule shaderModule); -typedef void (*WGPUProcShaderModuleRelease)(WGPUShaderModule shaderModule); - -// Procs of Surface -typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface); -typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface); - -// Procs of SwapChain -typedef void (*WGPUProcSwapChainConfigure)(WGPUSwapChain swapChain, WGPUTextureFormat format, WGPUTextureUsageFlags allowedUsage, uint32_t width, uint32_t height); -typedef WGPUTextureView (*WGPUProcSwapChainGetCurrentTextureView)(WGPUSwapChain swapChain); -typedef void (*WGPUProcSwapChainPresent)(WGPUSwapChain swapChain); -typedef void (*WGPUProcSwapChainReference)(WGPUSwapChain swapChain); -typedef void (*WGPUProcSwapChainRelease)(WGPUSwapChain swapChain); - -// Procs of Texture -typedef WGPUTextureView (*WGPUProcTextureCreateView)(WGPUTexture texture, WGPUTextureViewDescriptor const * descriptor); -typedef void (*WGPUProcTextureDestroy)(WGPUTexture texture); -typedef void (*WGPUProcTextureReference)(WGPUTexture texture); -typedef void (*WGPUProcTextureRelease)(WGPUTexture texture); - -// Procs of TextureView -typedef void (*WGPUProcTextureViewReference)(WGPUTextureView textureView); -typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView); - -#endif // !defined(WGPU_SKIP_PROCS) - -#if !defined(WGPU_SKIP_DECLARATIONS) - -WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPUInstanceDescriptor const * descriptor); -WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName); - -// Methods of BindGroup -WGPU_EXPORT void wgpuBindGroupReference(WGPUBindGroup bindGroup); -WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup); - -// Methods of BindGroupLayout -WGPU_EXPORT void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout); -WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout); - -// Methods of Buffer -WGPU_EXPORT void wgpuBufferDestroy(WGPUBuffer buffer); -WGPU_EXPORT void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size); -WGPU_EXPORT void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size); -WGPU_EXPORT void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata); -WGPU_EXPORT void wgpuBufferUnmap(WGPUBuffer buffer); -WGPU_EXPORT void wgpuBufferReference(WGPUBuffer buffer); -WGPU_EXPORT void wgpuBufferRelease(WGPUBuffer buffer); - -// Methods of CommandBuffer -WGPU_EXPORT void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer); -WGPU_EXPORT void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer); - -// Methods of CommandEncoder -WGPU_EXPORT WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPUComputePassDescriptor const * descriptor); -WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor); -WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size); -WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUBufferCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize); -WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUTextureCopyView const * source, WGPUBufferCopyView const * destination, WGPUExtent3D const * copySize); -WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUTextureCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize); -WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * descriptor); -WGPU_EXPORT void wgpuCommandEncoderInjectValidationError(WGPUCommandEncoder commandEncoder, char const * message); -WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel); -WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder); -WGPU_EXPORT void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, char const * groupLabel); -WGPU_EXPORT void wgpuCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset); -WGPU_EXPORT void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -WGPU_EXPORT void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder); -WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder); - -// Methods of ComputePassEncoder -WGPU_EXPORT void wgpuComputePassEncoderDispatch(WGPUComputePassEncoder computePassEncoder, uint32_t x, uint32_t y, uint32_t z); -WGPU_EXPORT void wgpuComputePassEncoderDispatchIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT void wgpuComputePassEncoderEndPass(WGPUComputePassEncoder computePassEncoder); -WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel); -WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder); -WGPU_EXPORT void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, char const * groupLabel); -WGPU_EXPORT void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -WGPU_EXPORT void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline); -WGPU_EXPORT void wgpuComputePassEncoderWriteTimestamp(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -WGPU_EXPORT void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder); -WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder); - -// Methods of ComputePipeline -WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex); -WGPU_EXPORT void wgpuComputePipelineReference(WGPUComputePipeline computePipeline); -WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline); - -// Methods of Device -WGPU_EXPORT WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor); -WGPU_EXPORT WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor); -WGPU_EXPORT WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor); -WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPUCommandEncoderDescriptor const * descriptor); -WGPU_EXPORT WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor); -WGPU_EXPORT WGPUBuffer wgpuDeviceCreateErrorBuffer(WGPUDevice device); -WGPU_EXPORT WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor); -WGPU_EXPORT WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor); -WGPU_EXPORT void wgpuDeviceCreateReadyComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateReadyComputePipelineCallback callback, void * userdata); -WGPU_EXPORT void wgpuDeviceCreateReadyRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateReadyRenderPipelineCallback callback, void * userdata); -WGPU_EXPORT WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor); -WGPU_EXPORT WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor); -WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPUSamplerDescriptor const * descriptor); -WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor); -WGPU_EXPORT WGPUSwapChain wgpuDeviceCreateSwapChain(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor); -WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor); -WGPU_EXPORT WGPUQueue wgpuDeviceGetDefaultQueue(WGPUDevice device); -WGPU_EXPORT void wgpuDeviceInjectError(WGPUDevice device, WGPUErrorType type, char const * message); -WGPU_EXPORT void wgpuDeviceLoseForTesting(WGPUDevice device); -WGPU_EXPORT bool wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback callback, void * userdata); -WGPU_EXPORT void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter); -WGPU_EXPORT void wgpuDeviceSetDeviceLostCallback(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata); -WGPU_EXPORT void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void * userdata); -WGPU_EXPORT void wgpuDeviceTick(WGPUDevice device); -WGPU_EXPORT void wgpuDeviceReference(WGPUDevice device); -WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device); - -// Methods of Fence -WGPU_EXPORT uint64_t wgpuFenceGetCompletedValue(WGPUFence fence); -WGPU_EXPORT void wgpuFenceOnCompletion(WGPUFence fence, uint64_t value, WGPUFenceOnCompletionCallback callback, void * userdata); -WGPU_EXPORT void wgpuFenceReference(WGPUFence fence); -WGPU_EXPORT void wgpuFenceRelease(WGPUFence fence); - -// Methods of Instance -WGPU_EXPORT WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor); -WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance); -WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance); - -// Methods of PipelineLayout -WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout); -WGPU_EXPORT void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout); - -// Methods of QuerySet -WGPU_EXPORT void wgpuQuerySetDestroy(WGPUQuerySet querySet); -WGPU_EXPORT void wgpuQuerySetReference(WGPUQuerySet querySet); -WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet); - -// Methods of Queue -WGPU_EXPORT void wgpuQueueCopyTextureForBrowser(WGPUQueue queue, WGPUTextureCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options); -WGPU_EXPORT WGPUFence wgpuQueueCreateFence(WGPUQueue queue, WGPUFenceDescriptor const * descriptor); -WGPU_EXPORT void wgpuQueueSignal(WGPUQueue queue, WGPUFence fence, uint64_t signalValue); -WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands); -WGPU_EXPORT void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size); -WGPU_EXPORT void wgpuQueueWriteTexture(WGPUQueue queue, WGPUTextureCopyView const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize); -WGPU_EXPORT void wgpuQueueReference(WGPUQueue queue); -WGPU_EXPORT void wgpuQueueRelease(WGPUQueue queue); - -// Methods of RenderBundle -WGPU_EXPORT void wgpuRenderBundleReference(WGPURenderBundle renderBundle); -WGPU_EXPORT void wgpuRenderBundleRelease(WGPURenderBundle renderBundle); - -// Methods of RenderBundleEncoder -WGPU_EXPORT void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const * descriptor); -WGPU_EXPORT void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel); -WGPU_EXPORT void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder); -WGPU_EXPORT void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel); -WGPU_EXPORT void wgpuRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -WGPU_EXPORT void wgpuRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderBundleEncoderSetIndexBufferWithFormat(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline); -WGPU_EXPORT void wgpuRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderBundleEncoderReference(WGPURenderBundleEncoder renderBundleEncoder); -WGPU_EXPORT void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder); - -// Methods of RenderPassEncoder -WGPU_EXPORT void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex); -WGPU_EXPORT void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); -WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder); -WGPU_EXPORT void wgpuRenderPassEncoderEndPass(WGPURenderPassEncoder renderPassEncoder); -WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, uint32_t bundlesCount, WGPURenderBundle const * bundles); -WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel); -WGPU_EXPORT void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder); -WGPU_EXPORT void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel); -WGPU_EXPORT void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); -WGPU_EXPORT void wgpuRenderPassEncoderSetBlendColor(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color); -WGPU_EXPORT void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderPassEncoderSetIndexBufferWithFormat(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline); -WGPU_EXPORT void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height); -WGPU_EXPORT void wgpuRenderPassEncoderSetStencilReference(WGPURenderPassEncoder renderPassEncoder, uint32_t reference); -WGPU_EXPORT void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); -WGPU_EXPORT void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth); -WGPU_EXPORT void wgpuRenderPassEncoderWriteTimestamp(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); -WGPU_EXPORT void wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEncoder); -WGPU_EXPORT void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder); - -// Methods of RenderPipeline -WGPU_EXPORT WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex); -WGPU_EXPORT void wgpuRenderPipelineReference(WGPURenderPipeline renderPipeline); -WGPU_EXPORT void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline); - -// Methods of Sampler -WGPU_EXPORT void wgpuSamplerReference(WGPUSampler sampler); -WGPU_EXPORT void wgpuSamplerRelease(WGPUSampler sampler); - -// Methods of ShaderModule -WGPU_EXPORT void wgpuShaderModuleReference(WGPUShaderModule shaderModule); -WGPU_EXPORT void wgpuShaderModuleRelease(WGPUShaderModule shaderModule); - -// Methods of Surface -WGPU_EXPORT void wgpuSurfaceReference(WGPUSurface surface); -WGPU_EXPORT void wgpuSurfaceRelease(WGPUSurface surface); - -// Methods of SwapChain -WGPU_EXPORT void wgpuSwapChainConfigure(WGPUSwapChain swapChain, WGPUTextureFormat format, WGPUTextureUsageFlags allowedUsage, uint32_t width, uint32_t height); -WGPU_EXPORT WGPUTextureView wgpuSwapChainGetCurrentTextureView(WGPUSwapChain swapChain); -WGPU_EXPORT void wgpuSwapChainPresent(WGPUSwapChain swapChain); -WGPU_EXPORT void wgpuSwapChainReference(WGPUSwapChain swapChain); -WGPU_EXPORT void wgpuSwapChainRelease(WGPUSwapChain swapChain); - -// Methods of Texture -WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPUTextureViewDescriptor const * descriptor); -WGPU_EXPORT void wgpuTextureDestroy(WGPUTexture texture); -WGPU_EXPORT void wgpuTextureReference(WGPUTexture texture); -WGPU_EXPORT void wgpuTextureRelease(WGPUTexture texture); - -// Methods of TextureView -WGPU_EXPORT void wgpuTextureViewReference(WGPUTextureView textureView); -WGPU_EXPORT void wgpuTextureViewRelease(WGPUTextureView textureView); - -#endif // !defined(WGPU_SKIP_DECLARATIONS) - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // WEBGPU_H_ diff --git a/bgfx/3rdparty/webgpu/include/webgpu/webgpu_cpp.h b/bgfx/3rdparty/webgpu/include/webgpu/webgpu_cpp.h deleted file mode 100644 index 1d8a56a5..00000000 --- a/bgfx/3rdparty/webgpu/include/webgpu/webgpu_cpp.h +++ /dev/null @@ -1,1418 +0,0 @@ -#ifndef WEBGPU_CPP_H_ -#define WEBGPU_CPP_H_ - -#include "webgpu.h" -#include "EnumClassBitmasks.h" - -namespace wgpu { - - static constexpr uint64_t kWholeSize = WGPU_WHOLE_SIZE; - // TODO(crbug.com/520): Remove kStrideUndefined in favor of kCopyStrideUndefined. - static constexpr uint32_t kStrideUndefined = WGPU_STRIDE_UNDEFINED; - static constexpr uint32_t kCopyStrideUndefined = WGPU_COPY_STRIDE_UNDEFINED; - - enum class AdapterType : uint32_t { - DiscreteGPU = 0x00000000, - IntegratedGPU = 0x00000001, - CPU = 0x00000002, - Unknown = 0x00000003, - }; - - enum class AddressMode : uint32_t { - Repeat = 0x00000000, - MirrorRepeat = 0x00000001, - ClampToEdge = 0x00000002, - }; - - enum class BackendType : uint32_t { - Null = 0x00000000, - D3D11 = 0x00000001, - D3D12 = 0x00000002, - Metal = 0x00000003, - Vulkan = 0x00000004, - OpenGL = 0x00000005, - OpenGLES = 0x00000006, - }; - - enum class BindingType : uint32_t { - Undefined = 0x00000000, - UniformBuffer = 0x00000001, - StorageBuffer = 0x00000002, - ReadonlyStorageBuffer = 0x00000003, - Sampler = 0x00000004, - ComparisonSampler = 0x00000005, - SampledTexture = 0x00000006, - MultisampledTexture = 0x00000007, - ReadonlyStorageTexture = 0x00000008, - WriteonlyStorageTexture = 0x00000009, - }; - - enum class BlendFactor : uint32_t { - Zero = 0x00000000, - One = 0x00000001, - SrcColor = 0x00000002, - OneMinusSrcColor = 0x00000003, - SrcAlpha = 0x00000004, - OneMinusSrcAlpha = 0x00000005, - DstColor = 0x00000006, - OneMinusDstColor = 0x00000007, - DstAlpha = 0x00000008, - OneMinusDstAlpha = 0x00000009, - SrcAlphaSaturated = 0x0000000A, - BlendColor = 0x0000000B, - OneMinusBlendColor = 0x0000000C, - }; - - enum class BlendOperation : uint32_t { - Add = 0x00000000, - Subtract = 0x00000001, - ReverseSubtract = 0x00000002, - Min = 0x00000003, - Max = 0x00000004, - }; - - enum class BufferBindingType : uint32_t { - Undefined = 0x00000000, - Uniform = 0x00000001, - Storage = 0x00000002, - ReadOnlyStorage = 0x00000003, - }; - - enum class BufferMapAsyncStatus : uint32_t { - Success = 0x00000000, - Error = 0x00000001, - Unknown = 0x00000002, - DeviceLost = 0x00000003, - DestroyedBeforeCallback = 0x00000004, - UnmappedBeforeCallback = 0x00000005, - }; - - enum class CompareFunction : uint32_t { - Undefined = 0x00000000, - Never = 0x00000001, - Less = 0x00000002, - LessEqual = 0x00000003, - Greater = 0x00000004, - GreaterEqual = 0x00000005, - Equal = 0x00000006, - NotEqual = 0x00000007, - Always = 0x00000008, - }; - - enum class CreateReadyPipelineStatus : uint32_t { - Success = 0x00000000, - Error = 0x00000001, - DeviceLost = 0x00000002, - DeviceDestroyed = 0x00000003, - Unknown = 0x00000004, - }; - - enum class CullMode : uint32_t { - None = 0x00000000, - Front = 0x00000001, - Back = 0x00000002, - }; - - enum class ErrorFilter : uint32_t { - None = 0x00000000, - Validation = 0x00000001, - OutOfMemory = 0x00000002, - }; - - enum class ErrorType : uint32_t { - NoError = 0x00000000, - Validation = 0x00000001, - OutOfMemory = 0x00000002, - Unknown = 0x00000003, - DeviceLost = 0x00000004, - }; - - enum class FenceCompletionStatus : uint32_t { - Success = 0x00000000, - Error = 0x00000001, - Unknown = 0x00000002, - DeviceLost = 0x00000003, - }; - - enum class FilterMode : uint32_t { - Nearest = 0x00000000, - Linear = 0x00000001, - }; - - enum class FrontFace : uint32_t { - CCW = 0x00000000, - CW = 0x00000001, - }; - - enum class IndexFormat : uint32_t { - Undefined = 0x00000000, - Uint16 = 0x00000001, - Uint32 = 0x00000002, - }; - - enum class InputStepMode : uint32_t { - Vertex = 0x00000000, - Instance = 0x00000001, - }; - - enum class LoadOp : uint32_t { - Clear = 0x00000000, - Load = 0x00000001, - }; - - enum class PipelineStatisticName : uint32_t { - VertexShaderInvocations = 0x00000000, - ClipperInvocations = 0x00000001, - ClipperPrimitivesOut = 0x00000002, - FragmentShaderInvocations = 0x00000003, - ComputeShaderInvocations = 0x00000004, - }; - - enum class PresentMode : uint32_t { - Immediate = 0x00000000, - Mailbox = 0x00000001, - Fifo = 0x00000002, - }; - - enum class PrimitiveTopology : uint32_t { - PointList = 0x00000000, - LineList = 0x00000001, - LineStrip = 0x00000002, - TriangleList = 0x00000003, - TriangleStrip = 0x00000004, - }; - - enum class QueryType : uint32_t { - Occlusion = 0x00000000, - PipelineStatistics = 0x00000001, - Timestamp = 0x00000002, - }; - - enum class SType : uint32_t { - Invalid = 0x00000000, - SurfaceDescriptorFromMetalLayer = 0x00000001, - SurfaceDescriptorFromWindowsHWND = 0x00000002, - SurfaceDescriptorFromXlib = 0x00000003, - SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004, - ShaderModuleSPIRVDescriptor = 0x00000005, - ShaderModuleWGSLDescriptor = 0x00000006, - SamplerDescriptorDummyAnisotropicFiltering = 0x00000007, - RenderPipelineDescriptorDummyExtension = 0x00000008, - }; - - enum class SamplerBindingType : uint32_t { - Undefined = 0x00000000, - Filtering = 0x00000001, - NonFiltering = 0x00000002, - Comparison = 0x00000003, - }; - - enum class StencilOperation : uint32_t { - Keep = 0x00000000, - Zero = 0x00000001, - Replace = 0x00000002, - Invert = 0x00000003, - IncrementClamp = 0x00000004, - DecrementClamp = 0x00000005, - IncrementWrap = 0x00000006, - DecrementWrap = 0x00000007, - }; - - enum class StorageTextureAccess : uint32_t { - Undefined = 0x00000000, - ReadOnly = 0x00000001, - WriteOnly = 0x00000002, - }; - - enum class StoreOp : uint32_t { - Store = 0x00000000, - Clear = 0x00000001, - }; - - enum class TextureAspect : uint32_t { - All = 0x00000000, - StencilOnly = 0x00000001, - DepthOnly = 0x00000002, - }; - - enum class TextureComponentType : uint32_t { - Float = 0x00000000, - Sint = 0x00000001, - Uint = 0x00000002, - DepthComparison = 0x00000003, - }; - - enum class TextureDimension : uint32_t { - e1D = 0x00000000, - e2D = 0x00000001, - e3D = 0x00000002, - }; - - enum class TextureFormat : uint32_t { - Undefined = 0x00000000, - R8Unorm = 0x00000001, - R8Snorm = 0x00000002, - R8Uint = 0x00000003, - R8Sint = 0x00000004, - R16Uint = 0x00000005, - R16Sint = 0x00000006, - R16Float = 0x00000007, - RG8Unorm = 0x00000008, - RG8Snorm = 0x00000009, - RG8Uint = 0x0000000A, - RG8Sint = 0x0000000B, - R32Float = 0x0000000C, - R32Uint = 0x0000000D, - R32Sint = 0x0000000E, - RG16Uint = 0x0000000F, - RG16Sint = 0x00000010, - RG16Float = 0x00000011, - RGBA8Unorm = 0x00000012, - RGBA8UnormSrgb = 0x00000013, - RGBA8Snorm = 0x00000014, - RGBA8Uint = 0x00000015, - RGBA8Sint = 0x00000016, - BGRA8Unorm = 0x00000017, - BGRA8UnormSrgb = 0x00000018, - RGB10A2Unorm = 0x00000019, - RG11B10Ufloat = 0x0000001A, - RGB9E5Ufloat = 0x0000001B, - RG32Float = 0x0000001C, - RG32Uint = 0x0000001D, - RG32Sint = 0x0000001E, - RGBA16Uint = 0x0000001F, - RGBA16Sint = 0x00000020, - RGBA16Float = 0x00000021, - RGBA32Float = 0x00000022, - RGBA32Uint = 0x00000023, - RGBA32Sint = 0x00000024, - Depth32Float = 0x00000025, - Depth24Plus = 0x00000026, - Depth24PlusStencil8 = 0x00000027, - BC1RGBAUnorm = 0x00000028, - BC1RGBAUnormSrgb = 0x00000029, - BC2RGBAUnorm = 0x0000002A, - BC2RGBAUnormSrgb = 0x0000002B, - BC3RGBAUnorm = 0x0000002C, - BC3RGBAUnormSrgb = 0x0000002D, - BC4RUnorm = 0x0000002E, - BC4RSnorm = 0x0000002F, - BC5RGUnorm = 0x00000030, - BC5RGSnorm = 0x00000031, - BC6HRGBUfloat = 0x00000032, - BC6HRGBFloat = 0x00000033, - BC7RGBAUnorm = 0x00000034, - BC7RGBAUnormSrgb = 0x00000035, - }; - - enum class TextureSampleType : uint32_t { - Undefined = 0x00000000, - Float = 0x00000001, - UnfilterableFloat = 0x00000002, - Depth = 0x00000003, - Sint = 0x00000004, - Uint = 0x00000005, - }; - - enum class TextureViewDimension : uint32_t { - Undefined = 0x00000000, - e1D = 0x00000001, - e2D = 0x00000002, - e2DArray = 0x00000003, - Cube = 0x00000004, - CubeArray = 0x00000005, - e3D = 0x00000006, - }; - - enum class VertexFormat : uint32_t { - UChar2 = 0x00000000, - UChar4 = 0x00000001, - Char2 = 0x00000002, - Char4 = 0x00000003, - UChar2Norm = 0x00000004, - UChar4Norm = 0x00000005, - Char2Norm = 0x00000006, - Char4Norm = 0x00000007, - UShort2 = 0x00000008, - UShort4 = 0x00000009, - Short2 = 0x0000000A, - Short4 = 0x0000000B, - UShort2Norm = 0x0000000C, - UShort4Norm = 0x0000000D, - Short2Norm = 0x0000000E, - Short4Norm = 0x0000000F, - Half2 = 0x00000010, - Half4 = 0x00000011, - Float = 0x00000012, - Float2 = 0x00000013, - Float3 = 0x00000014, - Float4 = 0x00000015, - UInt = 0x00000016, - UInt2 = 0x00000017, - UInt3 = 0x00000018, - UInt4 = 0x00000019, - Int = 0x0000001A, - Int2 = 0x0000001B, - Int3 = 0x0000001C, - Int4 = 0x0000001D, - }; - - - enum class BufferUsage : uint32_t { - None = 0x00000000, - MapRead = 0x00000001, - MapWrite = 0x00000002, - CopySrc = 0x00000004, - CopyDst = 0x00000008, - Index = 0x00000010, - Vertex = 0x00000020, - Uniform = 0x00000040, - Storage = 0x00000080, - Indirect = 0x00000100, - QueryResolve = 0x00000200, - }; - - enum class ColorWriteMask : uint32_t { - None = 0x00000000, - Red = 0x00000001, - Green = 0x00000002, - Blue = 0x00000004, - Alpha = 0x00000008, - All = 0x0000000F, - }; - - enum class MapMode : uint32_t { - None = 0x00000000, - Read = 0x00000001, - Write = 0x00000002, - }; - - enum class ShaderStage : uint32_t { - None = 0x00000000, - Vertex = 0x00000001, - Fragment = 0x00000002, - Compute = 0x00000004, - }; - - enum class TextureUsage : uint32_t { - None = 0x00000000, - CopySrc = 0x00000001, - CopyDst = 0x00000002, - Sampled = 0x00000004, - Storage = 0x00000008, - OutputAttachment = 0x00000010, - RenderAttachment = 0x00000010, - Present = 0x00000020, - }; - - - template<> - struct IsDawnBitmask { - static constexpr bool enable = true; - }; - - template<> - struct IsDawnBitmask { - static constexpr bool enable = true; - }; - - template<> - struct IsDawnBitmask { - static constexpr bool enable = true; - }; - - template<> - struct IsDawnBitmask { - static constexpr bool enable = true; - }; - - template<> - struct IsDawnBitmask { - static constexpr bool enable = true; - }; - - - using Proc = WGPUProc; - using BufferMapCallback = WGPUBufferMapCallback; - using CreateReadyComputePipelineCallback = WGPUCreateReadyComputePipelineCallback; - using CreateReadyRenderPipelineCallback = WGPUCreateReadyRenderPipelineCallback; - using DeviceLostCallback = WGPUDeviceLostCallback; - using ErrorCallback = WGPUErrorCallback; - using FenceOnCompletionCallback = WGPUFenceOnCompletionCallback; - - class BindGroup; - class BindGroupLayout; - class Buffer; - class CommandBuffer; - class CommandEncoder; - class ComputePassEncoder; - class ComputePipeline; - class Device; - class Fence; - class Instance; - class PipelineLayout; - class QuerySet; - class Queue; - class RenderBundle; - class RenderBundleEncoder; - class RenderPassEncoder; - class RenderPipeline; - class Sampler; - class ShaderModule; - class Surface; - class SwapChain; - class Texture; - class TextureView; - - struct AdapterProperties; - struct BindGroupEntry; - struct BlendDescriptor; - struct BufferBindingLayout; - struct BufferDescriptor; - struct Color; - struct CommandBufferDescriptor; - struct CommandEncoderDescriptor; - struct ComputePassDescriptor; - struct CopyTextureForBrowserOptions; - struct DeviceProperties; - struct Extent3D; - struct FenceDescriptor; - struct InstanceDescriptor; - struct Origin3D; - struct PipelineLayoutDescriptor; - struct ProgrammableStageDescriptor; - struct QuerySetDescriptor; - struct RasterizationStateDescriptor; - struct RenderBundleDescriptor; - struct RenderBundleEncoderDescriptor; - struct RenderPassDepthStencilAttachmentDescriptor; - struct SamplerBindingLayout; - struct SamplerDescriptor; - struct SamplerDescriptorDummyAnisotropicFiltering; - struct ShaderModuleDescriptor; - struct ShaderModuleSPIRVDescriptor; - struct ShaderModuleWGSLDescriptor; - struct StencilStateFaceDescriptor; - struct StorageTextureBindingLayout; - struct SurfaceDescriptor; - struct SurfaceDescriptorFromCanvasHTMLSelector; - struct SurfaceDescriptorFromMetalLayer; - struct SurfaceDescriptorFromWindowsHWND; - struct SurfaceDescriptorFromXlib; - struct SwapChainDescriptor; - struct TextureBindingLayout; - struct TextureDataLayout; - struct TextureViewDescriptor; - struct VertexAttributeDescriptor; - struct BindGroupDescriptor; - struct BindGroupLayoutEntry; - struct BufferCopyView; - struct ColorStateDescriptor; - struct ComputePipelineDescriptor; - struct DepthStencilStateDescriptor; - struct RenderPassColorAttachmentDescriptor; - struct RenderPipelineDescriptorDummyExtension; - struct TextureCopyView; - struct TextureDescriptor; - struct VertexBufferLayoutDescriptor; - struct BindGroupLayoutDescriptor; - struct RenderPassDescriptor; - struct VertexStateDescriptor; - struct RenderPipelineDescriptor; - - template - class ObjectBase { - public: - ObjectBase() = default; - ObjectBase(CType handle): mHandle(handle) { - if (mHandle) Derived::WGPUReference(mHandle); - } - ~ObjectBase() { - if (mHandle) Derived::WGPURelease(mHandle); - } - - ObjectBase(ObjectBase const& other) - : ObjectBase(other.Get()) { - } - Derived& operator=(ObjectBase const& other) { - if (&other != this) { - if (mHandle) Derived::WGPURelease(mHandle); - mHandle = other.mHandle; - if (mHandle) Derived::WGPUReference(mHandle); - } - - return static_cast(*this); - } - - ObjectBase(ObjectBase&& other) { - mHandle = other.mHandle; - other.mHandle = 0; - } - Derived& operator=(ObjectBase&& other) { - if (&other != this) { - if (mHandle) Derived::WGPURelease(mHandle); - mHandle = other.mHandle; - other.mHandle = 0; - } - - return static_cast(*this); - } - - ObjectBase(std::nullptr_t) {} - Derived& operator=(std::nullptr_t) { - if (mHandle != nullptr) { - Derived::WGPURelease(mHandle); - mHandle = nullptr; - } - return static_cast(*this); - } - - bool operator==(std::nullptr_t) const { - return mHandle == nullptr; - } - bool operator!=(std::nullptr_t) const { - return mHandle != nullptr; - } - - explicit operator bool() const { - return mHandle != nullptr; - } - CType Get() const { - return mHandle; - } - CType Release() { - CType result = mHandle; - mHandle = 0; - return result; - } - static Derived Acquire(CType handle) { - Derived result; - result.mHandle = handle; - return result; - } - - protected: - CType mHandle = nullptr; - }; - - - - class BindGroup : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - - private: - friend ObjectBase; - static void WGPUReference(WGPUBindGroup handle); - static void WGPURelease(WGPUBindGroup handle); - }; - - class BindGroupLayout : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - - private: - friend ObjectBase; - static void WGPUReference(WGPUBindGroupLayout handle); - static void WGPURelease(WGPUBindGroupLayout handle); - }; - - class Buffer : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void Destroy() const; - void const * GetConstMappedRange(size_t offset = 0, size_t size = 0) const; - void * GetMappedRange(size_t offset = 0, size_t size = 0) const; - void MapAsync(MapMode mode, size_t offset, size_t size, BufferMapCallback callback, void * userdata) const; - void Unmap() const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUBuffer handle); - static void WGPURelease(WGPUBuffer handle); - }; - - class CommandBuffer : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - - private: - friend ObjectBase; - static void WGPUReference(WGPUCommandBuffer handle); - static void WGPURelease(WGPUCommandBuffer handle); - }; - - class CommandEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - ComputePassEncoder BeginComputePass(ComputePassDescriptor const * descriptor = nullptr) const; - RenderPassEncoder BeginRenderPass(RenderPassDescriptor const * descriptor) const; - void CopyBufferToBuffer(Buffer const& source, uint64_t sourceOffset, Buffer const& destination, uint64_t destinationOffset, uint64_t size) const; - void CopyBufferToTexture(BufferCopyView const * source, TextureCopyView const * destination, Extent3D const * copySize) const; - void CopyTextureToBuffer(TextureCopyView const * source, BufferCopyView const * destination, Extent3D const * copySize) const; - void CopyTextureToTexture(TextureCopyView const * source, TextureCopyView const * destination, Extent3D const * copySize) const; - CommandBuffer Finish(CommandBufferDescriptor const * descriptor = nullptr) const; - void InjectValidationError(char const * message) const; - void InsertDebugMarker(char const * markerLabel) const; - void PopDebugGroup() const; - void PushDebugGroup(char const * groupLabel) const; - void ResolveQuerySet(QuerySet const& querySet, uint32_t firstQuery, uint32_t queryCount, Buffer const& destination, uint64_t destinationOffset) const; - void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUCommandEncoder handle); - static void WGPURelease(WGPUCommandEncoder handle); - }; - - class ComputePassEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void Dispatch(uint32_t x, uint32_t y = 1, uint32_t z = 1) const; - void DispatchIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - void EndPass() const; - void InsertDebugMarker(char const * markerLabel) const; - void PopDebugGroup() const; - void PushDebugGroup(char const * groupLabel) const; - void SetBindGroup(uint32_t groupIndex, BindGroup const& group, uint32_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - void SetPipeline(ComputePipeline const& pipeline) const; - void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUComputePassEncoder handle); - static void WGPURelease(WGPUComputePassEncoder handle); - }; - - class ComputePipeline : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - BindGroupLayout GetBindGroupLayout(uint32_t groupIndex) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUComputePipeline handle); - static void WGPURelease(WGPUComputePipeline handle); - }; - - class Device : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - BindGroup CreateBindGroup(BindGroupDescriptor const * descriptor) const; - BindGroupLayout CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const; - Buffer CreateBuffer(BufferDescriptor const * descriptor) const; - CommandEncoder CreateCommandEncoder(CommandEncoderDescriptor const * descriptor = nullptr) const; - ComputePipeline CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const; - Buffer CreateErrorBuffer() const; - PipelineLayout CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const; - QuerySet CreateQuerySet(QuerySetDescriptor const * descriptor) const; - void CreateReadyComputePipeline(ComputePipelineDescriptor const * descriptor, CreateReadyComputePipelineCallback callback, void * userdata) const; - void CreateReadyRenderPipeline(RenderPipelineDescriptor const * descriptor, CreateReadyRenderPipelineCallback callback, void * userdata) const; - RenderBundleEncoder CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const; - RenderPipeline CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const; - Sampler CreateSampler(SamplerDescriptor const * descriptor) const; - ShaderModule CreateShaderModule(ShaderModuleDescriptor const * descriptor) const; - SwapChain CreateSwapChain(Surface const& surface, SwapChainDescriptor const * descriptor) const; - Texture CreateTexture(TextureDescriptor const * descriptor) const; - Queue GetDefaultQueue() const; - void InjectError(ErrorType type, char const * message) const; - void LoseForTesting() const; - bool PopErrorScope(ErrorCallback callback, void * userdata) const; - void PushErrorScope(ErrorFilter filter) const; - void SetDeviceLostCallback(DeviceLostCallback callback, void * userdata) const; - void SetUncapturedErrorCallback(ErrorCallback callback, void * userdata) const; - void Tick() const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUDevice handle); - static void WGPURelease(WGPUDevice handle); - }; - - class Fence : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - uint64_t GetCompletedValue() const; - void OnCompletion(uint64_t value, FenceOnCompletionCallback callback, void * userdata) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUFence handle); - static void WGPURelease(WGPUFence handle); - }; - - class Instance : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - Surface CreateSurface(SurfaceDescriptor const * descriptor) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUInstance handle); - static void WGPURelease(WGPUInstance handle); - }; - - class PipelineLayout : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - - private: - friend ObjectBase; - static void WGPUReference(WGPUPipelineLayout handle); - static void WGPURelease(WGPUPipelineLayout handle); - }; - - class QuerySet : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void Destroy() const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUQuerySet handle); - static void WGPURelease(WGPUQuerySet handle); - }; - - class Queue : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void CopyTextureForBrowser(TextureCopyView const * source, TextureCopyView const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const; - Fence CreateFence(FenceDescriptor const * descriptor = nullptr) const; - void Signal(Fence const& fence, uint64_t signalValue) const; - void Submit(uint32_t commandCount, CommandBuffer const * commands) const; - void WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const; - void WriteTexture(TextureCopyView const * destination, void const * data, size_t dataSize, TextureDataLayout const * dataLayout, Extent3D const * writeSize) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUQueue handle); - static void WGPURelease(WGPUQueue handle); - }; - - class RenderBundle : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - - private: - friend ObjectBase; - static void WGPUReference(WGPURenderBundle handle); - static void WGPURelease(WGPURenderBundle handle); - }; - - class RenderBundleEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t firstVertex = 0, uint32_t firstInstance = 0) const; - void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t firstIndex = 0, int32_t baseVertex = 0, uint32_t firstInstance = 0) const; - void DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - RenderBundle Finish(RenderBundleDescriptor const * descriptor = nullptr) const; - void InsertDebugMarker(char const * markerLabel) const; - void PopDebugGroup() const; - void PushDebugGroup(char const * groupLabel) const; - void SetBindGroup(uint32_t groupIndex, BindGroup const& group, uint32_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = 0) const; - void SetIndexBufferWithFormat(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = 0) const; - void SetPipeline(RenderPipeline const& pipeline) const; - void SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset = 0, uint64_t size = 0) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPURenderBundleEncoder handle); - static void WGPURelease(WGPURenderBundleEncoder handle); - }; - - class RenderPassEncoder : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void BeginOcclusionQuery(uint32_t queryIndex) const; - void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t firstVertex = 0, uint32_t firstInstance = 0) const; - void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t firstIndex = 0, int32_t baseVertex = 0, uint32_t firstInstance = 0) const; - void DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - void DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const; - void EndOcclusionQuery() const; - void EndPass() const; - void ExecuteBundles(uint32_t bundlesCount, RenderBundle const * bundles) const; - void InsertDebugMarker(char const * markerLabel) const; - void PopDebugGroup() const; - void PushDebugGroup(char const * groupLabel) const; - void SetBindGroup(uint32_t groupIndex, BindGroup const& group, uint32_t dynamicOffsetCount = 0, uint32_t const * dynamicOffsets = nullptr) const; - void SetBlendColor(Color const * color) const; - void SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = 0) const; - void SetIndexBufferWithFormat(Buffer const& buffer, IndexFormat format, uint64_t offset = 0, uint64_t size = 0) const; - void SetPipeline(RenderPipeline const& pipeline) const; - void SetScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const; - void SetStencilReference(uint32_t reference) const; - void SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset = 0, uint64_t size = 0) const; - void SetViewport(float x, float y, float width, float height, float minDepth, float maxDepth) const; - void WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPURenderPassEncoder handle); - static void WGPURelease(WGPURenderPassEncoder handle); - }; - - class RenderPipeline : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - BindGroupLayout GetBindGroupLayout(uint32_t groupIndex) const; - - private: - friend ObjectBase; - static void WGPUReference(WGPURenderPipeline handle); - static void WGPURelease(WGPURenderPipeline handle); - }; - - class Sampler : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - - private: - friend ObjectBase; - static void WGPUReference(WGPUSampler handle); - static void WGPURelease(WGPUSampler handle); - }; - - class ShaderModule : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - - private: - friend ObjectBase; - static void WGPUReference(WGPUShaderModule handle); - static void WGPURelease(WGPUShaderModule handle); - }; - - class Surface : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - - private: - friend ObjectBase; - static void WGPUReference(WGPUSurface handle); - static void WGPURelease(WGPUSurface handle); - }; - - class SwapChain : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - void Configure(TextureFormat format, TextureUsage allowedUsage, uint32_t width, uint32_t height) const; - TextureView GetCurrentTextureView() const; - void Present() const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUSwapChain handle); - static void WGPURelease(WGPUSwapChain handle); - }; - - class Texture : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - TextureView CreateView(TextureViewDescriptor const * descriptor = nullptr) const; - void Destroy() const; - - private: - friend ObjectBase; - static void WGPUReference(WGPUTexture handle); - static void WGPURelease(WGPUTexture handle); - }; - - class TextureView : public ObjectBase { - public: - using ObjectBase::ObjectBase; - using ObjectBase::operator=; - - - private: - friend ObjectBase; - static void WGPUReference(WGPUTextureView handle); - static void WGPURelease(WGPUTextureView handle); - }; - - - Instance CreateInstance(InstanceDescriptor const * descriptor = nullptr); - Proc GetProcAddress(Device const& device, const char* procName); - - struct ChainedStruct { - ChainedStruct const * nextInChain = nullptr; - SType sType = SType::Invalid; - }; - - struct AdapterProperties { - ChainedStruct const * nextInChain = nullptr; - uint32_t deviceID; - uint32_t vendorID; - char const * name; - char const * driverDescription; - AdapterType adapterType; - BackendType backendType; - }; - - struct BindGroupEntry { - uint32_t binding; - Buffer buffer = nullptr; - uint64_t offset = 0; - uint64_t size; - Sampler sampler = nullptr; - TextureView textureView = nullptr; - }; - - struct BlendDescriptor { - BlendOperation operation = BlendOperation::Add; - BlendFactor srcFactor = BlendFactor::One; - BlendFactor dstFactor = BlendFactor::Zero; - }; - - struct BufferBindingLayout { - ChainedStruct const * nextInChain = nullptr; - BufferBindingType type = BufferBindingType::Undefined; - bool hasDynamicOffset = false; - uint64_t minBindingSize = 0; - }; - - struct BufferDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - BufferUsage usage; - uint64_t size; - bool mappedAtCreation = false; - }; - - struct Color { - double r; - double g; - double b; - double a; - }; - - struct CommandBufferDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct CommandEncoderDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct ComputePassDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct CopyTextureForBrowserOptions { - ChainedStruct const * nextInChain = nullptr; - bool flipY = false; - }; - - struct DeviceProperties { - bool textureCompressionBC = false; - bool shaderFloat16 = false; - bool pipelineStatisticsQuery = false; - bool timestampQuery = false; - }; - - struct Extent3D { - uint32_t width = 1; - uint32_t height = 1; - uint32_t depth = 1; - }; - - struct FenceDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - uint64_t initialValue = 0; - }; - - struct InstanceDescriptor { - ChainedStruct const * nextInChain = nullptr; - }; - - struct Origin3D { - uint32_t x = 0; - uint32_t y = 0; - uint32_t z = 0; - }; - - struct PipelineLayoutDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - uint32_t bindGroupLayoutCount; - BindGroupLayout const * bindGroupLayouts; - }; - - struct ProgrammableStageDescriptor { - ChainedStruct const * nextInChain = nullptr; - ShaderModule module; - char const * entryPoint; - }; - - struct QuerySetDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - QueryType type; - uint32_t count; - PipelineStatisticName const * pipelineStatistics; - uint32_t pipelineStatisticsCount = 0; - }; - - struct RasterizationStateDescriptor { - ChainedStruct const * nextInChain = nullptr; - FrontFace frontFace = FrontFace::CCW; - CullMode cullMode = CullMode::None; - int32_t depthBias = 0; - float depthBiasSlopeScale = 0.0f; - float depthBiasClamp = 0.0f; - }; - - struct RenderBundleDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct RenderBundleEncoderDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - uint32_t colorFormatsCount; - TextureFormat const * colorFormats; - TextureFormat depthStencilFormat = TextureFormat::Undefined; - uint32_t sampleCount = 1; - }; - - struct RenderPassDepthStencilAttachmentDescriptor { - TextureView attachment; - LoadOp depthLoadOp; - StoreOp depthStoreOp; - float clearDepth; - bool depthReadOnly = false; - LoadOp stencilLoadOp; - StoreOp stencilStoreOp; - uint32_t clearStencil = 0; - bool stencilReadOnly = false; - }; - - struct SamplerBindingLayout { - ChainedStruct const * nextInChain = nullptr; - SamplerBindingType type = SamplerBindingType::Undefined; - }; - - struct SamplerDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - AddressMode addressModeU = AddressMode::ClampToEdge; - AddressMode addressModeV = AddressMode::ClampToEdge; - AddressMode addressModeW = AddressMode::ClampToEdge; - FilterMode magFilter = FilterMode::Nearest; - FilterMode minFilter = FilterMode::Nearest; - FilterMode mipmapFilter = FilterMode::Nearest; - float lodMinClamp = 0.0f; - float lodMaxClamp = 1000.0f; - CompareFunction compare = CompareFunction::Undefined; - uint16_t maxAnisotropy = 1; - }; - - struct SamplerDescriptorDummyAnisotropicFiltering : ChainedStruct { - SamplerDescriptorDummyAnisotropicFiltering() { - sType = SType::SamplerDescriptorDummyAnisotropicFiltering; - } - alignas(ChainedStruct) float maxAnisotropy; - }; - - struct ShaderModuleDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct ShaderModuleSPIRVDescriptor : ChainedStruct { - ShaderModuleSPIRVDescriptor() { - sType = SType::ShaderModuleSPIRVDescriptor; - } - alignas(ChainedStruct) uint32_t codeSize; - uint32_t const * code; - }; - - struct ShaderModuleWGSLDescriptor : ChainedStruct { - ShaderModuleWGSLDescriptor() { - sType = SType::ShaderModuleWGSLDescriptor; - } - alignas(ChainedStruct) char const * source; - }; - - struct StencilStateFaceDescriptor { - CompareFunction compare = CompareFunction::Always; - StencilOperation failOp = StencilOperation::Keep; - StencilOperation depthFailOp = StencilOperation::Keep; - StencilOperation passOp = StencilOperation::Keep; - }; - - struct StorageTextureBindingLayout { - ChainedStruct const * nextInChain = nullptr; - StorageTextureAccess access = StorageTextureAccess::Undefined; - TextureFormat format = TextureFormat::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::Undefined; - }; - - struct SurfaceDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - }; - - struct SurfaceDescriptorFromCanvasHTMLSelector : ChainedStruct { - SurfaceDescriptorFromCanvasHTMLSelector() { - sType = SType::SurfaceDescriptorFromCanvasHTMLSelector; - } - alignas(ChainedStruct) char const * selector; - }; - - struct SurfaceDescriptorFromMetalLayer : ChainedStruct { - SurfaceDescriptorFromMetalLayer() { - sType = SType::SurfaceDescriptorFromMetalLayer; - } - alignas(ChainedStruct) void * layer; - }; - - struct SurfaceDescriptorFromWindowsHWND : ChainedStruct { - SurfaceDescriptorFromWindowsHWND() { - sType = SType::SurfaceDescriptorFromWindowsHWND; - } - alignas(ChainedStruct) void * hinstance; - void * hwnd; - }; - - struct SurfaceDescriptorFromXlib : ChainedStruct { - SurfaceDescriptorFromXlib() { - sType = SType::SurfaceDescriptorFromXlib; - } - alignas(ChainedStruct) void * display; - uint32_t window; - }; - - struct SwapChainDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - TextureUsage usage; - TextureFormat format; - uint32_t width; - uint32_t height; - PresentMode presentMode; - uint64_t implementation = 0; - }; - - struct TextureBindingLayout { - ChainedStruct const * nextInChain = nullptr; - TextureSampleType sampleType = TextureSampleType::Undefined; - TextureViewDimension viewDimension = TextureViewDimension::Undefined; - bool multisampled = false; - }; - - struct TextureDataLayout { - ChainedStruct const * nextInChain = nullptr; - uint64_t offset = 0; - uint32_t bytesPerRow = WGPU_COPY_STRIDE_UNDEFINED; - uint32_t rowsPerImage = WGPU_COPY_STRIDE_UNDEFINED; - }; - - struct TextureViewDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - TextureFormat format = TextureFormat::Undefined; - TextureViewDimension dimension = TextureViewDimension::Undefined; - uint32_t baseMipLevel = 0; - uint32_t mipLevelCount = 0; - uint32_t baseArrayLayer = 0; - uint32_t arrayLayerCount = 0; - TextureAspect aspect = TextureAspect::All; - }; - - struct VertexAttributeDescriptor { - VertexFormat format; - uint64_t offset; - uint32_t shaderLocation; - }; - - struct BindGroupDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - BindGroupLayout layout; - uint32_t entryCount; - BindGroupEntry const * entries; - }; - - struct BindGroupLayoutEntry { - uint32_t binding; - ShaderStage visibility; - BindingType type = BindingType::Undefined; - bool hasDynamicOffset = false; - uint64_t minBufferBindingSize = 0; - TextureViewDimension viewDimension = TextureViewDimension::Undefined; - TextureComponentType textureComponentType = TextureComponentType::Float; - TextureFormat storageTextureFormat = TextureFormat::Undefined; - BufferBindingLayout buffer; - SamplerBindingLayout sampler; - TextureBindingLayout texture; - StorageTextureBindingLayout storageTexture; - }; - - struct BufferCopyView { - ChainedStruct const * nextInChain = nullptr; - TextureDataLayout layout; - Buffer buffer; - }; - - struct ColorStateDescriptor { - ChainedStruct const * nextInChain = nullptr; - TextureFormat format; - BlendDescriptor alphaBlend; - BlendDescriptor colorBlend; - ColorWriteMask writeMask = ColorWriteMask::All; - }; - - struct ComputePipelineDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - PipelineLayout layout = nullptr; - ProgrammableStageDescriptor computeStage; - }; - - struct DepthStencilStateDescriptor { - ChainedStruct const * nextInChain = nullptr; - TextureFormat format; - bool depthWriteEnabled = false; - CompareFunction depthCompare = CompareFunction::Always; - StencilStateFaceDescriptor stencilFront; - StencilStateFaceDescriptor stencilBack; - uint32_t stencilReadMask = 0xFFFFFFFF; - uint32_t stencilWriteMask = 0xFFFFFFFF; - }; - - struct RenderPassColorAttachmentDescriptor { - TextureView attachment; - TextureView resolveTarget = nullptr; - LoadOp loadOp; - StoreOp storeOp; - Color clearColor; - }; - - struct RenderPipelineDescriptorDummyExtension : ChainedStruct { - RenderPipelineDescriptorDummyExtension() { - sType = SType::RenderPipelineDescriptorDummyExtension; - } - alignas(ChainedStruct) ProgrammableStageDescriptor dummyStage; - }; - - struct TextureCopyView { - ChainedStruct const * nextInChain = nullptr; - Texture texture; - uint32_t mipLevel = 0; - Origin3D origin; - TextureAspect aspect = TextureAspect::All; - }; - - struct TextureDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - TextureUsage usage; - TextureDimension dimension = TextureDimension::e2D; - Extent3D size; - TextureFormat format; - uint32_t mipLevelCount = 1; - uint32_t sampleCount = 1; - }; - - struct VertexBufferLayoutDescriptor { - uint64_t arrayStride; - InputStepMode stepMode = InputStepMode::Vertex; - uint32_t attributeCount; - VertexAttributeDescriptor const * attributes; - }; - - struct BindGroupLayoutDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - uint32_t entryCount; - BindGroupLayoutEntry const * entries; - }; - - struct RenderPassDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - uint32_t colorAttachmentCount; - RenderPassColorAttachmentDescriptor const * colorAttachments; - RenderPassDepthStencilAttachmentDescriptor const * depthStencilAttachment = nullptr; - QuerySet occlusionQuerySet = nullptr; - }; - - struct VertexStateDescriptor { - ChainedStruct const * nextInChain = nullptr; - IndexFormat indexFormat = IndexFormat::Undefined; - uint32_t vertexBufferCount = 0; - VertexBufferLayoutDescriptor const * vertexBuffers; - }; - - struct RenderPipelineDescriptor { - ChainedStruct const * nextInChain = nullptr; - char const * label = nullptr; - PipelineLayout layout = nullptr; - ProgrammableStageDescriptor vertexStage; - ProgrammableStageDescriptor const * fragmentStage = nullptr; - VertexStateDescriptor const * vertexState = nullptr; - PrimitiveTopology primitiveTopology; - RasterizationStateDescriptor const * rasterizationState = nullptr; - uint32_t sampleCount = 1; - DepthStencilStateDescriptor const * depthStencilState = nullptr; - uint32_t colorStateCount; - ColorStateDescriptor const * colorStates; - uint32_t sampleMask = 0xFFFFFFFF; - bool alphaToCoverageEnabled = false; - }; - - -} // namespace wgpu - -#endif // WEBGPU_CPP_H_ diff --git a/bgfx/3rdparty/webgpu/webgpu_cpp.cpp b/bgfx/3rdparty/webgpu/webgpu_cpp.cpp deleted file mode 100644 index ad9c22a2..00000000 --- a/bgfx/3rdparty/webgpu/webgpu_cpp.cpp +++ /dev/null @@ -1,2053 +0,0 @@ - -#include "webgpu/webgpu_cpp.h" - -namespace wgpu { - - // AdapterType - - static_assert(sizeof(AdapterType) == sizeof(WGPUAdapterType), "sizeof mismatch for AdapterType"); - static_assert(alignof(AdapterType) == alignof(WGPUAdapterType), "alignof mismatch for AdapterType"); - - static_assert(static_cast(AdapterType::DiscreteGPU) == WGPUAdapterType_DiscreteGPU, "value mismatch for AdapterType::DiscreteGPU"); - static_assert(static_cast(AdapterType::IntegratedGPU) == WGPUAdapterType_IntegratedGPU, "value mismatch for AdapterType::IntegratedGPU"); - static_assert(static_cast(AdapterType::CPU) == WGPUAdapterType_CPU, "value mismatch for AdapterType::CPU"); - static_assert(static_cast(AdapterType::Unknown) == WGPUAdapterType_Unknown, "value mismatch for AdapterType::Unknown"); - - // AddressMode - - static_assert(sizeof(AddressMode) == sizeof(WGPUAddressMode), "sizeof mismatch for AddressMode"); - static_assert(alignof(AddressMode) == alignof(WGPUAddressMode), "alignof mismatch for AddressMode"); - - static_assert(static_cast(AddressMode::Repeat) == WGPUAddressMode_Repeat, "value mismatch for AddressMode::Repeat"); - static_assert(static_cast(AddressMode::MirrorRepeat) == WGPUAddressMode_MirrorRepeat, "value mismatch for AddressMode::MirrorRepeat"); - static_assert(static_cast(AddressMode::ClampToEdge) == WGPUAddressMode_ClampToEdge, "value mismatch for AddressMode::ClampToEdge"); - - // BackendType - - static_assert(sizeof(BackendType) == sizeof(WGPUBackendType), "sizeof mismatch for BackendType"); - static_assert(alignof(BackendType) == alignof(WGPUBackendType), "alignof mismatch for BackendType"); - - static_assert(static_cast(BackendType::Null) == WGPUBackendType_Null, "value mismatch for BackendType::Null"); - static_assert(static_cast(BackendType::D3D11) == WGPUBackendType_D3D11, "value mismatch for BackendType::D3D11"); - static_assert(static_cast(BackendType::D3D12) == WGPUBackendType_D3D12, "value mismatch for BackendType::D3D12"); - static_assert(static_cast(BackendType::Metal) == WGPUBackendType_Metal, "value mismatch for BackendType::Metal"); - static_assert(static_cast(BackendType::Vulkan) == WGPUBackendType_Vulkan, "value mismatch for BackendType::Vulkan"); - static_assert(static_cast(BackendType::OpenGL) == WGPUBackendType_OpenGL, "value mismatch for BackendType::OpenGL"); - static_assert(static_cast(BackendType::OpenGLES) == WGPUBackendType_OpenGLES, "value mismatch for BackendType::OpenGLES"); - - // BindingType - - static_assert(sizeof(BindingType) == sizeof(WGPUBindingType), "sizeof mismatch for BindingType"); - static_assert(alignof(BindingType) == alignof(WGPUBindingType), "alignof mismatch for BindingType"); - - static_assert(static_cast(BindingType::Undefined) == WGPUBindingType_Undefined, "value mismatch for BindingType::Undefined"); - static_assert(static_cast(BindingType::UniformBuffer) == WGPUBindingType_UniformBuffer, "value mismatch for BindingType::UniformBuffer"); - static_assert(static_cast(BindingType::StorageBuffer) == WGPUBindingType_StorageBuffer, "value mismatch for BindingType::StorageBuffer"); - static_assert(static_cast(BindingType::ReadonlyStorageBuffer) == WGPUBindingType_ReadonlyStorageBuffer, "value mismatch for BindingType::ReadonlyStorageBuffer"); - static_assert(static_cast(BindingType::Sampler) == WGPUBindingType_Sampler, "value mismatch for BindingType::Sampler"); - static_assert(static_cast(BindingType::ComparisonSampler) == WGPUBindingType_ComparisonSampler, "value mismatch for BindingType::ComparisonSampler"); - static_assert(static_cast(BindingType::SampledTexture) == WGPUBindingType_SampledTexture, "value mismatch for BindingType::SampledTexture"); - static_assert(static_cast(BindingType::MultisampledTexture) == WGPUBindingType_MultisampledTexture, "value mismatch for BindingType::MultisampledTexture"); - static_assert(static_cast(BindingType::ReadonlyStorageTexture) == WGPUBindingType_ReadonlyStorageTexture, "value mismatch for BindingType::ReadonlyStorageTexture"); - static_assert(static_cast(BindingType::WriteonlyStorageTexture) == WGPUBindingType_WriteonlyStorageTexture, "value mismatch for BindingType::WriteonlyStorageTexture"); - - // BlendFactor - - static_assert(sizeof(BlendFactor) == sizeof(WGPUBlendFactor), "sizeof mismatch for BlendFactor"); - static_assert(alignof(BlendFactor) == alignof(WGPUBlendFactor), "alignof mismatch for BlendFactor"); - - static_assert(static_cast(BlendFactor::Zero) == WGPUBlendFactor_Zero, "value mismatch for BlendFactor::Zero"); - static_assert(static_cast(BlendFactor::One) == WGPUBlendFactor_One, "value mismatch for BlendFactor::One"); - static_assert(static_cast(BlendFactor::SrcColor) == WGPUBlendFactor_SrcColor, "value mismatch for BlendFactor::SrcColor"); - static_assert(static_cast(BlendFactor::OneMinusSrcColor) == WGPUBlendFactor_OneMinusSrcColor, "value mismatch for BlendFactor::OneMinusSrcColor"); - static_assert(static_cast(BlendFactor::SrcAlpha) == WGPUBlendFactor_SrcAlpha, "value mismatch for BlendFactor::SrcAlpha"); - static_assert(static_cast(BlendFactor::OneMinusSrcAlpha) == WGPUBlendFactor_OneMinusSrcAlpha, "value mismatch for BlendFactor::OneMinusSrcAlpha"); - static_assert(static_cast(BlendFactor::DstColor) == WGPUBlendFactor_DstColor, "value mismatch for BlendFactor::DstColor"); - static_assert(static_cast(BlendFactor::OneMinusDstColor) == WGPUBlendFactor_OneMinusDstColor, "value mismatch for BlendFactor::OneMinusDstColor"); - static_assert(static_cast(BlendFactor::DstAlpha) == WGPUBlendFactor_DstAlpha, "value mismatch for BlendFactor::DstAlpha"); - static_assert(static_cast(BlendFactor::OneMinusDstAlpha) == WGPUBlendFactor_OneMinusDstAlpha, "value mismatch for BlendFactor::OneMinusDstAlpha"); - static_assert(static_cast(BlendFactor::SrcAlphaSaturated) == WGPUBlendFactor_SrcAlphaSaturated, "value mismatch for BlendFactor::SrcAlphaSaturated"); - static_assert(static_cast(BlendFactor::BlendColor) == WGPUBlendFactor_BlendColor, "value mismatch for BlendFactor::BlendColor"); - static_assert(static_cast(BlendFactor::OneMinusBlendColor) == WGPUBlendFactor_OneMinusBlendColor, "value mismatch for BlendFactor::OneMinusBlendColor"); - - // BlendOperation - - static_assert(sizeof(BlendOperation) == sizeof(WGPUBlendOperation), "sizeof mismatch for BlendOperation"); - static_assert(alignof(BlendOperation) == alignof(WGPUBlendOperation), "alignof mismatch for BlendOperation"); - - static_assert(static_cast(BlendOperation::Add) == WGPUBlendOperation_Add, "value mismatch for BlendOperation::Add"); - static_assert(static_cast(BlendOperation::Subtract) == WGPUBlendOperation_Subtract, "value mismatch for BlendOperation::Subtract"); - static_assert(static_cast(BlendOperation::ReverseSubtract) == WGPUBlendOperation_ReverseSubtract, "value mismatch for BlendOperation::ReverseSubtract"); - static_assert(static_cast(BlendOperation::Min) == WGPUBlendOperation_Min, "value mismatch for BlendOperation::Min"); - static_assert(static_cast(BlendOperation::Max) == WGPUBlendOperation_Max, "value mismatch for BlendOperation::Max"); - - // BufferBindingType - - static_assert(sizeof(BufferBindingType) == sizeof(WGPUBufferBindingType), "sizeof mismatch for BufferBindingType"); - static_assert(alignof(BufferBindingType) == alignof(WGPUBufferBindingType), "alignof mismatch for BufferBindingType"); - - static_assert(static_cast(BufferBindingType::Undefined) == WGPUBufferBindingType_Undefined, "value mismatch for BufferBindingType::Undefined"); - static_assert(static_cast(BufferBindingType::Uniform) == WGPUBufferBindingType_Uniform, "value mismatch for BufferBindingType::Uniform"); - static_assert(static_cast(BufferBindingType::Storage) == WGPUBufferBindingType_Storage, "value mismatch for BufferBindingType::Storage"); - static_assert(static_cast(BufferBindingType::ReadOnlyStorage) == WGPUBufferBindingType_ReadOnlyStorage, "value mismatch for BufferBindingType::ReadOnlyStorage"); - - // BufferMapAsyncStatus - - static_assert(sizeof(BufferMapAsyncStatus) == sizeof(WGPUBufferMapAsyncStatus), "sizeof mismatch for BufferMapAsyncStatus"); - static_assert(alignof(BufferMapAsyncStatus) == alignof(WGPUBufferMapAsyncStatus), "alignof mismatch for BufferMapAsyncStatus"); - - static_assert(static_cast(BufferMapAsyncStatus::Success) == WGPUBufferMapAsyncStatus_Success, "value mismatch for BufferMapAsyncStatus::Success"); - static_assert(static_cast(BufferMapAsyncStatus::Error) == WGPUBufferMapAsyncStatus_Error, "value mismatch for BufferMapAsyncStatus::Error"); - static_assert(static_cast(BufferMapAsyncStatus::Unknown) == WGPUBufferMapAsyncStatus_Unknown, "value mismatch for BufferMapAsyncStatus::Unknown"); - static_assert(static_cast(BufferMapAsyncStatus::DeviceLost) == WGPUBufferMapAsyncStatus_DeviceLost, "value mismatch for BufferMapAsyncStatus::DeviceLost"); - static_assert(static_cast(BufferMapAsyncStatus::DestroyedBeforeCallback) == WGPUBufferMapAsyncStatus_DestroyedBeforeCallback, "value mismatch for BufferMapAsyncStatus::DestroyedBeforeCallback"); - static_assert(static_cast(BufferMapAsyncStatus::UnmappedBeforeCallback) == WGPUBufferMapAsyncStatus_UnmappedBeforeCallback, "value mismatch for BufferMapAsyncStatus::UnmappedBeforeCallback"); - - // CompareFunction - - static_assert(sizeof(CompareFunction) == sizeof(WGPUCompareFunction), "sizeof mismatch for CompareFunction"); - static_assert(alignof(CompareFunction) == alignof(WGPUCompareFunction), "alignof mismatch for CompareFunction"); - - static_assert(static_cast(CompareFunction::Undefined) == WGPUCompareFunction_Undefined, "value mismatch for CompareFunction::Undefined"); - static_assert(static_cast(CompareFunction::Never) == WGPUCompareFunction_Never, "value mismatch for CompareFunction::Never"); - static_assert(static_cast(CompareFunction::Less) == WGPUCompareFunction_Less, "value mismatch for CompareFunction::Less"); - static_assert(static_cast(CompareFunction::LessEqual) == WGPUCompareFunction_LessEqual, "value mismatch for CompareFunction::LessEqual"); - static_assert(static_cast(CompareFunction::Greater) == WGPUCompareFunction_Greater, "value mismatch for CompareFunction::Greater"); - static_assert(static_cast(CompareFunction::GreaterEqual) == WGPUCompareFunction_GreaterEqual, "value mismatch for CompareFunction::GreaterEqual"); - static_assert(static_cast(CompareFunction::Equal) == WGPUCompareFunction_Equal, "value mismatch for CompareFunction::Equal"); - static_assert(static_cast(CompareFunction::NotEqual) == WGPUCompareFunction_NotEqual, "value mismatch for CompareFunction::NotEqual"); - static_assert(static_cast(CompareFunction::Always) == WGPUCompareFunction_Always, "value mismatch for CompareFunction::Always"); - - // CreateReadyPipelineStatus - - static_assert(sizeof(CreateReadyPipelineStatus) == sizeof(WGPUCreateReadyPipelineStatus), "sizeof mismatch for CreateReadyPipelineStatus"); - static_assert(alignof(CreateReadyPipelineStatus) == alignof(WGPUCreateReadyPipelineStatus), "alignof mismatch for CreateReadyPipelineStatus"); - - static_assert(static_cast(CreateReadyPipelineStatus::Success) == WGPUCreateReadyPipelineStatus_Success, "value mismatch for CreateReadyPipelineStatus::Success"); - static_assert(static_cast(CreateReadyPipelineStatus::Error) == WGPUCreateReadyPipelineStatus_Error, "value mismatch for CreateReadyPipelineStatus::Error"); - static_assert(static_cast(CreateReadyPipelineStatus::DeviceLost) == WGPUCreateReadyPipelineStatus_DeviceLost, "value mismatch for CreateReadyPipelineStatus::DeviceLost"); - static_assert(static_cast(CreateReadyPipelineStatus::DeviceDestroyed) == WGPUCreateReadyPipelineStatus_DeviceDestroyed, "value mismatch for CreateReadyPipelineStatus::DeviceDestroyed"); - static_assert(static_cast(CreateReadyPipelineStatus::Unknown) == WGPUCreateReadyPipelineStatus_Unknown, "value mismatch for CreateReadyPipelineStatus::Unknown"); - - // CullMode - - static_assert(sizeof(CullMode) == sizeof(WGPUCullMode), "sizeof mismatch for CullMode"); - static_assert(alignof(CullMode) == alignof(WGPUCullMode), "alignof mismatch for CullMode"); - - static_assert(static_cast(CullMode::None) == WGPUCullMode_None, "value mismatch for CullMode::None"); - static_assert(static_cast(CullMode::Front) == WGPUCullMode_Front, "value mismatch for CullMode::Front"); - static_assert(static_cast(CullMode::Back) == WGPUCullMode_Back, "value mismatch for CullMode::Back"); - - // ErrorFilter - - static_assert(sizeof(ErrorFilter) == sizeof(WGPUErrorFilter), "sizeof mismatch for ErrorFilter"); - static_assert(alignof(ErrorFilter) == alignof(WGPUErrorFilter), "alignof mismatch for ErrorFilter"); - - static_assert(static_cast(ErrorFilter::None) == WGPUErrorFilter_None, "value mismatch for ErrorFilter::None"); - static_assert(static_cast(ErrorFilter::Validation) == WGPUErrorFilter_Validation, "value mismatch for ErrorFilter::Validation"); - static_assert(static_cast(ErrorFilter::OutOfMemory) == WGPUErrorFilter_OutOfMemory, "value mismatch for ErrorFilter::OutOfMemory"); - - // ErrorType - - static_assert(sizeof(ErrorType) == sizeof(WGPUErrorType), "sizeof mismatch for ErrorType"); - static_assert(alignof(ErrorType) == alignof(WGPUErrorType), "alignof mismatch for ErrorType"); - - static_assert(static_cast(ErrorType::NoError) == WGPUErrorType_NoError, "value mismatch for ErrorType::NoError"); - static_assert(static_cast(ErrorType::Validation) == WGPUErrorType_Validation, "value mismatch for ErrorType::Validation"); - static_assert(static_cast(ErrorType::OutOfMemory) == WGPUErrorType_OutOfMemory, "value mismatch for ErrorType::OutOfMemory"); - static_assert(static_cast(ErrorType::Unknown) == WGPUErrorType_Unknown, "value mismatch for ErrorType::Unknown"); - static_assert(static_cast(ErrorType::DeviceLost) == WGPUErrorType_DeviceLost, "value mismatch for ErrorType::DeviceLost"); - - // FenceCompletionStatus - - static_assert(sizeof(FenceCompletionStatus) == sizeof(WGPUFenceCompletionStatus), "sizeof mismatch for FenceCompletionStatus"); - static_assert(alignof(FenceCompletionStatus) == alignof(WGPUFenceCompletionStatus), "alignof mismatch for FenceCompletionStatus"); - - static_assert(static_cast(FenceCompletionStatus::Success) == WGPUFenceCompletionStatus_Success, "value mismatch for FenceCompletionStatus::Success"); - static_assert(static_cast(FenceCompletionStatus::Error) == WGPUFenceCompletionStatus_Error, "value mismatch for FenceCompletionStatus::Error"); - static_assert(static_cast(FenceCompletionStatus::Unknown) == WGPUFenceCompletionStatus_Unknown, "value mismatch for FenceCompletionStatus::Unknown"); - static_assert(static_cast(FenceCompletionStatus::DeviceLost) == WGPUFenceCompletionStatus_DeviceLost, "value mismatch for FenceCompletionStatus::DeviceLost"); - - // FilterMode - - static_assert(sizeof(FilterMode) == sizeof(WGPUFilterMode), "sizeof mismatch for FilterMode"); - static_assert(alignof(FilterMode) == alignof(WGPUFilterMode), "alignof mismatch for FilterMode"); - - static_assert(static_cast(FilterMode::Nearest) == WGPUFilterMode_Nearest, "value mismatch for FilterMode::Nearest"); - static_assert(static_cast(FilterMode::Linear) == WGPUFilterMode_Linear, "value mismatch for FilterMode::Linear"); - - // FrontFace - - static_assert(sizeof(FrontFace) == sizeof(WGPUFrontFace), "sizeof mismatch for FrontFace"); - static_assert(alignof(FrontFace) == alignof(WGPUFrontFace), "alignof mismatch for FrontFace"); - - static_assert(static_cast(FrontFace::CCW) == WGPUFrontFace_CCW, "value mismatch for FrontFace::CCW"); - static_assert(static_cast(FrontFace::CW) == WGPUFrontFace_CW, "value mismatch for FrontFace::CW"); - - // IndexFormat - - static_assert(sizeof(IndexFormat) == sizeof(WGPUIndexFormat), "sizeof mismatch for IndexFormat"); - static_assert(alignof(IndexFormat) == alignof(WGPUIndexFormat), "alignof mismatch for IndexFormat"); - - static_assert(static_cast(IndexFormat::Undefined) == WGPUIndexFormat_Undefined, "value mismatch for IndexFormat::Undefined"); - static_assert(static_cast(IndexFormat::Uint16) == WGPUIndexFormat_Uint16, "value mismatch for IndexFormat::Uint16"); - static_assert(static_cast(IndexFormat::Uint32) == WGPUIndexFormat_Uint32, "value mismatch for IndexFormat::Uint32"); - - // InputStepMode - - static_assert(sizeof(InputStepMode) == sizeof(WGPUInputStepMode), "sizeof mismatch for InputStepMode"); - static_assert(alignof(InputStepMode) == alignof(WGPUInputStepMode), "alignof mismatch for InputStepMode"); - - static_assert(static_cast(InputStepMode::Vertex) == WGPUInputStepMode_Vertex, "value mismatch for InputStepMode::Vertex"); - static_assert(static_cast(InputStepMode::Instance) == WGPUInputStepMode_Instance, "value mismatch for InputStepMode::Instance"); - - // LoadOp - - static_assert(sizeof(LoadOp) == sizeof(WGPULoadOp), "sizeof mismatch for LoadOp"); - static_assert(alignof(LoadOp) == alignof(WGPULoadOp), "alignof mismatch for LoadOp"); - - static_assert(static_cast(LoadOp::Clear) == WGPULoadOp_Clear, "value mismatch for LoadOp::Clear"); - static_assert(static_cast(LoadOp::Load) == WGPULoadOp_Load, "value mismatch for LoadOp::Load"); - - // PipelineStatisticName - - static_assert(sizeof(PipelineStatisticName) == sizeof(WGPUPipelineStatisticName), "sizeof mismatch for PipelineStatisticName"); - static_assert(alignof(PipelineStatisticName) == alignof(WGPUPipelineStatisticName), "alignof mismatch for PipelineStatisticName"); - - static_assert(static_cast(PipelineStatisticName::VertexShaderInvocations) == WGPUPipelineStatisticName_VertexShaderInvocations, "value mismatch for PipelineStatisticName::VertexShaderInvocations"); - static_assert(static_cast(PipelineStatisticName::ClipperInvocations) == WGPUPipelineStatisticName_ClipperInvocations, "value mismatch for PipelineStatisticName::ClipperInvocations"); - static_assert(static_cast(PipelineStatisticName::ClipperPrimitivesOut) == WGPUPipelineStatisticName_ClipperPrimitivesOut, "value mismatch for PipelineStatisticName::ClipperPrimitivesOut"); - static_assert(static_cast(PipelineStatisticName::FragmentShaderInvocations) == WGPUPipelineStatisticName_FragmentShaderInvocations, "value mismatch for PipelineStatisticName::FragmentShaderInvocations"); - static_assert(static_cast(PipelineStatisticName::ComputeShaderInvocations) == WGPUPipelineStatisticName_ComputeShaderInvocations, "value mismatch for PipelineStatisticName::ComputeShaderInvocations"); - - // PresentMode - - static_assert(sizeof(PresentMode) == sizeof(WGPUPresentMode), "sizeof mismatch for PresentMode"); - static_assert(alignof(PresentMode) == alignof(WGPUPresentMode), "alignof mismatch for PresentMode"); - - static_assert(static_cast(PresentMode::Immediate) == WGPUPresentMode_Immediate, "value mismatch for PresentMode::Immediate"); - static_assert(static_cast(PresentMode::Mailbox) == WGPUPresentMode_Mailbox, "value mismatch for PresentMode::Mailbox"); - static_assert(static_cast(PresentMode::Fifo) == WGPUPresentMode_Fifo, "value mismatch for PresentMode::Fifo"); - - // PrimitiveTopology - - static_assert(sizeof(PrimitiveTopology) == sizeof(WGPUPrimitiveTopology), "sizeof mismatch for PrimitiveTopology"); - static_assert(alignof(PrimitiveTopology) == alignof(WGPUPrimitiveTopology), "alignof mismatch for PrimitiveTopology"); - - static_assert(static_cast(PrimitiveTopology::PointList) == WGPUPrimitiveTopology_PointList, "value mismatch for PrimitiveTopology::PointList"); - static_assert(static_cast(PrimitiveTopology::LineList) == WGPUPrimitiveTopology_LineList, "value mismatch for PrimitiveTopology::LineList"); - static_assert(static_cast(PrimitiveTopology::LineStrip) == WGPUPrimitiveTopology_LineStrip, "value mismatch for PrimitiveTopology::LineStrip"); - static_assert(static_cast(PrimitiveTopology::TriangleList) == WGPUPrimitiveTopology_TriangleList, "value mismatch for PrimitiveTopology::TriangleList"); - static_assert(static_cast(PrimitiveTopology::TriangleStrip) == WGPUPrimitiveTopology_TriangleStrip, "value mismatch for PrimitiveTopology::TriangleStrip"); - - // QueryType - - static_assert(sizeof(QueryType) == sizeof(WGPUQueryType), "sizeof mismatch for QueryType"); - static_assert(alignof(QueryType) == alignof(WGPUQueryType), "alignof mismatch for QueryType"); - - static_assert(static_cast(QueryType::Occlusion) == WGPUQueryType_Occlusion, "value mismatch for QueryType::Occlusion"); - static_assert(static_cast(QueryType::PipelineStatistics) == WGPUQueryType_PipelineStatistics, "value mismatch for QueryType::PipelineStatistics"); - static_assert(static_cast(QueryType::Timestamp) == WGPUQueryType_Timestamp, "value mismatch for QueryType::Timestamp"); - - // SType - - static_assert(sizeof(SType) == sizeof(WGPUSType), "sizeof mismatch for SType"); - static_assert(alignof(SType) == alignof(WGPUSType), "alignof mismatch for SType"); - - static_assert(static_cast(SType::Invalid) == WGPUSType_Invalid, "value mismatch for SType::Invalid"); - static_assert(static_cast(SType::SurfaceDescriptorFromMetalLayer) == WGPUSType_SurfaceDescriptorFromMetalLayer, "value mismatch for SType::SurfaceDescriptorFromMetalLayer"); - static_assert(static_cast(SType::SurfaceDescriptorFromWindowsHWND) == WGPUSType_SurfaceDescriptorFromWindowsHWND, "value mismatch for SType::SurfaceDescriptorFromWindowsHWND"); - static_assert(static_cast(SType::SurfaceDescriptorFromXlib) == WGPUSType_SurfaceDescriptorFromXlib, "value mismatch for SType::SurfaceDescriptorFromXlib"); - static_assert(static_cast(SType::SurfaceDescriptorFromCanvasHTMLSelector) == WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector, "value mismatch for SType::SurfaceDescriptorFromCanvasHTMLSelector"); - static_assert(static_cast(SType::ShaderModuleSPIRVDescriptor) == WGPUSType_ShaderModuleSPIRVDescriptor, "value mismatch for SType::ShaderModuleSPIRVDescriptor"); - static_assert(static_cast(SType::ShaderModuleWGSLDescriptor) == WGPUSType_ShaderModuleWGSLDescriptor, "value mismatch for SType::ShaderModuleWGSLDescriptor"); - static_assert(static_cast(SType::SamplerDescriptorDummyAnisotropicFiltering) == WGPUSType_SamplerDescriptorDummyAnisotropicFiltering, "value mismatch for SType::SamplerDescriptorDummyAnisotropicFiltering"); - static_assert(static_cast(SType::RenderPipelineDescriptorDummyExtension) == WGPUSType_RenderPipelineDescriptorDummyExtension, "value mismatch for SType::RenderPipelineDescriptorDummyExtension"); - - // SamplerBindingType - - static_assert(sizeof(SamplerBindingType) == sizeof(WGPUSamplerBindingType), "sizeof mismatch for SamplerBindingType"); - static_assert(alignof(SamplerBindingType) == alignof(WGPUSamplerBindingType), "alignof mismatch for SamplerBindingType"); - - static_assert(static_cast(SamplerBindingType::Undefined) == WGPUSamplerBindingType_Undefined, "value mismatch for SamplerBindingType::Undefined"); - static_assert(static_cast(SamplerBindingType::Filtering) == WGPUSamplerBindingType_Filtering, "value mismatch for SamplerBindingType::Filtering"); - static_assert(static_cast(SamplerBindingType::NonFiltering) == WGPUSamplerBindingType_NonFiltering, "value mismatch for SamplerBindingType::NonFiltering"); - static_assert(static_cast(SamplerBindingType::Comparison) == WGPUSamplerBindingType_Comparison, "value mismatch for SamplerBindingType::Comparison"); - - // StencilOperation - - static_assert(sizeof(StencilOperation) == sizeof(WGPUStencilOperation), "sizeof mismatch for StencilOperation"); - static_assert(alignof(StencilOperation) == alignof(WGPUStencilOperation), "alignof mismatch for StencilOperation"); - - static_assert(static_cast(StencilOperation::Keep) == WGPUStencilOperation_Keep, "value mismatch for StencilOperation::Keep"); - static_assert(static_cast(StencilOperation::Zero) == WGPUStencilOperation_Zero, "value mismatch for StencilOperation::Zero"); - static_assert(static_cast(StencilOperation::Replace) == WGPUStencilOperation_Replace, "value mismatch for StencilOperation::Replace"); - static_assert(static_cast(StencilOperation::Invert) == WGPUStencilOperation_Invert, "value mismatch for StencilOperation::Invert"); - static_assert(static_cast(StencilOperation::IncrementClamp) == WGPUStencilOperation_IncrementClamp, "value mismatch for StencilOperation::IncrementClamp"); - static_assert(static_cast(StencilOperation::DecrementClamp) == WGPUStencilOperation_DecrementClamp, "value mismatch for StencilOperation::DecrementClamp"); - static_assert(static_cast(StencilOperation::IncrementWrap) == WGPUStencilOperation_IncrementWrap, "value mismatch for StencilOperation::IncrementWrap"); - static_assert(static_cast(StencilOperation::DecrementWrap) == WGPUStencilOperation_DecrementWrap, "value mismatch for StencilOperation::DecrementWrap"); - - // StorageTextureAccess - - static_assert(sizeof(StorageTextureAccess) == sizeof(WGPUStorageTextureAccess), "sizeof mismatch for StorageTextureAccess"); - static_assert(alignof(StorageTextureAccess) == alignof(WGPUStorageTextureAccess), "alignof mismatch for StorageTextureAccess"); - - static_assert(static_cast(StorageTextureAccess::Undefined) == WGPUStorageTextureAccess_Undefined, "value mismatch for StorageTextureAccess::Undefined"); - static_assert(static_cast(StorageTextureAccess::ReadOnly) == WGPUStorageTextureAccess_ReadOnly, "value mismatch for StorageTextureAccess::ReadOnly"); - static_assert(static_cast(StorageTextureAccess::WriteOnly) == WGPUStorageTextureAccess_WriteOnly, "value mismatch for StorageTextureAccess::WriteOnly"); - - // StoreOp - - static_assert(sizeof(StoreOp) == sizeof(WGPUStoreOp), "sizeof mismatch for StoreOp"); - static_assert(alignof(StoreOp) == alignof(WGPUStoreOp), "alignof mismatch for StoreOp"); - - static_assert(static_cast(StoreOp::Store) == WGPUStoreOp_Store, "value mismatch for StoreOp::Store"); - static_assert(static_cast(StoreOp::Clear) == WGPUStoreOp_Clear, "value mismatch for StoreOp::Clear"); - - // TextureAspect - - static_assert(sizeof(TextureAspect) == sizeof(WGPUTextureAspect), "sizeof mismatch for TextureAspect"); - static_assert(alignof(TextureAspect) == alignof(WGPUTextureAspect), "alignof mismatch for TextureAspect"); - - static_assert(static_cast(TextureAspect::All) == WGPUTextureAspect_All, "value mismatch for TextureAspect::All"); - static_assert(static_cast(TextureAspect::StencilOnly) == WGPUTextureAspect_StencilOnly, "value mismatch for TextureAspect::StencilOnly"); - static_assert(static_cast(TextureAspect::DepthOnly) == WGPUTextureAspect_DepthOnly, "value mismatch for TextureAspect::DepthOnly"); - - // TextureComponentType - - static_assert(sizeof(TextureComponentType) == sizeof(WGPUTextureComponentType), "sizeof mismatch for TextureComponentType"); - static_assert(alignof(TextureComponentType) == alignof(WGPUTextureComponentType), "alignof mismatch for TextureComponentType"); - - static_assert(static_cast(TextureComponentType::Float) == WGPUTextureComponentType_Float, "value mismatch for TextureComponentType::Float"); - static_assert(static_cast(TextureComponentType::Sint) == WGPUTextureComponentType_Sint, "value mismatch for TextureComponentType::Sint"); - static_assert(static_cast(TextureComponentType::Uint) == WGPUTextureComponentType_Uint, "value mismatch for TextureComponentType::Uint"); - static_assert(static_cast(TextureComponentType::DepthComparison) == WGPUTextureComponentType_DepthComparison, "value mismatch for TextureComponentType::DepthComparison"); - - // TextureDimension - - static_assert(sizeof(TextureDimension) == sizeof(WGPUTextureDimension), "sizeof mismatch for TextureDimension"); - static_assert(alignof(TextureDimension) == alignof(WGPUTextureDimension), "alignof mismatch for TextureDimension"); - - static_assert(static_cast(TextureDimension::e1D) == WGPUTextureDimension_1D, "value mismatch for TextureDimension::e1D"); - static_assert(static_cast(TextureDimension::e2D) == WGPUTextureDimension_2D, "value mismatch for TextureDimension::e2D"); - static_assert(static_cast(TextureDimension::e3D) == WGPUTextureDimension_3D, "value mismatch for TextureDimension::e3D"); - - // TextureFormat - - static_assert(sizeof(TextureFormat) == sizeof(WGPUTextureFormat), "sizeof mismatch for TextureFormat"); - static_assert(alignof(TextureFormat) == alignof(WGPUTextureFormat), "alignof mismatch for TextureFormat"); - - static_assert(static_cast(TextureFormat::Undefined) == WGPUTextureFormat_Undefined, "value mismatch for TextureFormat::Undefined"); - static_assert(static_cast(TextureFormat::R8Unorm) == WGPUTextureFormat_R8Unorm, "value mismatch for TextureFormat::R8Unorm"); - static_assert(static_cast(TextureFormat::R8Snorm) == WGPUTextureFormat_R8Snorm, "value mismatch for TextureFormat::R8Snorm"); - static_assert(static_cast(TextureFormat::R8Uint) == WGPUTextureFormat_R8Uint, "value mismatch for TextureFormat::R8Uint"); - static_assert(static_cast(TextureFormat::R8Sint) == WGPUTextureFormat_R8Sint, "value mismatch for TextureFormat::R8Sint"); - static_assert(static_cast(TextureFormat::R16Uint) == WGPUTextureFormat_R16Uint, "value mismatch for TextureFormat::R16Uint"); - static_assert(static_cast(TextureFormat::R16Sint) == WGPUTextureFormat_R16Sint, "value mismatch for TextureFormat::R16Sint"); - static_assert(static_cast(TextureFormat::R16Float) == WGPUTextureFormat_R16Float, "value mismatch for TextureFormat::R16Float"); - static_assert(static_cast(TextureFormat::RG8Unorm) == WGPUTextureFormat_RG8Unorm, "value mismatch for TextureFormat::RG8Unorm"); - static_assert(static_cast(TextureFormat::RG8Snorm) == WGPUTextureFormat_RG8Snorm, "value mismatch for TextureFormat::RG8Snorm"); - static_assert(static_cast(TextureFormat::RG8Uint) == WGPUTextureFormat_RG8Uint, "value mismatch for TextureFormat::RG8Uint"); - static_assert(static_cast(TextureFormat::RG8Sint) == WGPUTextureFormat_RG8Sint, "value mismatch for TextureFormat::RG8Sint"); - static_assert(static_cast(TextureFormat::R32Float) == WGPUTextureFormat_R32Float, "value mismatch for TextureFormat::R32Float"); - static_assert(static_cast(TextureFormat::R32Uint) == WGPUTextureFormat_R32Uint, "value mismatch for TextureFormat::R32Uint"); - static_assert(static_cast(TextureFormat::R32Sint) == WGPUTextureFormat_R32Sint, "value mismatch for TextureFormat::R32Sint"); - static_assert(static_cast(TextureFormat::RG16Uint) == WGPUTextureFormat_RG16Uint, "value mismatch for TextureFormat::RG16Uint"); - static_assert(static_cast(TextureFormat::RG16Sint) == WGPUTextureFormat_RG16Sint, "value mismatch for TextureFormat::RG16Sint"); - static_assert(static_cast(TextureFormat::RG16Float) == WGPUTextureFormat_RG16Float, "value mismatch for TextureFormat::RG16Float"); - static_assert(static_cast(TextureFormat::RGBA8Unorm) == WGPUTextureFormat_RGBA8Unorm, "value mismatch for TextureFormat::RGBA8Unorm"); - static_assert(static_cast(TextureFormat::RGBA8UnormSrgb) == WGPUTextureFormat_RGBA8UnormSrgb, "value mismatch for TextureFormat::RGBA8UnormSrgb"); - static_assert(static_cast(TextureFormat::RGBA8Snorm) == WGPUTextureFormat_RGBA8Snorm, "value mismatch for TextureFormat::RGBA8Snorm"); - static_assert(static_cast(TextureFormat::RGBA8Uint) == WGPUTextureFormat_RGBA8Uint, "value mismatch for TextureFormat::RGBA8Uint"); - static_assert(static_cast(TextureFormat::RGBA8Sint) == WGPUTextureFormat_RGBA8Sint, "value mismatch for TextureFormat::RGBA8Sint"); - static_assert(static_cast(TextureFormat::BGRA8Unorm) == WGPUTextureFormat_BGRA8Unorm, "value mismatch for TextureFormat::BGRA8Unorm"); - static_assert(static_cast(TextureFormat::BGRA8UnormSrgb) == WGPUTextureFormat_BGRA8UnormSrgb, "value mismatch for TextureFormat::BGRA8UnormSrgb"); - static_assert(static_cast(TextureFormat::RGB10A2Unorm) == WGPUTextureFormat_RGB10A2Unorm, "value mismatch for TextureFormat::RGB10A2Unorm"); - static_assert(static_cast(TextureFormat::RG11B10Ufloat) == WGPUTextureFormat_RG11B10Ufloat, "value mismatch for TextureFormat::RG11B10Ufloat"); - static_assert(static_cast(TextureFormat::RGB9E5Ufloat) == WGPUTextureFormat_RGB9E5Ufloat, "value mismatch for TextureFormat::RGB9E5Ufloat"); - static_assert(static_cast(TextureFormat::RG32Float) == WGPUTextureFormat_RG32Float, "value mismatch for TextureFormat::RG32Float"); - static_assert(static_cast(TextureFormat::RG32Uint) == WGPUTextureFormat_RG32Uint, "value mismatch for TextureFormat::RG32Uint"); - static_assert(static_cast(TextureFormat::RG32Sint) == WGPUTextureFormat_RG32Sint, "value mismatch for TextureFormat::RG32Sint"); - static_assert(static_cast(TextureFormat::RGBA16Uint) == WGPUTextureFormat_RGBA16Uint, "value mismatch for TextureFormat::RGBA16Uint"); - static_assert(static_cast(TextureFormat::RGBA16Sint) == WGPUTextureFormat_RGBA16Sint, "value mismatch for TextureFormat::RGBA16Sint"); - static_assert(static_cast(TextureFormat::RGBA16Float) == WGPUTextureFormat_RGBA16Float, "value mismatch for TextureFormat::RGBA16Float"); - static_assert(static_cast(TextureFormat::RGBA32Float) == WGPUTextureFormat_RGBA32Float, "value mismatch for TextureFormat::RGBA32Float"); - static_assert(static_cast(TextureFormat::RGBA32Uint) == WGPUTextureFormat_RGBA32Uint, "value mismatch for TextureFormat::RGBA32Uint"); - static_assert(static_cast(TextureFormat::RGBA32Sint) == WGPUTextureFormat_RGBA32Sint, "value mismatch for TextureFormat::RGBA32Sint"); - static_assert(static_cast(TextureFormat::Depth32Float) == WGPUTextureFormat_Depth32Float, "value mismatch for TextureFormat::Depth32Float"); - static_assert(static_cast(TextureFormat::Depth24Plus) == WGPUTextureFormat_Depth24Plus, "value mismatch for TextureFormat::Depth24Plus"); - static_assert(static_cast(TextureFormat::Depth24PlusStencil8) == WGPUTextureFormat_Depth24PlusStencil8, "value mismatch for TextureFormat::Depth24PlusStencil8"); - static_assert(static_cast(TextureFormat::BC1RGBAUnorm) == WGPUTextureFormat_BC1RGBAUnorm, "value mismatch for TextureFormat::BC1RGBAUnorm"); - static_assert(static_cast(TextureFormat::BC1RGBAUnormSrgb) == WGPUTextureFormat_BC1RGBAUnormSrgb, "value mismatch for TextureFormat::BC1RGBAUnormSrgb"); - static_assert(static_cast(TextureFormat::BC2RGBAUnorm) == WGPUTextureFormat_BC2RGBAUnorm, "value mismatch for TextureFormat::BC2RGBAUnorm"); - static_assert(static_cast(TextureFormat::BC2RGBAUnormSrgb) == WGPUTextureFormat_BC2RGBAUnormSrgb, "value mismatch for TextureFormat::BC2RGBAUnormSrgb"); - static_assert(static_cast(TextureFormat::BC3RGBAUnorm) == WGPUTextureFormat_BC3RGBAUnorm, "value mismatch for TextureFormat::BC3RGBAUnorm"); - static_assert(static_cast(TextureFormat::BC3RGBAUnormSrgb) == WGPUTextureFormat_BC3RGBAUnormSrgb, "value mismatch for TextureFormat::BC3RGBAUnormSrgb"); - static_assert(static_cast(TextureFormat::BC4RUnorm) == WGPUTextureFormat_BC4RUnorm, "value mismatch for TextureFormat::BC4RUnorm"); - static_assert(static_cast(TextureFormat::BC4RSnorm) == WGPUTextureFormat_BC4RSnorm, "value mismatch for TextureFormat::BC4RSnorm"); - static_assert(static_cast(TextureFormat::BC5RGUnorm) == WGPUTextureFormat_BC5RGUnorm, "value mismatch for TextureFormat::BC5RGUnorm"); - static_assert(static_cast(TextureFormat::BC5RGSnorm) == WGPUTextureFormat_BC5RGSnorm, "value mismatch for TextureFormat::BC5RGSnorm"); - static_assert(static_cast(TextureFormat::BC6HRGBUfloat) == WGPUTextureFormat_BC6HRGBUfloat, "value mismatch for TextureFormat::BC6HRGBUfloat"); - static_assert(static_cast(TextureFormat::BC6HRGBFloat) == WGPUTextureFormat_BC6HRGBFloat, "value mismatch for TextureFormat::BC6HRGBFloat"); - static_assert(static_cast(TextureFormat::BC7RGBAUnorm) == WGPUTextureFormat_BC7RGBAUnorm, "value mismatch for TextureFormat::BC7RGBAUnorm"); - static_assert(static_cast(TextureFormat::BC7RGBAUnormSrgb) == WGPUTextureFormat_BC7RGBAUnormSrgb, "value mismatch for TextureFormat::BC7RGBAUnormSrgb"); - - // TextureSampleType - - static_assert(sizeof(TextureSampleType) == sizeof(WGPUTextureSampleType), "sizeof mismatch for TextureSampleType"); - static_assert(alignof(TextureSampleType) == alignof(WGPUTextureSampleType), "alignof mismatch for TextureSampleType"); - - static_assert(static_cast(TextureSampleType::Undefined) == WGPUTextureSampleType_Undefined, "value mismatch for TextureSampleType::Undefined"); - static_assert(static_cast(TextureSampleType::Float) == WGPUTextureSampleType_Float, "value mismatch for TextureSampleType::Float"); - static_assert(static_cast(TextureSampleType::UnfilterableFloat) == WGPUTextureSampleType_UnfilterableFloat, "value mismatch for TextureSampleType::UnfilterableFloat"); - static_assert(static_cast(TextureSampleType::Depth) == WGPUTextureSampleType_Depth, "value mismatch for TextureSampleType::Depth"); - static_assert(static_cast(TextureSampleType::Sint) == WGPUTextureSampleType_Sint, "value mismatch for TextureSampleType::Sint"); - static_assert(static_cast(TextureSampleType::Uint) == WGPUTextureSampleType_Uint, "value mismatch for TextureSampleType::Uint"); - - // TextureViewDimension - - static_assert(sizeof(TextureViewDimension) == sizeof(WGPUTextureViewDimension), "sizeof mismatch for TextureViewDimension"); - static_assert(alignof(TextureViewDimension) == alignof(WGPUTextureViewDimension), "alignof mismatch for TextureViewDimension"); - - static_assert(static_cast(TextureViewDimension::Undefined) == WGPUTextureViewDimension_Undefined, "value mismatch for TextureViewDimension::Undefined"); - static_assert(static_cast(TextureViewDimension::e1D) == WGPUTextureViewDimension_1D, "value mismatch for TextureViewDimension::e1D"); - static_assert(static_cast(TextureViewDimension::e2D) == WGPUTextureViewDimension_2D, "value mismatch for TextureViewDimension::e2D"); - static_assert(static_cast(TextureViewDimension::e2DArray) == WGPUTextureViewDimension_2DArray, "value mismatch for TextureViewDimension::e2DArray"); - static_assert(static_cast(TextureViewDimension::Cube) == WGPUTextureViewDimension_Cube, "value mismatch for TextureViewDimension::Cube"); - static_assert(static_cast(TextureViewDimension::CubeArray) == WGPUTextureViewDimension_CubeArray, "value mismatch for TextureViewDimension::CubeArray"); - static_assert(static_cast(TextureViewDimension::e3D) == WGPUTextureViewDimension_3D, "value mismatch for TextureViewDimension::e3D"); - - // VertexFormat - - static_assert(sizeof(VertexFormat) == sizeof(WGPUVertexFormat), "sizeof mismatch for VertexFormat"); - static_assert(alignof(VertexFormat) == alignof(WGPUVertexFormat), "alignof mismatch for VertexFormat"); - - static_assert(static_cast(VertexFormat::UChar2) == WGPUVertexFormat_UChar2, "value mismatch for VertexFormat::UChar2"); - static_assert(static_cast(VertexFormat::UChar4) == WGPUVertexFormat_UChar4, "value mismatch for VertexFormat::UChar4"); - static_assert(static_cast(VertexFormat::Char2) == WGPUVertexFormat_Char2, "value mismatch for VertexFormat::Char2"); - static_assert(static_cast(VertexFormat::Char4) == WGPUVertexFormat_Char4, "value mismatch for VertexFormat::Char4"); - static_assert(static_cast(VertexFormat::UChar2Norm) == WGPUVertexFormat_UChar2Norm, "value mismatch for VertexFormat::UChar2Norm"); - static_assert(static_cast(VertexFormat::UChar4Norm) == WGPUVertexFormat_UChar4Norm, "value mismatch for VertexFormat::UChar4Norm"); - static_assert(static_cast(VertexFormat::Char2Norm) == WGPUVertexFormat_Char2Norm, "value mismatch for VertexFormat::Char2Norm"); - static_assert(static_cast(VertexFormat::Char4Norm) == WGPUVertexFormat_Char4Norm, "value mismatch for VertexFormat::Char4Norm"); - static_assert(static_cast(VertexFormat::UShort2) == WGPUVertexFormat_UShort2, "value mismatch for VertexFormat::UShort2"); - static_assert(static_cast(VertexFormat::UShort4) == WGPUVertexFormat_UShort4, "value mismatch for VertexFormat::UShort4"); - static_assert(static_cast(VertexFormat::Short2) == WGPUVertexFormat_Short2, "value mismatch for VertexFormat::Short2"); - static_assert(static_cast(VertexFormat::Short4) == WGPUVertexFormat_Short4, "value mismatch for VertexFormat::Short4"); - static_assert(static_cast(VertexFormat::UShort2Norm) == WGPUVertexFormat_UShort2Norm, "value mismatch for VertexFormat::UShort2Norm"); - static_assert(static_cast(VertexFormat::UShort4Norm) == WGPUVertexFormat_UShort4Norm, "value mismatch for VertexFormat::UShort4Norm"); - static_assert(static_cast(VertexFormat::Short2Norm) == WGPUVertexFormat_Short2Norm, "value mismatch for VertexFormat::Short2Norm"); - static_assert(static_cast(VertexFormat::Short4Norm) == WGPUVertexFormat_Short4Norm, "value mismatch for VertexFormat::Short4Norm"); - static_assert(static_cast(VertexFormat::Half2) == WGPUVertexFormat_Half2, "value mismatch for VertexFormat::Half2"); - static_assert(static_cast(VertexFormat::Half4) == WGPUVertexFormat_Half4, "value mismatch for VertexFormat::Half4"); - static_assert(static_cast(VertexFormat::Float) == WGPUVertexFormat_Float, "value mismatch for VertexFormat::Float"); - static_assert(static_cast(VertexFormat::Float2) == WGPUVertexFormat_Float2, "value mismatch for VertexFormat::Float2"); - static_assert(static_cast(VertexFormat::Float3) == WGPUVertexFormat_Float3, "value mismatch for VertexFormat::Float3"); - static_assert(static_cast(VertexFormat::Float4) == WGPUVertexFormat_Float4, "value mismatch for VertexFormat::Float4"); - static_assert(static_cast(VertexFormat::UInt) == WGPUVertexFormat_UInt, "value mismatch for VertexFormat::UInt"); - static_assert(static_cast(VertexFormat::UInt2) == WGPUVertexFormat_UInt2, "value mismatch for VertexFormat::UInt2"); - static_assert(static_cast(VertexFormat::UInt3) == WGPUVertexFormat_UInt3, "value mismatch for VertexFormat::UInt3"); - static_assert(static_cast(VertexFormat::UInt4) == WGPUVertexFormat_UInt4, "value mismatch for VertexFormat::UInt4"); - static_assert(static_cast(VertexFormat::Int) == WGPUVertexFormat_Int, "value mismatch for VertexFormat::Int"); - static_assert(static_cast(VertexFormat::Int2) == WGPUVertexFormat_Int2, "value mismatch for VertexFormat::Int2"); - static_assert(static_cast(VertexFormat::Int3) == WGPUVertexFormat_Int3, "value mismatch for VertexFormat::Int3"); - static_assert(static_cast(VertexFormat::Int4) == WGPUVertexFormat_Int4, "value mismatch for VertexFormat::Int4"); - - // BufferUsage - - static_assert(sizeof(BufferUsage) == sizeof(WGPUBufferUsageFlags), "sizeof mismatch for BufferUsage"); - static_assert(alignof(BufferUsage) == alignof(WGPUBufferUsageFlags), "alignof mismatch for BufferUsage"); - - static_assert(static_cast(BufferUsage::None) == WGPUBufferUsage_None, "value mismatch for BufferUsage::None"); - static_assert(static_cast(BufferUsage::MapRead) == WGPUBufferUsage_MapRead, "value mismatch for BufferUsage::MapRead"); - static_assert(static_cast(BufferUsage::MapWrite) == WGPUBufferUsage_MapWrite, "value mismatch for BufferUsage::MapWrite"); - static_assert(static_cast(BufferUsage::CopySrc) == WGPUBufferUsage_CopySrc, "value mismatch for BufferUsage::CopySrc"); - static_assert(static_cast(BufferUsage::CopyDst) == WGPUBufferUsage_CopyDst, "value mismatch for BufferUsage::CopyDst"); - static_assert(static_cast(BufferUsage::Index) == WGPUBufferUsage_Index, "value mismatch for BufferUsage::Index"); - static_assert(static_cast(BufferUsage::Vertex) == WGPUBufferUsage_Vertex, "value mismatch for BufferUsage::Vertex"); - static_assert(static_cast(BufferUsage::Uniform) == WGPUBufferUsage_Uniform, "value mismatch for BufferUsage::Uniform"); - static_assert(static_cast(BufferUsage::Storage) == WGPUBufferUsage_Storage, "value mismatch for BufferUsage::Storage"); - static_assert(static_cast(BufferUsage::Indirect) == WGPUBufferUsage_Indirect, "value mismatch for BufferUsage::Indirect"); - static_assert(static_cast(BufferUsage::QueryResolve) == WGPUBufferUsage_QueryResolve, "value mismatch for BufferUsage::QueryResolve"); - - // ColorWriteMask - - static_assert(sizeof(ColorWriteMask) == sizeof(WGPUColorWriteMaskFlags), "sizeof mismatch for ColorWriteMask"); - static_assert(alignof(ColorWriteMask) == alignof(WGPUColorWriteMaskFlags), "alignof mismatch for ColorWriteMask"); - - static_assert(static_cast(ColorWriteMask::None) == WGPUColorWriteMask_None, "value mismatch for ColorWriteMask::None"); - static_assert(static_cast(ColorWriteMask::Red) == WGPUColorWriteMask_Red, "value mismatch for ColorWriteMask::Red"); - static_assert(static_cast(ColorWriteMask::Green) == WGPUColorWriteMask_Green, "value mismatch for ColorWriteMask::Green"); - static_assert(static_cast(ColorWriteMask::Blue) == WGPUColorWriteMask_Blue, "value mismatch for ColorWriteMask::Blue"); - static_assert(static_cast(ColorWriteMask::Alpha) == WGPUColorWriteMask_Alpha, "value mismatch for ColorWriteMask::Alpha"); - static_assert(static_cast(ColorWriteMask::All) == WGPUColorWriteMask_All, "value mismatch for ColorWriteMask::All"); - - // MapMode - - static_assert(sizeof(MapMode) == sizeof(WGPUMapModeFlags), "sizeof mismatch for MapMode"); - static_assert(alignof(MapMode) == alignof(WGPUMapModeFlags), "alignof mismatch for MapMode"); - - static_assert(static_cast(MapMode::None) == WGPUMapMode_None, "value mismatch for MapMode::None"); - static_assert(static_cast(MapMode::Read) == WGPUMapMode_Read, "value mismatch for MapMode::Read"); - static_assert(static_cast(MapMode::Write) == WGPUMapMode_Write, "value mismatch for MapMode::Write"); - - // ShaderStage - - static_assert(sizeof(ShaderStage) == sizeof(WGPUShaderStageFlags), "sizeof mismatch for ShaderStage"); - static_assert(alignof(ShaderStage) == alignof(WGPUShaderStageFlags), "alignof mismatch for ShaderStage"); - - static_assert(static_cast(ShaderStage::None) == WGPUShaderStage_None, "value mismatch for ShaderStage::None"); - static_assert(static_cast(ShaderStage::Vertex) == WGPUShaderStage_Vertex, "value mismatch for ShaderStage::Vertex"); - static_assert(static_cast(ShaderStage::Fragment) == WGPUShaderStage_Fragment, "value mismatch for ShaderStage::Fragment"); - static_assert(static_cast(ShaderStage::Compute) == WGPUShaderStage_Compute, "value mismatch for ShaderStage::Compute"); - - // TextureUsage - - static_assert(sizeof(TextureUsage) == sizeof(WGPUTextureUsageFlags), "sizeof mismatch for TextureUsage"); - static_assert(alignof(TextureUsage) == alignof(WGPUTextureUsageFlags), "alignof mismatch for TextureUsage"); - - static_assert(static_cast(TextureUsage::None) == WGPUTextureUsage_None, "value mismatch for TextureUsage::None"); - static_assert(static_cast(TextureUsage::CopySrc) == WGPUTextureUsage_CopySrc, "value mismatch for TextureUsage::CopySrc"); - static_assert(static_cast(TextureUsage::CopyDst) == WGPUTextureUsage_CopyDst, "value mismatch for TextureUsage::CopyDst"); - static_assert(static_cast(TextureUsage::Sampled) == WGPUTextureUsage_Sampled, "value mismatch for TextureUsage::Sampled"); - static_assert(static_cast(TextureUsage::Storage) == WGPUTextureUsage_Storage, "value mismatch for TextureUsage::Storage"); - static_assert(static_cast(TextureUsage::OutputAttachment) == WGPUTextureUsage_OutputAttachment, "value mismatch for TextureUsage::OutputAttachment"); - static_assert(static_cast(TextureUsage::RenderAttachment) == WGPUTextureUsage_RenderAttachment, "value mismatch for TextureUsage::RenderAttachment"); - static_assert(static_cast(TextureUsage::Present) == WGPUTextureUsage_Present, "value mismatch for TextureUsage::Present"); - - // ChainedStruct - - static_assert(sizeof(ChainedStruct) == sizeof(WGPUChainedStruct), - "sizeof mismatch for ChainedStruct"); - static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct), - "alignof mismatch for ChainedStruct"); - static_assert(offsetof(ChainedStruct, nextInChain) == offsetof(WGPUChainedStruct, next), - "offsetof mismatch for ChainedStruct::nextInChain"); - static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType), - "offsetof mismatch for ChainedStruct::sType"); - - // AdapterProperties - - static_assert(sizeof(AdapterProperties) == sizeof(WGPUAdapterProperties), "sizeof mismatch for AdapterProperties"); - static_assert(alignof(AdapterProperties) == alignof(WGPUAdapterProperties), "alignof mismatch for AdapterProperties"); - - static_assert(offsetof(AdapterProperties, nextInChain) == offsetof(WGPUAdapterProperties, nextInChain), - "offsetof mismatch for AdapterProperties::nextInChain"); - static_assert(offsetof(AdapterProperties, deviceID) == offsetof(WGPUAdapterProperties, deviceID), - "offsetof mismatch for AdapterProperties::deviceID"); - static_assert(offsetof(AdapterProperties, vendorID) == offsetof(WGPUAdapterProperties, vendorID), - "offsetof mismatch for AdapterProperties::vendorID"); - static_assert(offsetof(AdapterProperties, name) == offsetof(WGPUAdapterProperties, name), - "offsetof mismatch for AdapterProperties::name"); - static_assert(offsetof(AdapterProperties, driverDescription) == offsetof(WGPUAdapterProperties, driverDescription), - "offsetof mismatch for AdapterProperties::driverDescription"); - static_assert(offsetof(AdapterProperties, adapterType) == offsetof(WGPUAdapterProperties, adapterType), - "offsetof mismatch for AdapterProperties::adapterType"); - static_assert(offsetof(AdapterProperties, backendType) == offsetof(WGPUAdapterProperties, backendType), - "offsetof mismatch for AdapterProperties::backendType"); - - // BindGroupEntry - - static_assert(sizeof(BindGroupEntry) == sizeof(WGPUBindGroupEntry), "sizeof mismatch for BindGroupEntry"); - static_assert(alignof(BindGroupEntry) == alignof(WGPUBindGroupEntry), "alignof mismatch for BindGroupEntry"); - - static_assert(offsetof(BindGroupEntry, binding) == offsetof(WGPUBindGroupEntry, binding), - "offsetof mismatch for BindGroupEntry::binding"); - static_assert(offsetof(BindGroupEntry, buffer) == offsetof(WGPUBindGroupEntry, buffer), - "offsetof mismatch for BindGroupEntry::buffer"); - static_assert(offsetof(BindGroupEntry, offset) == offsetof(WGPUBindGroupEntry, offset), - "offsetof mismatch for BindGroupEntry::offset"); - static_assert(offsetof(BindGroupEntry, size) == offsetof(WGPUBindGroupEntry, size), - "offsetof mismatch for BindGroupEntry::size"); - static_assert(offsetof(BindGroupEntry, sampler) == offsetof(WGPUBindGroupEntry, sampler), - "offsetof mismatch for BindGroupEntry::sampler"); - static_assert(offsetof(BindGroupEntry, textureView) == offsetof(WGPUBindGroupEntry, textureView), - "offsetof mismatch for BindGroupEntry::textureView"); - - // BlendDescriptor - - static_assert(sizeof(BlendDescriptor) == sizeof(WGPUBlendDescriptor), "sizeof mismatch for BlendDescriptor"); - static_assert(alignof(BlendDescriptor) == alignof(WGPUBlendDescriptor), "alignof mismatch for BlendDescriptor"); - - static_assert(offsetof(BlendDescriptor, operation) == offsetof(WGPUBlendDescriptor, operation), - "offsetof mismatch for BlendDescriptor::operation"); - static_assert(offsetof(BlendDescriptor, srcFactor) == offsetof(WGPUBlendDescriptor, srcFactor), - "offsetof mismatch for BlendDescriptor::srcFactor"); - static_assert(offsetof(BlendDescriptor, dstFactor) == offsetof(WGPUBlendDescriptor, dstFactor), - "offsetof mismatch for BlendDescriptor::dstFactor"); - - // BufferBindingLayout - - static_assert(sizeof(BufferBindingLayout) == sizeof(WGPUBufferBindingLayout), "sizeof mismatch for BufferBindingLayout"); - static_assert(alignof(BufferBindingLayout) == alignof(WGPUBufferBindingLayout), "alignof mismatch for BufferBindingLayout"); - - static_assert(offsetof(BufferBindingLayout, nextInChain) == offsetof(WGPUBufferBindingLayout, nextInChain), - "offsetof mismatch for BufferBindingLayout::nextInChain"); - static_assert(offsetof(BufferBindingLayout, type) == offsetof(WGPUBufferBindingLayout, type), - "offsetof mismatch for BufferBindingLayout::type"); - static_assert(offsetof(BufferBindingLayout, hasDynamicOffset) == offsetof(WGPUBufferBindingLayout, hasDynamicOffset), - "offsetof mismatch for BufferBindingLayout::hasDynamicOffset"); - static_assert(offsetof(BufferBindingLayout, minBindingSize) == offsetof(WGPUBufferBindingLayout, minBindingSize), - "offsetof mismatch for BufferBindingLayout::minBindingSize"); - - // BufferDescriptor - - static_assert(sizeof(BufferDescriptor) == sizeof(WGPUBufferDescriptor), "sizeof mismatch for BufferDescriptor"); - static_assert(alignof(BufferDescriptor) == alignof(WGPUBufferDescriptor), "alignof mismatch for BufferDescriptor"); - - static_assert(offsetof(BufferDescriptor, nextInChain) == offsetof(WGPUBufferDescriptor, nextInChain), - "offsetof mismatch for BufferDescriptor::nextInChain"); - static_assert(offsetof(BufferDescriptor, label) == offsetof(WGPUBufferDescriptor, label), - "offsetof mismatch for BufferDescriptor::label"); - static_assert(offsetof(BufferDescriptor, usage) == offsetof(WGPUBufferDescriptor, usage), - "offsetof mismatch for BufferDescriptor::usage"); - static_assert(offsetof(BufferDescriptor, size) == offsetof(WGPUBufferDescriptor, size), - "offsetof mismatch for BufferDescriptor::size"); - static_assert(offsetof(BufferDescriptor, mappedAtCreation) == offsetof(WGPUBufferDescriptor, mappedAtCreation), - "offsetof mismatch for BufferDescriptor::mappedAtCreation"); - - // Color - - static_assert(sizeof(Color) == sizeof(WGPUColor), "sizeof mismatch for Color"); - static_assert(alignof(Color) == alignof(WGPUColor), "alignof mismatch for Color"); - - static_assert(offsetof(Color, r) == offsetof(WGPUColor, r), - "offsetof mismatch for Color::r"); - static_assert(offsetof(Color, g) == offsetof(WGPUColor, g), - "offsetof mismatch for Color::g"); - static_assert(offsetof(Color, b) == offsetof(WGPUColor, b), - "offsetof mismatch for Color::b"); - static_assert(offsetof(Color, a) == offsetof(WGPUColor, a), - "offsetof mismatch for Color::a"); - - // CommandBufferDescriptor - - static_assert(sizeof(CommandBufferDescriptor) == sizeof(WGPUCommandBufferDescriptor), "sizeof mismatch for CommandBufferDescriptor"); - static_assert(alignof(CommandBufferDescriptor) == alignof(WGPUCommandBufferDescriptor), "alignof mismatch for CommandBufferDescriptor"); - - static_assert(offsetof(CommandBufferDescriptor, nextInChain) == offsetof(WGPUCommandBufferDescriptor, nextInChain), - "offsetof mismatch for CommandBufferDescriptor::nextInChain"); - static_assert(offsetof(CommandBufferDescriptor, label) == offsetof(WGPUCommandBufferDescriptor, label), - "offsetof mismatch for CommandBufferDescriptor::label"); - - // CommandEncoderDescriptor - - static_assert(sizeof(CommandEncoderDescriptor) == sizeof(WGPUCommandEncoderDescriptor), "sizeof mismatch for CommandEncoderDescriptor"); - static_assert(alignof(CommandEncoderDescriptor) == alignof(WGPUCommandEncoderDescriptor), "alignof mismatch for CommandEncoderDescriptor"); - - static_assert(offsetof(CommandEncoderDescriptor, nextInChain) == offsetof(WGPUCommandEncoderDescriptor, nextInChain), - "offsetof mismatch for CommandEncoderDescriptor::nextInChain"); - static_assert(offsetof(CommandEncoderDescriptor, label) == offsetof(WGPUCommandEncoderDescriptor, label), - "offsetof mismatch for CommandEncoderDescriptor::label"); - - // ComputePassDescriptor - - static_assert(sizeof(ComputePassDescriptor) == sizeof(WGPUComputePassDescriptor), "sizeof mismatch for ComputePassDescriptor"); - static_assert(alignof(ComputePassDescriptor) == alignof(WGPUComputePassDescriptor), "alignof mismatch for ComputePassDescriptor"); - - static_assert(offsetof(ComputePassDescriptor, nextInChain) == offsetof(WGPUComputePassDescriptor, nextInChain), - "offsetof mismatch for ComputePassDescriptor::nextInChain"); - static_assert(offsetof(ComputePassDescriptor, label) == offsetof(WGPUComputePassDescriptor, label), - "offsetof mismatch for ComputePassDescriptor::label"); - - // CopyTextureForBrowserOptions - - static_assert(sizeof(CopyTextureForBrowserOptions) == sizeof(WGPUCopyTextureForBrowserOptions), "sizeof mismatch for CopyTextureForBrowserOptions"); - static_assert(alignof(CopyTextureForBrowserOptions) == alignof(WGPUCopyTextureForBrowserOptions), "alignof mismatch for CopyTextureForBrowserOptions"); - - static_assert(offsetof(CopyTextureForBrowserOptions, nextInChain) == offsetof(WGPUCopyTextureForBrowserOptions, nextInChain), - "offsetof mismatch for CopyTextureForBrowserOptions::nextInChain"); - static_assert(offsetof(CopyTextureForBrowserOptions, flipY) == offsetof(WGPUCopyTextureForBrowserOptions, flipY), - "offsetof mismatch for CopyTextureForBrowserOptions::flipY"); - - // DeviceProperties - - static_assert(sizeof(DeviceProperties) == sizeof(WGPUDeviceProperties), "sizeof mismatch for DeviceProperties"); - static_assert(alignof(DeviceProperties) == alignof(WGPUDeviceProperties), "alignof mismatch for DeviceProperties"); - - static_assert(offsetof(DeviceProperties, textureCompressionBC) == offsetof(WGPUDeviceProperties, textureCompressionBC), - "offsetof mismatch for DeviceProperties::textureCompressionBC"); - static_assert(offsetof(DeviceProperties, shaderFloat16) == offsetof(WGPUDeviceProperties, shaderFloat16), - "offsetof mismatch for DeviceProperties::shaderFloat16"); - static_assert(offsetof(DeviceProperties, pipelineStatisticsQuery) == offsetof(WGPUDeviceProperties, pipelineStatisticsQuery), - "offsetof mismatch for DeviceProperties::pipelineStatisticsQuery"); - static_assert(offsetof(DeviceProperties, timestampQuery) == offsetof(WGPUDeviceProperties, timestampQuery), - "offsetof mismatch for DeviceProperties::timestampQuery"); - - // Extent3D - - static_assert(sizeof(Extent3D) == sizeof(WGPUExtent3D), "sizeof mismatch for Extent3D"); - static_assert(alignof(Extent3D) == alignof(WGPUExtent3D), "alignof mismatch for Extent3D"); - - static_assert(offsetof(Extent3D, width) == offsetof(WGPUExtent3D, width), - "offsetof mismatch for Extent3D::width"); - static_assert(offsetof(Extent3D, height) == offsetof(WGPUExtent3D, height), - "offsetof mismatch for Extent3D::height"); - static_assert(offsetof(Extent3D, depth) == offsetof(WGPUExtent3D, depth), - "offsetof mismatch for Extent3D::depth"); - - // FenceDescriptor - - static_assert(sizeof(FenceDescriptor) == sizeof(WGPUFenceDescriptor), "sizeof mismatch for FenceDescriptor"); - static_assert(alignof(FenceDescriptor) == alignof(WGPUFenceDescriptor), "alignof mismatch for FenceDescriptor"); - - static_assert(offsetof(FenceDescriptor, nextInChain) == offsetof(WGPUFenceDescriptor, nextInChain), - "offsetof mismatch for FenceDescriptor::nextInChain"); - static_assert(offsetof(FenceDescriptor, label) == offsetof(WGPUFenceDescriptor, label), - "offsetof mismatch for FenceDescriptor::label"); - static_assert(offsetof(FenceDescriptor, initialValue) == offsetof(WGPUFenceDescriptor, initialValue), - "offsetof mismatch for FenceDescriptor::initialValue"); - - // InstanceDescriptor - - static_assert(sizeof(InstanceDescriptor) == sizeof(WGPUInstanceDescriptor), "sizeof mismatch for InstanceDescriptor"); - static_assert(alignof(InstanceDescriptor) == alignof(WGPUInstanceDescriptor), "alignof mismatch for InstanceDescriptor"); - - static_assert(offsetof(InstanceDescriptor, nextInChain) == offsetof(WGPUInstanceDescriptor, nextInChain), - "offsetof mismatch for InstanceDescriptor::nextInChain"); - - // Origin3D - - static_assert(sizeof(Origin3D) == sizeof(WGPUOrigin3D), "sizeof mismatch for Origin3D"); - static_assert(alignof(Origin3D) == alignof(WGPUOrigin3D), "alignof mismatch for Origin3D"); - - static_assert(offsetof(Origin3D, x) == offsetof(WGPUOrigin3D, x), - "offsetof mismatch for Origin3D::x"); - static_assert(offsetof(Origin3D, y) == offsetof(WGPUOrigin3D, y), - "offsetof mismatch for Origin3D::y"); - static_assert(offsetof(Origin3D, z) == offsetof(WGPUOrigin3D, z), - "offsetof mismatch for Origin3D::z"); - - // PipelineLayoutDescriptor - - static_assert(sizeof(PipelineLayoutDescriptor) == sizeof(WGPUPipelineLayoutDescriptor), "sizeof mismatch for PipelineLayoutDescriptor"); - static_assert(alignof(PipelineLayoutDescriptor) == alignof(WGPUPipelineLayoutDescriptor), "alignof mismatch for PipelineLayoutDescriptor"); - - static_assert(offsetof(PipelineLayoutDescriptor, nextInChain) == offsetof(WGPUPipelineLayoutDescriptor, nextInChain), - "offsetof mismatch for PipelineLayoutDescriptor::nextInChain"); - static_assert(offsetof(PipelineLayoutDescriptor, label) == offsetof(WGPUPipelineLayoutDescriptor, label), - "offsetof mismatch for PipelineLayoutDescriptor::label"); - static_assert(offsetof(PipelineLayoutDescriptor, bindGroupLayoutCount) == offsetof(WGPUPipelineLayoutDescriptor, bindGroupLayoutCount), - "offsetof mismatch for PipelineLayoutDescriptor::bindGroupLayoutCount"); - static_assert(offsetof(PipelineLayoutDescriptor, bindGroupLayouts) == offsetof(WGPUPipelineLayoutDescriptor, bindGroupLayouts), - "offsetof mismatch for PipelineLayoutDescriptor::bindGroupLayouts"); - - // ProgrammableStageDescriptor - - static_assert(sizeof(ProgrammableStageDescriptor) == sizeof(WGPUProgrammableStageDescriptor), "sizeof mismatch for ProgrammableStageDescriptor"); - static_assert(alignof(ProgrammableStageDescriptor) == alignof(WGPUProgrammableStageDescriptor), "alignof mismatch for ProgrammableStageDescriptor"); - - static_assert(offsetof(ProgrammableStageDescriptor, nextInChain) == offsetof(WGPUProgrammableStageDescriptor, nextInChain), - "offsetof mismatch for ProgrammableStageDescriptor::nextInChain"); - static_assert(offsetof(ProgrammableStageDescriptor, module) == offsetof(WGPUProgrammableStageDescriptor, module), - "offsetof mismatch for ProgrammableStageDescriptor::module"); - static_assert(offsetof(ProgrammableStageDescriptor, entryPoint) == offsetof(WGPUProgrammableStageDescriptor, entryPoint), - "offsetof mismatch for ProgrammableStageDescriptor::entryPoint"); - - // QuerySetDescriptor - - static_assert(sizeof(QuerySetDescriptor) == sizeof(WGPUQuerySetDescriptor), "sizeof mismatch for QuerySetDescriptor"); - static_assert(alignof(QuerySetDescriptor) == alignof(WGPUQuerySetDescriptor), "alignof mismatch for QuerySetDescriptor"); - - static_assert(offsetof(QuerySetDescriptor, nextInChain) == offsetof(WGPUQuerySetDescriptor, nextInChain), - "offsetof mismatch for QuerySetDescriptor::nextInChain"); - static_assert(offsetof(QuerySetDescriptor, label) == offsetof(WGPUQuerySetDescriptor, label), - "offsetof mismatch for QuerySetDescriptor::label"); - static_assert(offsetof(QuerySetDescriptor, type) == offsetof(WGPUQuerySetDescriptor, type), - "offsetof mismatch for QuerySetDescriptor::type"); - static_assert(offsetof(QuerySetDescriptor, count) == offsetof(WGPUQuerySetDescriptor, count), - "offsetof mismatch for QuerySetDescriptor::count"); - static_assert(offsetof(QuerySetDescriptor, pipelineStatistics) == offsetof(WGPUQuerySetDescriptor, pipelineStatistics), - "offsetof mismatch for QuerySetDescriptor::pipelineStatistics"); - static_assert(offsetof(QuerySetDescriptor, pipelineStatisticsCount) == offsetof(WGPUQuerySetDescriptor, pipelineStatisticsCount), - "offsetof mismatch for QuerySetDescriptor::pipelineStatisticsCount"); - - // RasterizationStateDescriptor - - static_assert(sizeof(RasterizationStateDescriptor) == sizeof(WGPURasterizationStateDescriptor), "sizeof mismatch for RasterizationStateDescriptor"); - static_assert(alignof(RasterizationStateDescriptor) == alignof(WGPURasterizationStateDescriptor), "alignof mismatch for RasterizationStateDescriptor"); - - static_assert(offsetof(RasterizationStateDescriptor, nextInChain) == offsetof(WGPURasterizationStateDescriptor, nextInChain), - "offsetof mismatch for RasterizationStateDescriptor::nextInChain"); - static_assert(offsetof(RasterizationStateDescriptor, frontFace) == offsetof(WGPURasterizationStateDescriptor, frontFace), - "offsetof mismatch for RasterizationStateDescriptor::frontFace"); - static_assert(offsetof(RasterizationStateDescriptor, cullMode) == offsetof(WGPURasterizationStateDescriptor, cullMode), - "offsetof mismatch for RasterizationStateDescriptor::cullMode"); - static_assert(offsetof(RasterizationStateDescriptor, depthBias) == offsetof(WGPURasterizationStateDescriptor, depthBias), - "offsetof mismatch for RasterizationStateDescriptor::depthBias"); - static_assert(offsetof(RasterizationStateDescriptor, depthBiasSlopeScale) == offsetof(WGPURasterizationStateDescriptor, depthBiasSlopeScale), - "offsetof mismatch for RasterizationStateDescriptor::depthBiasSlopeScale"); - static_assert(offsetof(RasterizationStateDescriptor, depthBiasClamp) == offsetof(WGPURasterizationStateDescriptor, depthBiasClamp), - "offsetof mismatch for RasterizationStateDescriptor::depthBiasClamp"); - - // RenderBundleDescriptor - - static_assert(sizeof(RenderBundleDescriptor) == sizeof(WGPURenderBundleDescriptor), "sizeof mismatch for RenderBundleDescriptor"); - static_assert(alignof(RenderBundleDescriptor) == alignof(WGPURenderBundleDescriptor), "alignof mismatch for RenderBundleDescriptor"); - - static_assert(offsetof(RenderBundleDescriptor, nextInChain) == offsetof(WGPURenderBundleDescriptor, nextInChain), - "offsetof mismatch for RenderBundleDescriptor::nextInChain"); - static_assert(offsetof(RenderBundleDescriptor, label) == offsetof(WGPURenderBundleDescriptor, label), - "offsetof mismatch for RenderBundleDescriptor::label"); - - // RenderBundleEncoderDescriptor - - static_assert(sizeof(RenderBundleEncoderDescriptor) == sizeof(WGPURenderBundleEncoderDescriptor), "sizeof mismatch for RenderBundleEncoderDescriptor"); - static_assert(alignof(RenderBundleEncoderDescriptor) == alignof(WGPURenderBundleEncoderDescriptor), "alignof mismatch for RenderBundleEncoderDescriptor"); - - static_assert(offsetof(RenderBundleEncoderDescriptor, nextInChain) == offsetof(WGPURenderBundleEncoderDescriptor, nextInChain), - "offsetof mismatch for RenderBundleEncoderDescriptor::nextInChain"); - static_assert(offsetof(RenderBundleEncoderDescriptor, label) == offsetof(WGPURenderBundleEncoderDescriptor, label), - "offsetof mismatch for RenderBundleEncoderDescriptor::label"); - static_assert(offsetof(RenderBundleEncoderDescriptor, colorFormatsCount) == offsetof(WGPURenderBundleEncoderDescriptor, colorFormatsCount), - "offsetof mismatch for RenderBundleEncoderDescriptor::colorFormatsCount"); - static_assert(offsetof(RenderBundleEncoderDescriptor, colorFormats) == offsetof(WGPURenderBundleEncoderDescriptor, colorFormats), - "offsetof mismatch for RenderBundleEncoderDescriptor::colorFormats"); - static_assert(offsetof(RenderBundleEncoderDescriptor, depthStencilFormat) == offsetof(WGPURenderBundleEncoderDescriptor, depthStencilFormat), - "offsetof mismatch for RenderBundleEncoderDescriptor::depthStencilFormat"); - static_assert(offsetof(RenderBundleEncoderDescriptor, sampleCount) == offsetof(WGPURenderBundleEncoderDescriptor, sampleCount), - "offsetof mismatch for RenderBundleEncoderDescriptor::sampleCount"); - - // RenderPassDepthStencilAttachmentDescriptor - - static_assert(sizeof(RenderPassDepthStencilAttachmentDescriptor) == sizeof(WGPURenderPassDepthStencilAttachmentDescriptor), "sizeof mismatch for RenderPassDepthStencilAttachmentDescriptor"); - static_assert(alignof(RenderPassDepthStencilAttachmentDescriptor) == alignof(WGPURenderPassDepthStencilAttachmentDescriptor), "alignof mismatch for RenderPassDepthStencilAttachmentDescriptor"); - - static_assert(offsetof(RenderPassDepthStencilAttachmentDescriptor, attachment) == offsetof(WGPURenderPassDepthStencilAttachmentDescriptor, attachment), - "offsetof mismatch for RenderPassDepthStencilAttachmentDescriptor::attachment"); - static_assert(offsetof(RenderPassDepthStencilAttachmentDescriptor, depthLoadOp) == offsetof(WGPURenderPassDepthStencilAttachmentDescriptor, depthLoadOp), - "offsetof mismatch for RenderPassDepthStencilAttachmentDescriptor::depthLoadOp"); - static_assert(offsetof(RenderPassDepthStencilAttachmentDescriptor, depthStoreOp) == offsetof(WGPURenderPassDepthStencilAttachmentDescriptor, depthStoreOp), - "offsetof mismatch for RenderPassDepthStencilAttachmentDescriptor::depthStoreOp"); - static_assert(offsetof(RenderPassDepthStencilAttachmentDescriptor, clearDepth) == offsetof(WGPURenderPassDepthStencilAttachmentDescriptor, clearDepth), - "offsetof mismatch for RenderPassDepthStencilAttachmentDescriptor::clearDepth"); - static_assert(offsetof(RenderPassDepthStencilAttachmentDescriptor, depthReadOnly) == offsetof(WGPURenderPassDepthStencilAttachmentDescriptor, depthReadOnly), - "offsetof mismatch for RenderPassDepthStencilAttachmentDescriptor::depthReadOnly"); - static_assert(offsetof(RenderPassDepthStencilAttachmentDescriptor, stencilLoadOp) == offsetof(WGPURenderPassDepthStencilAttachmentDescriptor, stencilLoadOp), - "offsetof mismatch for RenderPassDepthStencilAttachmentDescriptor::stencilLoadOp"); - static_assert(offsetof(RenderPassDepthStencilAttachmentDescriptor, stencilStoreOp) == offsetof(WGPURenderPassDepthStencilAttachmentDescriptor, stencilStoreOp), - "offsetof mismatch for RenderPassDepthStencilAttachmentDescriptor::stencilStoreOp"); - static_assert(offsetof(RenderPassDepthStencilAttachmentDescriptor, clearStencil) == offsetof(WGPURenderPassDepthStencilAttachmentDescriptor, clearStencil), - "offsetof mismatch for RenderPassDepthStencilAttachmentDescriptor::clearStencil"); - static_assert(offsetof(RenderPassDepthStencilAttachmentDescriptor, stencilReadOnly) == offsetof(WGPURenderPassDepthStencilAttachmentDescriptor, stencilReadOnly), - "offsetof mismatch for RenderPassDepthStencilAttachmentDescriptor::stencilReadOnly"); - - // SamplerBindingLayout - - static_assert(sizeof(SamplerBindingLayout) == sizeof(WGPUSamplerBindingLayout), "sizeof mismatch for SamplerBindingLayout"); - static_assert(alignof(SamplerBindingLayout) == alignof(WGPUSamplerBindingLayout), "alignof mismatch for SamplerBindingLayout"); - - static_assert(offsetof(SamplerBindingLayout, nextInChain) == offsetof(WGPUSamplerBindingLayout, nextInChain), - "offsetof mismatch for SamplerBindingLayout::nextInChain"); - static_assert(offsetof(SamplerBindingLayout, type) == offsetof(WGPUSamplerBindingLayout, type), - "offsetof mismatch for SamplerBindingLayout::type"); - - // SamplerDescriptor - - static_assert(sizeof(SamplerDescriptor) == sizeof(WGPUSamplerDescriptor), "sizeof mismatch for SamplerDescriptor"); - static_assert(alignof(SamplerDescriptor) == alignof(WGPUSamplerDescriptor), "alignof mismatch for SamplerDescriptor"); - - static_assert(offsetof(SamplerDescriptor, nextInChain) == offsetof(WGPUSamplerDescriptor, nextInChain), - "offsetof mismatch for SamplerDescriptor::nextInChain"); - static_assert(offsetof(SamplerDescriptor, label) == offsetof(WGPUSamplerDescriptor, label), - "offsetof mismatch for SamplerDescriptor::label"); - static_assert(offsetof(SamplerDescriptor, addressModeU) == offsetof(WGPUSamplerDescriptor, addressModeU), - "offsetof mismatch for SamplerDescriptor::addressModeU"); - static_assert(offsetof(SamplerDescriptor, addressModeV) == offsetof(WGPUSamplerDescriptor, addressModeV), - "offsetof mismatch for SamplerDescriptor::addressModeV"); - static_assert(offsetof(SamplerDescriptor, addressModeW) == offsetof(WGPUSamplerDescriptor, addressModeW), - "offsetof mismatch for SamplerDescriptor::addressModeW"); - static_assert(offsetof(SamplerDescriptor, magFilter) == offsetof(WGPUSamplerDescriptor, magFilter), - "offsetof mismatch for SamplerDescriptor::magFilter"); - static_assert(offsetof(SamplerDescriptor, minFilter) == offsetof(WGPUSamplerDescriptor, minFilter), - "offsetof mismatch for SamplerDescriptor::minFilter"); - static_assert(offsetof(SamplerDescriptor, mipmapFilter) == offsetof(WGPUSamplerDescriptor, mipmapFilter), - "offsetof mismatch for SamplerDescriptor::mipmapFilter"); - static_assert(offsetof(SamplerDescriptor, lodMinClamp) == offsetof(WGPUSamplerDescriptor, lodMinClamp), - "offsetof mismatch for SamplerDescriptor::lodMinClamp"); - static_assert(offsetof(SamplerDescriptor, lodMaxClamp) == offsetof(WGPUSamplerDescriptor, lodMaxClamp), - "offsetof mismatch for SamplerDescriptor::lodMaxClamp"); - static_assert(offsetof(SamplerDescriptor, compare) == offsetof(WGPUSamplerDescriptor, compare), - "offsetof mismatch for SamplerDescriptor::compare"); - static_assert(offsetof(SamplerDescriptor, maxAnisotropy) == offsetof(WGPUSamplerDescriptor, maxAnisotropy), - "offsetof mismatch for SamplerDescriptor::maxAnisotropy"); - - // SamplerDescriptorDummyAnisotropicFiltering - - static_assert(sizeof(SamplerDescriptorDummyAnisotropicFiltering) == sizeof(WGPUSamplerDescriptorDummyAnisotropicFiltering), "sizeof mismatch for SamplerDescriptorDummyAnisotropicFiltering"); - static_assert(alignof(SamplerDescriptorDummyAnisotropicFiltering) == alignof(WGPUSamplerDescriptorDummyAnisotropicFiltering), "alignof mismatch for SamplerDescriptorDummyAnisotropicFiltering"); - - static_assert(offsetof(SamplerDescriptorDummyAnisotropicFiltering, maxAnisotropy) == offsetof(WGPUSamplerDescriptorDummyAnisotropicFiltering, maxAnisotropy), - "offsetof mismatch for SamplerDescriptorDummyAnisotropicFiltering::maxAnisotropy"); - - // ShaderModuleDescriptor - - static_assert(sizeof(ShaderModuleDescriptor) == sizeof(WGPUShaderModuleDescriptor), "sizeof mismatch for ShaderModuleDescriptor"); - static_assert(alignof(ShaderModuleDescriptor) == alignof(WGPUShaderModuleDescriptor), "alignof mismatch for ShaderModuleDescriptor"); - - static_assert(offsetof(ShaderModuleDescriptor, nextInChain) == offsetof(WGPUShaderModuleDescriptor, nextInChain), - "offsetof mismatch for ShaderModuleDescriptor::nextInChain"); - static_assert(offsetof(ShaderModuleDescriptor, label) == offsetof(WGPUShaderModuleDescriptor, label), - "offsetof mismatch for ShaderModuleDescriptor::label"); - - // ShaderModuleSPIRVDescriptor - - static_assert(sizeof(ShaderModuleSPIRVDescriptor) == sizeof(WGPUShaderModuleSPIRVDescriptor), "sizeof mismatch for ShaderModuleSPIRVDescriptor"); - static_assert(alignof(ShaderModuleSPIRVDescriptor) == alignof(WGPUShaderModuleSPIRVDescriptor), "alignof mismatch for ShaderModuleSPIRVDescriptor"); - - static_assert(offsetof(ShaderModuleSPIRVDescriptor, codeSize) == offsetof(WGPUShaderModuleSPIRVDescriptor, codeSize), - "offsetof mismatch for ShaderModuleSPIRVDescriptor::codeSize"); - static_assert(offsetof(ShaderModuleSPIRVDescriptor, code) == offsetof(WGPUShaderModuleSPIRVDescriptor, code), - "offsetof mismatch for ShaderModuleSPIRVDescriptor::code"); - - // ShaderModuleWGSLDescriptor - - static_assert(sizeof(ShaderModuleWGSLDescriptor) == sizeof(WGPUShaderModuleWGSLDescriptor), "sizeof mismatch for ShaderModuleWGSLDescriptor"); - static_assert(alignof(ShaderModuleWGSLDescriptor) == alignof(WGPUShaderModuleWGSLDescriptor), "alignof mismatch for ShaderModuleWGSLDescriptor"); - - static_assert(offsetof(ShaderModuleWGSLDescriptor, source) == offsetof(WGPUShaderModuleWGSLDescriptor, source), - "offsetof mismatch for ShaderModuleWGSLDescriptor::source"); - - // StencilStateFaceDescriptor - - static_assert(sizeof(StencilStateFaceDescriptor) == sizeof(WGPUStencilStateFaceDescriptor), "sizeof mismatch for StencilStateFaceDescriptor"); - static_assert(alignof(StencilStateFaceDescriptor) == alignof(WGPUStencilStateFaceDescriptor), "alignof mismatch for StencilStateFaceDescriptor"); - - static_assert(offsetof(StencilStateFaceDescriptor, compare) == offsetof(WGPUStencilStateFaceDescriptor, compare), - "offsetof mismatch for StencilStateFaceDescriptor::compare"); - static_assert(offsetof(StencilStateFaceDescriptor, failOp) == offsetof(WGPUStencilStateFaceDescriptor, failOp), - "offsetof mismatch for StencilStateFaceDescriptor::failOp"); - static_assert(offsetof(StencilStateFaceDescriptor, depthFailOp) == offsetof(WGPUStencilStateFaceDescriptor, depthFailOp), - "offsetof mismatch for StencilStateFaceDescriptor::depthFailOp"); - static_assert(offsetof(StencilStateFaceDescriptor, passOp) == offsetof(WGPUStencilStateFaceDescriptor, passOp), - "offsetof mismatch for StencilStateFaceDescriptor::passOp"); - - // StorageTextureBindingLayout - - static_assert(sizeof(StorageTextureBindingLayout) == sizeof(WGPUStorageTextureBindingLayout), "sizeof mismatch for StorageTextureBindingLayout"); - static_assert(alignof(StorageTextureBindingLayout) == alignof(WGPUStorageTextureBindingLayout), "alignof mismatch for StorageTextureBindingLayout"); - - static_assert(offsetof(StorageTextureBindingLayout, nextInChain) == offsetof(WGPUStorageTextureBindingLayout, nextInChain), - "offsetof mismatch for StorageTextureBindingLayout::nextInChain"); - static_assert(offsetof(StorageTextureBindingLayout, access) == offsetof(WGPUStorageTextureBindingLayout, access), - "offsetof mismatch for StorageTextureBindingLayout::access"); - static_assert(offsetof(StorageTextureBindingLayout, format) == offsetof(WGPUStorageTextureBindingLayout, format), - "offsetof mismatch for StorageTextureBindingLayout::format"); - static_assert(offsetof(StorageTextureBindingLayout, viewDimension) == offsetof(WGPUStorageTextureBindingLayout, viewDimension), - "offsetof mismatch for StorageTextureBindingLayout::viewDimension"); - - // SurfaceDescriptor - - static_assert(sizeof(SurfaceDescriptor) == sizeof(WGPUSurfaceDescriptor), "sizeof mismatch for SurfaceDescriptor"); - static_assert(alignof(SurfaceDescriptor) == alignof(WGPUSurfaceDescriptor), "alignof mismatch for SurfaceDescriptor"); - - static_assert(offsetof(SurfaceDescriptor, nextInChain) == offsetof(WGPUSurfaceDescriptor, nextInChain), - "offsetof mismatch for SurfaceDescriptor::nextInChain"); - static_assert(offsetof(SurfaceDescriptor, label) == offsetof(WGPUSurfaceDescriptor, label), - "offsetof mismatch for SurfaceDescriptor::label"); - - // SurfaceDescriptorFromCanvasHTMLSelector - - static_assert(sizeof(SurfaceDescriptorFromCanvasHTMLSelector) == sizeof(WGPUSurfaceDescriptorFromCanvasHTMLSelector), "sizeof mismatch for SurfaceDescriptorFromCanvasHTMLSelector"); - static_assert(alignof(SurfaceDescriptorFromCanvasHTMLSelector) == alignof(WGPUSurfaceDescriptorFromCanvasHTMLSelector), "alignof mismatch for SurfaceDescriptorFromCanvasHTMLSelector"); - - static_assert(offsetof(SurfaceDescriptorFromCanvasHTMLSelector, selector) == offsetof(WGPUSurfaceDescriptorFromCanvasHTMLSelector, selector), - "offsetof mismatch for SurfaceDescriptorFromCanvasHTMLSelector::selector"); - - // SurfaceDescriptorFromMetalLayer - - static_assert(sizeof(SurfaceDescriptorFromMetalLayer) == sizeof(WGPUSurfaceDescriptorFromMetalLayer), "sizeof mismatch for SurfaceDescriptorFromMetalLayer"); - static_assert(alignof(SurfaceDescriptorFromMetalLayer) == alignof(WGPUSurfaceDescriptorFromMetalLayer), "alignof mismatch for SurfaceDescriptorFromMetalLayer"); - - static_assert(offsetof(SurfaceDescriptorFromMetalLayer, layer) == offsetof(WGPUSurfaceDescriptorFromMetalLayer, layer), - "offsetof mismatch for SurfaceDescriptorFromMetalLayer::layer"); - - // SurfaceDescriptorFromWindowsHWND - - static_assert(sizeof(SurfaceDescriptorFromWindowsHWND) == sizeof(WGPUSurfaceDescriptorFromWindowsHWND), "sizeof mismatch for SurfaceDescriptorFromWindowsHWND"); - static_assert(alignof(SurfaceDescriptorFromWindowsHWND) == alignof(WGPUSurfaceDescriptorFromWindowsHWND), "alignof mismatch for SurfaceDescriptorFromWindowsHWND"); - - static_assert(offsetof(SurfaceDescriptorFromWindowsHWND, hinstance) == offsetof(WGPUSurfaceDescriptorFromWindowsHWND, hinstance), - "offsetof mismatch for SurfaceDescriptorFromWindowsHWND::hinstance"); - static_assert(offsetof(SurfaceDescriptorFromWindowsHWND, hwnd) == offsetof(WGPUSurfaceDescriptorFromWindowsHWND, hwnd), - "offsetof mismatch for SurfaceDescriptorFromWindowsHWND::hwnd"); - - // SurfaceDescriptorFromXlib - - static_assert(sizeof(SurfaceDescriptorFromXlib) == sizeof(WGPUSurfaceDescriptorFromXlib), "sizeof mismatch for SurfaceDescriptorFromXlib"); - static_assert(alignof(SurfaceDescriptorFromXlib) == alignof(WGPUSurfaceDescriptorFromXlib), "alignof mismatch for SurfaceDescriptorFromXlib"); - - static_assert(offsetof(SurfaceDescriptorFromXlib, display) == offsetof(WGPUSurfaceDescriptorFromXlib, display), - "offsetof mismatch for SurfaceDescriptorFromXlib::display"); - static_assert(offsetof(SurfaceDescriptorFromXlib, window) == offsetof(WGPUSurfaceDescriptorFromXlib, window), - "offsetof mismatch for SurfaceDescriptorFromXlib::window"); - - // SwapChainDescriptor - - static_assert(sizeof(SwapChainDescriptor) == sizeof(WGPUSwapChainDescriptor), "sizeof mismatch for SwapChainDescriptor"); - static_assert(alignof(SwapChainDescriptor) == alignof(WGPUSwapChainDescriptor), "alignof mismatch for SwapChainDescriptor"); - - static_assert(offsetof(SwapChainDescriptor, nextInChain) == offsetof(WGPUSwapChainDescriptor, nextInChain), - "offsetof mismatch for SwapChainDescriptor::nextInChain"); - static_assert(offsetof(SwapChainDescriptor, label) == offsetof(WGPUSwapChainDescriptor, label), - "offsetof mismatch for SwapChainDescriptor::label"); - static_assert(offsetof(SwapChainDescriptor, usage) == offsetof(WGPUSwapChainDescriptor, usage), - "offsetof mismatch for SwapChainDescriptor::usage"); - static_assert(offsetof(SwapChainDescriptor, format) == offsetof(WGPUSwapChainDescriptor, format), - "offsetof mismatch for SwapChainDescriptor::format"); - static_assert(offsetof(SwapChainDescriptor, width) == offsetof(WGPUSwapChainDescriptor, width), - "offsetof mismatch for SwapChainDescriptor::width"); - static_assert(offsetof(SwapChainDescriptor, height) == offsetof(WGPUSwapChainDescriptor, height), - "offsetof mismatch for SwapChainDescriptor::height"); - static_assert(offsetof(SwapChainDescriptor, presentMode) == offsetof(WGPUSwapChainDescriptor, presentMode), - "offsetof mismatch for SwapChainDescriptor::presentMode"); - static_assert(offsetof(SwapChainDescriptor, implementation) == offsetof(WGPUSwapChainDescriptor, implementation), - "offsetof mismatch for SwapChainDescriptor::implementation"); - - // TextureBindingLayout - - static_assert(sizeof(TextureBindingLayout) == sizeof(WGPUTextureBindingLayout), "sizeof mismatch for TextureBindingLayout"); - static_assert(alignof(TextureBindingLayout) == alignof(WGPUTextureBindingLayout), "alignof mismatch for TextureBindingLayout"); - - static_assert(offsetof(TextureBindingLayout, nextInChain) == offsetof(WGPUTextureBindingLayout, nextInChain), - "offsetof mismatch for TextureBindingLayout::nextInChain"); - static_assert(offsetof(TextureBindingLayout, sampleType) == offsetof(WGPUTextureBindingLayout, sampleType), - "offsetof mismatch for TextureBindingLayout::sampleType"); - static_assert(offsetof(TextureBindingLayout, viewDimension) == offsetof(WGPUTextureBindingLayout, viewDimension), - "offsetof mismatch for TextureBindingLayout::viewDimension"); - static_assert(offsetof(TextureBindingLayout, multisampled) == offsetof(WGPUTextureBindingLayout, multisampled), - "offsetof mismatch for TextureBindingLayout::multisampled"); - - // TextureDataLayout - - static_assert(sizeof(TextureDataLayout) == sizeof(WGPUTextureDataLayout), "sizeof mismatch for TextureDataLayout"); - static_assert(alignof(TextureDataLayout) == alignof(WGPUTextureDataLayout), "alignof mismatch for TextureDataLayout"); - - static_assert(offsetof(TextureDataLayout, nextInChain) == offsetof(WGPUTextureDataLayout, nextInChain), - "offsetof mismatch for TextureDataLayout::nextInChain"); - static_assert(offsetof(TextureDataLayout, offset) == offsetof(WGPUTextureDataLayout, offset), - "offsetof mismatch for TextureDataLayout::offset"); - static_assert(offsetof(TextureDataLayout, bytesPerRow) == offsetof(WGPUTextureDataLayout, bytesPerRow), - "offsetof mismatch for TextureDataLayout::bytesPerRow"); - static_assert(offsetof(TextureDataLayout, rowsPerImage) == offsetof(WGPUTextureDataLayout, rowsPerImage), - "offsetof mismatch for TextureDataLayout::rowsPerImage"); - - // TextureViewDescriptor - - static_assert(sizeof(TextureViewDescriptor) == sizeof(WGPUTextureViewDescriptor), "sizeof mismatch for TextureViewDescriptor"); - static_assert(alignof(TextureViewDescriptor) == alignof(WGPUTextureViewDescriptor), "alignof mismatch for TextureViewDescriptor"); - - static_assert(offsetof(TextureViewDescriptor, nextInChain) == offsetof(WGPUTextureViewDescriptor, nextInChain), - "offsetof mismatch for TextureViewDescriptor::nextInChain"); - static_assert(offsetof(TextureViewDescriptor, label) == offsetof(WGPUTextureViewDescriptor, label), - "offsetof mismatch for TextureViewDescriptor::label"); - static_assert(offsetof(TextureViewDescriptor, format) == offsetof(WGPUTextureViewDescriptor, format), - "offsetof mismatch for TextureViewDescriptor::format"); - static_assert(offsetof(TextureViewDescriptor, dimension) == offsetof(WGPUTextureViewDescriptor, dimension), - "offsetof mismatch for TextureViewDescriptor::dimension"); - static_assert(offsetof(TextureViewDescriptor, baseMipLevel) == offsetof(WGPUTextureViewDescriptor, baseMipLevel), - "offsetof mismatch for TextureViewDescriptor::baseMipLevel"); - static_assert(offsetof(TextureViewDescriptor, mipLevelCount) == offsetof(WGPUTextureViewDescriptor, mipLevelCount), - "offsetof mismatch for TextureViewDescriptor::mipLevelCount"); - static_assert(offsetof(TextureViewDescriptor, baseArrayLayer) == offsetof(WGPUTextureViewDescriptor, baseArrayLayer), - "offsetof mismatch for TextureViewDescriptor::baseArrayLayer"); - static_assert(offsetof(TextureViewDescriptor, arrayLayerCount) == offsetof(WGPUTextureViewDescriptor, arrayLayerCount), - "offsetof mismatch for TextureViewDescriptor::arrayLayerCount"); - static_assert(offsetof(TextureViewDescriptor, aspect) == offsetof(WGPUTextureViewDescriptor, aspect), - "offsetof mismatch for TextureViewDescriptor::aspect"); - - // VertexAttributeDescriptor - - static_assert(sizeof(VertexAttributeDescriptor) == sizeof(WGPUVertexAttributeDescriptor), "sizeof mismatch for VertexAttributeDescriptor"); - static_assert(alignof(VertexAttributeDescriptor) == alignof(WGPUVertexAttributeDescriptor), "alignof mismatch for VertexAttributeDescriptor"); - - static_assert(offsetof(VertexAttributeDescriptor, format) == offsetof(WGPUVertexAttributeDescriptor, format), - "offsetof mismatch for VertexAttributeDescriptor::format"); - static_assert(offsetof(VertexAttributeDescriptor, offset) == offsetof(WGPUVertexAttributeDescriptor, offset), - "offsetof mismatch for VertexAttributeDescriptor::offset"); - static_assert(offsetof(VertexAttributeDescriptor, shaderLocation) == offsetof(WGPUVertexAttributeDescriptor, shaderLocation), - "offsetof mismatch for VertexAttributeDescriptor::shaderLocation"); - - // BindGroupDescriptor - - static_assert(sizeof(BindGroupDescriptor) == sizeof(WGPUBindGroupDescriptor), "sizeof mismatch for BindGroupDescriptor"); - static_assert(alignof(BindGroupDescriptor) == alignof(WGPUBindGroupDescriptor), "alignof mismatch for BindGroupDescriptor"); - - static_assert(offsetof(BindGroupDescriptor, nextInChain) == offsetof(WGPUBindGroupDescriptor, nextInChain), - "offsetof mismatch for BindGroupDescriptor::nextInChain"); - static_assert(offsetof(BindGroupDescriptor, label) == offsetof(WGPUBindGroupDescriptor, label), - "offsetof mismatch for BindGroupDescriptor::label"); - static_assert(offsetof(BindGroupDescriptor, layout) == offsetof(WGPUBindGroupDescriptor, layout), - "offsetof mismatch for BindGroupDescriptor::layout"); - static_assert(offsetof(BindGroupDescriptor, entryCount) == offsetof(WGPUBindGroupDescriptor, entryCount), - "offsetof mismatch for BindGroupDescriptor::entryCount"); - static_assert(offsetof(BindGroupDescriptor, entries) == offsetof(WGPUBindGroupDescriptor, entries), - "offsetof mismatch for BindGroupDescriptor::entries"); - - // BindGroupLayoutEntry - - static_assert(sizeof(BindGroupLayoutEntry) == sizeof(WGPUBindGroupLayoutEntry), "sizeof mismatch for BindGroupLayoutEntry"); - static_assert(alignof(BindGroupLayoutEntry) == alignof(WGPUBindGroupLayoutEntry), "alignof mismatch for BindGroupLayoutEntry"); - - static_assert(offsetof(BindGroupLayoutEntry, binding) == offsetof(WGPUBindGroupLayoutEntry, binding), - "offsetof mismatch for BindGroupLayoutEntry::binding"); - static_assert(offsetof(BindGroupLayoutEntry, visibility) == offsetof(WGPUBindGroupLayoutEntry, visibility), - "offsetof mismatch for BindGroupLayoutEntry::visibility"); - static_assert(offsetof(BindGroupLayoutEntry, type) == offsetof(WGPUBindGroupLayoutEntry, type), - "offsetof mismatch for BindGroupLayoutEntry::type"); - static_assert(offsetof(BindGroupLayoutEntry, hasDynamicOffset) == offsetof(WGPUBindGroupLayoutEntry, hasDynamicOffset), - "offsetof mismatch for BindGroupLayoutEntry::hasDynamicOffset"); - static_assert(offsetof(BindGroupLayoutEntry, minBufferBindingSize) == offsetof(WGPUBindGroupLayoutEntry, minBufferBindingSize), - "offsetof mismatch for BindGroupLayoutEntry::minBufferBindingSize"); - static_assert(offsetof(BindGroupLayoutEntry, viewDimension) == offsetof(WGPUBindGroupLayoutEntry, viewDimension), - "offsetof mismatch for BindGroupLayoutEntry::viewDimension"); - static_assert(offsetof(BindGroupLayoutEntry, textureComponentType) == offsetof(WGPUBindGroupLayoutEntry, textureComponentType), - "offsetof mismatch for BindGroupLayoutEntry::textureComponentType"); - static_assert(offsetof(BindGroupLayoutEntry, storageTextureFormat) == offsetof(WGPUBindGroupLayoutEntry, storageTextureFormat), - "offsetof mismatch for BindGroupLayoutEntry::storageTextureFormat"); - static_assert(offsetof(BindGroupLayoutEntry, buffer) == offsetof(WGPUBindGroupLayoutEntry, buffer), - "offsetof mismatch for BindGroupLayoutEntry::buffer"); - static_assert(offsetof(BindGroupLayoutEntry, sampler) == offsetof(WGPUBindGroupLayoutEntry, sampler), - "offsetof mismatch for BindGroupLayoutEntry::sampler"); - static_assert(offsetof(BindGroupLayoutEntry, texture) == offsetof(WGPUBindGroupLayoutEntry, texture), - "offsetof mismatch for BindGroupLayoutEntry::texture"); - static_assert(offsetof(BindGroupLayoutEntry, storageTexture) == offsetof(WGPUBindGroupLayoutEntry, storageTexture), - "offsetof mismatch for BindGroupLayoutEntry::storageTexture"); - - // BufferCopyView - - static_assert(sizeof(BufferCopyView) == sizeof(WGPUBufferCopyView), "sizeof mismatch for BufferCopyView"); - static_assert(alignof(BufferCopyView) == alignof(WGPUBufferCopyView), "alignof mismatch for BufferCopyView"); - - static_assert(offsetof(BufferCopyView, nextInChain) == offsetof(WGPUBufferCopyView, nextInChain), - "offsetof mismatch for BufferCopyView::nextInChain"); - static_assert(offsetof(BufferCopyView, layout) == offsetof(WGPUBufferCopyView, layout), - "offsetof mismatch for BufferCopyView::layout"); - static_assert(offsetof(BufferCopyView, buffer) == offsetof(WGPUBufferCopyView, buffer), - "offsetof mismatch for BufferCopyView::buffer"); - - // ColorStateDescriptor - - static_assert(sizeof(ColorStateDescriptor) == sizeof(WGPUColorStateDescriptor), "sizeof mismatch for ColorStateDescriptor"); - static_assert(alignof(ColorStateDescriptor) == alignof(WGPUColorStateDescriptor), "alignof mismatch for ColorStateDescriptor"); - - static_assert(offsetof(ColorStateDescriptor, nextInChain) == offsetof(WGPUColorStateDescriptor, nextInChain), - "offsetof mismatch for ColorStateDescriptor::nextInChain"); - static_assert(offsetof(ColorStateDescriptor, format) == offsetof(WGPUColorStateDescriptor, format), - "offsetof mismatch for ColorStateDescriptor::format"); - static_assert(offsetof(ColorStateDescriptor, alphaBlend) == offsetof(WGPUColorStateDescriptor, alphaBlend), - "offsetof mismatch for ColorStateDescriptor::alphaBlend"); - static_assert(offsetof(ColorStateDescriptor, colorBlend) == offsetof(WGPUColorStateDescriptor, colorBlend), - "offsetof mismatch for ColorStateDescriptor::colorBlend"); - static_assert(offsetof(ColorStateDescriptor, writeMask) == offsetof(WGPUColorStateDescriptor, writeMask), - "offsetof mismatch for ColorStateDescriptor::writeMask"); - - // ComputePipelineDescriptor - - static_assert(sizeof(ComputePipelineDescriptor) == sizeof(WGPUComputePipelineDescriptor), "sizeof mismatch for ComputePipelineDescriptor"); - static_assert(alignof(ComputePipelineDescriptor) == alignof(WGPUComputePipelineDescriptor), "alignof mismatch for ComputePipelineDescriptor"); - - static_assert(offsetof(ComputePipelineDescriptor, nextInChain) == offsetof(WGPUComputePipelineDescriptor, nextInChain), - "offsetof mismatch for ComputePipelineDescriptor::nextInChain"); - static_assert(offsetof(ComputePipelineDescriptor, label) == offsetof(WGPUComputePipelineDescriptor, label), - "offsetof mismatch for ComputePipelineDescriptor::label"); - static_assert(offsetof(ComputePipelineDescriptor, layout) == offsetof(WGPUComputePipelineDescriptor, layout), - "offsetof mismatch for ComputePipelineDescriptor::layout"); - static_assert(offsetof(ComputePipelineDescriptor, computeStage) == offsetof(WGPUComputePipelineDescriptor, computeStage), - "offsetof mismatch for ComputePipelineDescriptor::computeStage"); - - // DepthStencilStateDescriptor - - static_assert(sizeof(DepthStencilStateDescriptor) == sizeof(WGPUDepthStencilStateDescriptor), "sizeof mismatch for DepthStencilStateDescriptor"); - static_assert(alignof(DepthStencilStateDescriptor) == alignof(WGPUDepthStencilStateDescriptor), "alignof mismatch for DepthStencilStateDescriptor"); - - static_assert(offsetof(DepthStencilStateDescriptor, nextInChain) == offsetof(WGPUDepthStencilStateDescriptor, nextInChain), - "offsetof mismatch for DepthStencilStateDescriptor::nextInChain"); - static_assert(offsetof(DepthStencilStateDescriptor, format) == offsetof(WGPUDepthStencilStateDescriptor, format), - "offsetof mismatch for DepthStencilStateDescriptor::format"); - static_assert(offsetof(DepthStencilStateDescriptor, depthWriteEnabled) == offsetof(WGPUDepthStencilStateDescriptor, depthWriteEnabled), - "offsetof mismatch for DepthStencilStateDescriptor::depthWriteEnabled"); - static_assert(offsetof(DepthStencilStateDescriptor, depthCompare) == offsetof(WGPUDepthStencilStateDescriptor, depthCompare), - "offsetof mismatch for DepthStencilStateDescriptor::depthCompare"); - static_assert(offsetof(DepthStencilStateDescriptor, stencilFront) == offsetof(WGPUDepthStencilStateDescriptor, stencilFront), - "offsetof mismatch for DepthStencilStateDescriptor::stencilFront"); - static_assert(offsetof(DepthStencilStateDescriptor, stencilBack) == offsetof(WGPUDepthStencilStateDescriptor, stencilBack), - "offsetof mismatch for DepthStencilStateDescriptor::stencilBack"); - static_assert(offsetof(DepthStencilStateDescriptor, stencilReadMask) == offsetof(WGPUDepthStencilStateDescriptor, stencilReadMask), - "offsetof mismatch for DepthStencilStateDescriptor::stencilReadMask"); - static_assert(offsetof(DepthStencilStateDescriptor, stencilWriteMask) == offsetof(WGPUDepthStencilStateDescriptor, stencilWriteMask), - "offsetof mismatch for DepthStencilStateDescriptor::stencilWriteMask"); - - // RenderPassColorAttachmentDescriptor - - static_assert(sizeof(RenderPassColorAttachmentDescriptor) == sizeof(WGPURenderPassColorAttachmentDescriptor), "sizeof mismatch for RenderPassColorAttachmentDescriptor"); - static_assert(alignof(RenderPassColorAttachmentDescriptor) == alignof(WGPURenderPassColorAttachmentDescriptor), "alignof mismatch for RenderPassColorAttachmentDescriptor"); - - static_assert(offsetof(RenderPassColorAttachmentDescriptor, attachment) == offsetof(WGPURenderPassColorAttachmentDescriptor, attachment), - "offsetof mismatch for RenderPassColorAttachmentDescriptor::attachment"); - static_assert(offsetof(RenderPassColorAttachmentDescriptor, resolveTarget) == offsetof(WGPURenderPassColorAttachmentDescriptor, resolveTarget), - "offsetof mismatch for RenderPassColorAttachmentDescriptor::resolveTarget"); - static_assert(offsetof(RenderPassColorAttachmentDescriptor, loadOp) == offsetof(WGPURenderPassColorAttachmentDescriptor, loadOp), - "offsetof mismatch for RenderPassColorAttachmentDescriptor::loadOp"); - static_assert(offsetof(RenderPassColorAttachmentDescriptor, storeOp) == offsetof(WGPURenderPassColorAttachmentDescriptor, storeOp), - "offsetof mismatch for RenderPassColorAttachmentDescriptor::storeOp"); - static_assert(offsetof(RenderPassColorAttachmentDescriptor, clearColor) == offsetof(WGPURenderPassColorAttachmentDescriptor, clearColor), - "offsetof mismatch for RenderPassColorAttachmentDescriptor::clearColor"); - - // RenderPipelineDescriptorDummyExtension - - static_assert(sizeof(RenderPipelineDescriptorDummyExtension) == sizeof(WGPURenderPipelineDescriptorDummyExtension), "sizeof mismatch for RenderPipelineDescriptorDummyExtension"); - static_assert(alignof(RenderPipelineDescriptorDummyExtension) == alignof(WGPURenderPipelineDescriptorDummyExtension), "alignof mismatch for RenderPipelineDescriptorDummyExtension"); - - static_assert(offsetof(RenderPipelineDescriptorDummyExtension, dummyStage) == offsetof(WGPURenderPipelineDescriptorDummyExtension, dummyStage), - "offsetof mismatch for RenderPipelineDescriptorDummyExtension::dummyStage"); - - // TextureCopyView - - static_assert(sizeof(TextureCopyView) == sizeof(WGPUTextureCopyView), "sizeof mismatch for TextureCopyView"); - static_assert(alignof(TextureCopyView) == alignof(WGPUTextureCopyView), "alignof mismatch for TextureCopyView"); - - static_assert(offsetof(TextureCopyView, nextInChain) == offsetof(WGPUTextureCopyView, nextInChain), - "offsetof mismatch for TextureCopyView::nextInChain"); - static_assert(offsetof(TextureCopyView, texture) == offsetof(WGPUTextureCopyView, texture), - "offsetof mismatch for TextureCopyView::texture"); - static_assert(offsetof(TextureCopyView, mipLevel) == offsetof(WGPUTextureCopyView, mipLevel), - "offsetof mismatch for TextureCopyView::mipLevel"); - static_assert(offsetof(TextureCopyView, origin) == offsetof(WGPUTextureCopyView, origin), - "offsetof mismatch for TextureCopyView::origin"); - static_assert(offsetof(TextureCopyView, aspect) == offsetof(WGPUTextureCopyView, aspect), - "offsetof mismatch for TextureCopyView::aspect"); - - // TextureDescriptor - - static_assert(sizeof(TextureDescriptor) == sizeof(WGPUTextureDescriptor), "sizeof mismatch for TextureDescriptor"); - static_assert(alignof(TextureDescriptor) == alignof(WGPUTextureDescriptor), "alignof mismatch for TextureDescriptor"); - - static_assert(offsetof(TextureDescriptor, nextInChain) == offsetof(WGPUTextureDescriptor, nextInChain), - "offsetof mismatch for TextureDescriptor::nextInChain"); - static_assert(offsetof(TextureDescriptor, label) == offsetof(WGPUTextureDescriptor, label), - "offsetof mismatch for TextureDescriptor::label"); - static_assert(offsetof(TextureDescriptor, usage) == offsetof(WGPUTextureDescriptor, usage), - "offsetof mismatch for TextureDescriptor::usage"); - static_assert(offsetof(TextureDescriptor, dimension) == offsetof(WGPUTextureDescriptor, dimension), - "offsetof mismatch for TextureDescriptor::dimension"); - static_assert(offsetof(TextureDescriptor, size) == offsetof(WGPUTextureDescriptor, size), - "offsetof mismatch for TextureDescriptor::size"); - static_assert(offsetof(TextureDescriptor, format) == offsetof(WGPUTextureDescriptor, format), - "offsetof mismatch for TextureDescriptor::format"); - static_assert(offsetof(TextureDescriptor, mipLevelCount) == offsetof(WGPUTextureDescriptor, mipLevelCount), - "offsetof mismatch for TextureDescriptor::mipLevelCount"); - static_assert(offsetof(TextureDescriptor, sampleCount) == offsetof(WGPUTextureDescriptor, sampleCount), - "offsetof mismatch for TextureDescriptor::sampleCount"); - - // VertexBufferLayoutDescriptor - - static_assert(sizeof(VertexBufferLayoutDescriptor) == sizeof(WGPUVertexBufferLayoutDescriptor), "sizeof mismatch for VertexBufferLayoutDescriptor"); - static_assert(alignof(VertexBufferLayoutDescriptor) == alignof(WGPUVertexBufferLayoutDescriptor), "alignof mismatch for VertexBufferLayoutDescriptor"); - - static_assert(offsetof(VertexBufferLayoutDescriptor, arrayStride) == offsetof(WGPUVertexBufferLayoutDescriptor, arrayStride), - "offsetof mismatch for VertexBufferLayoutDescriptor::arrayStride"); - static_assert(offsetof(VertexBufferLayoutDescriptor, stepMode) == offsetof(WGPUVertexBufferLayoutDescriptor, stepMode), - "offsetof mismatch for VertexBufferLayoutDescriptor::stepMode"); - static_assert(offsetof(VertexBufferLayoutDescriptor, attributeCount) == offsetof(WGPUVertexBufferLayoutDescriptor, attributeCount), - "offsetof mismatch for VertexBufferLayoutDescriptor::attributeCount"); - static_assert(offsetof(VertexBufferLayoutDescriptor, attributes) == offsetof(WGPUVertexBufferLayoutDescriptor, attributes), - "offsetof mismatch for VertexBufferLayoutDescriptor::attributes"); - - // BindGroupLayoutDescriptor - - static_assert(sizeof(BindGroupLayoutDescriptor) == sizeof(WGPUBindGroupLayoutDescriptor), "sizeof mismatch for BindGroupLayoutDescriptor"); - static_assert(alignof(BindGroupLayoutDescriptor) == alignof(WGPUBindGroupLayoutDescriptor), "alignof mismatch for BindGroupLayoutDescriptor"); - - static_assert(offsetof(BindGroupLayoutDescriptor, nextInChain) == offsetof(WGPUBindGroupLayoutDescriptor, nextInChain), - "offsetof mismatch for BindGroupLayoutDescriptor::nextInChain"); - static_assert(offsetof(BindGroupLayoutDescriptor, label) == offsetof(WGPUBindGroupLayoutDescriptor, label), - "offsetof mismatch for BindGroupLayoutDescriptor::label"); - static_assert(offsetof(BindGroupLayoutDescriptor, entryCount) == offsetof(WGPUBindGroupLayoutDescriptor, entryCount), - "offsetof mismatch for BindGroupLayoutDescriptor::entryCount"); - static_assert(offsetof(BindGroupLayoutDescriptor, entries) == offsetof(WGPUBindGroupLayoutDescriptor, entries), - "offsetof mismatch for BindGroupLayoutDescriptor::entries"); - - // RenderPassDescriptor - - static_assert(sizeof(RenderPassDescriptor) == sizeof(WGPURenderPassDescriptor), "sizeof mismatch for RenderPassDescriptor"); - static_assert(alignof(RenderPassDescriptor) == alignof(WGPURenderPassDescriptor), "alignof mismatch for RenderPassDescriptor"); - - static_assert(offsetof(RenderPassDescriptor, nextInChain) == offsetof(WGPURenderPassDescriptor, nextInChain), - "offsetof mismatch for RenderPassDescriptor::nextInChain"); - static_assert(offsetof(RenderPassDescriptor, label) == offsetof(WGPURenderPassDescriptor, label), - "offsetof mismatch for RenderPassDescriptor::label"); - static_assert(offsetof(RenderPassDescriptor, colorAttachmentCount) == offsetof(WGPURenderPassDescriptor, colorAttachmentCount), - "offsetof mismatch for RenderPassDescriptor::colorAttachmentCount"); - static_assert(offsetof(RenderPassDescriptor, colorAttachments) == offsetof(WGPURenderPassDescriptor, colorAttachments), - "offsetof mismatch for RenderPassDescriptor::colorAttachments"); - static_assert(offsetof(RenderPassDescriptor, depthStencilAttachment) == offsetof(WGPURenderPassDescriptor, depthStencilAttachment), - "offsetof mismatch for RenderPassDescriptor::depthStencilAttachment"); - static_assert(offsetof(RenderPassDescriptor, occlusionQuerySet) == offsetof(WGPURenderPassDescriptor, occlusionQuerySet), - "offsetof mismatch for RenderPassDescriptor::occlusionQuerySet"); - - // VertexStateDescriptor - - static_assert(sizeof(VertexStateDescriptor) == sizeof(WGPUVertexStateDescriptor), "sizeof mismatch for VertexStateDescriptor"); - static_assert(alignof(VertexStateDescriptor) == alignof(WGPUVertexStateDescriptor), "alignof mismatch for VertexStateDescriptor"); - - static_assert(offsetof(VertexStateDescriptor, nextInChain) == offsetof(WGPUVertexStateDescriptor, nextInChain), - "offsetof mismatch for VertexStateDescriptor::nextInChain"); - static_assert(offsetof(VertexStateDescriptor, indexFormat) == offsetof(WGPUVertexStateDescriptor, indexFormat), - "offsetof mismatch for VertexStateDescriptor::indexFormat"); - static_assert(offsetof(VertexStateDescriptor, vertexBufferCount) == offsetof(WGPUVertexStateDescriptor, vertexBufferCount), - "offsetof mismatch for VertexStateDescriptor::vertexBufferCount"); - static_assert(offsetof(VertexStateDescriptor, vertexBuffers) == offsetof(WGPUVertexStateDescriptor, vertexBuffers), - "offsetof mismatch for VertexStateDescriptor::vertexBuffers"); - - // RenderPipelineDescriptor - - static_assert(sizeof(RenderPipelineDescriptor) == sizeof(WGPURenderPipelineDescriptor), "sizeof mismatch for RenderPipelineDescriptor"); - static_assert(alignof(RenderPipelineDescriptor) == alignof(WGPURenderPipelineDescriptor), "alignof mismatch for RenderPipelineDescriptor"); - - static_assert(offsetof(RenderPipelineDescriptor, nextInChain) == offsetof(WGPURenderPipelineDescriptor, nextInChain), - "offsetof mismatch for RenderPipelineDescriptor::nextInChain"); - static_assert(offsetof(RenderPipelineDescriptor, label) == offsetof(WGPURenderPipelineDescriptor, label), - "offsetof mismatch for RenderPipelineDescriptor::label"); - static_assert(offsetof(RenderPipelineDescriptor, layout) == offsetof(WGPURenderPipelineDescriptor, layout), - "offsetof mismatch for RenderPipelineDescriptor::layout"); - static_assert(offsetof(RenderPipelineDescriptor, vertexStage) == offsetof(WGPURenderPipelineDescriptor, vertexStage), - "offsetof mismatch for RenderPipelineDescriptor::vertexStage"); - static_assert(offsetof(RenderPipelineDescriptor, fragmentStage) == offsetof(WGPURenderPipelineDescriptor, fragmentStage), - "offsetof mismatch for RenderPipelineDescriptor::fragmentStage"); - static_assert(offsetof(RenderPipelineDescriptor, vertexState) == offsetof(WGPURenderPipelineDescriptor, vertexState), - "offsetof mismatch for RenderPipelineDescriptor::vertexState"); - static_assert(offsetof(RenderPipelineDescriptor, primitiveTopology) == offsetof(WGPURenderPipelineDescriptor, primitiveTopology), - "offsetof mismatch for RenderPipelineDescriptor::primitiveTopology"); - static_assert(offsetof(RenderPipelineDescriptor, rasterizationState) == offsetof(WGPURenderPipelineDescriptor, rasterizationState), - "offsetof mismatch for RenderPipelineDescriptor::rasterizationState"); - static_assert(offsetof(RenderPipelineDescriptor, sampleCount) == offsetof(WGPURenderPipelineDescriptor, sampleCount), - "offsetof mismatch for RenderPipelineDescriptor::sampleCount"); - static_assert(offsetof(RenderPipelineDescriptor, depthStencilState) == offsetof(WGPURenderPipelineDescriptor, depthStencilState), - "offsetof mismatch for RenderPipelineDescriptor::depthStencilState"); - static_assert(offsetof(RenderPipelineDescriptor, colorStateCount) == offsetof(WGPURenderPipelineDescriptor, colorStateCount), - "offsetof mismatch for RenderPipelineDescriptor::colorStateCount"); - static_assert(offsetof(RenderPipelineDescriptor, colorStates) == offsetof(WGPURenderPipelineDescriptor, colorStates), - "offsetof mismatch for RenderPipelineDescriptor::colorStates"); - static_assert(offsetof(RenderPipelineDescriptor, sampleMask) == offsetof(WGPURenderPipelineDescriptor, sampleMask), - "offsetof mismatch for RenderPipelineDescriptor::sampleMask"); - static_assert(offsetof(RenderPipelineDescriptor, alphaToCoverageEnabled) == offsetof(WGPURenderPipelineDescriptor, alphaToCoverageEnabled), - "offsetof mismatch for RenderPipelineDescriptor::alphaToCoverageEnabled"); - - // BindGroup - - static_assert(sizeof(BindGroup) == sizeof(WGPUBindGroup), "sizeof mismatch for BindGroup"); - static_assert(alignof(BindGroup) == alignof(WGPUBindGroup), "alignof mismatch for BindGroup"); - - void BindGroup::WGPUReference(WGPUBindGroup handle) { - if (handle != nullptr) { - wgpuBindGroupReference(handle); - } - } - void BindGroup::WGPURelease(WGPUBindGroup handle) { - if (handle != nullptr) { - wgpuBindGroupRelease(handle); - } - } - - // BindGroupLayout - - static_assert(sizeof(BindGroupLayout) == sizeof(WGPUBindGroupLayout), "sizeof mismatch for BindGroupLayout"); - static_assert(alignof(BindGroupLayout) == alignof(WGPUBindGroupLayout), "alignof mismatch for BindGroupLayout"); - - void BindGroupLayout::WGPUReference(WGPUBindGroupLayout handle) { - if (handle != nullptr) { - wgpuBindGroupLayoutReference(handle); - } - } - void BindGroupLayout::WGPURelease(WGPUBindGroupLayout handle) { - if (handle != nullptr) { - wgpuBindGroupLayoutRelease(handle); - } - } - - // Buffer - - static_assert(sizeof(Buffer) == sizeof(WGPUBuffer), "sizeof mismatch for Buffer"); - static_assert(alignof(Buffer) == alignof(WGPUBuffer), "alignof mismatch for Buffer"); - - void Buffer::Destroy() const { - wgpuBufferDestroy(Get()); - } - void const * Buffer::GetConstMappedRange(size_t offset, size_t size) const { - auto result = wgpuBufferGetConstMappedRange(Get(), offset, size); - return result; - } - void * Buffer::GetMappedRange(size_t offset, size_t size) const { - auto result = wgpuBufferGetMappedRange(Get(), offset, size); - return result; - } - void Buffer::MapAsync(MapMode mode, size_t offset, size_t size, BufferMapCallback callback, void * userdata) const { - wgpuBufferMapAsync(Get(), static_cast(mode), offset, size, callback, reinterpret_cast(userdata)); - } - void Buffer::Unmap() const { - wgpuBufferUnmap(Get()); - } - void Buffer::WGPUReference(WGPUBuffer handle) { - if (handle != nullptr) { - wgpuBufferReference(handle); - } - } - void Buffer::WGPURelease(WGPUBuffer handle) { - if (handle != nullptr) { - wgpuBufferRelease(handle); - } - } - - // CommandBuffer - - static_assert(sizeof(CommandBuffer) == sizeof(WGPUCommandBuffer), "sizeof mismatch for CommandBuffer"); - static_assert(alignof(CommandBuffer) == alignof(WGPUCommandBuffer), "alignof mismatch for CommandBuffer"); - - void CommandBuffer::WGPUReference(WGPUCommandBuffer handle) { - if (handle != nullptr) { - wgpuCommandBufferReference(handle); - } - } - void CommandBuffer::WGPURelease(WGPUCommandBuffer handle) { - if (handle != nullptr) { - wgpuCommandBufferRelease(handle); - } - } - - // CommandEncoder - - static_assert(sizeof(CommandEncoder) == sizeof(WGPUCommandEncoder), "sizeof mismatch for CommandEncoder"); - static_assert(alignof(CommandEncoder) == alignof(WGPUCommandEncoder), "alignof mismatch for CommandEncoder"); - - ComputePassEncoder CommandEncoder::BeginComputePass(ComputePassDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderBeginComputePass(Get(), reinterpret_cast(descriptor)); - return ComputePassEncoder::Acquire(result); - } - RenderPassEncoder CommandEncoder::BeginRenderPass(RenderPassDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderBeginRenderPass(Get(), reinterpret_cast(descriptor)); - return RenderPassEncoder::Acquire(result); - } - void CommandEncoder::CopyBufferToBuffer(Buffer const& source, uint64_t sourceOffset, Buffer const& destination, uint64_t destinationOffset, uint64_t size) const { - wgpuCommandEncoderCopyBufferToBuffer(Get(), source.Get(), sourceOffset, destination.Get(), destinationOffset, size); - } - void CommandEncoder::CopyBufferToTexture(BufferCopyView const * source, TextureCopyView const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyBufferToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); - } - void CommandEncoder::CopyTextureToBuffer(TextureCopyView const * source, BufferCopyView const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyTextureToBuffer(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); - } - void CommandEncoder::CopyTextureToTexture(TextureCopyView const * source, TextureCopyView const * destination, Extent3D const * copySize) const { - wgpuCommandEncoderCopyTextureToTexture(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize)); - } - CommandBuffer CommandEncoder::Finish(CommandBufferDescriptor const * descriptor) const { - auto result = wgpuCommandEncoderFinish(Get(), reinterpret_cast(descriptor)); - return CommandBuffer::Acquire(result); - } - void CommandEncoder::InjectValidationError(char const * message) const { - wgpuCommandEncoderInjectValidationError(Get(), reinterpret_cast(message)); - } - void CommandEncoder::InsertDebugMarker(char const * markerLabel) const { - wgpuCommandEncoderInsertDebugMarker(Get(), reinterpret_cast(markerLabel)); - } - void CommandEncoder::PopDebugGroup() const { - wgpuCommandEncoderPopDebugGroup(Get()); - } - void CommandEncoder::PushDebugGroup(char const * groupLabel) const { - wgpuCommandEncoderPushDebugGroup(Get(), reinterpret_cast(groupLabel)); - } - void CommandEncoder::ResolveQuerySet(QuerySet const& querySet, uint32_t firstQuery, uint32_t queryCount, Buffer const& destination, uint64_t destinationOffset) const { - wgpuCommandEncoderResolveQuerySet(Get(), querySet.Get(), firstQuery, queryCount, destination.Get(), destinationOffset); - } - void CommandEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuCommandEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); - } - void CommandEncoder::WGPUReference(WGPUCommandEncoder handle) { - if (handle != nullptr) { - wgpuCommandEncoderReference(handle); - } - } - void CommandEncoder::WGPURelease(WGPUCommandEncoder handle) { - if (handle != nullptr) { - wgpuCommandEncoderRelease(handle); - } - } - - // ComputePassEncoder - - static_assert(sizeof(ComputePassEncoder) == sizeof(WGPUComputePassEncoder), "sizeof mismatch for ComputePassEncoder"); - static_assert(alignof(ComputePassEncoder) == alignof(WGPUComputePassEncoder), "alignof mismatch for ComputePassEncoder"); - - void ComputePassEncoder::Dispatch(uint32_t x, uint32_t y, uint32_t z) const { - wgpuComputePassEncoderDispatch(Get(), x, y, z); - } - void ComputePassEncoder::DispatchIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuComputePassEncoderDispatchIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - void ComputePassEncoder::EndPass() const { - wgpuComputePassEncoderEndPass(Get()); - } - void ComputePassEncoder::InsertDebugMarker(char const * markerLabel) const { - wgpuComputePassEncoderInsertDebugMarker(Get(), reinterpret_cast(markerLabel)); - } - void ComputePassEncoder::PopDebugGroup() const { - wgpuComputePassEncoderPopDebugGroup(Get()); - } - void ComputePassEncoder::PushDebugGroup(char const * groupLabel) const { - wgpuComputePassEncoderPushDebugGroup(Get(), reinterpret_cast(groupLabel)); - } - void ComputePassEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const { - wgpuComputePassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); - } - void ComputePassEncoder::SetPipeline(ComputePipeline const& pipeline) const { - wgpuComputePassEncoderSetPipeline(Get(), pipeline.Get()); - } - void ComputePassEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuComputePassEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); - } - void ComputePassEncoder::WGPUReference(WGPUComputePassEncoder handle) { - if (handle != nullptr) { - wgpuComputePassEncoderReference(handle); - } - } - void ComputePassEncoder::WGPURelease(WGPUComputePassEncoder handle) { - if (handle != nullptr) { - wgpuComputePassEncoderRelease(handle); - } - } - - // ComputePipeline - - static_assert(sizeof(ComputePipeline) == sizeof(WGPUComputePipeline), "sizeof mismatch for ComputePipeline"); - static_assert(alignof(ComputePipeline) == alignof(WGPUComputePipeline), "alignof mismatch for ComputePipeline"); - - BindGroupLayout ComputePipeline::GetBindGroupLayout(uint32_t groupIndex) const { - auto result = wgpuComputePipelineGetBindGroupLayout(Get(), groupIndex); - return BindGroupLayout::Acquire(result); - } - void ComputePipeline::WGPUReference(WGPUComputePipeline handle) { - if (handle != nullptr) { - wgpuComputePipelineReference(handle); - } - } - void ComputePipeline::WGPURelease(WGPUComputePipeline handle) { - if (handle != nullptr) { - wgpuComputePipelineRelease(handle); - } - } - - // Device - - static_assert(sizeof(Device) == sizeof(WGPUDevice), "sizeof mismatch for Device"); - static_assert(alignof(Device) == alignof(WGPUDevice), "alignof mismatch for Device"); - - BindGroup Device::CreateBindGroup(BindGroupDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBindGroup(Get(), reinterpret_cast(descriptor)); - return BindGroup::Acquire(result); - } - BindGroupLayout Device::CreateBindGroupLayout(BindGroupLayoutDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBindGroupLayout(Get(), reinterpret_cast(descriptor)); - return BindGroupLayout::Acquire(result); - } - Buffer Device::CreateBuffer(BufferDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateBuffer(Get(), reinterpret_cast(descriptor)); - return Buffer::Acquire(result); - } - CommandEncoder Device::CreateCommandEncoder(CommandEncoderDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateCommandEncoder(Get(), reinterpret_cast(descriptor)); - return CommandEncoder::Acquire(result); - } - ComputePipeline Device::CreateComputePipeline(ComputePipelineDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateComputePipeline(Get(), reinterpret_cast(descriptor)); - return ComputePipeline::Acquire(result); - } - Buffer Device::CreateErrorBuffer() const { - auto result = wgpuDeviceCreateErrorBuffer(Get()); - return Buffer::Acquire(result); - } - PipelineLayout Device::CreatePipelineLayout(PipelineLayoutDescriptor const * descriptor) const { - auto result = wgpuDeviceCreatePipelineLayout(Get(), reinterpret_cast(descriptor)); - return PipelineLayout::Acquire(result); - } - QuerySet Device::CreateQuerySet(QuerySetDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateQuerySet(Get(), reinterpret_cast(descriptor)); - return QuerySet::Acquire(result); - } - void Device::CreateReadyComputePipeline(ComputePipelineDescriptor const * descriptor, CreateReadyComputePipelineCallback callback, void * userdata) const { - wgpuDeviceCreateReadyComputePipeline(Get(), reinterpret_cast(descriptor), callback, reinterpret_cast(userdata)); - } - void Device::CreateReadyRenderPipeline(RenderPipelineDescriptor const * descriptor, CreateReadyRenderPipelineCallback callback, void * userdata) const { - wgpuDeviceCreateReadyRenderPipeline(Get(), reinterpret_cast(descriptor), callback, reinterpret_cast(userdata)); - } - RenderBundleEncoder Device::CreateRenderBundleEncoder(RenderBundleEncoderDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateRenderBundleEncoder(Get(), reinterpret_cast(descriptor)); - return RenderBundleEncoder::Acquire(result); - } - RenderPipeline Device::CreateRenderPipeline(RenderPipelineDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateRenderPipeline(Get(), reinterpret_cast(descriptor)); - return RenderPipeline::Acquire(result); - } - Sampler Device::CreateSampler(SamplerDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateSampler(Get(), reinterpret_cast(descriptor)); - return Sampler::Acquire(result); - } - ShaderModule Device::CreateShaderModule(ShaderModuleDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateShaderModule(Get(), reinterpret_cast(descriptor)); - return ShaderModule::Acquire(result); - } - SwapChain Device::CreateSwapChain(Surface const& surface, SwapChainDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateSwapChain(Get(), surface.Get(), reinterpret_cast(descriptor)); - return SwapChain::Acquire(result); - } - Texture Device::CreateTexture(TextureDescriptor const * descriptor) const { - auto result = wgpuDeviceCreateTexture(Get(), reinterpret_cast(descriptor)); - return Texture::Acquire(result); - } - Queue Device::GetDefaultQueue() const { - auto result = wgpuDeviceGetDefaultQueue(Get()); - return Queue::Acquire(result); - } - void Device::InjectError(ErrorType type, char const * message) const { - wgpuDeviceInjectError(Get(), static_cast(type), reinterpret_cast(message)); - } - void Device::LoseForTesting() const { - wgpuDeviceLoseForTesting(Get()); - } - bool Device::PopErrorScope(ErrorCallback callback, void * userdata) const { - auto result = wgpuDevicePopErrorScope(Get(), callback, reinterpret_cast(userdata)); - return result; - } - void Device::PushErrorScope(ErrorFilter filter) const { - wgpuDevicePushErrorScope(Get(), static_cast(filter)); - } - void Device::SetDeviceLostCallback(DeviceLostCallback callback, void * userdata) const { - wgpuDeviceSetDeviceLostCallback(Get(), callback, reinterpret_cast(userdata)); - } - void Device::SetUncapturedErrorCallback(ErrorCallback callback, void * userdata) const { - wgpuDeviceSetUncapturedErrorCallback(Get(), callback, reinterpret_cast(userdata)); - } - void Device::Tick() const { - wgpuDeviceTick(Get()); - } - void Device::WGPUReference(WGPUDevice handle) { - if (handle != nullptr) { - wgpuDeviceReference(handle); - } - } - void Device::WGPURelease(WGPUDevice handle) { - if (handle != nullptr) { - wgpuDeviceRelease(handle); - } - } - - // Fence - - static_assert(sizeof(Fence) == sizeof(WGPUFence), "sizeof mismatch for Fence"); - static_assert(alignof(Fence) == alignof(WGPUFence), "alignof mismatch for Fence"); - - uint64_t Fence::GetCompletedValue() const { - auto result = wgpuFenceGetCompletedValue(Get()); - return result; - } - void Fence::OnCompletion(uint64_t value, FenceOnCompletionCallback callback, void * userdata) const { - wgpuFenceOnCompletion(Get(), value, callback, reinterpret_cast(userdata)); - } - void Fence::WGPUReference(WGPUFence handle) { - if (handle != nullptr) { - wgpuFenceReference(handle); - } - } - void Fence::WGPURelease(WGPUFence handle) { - if (handle != nullptr) { - wgpuFenceRelease(handle); - } - } - - // Instance - - static_assert(sizeof(Instance) == sizeof(WGPUInstance), "sizeof mismatch for Instance"); - static_assert(alignof(Instance) == alignof(WGPUInstance), "alignof mismatch for Instance"); - - Surface Instance::CreateSurface(SurfaceDescriptor const * descriptor) const { - auto result = wgpuInstanceCreateSurface(Get(), reinterpret_cast(descriptor)); - return Surface::Acquire(result); - } - void Instance::WGPUReference(WGPUInstance handle) { - if (handle != nullptr) { - wgpuInstanceReference(handle); - } - } - void Instance::WGPURelease(WGPUInstance handle) { - if (handle != nullptr) { - wgpuInstanceRelease(handle); - } - } - - // PipelineLayout - - static_assert(sizeof(PipelineLayout) == sizeof(WGPUPipelineLayout), "sizeof mismatch for PipelineLayout"); - static_assert(alignof(PipelineLayout) == alignof(WGPUPipelineLayout), "alignof mismatch for PipelineLayout"); - - void PipelineLayout::WGPUReference(WGPUPipelineLayout handle) { - if (handle != nullptr) { - wgpuPipelineLayoutReference(handle); - } - } - void PipelineLayout::WGPURelease(WGPUPipelineLayout handle) { - if (handle != nullptr) { - wgpuPipelineLayoutRelease(handle); - } - } - - // QuerySet - - static_assert(sizeof(QuerySet) == sizeof(WGPUQuerySet), "sizeof mismatch for QuerySet"); - static_assert(alignof(QuerySet) == alignof(WGPUQuerySet), "alignof mismatch for QuerySet"); - - void QuerySet::Destroy() const { - wgpuQuerySetDestroy(Get()); - } - void QuerySet::WGPUReference(WGPUQuerySet handle) { - if (handle != nullptr) { - wgpuQuerySetReference(handle); - } - } - void QuerySet::WGPURelease(WGPUQuerySet handle) { - if (handle != nullptr) { - wgpuQuerySetRelease(handle); - } - } - - // Queue - - static_assert(sizeof(Queue) == sizeof(WGPUQueue), "sizeof mismatch for Queue"); - static_assert(alignof(Queue) == alignof(WGPUQueue), "alignof mismatch for Queue"); - - void Queue::CopyTextureForBrowser(TextureCopyView const * source, TextureCopyView const * destination, Extent3D const * copySize, CopyTextureForBrowserOptions const * options) const { - wgpuQueueCopyTextureForBrowser(Get(), reinterpret_cast(source), reinterpret_cast(destination), reinterpret_cast(copySize), reinterpret_cast(options)); - } - Fence Queue::CreateFence(FenceDescriptor const * descriptor) const { - auto result = wgpuQueueCreateFence(Get(), reinterpret_cast(descriptor)); - return Fence::Acquire(result); - } - void Queue::Signal(Fence const& fence, uint64_t signalValue) const { - wgpuQueueSignal(Get(), fence.Get(), signalValue); - } - void Queue::Submit(uint32_t commandCount, CommandBuffer const * commands) const { - wgpuQueueSubmit(Get(), commandCount, reinterpret_cast(commands)); - } - void Queue::WriteBuffer(Buffer const& buffer, uint64_t bufferOffset, void const * data, size_t size) const { - wgpuQueueWriteBuffer(Get(), buffer.Get(), bufferOffset, reinterpret_cast(data), size); - } - void Queue::WriteTexture(TextureCopyView const * destination, void const * data, size_t dataSize, TextureDataLayout const * dataLayout, Extent3D const * writeSize) const { - wgpuQueueWriteTexture(Get(), reinterpret_cast(destination), reinterpret_cast(data), dataSize, reinterpret_cast(dataLayout), reinterpret_cast(writeSize)); - } - void Queue::WGPUReference(WGPUQueue handle) { - if (handle != nullptr) { - wgpuQueueReference(handle); - } - } - void Queue::WGPURelease(WGPUQueue handle) { - if (handle != nullptr) { - wgpuQueueRelease(handle); - } - } - - // RenderBundle - - static_assert(sizeof(RenderBundle) == sizeof(WGPURenderBundle), "sizeof mismatch for RenderBundle"); - static_assert(alignof(RenderBundle) == alignof(WGPURenderBundle), "alignof mismatch for RenderBundle"); - - void RenderBundle::WGPUReference(WGPURenderBundle handle) { - if (handle != nullptr) { - wgpuRenderBundleReference(handle); - } - } - void RenderBundle::WGPURelease(WGPURenderBundle handle) { - if (handle != nullptr) { - wgpuRenderBundleRelease(handle); - } - } - - // RenderBundleEncoder - - static_assert(sizeof(RenderBundleEncoder) == sizeof(WGPURenderBundleEncoder), "sizeof mismatch for RenderBundleEncoder"); - static_assert(alignof(RenderBundleEncoder) == alignof(WGPURenderBundleEncoder), "alignof mismatch for RenderBundleEncoder"); - - void RenderBundleEncoder::Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const { - wgpuRenderBundleEncoderDraw(Get(), vertexCount, instanceCount, firstVertex, firstInstance); - } - void RenderBundleEncoder::DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) const { - wgpuRenderBundleEncoderDrawIndexed(Get(), indexCount, instanceCount, firstIndex, baseVertex, firstInstance); - } - void RenderBundleEncoder::DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderBundleEncoderDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - void RenderBundleEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderBundleEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - RenderBundle RenderBundleEncoder::Finish(RenderBundleDescriptor const * descriptor) const { - auto result = wgpuRenderBundleEncoderFinish(Get(), reinterpret_cast(descriptor)); - return RenderBundle::Acquire(result); - } - void RenderBundleEncoder::InsertDebugMarker(char const * markerLabel) const { - wgpuRenderBundleEncoderInsertDebugMarker(Get(), reinterpret_cast(markerLabel)); - } - void RenderBundleEncoder::PopDebugGroup() const { - wgpuRenderBundleEncoderPopDebugGroup(Get()); - } - void RenderBundleEncoder::PushDebugGroup(char const * groupLabel) const { - wgpuRenderBundleEncoderPushDebugGroup(Get(), reinterpret_cast(groupLabel)); - } - void RenderBundleEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const { - wgpuRenderBundleEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); - } - void RenderBundleEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuRenderBundleEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(format), offset, size); - } - void RenderBundleEncoder::SetIndexBufferWithFormat(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuRenderBundleEncoderSetIndexBufferWithFormat(Get(), buffer.Get(), static_cast(format), offset, size); - } - void RenderBundleEncoder::SetPipeline(RenderPipeline const& pipeline) const { - wgpuRenderBundleEncoderSetPipeline(Get(), pipeline.Get()); - } - void RenderBundleEncoder::SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuRenderBundleEncoderSetVertexBuffer(Get(), slot, buffer.Get(), offset, size); - } - void RenderBundleEncoder::WGPUReference(WGPURenderBundleEncoder handle) { - if (handle != nullptr) { - wgpuRenderBundleEncoderReference(handle); - } - } - void RenderBundleEncoder::WGPURelease(WGPURenderBundleEncoder handle) { - if (handle != nullptr) { - wgpuRenderBundleEncoderRelease(handle); - } - } - - // RenderPassEncoder - - static_assert(sizeof(RenderPassEncoder) == sizeof(WGPURenderPassEncoder), "sizeof mismatch for RenderPassEncoder"); - static_assert(alignof(RenderPassEncoder) == alignof(WGPURenderPassEncoder), "alignof mismatch for RenderPassEncoder"); - - void RenderPassEncoder::BeginOcclusionQuery(uint32_t queryIndex) const { - wgpuRenderPassEncoderBeginOcclusionQuery(Get(), queryIndex); - } - void RenderPassEncoder::Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const { - wgpuRenderPassEncoderDraw(Get(), vertexCount, instanceCount, firstVertex, firstInstance); - } - void RenderPassEncoder::DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) const { - wgpuRenderPassEncoderDrawIndexed(Get(), indexCount, instanceCount, firstIndex, baseVertex, firstInstance); - } - void RenderPassEncoder::DrawIndexedIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderPassEncoderDrawIndexedIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - void RenderPassEncoder::DrawIndirect(Buffer const& indirectBuffer, uint64_t indirectOffset) const { - wgpuRenderPassEncoderDrawIndirect(Get(), indirectBuffer.Get(), indirectOffset); - } - void RenderPassEncoder::EndOcclusionQuery() const { - wgpuRenderPassEncoderEndOcclusionQuery(Get()); - } - void RenderPassEncoder::EndPass() const { - wgpuRenderPassEncoderEndPass(Get()); - } - void RenderPassEncoder::ExecuteBundles(uint32_t bundlesCount, RenderBundle const * bundles) const { - wgpuRenderPassEncoderExecuteBundles(Get(), bundlesCount, reinterpret_cast(bundles)); - } - void RenderPassEncoder::InsertDebugMarker(char const * markerLabel) const { - wgpuRenderPassEncoderInsertDebugMarker(Get(), reinterpret_cast(markerLabel)); - } - void RenderPassEncoder::PopDebugGroup() const { - wgpuRenderPassEncoderPopDebugGroup(Get()); - } - void RenderPassEncoder::PushDebugGroup(char const * groupLabel) const { - wgpuRenderPassEncoderPushDebugGroup(Get(), reinterpret_cast(groupLabel)); - } - void RenderPassEncoder::SetBindGroup(uint32_t groupIndex, BindGroup const& group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets) const { - wgpuRenderPassEncoderSetBindGroup(Get(), groupIndex, group.Get(), dynamicOffsetCount, reinterpret_cast(dynamicOffsets)); - } - void RenderPassEncoder::SetBlendColor(Color const * color) const { - wgpuRenderPassEncoderSetBlendColor(Get(), reinterpret_cast(color)); - } - void RenderPassEncoder::SetIndexBuffer(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuRenderPassEncoderSetIndexBuffer(Get(), buffer.Get(), static_cast(format), offset, size); - } - void RenderPassEncoder::SetIndexBufferWithFormat(Buffer const& buffer, IndexFormat format, uint64_t offset, uint64_t size) const { - wgpuRenderPassEncoderSetIndexBufferWithFormat(Get(), buffer.Get(), static_cast(format), offset, size); - } - void RenderPassEncoder::SetPipeline(RenderPipeline const& pipeline) const { - wgpuRenderPassEncoderSetPipeline(Get(), pipeline.Get()); - } - void RenderPassEncoder::SetScissorRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const { - wgpuRenderPassEncoderSetScissorRect(Get(), x, y, width, height); - } - void RenderPassEncoder::SetStencilReference(uint32_t reference) const { - wgpuRenderPassEncoderSetStencilReference(Get(), reference); - } - void RenderPassEncoder::SetVertexBuffer(uint32_t slot, Buffer const& buffer, uint64_t offset, uint64_t size) const { - wgpuRenderPassEncoderSetVertexBuffer(Get(), slot, buffer.Get(), offset, size); - } - void RenderPassEncoder::SetViewport(float x, float y, float width, float height, float minDepth, float maxDepth) const { - wgpuRenderPassEncoderSetViewport(Get(), x, y, width, height, minDepth, maxDepth); - } - void RenderPassEncoder::WriteTimestamp(QuerySet const& querySet, uint32_t queryIndex) const { - wgpuRenderPassEncoderWriteTimestamp(Get(), querySet.Get(), queryIndex); - } - void RenderPassEncoder::WGPUReference(WGPURenderPassEncoder handle) { - if (handle != nullptr) { - wgpuRenderPassEncoderReference(handle); - } - } - void RenderPassEncoder::WGPURelease(WGPURenderPassEncoder handle) { - if (handle != nullptr) { - wgpuRenderPassEncoderRelease(handle); - } - } - - // RenderPipeline - - static_assert(sizeof(RenderPipeline) == sizeof(WGPURenderPipeline), "sizeof mismatch for RenderPipeline"); - static_assert(alignof(RenderPipeline) == alignof(WGPURenderPipeline), "alignof mismatch for RenderPipeline"); - - BindGroupLayout RenderPipeline::GetBindGroupLayout(uint32_t groupIndex) const { - auto result = wgpuRenderPipelineGetBindGroupLayout(Get(), groupIndex); - return BindGroupLayout::Acquire(result); - } - void RenderPipeline::WGPUReference(WGPURenderPipeline handle) { - if (handle != nullptr) { - wgpuRenderPipelineReference(handle); - } - } - void RenderPipeline::WGPURelease(WGPURenderPipeline handle) { - if (handle != nullptr) { - wgpuRenderPipelineRelease(handle); - } - } - - // Sampler - - static_assert(sizeof(Sampler) == sizeof(WGPUSampler), "sizeof mismatch for Sampler"); - static_assert(alignof(Sampler) == alignof(WGPUSampler), "alignof mismatch for Sampler"); - - void Sampler::WGPUReference(WGPUSampler handle) { - if (handle != nullptr) { - wgpuSamplerReference(handle); - } - } - void Sampler::WGPURelease(WGPUSampler handle) { - if (handle != nullptr) { - wgpuSamplerRelease(handle); - } - } - - // ShaderModule - - static_assert(sizeof(ShaderModule) == sizeof(WGPUShaderModule), "sizeof mismatch for ShaderModule"); - static_assert(alignof(ShaderModule) == alignof(WGPUShaderModule), "alignof mismatch for ShaderModule"); - - void ShaderModule::WGPUReference(WGPUShaderModule handle) { - if (handle != nullptr) { - wgpuShaderModuleReference(handle); - } - } - void ShaderModule::WGPURelease(WGPUShaderModule handle) { - if (handle != nullptr) { - wgpuShaderModuleRelease(handle); - } - } - - // Surface - - static_assert(sizeof(Surface) == sizeof(WGPUSurface), "sizeof mismatch for Surface"); - static_assert(alignof(Surface) == alignof(WGPUSurface), "alignof mismatch for Surface"); - - void Surface::WGPUReference(WGPUSurface handle) { - if (handle != nullptr) { - wgpuSurfaceReference(handle); - } - } - void Surface::WGPURelease(WGPUSurface handle) { - if (handle != nullptr) { - wgpuSurfaceRelease(handle); - } - } - - // SwapChain - - static_assert(sizeof(SwapChain) == sizeof(WGPUSwapChain), "sizeof mismatch for SwapChain"); - static_assert(alignof(SwapChain) == alignof(WGPUSwapChain), "alignof mismatch for SwapChain"); - - void SwapChain::Configure(TextureFormat format, TextureUsage allowedUsage, uint32_t width, uint32_t height) const { - wgpuSwapChainConfigure(Get(), static_cast(format), static_cast(allowedUsage), width, height); - } - TextureView SwapChain::GetCurrentTextureView() const { - auto result = wgpuSwapChainGetCurrentTextureView(Get()); - return TextureView::Acquire(result); - } - void SwapChain::Present() const { - wgpuSwapChainPresent(Get()); - } - void SwapChain::WGPUReference(WGPUSwapChain handle) { - if (handle != nullptr) { - wgpuSwapChainReference(handle); - } - } - void SwapChain::WGPURelease(WGPUSwapChain handle) { - if (handle != nullptr) { - wgpuSwapChainRelease(handle); - } - } - - // Texture - - static_assert(sizeof(Texture) == sizeof(WGPUTexture), "sizeof mismatch for Texture"); - static_assert(alignof(Texture) == alignof(WGPUTexture), "alignof mismatch for Texture"); - - TextureView Texture::CreateView(TextureViewDescriptor const * descriptor) const { - auto result = wgpuTextureCreateView(Get(), reinterpret_cast(descriptor)); - return TextureView::Acquire(result); - } - void Texture::Destroy() const { - wgpuTextureDestroy(Get()); - } - void Texture::WGPUReference(WGPUTexture handle) { - if (handle != nullptr) { - wgpuTextureReference(handle); - } - } - void Texture::WGPURelease(WGPUTexture handle) { - if (handle != nullptr) { - wgpuTextureRelease(handle); - } - } - - // TextureView - - static_assert(sizeof(TextureView) == sizeof(WGPUTextureView), "sizeof mismatch for TextureView"); - static_assert(alignof(TextureView) == alignof(WGPUTextureView), "alignof mismatch for TextureView"); - - void TextureView::WGPUReference(WGPUTextureView handle) { - if (handle != nullptr) { - wgpuTextureViewReference(handle); - } - } - void TextureView::WGPURelease(WGPUTextureView handle) { - if (handle != nullptr) { - wgpuTextureViewRelease(handle); - } - } - - // Instance - - Instance CreateInstance(const InstanceDescriptor* descriptor) { - const WGPUInstanceDescriptor* cDescriptor = - reinterpret_cast(descriptor); - return Instance::Acquire(wgpuCreateInstance(cDescriptor)); - } - - Proc GetProcAddress(Device const& device, const char* procName) { - return reinterpret_cast(wgpuGetProcAddress(device.Get(), procName)); - } - -} diff --git a/bgfx/CODEOWNERS b/bgfx/CODEOWNERS index 0e7b2e7a..6d06e7df 100644 --- a/bgfx/CODEOWNERS +++ b/bgfx/CODEOWNERS @@ -5,6 +5,3 @@ src/renderer_mtl.* @attilaz # Vulkan src/renderer_vk.* @rinthel @pezcode - -# WebGPU -src/renderer_webgpu.* @hugoam diff --git a/bgfx/CONTRIBUTING.md b/bgfx/CONTRIBUTING.md index d45bd53d..dd25c630 100644 --- a/bgfx/CONTRIBUTING.md +++ b/bgfx/CONTRIBUTING.md @@ -5,7 +5,7 @@ different platforms, writing examples (see [Help Needed](https://github.com/bkar for ideas), improving documentation, profiling and optimizing, helping newcomers, telling others about bgfx, etc. -If you have just quick oneliner question it's prefereable to ask it at chat +If you have just quick oneliner question it's preferable to ask it at chat https://discord.gg/9eMbv7J instead opening new issue. ## Submitting bugs diff --git a/bgfx/LICENSE b/bgfx/LICENSE index f8393b90..0edd62e9 100644 --- a/bgfx/LICENSE +++ b/bgfx/LICENSE @@ -1,4 +1,4 @@ -Copyright 2010-2023 Branimir Karadzic +Copyright 2010-2024 Branimir Karadzic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/bgfx/README.md b/bgfx/README.md index 6bb68341..95b13aa5 100644 --- a/bgfx/README.md +++ b/bgfx/README.md @@ -32,7 +32,6 @@ rendering library. Supported rendering backends: - * Direct3D 9 * Direct3D 11 * Direct3D 12 * GNM (only for licensed PS4 developers, search DevNet forums for source) @@ -44,14 +43,13 @@ Supported rendering backends: * Vulkan * WebGL 1.0 * WebGL 2.0 - * WebGPU/Dawn (experimental) Supported platforms: - * Android (14+, ARM, x86, MIPS) - * iOS/iPadOS/tvOS (iPhone, iPad, AppleTV) + * Android (14+) + * iOS/iPadOS/tvOS (16.0+) * Linux - * macOS (11+) + * macOS (13.0+) * PlayStation 4 * RaspberryPi * UWP (Universal Windows, Xbox One) @@ -61,7 +59,7 @@ Supported platforms: Supported compilers: * Clang 11 and above - * GCC 8 and above + * GCC 11 and above * VS2019 and above * Apple clang 12 and above @@ -122,8 +120,8 @@ https://github.com/andr3wmac/Torque6 - Torque 6 is an MIT licensed 3D engine loosely based on Torque2D. Being neither Torque2D or Torque3D it is the 6th derivative of the original Torque Engine. -Torque 6 Material Editor ## Kepler Orbits @@ -150,7 +148,7 @@ C++ and using bgfx to support multiple rendering APIs. http://makingartstudios.itch.io/dls - DLS, the digital logic simulator game. DLS - Creating a 4-bit Register @@ -170,8 +168,8 @@ https://blackshift.itch.io/blackshift - Blackshift is a grid-based, space-themed action puzzle game which isn't afraid of complexity - think Chip's Challenge on crack. -Blackshift Trailer, May 2016 @@ -181,8 +179,8 @@ https://eheitzresearch.wordpress.com/415-2/ - Real-Time Polygonal-Light Shading with Linearly Transformed Cosines, Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt, ACM SIGGRAPH 2016. -Real-Time Polygonal-Light Shading with Linearly Transformed Cosines @@ -192,8 +190,8 @@ http://www.dogbytegames.com/dead_venture.html - Dead Venture is a new Drive 'N Gun game where you help a handful of survivals reach the safe haven: a military base on a far island. -Dead Venture - Gameplay Teaser (iOS / Android) @@ -203,14 +201,14 @@ https://github.com/degenerated1123/REGoth - REGoth is an open-source reimplementation of the zEngine, used by the game "Gothic" and "Gothic II". REGoth Engine ## Ethereal Engine https://github.com/volcoma/EtherealEngine - EtherealEngine is a C++ game engine -and WYSIWYG dditor. +and WYSIWYG editor. ![EtherealEngine screenshot](https://user-images.githubusercontent.com/1499411/29488403-ff3c3df6-8512-11e7-869f-32a783530cc3.png) @@ -219,8 +217,8 @@ and WYSIWYG dditor. http://gorallygame.com/ - Go Rally is top-down rally game with a career mode, multiplayer time challenges, and a track creator. -Go Rally @@ -239,8 +237,8 @@ open-world offroad driving game: explore massive landscapes, complete challenges, smash zombies, find secret locations, unlock and upgrade cars and weapons, it's up to you! -Zombie Safari - Official Gameplay Trailer (Android) @@ -248,11 +246,11 @@ width="640" height="480" border="0" /> http://www.smithandwinston.com/ - Smith and Winston is an exploration twin stick shooter for PC, PS4 & XBoxOne arriving in late 2018. Smith and Winston features -a massively destructable voxel world, rapid twin stick combat, physics puzzles +a massively destructible voxel world, rapid twin stick combat, physics puzzles and Metroid-style discovery. -Smith and Winston: Gameplay Video @@ -262,8 +260,8 @@ http://www.footballmanager.com/ - Football Manager 2018 is a 2017 football management simulation video game developed by Sports Interactive and published by Sega. -Match Engine | Football Manager 2018 @@ -273,8 +271,8 @@ http://wonderworlds.me/ - WonderWorlds is a place to play thousands of user-created levels and stories, make your own using the extensive in-game tools and share them with whomever you want. -WonderWorlds @@ -290,8 +288,8 @@ focused towards live graphical apps and games. https://outfit7.com/apps/talking-tom-pool/ - A "sling and match" puzzle game for mobile devices. -Talking Tom Pool @@ -308,10 +306,10 @@ engine v3.0. http://www.dogbytegames.com/off_the_road.html - A sandbox off-road driving simulator. -Off The Road +width="640" height="360" border="0" /> ## Coal Burnout @@ -323,8 +321,8 @@ https://beardsvibe.com/ - A multiplayer PVP rhythm game. https://outfit7.com/apps/my-talking-tom-2/ - Many mini games for mobile devices. -My Talking Tom 2 @@ -348,8 +346,8 @@ Hammerwatch. Encounter endless hordes of enemies, traps, puzzles, secrets and lots of loot, as you battle your way through procedurally generated levels to reach the top of the Forsaken Spire. -Heroes of Hammerwatch @@ -367,8 +365,8 @@ SIGGRAPH 2019: Project Nira: Instant Interactive Real-Time Access to Multi-Gigabyte Sized 3D Assets on Any Device: https://s2019.siggraph.org/presentation/?sess=sess104&id=real_130#038;id=real_130 -Heroes of Hammerwatch @@ -470,8 +468,8 @@ vehicle you bet you can hop into it! Pilot big rigs, helicopters, boats, airplanes or even trains. Sand dunes, frozen plains, mountains to climb and conquer. -Off The Road Unleashed @@ -490,8 +488,8 @@ https://klei.com/games/griftlands - Griftlands is a roguelike deck-building game with role-playing story elements in a science fiction setting, developed and published by Klei Entertainment. -Griftlands @@ -510,8 +508,8 @@ Evoke 2022 demoparty. https://github.com/astrofra/demo-marine-melodies -Marine Melodies @@ -538,6 +536,132 @@ world where you can zoom in on anything, forever. ![Pinhole Universe capsule image](https://festina-lente-productions.com/ext/capsule_small.jpg) +## Unavowed (Nintendo Switch version only) + +https://www.nintendo.com/us/store/products/unavowed-switch/ - A demon has possessed you +and used your body to tear a swath of bloodshed through New York. You are now free, but +life as you knew it is over. Your only path forward is joining the Unavowed - an ancient +society dedicated to stopping evil. No matter what the cost. + +![Unavowed Title](https://assets.nintendo.com/image/upload/c_limit,f_auto,h_1000,q_auto,w_1700/v1/ncom/en_US/games/switch/u/unavowed-switch/Video/posters/Unavowed_Switch_Trailer_NOA) + +## The Excavation of Hob's Barrow (Nintendo Switch version only) + +https://www.nintendo.com/us/store/products/the-excavation-of-hobs-barrow-switch/ - A folk +horror narrative-driven adventure. Explore the isolated moors of rural Victorian England +as you uncover the mysteries of Hob's Barrow. The answers lie in the soil... + +![The Excavation of Hob's Barrow Title](https://assets.nintendo.com/image/upload/c_limit,f_auto,h_1000,q_auto,w_1700/v1/ncom/en_US/games/switch/t/the-excavation-of-hobs-barrow-switch/Video/posters/The_Excavation_of_Hob_s_Barrow) + +## Primordia (Nintendo Switch version only) + +https://www.nintendo.com/us/store/products/primordia-switch/ - Life has ceased. Man is +but a myth. And now, even the machines have begun to fail. Lead Horatio Nullbuilt and his +sarcastic sidekick Crispin on a journey through the crumbling world of Primordia, facing +malfunctioning robots, ancient secrets, and an implacable, power-hungry foe. + +![Primordia Title](https://assets.nintendo.com/image/upload/c_limit,f_auto,h_1000,q_auto,w_1700/v1/ncom/en_US/games/switch/p/primordia-switch/Video/posters/Primordia_Trailer) + +## ProtoTwin + +https://prototwin.com - Online industrial simulation software for manufacturing and material handling. + +![ProtoTwin - Simulation for Industrial Automation](https://github.com/bkaradzic/bgfx/assets/37254625/7aac600f-2687-468f-8d60-441c45ec14a3) + +## WARCANA + +WARCANA is a fantasy inspired base defence, RTS game with a deck-building mechanic. +Face hundreds of thousands of unrelenting monsters in a battle royale between 30 other +mighty magicians. Build your deck. Prepare your defences. Summon your armies. +Survive the onslaught. + + + +## DiskBoard + +https://www.diskboard.com - DiskBoard is the ultimate tool that can help you measure +the performance and monitor the health of your hardware. All of your devices are +presented in a clean and easy to understand view. The tests offer extensive +customization options, allowing you to simulate various workloads. The intuitive +visuals provide clear insights, benchmark comparisons, and performance guidelines. +Join a community of tech enthusiasts, compare your device's prowess, and witness +your hardware shine! + +![Diskboard screenshot](https://www.diskboard.com/assets/diskboard3.png) + +## Ant + +https://github.com/ejoy/ant - Ant is an open-source game engine focused on mobile platforms. It is implemented +based on Lua, with excellent performance and easy customization. + +[Red Frontier Game using Ant Game Engine](https://github.com/ejoy/vaststars) + +![RedFrontier](https://github.com/ejoy/vaststars/blob/master/screenshot/startup.jpg) + +## Crypt of the NecroDancer + +https://braceyourselfgames.com/crypt-of-the-necrodancer/ - Crypt of the NecroDancer +is an award-winning hardcore roguelike rhythm game. Move to the music and deliver +beatdowns to the beat! The game uses bgfx on Windows, macOS, Linux, Nintendo +Switch and PlayStation 4. + +![Crypt of the NecroDancer screenshot](https://raw.githubusercontent.com/Marukyu/marukyu.github.io/misc-assets/247080_20240322072858_1.png) + +## Tomb4Plus + +https://www.github.com/SaracenOne/Tomb4Plus - Tomb4Plus is an open source +reimplementation of the Tomb Raider: The Last Revelation engine. It is an +enhanced fork of the original [Tomb4](https://github.com/Trxyebeep/TOMB4) +reimplementation project which focuses on supporting the Level Editor runtime +and aims for full compatibility with the unofficial binary-patched scripting +extensions used by many custom levels. Tomb4Plus also replaces the original +legacy Direct3D renderer with bgfx. + +![Tomb4Plus screenshot](https://raw.githubusercontent.com/SaracenOne/Tomb4Plus/level_editor_v2/.github/images/preview.png) + +## Braid, Anniversary Edition + +https://play.google.com/store/apps/details?id=com.netflix.NGP.BraidAnniversaryEdition - +bgfx is used only in Android version of the game. + + + +## Rotwood + +https://store.steampowered.com/app/2015270/Rotwood/ - Rotwood is an upcoming +beat'em up, rogouelike video game developed and published by Klei Entertainment. + + + +## Cubzh + +https://app.cu.bzh/ - Cubzh is a User Generated Social Universe, an online +platform where all items, avatars, games, and experiences are made by users +from the community. + +Source: https://github.com/cubzh/cubzh + +![Cubzh screenshot](https://camo.githubusercontent.com/154159f42f526cc87357d24419133d99d8996ee2a16513ae5b5d31bd7e06bc5d/68747470733a2f2f6672616d657275736572636f6e74656e742e636f6d2f696d616765732f4957384c7147575239496e696b7542534a6c5a664578647631412e77656270) + +## World Of Goo 2 + +https://store.epicgames.com/en-US/p/world-of-goo-2 - Build bridges, +grow towers, terraform terrain, and fuel flying machines in +the stunning followup to the multi-award winning World of Goo. + + + [License (BSD 2-clause)](https://bkaradzic.github.io/bgfx/license.html) ----------------------------------------------------------------------- @@ -545,18 +669,18 @@ world where you can zoom in on anything, forever. - Copyright 2010-2023 Branimir Karadzic - + Copyright 2010-2024 Branimir Karadzic + 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. diff --git a/bgfx/bindings/bf/bgfx.bf b/bgfx/bindings/bf/bgfx.bf index cc13110f..f3ff2415 100644 --- a/bgfx/bindings/bf/bgfx.bf +++ b/bgfx/bindings/bf/bgfx.bf @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -1036,136 +1036,136 @@ public static class bgfx /// DrawIndirect = 0x0000000000000010, + /// + /// Draw indirect with indirect count is supported. + /// + DrawIndirectCount = 0x0000000000000020, + /// /// Fragment depth is available in fragment shader. /// - FragmentDepth = 0x0000000000000020, + FragmentDepth = 0x0000000000000040, /// /// Fragment ordering is available in fragment shader. /// - FragmentOrdering = 0x0000000000000040, + FragmentOrdering = 0x0000000000000080, /// /// Graphics debugger is present. /// - GraphicsDebugger = 0x0000000000000080, + GraphicsDebugger = 0x0000000000000100, /// /// HDR10 rendering is supported. /// - Hdr10 = 0x0000000000000100, + Hdr10 = 0x0000000000000200, /// /// HiDPI rendering is supported. /// - Hidpi = 0x0000000000000200, + Hidpi = 0x0000000000000400, /// /// Image Read/Write is supported. /// - ImageRw = 0x0000000000000400, + ImageRw = 0x0000000000000800, /// /// 32-bit indices are supported. /// - Index32 = 0x0000000000000800, + Index32 = 0x0000000000001000, /// /// Instancing is supported. /// - Instancing = 0x0000000000001000, + Instancing = 0x0000000000002000, /// /// Occlusion query is supported. /// - OcclusionQuery = 0x0000000000002000, - - /// - /// Renderer is on separate thread. - /// - RendererMultithreaded = 0x0000000000004000, + OcclusionQuery = 0x0000000000004000, /// - /// Multiple windows are supported. + /// PrimitiveID is available in fragment shader. /// - SwapChain = 0x0000000000008000, + PrimitiveId = 0x0000000000008000, /// - /// 2D texture array is supported. + /// Renderer is on separate thread. /// - Texture2dArray = 0x0000000000010000, + RendererMultithreaded = 0x0000000000010000, /// - /// 3D textures are supported. + /// Multiple windows are supported. /// - Texture3d = 0x0000000000020000, + SwapChain = 0x0000000000020000, /// /// Texture blit is supported. /// TextureBlit = 0x0000000000040000, - /// - /// Transparent back buffer supported. - /// - TransparentBackbuffer = 0x0000000000080000, - TextureCompareReserved = 0x0000000000100000, - /// /// Texture compare less equal mode is supported. /// - TextureCompareLequal = 0x0000000000200000, + TextureCompareLequal = 0x0000000000080000, + TextureCompareReserved = 0x0000000000100000, /// /// Cubemap texture array is supported. /// - TextureCubeArray = 0x0000000000400000, + TextureCubeArray = 0x0000000000200000, /// /// CPU direct access to GPU texture memory. /// - TextureDirectAccess = 0x0000000000800000, + TextureDirectAccess = 0x0000000000400000, /// /// Read-back texture is supported. /// - TextureReadBack = 0x0000000001000000, + TextureReadBack = 0x0000000000800000, /// - /// Vertex attribute half-float is supported. + /// 2D texture array is supported. /// - VertexAttribHalf = 0x0000000002000000, + Texture2dArray = 0x0000000001000000, /// - /// Vertex attribute 10_10_10_2 is supported. + /// 3D textures are supported. /// - VertexAttribUint10 = 0x0000000004000000, + Texture3d = 0x0000000002000000, /// - /// Rendering with VertexID only is supported. + /// Transparent back buffer supported. /// - VertexId = 0x0000000008000000, + TransparentBackbuffer = 0x0000000004000000, /// - /// PrimitiveID is available in fragment shader. + /// Vertex attribute half-float is supported. /// - PrimitiveId = 0x0000000010000000, + VertexAttribHalf = 0x0000000008000000, /// - /// Viewport layer is available in vertex shader. + /// Vertex attribute 10_10_10_2 is supported. /// - ViewportLayerArray = 0x0000000020000000, + VertexAttribUint10 = 0x0000000010000000, /// - /// Draw indirect with indirect count is supported. + /// Rendering with VertexID only is supported. + /// + VertexId = 0x0000000020000000, + + /// + /// Viewport layer is available in vertex shader. /// - DrawIndirectCount = 0x0000000040000000, + ViewportLayerArray = 0x0000000040000000, /// /// All texture compare modes are supported. /// - TextureCompareAll = 0x0000000000300000, + TextureCompareAll = 0x0000000000180000, } [AllowDuplicates] @@ -1374,11 +1374,6 @@ public static class bgfx /// Agc, - /// - /// Direct3D 9.0 - /// - Direct3D9, - /// /// Direct3D 11.0 /// @@ -1419,11 +1414,6 @@ public static class bgfx /// Vulkan, - /// - /// WebGPU - /// - WebGPU, - Count } @@ -2444,15 +2434,6 @@ public static class bgfx [LinkName("bgfx_vertex_layout_decode")] public static extern void vertex_layout_decode(VertexLayout* _this, Attrib _attrib, uint8 * _num, AttribType* _type, bool* _normalized, bool* _asInt); - /// - /// Returns `true` if VertexLayout contains attribute. - /// - /// - /// Attribute semantics. See: `bgfx::Attrib` - /// - [LinkName("bgfx_vertex_layout_has")] - public static extern bool vertex_layout_has(VertexLayout* _this, Attrib _attrib); - /// /// Skip `_num` bytes in vertex stream. /// @@ -2574,6 +2555,12 @@ public static class bgfx [LinkName("bgfx_get_renderer_name")] public static extern char8* get_renderer_name(RendererType _type); + /// + /// Fill bgfx::Init struct with default values, before using it to initialize the library. + /// + /// + /// Pointer to structure to be initialized. See: `bgfx::Init` for more info. + /// [LinkName("bgfx_init_ctor")] public static extern void init_ctor(Init* _init); @@ -3015,6 +3002,8 @@ public static class bgfx /// /// Create shader from memory buffer. + /// @remarks + /// Shader binary is obtained by compiling shader offline with shaderc command line tool. /// /// /// Shader binary. @@ -3475,6 +3464,19 @@ public static class bgfx [LinkName("bgfx_set_palette_color")] public static extern void set_palette_color(uint8 _index, float _rgba); + /// + /// Set palette color value. + /// + /// + /// Index into palette. + /// Red value (RGBA floating point values) + /// Green value (RGBA floating point values) + /// Blue value (RGBA floating point values) + /// Alpha value (RGBA floating point values) + /// + [LinkName("bgfx_set_palette_color_rgba32f")] + public static extern void set_palette_color_rgba32f(uint8 _index, float _r, float _g, float _b, float _a); + /// /// Set palette color value. /// @@ -3498,9 +3500,10 @@ public static class bgfx /// /// View id. /// View name. + /// View name length (if length is INT32_MAX, it's expected that _name is zero terminated string. /// [LinkName("bgfx_set_view_name")] - public static extern void set_view_name(ViewId _id, char8* _name); + public static extern void set_view_name(ViewId _id, char8* _name, int _len); /// /// Set view rectangle. Draw primitive outside view will be clipped. @@ -3653,10 +3656,11 @@ public static class bgfx /// graphics debugging tools. /// /// - /// Marker string. + /// Marker name. + /// Marker name length (if length is INT32_MAX, it's expected that _name is zero terminated string. /// [LinkName("bgfx_encoder_set_marker")] - public static extern void encoder_set_marker(Encoder* _this, char8* _marker); + public static extern void encoder_set_marker(Encoder* _this, char8* _name, int _len); /// /// Set render states for draw primitive. @@ -3983,7 +3987,7 @@ public static class bgfx /// Discard or preserve states. See `BGFX_DISCARD_*`. /// [LinkName("bgfx_encoder_submit_indirect")] - public static extern void encoder_submit_indirect(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, uint16 _num, uint32 _depth, uint8 _flags); + public static extern void encoder_submit_indirect(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, uint32 _num, uint32 _depth, uint8 _flags); /// /// Submit primitive for rendering with index and instance data info and @@ -4002,7 +4006,7 @@ public static class bgfx /// Discard or preserve states. See `BGFX_DISCARD_*`. /// [LinkName("bgfx_encoder_submit_indirect_count")] - public static extern void encoder_submit_indirect_count(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint16 _numMax, uint32 _depth, uint8 _flags); + public static extern void encoder_submit_indirect_count(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint32 _numMax, uint32 _depth, uint8 _flags); /// /// Set compute index buffer. @@ -4098,7 +4102,7 @@ public static class bgfx /// Discard or preserve states. See `BGFX_DISCARD_*`. /// [LinkName("bgfx_encoder_dispatch_indirect")] - public static extern void encoder_dispatch_indirect(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, uint16 _num, uint8 _flags); + public static extern void encoder_dispatch_indirect(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, uint32 _num, uint8 _flags); /// /// Discard previously set state for draw or compute call. @@ -4221,10 +4225,11 @@ public static class bgfx /// graphics debugging tools. /// /// - /// Marker string. + /// Marker name. + /// Marker name length (if length is INT32_MAX, it's expected that _name is zero terminated string. /// [LinkName("bgfx_set_marker")] - public static extern void set_marker(char8* _marker); + public static extern void set_marker(char8* _name, int _len); /// /// Set render states for draw primitive. @@ -4559,7 +4564,7 @@ public static class bgfx /// Which states to discard for next draw. See `BGFX_DISCARD_*`. /// [LinkName("bgfx_submit_indirect")] - public static extern void submit_indirect(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, uint16 _num, uint32 _depth, uint8 _flags); + public static extern void submit_indirect(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, uint32 _num, uint32 _depth, uint8 _flags); /// /// Submit primitive for rendering with index and instance data info and @@ -4578,7 +4583,7 @@ public static class bgfx /// Which states to discard for next draw. See `BGFX_DISCARD_*`. /// [LinkName("bgfx_submit_indirect_count")] - public static extern void submit_indirect_count(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint16 _numMax, uint32 _depth, uint8 _flags); + public static extern void submit_indirect_count(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint32 _numMax, uint32 _depth, uint8 _flags); /// /// Set compute index buffer. @@ -4674,7 +4679,7 @@ public static class bgfx /// Discard or preserve states. See `BGFX_DISCARD_*`. /// [LinkName("bgfx_dispatch_indirect")] - public static extern void dispatch_indirect(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, uint16 _num, uint8 _flags); + public static extern void dispatch_indirect(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, uint32 _num, uint8 _flags); /// /// Discard previously set state for draw or compute call. diff --git a/bgfx/bindings/cs/bgfx.cs b/bgfx/bindings/cs/bgfx.cs index baccff2c..499439e6 100644 --- a/bgfx/bindings/cs/bgfx.cs +++ b/bgfx/bindings/cs/bgfx.cs @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -1035,136 +1035,136 @@ public enum CapsFlags : ulong /// DrawIndirect = 0x0000000000000010, + /// + /// Draw indirect with indirect count is supported. + /// + DrawIndirectCount = 0x0000000000000020, + /// /// Fragment depth is available in fragment shader. /// - FragmentDepth = 0x0000000000000020, + FragmentDepth = 0x0000000000000040, /// /// Fragment ordering is available in fragment shader. /// - FragmentOrdering = 0x0000000000000040, + FragmentOrdering = 0x0000000000000080, /// /// Graphics debugger is present. /// - GraphicsDebugger = 0x0000000000000080, + GraphicsDebugger = 0x0000000000000100, /// /// HDR10 rendering is supported. /// - Hdr10 = 0x0000000000000100, + Hdr10 = 0x0000000000000200, /// /// HiDPI rendering is supported. /// - Hidpi = 0x0000000000000200, + Hidpi = 0x0000000000000400, /// /// Image Read/Write is supported. /// - ImageRw = 0x0000000000000400, + ImageRw = 0x0000000000000800, /// /// 32-bit indices are supported. /// - Index32 = 0x0000000000000800, + Index32 = 0x0000000000001000, /// /// Instancing is supported. /// - Instancing = 0x0000000000001000, + Instancing = 0x0000000000002000, /// /// Occlusion query is supported. /// - OcclusionQuery = 0x0000000000002000, - - /// - /// Renderer is on separate thread. - /// - RendererMultithreaded = 0x0000000000004000, + OcclusionQuery = 0x0000000000004000, /// - /// Multiple windows are supported. + /// PrimitiveID is available in fragment shader. /// - SwapChain = 0x0000000000008000, + PrimitiveId = 0x0000000000008000, /// - /// 2D texture array is supported. + /// Renderer is on separate thread. /// - Texture2dArray = 0x0000000000010000, + RendererMultithreaded = 0x0000000000010000, /// - /// 3D textures are supported. + /// Multiple windows are supported. /// - Texture3d = 0x0000000000020000, + SwapChain = 0x0000000000020000, /// /// Texture blit is supported. /// TextureBlit = 0x0000000000040000, - /// - /// Transparent back buffer supported. - /// - TransparentBackbuffer = 0x0000000000080000, - TextureCompareReserved = 0x0000000000100000, - /// /// Texture compare less equal mode is supported. /// - TextureCompareLequal = 0x0000000000200000, + TextureCompareLequal = 0x0000000000080000, + TextureCompareReserved = 0x0000000000100000, /// /// Cubemap texture array is supported. /// - TextureCubeArray = 0x0000000000400000, + TextureCubeArray = 0x0000000000200000, /// /// CPU direct access to GPU texture memory. /// - TextureDirectAccess = 0x0000000000800000, + TextureDirectAccess = 0x0000000000400000, /// /// Read-back texture is supported. /// - TextureReadBack = 0x0000000001000000, + TextureReadBack = 0x0000000000800000, /// - /// Vertex attribute half-float is supported. + /// 2D texture array is supported. /// - VertexAttribHalf = 0x0000000002000000, + Texture2dArray = 0x0000000001000000, /// - /// Vertex attribute 10_10_10_2 is supported. + /// 3D textures are supported. /// - VertexAttribUint10 = 0x0000000004000000, + Texture3d = 0x0000000002000000, /// - /// Rendering with VertexID only is supported. + /// Transparent back buffer supported. /// - VertexId = 0x0000000008000000, + TransparentBackbuffer = 0x0000000004000000, /// - /// PrimitiveID is available in fragment shader. + /// Vertex attribute half-float is supported. /// - PrimitiveId = 0x0000000010000000, + VertexAttribHalf = 0x0000000008000000, /// - /// Viewport layer is available in vertex shader. + /// Vertex attribute 10_10_10_2 is supported. /// - ViewportLayerArray = 0x0000000020000000, + VertexAttribUint10 = 0x0000000010000000, /// - /// Draw indirect with indirect count is supported. + /// Rendering with VertexID only is supported. + /// + VertexId = 0x0000000020000000, + + /// + /// Viewport layer is available in vertex shader. /// - DrawIndirectCount = 0x0000000040000000, + ViewportLayerArray = 0x0000000040000000, /// /// All texture compare modes are supported. /// - TextureCompareAll = 0x0000000000300000, + TextureCompareAll = 0x0000000000180000, } [Flags] @@ -1371,11 +1371,6 @@ public enum RendererType /// Agc, - /// - /// Direct3D 9.0 - /// - Direct3D9, - /// /// Direct3D 11.0 /// @@ -1416,11 +1411,6 @@ public enum RendererType /// Vulkan, - /// - /// WebGPU - /// - WebGPU, - Count } @@ -2395,16 +2385,6 @@ public struct VertexLayoutHandle { [DllImport(DllName, EntryPoint="bgfx_vertex_layout_decode", CallingConvention = CallingConvention.Cdecl)] public static extern unsafe void vertex_layout_decode(VertexLayout* _this, Attrib _attrib, byte * _num, AttribType* _type, bool* _normalized, bool* _asInt); - /// - /// Returns `true` if VertexLayout contains attribute. - /// - /// - /// Attribute semantics. See: `bgfx::Attrib` - /// - [DllImport(DllName, EntryPoint="bgfx_vertex_layout_has", CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - public static extern unsafe bool vertex_layout_has(VertexLayout* _this, Attrib _attrib); - /// /// Skip `_num` bytes in vertex stream. /// @@ -2526,6 +2506,12 @@ public struct VertexLayoutHandle { [DllImport(DllName, EntryPoint="bgfx_get_renderer_name", CallingConvention = CallingConvention.Cdecl)] public static extern unsafe IntPtr get_renderer_name(RendererType _type); + /// + /// Fill bgfx::Init struct with default values, before using it to initialize the library. + /// + /// + /// Pointer to structure to be initialized. See: `bgfx::Init` for more info. + /// [DllImport(DllName, EntryPoint="bgfx_init_ctor", CallingConvention = CallingConvention.Cdecl)] public static extern unsafe void init_ctor(Init* _init); @@ -2969,6 +2955,8 @@ public struct VertexLayoutHandle { /// /// Create shader from memory buffer. + /// @remarks + /// Shader binary is obtained by compiling shader offline with shaderc command line tool. /// /// /// Shader binary. @@ -3431,6 +3419,19 @@ public struct VertexLayoutHandle { [DllImport(DllName, EntryPoint="bgfx_set_palette_color", CallingConvention = CallingConvention.Cdecl)] public static extern unsafe void set_palette_color(byte _index, float _rgba); + /// + /// Set palette color value. + /// + /// + /// Index into palette. + /// Red value (RGBA floating point values) + /// Green value (RGBA floating point values) + /// Blue value (RGBA floating point values) + /// Alpha value (RGBA floating point values) + /// + [DllImport(DllName, EntryPoint="bgfx_set_palette_color_rgba32f", CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe void set_palette_color_rgba32f(byte _index, float _r, float _g, float _b, float _a); + /// /// Set palette color value. /// @@ -3454,9 +3455,10 @@ public struct VertexLayoutHandle { /// /// View id. /// View name. + /// View name length (if length is INT32_MAX, it's expected that _name is zero terminated string. /// [DllImport(DllName, EntryPoint="bgfx_set_view_name", CallingConvention = CallingConvention.Cdecl)] - public static extern unsafe void set_view_name(ushort _id, [MarshalAs(UnmanagedType.LPStr)] string _name); + public static extern unsafe void set_view_name(ushort _id, [MarshalAs(UnmanagedType.LPStr)] string _name, int _len); /// /// Set view rectangle. Draw primitive outside view will be clipped. @@ -3609,10 +3611,11 @@ public struct VertexLayoutHandle { /// graphics debugging tools. /// /// - /// Marker string. + /// Marker name. + /// Marker name length (if length is INT32_MAX, it's expected that _name is zero terminated string. /// [DllImport(DllName, EntryPoint="bgfx_encoder_set_marker", CallingConvention = CallingConvention.Cdecl)] - public static extern unsafe void encoder_set_marker(Encoder* _this, [MarshalAs(UnmanagedType.LPStr)] string _marker); + public static extern unsafe void encoder_set_marker(Encoder* _this, [MarshalAs(UnmanagedType.LPStr)] string _name, int _len); /// /// Set render states for draw primitive. @@ -3939,7 +3942,7 @@ public struct VertexLayoutHandle { /// Discard or preserve states. See `BGFX_DISCARD_*`. /// [DllImport(DllName, EntryPoint="bgfx_encoder_submit_indirect", CallingConvention = CallingConvention.Cdecl)] - public static extern unsafe void encoder_submit_indirect(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags); + public static extern unsafe void encoder_submit_indirect(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, uint _num, uint _depth, byte _flags); /// /// Submit primitive for rendering with index and instance data info and @@ -3958,7 +3961,7 @@ public struct VertexLayoutHandle { /// Discard or preserve states. See `BGFX_DISCARD_*`. /// [DllImport(DllName, EntryPoint="bgfx_encoder_submit_indirect_count", CallingConvention = CallingConvention.Cdecl)] - public static extern unsafe void encoder_submit_indirect_count(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, IndexBufferHandle _numHandle, uint _numIndex, ushort _numMax, uint _depth, byte _flags); + public static extern unsafe void encoder_submit_indirect_count(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, IndexBufferHandle _numHandle, uint _numIndex, uint _numMax, uint _depth, byte _flags); /// /// Set compute index buffer. @@ -4054,7 +4057,7 @@ public struct VertexLayoutHandle { /// Discard or preserve states. See `BGFX_DISCARD_*`. /// [DllImport(DllName, EntryPoint="bgfx_encoder_dispatch_indirect", CallingConvention = CallingConvention.Cdecl)] - public static extern unsafe void encoder_dispatch_indirect(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, byte _flags); + public static extern unsafe void encoder_dispatch_indirect(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, uint _num, byte _flags); /// /// Discard previously set state for draw or compute call. @@ -4177,10 +4180,11 @@ public struct VertexLayoutHandle { /// graphics debugging tools. /// /// - /// Marker string. + /// Marker name. + /// Marker name length (if length is INT32_MAX, it's expected that _name is zero terminated string. /// [DllImport(DllName, EntryPoint="bgfx_set_marker", CallingConvention = CallingConvention.Cdecl)] - public static extern unsafe void set_marker([MarshalAs(UnmanagedType.LPStr)] string _marker); + public static extern unsafe void set_marker([MarshalAs(UnmanagedType.LPStr)] string _name, int _len); /// /// Set render states for draw primitive. @@ -4515,7 +4519,7 @@ public struct VertexLayoutHandle { /// Which states to discard for next draw. See `BGFX_DISCARD_*`. /// [DllImport(DllName, EntryPoint="bgfx_submit_indirect", CallingConvention = CallingConvention.Cdecl)] - public static extern unsafe void submit_indirect(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags); + public static extern unsafe void submit_indirect(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, uint _num, uint _depth, byte _flags); /// /// Submit primitive for rendering with index and instance data info and @@ -4534,7 +4538,7 @@ public struct VertexLayoutHandle { /// Which states to discard for next draw. See `BGFX_DISCARD_*`. /// [DllImport(DllName, EntryPoint="bgfx_submit_indirect_count", CallingConvention = CallingConvention.Cdecl)] - public static extern unsafe void submit_indirect_count(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, IndexBufferHandle _numHandle, uint _numIndex, ushort _numMax, uint _depth, byte _flags); + public static extern unsafe void submit_indirect_count(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, IndexBufferHandle _numHandle, uint _numIndex, uint _numMax, uint _depth, byte _flags); /// /// Set compute index buffer. @@ -4630,7 +4634,7 @@ public struct VertexLayoutHandle { /// Discard or preserve states. See `BGFX_DISCARD_*`. /// [DllImport(DllName, EntryPoint="bgfx_dispatch_indirect", CallingConvention = CallingConvention.Cdecl)] - public static extern unsafe void dispatch_indirect(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, byte _flags); + public static extern unsafe void dispatch_indirect(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, uint _num, byte _flags); /// /// Discard previously set state for draw or compute call. diff --git a/bgfx/bindings/cs/bgfx_dllname.cs b/bgfx/bindings/cs/bgfx_dllname.cs index 32418ce4..7ba7c3c7 100644 --- a/bgfx/bindings/cs/bgfx_dllname.cs +++ b/bgfx/bindings/cs/bgfx_dllname.cs @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/bindings/d/fakeenum.d b/bgfx/bindings/d/fakeenum.d index 4fdc6135..a0a44f37 100644 --- a/bgfx/bindings/d/fakeenum.d +++ b/bgfx/bindings/d/fakeenum.d @@ -14,7 +14,7 @@ extern(C++, "bgfx") package final abstract class Fatal{ } extern(C++, "bgfx") package final abstract class RendererType{ enum Enum{ - noop,agc,direct3D9,direct3D11,direct3D12,gnm,metal,nvn,openGLES,openGL,vulkan,webGPU,count + noop,agc,direct3D11,direct3D12,gnm,metal,nvn,openGLES,openGL,vulkan,count } } extern(C++, "bgfx") package final abstract class Access{ @@ -72,6 +72,11 @@ extern(C++, "bgfx") package final abstract class ViewMode{ default_,sequential,depthAscending,depthDescending,count } } +extern(C++, "bgfx") package final abstract class NativeWindowHandleType{ + enum Enum{ + default_,wayland,count + } +} extern(C++, "bgfx") package final abstract class RenderFrame{ enum Enum{ noContext,render,timeout,exiting,count diff --git a/bgfx/bindings/d/package.d b/bgfx/bindings/d/package.d index 606959c6..d696b590 100644 --- a/bgfx/bindings/d/package.d +++ b/bgfx/bindings/d/package.d @@ -7,13 +7,12 @@ module bgfx; import bindbc.bgfx.config; -import bindbc.common.types: va_list; +import bindbc.common.types: c_int64, c_uint64, va_list; static import bgfx.fakeenum; -enum uint apiVersion = 122; +enum uint apiVersion = 129; alias ViewID = ushort; -deprecated("Please use `ViewID` instead.") alias ViewId = ushort; enum invalidHandle(T) = T(ushort.max); @@ -106,7 +105,7 @@ enum StateAlphaRef: StateAlphaRef_{ shift = 40, ///Alpha reference bit shift mask = 0x0000_FF00_0000_0000, ///Alpha reference bit mask } -StateAlphaRef_ toStateAlphaRef(ulong v){ return (v << StateAlphaRef.shift) & StateAlphaRef.mask; } +StateAlphaRef_ toStateAlphaRef(ulong v) nothrow @nogc pure @safe{ return (v << StateAlphaRef.shift) & StateAlphaRef.mask; } alias StatePT_ = ulong; enum StatePT: StatePT_{ @@ -124,7 +123,7 @@ enum StatePointSize: StatePointSize_{ shift = 52, ///Point size bit shift mask = 0x00F0_0000_0000_0000, ///Point size bit mask } -StatePointSize_ toStatePointSize(ulong v){ return (v << StatePointSize.shift) & StatePointSize.mask; } +StatePointSize_ toStatePointSize(ulong v) nothrow @nogc pure @safe{ return (v << StatePointSize.shift) & StatePointSize.mask; } /** Enable MSAA write when writing into MSAA frame buffer. @@ -161,15 +160,15 @@ enum StencilFuncRef: StencilFuncRef_{ shift = 0, mask = 0x0000_00FF, } -StencilFuncRef_ toStencilFuncRef(uint v){ return (v << StencilFuncRef.shift) & StencilFuncRef.mask; } +StencilFuncRef_ toStencilFuncRef(uint v) nothrow @nogc pure @safe{ return (v << StencilFuncRef.shift) & StencilFuncRef.mask; } ///Set stencil rmask value. -alias StencilFuncRmask_ = uint; -enum StencilFuncRmask: StencilFuncRmask_{ +alias StencilFuncRMask_ = uint; +enum StencilFuncRMask: StencilFuncRMask_{ shift = 8, mask = 0x0000_FF00, } -StencilFuncRmask_ toStencilFuncRmask(uint v){ return (v << StencilFuncRmask.shift) & StencilFuncRmask.mask; } +StencilFuncRMask_ toStencilFuncRMask(uint v) nothrow @nogc pure @safe{ return (v << StencilFuncRMask.shift) & StencilFuncRMask.mask; } alias Stencil_ = uint; enum Stencil: Stencil_{ @@ -428,7 +427,7 @@ enum SamplerBorderColor: SamplerBorderColor_{ mask = 0x0F00_0000, } alias SamplerBorderColour = SamplerBorderColor; -SamplerBorderColor_ toSamplerBorderColor(uint v){ return (v << SamplerBorderColor.shift) & SamplerBorderColor.mask; } +SamplerBorderColor_ toSamplerBorderColor(uint v) nothrow @nogc pure @safe{ return (v << SamplerBorderColor.shift) & SamplerBorderColor.mask; } alias toSamplerBorderColour = toSamplerBorderColor; alias SamplerReserved_ = uint; @@ -498,33 +497,33 @@ enum CapFlags: CapFlags_{ compute = 0x0000_0000_0000_0004, ///Compute shaders are supported. conservativeRaster = 0x0000_0000_0000_0008, ///Conservative rasterization is supported. drawIndirect = 0x0000_0000_0000_0010, ///Draw indirect is supported. - fragmentDepth = 0x0000_0000_0000_0020, ///Fragment depth is available in fragment shader. - fragmentOrdering = 0x0000_0000_0000_0040, ///Fragment ordering is available in fragment shader. - graphicsDebugger = 0x0000_0000_0000_0080, ///Graphics debugger is present. - hdr10 = 0x0000_0000_0000_0100, ///HDR10 rendering is supported. - hiDPI = 0x0000_0000_0000_0200, ///HiDPI rendering is supported. - imageRW = 0x0000_0000_0000_0400, ///Image Read/Write is supported. - index32 = 0x0000_0000_0000_0800, ///32-bit indices are supported. - instancing = 0x0000_0000_0000_1000, ///Instancing is supported. - occlusionQuery = 0x0000_0000_0000_2000, ///Occlusion query is supported. - rendererMultithreaded = 0x0000_0000_0000_4000, ///Renderer is on separate thread. - swapChain = 0x0000_0000_0000_8000, ///Multiple windows are supported. - texture2DArray = 0x0000_0000_0001_0000, ///2D texture array is supported. - texture3D = 0x0000_0000_0002_0000, ///3D textures are supported. + drawIndirectCount = 0x0000_0000_0000_0020, ///Draw indirect with indirect count is supported. + fragmentDepth = 0x0000_0000_0000_0040, ///Fragment depth is available in fragment shader. + fragmentOrdering = 0x0000_0000_0000_0080, ///Fragment ordering is available in fragment shader. + graphicsDebugger = 0x0000_0000_0000_0100, ///Graphics debugger is present. + hdr10 = 0x0000_0000_0000_0200, ///HDR10 rendering is supported. + hiDPI = 0x0000_0000_0000_0400, ///HiDPI rendering is supported. + imageRW = 0x0000_0000_0000_0800, ///Image Read/Write is supported. + index32 = 0x0000_0000_0000_1000, ///32-bit indices are supported. + instancing = 0x0000_0000_0000_2000, ///Instancing is supported. + occlusionQuery = 0x0000_0000_0000_4000, ///Occlusion query is supported. + primitiveID = 0x0000_0000_0000_8000, ///PrimitiveID is available in fragment shader. + rendererMultithreaded = 0x0000_0000_0001_0000, ///Renderer is on separate thread. + swapChain = 0x0000_0000_0002_0000, ///Multiple windows are supported. textureBlit = 0x0000_0000_0004_0000, ///Texture blit is supported. - transparentBackbuffer = 0x0000_0000_0008_0000, ///Transparent back buffer supported. + textureCompareLEqual = 0x0000_0000_0008_0000, ///Texture compare less equal mode is supported. textureCompareReserved = 0x0000_0000_0010_0000, - textureCompareLEqual = 0x0000_0000_0020_0000, ///Texture compare less equal mode is supported. - textureCubeArray = 0x0000_0000_0040_0000, ///Cubemap texture array is supported. - textureDirectAccess = 0x0000_0000_0080_0000, ///CPU direct access to GPU texture memory. - textureReadBack = 0x0000_0000_0100_0000, ///Read-back texture is supported. - vertexAttribHalf = 0x0000_0000_0200_0000, ///Vertex attribute half-float is supported. - vertexAttribUint10 = 0x0000_0000_0400_0000, ///Vertex attribute 10_10_10_2 is supported. - vertexID = 0x0000_0000_0800_0000, ///Rendering with VertexID only is supported. - primitiveID = 0x0000_0000_1000_0000, ///PrimitiveID is available in fragment shader. - viewportLayerArray = 0x0000_0000_2000_0000, ///Viewport layer is available in vertex shader. - drawIndirectCount = 0x0000_0000_4000_0000, ///Draw indirect with indirect count is supported. - textureCompareAll = 0x0000_0000_0030_0000, ///All texture compare modes are supported. + textureCubeArray = 0x0000_0000_0020_0000, ///Cubemap texture array is supported. + textureDirectAccess = 0x0000_0000_0040_0000, ///CPU direct access to GPU texture memory. + textureReadBack = 0x0000_0000_0080_0000, ///Read-back texture is supported. + texture2DArray = 0x0000_0000_0100_0000, ///2D texture array is supported. + texture3D = 0x0000_0000_0200_0000, ///3D textures are supported. + transparentBackbuffer = 0x0000_0000_0400_0000, ///Transparent back buffer supported. + vertexAttribHalf = 0x0000_0000_0800_0000, ///Vertex attribute half-float is supported. + vertexAttribUint10 = 0x0000_0000_1000_0000, ///Vertex attribute 10_10_10_2 is supported. + vertexID = 0x0000_0000_2000_0000, ///Rendering with VertexID only is supported. + viewportLayerArray = 0x0000_0000_4000_0000, ///Viewport layer is available in vertex shader. + textureCompareAll = 0x0000_0000_0018_0000, ///All texture compare modes are supported. } alias CapsFormat_ = uint; @@ -592,7 +591,6 @@ enum Fatal: bgfx.fakeenum.Fatal.Enum{ enum RendererType: bgfx.fakeenum.RendererType.Enum{ noop = bgfx.fakeenum.RendererType.Enum.noop, agc = bgfx.fakeenum.RendererType.Enum.agc, - direct3D9 = bgfx.fakeenum.RendererType.Enum.direct3D9, direct3D11 = bgfx.fakeenum.RendererType.Enum.direct3D11, direct3D12 = bgfx.fakeenum.RendererType.Enum.direct3D12, gnm = bgfx.fakeenum.RendererType.Enum.gnm, @@ -601,7 +599,6 @@ enum RendererType: bgfx.fakeenum.RendererType.Enum{ openGLES = bgfx.fakeenum.RendererType.Enum.openGLES, openGL = bgfx.fakeenum.RendererType.Enum.openGL, vulkan = bgfx.fakeenum.RendererType.Enum.vulkan, - webGPU = bgfx.fakeenum.RendererType.Enum.webGPU, count = bgfx.fakeenum.RendererType.Enum.count, } @@ -907,57 +904,57 @@ pragma(inline,true) nothrow @nogc pure @safe{ StateBlend_ blendFuncSeparate(StateBlend_ srcRGB, StateBlend_ dstRGB, StateBlend_ srcA, StateBlend_ dstA){ return (srcRGB | ((dstRGB) << 4)) | ((srcA | (dstA << 4)) << 8); } - + ///Blend equation separate. StateBlendEquation_ blendEquationSeparate(StateBlendEquation_ equationRGB, StateBlendEquation_ equationA){ return equationRGB | (equationA << 3); } - + ///Blend function. StateBlend_ blendFunc(StateBlend_ src, StateBlend_ dst){ return blendFuncSeparate(src, dst, src, dst); } - + ///Blend equation. StateBlendEquation_ blendEquation(StateBlendEquation_ equation){ return blendEquationSeparate(equation, equation); } - + ///Utility predefined blend modes. enum StateBlendFunc: StateBlend_{ ///Additive blending. add = blendFunc(StateBlend.one, StateBlend.one), - + ///Alpha blend. alpha = blendFunc(StateBlend.srcAlpha, StateBlend.invSrcAlpha), - + ///Selects darker color of blend. darken = blendFunc(StateBlend.one, StateBlend.one) | blendEquation(StateBlendEquation.min), - + ///Selects lighter color of blend. lighten = blendFunc(StateBlend.one, StateBlend.one) | blendEquation(StateBlendEquation.max), - + ///Multiplies colors. multiply = blendFunc(StateBlend.dstColor, StateBlend.zero), - + ///Opaque pixels will cover the pixels directly below them without any math or algorithm applied to them. normal = blendFunc(StateBlend.one, StateBlend.invSrcAlpha), - + ///Multiplies the inverse of the blend and base colors. screen = blendFunc(StateBlend.one, StateBlend.invSrcColor), - + ///Decreases the brightness of the base color based on the value of the blend color. linearBurn = blendFunc(StateBlend.dstColor, StateBlend.invDstColor) | blendEquation(StateBlendEquation.sub), } - + StateBlend_ blendFuncRTx(StateBlend_ src, StateBlend_ dst){ return cast(uint)(src >> StateBlend.shift) | (cast(uint)(dst >> StateBlend.shift) << 4); } - + StateBlend_ blendFuncRTxE(StateBlend_ src, StateBlend_ dst, StateBlendEquation_ equation){ return blendFuncRTx(src, dst) | (cast(uint)(equation >> StateBlendEquation.shift) << 8); } - + StateBlend_ blendFuncRT1(StateBlend_ src, StateBlend_ dst){ return blendFuncRTx(src, dst) << 0; } StateBlend_ blendFuncRT2(StateBlend_ src, StateBlend_ dst){ return blendFuncRTx(src, dst) << 11; } StateBlend_ blendFuncRT3(StateBlend_ src, StateBlend_ dst){ return blendFuncRTx(src, dst) << 22; } - + StateBlend_ blendFuncRT1E(StateBlend_ src, StateBlend_ dst, StateBlendEquation_ equation){ return blendFuncRTxE(src, dst, equation) << 0; } @@ -1010,7 +1007,7 @@ extern(C++, "bgfx") struct Caps{ Supported functionality. @attention See `BGFX_CAPS_*` flags at https://bkaradzic.github.io/bgfx/bgfx.html#available-caps */ - ulong supported; + c_uint64 supported; ushort vendorID; ///Selected GPU vendor PCI id. ushort deviceID; ///Selected GPU device id. bool homogeneousDepth; ///True when NDC depth is in [-1, 1] range, otherwise its [0, 1]. @@ -1093,12 +1090,11 @@ extern(C++, "bgfx") struct Resolution{ ubyte maxFrameLatency; ///Maximum frame latency. ubyte debugTextScale; ///Scale factor for debug text. extern(D) mixin(joinFnBinds((){ - string[][] ret; - ret ~= makeFnBinds([ - [q{void}, q{this}, q{}, `C++`], - ], true); + FnBind[] ret = [ + {q{void}, q{this}, q{}, ext: `C++`}, + ]; return ret; - }(), typeof(this).stringof)); + }())); } ///Initialization parameters used by `bgfx::init`. @@ -1109,6 +1105,12 @@ extern(C++, "bgfx") struct Init{ uint minResourceCBSize; ///Minimum resource command buffer size. uint transientVBSize; ///Maximum transient vertex buffer size. uint transientIBSize; ///Maximum transient index buffer size. + extern(D) mixin(joinFnBinds((){ + FnBind[] ret = [ + {q{void}, q{this}, q{}, ext: `C++`}, + ]; + return ret; + }())); } /** @@ -1136,7 +1138,7 @@ extern(C++, "bgfx") struct Init{ matching ID. */ ushort deviceID; - ulong capabilities; ///Capabilities initialization mask (default: UINT64_MAX). + c_uint64 capabilities; ///Capabilities initialization mask (default: UINT64_MAX). bool debug_; ///Enable device for debugging. bool profile; ///Enable device for profiling. PlatformData platformData; ///Platform data. @@ -1156,12 +1158,11 @@ extern(C++, "bgfx") struct Init{ */ void* allocator; extern(D) mixin(joinFnBinds((){ - string[][] ret; - ret ~= makeFnBinds([ - [q{void}, q{this}, q{}, `C++`], - ], true); + FnBind[] ret = [ + {q{void}, q{this}, q{}, ext: `C++`}, + ]; return ret; - }(), typeof(this).stringof)); + }())); } /** @@ -1231,8 +1232,7 @@ extern(C++, "bgfx") struct Attachment{ ushort numLayers; ///Number of texture layer/slice(s) in array to use. ubyte resolve; ///Resolve flags. See: `BGFX_RESOLVE_*` extern(D) mixin(joinFnBinds((){ - string[][] ret; - ret ~= makeFnBinds([ + FnBind[] ret = [ /** Init attachment. Params: @@ -1243,10 +1243,10 @@ extern(C++, "bgfx") struct Attachment{ mip = Mip level. resolve = Resolve flags. See: `BGFX_RESOLVE_*` */ - [q{void}, q{init}, q{TextureHandle handle, bgfx.fakeenum.Access.Enum access=Access.write, ushort layer=0, ushort numLayers=1, ushort mip=0, ubyte resolve=Resolve.autoGenMIPs}, `C++`], - ], true); + {q{void}, q{init}, q{TextureHandle handle, bgfx.fakeenum.Access.Enum access=Access.write, ushort layer=0, ushort numLayers=1, ushort mip=0, ubyte resolve=Resolve.autoGenMIPs}, ext: `C++`}, + ]; return ret; - }(), typeof(this).stringof)); + }())); } ///Transform data. @@ -1259,17 +1259,17 @@ extern(C++, "bgfx") struct Transform{ extern(C++, "bgfx") struct ViewStats{ char[256] name; ///View name. ViewID view; ///View id. - long cpuTimeBegin; ///CPU (submit) begin time. - long cpuTimeEnd; ///CPU (submit) end time. - long gpuTimeBegin; ///GPU begin time. - long gpuTimeEnd; ///GPU end time. + c_int64 cpuTimeBegin; ///CPU (submit) begin time. + c_int64 cpuTimeEnd; ///CPU (submit) end time. + c_int64 gpuTimeBegin; ///GPU begin time. + c_int64 gpuTimeEnd; ///GPU end time. uint gpuFrameNum; ///Frame which generated gpuTimeBegin, gpuTimeEnd. } ///Encoder stats. extern(C++, "bgfx") struct EncoderStats{ - long cpuTimeBegin; ///Encoder thread CPU submit begin time. - long cpuTimeEnd; ///Encoder thread CPU submit end time. + c_int64 cpuTimeBegin; ///Encoder thread CPU submit begin time. + c_int64 cpuTimeEnd; ///Encoder thread CPU submit end time. } /** @@ -1278,15 +1278,15 @@ Renderer statistics data. time frequencies define timestamps-per-second for that hardware. */ extern(C++, "bgfx") struct Stats{ - long cpuTimeFrame; ///CPU time between two `bgfx::frame` calls. - long cpuTimeBegin; ///Render thread CPU submit begin time. - long cpuTimeEnd; ///Render thread CPU submit end time. - long cpuTimerFreq; ///CPU timer frequency. Timestamps-per-second - long gpuTimeBegin; ///GPU frame begin time. - long gpuTimeEnd; ///GPU frame end time. - long gpuTimerFreq; ///GPU timer frequency. - long waitRender; ///Time spent waiting for render backend thread to finish issuing draw commands to underlying graphics API. - long waitSubmit; ///Time spent waiting for submit thread to advance to next frame. + c_int64 cpuTimeFrame; ///CPU time between two `bgfx::frame` calls. + c_int64 cpuTimeBegin; ///Render thread CPU submit begin time. + c_int64 cpuTimeEnd; ///Render thread CPU submit end time. + c_int64 cpuTimerFreq; ///CPU timer frequency. Timestamps-per-second + c_int64 gpuTimeBegin; ///GPU frame begin time. + c_int64 gpuTimeEnd; ///GPU frame end time. + c_int64 gpuTimerFreq; ///GPU timer frequency. + c_int64 waitRender; ///Time spent waiting for render backend thread to finish issuing draw commands to underlying graphics API. + c_int64 waitSubmit; ///Time spent waiting for submit thread to advance to next frame. uint numDraw; ///Number of draw calls submitted. uint numCompute; ///Number of compute calls submitted. uint numBlit; ///Number of blit calls submitted. @@ -1303,13 +1303,13 @@ extern(C++, "bgfx") struct Stats{ ushort numUniforms; ///Number of used uniforms. ushort numVertexBuffers; ///Number of used vertex buffers. ushort numVertexLayouts; ///Number of used vertex layouts. - long textureMemoryUsed; ///Estimate of texture memory used. - long rtMemoryUsed; ///Estimate of render target memory used. + c_int64 textureMemoryUsed; ///Estimate of texture memory used. + c_int64 rtMemoryUsed; ///Estimate of render target memory used. int transientVBUsed; ///Amount of transient vertex buffer used. int transientIBUsed; ///Amount of transient index buffer used. uint[Topology.count] numPrims; ///Number of primitives rendered. - long gpuMemoryMax; ///Maximum available GPU memory for application. - long gpuMemoryUsed; ///Amount of GPU memory used by the application. + c_int64 gpuMemoryMax; ///Maximum available GPU memory for application. + c_int64 gpuMemoryUsed; ///Amount of GPU memory used by the application. ushort width; ///Backbuffer width in pixels. ushort height; ///Backbuffer height in pixels. ushort textWidth; ///Debug text width in characters. @@ -1327,16 +1327,15 @@ extern(C++, "bgfx") struct VertexLayout{ ushort[Attrib.count] offset; ///Attribute offsets. ushort[Attrib.count] attributes; ///Used attributes. extern(D) mixin(joinFnBinds((){ - string[][] ret; - ret ~= makeFnBinds([ - [q{void}, q{this}, q{}, `C++`], + FnBind[] ret = [ + {q{void}, q{this}, q{}, ext: `C++`}, /** Start VertexLayout. Params: rendererType = Renderer backend type. See: `bgfx::RendererType` */ - [q{VertexLayout*}, q{begin}, q{bgfx.fakeenum.RendererType.Enum rendererType=RendererType.noop}, `C++`], + {q{VertexLayout*}, q{begin}, q{bgfx.fakeenum.RendererType.Enum rendererType=RendererType.noop}, ext: `C++`}, /** Add attribute to VertexLayout. @@ -1345,7 +1344,7 @@ extern(C++, "bgfx") struct VertexLayout{ attrib = Attribute semantics. See: `bgfx::Attrib` num = Number of elements 1, 2, 3 or 4. type = Element type. - normalized = When using fixed point AttribType (f.e. Uint8) + normalised = When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader. @@ -1353,7 +1352,7 @@ extern(C++, "bgfx") struct VertexLayout{ vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader. */ - [q{VertexLayout*}, q{add}, q{bgfx.fakeenum.Attrib.Enum attrib, ubyte num, bgfx.fakeenum.AttribType.Enum type, bool normalized=false, bool asInt=false}, `C++`], + {q{VertexLayout*}, q{add}, q{bgfx.fakeenum.Attrib.Enum attrib, ubyte num, bgfx.fakeenum.AttribType.Enum type, bool normalised=false, bool asInt=false}, ext: `C++`}, /** Decode attribute. @@ -1361,25 +1360,25 @@ extern(C++, "bgfx") struct VertexLayout{ attrib = Attribute semantics. See: `bgfx::Attrib` num = Number of elements. type = Element type. - normalized = Attribute is normalized. + normalised = Attribute is normalized. asInt = Attribute is packed as int. */ - [q{void}, q{decode}, q{bgfx.fakeenum.Attrib.Enum attrib, ref ubyte num, ref bgfx.fakeenum.AttribType.Enum type, ref bool normalized, ref bool asInt}, `C++`, q{const}], + {q{void}, q{decode}, q{bgfx.fakeenum.Attrib.Enum attrib, ref ubyte num, ref bgfx.fakeenum.AttribType.Enum type, ref bool normalised, ref bool asInt}, ext: `C++`, memAttr: q{const}}, /** Skip `_num` bytes in vertex stream. Params: num = Number of bytes to skip. */ - [q{VertexLayout*}, q{skip}, q{ubyte num}, `C++`], + {q{VertexLayout*}, q{skip}, q{ubyte num}, ext: `C++`}, /** End VertexLayout. */ - [q{void}, q{end}, q{}, `C++`], - ], true); + {q{void}, q{end}, q{}, ext: `C++`}, + ]; return ret; - }(), typeof(this).stringof)); + }())); } /** @@ -1388,15 +1387,16 @@ per thread should be used. Use `bgfx::begin()` to obtain an encoder for a thread */ extern(C++, "bgfx") struct Encoder{ extern(D) mixin(joinFnBinds((){ - string[][] ret; - ret ~= makeFnBinds([ + FnBind[] ret = [ /** Sets a debug marker. This allows you to group graphics calls together for easy browsing in graphics debugging tools. Params: - marker = Marker string. + name = Marker name. + len = Marker name length (if length is INT32_MAX, it's expected + that _name is zero terminated string. */ - [q{void}, q{setMarker}, q{const(char)* marker}, `C++`], + {q{void}, q{setMarker}, q{const(char)* name, int len=int.max}, ext: `C++`}, /** Set render states for draw primitive. @@ -1423,7 +1423,7 @@ extern(C++, "bgfx") struct Encoder{ rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes. */ - [q{void}, q{setState}, q{ulong state, uint rgba=0}, `C++`], + {q{void}, q{setState}, q{c_uint64 state, uint rgba=0}, ext: `C++`}, /** Set condition for rendering. @@ -1431,16 +1431,16 @@ extern(C++, "bgfx") struct Encoder{ handle = Occlusion query handle. visible = Render if occlusion query is visible. */ - [q{void}, q{setCondition}, q{OcclusionQueryHandle handle, bool visible}, `C++`], + {q{void}, q{setCondition}, q{OcclusionQueryHandle handle, bool visible}, ext: `C++`}, /** Set stencil test state. Params: - fstencil = Front stencil state. - bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE` + fStencil = Front stencil state. + bStencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE` _fstencil is applied to both front and back facing primitives. */ - [q{void}, q{setStencil}, q{uint fstencil, uint bstencil=Stencil.none}, `C++`], + {q{void}, q{setStencil}, q{uint fStencil, uint bStencil=Stencil.none}, ext: `C++`}, /** Set scissor for draw primitive. @@ -1452,7 +1452,7 @@ extern(C++, "bgfx") struct Encoder{ width = Width of view scissor region. height = Height of view scissor region. */ - [q{ushort}, q{setScissor}, q{ushort x, ushort y, ushort width, ushort height}, `C++`], + {q{ushort}, q{setScissor}, q{ushort x, ushort y, ushort width, ushort height}, ext: `C++`}, /** Set scissor from cache for draw primitive. @@ -1461,7 +1461,7 @@ extern(C++, "bgfx") struct Encoder{ Params: cache = Index in scissor cache. */ - [q{void}, q{setScissor}, q{ushort cache=ushort.max}, `C++`], + {q{void}, q{setScissor}, q{ushort cache=ushort.max}, ext: `C++`}, /** Set model matrix for draw primitive. If it is not called, @@ -1470,7 +1470,7 @@ extern(C++, "bgfx") struct Encoder{ mtx = Pointer to first matrix in array. num = Number of matrices in array. */ - [q{uint}, q{setTransform}, q{const(void)* mtx, ushort num=1}, `C++`], + {q{uint}, q{setTransform}, q{const(void)* mtx, ushort num=1}, ext: `C++`}, /** Set model matrix from matrix cache for draw primitive. @@ -1478,7 +1478,7 @@ extern(C++, "bgfx") struct Encoder{ cache = Index in matrix cache. num = Number of matrices from cache. */ - [q{void}, q{setTransform}, q{uint cache, ushort num=1}, `C++`], + {q{void}, q{setTransform}, q{uint cache, ushort num=1}, ext: `C++`}, /** Reserve matrices in internal matrix cache. @@ -1487,7 +1487,7 @@ extern(C++, "bgfx") struct Encoder{ transform = Pointer to `Transform` structure. num = Number of matrices. */ - [q{uint}, q{allocTransform}, q{Transform* transform, ushort num}, `C++`], + {q{uint}, q{allocTransform}, q{Transform* transform, ushort num}, ext: `C++`}, /** Set shader uniform parameter for draw primitive. @@ -1497,14 +1497,14 @@ extern(C++, "bgfx") struct Encoder{ num = Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation. */ - [q{void}, q{setUniform}, q{UniformHandle handle, const(void)* value, ushort num=1}, `C++`], + {q{void}, q{setUniform}, q{UniformHandle handle, const(void)* value, ushort num=1}, ext: `C++`}, /** Set index buffer for draw primitive. Params: handle = Index buffer. */ - [q{void}, q{setIndexBuffer}, q{IndexBufferHandle handle}, `C++`], + {q{void}, q{setIndexBuffer}, q{IndexBufferHandle handle}, ext: `C++`}, /** Set index buffer for draw primitive. @@ -1513,14 +1513,14 @@ extern(C++, "bgfx") struct Encoder{ firstIndex = First index to render. numIndices = Number of indices to render. */ - [q{void}, q{setIndexBuffer}, q{IndexBufferHandle handle, uint firstIndex, uint numIndices}, `C++`], + {q{void}, q{setIndexBuffer}, q{IndexBufferHandle handle, uint firstIndex, uint numIndices}, ext: `C++`}, /** Set index buffer for draw primitive. Params: handle = Dynamic index buffer. */ - [q{void}, q{setIndexBuffer}, q{DynamicIndexBufferHandle handle}, `C++`], + {q{void}, q{setIndexBuffer}, q{DynamicIndexBufferHandle handle}, ext: `C++`}, /** Set index buffer for draw primitive. @@ -1529,14 +1529,14 @@ extern(C++, "bgfx") struct Encoder{ firstIndex = First index to render. numIndices = Number of indices to render. */ - [q{void}, q{setIndexBuffer}, q{DynamicIndexBufferHandle handle, uint firstIndex, uint numIndices}, `C++`], + {q{void}, q{setIndexBuffer}, q{DynamicIndexBufferHandle handle, uint firstIndex, uint numIndices}, ext: `C++`}, /** Set index buffer for draw primitive. Params: tib = Transient index buffer. */ - [q{void}, q{setIndexBuffer}, q{const(TransientIndexBuffer)* tib}, `C++`], + {q{void}, q{setIndexBuffer}, q{const(TransientIndexBuffer)* tib}, ext: `C++`}, /** Set index buffer for draw primitive. @@ -1545,7 +1545,7 @@ extern(C++, "bgfx") struct Encoder{ firstIndex = First index to render. numIndices = Number of indices to render. */ - [q{void}, q{setIndexBuffer}, q{const(TransientIndexBuffer)* tib, uint firstIndex, uint numIndices}, `C++`], + {q{void}, q{setIndexBuffer}, q{const(TransientIndexBuffer)* tib, uint firstIndex, uint numIndices}, ext: `C++`}, /** Set vertex buffer for draw primitive. @@ -1553,7 +1553,7 @@ extern(C++, "bgfx") struct Encoder{ stream = Vertex stream. handle = Vertex buffer. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, VertexBufferHandle handle}, `C++`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, VertexBufferHandle handle}, ext: `C++`}, /** Set vertex buffer for draw primitive. @@ -1566,7 +1566,7 @@ extern(C++, "bgfx") struct Encoder{ handle is used, vertex layout used for creation of vertex buffer will be used. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, VertexBufferHandle handle, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, `C++`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, VertexBufferHandle handle, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, ext: `C++`}, /** Set vertex buffer for draw primitive. @@ -1574,8 +1574,8 @@ extern(C++, "bgfx") struct Encoder{ stream = Vertex stream. handle = Dynamic vertex buffer. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle}, `C++`], - [q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, `C++`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle}, ext: `C++`}, + {q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, ext: `C++`}, /** Set vertex buffer for draw primitive. @@ -1583,7 +1583,7 @@ extern(C++, "bgfx") struct Encoder{ stream = Vertex stream. tvb = Transient vertex buffer. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, const(TransientVertexBuffer)* tvb}, `C++`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, const(TransientVertexBuffer)* tvb}, ext: `C++`}, /** Set vertex buffer for draw primitive. @@ -1596,7 +1596,7 @@ extern(C++, "bgfx") struct Encoder{ handle is used, vertex layout used for creation of vertex buffer will be used. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, const(TransientVertexBuffer)* tvb, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, `C++`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, const(TransientVertexBuffer)* tvb, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, ext: `C++`}, /** Set number of vertices for auto generated vertices use in conjunction @@ -1605,14 +1605,14 @@ extern(C++, "bgfx") struct Encoder{ Params: numVertices = Number of vertices. */ - [q{void}, q{setVertexCount}, q{uint numVertices}, `C++`], + {q{void}, q{setVertexCount}, q{uint numVertices}, ext: `C++`}, /** Set instance data buffer for draw primitive. Params: idb = Transient instance data buffer. */ - [q{void}, q{setInstanceDataBuffer}, q{const(InstanceDataBuffer)* idb}, `C++`], + {q{void}, q{setInstanceDataBuffer}, q{const(InstanceDataBuffer)* idb}, ext: `C++`}, /** Set instance data buffer for draw primitive. @@ -1621,7 +1621,7 @@ extern(C++, "bgfx") struct Encoder{ start = First instance data. num = Number of data instances. */ - [q{void}, q{setInstanceDataBuffer}, q{const(InstanceDataBuffer)* idb, uint start, uint num}, `C++`], + {q{void}, q{setInstanceDataBuffer}, q{const(InstanceDataBuffer)* idb, uint start, uint num}, ext: `C++`}, /** Set instance data buffer for draw primitive. @@ -1630,7 +1630,7 @@ extern(C++, "bgfx") struct Encoder{ startVertex = First instance data. num = Number of data instances. */ - [q{void}, q{setInstanceDataBuffer}, q{VertexBufferHandle handle, uint startVertex, uint num}, `C++`], + {q{void}, q{setInstanceDataBuffer}, q{VertexBufferHandle handle, uint startVertex, uint num}, ext: `C++`}, /** Set instance data buffer for draw primitive. @@ -1639,14 +1639,14 @@ extern(C++, "bgfx") struct Encoder{ startVertex = First instance data. num = Number of data instances. */ - [q{void}, q{setInstanceDataBuffer}, q{DynamicVertexBufferHandle handle, uint startVertex, uint num}, `C++`], + {q{void}, q{setInstanceDataBuffer}, q{DynamicVertexBufferHandle handle, uint startVertex, uint num}, ext: `C++`}, /** Set number of instances for auto generated instances use in conjunction with gl_InstanceID. Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`. */ - [q{void}, q{setInstanceCount}, q{uint numInstances}, `C++`], + {q{void}, q{setInstanceCount}, q{uint numInstances}, ext: `C++`}, /** Set texture stage for draw primitive. @@ -1661,7 +1661,7 @@ extern(C++, "bgfx") struct Encoder{ - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling. */ - [q{void}, q{setTexture}, q{ubyte stage, UniformHandle sampler, TextureHandle handle, uint flags=uint.max}, `C++`], + {q{void}, q{setTexture}, q{ubyte stage, UniformHandle sampler, TextureHandle handle, uint flags=uint.max}, ext: `C++`}, /** Submit an empty primitive for rendering. Uniforms and draw state @@ -1673,7 +1673,7 @@ extern(C++, "bgfx") struct Encoder{ Params: id = View id. */ - [q{void}, q{touch}, q{ViewID id}, `C++`], + {q{void}, q{touch}, q{ViewID id}, ext: `C++`}, /** Submit primitive for rendering. @@ -1683,7 +1683,7 @@ extern(C++, "bgfx") struct Encoder{ depth = Depth for sorting. flags = Discard or preserve states. See `BGFX_DISCARD_*`. */ - [q{void}, q{submit}, q{ViewID id, ProgramHandle program, uint depth=0, ubyte flags=Discard.all}, `C++`], + {q{void}, q{submit}, q{ViewID id, ProgramHandle program, uint depth=0, ubyte flags=Discard.all}, ext: `C++`}, /** Submit primitive with occlusion query for rendering. @@ -1694,7 +1694,7 @@ extern(C++, "bgfx") struct Encoder{ depth = Depth for sorting. flags = Discard or preserve states. See `BGFX_DISCARD_*`. */ - [q{void}, q{submit}, q{ViewID id, ProgramHandle program, OcclusionQueryHandle occlusionQuery, uint depth=0, ubyte flags=Discard.all}, `C++`], + {q{void}, q{submit}, q{ViewID id, ProgramHandle program, OcclusionQueryHandle occlusionQuery, uint depth=0, ubyte flags=Discard.all}, ext: `C++`}, /** Submit primitive for rendering with index and instance data info from @@ -1709,7 +1709,7 @@ extern(C++, "bgfx") struct Encoder{ depth = Depth for sorting. flags = Discard or preserve states. See `BGFX_DISCARD_*`. */ - [q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, ushort start=0, ushort num=1, uint depth=0, ubyte flags=Discard.all}, `C++`], + {q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start=0, uint num=1, uint depth=0, ubyte flags=Discard.all}, ext: `C++`}, /** Submit primitive for rendering with index and instance data info and @@ -1727,7 +1727,7 @@ extern(C++, "bgfx") struct Encoder{ depth = Depth for sorting. flags = Discard or preserve states. See `BGFX_DISCARD_*`. */ - [q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, ushort start, IndexBufferHandle numHandle, uint numIndex=0, ushort numMax=ushort.max, uint depth=0, ubyte flags=Discard.all}, `C++`], + {q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start, IndexBufferHandle numHandle, uint numIndex=0, uint numMax=uint.max, uint depth=0, ubyte flags=Discard.all}, ext: `C++`}, /** Set compute index buffer. @@ -1736,7 +1736,7 @@ extern(C++, "bgfx") struct Encoder{ handle = Index buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, IndexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++`], + {q{void}, q{setBuffer}, q{ubyte stage, IndexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++`}, /** Set compute vertex buffer. @@ -1745,7 +1745,7 @@ extern(C++, "bgfx") struct Encoder{ handle = Vertex buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, VertexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++`], + {q{void}, q{setBuffer}, q{ubyte stage, VertexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++`}, /** Set compute dynamic index buffer. @@ -1754,7 +1754,7 @@ extern(C++, "bgfx") struct Encoder{ handle = Dynamic index buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, DynamicIndexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++`], + {q{void}, q{setBuffer}, q{ubyte stage, DynamicIndexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++`}, /** Set compute dynamic vertex buffer. @@ -1763,7 +1763,7 @@ extern(C++, "bgfx") struct Encoder{ handle = Dynamic vertex buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, DynamicVertexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++`], + {q{void}, q{setBuffer}, q{ubyte stage, DynamicVertexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++`}, /** Set compute indirect buffer. @@ -1772,7 +1772,7 @@ extern(C++, "bgfx") struct Encoder{ handle = Indirect buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, IndirectBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++`], + {q{void}, q{setBuffer}, q{ubyte stage, IndirectBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++`}, /** Set compute image from texture. @@ -1783,7 +1783,7 @@ extern(C++, "bgfx") struct Encoder{ access = Image access. See `Access::Enum`. format = Texture format. See: `TextureFormat::Enum`. */ - [q{void}, q{setImage}, q{ubyte stage, TextureHandle handle, ubyte mip, bgfx.fakeenum.Access.Enum access, bgfx.fakeenum.TextureFormat.Enum format=TextureFormat.count}, `C++`], + {q{void}, q{setImage}, q{ubyte stage, TextureHandle handle, ubyte mip, bgfx.fakeenum.Access.Enum access, bgfx.fakeenum.TextureFormat.Enum format=TextureFormat.count}, ext: `C++`}, /** Dispatch compute. @@ -1795,7 +1795,7 @@ extern(C++, "bgfx") struct Encoder{ numZ = Number of groups Z. flags = Discard or preserve states. See `BGFX_DISCARD_*`. */ - [q{void}, q{dispatch}, q{ViewID id, ProgramHandle program, uint numX=1, uint numY=1, uint numZ=1, ubyte flags=Discard.all}, `C++`], + {q{void}, q{dispatch}, q{ViewID id, ProgramHandle program, uint numX=1, uint numY=1, uint numZ=1, ubyte flags=Discard.all}, ext: `C++`}, /** Dispatch compute indirect. @@ -1807,14 +1807,14 @@ extern(C++, "bgfx") struct Encoder{ num = Number of dispatches. flags = Discard or preserve states. See `BGFX_DISCARD_*`. */ - [q{void}, q{dispatch}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, ushort start=0, ushort num=1, ubyte flags=Discard.all}, `C++`], + {q{void}, q{dispatch}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start=0, uint num=1, ubyte flags=Discard.all}, ext: `C++`}, /** Discard previously set state for draw or compute call. Params: flags = Discard or preserve states. See `BGFX_DISCARD_*`. */ - [q{void}, q{discard}, q{ubyte flags=Discard.all}, `C++`], + {q{void}, q{discard}, q{ubyte flags=Discard.all}, ext: `C++`}, /** Blit 2D texture region between two 2D textures. @@ -1831,7 +1831,7 @@ extern(C++, "bgfx") struct Encoder{ width = Width of region. height = Height of region. */ - [q{void}, q{blit}, q{ViewID id, TextureHandle dst, ushort dstX, ushort dstY, TextureHandle src, ushort srcX=0, ushort srcY=0, ushort width=ushort.max, ushort height=ushort.max}, `C++`], + {q{void}, q{blit}, q{ViewID id, TextureHandle dst, ushort dstX, ushort dstY, TextureHandle src, ushort srcX=0, ushort srcY=0, ushort width=ushort.max, ushort height=ushort.max}, ext: `C++`}, /** Blit 2D texture region between two 2D textures. @@ -1858,26 +1858,25 @@ extern(C++, "bgfx") struct Encoder{ depth = If texture is 3D this argument represents depth of region, otherwise it's unused. */ - [q{void}, q{blit}, q{ViewID id, TextureHandle dst, ubyte dstMIP, ushort dstX, ushort dstY, ushort dstZ, TextureHandle src, ubyte srcMIP=0, ushort srcX=0, ushort srcY=0, ushort srcZ=0, ushort width=ushort.max, ushort height=ushort.max, ushort depth=ushort.max}, `C++`], - ], true); + {q{void}, q{blit}, q{ViewID id, TextureHandle dst, ubyte dstMIP, ushort dstX, ushort dstY, ushort dstZ, TextureHandle src, ubyte srcMIP=0, ushort srcX=0, ushort srcY=0, ushort srcZ=0, ushort width=ushort.max, ushort height=ushort.max, ushort depth=ushort.max}, ext: `C++`}, + ]; return ret; - }(), typeof(this).stringof)); + }())); } mixin(joinFnBinds((){ - string[][] ret; - ret ~= makeFnBinds([ + FnBind[] ret = [ /** * Pack vertex attribute into vertex stream format. Params: input = Value to be packed into vertex stream. - inputNormalized = `true` if input value is already normalized. + inputNormalised = `true` if input value is already normalized. attr = Attribute to pack. layout = Vertex stream layout. data = Destination vertex stream where data will be packed. index = Vertex index that will be modified. */ - [q{void}, q{vertexPack}, q{const(float)* input, bool inputNormalized, bgfx.fakeenum.Attrib.Enum attr, ref const VertexLayout layout, void* data, uint index=0}, `C++, "bgfx"`], + {q{void}, q{vertexPack}, q{const(float)* input, bool inputNormalised, bgfx.fakeenum.Attrib.Enum attr, ref const VertexLayout layout, void* data, uint index=0}, ext: `C++, "bgfx"`}, /** * Unpack vertex attribute from vertex stream format. @@ -1888,7 +1887,7 @@ mixin(joinFnBinds((){ data = Source vertex stream from where data will be unpacked. index = Vertex index that will be unpacked. */ - [q{void}, q{vertexUnpack}, q{float* output, bgfx.fakeenum.Attrib.Enum attr, ref const VertexLayout layout, const(void)* data, uint index=0}, `C++, "bgfx"`], + {q{void}, q{vertexUnpack}, q{float* output, bgfx.fakeenum.Attrib.Enum attr, ref const VertexLayout layout, const(void)* data, uint index=0}, ext: `C++, "bgfx"`}, /** * Converts vertex stream data from one vertex stream format to another. @@ -1899,7 +1898,7 @@ mixin(joinFnBinds((){ srcData = Source vertex stream data. num = Number of vertices to convert from source to destination. */ - [q{void}, q{vertexConvert}, q{ref const VertexLayout dstLayout, void* dstData, ref const VertexLayout srcLayout, const(void)* srcData, uint num=1}, `C++, "bgfx"`], + {q{void}, q{vertexConvert}, q{ref const VertexLayout dstLayout, void* dstData, ref const VertexLayout srcLayout, const(void)* srcData, uint num=1}, ext: `C++, "bgfx"`}, /** * Weld vertices. @@ -1912,7 +1911,7 @@ mixin(joinFnBinds((){ index32 = Set to `true` if input indices are 32-bit. epsilon = Error tolerance for vertex position comparison. */ - [q{uint}, q{weldVertices}, q{void* output, ref const VertexLayout layout, const(void)* data, uint num, bool index32, float epsilon=0.001f}, `C++, "bgfx"`], + {q{uint}, q{weldVertices}, q{void* output, ref const VertexLayout layout, const(void)* data, uint num, bool index32, float epsilon=0.001f}, ext: `C++, "bgfx"`}, /** * Convert index buffer for use with different primitive topologies. @@ -1927,7 +1926,7 @@ mixin(joinFnBinds((){ numIndices = Number of input indices. index32 = Set to `true` if input indices are 32-bit. */ - [q{uint}, q{topologyConvert}, q{bgfx.fakeenum.TopologyConvert.Enum conversion, void* dst, uint dstSize, const(void)* indices, uint numIndices, bool index32}, `C++, "bgfx"`], + {q{uint}, q{topologyConvert}, q{bgfx.fakeenum.TopologyConvert.Enum conversion, void* dst, uint dstSize, const(void)* indices, uint numIndices, bool index32}, ext: `C++, "bgfx"`}, /** * Sort indices. @@ -1947,7 +1946,7 @@ mixin(joinFnBinds((){ numIndices = Number of input indices. index32 = Set to `true` if input indices are 32-bit. */ - [q{void}, q{topologySortTriList}, q{bgfx.fakeenum.TopologySort.Enum sort, void* dst, uint dstSize, const(float)* dir, const(float)* pos, const(void)* vertices, uint stride, const(void)* indices, uint numIndices, bool index32}, `C++, "bgfx"`], + {q{void}, q{topologySortTriList}, q{bgfx.fakeenum.TopologySort.Enum sort, void* dst, uint dstSize, const(float)* dir, const(float)* pos, const(void)* vertices, uint stride, const(void)* indices, uint numIndices, bool index32}, ext: `C++, "bgfx"`}, /** * Returns supported backend API renderers. @@ -1955,26 +1954,26 @@ mixin(joinFnBinds((){ max = Maximum number of elements in _enum array. enum_ = Array where supported renderers will be written. */ - [q{ubyte}, q{getSupportedRenderers}, q{ubyte max=0, bgfx.fakeenum.RendererType.Enum* enum_=null}, `C++, "bgfx"`], + {q{ubyte}, q{getSupportedRenderers}, q{ubyte max=0, bgfx.fakeenum.RendererType.Enum* enum_=null}, ext: `C++, "bgfx"`}, /** * Returns name of renderer. Params: type = Renderer backend type. See: `bgfx::RendererType` */ - [q{const(char)*}, q{getRendererName}, q{bgfx.fakeenum.RendererType.Enum type}, `C++, "bgfx"`], + {q{const(char)*}, q{getRendererName}, q{bgfx.fakeenum.RendererType.Enum type}, ext: `C++, "bgfx"`}, /** * Initialize the bgfx library. Params: init = Initialization parameters. See: `bgfx::Init` for more info. */ - [q{bool}, q{init}, q{ref const Init init}, `C++, "bgfx"`], + {q{bool}, q{init}, q{ref const Init init}, ext: `C++, "bgfx"`}, /** * Shutdown bgfx library. */ - [q{void}, q{shutdown}, q{}, `C++, "bgfx"`], + {q{void}, q{shutdown}, q{}, ext: `C++, "bgfx"`}, /** * Reset graphic settings and back-buffer size. @@ -1997,7 +1996,7 @@ mixin(joinFnBinds((){ - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer. format = Texture format. See: `TextureFormat::Enum`. */ - [q{void}, q{reset}, q{uint width, uint height, uint flags=Reset.none, bgfx.fakeenum.TextureFormat.Enum format=TextureFormat.count}, `C++, "bgfx"`], + {q{void}, q{reset}, q{uint width, uint height, uint flags=Reset.none, bgfx.fakeenum.TextureFormat.Enum format=TextureFormat.count}, ext: `C++, "bgfx"`}, /** * Advance to next frame. When using multithreaded renderer, this call @@ -2006,34 +2005,34 @@ mixin(joinFnBinds((){ Params: capture = Capture frame with graphics debugger. */ - [q{uint}, q{frame}, q{bool capture=false}, `C++, "bgfx"`], + {q{uint}, q{frame}, q{bool capture=false}, ext: `C++, "bgfx"`}, /** * Returns current renderer backend API type. * Remarks: * Library must be initialized. */ - [q{RendererType}, q{getRendererType}, q{}, `C++, "bgfx"`], + {q{RendererType}, q{getRendererType}, q{}, ext: `C++, "bgfx"`}, /** * Returns renderer capabilities. * Remarks: * Library must be initialized. */ - [q{const(Caps)*}, q{getCaps}, q{}, `C++, "bgfx"`], + {q{const(Caps)*}, q{getCaps}, q{}, ext: `C++, "bgfx"`}, /** * Returns performance counters. * Attention: Pointer returned is valid until `bgfx::frame` is called. */ - [q{const(Stats)*}, q{getStats}, q{}, `C++, "bgfx"`], + {q{const(Stats)*}, q{getStats}, q{}, ext: `C++, "bgfx"`}, /** * Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx. Params: size = Size to allocate. */ - [q{const(Memory)*}, q{alloc}, q{uint size}, `C++, "bgfx"`], + {q{const(Memory)*}, q{alloc}, q{uint size}, ext: `C++, "bgfx"`}, /** * Allocate buffer and copy data into it. Data will be freed inside bgfx. @@ -2041,7 +2040,7 @@ mixin(joinFnBinds((){ data = Pointer to data to be copied. size = Size of data to be copied. */ - [q{const(Memory)*}, q{copy}, q{const(void)* data, uint size}, `C++, "bgfx"`], + {q{const(Memory)*}, q{copy}, q{const(void)* data, uint size}, ext: `C++, "bgfx"`}, /** * Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call @@ -2057,7 +2056,7 @@ mixin(joinFnBinds((){ releaseFn = Callback function to release memory after use. userData = User data to be passed to callback function. */ - [q{const(Memory)*}, q{makeRef}, q{const(void)* data, uint size, ReleaseFn releaseFn=null, void* userData=null}, `C++, "bgfx"`], + {q{const(Memory)*}, q{makeRef}, q{const(void)* data, uint size, ReleaseFn releaseFn=null, void* userData=null}, ext: `C++, "bgfx"`}, /** * Set debug flags. @@ -2072,7 +2071,7 @@ mixin(joinFnBinds((){ - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering primitives will be rendered as lines. */ - [q{void}, q{setDebug}, q{uint debug_}, `C++, "bgfx"`], + {q{void}, q{setDebug}, q{uint debug_}, ext: `C++, "bgfx"`}, /** * Clear internal debug text buffer. @@ -2080,7 +2079,7 @@ mixin(joinFnBinds((){ attr = Background color. small = Default 8x16 or 8x8 font. */ - [q{void}, q{dbgTextClear}, q{ubyte attr=0, bool small=false}, `C++, "bgfx"`], + {q{void}, q{dbgTextClear}, q{ubyte attr=0, bool small=false}, ext: `C++, "bgfx"`}, /** * Print formatted data to internal debug text character-buffer (VGA-compatible text mode). @@ -2091,7 +2090,7 @@ mixin(joinFnBinds((){ 4-bits represent foreground color from standard VGA text palette (ANSI escape codes). format = `printf` style format. */ - [q{void}, q{dbgTextPrintf}, q{ushort x, ushort y, ubyte attr, const(char)* format, ...}, `C++, "bgfx"`], + {q{void}, q{dbgTextPrintf}, q{ushort x, ushort y, ubyte attr, const(char)* format, ...}, ext: `C++, "bgfx"`}, /** * Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode). @@ -2103,7 +2102,7 @@ mixin(joinFnBinds((){ format = `printf` style format. argList = Variable arguments list for format string. */ - [q{void}, q{dbgTextPrintfVargs}, q{ushort x, ushort y, ubyte attr, const(char)* format, va_list argList}, `C++, "bgfx"`], + {q{void}, q{dbgTextPrintfVargs}, q{ushort x, ushort y, ubyte attr, const(char)* format, va_list argList}, ext: `C++, "bgfx"`}, /** * Draw image into internal debug text buffer. @@ -2115,7 +2114,7 @@ mixin(joinFnBinds((){ data = Raw image data (character/attribute raw encoding). pitch = Image pitch in bytes. */ - [q{void}, q{dbgTextImage}, q{ushort x, ushort y, ushort width, ushort height, const(void)* data, ushort pitch}, `C++, "bgfx"`], + {q{void}, q{dbgTextImage}, q{ushort x, ushort y, ushort width, ushort height, const(void)* data, ushort pitch}, ext: `C++, "bgfx"`}, /** * Create static index buffer. @@ -2134,7 +2133,7 @@ mixin(joinFnBinds((){ - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers. */ - [q{IndexBufferHandle}, q{createIndexBuffer}, q{const(Memory)* mem, ushort flags=Buffer.none}, `C++, "bgfx"`], + {q{IndexBufferHandle}, q{createIndexBuffer}, q{const(Memory)* mem, ushort flags=Buffer.none}, ext: `C++, "bgfx"`}, /** * Set static index buffer debug name. @@ -2144,28 +2143,28 @@ mixin(joinFnBinds((){ len = Static index buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string. */ - [q{void}, q{setName}, q{IndexBufferHandle handle, const(char)* name, int len=int.max}, `C++, "bgfx"`], + {q{void}, q{setName}, q{IndexBufferHandle handle, const(char)* name, int len=int.max}, ext: `C++, "bgfx"`}, /** * Destroy static index buffer. Params: handle = Static index buffer handle. */ - [q{void}, q{destroy}, q{IndexBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{IndexBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Create vertex layout. Params: layout = Vertex layout. */ - [q{VertexLayoutHandle}, q{createVertexLayout}, q{ref const VertexLayout layout}, `C++, "bgfx"`], + {q{VertexLayoutHandle}, q{createVertexLayout}, q{ref const VertexLayout layout}, ext: `C++, "bgfx"`}, /** * Destroy vertex layout. Params: layoutHandle = Vertex layout handle. */ - [q{void}, q{destroy}, q{VertexLayoutHandle layoutHandle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{VertexLayoutHandle layoutHandle}, ext: `C++, "bgfx"`}, /** * Create static vertex buffer. @@ -2183,7 +2182,7 @@ mixin(joinFnBinds((){ will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers. */ - [q{VertexBufferHandle}, q{createVertexBuffer}, q{const(Memory)* mem, ref const VertexLayout layout, ushort flags=Buffer.none}, `C++, "bgfx"`], + {q{VertexBufferHandle}, q{createVertexBuffer}, q{const(Memory)* mem, ref const VertexLayout layout, ushort flags=Buffer.none}, ext: `C++, "bgfx"`}, /** * Set static vertex buffer debug name. @@ -2193,14 +2192,14 @@ mixin(joinFnBinds((){ len = Static vertex buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string. */ - [q{void}, q{setName}, q{VertexBufferHandle handle, const(char)* name, int len=int.max}, `C++, "bgfx"`], + {q{void}, q{setName}, q{VertexBufferHandle handle, const(char)* name, int len=int.max}, ext: `C++, "bgfx"`}, /** * Destroy static vertex buffer. Params: handle = Static vertex buffer handle. */ - [q{void}, q{destroy}, q{VertexBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{VertexBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Create empty dynamic index buffer. @@ -2219,7 +2218,7 @@ mixin(joinFnBinds((){ - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers. */ - [q{DynamicIndexBufferHandle}, q{createDynamicIndexBuffer}, q{uint num, ushort flags=Buffer.none}, `C++, "bgfx"`], + {q{DynamicIndexBufferHandle}, q{createDynamicIndexBuffer}, q{uint num, ushort flags=Buffer.none}, ext: `C++, "bgfx"`}, /** * Create a dynamic index buffer and initialize it. @@ -2238,7 +2237,7 @@ mixin(joinFnBinds((){ - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers. */ - [q{DynamicIndexBufferHandle}, q{createDynamicIndexBuffer}, q{const(Memory)* mem, ushort flags=Buffer.none}, `C++, "bgfx"`], + {q{DynamicIndexBufferHandle}, q{createDynamicIndexBuffer}, q{const(Memory)* mem, ushort flags=Buffer.none}, ext: `C++, "bgfx"`}, /** * Update dynamic index buffer. @@ -2247,14 +2246,14 @@ mixin(joinFnBinds((){ startIndex = Start index. mem = Index buffer data. */ - [q{void}, q{update}, q{DynamicIndexBufferHandle handle, uint startIndex, const(Memory)* mem}, `C++, "bgfx"`], + {q{void}, q{update}, q{DynamicIndexBufferHandle handle, uint startIndex, const(Memory)* mem}, ext: `C++, "bgfx"`}, /** * Destroy dynamic index buffer. Params: handle = Dynamic index buffer handle. */ - [q{void}, q{destroy}, q{DynamicIndexBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{DynamicIndexBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Create empty dynamic vertex buffer. @@ -2274,7 +2273,7 @@ mixin(joinFnBinds((){ - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers. */ - [q{DynamicVertexBufferHandle}, q{createDynamicVertexBuffer}, q{uint num, ref const VertexLayout layout, ushort flags=Buffer.none}, `C++, "bgfx"`], + {q{DynamicVertexBufferHandle}, q{createDynamicVertexBuffer}, q{uint num, ref const VertexLayout layout, ushort flags=Buffer.none}, ext: `C++, "bgfx"`}, /** * Create dynamic vertex buffer and initialize it. @@ -2294,7 +2293,7 @@ mixin(joinFnBinds((){ - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers. */ - [q{DynamicVertexBufferHandle}, q{createDynamicVertexBuffer}, q{const(Memory)* mem, ref const VertexLayout layout, ushort flags=Buffer.none}, `C++, "bgfx"`], + {q{DynamicVertexBufferHandle}, q{createDynamicVertexBuffer}, q{const(Memory)* mem, ref const VertexLayout layout, ushort flags=Buffer.none}, ext: `C++, "bgfx"`}, /** * Update dynamic vertex buffer. @@ -2303,14 +2302,14 @@ mixin(joinFnBinds((){ startVertex = Start vertex. mem = Vertex buffer data. */ - [q{void}, q{update}, q{DynamicVertexBufferHandle handle, uint startVertex, const(Memory)* mem}, `C++, "bgfx"`], + {q{void}, q{update}, q{DynamicVertexBufferHandle handle, uint startVertex, const(Memory)* mem}, ext: `C++, "bgfx"`}, /** * Destroy dynamic vertex buffer. Params: handle = Dynamic vertex buffer handle. */ - [q{void}, q{destroy}, q{DynamicVertexBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{DynamicVertexBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Returns number of requested or maximum available indices. @@ -2318,7 +2317,7 @@ mixin(joinFnBinds((){ num = Number of required indices. index32 = Set to `true` if input indices will be 32-bit. */ - [q{uint}, q{getAvailTransientIndexBuffer}, q{uint num, bool index32=false}, `C++, "bgfx"`], + {q{uint}, q{getAvailTransientIndexBuffer}, q{uint num, bool index32=false}, ext: `C++, "bgfx"`}, /** * Returns number of requested or maximum available vertices. @@ -2326,7 +2325,7 @@ mixin(joinFnBinds((){ num = Number of required vertices. layout = Vertex layout. */ - [q{uint}, q{getAvailTransientVertexBuffer}, q{uint num, ref const VertexLayout layout}, `C++, "bgfx"`], + {q{uint}, q{getAvailTransientVertexBuffer}, q{uint num, ref const VertexLayout layout}, ext: `C++, "bgfx"`}, /** * Returns number of requested or maximum available instance buffer slots. @@ -2334,7 +2333,7 @@ mixin(joinFnBinds((){ num = Number of required instances. stride = Stride per instance. */ - [q{uint}, q{getAvailInstanceDataBuffer}, q{uint num, ushort stride}, `C++, "bgfx"`], + {q{uint}, q{getAvailInstanceDataBuffer}, q{uint num, ushort stride}, ext: `C++, "bgfx"`}, /** * Allocate transient index buffer. @@ -2345,7 +2344,7 @@ mixin(joinFnBinds((){ num = Number of indices to allocate. index32 = Set to `true` if input indices will be 32-bit. */ - [q{void}, q{allocTransientIndexBuffer}, q{TransientIndexBuffer* tib, uint num, bool index32=false}, `C++, "bgfx"`], + {q{void}, q{allocTransientIndexBuffer}, q{TransientIndexBuffer* tib, uint num, bool index32=false}, ext: `C++, "bgfx"`}, /** * Allocate transient vertex buffer. @@ -2356,7 +2355,7 @@ mixin(joinFnBinds((){ num = Number of vertices to allocate. layout = Vertex layout. */ - [q{void}, q{allocTransientVertexBuffer}, q{TransientVertexBuffer* tvb, uint num, ref const VertexLayout layout}, `C++, "bgfx"`], + {q{void}, q{allocTransientVertexBuffer}, q{TransientVertexBuffer* tvb, uint num, ref const VertexLayout layout}, ext: `C++, "bgfx"`}, /** * Check for required space and allocate transient vertex and index @@ -2374,7 +2373,7 @@ mixin(joinFnBinds((){ numIndices = Number of indices to allocate. index32 = Set to `true` if input indices will be 32-bit. */ - [q{bool}, q{allocTransientBuffers}, q{TransientVertexBuffer* tvb, ref const VertexLayout layout, uint numVertices, TransientIndexBuffer* tib, uint numIndices, bool index32=false}, `C++, "bgfx"`], + {q{bool}, q{allocTransientBuffers}, q{TransientVertexBuffer* tvb, ref const VertexLayout layout, uint numVertices, TransientIndexBuffer* tib, uint numIndices, bool index32=false}, ext: `C++, "bgfx"`}, /** * Allocate instance data buffer. @@ -2385,28 +2384,30 @@ mixin(joinFnBinds((){ num = Number of instances. stride = Instance stride. Must be multiple of 16. */ - [q{void}, q{allocInstanceDataBuffer}, q{InstanceDataBuffer* idb, uint num, ushort stride}, `C++, "bgfx"`], + {q{void}, q{allocInstanceDataBuffer}, q{InstanceDataBuffer* idb, uint num, ushort stride}, ext: `C++, "bgfx"`}, /** * Create draw indirect buffer. Params: num = Number of indirect calls. */ - [q{IndirectBufferHandle}, q{createIndirectBuffer}, q{uint num}, `C++, "bgfx"`], + {q{IndirectBufferHandle}, q{createIndirectBuffer}, q{uint num}, ext: `C++, "bgfx"`}, /** * Destroy draw indirect buffer. Params: handle = Indirect buffer handle. */ - [q{void}, q{destroy}, q{IndirectBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{IndirectBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Create shader from memory buffer. + * Remarks: + * Shader binary is obtained by compiling shader offline with shaderc command line tool. Params: mem = Shader binary. */ - [q{ShaderHandle}, q{createShader}, q{const(Memory)* mem}, `C++, "bgfx"`], + {q{ShaderHandle}, q{createShader}, q{const(Memory)* mem}, ext: `C++, "bgfx"`}, /** * Returns the number of uniforms and uniform handles used inside a shader. @@ -2417,7 +2418,7 @@ mixin(joinFnBinds((){ uniforms = UniformHandle array where data will be stored. max = Maximum capacity of array. */ - [q{ushort}, q{getShaderUniforms}, q{ShaderHandle handle, UniformHandle* uniforms=null, ushort max=0}, `C++, "bgfx"`], + {q{ushort}, q{getShaderUniforms}, q{ShaderHandle handle, UniformHandle* uniforms=null, ushort max=0}, ext: `C++, "bgfx"`}, /** * Set shader debug name. @@ -2427,7 +2428,7 @@ mixin(joinFnBinds((){ len = Shader name length (if length is INT32_MAX, it's expected that _name is zero terminated string). */ - [q{void}, q{setName}, q{ShaderHandle handle, const(char)* name, int len=int.max}, `C++, "bgfx"`], + {q{void}, q{setName}, q{ShaderHandle handle, const(char)* name, int len=int.max}, ext: `C++, "bgfx"`}, /** * Destroy shader. @@ -2436,7 +2437,7 @@ mixin(joinFnBinds((){ Params: handle = Shader handle. */ - [q{void}, q{destroy}, q{ShaderHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{ShaderHandle handle}, ext: `C++, "bgfx"`}, /** * Create program with vertex and fragment shaders. @@ -2445,7 +2446,7 @@ mixin(joinFnBinds((){ fsh = Fragment shader. destroyShaders = If true, shaders will be destroyed when program is destroyed. */ - [q{ProgramHandle}, q{createProgram}, q{ShaderHandle vsh, ShaderHandle fsh, bool destroyShaders=false}, `C++, "bgfx"`], + {q{ProgramHandle}, q{createProgram}, q{ShaderHandle vsh, ShaderHandle fsh, bool destroyShaders=false}, ext: `C++, "bgfx"`}, /** * Create program with compute shader. @@ -2453,14 +2454,14 @@ mixin(joinFnBinds((){ csh = Compute shader. destroyShaders = If true, shaders will be destroyed when program is destroyed. */ - [q{ProgramHandle}, q{createProgram}, q{ShaderHandle csh, bool destroyShaders=false}, `C++, "bgfx"`], + {q{ProgramHandle}, q{createProgram}, q{ShaderHandle csh, bool destroyShaders=false}, ext: `C++, "bgfx"`}, /** * Destroy program. Params: handle = Program handle. */ - [q{void}, q{destroy}, q{ProgramHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{ProgramHandle handle}, ext: `C++, "bgfx"`}, /** * Validate texture parameters. @@ -2471,7 +2472,7 @@ mixin(joinFnBinds((){ format = Texture format. See: `TextureFormat::Enum`. flags = Texture flags. See `BGFX_TEXTURE_*`. */ - [q{bool}, q{isTextureValid}, q{ushort depth, bool cubeMap, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, ulong flags}, `C++, "bgfx"`], + {q{bool}, q{isTextureValid}, q{ushort depth, bool cubeMap, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 flags}, ext: `C++, "bgfx"`}, /** * Validate frame buffer parameters. @@ -2479,7 +2480,7 @@ mixin(joinFnBinds((){ num = Number of attachments. attachment = Attachment texture info. See: `bgfx::Attachment`. */ - [q{bool}, q{isFrameBufferValid}, q{ubyte num, const(Attachment)* attachment}, `C++, "bgfx"`], + {q{bool}, q{isFrameBufferValid}, q{ubyte num, const(Attachment)* attachment}, ext: `C++, "bgfx"`}, /** * Calculate amount of memory required for texture. @@ -2493,7 +2494,7 @@ mixin(joinFnBinds((){ numLayers = Number of layers in texture array. format = Texture format. See: `TextureFormat::Enum`. */ - [q{void}, q{calcTextureSize}, q{ref TextureInfo info, ushort width, ushort height, ushort depth, bool cubeMap, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format}, `C++, "bgfx"`], + {q{void}, q{calcTextureSize}, q{ref TextureInfo info, ushort width, ushort height, ushort depth, bool cubeMap, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format}, ext: `C++, "bgfx"`}, /** * Create texture from memory buffer. @@ -2508,7 +2509,7 @@ mixin(joinFnBinds((){ skip = Skip top level mips when parsing texture. info = When non-`NULL` is specified it returns parsed texture information. */ - [q{TextureHandle}, q{createTexture}, q{const(Memory)* mem, ulong flags, ubyte skip=0, TextureInfo* info=null}, `C++, "bgfx"`], + {q{TextureHandle}, q{createTexture}, q{const(Memory)* mem, c_uint64 flags=Texture.none|Sampler.none, ubyte skip=0, TextureInfo* info=null}, ext: `C++, "bgfx"`}, /** * Create 2D texture. @@ -2529,7 +2530,7 @@ mixin(joinFnBinds((){ `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element. */ - [q{TextureHandle}, q{createTexture2D}, q{ushort width, ushort height, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, ulong flags, const(Memory)* mem=null}, `C++, "bgfx"`], + {q{TextureHandle}, q{createTexture2D}, q{ushort width, ushort height, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 flags=Texture.none|Sampler.none, const(Memory)* mem=null}, ext: `C++, "bgfx"`}, /** * Create texture with size based on back-buffer ratio. Texture will maintain ratio @@ -2547,7 +2548,7 @@ mixin(joinFnBinds((){ - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling. */ - [q{TextureHandle}, q{createTexture2D}, q{bgfx.fakeenum.BackbufferRatio.Enum ratio, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, ulong flags=Texture.none|Sampler.none}, `C++, "bgfx"`], + {q{TextureHandle}, q{createTexture2D}, q{bgfx.fakeenum.BackbufferRatio.Enum ratio, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 flags=Texture.none|Sampler.none}, ext: `C++, "bgfx"`}, /** * Create 3D texture. @@ -2567,7 +2568,7 @@ mixin(joinFnBinds((){ `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element. */ - [q{TextureHandle}, q{createTexture3D}, q{ushort width, ushort height, ushort depth, bool hasMIPs, bgfx.fakeenum.TextureFormat.Enum format, ulong flags=Texture.none|Sampler.none, const(Memory)* mem=null}, `C++, "bgfx"`], + {q{TextureHandle}, q{createTexture3D}, q{ushort width, ushort height, ushort depth, bool hasMIPs, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 flags=Texture.none|Sampler.none, const(Memory)* mem=null}, ext: `C++, "bgfx"`}, /** * Create Cube texture. @@ -2587,7 +2588,7 @@ mixin(joinFnBinds((){ `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element. */ - [q{TextureHandle}, q{createTextureCube}, q{ushort size, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, ulong flags=Texture.none|Sampler.none, const(Memory)* mem=null}, `C++, "bgfx"`], + {q{TextureHandle}, q{createTextureCube}, q{ushort size, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 flags=Texture.none|Sampler.none, const(Memory)* mem=null}, ext: `C++, "bgfx"`}, /** * Update 2D texture. @@ -2604,7 +2605,7 @@ mixin(joinFnBinds((){ pitch = Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width. */ - [q{void}, q{updateTexture2D}, q{TextureHandle handle, ushort layer, ubyte mip, ushort x, ushort y, ushort width, ushort height, const(Memory)* mem, ushort pitch=ushort.max}, `C++, "bgfx"`], + {q{void}, q{updateTexture2D}, q{TextureHandle handle, ushort layer, ubyte mip, ushort x, ushort y, ushort width, ushort height, const(Memory)* mem, ushort pitch=ushort.max}, ext: `C++, "bgfx"`}, /** * Update 3D texture. @@ -2620,7 +2621,7 @@ mixin(joinFnBinds((){ depth = Depth of texture block. mem = Texture update data. */ - [q{void}, q{updateTexture3D}, q{TextureHandle handle, ubyte mip, ushort x, ushort y, ushort z, ushort width, ushort height, ushort depth, const(Memory)* mem}, `C++, "bgfx"`], + {q{void}, q{updateTexture3D}, q{TextureHandle handle, ubyte mip, ushort x, ushort y, ushort z, ushort width, ushort height, ushort depth, const(Memory)* mem}, ext: `C++, "bgfx"`}, /** * Update Cube texture. @@ -2655,7 +2656,7 @@ mixin(joinFnBinds((){ pitch = Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width. */ - [q{void}, q{updateTextureCube}, q{TextureHandle handle, ushort layer, ubyte side, ubyte mip, ushort x, ushort y, ushort width, ushort height, const(Memory)* mem, ushort pitch=ushort.max}, `C++, "bgfx"`], + {q{void}, q{updateTextureCube}, q{TextureHandle handle, ushort layer, ubyte side, ubyte mip, ushort x, ushort y, ushort width, ushort height, const(Memory)* mem, ushort pitch=ushort.max}, ext: `C++, "bgfx"`}, /** * Read back texture content. @@ -2666,7 +2667,7 @@ mixin(joinFnBinds((){ data = Destination buffer. mip = Mip level. */ - [q{uint}, q{readTexture}, q{TextureHandle handle, void* data, ubyte mip=0}, `C++, "bgfx"`], + {q{uint}, q{readTexture}, q{TextureHandle handle, void* data, ubyte mip=0}, ext: `C++, "bgfx"`}, /** * Set texture debug name. @@ -2676,7 +2677,7 @@ mixin(joinFnBinds((){ len = Texture name length (if length is INT32_MAX, it's expected that _name is zero terminated string. */ - [q{void}, q{setName}, q{TextureHandle handle, const(char)* name, int len=int.max}, `C++, "bgfx"`], + {q{void}, q{setName}, q{TextureHandle handle, const(char)* name, int len=int.max}, ext: `C++, "bgfx"`}, /** * Returns texture direct access pointer. @@ -2685,14 +2686,14 @@ mixin(joinFnBinds((){ Params: handle = Texture handle. */ - [q{void*}, q{getDirectAccessPtr}, q{TextureHandle handle}, `C++, "bgfx"`], + {q{void*}, q{getDirectAccessPtr}, q{TextureHandle handle}, ext: `C++, "bgfx"`}, /** * Destroy texture. Params: handle = Texture handle. */ - [q{void}, q{destroy}, q{TextureHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{TextureHandle handle}, ext: `C++, "bgfx"`}, /** * Create frame buffer (simple). @@ -2707,7 +2708,7 @@ mixin(joinFnBinds((){ - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling. */ - [q{FrameBufferHandle}, q{createFrameBuffer}, q{ushort width, ushort height, bgfx.fakeenum.TextureFormat.Enum format, ulong textureFlags=SamplerU.clamp|SamplerV.clamp}, `C++, "bgfx"`], + {q{FrameBufferHandle}, q{createFrameBuffer}, q{ushort width, ushort height, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 textureFlags=SamplerU.clamp|SamplerV.clamp}, ext: `C++, "bgfx"`}, /** * Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio @@ -2723,7 +2724,7 @@ mixin(joinFnBinds((){ - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling. */ - [q{FrameBufferHandle}, q{createFrameBuffer}, q{bgfx.fakeenum.BackbufferRatio.Enum ratio, bgfx.fakeenum.TextureFormat.Enum format, ulong textureFlags=SamplerU.clamp|SamplerV.clamp}, `C++, "bgfx"`], + {q{FrameBufferHandle}, q{createFrameBuffer}, q{bgfx.fakeenum.BackbufferRatio.Enum ratio, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 textureFlags=SamplerU.clamp|SamplerV.clamp}, ext: `C++, "bgfx"`}, /** * Create MRT frame buffer from texture handles (simple). @@ -2733,7 +2734,7 @@ mixin(joinFnBinds((){ destroyTexture = If true, textures will be destroyed when frame buffer is destroyed. */ - [q{FrameBufferHandle}, q{createFrameBuffer}, q{ubyte num, const(TextureHandle)* handles, bool destroyTexture=false}, `C++, "bgfx"`], + {q{FrameBufferHandle}, q{createFrameBuffer}, q{ubyte num, const(TextureHandle)* handles, bool destroyTexture=false}, ext: `C++, "bgfx"`}, /** * Create MRT frame buffer from texture handles with specific layer and @@ -2744,7 +2745,7 @@ mixin(joinFnBinds((){ destroyTexture = If true, textures will be destroyed when frame buffer is destroyed. */ - [q{FrameBufferHandle}, q{createFrameBuffer}, q{ubyte num, const(Attachment)* attachment, bool destroyTexture=false}, `C++, "bgfx"`], + {q{FrameBufferHandle}, q{createFrameBuffer}, q{ubyte num, const(Attachment)* attachment, bool destroyTexture=false}, ext: `C++, "bgfx"`}, /** * Create frame buffer for multiple window rendering. @@ -2758,7 +2759,7 @@ mixin(joinFnBinds((){ format = Window back buffer color format. depthFormat = Window back buffer depth format. */ - [q{FrameBufferHandle}, q{createFrameBuffer}, q{void* nwh, ushort width, ushort height, bgfx.fakeenum.TextureFormat.Enum format=TextureFormat.count, bgfx.fakeenum.TextureFormat.Enum depthFormat=TextureFormat.count}, `C++, "bgfx"`], + {q{FrameBufferHandle}, q{createFrameBuffer}, q{void* nwh, ushort width, ushort height, bgfx.fakeenum.TextureFormat.Enum format=TextureFormat.count, bgfx.fakeenum.TextureFormat.Enum depthFormat=TextureFormat.count}, ext: `C++, "bgfx"`}, /** * Set frame buffer debug name. @@ -2768,21 +2769,21 @@ mixin(joinFnBinds((){ len = Frame buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string. */ - [q{void}, q{setName}, q{FrameBufferHandle handle, const(char)* name, int len=int.max}, `C++, "bgfx"`], + {q{void}, q{setName}, q{FrameBufferHandle handle, const(char)* name, int len=int.max}, ext: `C++, "bgfx"`}, /** * Obtain texture handle of frame buffer attachment. Params: handle = Frame buffer handle. */ - [q{TextureHandle}, q{getTexture}, q{FrameBufferHandle handle, ubyte attachment=0}, `C++, "bgfx"`], + {q{TextureHandle}, q{getTexture}, q{FrameBufferHandle handle, ubyte attachment=0}, ext: `C++, "bgfx"`}, /** * Destroy frame buffer. Params: handle = Frame buffer handle. */ - [q{void}, q{destroy}, q{FrameBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{FrameBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Create shader uniform parameter. @@ -2813,7 +2814,7 @@ mixin(joinFnBinds((){ type = Type of uniform (See: `bgfx::UniformType`). num = Number of elements in array. */ - [q{UniformHandle}, q{createUniform}, q{const(char)* name, bgfx.fakeenum.UniformType.Enum type, ushort num=1}, `C++, "bgfx"`], + {q{UniformHandle}, q{createUniform}, q{const(char)* name, bgfx.fakeenum.UniformType.Enum type, ushort num=1}, ext: `C++, "bgfx"`}, /** * Retrieve uniform info. @@ -2821,19 +2822,19 @@ mixin(joinFnBinds((){ handle = Handle to uniform object. info = Uniform info. */ - [q{void}, q{getUniformInfo}, q{UniformHandle handle, ref UniformInfo info}, `C++, "bgfx"`], + {q{void}, q{getUniformInfo}, q{UniformHandle handle, ref UniformInfo info}, ext: `C++, "bgfx"`}, /** * Destroy shader uniform parameter. Params: handle = Handle to uniform object. */ - [q{void}, q{destroy}, q{UniformHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{UniformHandle handle}, ext: `C++, "bgfx"`}, /** * Create occlusion query. */ - [q{OcclusionQueryHandle}, q{createOcclusionQuery}, q{}, `C++, "bgfx"`], + {q{OcclusionQueryHandle}, q{createOcclusionQuery}, q{}, ext: `C++, "bgfx"`}, /** * Retrieve occlusion query result from previous frame. @@ -2842,14 +2843,14 @@ mixin(joinFnBinds((){ result = Number of pixels that passed test. This argument can be `NULL` if result of occlusion query is not needed. */ - [q{OcclusionQueryResult}, q{getResult}, q{OcclusionQueryHandle handle, int* result=null}, `C++, "bgfx"`], + {q{OcclusionQueryResult}, q{getResult}, q{OcclusionQueryHandle handle, int* result=null}, ext: `C++, "bgfx"`}, /** * Destroy occlusion query. Params: handle = Handle to occlusion query object. */ - [q{void}, q{destroy}, q{OcclusionQueryHandle handle}, `C++, "bgfx"`], + {q{void}, q{destroy}, q{OcclusionQueryHandle handle}, ext: `C++, "bgfx"`}, /** * Set palette color value. @@ -2857,7 +2858,18 @@ mixin(joinFnBinds((){ index = Index into palette. rgba = RGBA floating point values. */ - [q{void}, q{setPaletteColor}, q{ubyte index, const(float)* rgba}, `C++, "bgfx"`], + {q{void}, q{setPaletteColor}, q{ubyte index, const(float)* rgba}, ext: `C++, "bgfx"`}, + + /** + * Set palette color value. + Params: + index = Index into palette. + r = Red value (RGBA floating point values) + g = Green value (RGBA floating point values) + b = Blue value (RGBA floating point values) + a = Alpha value (RGBA floating point values) + */ + {q{void}, q{setPaletteColor}, q{ubyte index, float r, float g, float b, float a}, ext: `C++, "bgfx"`}, /** * Set palette color value. @@ -2865,7 +2877,7 @@ mixin(joinFnBinds((){ index = Index into palette. rgba = Packed 32-bit RGBA value. */ - [q{void}, q{setPaletteColor}, q{ubyte index, uint rgba}, `C++, "bgfx"`], + {q{void}, q{setPaletteColor}, q{ubyte index, uint rgba}, ext: `C++, "bgfx"`}, /** * Set view name. @@ -2879,8 +2891,10 @@ mixin(joinFnBinds((){ Params: id = View id. name = View name. + len = View name length (if length is INT32_MAX, it's expected + that _name is zero terminated string. */ - [q{void}, q{setViewName}, q{ViewID id, const(char)* name}, `C++, "bgfx"`], + {q{void}, q{setViewName}, q{ViewID id, const(char)* name, int len=int.max}, ext: `C++, "bgfx"`}, /** * Set view rectangle. Draw primitive outside view will be clipped. @@ -2891,7 +2905,7 @@ mixin(joinFnBinds((){ width = Width of view port region. height = Height of view port region. */ - [q{void}, q{setViewRect}, q{ViewID id, ushort x, ushort y, ushort width, ushort height}, `C++, "bgfx"`], + {q{void}, q{setViewRect}, q{ViewID id, ushort x, ushort y, ushort width, ushort height}, ext: `C++, "bgfx"`}, /** * Set view rectangle. Draw primitive outside view will be clipped. @@ -2902,7 +2916,7 @@ mixin(joinFnBinds((){ ratio = Width and height will be set in respect to back-buffer size. See: `BackbufferRatio::Enum`. */ - [q{void}, q{setViewRect}, q{ViewID id, ushort x, ushort y, bgfx.fakeenum.BackbufferRatio.Enum ratio}, `C++, "bgfx"`], + {q{void}, q{setViewRect}, q{ViewID id, ushort x, ushort y, bgfx.fakeenum.BackbufferRatio.Enum ratio}, ext: `C++, "bgfx"`}, /** * Set view scissor. Draw primitive outside view will be clipped. When @@ -2914,7 +2928,7 @@ mixin(joinFnBinds((){ width = Width of view scissor region. height = Height of view scissor region. */ - [q{void}, q{setViewScissor}, q{ViewID id, ushort x=0, ushort y=0, ushort width=0, ushort height=0}, `C++, "bgfx"`], + {q{void}, q{setViewScissor}, q{ViewID id, ushort x=0, ushort y=0, ushort width=0, ushort height=0}, ext: `C++, "bgfx"`}, /** * Set view clear flags. @@ -2926,7 +2940,7 @@ mixin(joinFnBinds((){ depth = Depth clear value. stencil = Stencil clear value. */ - [q{void}, q{setViewClear}, q{ViewID id, ushort flags, uint rgba=0x000000ff, float depth=1.0f, ubyte stencil=0}, `C++, "bgfx"`], + {q{void}, q{setViewClear}, q{ViewID id, ushort flags, uint rgba=0x000000ff, float depth=1.0f, ubyte stencil=0}, ext: `C++, "bgfx"`}, /** * Set view clear flags with different clear color for each @@ -2947,7 +2961,7 @@ mixin(joinFnBinds((){ c6 = Palette index for frame buffer attachment 6. c7 = Palette index for frame buffer attachment 7. */ - [q{void}, q{setViewClear}, q{ViewID id, ushort flags, float depth, ubyte stencil, ubyte c0=ubyte.max, ubyte c1=ubyte.max, ubyte c2=ubyte.max, ubyte c3=ubyte.max, ubyte c4=ubyte.max, ubyte c5=ubyte.max, ubyte c6=ubyte.max, ubyte c7=ubyte.max}, `C++, "bgfx"`], + {q{void}, q{setViewClear}, q{ViewID id, ushort flags, float depth, ubyte stencil, ubyte c0=ubyte.max, ubyte c1=ubyte.max, ubyte c2=ubyte.max, ubyte c3=ubyte.max, ubyte c4=ubyte.max, ubyte c5=ubyte.max, ubyte c6=ubyte.max, ubyte c7=ubyte.max}, ext: `C++, "bgfx"`}, /** * Set view sorting mode. @@ -2957,7 +2971,7 @@ mixin(joinFnBinds((){ id = View id. mode = View sort mode. See `ViewMode::Enum`. */ - [q{void}, q{setViewMode}, q{ViewID id, bgfx.fakeenum.ViewMode.Enum mode=ViewMode.default_}, `C++, "bgfx"`], + {q{void}, q{setViewMode}, q{ViewID id, bgfx.fakeenum.ViewMode.Enum mode=ViewMode.default_}, ext: `C++, "bgfx"`}, /** * Set view frame buffer. @@ -2969,7 +2983,7 @@ mixin(joinFnBinds((){ frame buffer handle will draw primitives from this view into default back buffer. */ - [q{void}, q{setViewFrameBuffer}, q{ViewID id, FrameBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{setViewFrameBuffer}, q{ViewID id, FrameBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Set view's view matrix and projection matrix, @@ -2979,7 +2993,7 @@ mixin(joinFnBinds((){ view = View matrix. proj = Projection matrix. */ - [q{void}, q{setViewTransform}, q{ViewID id, const(void)* view, const(void)* proj}, `C++, "bgfx"`], + {q{void}, q{setViewTransform}, q{ViewID id, const(void)* view, const(void)* proj}, ext: `C++, "bgfx"`}, /** * Post submit view reordering. @@ -2989,26 +3003,26 @@ mixin(joinFnBinds((){ order = View remap id table. Passing `NULL` will reset view ids to default state. */ - [q{void}, q{setViewOrder}, q{ViewID id=0, ushort num=ushort.max, const(ViewID)* order=null}, `C++, "bgfx"`], + {q{void}, q{setViewOrder}, q{ViewID id=0, ushort num=ushort.max, const(ViewID)* order=null}, ext: `C++, "bgfx"`}, /** * Reset all view settings to default. */ - [q{void}, q{resetView}, q{ViewID id}, `C++, "bgfx"`], + {q{void}, q{resetView}, q{ViewID id}, ext: `C++, "bgfx"`}, /** * Begin submitting draw calls from thread. Params: forThread = Explicitly request an encoder for a worker thread. */ - [q{Encoder*}, q{begin}, q{bool forThread=false}, `C++, "bgfx"`], + {q{Encoder*}, q{begin}, q{bool forThread=false}, ext: `C++, "bgfx"`}, /** * End submitting draw calls from thread. Params: encoder = Encoder. */ - [q{void}, q{end}, q{Encoder* encoder}, `C++, "bgfx"`], + {q{void}, q{end}, q{Encoder* encoder}, ext: `C++, "bgfx"`}, /** * Request screen shot of window back buffer. @@ -3020,7 +3034,7 @@ mixin(joinFnBinds((){ made for main window back buffer. filePath = Will be passed to `bgfx::CallbackI::screenShot` callback. */ - [q{void}, q{requestScreenShot}, q{FrameBufferHandle handle, const(char)* filePath}, `C++, "bgfx"`], + {q{void}, q{requestScreenShot}, q{FrameBufferHandle handle, const(char)* filePath}, ext: `C++, "bgfx"`}, /** * Render frame. @@ -3034,7 +3048,7 @@ mixin(joinFnBinds((){ Params: msecs = Timeout in milliseconds. */ - [q{RenderFrame}, q{renderFrame}, q{int msecs=-1}, `C++, "bgfx"`], + {q{RenderFrame}, q{renderFrame}, q{int msecs=-1}, ext: `C++, "bgfx"`}, /** * Set platform data. @@ -3042,7 +3056,7 @@ mixin(joinFnBinds((){ Params: data = Platform data. */ - [q{void}, q{setPlatformData}, q{ref const PlatformData data}, `C++, "bgfx"`], + {q{void}, q{setPlatformData}, q{ref const PlatformData data}, ext: `C++, "bgfx"`}, /** * Get internal data for interop. @@ -3050,7 +3064,7 @@ mixin(joinFnBinds((){ * use this call. * Warning: Must be called only on render thread. */ - [q{const(InternalData)*}, q{getInternalData}, q{}, `C++, "bgfx"`], + {q{const(InternalData)*}, q{getInternalData}, q{}, ext: `C++, "bgfx"`}, /** * Override internal texture with externally created texture. Previously @@ -3062,7 +3076,7 @@ mixin(joinFnBinds((){ handle = Texture handle. ptr = Native API pointer to texture. */ - [q{size_t}, q{overrideInternal}, q{TextureHandle handle, size_t ptr}, `C++, "bgfx"`], + {q{size_t}, q{overrideInternal}, q{TextureHandle handle, size_t ptr}, ext: `C++, "bgfx"`}, /** * Override internal texture by creating new texture. Previously created @@ -3085,15 +3099,17 @@ mixin(joinFnBinds((){ - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling. */ - [q{size_t}, q{overrideInternal}, q{TextureHandle handle, ushort width, ushort height, ubyte numMIPs, bgfx.fakeenum.TextureFormat.Enum format, ulong flags}, `C++, "bgfx"`], + {q{size_t}, q{overrideInternal}, q{TextureHandle handle, ushort width, ushort height, ubyte numMIPs, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 flags=Texture.none | Sampler.none}, ext: `C++, "bgfx"`}, /** * Sets a debug marker. This allows you to group graphics calls together for easy browsing in * graphics debugging tools. Params: - marker = Marker string. + name = Marker name. + len = Marker name length (if length is INT32_MAX, it's expected + that _name is zero terminated string. */ - [q{void}, q{setMarker}, q{const(char)* marker}, `C++, "bgfx"`], + {q{void}, q{setMarker}, q{const(char)* name, int len=int.max}, ext: `C++, "bgfx"`}, /** * Set render states for draw primitive. @@ -3120,7 +3136,7 @@ mixin(joinFnBinds((){ rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes. */ - [q{void}, q{setState}, q{ulong state, uint rgba=0}, `C++, "bgfx"`], + {q{void}, q{setState}, q{c_uint64 state, uint rgba=0}, ext: `C++, "bgfx"`}, /** * Set condition for rendering. @@ -3128,16 +3144,16 @@ mixin(joinFnBinds((){ handle = Occlusion query handle. visible = Render if occlusion query is visible. */ - [q{void}, q{setCondition}, q{OcclusionQueryHandle handle, bool visible}, `C++, "bgfx"`], + {q{void}, q{setCondition}, q{OcclusionQueryHandle handle, bool visible}, ext: `C++, "bgfx"`}, /** * Set stencil test state. Params: - fstencil = Front stencil state. - bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE` + fStencil = Front stencil state. + bStencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE` _fstencil is applied to both front and back facing primitives. */ - [q{void}, q{setStencil}, q{uint fstencil, uint bstencil=Stencil.none}, `C++, "bgfx"`], + {q{void}, q{setStencil}, q{uint fStencil, uint bStencil=Stencil.none}, ext: `C++, "bgfx"`}, /** * Set scissor for draw primitive. @@ -3149,7 +3165,7 @@ mixin(joinFnBinds((){ width = Width of view scissor region. height = Height of view scissor region. */ - [q{ushort}, q{setScissor}, q{ushort x, ushort y, ushort width, ushort height}, `C++, "bgfx"`], + {q{ushort}, q{setScissor}, q{ushort x, ushort y, ushort width, ushort height}, ext: `C++, "bgfx"`}, /** * Set scissor from cache for draw primitive. @@ -3158,7 +3174,7 @@ mixin(joinFnBinds((){ Params: cache = Index in scissor cache. */ - [q{void}, q{setScissor}, q{ushort cache=ushort.max}, `C++, "bgfx"`], + {q{void}, q{setScissor}, q{ushort cache=ushort.max}, ext: `C++, "bgfx"`}, /** * Set model matrix for draw primitive. If it is not called, @@ -3167,7 +3183,7 @@ mixin(joinFnBinds((){ mtx = Pointer to first matrix in array. num = Number of matrices in array. */ - [q{uint}, q{setTransform}, q{const(void)* mtx, ushort num}, `C++, "bgfx"`], + {q{uint}, q{setTransform}, q{const(void)* mtx, ushort num=1}, ext: `C++, "bgfx"`}, /** * Set model matrix from matrix cache for draw primitive. @@ -3175,7 +3191,7 @@ mixin(joinFnBinds((){ cache = Index in matrix cache. num = Number of matrices from cache. */ - [q{void}, q{setTransform}, q{uint cache, ushort num=1}, `C++, "bgfx"`], + {q{void}, q{setTransform}, q{uint cache, ushort num=1}, ext: `C++, "bgfx"`}, /** * Reserve matrices in internal matrix cache. @@ -3184,7 +3200,7 @@ mixin(joinFnBinds((){ transform = Pointer to `Transform` structure. num = Number of matrices. */ - [q{uint}, q{allocTransform}, q{Transform* transform, ushort num}, `C++, "bgfx"`], + {q{uint}, q{allocTransform}, q{Transform* transform, ushort num}, ext: `C++, "bgfx"`}, /** * Set shader uniform parameter for draw primitive. @@ -3194,14 +3210,14 @@ mixin(joinFnBinds((){ num = Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation. */ - [q{void}, q{setUniform}, q{UniformHandle handle, const(void)* value, ushort num=1}, `C++, "bgfx"`], + {q{void}, q{setUniform}, q{UniformHandle handle, const(void)* value, ushort num=1}, ext: `C++, "bgfx"`}, /** * Set index buffer for draw primitive. Params: handle = Index buffer. */ - [q{void}, q{setIndexBuffer}, q{IndexBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{setIndexBuffer}, q{IndexBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Set index buffer for draw primitive. @@ -3210,14 +3226,14 @@ mixin(joinFnBinds((){ firstIndex = First index to render. numIndices = Number of indices to render. */ - [q{void}, q{setIndexBuffer}, q{IndexBufferHandle handle, uint firstIndex, uint numIndices}, `C++, "bgfx"`], + {q{void}, q{setIndexBuffer}, q{IndexBufferHandle handle, uint firstIndex, uint numIndices}, ext: `C++, "bgfx"`}, /** * Set index buffer for draw primitive. Params: handle = Dynamic index buffer. */ - [q{void}, q{setIndexBuffer}, q{DynamicIndexBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{setIndexBuffer}, q{DynamicIndexBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Set index buffer for draw primitive. @@ -3226,14 +3242,14 @@ mixin(joinFnBinds((){ firstIndex = First index to render. numIndices = Number of indices to render. */ - [q{void}, q{setIndexBuffer}, q{DynamicIndexBufferHandle handle, uint firstIndex, uint numIndices}, `C++, "bgfx"`], + {q{void}, q{setIndexBuffer}, q{DynamicIndexBufferHandle handle, uint firstIndex, uint numIndices}, ext: `C++, "bgfx"`}, /** * Set index buffer for draw primitive. Params: tib = Transient index buffer. */ - [q{void}, q{setIndexBuffer}, q{const(TransientIndexBuffer)* tib}, `C++, "bgfx"`], + {q{void}, q{setIndexBuffer}, q{const(TransientIndexBuffer)* tib}, ext: `C++, "bgfx"`}, /** * Set index buffer for draw primitive. @@ -3242,7 +3258,7 @@ mixin(joinFnBinds((){ firstIndex = First index to render. numIndices = Number of indices to render. */ - [q{void}, q{setIndexBuffer}, q{const(TransientIndexBuffer)* tib, uint firstIndex, uint numIndices}, `C++, "bgfx"`], + {q{void}, q{setIndexBuffer}, q{const(TransientIndexBuffer)* tib, uint firstIndex, uint numIndices}, ext: `C++, "bgfx"`}, /** * Set vertex buffer for draw primitive. @@ -3250,7 +3266,7 @@ mixin(joinFnBinds((){ stream = Vertex stream. handle = Vertex buffer. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, VertexBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, VertexBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Set vertex buffer for draw primitive. @@ -3263,7 +3279,7 @@ mixin(joinFnBinds((){ handle is used, vertex layout used for creation of vertex buffer will be used. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, VertexBufferHandle handle, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, `C++, "bgfx"`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, VertexBufferHandle handle, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, ext: `C++, "bgfx"`}, /** * Set vertex buffer for draw primitive. @@ -3271,7 +3287,7 @@ mixin(joinFnBinds((){ stream = Vertex stream. handle = Dynamic vertex buffer. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle}, `C++, "bgfx"`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle}, ext: `C++, "bgfx"`}, /** * Set vertex buffer for draw primitive. @@ -3284,7 +3300,7 @@ mixin(joinFnBinds((){ handle is used, vertex layout used for creation of vertex buffer will be used. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, `C++, "bgfx"`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, ext: `C++, "bgfx"`}, /** * Set vertex buffer for draw primitive. @@ -3292,7 +3308,7 @@ mixin(joinFnBinds((){ stream = Vertex stream. tvb = Transient vertex buffer. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, const(TransientVertexBuffer)* tvb}, `C++, "bgfx"`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, const(TransientVertexBuffer)* tvb}, ext: `C++, "bgfx"`}, /** * Set vertex buffer for draw primitive. @@ -3305,7 +3321,7 @@ mixin(joinFnBinds((){ handle is used, vertex layout used for creation of vertex buffer will be used. */ - [q{void}, q{setVertexBuffer}, q{ubyte stream, const(TransientVertexBuffer)* tvb, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, `C++, "bgfx"`], + {q{void}, q{setVertexBuffer}, q{ubyte stream, const(TransientVertexBuffer)* tvb, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, ext: `C++, "bgfx"`}, /** * Set number of vertices for auto generated vertices use in conjunction @@ -3314,14 +3330,14 @@ mixin(joinFnBinds((){ Params: numVertices = Number of vertices. */ - [q{void}, q{setVertexCount}, q{uint numVertices}, `C++, "bgfx"`], + {q{void}, q{setVertexCount}, q{uint numVertices}, ext: `C++, "bgfx"`}, /** * Set instance data buffer for draw primitive. Params: idb = Transient instance data buffer. */ - [q{void}, q{setInstanceDataBuffer}, q{const(InstanceDataBuffer)* idb}, `C++, "bgfx"`], + {q{void}, q{setInstanceDataBuffer}, q{const(InstanceDataBuffer)* idb}, ext: `C++, "bgfx"`}, /** * Set instance data buffer for draw primitive. @@ -3330,7 +3346,7 @@ mixin(joinFnBinds((){ start = First instance data. num = Number of data instances. */ - [q{void}, q{setInstanceDataBuffer}, q{const(InstanceDataBuffer)* idb, uint start, uint num}, `C++, "bgfx"`], + {q{void}, q{setInstanceDataBuffer}, q{const(InstanceDataBuffer)* idb, uint start, uint num}, ext: `C++, "bgfx"`}, /** * Set instance data buffer for draw primitive. @@ -3339,7 +3355,7 @@ mixin(joinFnBinds((){ startVertex = First instance data. num = Number of data instances. */ - [q{void}, q{setInstanceDataBuffer}, q{VertexBufferHandle handle, uint startVertex, uint num}, `C++, "bgfx"`], + {q{void}, q{setInstanceDataBuffer}, q{VertexBufferHandle handle, uint startVertex, uint num}, ext: `C++, "bgfx"`}, /** * Set instance data buffer for draw primitive. @@ -3348,14 +3364,14 @@ mixin(joinFnBinds((){ startVertex = First instance data. num = Number of data instances. */ - [q{void}, q{setInstanceDataBuffer}, q{DynamicVertexBufferHandle handle, uint startVertex, uint num}, `C++, "bgfx"`], + {q{void}, q{setInstanceDataBuffer}, q{DynamicVertexBufferHandle handle, uint startVertex, uint num}, ext: `C++, "bgfx"`}, /** * Set number of instances for auto generated instances use in conjunction * with gl_InstanceID. * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`. */ - [q{void}, q{setInstanceCount}, q{uint numInstances}, `C++, "bgfx"`], + {q{void}, q{setInstanceCount}, q{uint numInstances}, ext: `C++, "bgfx"`}, /** * Set texture stage for draw primitive. @@ -3370,7 +3386,7 @@ mixin(joinFnBinds((){ - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling. */ - [q{void}, q{setTexture}, q{ubyte stage, UniformHandle sampler, TextureHandle handle, uint flags=uint.max}, `C++, "bgfx"`], + {q{void}, q{setTexture}, q{ubyte stage, UniformHandle sampler, TextureHandle handle, uint flags=uint.max}, ext: `C++, "bgfx"`}, /** * Submit an empty primitive for rendering. Uniforms and draw state @@ -3380,7 +3396,7 @@ mixin(joinFnBinds((){ Params: id = View id. */ - [q{void}, q{touch}, q{ViewID id}, `C++, "bgfx"`], + {q{void}, q{touch}, q{ViewID id}, ext: `C++, "bgfx"`}, /** * Submit primitive for rendering. @@ -3390,7 +3406,7 @@ mixin(joinFnBinds((){ depth = Depth for sorting. flags = Which states to discard for next draw. See `BGFX_DISCARD_*`. */ - [q{void}, q{submit}, q{ViewID id, ProgramHandle program, uint depth=0, ubyte flags=Discard.all}, `C++, "bgfx"`], + {q{void}, q{submit}, q{ViewID id, ProgramHandle program, uint depth=0, ubyte flags=Discard.all}, ext: `C++, "bgfx"`}, /** * Submit primitive with occlusion query for rendering. @@ -3401,7 +3417,7 @@ mixin(joinFnBinds((){ depth = Depth for sorting. flags = Which states to discard for next draw. See `BGFX_DISCARD_*`. */ - [q{void}, q{submit}, q{ViewID id, ProgramHandle program, OcclusionQueryHandle occlusionQuery, uint depth=0, ubyte flags=Discard.all}, `C++, "bgfx"`], + {q{void}, q{submit}, q{ViewID id, ProgramHandle program, OcclusionQueryHandle occlusionQuery, uint depth=0, ubyte flags=Discard.all}, ext: `C++, "bgfx"`}, /** * Submit primitive for rendering with index and instance data info from @@ -3416,7 +3432,7 @@ mixin(joinFnBinds((){ depth = Depth for sorting. flags = Which states to discard for next draw. See `BGFX_DISCARD_*`. */ - [q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, ushort start=0, ushort num=1, uint depth=0, ubyte flags=Discard.all}, `C++, "bgfx"`], + {q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start=0, uint num=1, uint depth=0, ubyte flags=Discard.all}, ext: `C++, "bgfx"`}, /** * Submit primitive for rendering with index and instance data info and @@ -3434,7 +3450,7 @@ mixin(joinFnBinds((){ depth = Depth for sorting. flags = Which states to discard for next draw. See `BGFX_DISCARD_*`. */ - [q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, ushort start, IndexBufferHandle numHandle, uint numIndex=0, ushort numMax=ushort.max, uint depth=0, ubyte flags=Discard.all}, `C++, "bgfx"`], + {q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start, IndexBufferHandle numHandle, uint numIndex=0, uint numMax=uint.max, uint depth=0, ubyte flags=Discard.all}, ext: `C++, "bgfx"`}, /** * Set compute index buffer. @@ -3443,7 +3459,7 @@ mixin(joinFnBinds((){ handle = Index buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, IndexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++, "bgfx"`], + {q{void}, q{setBuffer}, q{ubyte stage, IndexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++, "bgfx"`}, /** * Set compute vertex buffer. @@ -3452,7 +3468,7 @@ mixin(joinFnBinds((){ handle = Vertex buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, VertexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++, "bgfx"`], + {q{void}, q{setBuffer}, q{ubyte stage, VertexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++, "bgfx"`}, /** * Set compute dynamic index buffer. @@ -3461,7 +3477,7 @@ mixin(joinFnBinds((){ handle = Dynamic index buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, DynamicIndexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++, "bgfx"`], + {q{void}, q{setBuffer}, q{ubyte stage, DynamicIndexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++, "bgfx"`}, /** * Set compute dynamic vertex buffer. @@ -3470,7 +3486,7 @@ mixin(joinFnBinds((){ handle = Dynamic vertex buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, DynamicVertexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++, "bgfx"`], + {q{void}, q{setBuffer}, q{ubyte stage, DynamicVertexBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++, "bgfx"`}, /** * Set compute indirect buffer. @@ -3479,7 +3495,7 @@ mixin(joinFnBinds((){ handle = Indirect buffer handle. access = Buffer access. See `Access::Enum`. */ - [q{void}, q{setBuffer}, q{ubyte stage, IndirectBufferHandle handle, bgfx.fakeenum.Access.Enum access}, `C++, "bgfx"`], + {q{void}, q{setBuffer}, q{ubyte stage, IndirectBufferHandle handle, bgfx.fakeenum.Access.Enum access}, ext: `C++, "bgfx"`}, /** * Set compute image from texture. @@ -3490,7 +3506,7 @@ mixin(joinFnBinds((){ access = Image access. See `Access::Enum`. format = Texture format. See: `TextureFormat::Enum`. */ - [q{void}, q{setImage}, q{ubyte stage, TextureHandle handle, ubyte mip, bgfx.fakeenum.Access.Enum access, bgfx.fakeenum.TextureFormat.Enum format=TextureFormat.count}, `C++, "bgfx"`], + {q{void}, q{setImage}, q{ubyte stage, TextureHandle handle, ubyte mip, bgfx.fakeenum.Access.Enum access, bgfx.fakeenum.TextureFormat.Enum format=TextureFormat.count}, ext: `C++, "bgfx"`}, /** * Dispatch compute. @@ -3502,7 +3518,7 @@ mixin(joinFnBinds((){ numZ = Number of groups Z. flags = Discard or preserve states. See `BGFX_DISCARD_*`. */ - [q{void}, q{dispatch}, q{ViewID id, ProgramHandle program, uint numX=1, uint numY=1, uint numZ=1, ubyte flags=Discard.all}, `C++, "bgfx"`], + {q{void}, q{dispatch}, q{ViewID id, ProgramHandle program, uint numX=1, uint numY=1, uint numZ=1, ubyte flags=Discard.all}, ext: `C++, "bgfx"`}, /** * Dispatch compute indirect. @@ -3514,14 +3530,14 @@ mixin(joinFnBinds((){ num = Number of dispatches. flags = Discard or preserve states. See `BGFX_DISCARD_*`. */ - [q{void}, q{dispatch}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, ushort start=0, ushort num=1, ubyte flags=Discard.all}, `C++, "bgfx"`], + {q{void}, q{dispatch}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start=0, uint num=1, ubyte flags=Discard.all}, ext: `C++, "bgfx"`}, /** * Discard previously set state for draw or compute call. Params: flags = Draw/compute states to discard. */ - [q{void}, q{discard}, q{ubyte flags=Discard.all}, `C++, "bgfx"`], + {q{void}, q{discard}, q{ubyte flags=Discard.all}, ext: `C++, "bgfx"`}, /** * Blit 2D texture region between two 2D textures. @@ -3538,7 +3554,7 @@ mixin(joinFnBinds((){ width = Width of region. height = Height of region. */ - [q{void}, q{blit}, q{ViewID id, TextureHandle dst, ushort dstX, ushort dstY, TextureHandle src, ushort srcX=0, ushort srcY=0, ushort width=ushort.max, ushort height=ushort.max}, `C++, "bgfx"`], + {q{void}, q{blit}, q{ViewID id, TextureHandle dst, ushort dstX, ushort dstY, TextureHandle src, ushort srcX=0, ushort srcY=0, ushort width=ushort.max, ushort height=ushort.max}, ext: `C++, "bgfx"`}, /** * Blit 2D texture region between two 2D textures. @@ -3565,11 +3581,11 @@ mixin(joinFnBinds((){ depth = If texture is 3D this argument represents depth of region, otherwise it's unused. */ - [q{void}, q{blit}, q{ViewID id, TextureHandle dst, ubyte dstMIP, ushort dstX, ushort dstY, ushort dstZ, TextureHandle src, ubyte srcMIP=0, ushort srcX=0, ushort srcY=0, ushort srcZ=0, ushort width=ushort.max, ushort height=ushort.max, ushort depth=ushort.max}, `C++, "bgfx"`], + {q{void}, q{blit}, q{ViewID id, TextureHandle dst, ubyte dstMIP, ushort dstX, ushort dstY, ushort dstZ, TextureHandle src, ubyte srcMIP=0, ushort srcX=0, ushort srcY=0, ushort srcZ=0, ushort width=ushort.max, ushort height=ushort.max, ushort depth=ushort.max}, ext: `C++, "bgfx"`}, - ]); + ]; return ret; -}(), __MODULE__, "Resolution, Init, Attachment, VertexLayout, Encoder, ")); +}(), "Resolution, Limits, Init, Attachment, VertexLayout, Encoder, ")); static if(!staticBinding): import bindbc.loader; diff --git a/bgfx/bindings/zig/bgfx.zig b/bgfx/bindings/zig/bgfx.zig index 59292685..8f721f16 100644 --- a/bgfx/bindings/zig/bgfx.zig +++ b/bgfx/bindings/zig/bgfx.zig @@ -1,4 +1,4 @@ -// Copyright 2011-2023 Branimir Karadzic. All rights reserved. +// Copyright 2011-2024 Branimir Karadzic. All rights reserved. // License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE @@ -641,84 +641,84 @@ pub const CapsFlags_ConservativeRaster: CapsFlags = 0x0000000000000008; /// Draw indirect is supported. pub const CapsFlags_DrawIndirect: CapsFlags = 0x0000000000000010; +/// Draw indirect with indirect count is supported. +pub const CapsFlags_DrawIndirectCount: CapsFlags = 0x0000000000000020; + /// Fragment depth is available in fragment shader. -pub const CapsFlags_FragmentDepth: CapsFlags = 0x0000000000000020; +pub const CapsFlags_FragmentDepth: CapsFlags = 0x0000000000000040; /// Fragment ordering is available in fragment shader. -pub const CapsFlags_FragmentOrdering: CapsFlags = 0x0000000000000040; +pub const CapsFlags_FragmentOrdering: CapsFlags = 0x0000000000000080; /// Graphics debugger is present. -pub const CapsFlags_GraphicsDebugger: CapsFlags = 0x0000000000000080; +pub const CapsFlags_GraphicsDebugger: CapsFlags = 0x0000000000000100; /// HDR10 rendering is supported. -pub const CapsFlags_Hdr10: CapsFlags = 0x0000000000000100; +pub const CapsFlags_Hdr10: CapsFlags = 0x0000000000000200; /// HiDPI rendering is supported. -pub const CapsFlags_Hidpi: CapsFlags = 0x0000000000000200; +pub const CapsFlags_Hidpi: CapsFlags = 0x0000000000000400; /// Image Read/Write is supported. -pub const CapsFlags_ImageRw: CapsFlags = 0x0000000000000400; +pub const CapsFlags_ImageRw: CapsFlags = 0x0000000000000800; /// 32-bit indices are supported. -pub const CapsFlags_Index32: CapsFlags = 0x0000000000000800; +pub const CapsFlags_Index32: CapsFlags = 0x0000000000001000; /// Instancing is supported. -pub const CapsFlags_Instancing: CapsFlags = 0x0000000000001000; +pub const CapsFlags_Instancing: CapsFlags = 0x0000000000002000; /// Occlusion query is supported. -pub const CapsFlags_OcclusionQuery: CapsFlags = 0x0000000000002000; +pub const CapsFlags_OcclusionQuery: CapsFlags = 0x0000000000004000; + +/// PrimitiveID is available in fragment shader. +pub const CapsFlags_PrimitiveId: CapsFlags = 0x0000000000008000; /// Renderer is on separate thread. -pub const CapsFlags_RendererMultithreaded: CapsFlags = 0x0000000000004000; +pub const CapsFlags_RendererMultithreaded: CapsFlags = 0x0000000000010000; /// Multiple windows are supported. -pub const CapsFlags_SwapChain: CapsFlags = 0x0000000000008000; - -/// 2D texture array is supported. -pub const CapsFlags_Texture2DArray: CapsFlags = 0x0000000000010000; - -/// 3D textures are supported. -pub const CapsFlags_Texture3D: CapsFlags = 0x0000000000020000; +pub const CapsFlags_SwapChain: CapsFlags = 0x0000000000020000; /// Texture blit is supported. pub const CapsFlags_TextureBlit: CapsFlags = 0x0000000000040000; -/// Transparent back buffer supported. -pub const CapsFlags_TransparentBackbuffer: CapsFlags = 0x0000000000080000; -pub const CapsFlags_TextureCompareReserved: CapsFlags = 0x0000000000100000; - /// Texture compare less equal mode is supported. -pub const CapsFlags_TextureCompareLequal: CapsFlags = 0x0000000000200000; +pub const CapsFlags_TextureCompareLequal: CapsFlags = 0x0000000000080000; +pub const CapsFlags_TextureCompareReserved: CapsFlags = 0x0000000000100000; /// Cubemap texture array is supported. -pub const CapsFlags_TextureCubeArray: CapsFlags = 0x0000000000400000; +pub const CapsFlags_TextureCubeArray: CapsFlags = 0x0000000000200000; /// CPU direct access to GPU texture memory. -pub const CapsFlags_TextureDirectAccess: CapsFlags = 0x0000000000800000; +pub const CapsFlags_TextureDirectAccess: CapsFlags = 0x0000000000400000; /// Read-back texture is supported. -pub const CapsFlags_TextureReadBack: CapsFlags = 0x0000000001000000; +pub const CapsFlags_TextureReadBack: CapsFlags = 0x0000000000800000; + +/// 2D texture array is supported. +pub const CapsFlags_Texture2DArray: CapsFlags = 0x0000000001000000; + +/// 3D textures are supported. +pub const CapsFlags_Texture3D: CapsFlags = 0x0000000002000000; + +/// Transparent back buffer supported. +pub const CapsFlags_TransparentBackbuffer: CapsFlags = 0x0000000004000000; /// Vertex attribute half-float is supported. -pub const CapsFlags_VertexAttribHalf: CapsFlags = 0x0000000002000000; +pub const CapsFlags_VertexAttribHalf: CapsFlags = 0x0000000008000000; /// Vertex attribute 10_10_10_2 is supported. -pub const CapsFlags_VertexAttribUint10: CapsFlags = 0x0000000004000000; +pub const CapsFlags_VertexAttribUint10: CapsFlags = 0x0000000010000000; /// Rendering with VertexID only is supported. -pub const CapsFlags_VertexId: CapsFlags = 0x0000000008000000; - -/// PrimitiveID is available in fragment shader. -pub const CapsFlags_PrimitiveId: CapsFlags = 0x0000000010000000; +pub const CapsFlags_VertexId: CapsFlags = 0x0000000020000000; /// Viewport layer is available in vertex shader. -pub const CapsFlags_ViewportLayerArray: CapsFlags = 0x0000000020000000; - -/// Draw indirect with indirect count is supported. -pub const CapsFlags_DrawIndirectCount: CapsFlags = 0x0000000040000000; +pub const CapsFlags_ViewportLayerArray: CapsFlags = 0x0000000040000000; /// All texture compare modes are supported. -pub const CapsFlags_TextureCompareAll: CapsFlags = 0x0000000000300000; +pub const CapsFlags_TextureCompareAll: CapsFlags = 0x0000000000180000; pub const CapsFormatFlags = u32; /// Texture format is not supported. @@ -840,9 +840,6 @@ pub const RendererType = enum(c_int) { /// AGC Agc, - /// Direct3D 9.0 - Direct3D9, - /// Direct3D 11.0 Direct3D11, @@ -867,9 +864,6 @@ pub const RendererType = enum(c_int) { /// Vulkan Vulkan, - /// WebGPU - WebGPU, - Count }; @@ -1536,11 +1530,6 @@ pub const Init = extern struct { pub inline fn decode(self: *const VertexLayout, _attrib: Attrib, _num: [*c]u8 , _type: [*c]AttribType, _normalized: [*c]bool, _asInt: [*c]bool) void { return bgfx_vertex_layout_decode(self, _attrib, _num, _type, _normalized, _asInt); } - /// Returns `true` if VertexLayout contains attribute. - /// Attribute semantics. See: `bgfx::Attrib` - pub inline fn has(self: *const VertexLayout, _attrib: Attrib) bool { - return bgfx_vertex_layout_has(self, _attrib); - } /// Skip `_num` bytes in vertex stream. /// Number of bytes to skip. pub inline fn skip(self: *VertexLayout, _num: u8) *VertexLayout { @@ -1555,9 +1544,10 @@ pub const Init = extern struct { pub const Encoder = opaque { /// Sets a debug marker. This allows you to group graphics calls together for easy browsing in /// graphics debugging tools. - /// Marker string. - pub inline fn setMarker(self: ?*Encoder, _marker: [*c]const u8) void { - return bgfx_encoder_set_marker(self, _marker); + /// Marker name. + /// Marker name length (if length is INT32_MAX, it's expected that _name is zero terminated string. + pub inline fn setMarker(self: ?*Encoder, _name: [*c]const u8, _len: i32) void { + return bgfx_encoder_set_marker(self, _name, _len); } /// Set render states for draw primitive. /// @remarks @@ -1776,7 +1766,7 @@ pub const Init = extern struct { /// Number of draws. /// Depth for sorting. /// Discard or preserve states. See `BGFX_DISCARD_*`. - pub inline fn submitIndirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _depth: u32, _flags: u8) void { + pub inline fn submitIndirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _num: u32, _depth: u32, _flags: u8) void { return bgfx_encoder_submit_indirect(self, _id, _program, _indirectHandle, _start, _num, _depth, _flags); } /// Submit primitive for rendering with index and instance data info and @@ -1791,7 +1781,7 @@ pub const Init = extern struct { /// Max number of draws. /// Depth for sorting. /// Discard or preserve states. See `BGFX_DISCARD_*`. - pub inline fn submitIndirectCount(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void { + pub inline fn submitIndirectCount(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u32, _depth: u32, _flags: u8) void { return bgfx_encoder_submit_indirect_count(self, _id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags); } /// Set compute index buffer. @@ -1855,7 +1845,7 @@ pub const Init = extern struct { /// First element in indirect buffer. /// Number of dispatches. /// Discard or preserve states. See `BGFX_DISCARD_*`. - pub inline fn dispatchIndirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _flags: u8) void { + pub inline fn dispatchIndirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _num: u32, _flags: u8) void { return bgfx_encoder_dispatch_indirect(self, _id, _program, _indirectHandle, _start, _num, _flags); } /// Discard previously set state for draw or compute call. @@ -1964,10 +1954,6 @@ extern fn bgfx_vertex_layout_add(self: [*c]VertexLayout, _attrib: Attrib, _num: /// Attribute is packed as int. extern fn bgfx_vertex_layout_decode(self: [*c]const VertexLayout, _attrib: Attrib, _num: [*c]u8 , _type: [*c]AttribType, _normalized: [*c]bool, _asInt: [*c]bool) void; -/// Returns `true` if VertexLayout contains attribute. -/// Attribute semantics. See: `bgfx::Attrib` -extern fn bgfx_vertex_layout_has(self: [*c]const VertexLayout, _attrib: Attrib) bool; - /// Skip `_num` bytes in vertex stream. /// Number of bytes to skip. extern fn bgfx_vertex_layout_skip(self: [*c]VertexLayout, _num: u8) [*c]VertexLayout; @@ -2064,6 +2050,8 @@ pub inline fn getRendererName(_type: RendererType) [*c]const u8 { } extern fn bgfx_get_renderer_name(_type: RendererType) [*c]const u8; +/// Fill bgfx::Init struct with default values, before using it to initialize the library. +/// Pointer to structure to be initialized. See: `bgfx::Init` for more info. pub inline fn initCtor(_init: [*c]Init) void { return bgfx_init_ctor(_init); } @@ -2407,6 +2395,8 @@ pub inline fn destroyIndirectBuffer(_handle: IndirectBufferHandle) void { extern fn bgfx_destroy_indirect_buffer(_handle: IndirectBufferHandle) void; /// Create shader from memory buffer. +/// @remarks +/// Shader binary is obtained by compiling shader offline with shaderc command line tool. /// Shader binary. pub inline fn createShader(_mem: [*c]const Memory) ShaderHandle { return bgfx_create_shader(_mem); @@ -2795,6 +2785,17 @@ pub inline fn setPaletteColor(_index: u8, _rgba: [4]f32) void { } extern fn bgfx_set_palette_color(_index: u8, _rgba: [4]f32) void; +/// Set palette color value. +/// Index into palette. +/// Red value (RGBA floating point values) +/// Green value (RGBA floating point values) +/// Blue value (RGBA floating point values) +/// Alpha value (RGBA floating point values) +pub inline fn setPaletteColorRgba32f(_index: u8, _r: f32, _g: f32, _b: f32, _a: f32) void { + return bgfx_set_palette_color_rgba32f(_index, _r, _g, _b, _a); +} +extern fn bgfx_set_palette_color_rgba32f(_index: u8, _r: f32, _g: f32, _b: f32, _a: f32) void; + /// Set palette color value. /// Index into palette. /// Packed 32-bit RGBA value. @@ -2813,10 +2814,11 @@ extern fn bgfx_set_palette_color_rgba8(_index: u8, _rgba: u32) void; /// +------ view id /// View id. /// View name. -pub inline fn setViewName(_id: ViewId, _name: [*c]const u8) void { - return bgfx_set_view_name(_id, _name); +/// View name length (if length is INT32_MAX, it's expected that _name is zero terminated string. +pub inline fn setViewName(_id: ViewId, _name: [*c]const u8, _len: i32) void { + return bgfx_set_view_name(_id, _name, _len); } -extern fn bgfx_set_view_name(_id: ViewId, _name: [*c]const u8) void; +extern fn bgfx_set_view_name(_id: ViewId, _name: [*c]const u8, _len: i32) void; /// Set view rectangle. Draw primitive outside view will be clipped. /// View id. @@ -2943,8 +2945,9 @@ extern fn bgfx_encoder_end(_encoder: ?*Encoder) void; /// Sets a debug marker. This allows you to group graphics calls together for easy browsing in /// graphics debugging tools. -/// Marker string. -extern fn bgfx_encoder_set_marker(self: ?*Encoder, _marker: [*c]const u8) void; +/// Marker name. +/// Marker name length (if length is INT32_MAX, it's expected that _name is zero terminated string. +extern fn bgfx_encoder_set_marker(self: ?*Encoder, _name: [*c]const u8, _len: i32) void; /// Set render states for draw primitive. /// @remarks @@ -3136,7 +3139,7 @@ extern fn bgfx_encoder_submit_occlusion_query(self: ?*Encoder, _id: ViewId, _pro /// Number of draws. /// Depth for sorting. /// Discard or preserve states. See `BGFX_DISCARD_*`. -extern fn bgfx_encoder_submit_indirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _depth: u32, _flags: u8) void; +extern fn bgfx_encoder_submit_indirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _num: u32, _depth: u32, _flags: u8) void; /// Submit primitive for rendering with index and instance data info and /// draw count from indirect buffers. @@ -3150,7 +3153,7 @@ extern fn bgfx_encoder_submit_indirect(self: ?*Encoder, _id: ViewId, _program: P /// Max number of draws. /// Depth for sorting. /// Discard or preserve states. See `BGFX_DISCARD_*`. -extern fn bgfx_encoder_submit_indirect_count(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void; +extern fn bgfx_encoder_submit_indirect_count(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u32, _depth: u32, _flags: u8) void; /// Set compute index buffer. /// Compute stage. @@ -3206,7 +3209,7 @@ extern fn bgfx_encoder_dispatch(self: ?*Encoder, _id: ViewId, _program: ProgramH /// First element in indirect buffer. /// Number of dispatches. /// Discard or preserve states. See `BGFX_DISCARD_*`. -extern fn bgfx_encoder_dispatch_indirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _flags: u8) void; +extern fn bgfx_encoder_dispatch_indirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _num: u32, _flags: u8) void; /// Discard previously set state for draw or compute call. /// Discard or preserve states. See `BGFX_DISCARD_*`. @@ -3305,11 +3308,12 @@ extern fn bgfx_override_internal_texture(_handle: TextureHandle, _width: u16, _h /// Sets a debug marker. This allows you to group graphics calls together for easy browsing in /// graphics debugging tools. -/// Marker string. -pub inline fn setMarker(_marker: [*c]const u8) void { - return bgfx_set_marker(_marker); +/// Marker name. +/// Marker name length (if length is INT32_MAX, it's expected that _name is zero terminated string. +pub inline fn setMarker(_name: [*c]const u8, _len: i32) void { + return bgfx_set_marker(_name, _len); } -extern fn bgfx_set_marker(_marker: [*c]const u8) void; +extern fn bgfx_set_marker(_name: [*c]const u8, _len: i32) void; /// Set render states for draw primitive. /// @remarks @@ -3586,10 +3590,10 @@ extern fn bgfx_submit_occlusion_query(_id: ViewId, _program: ProgramHandle, _occ /// Number of draws. /// Depth for sorting. /// Which states to discard for next draw. See `BGFX_DISCARD_*`. -pub inline fn submitIndirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _depth: u32, _flags: u8) void { +pub inline fn submitIndirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _num: u32, _depth: u32, _flags: u8) void { return bgfx_submit_indirect(_id, _program, _indirectHandle, _start, _num, _depth, _flags); } -extern fn bgfx_submit_indirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _depth: u32, _flags: u8) void; +extern fn bgfx_submit_indirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _num: u32, _depth: u32, _flags: u8) void; /// Submit primitive for rendering with index and instance data info and /// draw count from indirect buffers. @@ -3603,10 +3607,10 @@ extern fn bgfx_submit_indirect(_id: ViewId, _program: ProgramHandle, _indirectHa /// Max number of draws. /// Depth for sorting. /// Which states to discard for next draw. See `BGFX_DISCARD_*`. -pub inline fn submitIndirectCount(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void { +pub inline fn submitIndirectCount(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u32, _depth: u32, _flags: u8) void { return bgfx_submit_indirect_count(_id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags); } -extern fn bgfx_submit_indirect_count(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void; +extern fn bgfx_submit_indirect_count(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u32, _depth: u32, _flags: u8) void; /// Set compute index buffer. /// Compute stage. @@ -3683,10 +3687,10 @@ extern fn bgfx_dispatch(_id: ViewId, _program: ProgramHandle, _numX: u32, _numY: /// First element in indirect buffer. /// Number of dispatches. /// Discard or preserve states. See `BGFX_DISCARD_*`. -pub inline fn dispatchIndirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _flags: u8) void { +pub inline fn dispatchIndirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _num: u32, _flags: u8) void { return bgfx_dispatch_indirect(_id, _program, _indirectHandle, _start, _num, _flags); } -extern fn bgfx_dispatch_indirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _flags: u8) void; +extern fn bgfx_dispatch_indirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _num: u32, _flags: u8) void; /// Discard previously set state for draw or compute call. /// Draw/compute states to discard. diff --git a/bgfx/docs/bgfx.rst b/bgfx/docs/bgfx.rst index 911a7fb6..63121e6a 100644 --- a/bgfx/docs/bgfx.rst +++ b/bgfx/docs/bgfx.rst @@ -46,11 +46,11 @@ Reset .. doxygenfunction:: bgfx::reset .. doxygendefine:: BGFX_RESET_NONE -.. doxygendefine:: BGFX_RESET_FULLSCREEN .. doxygendefine:: BGFX_RESET_MSAA_X2 .. doxygendefine:: BGFX_RESET_MSAA_X4 .. doxygendefine:: BGFX_RESET_MSAA_X8 .. doxygendefine:: BGFX_RESET_MSAA_X16 +.. doxygendefine:: BGFX_RESET_FULLSCREEN .. doxygendefine:: BGFX_RESET_VSYNC .. doxygendefine:: BGFX_RESET_MAXANISOTROPY .. doxygendefine:: BGFX_RESET_CAPTURE @@ -60,6 +60,8 @@ Reset .. doxygendefine:: BGFX_RESET_HDR10 .. doxygendefine:: BGFX_RESET_HIDPI .. doxygendefine:: BGFX_RESET_DEPTH_CLAMP +.. doxygendefine:: BGFX_RESET_SUSPEND +.. doxygendefine:: BGFX_RESET_TRANSPARENT_BACKBUFFER Frame ***** @@ -316,7 +318,7 @@ State Flags .. doxygendefine:: BGFX_STATE_BLEND_FACTOR .. doxygendefine:: BGFX_STATE_BLEND_INV_FACTOR -**Blend Equaation** +**Blend Equation** .. doxygendefine:: BGFX_STATE_BLEND_EQUATION_ADD .. doxygendefine:: BGFX_STATE_BLEND_EQUATION_SUB @@ -424,8 +426,8 @@ In Views, all draw commands are executed **after** blit and compute commands. .. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL) .. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL) -.. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL) -.. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex = 0, uint16_t _numMax = UINT16_MAX, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL) +.. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start = 0, uint32_t _num = 1, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL) +.. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex = 0, uint32_t _numMax = UINT32_MAX, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL) Compute @@ -456,7 +458,7 @@ Dispatch In Views, all draw commands are executed **after** blit and compute commands. .. doxygenfunction:: bgfx::dispatch(ViewId _id, ProgramHandle _handle, uint32_t _numX = 1, uint32_t _numY = 1, uint32_t _numZ = 1, uint8_t _flags = BGFX_DISCARD_ALL) -.. doxygenfunction:: bgfx::dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint8_t _flags = BGFX_DISCARD_ALL) +.. doxygenfunction:: bgfx::dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint32_t _start = 0, uint32_t _num = 1, uint8_t _flags = BGFX_DISCARD_ALL) Blit ~~~~ @@ -479,6 +481,10 @@ Resources Shaders and Programs ~~~~~~~~~~~~~~~~~~~~ +.. note:: + + Shaders must be compiled with offline command line too shaderc. + .. doxygenfunction:: bgfx::createShader .. doxygenfunction:: bgfx::getShaderUniforms .. doxygenfunction:: bgfx::destroy(ShaderHandle _handle) @@ -544,6 +550,20 @@ Textures .. doxygenstruct:: bgfx::TextureFormat :members: +**Texture Flags** + +.. doxygendefine:: BGFX_TEXTURE_MSAA_SAMPLE +.. doxygendefine:: BGFX_TEXTURE_RT +.. doxygendefine:: BGFX_TEXTURE_COMPUTE_WRITE +.. doxygendefine:: BGFX_TEXTURE_SRGB +.. doxygendefine:: BGFX_TEXTURE_BLIT_DST +.. doxygendefine:: BGFX_TEXTURE_READ_BACK +.. doxygendefine:: BGFX_TEXTURE_RT_MSAA_X2 +.. doxygendefine:: BGFX_TEXTURE_RT_MSAA_X4 +.. doxygendefine:: BGFX_TEXTURE_RT_MSAA_X8 +.. doxygendefine:: BGFX_TEXTURE_RT_MSAA_X16 +.. doxygendefine:: BGFX_TEXTURE_RT_WRITE_ONLY + .. doxygenfunction:: bgfx::isTextureValid .. doxygenstruct:: bgfx::TextureInfo diff --git a/bgfx/docs/build.rst b/bgfx/docs/build.rst index 3fd670d2..b965aa7d 100644 --- a/bgfx/docs/build.rst +++ b/bgfx/docs/build.rst @@ -1,15 +1,14 @@ Building ======== -Dependencies ------------- +Dependencies & Getting the source +--------------------------------- -https://github.com/bkaradzic/bx + - https://github.com/bkaradzic/bx + - https://github.com/bkaradzic/bimg -https://github.com/bkaradzic/bimg - -Getting Source --------------- +The directories for `bx`, `bimg`, and `bgfx` should all be siblings of each other. +So clone the repositories next to each other: :: @@ -17,8 +16,8 @@ Getting Source git clone https://github.com/bkaradzic/bimg.git git clone https://github.com/bkaradzic/bgfx.git -Quick Start ------------ +Quick Start for Windows +----------------------- These are step for users who use Windows with Visual Studio. @@ -83,20 +82,22 @@ Build ----- bgfx uses `GENie - Project generator tool `__ -to generate project files for various platform. Binaries for Linux, macOS, and Windows are included in -bx repository. +to generate project files for various platforms. Binaries of GENie for Linux, macOS, and Windows are included in +the bx repository. GENie can generate a useful list of options relevant to the project using the +``--help`` flag. Most platform-specific examples below do not explicitly use the ``genie`` executable, but a convenience +makefile instead. For more control, you can directly use ``genie`` to generate the project files. -General -~~~~~~~ +General (Makefile wrapper) +~~~~~~~~~~~~~~~~~~~~~~~~~~ :: cd bgfx make -After calling ``make``, .build/projects/\* directory will be generated. -All intermediate files generated by compiler will be inside .build -directory structure. Deleting .build directory at any time is safe. +After calling ``make``, some directories in ``.build/projects/\*`` will be generated. +All intermediate files, libraries and executables generated by the compiler will be inside this +``.build`` directory structure. Deleting ``.build`` directory at any time is safe. :: @@ -108,6 +109,55 @@ Configuration is ``-[32/64]``. For example: linux-release64, wasm-debug, wasm-release, osx-debug, osx-release, android-arm64-release, etc. + +General (Directly with GENie) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Inspect the available options by invoking GENie with the ``--help`` option (where ```` is ``linux``, ``windows``, or ``darwin``): +:: + + ../bx/tools/bin//genie --help + +Select the options you want, such as: + + - ``--with-tools`` + - ``--with-amalgamated`` (see below) + - ``--with-shared-lib`` + - ``--with-profiler`` (see https://bkaradzic.github.io/bgfx/bgfx.html#_CPPv4N4bgfx9CallbackIE) + - ``--with-examples`` (see https://bkaradzic.github.io/bgfx/examples.html) + - ``--with-sdl`` to use SDL2 for the examples. + - ``--with-glfw`` to use GLFW3 for the examples. + +There are also many platform-specific options. + +.. note:: + If you wish to use the OpenGL backend, specifying a minimum API version is possible through setting + the ``BGFX_CONFIG`` environment variable when running ``genie``. For example: + + :: + + # Unix: + export BGFX_CONFIG=RENDERER_OPENGL_MIN_VERSION=40 + # Windows: + set BGFX_CONFIG=RENDERER_OPENGL_MIN_VERSION=40 + + ../bx/tools/bin//genie <... your options ...> + + The same can be done for OpenGL ES. + +Then generate your project files with the options. +Your project folder is in ``.build/projects/``. +For more help on specific platforms, see below and read the ``makefile`` in the bgfx repository) for examples on how to use GENie. + +For gmake projects, specify compile using: + +:: + + make config= -C .build/projects/-gmake + +Where ```` is something like ``release64``, ``debug64`` (or equivalent 32 bit), and +```` is the platform you chose. + Windows ~~~~~~~ @@ -123,10 +173,12 @@ Visual Studio 2019 IDE: start .build/projects/vs2019/bgfx.sln -Xcode +macOS ~~~~~ -Xcode command line: +There are two options when working on macOS: Xcode command-line builds, or within the XCode graphical development environment. + +For the Xcode command line: :: @@ -134,14 +186,14 @@ Xcode command line: cd examples/runtime ../../.build/osx64_clang/bin/examples.app/Contents/MacOS/examplesRelease -Xcode IDE: +Or for Xcode IDE: :: ../bx/tools/bin/darwin/genie --with-combined-examples --xcode=osx xcode9 open .build/projects/xcode9-osx/bgfx.xcworkspace -Due to `inability `__ +Due to the `inability `__ to set working directory for an Xcode project from `GENie `__ configuration file, it has to be set manually for each example project: @@ -157,6 +209,8 @@ Linux make linux-release64 +For more options, see `General (directly with GENie) <#general-directly-with-genie>`_. + WinRT / UWP ~~~~~~~~~~~ @@ -164,19 +218,21 @@ WinRT / UWP ..\bx\tools\bin\windows\genie --vs=winstore100 vs2019 +For more options, see `General (directly with GENie) <#general-directly-with-genie>`_. Build the resulting solution and deploy to device. .. note:: Shaders will need to be compiled with the appropriate target profile for your platform. + Amalgamated Build ----------------- -For ease of integration to other build system bgfx library can be built -with single .cpp file. It's only necessary to build +For ease of integration with other build systems, the bgfx library can be built +with a single .cpp file. It's only necessary to build `src/amalgamated.cpp `__ (for macOS/iOS/iPadOS/tvOS use `src/amalgamated.mm `__ -instead) inside different build system. +instead) inside a different build system. Tools ----- @@ -199,7 +255,7 @@ Alternative build systems - https://github.com/yuki-koyama/hello-bgfx - https://github.com/ataulien/bgfx-cmake -**fips** is a highlevel build system wrapper written in Python for C/C++ projects. +**fips** is a high-level build system wrapper written in Python for C/C++ projects. https://github.com/floooh/fips#fips **Conan** package diff --git a/bgfx/docs/examples.rst b/bgfx/docs/examples.rst index 036f2087..1af93139 100644 --- a/bgfx/docs/examples.rst +++ b/bgfx/docs/examples.rst @@ -689,7 +689,7 @@ Reference(s): .. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/48-drawindirect/screenshot.png :alt: example-48-drawindirect - + `49-hextile `__ --------------------------------------------------------------------------------------------- diff --git a/bgfx/docs/license.rst b/bgfx/docs/license.rst index 47f48e7b..032a0380 100644 --- a/bgfx/docs/license.rst +++ b/bgfx/docs/license.rst @@ -6,7 +6,7 @@ License :: - Copyright 2010-2023 Branimir Karadzic + Copyright 2010-2024 Branimir Karadzic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/bgfx/docs/overview.rst b/bgfx/docs/overview.rst index 58335373..954ccca3 100644 --- a/bgfx/docs/overview.rst +++ b/bgfx/docs/overview.rst @@ -17,7 +17,6 @@ licensed under permissive BSD-2 clause open source license. Supported rendering backends ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Direct3D 9 - Direct3D 11 - Direct3D 12 - GNM (only for licensed PS4 developers, search DevNet forums for source) @@ -29,15 +28,14 @@ Supported rendering backends - Vulkan - WebGL 1.0 - WebGL 2.0 -- WebGPU/Dawn (experimental) Supported Platforms ~~~~~~~~~~~~~~~~~~~ -- Android (14+, ARM, x86, MIPS) -- iOS/iPadOS/tvOS (iPhone, iPad, AppleTV) -- Linux -- macOS (11+) +- Android (14+) +- iOS/iPadOS/tvOS (16.0+) +- Linux (both X11 and Wayland) +- macOS (13.0+) - PlayStation 4 - RaspberryPi - UWP (Universal Windows, Xbox One) @@ -48,7 +46,7 @@ Supported Compilers ~~~~~~~~~~~~~~~~~~~ - Clang 11 and above -- GCC 8 and above +- GCC 11 and above - VS2019 and above - Apple clang 12 and above @@ -104,60 +102,6 @@ RenderDoc `How do I ...? `__ document `Shader debugging `__ with RenderDoc and MSVC. -IntelGPA -~~~~~~~~ - -Right click **Intel GPA Monitor** tray icon, choose preferences, check -"Auto-detect launched applications" option. Find ``InjectionList.txt`` -in GPA directory and add ``examples-*`` to the list. - -Download: -`IntelGPA `__ - -Other Debuggers and Profilers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. |x| unicode:: U+2713 .. CHECK MARK - -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| Name | OS | DX9 | DX11 | DX12 | Metal | GL | GLES | Vulkan| Source | -+=============+=================+=======+========+======+=======+======+======+=======+========+ -| APITrace | Linux/macOS/Win | |x| | |x| | | | |x| | |x| | | |x| | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| CodeXL | Linux/Win | | | | | |x| | | | | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| Dissector | Win | |x| | | | | | | | |x| | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| IntelGPA | Linux/macOS/Win | |x| | |x| | | | | |x| | | | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| Nsight | Win | |x| | |x| | | | |x| | | | | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| PerfHUD | Win | |x| | |x| | | | | | | | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| PerfStudio | Win | | |x| | |x| | | |x| | |x| | | | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| PIX | Win | | | |x| | | | | | | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| RGP | Win | | | |x| | | | | |x| | | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| RenderDoc | Win/Linux | | |x| | | | |x| | | |x| | |x| | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| vogl | Linux | | | | | |x| | | | |x| | -+-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ - -Download: - -- `APITrace `__ -- `CodeXL `__ -- `Dissector `__ -- `GPU PerfStudio `__ -- `Linux Graphics Debugger `__ -- `Nsight `__ -- `PIX `__ -- `PerfHUD `__ -- `RGP (Radeon GPU Profiler) `__ -- `vogl `__ - SDL, GLFW, etc. --------------- @@ -293,6 +237,8 @@ and `others `__... Repository visualization ~~~~~~~~~~~~~~~~~~~~~~~~ +.. image:: https://api.star-history.com/svg?repos=bkaradzic/bgfx&type=Date + .. raw:: html

diff --git a/bgfx/docs/tools.rst b/bgfx/docs/tools.rst index 3a78c3a0..ea2e0fce 100644 --- a/bgfx/docs/tools.rst +++ b/bgfx/docs/tools.rst @@ -199,9 +199,12 @@ Options: --varyingdef A varying.def.sc's file path. --verbose Be verbose. -(DX9 and DX11 only): +(Vulkan, DirectX and Metal): --debug Debug information. + +(DirectX only): + --disasm Disassemble a compiled shader. -O Set optimization level. Can be 0–3. diff --git a/bgfx/examples/00-helloworld/helloworld.cpp b/bgfx/examples/00-helloworld/helloworld.cpp index 8b989195..948e2316 100644 --- a/bgfx/examples/00-helloworld/helloworld.cpp +++ b/bgfx/examples/00-helloworld/helloworld.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -34,7 +34,7 @@ class ExampleHelloWorld : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/01-cubes/cubes.cpp b/bgfx/examples/01-cubes/cubes.cpp index 4c3da5c5..7de41175 100644 --- a/bgfx/examples/01-cubes/cubes.cpp +++ b/bgfx/examples/01-cubes/cubes.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -120,7 +120,7 @@ static const uint64_t s_ptState[] BGFX_STATE_PT_LINESTRIP, BGFX_STATE_PT_POINTS, }; -BX_STATIC_ASSERT(BX_COUNTOF(s_ptState) == BX_COUNTOF(s_ptNames) ); +static_assert(BX_COUNTOF(s_ptState) == BX_COUNTOF(s_ptNames) ); class ExampleCubes : public entry::AppI { @@ -149,7 +149,7 @@ class ExampleCubes : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/01-cubes/fs_cubes.sc b/bgfx/examples/01-cubes/fs_cubes.sc index 6f31cbe2..49f7962d 100644 --- a/bgfx/examples/01-cubes/fs_cubes.sc +++ b/bgfx/examples/01-cubes/fs_cubes.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/01-cubes/makefile b/bgfx/examples/01-cubes/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/01-cubes/makefile +++ b/bgfx/examples/01-cubes/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/01-cubes/vs_cubes.sc b/bgfx/examples/01-cubes/vs_cubes.sc index a9637c80..70115670 100644 --- a/bgfx/examples/01-cubes/vs_cubes.sc +++ b/bgfx/examples/01-cubes/vs_cubes.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/02-metaballs/fs_metaballs.bin.h b/bgfx/examples/02-metaballs/fs_metaballs.bin.h index cb08cb1b..fe4a9d86 100644 --- a/bgfx/examples/02-metaballs/fs_metaballs.bin.h +++ b/bgfx/examples/02-metaballs/fs_metaballs.bin.h @@ -54,110 +54,76 @@ static const uint8_t fs_metaballs_essl[402] = 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, // r = tmpvar_2;.}. 0x0a, 0x00, // .. }; -static const uint8_t fs_metaballs_spv[1050] = +static const uint8_t fs_metaballs_spv[990] = { - 0x46, 0x53, 0x48, 0x0b, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, // FSH..,.?........ - 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0xae, 0x00, // ....#........... + 0x46, 0x53, 0x48, 0x0b, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x03, // FSH..,.?........ + 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xae, 0x00, // ....#........... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // ................ 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, // ......GLSL.std.4 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // 50.............. - 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma - 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x55, 0x00, // in....N...Q...U. - 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, // ..b............. - 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, // ................ - 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ......main...... - 0x06, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, // ..N...gl_FragCoo - 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, 0x00, 0x76, 0x5f, // rd........Q...v_ - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x55, 0x00, // color0........U. - 0x00, 0x00, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..v_normal...... - 0x06, 0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, // ..b...bgfx_FragD - 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0b, 0x00, // ata0..G...N..... - 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...Q..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...U..... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...b..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, // ..............!. - 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, // ................ - 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, // .. ............. - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x29, 0x00, // ......+.......). - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2d, 0x00, // ......+.......-. - 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2e, 0x00, // ......,......... - 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..)...)...-...+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x41, 0x2b, 0x00, // ......6......A+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x2b, 0x00, // ......:......@+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x2f, 0xba, 0xe8, 0x3e, 0x2b, 0x00, // ......C.../..>+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x20, 0x00, // ......G......? . - 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..M...........;. - 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..M...N.......;. - 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..M...Q....... . - 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..T...........;. - 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..T...U....... . - 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..a...........;. - 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, // ..a...b.......,. - 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3a, 0x00, // ..........:...:. - 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0xad, 0x00, // ..:...,......... - 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x36, 0x00, // ..C...C...C...6. - 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..........=..... - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, // ..R...Q...=..... - 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x08, 0x00, // ..V...U......... - 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x56, 0x00, // ..........E...V. - 0x00, 0x00, 0x94, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x84, 0x00, // ................ - 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00, 0x88, 0x00, // ................ - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. - 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x52, 0x00, // ..O...........R. - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ..R............. - 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x8e, 0x00, // ................ - 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x86, 0x00, // ................ - 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x88, 0x00, // ..P............. - 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ - 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x0c, 0x00, // ................ - 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, // ................ - 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, // ..........Q..... - 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. - 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x93, 0x00, // ..Q............. - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x97, 0x00, // ......P......... - 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. - 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x62, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0xfd, 0x00, // ..>...b......... - 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ..8....... + 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x62, 0x00, // in....Q...U...b. + 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x51, 0x00, // ..main........Q. + 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..v_color0...... + 0x05, 0x00, 0x55, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x00, 0x00, // ..U...v_normal.. + 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // ......b...bgfx_F + 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x51, 0x00, // ragData0..G...Q. + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x55, 0x00, // ..........G...U. + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, // ..........G...b. + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, // ................ + 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, // ..!............. + 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, // ...... ......... + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, // ................ + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..........+..... + 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..).......+..... + 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, // ..-.......,..... + 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2d, 0x00, // ......)...)...-. + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+.......6..... + 0xf0, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0xcd, 0xcc, // .A+.......:..... + 0x0c, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x2f, 0xba, // .@+.......C.../. + 0xe8, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, // .>+.......G..... + 0x80, 0x3f, 0x20, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, // .? ...M......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...M...Q..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // .. ...T......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...T...U..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ...a......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;...a...b..... + 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x3a, 0x00, // ..,...........:. + 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, // ..:...:...,..... + 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x43, 0x00, // ......C...C...C. + 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // ..6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......R...Q...=. + 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, // ......V...U..... + 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, // ..............E. + 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x94, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x86, 0x00, // ..V............. + 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x06, 0x00, // ................ + 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x86, 0x00, // ................ + 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8a, 0x00, // ..6...O......... + 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..R...R......... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8c, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0xac, 0x00, // ................ + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x8c, 0x00, // ................ + 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x90, 0x00, // ......P......... + 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x81, 0x00, // ................ + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x90, 0x00, // ................ + 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x93, 0x00, // ..Q............. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x96, 0x00, // ......Q......... + 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, // ..........P..... + 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x96, 0x00, // ................ + 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x62, 0x00, 0x00, 0x00, 0x97, 0x00, // ..G...>...b..... + 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ......8....... }; -static const uint8_t fs_metaballs_dx9[427] = +static const uint8_t fs_metaballs_dx11[670] = { - 0x46, 0x53, 0x48, 0x0b, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x01, // FSH..,.?........ - 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x14, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ..........CTAB.. - 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..#............. - 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, // ..........ps_3_0 - 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, // .Microsoft (R) H - 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, // LSL Shader Compi - 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x00, 0x00, // ler 10.1..Q..... - 0x0f, 0xa0, 0x00, 0x00, 0xf0, 0x41, 0xcd, 0xcc, 0x0c, 0x40, 0x2f, 0xba, 0xe8, 0x3e, 0x00, 0x00, // .....A...@/..>.. - 0x80, 0x3f, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, 0x90, 0x1f, 0x00, // .?.............. - 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x01, 0x00, 0x07, 0x90, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x01, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0xe4, 0x90, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................ - 0x00, 0x80, 0x01, 0x00, 0xaa, 0x90, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, // ...... ......... - 0x00, 0x81, 0x00, 0x00, 0x00, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x00, 0x00, // ................ - 0x00, 0x90, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x90, 0x0f, 0x00, // ............U... - 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x90, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x0e, 0x80, 0x02, 0x00, 0x90, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, // ........U....... - 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x00, 0x00, // ....U........... - 0xaa, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x00, 0x00, 0xff, 0x80, 0x04, 0x00, // ................ - 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x00, 0x00, 0x00, 0x81, 0x01, 0x00, // ................ - 0x00, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, // ................ - 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, // ........U....... - 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x01, 0x80, 0x00, 0x00, // ................ - 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x0e, 0x00, // ............U... - 0x00, 0x02, 0x00, 0x08, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, // ................ - 0x08, 0x80, 0x00, 0x00, 0xff, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ........... -}; -static const uint8_t fs_metaballs_dx11[666] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x02, // FSH..,.?........ - 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x71, 0x00, 0x85, 0x0b, 0x80, 0xfd, 0x1e, 0xdf, 0x09, 0x21, // ..DXBCq........! - 0xdf, 0xe6, 0x3a, 0xef, 0x53, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x84, 0x02, 0x00, 0x00, 0x03, 0x00, // ..:.S........... + 0x46, 0x53, 0x48, 0x0b, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x02, // FSH..,.?........ + 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xe0, 0x71, 0x1c, 0x84, 0x5e, 0xe7, 0xa2, 0x56, 0xe3, 0xe1, // ..DXBC.q..^..V.. + 0x80, 0x2b, 0xcf, 0x34, 0xbf, 0x25, 0x01, 0x00, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0x03, 0x00, // .+.4.%.......... 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, // GNl...........P. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ @@ -169,38 +135,38 @@ static const uint8_t fs_metaballs_dx11[666] = 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,......... 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. ............. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR - 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xa8, 0x01, 0x00, 0x00, 0x40, 0x00, // GET...SHDR....@. - 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, // ..j...b...r..... - 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, // ..b...r.......e. - 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, // ... ......h..... - 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, // ../...r.......F. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8...r..... - 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xcd, 0xcc, // ..F........@.... - 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, // .@...@...@...... - 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, // ..r.......F..... - 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, // ..............F. - 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x44, 0x00, // ......F.......D. - 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........:..... - 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ..8...........:. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2f, 0x00, // ......*......./. - 0x00, 0x06, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, 0x00, // ..........:...A. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, // ......8......... - 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@.... - 0xf0, 0x41, 0x19, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, // .A.............. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2...r..... - 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x80, 0x41, 0x00, // ..F...........A. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2f, 0x00, // ............../. - 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, // ..r.......F..... - 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ..8...r.......F. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x2f, 0xba, 0xe8, 0x3e, 0x2f, 0xba, // .......@../..>/. - 0xe8, 0x3e, 0x2f, 0xba, 0xe8, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x20, // .>/..>........r - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ......F.......6. - 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ... .......@.... - 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // .?>....... + 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xac, 0x01, 0x00, 0x00, 0x50, 0x00, // GET...SHEX....P. + 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, // ..k...j...b...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, // ......b...r..... + 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e.... ......h. + 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ....../...r..... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, // ..F.......8...r. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ......F........@ + 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, // .....@...@...@.. + 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ......r.......F. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, // ..F.......F..... + 0x00, 0x00, 0x44, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ..D...........:. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x10, 0x10, 0x00, 0x02, 0x00, // ..:.......*..... + 0x00, 0x00, 0x2f, 0x00, 0x00, 0x06, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, // ../...........:. + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, // ..A.......8..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@ + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x41, 0x19, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, // .....A.......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, // ..........2...r. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, // ......F......... + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, // ..A............. + 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ../...r.......F. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8...r..... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x2f, 0xba, // ..F........@../. + 0xe8, 0x3e, 0x2f, 0xba, 0xe8, 0x3e, 0x2f, 0xba, 0xe8, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, // .>/..>/..>...... + 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, // ..r ......F..... + 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ..6.... .......@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // .....?>....... }; -static const uint8_t fs_metaballs_mtl[612] = +static const uint8_t fs_metaballs_mtl[632] = { - 0x46, 0x53, 0x48, 0x0b, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x02, // FSH..,.?......N. + 0x46, 0x53, 0x48, 0x0b, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x02, // FSH..,.?......b. 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, // ..#include .#inclu 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, // de @@ -223,22 +189,23 @@ static const uint8_t fs_metaballs_mtl[612] = 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // age_in]]).{. 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, // xlatMtlMain_out 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // out = {};. fl - 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x31, 0x33, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x74, 0x28, 0x6e, // oat _131 = dot(n - 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x6e, 0x6f, // ormalize(in.v_no - 0x72, 0x6d, 0x61, 0x6c, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, // rmal), float3(0. - 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, // 0, 0.0, -1.0));. - 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, // out.bgfx_Fra - 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, // gData0 = float4( - 0x70, 0x6f, 0x77, 0x28, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, // pow((pow(in.v_co - 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // lor0.xyz, float3 - 0x28, 0x32, 0x2e, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, // (2.2000000476837 - 0x31, 0x35, 0x38, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x31, 0x33, 0x31, 0x29, 0x20, 0x2b, 0x20, // 158)) * _131) + - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x31, 0x33, 0x31, 0x2c, // float3(pow(_131, - 0x20, 0x33, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // 30.0)), float3( - 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x34, 0x36, 0x38, 0x30, 0x39, 0x31, 0x39, 0x36, // 0.45454546809196 - 0x34, 0x37, 0x32, 0x29, 0x29, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 472)), 1.0);. - 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // return out;.}.. - 0x00, 0x00, 0x00, 0x00, // .... + 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x31, 0x33, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x74, 0x28, 0x66, // oat _131 = dot(f + 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x69, // ast::normalize(i + 0x6e, 0x2e, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, // n.v_normal), flo + 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, // at3(0.0, 0.0, -1 + 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, // .0));. out.bg + 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, // fx_FragData0 = f + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x69, // loat4(pow((pow(i + 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, // n.v_color0.xyz, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, 0x2e, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, // float3(2.2000000 + 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, 0x38, 0x32, 0x30, 0x33, 0x31, 0x32, 0x35, 0x29, // 476837158203125) + 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x31, 0x33, 0x31, 0x29, 0x20, 0x2b, 0x20, 0x66, 0x6c, 0x6f, 0x61, // ) * _131) + floa + 0x74, 0x33, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x31, 0x33, 0x31, 0x2c, 0x20, 0x33, 0x30, 0x2e, // t3(pow(_131, 30. + 0x30, 0x29, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x35, // 0)), float3(0.45 + 0x34, 0x35, 0x34, 0x35, 0x34, 0x36, 0x38, 0x30, 0x39, 0x31, 0x39, 0x36, 0x34, 0x37, 0x32, 0x31, // 4545468091964721 + 0x36, 0x37, 0x39, 0x36, 0x38, 0x37, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // 6796875)), 1.0); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, // . return out; + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, // .}...... }; extern const uint8_t* fs_metaballs_pssl; extern const uint32_t fs_metaballs_pssl_size; diff --git a/bgfx/examples/02-metaballs/fs_metaballs.sc b/bgfx/examples/02-metaballs/fs_metaballs.sc index 9f36e301..21955350 100644 --- a/bgfx/examples/02-metaballs/fs_metaballs.sc +++ b/bgfx/examples/02-metaballs/fs_metaballs.sc @@ -1,7 +1,7 @@ $input v_normal, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/02-metaballs/makefile b/bgfx/examples/02-metaballs/makefile index 38377fb8..66264968 100644 --- a/bgfx/examples/02-metaballs/makefile +++ b/bgfx/examples/02-metaballs/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/02-metaballs/metaballs.cpp b/bgfx/examples/02-metaballs/metaballs.cpp index 8c42f221..eb39f8d0 100644 --- a/bgfx/examples/02-metaballs/metaballs.cpp +++ b/bgfx/examples/02-metaballs/metaballs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -508,7 +508,7 @@ class ExampleMetaballs : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/02-metaballs/vs_metaballs.bin.h b/bgfx/examples/02-metaballs/vs_metaballs.bin.h index 661f6de1..2b668d17 100644 --- a/bgfx/examples/02-metaballs/vs_metaballs.bin.h +++ b/bgfx/examples/02-metaballs/vs_metaballs.bin.h @@ -1,9 +1,9 @@ static const uint8_t vs_metaballs_glsl[501] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, // VSH......,.?...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. .. ..... + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj - 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x61, 0x74, // ..............at + 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x61, 0x74, // ..............at 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, // tribute vec4 a_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // olor0;.attribute 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, // vec3 a_normal;. @@ -36,9 +36,9 @@ static const uint8_t vs_metaballs_glsl[501] = static const uint8_t vs_metaballs_essl[549] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, // VSH......,.?...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. .. ..... + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj - 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0x61, 0x74, // ..............at + 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0x61, 0x74, // ..............at 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // tribute highp ve 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, // c4 a_color0;.att 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // ribute highp vec @@ -74,10 +74,10 @@ static const uint8_t vs_metaballs_essl[549] = static const uint8_t vs_metaballs_spv[1608] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x0f, 0x75, // VSH......,.?...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // .........u_model - 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x03, 0x02, // ................ - 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, // #............... + 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x03, 0x02, // ................ + 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, // #............... 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, // ................ 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, // ..GLSL.std.450.. 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................ @@ -175,46 +175,14 @@ static const uint8_t vs_metaballs_spv[1608] = 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x03, // ..~.......8..... 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x40, 0x08, // ......@. }; -static const uint8_t vs_metaballs_dx9[463] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, // VSH......,.?...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ - 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj - 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x00, 0x03, // ................ - 0xfe, 0xff, 0xfe, 0xff, 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, // ....,.CTAB...... - 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, // ................ - 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x03, 0x00, // ..|...D......... - 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x02, 0x00, // ..L............. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......l.......u_ - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x00, // model......... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // ......u_modelVie - 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, // wProj........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // ......vs_3_0.Mic - 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL - 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler - 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, // 10.1............ - 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, // ................ - 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x02, 0x00, 0x07, 0xe0, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x55, 0x90, 0x04, 0x00, // ............U... - 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x90, 0x00, 0x00, // ................ - 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x02, 0x00, // ................ - 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................ - 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x05, 0x00, // ................ - 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x04, 0x00, // ....U........... - 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, // ................ - 0x07, 0xe0, 0x06, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, // ................ - 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ............... -}; -static const uint8_t vs_metaballs_dx11[740] = +static const uint8_t vs_metaballs_dx11[744] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, // VSH......,.?...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj - 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x44, 0x58, // ..............DX - 0x42, 0x43, 0xc6, 0x4d, 0x04, 0x38, 0x93, 0x20, 0x89, 0x1c, 0xbe, 0x68, 0xbc, 0xd4, 0xee, 0x2f, // BC.M.8. ...h.../ - 0x8a, 0xe9, 0x01, 0x00, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, // ..............,. + 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x44, 0x58, // ..............DX + 0x42, 0x43, 0x45, 0x29, 0xfe, 0x4b, 0x41, 0xa2, 0x84, 0xdf, 0x05, 0x09, 0x61, 0x78, 0x4f, 0x77, // BCE).KA.....axOw + 0x96, 0x92, 0x01, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, // ..............,. 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, // ..........ISGNh. 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........P..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, // ................ @@ -230,39 +198,39 @@ static const uint8_t vs_metaballs_dx11[740] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x08, // ................ 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, // ..SV_POSITION.CO 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, // LOR.TEXCOORD..SH - 0x44, 0x52, 0x84, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x61, 0x00, 0x00, 0x00, 0x59, 0x00, // DR....@...a...Y. - 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x5f, 0x00, // ..F. ........._. - 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, // .........._...r. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, // ......_...r..... - 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..g.... ........ - 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, // ..e.... ......e. - 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, // ..r ......h..... - 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, // ..8...........V. - 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, // ......F. ....... - 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ..2...........F. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x02, 0x00, // ............... - 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, // ..F.......2..... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, // ......F. ....... - 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ..........F..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ....... ......F. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, // ......F. ....... - 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, // ..6.... ......F. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8...r..... - 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2...r..... - 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, // ..F. ........... - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. - 0x00, 0x0a, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..r ......F. ... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, // ..............F. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x02, 0x00, // ......>......... - 0x01, 0x00, 0x40, 0x08, // ..@. + 0x45, 0x58, 0x88, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x62, 0x00, 0x00, 0x00, 0x6a, 0x08, // EX....P...b...j. + 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, // ..Y...F. ....... + 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, // .._..........._. + 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, // ..r......._...r. + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......g.... .... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, // ......e.... .... + 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e...r ......h. + 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... + 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ... + 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x06, 0x10, // ..F. ........... + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. + 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ... + 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ........... .... + 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ... + 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, // ......6.... .... + 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, // ..F.......8...r. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, // ......V.......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, // .........2...r. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F. ....... + 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, // ..........F..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x82, // ..2...r ......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, // ............... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, // ..F.......>..... + 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x40, 0x08, // ......@. }; -static const uint8_t vs_metaballs_mtl[913] = +static const uint8_t vs_metaballs_mtl[961] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x0f, 0x75, // VSH......,.?...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // .........u_model - 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x03, 0x00, 0x00, 0x23, 0x69, // ..........I...#i + 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x03, 0x00, 0x00, 0x23, 0x69, // ..........y...#i 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, // nclude .#include < 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, 0x73, // simd/simd.h>..us @@ -273,7 +241,10 @@ static const uint8_t vs_metaballs_mtl[913] = 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, // . float4x4 u_ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, // modelViewProj;.} 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // ;..struct xlatMt - 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // lMain_out.{. + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, // lMain_out.{..flo + 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, // at bgfx_metal_po + 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, // intSize [[point_ + 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // size]] = 1;. 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, // float4 _entryPoi 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ntOutput_v_color 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, // 0 [[user(locn0)] diff --git a/bgfx/examples/02-metaballs/vs_metaballs.sc b/bgfx/examples/02-metaballs/vs_metaballs.sc index 0312e7b7..07a4bb4b 100644 --- a/bgfx/examples/02-metaballs/vs_metaballs.sc +++ b/bgfx/examples/02-metaballs/vs_metaballs.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_color0 $output v_normal, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/03-raymarch/fs_raymarching.sc b/bgfx/examples/03-raymarch/fs_raymarching.sc index 41ba8516..081065b8 100644 --- a/bgfx/examples/03-raymarch/fs_raymarching.sc +++ b/bgfx/examples/03-raymarch/fs_raymarching.sc @@ -1,7 +1,7 @@ $input v_color0, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/03-raymarch/makefile b/bgfx/examples/03-raymarch/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/03-raymarch/makefile +++ b/bgfx/examples/03-raymarch/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/03-raymarch/raymarch.cpp b/bgfx/examples/03-raymarch/raymarch.cpp index ddbd73fe..950c0924 100644 --- a/bgfx/examples/03-raymarch/raymarch.cpp +++ b/bgfx/examples/03-raymarch/raymarch.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -121,7 +121,7 @@ class ExampleRaymarch : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/03-raymarch/vs_raymarching.sc b/bgfx/examples/03-raymarch/vs_raymarching.sc index 94eac94f..dbdf7dc5 100644 --- a/bgfx/examples/03-raymarch/vs_raymarching.sc +++ b/bgfx/examples/03-raymarch/vs_raymarching.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, a_texcoord0 $output v_color0, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/04-mesh/fs_mesh.sc b/bgfx/examples/04-mesh/fs_mesh.sc index 4e344472..31196000 100644 --- a/bgfx/examples/04-mesh/fs_mesh.sc +++ b/bgfx/examples/04-mesh/fs_mesh.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/04-mesh/makefile b/bgfx/examples/04-mesh/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/04-mesh/makefile +++ b/bgfx/examples/04-mesh/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/04-mesh/mesh.cpp b/bgfx/examples/04-mesh/mesh.cpp index 40469bd1..395c6725 100644 --- a/bgfx/examples/04-mesh/mesh.cpp +++ b/bgfx/examples/04-mesh/mesh.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -32,7 +32,7 @@ class ExampleMesh : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/04-mesh/vs_mesh.sc b/bgfx/examples/04-mesh/vs_mesh.sc index 6c8b2cb5..1e9c5dde 100644 --- a/bgfx/examples/04-mesh/vs_mesh.sc +++ b/bgfx/examples/04-mesh/vs_mesh.sc @@ -2,7 +2,7 @@ $input a_position, a_normal $output v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/05-instancing/fs_instancing.sc b/bgfx/examples/05-instancing/fs_instancing.sc index 6f31cbe2..49f7962d 100644 --- a/bgfx/examples/05-instancing/fs_instancing.sc +++ b/bgfx/examples/05-instancing/fs_instancing.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/05-instancing/instancing.cpp b/bgfx/examples/05-instancing/instancing.cpp index 9d5a804b..a36a2dbb 100644 --- a/bgfx/examples/05-instancing/instancing.cpp +++ b/bgfx/examples/05-instancing/instancing.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -84,7 +84,7 @@ class ExampleInstancing : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/05-instancing/makefile b/bgfx/examples/05-instancing/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/05-instancing/makefile +++ b/bgfx/examples/05-instancing/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/05-instancing/vs_instancing.sc b/bgfx/examples/05-instancing/vs_instancing.sc index 5fdf6399..7f8204b7 100644 --- a/bgfx/examples/05-instancing/vs_instancing.sc +++ b/bgfx/examples/05-instancing/vs_instancing.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, i_data0, i_data1, i_data2, i_data3, i_data4 $output v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/06-bump/bump.cpp b/bgfx/examples/06-bump/bump.cpp index 93aeeb38..92306763 100644 --- a/bgfx/examples/06-bump/bump.cpp +++ b/bgfx/examples/06-bump/bump.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -104,7 +104,7 @@ class ExampleBump : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/06-bump/fs_bump.sc b/bgfx/examples/06-bump/fs_bump.sc index b0636e96..12162f1d 100644 --- a/bgfx/examples/06-bump/fs_bump.sc +++ b/bgfx/examples/06-bump/fs_bump.sc @@ -1,7 +1,7 @@ $input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0// in... /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/06-bump/makefile b/bgfx/examples/06-bump/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/06-bump/makefile +++ b/bgfx/examples/06-bump/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/06-bump/vs_bump.sc b/bgfx/examples/06-bump/vs_bump.sc index 292192cb..3650482b 100644 --- a/bgfx/examples/06-bump/vs_bump.sc +++ b/bgfx/examples/06-bump/vs_bump.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_tangent, a_texcoord0 $output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -14,7 +14,7 @@ void main() v_wpos = wpos; gl_Position = mul(u_viewProj, vec4(wpos, 1.0) ); - + vec4 normal = a_normal * 2.0 - 1.0; vec4 tangent = a_tangent * 2.0 - 1.0; diff --git a/bgfx/examples/06-bump/vs_bump_instanced.sc b/bgfx/examples/06-bump/vs_bump_instanced.sc index 0b903b8f..507d0b0f 100644 --- a/bgfx/examples/06-bump/vs_bump_instanced.sc +++ b/bgfx/examples/06-bump/vs_bump_instanced.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_tangent, a_texcoord0, i_data0, i_data1, i_data2, $output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -18,7 +18,7 @@ void main() vec3 wpos = instMul(model, vec4(a_position, 1.0) ).xyz; gl_Position = mul(u_viewProj, vec4(wpos, 1.0) ); - + vec4 normal = a_normal * 2.0 - 1.0; vec3 wnormal = instMul(model, vec4(normal.xyz, 0.0) ).xyz; @@ -33,7 +33,7 @@ void main() v_wpos = wpos; - vec3 weyepos = mul(vec4(0.0, 0.0, 0.0, 1.0), u_view).xyz; + vec3 weyepos = mul(vec4(0.0, 0.0, 0.0, 1.0), u_view).xyz; v_view = instMul(weyepos - wpos, tbn); v_texcoord0 = a_texcoord0; diff --git a/bgfx/examples/07-callback/callback.cpp b/bgfx/examples/07-callback/callback.cpp index 2b7f59c8..bc8e176e 100644 --- a/bgfx/examples/07-callback/callback.cpp +++ b/bgfx/examples/07-callback/callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -331,7 +331,7 @@ class ExampleCallback : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/07-callback/fs_callback.sc b/bgfx/examples/07-callback/fs_callback.sc index 07feb33b..cfeb74f3 100644 --- a/bgfx/examples/07-callback/fs_callback.sc +++ b/bgfx/examples/07-callback/fs_callback.sc @@ -1,7 +1,7 @@ $input v_world, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/07-callback/makefile b/bgfx/examples/07-callback/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/07-callback/makefile +++ b/bgfx/examples/07-callback/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/07-callback/vs_callback.sc b/bgfx/examples/07-callback/vs_callback.sc index cf5a0ed6..aa1f9f42 100644 --- a/bgfx/examples/07-callback/vs_callback.sc +++ b/bgfx/examples/07-callback/vs_callback.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_world, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/08-update/cs_update.sc b/bgfx/examples/08-update/cs_update.sc index 54566d83..aa065c96 100644 --- a/bgfx/examples/08-update/cs_update.sc +++ b/bgfx/examples/08-update/cs_update.sc @@ -5,7 +5,7 @@ #include "bgfx_compute.sh" -IMAGE2D_ARRAY_WR(s_texColor, rgba8, 0); +IMAGE2D_ARRAY_WO(s_texColor, rgba8, 0); uniform vec4 u_time; NUM_THREADS(16, 16, 1) diff --git a/bgfx/examples/08-update/fs_update.sc b/bgfx/examples/08-update/fs_update.sc index 76d5f0e3..ac34fe3b 100644 --- a/bgfx/examples/08-update/fs_update.sc +++ b/bgfx/examples/08-update/fs_update.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/08-update/fs_update_3d.sc b/bgfx/examples/08-update/fs_update_3d.sc index 213d8540..dfa05ff6 100644 --- a/bgfx/examples/08-update/fs_update_3d.sc +++ b/bgfx/examples/08-update/fs_update_3d.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/08-update/fs_update_cmp.sc b/bgfx/examples/08-update/fs_update_cmp.sc index a06f4bed..e43252ab 100644 --- a/bgfx/examples/08-update/fs_update_cmp.sc +++ b/bgfx/examples/08-update/fs_update_cmp.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/08-update/makefile b/bgfx/examples/08-update/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/08-update/makefile +++ b/bgfx/examples/08-update/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/08-update/update.cpp b/bgfx/examples/08-update/update.cpp index d6fe7796..ecf6bba7 100644 --- a/bgfx/examples/08-update/update.cpp +++ b/bgfx/examples/08-update/update.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -77,7 +77,7 @@ static PosTexcoordVertex s_cubeVertices[] = {-1.0f, -1.0f, 1.0f, -2.0f, -2.0f, 2.0f }, { 1.0f, -1.0f, 1.0f, 2.0f, -2.0f, 2.0f }, }; -BX_STATIC_ASSERT(BX_COUNTOF(s_cubeVertices) == 28); +static_assert(BX_COUNTOF(s_cubeVertices) == 28); static const uint16_t s_cubeIndices[] = { @@ -99,7 +99,7 @@ static const uint16_t s_cubeIndices[] = 20, 22, 21, // 10 21, 22, 23, }; -BX_STATIC_ASSERT(BX_COUNTOF(s_cubeIndices) == 36); +static_assert(BX_COUNTOF(s_cubeIndices) == 36); bx::Vec3 s_faceColors[] = { @@ -247,7 +247,7 @@ class ExampleUpdate : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -295,7 +295,7 @@ class ExampleUpdate : public entry::AppI m_textures[22] = loadTextureWithUpdate("textures/texture_compression_atci.dds"); m_textures[23] = loadTextureWithUpdate("textures/texture_compression_atce.dds"); - BX_STATIC_ASSERT(24 == BX_COUNTOF(m_textures)); + static_assert(24 == BX_COUNTOF(m_textures)); const bgfx::Caps* caps = bgfx::getCaps(); m_texture3DSupported = !!(caps->supported & BGFX_CAPS_TEXTURE_3D); @@ -754,7 +754,7 @@ class ExampleUpdate : public entry::AppI "compute", "frameBuffer", }; - BX_STATIC_ASSERT(BX_COUNTOF(descTextureCube) == BX_COUNTOF(m_textureCube)); + static_assert(BX_COUNTOF(descTextureCube) == BX_COUNTOF(m_textureCube)); for (uint32_t ii = 0; ii < BX_COUNTOF(m_textureCube); ++ii) { @@ -847,7 +847,7 @@ class ExampleUpdate : public entry::AppI "update\natci", "update\natce", }; - BX_STATIC_ASSERT(BX_COUNTOF(descTextures) == BX_COUNTOF(m_textures)); + static_assert(BX_COUNTOF(descTextures) == BX_COUNTOF(m_textures)); for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii) { @@ -878,7 +878,7 @@ class ExampleUpdate : public entry::AppI "Tex3D R16F", "Tex3D R32F", }; - BX_STATIC_ASSERT(BX_COUNTOF(descTextures3d) == BX_COUNTOF(m_textures3d)); + static_assert(BX_COUNTOF(descTextures3d) == BX_COUNTOF(m_textures3d)); for (uint32_t ii = 0; ii < m_numTextures3d; ++ii) { diff --git a/bgfx/examples/08-update/vs_update.sc b/bgfx/examples/08-update/vs_update.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/08-update/vs_update.sc +++ b/bgfx/examples/08-update/vs_update.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/common.sh b/bgfx/examples/09-hdr/common.sh index 18c3b6eb..b16135e3 100644 --- a/bgfx/examples/09-hdr/common.sh +++ b/bgfx/examples/09-hdr/common.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/fs_hdr_blur.sc b/bgfx/examples/09-hdr/fs_hdr_blur.sc index 049f8b38..4f17c15a 100644 --- a/bgfx/examples/09-hdr/fs_hdr_blur.sc +++ b/bgfx/examples/09-hdr/fs_hdr_blur.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/fs_hdr_bright.sc b/bgfx/examples/09-hdr/fs_hdr_bright.sc index 246d532c..d91c5dac 100644 --- a/bgfx/examples/09-hdr/fs_hdr_bright.sc +++ b/bgfx/examples/09-hdr/fs_hdr_bright.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/fs_hdr_lum.sc b/bgfx/examples/09-hdr/fs_hdr_lum.sc index 691b2812..aced2169 100644 --- a/bgfx/examples/09-hdr/fs_hdr_lum.sc +++ b/bgfx/examples/09-hdr/fs_hdr_lum.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/fs_hdr_lumavg.sc b/bgfx/examples/09-hdr/fs_hdr_lumavg.sc index fc1e27e9..f5fed2a8 100644 --- a/bgfx/examples/09-hdr/fs_hdr_lumavg.sc +++ b/bgfx/examples/09-hdr/fs_hdr_lumavg.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/fs_hdr_mesh.sc b/bgfx/examples/09-hdr/fs_hdr_mesh.sc index 093d3d3e..ff62a69e 100644 --- a/bgfx/examples/09-hdr/fs_hdr_mesh.sc +++ b/bgfx/examples/09-hdr/fs_hdr_mesh.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/fs_hdr_skybox.sc b/bgfx/examples/09-hdr/fs_hdr_skybox.sc index 2eea2fbd..f4c0a4c0 100644 --- a/bgfx/examples/09-hdr/fs_hdr_skybox.sc +++ b/bgfx/examples/09-hdr/fs_hdr_skybox.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/fs_hdr_tonemap.sc b/bgfx/examples/09-hdr/fs_hdr_tonemap.sc index 97860718..77b5f354 100644 --- a/bgfx/examples/09-hdr/fs_hdr_tonemap.sc +++ b/bgfx/examples/09-hdr/fs_hdr_tonemap.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/hdr.cpp b/bgfx/examples/09-hdr/hdr.cpp index 626f10aa..5d4d1a1c 100644 --- a/bgfx/examples/09-hdr/hdr.cpp +++ b/bgfx/examples/09-hdr/hdr.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -11,8 +11,6 @@ namespace { -static float s_texelHalf = 0.0f; - struct PosColorTexCoord0Vertex { float m_x; @@ -37,7 +35,7 @@ struct PosColorTexCoord0Vertex bgfx::VertexLayout PosColorTexCoord0Vertex::ms_layout; -void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBottomLeft = false, float _width = 1.0f, float _height = 1.0f) +void screenSpaceQuad(bool _originBottomLeft = false, float _width = 1.0f, float _height = 1.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosColorTexCoord0Vertex::ms_layout) ) { @@ -52,13 +50,11 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBott const float miny = 0.0f; const float maxy = _height*2.0f; - const float texelHalfW = s_texelHalf/_textureWidth; - const float texelHalfH = s_texelHalf/_textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfW; + const float minu = -1.0f; + const float maxu = 1.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -107,8 +103,8 @@ void setOffsets2x2Lum(bgfx::UniformHandle _handle, uint32_t _width, uint32_t _he { for (uint32_t xx = 0; xx < 3; ++xx) { - offsets[num][0] = (xx - s_texelHalf) * du; - offsets[num][1] = (yy - s_texelHalf) * dv; + offsets[num][0] = xx * du; + offsets[num][1] = yy * dv; ++num; } } @@ -128,8 +124,8 @@ void setOffsets4x4Lum(bgfx::UniformHandle _handle, uint32_t _width, uint32_t _he { for (uint32_t xx = 0; xx < 4; ++xx) { - offsets[num][0] = (xx - 1.0f - s_texelHalf) * du; - offsets[num][1] = (yy - 1.0f - s_texelHalf) * dv; + offsets[num][0] = (xx - 1.0f) * du; + offsets[num][1] = (yy - 1.0f) * dv; ++num; } } @@ -159,7 +155,7 @@ class ExampleHDR : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -221,7 +217,6 @@ class ExampleHDR : public entry::AppI imguiCreate(); m_caps = bgfx::getCaps(); - s_texelHalf = bgfx::RendererType::Direct3D9 == m_caps->rendererType ? 0.5f : 0.0f; m_oldWidth = 0; m_oldHeight = 0; @@ -367,9 +362,10 @@ class ExampleHDR : public entry::AppI if (bgfx::isValid(m_rb) ) { - union { uint32_t color; uint8_t bgra[4]; } cast = { m_lumBgra8 }; - float exponent = cast.bgra[3]/255.0f * 255.0f - 128.0f; - float lumAvg = cast.bgra[2]/255.0f * bx::exp2(exponent); + struct Packed { uint8_t bgra[4]; } arr = bx::bitCast(m_lumBgra8); + float exponent = arr.bgra[3] / 255.0f * 255.0f - 128.0f; + float lumAvg = arr.bgra[2] / 255.0f * bx::exp2(exponent); + ImGui::SliderFloat("Lum Avg", &lumAvg, 0.0f, 1.0f); } @@ -496,7 +492,7 @@ class ExampleHDR : public entry::AppI bgfx::setTexture(0, s_texCube, m_uffizi); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); bgfx::setUniform(u_mtx, mtx); - screenSpaceQuad( (float)m_width, (float)m_height, true); + screenSpaceQuad(true); bgfx::submit(hdrSkybox, m_skyProgram); // Render m_mesh into view hdrMesh. @@ -508,35 +504,35 @@ class ExampleHDR : public entry::AppI setOffsets2x2Lum(u_offset, 128, 128); bgfx::setTexture(0, s_texColor, m_fbtextures[0]); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(128.0f, 128.0f, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(hdrLuminance, m_lumProgram); // Downscale luminance 0. setOffsets4x4Lum(u_offset, 128, 128); bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_lum[0]) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(64.0f, 64.0f, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(hdrLumScale0, m_lumAvgProgram); // Downscale luminance 1. setOffsets4x4Lum(u_offset, 64, 64); bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_lum[1]) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(16.0f, 16.0f, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(hdrLumScale1, m_lumAvgProgram); // Downscale luminance 2. setOffsets4x4Lum(u_offset, 16, 16); bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_lum[2]) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(4.0f, 4.0f, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(hdrLumScale2, m_lumAvgProgram); // Downscale luminance 3. setOffsets4x4Lum(u_offset, 4, 4); bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_lum[3]) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(1.0f, 1.0f, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(hdrLumScale3, m_lumAvgProgram); // m_bright pass m_threshold is tonemap[3]. @@ -545,14 +541,14 @@ class ExampleHDR : public entry::AppI bgfx::setTexture(1, s_texLum, bgfx::getTexture(m_lum[4]) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); bgfx::setUniform(u_tonemap, tonemap); - screenSpaceQuad( (float)m_width/2.0f, (float)m_height/2.0f, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(hdrBrightness, m_brightProgram); // m_blur m_bright pass vertically. bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_bright) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); bgfx::setUniform(u_tonemap, tonemap); - screenSpaceQuad( (float)m_width/8.0f, (float)m_height/8.0f, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(hdrVBlur, m_blurProgram); // m_blur m_bright pass horizontally, do tonemaping and combine. @@ -560,7 +556,7 @@ class ExampleHDR : public entry::AppI bgfx::setTexture(1, s_texLum, bgfx::getTexture(m_lum[4]) ); bgfx::setTexture(2, s_texBlur, bgfx::getTexture(m_blur) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad( (float)m_width, (float)m_height, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(hdrHBlurTonemap, m_tonemapProgram); if (bgfx::isValid(m_rb) ) diff --git a/bgfx/examples/09-hdr/makefile b/bgfx/examples/09-hdr/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/09-hdr/makefile +++ b/bgfx/examples/09-hdr/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/09-hdr/vs_hdr_blur.sc b/bgfx/examples/09-hdr/vs_hdr_blur.sc index 80bb703d..dfb1a0cf 100644 --- a/bgfx/examples/09-hdr/vs_hdr_blur.sc +++ b/bgfx/examples/09-hdr/vs_hdr_blur.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/vs_hdr_bright.sc b/bgfx/examples/09-hdr/vs_hdr_bright.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/09-hdr/vs_hdr_bright.sc +++ b/bgfx/examples/09-hdr/vs_hdr_bright.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/vs_hdr_lum.sc b/bgfx/examples/09-hdr/vs_hdr_lum.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/09-hdr/vs_hdr_lum.sc +++ b/bgfx/examples/09-hdr/vs_hdr_lum.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/vs_hdr_lumavg.sc b/bgfx/examples/09-hdr/vs_hdr_lumavg.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/09-hdr/vs_hdr_lumavg.sc +++ b/bgfx/examples/09-hdr/vs_hdr_lumavg.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/vs_hdr_mesh.sc b/bgfx/examples/09-hdr/vs_hdr_mesh.sc index 6204caa4..889dbb14 100644 --- a/bgfx/examples/09-hdr/vs_hdr_mesh.sc +++ b/bgfx/examples/09-hdr/vs_hdr_mesh.sc @@ -2,7 +2,7 @@ $input a_position, a_normal $output v_pos, v_view, v_normal /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/vs_hdr_skybox.sc b/bgfx/examples/09-hdr/vs_hdr_skybox.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/09-hdr/vs_hdr_skybox.sc +++ b/bgfx/examples/09-hdr/vs_hdr_skybox.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/09-hdr/vs_hdr_tonemap.sc b/bgfx/examples/09-hdr/vs_hdr_tonemap.sc index 9d50c792..83767127 100644 --- a/bgfx/examples/09-hdr/vs_hdr_tonemap.sc +++ b/bgfx/examples/09-hdr/vs_hdr_tonemap.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/10-font/font.cpp b/bgfx/examples/10-font/font.cpp index 0a886594..dbc70b83 100644 --- a/bgfx/examples/10-font/font.cpp +++ b/bgfx/examples/10-font/font.cpp @@ -73,7 +73,7 @@ class ExampleFont : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -269,21 +269,16 @@ class ExampleFont : public entry::AppI float view[16]; bx::mtxLookAt(view, eye, at); - float centering = 0.0f; - if (bgfx::getRendererType() == bgfx::RendererType::Direct3D9) { - centering = -0.5f; - } - // Setup a top-left ortho matrix for screen space drawing. const bgfx::Caps* caps = bgfx::getCaps(); { float ortho[16]; bx::mtxOrtho( ortho - , centering - , m_width + centering - , m_height + centering - , centering + , 0.0f + , float(m_width) + , float(m_height) + , 0.0f , 0.0f , 100.0f , 0.0f diff --git a/bgfx/examples/11-fontsdf/fontsdf.cpp b/bgfx/examples/11-fontsdf/fontsdf.cpp index 08a2dbf5..d79e3087 100644 --- a/bgfx/examples/11-fontsdf/fontsdf.cpp +++ b/bgfx/examples/11-fontsdf/fontsdf.cpp @@ -56,7 +56,7 @@ class ExampleFontSDF : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -256,16 +256,11 @@ class ExampleFontSDF : public entry::AppI float view[16]; bx::mtxLookAt(view, eye, at); - float centering = 0.0f; - if (bgfx::getRendererType() == bgfx::RendererType::Direct3D9) { - centering = -0.5f; - } - // Setup a top-left ortho matrix for screen space drawing. const bgfx::Caps* caps = bgfx::getCaps(); { float ortho[16]; - bx::mtxOrtho(ortho, centering, m_width + centering, m_height + centering, centering, -1.0f, 1.0f, 0.0f, caps->homogeneousDepth); + bx::mtxOrtho(ortho, 0.0f, float(m_width), float(m_height), 0.0f, -1.0f, 1.0f, 0.0f, caps->homogeneousDepth); bgfx::setViewTransform(0, view, ortho); bgfx::setViewRect(0, 0, 0, uint16_t(m_width), uint16_t(m_height) ); } diff --git a/bgfx/examples/12-lod/fs_tree.sc b/bgfx/examples/12-lod/fs_tree.sc index b9392d2d..d993b073 100644 --- a/bgfx/examples/12-lod/fs_tree.sc +++ b/bgfx/examples/12-lod/fs_tree.sc @@ -39,4 +39,3 @@ void main() color.xyz = toLinear(color.xyz)*l; gl_FragColor = toGamma(color); } - diff --git a/bgfx/examples/12-lod/lod.cpp b/bgfx/examples/12-lod/lod.cpp index b429334a..a3aa6c03 100644 --- a/bgfx/examples/12-lod/lod.cpp +++ b/bgfx/examples/12-lod/lod.cpp @@ -48,7 +48,7 @@ class ExampleLod : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/12-lod/makefile b/bgfx/examples/12-lod/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/12-lod/makefile +++ b/bgfx/examples/12-lod/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/13-stencil/makefile b/bgfx/examples/13-stencil/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/13-stencil/makefile +++ b/bgfx/examples/13-stencil/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/13-stencil/stencil.cpp b/bgfx/examples/13-stencil/stencil.cpp index cfbf0615..d082677a 100644 --- a/bgfx/examples/13-stencil/stencil.cpp +++ b/bgfx/examples/13-stencil/stencil.cpp @@ -814,7 +814,7 @@ class ExampleStencil : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_viewState.m_width; init.resolution.height = m_viewState.m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/13-stencil/vs_stencil_color.sc b/bgfx/examples/13-stencil/vs_stencil_color.sc index 16a73acb..a303feb1 100644 --- a/bgfx/examples/13-stencil/vs_stencil_color.sc +++ b/bgfx/examples/13-stencil/vs_stencil_color.sc @@ -5,7 +5,7 @@ $input a_position * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "../common/common.sh" +#include "../common/common.sh" void main() { diff --git a/bgfx/examples/13-stencil/vs_stencil_color_lighting.sc b/bgfx/examples/13-stencil/vs_stencil_color_lighting.sc index b0653178..6aeef3b6 100644 --- a/bgfx/examples/13-stencil/vs_stencil_color_lighting.sc +++ b/bgfx/examples/13-stencil/vs_stencil_color_lighting.sc @@ -6,7 +6,7 @@ $output v_normal, v_view * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "../common/common.sh" +#include "../common/common.sh" void main() { diff --git a/bgfx/examples/13-stencil/vs_stencil_color_texture.sc b/bgfx/examples/13-stencil/vs_stencil_color_texture.sc index 3b9d1a06..d2585e1a 100644 --- a/bgfx/examples/13-stencil/vs_stencil_color_texture.sc +++ b/bgfx/examples/13-stencil/vs_stencil_color_texture.sc @@ -6,7 +6,7 @@ $output v_texcoord0 * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "../common/common.sh" +#include "../common/common.sh" void main() { diff --git a/bgfx/examples/13-stencil/vs_stencil_texture.sc b/bgfx/examples/13-stencil/vs_stencil_texture.sc index 3b9d1a06..d2585e1a 100644 --- a/bgfx/examples/13-stencil/vs_stencil_texture.sc +++ b/bgfx/examples/13-stencil/vs_stencil_texture.sc @@ -6,7 +6,7 @@ $output v_texcoord0 * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "../common/common.sh" +#include "../common/common.sh" void main() { diff --git a/bgfx/examples/13-stencil/vs_stencil_texture_lighting.sc b/bgfx/examples/13-stencil/vs_stencil_texture_lighting.sc index 34aa4e1f..acb1ede1 100644 --- a/bgfx/examples/13-stencil/vs_stencil_texture_lighting.sc +++ b/bgfx/examples/13-stencil/vs_stencil_texture_lighting.sc @@ -6,7 +6,7 @@ $output v_normal, v_view, v_texcoord0 * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "../common/common.sh" +#include "../common/common.sh" void main() { diff --git a/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontcolor.sc b/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontcolor.sc index b26ca27f..25042bd6 100644 --- a/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontcolor.sc +++ b/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontcolor.sc @@ -5,7 +5,7 @@ #include "../common/common.sh" uniform vec4 u_color; - + void main() { gl_FragColor.xyz = u_color.xyz; diff --git a/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex2.sc b/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex2.sc index d6b436c2..4a10bcce 100644 --- a/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex2.sc +++ b/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex2.sc @@ -11,7 +11,7 @@ vec4 stencilColor(float _k) , float(abs(_k + 1.0) < 0.0001)/255.0 , float(abs(_k - 2.0) < 0.0001)/255.0 , float(abs(_k + 2.0) < 0.0001)/255.0 - ); + ); } void main() diff --git a/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lighting.sc b/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lighting.sc index 1800d2ff..dd6ddde5 100644 --- a/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lighting.sc +++ b/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lighting.sc @@ -86,4 +86,3 @@ void main() gl_FragColor.xyz = mix(u_fogColor, final, fogFactor); gl_FragColor.w = 1.0; } - diff --git a/bgfx/examples/14-shadowvolumes/makefile b/bgfx/examples/14-shadowvolumes/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/14-shadowvolumes/makefile +++ b/bgfx/examples/14-shadowvolumes/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp b/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp index 48828eba..4ccea3a9 100644 --- a/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp +++ b/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp @@ -89,7 +89,6 @@ static const uint16_t s_planeIndices[] = }; static bool s_oglNdc = false; -static float s_texelHalf = 0.0f; static uint32_t s_viewMask = 0; @@ -1786,7 +1785,7 @@ class ExampleShadowVolumes : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_viewState.m_width; init.resolution.height = m_viewState.m_height; init.resolution.reset = m_reset; @@ -1797,7 +1796,6 @@ class ExampleShadowVolumes : public entry::AppI const bgfx::Caps* caps = bgfx::getCaps(); s_oglNdc = caps->homogeneousDepth; - s_texelHalf = bgfx::RendererType::Direct3D9 == caps->rendererType ? 0.5f : 0.0f; // Imgui imguiCreate(); @@ -2187,7 +2185,7 @@ class ExampleShadowVolumes : public entry::AppI //update settings s_uniforms.m_params.m_ambientPass = 1.0f; s_uniforms.m_params.m_lightingPass = 1.0f; - s_uniforms.m_params.m_texelHalf = s_texelHalf; + s_uniforms.m_params.m_texelHalf = 0.0f; s_uniforms.m_svparams.m_useStencilTex = float(m_useStencilTexture); //set picked bunny model diff --git a/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_texture.sc b/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_texture.sc index 8c738935..951e5177 100644 --- a/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_texture.sc +++ b/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_texture.sc @@ -6,7 +6,7 @@ $output v_texcoord0 * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "../common/common.sh" +#include "../common/common.sh" void main() { @@ -14,4 +14,3 @@ void main() v_texcoord0 = a_texcoord0; } - diff --git a/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture.sc b/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture.sc index 6f2477d4..951e5177 100644 --- a/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture.sc +++ b/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture.sc @@ -6,7 +6,7 @@ $output v_texcoord0 * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "../common/common.sh" +#include "../common/common.sh" void main() { diff --git a/bgfx/examples/15-shadowmaps-simple/makefile b/bgfx/examples/15-shadowmaps-simple/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/15-shadowmaps-simple/makefile +++ b/bgfx/examples/15-shadowmaps-simple/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp index bfd4a75a..c1e44430 100644 --- a/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp +++ b/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp @@ -80,7 +80,7 @@ class ExampleShadowmapsSimple : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_csm.sc b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_csm.sc index c80fa204..4510c748 100644 --- a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_csm.sc +++ b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_csm.sc @@ -14,4 +14,3 @@ void main() { #include "fs_shadowmaps_color_lighting_main.sh" } - diff --git a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_csm.sc b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_csm.sc index 5e7fa74c..f088190c 100644 --- a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_csm.sc +++ b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_csm.sc @@ -15,4 +15,3 @@ void main() { #include "fs_shadowmaps_color_lighting_main.sh" } - diff --git a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_csm.sc b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_csm.sc index 97e0b480..778afabd 100644 --- a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_csm.sc +++ b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_csm.sc @@ -14,4 +14,3 @@ void main() { #include "fs_shadowmaps_color_lighting_main.sh" } - diff --git a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_csm.sc b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_csm.sc index 4b58b0ce..e28c1763 100644 --- a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_csm.sc +++ b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_csm.sc @@ -14,4 +14,3 @@ void main() { #include "fs_shadowmaps_color_lighting_main.sh" } - diff --git a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_csm.sc b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_csm.sc index 85448d13..bab57701 100644 --- a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_csm.sc +++ b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_csm.sc @@ -14,4 +14,3 @@ void main() { #include "fs_shadowmaps_color_lighting_main.sh" } - diff --git a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_omni.sc b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_omni.sc index e9b38f2d..80cec94c 100644 --- a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_omni.sc +++ b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_omni.sc @@ -14,4 +14,3 @@ void main() { #include "fs_shadowmaps_color_lighting_main.sh" } - diff --git a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_csm.sc b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_csm.sc index 3e98273a..4c7a2e69 100644 --- a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_csm.sc +++ b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_csm.sc @@ -14,4 +14,3 @@ void main() { #include "fs_shadowmaps_color_lighting_main.sh" } - diff --git a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_omni.sc b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_omni.sc index 15eff7b8..e8c9767d 100644 --- a/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_omni.sc +++ b/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_omni.sc @@ -14,4 +14,3 @@ void main() { #include "fs_shadowmaps_color_lighting_main.sh" } - diff --git a/bgfx/examples/16-shadowmaps/makefile b/bgfx/examples/16-shadowmaps/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/16-shadowmaps/makefile +++ b/bgfx/examples/16-shadowmaps/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/16-shadowmaps/shadowmaps.cpp b/bgfx/examples/16-shadowmaps/shadowmaps.cpp index e85f6dfa..f648a624 100644 --- a/bgfx/examples/16-shadowmaps/shadowmaps.cpp +++ b/bgfx/examples/16-shadowmaps/shadowmaps.cpp @@ -177,8 +177,7 @@ static const uint16_t s_planeIndices[] = 1, 3, 2, }; -static bool s_flipV = false; -static float s_texelHalf = 0.0f; +static bool s_originBottomLeft = false; static bgfx::UniformHandle s_texColor; static bgfx::UniformHandle s_shadowMap[ShadowMapRenderTargets::Count]; @@ -858,7 +857,7 @@ struct PosColorTexCoord0Vertex bgfx::VertexLayout PosColorTexCoord0Vertex::ms_layout; -void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBottomLeft = true, float _width = 1.0f, float _height = 1.0f) +void screenSpaceQuad(bool _originBottomLeft = true, float _width = 1.0f, float _height = 1.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosColorTexCoord0Vertex::ms_layout) ) { @@ -873,13 +872,11 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBott const float miny = 0.0f; const float maxy = _height*2.0f; - const float texelHalfW = s_texelHalf/_textureWidth; - const float texelHalfH = s_texelHalf/_textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfW; + const float minu = -1.0f; + const float maxu = 1.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -1159,7 +1156,7 @@ class ExampleShadowmaps : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_viewState.m_width; init.resolution.height = m_viewState.m_height; init.resolution.reset = m_reset; @@ -1168,22 +1165,7 @@ class ExampleShadowmaps : public entry::AppI // Enable debug text. bgfx::setDebug(m_debug); - // Setup root path for binary shaders. Shader binaries are different - // for each renderer. - switch (bgfx::getRendererType() ) - { - case bgfx::RendererType::Direct3D9: - s_texelHalf = 0.5f; - break; - - case bgfx::RendererType::OpenGL: - case bgfx::RendererType::OpenGLES: - s_flipV = true; - break; - - default: - break; - } + s_originBottomLeft = bgfx::getCaps()->originBottomLeft; // Imgui. imguiCreate(); @@ -2784,12 +2766,12 @@ class ExampleShadowmaps : public entry::AppI { bgfx::setTexture(4, s_shadowMap[0], bgfx::getTexture(s_rtShadowMap[0]) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV); + screenSpaceQuad(s_originBottomLeft); bgfx::submit(RENDERVIEW_VBLUR_0_ID, s_programs.m_vBlur[depthType]); bgfx::setTexture(4, s_shadowMap[0], bgfx::getTexture(s_rtBlur) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV); + screenSpaceQuad(s_originBottomLeft); bgfx::submit(RENDERVIEW_HBLUR_0_ID, s_programs.m_hBlur[depthType]); if (LightType::DirectionalLight == m_settings.m_lightType) @@ -2800,12 +2782,12 @@ class ExampleShadowmaps : public entry::AppI bgfx::setTexture(4, s_shadowMap[0], bgfx::getTexture(s_rtShadowMap[ii]) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV); + screenSpaceQuad(s_originBottomLeft); bgfx::submit(viewId, s_programs.m_vBlur[depthType]); bgfx::setTexture(4, s_shadowMap[0], bgfx::getTexture(s_rtBlur) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV); + screenSpaceQuad(s_originBottomLeft); bgfx::submit(viewId+1, s_programs.m_hBlur[depthType]); } } @@ -2816,7 +2798,7 @@ class ExampleShadowmaps : public entry::AppI // Setup shadow mtx. float mtxShadow[16]; - const float ymul = (s_flipV) ? 0.5f : -0.5f; + const float ymul = (s_originBottomLeft) ? 0.5f : -0.5f; float zadd = (DepthImpl::Linear == m_settings.m_depthImpl) ? 0.0f : 0.5f; const float mtxBias[16] = @@ -2835,7 +2817,7 @@ class ExampleShadowmaps : public entry::AppI } else if (LightType::PointLight == m_settings.m_lightType) { - const float s = (s_flipV) ? 1.0f : -1.0f; //sign + const float s = (s_originBottomLeft) ? 1.0f : -1.0f; //sign zadd = (DepthImpl::Linear == m_settings.m_depthImpl) ? 0.0f : 0.5f; const float mtxCropBias[2][TetrahedronFaces::Count][16] = @@ -2912,7 +2894,7 @@ class ExampleShadowmaps : public entry::AppI for (uint8_t ii = 0; ii < TetrahedronFaces::Count; ++ii) { ProjType::Enum projType = (m_settings.m_stencilPack) ? ProjType::Enum(ii>1) : ProjType::Horizontal; - uint8_t biasIndex = cropBiasIndices[m_settings.m_stencilPack][uint8_t(s_flipV)][ii]; + uint8_t biasIndex = cropBiasIndices[m_settings.m_stencilPack][uint8_t(s_originBottomLeft)][ii]; float mtxTmp[16]; bx::mtxMul(mtxTmp, mtxYpr[ii], lightProj[projType]); @@ -3040,7 +3022,7 @@ class ExampleShadowmaps : public entry::AppI { bgfx::setTexture(4, s_shadowMap[0], bgfx::getTexture(s_rtShadowMap[0]) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV); + screenSpaceQuad(s_originBottomLeft); bgfx::submit(RENDERVIEW_DRAWDEPTH_0_ID, s_programs.m_drawDepth[depthType]); if (LightType::DirectionalLight == m_settings.m_lightType) @@ -3049,7 +3031,7 @@ class ExampleShadowmaps : public entry::AppI { bgfx::setTexture(4, s_shadowMap[0], bgfx::getTexture(s_rtShadowMap[ii]) ); bgfx::setState(BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A); - screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV); + screenSpaceQuad(s_originBottomLeft); bgfx::submit(RENDERVIEW_DRAWDEPTH_0_ID+ii, s_programs.m_drawDepth[depthType]); } } diff --git a/bgfx/examples/16-shadowmaps/vs_shadowmaps_hblur.sc b/bgfx/examples/16-shadowmaps/vs_shadowmaps_hblur.sc index 0af78acd..e1472183 100644 --- a/bgfx/examples/16-shadowmaps/vs_shadowmaps_hblur.sc +++ b/bgfx/examples/16-shadowmaps/vs_shadowmaps_hblur.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/17-drawstress/drawstress.cpp b/bgfx/examples/17-drawstress/drawstress.cpp index c76cf9d2..b08851fd 100644 --- a/bgfx/examples/17-drawstress/drawstress.cpp +++ b/bgfx/examples/17-drawstress/drawstress.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -131,7 +131,7 @@ class ExampleDrawStress : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/17-drawstress/fs_drawstress.bin.h b/bgfx/examples/17-drawstress/fs_drawstress.bin.h index c62c615e..5b637b0f 100644 --- a/bgfx/examples/17-drawstress/fs_drawstress.bin.h +++ b/bgfx/examples/17-drawstress/fs_drawstress.bin.h @@ -16,56 +16,40 @@ static const uint8_t fs_drawstress_essl[93] = 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, // gl_FragColor = v 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _color0;.}... }; -static const uint8_t fs_drawstress_spv[466] = +static const uint8_t fs_drawstress_spv[406] = { - 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x01, // FSH....I........ - 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x31, 0x00, // ....#.........1. + 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, // FSH....I........ + 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x31, 0x00, // ....#.........1. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // ................ 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, // ......GLSL.std.4 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // 50.............. - 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma - 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x30, 0x00, // in...."...%...0. - 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x22, 0x00, // ..main........". - 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, // ..gl_FragCoord.. - 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x25, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ......%...v_colo - 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x30, 0x00, 0x00, 0x00, 0x62, 0x67, // r0........0...bg - 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, // fx_FragData0..G. - 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, // .."...........G. - 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..%...........G. - 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, // ..0............. - 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... - 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, // .......... ..... - 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..!...........;. - 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..!...".......;. - 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..!...%....... . - 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ../...........;. - 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, // ../...0.......6. - 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, // ..........=..... - 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x30, 0x00, // ..&...%...>...0. - 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..&.......8..... - 0x00, 0x00, // .. -}; -static const uint8_t fs_drawstress_dx9[135] = -{ - 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, // FSH....I......t. - 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x14, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ..........CTAB.. - 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..#............. - 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, // ..........ps_3_0 - 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, // .Microsoft (R) H - 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, // LSL Shader Compi - 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ler 10.1........ - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, // ................ - 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ....... + 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, // in....%...0..... + 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x25, 0x00, 0x00, 0x00, 0x76, 0x5f, // in........%...v_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x30, 0x00, // color0........0. + 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, // ..bgfx_FragData0 + 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...%......... + 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...0......... + 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, // ..........!..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // .. ...!......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...!...%..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, // .. .../......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;.../...0..... + 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // ..6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......&...%...>. + 0x03, 0x00, 0x30, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..0...&.......8. + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... }; -static const uint8_t fs_drawstress_dx11[266] = +static const uint8_t fs_drawstress_dx11[270] = { - 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, // FSH....I........ - 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xa6, 0x7f, 0x08, 0xe2, 0x95, 0xbd, 0x5f, 0xa3, 0x3f, 0x5b, // ..DXBC......_.?[ - 0x58, 0x8e, 0x54, 0x0f, 0x89, 0x67, 0x01, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x03, 0x00, // X.T..g.......... + 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, // FSH....I........ + 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x50, 0xef, 0x6d, 0x1a, 0x00, 0x93, 0x06, 0x9c, 0xf0, 0x68, // ..DXBCP.m......h + 0xce, 0x7c, 0xb9, 0x39, 0x12, 0x62, 0x01, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x03, 0x00, // .|.9.b.......... 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNL...........8. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ @@ -75,11 +59,11 @@ static const uint8_t fs_drawstress_dx11[266] = 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,......... 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. ............. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR - 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x38, 0x00, 0x00, 0x00, 0x40, 0x00, // GET...SHDR8...@. - 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, // ......b......... - 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..e.... ......6. - 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, // ... ......F..... - 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ..>....... + 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x3c, 0x00, 0x00, 0x00, 0x50, 0x00, // GET...SHEX<...P. + 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, // ......j...b..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......e.... .... + 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, // ..6.... ......F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ......>....... }; static const uint8_t fs_drawstress_mtl[386] = { diff --git a/bgfx/examples/17-drawstress/fs_drawstress.sc b/bgfx/examples/17-drawstress/fs_drawstress.sc index 6f31cbe2..49f7962d 100644 --- a/bgfx/examples/17-drawstress/fs_drawstress.sc +++ b/bgfx/examples/17-drawstress/fs_drawstress.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/17-drawstress/makefile b/bgfx/examples/17-drawstress/makefile index 38377fb8..66264968 100644 --- a/bgfx/examples/17-drawstress/makefile +++ b/bgfx/examples/17-drawstress/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/17-drawstress/vs_drawstress.bin.h b/bgfx/examples/17-drawstress/vs_drawstress.bin.h index c97f9616..722c5eae 100644 --- a/bgfx/examples/17-drawstress/vs_drawstress.bin.h +++ b/bgfx/examples/17-drawstress/vs_drawstress.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_drawstress_glsl[303] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec3 a_position;. @@ -24,7 +24,7 @@ static const uint8_t vs_drawstress_essl[333] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........ ...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........ ...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // bute highp vec3 @@ -47,9 +47,9 @@ static const uint8_t vs_drawstress_essl[333] = static const uint8_t vs_drawstress_spv[1060] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........_....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........_....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, // ................ @@ -114,37 +114,13 @@ static const uint8_t vs_drawstress_spv[1060] = 0x30, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x02, 0x05, 0x00, // 0.......8....... 0x01, 0x00, 0x40, 0x00, // ..@. }; -static const uint8_t vs_drawstress_dx9[321] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ................ - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ................ - 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ......U......... - 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, // ................ - 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................ - 0x00, // . -}; -static const uint8_t vs_drawstress_dx11[520] = +static const uint8_t vs_drawstress_dx11[524] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0x32, 0x9b, 0xdd, 0xb5, 0xa9, 0xb7, 0x22, 0xf0, 0xcf, 0x5e, 0x34, 0x2c, 0x72, 0xf0, 0x87, 0x00, // 2....."..^4,r... - 0x01, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC + 0x19, 0x40, 0x51, 0x48, 0x64, 0xf0, 0x4f, 0x1e, 0x9e, 0x94, 0x2e, 0xc7, 0x38, 0x04, 0x0f, 0xf4, // .@QHd.O.....8... + 0x01, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... 0x7c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x48, 0x00, 0x00, 0x00, // |.......ISGNH... 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........8....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -155,30 +131,30 @@ static const uint8_t vs_drawstress_dx11[520] = 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // D............... 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT - 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, // ION.COLOR...SHDR - 0xfc, 0x00, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...?...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // ........_...r... - 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... - 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... - 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, // h.......8....... - 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....V.......F. . - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // ........2....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....F. ......... - 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // F............ .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. . - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>... - 0x00, 0x02, 0x05, 0x00, 0x01, 0x00, 0x40, 0x00, // ......@. + 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, // ION.COLOR...SHEX + 0x00, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...@...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, // r.......g.... .. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... .. + 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....h.......8... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........V....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // F. .........2... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ....F........... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // F. .........6... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x05, 0x00, 0x01, 0x00, 0x40, 0x00, // >.........@. }; -static const uint8_t vs_drawstress_mtl[685] = +static const uint8_t vs_drawstress_mtl[733] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........y...#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa9, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -188,6 +164,9 @@ static const uint8_t vs_drawstress_mtl[685] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/17-drawstress/vs_drawstress.sc b/bgfx/examples/17-drawstress/vs_drawstress.sc index a9637c80..70115670 100644 --- a/bgfx/examples/17-drawstress/vs_drawstress.sc +++ b/bgfx/examples/17-drawstress/vs_drawstress.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/18-ibl/ibl.cpp b/bgfx/examples/18-ibl/ibl.cpp index fc3286b4..972e29de 100644 --- a/bgfx/examples/18-ibl/ibl.cpp +++ b/bgfx/examples/18-ibl/ibl.cpp @@ -420,7 +420,7 @@ class ExampleIbl : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/18-ibl/makefile b/bgfx/examples/18-ibl/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/18-ibl/makefile +++ b/bgfx/examples/18-ibl/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/19-oit/fs_oit.sc b/bgfx/examples/19-oit/fs_oit.sc index e3cc677e..19b6e6c3 100644 --- a/bgfx/examples/19-oit/fs_oit.sc +++ b/bgfx/examples/19-oit/fs_oit.sc @@ -1,7 +1,7 @@ $input v_pos /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/19-oit/fs_oit_wb.sc b/bgfx/examples/19-oit/fs_oit_wb.sc index f8d77f4d..1b89b1fc 100644 --- a/bgfx/examples/19-oit/fs_oit_wb.sc +++ b/bgfx/examples/19-oit/fs_oit_wb.sc @@ -1,7 +1,7 @@ $input v_pos /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/19-oit/fs_oit_wb_blit.sc b/bgfx/examples/19-oit/fs_oit_wb_blit.sc index b4bcf515..d5051c6e 100644 --- a/bgfx/examples/19-oit/fs_oit_wb_blit.sc +++ b/bgfx/examples/19-oit/fs_oit_wb_blit.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/19-oit/fs_oit_wb_separate.sc b/bgfx/examples/19-oit/fs_oit_wb_separate.sc index 2a6a9364..ec9cd9b6 100644 --- a/bgfx/examples/19-oit/fs_oit_wb_separate.sc +++ b/bgfx/examples/19-oit/fs_oit_wb_separate.sc @@ -1,7 +1,7 @@ $input v_pos /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/19-oit/fs_oit_wb_separate_blit.sc b/bgfx/examples/19-oit/fs_oit_wb_separate_blit.sc index cfff5f7d..da7e30b7 100644 --- a/bgfx/examples/19-oit/fs_oit_wb_separate_blit.sc +++ b/bgfx/examples/19-oit/fs_oit_wb_separate_blit.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/19-oit/makefile b/bgfx/examples/19-oit/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/19-oit/makefile +++ b/bgfx/examples/19-oit/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/19-oit/oit.cpp b/bgfx/examples/19-oit/oit.cpp index fa846b52..acedee1c 100644 --- a/bgfx/examples/19-oit/oit.cpp +++ b/bgfx/examples/19-oit/oit.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -171,7 +171,7 @@ class ExampleOIT : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/19-oit/vs_oit.sc b/bgfx/examples/19-oit/vs_oit.sc index f2296d52..c7851213 100644 --- a/bgfx/examples/19-oit/vs_oit.sc +++ b/bgfx/examples/19-oit/vs_oit.sc @@ -2,7 +2,7 @@ $input a_position $output v_pos /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/19-oit/vs_oit_blit.sc b/bgfx/examples/19-oit/vs_oit_blit.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/19-oit/vs_oit_blit.sc +++ b/bgfx/examples/19-oit/vs_oit_blit.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/20-nanovg/blendish.h b/bgfx/examples/20-nanovg/blendish.h index 8322c459..a1c1d2d3 100644 --- a/bgfx/examples/20-nanovg/blendish.h +++ b/bgfx/examples/20-nanovg/blendish.h @@ -40,8 +40,8 @@ Revision 6 (2014-09-21) Summary ------- -Blendish is a small collection of drawing functions for NanoVG, designed to -replicate the look of the Blender 2.5+ User Interface. You can use these +Blendish is a small collection of drawing functions for NanoVG, designed to +replicate the look of the Blender 2.5+ User Interface. You can use these functions to theme your UI library. Several metric constants for faithful reproduction are also included. @@ -50,7 +50,7 @@ icons is unclear, they are not included in Blendishes repository, but a SVG template, "icons_template.svg" is provided, which you can use to build your own icon sheet. -To use icons, you must first load the icon sheet using one of the +To use icons, you must first load the icon sheet using one of the nvgCreateImage*() functions and then pass the image handle to bndSetIconImage(); otherwise, no icons will be drawn. See bndSetIconImage() for more information. @@ -81,7 +81,7 @@ before including blendish.h, otherwise the file will be in header-only mode. #define BND_EXPORT #endif -// if that typedef is provided elsewhere, you may define +// if that typedef is provided elsewhere, you may define // BLENDISH_NO_NVG_TYPEDEFS before including the header. #ifndef BLENDISH_NO_NVG_TYPEDEFS typedef struct NVGcontext NVGcontext; @@ -119,14 +119,14 @@ typedef struct BNDnodeTheme { NVGcolor wiresColor; // color of text label when active NVGcolor textSelectedColor; - + // inner color of active node (and dragged wire) NVGcolor activeNodeColor; // color of selected wire NVGcolor wireSelectColor; // color of background of node NVGcolor nodeBackdropColor; - + // how much a noodle curves (0 to 10) int noodleCurving; } BNDnodeTheme; @@ -192,7 +192,7 @@ typedef enum BNDcornerFlags { BND_CORNER_DOWN_RIGHT = 4, // sharp bottom left corner BND_CORNER_DOWN_LEFT = 8, - // all corners are sharp; + // all corners are sharp; // you can invert a set of flags using ^= BND_CORNER_ALL BND_CORNER_ALL = 0xF, // top border is sharp @@ -757,7 +757,7 @@ BND_EXPORT void bndSetTheme(BNDtheme theme); BND_EXPORT const BNDtheme *bndGetTheme(); // designates an image handle as returned by nvgCreateImage*() as the themes' -// icon sheet. The icon sheet format must be compatible to Blender 2.6's icon +// icon sheet. The icon sheet format must be compatible to Blender 2.6's icon // sheet; the order of icons does not matter. // A valid icon sheet is e.g. shown at // http://wiki.blender.org/index.php/Dev:2.5/Doc/How_to/Add_an_icon @@ -789,7 +789,7 @@ BND_EXPORT void bndLabel(NVGcontext *ctx, // if label is not NULL, a label will be added to the widget // widget looks best when height is BND_WIDGET_HEIGHT BND_EXPORT void bndToolButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, + float x, float y, float w, float h, int flags, BNDwidgetState state, int iconid, const char *label); // Draw a radio button with its lower left origin at (x,y) and size of (w,h), @@ -799,9 +799,9 @@ BND_EXPORT void bndToolButton(NVGcontext *ctx, // if label is not NULL, a label will be added to the widget // widget looks best when height is BND_WIDGET_HEIGHT BND_EXPORT void bndRadioButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, + float x, float y, float w, float h, int flags, BNDwidgetState state, int iconid, const char *label); - + // Calculate the corresponding text position for given coordinates px/py // in a text field. @@ -819,18 +819,18 @@ BND_EXPORT int bndTextFieldTextPosition(NVGcontext *ctx, float x, float y, float // if cend < cbegin, then no caret will be drawn // widget looks best when height is BND_WIDGET_HEIGHT BND_EXPORT void bndTextField(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, + float x, float y, float w, float h, int flags, BNDwidgetState state, int iconid, const char *text, int cbegin, int cend); - + // Draw an option button with its lower left origin at (x,y) and size of (w,h), // where flags is one or multiple flags from BNDcornerFlags and state denotes // the widgets current UI state. // if label is not NULL, a label will be added to the widget // widget looks best when height is BND_WIDGET_HEIGHT BND_EXPORT void bndOptionButton(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, + float x, float y, float w, float h, BNDwidgetState state, const char *label); - + // Draw a choice button with its lower left origin at (x,y) and size of (w,h), // where flags is one or multiple flags from BNDcornerFlags and state denotes // the widgets current UI state. @@ -838,9 +838,9 @@ BND_EXPORT void bndOptionButton(NVGcontext *ctx, // if label is not NULL, a label will be added to the widget // widget looks best when height is BND_WIDGET_HEIGHT BND_EXPORT void bndChoiceButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, + float x, float y, float w, float h, int flags, BNDwidgetState state, int iconid, const char *label); - + // Draw a color button with its lower left origin at (x,y) and size of (w,h), // where flags is one or multiple flags from BNDcornerFlags and state denotes // the widgets current UI state. @@ -856,8 +856,8 @@ BND_EXPORT void bndColorButton(NVGcontext *ctx, // a ":" separator // widget looks best when height is BND_WIDGET_HEIGHT BND_EXPORT void bndNumberField(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - const char *label, const char *value); + float x, float y, float w, float h, int flags, BNDwidgetState state, + const char *label, const char *value); // Draw slider control with its lower left origin at (x,y) and size of (w,h), // where flags is one or multiple flags from BNDcornerFlags and state denotes @@ -868,7 +868,7 @@ BND_EXPORT void bndNumberField(NVGcontext *ctx, // a ":" separator // widget looks best when height is BND_WIDGET_HEIGHT BND_EXPORT void bndSlider(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, + float x, float y, float w, float h, int flags, BNDwidgetState state, float progress, const char *label, const char *value); // Draw scrollbar with its lower left origin at (x,y) and size of (w,h), @@ -878,9 +878,9 @@ BND_EXPORT void bndSlider(NVGcontext *ctx, // horizontal widget looks best when height is BND_SCROLLBAR_HEIGHT, // vertical looks best when width is BND_SCROLLBAR_WIDTH BND_EXPORT void bndScrollBar(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, + float x, float y, float w, float h, BNDwidgetState state, float offset, float size); - + // Draw a menu background with its lower left origin at (x,y) and size of (w,h), // where flags is one or multiple flags from BNDcornerFlags. BND_EXPORT void bndMenuBackground(NVGcontext *ctx, @@ -899,7 +899,7 @@ BND_EXPORT void bndMenuLabel(NVGcontext *ctx, // if label is not NULL, a label will be added to the widget // widget looks best when height is BND_WIDGET_HEIGHT BND_EXPORT void bndMenuItem(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, + float x, float y, float w, float h, BNDwidgetState state, int iconid, const char *label); // Draw a tooltip background with its lower left origin at (x,y) and size of (w,h) @@ -909,7 +909,7 @@ BND_EXPORT void bndTooltipBackground(NVGcontext *ctx, float x, float y, float w, BND_EXPORT void bndNodePort(NVGcontext *ctx, float x, float y, BNDwidgetState state, NVGcolor color); -// Draw a node wire originating at (x0,y0) and floating to (x1,y1), with +// Draw a node wire originating at (x0,y0) and floating to (x1,y1), with // a colored gradient based on the states state0 and state1: // BND_DEFAULT: default wire color // BND_HOVER: selected wire color @@ -927,19 +927,19 @@ BND_EXPORT void bndColoredNodeWire(NVGcontext *ctx, float x0, float y0, float x1 BND_EXPORT void bndNodeBackground(NVGcontext *ctx, float x, float y, float w, float h, BNDwidgetState state, int iconid, const char *label, NVGcolor titleColor); -// Draw a window with the upper right and lower left splitter widgets into +// Draw a window with the upper right and lower left splitter widgets into // the rectangle at origin (x,y) and size (w, h) BND_EXPORT void bndSplitterWidgets(NVGcontext *ctx, float x, float y, float w, float h); // Draw the join area overlay stencil into the rectangle // at origin (x,y) and size (w,h) -// vertical is 0 or 1 and designates the arrow orientation, +// vertical is 0 or 1 and designates the arrow orientation, // mirror is 0 or 1 and flips the arrow side BND_EXPORT void bndJoinAreaOverlay(NVGcontext *ctx, float x, float y, float w, float h, int vertical, int mirror); //////////////////////////////////////////////////////////////////////////////// - + // Estimator Functions // ------------------- // Use these functions to estimate sizes for widgets with your NVGcontext. @@ -971,12 +971,12 @@ BND_EXPORT NVGcolor bndOffsetColor(NVGcolor color, int delta); BND_EXPORT void bndSelectCorners(float *radiuses, float r, int flags); // computes the upper and lower gradient colors for the inner box from a widget -// theme and the widgets state. If flipActive is set and the state is +// theme and the widgets state. If flipActive is set and the state is // BND_ACTIVE, the upper and lower colors will be swapped. BND_EXPORT void bndInnerColors(NVGcolor *shade_top, NVGcolor *shade_down, const BNDwidgetTheme *theme, BNDwidgetState state, int flipActive); -// computes the text color for a widget label from a widget theme and the +// computes the text color for a widget label from a widget theme and the // widgets state. BND_EXPORT NVGcolor bndTextColor(const BNDwidgetTheme *theme, BNDwidgetState state); @@ -987,7 +987,7 @@ BND_EXPORT NVGcolor bndTextColor(const BNDwidgetTheme *theme, BNDwidgetState sta BND_EXPORT void bndScrollHandleRect(float *x, float *y, float *w, float *h, float offset, float size); -// Add a rounded box path at position (x,y) with size (w,h) and a separate +// Add a rounded box path at position (x,y) with size (w,h) and a separate // radius for each corner listed in clockwise order, so that cr0 = top left, // cr1 = top right, cr2 = bottom right, cr3 = bottom left; // this is a low level drawing function: the path must be stroked or filled @@ -1009,7 +1009,7 @@ BND_EXPORT void bndBevel(NVGcontext *ctx, float x, float y, float w, float h); // corners of the rounded box. BND_EXPORT void bndBevelInset(NVGcontext *ctx, float x, float y, float w, float h, float cr2, float cr3); - + // Draw an icon with (x,y) as its upper left coordinate; the iconid selects // the icon from the sheet; use the BND_ICONID macro to build icon IDs. BND_EXPORT void bndIcon(NVGcontext *ctx, float x, float y, int iconid); @@ -1020,7 +1020,7 @@ BND_EXPORT void bndIcon(NVGcontext *ctx, float x, float y, int iconid); BND_EXPORT void bndDropShadow(NVGcontext *ctx, float x, float y, float w, float h, float r, float feather, float alpha); -// Draw the inner part of a widget box, with a gradient from shade_top to +// Draw the inner part of a widget box, with a gradient from shade_top to // shade_down. If h>w, the gradient will be horizontal instead of // vertical. BND_EXPORT void bndInnerBox(NVGcontext *ctx, float x, float y, float w, float h, @@ -1040,7 +1040,7 @@ BND_EXPORT void bndOutlineBox(NVGcontext *ctx, float x, float y, float w, float // if value is not NULL, label and value will be drawn with a ":" separator // inbetween. BND_EXPORT void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, int align, float fontsize, const char *label, + int iconid, NVGcolor color, int align, float fontsize, const char *label, const char *value); // Draw an optional icon specified by and an optional label with @@ -1049,7 +1049,7 @@ BND_EXPORT void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, fl // if label is not NULL, it will be drawn with the specified alignment, fontsize // and color. BND_EXPORT void bndNodeIconLabel(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, NVGcolor shadowColor, int align, + int iconid, NVGcolor color, NVGcolor shadowColor, int align, float fontsize, const char *label); // Calculate the corresponding text position for given coordinates px/py @@ -1057,8 +1057,8 @@ BND_EXPORT void bndNodeIconLabel(NVGcontext *ctx, float x, float y, float w, flo // See bndIconLabelCaret for more info. BND_EXPORT int bndIconLabelTextPosition(NVGcontext *ctx, float x, float y, float w, float h, int iconid, float fontsize, const char *label, int px, int py); - -// Draw an optional icon specified by , an optional label and + +// Draw an optional icon specified by , an optional label and // a caret with given fontsize and color within a widget box. // if iconid is >= 0, an icon will be drawn and the labels remaining space // will be adjusted. @@ -1068,9 +1068,9 @@ BND_EXPORT int bndIconLabelTextPosition(NVGcontext *ctx, float x, float y, float // cend must be >= cbegin and <= strlen(text) and denotes the end of the caret // if cend < cbegin, then no caret will be drawn BND_EXPORT void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, float fontsize, const char *label, + int iconid, NVGcolor color, float fontsize, const char *label, NVGcolor caretcolor, int cbegin, int cend); - + // Draw a checkmark for an option box with the given upper left coordinates // (ox,oy) with the specified color. BND_EXPORT void bndCheck(NVGcontext *ctx, float ox, float oy, NVGcolor color); @@ -1086,7 +1086,7 @@ BND_EXPORT void bndUpDownArrow(NVGcontext *ctx, float x, float y, float s, NVGco BND_EXPORT void bndNodeArrowDown(NVGcontext *ctx, float x, float y, float s, NVGcolor color); // return the color of a node wire based on state -// BND_HOVER indicates selected state, +// BND_HOVER indicates selected state, // BND_ACTIVE indicates dragged state BND_EXPORT NVGcolor bndNodeWireColor(const BNDnodeTheme *theme, BNDwidgetState state); @@ -1258,10 +1258,10 @@ static BNDtheme bnd_theme = { {{{ 0.6,0.6,0.6,1 }}}, // color_inner {{{ 0.392,0.392,0.392,1 }}}, // color_inner_selected BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected + BND_COLOR_TEXT_SELECTED, // color_text_selected 0, // shade_top 0, // shade_down - }, + }, // toolTheme { {{{ 0.098,0.098,0.098,1 }}}, // color_outline @@ -1269,7 +1269,7 @@ static BNDtheme bnd_theme = { {{{ 0.6,0.6,0.6,1 }}}, // color_inner {{{ 0.392,0.392,0.392,1 }}}, // color_inner_selected BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected + BND_COLOR_TEXT_SELECTED, // color_text_selected 15, // shade_top -15, // shade_down }, @@ -1280,7 +1280,7 @@ static BNDtheme bnd_theme = { {{{ 0.275,0.275,0.275,1 }}}, // color_inner {{{ 0.337,0.502,0.761,1 }}}, // color_inner_selected BND_COLOR_TEXT_SELECTED, // color_text - BND_COLOR_TEXT, // color_text_selected + BND_COLOR_TEXT, // color_text_selected 15, // shade_top -15, // shade_down }, @@ -1291,7 +1291,7 @@ static BNDtheme bnd_theme = { {{{ 0.6, 0.6, 0.6,1 }}}, // color_inner {{{ 0.6, 0.6, 0.6,1 }}}, // color_inner_selected BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected + BND_COLOR_TEXT_SELECTED, // color_text_selected 0, // shade_top 25, // shade_down }, @@ -1302,7 +1302,7 @@ static BNDtheme bnd_theme = { {{{ 0.275,0.275,0.275,1 }}}, // color_inner {{{ 0.275,0.275,0.275,1 }}}, // color_inner_selected BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected + BND_COLOR_TEXT_SELECTED, // color_text_selected 15, // shade_top -15, // shade_down }, @@ -1313,7 +1313,7 @@ static BNDtheme bnd_theme = { {{{ 0.275,0.275,0.275,1 }}}, // color_inner {{{ 0.275,0.275,0.275,1 }}}, // color_inner_selected BND_COLOR_TEXT_SELECTED, // color_text - {{{ 0.8,0.8,0.8,1 }}}, // color_text_selected + {{{ 0.8,0.8,0.8,1 }}}, // color_text_selected 15, // shade_top -15, // shade_down }, @@ -1324,7 +1324,7 @@ static BNDtheme bnd_theme = { {{{ 0.706, 0.706, 0.706,1 }}}, // color_inner {{{ 0.6, 0.6, 0.6,1 }}}, // color_inner_selected BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected + BND_COLOR_TEXT_SELECTED, // color_text_selected -20, // shade_top 0, // shade_down }, @@ -1335,7 +1335,7 @@ static BNDtheme bnd_theme = { {{{ 0.706, 0.706, 0.706,1 }}}, // color_inner {{{ 0.6, 0.6, 0.6,1 }}}, // color_inner_selected BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected + BND_COLOR_TEXT_SELECTED, // color_text_selected -20, // shade_top 0, // shade_down }, @@ -1346,7 +1346,7 @@ static BNDtheme bnd_theme = { {{{ 0.314, 0.314, 0.314,0.706 }}}, // color_inner {{{ 0.392, 0.392, 0.392,0.706 }}}, // color_inner_selected BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected + BND_COLOR_TEXT_SELECTED, // color_text_selected 5, // shade_top -5, // shade_down }, @@ -1357,7 +1357,7 @@ static BNDtheme bnd_theme = { {{{ 0.098, 0.098, 0.098, 0.902 }}}, // color_inner {{{ 0.176, 0.176, 0.176, 0.902 }}}, // color_inner_selected {{{ 0.627, 0.627, 0.627, 1 }}}, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected + BND_COLOR_TEXT_SELECTED, // color_text_selected 0, // shade_top 0, // shade_down }, @@ -1368,7 +1368,7 @@ static BNDtheme bnd_theme = { {{{ 0.098, 0.098, 0.098, 0.902 }}}, // color_inner {{{ 0.176, 0.176, 0.176, 0.902 }}}, // color_inner_selected {{{ 0.627, 0.627, 0.627, 1 }}}, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected + BND_COLOR_TEXT_SELECTED, // color_text_selected 0, // shade_top 0, // shade_down }, @@ -1379,7 +1379,7 @@ static BNDtheme bnd_theme = { {{{ 0,0,0,0 }}}, // color_inner {{{ 0.337,0.502,0.761,1 }}}, // color_inner_selected BND_COLOR_TEXT_SELECTED, // color_text - BND_COLOR_TEXT, // color_text_selected + BND_COLOR_TEXT, // color_text_selected 38, // shade_top 0, // shade_down }, @@ -1421,21 +1421,21 @@ void bndSetFont(int font) { //////////////////////////////////////////////////////////////////////////////// -void bndLabel(NVGcontext *ctx, +void bndLabel(NVGcontext *ctx, float x, float y, float w, float h, int iconid, const char *label) { bndIconLabelValue(ctx,x,y,w,h,iconid, bnd_theme.regularTheme.textColor, BND_LEFT, BND_LABEL_FONT_SIZE, label, NULL); } -void bndToolButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, +void bndToolButton(NVGcontext *ctx, + float x, float y, float w, float h, int flags, BNDwidgetState state, int iconid, const char *label) { float cr[4]; NVGcolor shade_top, shade_down; - + bndSelectCorners(cr, BND_TOOL_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); + bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); bndInnerColors(&shade_top, &shade_down, &bnd_theme.toolTheme, state, 1); bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], @@ -1445,14 +1445,14 @@ void bndToolButton(NVGcontext *ctx, BND_LABEL_FONT_SIZE, label, NULL); } -void bndRadioButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, +void bndRadioButton(NVGcontext *ctx, + float x, float y, float w, float h, int flags, BNDwidgetState state, int iconid, const char *label) { float cr[4]; NVGcolor shade_top, shade_down; - + bndSelectCorners(cr, BND_OPTION_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); + bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); bndInnerColors(&shade_top, &shade_down, &bnd_theme.radioTheme, state, 1); bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], @@ -1468,14 +1468,14 @@ int bndTextFieldTextPosition(NVGcontext *ctx, float x, float y, float w, float h iconid, BND_LABEL_FONT_SIZE, text, px, py); } -void bndTextField(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, +void bndTextField(NVGcontext *ctx, + float x, float y, float w, float h, int flags, BNDwidgetState state, int iconid, const char *text, int cbegin, int cend) { float cr[4]; NVGcolor shade_top, shade_down; - + bndSelectCorners(cr, BND_TEXT_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); + bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); bndInnerColors(&shade_top, &shade_down, &bnd_theme.textFieldTheme, state, 0); bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], @@ -1484,19 +1484,19 @@ void bndTextField(NVGcontext *ctx, cend = -1; } bndIconLabelCaret(ctx,x,y,w,h,iconid, - bndTextColor(&bnd_theme.textFieldTheme, state), BND_LABEL_FONT_SIZE, + bndTextColor(&bnd_theme.textFieldTheme, state), BND_LABEL_FONT_SIZE, text, bnd_theme.textFieldTheme.itemColor, cbegin, cend); } -void bndOptionButton(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, +void bndOptionButton(NVGcontext *ctx, + float x, float y, float w, float h, BNDwidgetState state, const char *label) { float ox, oy; NVGcolor shade_top, shade_down; - + ox = x; oy = y+h-BND_OPTION_HEIGHT-3; - + bndBevelInset(ctx,ox,oy, BND_OPTION_WIDTH,BND_OPTION_HEIGHT, BND_OPTION_RADIUS,BND_OPTION_RADIUS); @@ -1517,14 +1517,14 @@ void bndOptionButton(NVGcontext *ctx, BND_LABEL_FONT_SIZE, label, NULL); } -void bndChoiceButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, +void bndChoiceButton(NVGcontext *ctx, + float x, float y, float w, float h, int flags, BNDwidgetState state, int iconid, const char *label) { float cr[4]; NVGcolor shade_top, shade_down; - + bndSelectCorners(cr, BND_OPTION_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); + bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); bndInnerColors(&shade_top, &shade_down, &bnd_theme.choiceTheme, state, 1); bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], @@ -1546,14 +1546,14 @@ void bndColorButton(NVGcontext *ctx, bndTransparent(bnd_theme.toolTheme.outlineColor)); } -void bndNumberField(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, +void bndNumberField(NVGcontext *ctx, + float x, float y, float w, float h, int flags, BNDwidgetState state, const char *label, const char *value) { float cr[4]; NVGcolor shade_top, shade_down; - + bndSelectCorners(cr, BND_NUMBER_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); + bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); bndInnerColors(&shade_top, &shade_down, &bnd_theme.numberFieldTheme, state, 0); bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], @@ -1567,12 +1567,12 @@ void bndNumberField(NVGcontext *ctx, bndTransparent(bnd_theme.numberFieldTheme.itemColor)); } -void bndSlider(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, +void bndSlider(NVGcontext *ctx, + float x, float y, float w, float h, int flags, BNDwidgetState state, float progress, const char *label, const char *value) { float cr[4]; NVGcolor shade_top, shade_down; - + bndSelectCorners(cr, BND_NUMBER_RADIUS, flags); bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); bndInnerColors(&shade_top, &shade_down, &bnd_theme.sliderTheme, state, 0); @@ -1588,11 +1588,11 @@ void bndSlider(NVGcontext *ctx, bnd_theme.sliderTheme.itemColor, bnd_theme.sliderTheme.shadeDown); shade_down = bndOffsetColor( bnd_theme.sliderTheme.itemColor, bnd_theme.sliderTheme.shadeTop); - } + } nvgScissor(ctx,x,y,8+(w-8)*bnd_clamp(progress,0,1),h); bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); nvgResetScissor(ctx); - + bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], bndTransparent(bnd_theme.sliderTheme.outlineColor)); bndIconLabelValue(ctx,x,y,w,h,-1, @@ -1600,10 +1600,10 @@ void bndSlider(NVGcontext *ctx, BND_LABEL_FONT_SIZE, label, value); } -void bndScrollBar(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, +void bndScrollBar(NVGcontext *ctx, + float x, float y, float w, float h, BNDwidgetState state, float offset, float size) { - + bndBevelInset(ctx,x,y,w,h, BND_SCROLLBAR_RADIUS, BND_SCROLLBAR_RADIUS); bndInnerBox(ctx,x,y,w,h, @@ -1617,18 +1617,18 @@ void bndScrollBar(NVGcontext *ctx, BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, bndTransparent(bnd_theme.scrollBarTheme.outlineColor)); - + NVGcolor itemColor = bndOffsetColor( bnd_theme.scrollBarTheme.itemColor, (state == BND_ACTIVE)?BND_SCROLLBAR_ACTIVE_SHADE:0); bndScrollHandleRect(&x,&y,&w,&h,offset,size); - + bndInnerBox(ctx,x,y,w,h, BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, bndOffsetColor( - itemColor, 3*bnd_theme.scrollBarTheme.shadeTop), + itemColor, 3*bnd_theme.scrollBarTheme.shadeTop), bndOffsetColor( itemColor, 3*bnd_theme.scrollBarTheme.shadeDown)); bndOutlineBox(ctx,x,y,w,h, @@ -1637,11 +1637,11 @@ void bndScrollBar(NVGcontext *ctx, bndTransparent(bnd_theme.scrollBarTheme.outlineColor)); } -void bndMenuBackground(NVGcontext *ctx, +void bndMenuBackground(NVGcontext *ctx, float x, float y, float w, float h, int flags) { float cr[4]; NVGcolor shade_top, shade_down; - + bndSelectCorners(cr, BND_MENU_RADIUS, flags); bndInnerColors(&shade_top, &shade_down, &bnd_theme.menuTheme, BND_DEFAULT, 0); @@ -1654,7 +1654,7 @@ void bndMenuBackground(NVGcontext *ctx, void bndTooltipBackground(NVGcontext *ctx, float x, float y, float w, float h) { NVGcolor shade_top, shade_down; - + bndInnerColors(&shade_top, &shade_down, &bnd_theme.tooltipTheme, BND_DEFAULT, 0); bndInnerBox(ctx,x,y,w,h+1, @@ -1667,21 +1667,21 @@ void bndTooltipBackground(NVGcontext *ctx, float x, float y, float w, float h) { BND_SHADOW_FEATHER,BND_SHADOW_ALPHA); } -void bndMenuLabel(NVGcontext *ctx, +void bndMenuLabel(NVGcontext *ctx, float x, float y, float w, float h, int iconid, const char *label) { bndIconLabelValue(ctx,x,y,w,h,iconid, bnd_theme.menuTheme.textColor, BND_LEFT, BND_LABEL_FONT_SIZE, label, NULL); } -void bndMenuItem(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, +void bndMenuItem(NVGcontext *ctx, + float x, float y, float w, float h, BNDwidgetState state, int iconid, const char *label) { if (state != BND_DEFAULT) { - bndInnerBox(ctx,x,y,w,h,0,0,0,0, - bndOffsetColor(bnd_theme.menuItemTheme.innerSelectedColor, - bnd_theme.menuItemTheme.shadeTop), - bndOffsetColor(bnd_theme.menuItemTheme.innerSelectedColor, + bndInnerBox(ctx,x,y,w,h,0,0,0,0, + bndOffsetColor(bnd_theme.menuItemTheme.innerSelectedColor, + bnd_theme.menuItemTheme.shadeTop), + bndOffsetColor(bnd_theme.menuItemTheme.innerSelectedColor, bnd_theme.menuItemTheme.shadeDown)); state = BND_ACTIVE; } @@ -1706,10 +1706,10 @@ void bndColoredNodeWire(NVGcontext *ctx, float x0, float y0, float x1, float y1, NVGcolor color0, NVGcolor color1) { float length = bnd_fmaxf(fabsf(x1 - x0),fabsf(y1 - y0)); float delta = length*(float)bnd_theme.nodeTheme.noodleCurving/10.0f; - + nvgBeginPath(ctx); nvgMoveTo(ctx, x0, y0); - nvgBezierTo(ctx, + nvgBezierTo(ctx, x0 + delta, y0, x1 - delta, y1, x1, y1); @@ -1718,8 +1718,8 @@ void bndColoredNodeWire(NVGcontext *ctx, float x0, float y0, float x1, float y1, nvgStrokeColor(ctx, colorw); nvgStrokeWidth(ctx, BND_NODE_WIRE_OUTLINE_WIDTH); nvgStroke(ctx); - nvgStrokePaint(ctx, nvgLinearGradient(ctx, - x0, y0, x1, y1, + nvgStrokePaint(ctx, nvgLinearGradient(ctx, + x0, y0, x1, y1, color0, color1)); nvgStrokeWidth(ctx,BND_NODE_WIRE_WIDTH); @@ -1737,17 +1737,17 @@ void bndNodeBackground(NVGcontext *ctx, float x, float y, float w, float h, BNDwidgetState state, int iconid, const char *label, NVGcolor titleColor) { bndInnerBox(ctx,x,y,w,BND_NODE_TITLE_HEIGHT+2, BND_NODE_RADIUS,BND_NODE_RADIUS,0,0, - bndTransparent(bndOffsetColor(titleColor, BND_BEVEL_SHADE)), + bndTransparent(bndOffsetColor(titleColor, BND_BEVEL_SHADE)), bndTransparent(titleColor)); bndInnerBox(ctx,x,y+float(BND_NODE_TITLE_HEIGHT-1),w,h+2-float(BND_NODE_TITLE_HEIGHT), 0,0,BND_NODE_RADIUS,BND_NODE_RADIUS, - bndTransparent(bnd_theme.nodeTheme.nodeBackdropColor), + bndTransparent(bnd_theme.nodeTheme.nodeBackdropColor), bndTransparent(bnd_theme.nodeTheme.nodeBackdropColor)); bndNodeIconLabel(ctx, x+float(BND_NODE_ARROW_AREA_WIDTH),y, w-float(BND_NODE_ARROW_AREA_WIDTH)-float(BND_NODE_MARGIN_SIDE),BND_NODE_TITLE_HEIGHT, - iconid, bnd_theme.regularTheme.textColor, - bndOffsetColor(titleColor, BND_BEVEL_SHADE), + iconid, bnd_theme.regularTheme.textColor, + bndOffsetColor(titleColor, BND_BEVEL_SHADE), BND_LEFT, BND_LABEL_FONT_SIZE, label); NVGcolor arrowColor; NVGcolor borderColor; @@ -1770,8 +1770,8 @@ void bndNodeBackground(NVGcontext *ctx, float x, float y, float w, float h, BND_NODE_RADIUS,BND_NODE_RADIUS,BND_NODE_RADIUS,BND_NODE_RADIUS, bndTransparent(borderColor)); /* - bndNodeArrowDown(ctx, - x + BND_NODE_MARGIN_SIDE, y + BND_NODE_TITLE_HEIGHT-4, + bndNodeArrowDown(ctx, + x + BND_NODE_MARGIN_SIDE, y + BND_NODE_TITLE_HEIGHT-4, BND_NODE_ARROW_SIZE, arrowColor); */ bndDropShadow(ctx,x,y,w,h,BND_NODE_RADIUS, @@ -1784,7 +1784,7 @@ void bndSplitterWidgets(NVGcontext *ctx, float x, float y, float w, float h) { NVGcolor insetDark = bndTransparent( bndOffsetColor(bnd_theme.backgroundColor, -BND_SPLITTER_SHADE)); NVGcolor inset = bndTransparent(bnd_theme.backgroundColor); - + float x2 = x+w; float y2 = y+h; @@ -1795,14 +1795,14 @@ void bndSplitterWidgets(NVGcontext *ctx, float x, float y, float w, float h) { nvgLineTo(ctx, x+9, y2); nvgMoveTo(ctx, x, y2-5); nvgLineTo(ctx, x+5, y2); - + nvgMoveTo(ctx, x2-11, y); nvgLineTo(ctx, x2, y+11); nvgMoveTo(ctx, x2-7, y); nvgLineTo(ctx, x2, y+7); nvgMoveTo(ctx, x2-3, y); nvgLineTo(ctx, x2, y+3); - + nvgStrokeColor(ctx, insetDark); nvgStroke(ctx); @@ -1813,17 +1813,17 @@ void bndSplitterWidgets(NVGcontext *ctx, float x, float y, float w, float h) { nvgLineTo(ctx, x+7, y2); nvgMoveTo(ctx, x, y2-3); nvgLineTo(ctx, x+3, y2); - + nvgMoveTo(ctx, x2-13, y); nvgLineTo(ctx, x2, y+13); nvgMoveTo(ctx, x2-9, y); nvgLineTo(ctx, x2, y+9); nvgMoveTo(ctx, x2-5, y); nvgLineTo(ctx, x2, y+5); - + nvgStrokeColor(ctx, insetLight); nvgStroke(ctx); - + nvgBeginPath(ctx); nvgMoveTo(ctx, x, y2-12); nvgLineTo(ctx, x+12, y2); @@ -1831,28 +1831,28 @@ void bndSplitterWidgets(NVGcontext *ctx, float x, float y, float w, float h) { nvgLineTo(ctx, x+8, y2); nvgMoveTo(ctx, x, y2-4); nvgLineTo(ctx, x+4, y2); - + nvgMoveTo(ctx, x2-12, y); nvgLineTo(ctx, x2, y+12); nvgMoveTo(ctx, x2-8, y); nvgLineTo(ctx, x2, y+8); nvgMoveTo(ctx, x2-4, y); nvgLineTo(ctx, x2, y+4); - + nvgStrokeColor(ctx, inset); nvgStroke(ctx); } void bndJoinAreaOverlay(NVGcontext *ctx, float x, float y, float w, float h, int vertical, int mirror) { - + if (vertical) { float u = w; w = h; h = u; } - + float s = (w>8) & 0xff; u = BND_ICON_SHEET_OFFSET_X + ix*BND_ICON_SHEET_GRID; v = BND_ICON_SHEET_OFFSET_Y + iy*BND_ICON_SHEET_GRID; - + nvgBeginPath(ctx); nvgRect(ctx,x,y,BND_ICON_SHEET_RES,BND_ICON_SHEET_RES); nvgFillPaint(ctx, @@ -2045,11 +2045,11 @@ void bndIcon(NVGcontext *ctx, float x, float y, int iconid) { void bndDropShadow(NVGcontext *ctx, float x, float y, float w, float h, float r, float feather, float alpha) { - + nvgBeginPath(ctx); y += feather; h -= feather; - + nvgMoveTo(ctx, x-feather, y-feather); nvgLineTo(ctx, x, y-feather); nvgLineTo(ctx, x, y+h-feather); @@ -2060,18 +2060,18 @@ void bndDropShadow(NVGcontext *ctx, float x, float y, float w, float h, nvgLineTo(ctx, x+w+feather, y+h+feather); nvgLineTo(ctx, x-feather, y+h+feather); nvgClosePath(ctx); - + nvgFillPaint(ctx, nvgBoxGradient(ctx, x - feather*0.5f,y - feather*0.5f, w + feather,h+feather, r+feather*0.5f, feather, - nvgRGBAf(0,0,0,alpha*alpha), + nvgRGBAf(0,0,0,alpha*alpha), nvgRGBAf(0,0,0,0))); nvgFill(ctx); } -void bndInnerBox(NVGcontext *ctx, float x, float y, float w, float h, +void bndInnerBox(NVGcontext *ctx, float x, float y, float w, float h, float cr0, float cr1, float cr2, float cr3, NVGcolor shade_top, NVGcolor shade_down) { nvgBeginPath(ctx); @@ -2100,7 +2100,7 @@ void bndSelectCorners(float *radiuses, float r, int flags) { } void bndInnerColors( - NVGcolor *shade_top, NVGcolor *shade_down, + NVGcolor *shade_top, NVGcolor *shade_down, const BNDwidgetTheme *theme, BNDwidgetState state, int flipActive) { switch(state) { @@ -2115,9 +2115,9 @@ void bndInnerColors( *shade_down = bndOffsetColor(color, theme->shadeDown); } break; case BND_ACTIVE: { - *shade_top = bndOffsetColor(theme->innerSelectedColor, + *shade_top = bndOffsetColor(theme->innerSelectedColor, flipActive?theme->shadeDown:theme->shadeTop); - *shade_down = bndOffsetColor(theme->innerSelectedColor, + *shade_down = bndOffsetColor(theme->innerSelectedColor, flipActive?theme->shadeTop:theme->shadeDown); } break; } @@ -2128,15 +2128,15 @@ NVGcolor bndTextColor(const BNDwidgetTheme *theme, BNDwidgetState state) { } void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, int align, float fontsize, const char *label, + int iconid, NVGcolor color, int align, float fontsize, const char *label, const char *value) { float pleft = BND_PAD_LEFT; if (label) { if (iconid >= 0) { bndIcon(ctx,x+4,y+2,iconid); pleft += BND_ICON_SHEET_RES; - } - + } + if (bnd_font < 0) return; nvgFontFaceId(ctx, bnd_font); nvgFontSize(ctx, fontsize); @@ -2146,7 +2146,7 @@ void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h, float label_width = nvgTextBounds(ctx, 1, 1, label, NULL, NULL); float sep_width = nvgTextBounds(ctx, 1, 1, BND_LABEL_SEPARATOR, NULL, NULL); - + nvgTextAlign(ctx, NVG_ALIGN_LEFT|NVG_ALIGN_BASELINE); x += pleft; if (align == BND_CENTER) { @@ -2161,7 +2161,7 @@ void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h, x += sep_width; nvgText(ctx, x, y, value, NULL); } else { - nvgTextAlign(ctx, + nvgTextAlign(ctx, (align==BND_LEFT)?(NVG_ALIGN_LEFT|NVG_ALIGN_BASELINE): (NVG_ALIGN_CENTER|NVG_ALIGN_BASELINE)); nvgTextBox(ctx,x+pleft,y+float(BND_WIDGET_HEIGHT)-BND_TEXT_PAD_DOWN, @@ -2173,7 +2173,7 @@ void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h, } void bndNodeIconLabel(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, NVGcolor shadowColor, + int iconid, NVGcolor color, NVGcolor shadowColor, int align, float fontsize, const char *label) { if (label && (bnd_font >= 0)) { nvgFontFaceId(ctx, bnd_font); @@ -2256,7 +2256,7 @@ static void bndCaretPosition(NVGcontext *ctx, float x, float y, } void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, float fontsize, const char *label, + int iconid, NVGcolor color, float fontsize, const char *label, NVGcolor caretcolor, int cbegin, int cend) { float pleft = BND_TEXT_RADIUS; if (!label) return; @@ -2264,9 +2264,9 @@ void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float h, bndIcon(ctx,x+4,y+2,iconid); pleft += BND_ICON_SHEET_RES; } - + if (bnd_font < 0) return; - + x+=pleft; y+=BND_WIDGET_HEIGHT-BND_TEXT_PAD_DOWN; @@ -2289,7 +2289,7 @@ void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float h, rows, nrows, &c0r, &c0x, &c0y); bndCaretPosition(ctx, x, y, desc, lh, label+cend, rows, nrows, &c1r, &c1x, &c1y); - + nvgBeginPath(ctx); if (cbegin == cend) { nvgFillColor(ctx, nvgRGBf(0.337,0.502,0.761)); @@ -2309,7 +2309,7 @@ void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float h, } nvgFill(ctx); } - + nvgBeginPath(ctx); nvgFillColor(ctx, color); nvgTextBox(ctx,x,y,w,label, NULL); diff --git a/bgfx/examples/20-nanovg/nanovg.cpp b/bgfx/examples/20-nanovg/nanovg.cpp index 62c17bcb..a8a1218c 100644 --- a/bgfx/examples/20-nanovg/nanovg.cpp +++ b/bgfx/examples/20-nanovg/nanovg.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -72,11 +72,11 @@ static char* cpToUTF8(int cp, char* str) switch (n) { - case 6: str[5] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x4000000; BX_FALLTHROUGH; - case 5: str[4] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x200000; BX_FALLTHROUGH; - case 4: str[3] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x10000; BX_FALLTHROUGH; - case 3: str[2] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x800; BX_FALLTHROUGH; - case 2: str[1] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0xc0; BX_FALLTHROUGH; + case 6: str[5] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x4000000; [[fallthrough]]; + case 5: str[4] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x200000; [[fallthrough]]; + case 4: str[3] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x10000; [[fallthrough]]; + case 3: str[2] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x800; [[fallthrough]]; + case 2: str[1] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0xc0; [[fallthrough]]; case 1: str[0] = char(cp); break; } @@ -1404,7 +1404,7 @@ class ExampleNanoVG : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/21-deferred/common.sh b/bgfx/examples/21-deferred/common.sh index 8589a431..2622f6ab 100644 --- a/bgfx/examples/21-deferred/common.sh +++ b/bgfx/examples/21-deferred/common.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/deferred.cpp b/bgfx/examples/21-deferred/deferred.cpp index 5fa1636c..16c36fe7 100644 --- a/bgfx/examples/21-deferred/deferred.cpp +++ b/bgfx/examples/21-deferred/deferred.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -19,8 +19,6 @@ constexpr bgfx::ViewId kRenderPassCombine = 3; constexpr bgfx::ViewId kRenderPassDebugLights = 4; constexpr bgfx::ViewId kRenderPassDebugGBuffer = 5; -static float s_texelHalf = 0.0f; - struct PosNormalTangentTexcoordVertex { float m_x; @@ -136,7 +134,7 @@ static const uint16_t s_cubeIndices[36] = 21, 23, 22, }; -void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) +void screenSpaceQuad(bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout) ) { @@ -149,15 +147,13 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf const float miny = 0.0f; const float maxy = _height*2.0f; - const float texelHalfW = _texelHalf/_textureWidth; - const float texelHalfH = _texelHalf/_textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfH; + const float minu = -1.0f; + const float maxu = 1.0f; const float zz = 0.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -213,7 +209,7 @@ class ExampleDeferred : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -334,8 +330,6 @@ class ExampleDeferred : public entry::AppI imguiCreate(); m_timeOffset = bx::getHPCounter(); - const bgfx::RendererType::Enum renderer = bgfx::getRendererType(); - s_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f; // Get renderer capabilities info. m_caps = bgfx::getCaps(); @@ -690,7 +684,7 @@ class ExampleDeferred : public entry::AppI // Clear UAV texture if (m_useUav) { - screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::setViewFrameBuffer(kRenderPassClearUav, BGFX_INVALID_HANDLE); bgfx::setState(0); bgfx::setImage(2, m_lightBufferTex, 0, bgfx::Access::ReadWrite, bgfx::TextureFormat::RGBA8); @@ -817,7 +811,7 @@ class ExampleDeferred : public entry::AppI | BGFX_STATE_WRITE_A | BGFX_STATE_BLEND_ADD ); - screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); if (bgfx::isValid(m_lightTaProgram) && m_useTArray) @@ -846,7 +840,7 @@ class ExampleDeferred : public entry::AppI | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A ); - screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); if (bgfx::isValid(m_lightTaProgram) && m_useTArray) diff --git a/bgfx/examples/21-deferred/fs_deferred_clear_uav.sc b/bgfx/examples/21-deferred/fs_deferred_clear_uav.sc index d56ed893..8ce8b151 100644 --- a/bgfx/examples/21-deferred/fs_deferred_clear_uav.sc +++ b/bgfx/examples/21-deferred/fs_deferred_clear_uav.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/fs_deferred_combine.sc b/bgfx/examples/21-deferred/fs_deferred_combine.sc index 31c3872b..7b4d088e 100644 --- a/bgfx/examples/21-deferred/fs_deferred_combine.sc +++ b/bgfx/examples/21-deferred/fs_deferred_combine.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/fs_deferred_combine_ta.sc b/bgfx/examples/21-deferred/fs_deferred_combine_ta.sc index 9ede7b86..0c08ea18 100644 --- a/bgfx/examples/21-deferred/fs_deferred_combine_ta.sc +++ b/bgfx/examples/21-deferred/fs_deferred_combine_ta.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/fs_deferred_debug.sc b/bgfx/examples/21-deferred/fs_deferred_debug.sc index 9ee68140..fa440910 100644 --- a/bgfx/examples/21-deferred/fs_deferred_debug.sc +++ b/bgfx/examples/21-deferred/fs_deferred_debug.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/fs_deferred_debug_line.sc b/bgfx/examples/21-deferred/fs_deferred_debug_line.sc index 6f31cbe2..49f7962d 100644 --- a/bgfx/examples/21-deferred/fs_deferred_debug_line.sc +++ b/bgfx/examples/21-deferred/fs_deferred_debug_line.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/fs_deferred_debug_ta.sc b/bgfx/examples/21-deferred/fs_deferred_debug_ta.sc index 9766ef90..45e5f84e 100644 --- a/bgfx/examples/21-deferred/fs_deferred_debug_ta.sc +++ b/bgfx/examples/21-deferred/fs_deferred_debug_ta.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/fs_deferred_geom.sc b/bgfx/examples/21-deferred/fs_deferred_geom.sc index 18006e74..7bb8fd4d 100644 --- a/bgfx/examples/21-deferred/fs_deferred_geom.sc +++ b/bgfx/examples/21-deferred/fs_deferred_geom.sc @@ -1,7 +1,7 @@ $input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/fs_deferred_light.sc b/bgfx/examples/21-deferred/fs_deferred_light.sc index 892d384e..6603a192 100644 --- a/bgfx/examples/21-deferred/fs_deferred_light.sc +++ b/bgfx/examples/21-deferred/fs_deferred_light.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/fs_deferred_light_ta.sc b/bgfx/examples/21-deferred/fs_deferred_light_ta.sc index e400115b..aea5f590 100644 --- a/bgfx/examples/21-deferred/fs_deferred_light_ta.sc +++ b/bgfx/examples/21-deferred/fs_deferred_light_ta.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/fs_deferred_light_uav.sc b/bgfx/examples/21-deferred/fs_deferred_light_uav.sc index ab093c61..4a49d62e 100644 --- a/bgfx/examples/21-deferred/fs_deferred_light_uav.sc +++ b/bgfx/examples/21-deferred/fs_deferred_light_uav.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/makefile b/bgfx/examples/21-deferred/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/21-deferred/makefile +++ b/bgfx/examples/21-deferred/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/21-deferred/vs_deferred_combine.sc b/bgfx/examples/21-deferred/vs_deferred_combine.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/21-deferred/vs_deferred_combine.sc +++ b/bgfx/examples/21-deferred/vs_deferred_combine.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/vs_deferred_debug.sc b/bgfx/examples/21-deferred/vs_deferred_debug.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/21-deferred/vs_deferred_debug.sc +++ b/bgfx/examples/21-deferred/vs_deferred_debug.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/vs_deferred_debug_line.sc b/bgfx/examples/21-deferred/vs_deferred_debug_line.sc index a9637c80..70115670 100644 --- a/bgfx/examples/21-deferred/vs_deferred_debug_line.sc +++ b/bgfx/examples/21-deferred/vs_deferred_debug_line.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/21-deferred/vs_deferred_geom.sc b/bgfx/examples/21-deferred/vs_deferred_geom.sc index 2886bd75..e2223f60 100644 --- a/bgfx/examples/21-deferred/vs_deferred_geom.sc +++ b/bgfx/examples/21-deferred/vs_deferred_geom.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_tangent, a_texcoord0 $output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -12,7 +12,7 @@ void main() { vec3 wpos = mul(u_model[0], vec4(a_position, 1.0) ).xyz; gl_Position = mul(u_viewProj, vec4(wpos, 1.0) ); - + vec4 normal = a_normal * 2.0 - 1.0; vec3 wnormal = mul(u_model[0], vec4(normal.xyz, 0.0) ).xyz; diff --git a/bgfx/examples/21-deferred/vs_deferred_light.sc b/bgfx/examples/21-deferred/vs_deferred_light.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/21-deferred/vs_deferred_light.sc +++ b/bgfx/examples/21-deferred/vs_deferred_light.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/22-windows/windows.cpp b/bgfx/examples/22-windows/windows.cpp index 04b9b26e..f8c891e5 100644 --- a/bgfx/examples/22-windows/windows.cpp +++ b/bgfx/examples/22-windows/windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -88,7 +88,7 @@ class ExampleWindows : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -204,6 +204,20 @@ class ExampleWindows : public entry::AppI m_fbh[viewId].idx = bgfx::kInvalidHandle; } + // Before we reattach a SwapChain to the window + // we must actually free up the previous one. + // The DestroyFrameBuffer command goes in the + // cmdPost CommandBuffer, which happens after + // the frame. The CreateFrameBuffer command goes + // int the cmdPre CommandBuffer, which happens + // at the beginning of the frame. Without this + // bgfx::frame() call, the creation would happen + // before it's destroyed, which would cause + // the platform window to have two SwapChains + // associated with it. + // Ideally, we have an operation of ResizeFrameBuffer. + bgfx::frame(); + win.m_nwh = m_state.m_nwh; win.m_width = m_state.m_width; win.m_height = m_state.m_height; @@ -276,6 +290,7 @@ class ExampleWindows : public entry::AppI int64_t now = bx::getHPCounter(); float time = (float)( (now-m_timeOffset)/double(bx::getHPFrequency() ) ); + bgfx::dbgTextClear(); if (NULL != m_bindings) { bgfx::dbgTextPrintf(0, 1, 0x2f, "Press 'c' to create or 'd' to destroy window."); diff --git a/bgfx/examples/23-vectordisplay/main.cpp b/bgfx/examples/23-vectordisplay/main.cpp index 213f917b..5b2903d3 100644 --- a/bgfx/examples/23-vectordisplay/main.cpp +++ b/bgfx/examples/23-vectordisplay/main.cpp @@ -60,11 +60,7 @@ class ExampleVectorDisplay : public entry::AppI init.resolution.reset = m_reset; bgfx::init(init); - const bgfx::RendererType::Enum renderer = bgfx::getRendererType(); - float texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f; - bool originBottomLeft = bgfx::RendererType::OpenGL == renderer - || bgfx::RendererType::OpenGLES == renderer; - m_vd.init(originBottomLeft, texelHalf); + m_vd.init(bgfx::getCaps()->originBottomLeft); m_vd.setup(uint16_t(m_width), uint16_t(m_height) ); // Enable debug text. diff --git a/bgfx/examples/23-vectordisplay/makefile b/bgfx/examples/23-vectordisplay/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/23-vectordisplay/makefile +++ b/bgfx/examples/23-vectordisplay/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/23-vectordisplay/vectordisplay.cpp b/bgfx/examples/23-vectordisplay/vectordisplay.cpp index 719556a8..3b18a98b 100644 --- a/bgfx/examples/23-vectordisplay/vectordisplay.cpp +++ b/bgfx/examples/23-vectordisplay/vectordisplay.cpp @@ -52,14 +52,12 @@ inline float normalizef(float _a) VectorDisplay::VectorDisplay() : m_originBottomLeft(false) - , m_texelHalf(false) { } -void VectorDisplay::init(bool _originBottomLeft, float _texelHalf) +void VectorDisplay::init(bool _originBottomLeft) { m_originBottomLeft = _originBottomLeft; - m_texelHalf = _texelHalf; } @@ -238,7 +236,7 @@ void VectorDisplay::endFrame() bgfx::setUniform(u_params, ¶ms); bgfx::setViewTransform(viewCounter, NULL, proj); - screenSpaceQuad(m_glowWidth, m_glowHeight); + screenSpaceQuad(); bgfx::setViewName(viewCounter, "BlendPassA"); bgfx::submit(viewCounter, m_blurShader); @@ -249,7 +247,7 @@ void VectorDisplay::endFrame() bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_glow0FrameBuffer) ); bgfx::setViewTransform(viewCounter, NULL, proj); - screenSpaceQuad(m_glowWidth, m_glowHeight); + screenSpaceQuad(); params[0] = 0.0f; params[1] = 1.0f / m_glowHeight; @@ -288,7 +286,7 @@ void VectorDisplay::endFrame() params[3] = 1.0f; bgfx::setUniform(u_params, params); bgfx::setViewName(viewCounter, "BlendVectorToDisplay"); - screenSpaceQuad(m_screenWidth, m_screenHeight); + screenSpaceQuad(); bgfx::submit(viewCounter, m_blitShader); viewCounter++; @@ -307,7 +305,7 @@ void VectorDisplay::endFrame() params[2] = glow_fin_mult; bgfx::setUniform(u_params, params); bgfx::setViewName(viewCounter, "BlendBlurToDisplay"); - screenSpaceQuad(m_screenWidth, m_screenHeight); + screenSpaceQuad(); bgfx::submit(viewCounter, m_blitShader); viewCounter++; } @@ -767,7 +765,7 @@ void VectorDisplay::getSize(float* _outWidth, float* _outHeight) *_outHeight = m_screenHeight; } -void VectorDisplay::screenSpaceQuad(float _textureWidth, float _textureHeight, float _width, float _height) +void VectorDisplay::screenSpaceQuad(float _width, float _height) { if (3 == getAvailTransientVertexBuffer(3, PosColorUvVertex::ms_layout) ) { @@ -782,13 +780,11 @@ void VectorDisplay::screenSpaceQuad(float _textureWidth, float _textureHeight, f const float miny = 0.0f; const float maxy = _height * 2.0f; - const float texelHalfW = m_texelHalf / _textureWidth; - const float texelHalfH = m_texelHalf / _textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfW; + const float minu = -1.0f; + const float maxu = 1.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (m_originBottomLeft) { diff --git a/bgfx/examples/23-vectordisplay/vectordisplay.h b/bgfx/examples/23-vectordisplay/vectordisplay.h index 3cfc57fa..d98fcce0 100644 --- a/bgfx/examples/23-vectordisplay/vectordisplay.h +++ b/bgfx/examples/23-vectordisplay/vectordisplay.h @@ -34,7 +34,7 @@ class VectorDisplay { } - void init(bool _originBottomLeft, float _texelHalf); + void init(bool _originBottomLeft); void setup(uint16_t _width, uint16_t _height, uint8_t _view = 2); void resize(uint16_t _width, uint16_t _height); @@ -110,7 +110,7 @@ class VectorDisplay void getSize(float* _outWidth, float* _outHeight); protected: - void screenSpaceQuad(float _textureWidth, float _textureHeight, float _width = 1.0f, float _height = 1.0f); + void screenSpaceQuad(float _width = 1.0f, float _height = 1.0f); struct PendingPoint { diff --git a/bgfx/examples/24-nbody/cs_indirect.sc b/bgfx/examples/24-nbody/cs_indirect.sc index e06802f4..558fe0dc 100644 --- a/bgfx/examples/24-nbody/cs_indirect.sc +++ b/bgfx/examples/24-nbody/cs_indirect.sc @@ -6,7 +6,7 @@ #include "bgfx_compute.sh" #include "uniforms.sh" -BUFFER_WR(indirectBuffer, uvec4, 0); +BUFFER_WO(indirectBuffer, uvec4, 0); NUM_THREADS(1, 1, 1) void main() diff --git a/bgfx/examples/24-nbody/cs_init_instances.sc b/bgfx/examples/24-nbody/cs_init_instances.sc index 0844979d..8c7b1a91 100644 --- a/bgfx/examples/24-nbody/cs_init_instances.sc +++ b/bgfx/examples/24-nbody/cs_init_instances.sc @@ -6,8 +6,8 @@ #include "bgfx_compute.sh" #include "uniforms.sh" -BUFFER_WR(prevPositionBuffer, vec4, 0); -BUFFER_WR(currPositionBuffer, vec4, 1); +BUFFER_WO(prevPositionBuffer, vec4, 0); +BUFFER_WO(currPositionBuffer, vec4, 1); uint rotl(uint _x, uint _r) { diff --git a/bgfx/examples/24-nbody/cs_update_instances.sc b/bgfx/examples/24-nbody/cs_update_instances.sc index 7031cb57..159a62fb 100644 --- a/bgfx/examples/24-nbody/cs_update_instances.sc +++ b/bgfx/examples/24-nbody/cs_update_instances.sc @@ -8,8 +8,8 @@ BUFFER_RO(prevPositionBuffer, vec4, 0); BUFFER_RO(currPositionBuffer, vec4, 1); -BUFFER_WR(outPrevPositionBuffer, vec4, 2); -BUFFER_WR(outCurrPositionBuffer, vec4, 3); +BUFFER_WO(outPrevPositionBuffer, vec4, 2); +BUFFER_WO(outCurrPositionBuffer, vec4, 3); #define GROUP_SIZE 512 SHARED vec3 otherEntries[GROUP_SIZE]; diff --git a/bgfx/examples/24-nbody/makefile b/bgfx/examples/24-nbody/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/24-nbody/makefile +++ b/bgfx/examples/24-nbody/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/24-nbody/nbody.cpp b/bgfx/examples/24-nbody/nbody.cpp index b47469d8..52bef1ca 100644 --- a/bgfx/examples/24-nbody/nbody.cpp +++ b/bgfx/examples/24-nbody/nbody.cpp @@ -132,7 +132,7 @@ class ExampleNbody : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/26-occlusion/occlusion.cpp b/bgfx/examples/26-occlusion/occlusion.cpp index 57cfa097..e611c5c0 100644 --- a/bgfx/examples/26-occlusion/occlusion.cpp +++ b/bgfx/examples/26-occlusion/occlusion.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -84,7 +84,7 @@ class ExampleOcclusion : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/27-terrain/makefile b/bgfx/examples/27-terrain/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/27-terrain/makefile +++ b/bgfx/examples/27-terrain/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/27-terrain/terrain.cpp b/bgfx/examples/27-terrain/terrain.cpp index 867e5089..4732e25f 100644 --- a/bgfx/examples/27-terrain/terrain.cpp +++ b/bgfx/examples/27-terrain/terrain.cpp @@ -80,7 +80,7 @@ ExampleTerrain(const char* _name, const char* _description, const char* _url) init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/28-wireframe/fs_wf_wireframe.sc b/bgfx/examples/28-wireframe/fs_wf_wireframe.sc index c60b7246..81852c1c 100644 --- a/bgfx/examples/28-wireframe/fs_wf_wireframe.sc +++ b/bgfx/examples/28-wireframe/fs_wf_wireframe.sc @@ -23,4 +23,3 @@ void main() vec4 rgba = vec4(color, (1.0-edge)*opacity); gl_FragColor = rgba; } - diff --git a/bgfx/examples/28-wireframe/makefile b/bgfx/examples/28-wireframe/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/28-wireframe/makefile +++ b/bgfx/examples/28-wireframe/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/28-wireframe/vs_wf_wireframe.sc b/bgfx/examples/28-wireframe/vs_wf_wireframe.sc index 2a63a30a..5644c603 100644 --- a/bgfx/examples/28-wireframe/vs_wf_wireframe.sc +++ b/bgfx/examples/28-wireframe/vs_wf_wireframe.sc @@ -16,4 +16,3 @@ void main() v_view = u_camPos - mul(u_model[0], vec4(a_position, 1.0) ).xyz; v_bc = a_color1; } - diff --git a/bgfx/examples/28-wireframe/wireframe.cpp b/bgfx/examples/28-wireframe/wireframe.cpp index 397577ba..75001cda 100644 --- a/bgfx/examples/28-wireframe/wireframe.cpp +++ b/bgfx/examples/28-wireframe/wireframe.cpp @@ -293,7 +293,7 @@ class ExampleWireframe : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/29-debugdraw/debugdraw.cpp b/bgfx/examples/29-debugdraw/debugdraw.cpp index 20a240fb..ddb50d97 100644 --- a/bgfx/examples/29-debugdraw/debugdraw.cpp +++ b/bgfx/examples/29-debugdraw/debugdraw.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -780,7 +780,7 @@ class ExampleDebugDraw : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/30-picking/fs_picking_id.sc b/bgfx/examples/30-picking/fs_picking_id.sc index 723265fc..d5e77e6e 100644 --- a/bgfx/examples/30-picking/fs_picking_id.sc +++ b/bgfx/examples/30-picking/fs_picking_id.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/30-picking/fs_picking_shaded.sc b/bgfx/examples/30-picking/fs_picking_shaded.sc index 74cc160b..741e34ed 100644 --- a/bgfx/examples/30-picking/fs_picking_shaded.sc +++ b/bgfx/examples/30-picking/fs_picking_shaded.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/30-picking/makefile b/bgfx/examples/30-picking/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/30-picking/makefile +++ b/bgfx/examples/30-picking/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/30-picking/picking.cpp b/bgfx/examples/30-picking/picking.cpp index 9a5c36d8..fcbe63e5 100644 --- a/bgfx/examples/30-picking/picking.cpp +++ b/bgfx/examples/30-picking/picking.cpp @@ -40,7 +40,7 @@ class ExamplePicking : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -336,14 +336,6 @@ class ExamplePicking : public entry::AppI uint8_t bb = *x++; uint8_t aa = *x++; - if (bgfx::RendererType::Direct3D9 == caps->rendererType) - { - // Comes back as BGRA - uint8_t temp = rr; - rr = bb; - bb = temp; - } - if (0 == (rr|gg|bb) ) // Skip background { continue; diff --git a/bgfx/examples/30-picking/vs_picking_shaded.sc b/bgfx/examples/30-picking/vs_picking_shaded.sc index 1458070d..f1243677 100644 --- a/bgfx/examples/30-picking/vs_picking_shaded.sc +++ b/bgfx/examples/30-picking/vs_picking_shaded.sc @@ -2,7 +2,7 @@ $input a_position, a_normal $output v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/31-rsm/makefile b/bgfx/examples/31-rsm/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/31-rsm/makefile +++ b/bgfx/examples/31-rsm/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/31-rsm/reflectiveshadowmap.cpp b/bgfx/examples/31-rsm/reflectiveshadowmap.cpp index 65dfe345..5f2ed6d1 100644 --- a/bgfx/examples/31-rsm/reflectiveshadowmap.cpp +++ b/bgfx/examples/31-rsm/reflectiveshadowmap.cpp @@ -128,7 +128,7 @@ struct PosTexCoord0Vertex bgfx::VertexLayout PosTexCoord0Vertex::ms_layout; // Utility function to draw a screen space quad for deferred rendering -void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) +void screenSpaceQuad(bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout) ) { @@ -141,15 +141,13 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf const float miny = 0.0f; const float maxy = _height*2.0f; - const float texelHalfW = _texelHalf/_textureWidth; - const float texelHalfH = _texelHalf/_textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfH; + const float minu = -1.0f; + const float maxu = 1.0f; const float zz = 0.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -195,7 +193,6 @@ class ExampleRSM : public entry::AppI , m_lightAzimuth(215.0f) , m_rsmAmount(0.25f) , m_vplRadius(3.0f) - , m_texelHalf(0.0f) { } @@ -213,7 +210,7 @@ class ExampleRSM : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -374,8 +371,6 @@ class ExampleRSM : public entry::AppI // Get renderer capabilities info. m_caps = bgfx::getCaps(); - const bgfx::RendererType::Enum renderer = bgfx::getRendererType(); - m_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f; imguiCreate(); } @@ -516,7 +511,7 @@ class ExampleRSM : public entry::AppI bgfx::setTexture(0, s_normal, bgfx::getTexture(m_gbuffer, GBUFFER_RT_NORMAL) ); // Normal for lighting calculations bgfx::setTexture(1, s_depth, bgfx::getTexture(m_gbuffer, GBUFFER_RT_DEPTH) ); // Depth to reconstruct world position - // Thse are used in the vert shader + // These are used in the vert shader bgfx::setTexture(2, s_shadowMap, bgfx::getTexture(m_shadowBuffer, SHADOW_RT_DEPTH) ); // Used to place sphere bgfx::setTexture(3, s_rsm, bgfx::getTexture(m_shadowBuffer, SHADOW_RT_RSM) ); // Used to scale/color sphere @@ -580,7 +575,7 @@ class ExampleRSM : public entry::AppI bgfx::setViewTransform(RENDER_PASS_COMBINE, NULL, orthoProj); bgfx::setViewRect(RENDER_PASS_COMBINE, 0, 0, uint16_t(m_width), uint16_t(m_height) ); // Bind vertex buffer and draw quad - screenSpaceQuad( (float)m_width, (float)m_height, m_texelHalf, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(RENDER_PASS_COMBINE, m_combineProgram); // Draw UI @@ -754,8 +749,6 @@ class ExampleRSM : public entry::AppI float m_rsmAmount; // Amount of rsm float m_vplRadius; // Radius of virtual point light - - float m_texelHalf; }; } // namespace diff --git a/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc b/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc index a7ac4108..d27cbdef 100644 --- a/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc +++ b/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc @@ -20,7 +20,7 @@ void main() // Calculate normal. Note that compressed normal is stored in the vertices vec3 normalObjectSpace = a_normal.xyz*2.0+-1.0; // Normal is stored in [0,1], remap to [-1,1]. - // Transform normal into world space. + // Transform normal into world space. vec3 normalWorldSpace = mul(u_model[0], vec4(normalObjectSpace, 0.0) ).xyz; // Normalize to remove (uniform...) scaling, however, recompress v_normal.xyz = normalize(normalWorldSpace)*0.5+0.5; diff --git a/bgfx/examples/31-rsm/vs_rsm_shadow.sc b/bgfx/examples/31-rsm/vs_rsm_shadow.sc index 942e1c3e..2b5899ae 100644 --- a/bgfx/examples/31-rsm/vs_rsm_shadow.sc +++ b/bgfx/examples/31-rsm/vs_rsm_shadow.sc @@ -17,7 +17,7 @@ void main() // Calculate normal. Note that compressed normal is stored in the vertices vec3 normalObjectSpace = a_normal.xyz*2.0+-1.0; // Normal is stored in [0,1], remap to [-1,1]. - // Transform normal into view space. + // Transform normal into view space. v_normal = mul(u_modelView, vec4(normalObjectSpace, 0.0) ).xyz; // Normalize to remove (uniform...) scaling v_normal = normalize(v_normal); diff --git a/bgfx/examples/32-particles/particles.cpp b/bgfx/examples/32-particles/particles.cpp index 12ab607a..1a661f2c 100644 --- a/bgfx/examples/32-particles/particles.cpp +++ b/bgfx/examples/32-particles/particles.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -81,7 +81,7 @@ static const char* s_easeFuncName[] = "InOutBounce", "OutInBounce", }; -BX_STATIC_ASSERT(BX_COUNTOF(s_easeFuncName) == bx::Easing::Count); +static_assert(BX_COUNTOF(s_easeFuncName) == bx::Easing::Count); struct Emitter { @@ -248,7 +248,7 @@ class ExampleParticles : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/33-pom/makefile b/bgfx/examples/33-pom/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/33-pom/makefile +++ b/bgfx/examples/33-pom/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/33-pom/pom.cpp b/bgfx/examples/33-pom/pom.cpp index 508178fa..de12003d 100644 --- a/bgfx/examples/33-pom/pom.cpp +++ b/bgfx/examples/33-pom/pom.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -37,29 +37,15 @@ struct PosTangentBitangentTexcoordVertex bgfx::VertexLayout PosTangentBitangentTexcoordVertex::ms_layout; -uint32_t packUint32(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) -{ - union - { - uint32_t ui32; - uint8_t arr[4]; - } un; - - un.arr[0] = _x; - un.arr[1] = _y; - un.arr[2] = _z; - un.arr[3] = _w; - - return un.ui32; -} - uint32_t packF4u(float _x, float _y = 0.0f, float _z = 0.0f, float _w = 0.0f) { - const uint8_t xx = uint8_t(_x*127.0f + 128.0f); - const uint8_t yy = uint8_t(_y*127.0f + 128.0f); - const uint8_t zz = uint8_t(_z*127.0f + 128.0f); - const uint8_t ww = uint8_t(_w*127.0f + 128.0f); - return packUint32(xx, yy, zz, ww); + struct Packed { uint8_t value[4]; } arr = { 0 }; + arr.value[0] = uint8_t(_x * 127.0f + 128.0f); + arr.value[1] = uint8_t(_y * 127.0f + 128.0f); + arr.value[2] = uint8_t(_z * 127.0f + 128.0f); + arr.value[3] = uint8_t(_w * 127.0f + 128.0f); + + return bx::bitCast(arr); } static PosTangentBitangentTexcoordVertex s_cubeVertices[24] = @@ -130,7 +116,7 @@ class ExamplePom : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/34-mvs/mvs.cpp b/bgfx/examples/34-mvs/mvs.cpp index 7fecebea..7eec73b2 100644 --- a/bgfx/examples/34-mvs/mvs.cpp +++ b/bgfx/examples/34-mvs/mvs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -126,7 +126,7 @@ class ExampleMvs : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/35-dynamic/dynamic.cpp b/bgfx/examples/35-dynamic/dynamic.cpp index 7ee451f5..af9b2c01 100644 --- a/bgfx/examples/35-dynamic/dynamic.cpp +++ b/bgfx/examples/35-dynamic/dynamic.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -104,7 +104,7 @@ class ExampleDynamic : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/36-sky/fs_sky_landscape.sc b/bgfx/examples/36-sky/fs_sky_landscape.sc index 0ce045e5..df59dcd9 100644 --- a/bgfx/examples/36-sky/fs_sky_landscape.sc +++ b/bgfx/examples/36-sky/fs_sky_landscape.sc @@ -26,7 +26,7 @@ float nrand(in vec2 n) float n4rand_ss(in vec2 n) { float nrnd0 = nrand( n + 0.07*fract( u_parameters.w ) ); - float nrnd1 = nrand( n + 0.11*fract( u_parameters.w + 0.573953 ) ); + float nrnd1 = nrand( n + 0.11*fract( u_parameters.w + 0.573953 ) ); return 0.23*sqrt(-log(nrnd0+0.00001))*cos(2.0*3.141592*nrnd1)+0.5; } @@ -40,17 +40,17 @@ void main() vec3 normal = normalize(v_normal); float occulsion = toLinear(texture2D(s_texLightmap, v_texcoord0).r); - + vec3 skyDirection = vec3(0.0, 0.0, 1.0); - + float diffuseSun = max(0.0, dot(normal, normalize(u_sunDirection.xyz))); float diffuseSky = 1.0 + 0.5 * dot(normal, skyDirection); - + vec3 color = diffuseSun * u_sunLuminance.rgb + (diffuseSky * u_skyLuminance.rgb + 0.01) * occulsion; color *= 0.5; - + //color = mix(color, (u_skyLuminance + u_sunLuminance)*0.3, v_fogFactor); - + gl_FragColor.xyz = color * u_parameters.z; gl_FragColor.w = 1.0; float r = n4rand_ss(gl_FragCoord.xy) / 40.0; diff --git a/bgfx/examples/36-sky/makefile b/bgfx/examples/36-sky/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/36-sky/makefile +++ b/bgfx/examples/36-sky/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/36-sky/sky.cpp b/bgfx/examples/36-sky/sky.cpp index b82c31fd..d00a4aa9 100644 --- a/bgfx/examples/36-sky/sky.cpp +++ b/bgfx/examples/36-sky/sky.cpp @@ -420,7 +420,7 @@ class ExampleProceduralSky : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/36-sky/varying.def.sc b/bgfx/examples/36-sky/varying.def.sc index ada280b4..ad5efec5 100644 --- a/bgfx/examples/36-sky/varying.def.sc +++ b/bgfx/examples/36-sky/varying.def.sc @@ -6,4 +6,4 @@ vec3 v_viewDir : TEXCOORD2 = vec3(0.0, 0.0, 1.0); vec3 a_position : POSITION; vec4 a_normal : NORMAL; -vec2 a_texcoord0 : TEXCOORD0; \ No newline at end of file +vec2 a_texcoord0 : TEXCOORD0; diff --git a/bgfx/examples/36-sky/vs_sky_landscape.sc b/bgfx/examples/36-sky/vs_sky_landscape.sc index 6bc0868b..a20caad3 100644 --- a/bgfx/examples/36-sky/vs_sky_landscape.sc +++ b/bgfx/examples/36-sky/vs_sky_landscape.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_texcoord0 $output v_normal, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/37-gpudrivenrendering/cs_gdr_copy_z.sc b/bgfx/examples/37-gpudrivenrendering/cs_gdr_copy_z.sc index c5732156..71656f36 100644 --- a/bgfx/examples/37-gpudrivenrendering/cs_gdr_copy_z.sc +++ b/bgfx/examples/37-gpudrivenrendering/cs_gdr_copy_z.sc @@ -6,7 +6,7 @@ #include "bgfx_compute.sh" SAMPLER2D(s_texOcclusionDepth, 0); -IMAGE2D_WR(s_texOcclusionDepthOut, r32f, 1); +IMAGE2D_WO(s_texOcclusionDepthOut, r32f, 1); uniform vec4 u_inputRTSize; diff --git a/bgfx/examples/37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc b/bgfx/examples/37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc index cb394163..f8a2803e 100644 --- a/bgfx/examples/37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc +++ b/bgfx/examples/37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc @@ -6,7 +6,7 @@ #include "bgfx_compute.sh" IMAGE2D_RO(s_texOcclusionDepthIn, r32f, 0); -IMAGE2D_WR(s_texOcclusionDepthOut, r32f, 1); +IMAGE2D_WO(s_texOcclusionDepthOut, r32f, 1); uniform vec4 u_inputRTSize; diff --git a/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc b/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc index fd4ae946..9c831666 100644 --- a/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc +++ b/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc @@ -9,7 +9,7 @@ SAMPLER2D(s_texOcclusionDepth, 0); BUFFER_RO(instanceDataIn, vec4, 1); BUFFER_RW(drawcallInstanceCount, uint, 2); -BUFFER_WR(instancePredicates, bool, 3); +BUFFER_WO(instancePredicates, bool, 3); uniform vec4 u_inputRTSize; uniform vec4 u_cullingConfig; @@ -51,7 +51,7 @@ void main() //transform World space aaBox to NDC vec4 clipPos = mul( u_viewProj, vec4(boxCorners[i], 1) ); -#if BGFX_SHADER_LANGUAGE_GLSL +#if BGFX_SHADER_LANGUAGE_GLSL clipPos.z = 0.5 * ( clipPos.z + clipPos.w ); #endif clipPos.z = max(clipPos.z, 0); diff --git a/bgfx/examples/37-gpudrivenrendering/cs_gdr_stream_compaction.sc b/bgfx/examples/37-gpudrivenrendering/cs_gdr_stream_compaction.sc index 058d1eaf..24126e9d 100644 --- a/bgfx/examples/37-gpudrivenrendering/cs_gdr_stream_compaction.sc +++ b/bgfx/examples/37-gpudrivenrendering/cs_gdr_stream_compaction.sc @@ -17,7 +17,7 @@ BUFFER_RW(drawcallInstanceCount, uint, 3); //drawcall data that will drive drawIndirect BUFFER_RW(drawcallData, uvec4, 4); //culled instance data -BUFFER_WR(instanceDataOut, vec4, 5); +BUFFER_WO(instanceDataOut, vec4, 5); uniform vec4 u_cullingConfig; diff --git a/bgfx/examples/37-gpudrivenrendering/gpudrivenrendering.cpp b/bgfx/examples/37-gpudrivenrendering/gpudrivenrendering.cpp index 5a3ff9ac..cbe33c33 100644 --- a/bgfx/examples/37-gpudrivenrendering/gpudrivenrendering.cpp +++ b/bgfx/examples/37-gpudrivenrendering/gpudrivenrendering.cpp @@ -330,7 +330,7 @@ class GPUDrivenRendering : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/37-gpudrivenrendering/makefile b/bgfx/examples/37-gpudrivenrendering/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/37-gpudrivenrendering/makefile +++ b/bgfx/examples/37-gpudrivenrendering/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/38-bloom/bloom.cpp b/bgfx/examples/38-bloom/bloom.cpp index 99dcb730..04a974c4 100644 --- a/bgfx/examples/38-bloom/bloom.cpp +++ b/bgfx/examples/38-bloom/bloom.cpp @@ -32,8 +32,6 @@ namespace // number of downsampled and then upsampled textures(used for bloom.) #define TEX_CHAIN_LEN 5 -static float s_texelHalf = 0.0f; - struct PosVertex { float m_x; @@ -123,7 +121,7 @@ static const uint16_t s_cubeIndices[36] = 21, 23, 22, }; -void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) +void screenSpaceQuad(bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout) ) { @@ -136,15 +134,13 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf const float miny = 0.0f; const float maxy = _height*2.0f; - const float texelHalfW = _texelHalf/_textureWidth; - const float texelHalfH = _texelHalf/_textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfH; + const float minu = -1.0f; + const float maxu = 1.0f; const float zz = 0.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -200,7 +196,7 @@ class ExampleBloom : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -270,8 +266,6 @@ class ExampleBloom : public entry::AppI imguiCreate(); m_timeOffset = bx::getHPCounter(); - const bgfx::RendererType::Enum renderer = bgfx::getRendererType(); - s_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f; // Get renderer capabilities info. m_caps = bgfx::getCaps(); @@ -554,7 +548,7 @@ class ExampleBloom : public entry::AppI | BGFX_STATE_WRITE_A ); - screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(RENDER_PASS_DOWNSAMPLE0_ID + ii, m_downsampleProgram); } @@ -584,7 +578,7 @@ class ExampleBloom : public entry::AppI | BGFX_STATE_BLEND_ADD ); - screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(RENDER_PASS_UPSAMPLE0_ID + ii, m_upsampleProgram); } @@ -595,7 +589,7 @@ class ExampleBloom : public entry::AppI | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A ); - screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft); + screenSpaceQuad(m_caps->originBottomLeft); bgfx::submit(RENDER_PASS_COMBINE_ID, m_combineProgram); } diff --git a/bgfx/examples/38-bloom/fs_bloom_combine.sc b/bgfx/examples/38-bloom/fs_bloom_combine.sc index b3ad7a16..2e849006 100644 --- a/bgfx/examples/38-bloom/fs_bloom_combine.sc +++ b/bgfx/examples/38-bloom/fs_bloom_combine.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/38-bloom/makefile b/bgfx/examples/38-bloom/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/38-bloom/makefile +++ b/bgfx/examples/38-bloom/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/38-bloom/vs_deferred_combine.sc b/bgfx/examples/38-bloom/vs_deferred_combine.sc index 0483c189..d8264d39 100644 --- a/bgfx/examples/38-bloom/vs_deferred_combine.sc +++ b/bgfx/examples/38-bloom/vs_deferred_combine.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/39-assao/assao.cpp b/bgfx/examples/39-assao/assao.cpp index fbff0f29..49644193 100644 --- a/bgfx/examples/39-assao/assao.cpp +++ b/bgfx/examples/39-assao/assao.cpp @@ -84,7 +84,7 @@ namespace bgfx::VertexLayout PosTexCoord0Vertex::ms_layout; // Utility function to draw a screen space quad for deferred rendering - void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) + void screenSpaceQuad(bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout)) { @@ -97,15 +97,13 @@ namespace const float miny = 0.0f; const float maxy = _height * 2.0f; - const float texelHalfW = _texelHalf / _textureWidth; - const float texelHalfH = _texelHalf / _textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfH; + const float minu = -1.0f; + const float maxu = 1.0f; const float zz = 0.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -252,7 +250,6 @@ namespace , m_currFrame(UINT32_MAX) , m_enableSSAO(true) , m_enableTexturing(true) - , m_texelHalf(0.0f) , m_framebufferGutter(true) { } @@ -271,7 +268,7 @@ namespace init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -376,10 +373,6 @@ namespace cameraSetVerticalAngle(-0.3f); m_fovY = 60.0f; - // Get renderer capabilities info. - const bgfx::RendererType::Enum renderer = bgfx::getRendererType(); - m_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f; - imguiCreate(); } @@ -495,7 +488,7 @@ namespace bgfx::setViewTransform(RENDER_PASS_COMBINE, NULL, orthoProj); bgfx::setViewRect(RENDER_PASS_COMBINE, 0, 0, uint16_t(m_width), uint16_t(m_height)); // Bind vertex buffer and draw quad - screenSpaceQuad((float)m_width, (float)m_height, m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); //bgfx::submit(RENDER_PASS_COMBINE, m_combineProgram); bgfx::touch(RENDER_PASS_COMBINE); @@ -754,7 +747,7 @@ namespace (float)(m_size[0]-2*m_border) / (float)m_size[0], (float)(m_size[1] - 2 * m_border) / (float)m_size[1], (float)m_border / (float)m_size[0], (float)m_border / (float)m_size[1] }; bgfx::setUniform(u_combineParams, combineParams, 2); - screenSpaceQuad((float)m_width, (float)m_height, m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_DEPTH_TEST_ALWAYS); bgfx::submit(view, m_combineProgram); ++view; @@ -1183,7 +1176,6 @@ namespace bool m_enableSSAO; bool m_enableTexturing; - float m_texelHalf; float m_fovY; bool m_framebufferGutter; @@ -1208,5 +1200,3 @@ ENTRY_IMPLEMENT_MAIN( , "Adaptive Screen Space Ambient Occlusion." , "https://bkaradzic.github.io/bgfx/examples.html#assao" ); - - diff --git a/bgfx/examples/39-assao/cs_assao_apply.sc b/bgfx/examples/39-assao/cs_assao_apply.sc index d6148fb3..c75e2788 100644 --- a/bgfx/examples/39-assao/cs_assao_apply.sc +++ b/bgfx/examples/39-assao/cs_assao_apply.sc @@ -3,11 +3,11 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_WR(s_target, r8, 0); -SAMPLER2DARRAY(s_finalSSAO, 1); +IMAGE2D_WO(s_target, r8, 0); +SAMPLER2DARRAY(s_finalSSAO, 1); // unpacking for edges; 2 bits per edge mean 4 gradient values (0, 0.33, 0.66, 1) for smoother transitions! @@ -24,7 +24,7 @@ vec4 UnpackEdges( float _packedVal ) } NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy) + uvec2(u_rect.xy); if (all(lessThan(dtID.xy, u_rect.zw) ) ) @@ -36,7 +36,7 @@ void main() // calculate index in the four deinterleaved source array texture int mx = (int(pixPos.x) % 2); #if BGFX_SHADER_LANGUAGE_GLSL - int dimy = imageSize(s_target).y; + int dimy = imageSize(s_target).y; int my = (int(dimy-1-pixPos.y) % 2); #else int my = (int(pixPos.y) % 2); @@ -47,7 +47,7 @@ void main() int id = (1-mx) + (1-my)*2; // diagonal vec2 centerVal = texelFetch(s_finalSSAO, ivec3(pixPosHalf, ic), 0 ).xy; - + ao = centerVal.x; #if 1 // change to 0 if you want to disable last pass high-res blur (for debugging purposes, etc.) @@ -58,7 +58,7 @@ void main() // convert index shifts to sampling offsets float fmx = float(mx); float fmy = float(my); - + // in case of an edge, push sampling offsets away from the edge (towards pixel center) float fmxe = (edgesLRTB.y - edgesLRTB.x); float fmye = (edgesLRTB.w - edgesLRTB.z); @@ -100,4 +100,3 @@ void main() imageStore(s_target, ivec2(dtID.xy), ao.xxxx); } } - diff --git a/bgfx/examples/39-assao/cs_assao_generate_importance_map.sc b/bgfx/examples/39-assao/cs_assao_generate_importance_map.sc index 7905c819..9f30767e 100644 --- a/bgfx/examples/39-assao/cs_assao_generate_importance_map.sc +++ b/bgfx/examples/39-assao/cs_assao_generate_importance_map.sc @@ -3,14 +3,14 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_WR(s_target, r8, 0); -SAMPLER2DARRAY(s_finalSSAO, 1); +IMAGE2D_WO(s_target, r8, 0); +SAMPLER2DARRAY(s_finalSSAO, 1); NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy); diff --git a/bgfx/examples/39-assao/cs_assao_generate_q.sh b/bgfx/examples/39-assao/cs_assao_generate_q.sh index 5b4726e6..7053879b 100644 --- a/bgfx/examples/39-assao/cs_assao_generate_q.sh +++ b/bgfx/examples/39-assao/cs_assao_generate_q.sh @@ -3,7 +3,7 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" // progressive poisson-like pattern; x, y are in [-1, 1] range, .z is length( vec2(x,y) ), .w is log2( z ) @@ -49,20 +49,20 @@ CONST(uint g_numTaps[5]) = { 3, 5, 12, 0, 0 }; #define SSAO_DEPTH_MIPS_ENABLE_AT_QUALITY_PRESET (2) // !!warning!! the MIP generation on the C++ side will be enabled on quality preset 2 regardless of this value, so if changing here, change the C++ side too #define SSAO_DEPTH_MIPS_GLOBAL_OFFSET (-4.3) // best noise/quality/performance tradeoff, found empirically // -// !!warning!! the edge handling is hard-coded to 'disabled' on quality level 0, and enabled above, on the C++ side; while toggling it here will work for +// !!warning!! the edge handling is hard-coded to 'disabled' on quality level 0, and enabled above, on the C++ side; while toggling it here will work for // testing purposes, it will not yield performance gains (or correct results) -#define SSAO_DEPTH_BASED_EDGES_ENABLE_AT_QUALITY_PRESET (1) +#define SSAO_DEPTH_BASED_EDGES_ENABLE_AT_QUALITY_PRESET (1) // #define SSAO_REDUCE_RADIUS_NEAR_SCREEN_BORDER_ENABLE_AT_QUALITY_PRESET (99) // 99 means disabled; only helpful if artifacts at the edges caused by lack of out of screen depth data are not acceptable with the depth sampler in either clamp or mirror modes ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -SAMPLER2D(s_viewspaceDepthSource, 0); -SAMPLER2D(s_viewspaceDepthSourceMirror, 1); +SAMPLER2D(s_viewspaceDepthSource, 0); +SAMPLER2D(s_viewspaceDepthSourceMirror, 1); IMAGE2D_RO(s_normalmapSource, rgba8, 2); -BUFFER_RO(s_loadCounter, uint, 3); -SAMPLER2D(s_importanceMap, 4); +BUFFER_RO(s_loadCounter, uint, 3); +SAMPLER2D(s_importanceMap, 4); IMAGE2D_ARRAY_RO(s_baseSSAO, rg8, 5); -IMAGE2D_ARRAY_WR(s_target, rg8, 6); +IMAGE2D_ARRAY_WO(s_target, rg8, 6); // packing/unpacking for edges; 2 bits per edge mean 4 gradient values (0, 0.33, 0.66, 1) for smoother transitions! float PackEdges( vec4 edgesLRTB ) @@ -96,7 +96,7 @@ void CalculateRadiusParameters( const float pixCenterLength, const vec2 pixelDir // when too close, on-screen sampling disk will grow beyond screen size; limit this to avoid closeup temporal artifacts const float tooCloseLimitMod = saturate( pixCenterLength * u_effectSamplingRadiusNearLimitRec ) * 0.8 + 0.2; - + effectRadius *= tooCloseLimitMod; // 0.85 is to reduce the radius to allow for more samples on a slope to still stay within influence @@ -169,7 +169,7 @@ void SSAOTapInner( const int qualityLevel, inout float obscuranceSum, inout floa float obscurance = CalculatePixelObscurance( pixelNormal, hitDelta, falloffCalcMulSq ); float weight = 1.0; - + if( qualityLevel >= SSAO_HALOING_REDUCTION_ENABLE_AT_QUALITY_PRESET ) { //float reduct = max( 0, dot( hitDelta, negViewspaceDir ) ); @@ -198,7 +198,7 @@ void SSAOTap( const int qualityLevel, inout float obscuranceSum, inout float wei // snap to pixel center (more correct obscurance math, avoids artifacts) sampleOffset = round(sampleOffset); - // calculate MIP based on the sample distance from the centre, similar to as described + // calculate MIP based on the sample distance from the centre, similar to as described // in http://graphics.cs.williams.edu/papers/SAOHPG12/. float mipLevel = ( qualityLevel < SSAO_DEPTH_MIPS_ENABLE_AT_QUALITY_PRESET )?(0):(samplePow2Len + mipOffset); @@ -228,7 +228,7 @@ void SSAOTap( const int qualityLevel, inout float obscuranceSum, inout float wei } // this function is designed to only work with half/half depth at the moment - there's a couple of hardcoded paths that expect pixel/texel size, so it will not work for full res -void GenerateSSAOShadowsInternal( out float outShadowTerm, out vec4 outEdges, out float outWeight, +void GenerateSSAOShadowsInternal( out float outShadowTerm, out vec4 outEdges, out float outWeight, const vec2 SVPos, const int qualityLevel, bool adaptiveBase) { vec2 SVPosRounded = trunc( SVPos ); @@ -237,7 +237,7 @@ void GenerateSSAOShadowsInternal( out float outShadowTerm, out vec4 outEdges, ou const uint numberOfTaps = (adaptiveBase)?(SSAO_ADAPTIVE_TAP_BASE_COUNT) : ( g_numTaps[qualityLevel] ); float pixZ, pixLZ, pixTZ, pixRZ, pixBZ; -#if BGFX_SHADER_LANGUAGE_GLSL +#if BGFX_SHADER_LANGUAGE_GLSL vec4 valuesUL = textureGather(s_viewspaceDepthSourceMirror, SVPosRounded * u_halfViewportPixelSize + vec2(0.0,u_halfViewportPixelSize.y), 0).wzyx; vec4 valuesBR = textureGatherOffset(s_viewspaceDepthSourceMirror, SVPosRounded * u_halfViewportPixelSize + vec2(0.0,u_halfViewportPixelSize.y), ivec2( 1, -1 ), 0).wzyx; #else @@ -246,7 +246,7 @@ void GenerateSSAOShadowsInternal( out float outShadowTerm, out vec4 outEdges, ou #endif // get this pixel's viewspace depth - pixZ = valuesUL.y; + pixZ = valuesUL.y; // get left right top bottom neighbouring pixels for edge detection (gets compiled out on qualityLevel == 0) pixLZ = valuesUL.x; @@ -450,7 +450,7 @@ void GenerateSSAOShadowsInternal( out float outShadowTerm, out vec4 outEdges, ou // calculate fadeout (1 close, gradient, 0 far) float fadeOut = saturate( pixCenterPos.z * u_effectFadeOutMul + u_effectFadeOutAdd ); - + // Reduce the SSAO shadowing if we're on the edge to remove artifacts on edges (we don't care for the lower quality one) if( !adaptiveBase && (qualityLevel >= SSAO_DEPTH_BASED_EDGES_ENABLE_AT_QUALITY_PRESET) ) { @@ -464,20 +464,20 @@ void GenerateSSAOShadowsInternal( out float outShadowTerm, out vec4 outEdges, ou fadeOut *= saturate( 1.0 - edgeFadeoutFactor ); } - + // same as a bove, but a lot more conservative version // fadeOut *= saturate( dot( edgesLRTB, vec4( 0.9, 0.9, 0.9, 0.9 ) ) - 2.6 ); // strength obscurance = u_effectShadowStrength * obscurance; - + // clamp obscurance = min( obscurance, u_effectShadowClamp ); - + // fadeout obscurance *= fadeOut; - // conceptually switch to occlusion with the meaning being visibility (grows with visibility, occlusion == 1 implies full visibility), + // conceptually switch to occlusion with the meaning being visibility (grows with visibility, occlusion == 1 implies full visibility), // to be in line with what is more commonly used. float occlusion = 1.0 - obscurance; @@ -492,11 +492,11 @@ void GenerateSSAOShadowsInternal( out float outShadowTerm, out vec4 outEdges, ou } NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy) + uvec2(u_rect.xy); if (all(lessThan(dtID.xy, u_rect.zw) ) ) - { + { float outShadowTerm; float outWeight; vec4 outEdges; diff --git a/bgfx/examples/39-assao/cs_assao_generate_q0.sc b/bgfx/examples/39-assao/cs_assao_generate_q0.sc index 16524992..750adf48 100644 --- a/bgfx/examples/39-assao/cs_assao_generate_q0.sc +++ b/bgfx/examples/39-assao/cs_assao_generate_q0.sc @@ -6,4 +6,4 @@ #define ASSAO_QUALITY 0 #define ASSAO_ADAPTIVE_BASE false -#include "cs_assao_generate_q.sh" \ No newline at end of file +#include "cs_assao_generate_q.sh" diff --git a/bgfx/examples/39-assao/cs_assao_generate_q1.sc b/bgfx/examples/39-assao/cs_assao_generate_q1.sc index 942a4828..fef0189a 100644 --- a/bgfx/examples/39-assao/cs_assao_generate_q1.sc +++ b/bgfx/examples/39-assao/cs_assao_generate_q1.sc @@ -6,4 +6,4 @@ #define ASSAO_QUALITY 1 #define ASSAO_ADAPTIVE_BASE false -#include "cs_assao_generate_q.sh" \ No newline at end of file +#include "cs_assao_generate_q.sh" diff --git a/bgfx/examples/39-assao/cs_assao_generate_q2.sc b/bgfx/examples/39-assao/cs_assao_generate_q2.sc index 2e62c45d..cf7aaa7d 100644 --- a/bgfx/examples/39-assao/cs_assao_generate_q2.sc +++ b/bgfx/examples/39-assao/cs_assao_generate_q2.sc @@ -6,4 +6,4 @@ #define ASSAO_QUALITY 2 #define ASSAO_ADAPTIVE_BASE false -#include "cs_assao_generate_q.sh" \ No newline at end of file +#include "cs_assao_generate_q.sh" diff --git a/bgfx/examples/39-assao/cs_assao_generate_q3.sc b/bgfx/examples/39-assao/cs_assao_generate_q3.sc index b53352e3..c224ea1a 100644 --- a/bgfx/examples/39-assao/cs_assao_generate_q3.sc +++ b/bgfx/examples/39-assao/cs_assao_generate_q3.sc @@ -6,4 +6,4 @@ #define ASSAO_QUALITY 3 #define ASSAO_ADAPTIVE_BASE false -#include "cs_assao_generate_q.sh" \ No newline at end of file +#include "cs_assao_generate_q.sh" diff --git a/bgfx/examples/39-assao/cs_assao_generate_q3base.sc b/bgfx/examples/39-assao/cs_assao_generate_q3base.sc index 0b5c4f98..8cb86c2d 100644 --- a/bgfx/examples/39-assao/cs_assao_generate_q3base.sc +++ b/bgfx/examples/39-assao/cs_assao_generate_q3base.sc @@ -6,4 +6,4 @@ #define ASSAO_QUALITY 3 #define ASSAO_ADAPTIVE_BASE true -#include "cs_assao_generate_q.sh" \ No newline at end of file +#include "cs_assao_generate_q.sh" diff --git a/bgfx/examples/39-assao/cs_assao_load_counter_clear.sc b/bgfx/examples/39-assao/cs_assao_load_counter_clear.sc index ef7c1bfa..a4fd965f 100644 --- a/bgfx/examples/39-assao/cs_assao_load_counter_clear.sc +++ b/bgfx/examples/39-assao/cs_assao_load_counter_clear.sc @@ -3,13 +3,13 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -BUFFER_WR(s_loadCounter, uint, 0); +BUFFER_WO(s_loadCounter, uint, 0); NUM_THREADS(1, 1, 1) -void main() +void main() { s_loadCounter[0] = 0; } diff --git a/bgfx/examples/39-assao/cs_assao_non_smart_apply.sc b/bgfx/examples/39-assao/cs_assao_non_smart_apply.sc index af55615d..29aaebfb 100644 --- a/bgfx/examples/39-assao/cs_assao_non_smart_apply.sc +++ b/bgfx/examples/39-assao/cs_assao_non_smart_apply.sc @@ -3,15 +3,15 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_WR(s_target, r8, 0); +IMAGE2D_WO(s_target, r8, 0); SAMPLER2DARRAY(s_finalSSAO, 1); // edge-ignorant blur & apply (for the lowest quality level 0) NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy) + uvec2(u_rect.xy); if (all(lessThan(dtID.xy, u_rect.zw) ) ) @@ -26,4 +26,3 @@ void main() imageStore(s_target, ivec2(dtID.xy), avg.xxxx); } } - diff --git a/bgfx/examples/39-assao/cs_assao_non_smart_blur.sc b/bgfx/examples/39-assao/cs_assao_non_smart_blur.sc index 6c41d5d7..29476a90 100644 --- a/bgfx/examples/39-assao/cs_assao_non_smart_blur.sc +++ b/bgfx/examples/39-assao/cs_assao_non_smart_blur.sc @@ -3,15 +3,15 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_ARRAY_WR(s_target, rg8, 0); -SAMPLER2DARRAY(s_blurInput, 1); +IMAGE2D_ARRAY_WO(s_target, rg8, 0); +SAMPLER2DARRAY(s_blurInput, 1); // edge-ignorant blur in x and y directions, 9 pixels touched (for the lowest quality level 0) NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy) + uvec2(u_rect.xy); if (all(lessThan(dtID.xy, u_rect.zw) ) ) @@ -34,4 +34,3 @@ void main() imageStore(s_target, ivec3(dtID.xy,u_layer), vec4(dot( vals, 0.2.xxxx ) + centre.x * 0.2, centre.y, 0.0, 0.0)); } } - diff --git a/bgfx/examples/39-assao/cs_assao_non_smart_half_apply.sc b/bgfx/examples/39-assao/cs_assao_non_smart_half_apply.sc index 5026b489..06d9e1fc 100644 --- a/bgfx/examples/39-assao/cs_assao_non_smart_half_apply.sc +++ b/bgfx/examples/39-assao/cs_assao_non_smart_half_apply.sc @@ -3,15 +3,15 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_WR(s_target, r8, 0); +IMAGE2D_WO(s_target, r8, 0); SAMPLER2DARRAY(s_finalSSAO, 1); // edge-ignorant blur & apply, skipping half pixels in checkerboard pattern (for the Lowest quality level 0 and Settings::SkipHalfPixelsOnLowQualityLevel == true ) NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy) + uvec2(u_rect.xy); if (all(lessThan(dtID.xy, u_rect.zw) ) ) diff --git a/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_a.sc b/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_a.sc index c11eb99c..c7041bfc 100644 --- a/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_a.sc +++ b/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_a.sc @@ -3,10 +3,10 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_WR(s_target, r8, 0); +IMAGE2D_WO(s_target, r8, 0); SAMPLER2D(s_importanceMap, 1); // Shaders below only needed for adaptive quality level @@ -14,7 +14,7 @@ SAMPLER2D(s_importanceMap, 1); CONST(float cSmoothenImportance) = 1.0; NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy); @@ -31,7 +31,7 @@ void main() #if BGFX_SHADER_LANGUAGE_GLSL halfPixel.y = -halfPixel.y; -#endif +#endif vec4 vals; vals.x = texture2DLod(s_importanceMap, inUV + vec2( -halfPixel.x * 3, -halfPixel.y ), 0.0 ).x; vals.y = texture2DLod(s_importanceMap, inUV + vec2( +halfPixel.x, -halfPixel.y * 3 ), 0.0 ).x; diff --git a/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_b.sc b/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_b.sc index 8696292d..992d604a 100644 --- a/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_b.sc +++ b/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_b.sc @@ -3,10 +3,10 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_WR(s_target, r8, 0); +IMAGE2D_WO(s_target, r8, 0); SAMPLER2D(s_importanceMap, 1); BUFFER_RW(s_loadCounter, uint, 2); @@ -14,7 +14,7 @@ CONST(float cSmoothenImportance) = 1.0; // Shaders below only needed for adaptive quality level NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy); @@ -40,11 +40,11 @@ void main() float retVal = mix( maxVal, avgVal, cSmoothenImportance ); - // sum the average; to avoid overflowing we assume max AO resolution is not bigger than 16384x16384; so quarter res (used here) will be 4096x4096, which leaves us with 8 bits per pixel + // sum the average; to avoid overflowing we assume max AO resolution is not bigger than 16384x16384; so quarter res (used here) will be 4096x4096, which leaves us with 8 bits per pixel uint sum = uint(saturate(retVal) * 255.0 + 0.5); - + // save every 9th to avoid InterlockedAdd congestion - since we're blurring, this is good enough; compensated by multiplying LoadCounterAvgDiv by 9 -#if BGFX_SHADER_LANGUAGE_GLSL +#if BGFX_SHADER_LANGUAGE_GLSL if( ((dtID.x % 3) + ((dim.y-1-dtID.y) % 3)) == 0 ) #else if( ((dtID.x % 3) + (dtID.y % 3)) == 0 ) diff --git a/bgfx/examples/39-assao/cs_assao_prepare_depth_mip.sc b/bgfx/examples/39-assao/cs_assao_prepare_depth_mip.sc index c033bc79..70cae37a 100644 --- a/bgfx/examples/39-assao/cs_assao_prepare_depth_mip.sc +++ b/bgfx/examples/39-assao/cs_assao_prepare_depth_mip.sc @@ -3,18 +3,18 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_RO(s_viewspaceDepthSource0, r16f, 0); +IMAGE2D_RO(s_viewspaceDepthSource0, r16f, 0); IMAGE2D_RO(s_viewspaceDepthSource1, r16f, 1); IMAGE2D_RO(s_viewspaceDepthSource2, r16f, 2); IMAGE2D_RO(s_viewspaceDepthSource3, r16f, 3); -IMAGE2D_WR(s_target0, r16f, 4); -IMAGE2D_WR(s_target1, r16f, 5); -IMAGE2D_WR(s_target2, r16f, 6); -IMAGE2D_WR(s_target3, r16f, 7); +IMAGE2D_WO(s_target0, r16f, 4); +IMAGE2D_WO(s_target1, r16f, 5); +IMAGE2D_WO(s_target2, r16f, 6); +IMAGE2D_WO(s_target3, r16f, 7); // calculate effect radius and fit our screen sampling pattern inside it void CalculateRadiusParameters( const float pixCenterLength, const vec2 pixelDirRBViewspaceSizeAtCenterZ, out float pixLookupRadiusMod, out float effectRadius, out float falloffCalcMulSq ) @@ -26,7 +26,7 @@ void CalculateRadiusParameters( const float pixCenterLength, const vec2 pixelDir // when too close, on-screen sampling disk will grow beyond screen size; limit this to avoid closeup temporal artifacts const float tooCloseLimitMod = saturate( pixCenterLength * u_effectSamplingRadiusNearLimitRec ) * 0.8 + 0.2; - + effectRadius *= tooCloseLimitMod; // 0.85 is to reduce the radius to allow for more samples on a slope to still stay within influence @@ -37,13 +37,13 @@ void CalculateRadiusParameters( const float pixCenterLength, const vec2 pixelDir } NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy); uvec2 dim = uvec2(u_rect.zw); if (all(lessThan(dtID.xy, dim) ) ) - { + { ivec2 baseCoords = ivec2(dtID.xy) * 2; vec4 depthsArr[4]; @@ -66,14 +66,14 @@ void main() depthsArr[3].y = imageLoad(s_viewspaceDepthSource3, baseCoords + ivec2( 1, 0 )).x; depthsArr[3].z = imageLoad(s_viewspaceDepthSource3, baseCoords + ivec2( 0, 1 )).x; depthsArr[3].w = imageLoad(s_viewspaceDepthSource3, baseCoords + ivec2( 1, 1 )).x; - + const uvec2 SVPosui = uvec2( dtID.xy ); const uint pseudoRandomA = (SVPosui.x ) + 2 * (SVPosui.y ); float dummyUnused1; float dummyUnused2; float falloffCalcMulSq, falloffCalcAdd; - + UNROLL for( int i = 0; i < 4; i++ ) { diff --git a/bgfx/examples/39-assao/cs_assao_prepare_depths.sc b/bgfx/examples/39-assao/cs_assao_prepare_depths.sc index 0b43c0e1..26e1b371 100644 --- a/bgfx/examples/39-assao/cs_assao_prepare_depths.sc +++ b/bgfx/examples/39-assao/cs_assao_prepare_depths.sc @@ -3,15 +3,15 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" SAMPLER2D(s_depthSource, 0); -IMAGE2D_WR(s_target0, r16f, 1); -IMAGE2D_WR(s_target1, r16f, 2); -IMAGE2D_WR(s_target2, r16f, 3); -IMAGE2D_WR(s_target3, r16f, 4); +IMAGE2D_WO(s_target0, r16f, 1); +IMAGE2D_WO(s_target1, r16f, 2); +IMAGE2D_WO(s_target2, r16f, 3); +IMAGE2D_WO(s_target3, r16f, 4); float ScreenSpaceToViewSpaceDepth( float screenDepth ) { @@ -29,15 +29,15 @@ float ScreenSpaceToViewSpaceDepth( float screenDepth ) NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy); uvec2 dim = imageSize(s_target0).xy; if (all(lessThan(dtID.xy, dim) ) ) - { + { ivec2 baseCoord = ivec2(dtID.xy) * 2; -#if BGFX_SHADER_LANGUAGE_GLSL +#if BGFX_SHADER_LANGUAGE_GLSL float a = texelFetch(s_depthSource, baseCoord + ivec2( 0, 1 ), 0).x; float b = texelFetch(s_depthSource, baseCoord + ivec2( 1, 1 ), 0).x; float c = texelFetch(s_depthSource, baseCoord + ivec2( 0, 0 ), 0).x; @@ -55,4 +55,3 @@ void main() imageStore(s_target3, ivec2(dtID.xy), ScreenSpaceToViewSpaceDepth( d ).xxxx); } } - diff --git a/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals.sc b/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals.sc index 836a0543..b952828b 100644 --- a/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals.sc +++ b/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals.sc @@ -3,16 +3,16 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" SAMPLER2D(s_depthSource, 0); -IMAGE2D_WR(s_target0, r16f, 1); -IMAGE2D_WR(s_target1, r16f, 2); -IMAGE2D_WR(s_target2, r16f, 3); -IMAGE2D_WR(s_target3, r16f, 4); -IMAGE2D_WR(s_normalsOutputUAV, rgba8, 5); +IMAGE2D_WO(s_target0, r16f, 1); +IMAGE2D_WO(s_target1, r16f, 2); +IMAGE2D_WO(s_target2, r16f, 3); +IMAGE2D_WO(s_target3, r16f, 4); +IMAGE2D_WO(s_normalsOutputUAV, rgba8, 5); float ScreenSpaceToViewSpaceDepth( float screenDepth ) { @@ -68,12 +68,12 @@ vec3 CalculateNormal( const vec4 edgesLRTB, vec3 pixCenterPos, vec3 pixLPos, vec pixelNormal += ( acceptedNormals.z ) * cross( pixRPos, pixBPos ); pixelNormal += ( acceptedNormals.w ) * cross( pixBPos, pixLPos ); pixelNormal = normalize( pixelNormal ); - + return pixelNormal; } NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy); @@ -114,12 +114,12 @@ void main() #if BGFX_SHADER_LANGUAGE_GLSL // left 2 - pixZs[0][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 0 ) ).x ); - pixZs[0][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, -1 ) ).x ); + pixZs[0][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 0 ) ).x ); + pixZs[0][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, -1 ) ).x ); // right 2 - pixZs[3][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 0 ) ).x ); - pixZs[3][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, -1 ) ).x ); + pixZs[3][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 0 ) ).x ); + pixZs[3][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, -1 ) ).x ); // top 2 pixZs[1][0] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 0, 1 ) ).x ); @@ -130,11 +130,11 @@ void main() pixZs[2][3] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 1, -2 ) ).x ); #else // left 2 - pixZs[0][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 0 ) ).x ); - pixZs[0][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 1 ) ).x ); + pixZs[0][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 0 ) ).x ); + pixZs[0][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 1 ) ).x ); // right 2 - pixZs[3][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 0 ) ).x ); - pixZs[3][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 1 ) ).x ); + pixZs[3][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 0 ) ).x ); + pixZs[3][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 1 ) ).x ); // top 2 pixZs[1][0] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 0, -1 ) ).x ); pixZs[2][0] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 1, -1 ) ).x ); @@ -162,13 +162,13 @@ void main() // left 2 pixPos[0][1] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( -1.0, 0.0), pixZs[0][1] ); pixPos[0][2] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( -1.0, 1.0), pixZs[0][2] ); - // right 2 + // right 2 pixPos[3][1] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 2.0, 0.0), pixZs[3][1] ); pixPos[3][2] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 2.0, 1.0), pixZs[3][2] ); - // top 2 + // top 2 pixPos[1][0] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 0.0, -1.0 ), pixZs[1][0] ); pixPos[2][0] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 1.0, -1.0 ), pixZs[2][0] ); - // bottom 2 + // bottom 2 pixPos[1][3] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 0.0, 2.0 ), pixZs[1][3] ); pixPos[2][3] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 1.0, 2.0 ), pixZs[2][3] ); diff --git a/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals_half.sc b/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals_half.sc index 279de719..390c8b4e 100644 --- a/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals_half.sc +++ b/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals_half.sc @@ -3,14 +3,14 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" SAMPLER2D(s_depthSource, 0); -IMAGE2D_WR(s_target0, r16f, 1); -IMAGE2D_WR(s_target1, r16f, 2); -IMAGE2D_WR(s_normalsOutputUAV, rgba8, 5); +IMAGE2D_WO(s_target0, r16f, 1); +IMAGE2D_WO(s_target1, r16f, 2); +IMAGE2D_WO(s_normalsOutputUAV, rgba8, 5); float ScreenSpaceToViewSpaceDepth( float screenDepth ) { @@ -66,12 +66,12 @@ vec3 CalculateNormal( const vec4 edgesLRTB, vec3 pixCenterPos, vec3 pixLPos, vec pixelNormal += ( acceptedNormals.z ) * cross( pixRPos, pixBPos ); pixelNormal += ( acceptedNormals.w ) * cross( pixBPos, pixLPos ); pixelNormal = normalize( pixelNormal ); - + return pixelNormal; } NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy); @@ -110,12 +110,12 @@ void main() pixZs[2][2] = z3; #if BGFX_SHADER_LANGUAGE_GLSL // left 2 - pixZs[0][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 0 ) ).x ); - pixZs[0][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, -1 ) ).x ); + pixZs[0][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 0 ) ).x ); + pixZs[0][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, -1 ) ).x ); // right 2 - pixZs[3][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 0 ) ).x ); - pixZs[3][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, -1 ) ).x ); + pixZs[3][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 0 ) ).x ); + pixZs[3][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, -1 ) ).x ); // top 2 pixZs[1][0] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 0, 1 ) ).x ); @@ -126,12 +126,12 @@ void main() pixZs[2][3] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 1, -2 ) ).x ); #else // left 2 - pixZs[0][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 0 ) ).x ); - pixZs[0][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 1 ) ).x ); + pixZs[0][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 0 ) ).x ); + pixZs[0][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( -1, 1 ) ).x ); // right 2 - pixZs[3][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 0 ) ).x ); - pixZs[3][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 1 ) ).x ); + pixZs[3][1] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 0 ) ).x ); + pixZs[3][2] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 2, 1 ) ).x ); // top 2 pixZs[1][0] = ScreenSpaceToViewSpaceDepth( texture2DLodOffset(s_depthSource, upperLeftUV, 0.0, ivec2( 0, -1 ) ).x ); @@ -164,13 +164,13 @@ void main() // left 2 pixPos[0][1] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( -1.0, 0.0), pixZs[0][1] ); //pixPos[0][2] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( -1.0, 1.0), pixZs[0][2] ); - // right 2 + // right 2 //pixPos[3][1] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 2.0, 0.0), pixZs[3][1] ); pixPos[3][2] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 2.0, 1.0), pixZs[3][2] ); - // top 2 + // top 2 pixPos[1][0] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 0.0, -1.0 ), pixZs[1][0] ); //pixPos[2][0] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 1.0, -1.0 ), pixZs[2][0] ); - // bottom 2 + // bottom 2 //pixPos[1][3] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 0.0, 2.0 ), pixZs[1][3] ); pixPos[2][3] = NDCToViewspace( upperLeftUV + viewportPixelSize * vec2( 1.0, 2.0 ), pixZs[2][3] ); diff --git a/bgfx/examples/39-assao/cs_assao_prepare_depths_half.sc b/bgfx/examples/39-assao/cs_assao_prepare_depths_half.sc index 83b913af..8a4c1dda 100644 --- a/bgfx/examples/39-assao/cs_assao_prepare_depths_half.sc +++ b/bgfx/examples/39-assao/cs_assao_prepare_depths_half.sc @@ -3,12 +3,12 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" SAMPLER2D(s_depthSource, 0); -IMAGE2D_WR(s_target0, r16f, 1); -IMAGE2D_WR(s_target1, r16f, 2); +IMAGE2D_WO(s_target0, r16f, 1); +IMAGE2D_WO(s_target1, r16f, 2); float ScreenSpaceToViewSpaceDepth( float screenDepth ) { @@ -25,7 +25,7 @@ float ScreenSpaceToViewSpaceDepth( float screenDepth ) } NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy); @@ -33,7 +33,7 @@ void main() if (all(lessThan(dtID.xy, dim) ) ) { ivec2 baseCoord = ivec2(dtID.xy) * 2; -#if BGFX_SHADER_LANGUAGE_GLSL +#if BGFX_SHADER_LANGUAGE_GLSL float a = texelFetch(s_depthSource, baseCoord + ivec2( 0, 1 ), 0).x; float d = texelFetch(s_depthSource, baseCoord + ivec2( 1, 0 ), 0).x; #else @@ -45,4 +45,3 @@ void main() imageStore(s_target1, ivec2(dtID.xy), ScreenSpaceToViewSpaceDepth( d ).xxxx); } } - diff --git a/bgfx/examples/39-assao/cs_assao_smart_blur.sc b/bgfx/examples/39-assao/cs_assao_smart_blur.sc index 5ddf435f..7cf4722b 100644 --- a/bgfx/examples/39-assao/cs_assao_smart_blur.sc +++ b/bgfx/examples/39-assao/cs_assao_smart_blur.sc @@ -3,10 +3,10 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_ARRAY_WR(s_target, rg8, 0); +IMAGE2D_ARRAY_WO(s_target, rg8, 0); SAMPLER2DARRAY(s_blurInput, 1); // unpacking for edges; 2 bits per edge mean 4 gradient values (0, 0.33, 0.66, 1) for smoother transitions! @@ -27,7 +27,7 @@ vec4 UnpackEdges( float _packedVal ) void AddSample( float ssaoValue, float edgeValue, inout float sum, inout float sumWeight ) { - float weight = edgeValue; + float weight = edgeValue; sum += (weight * ssaoValue); sumWeight += weight; @@ -70,7 +70,7 @@ vec2 SampleBlurred( ivec2 inPos, vec2 coord ) // edge-sensitive blur NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy) + uvec2(u_rect.xy); if (all(lessThan(dtID.xy, u_rect.zw) ) ) @@ -79,4 +79,3 @@ void main() imageStore(s_target, ivec3(dtID.xy, u_layer), SampleBlurred( ivec2(dtID.xy), inUV ).xyyy); } } - diff --git a/bgfx/examples/39-assao/cs_assao_smart_blur_wide.sc b/bgfx/examples/39-assao/cs_assao_smart_blur_wide.sc index e6752700..70c81cd2 100644 --- a/bgfx/examples/39-assao/cs_assao_smart_blur_wide.sc +++ b/bgfx/examples/39-assao/cs_assao_smart_blur_wide.sc @@ -3,10 +3,10 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#include "bgfx_compute.sh" +#include "bgfx_compute.sh" #include "uniforms.sh" -IMAGE2D_ARRAY_WR(s_target, rg8, 0); +IMAGE2D_ARRAY_WO(s_target, rg8, 0); SAMPLER2DARRAY(s_blurInput, 1); // unpacking for edges; 2 bits per edge mean 4 gradient values (0, 0.33, 0.66, 1) for smoother transitions! @@ -27,7 +27,7 @@ vec4 UnpackEdges( float _packedVal ) void AddSample( float ssaoValue, float edgeValue, inout float sum, inout float sumWeight ) { - float weight = edgeValue; + float weight = edgeValue; sum += (weight * ssaoValue); sumWeight += weight; @@ -71,7 +71,7 @@ vec2 SampleBlurredWide(vec3 coord) // edge-sensitive blur (wider kernel) NUM_THREADS(8, 8, 1) -void main() +void main() { uvec2 dtID = uvec2(gl_GlobalInvocationID.xy) + uvec2(u_rect.xy); if (all(lessThan(dtID.xy, u_rect.zw) ) ) @@ -80,4 +80,3 @@ void main() imageStore(s_target, ivec3(dtID.xy,u_layer), SampleBlurredWide(vec3(inUV,0.0)).xyyy); } } - diff --git a/bgfx/examples/39-assao/fs_assao_deferred_combine.sc b/bgfx/examples/39-assao/fs_assao_deferred_combine.sc index e12d58ee..c660df37 100644 --- a/bgfx/examples/39-assao/fs_assao_deferred_combine.sc +++ b/bgfx/examples/39-assao/fs_assao_deferred_combine.sc @@ -29,7 +29,7 @@ void main() // Expand out normal n = n*2.0-1.0; vec3 l = normalize(vec3(-0.8,0.75,-1.0)); - light = max(0.0,dot(n,l)) * 1.2+ 0.3; + light = max(0.0,dot(n,l)) * 1.2+ 0.3; } float ao = 1.0; @@ -39,5 +39,4 @@ void main() } gl_FragColor = vec4(albedoColor * light * ao, 1.0f); -} - \ No newline at end of file +} diff --git a/bgfx/examples/39-assao/makefile b/bgfx/examples/39-assao/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/39-assao/makefile +++ b/bgfx/examples/39-assao/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/39-assao/uniforms.sh b/bgfx/examples/39-assao/uniforms.sh index 5cedd7a4..585262b9 100644 --- a/bgfx/examples/39-assao/uniforms.sh +++ b/bgfx/examples/39-assao/uniforms.sh @@ -1,8 +1,8 @@ uniform vec4 u_params[19]; uniform vec4 u_rect; -#define u_viewportPixelSize u_params[0].xy -#define u_halfViewportPixelSize u_params[0].zw +#define u_viewportPixelSize u_params[0].xy +#define u_halfViewportPixelSize u_params[0].zw #define u_depthUnpackConsts u_params[1].xy #define u_ndcToViewMul u_params[2].xy #define u_ndcToViewAdd u_params[2].zw diff --git a/bgfx/examples/39-assao/varying.def.sc b/bgfx/examples/39-assao/varying.def.sc index 8471e5e5..53b7528d 100644 --- a/bgfx/examples/39-assao/varying.def.sc +++ b/bgfx/examples/39-assao/varying.def.sc @@ -3,5 +3,4 @@ vec2 a_texcoord0 : TEXCOORD0; vec3 a_normal : NORMAL; vec2 v_texcoord0 : TEXCOORD0; -vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0); - +vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0); diff --git a/bgfx/examples/39-assao/vs_assao.sc b/bgfx/examples/39-assao/vs_assao.sc index a4eb7999..f9b88efc 100644 --- a/bgfx/examples/39-assao/vs_assao.sc +++ b/bgfx/examples/39-assao/vs_assao.sc @@ -11,6 +11,5 @@ $output v_texcoord0 void main() { gl_Position = mul(u_modelViewProj, vec4(a_position.xyz, 1.0) ); - v_texcoord0 = a_texcoord0; + v_texcoord0 = a_texcoord0; } - diff --git a/bgfx/examples/39-assao/vs_assao_gbuffer.sc b/bgfx/examples/39-assao/vs_assao_gbuffer.sc index e9662e61..d71a21bd 100644 --- a/bgfx/examples/39-assao/vs_assao_gbuffer.sc +++ b/bgfx/examples/39-assao/vs_assao_gbuffer.sc @@ -18,7 +18,7 @@ void main() // Calculate normal. Note that compressed normal is stored in the vertices vec3 normalObjectSpace = a_normal.xyz*2.0+-1.0; // Normal is stored in [0,1], remap to [-1,1]. - // Transform normal into world space. + // Transform normal into world space. vec3 normalWorldSpace = mul(u_model[0], vec4(normalObjectSpace, 0.0) ).xyz; // Normalize to remove (uniform...) scaling, however, recompress v_normal.xyz = normalize(normalWorldSpace)*0.5+0.5; diff --git a/bgfx/examples/40-svt/fs_vt_mip.sc b/bgfx/examples/40-svt/fs_vt_mip.sc index 5d79b6c6..aea08c13 100644 --- a/bgfx/examples/40-svt/fs_vt_mip.sc +++ b/bgfx/examples/40-svt/fs_vt_mip.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -20,5 +20,5 @@ void main() float mip = floor(MipLevel(v_texcoord0.xy, VirtualTextureSize) - MipBias); mip = clamp(mip, 0, mipCount); vec2 offset = floor(v_texcoord0.xy * PageTableSize); - gl_FragColor = vec4(floor(vec3(offset / exp2(mip), mip)) / 255.0, 1.0); + gl_FragColor = vec4(floor(vec3(offset / exp2(mip), mip)) / 255.0, 1.0); } diff --git a/bgfx/examples/40-svt/fs_vt_unlit.sc b/bgfx/examples/40-svt/fs_vt_unlit.sc index 1ee16116..68ee664b 100644 --- a/bgfx/examples/40-svt/fs_vt_unlit.sc +++ b/bgfx/examples/40-svt/fs_vt_unlit.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -9,8 +9,8 @@ $input v_texcoord0 * Reference(s): * - Based on Virtual Texture Demo by Brad Blanchard * http://web.archive.org/web/20190103162638/http://linedef.com/virtual-texture-demo.html - */ - + */ + #include "../common/common.sh" #include "virtualtexture.sh" @@ -18,4 +18,3 @@ void main() { gl_FragColor = VirtualTexture(v_texcoord0.xy); } - diff --git a/bgfx/examples/40-svt/makefile b/bgfx/examples/40-svt/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/40-svt/makefile +++ b/bgfx/examples/40-svt/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/40-svt/svt.cpp b/bgfx/examples/40-svt/svt.cpp index 3256f649..cde5f01a 100644 --- a/bgfx/examples/40-svt/svt.cpp +++ b/bgfx/examples/40-svt/svt.cpp @@ -82,7 +82,7 @@ class ExampleSVT : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/40-svt/virtualtexture.sh b/bgfx/examples/40-svt/virtualtexture.sh index f0ffde2e..e1253700 100644 --- a/bgfx/examples/40-svt/virtualtexture.sh +++ b/bgfx/examples/40-svt/virtualtexture.sh @@ -1,8 +1,8 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ - + /* * Reference(s): * - Based on Virtual Texture Demo by Brad Blanchard @@ -33,8 +33,8 @@ float MipLevel( vec2 uv, float size ) return max( 0.5 * log2( d ), 0 ); } -// This function samples the page table and returns the page's -// position and mip level. +// This function samples the page table and returns the page's +// position and mip level. vec3 SampleTable( vec2 uv, float mip ) { vec2 offset = fract( uv * PageTableSize ) / PageTableSize; diff --git a/bgfx/examples/40-svt/vs_vt_generic.sc b/bgfx/examples/40-svt/vs_vt_generic.sc index 997b8698..f0ebc339 100644 --- a/bgfx/examples/40-svt/vs_vt_generic.sc +++ b/bgfx/examples/40-svt/vs_vt_generic.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/40-svt/vt.cpp b/bgfx/examples/40-svt/vt.cpp index cabc06c4..0e599cb7 100644 --- a/bgfx/examples/40-svt/vt.cpp +++ b/bgfx/examples/40-svt/vt.cpp @@ -1263,7 +1263,7 @@ bool TileGenerator::generate(const bx::FilePath& _filePath) } } - bx::debugPrintf("Finising\n"); + bx::debugPrintf("Finishing\n"); // Write header m_tileDataFile->writeInfo(); // Close tile file diff --git a/bgfx/examples/41-tess/cs_terrain_init.sc b/bgfx/examples/41-tess/cs_terrain_init.sc index b15f2397..1652b2ad 100644 --- a/bgfx/examples/41-tess/cs_terrain_init.sc +++ b/bgfx/examples/41-tess/cs_terrain_init.sc @@ -2,11 +2,11 @@ #include "uniforms.sh" -BUFFER_WR(u_SubdBufferOut, uint, 1); +BUFFER_WO(u_SubdBufferOut, uint, 1); BUFFER_RW(u_CulledSubdBuffer, uint, 2); BUFFER_RW(indirectBuffer, uvec4, 3); BUFFER_RW(atomicCounterBuffer, uint, 4); -BUFFER_WR(u_SubdBufferIn, uint, 8); +BUFFER_WO(u_SubdBufferIn, uint, 8); NUM_THREADS(1u, 1u, 1u) void main() diff --git a/bgfx/examples/41-tess/makefile b/bgfx/examples/41-tess/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/41-tess/makefile +++ b/bgfx/examples/41-tess/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/41-tess/tess.cpp b/bgfx/examples/41-tess/tess.cpp index 8f0ef164..e92d22be 100644 --- a/bgfx/examples/41-tess/tess.cpp +++ b/bgfx/examples/41-tess/tess.cpp @@ -339,7 +339,7 @@ class ExampleTessellation : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/41-tess/uniforms.sh b/bgfx/examples/41-tess/uniforms.sh index 38fe7820..358948ad 100644 --- a/bgfx/examples/41-tess/uniforms.sh +++ b/bgfx/examples/41-tess/uniforms.sh @@ -11,5 +11,3 @@ uniform vec4 u_params[2]; #define COMPUTE_THREAD_COUNT 32u #define UPDATE_INDIRECT_VALUE_DIVIDE 32u - - diff --git a/bgfx/examples/42-bunnylod/bunnylod.cpp b/bgfx/examples/42-bunnylod/bunnylod.cpp index 4bfbbf90..091be446 100644 --- a/bgfx/examples/42-bunnylod/bunnylod.cpp +++ b/bgfx/examples/42-bunnylod/bunnylod.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -68,11 +68,15 @@ class ExampleBunnyLOD : public entry::AppI static void remapIndices(uint32_t* _indices, uint32_t _num) { uint32_t target = 0; - for (uint32_t i = 0; i < _num; i++) { + for (uint32_t i = 0; i < _num; i++) + { uint32_t map = _indices[i]; - if (i != map) { + if (i != map) + { _indices[i] = _indices[map]; - } else { + } + else + { _indices[i] = target; ++target; } @@ -264,7 +268,7 @@ class ExampleBunnyLOD : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/42-bunnylod/fs_bunnylod.sc b/bgfx/examples/42-bunnylod/fs_bunnylod.sc index 07feb33b..cfeb74f3 100644 --- a/bgfx/examples/42-bunnylod/fs_bunnylod.sc +++ b/bgfx/examples/42-bunnylod/fs_bunnylod.sc @@ -1,7 +1,7 @@ $input v_world, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/42-bunnylod/makefile b/bgfx/examples/42-bunnylod/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/42-bunnylod/makefile +++ b/bgfx/examples/42-bunnylod/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/42-bunnylod/progmesh.c b/bgfx/examples/42-bunnylod/progmesh.c index 2738c099..ca2a3dc0 100644 --- a/bgfx/examples/42-bunnylod/progmesh.c +++ b/bgfx/examples/42-bunnylod/progmesh.c @@ -50,7 +50,7 @@ struct triangle { int vertex[3]; // the 3 points (id) that make this tri - float normal[3]; // unit vector othogonal to this face + float normal[3]; // unit vector orthogonal to this face }; struct array { diff --git a/bgfx/examples/42-bunnylod/vs_bunnylod.sc b/bgfx/examples/42-bunnylod/vs_bunnylod.sc index d40fc67c..08458e99 100644 --- a/bgfx/examples/42-bunnylod/vs_bunnylod.sc +++ b/bgfx/examples/42-bunnylod/vs_bunnylod.sc @@ -2,7 +2,7 @@ $input a_position, a_normal $output v_world, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/43-denoise/denoise.cpp b/bgfx/examples/43-denoise/denoise.cpp index f9ff556a..2216cb14 100644 --- a/bgfx/examples/43-denoise/denoise.cpp +++ b/bgfx/examples/43-denoise/denoise.cpp @@ -160,7 +160,7 @@ struct RenderTarget bgfx::FrameBufferHandle m_buffer; }; -void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) +void screenSpaceQuad(bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout) ) { @@ -173,15 +173,13 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf const float miny = 0.0f; const float maxy = _height * 2.0f; - const float texelHalfW = _texelHalf / _textureWidth; - const float texelHalfH = _texelHalf / _textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfW; + const float minu = -1.0f; + const float maxu = 1.0f; const float zz = 0.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -235,7 +233,6 @@ class ExampleDenoise : public entry::AppI ExampleDenoise(const char* _name, const char* _description) : entry::AppI(_name, _description) , m_currFrame(UINT32_MAX) - , m_texelHalf(0.0f) { } @@ -253,7 +250,7 @@ class ExampleDenoise : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -329,10 +326,6 @@ class ExampleDenoise : public entry::AppI // Track whether previous results are valid m_havePrevious = false; - // Get renderer capabilities info. - const bgfx::RendererType::Enum renderer = bgfx::getRendererType(); - m_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f; - imguiCreate(); } @@ -480,7 +473,7 @@ class ExampleDenoise : public entry::AppI m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_combineProgram); @@ -512,7 +505,7 @@ class ExampleDenoise : public entry::AppI m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_denoiseTemporalProgram); @@ -534,7 +527,7 @@ class ExampleDenoise : public entry::AppI m_temporaryColor.m_buffer, m_currentColor.m_buffer, }; - BX_STATIC_ASSERT(BX_COUNTOF(destBuffer) == DENOISE_MAX_PASSES); + static_assert(BX_COUNTOF(destBuffer) == DENOISE_MAX_PASSES); const uint32_t denoisePasses = bx::min(DENOISE_MAX_PASSES, m_denoisePasses); @@ -558,7 +551,7 @@ class ExampleDenoise : public entry::AppI m_uniforms.m_denoiseStep = denoiseStepScale; m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); const bgfx::ProgramHandle spatialProgram = (0 == m_spatialSampleType) ? m_denoiseSpatialProgram3x3 @@ -593,7 +586,7 @@ class ExampleDenoise : public entry::AppI bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_DEPTH_TEST_ALWAYS); bgfx::setTexture(0, s_color, lastTex); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_copyProgram); ++view; @@ -620,7 +613,7 @@ class ExampleDenoise : public entry::AppI bgfx::setTexture(1, s_albedo, m_gbufferTex[GBUFFER_RT_COLOR]); m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_denoiseApplyLighting); ++view; @@ -651,7 +644,7 @@ class ExampleDenoise : public entry::AppI bgfx::setTexture(3, s_depth, m_gbufferTex[GBUFFER_RT_DEPTH]); m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_txaaProgram); ++view; @@ -671,7 +664,7 @@ class ExampleDenoise : public entry::AppI ); bgfx::setTexture(0, s_color, m_txaaColor.m_texture); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_copyProgram); ++view; @@ -691,7 +684,7 @@ class ExampleDenoise : public entry::AppI ); bgfx::setTexture(0, s_color, m_txaaColor.m_texture); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_copyProgram); ++view; @@ -718,7 +711,7 @@ class ExampleDenoise : public entry::AppI ); bgfx::setTexture(0, s_color, lastTex); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_copyProgram); ++view; @@ -734,7 +727,7 @@ class ExampleDenoise : public entry::AppI bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_DEPTH_TEST_ALWAYS); bgfx::setTexture(0, s_color, m_gbufferTex[GBUFFER_RT_NORMAL]); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_copyProgram); ++view; @@ -1095,7 +1088,6 @@ class ExampleDenoise : public entry::AppI bgfx::TextureHandle m_normalTexture; uint32_t m_currFrame; - float m_texelHalf = 0.0f; float m_fovY = 60.0f; bool m_recreateFrameBuffers = false; bool m_havePrevious = false; diff --git a/bgfx/examples/43-denoise/fs_denoise_spatial_implementation.sh b/bgfx/examples/43-denoise/fs_denoise_spatial_implementation.sh index e04a91bb..7c6fd222 100644 --- a/bgfx/examples/43-denoise/fs_denoise_spatial_implementation.sh +++ b/bgfx/examples/43-denoise/fs_denoise_spatial_implementation.sh @@ -74,7 +74,7 @@ void main() vec4 sampleColor = texture2D(s_color, sampleTexCoord); vec3 sampleNormal = NormalDecode(texture2D(s_normal, sampleTexCoord).xyz); float normalWeight = pow(saturate(dot(normal, sampleNormal)), u_sigmaNormal); - + float sampleDepth = texture2D(s_depth, sampleTexCoord).x; float depthDelta = depth - sampleDepth; float depthWeight = exp(-abs(depthDelta) / max(1e-5, u_sigmaDepth*u_sigmaDepth)); diff --git a/bgfx/examples/43-denoise/fs_denoise_txaa.sc b/bgfx/examples/43-denoise/fs_denoise_txaa.sc index d4cdc82e..e2d8cd66 100644 --- a/bgfx/examples/43-denoise/fs_denoise_txaa.sc +++ b/bgfx/examples/43-denoise/fs_denoise_txaa.sc @@ -39,7 +39,7 @@ vec3 FindNearestDepth(sampler2D _depthSampler, vec2 _texCoord) { vec3 tcd7 = vec3(coord, texture2D(_depthSampler, coord).x); coord = _texCoord + du + dv; vec3 tcd8 = vec3(coord, texture2D(_depthSampler, coord).x); - + vec3 minTcd = tcd0; if (tcd1.z < minTcd.z) minTcd = tcd1; if (tcd2.z < minTcd.z) minTcd = tcd2; @@ -86,7 +86,7 @@ void main() vec2 texCoordPrev = GetTexCoordPrevious(texCoord, velocity); vec3 colorPrev = texture2D(s_previousColor, texCoordPrev).xyz; - + // Sample local neighborhood for variance clipping vec2 du = vec2(u_viewTexel.x, 0.0); vec2 dv = vec2(0.0, u_viewTexel.y); diff --git a/bgfx/examples/43-denoise/normal_encoding.sh b/bgfx/examples/43-denoise/normal_encoding.sh index 231cdae0..c55c12dc 100644 --- a/bgfx/examples/43-denoise/normal_encoding.sh +++ b/bgfx/examples/43-denoise/normal_encoding.sh @@ -46,7 +46,7 @@ vec2 float32x3_to_oct(vec3 v) { // Project the sphere onto the octahedron, and then onto the xy plane vec2 p = v.xy * (1.0 / (abs(v.x) + abs(v.y) + abs(v.z))); - + // Reflect the folds of the lower hemisphere over the diagonals return (v.z <= 0.0) ? ((1.0 - abs(p.yx)) * signNotZero(p)) : p; } diff --git a/bgfx/examples/44-sss/fs_sss_gbuffer.sc b/bgfx/examples/44-sss/fs_sss_gbuffer.sc index 54c50929..fd72857b 100644 --- a/bgfx/examples/44-sss/fs_sss_gbuffer.sc +++ b/bgfx/examples/44-sss/fs_sss_gbuffer.sc @@ -22,7 +22,7 @@ mat3 cotangentFrame(vec3 N, vec3 p, vec2 uv) vec3 dp1perp = cross(N, dp1); vec3 T = dp2perp * duv1.x + dp1perp * duv2.x; vec3 B = dp2perp * duv1.y + dp1perp * duv2.y; - + // construct a scale-invariant frame float invMax = inversesqrt(max(dot(T,T), dot(B,B))); return mat3(T*invMax, B*invMax, N); @@ -34,13 +34,13 @@ void main() // get vertex normal vec3 normal = normalize(v_normal); - + // get normal map normal, unpack, and calculate z vec3 normalMap; normalMap.xy = texture2D(s_normal, v_texcoord0).xy; normalMap.xy = normalMap.xy * 2.0 - 1.0; normalMap.z = sqrt(1.0 - dot(normalMap.xy, normalMap.xy)); - + // swap x and y, because the brick texture looks flipped, don't copy this... normalMap.xy = normalMap.yx; @@ -48,7 +48,7 @@ void main() vec3 pos = v_texcoord1.xyz; // contains world space pos mat3 TBN = cotangentFrame(normal, pos, v_texcoord0); vec3 bumpedNormal = normalize(instMul(TBN, normalMap)); - + // need some proxy for roughness value w/o roughness texture // assume horizontal (blue) normal map is smooth, and then // modulate with albedo for some higher frequency detail diff --git a/bgfx/examples/44-sss/normal_encoding.sh b/bgfx/examples/44-sss/normal_encoding.sh index c83b9575..f56c075f 100644 --- a/bgfx/examples/44-sss/normal_encoding.sh +++ b/bgfx/examples/44-sss/normal_encoding.sh @@ -46,7 +46,7 @@ vec2 float32x3_to_oct(vec3 v) { // Project the sphere onto the octahedron, and then onto the xy plane vec2 p = v.xy * (1.0 / (abs(v.x) + abs(v.y) + abs(v.z))); - + // Reflect the folds of the lower hemisphere over the diagonals return (v.z <= 0.0) ? ((1.0 - abs(p.yx)) * signNotZero(p)) : p; } diff --git a/bgfx/examples/44-sss/screen_space_shadows.cpp b/bgfx/examples/44-sss/screen_space_shadows.cpp index 1bf85b0e..c32c6f10 100644 --- a/bgfx/examples/44-sss/screen_space_shadows.cpp +++ b/bgfx/examples/44-sss/screen_space_shadows.cpp @@ -172,7 +172,7 @@ struct RenderTarget bgfx::FrameBufferHandle m_buffer; }; -void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) +void screenSpaceQuad(bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout)) { @@ -185,15 +185,13 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf const float miny = 0.0f; const float maxy = _height * 2.0f; - const float texelHalfW = _texelHalf / _textureWidth; - const float texelHalfH = _texelHalf / _textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfW; + const float minu = -1.0f; + const float maxu = 1.0f; const float zz = 0.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -247,7 +245,6 @@ class ExampleScreenSpaceShadows : public entry::AppI ExampleScreenSpaceShadows(const char* _name, const char* _description) : entry::AppI(_name, _description) , m_currFrame(UINT32_MAX) - , m_texelHalf(0.0f) { } @@ -265,7 +262,7 @@ class ExampleScreenSpaceShadows : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -336,10 +333,6 @@ class ExampleScreenSpaceShadows : public entry::AppI // Track whether previous results are valid m_havePrevious = false; - // Get renderer capabilities info. - const bgfx::RendererType::Enum renderer = bgfx::getRendererType(); - m_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f; - imguiCreate(); } @@ -502,7 +495,7 @@ class ExampleScreenSpaceShadows : public entry::AppI ); bgfx::setTexture(0, s_depth, m_gbufferTex[GBUFFER_RT_DEPTH]); m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_linearDepthProgram); ++view; } @@ -521,7 +514,7 @@ class ExampleScreenSpaceShadows : public entry::AppI ); bgfx::setTexture(0, s_depth, m_linearDepth.m_texture); m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_shadowsProgram); ++view; } @@ -543,7 +536,7 @@ class ExampleScreenSpaceShadows : public entry::AppI bgfx::setTexture(2, s_depth, m_linearDepth.m_texture); bgfx::setTexture(3, s_shadows, m_shadows.m_texture); m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_combineProgram); ++view; } @@ -818,7 +811,6 @@ class ExampleScreenSpaceShadows : public entry::AppI uint32_t m_currFrame; float m_lightRotation = 0.0f; - float m_texelHalf = 0.0f; float m_fovY = 60.0f; bool m_recreateFrameBuffers = false; bool m_havePrevious = false; diff --git a/bgfx/examples/45-bokeh/bokeh.cpp b/bgfx/examples/45-bokeh/bokeh.cpp index 965db747..8c30df3f 100644 --- a/bgfx/examples/45-bokeh/bokeh.cpp +++ b/bgfx/examples/45-bokeh/bokeh.cpp @@ -36,9 +36,9 @@ namespace { -#define FRAMEBUFFER_RT_COLOR 0 -#define FRAMEBUFFER_RT_DEPTH 1 -#define FRAMEBUFFER_RENDER_TARGETS 2 +#define FRAMEBUFFER_RT_COLOR 0 +#define FRAMEBUFFER_RT_DEPTH 1 +#define FRAMEBUFFER_RENDER_TARGETS 2 enum Meshes { @@ -162,7 +162,7 @@ struct RenderTarget bgfx::FrameBufferHandle m_buffer; }; -void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) +void screenSpaceQuad(bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout)) { @@ -175,15 +175,13 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf const float miny = 0.0f; const float maxy = _height * 2.0f; - const float texelHalfW = _texelHalf / _textureWidth; - const float texelHalfH = _texelHalf / _textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfW; + const float minu = -1.0f; + const float maxu = 1.0f; const float zz = 0.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -229,7 +227,6 @@ class ExampleBokeh : public entry::AppI ExampleBokeh(const char* _name, const char* _description) : entry::AppI(_name, _description) , m_currFrame(UINT32_MAX) - , m_texelHalf(0.0f) { } @@ -247,7 +244,7 @@ class ExampleBokeh : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -304,10 +301,6 @@ class ExampleBokeh : public entry::AppI cameraGetViewMtx(m_view); bx::mtxProj(m_proj, m_fovY, float(m_size[0]) / float(m_size[1]), 0.01f, 100.0f, bgfx::getCaps()->homogeneousDepth); - // Get renderer capabilities info. - const bgfx::RendererType::Enum renderer = bgfx::getRendererType(); - m_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f; - m_bokehTexture.idx = bgfx::kInvalidHandle; updateDisplayBokehTexture(m_radiusScale, m_maxBlurSize, m_lobeCount, (1.0f-m_lobePinch), 1.0f, m_lobeRotation); @@ -452,7 +445,7 @@ class ExampleBokeh : public entry::AppI ); bgfx::setTexture(0, s_depth, m_frameBufferTex[FRAMEBUFFER_RT_DEPTH]); m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_linearDepthProgram); ++view; } @@ -481,7 +474,7 @@ class ExampleBokeh : public entry::AppI | BGFX_STATE_WRITE_A ); bgfx::setTexture(0, s_color, m_frameBufferTex[FRAMEBUFFER_RT_COLOR]); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_copyLinearToGammaProgram); ++view; } @@ -701,7 +694,7 @@ class ExampleBokeh : public entry::AppI bgfx::setTexture(0, s_color, lastTex); bgfx::setTexture(1, s_depth, m_linearDepth.m_texture); m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, _originBottomLeft); + screenSpaceQuad(_originBottomLeft); bgfx::submit(view, m_dofDebugProgram); ++view; } @@ -719,7 +712,7 @@ class ExampleBokeh : public entry::AppI bgfx::setTexture(0, s_color, lastTex); bgfx::setTexture(1, s_depth, m_linearDepth.m_texture); m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, _originBottomLeft); + screenSpaceQuad(_originBottomLeft); bgfx::submit(view, m_dofSinglePassProgram); ++view; } @@ -740,7 +733,7 @@ class ExampleBokeh : public entry::AppI bgfx::setTexture(0, s_color, lastTex); bgfx::setTexture(1, s_depth, m_linearDepth.m_texture); m_uniforms.submit(); - screenSpaceQuad(float(halfWidth), float(halfHeight), m_texelHalf, _originBottomLeft); + screenSpaceQuad(_originBottomLeft); bgfx::submit(view, m_dofDownsampleProgram); ++view; lastTex = m_dofQuarterInput.m_texture; @@ -763,7 +756,7 @@ class ExampleBokeh : public entry::AppI ); bgfx::setTexture(0, s_color, lastTex); m_uniforms.submit(); - screenSpaceQuad(float(halfWidth), float(halfHeight), m_texelHalf, _originBottomLeft); + screenSpaceQuad(_originBottomLeft); bgfx::submit(view, m_dofQuarterProgram); ++view; lastTex = m_dofQuarterOutput.m_texture; @@ -780,7 +773,7 @@ class ExampleBokeh : public entry::AppI bgfx::setTexture(0, s_color, _colorTexture); bgfx::setTexture(1, s_blurredColor, lastTex); m_uniforms.submit(); - screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, _originBottomLeft); + screenSpaceQuad(_originBottomLeft); bgfx::submit(view, m_dofCombineProgram); ++view; } @@ -1022,7 +1015,6 @@ class ExampleBokeh : public entry::AppI uint32_t m_currFrame; float m_lightRotation = 0.0f; - float m_texelHalf = 0.0f; float m_fovY = 60.0f; bool m_recreateFrameBuffers = false; float m_animationTime = 0.0f; diff --git a/bgfx/examples/45-bokeh/bokeh_dof.sh b/bgfx/examples/45-bokeh/bokeh_dof.sh index 43c4885d..21a2a8bc 100644 --- a/bgfx/examples/45-bokeh/bokeh_dof.sh +++ b/bgfx/examples/45-bokeh/bokeh_dof.sh @@ -91,7 +91,7 @@ float BokehShapeFromAngle (float lobeCount, float radiusMin, float radiusDelta2x return 1.0f; } - // divide edge into some number of lobes + // divide edge into some number of lobes float invPeriod = lobeCount / (2.0 * 3.1415926); float periodFraction = fract(angle * invPeriod + rotation); diff --git a/bgfx/examples/45-bokeh/fs_bokeh_forward.sc b/bgfx/examples/45-bokeh/fs_bokeh_forward.sc index 2ad870f4..50d4fd0e 100644 --- a/bgfx/examples/45-bokeh/fs_bokeh_forward.sc +++ b/bgfx/examples/45-bokeh/fs_bokeh_forward.sc @@ -32,7 +32,7 @@ mat3 cotangentFrame(vec3 N, vec3 p, vec2 uv) vec3 dp1perp = cross(N, dp1); vec3 T = dp2perp * duv1.x + dp1perp * duv2.x; vec3 B = dp2perp * duv1.y + dp1perp * duv2.y; - + // construct a scale-invariant frame float invMax = inversesqrt(max(dot(T,T), dot(B,B))); return mat3(T*invMax, B*invMax, N); @@ -44,13 +44,13 @@ void main() // get vertex normal vec3 normal = normalize(v_normal); - + // get normal map normal, unpack, and calculate z vec3 normalMap; normalMap.xy = texture2D(s_normal, v_texcoord0).xy; normalMap.xy = normalMap.xy * 2.0 - 1.0; normalMap.z = sqrt(1.0 - dot(normalMap.xy, normalMap.xy)); - + // swap x and y, because the brick texture looks flipped, don't copy this... normalMap.xy = -normalMap.yx; diff --git a/bgfx/examples/46-fsr/app.cpp b/bgfx/examples/46-fsr/app.cpp index 4049d3e1..31e009b4 100644 --- a/bgfx/examples/46-fsr/app.cpp +++ b/bgfx/examples/46-fsr/app.cpp @@ -63,7 +63,7 @@ struct PosTexCoord0Vertex bgfx::VertexLayout PosTexCoord0Vertex::ms_layout; -void screenSpaceTriangle(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f, float _offsetX = 0.0f, float _offsetY = 0.0f) +void screenSpaceQuad(bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f, float _offsetX = 0.0f, float _offsetY = 0.0f) { if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout) ) { @@ -76,15 +76,13 @@ void screenSpaceTriangle(float _textureWidth, float _textureHeight, float _texel const float miny = 0.0f - _offsetY; const float maxy = _height * 2.0f - _offsetY; - const float texelHalfW = _texelHalf / _textureWidth; - const float texelHalfH = _texelHalf / _textureHeight; - const float minu = -1.0f + texelHalfW; - const float maxu = 1.0f + texelHalfW; + const float minu = -1.0f; + const float maxu = 1.0f; const float zz = 0.0f; - float minv = texelHalfH; - float maxv = 2.0f + texelHalfH; + float minv = 0.0f; + float maxv = 2.0f; if (_originBottomLeft) { @@ -193,7 +191,6 @@ struct AppState uint32_t m_currFrame{UINT32_MAX}; float m_lightRotation = 0.0f; - float m_texelHalf = 0.0f; float m_fovY = 60.0f; float m_animationTime = 0.0f; @@ -262,7 +259,7 @@ struct MagnifierWidget bgfx::setState(0 | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_DEPTH_TEST_ALWAYS | BGFX_STATE_BLEND_ALPHA); bgfx::setTexture(0, state.s_color, m_widgetTexture); - screenSpaceTriangle(float(m_widgetWidth), float(m_widgetHeight), state.m_texelHalf, false, scaleX, scaleY, offsetX, offsetY); + screenSpaceQuad(false, scaleX, scaleY, offsetX, offsetY); bgfx::submit(view, state.m_copyLinearToGammaProgram); } @@ -291,7 +288,7 @@ struct MagnifierWidget bgfx::setViewFrameBuffer(view, m_content.m_buffer); bgfx::setState(0 | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A); bgfx::setTexture(0, state.s_color, srcTexture, BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP); - screenSpaceTriangle(float(state.m_width), float(state.m_height), state.m_texelHalf, false, scaleX, scaleY, offsetX, offsetY); + screenSpaceQuad(false, scaleX, scaleY, offsetX, offsetY); bgfx::submit(view, state.m_copyLinearToGammaProgram); ++view; } @@ -421,10 +418,6 @@ class ExampleFsr : public entry::AppI cameraGetViewMtx(m_state.m_view); bx::mtxProj(m_state.m_proj, m_state.m_fovY, float(m_state.m_size[0]) / float(m_state.m_size[1]), 0.01f, 100.0f, bgfx::getCaps()->homogeneousDepth); - // Get renderer capabilities info. - const bgfx::RendererType::Enum renderer = bgfx::getRendererType(); - m_state.m_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f; - const uint32_t magnifierSize = 32; m_magnifierWidget.init(magnifierSize, magnifierSize); m_magnifierWidget.setPosition(m_state.m_width * 0.5f, m_state.m_height * 0.5f); @@ -600,7 +593,7 @@ class ExampleFsr : public entry::AppI bgfx::setViewFrameBuffer(view, BGFX_INVALID_HANDLE); bgfx::setState(0 | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A); bgfx::setTexture(0, m_state.s_color, srcTexture, BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP); - screenSpaceTriangle(float(m_state.m_width), float(m_state.m_height), m_state.m_texelHalf, caps->originBottomLeft); + screenSpaceQuad(caps->originBottomLeft); bgfx::submit(view, m_state.m_copyLinearToGammaProgram); } diff --git a/bgfx/examples/46-fsr/cs_fsr.h b/bgfx/examples/46-fsr/cs_fsr.h index 928ec47e..1d17c705 100644 --- a/bgfx/examples/46-fsr/cs_fsr.h +++ b/bgfx/examples/46-fsr/cs_fsr.h @@ -24,36 +24,36 @@ uniform vec4 u_params[3]; #endif // BGFX_SHADER_LANGUAGE_GLSL #if SAMPLE_SLOW_FALLBACK - #include "ffx_a.h" - SAMPLER2D(InputTexture, 0); - IMAGE2D_WR(OutputTexture, rgba32f, 1); - #if SAMPLE_EASU - #define FSR_EASU_F 1 - AF4 FsrEasuRF(AF2 p) { AF4 res = textureGather(InputTexture, p, 0); return res; } - AF4 FsrEasuGF(AF2 p) { AF4 res = textureGather(InputTexture, p, 1); return res; } - AF4 FsrEasuBF(AF2 p) { AF4 res = textureGather(InputTexture, p, 2); return res; } - #endif - #if SAMPLE_RCAS - #define FSR_RCAS_F - AF4 FsrRcasLoadF(ASU2 p) { return texelFetch(InputTexture, ASU2(p), 0); } - void FsrRcasInputF(inout AF1 r, inout AF1 g, inout AF1 b) {} - #endif +# include "ffx_a.h" + SAMPLER2D(InputTexture, 0); + IMAGE2D_WO(OutputTexture, rgba32f, 1); +# if SAMPLE_EASU + #define FSR_EASU_F 1 + AF4 FsrEasuRF(AF2 p) { AF4 res = textureGather(InputTexture, p, 0); return res; } + AF4 FsrEasuGF(AF2 p) { AF4 res = textureGather(InputTexture, p, 1); return res; } + AF4 FsrEasuBF(AF2 p) { AF4 res = textureGather(InputTexture, p, 2); return res; } +# endif +# if SAMPLE_RCAS + #define FSR_RCAS_F + AF4 FsrRcasLoadF(ASU2 p) { return texelFetch(InputTexture, ASU2(p), 0); } + void FsrRcasInputF(inout AF1 r, inout AF1 g, inout AF1 b) {} +# endif #else - #define A_HALF - #include "ffx_a.h" - SAMPLER2D(InputTexture, 0); - IMAGE2D_WR(OutputTexture, rgba16f, 1); - #if SAMPLE_EASU - #define FSR_EASU_H 1 - AH4 FsrEasuRH(AF2 p) { AH4 res = AH4(textureGather(InputTexture, p, 0)); return res; } - AH4 FsrEasuGH(AF2 p) { AH4 res = AH4(textureGather(InputTexture, p, 1)); return res; } - AH4 FsrEasuBH(AF2 p) { AH4 res = AH4(textureGather(InputTexture, p, 2)); return res; } - #endif - #if SAMPLE_RCAS - #define FSR_RCAS_H - AH4 FsrRcasLoadH(ASW2 p) { return AH4(texelFetch(InputTexture, ASU2(p), 0)); } - void FsrRcasInputH(inout AH1 r,inout AH1 g,inout AH1 b){} - #endif +# define A_HALF +# include "ffx_a.h" + SAMPLER2D(InputTexture, 0); + IMAGE2D_WO(OutputTexture, rgba16f, 1); +# if SAMPLE_EASU + #define FSR_EASU_H 1 + AH4 FsrEasuRH(AF2 p) { AH4 res = AH4(textureGather(InputTexture, p, 0)); return res; } + AH4 FsrEasuGH(AF2 p) { AH4 res = AH4(textureGather(InputTexture, p, 1)); return res; } + AH4 FsrEasuBH(AF2 p) { AH4 res = AH4(textureGather(InputTexture, p, 2)); return res; } +# endif +# if SAMPLE_RCAS + #define FSR_RCAS_H + AH4 FsrRcasLoadH(ASW2 p) { return AH4(texelFetch(InputTexture, ASU2(p), 0)); } + void FsrRcasInputH(inout AH1 r,inout AH1 g,inout AH1 b){} +# endif #endif #include "ffx_fsr1.h" @@ -61,38 +61,40 @@ uniform vec4 u_params[3]; void CurrFilter(AU2 pos, AU4 Const0, AU4 Const1, AU4 Const2, AU4 Const3, AU4 Sample) { #if SAMPLE_BILINEAR - AF2 pp = (AF2(pos) * AF2_AU2(Const0.xy) + AF2_AU2(Const0.zw)) * AF2_AU2(Const1.xy) + AF2(0.5, -0.5) * AF2_AU2(Const1.zw); - imageStore(OutputTexture, ASU2(pos), texture2DLod(InputTexture, pp, 0.0)); + AF2 pp = (AF2(pos) * AF2_AU2(Const0.xy) + AF2_AU2(Const0.zw)) * AF2_AU2(Const1.xy) + AF2(0.5, -0.5) * AF2_AU2(Const1.zw); + imageStore(OutputTexture, ASU2(pos), texture2DLod(InputTexture, pp, 0.0)); #endif + #if SAMPLE_EASU - #if SAMPLE_SLOW_FALLBACK - AF3 c; - FsrEasuF(c, pos, Const0, Const1, Const2, Const3); - if( Sample.x == 1 ) - c *= c; - imageStore(OutputTexture, ASU2(pos), AF4(c, 1)); - #else - AH3 c; - FsrEasuH(c, pos, Const0, Const1, Const2, Const3); - if( Sample.x == 1 ) - c *= c; - imageStore(OutputTexture, ASU2(pos), AH4(c, 1)); - #endif +# if SAMPLE_SLOW_FALLBACK + AF3 c; + FsrEasuF(c, pos, Const0, Const1, Const2, Const3); + if( Sample.x == 1 ) + c *= c; + imageStore(OutputTexture, ASU2(pos), AF4(c, 1)); +# else + AH3 c; + FsrEasuH(c, pos, Const0, Const1, Const2, Const3); + if( Sample.x == 1 ) + c *= c; + imageStore(OutputTexture, ASU2(pos), AH4(c, 1)); +# endif #endif + #if SAMPLE_RCAS - #if SAMPLE_SLOW_FALLBACK - AF3 c; - FsrRcasF(c.r, c.g, c.b, pos, Const0); - if( Sample.x == 1 ) - c *= c; - imageStore(OutputTexture, ASU2(pos), AF4(c, 1)); - #else - AH3 c; - FsrRcasH(c.r, c.g, c.b, pos, Const0); - if( Sample.x == 1 ) - c *= c; - imageStore(OutputTexture, ASU2(pos), AH4(c, 1)); - #endif +# if SAMPLE_SLOW_FALLBACK + AF3 c; + FsrRcasF(c.r, c.g, c.b, pos, Const0); + if( Sample.x == 1 ) + c *= c; + imageStore(OutputTexture, ASU2(pos), AF4(c, 1)); +# else + AH3 c; + FsrRcasH(c.r, c.g, c.b, pos, Const0); + if( Sample.x == 1 ) + c *= c; + imageStore(OutputTexture, ASU2(pos), AH4(c, 1)); +# endif #endif } @@ -108,20 +110,20 @@ void main() SrcSize.x, SrcSize.y, // The size of the input image. DstSize.x, DstSize.y); // The output resolution. Sample.x = 0; // no HDR output -#endif +#endif // SAMPLE_EASU || SAMPLE_BILINEAR + #if SAMPLE_RCAS FsrRcasCon(Const0, ViewportSizeRcasAttenuation.z); Sample.x = 0; // no HDR output -#endif +#endif // SAMPLE_RCAS - // Do remapping of local xy in workgroup for a more PS-like swizzle pattern. - AU2 gxy = ARmp8x8(gl_LocalInvocationID.x) + AU2(gl_WorkGroupID.x << 4u, gl_WorkGroupID.y << 4u); - CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample); - gxy.x += 8u; - CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample); - gxy.y += 8u; - CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample); - gxy.x -= 8u; - CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample); + // Do remapping of local xy in workgroup for a more PS-like swizzle pattern. + AU2 gxy = ARmp8x8(gl_LocalInvocationID.x) + AU2(gl_WorkGroupID.x << 4u, gl_WorkGroupID.y << 4u); + CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample); + gxy.x += 8u; + CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample); + gxy.y += 8u; + CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample); + gxy.x -= 8u; + CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample); } - diff --git a/bgfx/examples/46-fsr/ffx_a.h b/bgfx/examples/46-fsr/ffx_a.h index 0efcc8d8..eff831ee 100644 --- a/bgfx/examples/46-fsr/ffx_a.h +++ b/bgfx/examples/46-fsr/ffx_a.h @@ -249,7 +249,7 @@ //------------------------------------------------------------------------------------------------------------------------------ // TODO // ==== -// - Replace transcendentals with manual versions. +// - Replace transcendentals with manual versions. //============================================================================================================================== #ifdef A_GCC A_STATIC AD1 AAbsD1(AD1 a){return __builtin_fabs(a);} @@ -310,7 +310,7 @@ A_STATIC AL1 AMaxL1(AL1 a,AL1 b){return a>b?a:b;} A_STATIC AU1 AMaxU1(AU1 a,AU1 b){return a>b?a:b;} //------------------------------------------------------------------------------------------------------------------------------ - // These follow the convention that A integer types don't have signage, until they are operated on. + // These follow the convention that A integer types don't have signage, until they are operated on. A_STATIC AL1 AMaxSL1(AL1 a,AL1 b){return (ASL1_(a)>ASL1_(b))?a:b;} A_STATIC AU1 AMaxSU1(AU1 a,AU1 b){return (ASU1_(a)>ASU1_(b))?a:b;} //------------------------------------------------------------------------------------------------------------------------------ @@ -1071,7 +1071,7 @@ #define AU1_AH1_AF1(a) AU1_AH1_AF1_x(AF1(a)) //------------------------------------------------------------------------------------------------------------------------------ AU1 AU1_AH2_AF2_x(AF2 a){return f32tof16(a.x)|(f32tof16(a.y)<<16);} - #define AU1_AH2_AF2(a) AU1_AH2_AF2_x(AF2(a)) + #define AU1_AH2_AF2(a) AU1_AH2_AF2_x(AF2(a)) #define AU1_AB4Unorm_AF4(x) D3DCOLORtoUBYTE4(AF4(x)) //------------------------------------------------------------------------------------------------------------------------------ AF2 AF2_AH2_AU1_x(AU1 x){return AF2(f16tof32(x&0xFFFF),f16tof32(x>>16));} @@ -1588,7 +1588,7 @@ // - V_CVT_F32_UBYTE{0,1,2,3} - Unsigned byte to float. // - V_CVT_PKACC_U8_F32 - Float to unsigned byte (does bit-field insert into 32-bit integer). // V_PERM_B32 does byte packing with ability to zero fill bytes as well. -// - Can pull out byte values from two sources, and zero fill upper 8-bits of packed hi and lo. +// - Can pull out byte values from two sources, and zero fill upper 8-bits of packed hi and lo. //------------------------------------------------------------------------------------------------------------------------------ // BYTE : FLOAT - ABuc{0,1,2,3}{To,From}U1() - Designed for V_CVT_F32_UBYTE* and V_CVT_PKACCUM_U8_F32 ops. // ==== ===== @@ -1683,8 +1683,8 @@ // ENCODING (without zero-based encoding) // ======== // 0 = unused (can be used to mean something else) -// 1 = lowest value -// 128 = exact zero center (zero based encoding +// 1 = lowest value +// 128 = exact zero center (zero based encoding // 255 = highest value //------------------------------------------------------------------------------------------------------------------------------ // Zero-based [Zb] flips the MSB bit of the byte (making 128 "exact zero" actually zero). @@ -1696,8 +1696,8 @@ // 1 : -126/512 // 2 : -125/512 // ... -// 128 : 0 -// ... +// 128 : 0 +// ... // 255 : 127/512 // : 1/4 (just outside the encoding range) //============================================================================================================================== @@ -1918,7 +1918,7 @@ // - Parabolic takes 8 clocks and 8 issue slots (only fract is non-packed). AH1 APSinH1(AH1 x){return x*abs(x)-x;} AH2 APSinH2(AH2 x){return x*abs(x)-x;} // AND,FMA - AH1 APCosH1(AH1 x){x=AFractH1(x*AH1_(0.5)+AH1_(0.75));x=x*AH1_(2.0)-AH1_(1.0);return APSinH1(x);} + AH1 APCosH1(AH1 x){x=AFractH1(x*AH1_(0.5)+AH1_(0.75));x=x*AH1_(2.0)-AH1_(1.0);return APSinH1(x);} AH2 APCosH2(AH2 x){x=AFractH2(x*AH2_(0.5)+AH2_(0.75));x=x*AH2_(2.0)-AH2_(1.0);return APSinH2(x);} // 3x FMA, 2xFRACT, AND AH2 APSinCosH1(AH1 x){AH1 y=AFractH1(x*AH1_(0.5)+AH1_(0.75));y=y*AH1_(2.0)-AH1_(1.0);return APSinH2(AH2(x,y));} #endif @@ -2152,9 +2152,9 @@ return clamp(j.xxx,c*j.yyy,pow(c,j.zzz)*k.xxx+k.yyy);} //------------------------------------------------------------------------------------------------------------------------------ // Note 'rcpX' is '1/x', where the 'x' is what would be used in AFromGamma(). - AF1 AToGammaF1(AF1 c,AF1 rcpX){return pow(c,AF1_(rcpX));} - AF2 AToGammaF2(AF2 c,AF1 rcpX){return pow(c,AF2_(rcpX));} - AF3 AToGammaF3(AF3 c,AF1 rcpX){return pow(c,AF3_(rcpX));} + AF1 AToGammaF1(AF1 c,AF1 rcpX){return pow(c,AF1_(rcpX));} + AF2 AToGammaF2(AF2 c,AF1 rcpX){return pow(c,AF2_(rcpX));} + AF3 AToGammaF3(AF3 c,AF1 rcpX){return pow(c,AF3_(rcpX));} //------------------------------------------------------------------------------------------------------------------------------ AF1 AToPqF1(AF1 x){AF1 p=pow(x,AF1_(0.159302)); return pow((AF1_(0.835938)+AF1_(18.8516)*p)/(AF1_(1.0)+AF1_(18.6875)*p),AF1_(78.8438));} @@ -2188,9 +2188,9 @@ AF3 AFrom709F3(AF3 c){AF3 j=AF3(0.081/4.5,1.0/4.5,1.0/0.45);AF2 k=AF2(1.0/1.099,0.099/1.099); return AZolSelF3(AZolSignedF3(c-j.xxx),c*j.yyy,pow(c*k.xxx+k.yyy,j.zzz));} //------------------------------------------------------------------------------------------------------------------------------ - AF1 AFromGammaF1(AF1 c,AF1 x){return pow(c,AF1_(x));} - AF2 AFromGammaF2(AF2 c,AF1 x){return pow(c,AF2_(x));} - AF3 AFromGammaF3(AF3 c,AF1 x){return pow(c,AF3_(x));} + AF1 AFromGammaF1(AF1 c,AF1 x){return pow(c,AF1_(x));} + AF2 AFromGammaF2(AF2 c,AF1 x){return pow(c,AF2_(x));} + AF3 AFromGammaF3(AF3 c,AF1 x){return pow(c,AF3_(x));} //------------------------------------------------------------------------------------------------------------------------------ AF1 AFromPqF1(AF1 x){AF1 p=pow(x,AF1_(0.0126833)); return pow(ASatF1(p-AF1_(0.835938))/(AF1_(18.8516)-AF1_(18.6875)*p),AF1_(6.27739));} @@ -2292,14 +2292,14 @@ // Details, // LANE TO 8x8 MAPPING // =================== - // 00 01 08 09 10 11 18 19 + // 00 01 08 09 10 11 18 19 // 02 03 0a 0b 12 13 1a 1b // 04 05 0c 0d 14 15 1c 1d - // 06 07 0e 0f 16 17 1e 1f - // 20 21 28 29 30 31 38 39 + // 06 07 0e 0f 16 17 1e 1f + // 20 21 28 29 30 31 38 39 // 22 23 2a 2b 32 33 3a 3b // 24 25 2c 2d 34 35 3c 3d - // 26 27 2e 2f 36 37 3e 3f + // 26 27 2e 2f 36 37 3e 3f AU2 ARmpRed8x8(AU1 a){return AU2(ABfiM(ABfe(a,2u,3u),a,1u),ABfiM(ABfe(a,3u,3u),ABfe(a,1u,2u),2u));} //============================================================================================================================== #ifdef A_HALF @@ -2356,7 +2356,7 @@ // ... // 1023 = 2^(-14)*(1-2^(-10)) = 2^(-14)*(1-1/1024) ... last denormal value // 1024 = 2^(-14) = 1/16384 .......................... first normal value that still maps to integers -// 2047 .............................................. last normal value that still maps to integers +// 2047 .............................................. last normal value that still maps to integers // Scaling limits, // 2^15 = 32768 ...................................... largest power of 2 scaling // Largest pow2 conversion mapping is at *32768, diff --git a/bgfx/examples/46-fsr/ffx_fsr1.h b/bgfx/examples/46-fsr/ffx_fsr1.h index bd872845..b82f04db 100644 --- a/bgfx/examples/46-fsr/ffx_fsr1.h +++ b/bgfx/examples/46-fsr/ffx_fsr1.h @@ -35,12 +35,12 @@ // ===== // FSR is a collection of algorithms relating to generating a higher resolution image. // This specific header focuses on single-image non-temporal image scaling, and related tools. -// +// // The core functions are EASU and RCAS: // [EASU] Edge Adaptive Spatial Upsampling ....... 1x to 4x area range spatial scaling, clamped adaptive elliptical filter. // [RCAS] Robust Contrast Adaptive Sharpening .... A non-scaling variation on CAS. // RCAS needs to be applied after EASU as a separate pass. -// +// // Optional utility functions are: // [LFGA] Linear Film Grain Applicator ........... Tool to apply film grain after scaling. // [SRTM] Simple Reversible Tone-Mapper .......... Linear HDR {0 to FP16_MAX} to {0 to 1} and back. @@ -80,7 +80,7 @@ // and limits output to the minimum and maximum of that neighborhood. //------------------------------------------------------------------------------------------------------------------------------ // Input image requirements: -// +// // Color needs to be encoded as 3 channel[red, green, blue](e.g.XYZ not supported) // Each channel needs to be in the range[0, 1] // Any color primaries are supported @@ -90,11 +90,11 @@ // There should be no noise in the input that is not at input pixel granularity // For performance purposes, use 32bpp formats //------------------------------------------------------------------------------------------------------------------------------ -// Best to apply EASU at the end of the frame after tonemapping +// Best to apply EASU at the end of the frame after tonemapping // but before film grain or composite of the UI. //------------------------------------------------------------------------------------------------------------------------------ // Example of including this header for D3D HLSL : -// +// // #define A_GPU 1 // #define A_HLSL 1 // #define A_HALF 1 @@ -103,9 +103,9 @@ // #define FSR_RCAS_H 1 // //declare input callbacks // #include "ffx_fsr1.h" -// +// // Example of including this header for Vulkan GLSL : -// +// // #define A_GPU 1 // #define A_GLSL 1 // #define A_HALF 1 @@ -114,9 +114,9 @@ // #define FSR_RCAS_H 1 // //declare input callbacks // #include "ffx_fsr1.h" -// +// // Example of including this header for Vulkan HLSL : -// +// // #define A_GPU 1 // #define A_HLSL 1 // #define A_HLSL_6_2 1 @@ -127,11 +127,11 @@ // #define FSR_RCAS_H 1 // //declare input callbacks // #include "ffx_fsr1.h" -// +// // Example of declaring the required input callbacks for GLSL : // The callbacks need to gather4 for each color channel using the specified texture coordinate 'p'. // EASU uses gather4 to reduce position computation logic and for free Arrays of Structures to Structures of Arrays conversion. -// +// // AH4 FsrEasuRH(AF2 p){return AH4(textureGather(sampler2D(tex,sam),p,0));} // AH4 FsrEasuGH(AF2 p){return AH4(textureGather(sampler2D(tex,sam),p,1));} // AH4 FsrEasuBH(AF2 p){return AH4(textureGather(sampler2D(tex,sam),p,2));} @@ -611,7 +611,7 @@ A_STATIC void FsrEasuConOffset( // RCAS is based on the following logic. // RCAS uses a 5 tap filter in a cross pattern (same as CAS), // w n -// w 1 w for taps w m e +// w 1 w for taps w m e // w s // Where 'w' is the negative lobe weight. // output = (w*(n+e+w+s)+m)/(4*w+1) @@ -630,16 +630,16 @@ A_STATIC void FsrEasuConOffset( // This is used as a noise detection filter, to reduce the effect of RCAS on grain, and focus on real edges. // // GLSL example for the required callbacks : -// +// // AH4 FsrRcasLoadH(ASW2 p){return AH4(imageLoad(imgSrc,ASU2(p)));} // void FsrRcasInputH(inout AH1 r,inout AH1 g,inout AH1 b) // { // //do any simple input color conversions here or leave empty if none needed // } -// +// // FsrRcasCon need to be called from the CPU or GPU to set up constants. // Including a GPU example here, the 'con' value would be stored out to a constant buffer. -// +// // AU4 con; // FsrRcasCon(con, // 0.0); // The scale is {0.0 := maximum sharpness, to N>0, where N is the number of stops (halving) of the reduction of sharpness}. @@ -691,7 +691,7 @@ AF1 sharpness){ AU2 ip, // Integer pixel position in output. AU4 con){ // Constant generated by RcasSetup(). // Algorithm uses minimal 3x3 pixel neighborhood. - // b + // b // d e f // h ASU2 sp=ASU2(ip); @@ -766,7 +766,7 @@ AF1 sharpness){ pixR=(lobe*bR+lobe*dR+lobe*hR+lobe*fR+eR)*rcpL; pixG=(lobe*bG+lobe*dG+lobe*hG+lobe*fG+eG)*rcpL; pixB=(lobe*bB+lobe*dB+lobe*hB+lobe*fB+eB)*rcpL; - return;} + return;} #endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -789,7 +789,7 @@ AF1 sharpness){ AU2 ip, // Integer pixel position in output. AU4 con){ // Constant generated by RcasSetup(). // Sharpening algorithm uses minimal 3x3 pixel neighborhood. - // b + // b // d e f // h ASW2 sp=ASW2(ip); diff --git a/bgfx/examples/46-fsr/fs_fsr_forward.sc b/bgfx/examples/46-fsr/fs_fsr_forward.sc index d60110d8..068a49c0 100644 --- a/bgfx/examples/46-fsr/fs_fsr_forward.sc +++ b/bgfx/examples/46-fsr/fs_fsr_forward.sc @@ -31,7 +31,7 @@ mat3 cotangentFrame(vec3 N, vec3 p, vec2 uv) vec3 dp1perp = cross(N, dp1); vec3 T = dp2perp * duv1.x + dp1perp * duv2.x; vec3 B = dp2perp * duv1.y + dp1perp * duv2.y; - + // construct a scale-invariant frame float invMax = inversesqrt(max(dot(T,T), dot(B,B))); return mat3(T*invMax, B*invMax, N); @@ -43,13 +43,13 @@ void main() // get vertex normal vec3 normal = normalize(v_normal); - + // get normal map normal, unpack, and calculate z vec3 normalMap; normalMap.xy = texture2D(s_normal, v_texcoord0).xy; normalMap.xy = normalMap.xy * 2.0 - 1.0; normalMap.z = sqrt(1.0 - dot(normalMap.xy, normalMap.xy)); - + // swap x and y, because the brick texture looks flipped, don't copy this... normalMap.xy = -normalMap.yx; diff --git a/bgfx/examples/46-fsr/makefile b/bgfx/examples/46-fsr/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/46-fsr/makefile +++ b/bgfx/examples/46-fsr/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/47-pixelformats/makefile b/bgfx/examples/47-pixelformats/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/47-pixelformats/makefile +++ b/bgfx/examples/47-pixelformats/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/47-pixelformats/pixelformats.cpp b/bgfx/examples/47-pixelformats/pixelformats.cpp index 4eb79532..56533286 100644 --- a/bgfx/examples/47-pixelformats/pixelformats.cpp +++ b/bgfx/examples/47-pixelformats/pixelformats.cpp @@ -24,28 +24,31 @@ constexpr int32_t kFirstUncompressedFormatIndex = bgfx::TextureFormat::Unknown + constexpr int32_t kNumCompressedFormats = bgfx::TextureFormat::Unknown; constexpr int32_t kNumUncompressedFormats = bgfx::TextureFormat::UnknownDepth - kFirstUncompressedFormatIndex; constexpr int32_t kNumFormats = kNumCompressedFormats + kNumUncompressedFormats; -const int32_t kNumFormatsInRow = (int32_t)bx::ceil(1.2f * bx::sqrt(kNumFormats) ); +constexpr int32_t kNumFormatsInRow = 10; -inline int32_t formatToIndex(bimg::TextureFormat::Enum format) +int32_t formatToIndex(bimg::TextureFormat::Enum _format) { - int32_t index = format; + int32_t index = _format; + if (index >= kFirstUncompressedFormatIndex) { --index; } + return index; } -inline bimg::TextureFormat::Enum indexToFormat(int32_t index) +bimg::TextureFormat::Enum indexToFormat(int32_t _index) { - if (index < kNumCompressedFormats) + if (_index < kNumCompressedFormats) { - return bimg::TextureFormat::Enum(index); + return bimg::TextureFormat::Enum(_index); } - if (index >= kNumCompressedFormats && index < kNumFormats) + if (_index >= kNumCompressedFormats + && _index < kNumFormats) { - return bimg::TextureFormat::Enum(index + 1); + return bimg::TextureFormat::Enum(_index + 1); } return bimg::TextureFormat::Unknown; @@ -62,25 +65,29 @@ struct TextureStatus FormatIgnored }; - inline static const char* getDescription(Enum value) + static const char* getDescription(Enum _value) { - switch (value) + switch (_value) { - case Ok: return "Ok"; - case NotInitialized: return "Texture was not initialized"; - case FormatNotSupported: return "Format not supported by GPU/backend"; - case ConversionNotSupported: return "Conversion from RGBA8 not supported"; - case FormatIgnored: return "Format is ignored by this example"; + case Ok: return "Ok"; + case NotInitialized: return "Texture was not initialized"; + case FormatNotSupported: return "Format not supported by GPU/backend"; + case ConversionNotSupported: return "Conversion from RGBA8 not supported"; + case FormatIgnored: return "Format is ignored by this example"; + + default: + break; } return "Unknown"; } - inline static bool isError(Enum value) + static bool isError(Enum _value) { - return value == FormatNotSupported - || value == ConversionNotSupported - ; + return false + || _value == FormatNotSupported + || _value == ConversionNotSupported + ; } }; @@ -116,7 +123,8 @@ static bimg::ImageContainer* generateHueWheelImage() false, false, NULL - ); + ); + if (NULL == image) { return NULL; @@ -124,54 +132,54 @@ static bimg::ImageContainer* generateHueWheelImage() float* rgbaf32Pixels = (float*)image->m_data; - for (int32_t y = 0 ; y < kTextureSize; ++y) + for (int32_t yy = 0 ; yy < kTextureSize; ++yy) { - for (int32_t x = 0; x < kTextureSize; ++x) + for (int32_t xx = 0; xx < kTextureSize; ++xx) { - float relX = (x - kHalfTextureSize) / (float) kHalfTextureSize; - float relY = (y - kHalfTextureSize) / (float) kHalfTextureSize; + float relX = (xx - kHalfTextureSize) / (float) kHalfTextureSize; + float relY = (yy - kHalfTextureSize) / (float) kHalfTextureSize; float distance = bx::min(1.0f, bx::sqrt(relX * relX + relY * relY) ); float angle = bx::atan2(relY, relX); - float* pixel = &rgbaf32Pixels[(x + y * kTextureSize) * 4]; + float* pixel = &rgbaf32Pixels[(xx + yy * kTextureSize) * 4]; float hsv[3] = {angle / (2.0f * bx::kPi), 1.0f, 1.0f - distance}; bx::hsvToRgb(pixel, hsv); pixel[3] = 1.0f - distance; } } - for (int32_t y = 0; y < 16; ++y) + for (int32_t yy = 0; yy < 16; ++yy) { - for (int32_t x = 0; x < 16; ++x) + for (int32_t xx = 0; xx < 16; ++xx) { - float* r = &rgbaf32Pixels[(x + (kTextureSize - 36 + y) * kTextureSize) * 4]; - r[0] = 1.0f; - r[1] = 0.0f; - r[2] = 0.0f; - r[3] = 1.0f; - - float* g = &rgbaf32Pixels[(x + 16 + (kTextureSize - 36 + y) * kTextureSize) * 4]; - g[0] = 0.0f; - g[1] = 1.0f; - g[2] = 0.0f; - g[3] = 1.0f; - - float* b = &rgbaf32Pixels[(x + 32 + (kTextureSize - 36 + y) * kTextureSize) * 4]; - b[0] = 0.0f; - b[1] = 0.0f; - b[2] = 1.0f; - b[3] = 1.0f; + float* rr = &rgbaf32Pixels[(xx + (kTextureSize - 36 + yy) * kTextureSize) * 4]; + rr[0] = 1.0f; + rr[1] = 0.0f; + rr[2] = 0.0f; + rr[3] = 1.0f; + + float* gg = &rgbaf32Pixels[(xx + 16 + (kTextureSize - 36 + yy) * kTextureSize) * 4]; + gg[0] = 0.0f; + gg[1] = 1.0f; + gg[2] = 0.0f; + gg[3] = 1.0f; + + float* bb = &rgbaf32Pixels[(xx + 32 + (kTextureSize - 36 + yy) * kTextureSize) * 4]; + bb[0] = 0.0f; + bb[1] = 0.0f; + bb[2] = 1.0f; + bb[3] = 1.0f; } } - for (int32_t y = 0; y < 16; ++y) + for (int32_t yy = 0; yy < 16; ++yy) { - for (int32_t x = 0; x < 48; ++x) + for (int32_t xx = 0; xx < 48; ++xx) { - float* a = &rgbaf32Pixels[(x + (kTextureSize - 20 + y) * kTextureSize) * 4]; - a[0] = 1.0f; - a[1] = 1.0f; - a[2] = 1.0f; - a[3] = 1.0f - (float)x / 48.0f; + float* aa = &rgbaf32Pixels[(xx + (kTextureSize - 20 + yy) * kTextureSize) * 4]; + aa[0] = 1.0f; + aa[1] = 1.0f; + aa[2] = 1.0f; + aa[3] = 1.0f - (float)xx / 48.0f; } } @@ -208,9 +216,9 @@ static void textureSetPopulateCompressedFormat(TextureSet& textureSet, bimg::Ima , mip0 ); - texture.m_width = uint16_t(mip0.m_width); - texture.m_height = uint16_t(mip0.m_height); - texture.m_status = TextureStatus::Ok; + texture.m_width = uint16_t(mip0.m_width); + texture.m_height = uint16_t(mip0.m_height); + texture.m_status = TextureStatus::Ok; texture.m_texture = bgfx::createTexture2D( uint16_t(mip0.m_width) , uint16_t(mip0.m_height) @@ -219,7 +227,7 @@ static void textureSetPopulateCompressedFormat(TextureSet& textureSet, bimg::Ima , bgfx::TextureFormat::Enum(mip0.m_format) , BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT , bgfx::copy(mip0.m_data, mip0.m_size) - ); + ); bgfx::setName(texture.m_texture, bimg::getName(source->m_format) ); @@ -244,13 +252,14 @@ static void textureSetPopulateUncompressedFormats(TextureSet& textureSet, bimg:: | BGFX_SAMPLER_MAG_POINT ; - for (int32_t i = 0; i < kNumUncompressedFormats; ++i) + for (int32_t ii = 0; ii < kNumUncompressedFormats; ++ii) { - int32_t textureIndex = kNumCompressedFormats + i; + int32_t textureIndex = kNumCompressedFormats + ii; Texture& texture = textureSet.m_textures[textureIndex]; - if (bgfx::isValid(texture.m_texture) || texture.m_status == TextureStatus::FormatNotSupported) + if (bgfx::isValid(texture.m_texture) + || texture.m_status == TextureStatus::FormatNotSupported) { continue; } @@ -326,9 +335,9 @@ static TextureSet makeEmptyTextureSet(const char* name) TextureSet textureSet; textureSet.m_name = name; - for (int32_t i = 0; i < kNumFormats; ++i) + for (int32_t ii = 0; ii < kNumFormats; ++ii) { - bimg::TextureFormat::Enum format = indexToFormat(i); + bimg::TextureFormat::Enum format = indexToFormat(ii); if (!bgfx::isTextureValid( 1 @@ -338,7 +347,7 @@ static TextureSet makeEmptyTextureSet(const char* name) , BGFX_TEXTURE_NONE ) ) { - textureSet.m_textures[i].m_status = TextureStatus::FormatNotSupported; + textureSet.m_textures[ii].m_status = TextureStatus::FormatNotSupported; } } @@ -401,7 +410,7 @@ static TextureSet generateTextureSetFromFile(const char* filePath) const char* filePaths[] = { filePath, - nullptr + NULL }; return generateTextureSetFromFileSet(bx::FilePath(filePath).getFileName().getPtr(), filePaths); @@ -429,7 +438,7 @@ class ExamplePixelFormats : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -447,6 +456,7 @@ class ExamplePixelFormats : public entry::AppI ); const bgfx::Memory* checkerboardImageMemory = bgfx::alloc(kCheckerboardSize * kCheckerboardSize * 4); + bimg::imageCheckerboard( checkerboardImageMemory->data , kCheckerboardSize @@ -455,6 +465,7 @@ class ExamplePixelFormats : public entry::AppI , 0xFF909090 , 0xFF707070 ); + m_checkerboard = bgfx::createTexture2D( kCheckerboardSize , kCheckerboardSize @@ -468,6 +479,7 @@ class ExamplePixelFormats : public entry::AppI m_textureSets.push_back(generateTextureSetFromImage("Hue Wheel", generateHueWheelImage() ) ); m_textureSets.push_back(generateTextureSetFromFile("textures/pf_alpha_test.dds") ); m_textureSets.push_back(generateTextureSetFromFile("textures/pf_uv_filtering_test.dds") ); + const char* textureCompressionSetFiles[] = { "textures/texture_compression_astc_4x4.dds", @@ -498,15 +510,16 @@ class ExamplePixelFormats : public entry::AppI "textures/texture_compression_ptc22.pvr", "textures/texture_compression_ptc24.pvr", "textures/texture_compression_rgba8.dds", - nullptr + NULL }; - m_textureSets.push_back(generateTextureSetFromFileSet("texture_compression_* set", textureCompressionSetFiles)); + + m_textureSets.push_back(generateTextureSetFromFileSet("texture_compression_* set", textureCompressionSetFiles) ); m_currentTextureSet = &m_textureSets[0]; for (auto& textureSet : m_textureSets) { - m_largestTextureSize = bx::max(m_largestTextureSize, float(bx::max(textureSet.m_maxWidth, textureSet.m_maxHeight))); + m_largestTextureSize = bx::max(m_largestTextureSize, float(bx::max(textureSet.m_maxWidth, textureSet.m_maxHeight) ) ); } imguiCreate(); @@ -630,10 +643,11 @@ class ExamplePixelFormats : public entry::AppI showExampleDialog(this); - ImGui::SetNextWindowPos(ImVec2(360.0f, 40.0f), ImGuiCond_FirstUseEver); - ImGui::Begin("Formats", NULL, ImGuiWindowFlags_AlwaysAutoResize); + ImGui::SetNextWindowPos(ImVec2(340.0f, 10.0f), ImGuiCond_FirstUseEver); + ImGui::Begin("Formats", NULL, ImGuiWindowFlags_None); ImVec2 previewSize = ImVec2(m_previewSize, m_previewSize); + if (m_currentTextureSet->m_maxWidth > m_currentTextureSet->m_maxHeight) { previewSize.y /= float(m_currentTextureSet->m_maxWidth) / m_currentTextureSet->m_maxHeight; @@ -644,21 +658,21 @@ class ExamplePixelFormats : public entry::AppI } float cellWidth = previewSize.x; - for (int32_t i = 0; i < kNumFormats; ++i) + for (int32_t ii = 0; ii < kNumFormats; ++ii) { - int32_t format = indexToFormat(i); + int32_t format = indexToFormat(ii); ImVec2 textSize = ImGui::CalcTextSize(bimg::getName(bimg::TextureFormat::Enum(format) ) ); cellWidth = bx::max(cellWidth, textSize.x); } ImDrawList* drawList = ImGui::GetWindowDrawList(); - if (ImGui::BeginCombo("Sample", m_currentTextureSet ? m_currentTextureSet->m_name.c_str() : nullptr)) + if (ImGui::BeginCombo("Sample", m_currentTextureSet ? m_currentTextureSet->m_name.c_str() : NULL) ) { for (auto& textureSet : m_textureSets) { bool isSelected = (&textureSet == m_currentTextureSet); - if (ImGui::Selectable(textureSet.m_name.c_str(), &isSelected)) + if (ImGui::Selectable(textureSet.m_name.c_str(), &isSelected) ) { m_currentTextureSet = &textureSet; if (!m_currentTextureSet->m_hasCompressedTextures && formatToIndex(m_selectedFormat) < kNumCompressedFormats) @@ -678,17 +692,20 @@ class ExamplePixelFormats : public entry::AppI ImGui::Checkbox("Animate", &m_animate); ImGui::BeginTable("Formats", kNumFormatsInRow, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit); - for (int32_t i = m_currentTextureSet->m_hasCompressedTextures ? 0 : kNumCompressedFormats; i < kNumFormats; ++i) + for (int32_t ii = m_currentTextureSet->m_hasCompressedTextures ? 0 : kNumCompressedFormats; ii < kNumFormats; ++ii) { ImGui::TableNextColumn(); - bimg::TextureFormat::Enum format = indexToFormat(i); - const Texture& texture = m_currentTextureSet->m_textures[i]; + bimg::TextureFormat::Enum format = indexToFormat(ii); + const Texture& texture = m_currentTextureSet->m_textures[ii]; bool isSelected = (m_selectedFormat == format); - bool isFormatSupported = texture.m_status == TextureStatus::Ok; - bool isError = TextureStatus::isError(texture.m_status); - ImU32 labelColor = isError ? IM_COL32(255, 96, 96, 255) : ImGui::GetColorU32(isFormatSupported ? ImGuiCol_Text : ImGuiCol_TextDisabled); + const bool isFormatSupported = texture.m_status == TextureStatus::Ok; + const bool isError = TextureStatus::isError(texture.m_status); + ImU32 labelColor = isError + ? IM_COL32(255, 96, 96, 255) + : ImGui::GetColorU32(isFormatSupported ? ImGuiCol_Text : ImGuiCol_TextDisabled) + ; ImDrawListSplitter splitter; splitter.Split(drawList, 2); @@ -704,9 +721,11 @@ class ExamplePixelFormats : public entry::AppI { imguiStrikethroughItem(); } - imguiTexturePreview(ImVec2(cellWidth, previewSize.y), m_currentTextureSet->m_textures[i].m_texture, previewSize ); + + imguiTexturePreview(ImVec2(cellWidth, previewSize.y), m_currentTextureSet->m_textures[ii].m_texture, previewSize ); ImGui::PopStyleColor(); ImGui::EndGroup(); + if (!isFormatSupported && ImGui::IsItemHovered() ) { ImGui::SetTooltip("%s", TextureStatus::getDescription(texture.m_status) ); @@ -715,7 +734,7 @@ class ExamplePixelFormats : public entry::AppI splitter.SetCurrentChannel(drawList, 0); ImGui::SetCursorScreenPos(ImGui::GetItemRectMin() ); - ImGui::PushID(i); + ImGui::PushID(ii); if (ImGui::Selectable( "##selectable" @@ -757,7 +776,8 @@ class ExamplePixelFormats : public entry::AppI ImGui::PushEnabled(false); ImGui::Checkbox("Emu", &emulated); ImGui::PopEnabled(); - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) + + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) ) { ImGui::SetTooltip("Texture format is%s emulated.", emulated ? "" : " not"); } @@ -767,7 +787,8 @@ class ExamplePixelFormats : public entry::AppI ImGui::PushEnabled(false); ImGui::Checkbox("FB", &framebuffer); ImGui::PopEnabled(); - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) + + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) ) { ImGui::SetTooltip("Texture format can%s be used as frame buffer.", framebuffer ? "" : "not"); } @@ -777,7 +798,8 @@ class ExamplePixelFormats : public entry::AppI ImGui::PushEnabled(false); ImGui::Checkbox("MSAA", &msaa); ImGui::PopEnabled(); - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) + + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) ) { ImGui::SetTooltip("Texture can%s be sampled as MSAA.", msaa ? "" : "not"); } @@ -815,10 +837,12 @@ class ExamplePixelFormats : public entry::AppI uint32_t m_height; uint32_t m_debug; uint32_t m_reset; + float m_largestTextureSize = 256.0f; - float m_previewSize = 50.0f; - bool m_useAlpha = true; - bool m_animate = true; + float m_previewSize = 75.0f; + bool m_useAlpha = true; + bool m_animate = true; + bimg::TextureFormat::Enum m_selectedFormat = bimg::TextureFormat::RGBA8; bgfx::TextureHandle m_checkerboard = BGFX_INVALID_HANDLE; diff --git a/bgfx/examples/48-drawindirect/cs_drawindirect.sc b/bgfx/examples/48-drawindirect/cs_drawindirect.sc index 0e37a38e..46236180 100644 --- a/bgfx/examples/48-drawindirect/cs_drawindirect.sc +++ b/bgfx/examples/48-drawindirect/cs_drawindirect.sc @@ -9,10 +9,10 @@ BUFFER_RO(instanceDataIn, vec4, 0); // Output -BUFFER_WR(indirectBuffer, uvec4, 1); -BUFFER_WR(instanceBufferOut, vec4, 2); +BUFFER_WO(indirectBuffer, uvec4, 1); +BUFFER_WO(instanceBufferOut, vec4, 2); #ifdef INDIRECT_COUNT -BUFFER_WR(indirectCountBuffer, int, 3); +BUFFER_WO(indirectCountBuffer, int, 3); #endif uniform vec4 u_drawParams; diff --git a/bgfx/examples/48-drawindirect/drawindirect.cpp b/bgfx/examples/48-drawindirect/drawindirect.cpp index 65fffa12..84ca901c 100644 --- a/bgfx/examples/48-drawindirect/drawindirect.cpp +++ b/bgfx/examples/48-drawindirect/drawindirect.cpp @@ -146,7 +146,7 @@ class DrawIndirect : public entry::AppI init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; @@ -376,7 +376,7 @@ class DrawIndirect : public entry::AppI // This is done here for demonstration purposes // The model matrix for each instance is also set on compute - // you could modify this to, eg, do frustrum culling on the GPU + // you could modify this to, eg, do frustum culling on the GPU float ud[4] = { float(m_nDrawElements), float(m_sideSize), float(time), 0 }; uint32_t numToDraw = (m_sideSize*m_sideSize); @@ -415,7 +415,7 @@ class DrawIndirect : public entry::AppI } else { - bgfx::submit(0, m_program, m_indirect_buffer_handle, 0, uint16_t(numToDraw)); + bgfx::submit(0, m_program, m_indirect_buffer_handle, 0, numToDraw); } } else diff --git a/bgfx/examples/48-drawindirect/makefile b/bgfx/examples/48-drawindirect/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/48-drawindirect/makefile +++ b/bgfx/examples/48-drawindirect/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/49-hextile/fs_hextile.sc b/bgfx/examples/49-hextile/fs_hextile.sc index 65c88820..bfdc4ef3 100644 --- a/bgfx/examples/49-hextile/fs_hextile.sc +++ b/bgfx/examples/49-hextile/fs_hextile.sc @@ -4,18 +4,18 @@ $input v_position, v_texcoord0 * Copyright 2022 Preetish Kakkar. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ - + /* Most of the code is inspired/ported from https://github.com/mmikk/hextile-demo/blob/main/hextile-demo/shader_lighting.hlsl - + The basic idea behind the algorithm is to use tiling & blending schema but instead of regular linear blending, the algorithm uses blending operator that prevents visual artifacts caused by linear blending - + We partition the uv-space on a triangle grid and compute the local triangle and the barycentric coordinates inside the triangle. We use a hash function to associate a random offset with each vertex of the triangle grid and use this random offset to fetch the example texture. - + Finally, we blend the result using the barycentric coordinates as blending weights. - + */ #include "../common/common.sh" @@ -56,7 +56,7 @@ mat2 LoadRot2x2(vec2 idx, float rotStrength) float angle = abs(idx.x * idx.y) + abs(idx.x + idx.y) + M_PI; // remap to +/-pi - //angle = fmod(angle, 2.0*M_PI); + //angle = fmod(angle, 2.0*M_PI); if (angle < 0.0) angle += 2.0 * M_PI; if (angle > M_PI) angle -= 2.0 * M_PI; @@ -108,7 +108,7 @@ void TriangleGrid(out float w1, out float w2, out float w3, vec2 uv) { // Scaling of the input - uv *= 2.0 * sqrt(3.0); // controls the size of the input with respect to the size of the tiles. + uv *= 2.0 * sqrt(3.0); // controls the size of the input with respect to the size of the tiles. // Skew input space into simplex triangle grid const mat2 gridToSkewedGrid = @@ -157,7 +157,7 @@ void hex2colTex(out vec4 color, out vec3 weights, vec2 uv, vec2 uv3 = mul(uv - cen3, rot3) + cen3 + hash(vertex3); // Fetch input - // We could simply use texture2D function, however, the sreen space derivatives could be broken + // We could simply use texture2D function, however, the screen space derivatives could be broken // since we are using random offsets, we use texture2DGrad to make sure that we pass correct derivatives explicitly. vec4 c1 = texture2DGrad(s_trx_d, uv1, mul(dSTdx, rot1), mul(dSTdy, rot1)); @@ -175,7 +175,7 @@ void hex2colTex(out vec4 color, out vec3 weights, vec2 uv, W /= (W.x + W.y + W.z); if (r != 0.5) W = Gain3(W, r); - // blend weights with color linearly + // blend weights with color linearly // histogram preserving blending will be better but requires precompution step to create histogram texture color = W.x * c1 + W.y * c2 + W.z * c3; weights = ProduceHexWeights(W.xyz, vertex1, vertex2, vertex3); @@ -202,16 +202,16 @@ void main() vec3 sp = GetTileRate() * surfPosInWorld; vec2 uv0 = vec2(sp.x, sp.z); - - if(u_useRegularTiling > 0.0) + + if(u_useRegularTiling > 0.0) { gl_FragColor = vec4(texture2D(s_trx_d, uv0.xy)); - } - else + } + else { vec3 color, weights; FetchColorAndWeight(color, weights, uv0); - + if (u_showWeights > 0.0) { gl_FragColor = vec4(weights, 1.0); @@ -222,5 +222,5 @@ void main() } } - + } diff --git a/bgfx/examples/49-hextile/hextile.cpp b/bgfx/examples/49-hextile/hextile.cpp index 58dc2c7e..820598f2 100644 --- a/bgfx/examples/49-hextile/hextile.cpp +++ b/bgfx/examples/49-hextile/hextile.cpp @@ -85,7 +85,7 @@ namespace init.vendorId = args.m_pciId; init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle); init.platformData.ndt = entry::getNativeDisplayHandle(); - init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + init.platformData.type = entry::getNativeWindowHandleType(); init.resolution.width = m_width; init.resolution.height = m_height; init.resolution.reset = m_reset; diff --git a/bgfx/examples/49-hextile/makefile b/bgfx/examples/49-hextile/makefile index dd0194e1..303e0d83 100644 --- a/bgfx/examples/49-hextile/makefile +++ b/bgfx/examples/49-hextile/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/assets/meshes/tree1b_lod0_2.obj b/bgfx/examples/assets/meshes/tree1b_lod0_2.obj index 84b91caf..addb8d63 100644 --- a/bgfx/examples/assets/meshes/tree1b_lod0_2.obj +++ b/bgfx/examples/assets/meshes/tree1b_lod0_2.obj @@ -7585,4 +7585,3 @@ vn -0.567090 0.776659 -0.274245 vn -0.672016 0.735228 0.088511 vn -0.516133 0.848043 0.120122 vn -0.398125 0.839839 -0.369008 - diff --git a/bgfx/examples/assets/meshes/tree1b_lod1_2.obj b/bgfx/examples/assets/meshes/tree1b_lod1_2.obj index 8340869d..e34c9178 100644 --- a/bgfx/examples/assets/meshes/tree1b_lod1_2.obj +++ b/bgfx/examples/assets/meshes/tree1b_lod1_2.obj @@ -5291,4 +5291,3 @@ vn -0.516133 0.848043 0.120122 vn -0.294180 0.754159 -0.587114 vn -0.371250 0.704178 -0.605233 vn -0.672016 0.735228 0.088511 - diff --git a/bgfx/examples/assets/meshes/tree1b_lod2_2.obj b/bgfx/examples/assets/meshes/tree1b_lod2_2.obj index 75ac162b..aaa69716 100644 --- a/bgfx/examples/assets/meshes/tree1b_lod2_2.obj +++ b/bgfx/examples/assets/meshes/tree1b_lod2_2.obj @@ -2609,4 +2609,3 @@ vn -0.516133 0.848043 0.120122 vn -0.294180 0.754159 -0.587114 vn -0.523407 0.573721 -0.629991 vn -0.741276 0.667292 0.072325 - diff --git a/bgfx/examples/common/aviwriter.h b/bgfx/examples/common/aviwriter.h index 016e0122..25334f0a 100644 --- a/bgfx/examples/common/aviwriter.h +++ b/bgfx/examples/common/aviwriter.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/bgfx_utils.cpp b/bgfx/examples/common/bgfx_utils.cpp index fd9cfe9a..3e32d7a8 100644 --- a/bgfx/examples/common/bgfx_utils.cpp +++ b/bgfx/examples/common/bgfx_utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -23,7 +23,7 @@ namespace stl = tinystl; #include -void* load(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _filePath, uint32_t* _size) +void* load(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const bx::FilePath& _filePath, uint32_t* _size) { if (bx::open(_reader, _filePath) ) { @@ -39,7 +39,7 @@ void* load(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _fi } else { - DBG("Failed to open: %s.", _filePath); + DBG("Failed to open: %s.", _filePath.getCPtr() ); } if (NULL != _size) @@ -50,7 +50,7 @@ void* load(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _fi return NULL; } -void* load(const char* _filePath, uint32_t* _size) +void* load(const bx::FilePath& _filePath, uint32_t* _size) { return load(entry::getFileReader(), entry::getAllocator(), _filePath, _size); } @@ -60,7 +60,7 @@ void unload(void* _ptr) bx::free(entry::getAllocator(), _ptr); } -static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const char* _filePath) +static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const bx::FilePath& _filePath) { if (bx::open(_reader, _filePath) ) { @@ -72,11 +72,11 @@ static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const char* _filePa return mem; } - DBG("Failed to load %s.", _filePath); + DBG("Failed to load %s.", _filePath.getCPtr() ); return NULL; } -static void* loadMem(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _filePath, uint32_t* _size) +static void* loadMem(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const bx::FilePath& _filePath, uint32_t* _size) { if (bx::open(_reader, _filePath) ) { @@ -92,56 +92,54 @@ static void* loadMem(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const return data; } - DBG("Failed to load %s.", _filePath); + DBG("Failed to load %s.", _filePath.getCPtr() ); return NULL; } -static bgfx::ShaderHandle loadShader(bx::FileReaderI* _reader, const char* _name) +static bgfx::ShaderHandle loadShader(bx::FileReaderI* _reader, const bx::StringView& _name) { - char filePath[512]; - - const char* shaderPath = "???"; + bx::FilePath filePath("shaders/"); switch (bgfx::getRendererType() ) { case bgfx::RendererType::Noop: - case bgfx::RendererType::Direct3D9: shaderPath = "shaders/dx9/"; break; case bgfx::RendererType::Direct3D11: - case bgfx::RendererType::Direct3D12: shaderPath = "shaders/dx11/"; break; + case bgfx::RendererType::Direct3D12: filePath.join("dx11"); break; case bgfx::RendererType::Agc: - case bgfx::RendererType::Gnm: shaderPath = "shaders/pssl/"; break; - case bgfx::RendererType::Metal: shaderPath = "shaders/metal/"; break; - case bgfx::RendererType::Nvn: shaderPath = "shaders/nvn/"; break; - case bgfx::RendererType::OpenGL: shaderPath = "shaders/glsl/"; break; - case bgfx::RendererType::OpenGLES: shaderPath = "shaders/essl/"; break; - case bgfx::RendererType::Vulkan: shaderPath = "shaders/spirv/"; break; - case bgfx::RendererType::WebGPU: shaderPath = "shaders/spirv/"; break; + case bgfx::RendererType::Gnm: filePath.join("pssl"); break; + case bgfx::RendererType::Metal: filePath.join("metal"); break; + case bgfx::RendererType::Nvn: filePath.join("nvn"); break; + case bgfx::RendererType::OpenGL: filePath.join("glsl"); break; + case bgfx::RendererType::OpenGLES: filePath.join("essl"); break; + case bgfx::RendererType::Vulkan: filePath.join("spirv"); break; case bgfx::RendererType::Count: BX_ASSERT(false, "You should not be here!"); break; } - bx::strCopy(filePath, BX_COUNTOF(filePath), shaderPath); - bx::strCat(filePath, BX_COUNTOF(filePath), _name); - bx::strCat(filePath, BX_COUNTOF(filePath), ".bin"); + char fileName[512]; + bx::strCopy(fileName, BX_COUNTOF(fileName), _name); + bx::strCat(fileName, BX_COUNTOF(fileName), ".bin"); + + filePath.join(fileName); - bgfx::ShaderHandle handle = bgfx::createShader(loadMem(_reader, filePath) ); - bgfx::setName(handle, _name); + bgfx::ShaderHandle handle = bgfx::createShader(loadMem(_reader, filePath.getCPtr() ) ); + bgfx::setName(handle, _name.getPtr(), _name.getLength() ); return handle; } -bgfx::ShaderHandle loadShader(const char* _name) +bgfx::ShaderHandle loadShader(const bx::StringView& _name) { return loadShader(entry::getFileReader(), _name); } -bgfx::ProgramHandle loadProgram(bx::FileReaderI* _reader, const char* _vsName, const char* _fsName) +bgfx::ProgramHandle loadProgram(bx::FileReaderI* _reader, const bx::StringView& _vsName, const bx::StringView& _fsName) { bgfx::ShaderHandle vsh = loadShader(_reader, _vsName); bgfx::ShaderHandle fsh = BGFX_INVALID_HANDLE; - if (NULL != _fsName) + if (!_fsName.isEmpty() ) { fsh = loadShader(_reader, _fsName); } @@ -149,7 +147,7 @@ bgfx::ProgramHandle loadProgram(bx::FileReaderI* _reader, const char* _vsName, c return bgfx::createProgram(vsh, fsh, true /* destroy shaders when program is destroyed */); } -bgfx::ProgramHandle loadProgram(const char* _vsName, const char* _fsName) +bgfx::ProgramHandle loadProgram(const bx::StringView& _vsName, const bx::StringView& _fsName) { return loadProgram(entry::getFileReader(), _vsName, _fsName); } @@ -161,7 +159,7 @@ static void imageReleaseCb(void* _ptr, void* _userData) bimg::imageFree(imageContainer); } -bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _filePath, uint64_t _flags, uint8_t _skip, bgfx::TextureInfo* _info, bimg::Orientation::Enum* _orientation) +bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const bx::FilePath& _filePath, uint64_t _flags, uint8_t _skip, bgfx::TextureInfo* _info, bimg::Orientation::Enum* _orientation) { BX_UNUSED(_skip); bgfx::TextureHandle handle = BGFX_INVALID_HANDLE; @@ -187,6 +185,20 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _filePath, ); unload(data); + if (NULL != _info) + { + bgfx::calcTextureSize( + *_info + , uint16_t(imageContainer->m_width) + , uint16_t(imageContainer->m_height) + , uint16_t(imageContainer->m_depth) + , imageContainer->m_cubeMap + , 1 < imageContainer->m_numMips + , imageContainer->m_numLayers + , bgfx::TextureFormat::Enum(imageContainer->m_format) + ); + } + if (imageContainer->m_cubeMap) { handle = bgfx::createTextureCube( @@ -225,21 +237,8 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _filePath, if (bgfx::isValid(handle) ) { - bgfx::setName(handle, _filePath); - } - - if (NULL != _info) - { - bgfx::calcTextureSize( - *_info - , uint16_t(imageContainer->m_width) - , uint16_t(imageContainer->m_height) - , uint16_t(imageContainer->m_depth) - , imageContainer->m_cubeMap - , 1 < imageContainer->m_numMips - , imageContainer->m_numLayers - , bgfx::TextureFormat::Enum(imageContainer->m_format) - ); + const bx::StringView name(_filePath); + bgfx::setName(handle, name.getPtr(), name.getLength() ); } } } @@ -247,12 +246,12 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _filePath, return handle; } -bgfx::TextureHandle loadTexture(const char* _name, uint64_t _flags, uint8_t _skip, bgfx::TextureInfo* _info, bimg::Orientation::Enum* _orientation) +bgfx::TextureHandle loadTexture(const bx::FilePath& _filePath, uint64_t _flags, uint8_t _skip, bgfx::TextureInfo* _info, bimg::Orientation::Enum* _orientation) { - return loadTexture(entry::getFileReader(), _name, _flags, _skip, _info, _orientation); + return loadTexture(entry::getFileReader(), _filePath, _flags, _skip, _info, _orientation); } -bimg::ImageContainer* imageLoad(const char* _filePath, bgfx::TextureFormat::Enum _dstFormat) +bimg::ImageContainer* imageLoad(const bx::FilePath& _filePath, bgfx::TextureFormat::Enum _dstFormat) { uint32_t size = 0; void* data = loadMem(entry::getFileReader(), entry::getAllocator(), _filePath, &size); @@ -662,7 +661,7 @@ Mesh* meshLoad(bx::ReaderSeekerI* _reader, bool _ramcopy) return mesh; } -Mesh* meshLoad(const char* _filePath, bool _ramcopy) +Mesh* meshLoad(const bx::FilePath& _filePath, bool _ramcopy) { bx::FileReaderI* reader = entry::getFileReader(); if (bx::open(reader, _filePath) ) @@ -712,7 +711,6 @@ static RendererTypeRemap s_rendererTypeRemap[] = { { "d3d11", bgfx::RendererType::Direct3D11 }, { "d3d12", bgfx::RendererType::Direct3D12 }, - { "d3d9", bgfx::RendererType::Direct3D9 }, { "gl", bgfx::RendererType::OpenGL }, { "mtl", bgfx::RendererType::Metal }, { "noop", bgfx::RendererType::Noop }, @@ -767,10 +765,6 @@ Args::Args(int _argc, const char* const* _argv) { m_type = bgfx::RendererType::Noop; } - if (cmdLine.hasArg("d3d9") ) - { - m_type = bgfx::RendererType::Direct3D9; - } else if (cmdLine.hasArg("d3d11") ) { m_type = bgfx::RendererType::Direct3D11; diff --git a/bgfx/examples/common/bgfx_utils.h b/bgfx/examples/common/bgfx_utils.h index 03c48f65..d9c25e03 100644 --- a/bgfx/examples/common/bgfx_utils.h +++ b/bgfx/examples/common/bgfx_utils.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -18,22 +18,22 @@ namespace stl = tinystl; /// -void* load(const char* _filePath, uint32_t* _size = NULL); +void* load(const bx::FilePath& _filePath, uint32_t* _size = NULL); /// void unload(void* _ptr); /// -bgfx::ShaderHandle loadShader(const char* _name); +bgfx::ShaderHandle loadShader(const bx::StringView& _name); /// -bgfx::ProgramHandle loadProgram(const char* _vsName, const char* _fsName); +bgfx::ProgramHandle loadProgram(const bx::StringView& _vsName, const bx::StringView& _fsName); /// -bgfx::TextureHandle loadTexture(const char* _name, uint64_t _flags = BGFX_TEXTURE_NONE|BGFX_SAMPLER_NONE, uint8_t _skip = 0, bgfx::TextureInfo* _info = NULL, bimg::Orientation::Enum* _orientation = NULL); +bgfx::TextureHandle loadTexture(const bx::FilePath& _filePath, uint64_t _flags = BGFX_TEXTURE_NONE|BGFX_SAMPLER_NONE, uint8_t _skip = 0, bgfx::TextureInfo* _info = NULL, bimg::Orientation::Enum* _orientation = NULL); /// -bimg::ImageContainer* imageLoad(const char* _filePath, bgfx::TextureFormat::Enum _dstFormat); +bimg::ImageContainer* imageLoad(const bx::FilePath& _filePath, bgfx::TextureFormat::Enum _dstFormat); /// void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexLayout _layout, const uint16_t* _indices, uint32_t _numIndices); @@ -129,7 +129,7 @@ struct Mesh }; /// -Mesh* meshLoad(const char* _filePath, bool _ramcopy = false); +Mesh* meshLoad(const bx::FilePath& _filePath, bool _ramcopy = false); /// void meshUnload(Mesh* _mesh); diff --git a/bgfx/examples/common/common.h b/bgfx/examples/common/common.h index 225352e2..099c2050 100644 --- a/bgfx/examples/common/common.h +++ b/bgfx/examples/common/common.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/common.sh b/bgfx/examples/common/common.sh index 6c649feb..c820e139 100644 --- a/bgfx/examples/common/common.sh +++ b/bgfx/examples/common/common.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/cube_atlas.h b/bgfx/examples/common/cube_atlas.h index d823e63f..300275b9 100644 --- a/bgfx/examples/common/cube_atlas.h +++ b/bgfx/examples/common/cube_atlas.h @@ -1,4 +1,4 @@ -/* +/* * Copyright 2013 Jeremie Roy. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/debugdraw.cpp b/bgfx/examples/common/debugdraw/debugdraw.cpp index 201262c9..8327bdba 100644 --- a/bgfx/examples/common/debugdraw/debugdraw.cpp +++ b/bgfx/examples/common/debugdraw/debugdraw.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -1505,7 +1505,7 @@ struct DebugDrawEncoderImpl } else { - BX_STATIC_ASSERT(sizeof(DdVertex) == sizeof(bx::Vec3), ""); + static_assert(sizeof(DdVertex) == sizeof(bx::Vec3), ""); uint64_t old = attrib.m_state; attrib.m_state &= ~BGFX_STATE_CULL_MASK; @@ -2241,7 +2241,7 @@ struct DebugDrawEncoderImpl static const uint32_t kCacheSize = 1024; static const uint32_t kStackSize = 16; static const uint32_t kCacheQuadSize = 1024; - BX_STATIC_ASSERT(kCacheSize >= 3, "Cache must be at least 3 elements."); + static_assert(kCacheSize >= 3, "Cache must be at least 3 elements."); DebugVertex m_cache[kCacheSize+1]; DebugUvVertex m_cacheQuad[kCacheQuadSize]; @@ -2281,7 +2281,7 @@ struct DebugDrawEncoderImpl }; static DebugDrawEncoderImpl s_dde; -BX_STATIC_ASSERT(sizeof(DebugDrawEncoderImpl) <= sizeof(DebugDrawEncoder), "Size must match"); +static_assert(sizeof(DebugDrawEncoderImpl) <= sizeof(DebugDrawEncoder), "Size must match"); void ddInit(bx::AllocatorI* _allocator) { diff --git a/bgfx/examples/common/debugdraw/debugdraw.h b/bgfx/examples/common/debugdraw/debugdraw.h index 71dd5746..5b882056 100644 --- a/bgfx/examples/common/debugdraw/debugdraw.h +++ b/bgfx/examples/common/debugdraw/debugdraw.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_fill.bin.h b/bgfx/examples/common/debugdraw/fs_debugdraw_fill.bin.h index f6b71f58..560b276d 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_fill.bin.h +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_fill.bin.h @@ -18,77 +18,58 @@ static const uint8_t fs_debugdraw_fill_essl[112] = 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x75, // gl_FragColor = u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x33, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _params[3];.}... }; -static const uint8_t fs_debugdraw_fill_spv[749] = +static const uint8_t fs_debugdraw_fill_spv[673] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, // FSH............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // _params......... - 0x00, 0xc4, 0x02, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, // .......#........ + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // _params......... + 0x00, 0x78, 0x02, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, // .x.....#........ 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, // .O.............. 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, // .........GLSL.st 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // d.450........... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, // .main....,...5.. - 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, // ................ - 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x21, 0x00, 0x00, // .main........!.. - 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, // .UniformBlock... - 0x00, 0x06, 0x00, 0x06, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, // .....!.......u_p - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x23, 0x00, 0x00, // arams........#.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, // .........,...gl_ - 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // FragCoord....... - 0x00, 0x35, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .5...bgfx_FragDa - 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // ta0..G... ...... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....H...!...... - 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, // .#.......G...!.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // .....G...#...".. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .....G...#...!.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, // .....G...,...... - 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...5...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, // .............!.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, // ................ - 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // . .............. - 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // ............. .. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // .....+.......... - 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // ......... ...... - 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .........!... .. - 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // . ...".......!.. - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .;..."...#...... - 0x00, 0x15, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....$... ...... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+...$...%...... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .+...$...&...... - 0x00, 0x20, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...'.......... - 0x00, 0x20, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...+.......... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .;...+...,...... - 0x00, 0x20, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...4.......... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...4...5...... - 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .6.............. - 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. - 0x00, 0x27, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, // .'...M...#...%.. - 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, // .&...=.......N.. - 0x00, 0x4d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x35, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, // .M...>...5...N.. - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, // .....8.....@. -}; -static const uint8_t fs_debugdraw_fill_dx9[190] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, // FSH............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // _params......... - 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, 0x54, 0x41, // ........... .CTA - 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, // B....S.......... - 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, // .........L...0.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........<...... - 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // .u_params....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x01, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x08, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // .............. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, // .main....5...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, // ................ + 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai + 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x21, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, // n........!...Uni + 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, // formBlock....... + 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // .!.......u_param + 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // s........#...... + 0x00, 0x05, 0x00, 0x06, 0x00, 0x35, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....5...bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, // agData0..G... .. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, // .........H...!.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .....#.......G.. + 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, // .!.......G...#.. + 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, // .".......G...#.. + 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, // .!.......G...5.. + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, // .!.............. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // ..... .......... + 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, // ................ + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, // . .......+...... + 0x00, 0x1f, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, // ............. .. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, // .............!.. + 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // . ... ..."...... + 0x00, 0x21, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .!...;..."...#.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .........$... .. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, // .....+...$...%.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, // .....+...$...&.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ..... ...'...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ..... ...4...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, // .....;...4...5.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .....6.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, // ................ + 0x00, 0x41, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .A...'...M...#.. + 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .%...&...=...... + 0x00, 0x4e, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x35, 0x00, 0x00, // .N...M...>...5.. + 0x00, 0x4e, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, // .N.......8.....@ + 0x00, // . }; -static const uint8_t fs_debugdraw_fill_dx11[261] = +static const uint8_t fs_debugdraw_fill_dx11[265] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // _params......... - 0x00, 0xdc, 0x00, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xda, 0xfb, 0x8d, 0xd4, 0xad, 0x58, 0xef, // .....DXBC.....X. - 0x92, 0x13, 0x90, 0x07, 0xb7, 0x79, 0x4c, 0x38, 0x95, 0x01, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, // .....yL8........ + 0x00, 0xe0, 0x00, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xda, 0xc5, 0x2f, 0x4c, 0x40, 0x22, 0xe5, // .....DXBC../L@". + 0x26, 0x25, 0x5a, 0xa5, 0xcb, 0x8f, 0x76, 0x01, 0x1d, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, // &%Z...v......... 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, // .....,...`...... 0x00, 0x49, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGN,.......... 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // . .............. @@ -96,12 +77,12 @@ static const uint8_t fs_debugdraw_fill_dx11[261] = 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // TION.OSGN,...... 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..... .......... 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, // .............SV_ - 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x40, 0x00, 0x00, // TARGET...SHDR@.. - 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, // .@.......Y...F. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, // .........e.... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....6.... ..... - 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, // .F. .........>.. - 0x01, 0x00, 0x00, 0x40, 0x00, // ...@. + 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x44, 0x00, 0x00, // TARGET...SHEXD.. + 0x00, 0x50, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, // .P.......j...Y.. + 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, // .F. .........e.. + 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0xf2, 0x20, 0x10, // .. ......6.... . + 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .....F. ........ + 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, // .>.....@. }; static const uint8_t fs_debugdraw_fill_mtl[400] = { diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc b/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc index 80f3c1a0..1327d5c6 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.bin.h b/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.bin.h index e1e8b098..f8ca6fb9 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.bin.h +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.bin.h @@ -68,26 +68,23 @@ static const uint8_t fs_debugdraw_fill_lit_essl[518] = 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // Color = tmpvar_3 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... }; -static const uint8_t fs_debugdraw_fill_lit_spv[1597] = +static const uint8_t fs_debugdraw_fill_lit_spv[1461] = { 0x46, 0x53, 0x48, 0x0b, 0x0f, 0xc8, 0x56, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, // FSH...V_.......u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // _params......... - 0x00, 0x14, 0x06, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, // .......#........ + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // _params......... + 0x00, 0x8c, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, // .......#........ 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, // .........GLSL.st 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // d.450........... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, // .main....z...~.. - 0x00, 0x81, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, // ................ - 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x05, 0x00, 0x06, 0x00, 0x49, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // .....I...Uniform - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x49, 0x00, 0x00, // Block........I.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, // .....u_params... - 0x00, 0x05, 0x00, 0x03, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....K.......... - 0x00, 0x7a, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, // .z...gl_FragCoor - 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x76, // d........~...v_v - 0x69, 0x65, 0x77, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x77, // iew..........v_w + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, // .main........... + 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, // ................ + 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x49, 0x00, 0x00, // .main........I.. + 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, // .UniformBlock... + 0x00, 0x06, 0x00, 0x06, 0x00, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, // .....I.......u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x4b, 0x00, 0x00, // arams........K.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x77, // .............v_w 0x6f, 0x72, 0x6c, 0x64, 0x00, 0x05, 0x00, 0x06, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // orld.........bgf 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, // x_FragData0..G.. 0x00, 0x48, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // .H...........H.. @@ -95,8 +92,6 @@ static const uint8_t fs_debugdraw_fill_lit_spv[1597] = 0x00, 0x47, 0x00, 0x03, 0x00, 0x49, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .G...I.......G.. 0x00, 0x4b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .K...".......G.. 0x00, 0x4b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .K...!.......G.. - 0x00, 0x7a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .z...........G.. - 0x00, 0x7e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .~...........G.. 0x00, 0x81, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .............G.. 0x00, 0x8e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, // ................ 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....!.......... @@ -117,11 +112,8 @@ static const uint8_t fs_debugdraw_fill_lit_spv[1597] = 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, // .W......?+...L.. 0x00, 0x65, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x46, 0x00, 0x00, // .e.......+...F.. 0x00, 0x70, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, // .p....... ...q.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, // ......... ...y.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, // .........;...y.. - 0x00, 0x7a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, // .z....... ...}.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, // ......... ...}.. 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, // .........;...}.. - 0x00, 0x7e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, // .~.......;...}.. 0x00, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x8d, 0x00, 0x00, // ......... ...... 0x00, 0x03, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x8d, 0x00, 0x00, // .........;...... 0x00, 0x8e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, // .........6...... @@ -139,73 +131,44 @@ static const uint8_t fs_debugdraw_fill_lit_spv[1597] = 0x00, 0x4f, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, // .O.............. 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ 0x00, 0x94, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, // ................ - 0x00, 0xbc, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, // ................ - 0x00, 0xbd, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, // .....W.......... - 0x00, 0xc0, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, // .........W...P.. - 0x00, 0x07, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, // ................ - 0x00, 0xc0, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x4e, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, // .....A...N...... - 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .K...M...T...=.. - 0x00, 0x14, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, // .............O.. - 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. - 0x00, 0x4e, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, // .N.......K...M.. - 0x00, 0x55, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, // .U...=.......... - 0x00, 0xc5, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, // .....O.......... - 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, // ................ - 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, // ................ - 0x00, 0xc1, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x4e, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, // .....A...N...... - 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .K...M...e...=.. - 0x00, 0x14, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, // .............O.. - 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, // ................ - 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, // ................ - 0x00, 0x41, 0x00, 0x07, 0x00, 0x71, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, // .A...q.......K.. - 0x00, 0x4d, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .M...e...p...=.. - 0x00, 0x06, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, // .............Q.. - 0x00, 0x06, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, // .Q.............. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, // .....Q.......... - 0x00, 0xcc, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x14, 0x00, 0x00, // .........P...... - 0x00, 0xd6, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, // ................ - 0x00, 0xd2, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x8e, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, // .....>.......... - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, // .....8.....@. -}; -static const uint8_t fs_debugdraw_fill_lit_dx9[410] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x0f, 0xc8, 0x56, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, // FSH...V_.......u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // _params......... - 0x00, 0x74, 0x01, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, 0x54, 0x41, // .t......... .CTA - 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, // B....S.......... - 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, // .........L...0.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........<...... - 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // .u_params....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, // mpiler 10.1..Q.. - 0x05, 0x04, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........?....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x00, 0x00, 0x07, // ................ - 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xc9, 0x91, 0x5c, 0x00, 0x00, // ................ - 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, // .........[...... - 0x80, 0x00, 0x00, 0xd2, 0x90, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, // ................ - 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xd2, // ................ - 0x80, 0x00, 0x00, 0xc9, 0x80, 0x02, 0x00, 0xe4, 0x81, 0x24, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, // .........$...... - 0x80, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xe4, // ................ - 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................ - 0x80, 0x04, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, // ................ - 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x01, 0x00, 0x90, // ................ - 0x81, 0x01, 0x00, 0x90, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, // ................ - 0x80, 0x00, 0x00, 0xf9, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x07, // ................ - 0x80, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x08, // ................ - 0x80, 0x03, 0x00, 0xff, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // .......... + 0x00, 0xbc, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, // .....2.......W.. + 0x00, 0x57, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, // .W...P.......... + 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x4e, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, // .N.......K...M.. + 0x00, 0x54, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, // .T...=.......... + 0x00, 0xc2, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, // .....O.......... + 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x4e, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, // .....A...N...... + 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .K...M...U...=.. + 0x00, 0x14, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, // .............O.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, // ................ + 0x00, 0x07, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, // ................ + 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x4e, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, // .N.......K...M.. + 0x00, 0x65, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, // .e...=.......... + 0x00, 0xc9, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, // .....O.......... + 0x00, 0xca, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, // ................ + 0x00, 0xe3, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x71, 0x00, 0x00, // .........A...q.. + 0x00, 0xd1, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, // .....K...M...e.. + 0x00, 0x70, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, // .p...=.......... + 0x00, 0xd1, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, // .....Q.......... + 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, // .........Q...... + 0x00, 0xd4, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, // .............Q.. + 0x00, 0x06, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x50, 0x00, 0x07, 0x00, 0x14, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, // .P.............. + 0x00, 0xd4, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .............>.. + 0x00, 0x8e, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, // .............8.. + 0x00, 0x00, 0x00, 0x40, 0x00, // ...@. }; -static const uint8_t fs_debugdraw_fill_lit_dx11[729] = +static const uint8_t fs_debugdraw_fill_lit_dx11[733] = { 0x46, 0x53, 0x48, 0x0b, 0x0f, 0xc8, 0x56, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, // FSH...V_.......u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // _params......... - 0x00, 0xb0, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x59, 0x1c, 0xf9, 0xc6, 0x41, 0xb7, 0xae, // .....DXBCY...A.. - 0xfd, 0xa5, 0xa5, 0x0c, 0x28, 0x25, 0x0d, 0x24, 0x29, 0x01, 0x00, 0x00, 0x00, 0xb0, 0x02, 0x00, // ....(%.$)....... + 0x00, 0xb4, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xbf, 0x27, 0xf8, 0x96, 0xca, 0x6f, 0xfa, // .....DXBC.'...o. + 0xd8, 0xe5, 0x3b, 0x17, 0x64, 0x26, 0x95, 0xb3, 0xe9, 0x01, 0x00, 0x00, 0x00, 0xb4, 0x02, 0x00, // ..;.d&.......... 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, // .....,.......... 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGNh.......... 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .P.............. @@ -217,43 +180,43 @@ static const uint8_t fs_debugdraw_fill_lit_dx11[729] = 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .OSGN,.......... 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // . .............. 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, // .........SV_TARG - 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xd8, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, // ET...SHDR....@.. - 0x00, 0x76, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .v...Y...F. .... - 0x00, 0x04, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, // .....b...r...... - 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, // .e.... ......h.. - 0x02, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....6...r...... - 0x00, 0x96, 0x14, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, // .....A.......... - 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, // .r.......F...... - 0x00, 0x0b, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x26, 0x19, 0x10, // .....r.......&.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, // .....8...r...... - 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, // .F.......F...... - 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x09, 0x10, // .2...r.......&.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x96, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, // .............F.. - 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, // .A.............. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, // .....F.......F.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....D.......... - 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, // .:.......8...r.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, // .............F.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, // .F.......F. .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....2.......... - 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........@..... - 0x3f, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x0a, 0xe2, 0x00, 0x10, // ?.@.....?....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x89, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ....... ........ - 0x00, 0x06, 0x89, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ... .A.......... - 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, // .2...r.......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, // .............F. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x20, 0x10, // .........8...r . + 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xdc, 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, // ET...SHEX....P.. + 0x00, 0x77, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, // .w...j...Y...F. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, // .........b...r.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....e.... ..... + 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, // .h.......6...r.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x14, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .........A...... + 0x00, 0x7c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, // .|...r.......F.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....z...r...... + 0x00, 0x26, 0x19, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, // .&.......8...r.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, // .....F.......F.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....2...r...... + 0x00, 0x26, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x96, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, // .&.............. + 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // .F...A.......... + 0x07, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, // .........F...... + 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, // .F.......D...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, // .....:.......8.. + 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, // .r.............. + 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, // .F.............. 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, // .....F.......F. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x82, 0x20, 0x10, // .........6.... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .....:. ........ - 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, // .>.....@. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, // .........2...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, // ..............@. + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ....?.@.....?... + 0x0a, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x89, 0x20, 0x00, 0x00, 0x00, 0x00, // ........... .... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x89, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... .A...... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....2...r...... + 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, // .F. .........8.. + 0x08, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, // .r ......F...... + 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // .F. .........6.. + 0x06, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, // .. ......:. .... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, // .....>.....@. }; -static const uint8_t fs_debugdraw_fill_lit_mtl[690] = +static const uint8_t fs_debugdraw_fill_lit_mtl[697] = { 0x46, 0x53, 0x48, 0x0b, 0x0f, 0xc8, 0x56, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, // FSH...V_.......u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3b, // _params........; - 0x01, 0x89, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, // .....#include .#in 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, // clude ..using names @@ -283,18 +246,18 @@ static const uint8_t fs_debugdraw_fill_lit_mtl[690] = 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, // _mtl_u.u_params[ 0x32, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // 2].xyz, _mtl_u.u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, // _params[1].xyz, - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x28, 0x64, 0x6f, 0x74, 0x28, 0x6e, 0x6f, 0x72, 0x6d, // float3((dot(norm - 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x28, 0x64, 0x66, 0x64, 0x78, // alize(cross(dfdx - 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x29, 0x2c, 0x20, 0x64, 0x66, // (in.v_world), df - 0x64, 0x79, 0x28, 0x2d, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x29, 0x29, // dy(-in.v_world)) - 0x29, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ), _mtl_u.u_para - 0x6d, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, // ms[0].xyz) * 0.5 - 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ) + 0.5)) * _mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x33, 0x5d, 0x2e, 0x78, // _u.u_params[3].x - 0x79, 0x7a, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // yz, _mtl_u.u_par - 0x61, 0x6d, 0x73, 0x5b, 0x33, 0x5d, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, // ams[3].w);. r - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, // eturn out;.}.... - 0x40, 0x00, // @. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x64, 0x6f, 0x74, 0x28, 0x66, // float3(fma(dot(f + 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x63, // ast::normalize(c + 0x72, 0x6f, 0x73, 0x73, 0x28, 0x64, 0x66, 0x64, 0x78, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x77, // ross(dfdx(in.v_w + 0x6f, 0x72, 0x6c, 0x64, 0x29, 0x2c, 0x20, 0x64, 0x66, 0x64, 0x79, 0x28, 0x2d, 0x69, 0x6e, 0x2e, // orld), dfdy(-in. + 0x76, 0x5f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x29, 0x29, 0x29, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // v_world))), _mtl + 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x78, // _u.u_params[0].x + 0x79, 0x7a, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x29, // yz), 0.5, 0.5))) + 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // * _mtl_u.u_para + 0x6d, 0x73, 0x5b, 0x33, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ms[3].xyz, _mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5b, 0x33, 0x5d, 0x2e, 0x77, 0x29, // u.u_params[3].w) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, // ;. return out + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x40, 0x00, // ;.}....@. }; extern const uint8_t* fs_debugdraw_fill_lit_pssl; extern const uint32_t fs_debugdraw_fill_lit_pssl_size; diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc b/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc index 9489c9d5..1be5008f 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc @@ -1,7 +1,7 @@ $input v_view, v_world /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.bin.h b/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.bin.h index 75d60bda..a27c3962 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.bin.h +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.bin.h @@ -34,115 +34,92 @@ static const uint8_t fs_debugdraw_fill_texture_essl[261] = 0x72, 0x5f, 0x31, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x29, 0x3b, // r_1 * v_color0); 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... }; -static const uint8_t fs_debugdraw_fill_texture_spv[923] = +static const uint8_t fs_debugdraw_fill_texture_spv[863] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // _texColor0...... - 0x02, 0x1a, 0x00, 0x70, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, // ...p.....#...... + 0x02, 0x22, 0x00, 0x34, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, // .".4.....#...... 0x00, 0x08, 0x00, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ................ 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, // ...........GLSL. 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, // std.450......... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4f, // ...main....L...O - 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, // ...S...`........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, // ................ - 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......#...s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, // ColorSampler.... - 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...&...s_texColo - 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x4c, // rTexture.......L - 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, // ...gl_FragCoord. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // .......O...v_col - 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x53, 0x00, 0x00, 0x00, 0x76, // or0........S...v - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x60, // _texcoord0.....` - 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData - 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...#...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...#...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...&...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G...&...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G...L........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...O........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G...S........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...`........ - 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ - 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ..."...........; - 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ..."...#....... - 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...%...........; - 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, // ...%...&........ - 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4b, // ...2....... ...K - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4b, // ...........;...K - 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4b, // ...L.......;...K - 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x52, // ...O....... ...R - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x52, // ...........;...R - 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5f, // ...S....... ..._ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5f, // ...........;..._ - 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, // ...`.......6.... - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, // ................ - 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, // .......=.......$ - 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, // ...#...=.......' - 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x50, // ...&...=.......P - 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x54, // ...O...=.......T - 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0x90, // ...S...V...2.... - 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, // ...'...$...W.... - 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x85, // ...........T.... - 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x50, // ...............P - 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0xfd, // ...>...`........ - 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ...8....... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x53, // ...main....O...S + 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, // ...`............ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, // ................ + 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, // .......main..... + 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...#...s_texColo + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x26, // rSampler.......& + 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, // ...s_texColorTex + 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x76, // ture.......O...v + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x53, // _color0........S + 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, // ...v_texcoord0.. + 0x00, 0x06, 0x00, 0x60, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // ...`...bgfx_Frag + 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, // Data0..G...#..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, // .......G...#...! + 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, // .......G...&..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, // .......G...&...! + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x1e, // .......G...O.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x1e, // .......G...S.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1e, // .......G...`.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, // ...............! + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, // ................ + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, // ........... .... + 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ... ..."........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...;..."...#.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ... ...%........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, // ...;...%...&.... + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, // .......2....... + 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, // ...K...........; + 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...K...O....... + 0x00, 0x04, 0x00, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, // ...R...........; + 0x00, 0x04, 0x00, 0x52, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...R...S....... + 0x00, 0x04, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, // ..._...........; + 0x00, 0x04, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, // ..._...`.......6 + 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=.... + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...$...#...=.... + 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, // ...'...&...=.... + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, // ...P...O...=.... + 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, // ...T...S...V...2 + 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, // .......'...$...W + 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x54, // ...............T + 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x92, // ................ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00, 0x00, 0x82, // ...P...>...`.... + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // .......8....... }; -static const uint8_t fs_debugdraw_fill_texture_dx9[248] = +static const uint8_t fs_debugdraw_fill_texture_dx11[423] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, // ............. .C - 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, // TAB....S........ - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, // ...........L...0 - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, // ...........<.... - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, // ...s_texColor... - 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, // ...............p - 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, // s_3_0.Microsoft - 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, // (R) HLSL Shader - 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, // Compiler 10.1... - 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, // ................ - 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, // ................ - 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, // ...B............ - 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ........ -}; -static const uint8_t fs_debugdraw_fill_texture_dx11[432] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, // ....s_texColor0. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........p...DXBC - 0xbe, 0x78, 0xe7, 0xa5, 0x19, 0x0c, 0x70, 0xeb, 0x4c, 0xb1, 0xac, 0x1f, 0x16, 0x84, 0xe9, 0x97, // .x....p.L....... - 0x01, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....p.......,... - 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl... - 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... - 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ - 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, // ................ - 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN - 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET... - 0x53, 0x48, 0x44, 0x52, 0x94, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, // SHDR....@...%... - 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, // Z....`......X... - 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b... - 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........b...2... - 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ...... - 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, // h.......E....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // .....`......8... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... - 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // F.......>....... + 0x00, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x9f, 0xc3, 0xdd, 0xee, 0xdf, // ...|...DXBC..... + 0xe0, 0xb0, 0x54, 0xaa, 0x51, 0xec, 0xb4, 0x2a, 0xf6, 0x8e, 0x43, 0x01, 0x00, 0x00, 0x00, 0x7c, // ..T.Q..*..C....| + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, // .......,........ + 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, // ...ISGNl........ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, // ...P............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...b............ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO + 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX + 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // COORD..OSGN,.... + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S + 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xa0, // V_TARGET...SHEX. + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x5a, // ...P...(...j...Z + 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, // ....`......X.... + 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, // p......UU..b.... + 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, // .......b...2.... + 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, // ...e.... ......h + 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, // .......E.......C + 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, // U..........F.... + 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, // ...F~.......`... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...8.... ......F + 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, // .......F.......> + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ....... }; static const uint8_t fs_debugdraw_fill_texture_mtl[644] = { diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc b/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc index 9a641514..85566cf1 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_lines.bin.h b/bgfx/examples/common/debugdraw/fs_debugdraw_lines.bin.h index 24c07f8d..a1edcdae 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_lines.bin.h +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_lines.bin.h @@ -16,56 +16,40 @@ static const uint8_t fs_debugdraw_lines_essl[93] = 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, // gl_FragColor = v 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _color0;.}... }; -static const uint8_t fs_debugdraw_lines_spv[466] = +static const uint8_t fs_debugdraw_lines_spv[406] = { - 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x01, // FSH....I........ - 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x31, 0x00, // ....#.........1. + 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, // FSH....I........ + 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x31, 0x00, // ....#.........1. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // ................ 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, // ......GLSL.std.4 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // 50.............. - 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma - 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x30, 0x00, // in...."...%...0. - 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x22, 0x00, // ..main........". - 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, // ..gl_FragCoord.. - 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x25, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ......%...v_colo - 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x30, 0x00, 0x00, 0x00, 0x62, 0x67, // r0........0...bg - 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, // fx_FragData0..G. - 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, // .."...........G. - 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..%...........G. - 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, // ..0............. - 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... - 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, // .......... ..... - 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..!...........;. - 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..!...".......;. - 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..!...%....... . - 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ../...........;. - 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, // ../...0.......6. - 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, // ..........=..... - 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x30, 0x00, // ..&...%...>...0. - 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..&.......8..... - 0x00, 0x00, // .. -}; -static const uint8_t fs_debugdraw_lines_dx9[135] = -{ - 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, // FSH....I......t. - 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x14, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ..........CTAB.. - 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..#............. - 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, // ..........ps_3_0 - 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, // .Microsoft (R) H - 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, // LSL Shader Compi - 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ler 10.1........ - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, // ................ - 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ....... + 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, // in....%...0..... + 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x25, 0x00, 0x00, 0x00, 0x76, 0x5f, // in........%...v_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x30, 0x00, // color0........0. + 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, // ..bgfx_FragData0 + 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...%......... + 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...0......... + 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, // ..........!..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // .. ...!......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...!...%..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, // .. .../......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;.../...0..... + 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // ..6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......&...%...>. + 0x03, 0x00, 0x30, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..0...&.......8. + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... }; -static const uint8_t fs_debugdraw_lines_dx11[266] = +static const uint8_t fs_debugdraw_lines_dx11[270] = { - 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, // FSH....I........ - 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xa6, 0x7f, 0x08, 0xe2, 0x95, 0xbd, 0x5f, 0xa3, 0x3f, 0x5b, // ..DXBC......_.?[ - 0x58, 0x8e, 0x54, 0x0f, 0x89, 0x67, 0x01, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x03, 0x00, // X.T..g.......... + 0x46, 0x53, 0x48, 0x0b, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, // FSH....I........ + 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x50, 0xef, 0x6d, 0x1a, 0x00, 0x93, 0x06, 0x9c, 0xf0, 0x68, // ..DXBCP.m......h + 0xce, 0x7c, 0xb9, 0x39, 0x12, 0x62, 0x01, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x03, 0x00, // .|.9.b.......... 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNL...........8. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ @@ -75,11 +59,11 @@ static const uint8_t fs_debugdraw_lines_dx11[266] = 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,......... 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. ............. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR - 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x38, 0x00, 0x00, 0x00, 0x40, 0x00, // GET...SHDR8...@. - 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, // ......b......... - 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..e.... ......6. - 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, // ... ......F..... - 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ..>....... + 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x3c, 0x00, 0x00, 0x00, 0x50, 0x00, // GET...SHEX<...P. + 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, // ......j...b..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......e.... .... + 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, // ..6.... ......F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ......>....... }; static const uint8_t fs_debugdraw_lines_mtl[386] = { diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc b/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc index bb9c0d4f..a2caa601 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.bin.h b/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.bin.h index b09a4b6c..e9293f7e 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.bin.h +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.bin.h @@ -33,84 +33,58 @@ static const uint8_t fs_debugdraw_lines_stipple_essl[239] = 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, // gl_FragColor = 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // v_color0;.}... }; -static const uint8_t fs_debugdraw_lines_stipple_spv[762] = +static const uint8_t fs_debugdraw_lines_stipple_spv[694] = { - 0x46, 0x53, 0x48, 0x0b, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x02, // FSH...Z......... - 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x89, 0x00, // ....#........... + 0x46, 0x53, 0x48, 0x0b, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, // FSH...Z......... + 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x8b, 0x00, // ....#........... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // ................ 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, // ......GLSL.std.4 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // 50.............. - 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma - 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x44, 0x00, // in....=...@...D. - 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, // ..Q............. - 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, // ................ - 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ......main...... - 0x06, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, // ..=...gl_FragCoo - 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x76, 0x5f, // rd........@...v_ - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x44, 0x00, // color0........D. - 0x00, 0x00, 0x76, 0x5f, 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, // ..v_stipple..... - 0x06, 0x00, 0x51, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, // ..Q...bgfx_FragD - 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x0b, 0x00, // ata0..G...=..... - 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...@..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x44, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...D..... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...Q..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, // ..............!. - 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, // ................ - 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, // .. ............. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2f, 0x00, // ......+......./. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x00, // .....>+.......0. - 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x14, 0x00, 0x02, 0x00, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, // .....>....5... . - 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..<...........;. - 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..<...=.......;. - 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..<...@....... . - 0x04, 0x00, 0x43, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..C...........;. - 0x04, 0x00, 0x43, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..C...D....... . - 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..P...........;. - 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..P...Q.......+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x36, 0x00, // .............@6. - 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..........=..... - 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, // ..A...@...=..... - 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..E...D......... - 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x0c, 0x00, // ......E......... - 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ................ - 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x85, 0x00, // ................ - 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, // ..0............. - 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0xb8, 0x00, // ......E......... - 0x05, 0x00, 0x35, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x86, 0x00, // ..5...q.../..... - 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, // ......s......... - 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0xf8, 0x00, // ..q...r...s..... - 0x02, 0x00, 0x72, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x73, 0x00, // ..r...........s. - 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x51, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0xfd, 0x00, // ..>...Q...A..... - 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ..8....... + 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x51, 0x00, // in....@...D...Q. + 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x40, 0x00, // ..main........@. + 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..v_color0...... + 0x05, 0x00, 0x44, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 0x65, 0x00, // ..D...v_stipple. + 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x51, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // ......Q...bgfx_F + 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x40, 0x00, // ragData0..G...@. + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x44, 0x00, // ..........G...D. + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x51, 0x00, // ..........G...Q. + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, // ................ + 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, // ..!............. + 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, // ...... ......... + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..........+..... + 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x14, 0x00, 0x02, 0x00, 0x35, 0x00, // ../......>....5. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ...<......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...<...@..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x43, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, // .. ...C......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x43, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...C...D..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ...P......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;...P...Q..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+............. + 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, // .@+............. + 0x80, 0xbe, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // ..6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......A...@...=. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x85, 0x00, // ......E...D..... + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x88, 0x00, // ..........E..... + 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x06, 0x00, // ................ + 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x8a, 0x00, // ..........2..... + 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x35, 0x00, // ......E.......5. + 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0xf7, 0x00, // ..q.../......... + 0x03, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x71, 0x00, // ..s...........q. + 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x72, 0x00, // ..r...s.......r. + 0x00, 0x00, 0xfc, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x73, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..........s...>. + 0x03, 0x00, 0x51, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..Q...A.......8. + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... }; -static const uint8_t fs_debugdraw_lines_stipple_dx9[303] = +static const uint8_t fs_debugdraw_lines_stipple_dx11[450] = { - 0x46, 0x53, 0x48, 0x0b, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x01, // FSH...Z......... - 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x14, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ..........CTAB.. - 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..#............. - 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, // ..........ps_3_0 - 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, // .Microsoft (R) H - 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, // LSL Shader Compi - 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x00, 0x00, // ler 10.1..Q..... - 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, // .....@...>...>.. - 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ..Q............. - 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ................ - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, // ................ - 0x01, 0x90, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, // ................ - 0x00, 0x90, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, // ........U....... - 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0xa1, 0x01, 0x00, // ............U... - 0x00, 0x90, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, // ................ - 0xaa, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ..X............. - 0x00, 0xa0, 0x01, 0x00, 0x55, 0xa0, 0x41, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, // ....U.A......... - 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ............... -}; -static const uint8_t fs_debugdraw_lines_stipple_dx11[446] = -{ - 0x46, 0x53, 0x48, 0x0b, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, // FSH...Z......... - 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x6f, 0x8f, 0x64, 0x39, 0xd9, 0xef, 0xc7, 0x09, 0x59, 0xdc, // ..DXBCo.d9....Y. - 0x77, 0x5a, 0xe8, 0x91, 0x4c, 0x16, 0x01, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x03, 0x00, // wZ..L........... + 0x46, 0x53, 0x48, 0x0b, 0xe7, 0x1a, 0x5a, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x01, // FSH...Z......... + 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x96, 0x76, 0x5f, 0x90, 0xfe, 0x0c, 0xf6, 0xa6, 0xf8, 0x87, // ..DXBC.v_....... + 0x87, 0x78, 0x69, 0xff, 0xc8, 0x0a, 0x01, 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0x03, 0x00, // .xi............. 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, // GNl...........P. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ @@ -122,20 +96,21 @@ static const uint8_t fs_debugdraw_lines_stipple_dx11[446] = 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,......... 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. ............. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR - 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xcc, 0x00, 0x00, 0x00, 0x40, 0x00, // GET...SHDR....@. - 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, // ..3...b......... - 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x12, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, // ..b...........e. - 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, // ... ......h..... - 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x10, // ..8............. - 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x00, // .......@.....@A. - 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..2............. - 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..A........@.... - 0x80, 0x3e, 0x0a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x07, 0x12, 0x00, // .>........1..... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x0a, 0x00, // .......@.....>.. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, // ..6.... ......F. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ......>....... + 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xd0, 0x00, 0x00, 0x00, 0x50, 0x00, // GET...SHEX....P. + 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, // ..4...j...b..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x12, 0x10, 0x10, 0x00, 0x02, 0x00, // ......b......... + 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e.... ......h. + 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... + 0x00, 0x00, 0x0a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@.... + 0x80, 0x40, 0x41, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // .@A............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......A........@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x0a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x31, 0x00, // .....>........1. + 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@.... + 0x00, 0x3e, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x03, 0x0a, 0x00, // .>.............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......6.... .... + 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, // ..F.......>..... + 0x00, 0x00, // .. }; static const uint8_t fs_debugdraw_lines_stipple_mtl[532] = { @@ -162,10 +137,10 @@ static const uint8_t fs_debugdraw_lines_stipple_mtl[532] = 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // age_in]]).{. 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, // xlatMtlMain_out 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, // out = {};. if - 0x20, 0x28, 0x30, 0x2e, 0x31, 0x32, 0x35, 0x20, 0x3c, 0x20, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // (0.125 < (in.v_ - 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x2d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x35, 0x20, // stipple - (0.25 - 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x73, 0x74, 0x69, // * floor(in.v_sti - 0x70, 0x70, 0x6c, 0x65, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x29, 0x0a, 0x20, // pple * 4.0)))). + 0x20, 0x28, 0x30, 0x2e, 0x31, 0x32, 0x35, 0x20, 0x3c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x2d, 0x30, // (0.125 < fma(-0 + 0x2e, 0x32, 0x35, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // .25, floor(in.v_ + 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x2c, 0x20, // stipple * 4.0), + 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 0x65, 0x29, 0x29, 0x0a, 0x20, // in.v_stipple)). 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, // {. dis 0x63, 0x61, 0x72, 0x64, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x3b, // card_fragment(); 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, // . }. out.b diff --git a/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc b/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc index 4140391c..4be7421d 100644 --- a/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc +++ b/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc @@ -1,7 +1,7 @@ $input v_color0, v_stipple /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/makefile b/bgfx/examples/common/debugdraw/makefile index 9fe95f71..b4a4e8b3 100644 --- a/bgfx/examples/common/debugdraw/makefile +++ b/bgfx/examples/common/debugdraw/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill.bin.h b/bgfx/examples/common/debugdraw/vs_debugdraw_fill.bin.h index 111fc9ff..33f7e0e8 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill.bin.h +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill.bin.h @@ -1,8 +1,8 @@ static const uint8_t vs_debugdraw_fill_glsl[304] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x75, // VSH............u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, // ....u_model. .. + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... + 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, // ....u_model. ... 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x20, 0x75, 0x76, 0x65, 0x63, // .........in uvec 0x34, 0x20, 0x61, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3b, 0x0a, 0x69, 0x6e, 0x20, // 4 a_indices;.in 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // vec3 a_position; @@ -23,8 +23,8 @@ static const uint8_t vs_debugdraw_fill_glsl[304] = static const uint8_t vs_debugdraw_fill_essl[372] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x75, // VSH............u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, // ....u_model. .. + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... + 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, // ....u_model. ... 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x01, 0x00, 0x00, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, // .....:...precisi 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x70, 0x72, // on highp int;.pr 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, // ecision highp fl @@ -50,10 +50,10 @@ static const uint8_t vs_debugdraw_fill_essl[372] = static const uint8_t vs_debugdraw_fill_spv[1257] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model..@....... - 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, // .u_viewProj..... + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. @....... + 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, // .u_viewProj..... 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, // ...........#.... - 0x00, 0x0a, 0x00, 0x08, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, // .....f.......... + 0x00, 0x0b, 0x00, 0x08, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, // .....f.......... 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, // .............GLS 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, // L.std.450....... 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, // ................ @@ -129,48 +129,14 @@ static const uint8_t vs_debugdraw_fill_spv[1257] = 0x00, 0x40, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, // .@...e.......8.. 0x00, 0x00, 0x02, 0x0e, 0x00, 0x01, 0x00, 0x40, 0x08, // .......@. }; -static const uint8_t vs_debugdraw_fill_dx9[494] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ - 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x80, 0x00, 0x04, // .u_viewProj..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2b, // ...............+ - 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, // .CTAB........... - 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x78, 0x00, 0x00, // .............x.. - 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, // .D...........L.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // .h.......u_model - 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... - 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0xab, 0x03, 0x00, 0x03, // .u_viewProj..... - 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, // .............vs_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, // mpiler 10.1..Q.. - 0x05, 0x84, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........@....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, // ................ - 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, // ................ - 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................ - 0x80, 0x84, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x2e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, // ................ - 0xb0, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0x55, // ...............U - 0x90, 0x01, 0x20, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, // .. ............. - 0x80, 0x00, 0x20, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, // .. ............. - 0x80, 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x20, 0xe4, 0xa0, 0x00, 0x00, 0x00, // .......... ..... - 0xb0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, // ................ - 0x80, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x20, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x05, 0x00, 0x00, // ...... ......... - 0x03, 0x01, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x81, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, // .......U........ - 0x04, 0x01, 0x00, 0x0f, 0x80, 0x80, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, // ................ - 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x82, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, // ................ - 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0xe0, 0x83, 0x00, 0xe4, // ................ - 0xa0, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // .............. -}; -static const uint8_t vs_debugdraw_fill_dx11[689] = +static const uint8_t vs_debugdraw_fill_dx11[693] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x75, // VSH............u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x40, 0x00, 0x80, // ....u_model. @.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x5f, 0x41, 0xca, // .....p...DXBC_A. - 0x34, 0xb4, 0x57, 0xbe, 0x95, 0xea, 0x82, 0x43, 0x48, 0x9b, 0xc3, 0xbc, 0xdb, 0x01, 0x00, 0x00, // 4.W....CH....... - 0x00, 0x70, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, // .p.......,...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xc1, 0x2c, 0x41, // .....t...DXBC.,A + 0x2c, 0xba, 0x34, 0xb2, 0xf0, 0x52, 0xc5, 0x22, 0x4a, 0x37, 0xde, 0xd6, 0xa0, 0x01, 0x00, 0x00, // ,.4..R."J7...... + 0x00, 0x74, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, // .t.......,...... 0x00, 0xb8, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....ISGNP...... 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....8.......... 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x45, 0x00, 0x00, // .............E.. @@ -180,42 +146,42 @@ static const uint8_t vs_debugdraw_fill_dx11[689] = 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // N,........... .. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, // .....SV_POSITION - 0x00, 0x53, 0x48, 0x44, 0x52, 0xb0, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x6c, 0x00, 0x00, // .SHDR....@...l.. - 0x00, 0x59, 0x08, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, // .Y...F. ........ - 0x00, 0x5f, 0x00, 0x00, 0x03, 0x12, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, // ._..........._.. - 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, // .r.......g.... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, // .........h...... - 0x00, 0x29, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x10, // .).............. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, // ......@......8.. - 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, // .........V...... - 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // .F. ............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....2.......... - 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // .F. ............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .............F.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....2.......... - 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // .F. ............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .............F.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, // .F.......F. .... - 0x00, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, // .............8.. - 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, // .........V...... - 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .F. .........2.. - 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .........F. .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .............F.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....2.......... - 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, // .F. ............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .....F.......2.. - 0x0a, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .. ......F. .... - 0x00, 0x03, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .............F.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x0e, 0x00, 0x01, 0x00, 0x40, // .....>.........@ - 0x08, // . + 0x00, 0x53, 0x48, 0x45, 0x58, 0xb4, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x6d, 0x00, 0x00, // .SHEX....P...m.. + 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x08, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .j...Y...F. .... + 0x00, 0x84, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x12, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, // ....._.......... + 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, // ._...r.......g.. + 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, // .. ..........h.. + 0x02, 0x02, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....).......... + 0x00, 0x0a, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x02, 0x00, 0x00, // ..........@..... + 0x00, 0x38, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, // .8...........V.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, // .....F. ........ + 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, // .........2...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .....F. ........ + 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, // .F.......2...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // .....F. ........ + 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, // .F.............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, // .....F.......F. + 0x06, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, // .8...........V.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....F. ........ + 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, // .2...........F. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, // .F.......2...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....F. ........ + 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, // .........F...... + 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, // .2.... ......F. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x0e, // .F.......>...... + 0x00, 0x01, 0x00, 0x40, 0x08, // ...@. }; -static const uint8_t vs_debugdraw_fill_mtl[649] = +static const uint8_t vs_debugdraw_fill_mtl[697] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. @....... 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, // .u_viewProj..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, // .....H...#includ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, // .....x...#includ 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, // e 0x0a, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, // .#include ..using n @@ -226,7 +192,10 @@ static const uint8_t vs_debugdraw_fill_mtl[649] = 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, // loat4x4 u_model[ 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, // 32];.};..struct 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, // xlatMtlMain_out. - 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, // {. float4 gl_ + 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, // {..float bgfx_me + 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, // tal_pointSize [[ + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, // point_size]] = 1 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, // ;. float4 gl_ 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, // Position [[posit 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, // ion]];.};..struc 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, // t xlatMtlMain_in diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc b/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc index bee7f33d..7ac6ecaf 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc @@ -1,7 +1,7 @@ $input a_position, a_indices /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.bin.h b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.bin.h index 2f985f65..a31d18c2 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.bin.h +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.bin.h @@ -1,10 +1,10 @@ static const uint8_t vs_debugdraw_fill_lit_glsl[479] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x06, 0x75, // VSH.......V_...u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... - 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // u_viewProj...... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... + 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // u_viewProj...... 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, // .....u_model. .. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x69, 0x6e, 0x20, 0x75, 0x76, 0x65, // .........in uve + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x69, 0x6e, 0x20, 0x75, 0x76, 0x65, // ..........in uve 0x63, 0x34, 0x20, 0x61, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3b, 0x0a, 0x69, 0x6e, // c4 a_indices;.in 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // vec3 a_position 0x3b, 0x0a, 0x6f, 0x75, 0x74, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x76, 0x69, 0x65, // ;.out vec3 v_vie @@ -34,10 +34,10 @@ static const uint8_t vs_debugdraw_fill_lit_glsl[479] = static const uint8_t vs_debugdraw_fill_lit_essl[571] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x06, 0x75, // VSH.......V_...u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... - 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // u_viewProj...... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... + 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // u_viewProj...... 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, // .....u_model. .. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, // .........precis + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, // ..........precis 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x70, // ion highp int;.p 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, // recision highp f 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x69, 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x75, // loat;.in highp u @@ -73,11 +73,11 @@ static const uint8_t vs_debugdraw_fill_lit_essl[571] = static const uint8_t vs_debugdraw_fill_lit_spv[1674] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x07, 0x75, // VSH.......V_...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model.......... - 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x40, 0x00, 0x04, // .u_viewProj..@.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x00, 0x00, 0x00, // ......u_view.... + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ + 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x40, 0x00, 0x04, // .u_viewProj..@.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, // ......u_view.... 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x06, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ......8.....#... - 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ + 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, // ..............GL 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // SL.std.450...... 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0a, 0x00, 0x00, 0x00, // ................ @@ -178,59 +178,15 @@ static const uint8_t vs_debugdraw_fill_lit_spv[1674] = 0x03, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..[...........8. 0x01, 0x00, 0x00, 0x02, 0x0e, 0x00, 0x01, 0x00, 0x80, 0x08, // .......... }; -static const uint8_t vs_debugdraw_fill_lit_dx9[651] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x07, 0x75, // VSH.......V_...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ - 0x06, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // .u_view......... - 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x84, 0x00, // ..u_viewProj.... - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, // ......@......... - 0x32, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x03, // 2.CTAB.......... - 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x93, 0x00, // ................ - 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x60, 0x00, // ..X...........`. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x02, 0x00, 0x80, 0x00, 0x04, 0x00, // ......p......... - 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x02, 0x00, // ..x............. - 0x84, 0x00, 0x04, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......x.......u_ - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x00, // model......... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x00, 0xab, 0x03, 0x00, // ......u_view.... - 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ..............u_ - 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, // viewProj.vs_3_0. - 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, // Microsoft (R) HL - 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, // SL Shader Compil - 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x88, 0x00, // er 10.1...Q..... - 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....@.......... - 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, // ................ - 0x07, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x02, 0x00, 0x07, 0xe0, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x88, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x2e, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x01, 0xb0, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x0f, 0x80, 0x01, 0x00, 0x55, 0x90, 0x01, 0x20, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, // ....U.. ........ - 0x00, 0x05, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x20, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, // ....... ........ - 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x20, // ............... - 0xe4, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................ - 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x20, 0xe4, 0xa0, 0x00, 0x00, // ........... .... - 0x00, 0xb0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x85, 0x00, // ............U... - 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x84, 0x00, 0xe4, 0xa0, 0x00, 0x00, // ................ - 0x00, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x86, 0x00, // ................ - 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x0f, 0xe0, 0x87, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, // ................ - 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0x55, 0x80, 0x81, 0x00, 0xe4, 0xa0, 0x04, 0x00, // ........U....... - 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x80, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x82, 0x00, 0xe4, 0xa0, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0xe0, 0x83, 0x00, // ................ - 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, // ................ - 0x07, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ........... -}; -static const uint8_t vs_debugdraw_fill_lit_dx11[962] = +static const uint8_t vs_debugdraw_fill_lit_dx11[966] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x06, 0x75, // VSH.......V_...u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x40, 0x00, 0x04, 0x00, // u_viewProj..@... 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x80, 0x00, // .....u_model. .. - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x7c, 0x27, // ......p...DXBC|' - 0x35, 0x24, 0x2d, 0xe2, 0xb8, 0x12, 0x5c, 0xed, 0xf0, 0xe1, 0x5d, 0x10, 0xd9, 0xf9, 0x01, 0x00, // 5$-.......]..... - 0x00, 0x00, 0x70, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, // ..p.......,..... + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x7f, 0xfc, // ......t...DXBC.. + 0xb7, 0xb9, 0x58, 0x00, 0xe1, 0xb1, 0x35, 0x7a, 0x1d, 0xaa, 0x54, 0x9b, 0xee, 0x41, 0x01, 0x00, // ..X...5z..T..A.. + 0x00, 0x00, 0x74, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, // ..t.......,..... 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, // ......ISGNP..... 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......8......... 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x45, 0x00, // ..............E. @@ -244,55 +200,55 @@ static const uint8_t vs_debugdraw_fill_lit_dx11[962] = 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ................ 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, // ......SV_POSITIO 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, // N.TEXCOORD....SH - 0x44, 0x52, 0x74, 0x02, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x59, 0x08, // DRt...@.......Y. - 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x5f, 0x00, // ..F. ........._. - 0x00, 0x03, 0x12, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, // .........._...r. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......g.... .... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, // ......e...r .... - 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e...r ......h. - 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......)......... - 0x00, 0x00, 0x0a, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x02, 0x00, // ...........@.... - 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x15, // ..8...........V. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, // ......F. ....... - 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0xf2, 0x00, // ..........2..... - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // ......F. ....... - 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0xf2, 0x00, // ..F.......2..... - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......F. ....... - 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, // ..F............. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, // ......F.......F. - 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ............... - 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, // ..8...........V. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ......F. ....... - 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, // ..2...........F. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, // ............... - 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, // ..F.......2..... - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ......F. ....... - 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, // ..........F..... - 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ..2.... ......F. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, // ............... - 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, // ..F.......8...r. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, // ......V.......F. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, // .........2...r. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F. ....... - 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, // ..........F..... - 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, // ..2...r.......F. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, // ............... - 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x20, // ..F.......2...r - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ......F. ....... - 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, // ..........F..... - 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, // ..6...r ......F. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x0e, 0x00, 0x01, 0x00, // ......>......... - 0x80, 0x08, // .. + 0x45, 0x58, 0x78, 0x02, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x6a, 0x08, // EXx...P.......j. + 0x00, 0x01, 0x59, 0x08, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, // ..Y...F. ....... + 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x12, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, // .._..........._. + 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, // ..r.......g.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, // ..........e...r + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, // ......e...r .... + 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x07, 0x12, 0x00, // ..h.......)..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, // ......8......... + 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, // ..V.......F. ... + 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, // ..........F. ... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, // ................ + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. + 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, // ..........F. ... + 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x1a, // ................ + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F......... + 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, // ..........F..... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..F. ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, // ......8......... + 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ... + 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, // ......2......... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, // ..F. ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. + 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ... + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......2.... .... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, 0x0f, // ..F. ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, // ......F.......8. + 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, // ..r.......V..... + 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2. + 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..r.......F. ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ..............F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......2...r..... + 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x0a, // ..F. ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. + 0x00, 0x0a, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..r ......F. ... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ..............F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, // ......6...r .... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, // ..F.......>..... + 0x0e, 0x00, 0x01, 0x00, 0x80, 0x08, // ...... }; -static const uint8_t vs_debugdraw_fill_lit_mtl[925] = +static const uint8_t vs_debugdraw_fill_lit_mtl[973] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x07, 0x75, // VSH.......V_...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x40, 0x00, 0x04, // .u_viewProj..@.. 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, // ......u_view.... - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, // ......K...#inclu + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, // ......{...#inclu 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, // de .#include ..using @@ -304,7 +260,10 @@ static const uint8_t vs_debugdraw_fill_lit_mtl[925] = 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, // . float4x4 u_ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, // model[32];.};..s 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // truct xlatMtlMai - 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // n_out.{. floa + 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, // n_out.{..float b + 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, // gfx_metal_pointS + 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, // ize [[point_size + 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // ]] = 1;. floa 0x74, 0x33, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, // t3 _entryPointOu 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x20, 0x5b, 0x5b, 0x75, 0x73, // tput_v_view [[us 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, // er(locn0)]];. diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc index 9d6f483e..e1cbed47 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc @@ -2,7 +2,7 @@ $input a_position, a_indices $output v_view, v_world /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.bin.h b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.bin.h index 712eb851..2101d9fc 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.bin.h +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.bin.h @@ -1,10 +1,10 @@ static const uint8_t vs_debugdraw_fill_lit_mesh_glsl[459] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x06, 0x75, // VSH.......V_...u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... - 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // u_viewProj...... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... + 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // u_viewProj...... 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, // .....u_model. .. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, // .........attrib + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, // ..........attrib 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // ute vec3 a_posit 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, // ion;.varying vec 0x33, 0x20, 0x76, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, // 3 v_view;.varyin @@ -33,10 +33,10 @@ static const uint8_t vs_debugdraw_fill_lit_mesh_glsl[459] = static const uint8_t vs_debugdraw_fill_lit_mesh_essl[501] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x06, 0x75, // VSH.......V_...u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... - 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // u_viewProj...... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... + 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // u_viewProj...... 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, // .....u_model. .. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, // .........attrib + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, // ..........attrib 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, // ute highp vec3 a 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // _position;.varyi 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, // ng highp vec3 v_ @@ -68,11 +68,11 @@ static const uint8_t vs_debugdraw_fill_lit_mesh_essl[501] = static const uint8_t vs_debugdraw_fill_lit_mesh_spv[1532] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x07, 0x75, // VSH.......V_...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // _model.......... - 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x40, 0x00, 0x04, // .u_viewProj..@.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x00, 0x00, 0x00, // ......u_view.... + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x01, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // _model.......... + 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x40, 0x00, 0x04, // .u_viewProj..@.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, // ......u_view.... 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ............#... - 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ......v......... + 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ......v......... 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, // ..............GL 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // SL.std.450...... 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x00, 0x00, // ................ @@ -164,54 +164,15 @@ static const uint8_t vs_debugdraw_fill_lit_mesh_spv[1532] = 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0xfd, 0x00, // ..>...M...u..... 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0xc0, 0x00, // ..8......... }; -static const uint8_t vs_debugdraw_fill_lit_mesh_dx9[571] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x07, 0x75, // VSH.......V_...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ - 0x06, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // .u_view......... - 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x04, 0x00, // ..u_viewProj.... - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, // ................ - 0x32, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x03, // 2.CTAB.......... - 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x93, 0x00, // ................ - 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x60, 0x00, // ..X...........`. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, // ......p......... - 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x02, 0x00, // ..x............. - 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......x.......u_ - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x00, // model......... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x00, 0xab, 0x03, 0x00, // ......u_view.... - 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ..............u_ - 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, // viewProj.vs_3_0. - 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, // Microsoft (R) HL - 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, // SL Shader Compil - 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // er 10.1......... - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x07, 0xe0, 0x1f, 0x00, // ................ - 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x02, 0x00, 0x07, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x0f, 0x80, 0x09, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ........U....... - 0x0f, 0x80, 0x08, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, // ................ - 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x0a, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, // ................ - 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x0b, 0x00, // ................ - 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, // ............U... - 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x04, 0x00, 0xe4, 0xa0, 0x00, 0x00, // ................ - 0x00, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x06, 0x00, // ................ - 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x0f, 0xe0, 0x07, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, // ................ - 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x04, 0x00, // ........U....... - 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0xe0, 0x03, 0x00, // ................ - 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, // ................ - 0x07, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ........... -}; -static const uint8_t vs_debugdraw_fill_lit_mesh_dx11[852] = +static const uint8_t vs_debugdraw_fill_lit_mesh_dx11[856] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x06, 0x75, // VSH.......V_...u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // _view........... 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x40, 0x00, 0x04, 0x00, // u_viewProj..@... 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x80, 0x00, // .....u_model. .. - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x7f, 0x42, // ..........DXBC.B - 0xf4, 0xce, 0x08, 0xe2, 0x05, 0xc2, 0x2c, 0xa2, 0x28, 0x50, 0x19, 0x35, 0xb8, 0x0d, 0x01, 0x00, // ......,.(P.5.... - 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, // ..........,...`. + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x62, 0x77, // ..........DXBCbw + 0x2b, 0x2a, 0x18, 0xd4, 0x1f, 0x7f, 0x99, 0x8a, 0xb5, 0xbb, 0xcd, 0x43, 0x54, 0x3f, 0x01, 0x00, // +*.........CT?.. + 0x00, 0x00, 0x08, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, // ..........,...`. 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, // ......ISGN,..... 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ......... 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x50, 0x4f, // ..............PO @@ -222,51 +183,51 @@ static const uint8_t vs_debugdraw_fill_lit_mesh_dx11[852] = 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x08, // ................ 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, // ..SV_POSITION.TE - 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x2c, 0x02, // XCOORD....SHDR,. - 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, // ..@.......Y...F. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, // ........._...r. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......g.... .... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, // ......e...r .... - 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e...r ......h. - 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... - 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ... - 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... - 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x10, // ..F. ........... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. - 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ... - 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ... - 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, // ......8......... - 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ... - 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, // ......2......... - 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, // ..F. ........... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. - 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ... - 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......2.... .... - 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, 0x0f, // ..F. ........... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, // ......F.......8. - 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, // ..r.......V..... - 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2. - 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..r.......F. ... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ..............F. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......2...r..... - 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x0a, // ..F. ........... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. - 0x00, 0x0a, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..r ......F. ... - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ..............F. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, // ......6...r .... - 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x01, // ..F.......>..... - 0x01, 0x00, 0x80, 0x08, // .... + 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x30, 0x02, // XCOORD....SHEX0. + 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, // ..P.......j...Y. + 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x5f, 0x00, // ..F. ........._. + 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, // ..r.......g.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, // ..........e...r + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, // ......e...r .... + 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, // ..h.......8..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ......V.......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, // .........2..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // ......F. ....... + 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ..........F..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ..2...........F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x00, // ..F............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ......F.......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, // .........8..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ......V.......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, // .........2..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, // ......F. ....... + 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, // ..........F..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, // ..2...........F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x20, // ..F.......2.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, // ......F. ....... + 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, // ..........F..... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, // ..8...r.......V. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ......F. ....... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, // ..2...r.......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, // ..F.......2...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, // ......F. ....... + 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, // ..........F..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, // ..2...r ......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, // ..F.......6...r + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......F.......>. + 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x80, 0x08, // ........ }; -static const uint8_t vs_debugdraw_fill_lit_mesh_mtl[867] = +static const uint8_t vs_debugdraw_fill_lit_mesh_mtl[915] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x56, 0x5f, 0x03, 0x00, 0x07, 0x75, // VSH.......V_...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x01, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // _model.......... 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x40, 0x00, 0x04, // .u_viewProj..@.. 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x04, 0x01, 0x00, 0x00, // ......u_view.... - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, // ..........#inclu + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, // ......C...#inclu 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, // de .#include ..using @@ -278,7 +239,10 @@ static const uint8_t vs_debugdraw_fill_lit_mesh_mtl[867] = 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, // . float4x4 u_ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, // model[32];.};..s 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // truct xlatMtlMai - 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // n_out.{. floa + 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, // n_out.{..float b + 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, // gfx_metal_pointS + 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, // ize [[point_size + 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // ]] = 1;. floa 0x74, 0x33, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, // t3 _entryPointOu 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x20, 0x5b, 0x5b, 0x75, 0x73, // tput_v_view [[us 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, // er(locn0)]];. diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc index 25e55547..a590646f 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc @@ -2,7 +2,7 @@ $input a_position $output v_view, v_world /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.bin.h b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.bin.h index 98ec9874..b7ef5acb 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.bin.h +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.bin.h @@ -1,8 +1,8 @@ static const uint8_t vs_debugdraw_fill_mesh_glsl[276] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x75, // VSH............u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, // ....u_model. .. + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... + 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, // ....u_model. ... 0x00, 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, // .........attribu 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // te vec3 a_positi 0x6f, 0x6e, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, // on;.uniform mat4 @@ -22,8 +22,8 @@ static const uint8_t vs_debugdraw_fill_mesh_glsl[276] = static const uint8_t vs_debugdraw_fill_mesh_essl[294] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x75, // VSH............u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, // ....u_model. .. + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... + 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, // ....u_model. ... 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, // .........attribu 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, // te highp vec3 a_ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // position;.unifor @@ -44,10 +44,10 @@ static const uint8_t vs_debugdraw_fill_mesh_essl[294] = static const uint8_t vs_debugdraw_fill_mesh_spv[1115] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x00, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // _model..@....... - 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, // .u_viewProj..... + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x01, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // _model..@....... + 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, // .u_viewProj..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, // ...........#.... - 0x00, 0x0a, 0x00, 0x08, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, // .....U.......... + 0x00, 0x0b, 0x00, 0x08, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, // .....U.......... 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, // .............GLS 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, // L.std.450....... 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, // ................ @@ -114,81 +114,52 @@ static const uint8_t vs_debugdraw_fill_mesh_spv[1115] = 0x00, 0x3e, 0x00, 0x03, 0x00, 0x34, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, // .>...4...T...... 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x80, 0x00, // .8......... }; -static const uint8_t vs_debugdraw_fill_mesh_dx9[414] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ - 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, // .u_viewProj..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2b, // .....d.........+ - 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, // .CTAB........... - 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x78, 0x00, 0x00, // .............x.. - 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, // .D...........L.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // .h.......u_model - 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... - 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0xab, 0x03, 0x00, 0x03, // .u_viewProj..... - 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, // .............vs_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x05, 0x00, 0xe4, // ................ - 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x04, 0x00, 0xe4, // ...U............ - 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, // ................ - 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, // ................ - 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x07, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, // ................ - 0x03, 0x01, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, // .......U........ - 0x04, 0x01, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, // ................ - 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, // ................ - 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0xe0, 0x03, 0x00, 0xe4, // ................ - 0xa0, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // .............. -}; -static const uint8_t vs_debugdraw_fill_mesh_dx11[579] = +static const uint8_t vs_debugdraw_fill_mesh_dx11[583] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x75, // VSH............u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x40, 0x00, 0x80, // ....u_model. @.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xb0, 0x1d, 0x55, // .........DXBC..U - 0xd7, 0x6c, 0x8e, 0xc2, 0xec, 0x7e, 0xf8, 0x30, 0x3a, 0xf1, 0x83, 0x0f, 0x9a, 0x01, 0x00, 0x00, // .l...~.0:....... - 0x00, 0x04, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, // .........,...`.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x3d, 0x96, 0xb2, // .........DXBC=.. + 0x35, 0xcf, 0xb2, 0xe8, 0x90, 0xa2, 0x76, 0xc8, 0x55, 0xd8, 0xbf, 0xe2, 0xa9, 0x01, 0x00, 0x00, // 5.....v.U....... + 0x00, 0x08, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, // .........,...`.. 0x00, 0x94, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....ISGN,...... 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..... .......... 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x50, 0x4f, 0x53, // .............POS 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, // ITION....OSGN,.. 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // ................ - 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x53, 0x48, 0x44, // .SV_POSITION.SHD - 0x52, 0x68, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, // Rh...@...Z...Y.. - 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, // .F. ........._.. - 0x03, 0x72, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, // .r.......g.... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, // .........h...... - 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, // .8...........V.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, // .....F. ........ - 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, // .2...........F. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, // .F.......2...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // .....F. ........ - 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, // .........F...... - 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .............F.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, // .....F. ........ - 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, // .8...........V.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....F. ........ - 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, // .2...........F. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, // .F.......2...... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....F. ........ - 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, // .........F...... - 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, // .2.... ......F. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, // .F.......>...... - 0x00, 0x40, 0x08, // .@. + 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x53, 0x48, 0x45, // .SV_POSITION.SHE + 0x58, 0x6c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, // Xl...P...[...j.. + 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .Y...F. ........ + 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, // ._...r.......g.. + 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, // .. ..........h.. + 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....8.......... + 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .V.......F. .... + 0x00, 0x05, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....2.......... + 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, // .F. ............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .....F.......2.. + 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .........F. .... + 0x00, 0x06, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .............F.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .F.......F. .... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....8.......... + 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .V.......F. .... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....2.......... + 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, // .F. ............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .....F.......2.. + 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .........F. .... + 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .............F.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....2.... ..... + 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, // .F. ............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, // .....F.......>.. + 0x01, 0x00, 0x01, 0x01, 0x00, 0x40, 0x08, // .....@. }; -static const uint8_t vs_debugdraw_fill_mesh_mtl[591] = +static const uint8_t vs_debugdraw_fill_mesh_mtl[639] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x01, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // _model..@....... 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, // .u_viewProj..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, // .........#includ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, // .....@...#includ 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, // e 0x0a, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, // .#include ..using n @@ -199,7 +170,10 @@ static const uint8_t vs_debugdraw_fill_mesh_mtl[591] = 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, // loat4x4 u_model[ 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, // 32];.};..struct 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, // xlatMtlMain_out. - 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, // {. float4 gl_ + 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, // {..float bgfx_me + 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, // tal_pointSize [[ + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, // point_size]] = 1 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, // ;. float4 gl_ 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, // Position [[posit 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, // ion]];.};..struc 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, // t xlatMtlMain_in diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc index 1b3e3807..f1a23b73 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc @@ -1,7 +1,7 @@ $input a_position /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.bin.h b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.bin.h index 4e4e85d2..86f90884 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.bin.h +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_debugdraw_fill_texture_glsl[386] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........U...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........U...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec3 a_position;. @@ -30,7 +30,7 @@ static const uint8_t vs_debugdraw_fill_texture_essl[428] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // bute highp vec3 @@ -59,9 +59,9 @@ static const uint8_t vs_debugdraw_fill_texture_essl[428] = static const uint8_t vs_debugdraw_fill_texture_spv[1270] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........r....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........r....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, // ................ @@ -139,39 +139,13 @@ static const uint8_t vs_debugdraw_fill_texture_spv[1270] = 0x40, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, // @.......8....... 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ....@. }; -static const uint8_t vs_debugdraw_fill_texture_dx9[357] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........8....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x03, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, // ................ - 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, // ................ - 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0xe0, 0x02, 0x00, 0xe4, 0x90, // ................ - 0xff, 0xff, 0x00, 0x00, 0x00, // ..... -}; -static const uint8_t vs_debugdraw_fill_texture_dx11[630] = +static const uint8_t vs_debugdraw_fill_texture_dx11[634] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........@...DXBC - 0x25, 0x0b, 0xbc, 0xf2, 0xf1, 0x2f, 0x13, 0x1a, 0x84, 0x83, 0x08, 0xf9, 0x08, 0xa1, 0x2c, 0x84, // %..../........,. - 0x01, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....@.......,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........D...DXBC + 0xd0, 0x9b, 0x3a, 0x6d, 0x78, 0xfa, 0x92, 0xb6, 0x87, 0xe3, 0xb4, 0x17, 0xb7, 0x55, 0x19, 0x9b, // ..:mx........U.. + 0x01, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....D.......,... 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, // ........ISGNh... 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -186,33 +160,33 @@ static const uint8_t vs_debugdraw_fill_texture_dx11[630] = 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x28, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // (...@...J...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // ........_...r... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._...2....... - 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // g.... .......... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // 2 ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // F.......2....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....F. ......... - 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ..... ......F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....F. ......... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....6...2 ...... - 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, // F.......>....... - 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ....@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x2c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ,...P...K...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // r......._...2... + 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e...2 ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // ....F.......2... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F. ..... + 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, // F.......6...2 .. + 0x02, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>... + 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ........@. }; -static const uint8_t vs_debugdraw_fill_texture_mtl[842] = +static const uint8_t vs_debugdraw_fill_texture_mtl[890] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........D...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -222,6 +196,9 @@ static const uint8_t vs_debugdraw_fill_texture_mtl[842] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc index 7c72921a..7923be39 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0, a_color0 $output v_texcoord0, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_lines.bin.h b/bgfx/examples/common/debugdraw/vs_debugdraw_lines.bin.h index 8fce9a51..3b15ea67 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_lines.bin.h +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_lines.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_debugdraw_lines_glsl[303] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec3 a_position;. @@ -24,7 +24,7 @@ static const uint8_t vs_debugdraw_lines_essl[333] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........ ...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........ ...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // bute highp vec3 @@ -47,9 +47,9 @@ static const uint8_t vs_debugdraw_lines_essl[333] = static const uint8_t vs_debugdraw_lines_spv[1060] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........_....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........_....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, // ................ @@ -114,37 +114,13 @@ static const uint8_t vs_debugdraw_lines_spv[1060] = 0x30, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x02, 0x05, 0x00, // 0.......8....... 0x01, 0x00, 0x40, 0x00, // ..@. }; -static const uint8_t vs_debugdraw_lines_dx9[321] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ................ - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ................ - 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ......U......... - 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, // ................ - 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................ - 0x00, // . -}; -static const uint8_t vs_debugdraw_lines_dx11[520] = +static const uint8_t vs_debugdraw_lines_dx11[524] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0x32, 0x9b, 0xdd, 0xb5, 0xa9, 0xb7, 0x22, 0xf0, 0xcf, 0x5e, 0x34, 0x2c, 0x72, 0xf0, 0x87, 0x00, // 2....."..^4,r... - 0x01, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC + 0x19, 0x40, 0x51, 0x48, 0x64, 0xf0, 0x4f, 0x1e, 0x9e, 0x94, 0x2e, 0xc7, 0x38, 0x04, 0x0f, 0xf4, // .@QHd.O.....8... + 0x01, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... 0x7c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x48, 0x00, 0x00, 0x00, // |.......ISGNH... 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........8....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -155,30 +131,30 @@ static const uint8_t vs_debugdraw_lines_dx11[520] = 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // D............... 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT - 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, // ION.COLOR...SHDR - 0xfc, 0x00, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...?...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // ........_...r... - 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... - 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... - 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, // h.......8....... - 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....V.......F. . - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // ........2....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....F. ......... - 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // F............ .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. . - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>... - 0x00, 0x02, 0x05, 0x00, 0x01, 0x00, 0x40, 0x00, // ......@. + 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, // ION.COLOR...SHEX + 0x00, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...@...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, // r.......g.... .. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... .. + 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....h.......8... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........V....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // F. .........2... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ....F........... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // F. .........6... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x05, 0x00, 0x01, 0x00, 0x40, 0x00, // >.........@. }; -static const uint8_t vs_debugdraw_lines_mtl[685] = +static const uint8_t vs_debugdraw_lines_mtl[733] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, // VSH........I...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........y...#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa9, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -188,6 +164,9 @@ static const uint8_t vs_debugdraw_lines_mtl[685] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc b/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc index 850384f6..4b754fad 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.bin.h b/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.bin.h index c35e375c..91862d48 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.bin.h +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_debugdraw_lines_stipple_glsl[385] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x1a, 0x5a, 0xef, 0x01, 0x00, 0x0f, 0x75, // VSH.......Z....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........T...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........T...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec3 a_position;. @@ -30,7 +30,7 @@ static const uint8_t vs_debugdraw_lines_stipple_essl[427] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x1a, 0x5a, 0xef, 0x01, 0x00, 0x0f, 0x75, // VSH.......Z....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........~...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........~...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // bute highp vec3 @@ -59,9 +59,9 @@ static const uint8_t vs_debugdraw_lines_stipple_essl[427] = static const uint8_t vs_debugdraw_lines_stipple_spv[1286] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x1a, 0x5a, 0xef, 0x01, 0x00, 0x0f, 0x75, // VSH.......Z....u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........y....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........y....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, // ................ @@ -140,39 +140,13 @@ static const uint8_t vs_debugdraw_lines_stipple_spv[1286] = 0x78, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, // x.......8....... 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ....@. }; -static const uint8_t vs_debugdraw_lines_stipple_dx9[357] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x1a, 0x5a, 0xef, 0x01, 0x00, 0x0f, 0x75, // VSH.......Z....u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........8....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x01, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, // ................ - 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, // ................ - 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0xe0, 0x02, 0x00, 0x00, 0x90, // ................ - 0xff, 0xff, 0x00, 0x00, 0x00, // ..... -}; -static const uint8_t vs_debugdraw_lines_stipple_dx11[630] = +static const uint8_t vs_debugdraw_lines_stipple_dx11[634] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x1a, 0x5a, 0xef, 0x01, 0x00, 0x0f, 0x75, // VSH.......Z....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........@...DXBC - 0xdc, 0x27, 0x18, 0xb1, 0x2d, 0xea, 0xb1, 0x79, 0x0a, 0x20, 0xf3, 0x0f, 0x0b, 0xfd, 0x09, 0x50, // .'..-..y. .....P - 0x01, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....@.......,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........D...DXBC + 0x5d, 0x00, 0x31, 0xee, 0x19, 0xa0, 0x64, 0x50, 0xc2, 0x8d, 0x1f, 0xf2, 0x10, 0x67, 0x35, 0xab, // ].1...dP.....g5. + 0x01, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....D.......,... 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, // ........ISGNh... 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -187,33 +161,33 @@ static const uint8_t vs_debugdraw_lines_stipple_dx11[630] = 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x28, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // (...@...J...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // ........_...r... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x12, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._........... - 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // g.... .......... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0x12, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // F.......2....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....F. ......... - 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ..... ......F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....F. ......... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x12, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....6.... ...... - 0x0a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, // ........>....... - 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ....@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x2c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ,...P...K...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x12, 0x10, 0x10, 0x00, // r......._....... + 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0x12, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // ....F.......2... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F. ..... + 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x12, 0x20, 0x10, 0x00, // F.......6.... .. + 0x02, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ............>... + 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ........@. }; -static const uint8_t vs_debugdraw_lines_stipple_mtl[839] = +static const uint8_t vs_debugdraw_lines_stipple_mtl[887] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x1a, 0x5a, 0xef, 0x01, 0x00, 0x0f, 0x75, // VSH.......Z....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........A...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -223,6 +197,9 @@ static const uint8_t vs_debugdraw_lines_stipple_mtl[839] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc b/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc index cc559096..a448eef0 100644 --- a/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc +++ b/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, a_texcoord0 $output v_color0, v_stipple /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/entry/cmd.cpp b/bgfx/examples/common/entry/cmd.cpp index c80b64d5..59cacba9 100644 --- a/bgfx/examples/common/entry/cmd.cpp +++ b/bgfx/examples/common/entry/cmd.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/entry/cmd.h b/bgfx/examples/common/entry/cmd.h index cd1e611b..ea793836 100644 --- a/bgfx/examples/common/entry/cmd.h +++ b/bgfx/examples/common/entry/cmd.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/entry/dbg.h b/bgfx/examples/common/entry/dbg.h index 6ac2c417..95b826a4 100644 --- a/bgfx/examples/common/entry/dbg.h +++ b/bgfx/examples/common/entry/dbg.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/entry/dialog.cpp b/bgfx/examples/common/entry/dialog.cpp index 913cc8a1..a6d0d4f0 100644 --- a/bgfx/examples/common/entry/dialog.cpp +++ b/bgfx/examples/common/entry/dialog.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -68,7 +68,7 @@ void openUrl(const bx::StringView& _url) #if BX_PLATFORM_WINDOWS void* result = ShellExecuteA(NULL, NULL, tmp, NULL, NULL, false); BX_UNUSED(result); -#elif !BX_PLATFORM_IOS +#elif !BX_PLATFORM_IOS && !BX_PLATFORM_VISIONOS int32_t result = system(tmp); BX_UNUSED(result); #endif // BX_PLATFORM_* @@ -78,19 +78,24 @@ class Split { public: Split(const bx::StringView& _str, char _ch) - : m_str(_str) - , m_token(_str.getPtr(), bx::strFind(_str, _ch).getPtr() ) - , m_ch(_ch) + : m_str(_str) + , m_token(_str.getPtr(), bx::strFind(_str, _ch).getPtr() ) + , m_ch(_ch) { } bx::StringView next() { bx::StringView result = m_token; + m_token = bx::strTrim( - bx::StringView(m_token.getTerm()+1, bx::strFind(bx::StringView(m_token.getTerm()+1, m_str.getTerm() ), m_ch).getPtr() ) + bx::StringView( + m_token.getTerm()+1 + , bx::strFind(bx::StringView(m_token.getTerm()+1, m_str.getTerm() ), m_ch).getPtr() + ) , " \t\n" ); + return result; } @@ -113,7 +118,7 @@ s_getFileNameA[] = { GetOpenFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 | /* OFN_FILEMUSTEXIST */ 0x00001000 }, { GetSaveFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 }, }; -BX_STATIC_ASSERT(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count); +static_assert(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count); #endif #if !BX_PLATFORM_OSX @@ -124,11 +129,12 @@ bool openFileSelectionDialog( , const bx::StringView& _filter ) { -#if BX_PLATFORM_LINUX + bx::Error err; + char tmp[4096]; bx::StaticMemoryBlockWriter writer(tmp, sizeof(tmp) ); - bx::Error err; +#if BX_PLATFORM_LINUX bx::write(&writer, &err , "--file-selection%s --title \"%.*s\" --filename \"%s\"" , FileSelectionDialogType::Save == _type ? " --save" : "" @@ -167,9 +173,13 @@ bool openFileSelectionDialog( } } } + #elif BX_PLATFORM_WINDOWS - if (_type < 0 || _type >= BX_COUNTOF(s_getFileNameA)) + if (_type < 0 + || _type >= BX_COUNTOF(s_getFileNameA) ) + { return false; + } char out[bx::kMaxFilePath] = { '\0' }; @@ -181,11 +191,6 @@ bool openFileSelectionDialog( ofn.maxFile = sizeof(out); ofn.flags = s_getFileNameA[_type].m_flags; - char tmp[4096]; - bx::StaticMemoryBlockWriter writer(tmp, sizeof(tmp) ); - - bx::Error err; - ofn.title = tmp; bx::write(&writer, &err, "%.*s", _title.getLength(), _title.getPtr() ); bx::write(&writer, '\0', &err); @@ -229,13 +234,13 @@ bool openFileSelectionDialog( bx::write(&writer, '\0', &err); if (err.isOk() - && s_getFileNameA[_type].m_function(&ofn)) + && s_getFileNameA[_type].m_function(&ofn) ) { _inOutFilePath.set(ofn.file); return true; } #else - BX_UNUSED(_inOutFilePath, _type, _title, _filter); + BX_UNUSED(_inOutFilePath, _type, _title, _filter, err, tmp, writer); #endif // BX_PLATFORM_LINUX return false; diff --git a/bgfx/examples/common/entry/dialog.h b/bgfx/examples/common/entry/dialog.h index 2ea7e009..472c1f50 100644 --- a/bgfx/examples/common/entry/dialog.h +++ b/bgfx/examples/common/entry/dialog.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/entry/entry.cpp b/bgfx/examples/common/entry/entry.cpp index 14a48925..0787ee18 100644 --- a/bgfx/examples/common/entry/entry.cpp +++ b/bgfx/examples/common/entry/entry.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -185,7 +185,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); "GamepadStart", "GamepadGuide", }; - BX_STATIC_ASSERT(Key::Count == BX_COUNTOF(s_keyName) ); + static_assert(Key::Count == BX_COUNTOF(s_keyName) ); const char* getName(Key::Enum _key) { @@ -455,7 +455,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); AppI::AppI(const char* _name, const char* _description, const char* _url) { - BX_STATIC_ASSERT(sizeof(AppInternal) <= sizeof(m_internal) ); + static_assert(sizeof(AppInternal) <= sizeof(m_internal) ); s_offset = BX_OFFSETOF(AppI, m_internal); AppInternal* ai = (AppInternal*)m_internal; @@ -767,6 +767,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); handle = size->m_handle; _width = size->m_width; _height = size->m_height; + BX_TRACE("Window resize event: %d: %dx%d", handle, _width, _height); needReset = true; } @@ -800,6 +801,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); && needReset) { _reset = s_reset; + BX_TRACE("bgfx::reset(%d, %d, 0x%x)", _width, _height, _reset) bgfx::reset(_width, _height, _reset); inputSetMouseResolution(uint16_t(_width), uint16_t(_height) ); } @@ -979,6 +981,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); if (needReset) { _reset = s_reset; + BX_TRACE("bgfx::reset(%d, %d, 0x%x)", s_window[0].m_width, s_window[0].m_height, _reset) bgfx::reset(s_window[0].m_width, s_window[0].m_height, _reset); inputSetMouseResolution(uint16_t(s_window[0].m_width), uint16_t(s_window[0].m_height) ); } @@ -1040,5 +1043,5 @@ extern "C" void* entry_get_native_display_handle() extern "C" bgfx::NativeWindowHandleType::Enum entry_get_native_window_handle_type() { - return entry::getNativeWindowHandleType(entry::kDefaultWindowHandle); + return entry::getNativeWindowHandleType(); } diff --git a/bgfx/examples/common/entry/entry.h b/bgfx/examples/common/entry/entry.h index 9867aa87..772a76c9 100644 --- a/bgfx/examples/common/entry/entry.h +++ b/bgfx/examples/common/entry/entry.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -299,7 +299,7 @@ namespace entry void* getNativeDisplayHandle(); /// - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle); + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(); /// void setCurrentDir(const char* _dir); diff --git a/bgfx/examples/common/entry/entry_android.cpp b/bgfx/examples/common/entry/entry_android.cpp index de6bd5ab..d9549460 100644 --- a/bgfx/examples/common/entry/entry_android.cpp +++ b/bgfx/examples/common/entry/entry_android.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -189,9 +189,10 @@ namespace entry while (0 == m_app->destroyRequested) { - int32_t num; android_poll_source* source; - /*int32_t id =*/ ALooper_pollAll(-1, NULL, &num, (void**)&source); + int32_t result = ALooper_pollOnce(-1, NULL, NULL, reinterpret_cast(&source)); + + BX_ASSERT(ALOOPER_POLL_ERROR != result, "ALooper_pollOnce returned an error."); if (NULL != source) { @@ -550,9 +551,8 @@ namespace entry return NULL; } - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle) + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType() { - BX_UNUSED(_handle); return bgfx::NativeWindowHandleType::Default; } diff --git a/bgfx/examples/common/entry/entry_glfw.cpp b/bgfx/examples/common/entry/entry_glfw.cpp index 07167269..206bc64e 100644 --- a/bgfx/examples/common/entry/entry_glfw.cpp +++ b/bgfx/examples/common/entry/entry_glfw.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -10,18 +10,14 @@ #define GLFW_INCLUDE_NONE #include -#if GLFW_VERSION_MINOR < 2 -# error "GLFW 3.2 or later is required" -#endif // GLFW_VERSION_MINOR < 2 +#if !(GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 4) ) +# error "GLFW 3.4 or later is required" +#endif // GLFW_VERSION_* -#if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND -# include -# define GLFW_EXPOSE_NATIVE_WAYLAND -# else -# define GLFW_EXPOSE_NATIVE_X11 -# define GLFW_EXPOSE_NATIVE_GLX -# endif +#if BX_PLATFORM_LINUX +# define GLFW_EXPOSE_NATIVE_WAYLAND +# define GLFW_EXPOSE_NATIVE_X11 +# define GLFW_EXPOSE_NATIVE_GLX #elif BX_PLATFORM_OSX # define GLFW_EXPOSE_NATIVE_COCOA # define GLFW_EXPOSE_NATIVE_NSGL @@ -44,23 +40,13 @@ namespace entry { static void* glfwNativeWindowHandle(GLFWwindow* _window) { -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND - wl_egl_window *win_impl = (wl_egl_window*)glfwGetWindowUserPointer(_window); - if(!win_impl) +# if BX_PLATFORM_LINUX + if (GLFW_PLATFORM_WAYLAND == glfwGetPlatform() ) { - int width, height; - glfwGetWindowSize(_window, &width, &height); - struct wl_surface* surface = (struct wl_surface*)glfwGetWaylandWindow(_window); - if(!surface) - return nullptr; - win_impl = wl_egl_window_create(surface, width, height); - glfwSetWindowUserPointer(_window, (void*)(uintptr_t)win_impl); + return glfwGetWaylandWindow(_window); } - return (void*)(uintptr_t)win_impl; -# else - return (void*)(uintptr_t)glfwGetX11Window(_window); -# endif + + return (void*)uintptr_t(glfwGetX11Window(_window) ); # elif BX_PLATFORM_OSX return glfwGetCocoaWindow(_window); # elif BX_PLATFORM_WINDOWS @@ -68,23 +54,6 @@ namespace entry # endif // BX_PLATFORM_ } - static void glfwDestroyWindowImpl(GLFWwindow *_window) - { - if(!_window) - return; -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND - wl_egl_window *win_impl = (wl_egl_window*)glfwGetWindowUserPointer(_window); - if(win_impl) - { - glfwSetWindowUserPointer(_window, nullptr); - wl_egl_window_destroy(win_impl); - } -# endif -# endif - glfwDestroyWindow(_window); - } - static uint8_t translateKeyModifiers(int _glfw) { uint8_t modifiers = 0; @@ -525,7 +494,7 @@ namespace entry { GLFWwindow* window = m_window[msg->m_handle.idx]; m_eventQueue.postWindowEvent(msg->m_handle); - glfwDestroyWindowImpl(window); + glfwDestroyWindow(window); m_window[msg->m_handle.idx] = NULL; } } @@ -617,7 +586,7 @@ namespace entry m_eventQueue.postExitEvent(); m_thread.shutdown(); - glfwDestroyWindowImpl(m_window[0]); + glfwDestroyWindow(m_window[0]); glfwTerminate(); return m_thread.getExitCode(); @@ -864,28 +833,28 @@ namespace entry void* getNativeDisplayHandle() { -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND - return glfwGetWaylandDisplay(); -# else +# if BX_PLATFORM_LINUX + if (GLFW_PLATFORM_WAYLAND == glfwGetPlatform() ) + { + return glfwGetWaylandDisplay(); + } + return glfwGetX11Display(); -# endif // ENTRY_CONFIG_USE_WAYLAND # else return NULL; # endif // BX_PLATFORM_* } - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle) + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType() { -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND - return bgfx::NativeWindowHandleType::Wayland; -# else - return bgfx::NativeWindowHandleType::Default; -# endif // ENTRY_CONFIG_USE_WAYLAND -# else +# if BX_PLATFORM_LINUX + if (GLFW_PLATFORM_WAYLAND == glfwGetPlatform() ) + { + return bgfx::NativeWindowHandleType::Wayland; + } +# endif // BX_PLATFORM_LINUX + return bgfx::NativeWindowHandleType::Default; -# endif // BX_PLATFORM_* } int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData) diff --git a/bgfx/examples/common/entry/entry_html5.cpp b/bgfx/examples/common/entry/entry_html5.cpp index 998cb950..8df5d973 100644 --- a/bgfx/examples/common/entry/entry_html5.cpp +++ b/bgfx/examples/common/entry/entry_html5.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -428,9 +428,8 @@ namespace entry return NULL; } - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle) + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType() { - BX_UNUSED(_handle); return bgfx::NativeWindowHandleType::Default; } } diff --git a/bgfx/examples/common/entry/entry_ios.mm b/bgfx/examples/common/entry/entry_ios.mm index d5676fef..bc4cf2fc 100644 --- a/bgfx/examples/common/entry/entry_ios.mm +++ b/bgfx/examples/common/entry/entry_ios.mm @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -161,9 +161,8 @@ void setMouseLock(WindowHandle _handle, bool _lock) return NULL; } - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle) + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType() { - BX_UNUSED(_handle); return bgfx::NativeWindowHandleType::Default; } diff --git a/bgfx/examples/common/entry/entry_noop.cpp b/bgfx/examples/common/entry/entry_noop.cpp index 1e1e61d0..8170ac7f 100644 --- a/bgfx/examples/common/entry/entry_noop.cpp +++ b/bgfx/examples/common/entry/entry_noop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -78,9 +78,8 @@ namespace entry return NULL; } - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle) + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType() { - BX_UNUSED(_handle); return bgfx::NativeWindowHandleType::Default; } diff --git a/bgfx/examples/common/entry/entry_osx.mm b/bgfx/examples/common/entry/entry_osx.mm index 201033f1..16c23b3c 100644 --- a/bgfx/examples/common/entry/entry_osx.mm +++ b/bgfx/examples/common/entry/entry_osx.mm @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -725,9 +725,8 @@ void setMouseLock(WindowHandle _handle, bool _lock) return NULL; } - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle) + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType() { - BX_UNUSED(_handle); return bgfx::NativeWindowHandleType::Default; } diff --git a/bgfx/examples/common/entry/entry_p.h b/bgfx/examples/common/entry/entry_p.h index b2f1f579..1295f7a3 100644 --- a/bgfx/examples/common/entry/entry_p.h +++ b/bgfx/examples/common/entry/entry_p.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -25,10 +25,6 @@ # define ENTRY_CONFIG_USE_GLFW 0 #endif // ENTRY_CONFIG_USE_GLFW -#ifndef ENTRY_CONFIG_USE_WAYLAND -# define ENTRY_CONFIG_USE_WAYLAND 0 -#endif // ENTRY_CONFIG_USE_WAYLAND - #if !defined(ENTRY_CONFIG_USE_NATIVE) \ && !ENTRY_CONFIG_USE_NOOP \ && !ENTRY_CONFIG_USE_SDL \ diff --git a/bgfx/examples/common/entry/entry_sdl.cpp b/bgfx/examples/common/entry/entry_sdl.cpp index 2d5e9c15..cae5012b 100644 --- a/bgfx/examples/common/entry/entry_sdl.cpp +++ b/bgfx/examples/common/entry/entry_sdl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -7,10 +7,7 @@ #if ENTRY_CONFIG_USE_SDL -#if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND -# include -# endif +#if BX_PLATFORM_LINUX #elif BX_PLATFORM_WINDOWS # define SDL_MAIN_HANDLED #endif @@ -48,27 +45,16 @@ namespace entry return NULL; } -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND - if (wmi.subsystem == SDL_SYSWM_WAYLAND) - { - wl_egl_window *win_impl = (wl_egl_window*)SDL_GetWindowData(_window, "wl_egl_window"); - if(!win_impl) - { - int width, height; - SDL_GetWindowSize(_window, &width, &height); - struct wl_surface* surface = wmi.info.wl.surface; - if(!surface) - return nullptr; - win_impl = wl_egl_window_create(surface, width, height); - SDL_SetWindowData(_window, "wl_egl_window", win_impl); - } - return (void*)(uintptr_t)win_impl; - } - else -# endif // ENTRY_CONFIG_USE_WAYLAND - return (void*)wmi.info.x11.window; -# elif BX_PLATFORM_OSX || BX_PLATFORM_IOS +# if BX_PLATFORM_LINUX + if (wmi.subsystem == SDL_SYSWM_WAYLAND) + { + return (void*)wmi.info.wl.surface; + } + else + { + return (void*)wmi.info.x11.window; + } +# elif BX_PLATFORM_OSX || BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS return wmi.info.cocoa.window; # elif BX_PLATFORM_WINDOWS return wmi.info.win.window; @@ -77,23 +63,6 @@ namespace entry # endif // BX_PLATFORM_ } - static void sdlDestroyWindow(SDL_Window* _window) - { - if(!_window) - return; -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND - wl_egl_window *win_impl = (wl_egl_window*)SDL_GetWindowData(_window, "wl_egl_window"); - if(win_impl) - { - SDL_SetWindowData(_window, "wl_egl_window", nullptr); - wl_egl_window_destroy(win_impl); - } -# endif -# endif - SDL_DestroyWindow(_window); - } - static uint8_t translateKeyModifiers(uint16_t _sdl) { uint8_t modifiers = 0; @@ -164,22 +133,6 @@ namespace entry return GamepadAxis::Enum(s_translateGamepadAxis[_sdl]); } - struct AxisDpadRemap - { - Key::Enum first; - Key::Enum second; - }; - - static AxisDpadRemap s_axisDpad[] = - { - { Key::GamepadLeft, Key::GamepadRight }, - { Key::GamepadUp, Key::GamepadDown }, - { Key::None, Key::None }, - { Key::GamepadLeft, Key::GamepadRight }, - { Key::GamepadUp, Key::GamepadDown }, - { Key::None, Key::None }, - }; - struct GamepadSDL { GamepadSDL() @@ -217,22 +170,6 @@ namespace entry { _eventQueue.postAxisEvent(_handle, _gamepad, _axis, _value); - if (Key::None != s_axisDpad[_axis].first) - { - if (_value == 0) - { - _eventQueue.postKeyEvent(_handle, s_axisDpad[_axis].first, 0, false); - _eventQueue.postKeyEvent(_handle, s_axisDpad[_axis].second, 0, false); - } - else - { - _eventQueue.postKeyEvent(_handle - , 0 > _value ? s_axisDpad[_axis].first : s_axisDpad[_axis].second - , 0 - , true - ); - } - } } } @@ -493,7 +430,7 @@ namespace entry // Force window resolution... WindowHandle defaultWindow = { 0 }; - setWindowSize(defaultWindow, m_width, m_height, true); + entry::setWindowSize(defaultWindow, m_width, m_height); SDL_EventState(SDL_DROPFILE, SDL_ENABLE); @@ -671,7 +608,15 @@ namespace entry case SDL_WINDOWEVENT_SIZE_CHANGED: { WindowHandle handle = findHandle(wev.windowID); - setWindowSize(handle, wev.data1, wev.data2); + uint32_t width = wev.data1; + uint32_t height = wev.data2; + if (width != m_width + || height != m_height) + { + m_width = width; + m_height = height; + m_eventQueue.postSizeEvent(handle, m_width, m_height); + } } break; @@ -702,16 +647,14 @@ namespace entry } break; + // Ignore Joystick events. Example's Gamepad concept mirrors SDL Game Controller. + // Game Controllers are higher level wrapper around Joystick and both events come through. + // Respond to only the controller events. Controller events are properly remapped. case SDL_JOYAXISMOTION: - { - const SDL_JoyAxisEvent& jev = event.jaxis; - GamepadHandle handle = findGamepad(jev.which); - if (isValid(handle) ) - { - GamepadAxis::Enum axis = translateGamepadAxis(jev.axis); - m_gamepad[handle.idx].update(m_eventQueue, defaultWindow, handle, axis, jev.value); - } - } + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + case SDL_JOYDEVICEADDED: + case SDL_JOYDEVICEREMOVED: break; case SDL_CONTROLLERAXISMOTION: @@ -726,23 +669,6 @@ namespace entry } break; - case SDL_JOYBUTTONDOWN: - case SDL_JOYBUTTONUP: - { - const SDL_JoyButtonEvent& bev = event.jbutton; - GamepadHandle handle = findGamepad(bev.which); - - if (isValid(handle) ) - { - Key::Enum key = translateGamepad(bev.button); - if (Key::Count != key) - { - m_eventQueue.postKeyEvent(defaultWindow, key, 0, event.type == SDL_JOYBUTTONDOWN); - } - } - } - break; - case SDL_CONTROLLERBUTTONDOWN: case SDL_CONTROLLERBUTTONUP: { @@ -759,31 +685,6 @@ namespace entry } break; - case SDL_JOYDEVICEADDED: - { - GamepadHandle handle = { m_gamepadAlloc.alloc() }; - if (isValid(handle) ) - { - const SDL_JoyDeviceEvent& jev = event.jdevice; - m_gamepad[handle.idx].create(jev); - m_eventQueue.postGamepadEvent(defaultWindow, handle, true); - } - } - break; - - case SDL_JOYDEVICEREMOVED: - { - const SDL_JoyDeviceEvent& jev = event.jdevice; - GamepadHandle handle = findGamepad(jev.which); - if (isValid(handle) ) - { - m_gamepad[handle.idx].destroy(); - m_gamepadAlloc.free(handle.idx); - m_eventQueue.postGamepadEvent(defaultWindow, handle, false); - } - } - break; - case SDL_CONTROLLERDEVICEADDED: { GamepadHandle handle = { m_gamepadAlloc.alloc() }; @@ -865,7 +766,7 @@ namespace entry if (isValid(handle) ) { m_eventQueue.postWindowEvent(handle); - sdlDestroyWindow(m_window[handle.idx]); + SDL_DestroyWindow(m_window[handle.idx]); m_window[handle.idx] = NULL; } } @@ -916,7 +817,7 @@ namespace entry Msg* msg = (Msg*)uev.data2; if (isValid(handle) ) { - setWindowSize(handle, msg->m_width, msg->m_height); + SDL_SetWindowSize(m_window[handle.idx], msg->m_width, msg->m_height); } delete msg; } @@ -959,7 +860,7 @@ namespace entry while (bgfx::RenderFrame::NoContext != bgfx::renderFrame() ) {}; m_thread.shutdown(); - sdlDestroyWindow(m_window[0]); + SDL_DestroyWindow(m_window[0]); SDL_Quit(); return m_thread.getExitCode(); @@ -988,20 +889,6 @@ namespace entry return invalid; } - void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height, bool _force = false) - { - if (_width != m_width - || _height != m_height - || _force) - { - m_width = _width; - m_height = _height; - - SDL_SetWindowSize(m_window[_handle.idx], m_width, m_height); - m_eventQueue.postSizeEvent(_handle, m_width, m_height); - } - } - GamepadHandle findGamepad(SDL_JoystickID _jid) { for (uint32_t ii = 0, num = m_gamepadAlloc.getNumHandles(); ii < num; ++ii) @@ -1102,6 +989,7 @@ namespace entry void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height) { + // Function to set the window size programmatically from the examples/tools. Msg* msg = new Msg; msg->m_width = _width; msg->m_height = _height; @@ -1148,33 +1036,33 @@ namespace entry { return NULL; } -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND - if (wmi.subsystem == SDL_SYSWM_WAYLAND) - return wmi.info.wl.display; - else -# endif // ENTRY_CONFIG_USE_WAYLAND - return wmi.info.x11.display; +# if BX_PLATFORM_LINUX + if (wmi.subsystem == SDL_SYSWM_WAYLAND) + return wmi.info.wl.display; + else + return wmi.info.x11.display; # else return NULL; # endif // BX_PLATFORM_* } - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle) + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType() { SDL_SysWMinfo wmi; SDL_VERSION(&wmi.version); - if (!SDL_GetWindowWMInfo(s_ctx.m_window[_handle.idx], &wmi) ) + if (!SDL_GetWindowWMInfo(s_ctx.m_window[kDefaultWindowHandle.idx], &wmi) ) { return bgfx::NativeWindowHandleType::Default; } -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if ENTRY_CONFIG_USE_WAYLAND +# if BX_PLATFORM_LINUX if (wmi.subsystem == SDL_SYSWM_WAYLAND) + { return bgfx::NativeWindowHandleType::Wayland; + } else -# endif // ENTRY_CONFIG_USE_WAYLAND + { return bgfx::NativeWindowHandleType::Default; + } # else return bgfx::NativeWindowHandleType::Default; # endif // BX_PLATFORM_* diff --git a/bgfx/examples/common/entry/entry_windows.cpp b/bgfx/examples/common/entry/entry_windows.cpp index 7db32cd1..f25e50d6 100644 --- a/bgfx/examples/common/entry/entry_windows.cpp +++ b/bgfx/examples/common/entry/entry_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -851,14 +851,18 @@ namespace entry if (utf16[0] >= 0xD800 && utf16[0] <= 0xDBFF) { m_surrogate = utf16[0]; - } else { + } + else + { int utf16_len; if (utf16[0] >= 0xDC00 && utf16[0] <= 0xDFFF) { utf16[1] = utf16[0]; utf16[0] = m_surrogate; m_surrogate = 0; utf16_len = 2; - } else { + } + else + { utf16_len = 1; } @@ -1169,9 +1173,8 @@ namespace entry return NULL; } - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle) + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType() { - BX_UNUSED(_handle); return bgfx::NativeWindowHandleType::Default; } diff --git a/bgfx/examples/common/entry/entry_x11.cpp b/bgfx/examples/common/entry/entry_x11.cpp index 9d80593f..d71dc805 100644 --- a/bgfx/examples/common/entry/entry_x11.cpp +++ b/bgfx/examples/common/entry/entry_x11.cpp @@ -1,11 +1,11 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #include "entry_p.h" -#if ENTRY_CONFIG_USE_NATIVE && (BX_PLATFORM_BSD || BX_PLATFORM_LINUX || BX_PLATFORM_RPI) +#if ENTRY_CONFIG_USE_NATIVE && (BX_PLATFORM_LINUX || BX_PLATFORM_RPI) #define XK_MISCELLANY #define XK_LATIN1 @@ -81,7 +81,7 @@ namespace entry { Key::GamepadUp, Key::GamepadDown }, { Key::None, Key::None }, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_translateAxis) == BX_COUNTOF(s_axisDpad) ); + static_assert(BX_COUNTOF(s_translateAxis) == BX_COUNTOF(s_axisDpad) ); struct Joystick { @@ -336,8 +336,13 @@ namespace entry m_display = XOpenDisplay(NULL); if (NULL == m_display) { - bx::printf("XOpenDisplay failed: DISPLAY environment variable must be set.\n\n"); - return bx::kExitFailure; + // Use `DISPLAY` environment variable to pick display. If `DISPLAY` is not set try ":0" + m_display = XOpenDisplay(":0"); + if (NULL == m_display) + { + bx::printf("XOpenDisplay failed: DISPLAY environment variable must be set.\n\n"); + return bx::kExitFailure; + } } int32_t screen = DefaultScreen(m_display); @@ -771,9 +776,8 @@ namespace entry return s_ctx.m_display; } - bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle) + bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType() { - BX_UNUSED(_handle); return bgfx::NativeWindowHandleType::Default; } @@ -785,4 +789,4 @@ int main(int _argc, const char* const* _argv) return s_ctx.run(_argc, _argv); } -#endif // ENTRY_CONFIG_USE_NATIVE && (BX_PLATFORM_BSD || BX_PLATFORM_LINUX || BX_PLATFORM_RPI) +#endif // ENTRY_CONFIG_USE_NATIVE && (BX_PLATFORM_LINUX || BX_PLATFORM_RPI) diff --git a/bgfx/examples/common/entry/input.cpp b/bgfx/examples/common/entry/input.cpp index 3fa13801..fdad52d4 100644 --- a/bgfx/examples/common/entry/input.cpp +++ b/bgfx/examples/common/entry/input.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/entry/input.h b/bgfx/examples/common/entry/input.h index 00d7bfc6..f7defe8e 100644 --- a/bgfx/examples/common/entry/input.h +++ b/bgfx/examples/common/entry/input.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/example-glue.cpp b/bgfx/examples/common/example-glue.cpp index bcc40033..a0539bcd 100644 --- a/bgfx/examples/common/example-glue.cpp +++ b/bgfx/examples/common/example-glue.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -290,6 +290,8 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText) } } } +#else + ImGui::Text("Renderer: %s", bgfx::getRendererName(bgfx::getRendererType())); #endif // 0 const bgfx::Stats* stats = bgfx::getStats(); diff --git a/bgfx/examples/common/font/font_manager.cpp b/bgfx/examples/common/font/font_manager.cpp index 5416fc55..92e497a4 100644 --- a/bgfx/examples/common/font/font_manager.cpp +++ b/bgfx/examples/common/font/font_manager.cpp @@ -522,7 +522,9 @@ float FontManager::getKerning(FontHandle _handle, CodePoint _prevCodePoint, Code if (isValid(cachedFont.masterFontHandle)) { CachedFont& baseFont = m_cachedFonts[cachedFont.masterFontHandle.idx]; - return baseFont.trueTypeFont->m_scale * stbtt_GetCodepointKernAdvance(&baseFont.trueTypeFont->m_font, _prevCodePoint, _codePoint); + return baseFont.trueTypeFont->m_scale + * stbtt_GetCodepointKernAdvance(&baseFont.trueTypeFont->m_font, _prevCodePoint, _codePoint) + * cachedFont.fontInfo.scale; } else { diff --git a/bgfx/examples/common/font/fs_font_basic.bin.h b/bgfx/examples/common/font/fs_font_basic.bin.h index 01e7bbe2..0b603add 100644 --- a/bgfx/examples/common/font/fs_font_basic.bin.h +++ b/bgfx/examples/common/font/fs_font_basic.bin.h @@ -103,185 +103,147 @@ static const uint8_t fs_font_basic_essl[808] = 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // agColor = tmpvar 0x5f, 0x36, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _6;.}... }; -static const uint8_t fs_font_basic_spv[1439] = +static const uint8_t fs_font_basic_spv[1371] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // _texColor0...... - 0x04, 0x1a, 0x00, 0x74, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, // ...t.....#...... + 0x04, 0x22, 0x00, 0x30, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, // .".0.....#...... 0x00, 0x08, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ................ 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, // ...........GLSL. 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, // std.450......... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x7c, // ...main....y...| - 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, // ................ - 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......#...s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, // ColorSampler.... - 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...&...s_texColo - 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x79, // rTexture.......y - 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, // ...gl_FragCoord. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // .......|...v_col - 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x76, // or0............v - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x8c, // _texcoord0...... - 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData - 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...#...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...#...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...&...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G...&...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G...y........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...|........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............ - 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ - 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ..."...........; - 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ..."...#....... - 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...%...........; - 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, // ...%...&........ - 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...)... .......+ - 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1b, // ...)...*........ - 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...2.......+.... - 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...P......@+.... - 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x14, 0x00, 0x02, 0x00, 0x57, // ...R......?....W - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x02, // ...+...)...].... - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x03, // ...+...)...c.... - 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, // ... ...x........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x01, // ...;...x...y.... - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x01, // ...;...x...|.... - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x01, // ...;...x........ - 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, // ... ............ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x03, // ...;............ - 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // ...6............ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, // ...............= - 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, // .......$...#...= - 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, // .......'...&...= - 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x3d, // .......}...|...= - 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x4f, // ...............O - 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, // ...............V - 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, // ...2.......'...$ - 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0xdd, // ...W............ - 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb1, // .......Q........ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x81, // ...........P.... - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x52, // ...............R - 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xb3, // ...n...)........ - 0x00, 0x00, 0x00, 0xb1, 0x00, 0x05, 0x00, 0x57, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xb4, // .......W........ - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb8, // ...*...Q........ - 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x05, 0x00, 0x57, // ...............W - 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x51, // ...........]...Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0xb1, 0x00, 0x05, 0x00, 0x57, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xb4, // .......W........ - 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc0, // ...c...Q........ - 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xa9, // ................ - 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xc0, // ................ - 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, // ................ - 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xa9, // ................ - 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xb8, // ................ - 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc9, // .......Q........ - 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // ...}............ - 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, // ...........}.... - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x7d, // ...Q...........} - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, // .......Q........ - 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, // ...}.......P.... - 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0xce, // ................ - 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xcf, // .......>........ - 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // .......8....... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7f, // ...main....|.... + 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, // ................ + 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, // .......main..... + 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...#...s_texColo + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x26, // rSampler.......& + 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, // ...s_texColorTex + 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x76, // ture.......|...v + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x7f, // _color0......... + 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, // ...v_texcoord0.. + 0x00, 0x06, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // .......bgfx_Frag + 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, // Data0..G...#..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, // .......G...#...! + 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, // .......G...&..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, // .......G...&...! + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x1e, // .......G...|.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, // ...............! + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, // ................ + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, // ........... .... + 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ... ..."........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...;..."...#.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ... ...%........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, // ...;...%...&.... + 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, // .......)... .... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, // ...+...)...*.... + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, // .......2.......+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, // .......P......@+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x14, // .......R......?. + 0x00, 0x02, 0x00, 0x57, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x5d, // ...W...+...)...] + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x63, // .......+...)...c + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x01, // ....... ...x.... + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7c, // .......;...x...| + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7f, // .......;...x.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x03, // ....... ........ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x8c, // .......;........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, // .......6........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, // ................ + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, // ...=.......$...# + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, // ...=.......'...& + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x7c, // ...=.......}...| + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x7f, // ...=............ + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x80, // ...O............ + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x27, // ...V...2.......' + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xdf, // ...$...W........ + 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, // ...............2 + 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x6e, // .......P...R...n + 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00, 0xb1, // ...)............ + 0x00, 0x05, 0x00, 0x57, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x2a, // ...W...........* + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0xdf, // ...Q............ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x05, 0x00, 0x57, 0x00, 0x00, 0x00, 0xba, // ...........W.... + 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // .......]...Q.... + 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xb1, // ................ + 0x00, 0x05, 0x00, 0x57, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x63, // ...W...........c + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xdf, // ...Q............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc2, // .......Q........ + 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x06, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc2, // ................ + 0x00, 0x00, 0x00, 0xa9, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xba, // ................ + 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x06, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0xc4, // ................ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x7d, // ...Q...........} + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, // ................ + 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // .......}.......Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x01, // ...........}.... + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x7d, // ...Q...........} + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xcf, // .......P........ + 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0xcb, // ................ + 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0xfd, // ...>............ + 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ...8....... }; -static const uint8_t fs_font_basic_dx9[488] = +static const uint8_t fs_font_basic_dx11[647] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, // ............. .C - 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, // TAB....S........ - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, // ...........L...0 - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, // ...........<.... - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, // ...s_texColor... - 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, // ...............p - 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, // s_3_0.Microsoft - 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, // (R) HLSL Shader - 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, // Compiler 10.1..Q - 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, // ..........@...?. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, // ......?Q........ - 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x1f, // .........@...... - 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, // ................ - 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, // ................ - 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, // ................ - 0x00, 0x00, 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, // .....U.......... - 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, // ...X.........U.. - 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, // ................ - 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, // .....U.X........ - 0x00, 0x00, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, // .........U...... - 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, // ...........B.... - 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, // ...........X.... - 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0xff, 0x80, 0x01, 0x00, 0x00, 0x80, 0x58, // ...............X - 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x01, // .........U...... - 0x00, 0x55, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, // .U.X............ - 0x00, 0x55, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, // .U.............. - 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ........ + 0x00, 0x00, 0x00, 0x5c, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xf2, 0x61, 0x72, 0x64, 0xa1, // .......DXBC.ard. + 0x68, 0x6a, 0xdf, 0x49, 0x14, 0xcf, 0xb6, 0xf9, 0x7a, 0x68, 0x79, 0x01, 0x00, 0x00, 0x00, 0x5c, // hj.I....zhy..... + 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, // .......,........ + 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, // ...ISGNl........ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, // ...P............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...b............ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO + 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX + 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // COORD..OSGN,.... + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S + 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x80, // V_TARGET...SHEX. + 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x5a, // ...P...`...j...Z + 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, // ....`......X0... + 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, // p......UU..b.... + 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, // .......b........ + 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, // ...e.... ......h + 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, // .......2........ + 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, // ...:........@... + 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, // ..@.@.....?..... + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, // ..............." + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, // ...r............ + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, // ....@........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, // .......E.......C + 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, // U..........F.... + 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, // ...F~.......`... + 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...7...B.......* + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, // ...............: + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, // .......7...".... + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x12, // ...*.......7.... + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...............* + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...............8 + 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // .... ........... + 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, // ...:.......6...r + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, // ......F.......> + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ....... }; -static const uint8_t fs_font_basic_dx11[656] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, // ....s_texColor0. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........P...DXBC - 0xfa, 0xe4, 0x8b, 0xa4, 0x28, 0x69, 0x9a, 0xff, 0x6d, 0x15, 0xac, 0x21, 0xfc, 0x34, 0xe4, 0x3a, // ....(i..m..!.4.: - 0x01, 0x00, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....P.......,... - 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl... - 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... - 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ - 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ - 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN - 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET... - 0x53, 0x48, 0x44, 0x52, 0x74, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, // SHDRt...@...]... - 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, // Z....`......X0.. - 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b... - 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........b....... - 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ...... - 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, // h.......2....... - 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // ....:........@.. - 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, // ...@.@.....?.... - 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x22, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // "...r........... - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // .....@.......... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, // ........E....... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, // .....`......7... - 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // B.......*....... - 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........:....... - 0x37, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 7..."........... - 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // ............*... - 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....7........... - 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........*....... - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, // ........8.... .. - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, // ............:... - 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...r ...... - 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // F.......>....... -}; -static const uint8_t fs_font_basic_mtl[827] = +static const uint8_t fs_font_basic_mtl[828] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x11, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler - 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x89, 0x02, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex + 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... - 0x01, 0x00, 0x00, 0x00, 0x89, 0x02, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x02, 0xd8, 0x02, 0x00, 0x00, 0x23, // r..............# + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo + 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd9, 0x02, 0x00, 0x00, 0x23, // r..............# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, // include .#include 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, // ..u @@ -315,19 +277,19 @@ static const uint8_t fs_font_basic_mtl[827] = 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // Sampler, in.v_te 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, // xcoord0.xyz);. 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x5f, 0x31, 0x37, 0x37, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, // int _177 = int - 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // ((in.v_texcoord0 - 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, // .w * 4.0) + 0.5) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // ;. out.bgfx_F - 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // ragData0 = float - 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, // 4(in.v_color0.xy - 0x7a, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, // z, in.v_color0.w - 0x20, 0x2a, 0x20, 0x28, 0x28, 0x5f, 0x31, 0x37, 0x37, 0x20, 0x3c, 0x20, 0x31, 0x29, 0x20, 0x3f, // * ((_177 < 1) ? - 0x20, 0x5f, 0x32, 0x32, 0x30, 0x2e, 0x7a, 0x20, 0x3a, 0x20, 0x28, 0x28, 0x5f, 0x31, 0x37, 0x37, // _220.z : ((_177 - 0x20, 0x3c, 0x20, 0x32, 0x29, 0x20, 0x3f, 0x20, 0x5f, 0x32, 0x32, 0x30, 0x2e, 0x79, 0x20, 0x3a, // < 2) ? _220.y : - 0x20, 0x28, 0x28, 0x5f, 0x31, 0x37, 0x37, 0x20, 0x3c, 0x20, 0x33, 0x29, 0x20, 0x3f, 0x20, 0x5f, // ((_177 < 3) ? _ - 0x32, 0x32, 0x30, 0x2e, 0x78, 0x20, 0x3a, 0x20, 0x5f, 0x32, 0x32, 0x30, 0x2e, 0x77, 0x29, 0x29, // 220.x : _220.w)) - 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, // ));. return o - 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, 0x00, // ut;.}.... . + 0x28, 0x66, 0x6d, 0x61, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // (fma(in.v_texcoo + 0x72, 0x64, 0x30, 0x2e, 0x77, 0x2c, 0x20, 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, // rd0.w, 4.0, 0.5) + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, // );. out.bgfx_ + 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // FragData0 = floa + 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, // t4(in.v_color0.x + 0x79, 0x7a, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // yz, in.v_color0. + 0x77, 0x20, 0x2a, 0x20, 0x28, 0x28, 0x5f, 0x31, 0x37, 0x37, 0x20, 0x3c, 0x20, 0x31, 0x29, 0x20, // w * ((_177 < 1) + 0x3f, 0x20, 0x5f, 0x32, 0x32, 0x30, 0x2e, 0x7a, 0x20, 0x3a, 0x20, 0x28, 0x28, 0x5f, 0x31, 0x37, // ? _220.z : ((_17 + 0x37, 0x20, 0x3c, 0x20, 0x32, 0x29, 0x20, 0x3f, 0x20, 0x5f, 0x32, 0x32, 0x30, 0x2e, 0x79, 0x20, // 7 < 2) ? _220.y + 0x3a, 0x20, 0x28, 0x28, 0x5f, 0x31, 0x37, 0x37, 0x20, 0x3c, 0x20, 0x33, 0x29, 0x20, 0x3f, 0x20, // : ((_177 < 3) ? + 0x5f, 0x32, 0x32, 0x30, 0x2e, 0x78, 0x20, 0x3a, 0x20, 0x5f, 0x32, 0x32, 0x30, 0x2e, 0x77, 0x29, // _220.x : _220.w) + 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, // )));. return + 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, 0x00, // out;.}.... . }; extern const uint8_t* fs_font_basic_pssl; extern const uint32_t fs_font_basic_pssl_size; diff --git a/bgfx/examples/common/font/fs_font_distance_field.bin.h b/bgfx/examples/common/font/fs_font_distance_field.bin.h index 79c3e8a8..930fcc0e 100644 --- a/bgfx/examples/common/font/fs_font_distance_field.bin.h +++ b/bgfx/examples/common/font/fs_font_distance_field.bin.h @@ -130,264 +130,208 @@ static const uint8_t fs_font_distance_field_essl[1038] = 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, // gl_FragColor = 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tmpvar_8;.}... }; -static const uint8_t fs_font_distance_field_spv[2034] = +static const uint8_t fs_font_distance_field_spv[2006] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, // ..s_texColor0... - 0x00, 0x00, 0x00, 0x04, 0x1a, 0x00, 0xb4, 0x07, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ............#... - 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x16, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ + 0x00, 0x00, 0x00, 0x04, 0x22, 0x00, 0x98, 0x07, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ....".......#... + 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, // ..............GL 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // SL.std.450...... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x93, 0x00, // ......main...... - 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x10, 0x00, // ................ - 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, // ................ - 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma - 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, // in........#...s_ - 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, // texColorSampler. - 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ......&...s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, // olorTexture..... - 0x06, 0x00, 0x77, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, // ..w...UniformBlo - 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, // ck........w..... - 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..u_params...... - 0x03, 0x00, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x93, 0x00, // ..y............. - 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, // ..gl_FragCoord.. - 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x96, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ..........v_colo - 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x76, 0x5f, // r0............v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0xa6, 0x00, // texcoord0....... - 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, // ..bgfx_FragData0 - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...#..."..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, // ..G...#...!..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...&..."..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, // ..G...&...!..... - 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, // ..H...w.......#. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, // ......G...w..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...y..."..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, // ..G...y...!..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x93, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x96, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x99, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G............. - 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, // ..........!..... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, // ................ - 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, // ...... ......... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, // .."...........;. - 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, // .."...#....... . - 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..%...........;. - 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, // ..%...&......... - 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..)... .......+. - 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..)...*.......+. - 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, // ..)............. - 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x4c, 0x00, // ..2...........L. - 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // .. .......+..... - 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..P......@+..... - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x4c, 0x00, // ..R......?+...L. - 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x56, 0x00, // ..U...........V. - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x57, 0x00, // ......U... ...W. - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x4c, 0x00, // ......V...+...L. - 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, // ..].......+...). - 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, // ..a.......+...). - 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x77, 0x00, // ..f...........w. - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x02, 0x00, // ...... ...x..... - 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x79, 0x00, // ..w...;...x...y. - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x02, 0x00, // ...... ...z..... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x92, 0x00, 0x00, 0x00, 0x01, 0x00, // ...... ......... - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x92, 0x00, 0x00, 0x00, 0x93, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x92, 0x00, 0x00, 0x00, 0x96, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x92, 0x00, 0x00, 0x00, 0x99, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x03, 0x00, // ...... ......... - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xa6, 0x00, // ......;......... - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x01, // ......+......... - 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, // ....5A6......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, // ................ - 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x07, 0x00, // ..;...W......... - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, // ..=.......$...#. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, // ..=.......'...&. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x96, 0x00, // ..=............. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x99, 0x00, // ..=............. - 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x9a, 0x00, // ..O............. - 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x27, 0x00, // ..V...2.......'. - 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x08, 0x01, // ..$...W......... - 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x50, 0x00, // ..............P. - 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0xcd, 0x00, // ................ - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0xcf, 0x00, // ..R...n...)..... - 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd1, 0x00, // ......Q......... - 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x13, 0x00, // ..........A..... - 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..............>. - 0x03, 0x00, 0xd2, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, // ..............A. - 0x05, 0x00, 0x13, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x2a, 0x00, // ..............*. - 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xd5, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x51, 0x00, // ..>...........Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x13, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xc0, 0x00, // ..A............. - 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xd7, 0x00, // ..a...>......... - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0x08, 0x01, // ..Q............. - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x13, 0x00, 0x00, 0x00, 0xdb, 0x00, // ......A......... - 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xdb, 0x00, // ......f...>..... - 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x13, 0x00, 0x00, 0x00, 0xdd, 0x00, // ......A......... - 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..........=..... - 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... - 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x0b, 0x00, // ................ - 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0xe1, 0x00, // ..........B..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0xe2, 0x00, // ................ - 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x7a, 0x00, 0x00, 0x00, 0xe5, 0x00, // ......A...z..... - 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..y.......]...=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x85, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0xe6, 0x00, // ................ - 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x52, 0x00, // ..............R. - 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xeb, 0x00, // ................ - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ..R............. - 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe9, 0x00, // ..........1..... - 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0xf2, 0x00, // ................ - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x97, 0x00, // ..Q............. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf5, 0x00, // ......Q......... - 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, // ..............P. - 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xf5, 0x00, // ................ - 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xa6, 0x00, // ..........>..... - 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..........8..... - 0x10, 0x00, // .. + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, // ......main...... + 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, // ................ + 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. + 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ......#...s_texC + 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, // olorSampler..... + 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ..&...s_texColor + 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x77, 0x00, // Texture.......w. + 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, // ..UniformBlock.. + 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......w.......u_ + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x79, 0x00, // params........y. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x96, 0x00, 0x00, 0x00, 0x76, 0x5f, // ..............v_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x99, 0x00, // color0.......... + 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, // ..v_texcoord0... + 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, // ......bgfx_FragD + 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, // ata0..G...#...". + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...#...!. + 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, // ......G...&...". + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...&...!. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, // ......H...w..... + 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x77, 0x00, // ..#.......G...w. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0x22, 0x00, // ......G...y...". + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...y...!. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x96, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x99, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, // ..............!. + 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, // ................ + 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, // .......... ..... + 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // .. ..."......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;..."...#..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // .. ...%......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;...%...&..... + 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, // ......)... ..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, // ..+...)...*..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+...)......... + 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, // ......2......... + 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..L... .......+. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, // ......P......@+. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, // ......R......?+. + 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..L...U......... + 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x20, 0x00, // ..V.......U... . + 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..W.......V...+. + 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..L...].......+. + 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..)...a.......+. + 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, // ..)...f......... + 0x03, 0x00, 0x77, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x78, 0x00, // ..w....... ...x. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x78, 0x00, // ......w...;...x. + 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7a, 0x00, // ..y....... ...z. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x92, 0x00, // .......... ..... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x92, 0x00, // ..........;..... + 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x92, 0x00, // ..........;..... + 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xa5, 0x00, // .......... ..... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xa5, 0x00, // ..........;..... + 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..........+..... + 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ........5A+..... + 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0xf3, 0x04, 0x35, 0xc1, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, // ........5.6..... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, // ................ + 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, 0xc0, 0x00, // ......;...W..... + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, // ......=.......$. + 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, // ..#...=.......'. + 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x97, 0x00, // ..&...=......... + 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x9a, 0x00, // ......=......... + 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc9, 0x00, // ......O......... + 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0x06, 0x01, // ......V...2..... + 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, // ..'...$...W..... + 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x52, 0x00, // ..2.......P...R. + 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0xce, 0x00, // ..n...)......... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x08, 0x01, // ..Q............. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x13, 0x00, 0x00, 0x00, 0xd2, 0x00, // ......A......... + 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xd2, 0x00, // ..........>..... + 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd4, 0x00, // ......Q......... + 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x13, 0x00, // ..........A..... + 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..........*...>. + 0x03, 0x00, 0xd5, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, // ..............A. + 0x05, 0x00, 0x13, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x61, 0x00, // ..............a. + 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x51, 0x00, // ..>...........Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x13, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xc0, 0x00, // ..A............. + 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xda, 0x00, // ..f...>......... + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x13, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xc0, 0x00, // ..A............. + 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xde, 0x00, // ......=......... + 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe0, 0x00, // ......O......... + 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe1, 0x00, // ................ + 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe2, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x85, 0x00, // ......B......... + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x15, 0x01, // ................ + 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x7a, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x79, 0x00, // ..A...z.......y. + 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ......]...=..... + 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x0c, 0x00, // ................ + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x0c, 0x00, // ..........R..... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x0c, 0x00, // ..........R..... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, // ..............1. + 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0xed, 0x00, // ................ + 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf4, 0x00, // ......Q......... + 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x02, 0x00, // ................ + 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0xf4, 0x00, // ..P............. + 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..............>. + 0x03, 0x00, 0xa6, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..............8. + 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ...... }; -static const uint8_t fs_font_distance_field_dx9[787] = +static const uint8_t fs_font_distance_field_dx11[1098] = { - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, // ....u_params.... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x02, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, // ................ - 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x03, // ,.CTAB.......... - 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, 0x00, // ..............|. - 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, // ..D...........P. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, // ......`......... - 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..l.......s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // olor............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0xab, // ......u_params.. - 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, // ..ps_3_0.Microso - 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, // ft (R) HLSL Shad - 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, // er Compiler 10.1 - 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, // ..Q..........@.. - 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, // .?.......?Q..... - 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, // ................ - 0x40, 0xc0, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xf3, 0x04, 0x35, 0x41, 0x00, 0x00, // @.Q.........5A.. - 0x00, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // .?......@@...... - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, // ................ - 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, // ................ - 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, // ................ - 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, // U.............X. - 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x01, 0x00, 0xaa, 0xa0, 0x01, 0x00, // ........U....... - 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // U.X............. - 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................ - 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, // ....U........... - 0x00, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, // ......X......... - 0xe4, 0x8c, 0x01, 0x00, 0xff, 0xa0, 0x01, 0x00, 0xaa, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, // ..........B..... - 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x01, 0x80, 0x01, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x00, 0x00, // ..........[..... - 0x0e, 0x80, 0x01, 0x00, 0x90, 0x90, 0x5c, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0xe4, 0x8b, 0x01, 0x00, // ................ - 0x90, 0x8b, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, // ................ - 0xf9, 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, // ............U... - 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ........U....... - 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ....U...U....... - 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x03, 0x00, 0x55, 0xa0, 0x04, 0x00, // ....U.......U... - 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, // ........U....... - 0x55, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, // U............... - 0xe4, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, // ............U... - 0x00, 0x03, 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, // ........U....... - 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xaa, 0xa0, 0x03, 0x00, // ................ - 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // U............... - 0xff, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, // ................ - 0x00, 0x00, 0x00, // ... -}; -static const uint8_t fs_font_distance_field_dx11[1107] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x08, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, // ..s_texColor0... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x44, // r0.............D - 0x58, 0x42, 0x43, 0x94, 0x67, 0xc1, 0x07, 0x2c, 0x82, 0xd2, 0x89, 0x1d, 0x94, 0x4a, 0x17, 0x85, // XBC.g..,.....J.. - 0x81, 0x8b, 0x32, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // ..2............, - 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, // ...........ISGNl - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, // ...........P.... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, // ...........b.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, // ...SV_POSITION.C - 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, // OLOR.TEXCOORD..O - 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, // SGN,........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, // .......SV_TARGET - 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x24, 0x03, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xc9, // ...SHDR$...@.... - 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...Y...F. ...... - 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, // ...Z....`......X - 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, // 0...p......UU..b - 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, // ...........b.... - 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, // .......e.... ... - 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, // ...h.......i.... - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, // ...........E.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // .......F.......F - 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // ~.......`......6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ....0 .........* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, // .......6....0 .. - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, // ....0 .......... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, // .......6....0 .. - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // .......:.......2 - 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x02, // ...........:.... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@.....@.@... - 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ..?............. - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......6........ - 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ....0 .......... - 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ................ - 0x19, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, // ...........r.... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, // ...F............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, // .......V........ - 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, // ................ - 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, // ...........K..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...............8 - 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // ..... .........2 - 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, // ...B...........A - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, // ........@....5A. - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, // @.....?2...".... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, // ............@... - 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, // .5A.@.....?....2 - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ...........A.... - 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, // ...F..........." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, // ........@.....?. - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..?...?...?..... - 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ...8 ........... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // ...............2 - 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@.......@... - 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // .@@8............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...............8 - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, // ...........8.... - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // ..............: - 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, // .......6...r ... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, // ...F.......>.... - 0x00, 0x10, 0x00, // ... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x2e, 0x6d, // ..........DXBC.m + 0xb2, 0x8c, 0xf3, 0x78, 0x8a, 0x9b, 0x40, 0xf6, 0xf4, 0x47, 0x18, 0x61, 0x9c, 0xb1, 0x01, 0x00, // ...x..@..G.a.... + 0x00, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, // ..........,..... + 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, // ......ISGNl..... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ......P......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......b......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, // ..............SV + 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, // _POSITION.COLOR. + 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, // TEXCOORD..OSGN,. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................ + 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, // ..SV_TARGET...SH + 0x45, 0x58, 0x30, 0x03, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x6a, 0x08, // EX0...P.......j. + 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..Y...F. ....... + 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, // ..Z....`......X0 + 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, // ...p......UU..b. + 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, // ..........b..... + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......e.... .... + 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, // ..h.......i..... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, // ..........E..... + 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, // ..CU..........F. + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, // ......F~.......` + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, // ......6....0 ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ......*.......6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, // ...0 ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, // ......6....0 ... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, // ...0 .........:. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..:........@.... + 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, // .@.@.....?...... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, // ...........0 ... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, // ..........z..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x7c, 0x00, // ..............|. + 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, // ..r.......F..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, // ..............V. + 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // .........."..... + 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..K..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8..."..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, // ............ ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2...B..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......A........@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, // ....5A.@.....?2. + 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@....5A.@.... + 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, // .?....2......... + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, // ..A.......F..... + 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ......"........@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // .....?...?...?.. + 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, // .?........8 .... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2..."..... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@.... + 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, // ...@....@@8..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..8.... ........ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, // ......:.......6. + 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, // ..r ......F..... + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ..>....... }; -static const uint8_t fs_font_distance_field_mtl[2043] = +static const uint8_t fs_font_distance_field_mtl[2102] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x11, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler @@ -395,7 +339,7 @@ static const uint8_t fs_font_distance_field_mtl[2043] = 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, // .......u_params. 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..........s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x07, // olor............ + 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, // olor............ 0x00, 0x00, 0x23, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x20, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x20, // ..#pragma clang 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, // diagnostic ignor 0x65, 0x64, 0x20, 0x22, 0x2d, 0x57, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2d, 0x70, 0x72, // ed "-Wmissing-pr @@ -500,23 +444,27 @@ static const uint8_t fs_font_distance_field_mtl[2043] = 0x32, 0x36, 0x34, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x31, 0x39, 0x32, 0x5b, // 264.y;. _192[ 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x32, 0x36, 0x34, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 2] = _264.x;. 0x20, 0x5f, 0x31, 0x39, 0x32, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x32, 0x36, 0x34, 0x2e, // _192[3] = _264. - 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x33, // w;. float _23 - 0x31, 0x20, 0x3d, 0x20, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, // 1 = (length(fwid - 0x74, 0x68, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // th(in.v_texcoord - 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, // 0.xyz)) * 11.313 - 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x37, 0x29, 0x20, 0x2a, 0x20, // 708305358887) * - 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, // _mtl_u.u_params. - 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, // y;. out.bgfx_ - 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // FragData0 = floa - 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, // t4(in.v_color0.x - 0x79, 0x7a, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x30, // yz, smoothstep(0 - 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x5f, 0x32, 0x33, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x20, 0x2b, // .5 - _231, 0.5 + - 0x20, 0x5f, 0x32, 0x33, 0x31, 0x2c, 0x20, 0x5f, 0x31, 0x39, 0x32, 0x5b, 0x69, 0x6e, 0x74, 0x28, // _231, _192[int( - 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // (in.v_texcoord0. - 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x5d, // w * 4.0) + 0.5)] - 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // ) * in.v_color0. - 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, // w);. return o - 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // ut;.}....0. + 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x32, // w;. float _22 + 0x36, 0x20, 0x3d, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, // 6 = length(fwidt + 0x68, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // h(in.v_texcoord0 + 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, // .xyz));. out. + 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, // bgfx_FragData0 = + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // float4(in.v_col + 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, // or0.xyz, smooths + 0x74, 0x65, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x28, // tep(fma(_226 * ( + 0x2d, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, // -11.313708305358 + 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // 88671875), _mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, // u.u_params.y, 0. + 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x31, // 5), fma(_226 * 1 + 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, // 1.31370830535888 + 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // 671875, _mtl_u.u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, // _params.y, 0.5), + 0x20, 0x5f, 0x31, 0x39, 0x32, 0x5b, 0x69, 0x6e, 0x74, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x69, 0x6e, // _192[int(fma(in + 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x2c, 0x20, // .v_texcoord0.w, + 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, // 4.0, 0.5))]) * i + 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, // n.v_color0.w);. + 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, // return out;.} + 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // ....0. }; extern const uint8_t* fs_font_distance_field_pssl; extern const uint32_t fs_font_distance_field_pssl_size; diff --git a/bgfx/examples/common/font/fs_font_distance_field.sc b/bgfx/examples/common/font/fs_font_distance_field.sc index 8bc3e1d9..91a934c9 100644 --- a/bgfx/examples/common/font/fs_font_distance_field.sc +++ b/bgfx/examples/common/font/fs_font_distance_field.sc @@ -9,7 +9,7 @@ uniform vec4 u_params; #define u_distanceMultiplier u_params.y void main() -{ +{ vec4 color = textureCube(s_texColor, v_texcoord0.xyz); int index = int(v_texcoord0.w*4.0 + 0.5); float rgba[4]; diff --git a/bgfx/examples/common/font/fs_font_distance_field_drop_shadow.bin.h b/bgfx/examples/common/font/fs_font_distance_field_drop_shadow.bin.h index d81fa11b..d028e55c 100644 --- a/bgfx/examples/common/font/fs_font_distance_field_drop_shadow.bin.h +++ b/bgfx/examples/common/font/fs_font_distance_field_drop_shadow.bin.h @@ -264,156 +264,147 @@ static const uint8_t fs_font_distance_field_drop_shadow_essl[2132] = 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x3b, 0x0a, // or = tmpvar_17;. 0x7d, 0x0a, 0x0a, 0x00, // }... }; -static const uint8_t fs_font_distance_field_drop_shadow_spv[3346] = +static const uint8_t fs_font_distance_field_drop_shadow_spv[3218] = { 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH..gz........u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, // ..s_texColor0... - 0x00, 0x00, 0x00, 0x04, 0x1a, 0x00, 0xd4, 0x0c, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ............#... - 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0xeb, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ + 0x00, 0x00, 0x00, 0x04, 0x22, 0x00, 0x54, 0x0c, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ....".T.....#... + 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xee, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, // ..............GL 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // SL.std.450...... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0c, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, // ......main...... - 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0xf9, 0x00, // ................ - 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, // ................ - 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. - 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ......-...s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, // olorSampler..... - 0x07, 0x00, 0x30, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ..0...s_texColor - 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x92, 0x00, // Texture......... - 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, // ..UniformBlock.. - 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ..............u_ - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x94, 0x00, // params.......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0xed, 0x00, 0x00, 0x00, 0x67, 0x6c, // ..............gl - 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // _FragCoord...... - 0x05, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, // ......v_color0.. - 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ..........v_colo - 0x72, 0x31, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x76, 0x5f, // r1............v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0xf9, 0x00, // texcoord0....... - 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, // ..v_texcoord1... - 0x05, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // ......v_texcoord - 0x32, 0x00, 0x05, 0x00, 0x06, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // 2.........bgfx_F - 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2d, 0x00, // ragData0..G...-. - 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2d, 0x00, // ..".......G...-. - 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, // ..!.......G...0. - 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, // ..".......G...0. - 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x92, 0x00, // ..!.......H..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ......#.......G. - 0x03, 0x00, 0x92, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x94, 0x00, // ..........G..... - 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x94, 0x00, // ..".......G..... - 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xed, 0x00, // ..!.......G..... - 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xf0, 0x00, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xf3, 0x00, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xf6, 0x00, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xf9, 0x00, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xfc, 0x00, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0f, 0x01, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..!............. - 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..,...........;. - 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, // ..,...-....... . - 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ../...........;. - 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, // ../...0......... - 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..3... .......+. - 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..3...4.......+. - 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, // ..3...8......... - 0x03, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..<.......+..... - 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, // ..O.......,..... - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, // ..R...O...O...O. - 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ......g... ..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+.......k..... - 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, // .@+.......m..... - 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x04, 0x00, // .?+...g...p..... - 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x70, 0x00, // ......q.......p. - 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x71, 0x00, // .. ...r.......q. - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x02, 0x00, // ..+...g...t..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x01, 0x00, // ..+...g...x..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x02, 0x00, // ..+...3...|..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+...g...}..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x03, 0x00, // ..+...3......... - 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x92, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x93, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x93, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x36, 0x00, // ............5A6. - 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x72, 0x00, // ..........;...r. - 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x72, 0x00, // ..3.......;...r. - 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, // ..<.......=..... - 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, // ......-...=..... - 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..1...0...=..... - 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..........=..... - 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..........=..... - 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xb3, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x42, 0x01, // ..........}...B. - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x42, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ......B...O..... - 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, // ..E............. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0x14, 0x00, // ................ - 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x9a, 0x00, // ......E...R..... - 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xa8, 0x00, // ......G......... - 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0xf7, 0x00, // ......H...G..... - 0x03, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x48, 0x01, // ..............H. - 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x49, 0x01, // ..I...........I. - 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x4d, 0x01, 0x00, 0x00, 0xfd, 0x00, // ..O.......M..... - 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0x31, 0x00, // ..V...<.......1. - 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc9, 0x01, // ......W......... - 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0x4d, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ......M...Q..... - 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ..P............. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x51, 0x01, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x6b, 0x00, // ......Q...P...k. - 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x51, 0x01, // ..........R...Q. - 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x53, 0x01, // ..m...n...3...S. - 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x55, 0x01, // ..R...Q.......U. - 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, // ..........A..... - 0x00, 0x00, 0x56, 0x01, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..V...3...8...>. - 0x03, 0x00, 0x56, 0x01, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..V...U...Q..... - 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, // ..X...........A. - 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x34, 0x00, // ......Y...3...4. - 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x59, 0x01, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...Y...X...Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5b, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x00, 0x00, // ......[......... - 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x33, 0x01, // ..A...........3. - 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x5b, 0x01, // ..|...>.......[. - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5e, 0x01, 0x00, 0x00, 0xc9, 0x01, // ..Q.......^..... - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x5f, 0x01, // ......A......._. - 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5f, 0x01, // ..3.......>..._. - 0x00, 0x00, 0x5e, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x61, 0x01, // ..^...A.......a. - 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x53, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..3...S...=..... - 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0x61, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..b...a...O..... - 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, // ..d............. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x0b, 0x00, // ................ - 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, // ..e...d......... - 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x65, 0x01, // ..f.......B...e. - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x66, 0x01, // ..........h...f. - 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x95, 0x00, 0x00, 0x00, 0x69, 0x01, // ......A.......i. - 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......8...x...=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x85, 0x00, // ......j...i..... - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x6a, 0x01, // ......k...h...j. - 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x95, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x94, 0x00, // ..A.......l..... - 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..8...t...=..... - 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // ..m...l......... - 0x00, 0x00, 0x6e, 0x01, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x83, 0x00, // ..n...k...m..... - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0x01, // ......p...m...n. - 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x72, 0x01, 0x00, 0x00, 0x6d, 0x00, // ..........r...m. - 0x00, 0x00, 0x6e, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x74, 0x01, // ..n...........t. + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, // ......main...... + 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x10, 0x00, // ................ + 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x73, 0x5f, // in........-...s_ + 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, // texColorSampler. + 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x30, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ......0...s_texC + 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, // olorTexture..... + 0x06, 0x00, 0x92, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, // ......UniformBlo + 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, // ck.............. + 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..u_params...... + 0x03, 0x00, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xf0, 0x00, // ................ + 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..v_color0...... + 0x05, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // ......v_texcoord + 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // 0.........v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x00, 0x05, 0x00, 0x06, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x62, 0x67, // oord2.........bg + 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, // fx_FragData0..G. + 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..-...".......G. + 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, // ..-...!.......G. + 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..0...".......G. + 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, // ..0...!.......H. + 0x05, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........#..... + 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x92, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, // ..G...........G. + 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ......".......G. + 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, // ......!.......G. + 0x04, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. + 0x04, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. + 0x04, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. + 0x04, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, // ................ + 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... + 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, // ................ + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, // ................ + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x13, 0x00, // ................ + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // .. ...,......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;...,...-..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // .. .../......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;.../...0..... + 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, // ......3... ..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, // ..+...3...4..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+...3...8..... + 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, // ......<.......+. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, // ......O.......,. + 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, // ......R...O...O. + 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x20, 0x00, // ..O.......g... . + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6b, 0x00, // ......+.......k. + 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6d, 0x00, // .....@+.......m. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x70, 0x00, // .....?+...g...p. + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x07, 0x00, // ..........q..... + 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x07, 0x00, // ..p... ...r..... + 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x74, 0x00, // ..q...+...g...t. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x78, 0x00, // ......+...g...x. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x7c, 0x00, // ......+...3...|. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x7d, 0x00, // ......+...g...}. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x81, 0x00, // ......+...3..... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x92, 0x00, 0x00, 0x00, 0x0d, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x93, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x92, 0x00, // .. ............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x93, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x02, 0x00, // ..;............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x03, 0x00, // ..;............. + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, 0xf3, 0x04, // ..+............. + 0x35, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0xf3, 0x04, // 5A+............. + 0x35, 0xc1, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // 5.6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. + 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..r...3.......;. + 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..r...<.......=. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..........-...=. + 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......1...0...=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xf7, 0x00, // ................ + 0x03, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0x7d, 0x00, // ..............}. + 0x00, 0x00, 0x42, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x42, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..B.......B...O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfd, 0x00, // ......E......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb4, 0x00, // ................ + 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x52, 0x00, // ..........E...R. + 0x00, 0x00, 0x9a, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0xc0, 0x01, // ..........G..... + 0x00, 0x00, 0xa8, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0x47, 0x01, // ..........H...G. + 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, // ................ + 0x04, 0x00, 0x48, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xf8, 0x00, // ..H...I......... + 0x02, 0x00, 0x49, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x4d, 0x01, // ..I...O.......M. + 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xc7, 0x01, // ......V...<..... + 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, // ..1.......W..... + 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0x4d, 0x01, 0x00, 0x00, 0x51, 0x00, // ..........M...Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x03, 0x00, // ......P......... + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........R..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6d, 0x00, // ..2...P...k...m. + 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x53, 0x01, 0x00, 0x00, 0x52, 0x01, // ..n...3...S...R. + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0xc9, 0x01, // ..Q.......U..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x56, 0x01, // ......A.......V. + 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x56, 0x01, // ..3...8...>...V. + 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, 0x01, // ..U...Q.......X. + 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, // ..........A..... + 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..Y...3...4...>. + 0x03, 0x00, 0x59, 0x01, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..Y...X...Q..... + 0x00, 0x00, 0x5b, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, // ..[...........A. + 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x7c, 0x00, // ..........3...|. + 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>.......[...Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5e, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x03, 0x00, // ......^......... + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x33, 0x01, // ..A......._...3. + 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x5e, 0x01, // ......>..._...^. + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x61, 0x01, 0x00, 0x00, 0x33, 0x01, // ..A.......a...3. + 0x00, 0x00, 0x53, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x62, 0x01, // ..S...=.......b. + 0x00, 0x00, 0x61, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x64, 0x01, // ..a...O.......d. + 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x65, 0x01, // ..............e. + 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x66, 0x01, // ..d...........f. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x85, 0x00, // ......B...e..... + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0xe9, 0x01, // ......h...f..... + 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x95, 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x94, 0x00, // ..A.......i..... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..8...x...=..... + 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // ..j...i......... + 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x41, 0x00, // ..k...h...j...A. + 0x06, 0x00, 0x95, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x38, 0x00, // ......l.......8. + 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6d, 0x01, // ..t...=.......m. + 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xeb, 0x01, // ..l............. + 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x70, 0x01, // ..k...........p. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0x6d, 0x01, // ......2.......m. + 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x72, 0x01, // ..m...........r. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x6d, 0x01, // ......2...k...m. + 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x74, 0x01, // ..m...........t. 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x72, 0x01, // ......1...p...r. 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x79, 0x01, // ..b...Q.......y. 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // ................ @@ -430,37 +421,38 @@ static const uint8_t fs_font_distance_field_drop_shadow_spv[3346] = 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, // ..1.......W..... 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0xd0, 0x01, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x86, 0x01, // ................ - 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x88, 0x01, // ..k............. - 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x33, 0x00, // ......m...n...3. - 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, // ..............A. - 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x38, 0x00, // ..........<...8. - 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...........Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8e, 0x01, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x3c, 0x01, // ..A...........<. - 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x8e, 0x01, // ..4...>......... - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x91, 0x01, 0x00, 0x00, 0xd2, 0x01, // ..Q............. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x92, 0x01, // ......A......... - 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x92, 0x01, // ..<...|...>..... - 0x00, 0x00, 0x91, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x94, 0x01, // ......Q......... - 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, // ..........A..... - 0x00, 0x00, 0x95, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......<.......>. - 0x03, 0x00, 0x95, 0x01, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, // ..........A..... - 0x00, 0x00, 0x97, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x3d, 0x00, // ......<.......=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x98, 0x01, 0x00, 0x00, 0x97, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..............O. - 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0xf7, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, // ................ - 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0x0c, 0x00, // ................ - 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, // ..............B. - 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9e, 0x01, // ................ - 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x95, 0x00, // ..........A..... - 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x78, 0x00, // ..........8...x. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x9f, 0x01, // ..=............. - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0x9e, 0x01, // ................ - 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa3, 0x01, // ................ - 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, // ..m............. - 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0x0c, 0x00, // ......m......... + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6d, 0x00, // ..2.......k...m. + 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x88, 0x01, // ..n...3......... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0xd2, 0x01, // ..Q............. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x8c, 0x01, // ......A......... + 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x8c, 0x01, // ..<...8...>..... + 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8e, 0x01, // ......Q......... + 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, // ..........A..... + 0x00, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......<...4...>. + 0x03, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x8e, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0x91, 0x01, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, // ..............A. + 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x92, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x7c, 0x00, // ..........<...|. + 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x92, 0x01, 0x00, 0x00, 0x91, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...........Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x95, 0x01, 0x00, 0x00, 0x3c, 0x01, // ..A...........<. + 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x95, 0x01, 0x00, 0x00, 0x94, 0x01, // ......>......... + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x97, 0x01, 0x00, 0x00, 0x3c, 0x01, // ..A...........<. + 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x98, 0x01, // ......=......... + 0x00, 0x00, 0x97, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9a, 0x01, // ......O......... + 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9b, 0x01, // ................ + 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9c, 0x01, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x85, 0x00, // ......B......... + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9e, 0x01, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0xe9, 0x01, // ................ + 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x95, 0x00, 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0x94, 0x00, // ..A............. + 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..8...x...=..... + 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0xea, 0x01, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0x0c, 0x00, // ................ + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0xea, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x00, // ..........m..... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0x9e, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x00, // ..........m..... 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa7, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, // ..............1. 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0x98, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ @@ -472,230 +464,143 @@ static const uint8_t fs_font_distance_field_drop_shadow_spv[3346] = 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0xae, 0x01, // ..P............. 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xf9, 0x00, // ................ 0x02, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xf5, 0x00, // ................ - 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xea, 0x01, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x49, 0x01, // ..........~...I. + 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x49, 0x01, // ..........~...I. 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x0f, 0x01, // ..........>..... - 0x00, 0x00, 0xea, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..........8..... + 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..........8..... 0x10, 0x00, // .. }; -static const uint8_t fs_font_distance_field_drop_shadow_dx9[1335] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH..gz........s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, // ....u_params.... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x04, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, // ................ - 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x03, // ,.CTAB.......... - 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, 0x00, // ..............|. - 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, // ..D...........P. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, // ......`......... - 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..l.......s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // olor............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0xab, // ......u_params.. - 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, // ..ps_3_0.Microso - 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, // ft (R) HLSL Shad - 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, // er Compiler 10.1 - 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ..Q............. - 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, // ........@.Q..... - 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, // .....?.......@.. - 0x00, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xf3, 0x04, 0x35, 0x41, 0x00, 0x00, // .?Q.........5A.. - 0x00, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // .?......@@...... - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, // ................ - 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x02, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, // ..........X..... - 0x07, 0x80, 0x02, 0x00, 0xe4, 0x9c, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x08, 0x00, // ............U... - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x29, 0x00, // ..............). - 0x04, 0x02, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, // ........U....... - 0x0f, 0x80, 0x02, 0x00, 0x55, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ....U.*......... - 0x02, 0x80, 0x02, 0x00, 0xff, 0x90, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xff, 0xa0, 0x13, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, // ........U.X..... - 0x08, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x02, 0x00, 0x00, 0xa0, 0x58, 0x00, // ........U.....X. - 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x55, 0xa0, 0x00, 0x00, // ........U...U... - 0xff, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // ............U... - 0xaa, 0x81, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, // ................ - 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, // U...........U... - 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x8c, 0x02, 0x00, // ..X............. - 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x02, 0x00, // ....U.B......... - 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, // ................ - 0xc6, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, // ......[......... - 0xe4, 0x90, 0x5c, 0x00, 0x00, 0x02, 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x90, 0x02, 0x00, // ................ - 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x8b, 0x02, 0x00, 0xe4, 0x8b, 0x08, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x07, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ....U........... - 0xaa, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x03, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ........U....... - 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x55, 0xa0, 0x02, 0x00, // ............U... - 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xff, 0x81, 0x00, 0x00, 0xe4, 0x80, 0x06, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x12, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ........U....... - 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x55, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ....U...U....... - 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0xaa, 0xa0, 0x03, 0x00, 0xff, 0xa0, 0x05, 0x00, // ....U........... - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, // ............U... - 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, // ........U....... - 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x2b, 0x00, 0x00, 0x00, 0x29, 0x00, // ..........+...). - 0x03, 0x02, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x04, 0x00, // ........U.*..... - 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, // ................ - 0xff, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, // ..............X. - 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x02, 0x00, // ........U...U... - 0x00, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, // ..X............. - 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // U............... - 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ....U........... - 0xaa, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, // ................ - 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, // ......X......... - 0xe4, 0x8c, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, // ........U.B..... - 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x01, 0x80, 0x01, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x00, 0x00, // ..........[..... - 0x0e, 0x80, 0x01, 0x00, 0x90, 0x90, 0x5c, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0xe4, 0x8b, 0x01, 0x00, // ................ - 0x90, 0x8b, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, // ................ - 0xf9, 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, // ............U... - 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ........U....... - 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ....U...U....... - 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x03, 0x00, 0x55, 0xa0, 0x04, 0x00, // ....U.......U... - 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, // ........U....... - 0x55, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, // U............... - 0xe4, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, // ............U... - 0x00, 0x03, 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, // ........U....... - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, // ................ - 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xaa, 0xa0, 0x03, 0x00, // ................ - 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // ............U... - 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0xff, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x2b, 0x00, // ..............+. - 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, // ....... -}; -static const uint8_t fs_font_distance_field_drop_shadow_dx11[2043] = +static const uint8_t fs_font_distance_field_drop_shadow_dx11[2042] = { - 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x08, 0x75, // FSH..gz........u + 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH..gz........u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, // ..s_texColor0... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x07, 0x00, 0x00, 0x44, // r0.............D - 0x58, 0x42, 0x43, 0x1a, 0xc6, 0x6b, 0xec, 0xf0, 0x1b, 0x11, 0x22, 0xfe, 0x17, 0x53, 0x48, 0x88, // XBC..k...."..SH. - 0xaa, 0xde, 0xb5, 0x01, 0x00, 0x00, 0x00, 0xa8, 0x07, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // ..............., - 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0xb4, // ...........ISGN. - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO - 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX - 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // COORD..OSGN,.... - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S - 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x84, // V_TARGET...SHDR. - 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, // ...@.......Y...F - 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, // . .........Z.... - 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, // `......X0...p... - 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, // ...UU..b........ - 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, // ...b...........b - 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ...........e.... - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, // ......h.......i - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, // ...............i - 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, // ................ - 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, // ...r.......F.... - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....@........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......<........ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...<...........* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, // ................ - 0x00, 0x00, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, // ...........E.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, // .......F.......F - 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // ~.......`......2 - 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x05, // ...........:.... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@.....@.@... - 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, // ..?............. - 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, // .......6....0 .. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // .......*.......6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ....0 .......... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, // .......6....0 .. - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, // ....0 .........: - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......6........ - 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, // ....0 .......... - 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ................ - 0x19, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, // ...........r.... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, // ...F............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, // .......V........ - 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, // ................ - 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, // ...........K..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...............8 - 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ..... .........8 - 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // ...*. .........2 - 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, // ...B...........A - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, // ........@....5A. - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, // @.....?2...".... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, // ............@... - 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, // .5A.@.....?....2 - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ...........A.... - 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, // ...F..........." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, // ........@.....?. - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..?...?...?..... - 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ...8 ........... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // ...............2 - 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@.......@... - 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // .@@8............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...............8 - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, // ...........8.... - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // ..............: - 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, // .......6...r ... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, // ...F.......>.... - 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...E...........F - 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......F~....... - 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, // `......2........ - 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, // ...:........@... - 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, // ..@.@.....?..... - 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ....0 .........* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, // .......6....0 .. - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, // ....0 .......... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, // .......6....0 .. - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // .......:.......6 - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x01, // ............0 .. - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0xe2, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, // ...r.......F.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, // ...............V - 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, // ...........".... - 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ...K..."........ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, // .......8...".... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, // ............. .. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, // .......2...B.... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......A........ - 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, // @....5A.@.....?2 - 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@....5A.@... - 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, // ..?....2........ - 0x0a, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, // ...A.......F.... - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // ......."........ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, // @.....?...?...?. - 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, // ..?........8 ... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, // .......2...".... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, // ............@... - 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, // ....@....@@8.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......8........ - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...8.... ....... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, // .......:.......6 - 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, // ...r ......F.... - 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ...>....... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x07, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x38, 0xa0, // ..........DXBC8. + 0x50, 0xef, 0x44, 0x93, 0x14, 0xfc, 0x8e, 0x3e, 0x55, 0x6a, 0x7c, 0x97, 0x5c, 0x3c, 0x01, 0x00, // P.D....>Uj|..<.. + 0x00, 0x00, 0xbc, 0x07, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xe8, 0x00, // ..........,..... + 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0xb4, 0x00, 0x00, 0x00, 0x06, 0x00, // ......ISGN...... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xa4, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, // ......SV_POSITIO + 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, // N.COLOR.TEXCOORD + 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,......... + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. ............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR + 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x98, 0x06, 0x00, 0x00, 0x50, 0x00, // GET...SHEX....P. + 0x00, 0x00, 0xa6, 0x01, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, // ......j...Y...F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, // .........Z....` + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, // ......X0...p.... + 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, // ..UU..b......... + 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x10, // ..b...........b. + 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, // ..........e.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, // ......h.......i. + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x00, // ..............i. + 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00, // ................ + 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, // ..r.......F..... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...@............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......<......... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ..<...........*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, // ................ + 0x00, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, // ..........E..... + 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, // ..CU..........F. + 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, // ......F~.......` + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, // ......2......... + 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..:........@.... + 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, // .@.@.....?...... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ...0 .........*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, // ......6....0 ... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, // ...0 ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, // ......6....0 ... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ......:.......6. + 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, // ...........0 ... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, // ..........z..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x7c, 0x00, // ..............|. + 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, // ..r.......F..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, // ..............V. + 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // .........."..... + 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..K..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8..."..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, // ............ ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8..."..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00, 0x00, 0x00, // ..........*. ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2...B..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......A........@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, // ....5A.@.....?2. + 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@....5A.@.... + 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, // .?....2......... + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, // ..A.......F..... + 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ......"........@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // .....?...?...?.. + 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, // .?........8 .... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2..."..... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@.... + 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, // ...@....@@8..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..8.... ........ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, // ......:.......6. + 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, // ..r ......F..... + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, // ..>.......E..... + 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, // ..CU..........F. + 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, // ......F~.......` + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, // ......2......... + 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..:........@.... + 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, // .@.@.....?...... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ...0 .........*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, // ......6....0 ... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, // ...0 ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, // ......6....0 ... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ......:.......6. + 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x01, 0x00, // ...........0 ... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, // ..........z..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, // ..............|. + 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, // ..r.......F..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, // ..............V. + 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // .........."..... + 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..K..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8..."..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, // ............ ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2...B..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......A........@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, // ....5A.@.....?2. + 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@....5A.@.... + 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, // .?....2......... + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, // ..A.......F..... + 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ......"........@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // .....?...?...?.. + 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, // .?........8 .... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2..."..... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@.... + 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, // ...@....@@8..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..8.... ........ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, // ......:.......6. + 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, // ..r ......F..... + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ..>....... }; -static const uint8_t fs_font_distance_field_drop_shadow_mtl[2801] = +static const uint8_t fs_font_distance_field_drop_shadow_mtl[2891] = { 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x11, 0x73, // FSH..gz........s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler @@ -703,7 +608,7 @@ static const uint8_t fs_font_distance_field_drop_shadow_mtl[2801] = 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, // .......u_params. 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..........s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x0a, // olor..........{. + 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x0a, // olor............ 0x00, 0x00, 0x23, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x20, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x20, // ..#pragma clang 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, // diagnostic ignor 0x65, 0x64, 0x20, 0x22, 0x2d, 0x57, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2d, 0x70, 0x72, // ed "-Wmissing-pr @@ -799,7 +704,7 @@ static const uint8_t fs_font_distance_field_drop_shadow_mtl[2801] = 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // ]]).{. xlatMt 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, // lMain_out out = 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, // {};. float4 _ - 0x34, 0x39, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, // 490;. do. + 0x34, 0x39, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, // 493;. do. 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x21, 0x61, // {. if (!a 0x6e, 0x79, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // ny(in.v_texcoord 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // 2.xyz == float3( @@ -820,59 +725,64 @@ static const uint8_t fs_font_distance_field_drop_shadow_mtl[2801] = 0x3d, 0x20, 0x5f, 0x34, 0x35, 0x37, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _457.x;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x30, 0x37, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, // _307[3] = 0x5f, 0x34, 0x35, 0x37, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _457.w;. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x33, 0x36, 0x36, 0x20, 0x3d, // float _366 = - 0x20, 0x28, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, // ((length(fwidth - 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, // (in.v_texcoord2. - 0x78, 0x79, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, // xyz)) * 11.31370 - 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x37, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, // 8305358887) * _m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, // tl_u.u_params.y) - 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // * _mtl_u.u_para - 0x6d, 0x73, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ms.z;. - 0x20, 0x20, 0x5f, 0x34, 0x39, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, // _490 = float4( - 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, // in.v_color0.xyz, - 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x30, 0x2e, 0x35, 0x20, // smoothstep(0.5 - 0x2d, 0x20, 0x5f, 0x33, 0x36, 0x36, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x33, // - _366, 0.5 + _3 - 0x36, 0x36, 0x2c, 0x20, 0x5f, 0x33, 0x30, 0x37, 0x5b, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x69, 0x6e, // 66, _307[int((in - 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x77, 0x20, 0x2a, // .v_texcoord2.w * - 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x5d, 0x29, 0x20, 0x2a, // 4.0) + 0.5)]) * - 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, // in.v_color0.w); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, // . bre - 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, // ak;. }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x36, // float4 _46 - 0x36, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, // 6 = s_texColor.s - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ample(s_texColor - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // Sampler, in.v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, // xcoord0.xyz);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x41, // spvUnsafeA - 0x72, 0x72, 0x61, 0x79, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x34, 0x3e, 0x20, 0x5f, // rray _ - 0x33, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x31, // 316;. _31 - 0x36, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x36, 0x36, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, // 6[0] = _466.z;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x31, 0x36, 0x5b, 0x31, 0x5d, 0x20, 0x3d, // _316[1] = - 0x20, 0x5f, 0x34, 0x36, 0x36, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _466.y;. - 0x20, 0x5f, 0x33, 0x31, 0x36, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x36, 0x36, 0x2e, // _316[2] = _466. - 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x31, 0x36, 0x5b, // x;. _316[ - 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x36, 0x36, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 3] = _466.w;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x34, 0x31, 0x37, 0x20, // float _417 - 0x3d, 0x20, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, // = (length(fwidth + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x33, 0x36, 0x33, 0x20, 0x3d, // float _363 = + 0x20, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, 0x28, // (length(fwidth( + 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x78, // in.v_texcoord2.x + 0x79, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, // yz)) * 11.313708 + 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x20, // 30535888671875) + 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // * _mtl_u.u_param + 0x73, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // s.y;. + 0x20, 0x5f, 0x34, 0x39, 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, // _493 = float4(i + 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, // n.v_color0.xyz, + 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x2d, // smoothstep(fma(- + 0x5f, 0x33, 0x36, 0x33, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // _363, _mtl_u.u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x66, // arams.z, 0.5), f + 0x6d, 0x61, 0x28, 0x5f, 0x33, 0x36, 0x33, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // ma(_363, _mtl_u. + 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, // u_params.z, 0.5) + 0x2c, 0x20, 0x5f, 0x33, 0x30, 0x37, 0x5b, 0x69, 0x6e, 0x74, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x69, // , _307[int(fma(i + 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x77, 0x2c, // n.v_texcoord2.w, + 0x20, 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x5d, 0x29, 0x20, 0x2a, 0x20, // 4.0, 0.5))]) * + 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, // in.v_color0.w);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, // brea + 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // k;. }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x36, 0x36, // float4 _466 + 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, // = s_texColor.sa + 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, // mple(s_texColorS + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, // ampler, in.v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // coord0.xyz);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x41, 0x72, // spvUnsafeAr + 0x72, 0x61, 0x79, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x34, 0x3e, 0x20, 0x5f, 0x33, // ray _3 + 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x31, 0x36, // 16;. _316 + 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x36, 0x36, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, // [0] = _466.z;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x31, 0x36, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, // _316[1] = + 0x5f, 0x34, 0x36, 0x36, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _466.y;. + 0x5f, 0x33, 0x31, 0x36, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x36, 0x36, 0x2e, 0x78, // _316[2] = _466.x + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x31, 0x36, 0x5b, 0x33, // ;. _316[3 + 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x36, 0x36, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ] = _466.w;. + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x34, 0x31, 0x32, 0x20, 0x3d, // float _412 = + 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, 0x28, 0x69, // length(fwidth(i + 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, // n.v_texcoord0.xy + 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x39, // z));. _49 + 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // 3 = float4(in.v_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, // color0.xyz, smoo + 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x34, 0x31, 0x32, 0x20, // thstep(fma(_412 + 0x2a, 0x20, 0x28, 0x2d, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, // * (-11.313708305 + 0x33, 0x35, 0x38, 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x6d, // 35888671875), _m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, // tl_u.u_params.y, + 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x34, 0x31, 0x32, 0x20, // 0.5), fma(_412 + 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, // * 11.31370830535 + 0x38, 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // 888671875, _mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, // u.u_params.y, 0. + 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x33, 0x31, 0x36, 0x5b, 0x69, 0x6e, 0x74, 0x28, 0x66, 0x6d, 0x61, // 5), _316[int(fma 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // (in.v_texcoord0. - 0x78, 0x79, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, // xyz)) * 11.31370 - 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x37, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, // 8305358887) * _m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x3b, // tl_u.u_params.y; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x39, 0x30, 0x20, 0x3d, 0x20, // . _490 = - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // float4(in.v_colo - 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, // r0.xyz, smoothst - 0x65, 0x70, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x5f, 0x34, 0x31, 0x37, 0x2c, 0x20, 0x30, // ep(0.5 - _417, 0 - 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x34, 0x31, 0x37, 0x2c, 0x20, 0x5f, 0x33, 0x31, 0x36, 0x5b, // .5 + _417, _316[ - 0x69, 0x6e, 0x74, 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // int((in.v_texcoo - 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, // rd0.w * 4.0) + 0 - 0x2e, 0x35, 0x29, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // .5)]) * in.v_col - 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // or0.w);. - 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, // break;. } whi - 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, // le(false);. o - 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ut.bgfx_FragData - 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x39, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, // 0 = _490;. re - 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, // turn out;.}....0 - 0x00, // . + 0x77, 0x2c, 0x20, 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x5d, 0x29, 0x20, // w, 4.0, 0.5))]) + 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, // * in.v_color0.w) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, // ;. break; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, // . } while(fal + 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, // se);. out.bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, // x_FragData0 = _4 + 0x39, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, // 93;. return o + 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // ut;.}....0. }; extern const uint8_t* fs_font_distance_field_drop_shadow_pssl; extern const uint32_t fs_font_distance_field_drop_shadow_pssl_size; diff --git a/bgfx/examples/common/font/fs_font_distance_field_drop_shadow_image.bin.h b/bgfx/examples/common/font/fs_font_distance_field_drop_shadow_image.bin.h index 2caf6ec9..9590ae80 100644 --- a/bgfx/examples/common/font/fs_font_distance_field_drop_shadow_image.bin.h +++ b/bgfx/examples/common/font/fs_font_distance_field_drop_shadow_image.bin.h @@ -304,197 +304,191 @@ static const uint8_t fs_font_distance_field_drop_shadow_image_essl[2460] = 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_19;.}... }; -static const uint8_t fs_font_distance_field_drop_shadow_image_spv[3710] = +static const uint8_t fs_font_distance_field_drop_shadow_image_spv[3638] = { 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH..gz........u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, // ..s_texColor0... - 0x00, 0x00, 0x00, 0x04, 0x1a, 0x00, 0x40, 0x0e, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ......@.....#... - 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x34, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ......4......... + 0x00, 0x00, 0x00, 0x04, 0x22, 0x00, 0xf8, 0x0d, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ....".......#... + 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x37, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ......7......... 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, // ..............GL 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // SL.std.450...... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0c, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x08, 0x01, // ......main...... - 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x14, 0x01, // ................ - 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, // ......*......... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, // ................ - 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. - 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ......-...s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, // olorSampler..... - 0x07, 0x00, 0x30, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ..0...s_texColor - 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x92, 0x00, // Texture......... - 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, // ..UniformBlock.. - 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ..............u_ - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x94, 0x00, // params.......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x08, 0x01, 0x00, 0x00, 0x67, 0x6c, // ..............gl - 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // _FragCoord...... + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0a, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, // ......main...... + 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x2a, 0x01, // ..............*. + 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2d, 0x00, // ..main........-. + 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, // ..s_texColorSamp + 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x30, 0x00, 0x00, 0x00, 0x73, 0x5f, // ler.......0...s_ + 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, // texColorTexture. + 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x92, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, // ..........Unifor + 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x92, 0x00, // mBlock.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, // ......u_params.. + 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ................ 0x05, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, // ......v_color0.. - 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ..........v_colo - 0x72, 0x31, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x11, 0x01, 0x00, 0x00, 0x76, 0x5f, // r1............v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0x14, 0x01, // texcoord0....... - 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, // ..v_texcoord1... - 0x05, 0x00, 0x17, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // ......v_texcoord - 0x32, 0x00, 0x05, 0x00, 0x06, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // 2.....*...bgfx_F - 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2d, 0x00, // ragData0..G...-. - 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2d, 0x00, // ..".......G...-. - 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, // ..!.......G...0. - 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, // ..".......G...0. - 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x92, 0x00, // ..!.......H..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ......#.......G. - 0x03, 0x00, 0x92, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x94, 0x00, // ..........G..... - 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x94, 0x00, // ..".......G..... - 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x08, 0x01, // ..!.......G..... - 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0b, 0x01, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0e, 0x01, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x11, 0x01, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x14, 0x01, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x17, 0x01, // ..........G..... - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2a, 0x01, // ..........G...*. - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..!............. - 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..,...........;. - 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, // ..,...-....... . - 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ../...........;. - 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, // ../...0......... - 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..3... .......+. - 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..3...4.......+. - 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, // ..3...8......... - 0x03, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..<.......+..... - 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, // ..O.......,..... - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, // ..R...O...O...O. - 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ......g... ..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+.......k..... - 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, // .@+.......m..... - 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x04, 0x00, // .?+...g...p..... - 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x70, 0x00, // ......q.......p. - 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x71, 0x00, // .. ...r.......q. - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x02, 0x00, // ..+...g...t..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x01, 0x00, // ..+...g...x..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x02, 0x00, // ..+...3...|..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+...g...}..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x03, 0x00, // ..+...3......... - 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x92, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x93, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x93, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x07, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x07, 0x01, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x07, 0x01, 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x07, 0x01, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x07, 0x01, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x07, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x29, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..)...........;. - 0x04, 0x00, 0x29, 0x01, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..)...*.......+. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x36, 0x00, // ......2.....5A6. - 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x72, 0x00, // ..........;...r. - 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x72, 0x00, // ..N.......;...r. - 0x00, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, // ..........=..... - 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, // ......-...=..... - 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..1...0...=..... - 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..........=..... - 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..........=..... - 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..........=..... - 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xe8, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x62, 0x01, // ..........}...b. - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x62, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ......b...O..... - 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, // ..e............. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0x14, 0x00, // ................ - 0x00, 0x00, 0xf5, 0x01, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x9a, 0x00, // ......e...R..... - 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0xf5, 0x01, 0x00, 0x00, 0xa8, 0x00, // ......g......... - 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0xf7, 0x00, // ......h...g..... - 0x03, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x68, 0x01, // ..............h. - 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x69, 0x01, // ..i...........i. - 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x18, 0x01, // ..O.......m..... - 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x31, 0x00, // ..V...<.......1. - 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xfe, 0x01, // ......W......... - 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ......m...Q..... - 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ..p............. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x6b, 0x00, // ......q...p...k. - 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x72, 0x01, 0x00, 0x00, 0x71, 0x01, // ..........r...q. - 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x73, 0x01, // ..m...n...3...s. - 0x00, 0x00, 0x72, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x75, 0x01, // ..r...Q.......u. - 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, // ..........A..... - 0x00, 0x00, 0x76, 0x01, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..v...N...8...>. - 0x03, 0x00, 0x76, 0x01, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..v...u...Q..... - 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, // ..x...........A. - 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x34, 0x00, // ......y...N...4. - 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x79, 0x01, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...y...x...Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7b, 0x01, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, // ......{......... - 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x4e, 0x01, // ..A.......|...N. - 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x7b, 0x01, // ..|...>...|...{. - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0xfe, 0x01, // ..Q.......~..... - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x7f, 0x01, // ......A......... - 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x7f, 0x01, // ..N.......>..... - 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x81, 0x01, // ..~...A......... - 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x73, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..N...s...=..... - 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... - 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x0b, 0x00, // ................ - 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x85, 0x01, // ..........B..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x86, 0x01, // ................ - 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x95, 0x00, 0x00, 0x00, 0x89, 0x01, // ..2...A......... - 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......8...x...=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x85, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x8a, 0x01, // ................ - 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x95, 0x00, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x94, 0x00, // ..A............. - 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..8...t...=..... - 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x8e, 0x01, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x83, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x8e, 0x01, // ..........m..... - 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x92, 0x01, 0x00, 0x00, 0x6d, 0x00, // ..............m. - 0x00, 0x00, 0x8e, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x94, 0x01, // ................ - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x92, 0x01, // ......1......... - 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x99, 0x01, // ......Q......... - 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x99, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x0c, 0x01, // ..Q............. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9d, 0x01, // ......Q......... - 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, // ..........P..... - 0x00, 0x00, 0x9e, 0x01, 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x9d, 0x01, // ................ - 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xe8, 0x01, 0x00, 0x00, 0xf8, 0x00, // ................ - 0x02, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa2, 0x01, // ......O......... - 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0x03, 0x02, // ................ - 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x04, 0x00, 0x13, 0x00, // ......R......... - 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xb5, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xa4, 0x01, 0x00, 0x00, 0xa5, 0x01, // ................ - 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xa5, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..............O. - 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x15, 0x01, // ................ + 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x11, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ..........v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0x14, 0x01, 0x00, 0x00, 0x76, 0x5f, // oord0.........v_ + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, 0x05, 0x00, 0x17, 0x01, // texcoord1....... + 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x00, 0x05, 0x00, // ..v_texcoord2... + 0x06, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, // ..*...bgfx_FragD + 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x22, 0x00, // ata0..G...-...". + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...-...!. + 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x22, 0x00, // ......G...0...". + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...0...!. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, // ......H......... + 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x92, 0x00, // ..#.......G..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x22, 0x00, // ......G.......". + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G.......!. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x11, 0x01, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x14, 0x01, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x17, 0x01, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x1e, 0x00, // ......G...*..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, // ..............!. + 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, // ................ + 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, // .......... ..... + 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x14, 0x00, // ................ + 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1a, 0x00, // .......... ..... + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2c, 0x00, // .......... ...,. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2c, 0x00, // ..........;...,. + 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2f, 0x00, // ..-....... .../. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2f, 0x00, // ..........;.../. + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x33, 0x00, // ..0...........3. + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, // .. .......+...3. + 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x33, 0x00, // ..4.......+...3. + 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x3c, 0x00, // ..8...........<. + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4f, 0x00, // ......+.......O. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x52, 0x00, // ......,.......R. + 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x15, 0x00, // ..O...O...O..... + 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..g... .......+. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, // ......k......@+. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, // ......m......?+. + 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..g...p......... + 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x20, 0x00, // ..q.......p... . + 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..r.......q...+. + 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..g...t.......+. + 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..g...x.......+. + 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..3...|.......+. + 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..g...}.......+. + 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, // ..3............. + 0x03, 0x00, 0x92, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x93, 0x00, // .......... ..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x93, 0x00, // ..........;..... + 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x95, 0x00, // .......... ..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x07, 0x01, // .......... ..... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x07, 0x01, // ..........;..... + 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x07, 0x01, // ..........;..... + 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x07, 0x01, // ..........;..... + 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x07, 0x01, // ..........;..... + 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x29, 0x01, // .......... ...). + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x29, 0x01, // ..........;...). + 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..*.......+..... + 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..2.....5A+..... + 0x00, 0x00, 0x35, 0x02, 0x00, 0x00, 0xf3, 0x04, 0x35, 0xc1, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, // ..5.....5.6..... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, // ................ + 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x4e, 0x01, // ......;...r...N. + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x5c, 0x01, // ......;...r..... + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2e, 0x00, // ......=......... + 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x31, 0x00, // ..-...=.......1. + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c, 0x01, // ..0...=......... + 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x12, 0x01, // ......=......... + 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x15, 0x01, // ......=......... + 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x18, 0x01, // ......=......... + 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0xf8, 0x00, // ......}...b..... + 0x02, 0x00, 0x62, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x65, 0x01, // ..b...O.......e. + 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0xf5, 0x01, // ................ + 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x04, 0x00, 0x13, 0x00, // ..e...R......... + 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0xf5, 0x01, 0x00, 0x00, 0xa8, 0x00, 0x04, 0x00, 0x13, 0x00, // ..g............. + 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xa0, 0x01, // ..h...g......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x69, 0x01, // ..........h...i. + 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x69, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..........i...O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x18, 0x01, // ......m......... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, // ..............V. - 0x05, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2e, 0x00, // ..<.......1..... - 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x0a, 0x02, // ..W............. - 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xad, 0x01, // ......Q......... - 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xaf, 0x01, // ................ - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0x0c, 0x02, // ..Q............. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb2, 0x01, // ......Q......... - 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, // ..............P. - 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0xb2, 0x01, // ................ - 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xe8, 0x01, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... - 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x3c, 0x00, // ..........V...<. - 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x57, 0x00, // ......1.......W. - 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x15, 0x02, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0xb8, 0x01, // ................ - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, 0x12, 0x01, // ..Q............. - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbc, 0x01, // ................ - 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, // ......k......... - 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0x00, // ..........m...n. + 0x05, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2e, 0x00, // ..<.......1..... + 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfc, 0x01, // ..W............. + 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x70, 0x01, // ..m...Q.......p. + 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x72, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x70, 0x01, // ..r.......2...p. + 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x33, 0x00, // ..k...m...n...3. + 0x00, 0x00, 0x73, 0x01, 0x00, 0x00, 0x72, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..s...r...Q..... + 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, // ..u...........A. + 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x76, 0x01, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x38, 0x00, // ......v...N...8. + 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x76, 0x01, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...v...u...Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x01, 0x00, // ......x......... + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x4e, 0x01, // ..A.......y...N. + 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x79, 0x01, 0x00, 0x00, 0x78, 0x01, // ..4...>...y...x. + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7b, 0x01, 0x00, 0x00, 0xfe, 0x01, // ..Q.......{..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x7c, 0x01, // ......A.......|. + 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x7c, 0x01, // ..N...|...>...|. + 0x00, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7e, 0x01, // ..{...Q.......~. + 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, // ..........A..... + 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......N.......>. + 0x03, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, // ......~...A..... + 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x73, 0x01, 0x00, 0x00, 0x3d, 0x00, // ......N...s...=. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..............O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x18, 0x01, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, // ................ + 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x0c, 0x00, // ................ + 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, // ..............B. + 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x88, 0x01, // ................ + 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x95, 0x00, // ......2...A..... + 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x78, 0x00, // ..........8...x. + 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x89, 0x01, // ..=............. + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x88, 0x01, // ................ + 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x95, 0x00, 0x00, 0x00, 0x8c, 0x01, // ......A......... + 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......8...t...=. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x7f, 0x00, // ................ + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x0c, 0x00, // ......4......... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x00, // ..4.......m..... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x92, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x00, // ..........m..... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, // ..............1. + 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x92, 0x01, 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x99, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0x94, 0x01, // ................ + 0x00, 0x00, 0x99, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9b, 0x01, // ......Q......... + 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9d, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x02, 0x00, // ................ + 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x9e, 0x01, 0x00, 0x00, 0x9b, 0x01, // ..P............. + 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x9d, 0x01, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0xf9, 0x00, // ................ + 0x02, 0x00, 0xe8, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..............O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x12, 0x01, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb4, 0x00, // ................ + 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0x52, 0x00, // ..............R. + 0x00, 0x00, 0x9a, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x03, 0x02, // ................ + 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, // ................ + 0x04, 0x00, 0xa4, 0x01, 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0xf8, 0x00, // ................ + 0x02, 0x00, 0xa5, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa8, 0x01, // ......O......... + 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x0a, 0x02, // ......V...<..... + 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, // ..1.......W..... + 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x0c, 0x01, // ..Q............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb0, 0x01, // ................ + 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x0c, 0x02, // ..Q............. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb4, 0x01, // ......P......... + 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xb0, 0x01, // ................ + 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xe8, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb5, 0x01, // ................ + 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x12, 0x01, // ..O............. + 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ................ + 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x31, 0x00, // ..V...<.......1. + 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x15, 0x02, // ......W......... + 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, // ................ + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0x00, // ......k...m...n. 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x51, 0x00, // ..3...........Q. 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x15, 0x02, 0x00, 0x00, 0x02, 0x00, // ................ 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x5c, 0x01, // ..A............. @@ -519,265 +513,174 @@ static const uint8_t fs_font_distance_field_drop_shadow_image_spv[3710] = 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, 0x41, 0x00, // ..........2...A. 0x06, 0x00, 0x95, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x38, 0x00, // ..............8. 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd5, 0x01, // ..x...=......... - 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd6, 0x01, // ................ - 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x81, 0x00, // ......m......... - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0xd6, 0x01, // ..........m..... - 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0xcd, 0x01, // ..1............. - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x0c, 0x01, // ..Q............. - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe2, 0x01, // ................ - 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0x0c, 0x01, // ..Q............. - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xe6, 0x01, // ......P......... - 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0xe2, 0x01, // ................ - 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xe8, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xe8, 0x01, // ................ - 0x00, 0x00, 0xf5, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0x9e, 0x01, // ..........3..... - 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0xe6, 0x01, // ..i............. - 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x33, 0x02, // ......>...*...3. - 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ......8....... -}; -static const uint8_t fs_font_distance_field_drop_shadow_image_dx9[1447] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH..gz........s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, // ....u_params.... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x05, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, // ......l......... - 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x03, // ,.CTAB.......... - 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, 0x00, // ..............|. - 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, // ..D...........P. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, // ......`......... - 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..l.......s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // olor............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0xab, // ......u_params.. - 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, // ..ps_3_0.Microso - 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, // ft (R) HLSL Shad - 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, // er Compiler 10.1 - 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ..Q............. - 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, // ........@.Q..... - 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, // .....?.......@.. - 0x00, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xf3, 0x04, 0x35, 0x41, 0x00, 0x00, // .?Q.........5A.. - 0x00, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // .?......@@...... - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, // ................ - 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x02, 0x00, 0x07, 0x90, 0x1f, 0x00, // ................ - 0x00, 0x02, 0x05, 0x00, 0x02, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x03, 0x00, // ......X......... - 0xe4, 0x9c, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, // ........U....... - 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x29, 0x00, 0x04, 0x02, 0x00, 0x00, // ..........)..... - 0x00, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x02, 0x00, // ....U........... - 0x55, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x03, 0x00, // U.*............. - 0xff, 0x90, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xff, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ....U.X......... - 0xaa, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x02, 0x00, 0x00, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, // ....U.....X..... - 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x55, 0xa0, 0x00, 0x00, 0xff, 0x80, 0x02, 0x00, // ....U...U....... - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x02, 0x00, // ........U....... - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, // ............U... - 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, // ........U.....X. - 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x8c, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, // ................ - 0x55, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0x90, 0x00, 0x08, // U.B............. - 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0xc6, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x90, 0x5c, 0x00, // ..[............. - 0x00, 0x02, 0x02, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, // ................ - 0x07, 0x80, 0x01, 0x00, 0xe4, 0x8b, 0x02, 0x00, 0xe4, 0x8b, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x04, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, // ................ - 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, // U............... - 0xaa, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x03, 0x00, // ................ - 0x00, 0xa1, 0x03, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ....U........... - 0xaa, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x55, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // ........U....... - 0x06, 0x80, 0x00, 0x00, 0xff, 0x81, 0x00, 0x00, 0xe4, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x12, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ....U........... - 0x55, 0x80, 0x00, 0x00, 0x55, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, // U...U........... - 0x55, 0x80, 0x03, 0x00, 0xaa, 0xa0, 0x03, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // U............... - 0x02, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, // ........U....... - 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, // ....U........... - 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x2b, 0x00, 0x00, 0x00, 0x29, 0x00, 0x03, 0x02, 0x00, 0x00, // ......+...)..... - 0x00, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, // ....U.*...X..... - 0x07, 0x80, 0x01, 0x00, 0xe4, 0x9c, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x08, 0x00, // ............U... - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x29, 0x00, // ..............). - 0x04, 0x02, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, // ........U.B..... - 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, // ................ - 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, // ................ - 0xff, 0x80, 0x00, 0x00, 0xff, 0x90, 0x2a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ......*......... - 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xff, 0xa0, 0x13, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, // ..........X..... - 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x02, 0x00, 0x00, 0xa0, 0x58, 0x00, // ....U...U.....X. - 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x55, 0xa0, 0x00, 0x00, // ............U... - 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0x55, 0x81, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, // U............... - 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ................ - 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x02, 0x00, // ..X............. - 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, // ....U.B......... - 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, // ................ - 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x01, 0x00, // ......[......... - 0x90, 0x90, 0x5c, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x02, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0xe4, 0x8b, 0x01, 0x00, 0x90, 0x8b, 0x08, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x07, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, // ........U....... - 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, // ....U........... - 0x55, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // U...U........... - 0x55, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x03, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // U.......U....... - 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x55, 0xa0, 0x02, 0x00, // ....U.......U... - 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0xe4, 0x80, 0x06, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ........U....... - 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ....U........... - 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xaa, 0xa0, 0x03, 0x00, 0xff, 0xa0, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, // ........U....... - 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, // ................ - 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..........+...+. - 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, // ....... + 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x33, 0x02, // ..............3. + 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x35, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ......5......... + 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x33, 0x02, // ..........2...3. + 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ......m......... + 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xd3, 0x01, // ..........2..... + 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ......m......... + 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xd8, 0x01, // ..........1..... + 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ................ + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe2, 0x01, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xe1, 0x01, // ................ + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0x0c, 0x01, // ..Q............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe4, 0x01, // ......Q......... + 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, // ..............P. + 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0xe4, 0x01, // ................ + 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0xe2, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xe8, 0x01, // ................ + 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xe8, 0x01, 0x00, 0x00, 0xf5, 0x00, 0x09, 0x00, 0x0d, 0x00, // ................ + 0x00, 0x00, 0x36, 0x02, 0x00, 0x00, 0x9e, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0xb4, 0x01, // ..6.......i..... + 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x3e, 0x00, // ..............>. + 0x03, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x36, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..*...6.......8. + 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ...... }; -static const uint8_t fs_font_distance_field_drop_shadow_image_dx11[2255] = +static const uint8_t fs_font_distance_field_drop_shadow_image_dx11[2262] = { - 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x08, 0x75, // FSH..gz........u + 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH..gz........u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, // ..s_texColor0... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x08, 0x00, 0x00, 0x44, // r0.........|...D - 0x58, 0x42, 0x43, 0x74, 0x0a, 0xe2, 0x36, 0x59, 0xd0, 0x6e, 0xc1, 0x42, 0x64, 0xca, 0x1a, 0x50, // XBCt..6Y.n.Bd..P - 0x60, 0xaa, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x7c, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // `......|......., - 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0xb4, // ...........ISGN. - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x07, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO - 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX - 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // COORD..OSGN,.... - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S - 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x58, // V_TARGET...SHDRX - 0x07, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, // ...@.......Y...F - 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, // . .........Z.... - 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, // `......X0...p... - 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, // ...UU..b........ - 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, // ...b...........b - 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, // ...r.......b.... - 0x10, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, // .......e.... ... - 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, // ...h.......i.... - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x01, // ...........i.... - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0a, 0x72, // ...............r - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, // .......F........ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // @............... - 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ...<............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, // ...............< - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, // ...........*.... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x03, 0x0a, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......E........ - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, // ...F.......F~... - 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, // ....`......2.... - 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, // .......:........ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, // @.....@.@.....?. - 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...6....0 ...... - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, // ...*.......6.... - 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // 0 .............. - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // ...6....0 ...... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, // ...........6.... - 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, // 0 .........:.... - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...6............ - 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, // 0 .............. - 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x05, // ................ - 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......r.......F - 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ...V............ - 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, // ..............." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, // ................ - 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, // .......K...".... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, // ...........8..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, // . .........8..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...............* - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, // . .........2...B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ...........A.... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@....5A.@... - 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ..?2..."........ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, // ........@....5A. - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, // @.....?....2.... - 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......A.......F - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, // ...........".... - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, // ....@.....?...?. - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ..?...?........8 - 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ............... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, // ...........2..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, // @.......@....@@8 - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, // ...........8.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, // .......8.... ... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, // ...........:.... - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...6...r ......F - 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x18, // .......>........ - 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, // ...r.......F.... - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....@........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......<........ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...<...........* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, // ................ - 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, // ...........E.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, // .......F.......F - 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ~.......`......8 - 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, // .... ......:.... - 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, // ...:.......6...r - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, // ......F.......> - 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......E........ - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, // ...F.......F~... - 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, // ....`......2.... - 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // .......:........ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, // @.....@.@.....?. - 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ...6....0 ...... - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, // ...*.......6.... - 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // 0 .............. - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ...6....0 ...... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, // ...........6.... - 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, // 0 .........:.... - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...6............ - 0x30, 0x20, 0x04, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, // 0 .............. - 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......r.......F - 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ...V............ - 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, // ..............." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, // ................ - 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, // .......K...".... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, // ...........8..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, // . .........2...B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ...........A.... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@....5A.@... - 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ..?2..."........ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, // ........@....5A. - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, // @.....?....2.... - 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......A.......F - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, // ...........".... - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, // ....@.....?...?. - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ..?...?........8 - 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ............... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, // ...........2..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, // @.......@....@@8 - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, // ...........8.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, // .......8.... ... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, // ...........:.... - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...6...r ......F - 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // .......>....... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x08, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xf4, 0xd3, // ..........DXBC.. + 0x2e, 0xbd, 0x5e, 0x11, 0x02, 0xf0, 0x8d, 0x57, 0x5d, 0x24, 0x58, 0xa5, 0xfa, 0xe1, 0x01, 0x00, // ..^....W]$X..... + 0x00, 0x00, 0x98, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xe8, 0x00, // ..........,..... + 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0xb4, 0x00, 0x00, 0x00, 0x06, 0x00, // ......ISGN...... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xa4, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00, 0x00, 0xaa, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, // ......SV_POSITIO + 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, // N.COLOR.TEXCOORD + 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,......... + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. ............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR + 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x74, 0x07, 0x00, 0x00, 0x50, 0x00, // GET...SHEXt...P. + 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, // ......j...Y...F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, // .........Z....` + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, // ......X0...p.... + 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, // ..UU..b......... + 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x10, // ..b...........b. + 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, // ..r.......b..... + 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......e.... .... + 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, // ..h.......i..... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x01, 0x00, // ..........i..... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0a, 0x72, 0x00, // ..............r. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x40, // ......F........@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..<............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, // ..............<. + 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........*..... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x03, 0x0a, 0x00, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, // ......E.......CU + 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, // ..........F..... + 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..F~.......`.... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, // ..2...........:. + 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, // .......@.....@.@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, // .....?.......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, // ..........6....0 + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // .........*..... + 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..6....0 ....... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, // ..........6....0 + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ..6....0 ....... + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, // ..:.......6..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // .......0 ....... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......z......... + 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x05, 0x72, 0x00, // ..........|...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F......... + 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, // ..........V..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, // ......"......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, // ..............K. + 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..8..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ ....... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..8..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......*. ....... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..2...B......... + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, // ..A........@.... + 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, // 5A.@.....?2...". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // ....5A.@.....?.. + 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x80, 0x41, 0x00, // ..2...........A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // ......F......... + 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // .."........@.... + 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, // .?...?...?...?.. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8 ........ + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..2..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, // .......@.......@ + 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ....@@8......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..8............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // ..............8. + 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ... ............ + 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, // ..:.......6...r + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......F.......>. + 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........r..... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // ..F........@.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, // ..............<. + 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, // ..........<..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......*......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, // ..E.......CU.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x7e, // ......F.......F~ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // .......`......8. + 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, // ... ......:..... + 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, // ..:.......6...r + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......F.......>. + 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, // ......E.......CU + 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, // ..........F..... + 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..F~.......`.... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, // ..2...........:. + 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, // .......@.....@.@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, // .....?.......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, // ..........6....0 + 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // .........*..... + 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, // ..6....0 ....... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, // ..........6....0 + 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, // ..6....0 ....... + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, // ..:.......6..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, // .......0 ....... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......z......... + 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x05, 0x72, 0x00, // ..........|...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F......... + 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, // ..........V..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, // ......"......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, // ..............K. + 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..8..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ ....... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..2...B......... + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, // ..A........@.... + 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, // 5A.@.....?2...". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // ....5A.@.....?.. + 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x80, 0x41, 0x00, // ..2...........A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // ......F......... + 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // .."........@.... + 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, // .?...?...?...?.. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8 ........ + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..2..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, // .......@.......@ + 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ....@@8......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..8............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // ..............8. + 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ... ............ + 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, // ..:.......6...r + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......F.......>. + 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ...... }; -static const uint8_t fs_font_distance_field_drop_shadow_image_mtl[3077] = +static const uint8_t fs_font_distance_field_drop_shadow_image_mtl[3167] = { 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x11, 0x73, // FSH..gz........s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler @@ -785,7 +688,7 @@ static const uint8_t fs_font_distance_field_drop_shadow_image_mtl[3077] = 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, // .......u_params. 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..........s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x0b, // olor............ + 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x0b, // olor............ 0x00, 0x00, 0x23, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x20, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x20, // ..#pragma clang 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, // diagnostic ignor 0x65, 0x64, 0x20, 0x22, 0x2d, 0x57, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2d, 0x70, 0x72, // ed "-Wmissing-pr @@ -883,7 +786,7 @@ static const uint8_t fs_font_distance_field_drop_shadow_image_mtl[3077] = 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, // mpler(0)]]).{. 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, // xlatMtlMain_ou 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // t out = {};. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x35, 0x36, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float4 _563;. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x35, 0x36, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float4 _566;. 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // do. {. 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x21, 0x61, 0x6e, 0x79, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // if (!any(in.v_ 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x3d, // texcoord2.xyz == @@ -905,73 +808,78 @@ static const uint8_t fs_font_distance_field_drop_shadow_image_mtl[3077] = 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, // ;. _3 0x33, 0x34, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x31, 0x30, 0x2e, 0x77, 0x3b, 0x0a, // 34[3] = _510.w;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // floa - 0x74, 0x20, 0x5f, 0x33, 0x39, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, // t _398 = ((lengt - 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // h(fwidth(in.v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, // xcoord2.xyz)) * - 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, // 11.3137083053588 - 0x38, 0x37, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // 87) * _mtl_u.u_p - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // arams.y) * _mtl_ - 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, // u.u_params.z;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x35, 0x36, 0x33, 0x20, 0x3d, // _563 = - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // float4(in.v_col - 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, // or0.xyz, smooths - 0x74, 0x65, 0x70, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x5f, 0x33, 0x39, 0x38, 0x2c, 0x20, // tep(0.5 - _398, - 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x33, 0x39, 0x38, 0x2c, 0x20, 0x5f, 0x33, 0x33, 0x34, // 0.5 + _398, _334 - 0x5b, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // [int((in.v_texco - 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, // ord2.w * 4.0) + - 0x30, 0x2e, 0x35, 0x29, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, // 0.5)]) * in.v_co - 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lor0.w);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, // }. if - 0x20, 0x28, 0x61, 0x6e, 0x79, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // (any(in.v_texco - 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // ord0.xyz == floa - 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // t3(0.0))). - 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x35, 0x32, 0x34, 0x20, 0x3d, 0x20, 0x73, 0x5f, // float4 _524 = s_ - 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, // texColor.sample( - 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, // s_texColorSample - 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // r, in.v_texcoord - 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 1.xyz);. - 0x20, 0x20, 0x20, 0x20, 0x5f, 0x35, 0x36, 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // _563 = float - 0x34, 0x28, 0x5f, 0x35, 0x32, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x5f, 0x35, 0x32, 0x34, // 4(_524.xyz, _524 - 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // .w * in.v_color0 - 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .w);. - 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. - 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // }. float4 - 0x20, 0x5f, 0x35, 0x33, 0x33, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // _533 = s_texCol - 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // or.sample(s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, // olorSampler, in. - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, // v_texcoord0.xyz) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, // ;. spvUns - 0x61, 0x66, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, // afeArray _348;. - 0x20, 0x5f, 0x33, 0x34, 0x38, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x33, 0x33, 0x2e, // _348[0] = _533. - 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x34, 0x38, 0x5b, // z;. _348[ - 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x33, 0x33, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 1] = _533.y;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x34, 0x38, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, // _348[2] = _ - 0x35, 0x33, 0x33, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // 533.x;. _ - 0x33, 0x34, 0x38, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x33, 0x33, 0x2e, 0x77, 0x3b, // 348[3] = _533.w; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, // . float _ - 0x34, 0x37, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, // 470 = (length(fw - 0x69, 0x64, 0x74, 0x68, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // idth(in.v_texcoo - 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, // rd0.xyz)) * 11.3 - 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x37, 0x29, 0x20, // 13708305358887) - 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // * _mtl_u.u_param - 0x73, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x35, 0x36, // s.y;. _56 - 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // 3 = float4(in.v_ - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, // color0.xyz, smoo - 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x5f, 0x34, 0x37, // thstep(0.5 - _47 - 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x34, 0x37, 0x30, 0x2c, 0x20, 0x5f, // 0, 0.5 + _470, _ - 0x33, 0x34, 0x38, 0x5b, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // 348[int((in.v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, // xcoord0.w * 4.0) - 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, // + 0.5)]) * in.v - 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // _color0.w);. - 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, // break;. } - 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, // while(false);. - 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // out.bgfx_Frag - 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x36, 0x33, 0x3b, 0x0a, 0x20, 0x20, // Data0 = _563;. - 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, // return out;.}. - 0x0a, 0x00, 0x00, 0x30, 0x00, // ...0. + 0x74, 0x20, 0x5f, 0x33, 0x39, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, // t _395 = (length + 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, // (fwidth(in.v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x31, // coord2.xyz)) * 1 + 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, // 1.31370830535888 + 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // 671875) * _mtl_u + 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, // .u_params.y;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x35, 0x36, 0x36, 0x20, 0x3d, 0x20, // _566 = + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // float4(in.v_colo + 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, // r0.xyz, smoothst + 0x65, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x2d, 0x5f, 0x33, 0x39, 0x35, 0x2c, 0x20, 0x5f, 0x6d, // ep(fma(-_395, _m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x2c, // tl_u.u_params.z, + 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x33, 0x39, 0x35, 0x2c, // 0.5), fma(_395, + 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // _mtl_u.u_params + 0x2e, 0x7a, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x33, 0x33, 0x34, 0x5b, 0x69, // .z, 0.5), _334[i + 0x6e, 0x74, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // nt(fma(in.v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x77, 0x2c, 0x20, 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, // oord2.w, 4.0, 0. + 0x35, 0x29, 0x29, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // 5))]) * in.v_col + 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // or0.w);. + 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // }. if + 0x28, 0x61, 0x6e, 0x79, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // (any(in.v_texcoo + 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // rd0.xyz == float + 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 3(0.0))). + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // {. f + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x35, 0x32, 0x34, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, // loat4 _524 = s_t + 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, // exColor.sample(s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler + 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, // , in.v_texcoord1 + 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .xyz);. + 0x20, 0x20, 0x20, 0x5f, 0x35, 0x36, 0x36, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // _566 = float4 + 0x28, 0x5f, 0x35, 0x32, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x5f, 0x35, 0x32, 0x34, 0x2e, // (_524.xyz, _524. + 0x77, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // w * in.v_color0. + 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // w);. + 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // break;. } + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // . float4 + 0x5f, 0x35, 0x33, 0x33, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // _533 = s_texColo + 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // r.sample(s_texCo + 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, // lorSampler, in.v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, // _texcoord0.xyz); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, 0x61, // . spvUnsa + 0x66, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x34, // feArray _348;. + 0x5f, 0x33, 0x34, 0x38, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x33, 0x33, 0x2e, 0x7a, // _348[0] = _533.z + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x34, 0x38, 0x5b, 0x31, // ;. _348[1 + 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x33, 0x33, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ] = _533.y;. + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x34, 0x38, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x35, // _348[2] = _5 + 0x33, 0x33, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, // 33.x;. _3 + 0x34, 0x38, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x33, 0x33, 0x2e, 0x77, 0x3b, 0x0a, // 48[3] = _533.w;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x34, // float _4 + 0x36, 0x35, 0x20, 0x3d, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, // 65 = length(fwid + 0x74, 0x68, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // th(in.v_texcoord + 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0.xyz));. + 0x20, 0x5f, 0x35, 0x36, 0x36, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, // _566 = float4(i + 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, // n.v_color0.xyz, + 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, // smoothstep(fma(_ + 0x34, 0x36, 0x35, 0x20, 0x2a, 0x20, 0x28, 0x2d, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, // 465 * (-11.31370 + 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, // 830535888671875) + 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // , _mtl_u.u_param + 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, // s.y, 0.5), fma(_ + 0x34, 0x36, 0x35, 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, // 465 * 11.3137083 + 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x5f, // 0535888671875, _ + 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, // mtl_u.u_params.y + 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x33, 0x34, 0x38, 0x5b, 0x69, 0x6e, 0x74, // , 0.5), _348[int + 0x28, 0x66, 0x6d, 0x61, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // (fma(in.v_texcoo + 0x72, 0x64, 0x30, 0x2e, 0x77, 0x2c, 0x20, 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, // rd0.w, 4.0, 0.5) + 0x29, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // )]) * in.v_color + 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, // 0.w);. br + 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, // eak;. } while + 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, // (false);. out + 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, // .bgfx_FragData0 + 0x3d, 0x20, 0x5f, 0x35, 0x36, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // = _566;. retu + 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // rn out;.}....0. }; extern const uint8_t* fs_font_distance_field_drop_shadow_image_pssl; extern const uint32_t fs_font_distance_field_drop_shadow_image_pssl_size; diff --git a/bgfx/examples/common/font/fs_font_distance_field_outline.bin.h b/bgfx/examples/common/font/fs_font_distance_field_outline.bin.h index 7dea3e39..4023e3b6 100644 --- a/bgfx/examples/common/font/fs_font_distance_field_outline.bin.h +++ b/bgfx/examples/common/font/fs_font_distance_field_outline.bin.h @@ -181,335 +181,265 @@ static const uint8_t fs_font_distance_field_outline_essl[1456] = 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, // gl_FragColor = 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tmpvar_12;.}... }; -static const uint8_t fs_font_distance_field_outline_spv[2450] = +static const uint8_t fs_font_distance_field_outline_spv[2438] = { 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH....n.......u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, // ..s_texColor0... - 0x00, 0x00, 0x00, 0x04, 0x1a, 0x00, 0x54, 0x09, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ......T.....#... - 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x66, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ......f......... + 0x00, 0x00, 0x00, 0x04, 0x22, 0x00, 0x48, 0x09, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ....".H.....#... + 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ......j......... 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, // ..............GL 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // SL.std.450...... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, // ......main...... - 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc6, 0x00, // ................ - 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, // ................ - 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ......main...... - 0x07, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ..+...s_texColor - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2e, 0x00, // Sampler......... - 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, // ..s_texColorText - 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0x55, 0x6e, // ure...........Un - 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // iformBlock...... - 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ..........u_para - 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, // ms.............. - 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0xba, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // ..........gl_Fra - 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xbd, 0x00, // gCoord.......... + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, // ......main...... + 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x10, 0x00, // ................ + 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x73, 0x5f, // in........+...s_ + 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, // texColorSampler. + 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..........s_texC + 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, // olorTexture..... + 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, // ......UniformBlo + 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, // ck.............. + 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..u_params...... + 0x03, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xbd, 0x00, // ................ 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..v_color0...... 0x05, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x00, 0x00, // ......v_color1.. 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ..........v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x76, 0x5f, // oord0.........v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, 0x06, 0x00, 0xd7, 0x00, // texcoord1....... - 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, // ..bgfx_FragData0 - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...+..."..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, // ..G...+...!..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G......."..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, // ..G.......!..... - 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, // ..H...........#. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x85, 0x00, 0x00, 0x00, 0x02, 0x00, // ......G......... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x87, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G......."..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x87, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, // ..G.......!..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G............. - 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, // ..........!..... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, // ................ - 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, // ...... ......... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..*...........;. - 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, // ..*...+....... . - 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..-...........;. - 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, // ..-............. - 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..1... .......+. - 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..1...2.......+. - 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, // ..1...6......... - 0x03, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x5a, 0x00, // ..:...........Z. - 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x5a, 0x00, // .. .......+...Z. - 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..[.......+..... - 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..^......@+..... - 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x5a, 0x00, // ..`......?+...Z. - 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x64, 0x00, // ..c...........d. - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x65, 0x00, // ......c... ...e. - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x5a, 0x00, // ......d...+...Z. - 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x31, 0x00, // ..k.......+...1. - 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x31, 0x00, // ..o.......+...1. - 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x85, 0x00, // ..t............. - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x86, 0x00, 0x00, 0x00, 0x02, 0x00, // ...... ......... - 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x86, 0x00, 0x00, 0x00, 0x87, 0x00, // ......;......... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x88, 0x00, 0x00, 0x00, 0x02, 0x00, // ...... ......... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0x01, 0x00, // ...... ......... - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xba, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xbd, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xc0, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xc3, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xc6, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x03, 0x00, // ...... ......... - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xd7, 0x00, // ......;......... - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x65, 0x01, // ......+.......e. - 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, // ....5A6......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, // ................ - 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x65, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x07, 0x00, // ..;...e......... - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..=.......,...+. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x2e, 0x00, // ..=......./..... - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xbd, 0x00, // ..=............. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc0, 0x00, // ..=............. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc3, 0x00, // ..=............. - 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xc4, 0x00, // ..O............. - 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x2f, 0x00, // ..V...:...P.../. - 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x52, 0x01, // ..,...W.......R. - 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..P.......Q..... - 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x5e, 0x00, // ..............^. - 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x04, 0x01, // ................ - 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x06, 0x01, // ..`...n...1..... - 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x01, // ......Q......... - 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x19, 0x00, // ..R.......A..... - 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..........6...>. - 0x03, 0x00, 0x09, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, // ......R.......A. - 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. - 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...........Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x00, 0x00, // ..........R..... - 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0xf1, 0x00, // ..A............. - 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0e, 0x01, // ..o...>......... - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x52, 0x01, // ..Q...........R. - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x12, 0x01, // ......A......... - 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x12, 0x01, // ......t...>..... - 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x14, 0x01, // ......A......... - 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..........=..... - 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... - 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x0b, 0x00, // ................ - 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x18, 0x01, // ..........B..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x00, 0x19, 0x01, // ................ - 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x88, 0x00, 0x00, 0x00, 0x1c, 0x01, // ..e...A......... - 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......6...k...=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x85, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x00, 0x1d, 0x01, // ................ - 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x88, 0x00, 0x00, 0x00, 0x1f, 0x01, 0x00, 0x00, 0x87, 0x00, // ..A............. - 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..6...[...=..... - 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x1f, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // .. ............. - 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x83, 0x00, // .."... ......... - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x22, 0x01, // ......$...`...". - 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x27, 0x01, 0x00, 0x00, 0x24, 0x01, // ..........'...$. - 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2a, 0x01, // ..............*. - 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ..$............. - 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x27, 0x01, // ..,.......1...'. - 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, // ..*............. - 0x00, 0x00, 0x2e, 0x01, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x81, 0x00, // ......`......... - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1e, 0x01, // ......0...`..... - 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........2..... - 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2e, 0x01, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x15, 0x01, // ..1.......0..... - 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x32, 0x01, // ..P.......4...2. - 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..2...2...O..... - 0x00, 0x00, 0x36, 0x01, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, // ..6............. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... - 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, // ..8............. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, // ................ - 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x36, 0x01, // ..X...........6. - 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..8...4...Q..... - 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ..<............. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x3c, 0x01, // ......=...,...<. - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3e, 0x01, 0x00, 0x00, 0x58, 0x01, // ..Q.......>...X. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3f, 0x01, // ......Q.......?. - 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..X.......Q..... - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, // ..@...X.......P. - 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0x3e, 0x01, 0x00, 0x00, 0x3f, 0x01, // ......A...>...?. - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xd7, 0x00, // ..@...=...>..... - 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..A.......8..... - 0x10, 0x00, // .. + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x62, 0x67, // oord0.........bg + 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, // fx_FragData0..G. + 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..+...".......G. + 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, // ..+...!.......G. + 0x04, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ......".......G. + 0x04, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, // ......!.......H. + 0x05, 0x00, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........#..... + 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x85, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, // ..G...........G. + 0x04, 0x00, 0x87, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ......".......G. + 0x04, 0x00, 0x87, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, // ......!.......G. + 0x04, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. + 0x04, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. + 0x04, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. + 0x04, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, // ................ + 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... + 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, // ................ + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, // ................ + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x19, 0x00, // .......... ..... + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2a, 0x00, // .......... ...*. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2a, 0x00, // ..........;...*. + 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2d, 0x00, // ..+....... ...-. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2d, 0x00, // ..........;...-. + 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x31, 0x00, // ..............1. + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x31, 0x00, // .. .......+...1. + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x31, 0x00, // ..2.......+...1. + 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x3a, 0x00, // ..6...........:. + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x20, 0x00, // ..........Z... . + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5b, 0x00, // ......+...Z...[. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5e, 0x00, // ......+.......^. + 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x60, 0x00, // .....@+.......`. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x63, 0x00, // .....?+...Z...c. + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x07, 0x00, // ..........d..... + 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x65, 0x00, 0x00, 0x00, 0x07, 0x00, // ..c... ...e..... + 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x6b, 0x00, // ..d...+...Z...k. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x6f, 0x00, // ......+...1...o. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x74, 0x00, // ......+...1...t. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x85, 0x00, 0x00, 0x00, 0x0d, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x86, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, // .. ............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x86, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x00, // ..;............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x88, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;............. + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0xf3, 0x04, // ..+.......e..... + 0x35, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0xf3, 0x04, // 5A+.......i..... + 0x35, 0xc1, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // 5.6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. + 0x04, 0x00, 0x65, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..e...........=. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......,...+...=. + 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3d, 0x00, // ....../.......=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x4f, 0x00, // ..............O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc4, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, // ..............V. + 0x05, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x2c, 0x00, // ..:...P.../...,. + 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x50, 0x01, // ..W.......R...P. + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x01, // ......Q......... + 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x03, 0x01, // ..........2..... + 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x31, 0x00, // ..^...`...n...1. + 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, // ......R.......A. + 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x09, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...........Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........R..... + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0xf1, 0x00, // ..A............. + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x0b, 0x01, // ..2...>......... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x52, 0x01, // ..Q...........R. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x0f, 0x01, // ......A......... + 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x0f, 0x01, // ......o...>..... + 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x01, // ......Q......... + 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x19, 0x00, // ..R.......A..... + 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..........t...>. + 0x03, 0x00, 0x12, 0x01, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x19, 0x00, // ..........A..... + 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..............O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc4, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, // ................ + 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x0c, 0x00, // ................ + 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, // ..............B. + 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1b, 0x01, // ................ + 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x88, 0x00, // ......e...A..... + 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x6b, 0x00, // ..........6...k. + 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x1c, 0x01, // ..=............. + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x1b, 0x01, // ................ + 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x88, 0x00, 0x00, 0x00, 0x1f, 0x01, // ......A......... + 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......6...[...=. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x1f, 0x01, 0x00, 0x00, 0x7f, 0x00, // ...... ......... + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x0c, 0x00, // ......f... ..... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......$.......2. + 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x85, 0x00, // ..f.......`..... + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x69, 0x01, // ......g.......i. + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x27, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........'..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x24, 0x01, // ..2...g.......$. + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........*..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x24, 0x01, // ..2...........$. + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........,..... + 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x27, 0x01, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x15, 0x01, // ..1...'...*..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x19, 0x01, // ..........h..... + 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2e, 0x01, // ..i............. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x1d, 0x01, // ......2...h..... + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x30, 0x01, // ..`...........0. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x00, 0x1d, 0x01, // ......2......... + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x32, 0x01, // ..`...........2. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2e, 0x01, 0x00, 0x00, 0x30, 0x01, // ......1.......0. + 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x34, 0x01, // ......P.......4. + 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..2...2...2...O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x36, 0x01, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc1, 0x00, // ......6......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x4f, 0x00, // ..............O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xbe, 0x00, // ......8......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, // ................ + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, // ......X......... + 0x00, 0x00, 0x36, 0x01, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x51, 0x00, // ..6...8...4...Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x03, 0x00, // ......<......... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x2c, 0x01, // ..........=...,. + 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3e, 0x01, // ..<...Q.......>. + 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..X.......Q..... + 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, // ..?...X.......Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x02, 0x00, // ......@...X..... + 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0x3e, 0x01, // ..P.......A...>. + 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x3e, 0x00, // ..?...@...=...>. + 0x03, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ......A.......8. + 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ...... }; -static const uint8_t fs_font_distance_field_outline_dx9[1035] = +static const uint8_t fs_font_distance_field_outline_dx11[1578] = { - 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH....n.......s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, // ....u_params.... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, // ................ - 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x03, // ,.CTAB.......... - 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, 0x00, // ..............|. - 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, // ..D...........P. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, // ......`......... - 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..l.......s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // olor............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0xab, // ......u_params.. - 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, // ..ps_3_0.Microso - 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, // ft (R) HLSL Shad - 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, // er Compiler 10.1 - 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, // ..Q..........@.. - 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, // .?.......?Q..... - 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, // ................ - 0x40, 0xc0, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xf3, 0x04, 0x35, 0x41, 0x00, 0x00, // @.Q.........5A.. - 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ....@@...?...... - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, // ................ - 0x07, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x01, 0x80, 0x02, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x55, 0xa0, 0x13, 0x00, // ............U... - 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, // ..........X..... - 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x01, 0x00, 0xaa, 0xa0, 0x01, 0x00, 0xff, 0xa0, 0x02, 0x00, // ....U........... - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, // ............U.X. - 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xaa, 0xa0, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, // U............... - 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x01, 0x00, // ..X............. - 0xff, 0xa0, 0x01, 0x00, 0xaa, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x02, 0x00, // ......B......... - 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, // ................ - 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x02, 0x00, // ......[......... - 0x90, 0x90, 0x5c, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x90, 0x02, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0xe4, 0x8b, 0x01, 0x00, 0x90, 0x8b, 0x08, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x07, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, // ........U....... - 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, // ....U........... - 0x55, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // U...U........... - 0x55, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x03, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // U............... - 0x08, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, // ................ - 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, 0xff, 0xa0, 0x02, 0x00, // ....U........... - 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x01, 0x00, 0x00, 0x80, 0x06, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x14, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x08, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x03, 0x00, 0xaa, 0xa0, 0x05, 0x00, // ........U....... - 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, // ................ - 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, // ................ - 0x07, 0x80, 0x01, 0x00, 0xe4, 0x81, 0x00, 0x00, 0xe4, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, // ................ - 0x07, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x01, 0x00, // ........U....... - 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ........U....... - 0x04, 0x80, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0x81, 0x01, 0x00, 0x55, 0x80, 0x04, 0x00, // ............U... - 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x00, 0x00, // ........U....... - 0xaa, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, // ............U... - 0x00, 0xa1, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x00, 0x00, // ................ - 0x55, 0x81, 0x00, 0x00, 0xf4, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, // U............... - 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // ............U... - 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, // ................ - 0x55, 0xa0, 0x03, 0x00, 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // U............... - 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................ - 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, // ....U........... - 0x00, 0x80, 0x00, 0x00, 0xff, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ........... -}; -static const uint8_t fs_font_distance_field_outline_dx11[1587] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x08, 0x75, // FSH....n.......u + 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH....n.......u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, // ..s_texColor0... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x05, 0x00, 0x00, 0x44, // r0.............D - 0x58, 0x42, 0x43, 0xa0, 0xf0, 0xc3, 0x4f, 0xe4, 0x9e, 0xf2, 0x71, 0x7b, 0x3c, 0x33, 0x92, 0xfa, // XBC...O...q{<3.. - 0xd0, 0x23, 0x87, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // .#............., - 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x9c, // ...........ISGN. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x07, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, // ...SV_POSITION.C - 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, // OLOR.TEXCOORD..O - 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, // SGN,........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, // .......SV_TARGET - 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xd4, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x35, // ...SHDR....@...5 - 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...Y...F. ...... - 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, // ...Z....`......X - 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, // 0...p......UU..b - 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, // ...........b...r - 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, // .......b........ - 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, // ...e.... ......h - 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, // .......i........ - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......E........ - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, // ...F.......F~... - 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, // ....`......6.... - 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, // 0 .........*.... - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...6....0 ...... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, // ...........6.... - 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // 0 .............. - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...6....0 ...... - 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, // ...:.......2.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // .......:........ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, // @.....@.@.....?. - 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...6............ - 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, // 0 .............. - 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......r.......F - 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ...V............ - 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, // ..............." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, // ................ - 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, // .......K...".... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, // ...........8..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, // . .........8...B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x32, 0x00, 0x00, 0x0b, 0x42, 0x00, 0x10, 0x00, 0x00, // @....5A2...B.... - 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...:. .A........ - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, // ...*........@... - 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ..?2............ - 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, // ...A........@... - 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x42, // .5A*.......2...B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // @....5A*........ - 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, // ...B.......:...A - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......*........ - 0x00, 0x00, 0x08, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, // ...........:...A - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, // ................ - 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ...B........@... - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x2a, // ..?...?...?...?* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, // .......8 ..B.... - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, // ...*.......:.... - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...2...........* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, // ........@....... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, // @....@@8...B.... - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, // ...*.......*.... - 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...8...B.......* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // .......:.......8 - 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, // .... ......*.... - 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x42, // ...:.......2...B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, // @....5A.@.....?2 - 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, // ..."...........A - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, // ........@....5A. - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x52, 0x00, 0x10, 0x00, 0x00, // @.....?....R.... - 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ...V...A........ - 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, // ...........".... - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, // ....@.....?...?. - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ..?...?*.......8 - 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ............... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, // ...........2..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, // @.......@....@@8 - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, // ...........8.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x80, 0x41, // ...............A - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x72, 0x20, 0x10, 0x00, 0x00, // .......2...r ... - 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, // ...F.......>.... - 0x00, 0x10, 0x00, // ... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x05, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xfa, 0x76, // ..........DXBC.v + 0x35, 0x2e, 0x2b, 0xab, 0x47, 0xb9, 0x6e, 0xe3, 0x3f, 0x47, 0xf9, 0x59, 0x42, 0x78, 0x01, 0x00, // 5.+.G.n.?G.YBx.. + 0x00, 0x00, 0xec, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xd0, 0x00, // ..........,..... + 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x9c, 0x00, 0x00, 0x00, 0x05, 0x00, // ......ISGN...... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x8c, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00, 0x00, 0x92, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, // ..............SV + 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, // _POSITION.COLOR. + 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, // TEXCOORD..OSGN,. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................ + 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, // ..SV_TARGET...SH + 0x45, 0x58, 0xe0, 0x04, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x6a, 0x08, // EX....P...8...j. + 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..Y...F. ....... + 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, // ..Z....`......X0 + 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, // ...p......UU..b. + 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, // ..........b...r. + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, // ......b......... + 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e.... ......h. + 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, // ......i......... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, // ......E.......CU + 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, // ..........F..... + 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..F~.......`.... + 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..6....0 ....... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, // ..*.......6....0 + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, // ..6....0 ....... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, // ..........6....0 + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, // .........:..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, // ..2...........:. + 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, // .......@.....@.@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?.......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, // ..........6..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // .......0 ....... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......z......... + 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x05, 0x72, 0x00, // ..........|...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F......... + 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, // ..........V..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, // ......"......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, // ..............K. + 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..8..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ ....... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..8...B......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x32, 0x00, // .......@....5A2. + 0x00, 0x0b, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x80, 0x41, 0x00, // ..B.......:. .A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........*..... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, // ...@.....?2..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........A..... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ...@....5A*..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..2...B......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, 0x00, // .......@....5A*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........B..... + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ..:...A.......*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..:...A......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........B..... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // ...@.....?...?.. + 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, // .?...?*.......8 + 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..B.......*..... + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x82, 0x00, // ..:.......2..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......*........@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, // .......@....@@8. + 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..B.......*..... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, // ..*.......8...B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ......*.......:. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, // ......8.... .... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, // ..*.......:..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..2...B......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, // .......@....5A.@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?2..."..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......A........@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // ....5A.@.....?.. + 0x00, 0x08, 0x52, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x80, 0x41, 0x00, // ..R.......V...A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // ................ + 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // .."........@.... + 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x2a, 0x00, // .?...?...?...?*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8 ........ + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..2..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, // .......@.......@ + 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ....@@8......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..8............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x06, 0x19, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, // ......A.......2. + 0x00, 0x09, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, // ..r ............ + 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, // ..........F..... + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ..>....... }; -static const uint8_t fs_font_distance_field_outline_mtl[2232] = +static const uint8_t fs_font_distance_field_outline_mtl[2411] = { 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x11, 0x73, // FSH....n.......s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler @@ -517,7 +447,7 @@ static const uint8_t fs_font_distance_field_outline_mtl[2232] = 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, // .......u_params. 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..........s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x08, // olor..........B. + 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x08, // olor............ 0x00, 0x00, 0x23, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x20, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x20, // ..#pragma clang 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, // diagnostic ignor 0x65, 0x64, 0x20, 0x22, 0x2d, 0x57, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2d, 0x70, 0x72, // ed "-Wmissing-pr @@ -618,39 +548,50 @@ static const uint8_t fs_font_distance_field_outline_mtl[2232] = 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, // ampler, in.v_tex 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // coord0.xyz);. 0x20, 0x69, 0x6e, 0x74, 0x20, 0x5f, 0x32, 0x36, 0x32, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, // int _262 = int( - 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // (in.v_texcoord0. - 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x3b, // w * 4.0) + 0.5); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x41, 0x72, // . spvUnsafeAr - 0x72, 0x61, 0x79, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x34, 0x3e, 0x20, 0x5f, 0x32, // ray _2 - 0x34, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x5b, 0x30, 0x5d, 0x20, // 41;. _241[0] - 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x38, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, // = _338.z;. _2 - 0x34, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x38, 0x2e, 0x79, 0x3b, 0x0a, // 41[1] = _338.y;. - 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x33, // _241[2] = _3 - 0x33, 0x38, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x5b, 0x33, // 38.x;. _241[3 - 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x38, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ] = _338.w;. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x38, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x6c, 0x65, // float _286 = (le + 0x66, 0x6d, 0x61, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // fma(in.v_texcoor + 0x64, 0x30, 0x2e, 0x77, 0x2c, 0x20, 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, // d0.w, 4.0, 0.5)) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x41, // ;. spvUnsafeA + 0x72, 0x72, 0x61, 0x79, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x34, 0x3e, 0x20, 0x5f, // rray _ + 0x32, 0x34, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x5b, 0x30, 0x5d, // 241;. _241[0] + 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x38, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, // = _338.z;. _ + 0x32, 0x34, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x38, 0x2e, 0x79, 0x3b, // 241[1] = _338.y; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, // . _241[2] = _ + 0x33, 0x33, 0x38, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x5b, // 338.x;. _241[ + 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x38, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 3] = _338.w;. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x38, 0x31, 0x20, 0x3d, 0x20, 0x6c, 0x65, // float _281 = le 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, 0x28, 0x69, 0x6e, 0x2e, 0x76, // ngth(fwidth(in.v 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, // _texcoord0.xyz)) - 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, // * 11.3137083053 - 0x35, 0x38, 0x38, 0x38, 0x37, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // 58887) * _mtl_u. - 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // u_params.y;. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x39, 0x32, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x35, // float _292 = 0.5 - 0x20, 0x2d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // - (_mtl_u.u_par - 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x5f, 0x32, 0x38, 0x36, 0x29, 0x3b, 0x0a, 0x20, // ams.w * _286);. - 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // out.bgfx_Frag - 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x6d, // Data0 = float4(m - 0x69, 0x78, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x2e, 0x78, // ix(in.v_color1.x - 0x79, 0x7a, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // yz, in.v_color0. - 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x73, 0x6d, 0x6f, 0x6f, // xyz, float3(smoo - 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x5f, 0x32, 0x38, // thstep(0.5 - _28 - 0x36, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x38, 0x36, 0x2c, 0x20, 0x5f, // 6, 0.5 + _286, _ - 0x32, 0x34, 0x31, 0x5b, 0x5f, 0x32, 0x36, 0x32, 0x5d, 0x29, 0x29, 0x29, 0x2c, 0x20, 0x73, 0x6d, // 241[_262]))), sm - 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x5f, 0x32, 0x39, 0x32, 0x20, 0x2d, 0x20, // oothstep(_292 - - 0x5f, 0x32, 0x38, 0x36, 0x2c, 0x20, 0x5f, 0x32, 0x39, 0x32, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x38, // _286, _292 + _28 - 0x36, 0x2c, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x5b, 0x5f, 0x32, 0x36, 0x32, 0x5d, 0x29, 0x20, 0x2a, // 6, _241[_262]) * - 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, // in.v_color0.w); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, // . return out; - 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // .}....0. + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x38, 0x33, // ;. float _283 + 0x20, 0x3d, 0x20, 0x5f, 0x32, 0x38, 0x31, 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, // = _281 * 11.313 + 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, // 7083053588867187 + 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x39, // 5;. float _29 + 0x32, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x2d, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // 2 = fma(-_mtl_u. + 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x2c, 0x20, 0x5f, 0x32, 0x38, 0x33, // u_params.w, _283 + 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // * _mtl_u.u_para + 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ms.y, 0.5);. + 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, // out.bgfx_FragDat + 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x6d, 0x69, 0x78, 0x28, // a0 = float4(mix( + 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x2c, // in.v_color1.xyz, + 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, // in.v_color0.xyz + 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, // , float3(smooths + 0x74, 0x65, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x38, 0x31, 0x20, 0x2a, 0x20, 0x28, // tep(fma(_281 * ( + 0x2d, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, // -11.313708305358 + 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // 88671875), _mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, // u.u_params.y, 0. + 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x38, 0x33, 0x2c, 0x20, 0x5f, 0x6d, // 5), fma(_283, _m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, // tl_u.u_params.y, + 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x5b, 0x5f, 0x32, 0x36, 0x32, // 0.5), _241[_262 + 0x5d, 0x29, 0x29, 0x29, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, // ]))), smoothstep + 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x38, 0x31, 0x20, 0x2a, 0x20, 0x28, 0x2d, 0x31, 0x31, // (fma(_281 * (-11 + 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x36, // .313708305358886 + 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // 71875), _mtl_u.u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x32, 0x39, 0x32, 0x29, // _params.y, _292) + 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x38, 0x33, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // , fma(_283, _mtl + 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x5f, // _u.u_params.y, _ + 0x32, 0x39, 0x32, 0x29, 0x2c, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x5b, 0x5f, 0x32, 0x36, 0x32, 0x5d, // 292), _241[_262] + 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // ) * in.v_color0. + 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, // w);. return o + 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // ut;.}....0. }; extern const uint8_t* fs_font_distance_field_outline_pssl; extern const uint32_t fs_font_distance_field_outline_pssl_size; diff --git a/bgfx/examples/common/font/fs_font_distance_field_outline_drop_shadow_image.bin.h b/bgfx/examples/common/font/fs_font_distance_field_outline_drop_shadow_image.bin.h index 4908ded5..44a3977c 100644 --- a/bgfx/examples/common/font/fs_font_distance_field_outline_drop_shadow_image.bin.h +++ b/bgfx/examples/common/font/fs_font_distance_field_outline_drop_shadow_image.bin.h @@ -383,205 +383,203 @@ static const uint8_t fs_font_distance_field_outline_drop_shadow_image_essl[3112] 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // gColor = tmpvar_ 0x32, 0x36, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 26;.}... }; -static const uint8_t fs_font_distance_field_outline_drop_shadow_image_spv[4110] = +static const uint8_t fs_font_distance_field_outline_drop_shadow_image_spv[4174] = { 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH..gz........u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, // ..s_texColor0... - 0x00, 0x00, 0x00, 0x04, 0x1a, 0x00, 0xd0, 0x0f, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ............#... - 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x91, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ + 0x00, 0x00, 0x00, 0x04, 0x22, 0x00, 0x10, 0x10, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ....".......#... + 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x97, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, // ..............GL 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // SL.std.450...... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0c, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x39, 0x01, // ......main....9. - 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x42, 0x01, 0x00, 0x00, 0x45, 0x01, // ..<...?...B...E. - 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, // ..H...[......... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, // ................ - 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. - 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x33, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ......3...s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, // olorSampler..... - 0x07, 0x00, 0x36, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ..6...s_texColor - 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0xba, 0x00, // Texture......... - 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, // ..UniformBlock.. - 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ..............u_ - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0xbc, 0x00, // params.......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x39, 0x01, 0x00, 0x00, 0x67, 0x6c, // ..........9...gl - 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // _FragCoord...... - 0x05, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, // ..<...v_color0.. - 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ......?...v_colo - 0x72, 0x31, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x42, 0x01, 0x00, 0x00, 0x76, 0x5f, // r1........B...v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0x45, 0x01, // texcoord0.....E. - 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, // ..v_texcoord1... - 0x05, 0x00, 0x48, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // ..H...v_texcoord - 0x32, 0x00, 0x05, 0x00, 0x06, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // 2.....[...bgfx_F - 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x33, 0x00, // ragData0..G...3. - 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x33, 0x00, // ..".......G...3. - 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x36, 0x00, // ..!.......G...6. - 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x36, 0x00, // ..".......G...6. - 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0xba, 0x00, // ..!.......H..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ......#.......G. - 0x03, 0x00, 0xba, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbc, 0x00, // ..........G..... - 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbc, 0x00, // ..".......G..... - 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x39, 0x01, // ..!.......G...9. - 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3c, 0x01, // ..........G...<. - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x01, // ..........G...?. - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x42, 0x01, // ..........G...B. - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x45, 0x01, // ..........G...E. - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x48, 0x01, // ..........G...H. - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5b, 0x01, // ..........G...[. - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..!............. - 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .. ........... . - 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..2...........;. - 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, // ..2...3....... . - 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..5...........;. - 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, // ..5...6......... - 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..9... .......+. - 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..9...:.......+. - 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, // ..9...>......... - 0x03, 0x00, 0x42, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..B.......+..... - 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, // ..[.......,..... - 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, // ..^...[...[...[. - 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ......q... ..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x03, 0x00, // ..+...q...r..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+............. - 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, // .@+............. - 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x04, 0x00, // .?+...q......... - 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x99, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x98, 0x00, // ................ - 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x99, 0x00, // .. ............. - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x02, 0x00, // ..+...q......... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x01, 0x00, // ..+...q......... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x02, 0x00, // ..+...9......... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+...q......... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x03, 0x00, // ..+...9......... - 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0xba, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..8...........;. - 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x39, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..8...9.......;. - 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..8...<.......;. - 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..8...?.......;. - 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x42, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..8...B.......;. - 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..8...E.......;. - 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..8...H....... . - 0x04, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..Z...........;. - 0x04, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..Z...[.......+. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x36, 0x00, // ............5A6. - 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x9a, 0x00, // ..........;..... - 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x9a, 0x00, // ..........;..... - 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, // ..........=..... - 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, // ..4...3...=..... - 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..7...6...=..... - 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..=...<...=..... - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..@...?...=..... - 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x42, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..C...B...=..... - 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..F...E...=..... - 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x3f, 0x02, // ..I...H.......?. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x9c, 0x01, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... - 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x00, 0x00, // ......F...F..... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0x14, 0x00, // ................ - 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x9a, 0x00, // ..L.......^..... - 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0xa8, 0x00, // ..........L..... - 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0xf7, 0x00, // ................ - 0x03, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xa2, 0x01, // ................ - 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xa3, 0x01, // ................ - 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa6, 0x01, 0x00, 0x00, 0x46, 0x01, // ..O...........F. - 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ..F............. - 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x42, 0x00, 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0x37, 0x00, // ..V...B...S...7. - 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x55, 0x02, // ..4...W.......U. - 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0xa6, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..S.......Q..... - 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, // ......U.......Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x03, 0x00, // ..........=..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0xab, 0x01, // ................ - 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaf, 0x01, // ......Q......... - 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..U.......Q..... - 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, // ......U.......Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x02, 0x00, // ..........U..... - 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0xaf, 0x01, // ..P............. - 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0xf9, 0x00, // ................ - 0x02, 0x00, 0x3f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..?...........O. - 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x49, 0x01, // ..........I...I. + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x01, // ......main....<. + 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x42, 0x01, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x48, 0x01, // ..?...B...E...H. + 0x00, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, // ..[............. + 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, // ................ + 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ......main...... + 0x07, 0x00, 0x33, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ..3...s_texColor + 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x36, 0x00, // Sampler.......6. + 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, // ..s_texColorText + 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0xba, 0x00, 0x00, 0x00, 0x55, 0x6e, // ure...........Un + 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // iformBlock...... + 0x06, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ..........u_para + 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, // ms.............. + 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ......<...v_colo + 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x76, 0x5f, // r0........?...v_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x42, 0x01, // color1........B. + 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, // ..v_texcoord0... + 0x05, 0x00, 0x45, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // ..E...v_texcoord + 0x31, 0x00, 0x05, 0x00, 0x05, 0x00, 0x48, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // 1.....H...v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x00, 0x05, 0x00, 0x06, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x62, 0x67, // oord2.....[...bg + 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, // fx_FragData0..G. + 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..3...".......G. + 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, // ..3...!.......G. + 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..6...".......G. + 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, // ..6...!.......H. + 0x05, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........#..... + 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0xba, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, // ..G...........G. + 0x04, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ......".......G. + 0x04, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, // ......!.......G. + 0x04, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..<...........G. + 0x04, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, // ..?...........G. + 0x04, 0x00, 0x42, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, // ..B...........G. + 0x04, 0x00, 0x45, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, // ..E...........G. + 0x04, 0x00, 0x48, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, // ..H...........G. + 0x04, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, // ..[............. + 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... + 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, // ................ + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, // ................ + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x13, 0x00, // ................ + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ... ......... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // .. ...2......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;...2...3..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // .. ...5......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;...5...6..... + 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, // ......9... ..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x01, 0x00, // ..+...9...:..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+...9...>..... + 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x42, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, // ......B.......+. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, // ......[.......,. + 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, // ......^...[...[. + 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x20, 0x00, // ..[.......q... . + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x72, 0x00, // ......+...q...r. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x93, 0x00, // ......+......... + 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x95, 0x00, // .....@+......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x98, 0x00, // .....?+...q..... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x99, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x07, 0x00, // ...... ......... + 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0x9c, 0x00, // ......+...q..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0xa0, 0x00, // ......+...q..... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0xa4, 0x00, // ......+...9..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, 0x00, 0xa5, 0x00, // ......+...q..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0xa9, 0x00, // ......+...9..... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0xba, 0x00, 0x00, 0x00, 0x0d, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xba, 0x00, // .. ............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x02, 0x00, // ..;............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ............. + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ...8......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x01, 0x00, // ..;...8...<..... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x01, 0x00, // ..;...8...?..... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x42, 0x01, 0x00, 0x00, 0x01, 0x00, // ..;...8...B..... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x01, 0x00, // ..;...8...E..... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0x01, 0x00, // ..;...8...H..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ...Z......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x03, 0x00, // ..;...Z...[..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0xf3, 0x04, // ..+............. + 0x35, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x95, 0x02, 0x00, 0x00, 0xf3, 0x04, // 5A+............. + 0x35, 0xc1, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // 5.6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. + 0x04, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. + 0x04, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......4...3...=. + 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......7...6...=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x3d, 0x00, // ......=...<...=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0x3d, 0x00, // ......@...?...=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x42, 0x01, 0x00, 0x00, 0x3d, 0x00, // ......C...B...=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x3d, 0x00, // ......F...E...=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0xf7, 0x00, // ......I...H..... + 0x03, 0x00, 0x3f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xa5, 0x00, // ..?............. + 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..............O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x46, 0x01, // ..........F...F. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb4, 0x00, // ................ - 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x5e, 0x00, // ......Z.......^. - 0x00, 0x00, 0x9a, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0x5a, 0x02, // ..............Z. - 0x00, 0x00, 0xa8, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0xb7, 0x01, // ................ - 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, // ................ - 0x04, 0x00, 0xb8, 0x01, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0xf8, 0x00, // ................ - 0x02, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xbd, 0x01, // ......O......... - 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..I...I......... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x42, 0x00, 0x00, 0x00, 0x61, 0x02, // ......V...B...a. + 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0x5e, 0x00, // ......L.......^. + 0x00, 0x00, 0x9a, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0x4c, 0x02, // ..............L. + 0x00, 0x00, 0xa8, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0xa1, 0x01, // ................ + 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, // ................ + 0x04, 0x00, 0xa2, 0x01, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xf8, 0x00, // ................ + 0x02, 0x00, 0xa3, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa6, 0x01, // ......O......... + 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..F...F......... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x42, 0x00, 0x00, 0x00, 0x53, 0x02, // ......V...B...S. 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, // ..7...4...W..... - 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x51, 0x00, // ..c...a.......Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x03, 0x00, // ..........I..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0xc0, 0x01, // ................ - 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc2, 0x01, // ................ - 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x39, 0x00, // ..........n...9. - 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, // ......c.......A. - 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x3e, 0x00, // .. ...........>. - 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xc6, 0x01, 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...........Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x01, 0x00, // ..........c..... - 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x85, 0x01, // ..A... ......... - 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xc9, 0x01, 0x00, 0x00, 0xc8, 0x01, // ..:...>......... - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0x63, 0x02, // ..Q...........c. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0xcc, 0x01, // ......A... ..... - 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xcc, 0x01, // ..........>..... - 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, 0x01, // ......Q......... - 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, // ..c.......A... . - 0x00, 0x00, 0xcf, 0x01, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..............>. - 0x03, 0x00, 0xcf, 0x01, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, // ..........A... . - 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0x3d, 0x00, // ..............=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..............O. - 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x49, 0x01, // ..........I...I. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, // ................ - 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x0c, 0x00, // ................ - 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, // ..............B. - 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, 0x01, // ................ - 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xbd, 0x00, // ..........A..... - 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0xa0, 0x00, // ..........>..... - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0xd9, 0x01, // ..=............. - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xd8, 0x01, // ................ - 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xdc, 0x01, // ......A......... - 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......>...r...=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x85, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0xdb, 0x01, // ................ - 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x95, 0x00, // ................ - 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xe3, 0x01, // ......A......... - 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......>.......=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0x85, 0x00, // ................ - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xe4, 0x01, // ................ - 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0xe1, 0x01, // ................ - 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xeb, 0x01, // ................ - 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe8, 0x01, // ..........1..... - 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0xf2, 0x01, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ......=......... - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0xf2, 0x01, // ................ - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x3d, 0x01, // ..Q...........=. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf5, 0x01, // ......Q......... - 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..=.......Q..... - 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, // ......=.......P. - 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0xf5, 0x01, // ................ - 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x3f, 0x02, // ..............?. - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... - 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x00, 0x00, // ......C...C..... + 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0xa6, 0x01, 0x00, 0x00, 0x51, 0x00, // ..U...S.......Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x03, 0x00, // ..........U..... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x3d, 0x01, // ..Q...........=. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xae, 0x01, // ................ + 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, // ......U.......Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x01, 0x00, // ..........U..... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0x55, 0x02, // ..Q...........U. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb2, 0x01, // ......P......... + 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0xae, 0x01, // ................ + 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x3f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb3, 0x01, // ......?......... + 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x49, 0x01, // ..O...........I. + 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ..I............. + 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0xb5, 0x01, // ..........Z..... + 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0xb7, 0x01, // ..^............. + 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0xa8, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0xb8, 0x01, // ..Z............. + 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xb8, 0x01, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0xf9, 0x01, // ................ + 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... + 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x00, 0x00, // ......I...I..... 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x42, 0x00, // ..........V...B. - 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x57, 0x00, // ..j...7...4...W. - 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0xfc, 0x01, // ......l...j..... - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x43, 0x01, // ..Q...........C. - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x6e, 0x00, // ..............n. + 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x57, 0x00, // ..a...7...4...W. + 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0xbd, 0x01, // ......c...a..... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x49, 0x01, // ..Q...........I. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc2, 0x01, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x93, 0x00, // ......2......... + 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0xc3, 0x01, // ......n...9..... + 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc5, 0x01, // ......Q......... + 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, // ..c.......A... . + 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..........>...>. + 0x03, 0x00, 0xc6, 0x01, 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, // ......c.......A. + 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x3a, 0x00, // .. ...........:. + 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xc9, 0x01, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...........Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x00, 0x00, // ..........c..... + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0x85, 0x01, // ..A... ......... + 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xcc, 0x01, 0x00, 0x00, 0xcb, 0x01, // ......>......... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0x63, 0x02, // ..Q...........c. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0xcf, 0x01, // ......A... ..... + 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xcf, 0x01, // ..........>..... + 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0xd1, 0x01, // ......A... ..... + 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..........=..... + 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... + 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x00, 0x00, // ......I...I..... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x0b, 0x00, // ................ + 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0xd5, 0x01, // ..........B..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0xd6, 0x01, // ................ + 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xd9, 0x01, // ......A......... + 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......>.......=. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0x85, 0x00, // ................ + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0xda, 0x01, // ................ + 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xbc, 0x00, // ..A............. + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..>...r...=..... + 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x93, 0x02, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x93, 0x02, // ..........2..... + 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xbd, 0x00, // ..........A..... + 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x9c, 0x00, // ..........>..... + 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0xe3, 0x01, // ..=............. + 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x94, 0x02, 0x00, 0x00, 0xdb, 0x01, // ................ + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x94, 0x02, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0xe1, 0x01, // ..2............. + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0xe1, 0x01, // ..2............. + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0xd2, 0x01, // ..1............. + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf2, 0x01, 0x00, 0x00, 0x3d, 0x01, // ..Q...........=. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf3, 0x01, // ................ + 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0xf2, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, // ......=.......Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf5, 0x01, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........=..... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0x3d, 0x01, // ..Q...........=. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf7, 0x01, // ......P......... + 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0xf5, 0x01, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xf3, 0x01, // ................ + 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x3f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf9, 0x01, // ......?......... + 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x43, 0x01, // ..O...........C. + 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ..C............. + 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x42, 0x00, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x37, 0x00, // ..V...B...j...7. + 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x6c, 0x02, // ..4...W.......l. + 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..j.......Q..... + 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, // ......C......... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x6e, 0x00, // ..............n. 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x51, 0x00, // ..9...........Q. 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x02, 0x00, // ..........l..... 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0x05, 0x02, 0x00, 0x00, 0x90, 0x01, // ..A... ......... @@ -610,16 +608,22 @@ static const uint8_t fs_font_distance_field_outline_drop_shadow_image_spv[4110] 0x00, 0x00, 0x17, 0x02, 0x00, 0x00, 0x19, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xbd, 0x00, // ..........A..... 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x72, 0x00, // ..........>...r. 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x1b, 0x02, // ..=............. - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, 0x1c, 0x02, // ................ - 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x02, // .............. . - 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x81, 0x00, // ..#... ......... - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x1a, 0x02, // ......&... ..... - 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x01, 0x00, // ..........(..... - 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, 0x11, 0x02, // ..1...#...&..... - 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x95, 0x00, // ..........*..... - 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2c, 0x02, // ..............,. - 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0x1c, 0x02, // ................ + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x01, 0x00, // .......... ..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x95, 0x00, // ..2............. + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x15, 0x02, // ................ + 0x00, 0x00, 0x95, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x23, 0x02, // ..............#. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x19, 0x02, // ......2......... + 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x26, 0x02, // .. ...........&. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x17, 0x02, 0x00, 0x00, 0x19, 0x02, // ......2......... + 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, 0x02, // .. ...........(. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x26, 0x02, // ......1...#...&. + 0x00, 0x00, 0x11, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x92, 0x02, // ................ + 0x00, 0x00, 0x15, 0x02, 0x00, 0x00, 0x95, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x92, 0x02, // ..*.......2..... + 0x00, 0x00, 0x19, 0x02, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x17, 0x02, // ..,.......2..... + 0x00, 0x00, 0x19, 0x02, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ................ 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2a, 0x02, // ..........1...*. 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x11, 0x02, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, // ..,.......P..... 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x2e, 0x02, // ..0............. @@ -638,300 +642,187 @@ static const uint8_t fs_font_distance_field_outline_drop_shadow_image_spv[4110] 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3d, 0x02, // ......P.......=. 0x00, 0x00, 0x3a, 0x02, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x39, 0x02, // ..:...;...<...9. 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x3f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x3f, 0x02, // ......?.......?. - 0x00, 0x00, 0xf5, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0xb2, 0x01, // ................ + 0x00, 0x00, 0xf5, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x96, 0x02, 0x00, 0x00, 0xb2, 0x01, // ................ 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x3d, 0x02, // ..............=. - 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x90, 0x02, // ......>...[..... + 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x96, 0x02, // ......>...[..... 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ......8....... }; -static const uint8_t fs_font_distance_field_outline_drop_shadow_image_dx9[1775] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH..gz........s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, // ....u_params.... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x06, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, // ................ - 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x03, // ,.CTAB.......... - 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, 0x00, // ..............|. - 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, // ..D...........P. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, // ......`......... - 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..l.......s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // olor............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0xab, // ......u_params.. - 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, // ..ps_3_0.Microso - 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, // ft (R) HLSL Shad - 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, // er Compiler 10.1 - 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ..Q............. - 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, // ........@.Q..... - 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, // .....?.......@.. - 0x00, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xf3, 0x04, 0x35, 0x41, 0x00, 0x00, // .?Q.........5A.. - 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ....@@...?...... - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, // ................ - 0x07, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................ - 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x03, 0x00, 0x07, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, // ................ - 0x02, 0x80, 0x04, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, // ................ - 0x0f, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x9c, 0x02, 0x00, // ..X............. - 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ....U........... - 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x29, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, // ......)......... - 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0x80, 0x02, 0x00, 0x55, 0xa0, 0x2a, 0x00, // U...........U.*. - 0x00, 0x00, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0x90, 0x00, 0x08, // ..B............. - 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x08, 0x80, 0x01, 0x00, 0xff, 0x80, 0x00, 0x00, // ................ - 0xff, 0x90, 0x2b, 0x00, 0x00, 0x00, 0x29, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, // ..+...)......... - 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x2a, 0x00, // U.............*. - 0x00, 0x00, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x04, 0x00, 0xe4, 0x9c, 0x02, 0x00, // ..X............. - 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ....U........... - 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x29, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, // ......)......... - 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x2a, 0x00, // U.............*. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x04, 0x00, 0xff, 0x90, 0x02, 0x00, // ................ - 0xaa, 0xa0, 0x02, 0x00, 0xff, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ................ - 0x55, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x02, 0x00, // U.X............. - 0x55, 0xa0, 0x02, 0x00, 0x00, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // U.....X......... - 0x55, 0x80, 0x02, 0x00, 0x55, 0xa0, 0x00, 0x00, 0xff, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // U...U........... - 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // ....U........... - 0x02, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, // ........U....... - 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x01, 0x00, // ....U.....X..... - 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x8c, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x42, 0x00, // ............U.B. - 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x04, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0xc6, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x5b, 0x00, // ..............[. - 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x04, 0x00, 0xe4, 0x90, 0x5c, 0x00, 0x00, 0x02, 0x02, 0x00, // ................ - 0x07, 0x80, 0x04, 0x00, 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x8b, 0x02, 0x00, 0xe4, 0x8b, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x05, 0x00, // ............U... - 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x01, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x02, 0x00, 0xff, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x08, 0x80, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0xff, 0x80, 0x04, 0x00, // ................ - 0x00, 0x04, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, // ................ - 0xff, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, // ................ - 0xaa, 0x81, 0x00, 0x00, 0xff, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x81, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ....U........... - 0xaa, 0x81, 0x01, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x12, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, // ................ - 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // U...........U... - 0x55, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, // U...........U... - 0x55, 0xa0, 0x03, 0x00, 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, // U............... - 0xaa, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, // ....U........... - 0x55, 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, // U............... - 0xe4, 0x90, 0x2b, 0x00, 0x00, 0x00, 0x29, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, // ..+...)......... - 0x55, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, // U.*............. - 0xff, 0x90, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xff, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ......X......... - 0x55, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x02, 0x00, 0x00, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, // U...U.....X..... - 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, // ........U....... - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x02, 0x00, // ............U... - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, // ..............X. - 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, // ................ - 0x55, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x90, 0x00, 0x08, // U.B............. - 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xc6, 0x80, 0x00, 0x00, // ................ - 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x02, 0x00, 0x90, 0x90, 0x5c, 0x00, // ..[............. - 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x0e, 0x80, 0x00, 0x00, 0xe4, 0x8b, 0x01, 0x00, 0x90, 0x8b, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, // ....U........... - 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // U...........U... - 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, // U...........U... - 0x00, 0xa1, 0x03, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x81, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, // ................ - 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // U............... - 0x04, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x01, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x14, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x03, 0x00, 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ....U........... - 0x04, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, // ................ - 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x91, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, // ....U........... - 0x08, 0x80, 0x02, 0x00, 0xff, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ................ - 0xff, 0xa0, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0xff, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, // ....U........... - 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x00, 0x00, // ........U....... - 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, // ............U... - 0xf4, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, // ........U....... - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, // ................ - 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x03, 0x00, // ............U... - 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // ............U... - 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0xff, 0x90, 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, // ..+...+........ -}; -static const uint8_t fs_font_distance_field_outline_drop_shadow_image_dx11[2735] = +static const uint8_t fs_font_distance_field_outline_drop_shadow_image_dx11[2742] = { - 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x08, 0x75, // FSH..gz........u + 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH..gz........u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, // ..s_texColor0... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x0a, 0x00, 0x00, 0x44, // r0.............D - 0x58, 0x42, 0x43, 0x0a, 0x76, 0x6e, 0x1c, 0xad, 0x10, 0xc2, 0xbe, 0x43, 0xeb, 0x63, 0x26, 0x8a, // XBC.vn.....C.c&. - 0x5a, 0x50, 0x92, 0x01, 0x00, 0x00, 0x00, 0x5c, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // ZP............., - 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0xb4, // ...........ISGN. - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x07, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x07, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO - 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX - 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // COORD..OSGN,.... - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S - 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x38, // V_TARGET...SHDR8 - 0x09, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, // ...@...N...Y...F - 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, // . .........Z.... - 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, // `......X0...p... - 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, // ...UU..b........ - 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, // ...b...r.......b - 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, // ...........b...r - 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x05, // .......b........ - 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, // ...e.... ......h - 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, // .......i........ - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x04, // .......i........ - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, // ...........r.... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ...F........@... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, // ...............< - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, // ...........<.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // .......*........ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...E...........F - 0x12, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......F~....... - 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, // `......8.... ... - 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, // ...:.......:.... - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...6...r ......F - 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x18, // .......>........ - 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, // ...r.......F.... - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....@........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......<........ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...<...........* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, // ................ - 0x00, 0x00, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, // ...........E.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, // .......F.......F - 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // ~.......`......2 - 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x05, // ...........:.... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@.....@.@... - 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, // ..?............. - 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, // .......6....0 .. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // .......*.......6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ....0 .......... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, // .......6....0 .. - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, // ....0 .........: - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......6........ - 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, // ....0 .......... - 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ................ - 0x19, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, // ...........r.... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, // ...F............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, // .......V........ - 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, // ................ - 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, // ...........K..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...............8 - 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ..... .........8 - 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x32, 0x00, 0x00, 0x0b, 0x42, // ....@....5A2...B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // .......:. .A.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x0b, 0x82, 0x00, 0x10, 0x00, 0x00, // @.....?2........ - 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...*. .A........ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, // ...........*.... - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...2...".......* - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // . .............. - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x32, // ...*...........2 - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ...........A.... - 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, // ...F..........." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, // ........@.....?. - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..?...?...?..... - 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ...8 ........... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // ...............2 - 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@.......@... - 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // .@@8............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...............8 - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, // ...........8.... - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // ..............: - 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, // .......6...r ... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, // ...F.......>.... - 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...E...........F - 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......F~....... - 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, // `......2........ - 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, // ...:........@... - 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, // ..@.@.....?..... - 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ....0 .........* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, // .......6....0 .. - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, // ....0 .......... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, // .......6....0 .. - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // .......:.......6 - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x01, // ............0 .. - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0xe2, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, // ...r.......F.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, // ...............V - 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, // ...........".... - 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ...K..."........ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, // .......8...".... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, // ............. .. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, // .......8...B.... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, // ............@... - 0x04, 0x35, 0x41, 0x32, 0x00, 0x00, 0x0b, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // .5A2...B.......: - 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // . .A...........* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, // ........@.....?2 - 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, // ...............A - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, // ........@....5A* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, // .......2...B.... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, // ............@... - 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x42, // .5A*...........B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // .......:...A.... - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x82, // ...*............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // .......:...A.... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x42, // ...............B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, // ........@.....?. - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, // ..?...?...?*.... - 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...8 ..B.......* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // .......:.......2 - 0x00, 0x00, 0x09, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, // ...........*.... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@.......@... - 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // .@@8...B.......* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // .......*.......8 - 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, // ...B.......*.... - 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, // ...:.......2.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ...........A.... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@....5A.@... - 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ..?2..."........ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, // ........@....5A. - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, // @.....?....2.... - 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......A.......F - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, // ...........".... - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, // ....@.....?...?. - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ..?...?........8 - 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ............... - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, // ...........2..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, // @.......@....@@8 - 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, // ...........8.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x01, // ...........r.... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x80, 0x41, // ...F.......F...A - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x72, 0x20, 0x10, 0x00, 0x00, // .......2...r ... - 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...........F.... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, // ...F.......8.... - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // ......*.......: - 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // .......>....... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0a, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xf9, 0x60, // ......x...DXBC.` + 0xbe, 0x1a, 0x28, 0xc3, 0xb6, 0xb4, 0x37, 0xda, 0x6d, 0x34, 0xf4, 0x46, 0x55, 0xc1, 0x01, 0x00, // ..(...7.m4.FU... + 0x00, 0x00, 0x78, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xe8, 0x00, // ..x.......,..... + 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0xb4, 0x00, 0x00, 0x00, 0x06, 0x00, // ......ISGN...... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xa4, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00, 0x00, 0xaa, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00, 0x00, 0xaa, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, // ......SV_POSITIO + 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, // N.COLOR.TEXCOORD + 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,......... + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. ............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR + 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x54, 0x09, 0x00, 0x00, 0x50, 0x00, // GET...SHEXT...P. + 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, // ..U...j...Y...F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, // .........Z....` + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, // ......X0...p.... + 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, // ..UU..b......... + 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x10, // ..b...r.......b. + 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, // ..........b...r. + 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x05, 0x00, // ......b......... + 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e.... ......h. + 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, // ......i......... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, // ......i......... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........r..... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // ..F........@.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, // ..............<. + 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, // ..........<..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......*......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, // ..E.......CU.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x7e, // ......F.......F~ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // .......`......8. + 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, // ... ......:..... + 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, // ..:.......6...r + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......F.......>. + 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........r..... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // ..F........@.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, // ..............<. + 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, // ..........<..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......*......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, // ..E.......CU.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x7e, // ......F.......F~ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // .......`......2. + 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x05, 0x00, // ..........:..... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@.....@.@.... + 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, // .?.............. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, // ......6....0 ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ......*.......6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, // ...0 ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, // ......6....0 ... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, // ...0 .........:. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......6......... + 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, // ...0 ........... + 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, // ..z............. + 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......|...r..... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, // ..F............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, // ......V......... + 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ................ + 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, // ..........K...". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // ..............8. + 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // .... .........8. + 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x32, 0x00, 0x00, 0x0b, 0x42, 0x00, // ...@....5A2...B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ......:. .A..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x0b, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?2......... + 0x00, 0x00, 0x2a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..*. .A......... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........*..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, // ..2...".......*. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, // ..*...........2. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........A..... + 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, // ..F...........". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // .......@.....?.. + 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .?...?...?...... + 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..8 ............ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@.......@.... + 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // @@8............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // ..............8. + 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, // ..........8.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, // ..............:. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, // ......6...r .... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, 0x00, // ..F.......>..... + 0x00, 0x01, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, // ..E.......CU.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, // ......F.......F~ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // .......`......2. + 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x03, 0x00, // ..........:..... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@.....@.@.... + 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, // .?.............. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, // ......6....0 ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ......*.......6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, // ...0 ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, // ......6....0 ... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, // ...0 .........:. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......6......... + 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, // ...0 ........... + 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, // ..z............. + 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......|...r..... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, // ..F............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, // ......V......... + 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ................ + 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, // ..........K...". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // ..............8. + 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // .... .........8. + 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..B............. + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x32, 0x00, 0x00, 0x0b, 0x42, 0x00, // ...@....5A2...B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ......:. .A..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......*........@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?2......... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......A........@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ....5A*.......2. + 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..B............. + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ...@....5A*..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ......B.......:. + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..A.......*..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ..............:. + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..A............. + 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ......B........@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // .....?...?...?.. + 0x80, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x42, 0x00, // .?*.......8 ..B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ......*.......:. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..*........@.... + 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, // ...@....@@8...B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ......*.......*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8...B..... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..*.......:..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..2............. + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, // ..A........@.... + 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, // 5A.@.....?2...". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // ....5A.@.....?.. + 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x80, 0x41, 0x00, // ..2...........A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // ......F......... + 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // .."........@.... + 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, // .?...?...?...?.. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8 ........ + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..2..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, // .......@.......@ + 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ....@@8......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..8............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, // ..r.......F..... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F...A.......2. + 0x00, 0x09, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, // ..r ............ + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, // ..F.......F..... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ..8.... ......*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......:.......>. + 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ...... }; -static const uint8_t fs_font_distance_field_outline_drop_shadow_image_mtl[3365] = +static const uint8_t fs_font_distance_field_outline_drop_shadow_image_mtl[3552] = { 0x46, 0x53, 0x48, 0x0b, 0x9e, 0x67, 0x7a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x11, 0x73, // FSH..gz........s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler @@ -939,7 +830,7 @@ static const uint8_t fs_font_distance_field_outline_drop_shadow_image_mtl[3365] 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, // .......u_params. 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..........s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x0c, // olor............ + 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x0d, // olor..........j. 0x00, 0x00, 0x23, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x20, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x20, // ..#pragma clang 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, // diagnostic ignor 0x65, 0x64, 0x20, 0x22, 0x2d, 0x57, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2d, 0x70, 0x72, // ed "-Wmissing-pr @@ -1039,7 +930,7 @@ static const uint8_t fs_font_distance_field_outline_drop_shadow_image_mtl[3365] 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, // [[sampler(0)]]) 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // .{. xlatMtlMa 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, // in_out out = {}; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x35, 0x36, // . float4 _656 + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x36, 0x32, // . float4 _662 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // ;. do. {. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x21, 0x61, 0x6e, 0x79, 0x28, // if (!any( 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x2e, 0x78, // in.v_texcoord1.x @@ -1051,7 +942,7 @@ static const uint8_t fs_font_distance_field_outline_drop_shadow_image_mtl[3365] 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, // olorSampler, in. 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x29, // v_texcoord1.xyz) 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, // ;. _6 - 0x35, 0x36, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x35, 0x39, 0x37, // 56 = float4(_597 + 0x36, 0x32, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x35, 0x39, 0x37, // 62 = float4(_597 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x5f, 0x35, 0x39, 0x37, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x69, // .xyz, _597.w * i 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, // n.v_color0.w);. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, // break @@ -1080,70 +971,81 @@ static const uint8_t fs_font_distance_field_outline_drop_shadow_image_mtl[3365] 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, // th(fwidth(in.v_t 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x20, 0x2a, // excoord2.xyz)) * 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, // 11.313708305358 - 0x38, 0x38, 0x37, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // 887) * _mtl_u.u_ - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // params.y;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x34, 0x38, 0x31, // float _481 - 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // = 0.5 - (_mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x5f, 0x34, // .u_params.w * _4 - 0x37, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 75);. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x34, 0x38, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x34, // float _485 = _4 - 0x37, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // 75 * _mtl_u.u_pa - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // rams.z;. - 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x35, 0x36, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // _656 = float - 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, // 4(in.v_color0.xy - 0x7a, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x5f, 0x34, // z, smoothstep(_4 - 0x38, 0x31, 0x20, 0x2d, 0x20, 0x5f, 0x34, 0x38, 0x35, 0x2c, 0x20, 0x5f, 0x34, 0x38, 0x31, 0x20, // 81 - _485, _481 - 0x2b, 0x20, 0x5f, 0x34, 0x38, 0x35, 0x2c, 0x20, 0x5f, 0x33, 0x38, 0x39, 0x5b, 0x69, 0x6e, 0x74, // + _485, _389[int - 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, // ((in.v_texcoord2 - 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, // .w * 4.0) + 0.5) - 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // ]) * in.v_color0 - 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .w);. - 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. - 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // }. float4 - 0x20, 0x5f, 0x36, 0x32, 0x30, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // _620 = s_texCol - 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // or.sample(s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, // olorSampler, in. - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, // v_texcoord0.xyz) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x5f, 0x35, // ;. int _5 - 0x31, 0x34, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, // 14 = int((in.v_t - 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, // excoord0.w * 4.0 - 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ) + 0.5);. - 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, // spvUnsafeArray - 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x34, 0x3e, 0x20, 0x5f, 0x34, 0x30, 0x30, 0x3b, // _400; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x30, 0x30, 0x5b, 0x30, 0x5d, // . _400[0] - 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x32, 0x30, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // = _620.z;. - 0x20, 0x20, 0x20, 0x5f, 0x34, 0x30, 0x30, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x32, // _400[1] = _62 - 0x30, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x30, // 0.y;. _40 - 0x30, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x32, 0x30, 0x2e, 0x78, 0x3b, 0x0a, 0x20, // 0[2] = _620.x;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x30, 0x30, 0x5b, 0x33, 0x5d, 0x20, 0x3d, // _400[3] = - 0x20, 0x5f, 0x36, 0x32, 0x30, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _620.w;. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x33, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x6c, // float _538 = (l - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, 0x28, 0x69, 0x6e, 0x2e, // ength(fwidth(in. - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, // v_texcoord0.xyz) - 0x29, 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, // ) * 11.313708305 - 0x33, 0x35, 0x38, 0x38, 0x38, 0x37, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // 358887) * _mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, // .u_params.y;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x34, 0x34, 0x20, // float _544 - 0x3d, 0x20, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // = 0.5 - (_mtl_u. - 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x33, // u_params.w * _53 - 0x38, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x35, 0x36, // 8);. _656 - 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x6d, 0x69, 0x78, 0x28, 0x69, 0x6e, // = float4(mix(in - 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x69, // .v_color1.xyz, i - 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, // n.v_color0.xyz, - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, // float3(smoothste - 0x70, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x5f, 0x35, 0x33, 0x38, 0x2c, 0x20, 0x30, 0x2e, // p(0.5 - _538, 0. - 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x35, 0x33, 0x38, 0x2c, 0x20, 0x5f, 0x34, 0x30, 0x30, 0x5b, 0x5f, // 5 + _538, _400[_ + 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // 88671875) * _mtl + 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x3b, 0x0a, 0x20, // _u.u_params.y;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // float + 0x20, 0x5f, 0x34, 0x38, 0x31, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x2d, 0x5f, 0x6d, 0x74, // _481 = fma(-_mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x2c, 0x20, // l_u.u_params.w, + 0x5f, 0x34, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // _475, 0.5);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x36, 0x32, 0x20, 0x3d, 0x20, 0x66, // _662 = f + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // loat4(in.v_color + 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, // 0.xyz, smoothste + 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x2d, 0x5f, 0x34, 0x37, 0x35, 0x2c, 0x20, 0x5f, 0x6d, 0x74, // p(fma(-_475, _mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x2c, 0x20, // l_u.u_params.z, + 0x5f, 0x34, 0x38, 0x31, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x34, 0x37, 0x35, 0x2c, // _481), fma(_475, + 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // _mtl_u.u_params + 0x2e, 0x7a, 0x2c, 0x20, 0x5f, 0x34, 0x38, 0x31, 0x29, 0x2c, 0x20, 0x5f, 0x33, 0x38, 0x39, 0x5b, // .z, _481), _389[ + 0x69, 0x6e, 0x74, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, // int(fma(in.v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x32, 0x2e, 0x77, 0x2c, 0x20, 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, // coord2.w, 4.0, 0 + 0x2e, 0x35, 0x29, 0x29, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, // .5))]) * in.v_co + 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lor0.w);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // break;. + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // }. fl + 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x32, 0x30, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, // oat4 _620 = s_te + 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, // xColor.sample(s_ + 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, // texColorSampler, + 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // in.v_texcoord0. + 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, // xyz);. in + 0x74, 0x20, 0x5f, 0x35, 0x31, 0x34, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x66, 0x6d, 0x61, // t _514 = int(fma + 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // (in.v_texcoord0. + 0x77, 0x2c, 0x20, 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, // w, 4.0, 0.5));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, // spvUnsafe + 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x34, 0x3e, 0x20, // Array + 0x5f, 0x34, 0x30, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, // _400;. _4 + 0x30, 0x30, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x32, 0x30, 0x2e, 0x7a, 0x3b, 0x0a, // 00[0] = _620.z;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x30, 0x30, 0x5b, 0x31, 0x5d, 0x20, // _400[1] + 0x3d, 0x20, 0x5f, 0x36, 0x32, 0x30, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _620.y;. + 0x20, 0x20, 0x5f, 0x34, 0x30, 0x30, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x32, 0x30, // _400[2] = _620 + 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x30, 0x30, // .x;. _400 + 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x32, 0x30, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, // [3] = _620.w;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x33, 0x33, // float _533 + 0x20, 0x3d, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, // = length(fwidth + 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // (in.v_texcoord0. + 0x78, 0x79, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // xyz));. f + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x33, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x33, 0x33, // loat _535 = _533 + 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, // * 11.3137083053 + 0x35, 0x38, 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 5888671875;. + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x34, 0x34, 0x20, 0x3d, // float _544 = + 0x20, 0x66, 0x6d, 0x61, 0x28, 0x2d, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // fma(-_mtl_u.u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x2c, 0x20, 0x5f, 0x35, 0x33, 0x35, 0x20, 0x2a, 0x20, // arams.w, _535 * + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, // _mtl_u.u_params. + 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // y, 0.5);. + 0x20, 0x5f, 0x36, 0x36, 0x32, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x6d, // _662 = float4(m + 0x69, 0x78, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x2e, 0x78, // ix(in.v_color1.x + 0x79, 0x7a, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // yz, in.v_color0. + 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x73, 0x6d, 0x6f, 0x6f, // xyz, float3(smoo + 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x35, 0x33, 0x33, 0x20, // thstep(fma(_533 + 0x2a, 0x20, 0x28, 0x2d, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, // * (-11.313708305 + 0x33, 0x35, 0x38, 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x6d, // 35888671875), _m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, // tl_u.u_params.y, + 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x35, 0x33, 0x35, 0x2c, // 0.5), fma(_535, + 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // _mtl_u.u_params + 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x34, 0x30, 0x30, 0x5b, 0x5f, // .y, 0.5), _400[_ 0x35, 0x31, 0x34, 0x5d, 0x29, 0x29, 0x29, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, // 514]))), smooths - 0x74, 0x65, 0x70, 0x28, 0x5f, 0x35, 0x34, 0x34, 0x20, 0x2d, 0x20, 0x5f, 0x35, 0x33, 0x38, 0x2c, // tep(_544 - _538, - 0x20, 0x5f, 0x35, 0x34, 0x34, 0x20, 0x2b, 0x20, 0x5f, 0x35, 0x33, 0x38, 0x2c, 0x20, 0x5f, 0x34, // _544 + _538, _4 - 0x30, 0x30, 0x5b, 0x5f, 0x35, 0x31, 0x34, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, // 00[_514]) * in.v - 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // _color0.w);. - 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, // break;. } - 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, // while(false);. - 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // out.bgfx_Frag - 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x35, 0x36, 0x3b, 0x0a, 0x20, 0x20, // Data0 = _656;. - 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, // return out;.}. - 0x0a, 0x00, 0x00, 0x30, 0x00, // ...0. + 0x74, 0x65, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x35, 0x33, 0x33, 0x20, 0x2a, 0x20, 0x28, // tep(fma(_533 * ( + 0x2d, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, // -11.313708305358 + 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // 88671875), _mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x35, // u.u_params.y, _5 + 0x34, 0x34, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x35, 0x33, 0x35, 0x2c, 0x20, 0x5f, // 44), fma(_535, _ + 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, // mtl_u.u_params.y + 0x2c, 0x20, 0x5f, 0x35, 0x34, 0x34, 0x29, 0x2c, 0x20, 0x5f, 0x34, 0x30, 0x30, 0x5b, 0x5f, 0x35, // , _544), _400[_5 + 0x31, 0x34, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // 14]) * in.v_colo + 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, // r0.w);. b + 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, // reak;. } whil + 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, // e(false);. ou + 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, // t.bgfx_FragData0 + 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x36, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, // = _662;. ret + 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // urn out;.}....0. }; extern const uint8_t* fs_font_distance_field_outline_drop_shadow_image_pssl; extern const uint32_t fs_font_distance_field_outline_drop_shadow_image_pssl_size; diff --git a/bgfx/examples/common/font/fs_font_distance_field_outline_image.bin.h b/bgfx/examples/common/font/fs_font_distance_field_outline_image.bin.h index 3b4b08a1..28bd3498 100644 --- a/bgfx/examples/common/font/fs_font_distance_field_outline_image.bin.h +++ b/bgfx/examples/common/font/fs_font_distance_field_outline_image.bin.h @@ -221,387 +221,314 @@ static const uint8_t fs_font_distance_field_outline_image_essl[1785] = 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // agColor = tmpvar 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _14;.}... }; -static const uint8_t fs_font_distance_field_outline_image_spv[2962] = +static const uint8_t fs_font_distance_field_outline_image_spv[3006] = { 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH....n.......u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, // ..s_texColor0... - 0x00, 0x00, 0x00, 0x04, 0x1a, 0x00, 0x54, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ......T.....#... - 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ + 0x00, 0x00, 0x00, 0x04, 0x22, 0x00, 0x80, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ....".......#... + 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xcc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ................ 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, // ..............GL 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // SL.std.450...... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, // ......main...... - 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xee, 0x00, // ................ - 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, // ................ - 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ......main...... - 0x07, 0x00, 0x32, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ..2...s_texColor - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x35, 0x00, // Sampler.......5. - 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, // ..s_texColorText - 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0xad, 0x00, 0x00, 0x00, 0x55, 0x6e, // ure...........Un - 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // iformBlock...... - 0x06, 0x00, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ..........u_para - 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, // ms.............. - 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // ..........gl_Fra - 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xe5, 0x00, // gCoord.......... - 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..v_color0...... - 0x05, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x00, 0x00, // ......v_color1.. - 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ..........v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0xee, 0x00, 0x00, 0x00, 0x76, 0x5f, // oord0.........v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, 0x06, 0x00, 0xff, 0x00, // texcoord1....... - 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, // ..bgfx_FragData0 - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...2..."..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, // ..G...2...!..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...5..."..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, // ..G...5...!..... - 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, // ..H...........#. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0x02, 0x00, // ......G......... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G......."..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, // ..G.......!..... - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xee, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, // ..G............. - 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xff, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G............. - 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, // ..........!..... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, // ................ - 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, // ...... ......... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x14, 0x00, // ................ - 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13, 0x00, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x07, 0x00, // ...... ... ..... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ...1..... - 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x32, 0x00, // ......;...1...2. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ...4..... - 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x35, 0x00, // ......;...4...5. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x20, 0x00, // ..........8... . - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x39, 0x00, // ......+...8...9. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......+...8...=. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x41, 0x00, 0x00, 0x00, 0x08, 0x00, // ..........A..... - 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+.......Z..... - 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x5a, 0x00, // ..,.......]...Z. - 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x6f, 0x00, // ..Z...Z.......o. - 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x6f, 0x00, // .. .......+...o. - 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..p.......+..... - 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // .........@+..... - 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x6f, 0x00, // .........?+...o. - 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x8c, 0x00, // ................ - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x8d, 0x00, // .......... ..... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x6f, 0x00, // ..........+...o. - 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x38, 0x00, // ..........+...8. - 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x6f, 0x00, // ..........+...o. - 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x38, 0x00, // ..........+...8. - 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0xad, 0x00, // ................ - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xae, 0x00, 0x00, 0x00, 0x02, 0x00, // ...... ......... - 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xae, 0x00, 0x00, 0x00, 0xaf, 0x00, // ......;......... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x02, 0x00, // ...... ......... - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x01, 0x00, // ...... ......... - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xe2, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xe5, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xe8, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xeb, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xee, 0x00, // ......;......... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x03, 0x00, // ...... ......... - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xff, 0x00, // ......;......... - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc6, 0x01, // ......+......... - 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, // ....5A6......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, // ................ - 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x07, 0x00, // ..;.......&..... - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x32, 0x00, // ..=.......3...2. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x35, 0x00, // ..=.......6...5. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xe5, 0x00, // ..=............. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xe8, 0x00, // ..=............. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xeb, 0x00, // ..=............. - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0xee, 0x00, // ..=............. - 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x8e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, // ................ - 0x03, 0x00, 0x98, 0x00, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x32, 0x01, // ......2.......2. - 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0xec, 0x00, // ..O.......5..... - 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x35, 0x01, // ..............5. - 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x37, 0x01, // ..]...........7. - 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x48, 0x01, 0x00, 0x00, 0x00, 0x00, // ..........H..... - 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x37, 0x01, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x48, 0x01, // ......7...8...H. - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x38, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ......8...O..... - 0x00, 0x00, 0x3b, 0x01, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;............. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x41, 0x00, // ..........V...A. - 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x57, 0x00, // ......6...3...W. - 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0x3b, 0x01, // ..............;. - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xa4, 0x01, // ..Q.......@..... - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x42, 0x01, // ......Q.......B. - 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // ................ - 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x42, 0x01, 0x00, 0x00, 0x51, 0x00, // ..C...@...B...Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x00, 0x00, // ......D......... - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0xa4, 0x01, // ..Q.......E..... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x46, 0x01, // ......Q.......F. - 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, // ..........P..... - 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x46, 0x01, // ..G...D...E...F. - 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x8e, 0x01, 0x00, 0x00, 0xf8, 0x00, // ..C............. - 0x02, 0x00, 0x48, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x4b, 0x01, // ..H...O.......K. + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0a, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xe5, 0x00, // ......main...... + 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xff, 0x00, // ................ + 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x32, 0x00, // ..main........2. + 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, // ..s_texColorSamp + 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x35, 0x00, 0x00, 0x00, 0x73, 0x5f, // ler.......5...s_ + 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, // texColorTexture. + 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0xad, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, // ..........Unifor + 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0xad, 0x00, // mBlock.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, // ......u_params.. + 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ................ + 0x05, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, // ......v_color0.. + 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ..........v_colo + 0x72, 0x31, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x76, 0x5f, // r1............v_ + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0xee, 0x00, // texcoord0....... + 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, // ..v_texcoord1... + 0x06, 0x00, 0xff, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, // ......bgfx_FragD + 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x22, 0x00, // ata0..G...2...". + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...2...!. + 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x22, 0x00, // ......G...5...". + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...5...!. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, // ......H......... + 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0xad, 0x00, // ..#.......G..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x22, 0x00, // ......G.......". + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G.......!. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xee, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xff, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, // ..............!. + 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, // ................ + 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, // .......... ..... + 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x14, 0x00, // ................ + 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x20, 0x00, // .......... ... . + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x31, 0x00, // .......... ...1. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x31, 0x00, // ..........;...1. + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x34, 0x00, // ..2....... ...4. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x34, 0x00, // ..........;...4. + 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x38, 0x00, // ..5...........8. + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x38, 0x00, // .. .......+...8. + 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x38, 0x00, // ..9.......+...8. + 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x41, 0x00, // ..=...........A. + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5a, 0x00, // ......+.......Z. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x5d, 0x00, // ......,.......]. + 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x15, 0x00, // ..Z...Z...Z..... + 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..o... .......+. + 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..o...p.......+. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, // .............@+. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, // .............?+. + 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..o............. + 0x04, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . + 0x04, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..o...........+. + 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..8...........+. + 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..o...........+. + 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, // ..8............. + 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xae, 0x00, // .......... ..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xae, 0x00, // ..........;..... + 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xb0, 0x00, // .......... ..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xe1, 0x00, // .......... ..... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe1, 0x00, // ..........;..... + 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe1, 0x00, // ..........;..... + 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe1, 0x00, // ..........;..... + 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe1, 0x00, // ..........;..... + 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xfe, 0x00, // .......... ..... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xfe, 0x00, // ..........;..... + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ..........+..... + 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, // ........5A+..... + 0x00, 0x00, 0xca, 0x01, 0x00, 0x00, 0xf3, 0x04, 0x35, 0xc1, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, // ........5.6..... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, // ................ + 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x26, 0x01, // ......;.......&. + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x33, 0x00, // ......=.......3. + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x36, 0x00, // ..2...=.......6. + 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xe6, 0x00, // ..5...=......... + 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xe9, 0x00, // ......=......... + 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xec, 0x00, // ......=......... + 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xef, 0x00, // ......=......... + 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x8e, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0x98, 0x00, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0xf8, 0x00, // ..........2..... + 0x02, 0x00, 0x32, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x35, 0x01, // ..2...O.......5. 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x41, 0x00, 0x00, 0x00, 0xab, 0x01, // ......V...A..... - 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, // ..6...3...W..... - 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x51, 0x00, // ..........K...Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x03, 0x00, // ......N......... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4f, 0x01, 0x00, 0x00, 0x4e, 0x01, // ..........O...N. - 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x50, 0x01, // ..............P. - 0x00, 0x00, 0x4f, 0x01, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x38, 0x00, // ..O.......n...8. - 0x00, 0x00, 0x51, 0x01, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..Q...P...Q..... - 0x00, 0x00, 0x53, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, // ..S...........A. - 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x3d, 0x00, // .. ...T...&...=. - 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x54, 0x01, 0x00, 0x00, 0x53, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...T...S...Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x56, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x01, 0x00, // ......V......... - 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0x57, 0x01, 0x00, 0x00, 0x26, 0x01, // ..A... ...W...&. - 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x57, 0x01, 0x00, 0x00, 0x56, 0x01, // ..9...>...W...V. - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0xad, 0x01, // ..Q.......Y..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0x5a, 0x01, // ......A... ...Z. - 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5a, 0x01, // ..&.......>...Z. - 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5c, 0x01, // ..Y...Q......... - 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, // ..........A... . - 0x00, 0x00, 0x5d, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..]...&.......>. - 0x03, 0x00, 0x5d, 0x01, 0x00, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, // ..].......A... . - 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x51, 0x01, 0x00, 0x00, 0x3d, 0x00, // .._...&...Q...=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x4f, 0x00, // ......`..._...O. - 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, 0x00, // ......b......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, // ................ - 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0x0c, 0x00, // ......c...b..... - 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, // ......d.......B. - 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x66, 0x01, // ..c...........f. - 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xb0, 0x00, // ..d.......A..... - 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x93, 0x00, // ..g.......=..... - 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x67, 0x01, // ..=.......h...g. - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x66, 0x01, // ..........i...f. - 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x6a, 0x01, // ..h...A.......j. - 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......=...p...=. - 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x85, 0x00, // ......k...j..... - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x69, 0x01, // ......m...k...i. - 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x88, 0x00, // ..........o..... - 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x72, 0x01, // ..m...........r. - 0x00, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, // ..o...i......... - 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x0c, 0x00, // ..u...o...i..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0x9b, 0x01, // ................ + 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x04, 0x00, 0x13, 0x00, // ..5...]......... + 0x00, 0x00, 0x37, 0x01, 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x48, 0x01, // ..7...........H. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x37, 0x01, 0x00, 0x00, 0x38, 0x01, // ..........7...8. + 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x38, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..H.......8...O. + 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x01, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0xef, 0x00, // ......;......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, // ..............V. + 0x05, 0x00, 0x41, 0x00, 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x33, 0x00, // ..A.......6...3. + 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0xa2, 0x01, // ..W............. + 0x00, 0x00, 0x3b, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x40, 0x01, // ..;...Q.......@. + 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0x42, 0x01, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ..B............. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x42, 0x01, // ......C...@...B. + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0xa4, 0x01, // ..Q.......D..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x45, 0x01, // ......Q.......E. + 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, // ..F...........P. + 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x45, 0x01, // ......G...D...E. + 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x8e, 0x01, // ..F...C......... + 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x48, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ......H...O..... + 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, 0x00, // ..K............. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x41, 0x00, // ..........V...A. + 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x57, 0x00, // ......6...3...W. + 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x4b, 0x01, // ..............K. + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0xec, 0x00, // ..Q.......N..... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x50, 0x01, // ..............P. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x86, 0x00, // ......2...N..... + 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x51, 0x01, // ......n...8...Q. + 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x53, 0x01, // ..P...Q.......S. + 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, // ..........A... . + 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..T...&...=...>. + 0x03, 0x00, 0x54, 0x01, 0x00, 0x00, 0x53, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..T...S...Q..... + 0x00, 0x00, 0x56, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, // ..V...........A. + 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0x57, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x39, 0x00, // .. ...W...&...9. + 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x57, 0x01, 0x00, 0x00, 0x56, 0x01, 0x00, 0x00, 0x51, 0x00, // ..>...W...V...Q. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x00, 0x00, // ......Y......... + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x26, 0x01, // ..A... ...Z...&. + 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x59, 0x01, // ......>...Z...Y. + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5c, 0x01, 0x00, 0x00, 0xad, 0x01, // ..Q............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0x5d, 0x01, // ......A... ...]. + 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5d, 0x01, // ..&.......>...]. + 0x00, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0x5f, 0x01, // ......A... ..._. + 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x51, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..&...Q...=..... + 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..`..._...O..... + 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, 0x00, // ..b............. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x0b, 0x00, // ................ + 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, // ..c...b......... + 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x63, 0x01, // ..d.......B...c. + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0x64, 0x01, // ..........f...d. + 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x67, 0x01, // ......A.......g. + 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......=.......=. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0x85, 0x00, // ......h...g..... + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0x68, 0x01, // ......i...f...h. + 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0xaf, 0x00, // ..A.......j..... + 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, // ..=...p...=..... + 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x07, 0x00, // ..k...j......... + 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, // ......k......... + 0x00, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xc7, 0x01, // ..o.......2..... + 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, // ..i............. + 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0xca, 0x01, 0x00, 0x00, 0x0c, 0x00, // ......d......... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x72, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......r.......2. + 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x0c, 0x00, // ......h...o..... + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......u.......2. + 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x0c, 0x00, // ..f...h...o..... 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x77, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, // ......w.......1. - 0x00, 0x00, 0x72, 0x01, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x83, 0x00, // ..r...u...`..... - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x69, 0x01, // ......y.......i. - 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x88, 0x00, // ..........{..... - 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7d, 0x01, // ..i...........}. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x7b, 0x01, // ......1...y...{. - 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x7f, 0x01, // ..`...P......... - 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..}...}...}...O. - 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xe9, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x4f, 0x00, // ..............O. - 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xe6, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, // ................ - 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, // ................ - 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x77, 0x01, // ..............w. - 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x89, 0x01, // ......Q......... - 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... - 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. - 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x89, 0x01, // ..P............. - 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0xf9, 0x00, // ................ - 0x02, 0x00, 0x8e, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x8e, 0x01, 0x00, 0x00, 0xf5, 0x00, // ................ - 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x38, 0x01, // ..........G...8. - 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xff, 0x00, // ......H...>..... - 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..........8..... - 0x10, 0x00, // .. -}; -static const uint8_t fs_font_distance_field_outline_image_dx9[1147] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH....n.......s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x00, 0x00, // ....u_params.... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, // ......@......... - 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x03, // ,.CTAB.......... - 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, 0x00, // ..............|. - 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, // ..D...........P. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, // ......`......... - 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..l.......s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // olor............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0xab, // ......u_params.. - 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, // ..ps_3_0.Microso - 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, // ft (R) HLSL Shad - 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, // er Compiler 10.1 - 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // ..Q..........?.. - 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, // .....@...?Q..... - 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, // ................ - 0x40, 0xc0, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xf3, 0x04, 0x35, 0x41, 0x00, 0x00, // @.Q.........5A.. - 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, // ....@@...?...... - 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, // ................ - 0x07, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................ - 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x03, 0x00, 0x07, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, // ......X......... - 0xe4, 0x9c, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x55, 0xa0, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, // ........U....... - 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x29, 0x00, 0x04, 0x02, 0x00, 0x00, // ..........)..... - 0x00, 0x81, 0x01, 0x00, 0x55, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x03, 0x00, // ....U.B......... - 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, // ................ - 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, // ................ - 0xff, 0x90, 0x2a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, // ..*............. - 0xff, 0x90, 0x01, 0x00, 0xaa, 0xa0, 0x01, 0x00, 0xff, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ......X......... - 0x55, 0x81, 0x01, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, // U...U.....X..... - 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, // ........U....... - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x02, 0x00, // ............U... - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x58, 0x00, // ..............X. - 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, // ................ - 0x55, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x90, 0x00, 0x08, // U.B............. - 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xc6, 0x80, 0x00, 0x00, // ................ - 0xe4, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x02, 0x00, 0x90, 0x90, 0x5c, 0x00, // ..[............. - 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x0e, 0x80, 0x00, 0x00, 0xe4, 0x8b, 0x01, 0x00, 0x90, 0x8b, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, // ....U........... - 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // U...........U... - 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, // U...........U... - 0x00, 0xa1, 0x03, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x81, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, // ................ - 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // U............... - 0x04, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x01, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x14, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x03, 0x00, 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ....U........... - 0x04, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, // ................ - 0x07, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, // ................ - 0xe4, 0x81, 0x00, 0x00, 0xe4, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, // ................ - 0xaa, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, // ....U........... - 0x08, 0x80, 0x01, 0x00, 0xff, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, // ................ - 0xff, 0xa0, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0xff, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, // ....U........... - 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x00, 0x00, // ........U....... - 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, // ............U... - 0xf4, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, // ........U....... - 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, // ................ - 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x03, 0x00, // ............U... - 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // ............U... - 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0xff, 0x90, 0x2b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, // ..+........ + 0x00, 0x00, 0x72, 0x01, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x85, 0x00, // ..r...u...`..... + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0xca, 0x01, // ..........d..... + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........y..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x88, 0x00, // ..2.......h..... + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........{..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x88, 0x00, // ..2...f...h..... + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........}..... + 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x60, 0x01, // ..1...y...{...`. + 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x7d, 0x01, // ..P...........}. + 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..}...}...O..... + 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, // ..........O..... + 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, // ................ + 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x81, 0x01, // ................ + 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, // ................ + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x77, 0x01, 0x00, 0x00, 0x87, 0x01, // ..........w..... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0xb3, 0x01, // ..Q............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8a, 0x01, // ......Q......... + 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........Q..... + 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, // ..............P. + 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x8a, 0x01, // ................ + 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x8e, 0x01, // ................ + 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x8e, 0x01, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, // ................ + 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x8c, 0x01, // ......G...8..... + 0x00, 0x00, 0x48, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xff, 0x00, 0x00, 0x00, 0xcb, 0x01, // ..H...>......... + 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ......8....... }; -static const uint8_t fs_font_distance_field_outline_image_dx11[1799] = +static const uint8_t fs_font_distance_field_outline_image_dx11[1798] = { - 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x08, 0x75, // FSH....n.......u + 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x75, // FSH....n.......u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // _params......... 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, // ..s_texColor0... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x06, 0x00, 0x00, 0x44, // r0.............D - 0x58, 0x42, 0x43, 0x5e, 0xe4, 0x19, 0x72, 0x85, 0x68, 0x9d, 0x02, 0x8d, 0xb2, 0x00, 0xf7, 0x75, // XBC^..r.h......u - 0x7c, 0x41, 0x99, 0x01, 0x00, 0x00, 0x00, 0xb4, 0x06, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // |A............., - 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x9c, // ...........ISGN. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x07, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x07, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, // ...SV_POSITION.C - 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, // OLOR.TEXCOORD..O - 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, // SGN,........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, // .......SV_TARGET - 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xa8, 0x05, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x6a, // ...SHDR....@...j - 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...Y...F. ...... - 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, // ...Z....`......X - 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, // 0...p......UU..b - 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, // ...........b...r - 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, // .......b........ - 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x65, // ...b...r.......e - 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, // .... ......h.... - 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ...i............ - 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......r.......F - 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........@....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, // ...........<.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ................ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......<........ - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ...*............ - 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, // ...............E - 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x04, // ...........F.... - 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, // ...F~.......`... - 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // ...8.... ......: - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, // .......:.......6 - 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ...r ......F.... - 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x09, 0xf2, // ...>.......E.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, // .......F.......F - 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // ~.......`......2 - 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x03, // ...........:.... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@.....@.@... - 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, // ..?............. - 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, // .......6....0 .. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // .......*.......6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ....0 .......... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, // .......6....0 .. - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, // ....0 .........: - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......6........ - 0x00, 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, // ....0 .......... - 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ................ - 0x19, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, // ...........r.... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, // ...F............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, // .......V........ - 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, // ................ - 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, // ...........K..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...............8 - 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ..."............ - 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ..... .........8 - 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ...B............ - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x32, 0x00, 0x00, 0x0b, 0x42, // ....@....5A2...B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // .......:. .A.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......*........ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x00, // @.....?2........ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......A........ - 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // @....5A*.......2 - 0x00, 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ...B............ - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, // ....@....5A*.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // .......B.......: - 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, // ...A.......*.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // ...............: - 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ...A............ - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // .......B........ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, // @.....?...?...?. - 0x00, 0x80, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x42, // ..?*.......8 ..B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // .......*.......: - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x82, 0x00, 0x10, 0x00, 0x00, // .......2........ - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, // ...*........@... - 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x42, // ....@....@@8...B - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // .......*.......* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, // .......8...B.... - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, // ...*.......:.... - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ...2............ - 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, // ...A........@... - 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, // .5A.@.....?2..." - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, // @....5A.@.....?. - 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x80, 0x41, // ...2...........A - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, // .......F........ - 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ..."........@... - 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, // ..?...?...?...?. - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......8 ....... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...2..."........ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, // ........@....... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // @....@@8........ - 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...8............ - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, // ...r.......F.... - 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, // ...F...A.......2 - 0x00, 0x00, 0x09, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, // ...r ........... - 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, // ...F.......F.... - 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...8.... ......* - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, // .......:.......> - 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ....... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x06, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xd1, 0x13, // ..........DXBC.. + 0xb8, 0x08, 0xdc, 0x9f, 0xf5, 0x40, 0x88, 0x26, 0x92, 0x79, 0x95, 0x27, 0x87, 0x61, 0x01, 0x00, // .....@.&.y.'.a.. + 0x00, 0x00, 0xc8, 0x06, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xd0, 0x00, // ..........,..... + 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x9c, 0x00, 0x00, 0x00, 0x05, 0x00, // ......ISGN...... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x8c, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00, 0x00, 0x92, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00, 0x00, 0x53, 0x56, // ..............SV + 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, // _POSITION.COLOR. + 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, // TEXCOORD..OSGN,. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................ + 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, // ..SV_TARGET...SH + 0x45, 0x58, 0xbc, 0x05, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x6a, 0x08, // EX....P...o...j. + 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..Y...F. ....... + 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, // ..Z....`......X0 + 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, // ...p......UU..b. + 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, // ..........b...r. + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, // ......b......... + 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x65, 0x00, // ..b...r.......e. + 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, // ... ......h..... + 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // ..i............. + 0x00, 0x00, 0x18, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, // ......r.......F. + 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......@........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, // ..........<..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......<......... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..*............. + 0x00, 0x00, 0x1f, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, // ..............E. + 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......CU........ + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, // ..F.......F~.... + 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, // ...`......8.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, // ......:.......:. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, // ......6...r .... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, 0x00, // ..F.......>..... + 0x00, 0x01, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, // ..E.......CU.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, // ......F.......F~ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // .......`......2. + 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x03, 0x00, // ..........:..... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@.....@.@.... + 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, // .?.............. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, // ......6....0 ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ......*.......6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, // ...0 ........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, // ......6....0 ... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, // ...0 .........:. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......6......... + 0x00, 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, // ...0 ........... + 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, // ..z............. + 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......|...r..... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xe2, 0x00, // ..F............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, // ......V......... + 0x00, 0x00, 0x06, 0x09, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ................ + 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x22, 0x00, // ..........K...". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // ..............8. + 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // .... .........8. + 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..B............. + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x32, 0x00, 0x00, 0x0b, 0x42, 0x00, // ...@....5A2...B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ......:. .A..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......*........@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?2......... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ......A........@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ....5A*.......2. + 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..B............. + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ...@....5A*..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ......B.......:. + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..A.......*..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ..............:. + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..A............. + 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ......B........@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // .....?...?...?.. + 0x80, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x42, 0x00, // .?*.......8 ..B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ......*.......:. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..*........@.... + 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, // ...@....@@8...B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ......*.......*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8...B..... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..*.......:..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..2............. + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xf3, 0x04, // ..A........@.... + 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, // 5A.@.....?2...". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@ + 0x00, 0x00, 0xf3, 0x04, 0x35, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // ....5A.@.....?.. + 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x80, 0x41, 0x00, // ..2...........A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // ......F......... + 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // .."........@.... + 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, // .?...?...?...?.. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8 ........ + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..2..."......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, // .......@.......@ + 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ....@@8......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..8............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, // ..r.......F..... + 0x00, 0x00, 0x46, 0x12, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F...A.......2. + 0x00, 0x09, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, // ..r ............ + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, // ..F.......F..... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ..8.... ......*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......:.......>. + 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ...... }; -static const uint8_t fs_font_distance_field_outline_image_mtl[2630] = +static const uint8_t fs_font_distance_field_outline_image_mtl[2813] = { 0x46, 0x53, 0x48, 0x0b, 0x94, 0xf7, 0xae, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x11, 0x73, // FSH....n.......s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler @@ -609,7 +536,7 @@ static const uint8_t fs_font_distance_field_outline_image_mtl[2630] = 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, // .......u_params. 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // ..........s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x09, // olor............ + 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x0a, // olor............ 0x00, 0x00, 0x23, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x20, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x20, // ..#pragma clang 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, // diagnostic ignor 0x65, 0x64, 0x20, 0x22, 0x2d, 0x57, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2d, 0x70, 0x72, // ed "-Wmissing-pr @@ -707,7 +634,7 @@ static const uint8_t fs_font_distance_field_outline_image_mtl[2630] = 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, // er(0)]]).{. x 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, // latMtlMain_out o 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ut = {};. flo - 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x35, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, // at4 _455;. do + 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x35, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, // at4 _459;. do 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, // . {. i 0x66, 0x20, 0x28, 0x61, 0x6e, 0x79, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // f (any(in.v_texc 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x66, 0x6c, 0x6f, // oord0.xyz == flo @@ -718,7 +645,7 @@ static const uint8_t fs_font_distance_field_outline_image_mtl[2630] = 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, // (s_texColorSampl 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // er, in.v_texcoor 0x64, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // d1.xyz);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x35, 0x35, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // _455 = floa + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x35, 0x39, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // _459 = floa 0x74, 0x34, 0x28, 0x5f, 0x34, 0x32, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x5f, 0x34, 0x32, // t4(_420.xyz, _42 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // 0.w * in.v_color 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0.w);. @@ -729,45 +656,56 @@ static const uint8_t fs_font_distance_field_outline_image_mtl[2630] = 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, // ColorSampler, in 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, // .v_texcoord0.xyz 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x5f, // );. int _ - 0x33, 0x33, 0x37, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // 337 = int((in.v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, // texcoord0.w * 4. - 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 0) + 0.5);. - 0x20, 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x41, 0x72, 0x72, 0x61, // spvUnsafeArra - 0x79, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x34, 0x3e, 0x20, 0x5f, 0x32, 0x39, 0x34, // y _294 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x39, 0x34, 0x5b, 0x30, // ;. _294[0 - 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x32, 0x39, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ] = _429.z;. - 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x39, 0x34, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, // _294[1] = _4 - 0x32, 0x39, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, // 29.y;. _2 - 0x39, 0x34, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x32, 0x39, 0x2e, 0x78, 0x3b, 0x0a, // 94[2] = _429.x;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x39, 0x34, 0x5b, 0x33, 0x5d, 0x20, // _294[3] - 0x3d, 0x20, 0x5f, 0x34, 0x32, 0x39, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _429.w;. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x33, 0x36, 0x31, 0x20, 0x3d, 0x20, 0x28, // float _361 = ( + 0x33, 0x33, 0x37, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x69, 0x6e, // 337 = int(fma(in + 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x2c, 0x20, // .v_texcoord0.w, + 0x34, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 4.0, 0.5));. + 0x20, 0x20, 0x20, 0x20, 0x73, 0x70, 0x76, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x41, 0x72, 0x72, // spvUnsafeArr + 0x61, 0x79, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x34, 0x3e, 0x20, 0x5f, 0x32, 0x39, // ay _29 + 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x39, 0x34, 0x5b, // 4;. _294[ + 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x32, 0x39, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 0] = _429.z;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x39, 0x34, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x5f, // _294[1] = _ + 0x34, 0x32, 0x39, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // 429.y;. _ + 0x32, 0x39, 0x34, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x32, 0x39, 0x2e, 0x78, 0x3b, // 294[2] = _429.x; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x39, 0x34, 0x5b, 0x33, 0x5d, // . _294[3] + 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x32, 0x39, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // = _429.w;. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x33, 0x35, 0x36, 0x20, 0x3d, 0x20, // float _356 = 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, 0x28, 0x69, 0x6e, // length(fwidth(in 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, // .v_texcoord0.xyz - 0x29, 0x29, 0x20, 0x2a, 0x20, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, // )) * 11.31370830 - 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x37, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // 5358887) * _mtl_ - 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, // u.u_params.y;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x33, 0x36, 0x37, // float _367 - 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // = 0.5 - (_mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x5f, 0x33, // .u_params.w * _3 - 0x36, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x35, // 61);. _45 - 0x35, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x6d, 0x69, 0x78, 0x28, 0x69, // 5 = float4(mix(i - 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, // n.v_color1.xyz, - 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, // in.v_color0.xyz, - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, // float3(smoothst - 0x65, 0x70, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x5f, 0x33, 0x36, 0x31, 0x2c, 0x20, 0x30, // ep(0.5 - _361, 0 - 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x33, 0x36, 0x31, 0x2c, 0x20, 0x5f, 0x32, 0x39, 0x34, 0x5b, // .5 + _361, _294[ - 0x5f, 0x33, 0x33, 0x37, 0x5d, 0x29, 0x29, 0x29, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, // _337]))), smooth - 0x73, 0x74, 0x65, 0x70, 0x28, 0x5f, 0x33, 0x36, 0x37, 0x20, 0x2d, 0x20, 0x5f, 0x33, 0x36, 0x31, // step(_367 - _361 - 0x2c, 0x20, 0x5f, 0x33, 0x36, 0x37, 0x20, 0x2b, 0x20, 0x5f, 0x33, 0x36, 0x31, 0x2c, 0x20, 0x5f, // , _367 + _361, _ - 0x32, 0x39, 0x34, 0x5b, 0x5f, 0x33, 0x33, 0x37, 0x5d, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, // 294[_337]) * in. - 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // v_color0.w);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // break;. - 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, // } while(false);. - 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, // out.bgfx_Fra - 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x35, 0x35, 0x3b, 0x0a, 0x20, // gData0 = _455;. - 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, // return out;.} - 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // ....0. + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // ));. floa + 0x74, 0x20, 0x5f, 0x33, 0x35, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x35, 0x36, 0x20, 0x2a, 0x20, // t _358 = _356 * + 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, // 11.3137083053588 + 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 8671875;. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x33, 0x36, 0x37, 0x20, 0x3d, 0x20, 0x66, 0x6d, // float _367 = fm + 0x61, 0x28, 0x2d, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // a(-_mtl_u.u_para + 0x6d, 0x73, 0x2e, 0x77, 0x2c, 0x20, 0x5f, 0x33, 0x35, 0x38, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, // ms.w, _358 * _mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, // l_u.u_params.y, + 0x30, 0x2e, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, // 0.5);. _4 + 0x35, 0x39, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x6d, 0x69, 0x78, 0x28, // 59 = float4(mix( + 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x2c, // in.v_color1.xyz, + 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, // in.v_color0.xyz + 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, // , float3(smooths + 0x74, 0x65, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x33, 0x35, 0x36, 0x20, 0x2a, 0x20, 0x28, // tep(fma(_356 * ( + 0x2d, 0x31, 0x31, 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, // -11.313708305358 + 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // 88671875), _mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, // u.u_params.y, 0. + 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x33, 0x35, 0x38, 0x2c, 0x20, 0x5f, 0x6d, // 5), fma(_358, _m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, // tl_u.u_params.y, + 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x32, 0x39, 0x34, 0x5b, 0x5f, 0x33, 0x33, 0x37, // 0.5), _294[_337 + 0x5d, 0x29, 0x29, 0x29, 0x2c, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, // ]))), smoothstep + 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x33, 0x35, 0x36, 0x20, 0x2a, 0x20, 0x28, 0x2d, 0x31, 0x31, // (fma(_356 * (-11 + 0x2e, 0x33, 0x31, 0x33, 0x37, 0x30, 0x38, 0x33, 0x30, 0x35, 0x33, 0x35, 0x38, 0x38, 0x38, 0x36, // .313708305358886 + 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // 71875), _mtl_u.u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x33, 0x36, 0x37, 0x29, // _params.y, _367) + 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x33, 0x35, 0x38, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // , fma(_358, _mtl + 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x2c, 0x20, 0x5f, // _u.u_params.y, _ + 0x33, 0x36, 0x37, 0x29, 0x2c, 0x20, 0x5f, 0x32, 0x39, 0x34, 0x5b, 0x5f, 0x33, 0x33, 0x37, 0x5d, // 367), _294[_337] + 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // ) * in.v_color0. + 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, // w);. brea + 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, // k;. } while(f + 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, // alse);. out.b + 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, // gfx_FragData0 = + 0x5f, 0x34, 0x35, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, // _459;. return + 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // out;.}....0. }; extern const uint8_t* fs_font_distance_field_outline_image_pssl; extern const uint32_t fs_font_distance_field_outline_image_pssl_size; diff --git a/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h b/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h index bc896013..9e682cde 100644 --- a/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h +++ b/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h @@ -156,353 +156,285 @@ static const uint8_t fs_font_distance_field_subpixel_essl[1276] = 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // tmpvar_7 * v_col 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // or0.w);.}... }; -static const uint8_t fs_font_distance_field_subpixel_spv[1855] = +static const uint8_t fs_font_distance_field_subpixel_spv[1823] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // _texColor0...... - 0x04, 0x1a, 0x00, 0x14, 0x07, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, // .........#...... - 0x00, 0x08, 0x00, 0x4c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ...L............ + 0x04, 0x22, 0x00, 0xf4, 0x06, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, // .".......#...... + 0x00, 0x08, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ..._............ 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, // ...........GLSL. 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, // std.450......... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0xa4, // ...main......... - 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, // ................ - 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......#...s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, // ColorSampler.... - 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...&...s_texColo - 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0xa1, // rTexture........ - 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, // ...gl_FragCoord. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ...........v_col - 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x76, // or0............v - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0xb4, // _texcoord0...... - 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData - 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...#...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...#...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...&...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G...&...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............ - 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ - 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ..."...........; - 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ..."...#....... - 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...%...........; - 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, // ...%...&........ - 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1b, // ...)... ........ - 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...2.......+.... - 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...I......@+.... - 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...K......?+.... - 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0xc1, 0xaa, 0x2a, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...X.....*>+.... - 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x20, 0x00, 0x04, 0x00, 0xa0, // ..........A .... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xa0, // ...........;.... - 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xa0, // ...........;.... - 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xa0, // ...........;.... - 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xb3, // ........... .... - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb3, // ...........;.... - 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x0d, // ................ - 0x00, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, // ...K...6........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, // ................ - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, // ...=.......$...# - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, // ...=.......'...& - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xa4, // ...=............ - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xa7, // ...=............ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xa8, // ...Q............ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe2, // ................ - 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, // .......I........ - 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x6e, // ...........K...n - 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x4f, // ...)...........O - 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xa8, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, 0xae, // ...main......... + 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, // ................ + 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, // .......main..... + 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...#...s_texColo + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x26, // rSampler.......& + 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, // ...s_texColorTex + 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xab, 0x00, 0x00, 0x00, 0x76, // ture...........v + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xae, // _color0......... + 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, // ...v_texcoord0.. + 0x00, 0x06, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // .......bgfx_Frag + 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, // Data0..G...#..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, // .......G...#...! + 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, // .......G...&..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, // .......G...&...! + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xab, 0x00, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xae, 0x00, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, // ...............! + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, // ................ + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, // ........... .... + 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ... ..."........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...;..."...#.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ... ...%........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, // ...;...%...&.... + 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, // .......)... .... + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, // .......2.......+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x2b, // .......I......@+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, // .......K......?+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0xc1, 0xaa, 0x2a, 0x3e, 0x2b, // .......X.....*>+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x20, // ..............A + 0x00, 0x04, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, // ...............; + 0x00, 0x04, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, // ...............; + 0x00, 0x04, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, // ...............; + 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x36, // .......^.......6 + 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=.... + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...$...#...=.... + 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, // ...'...&...=.... + 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, // ...........=.... + 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, // ...............2 + 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x6e, // .......I...K...n + 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x4f, // ...)...........O + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xaf, // ................ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xcf, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x4f, // ...............O - 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xa8, // ................ + 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x4f, // ...............O + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xaf, // ................ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x7f, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xd0, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x8e, // ................ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x58, // ...............X - 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0xa8, // ...O............ - 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0xef, // ................ - 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf3, // .......O........ - 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf5, // ................ - 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, // ...........V...2 - 0x00, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, // ...1...'...$...W - 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0xf1, // .......3...1.... - 0x00, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x33, // ...O...........3 - 0x01, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ...3............ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfb, // .......M........ - 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, // ...........V...2 - 0x00, 0x00, 0x00, 0x3a, 0x01, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, // ...:...'...$...W - 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x3a, 0x01, 0x00, 0x00, 0xf5, // .......<...:.... - 0x00, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x3c, // ...O...........< - 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ...<............ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, // .......M........ - 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x85, // ................ - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x04, // ...........K.... - 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, // ...B............ - 0x00, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0xeb, // ...........B.... - 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x07, // ................ - 0x01, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0d, // ................ - 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x00, 0x00, 0x50, // .......K.......P - 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0f, // ................ - 0x01, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x12, // ................ - 0x01, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, // ...K.......P.... - 0x00, 0x00, 0x00, 0x13, 0x01, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x12, // ................ - 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0xfb, // ...P............ - 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x10, // ...........1.... - 0x01, 0x00, 0x00, 0x13, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x8e, // ................ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x1b, // ................ - 0x01, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x4b, // ...O...........K - 0x01, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, // ................ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x21, // .......Q.......! - 0x01, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x21, 0x01, 0x00, 0x00, 0x52, // ...".......!...R - 0x00, 0x06, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x1e, // .......I...".... - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x49, // .......>.......I + 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xd0, // ................ + 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x8e, // ................ + 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x58, // ...............X + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0xaf, // ...O............ + 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf6, // ................ + 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xfa, // .......O........ + 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xfc, // ................ + 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, // ...........V...2 + 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, // ...<...'...$...W + 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3e, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0xf8, // .......>...<.... + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x3e, // ...O...........> + 0x01, 0x00, 0x00, 0x3e, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ...>............ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, // .......M........ + 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, // ...........V...2 + 0x00, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, // ...E...'...$...W + 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0xfc, // .......G...E.... + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x47, // ...O...........G + 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ...G............ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, // .......M........ + 0x01, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x85, // ................ + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x0b, // ...........K.... + 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, // ...B............ + 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0xf2, // ...........B.... + 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x01, 0x00, 0x00, 0x0e, // ................ + 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, // ................ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x5e, 0x01, 0x00, 0x00, 0x13, // .......2...^.... + 0x01, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x17, // ...K...P........ + 0x01, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, // ...............2 + 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x13, 0x01, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x50, // ...........K...P + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x19, // ................ + 0x01, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1e, // .......P........ + 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1f, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, // ...............1 + 0x00, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x03, // ......."........ + 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x23, 0x01, 0x00, 0x00, 0x1f, // ...........#.... + 0x01, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x25, // ..."...Q.......% + 0x01, 0x00, 0x00, 0x23, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...#.......Q.... + 0x00, 0x00, 0x00, 0x27, 0x01, 0x00, 0x00, 0x23, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, // ...'...#.......Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x29, 0x01, 0x00, 0x00, 0x23, 0x01, 0x00, 0x00, 0x02, // .......)...#.... + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0xac, // ...Q.......,.... + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2d, // ...............- + 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, // .......,...P.... + 0x00, 0x00, 0x00, 0x5d, 0x01, 0x00, 0x00, 0x25, 0x01, 0x00, 0x00, 0x27, 0x01, 0x00, 0x00, 0x29, // ...]...%...'...) + 0x01, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x5d, // ...-...>.......] 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // .......8....... }; -static const uint8_t fs_font_distance_field_subpixel_dx9[904] = +static const uint8_t fs_font_distance_field_subpixel_dx11[1335] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, // ...`......... .C - 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, // TAB....S........ - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, // ...........L...0 - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, // ...........<.... - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, // ...s_texColor... - 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, // ...............p - 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, // s_3_0.Microsoft - 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, // (R) HLSL Shader - 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, // Compiler 10.1..Q - 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, // ..........@...?. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, // ......?Q........ - 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, // .............@.Q - 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x00, // .............@@. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xc1, // .......Q........ - 0xaa, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, // .*>...A...?..... - 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x08, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, // ................ - 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, // ................ - 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, // ................ - 0x00, 0x00, 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, // .....U.......... - 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, // ...X.........U.. - 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, // ................ - 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, // .....U.X........ - 0x00, 0x00, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, // .........U...... - 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, // ...........X.... - 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x5b, // ...............[ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x04, 0x00, 0x00, 0x04, 0x02, // ................ - 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x01, 0x00, 0xe4, 0x90, 0x42, // ...............B - 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, // ................ - 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80, 0x02, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x04, // ................ - 0x00, 0x00, 0x04, 0x03, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x01, // ................ - 0x00, 0xe4, 0x90, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x07, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x06, // ................ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x42, 0x00, 0x00, 0x03, 0x03, // ...........B.... - 0x00, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x02, // ................ - 0x00, 0x04, 0x80, 0x03, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x01, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, // ................ - 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, // .........U...... - 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x91, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x06, // ................ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, // ................ - 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa1, 0x03, 0x00, 0xaa, 0xa0, 0x04, // .........U...... - 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x03, // .............U.. - 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, // .............U.. - 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x55, 0x81, 0x02, // .............U.. - 0x00, 0x90, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x02, 0x00, 0x55, 0x80, 0x00, // .............U.. - 0x00, 0xff, 0x90, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x17, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x04, // ................ - 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, // ................ - 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, // .U.............. - 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, // ................ - 0x00, 0xff, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ........ -}; -static const uint8_t fs_font_distance_field_subpixel_dx11[1336] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, // ....s_texColor0. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x04, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0x72, 0x17, 0x00, 0xad, 0x3a, 0xed, 0x4a, 0x16, 0x14, 0x58, 0xdb, 0x06, 0xdf, 0x01, 0x0f, 0x39, // r...:.J..X.....9 - 0x01, 0x00, 0x00, 0x00, 0xf8, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... - 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl... - 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... - 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ - 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x0f, 0x08, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ - 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN - 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET... - 0x53, 0x48, 0x44, 0x52, 0x1c, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, // SHDR....@....... - 0x35, 0x18, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, // 5..........?.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // ...............? + 0x00, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x5e, 0x55, 0x47, 0x7d, 0x6a, // .......DXBC^UG}j + 0xf7, 0xaf, 0x89, 0x57, 0x10, 0x54, 0xfa, 0xcd, 0x0e, 0xcd, 0x87, 0x01, 0x00, 0x00, 0x00, 0x0c, // ...W.T.......... + 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, // .......,........ + 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, // ...ISGNl........ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, // ...P............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x08, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...b............ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO + 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX + 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // COORD..OSGN,.... + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S + 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x30, // V_TARGET...SHEX0 + 0x04, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x35, // ...P.......j...5 + 0x18, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........?..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, // ..............?. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, // .......?Z....`.. - 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....X0...p...... - 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x82, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // UU..b........... - 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...........e... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, // . ......h....... - 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, // 2...........:... - 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, // .....@.....@.@.. - 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?............ - 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0d, // ............2... - 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // r...........A... - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, // .....@....*>..*> - 0xc1, 0xaa, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ..*>....F....... - 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // E...........F... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, // ....F~.......`.. - 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x66, 0x0c, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x9e, 0x90, 0x00, 0x0a, 0x00, 0x10, 0x00, // f.......F....... - 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....2...r....... - 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xc1, 0xaa, 0x2a, 0x3e, // .........@....*> - 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, // ..*>..*>....F... - 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........"....... - 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // E...........F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, // ....F~.......`.. - 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........B....... - 0x66, 0x0c, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x9e, 0x90, 0x00, 0x0a, 0x00, 0x10, 0x00, // f.......F....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // *............... - 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // 8..."........... - 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x00, 0x00, 0x06, // .....@.....?6... - 0xd2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // ............A... - 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0xd2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x06, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....K...2....... - 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // F............... - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2..."....... - 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // ....A........@.. - 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, // ...A.@.....?2... - 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, // .@.....A.@.....? - 0x00, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, // ................ - 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // A............... - 0x00, 0x00, 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x80, // ............V... - 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // A............... - 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 8.... .......... - 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, // ....:........... - 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // .........@.....? - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x0a, 0x00, 0x10, 0x00, // ...?...?...?.... - 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8 ..r....... - 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 2...r.......F... - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, // .....@.......... - 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, // .........@....@@ - 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ..@@..@@....8... - 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r.......F....... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, // F.......8...r... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....F.......F... - 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8...r ...... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x1f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // F............... - 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // >....... + 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..?............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, // ......?Z....`... + 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, // ...X0...p......U + 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x82, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, // U..b...........b + 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ...........e.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x32, // ......h.......2 + 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x02, // ...........:.... + 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, // ....@.....@.@... + 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ..?............. + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, 0x00, // .......z........ + 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0d, 0x72, // ...........2...r + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ...........A.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, // ....@....*>..*>. + 0xaa, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x45, // .*>....F.......E + 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x01, // .......CU....... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, // ...F.......F~... + 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x12, // ....`........... + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x66, 0x0c, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......f.......F + 0x9e, 0x90, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, // ...........2...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // ................ + 0x40, 0x00, 0x00, 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, 0x00, // @....*>..*>..*>. + 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, // ...F..........." + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, // ................ + 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0x82, 0x01, 0x00, 0x80, 0x43, // .......E.......C + 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // U..........F.... + 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, // ...F~.......`... + 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x66, // .......B.......f + 0x0c, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x9e, 0x90, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // .......F........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, // ...............* + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, // ...............8 + 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ..."............ + 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x00, 0x00, 0x06, 0xd2, // ....@.....?6.... + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, // ...........A.... + 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x05, 0xd2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ...|............ + 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...K...2.......F + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...2..."........ + 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, // ...A........@... + 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, 0x12, // ..A.@.....?2.... + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, // @.....A.@.....?. + 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, // ...............A + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x80, 0x41, // ...........V...A + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, // ...............8 + 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x01, // .... ........... + 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x12, // ...:............ + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, // ........@.....?. + 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x0a, 0x00, 0x10, 0x00, 0x00, // ..?...?...?..... + 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ...8 ..r........ + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // ...............2 + 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, // ....@........... + 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, // ........@....@@. + 0x00, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, // .@@..@@....8...r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......F.......F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, // .......8...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...F.......F.... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...8...r ......F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x1f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, // ...............> + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ....... }; -static const uint8_t fs_font_distance_field_subpixel_mtl[1262] = +static const uint8_t fs_font_distance_field_subpixel_mtl[1168] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x11, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x04, 0x00, 0x00, 0x23, // r..............# + 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x04, 0x00, 0x00, 0x23, // r..........-...# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, // include .#include 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, // ..u 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, // sing namespace m - 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, // etal;..constant - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x33, 0x32, 0x38, 0x20, 0x3d, 0x20, 0x7b, 0x7d, // float4 _328 = {} - 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // ;..struct xlatMt - 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // lMain_out.{. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // float4 bgfx_Frag - 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, // Data0 [[color(0) - 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, // ]];.};..struct x - 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, // latMtlMain_in.{. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // float4 v_col - 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, // or0 [[user(locn0 - 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // )]];. float4 - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, // v_texcoord0 [[us - 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // er(locn1)]];.};. - 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // .fragment xlatMt - 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // lMain_out xlatMt - 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // lMain(xlatMtlMai - 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, // n_in in [[stage_ - 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x63, 0x75, 0x62, // in]], texturecub - 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // e s_texCo - 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, // lor [[texture(0) - 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, // ]], sampler s_te - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, 0x5b, // xColorSampler [[ - 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, // sampler(0)]]).{. - 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, // xlatMtlMain_ - 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, // out out = {};. - 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x5f, 0x32, 0x32, 0x35, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, // int _225 = int - 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // ((in.v_texcoord0 - 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, // .w * 4.0) + 0.5) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x32, 0x32, // ;. float3 _22 - 0x38, 0x20, 0x3d, 0x20, 0x64, 0x66, 0x64, 0x78, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // 8 = dfdx(in.v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, // xcoord0.xyz);. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x32, 0x33, 0x34, 0x20, 0x3d, 0x20, // float3 _234 = - 0x5f, 0x32, 0x32, 0x38, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x39, // _228 * 0.1666669 - 0x39, 0x39, 0x34, 0x35, 0x39, 0x32, 0x36, 0x36, 0x36, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 9945926666;. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x34, 0x38, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, // float _248 = s_t - 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, // exColor.sample(s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler - 0x2c, 0x20, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // , (in.v_texcoord - 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2d, 0x20, 0x5f, 0x32, 0x33, 0x34, 0x29, 0x29, 0x2e, 0x7a, // 0.xyz - _234)).z - 0x79, 0x78, 0x77, 0x5b, 0x5f, 0x32, 0x32, 0x35, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // yxw[_225];. f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x35, 0x34, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, // loat _254 = s_te - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, // xColor.sample(s_ - 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, // texColorSampler, - 0x20, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // (in.v_texcoord0 - 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x33, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, // .xyz + _234)).zy - 0x78, 0x77, 0x5b, 0x5f, 0x32, 0x32, 0x35, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // xw[_225];. fl - 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x35, 0x38, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x35, 0x20, 0x2a, // oat _258 = 0.5 * - 0x20, 0x28, 0x5f, 0x32, 0x34, 0x38, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x35, 0x34, 0x29, 0x3b, 0x0a, // (_248 + _254);. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x36, 0x36, 0x20, 0x3d, // float _266 = - 0x20, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x5f, // 8.0 * (length(_ - 0x32, 0x32, 0x38, 0x29, 0x20, 0x2b, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x64, 0x66, // 228) + length(df - 0x64, 0x79, 0x28, 0x2d, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // dy(-in.v_texcoor - 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // d0.xyz)));. f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x32, 0x38, 0x31, 0x20, 0x3d, 0x20, 0x73, 0x6d, 0x6f, // loat3 _281 = smo - 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // othstep(float3(0 - 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x5f, 0x32, 0x36, 0x36, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, // .5 - _266), floa - 0x74, 0x33, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x36, 0x36, 0x29, 0x2c, 0x20, // t3(0.5 + _266), - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x5f, 0x32, 0x34, 0x38, 0x2c, 0x20, 0x5f, 0x32, 0x35, // float3(_248, _25 - 0x38, 0x2c, 0x20, 0x5f, 0x32, 0x35, 0x34, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, // 8, _254)) * in.v - 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // _color0.w;. f - 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x33, 0x32, 0x36, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, // loat4 _326 = flo - 0x61, 0x74, 0x34, 0x28, 0x5f, 0x32, 0x38, 0x31, 0x2e, 0x78, 0x2c, 0x20, 0x5f, 0x32, 0x38, 0x31, // at4(_281.x, _281 - 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x32, 0x38, 0x31, 0x2e, 0x7a, 0x2c, 0x20, 0x5f, 0x33, 0x32, 0x38, // .y, _281.z, _328 - 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x32, 0x36, 0x2e, 0x77, 0x20, // .w);. _326.w - 0x3d, 0x20, 0x5f, 0x32, 0x35, 0x38, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, // = _258 * in.v_co - 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, // lor0.w;. out. - 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, // bgfx_FragData0 = - 0x20, 0x5f, 0x33, 0x32, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, // _326;. retur - 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, 0x00, // n out;.}.... . + 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // etal;..struct xl + 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // float4 bgfx_ + 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, // FragData0 [[colo + 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, // r(0)]];.};..stru + 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, // ct xlatMtlMain_i + 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, // n.{. float4 v + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, // _color0 [[user(l + 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ocn0)]];. flo + 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, // at4 v_texcoord0 + 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, // [[user(locn1)]]; + 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, // .};..fragment xl + 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, // atMtlMain_out xl + 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // atMtlMain(xlatMt + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, // lMain_in in [[st + 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // age_in]], textur + 0x65, 0x63, 0x75, 0x62, 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, // ecube s_t + 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // exColor [[textur + 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, // e(0)]], sampler + 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, // s_texColorSample + 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, // r [[sampler(0)]] + 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // ).{. xlatMtlM + 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, // ain_out out = {} + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x5f, 0x32, 0x33, 0x32, 0x20, 0x3d, // ;. int _232 = + 0x20, 0x69, 0x6e, 0x74, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // int(fma(in.v_te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x2c, 0x20, 0x34, 0x2e, 0x30, 0x2c, 0x20, // xcoord0.w, 4.0, + 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 0.5));. float + 0x33, 0x20, 0x5f, 0x32, 0x33, 0x35, 0x20, 0x3d, 0x20, 0x64, 0x66, 0x64, 0x78, 0x28, 0x69, 0x6e, // 3 _235 = dfdx(in + 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, // .v_texcoord0.xyz + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x32, // );. float3 _2 + 0x34, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x32, 0x33, 0x35, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x31, 0x36, // 41 = _235 * 0.16 + 0x36, 0x36, 0x36, 0x36, 0x39, 0x39, 0x39, 0x34, 0x35, 0x39, 0x32, 0x36, 0x36, 0x36, 0x36, 0x32, // 6666999459266662 + 0x35, 0x39, 0x37, 0x36, 0x35, 0x36, 0x32, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // 59765625;. fl + 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x35, 0x35, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, // oat _255 = s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, // Color.sample(s_t + 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, // exColorSampler, + 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // (in.v_texcoord0. + 0x78, 0x79, 0x7a, 0x20, 0x2d, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, // xyz - _241)).zyx + 0x77, 0x5b, 0x5f, 0x32, 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // w[_232];. flo + 0x61, 0x74, 0x20, 0x5f, 0x32, 0x36, 0x31, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // at _261 = s_texC + 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, // olor.sample(s_te + 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x28, // xColorSampler, ( + 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, // in.v_texcoord0.x + 0x79, 0x7a, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x34, 0x31, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, // yz + _241)).zyxw + 0x5b, 0x5f, 0x32, 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // [_232];. floa + 0x74, 0x20, 0x5f, 0x32, 0x36, 0x35, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x35, 0x20, 0x2a, 0x20, 0x28, // t _265 = 0.5 * ( + 0x5f, 0x32, 0x35, 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x36, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, // _255 + _261);. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x37, 0x32, 0x20, 0x3d, 0x20, 0x6c, // float _272 = l + 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x5f, 0x32, 0x33, 0x35, 0x29, 0x20, 0x2b, 0x20, 0x6c, 0x65, // ength(_235) + le + 0x6e, 0x67, 0x74, 0x68, 0x28, 0x64, 0x66, 0x64, 0x79, 0x28, 0x2d, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // ngth(dfdy(-in.v_ + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x3b, // texcoord0.xyz)); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // . out.bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // agData0 = float4 + 0x28, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x66, 0x6c, 0x6f, 0x61, // (smoothstep(floa + 0x74, 0x33, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x2d, 0x38, 0x2e, 0x30, 0x2c, 0x20, 0x5f, 0x32, 0x37, // t3(fma(-8.0, _27 + 0x32, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // 2, 0.5)), float3 + 0x28, 0x66, 0x6d, 0x61, 0x28, 0x38, 0x2e, 0x30, 0x2c, 0x20, 0x5f, 0x32, 0x37, 0x32, 0x2c, 0x20, // (fma(8.0, _272, + 0x30, 0x2e, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x5f, 0x32, // 0.5)), float3(_2 + 0x35, 0x35, 0x2c, 0x20, 0x5f, 0x32, 0x36, 0x35, 0x2c, 0x20, 0x5f, 0x32, 0x36, 0x31, 0x29, 0x29, // 55, _265, _261)) + 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, // * in.v_color0.w + 0x2c, 0x20, 0x5f, 0x32, 0x36, 0x35, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, // , _265 * in.v_co + 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, // lor0.w);. ret + 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, 0x00, // urn out;.}.... . }; extern const uint8_t* fs_font_distance_field_subpixel_pssl; extern const uint32_t fs_font_distance_field_subpixel_pssl_size; diff --git a/bgfx/examples/common/font/makefile b/bgfx/examples/common/font/makefile index 9fe95f71..b4a4e8b3 100644 --- a/bgfx/examples/common/font/makefile +++ b/bgfx/examples/common/font/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/common/font/utf8.cpp b/bgfx/examples/common/font/utf8.cpp index 105a52ee..de685ef8 100644 --- a/bgfx/examples/common/font/utf8.cpp +++ b/bgfx/examples/common/font/utf8.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2008-2009 Bjoern Hoehrmann // See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details. // -// Permission is hereby granted, free of charge, to any person obtaining a +// Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, diff --git a/bgfx/examples/common/font/vs_font_basic.bin.h b/bgfx/examples/common/font/vs_font_basic.bin.h index e064cae3..d90909b9 100644 --- a/bgfx/examples/common/font/vs_font_basic.bin.h +++ b/bgfx/examples/common/font/vs_font_basic.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_font_basic_glsl[397] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........`...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........`...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec2 a_position;. @@ -30,7 +30,7 @@ static const uint8_t vs_font_basic_essl[439] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // bute highp vec2 @@ -60,9 +60,9 @@ static const uint8_t vs_font_basic_essl[439] = static const uint8_t vs_font_basic_spv[1218] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........l....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........l....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, // ................ @@ -137,38 +137,13 @@ static const uint8_t vs_font_basic_spv[1218] = 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, // ....8........... 0x40, 0x00, // @. }; -static const uint8_t vs_font_basic_dx9[337] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........$....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, // ................ - 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................ - 0x00, // . -}; -static const uint8_t vs_font_basic_dx11[590] = +static const uint8_t vs_font_basic_dx11[594] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0xe3, 0x5d, 0xf0, 0xa8, 0xb3, 0x95, 0xec, 0x3a, 0x48, 0x51, 0xb3, 0xab, 0xaf, 0x69, 0xf9, 0x66, // .].....:HQ...i.f - 0x01, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC + 0x67, 0x2e, 0xf2, 0x76, 0x33, 0x6c, 0xd0, 0x30, 0xc6, 0x42, 0xd6, 0x1f, 0x81, 0x66, 0x83, 0xe6, // g..v3l.0.B...f.. + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, // ........ISGNh... 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -183,30 +158,31 @@ static const uint8_t vs_font_basic_dx11[590] = 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...@...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........_...2... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._........... - 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // g.... .......... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // F............ .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. . - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... - 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // . ......F....... - 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // >...........@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x04, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x41, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...A...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // 2......._....... + 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ....F........... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // F. .........6... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... + 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, // ....>........... + 0x40, 0x00, // @. }; -static const uint8_t vs_font_basic_mtl[847] = +static const uint8_t vs_font_basic_mtl[895] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........I...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -216,6 +192,9 @@ static const uint8_t vs_font_basic_mtl[847] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/font/vs_font_distance_field.bin.h b/bgfx/examples/common/font/vs_font_distance_field.bin.h index 9cf12044..8fbe184f 100644 --- a/bgfx/examples/common/font/vs_font_distance_field.bin.h +++ b/bgfx/examples/common/font/vs_font_distance_field.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_font_distance_field_glsl[397] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........`...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........`...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec2 a_position;. @@ -30,7 +30,7 @@ static const uint8_t vs_font_distance_field_essl[439] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // bute highp vec2 @@ -60,9 +60,9 @@ static const uint8_t vs_font_distance_field_essl[439] = static const uint8_t vs_font_distance_field_spv[1218] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........l....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........l....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, // ................ @@ -137,38 +137,13 @@ static const uint8_t vs_font_distance_field_spv[1218] = 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, // ....8........... 0x40, 0x00, // @. }; -static const uint8_t vs_font_distance_field_dx9[337] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........$....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, // ................ - 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................ - 0x00, // . -}; -static const uint8_t vs_font_distance_field_dx11[590] = +static const uint8_t vs_font_distance_field_dx11[594] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0xe3, 0x5d, 0xf0, 0xa8, 0xb3, 0x95, 0xec, 0x3a, 0x48, 0x51, 0xb3, 0xab, 0xaf, 0x69, 0xf9, 0x66, // .].....:HQ...i.f - 0x01, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC + 0x67, 0x2e, 0xf2, 0x76, 0x33, 0x6c, 0xd0, 0x30, 0xc6, 0x42, 0xd6, 0x1f, 0x81, 0x66, 0x83, 0xe6, // g..v3l.0.B...f.. + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, // ........ISGNh... 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -183,30 +158,31 @@ static const uint8_t vs_font_distance_field_dx11[590] = 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...@...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........_...2... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._........... - 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // g.... .......... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // F............ .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. . - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... - 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // . ......F....... - 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // >...........@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x04, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x41, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...A...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // 2......._....... + 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ....F........... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // F. .........6... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... + 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, // ....>........... + 0x40, 0x00, // @. }; -static const uint8_t vs_font_distance_field_mtl[847] = +static const uint8_t vs_font_distance_field_mtl[895] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........I...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -216,6 +192,9 @@ static const uint8_t vs_font_distance_field_mtl[847] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/font/vs_font_distance_field_drop_shadow.bin.h b/bgfx/examples/common/font/vs_font_distance_field_drop_shadow.bin.h index 7c89d282..e5a489a5 100644 --- a/bgfx/examples/common/font/vs_font_distance_field_drop_shadow.bin.h +++ b/bgfx/examples/common/font/vs_font_distance_field_drop_shadow.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_font_distance_field_drop_shadow_glsl[634] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........M...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........M...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color1;.at @@ -45,7 +45,7 @@ static const uint8_t vs_font_distance_field_drop_shadow_essl[712] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // bute highp vec4 @@ -92,9 +92,9 @@ static const uint8_t vs_font_distance_field_drop_shadow_essl[712] = static const uint8_t vs_font_distance_field_drop_shadow_spv[1700] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x06, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ........h.....#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, 0x00, // ................ @@ -199,44 +199,13 @@ static const uint8_t vs_font_distance_field_drop_shadow_spv[1700] = 0x38, 0x00, 0x01, 0x00, 0x00, 0x06, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, // 8............... 0x12, 0x00, 0x40, 0x00, // ..@. }; -static const uint8_t vs_font_distance_field_drop_shadow_dx9[445] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ................ - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, // ................ - 0x04, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x02, 0x80, 0x05, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, // ................ - 0x02, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0xe0, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x04, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x02, 0x80, 0x05, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ................ - 0x01, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ......U......... - 0x00, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, // ................ - 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x03, 0x00, 0x0f, 0xe0, 0x03, 0x00, 0xe4, 0x90, // ................ - 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, 0x0f, 0xe0, 0x04, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ............. -}; -static const uint8_t vs_font_distance_field_drop_shadow_dx11[872] = +static const uint8_t vs_font_distance_field_drop_shadow_dx11[876] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........,...DXBC - 0x52, 0xfc, 0x6d, 0x4d, 0x40, 0xd5, 0x3b, 0x61, 0x1a, 0x9e, 0xf4, 0x2b, 0xde, 0x55, 0xa6, 0x76, // R.mM@.;a...+.U.v - 0x01, 0x00, 0x00, 0x00, 0x2c, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....,.......,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........0...DXBC + 0xae, 0x48, 0x4a, 0xd1, 0x28, 0x9e, 0x06, 0xfe, 0x68, 0xe6, 0x57, 0xe9, 0x22, 0xe0, 0x0e, 0xe3, // .HJ.(...h.W."... + 0x01, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....0.......,... 0xe4, 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0xb0, 0x00, 0x00, 0x00, // ........ISGN.... 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -260,39 +229,39 @@ static const uint8_t vs_font_distance_field_drop_shadow_dx11[872] = 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x84, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x61, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...a...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........_....... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._...2....... - 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... - 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........_....... - 0x05, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... - 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // . ......e.... .. - 0x04, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, // ....e.... ...... - 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, // h.......8....... - 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....V.......F. . - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // ........2....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....F. ......... - 0x06, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ..... ......F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....F. ......... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....6.... ...... - 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // F.......6.... .. - 0x03, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... - 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, // . ......F....... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x05, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x06, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, // ....>........... - 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, 0x40, 0x00, // ......@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x88, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x62, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...b...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........_...2... + 0x02, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ...._........... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0xf2, 0x10, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, // ........g.... .. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... .. + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... + 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // . ......e.... .. + 0x05, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....h.......8... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........V....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // F. .........2... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F. ..... + 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // F.......6.... .. + 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... + 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // . ......F....... + 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... + 0x04, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x06, 0x05, 0x00, // F.......>....... + 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, 0x40, 0x00, // ..........@. }; -static const uint8_t vs_font_distance_field_drop_shadow_mtl[1306] = +static const uint8_t vs_font_distance_field_drop_shadow_mtl[1354] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x05, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -302,6 +271,9 @@ static const uint8_t vs_font_distance_field_drop_shadow_mtl[1306] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/font/vs_font_distance_field_drop_shadow_image.bin.h b/bgfx/examples/common/font/vs_font_distance_field_drop_shadow_image.bin.h index 1f05ed8a..b9fcb204 100644 --- a/bgfx/examples/common/font/vs_font_distance_field_drop_shadow_image.bin.h +++ b/bgfx/examples/common/font/vs_font_distance_field_drop_shadow_image.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_font_distance_field_drop_shadow_image_glsl[634] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........M...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........M...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color1;.at @@ -45,7 +45,7 @@ static const uint8_t vs_font_distance_field_drop_shadow_image_essl[712] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // bute highp vec4 @@ -92,9 +92,9 @@ static const uint8_t vs_font_distance_field_drop_shadow_image_essl[712] = static const uint8_t vs_font_distance_field_drop_shadow_image_spv[1700] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x06, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ........h.....#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, 0x00, // ................ @@ -199,44 +199,13 @@ static const uint8_t vs_font_distance_field_drop_shadow_image_spv[1700] = 0x38, 0x00, 0x01, 0x00, 0x00, 0x06, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, // 8............... 0x12, 0x00, 0x40, 0x00, // ..@. }; -static const uint8_t vs_font_distance_field_drop_shadow_image_dx9[445] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ................ - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, // ................ - 0x04, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x02, 0x80, 0x05, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, // ................ - 0x02, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0xe0, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x04, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x02, 0x80, 0x05, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ................ - 0x01, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ......U......... - 0x00, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, // ................ - 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x03, 0x00, 0x0f, 0xe0, 0x03, 0x00, 0xe4, 0x90, // ................ - 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, 0x0f, 0xe0, 0x04, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ............. -}; -static const uint8_t vs_font_distance_field_drop_shadow_image_dx11[872] = +static const uint8_t vs_font_distance_field_drop_shadow_image_dx11[876] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........,...DXBC - 0x52, 0xfc, 0x6d, 0x4d, 0x40, 0xd5, 0x3b, 0x61, 0x1a, 0x9e, 0xf4, 0x2b, 0xde, 0x55, 0xa6, 0x76, // R.mM@.;a...+.U.v - 0x01, 0x00, 0x00, 0x00, 0x2c, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....,.......,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........0...DXBC + 0xae, 0x48, 0x4a, 0xd1, 0x28, 0x9e, 0x06, 0xfe, 0x68, 0xe6, 0x57, 0xe9, 0x22, 0xe0, 0x0e, 0xe3, // .HJ.(...h.W."... + 0x01, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....0.......,... 0xe4, 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0xb0, 0x00, 0x00, 0x00, // ........ISGN.... 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -260,39 +229,39 @@ static const uint8_t vs_font_distance_field_drop_shadow_image_dx11[872] = 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x84, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x61, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...a...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........_....... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._...2....... - 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... - 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........_....... - 0x05, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... - 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // . ......e.... .. - 0x04, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, // ....e.... ...... - 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, // h.......8....... - 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....V.......F. . - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // ........2....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....F. ......... - 0x06, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ..... ......F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....F. ......... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....6.... ...... - 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // F.......6.... .. - 0x03, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... - 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, // . ......F....... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x05, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x06, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, // ....>........... - 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, 0x40, 0x00, // ......@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x88, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x62, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...b...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........_...2... + 0x02, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ...._........... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0xf2, 0x10, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, // ........g.... .. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... .. + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... + 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // . ......e.... .. + 0x05, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....h.......8... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........V....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // F. .........2... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F. ..... + 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // F.......6.... .. + 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... + 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // . ......F....... + 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... + 0x04, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x06, 0x05, 0x00, // F.......>....... + 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, 0x40, 0x00, // ..........@. }; -static const uint8_t vs_font_distance_field_drop_shadow_image_mtl[1306] = +static const uint8_t vs_font_distance_field_drop_shadow_image_mtl[1354] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x05, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -302,6 +271,9 @@ static const uint8_t vs_font_distance_field_drop_shadow_image_mtl[1306] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/font/vs_font_distance_field_outline.bin.h b/bgfx/examples/common/font/vs_font_distance_field_outline.bin.h index 5ac1118f..4092bc3d 100644 --- a/bgfx/examples/common/font/vs_font_distance_field_outline.bin.h +++ b/bgfx/examples/common/font/vs_font_distance_field_outline.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_font_distance_field_outline_glsl[551] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color1;.at @@ -40,7 +40,7 @@ static const uint8_t vs_font_distance_field_outline_essl[617] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........<...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........<...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // bute highp vec4 @@ -81,9 +81,9 @@ static const uint8_t vs_font_distance_field_outline_essl[617] = static const uint8_t vs_font_distance_field_outline_spv[1538] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0f, 0x00, // ................ @@ -178,42 +178,13 @@ static const uint8_t vs_font_distance_field_outline_spv[1538] = 0x38, 0x00, 0x01, 0x00, 0x00, 0x05, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, // 8............... 0x40, 0x00, // @. }; -static const uint8_t vs_font_distance_field_outline_dx9[409] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........l....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, // ................ - 0x04, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x0a, 0x00, 0x01, 0x80, 0x02, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, // ................ - 0x03, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x04, 0x00, 0x0f, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, // ................ - 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, // ................ - 0x03, 0x00, 0x0f, 0xe0, 0x03, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, 0x0f, 0xe0, // ................ - 0x04, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......... -}; -static const uint8_t vs_font_distance_field_outline_dx11[778] = +static const uint8_t vs_font_distance_field_outline_dx11[782] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0xb8, 0x03, 0xd3, 0x5a, 0xf9, 0xd3, 0xa7, 0x53, 0x66, 0x63, 0x68, 0xf0, 0xf4, 0x8f, 0xe4, 0x7e, // ...Z...Sfch....~ - 0x01, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC + 0x69, 0x9d, 0x3c, 0xc2, 0x02, 0x5b, 0xac, 0x4c, 0xfc, 0xe6, 0xad, 0x1e, 0x9f, 0x86, 0xe4, 0x9f, // i.<..[.L........ + 0x01, 0x00, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... 0xcc, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x98, 0x00, 0x00, 0x00, // ....p...ISGN.... 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -234,36 +205,36 @@ static const uint8_t vs_font_distance_field_outline_dx11[778] = 0x03, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x58, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x56, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // X...@...V...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........_....... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._...2....... - 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... - 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, // ........g.... .. - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... .. - 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....e.... ...... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // F............ .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. . - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... - 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // . ......F....... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, // ....6.... ...... - 0x46, 0x1e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x05, 0x05, 0x00, // F.......>....... - 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, 0x40, 0x00, // ........@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x5c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x57, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...W...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........_...2... + 0x02, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ...._........... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, // _...........g... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // . ..........e... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // . ......e.... .. + 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ....F........... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // F. .........6... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... + 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // F.......6.... .. + 0x04, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>... + 0x00, 0x05, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, 0x40, 0x00, // ............@. }; -static const uint8_t vs_font_distance_field_outline_mtl[1149] = +static const uint8_t vs_font_distance_field_outline_mtl[1197] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........C...#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........s...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -273,6 +244,9 @@ static const uint8_t vs_font_distance_field_outline_mtl[1149] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/font/vs_font_distance_field_outline_drop_shadow_image.bin.h b/bgfx/examples/common/font/vs_font_distance_field_outline_drop_shadow_image.bin.h index d3138b58..13578347 100644 --- a/bgfx/examples/common/font/vs_font_distance_field_outline_drop_shadow_image.bin.h +++ b/bgfx/examples/common/font/vs_font_distance_field_outline_drop_shadow_image.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_font_distance_field_outline_drop_shadow_image_glsl[634] { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........M...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........M...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color1;.at @@ -45,7 +45,7 @@ static const uint8_t vs_font_distance_field_outline_drop_shadow_image_essl[712] { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // bute highp vec4 @@ -92,9 +92,9 @@ static const uint8_t vs_font_distance_field_outline_drop_shadow_image_essl[712] static const uint8_t vs_font_distance_field_outline_drop_shadow_image_spv[1700] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x06, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ........h.....#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, 0x00, // ................ @@ -199,44 +199,13 @@ static const uint8_t vs_font_distance_field_outline_drop_shadow_image_spv[1700] 0x38, 0x00, 0x01, 0x00, 0x00, 0x06, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, // 8............... 0x12, 0x00, 0x40, 0x00, // ..@. }; -static const uint8_t vs_font_distance_field_outline_drop_shadow_image_dx9[445] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ................ - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, // ................ - 0x04, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x02, 0x80, 0x05, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, // ................ - 0x02, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0xe0, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x04, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x02, 0x80, 0x05, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ................ - 0x01, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ......U......... - 0x00, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, // ................ - 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x03, 0x00, 0x0f, 0xe0, 0x03, 0x00, 0xe4, 0x90, // ................ - 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, 0x0f, 0xe0, 0x04, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x0f, 0xe0, 0x05, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ............. -}; -static const uint8_t vs_font_distance_field_outline_drop_shadow_image_dx11[872] = +static const uint8_t vs_font_distance_field_outline_drop_shadow_image_dx11[876] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........,...DXBC - 0x52, 0xfc, 0x6d, 0x4d, 0x40, 0xd5, 0x3b, 0x61, 0x1a, 0x9e, 0xf4, 0x2b, 0xde, 0x55, 0xa6, 0x76, // R.mM@.;a...+.U.v - 0x01, 0x00, 0x00, 0x00, 0x2c, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....,.......,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........0...DXBC + 0xae, 0x48, 0x4a, 0xd1, 0x28, 0x9e, 0x06, 0xfe, 0x68, 0xe6, 0x57, 0xe9, 0x22, 0xe0, 0x0e, 0xe3, // .HJ.(...h.W."... + 0x01, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....0.......,... 0xe4, 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0xb0, 0x00, 0x00, 0x00, // ........ISGN.... 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -260,39 +229,39 @@ static const uint8_t vs_font_distance_field_outline_drop_shadow_image_dx11[872] 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x84, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x61, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...a...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........_....... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._...2....... - 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... - 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........_....... - 0x05, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... - 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // . ......e.... .. - 0x04, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, // ....e.... ...... - 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, // h.......8....... - 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....V.......F. . - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // ........2....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....F. ......... - 0x06, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ..... ......F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....F. ......... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....6.... ...... - 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // F.......6.... .. - 0x03, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... - 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, // . ......F....... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x05, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x06, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, // ....>........... - 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, 0x40, 0x00, // ......@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x88, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x62, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...b...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........_...2... + 0x02, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ...._........... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0xf2, 0x10, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, // ........g.... .. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... .. + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... + 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // . ......e.... .. + 0x05, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....h.......8... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........V....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // F. .........2... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F. ..... + 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // F.......6.... .. + 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... + 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // . ......F....... + 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... + 0x04, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x06, 0x05, 0x00, // F.......>....... + 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, 0x40, 0x00, // ..........@. }; -static const uint8_t vs_font_distance_field_outline_drop_shadow_image_mtl[1306] = +static const uint8_t vs_font_distance_field_outline_drop_shadow_image_mtl[1354] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x67, 0x7a, 0xc3, 0x01, 0x00, 0x0f, 0x75, // VSH......gz....u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x05, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -302,6 +271,9 @@ static const uint8_t vs_font_distance_field_outline_drop_shadow_image_mtl[1306] 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/font/vs_font_distance_field_outline_image.bin.h b/bgfx/examples/common/font/vs_font_distance_field_outline_image.bin.h index 852171c9..aa92c869 100644 --- a/bgfx/examples/common/font/vs_font_distance_field_outline_image.bin.h +++ b/bgfx/examples/common/font/vs_font_distance_field_outline_image.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_font_distance_field_outline_image_glsl[551] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color1;.at @@ -40,7 +40,7 @@ static const uint8_t vs_font_distance_field_outline_image_essl[617] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........<...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........<...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // bute highp vec4 @@ -81,9 +81,9 @@ static const uint8_t vs_font_distance_field_outline_image_essl[617] = static const uint8_t vs_font_distance_field_outline_image_spv[1538] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0f, 0x00, // ................ @@ -178,42 +178,13 @@ static const uint8_t vs_font_distance_field_outline_image_spv[1538] = 0x38, 0x00, 0x01, 0x00, 0x00, 0x05, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, // 8............... 0x40, 0x00, // @. }; -static const uint8_t vs_font_distance_field_outline_image_dx9[409] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........l....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, // ................ - 0x04, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x0a, 0x00, 0x01, 0x80, 0x02, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, // ................ - 0x03, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x04, 0x00, 0x0f, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, // ................ - 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, // ................ - 0x03, 0x00, 0x0f, 0xe0, 0x03, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, 0x0f, 0xe0, // ................ - 0x04, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......... -}; -static const uint8_t vs_font_distance_field_outline_image_dx11[778] = +static const uint8_t vs_font_distance_field_outline_image_dx11[782] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0xb8, 0x03, 0xd3, 0x5a, 0xf9, 0xd3, 0xa7, 0x53, 0x66, 0x63, 0x68, 0xf0, 0xf4, 0x8f, 0xe4, 0x7e, // ...Z...Sfch....~ - 0x01, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC + 0x69, 0x9d, 0x3c, 0xc2, 0x02, 0x5b, 0xac, 0x4c, 0xfc, 0xe6, 0xad, 0x1e, 0x9f, 0x86, 0xe4, 0x9f, // i.<..[.L........ + 0x01, 0x00, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... 0xcc, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x98, 0x00, 0x00, 0x00, // ....p...ISGN.... 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -234,36 +205,36 @@ static const uint8_t vs_font_distance_field_outline_image_dx11[778] = 0x03, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x58, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x56, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // X...@...V...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........_....... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._...2....... - 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... - 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, // ........g.... .. - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... .. - 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....e.... ...... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // F............ .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. . - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... - 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // . ......F....... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, // ....6.... ...... - 0x46, 0x1e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x05, 0x05, 0x00, // F.......>....... - 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, 0x40, 0x00, // ........@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x5c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x57, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...W...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........_...2... + 0x02, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ...._........... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, // _...........g... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // . ..........e... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // . ......e.... .. + 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ....F........... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // F. .........6... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... + 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // F.......6.... .. + 0x04, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>... + 0x00, 0x05, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x11, 0x00, 0x40, 0x00, // ............@. }; -static const uint8_t vs_font_distance_field_outline_image_mtl[1149] = +static const uint8_t vs_font_distance_field_outline_image_mtl[1197] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x94, 0xf7, 0xae, 0x6e, 0x01, 0x00, 0x0f, 0x75, // VSH........n...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........C...#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........s...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -273,6 +244,9 @@ static const uint8_t vs_font_distance_field_outline_image_mtl[1149] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h b/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h index 66ff9924..47a89894 100644 --- a/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h +++ b/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_font_distance_field_subpixel_glsl[397] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........`...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........`...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec2 a_position;. @@ -30,7 +30,7 @@ static const uint8_t vs_font_distance_field_subpixel_essl[439] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // bute highp vec2 @@ -60,9 +60,9 @@ static const uint8_t vs_font_distance_field_subpixel_essl[439] = static const uint8_t vs_font_distance_field_subpixel_spv[1218] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........l....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........l....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, // ................ @@ -137,38 +137,13 @@ static const uint8_t vs_font_distance_field_subpixel_spv[1218] = 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, // ....8........... 0x40, 0x00, // @. }; -static const uint8_t vs_font_distance_field_subpixel_dx9[337] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........$....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, // ................ - 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................ - 0x00, // . -}; -static const uint8_t vs_font_distance_field_subpixel_dx11[590] = +static const uint8_t vs_font_distance_field_subpixel_dx11[594] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0xe3, 0x5d, 0xf0, 0xa8, 0xb3, 0x95, 0xec, 0x3a, 0x48, 0x51, 0xb3, 0xab, 0xaf, 0x69, 0xf9, 0x66, // .].....:HQ...i.f - 0x01, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC + 0x67, 0x2e, 0xf2, 0x76, 0x33, 0x6c, 0xd0, 0x30, 0xc6, 0x42, 0xd6, 0x1f, 0x81, 0x66, 0x83, 0xe6, // g..v3l.0.B...f.. + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, // ........ISGNh... 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -183,30 +158,31 @@ static const uint8_t vs_font_distance_field_subpixel_dx11[590] = 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...@...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........_...2... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._........... - 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // g.... .......... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // F............ .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. . - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... - 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // . ......F....... - 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // >...........@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x04, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x41, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...A...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // 2......._....... + 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ....F........... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // F. .........6... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... + 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, // ....>........... + 0x40, 0x00, // @. }; -static const uint8_t vs_font_distance_field_subpixel_mtl[847] = +static const uint8_t vs_font_distance_field_subpixel_mtl[895] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........I...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -216,6 +192,9 @@ static const uint8_t vs_font_distance_field_subpixel_mtl[847] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/imgui/fs_imgui_image.bin.h b/bgfx/examples/common/imgui/fs_imgui_image.bin.h index c68a6922..f587bf40 100644 --- a/bgfx/examples/common/imgui/fs_imgui_image.bin.h +++ b/bgfx/examples/common/imgui/fs_imgui_image.bin.h @@ -50,167 +50,133 @@ static const uint8_t fs_imgui_image_essl[372] = 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, // lor = tmpvar_1;. 0x7d, 0x0a, 0x0a, 0x00, // }... }; -static const uint8_t fs_imgui_image_spv[1379] = +static const uint8_t fs_imgui_image_spv[1295] = { 0x46, 0x53, 0x48, 0x0b, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, 0x75, // FSH.o.><.......u 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, // _imageLodEnabled - 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x1c, // Color0.......... - 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0xb3, // .....#.......... + 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0xc8, // Color0.......".. + 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xb3, // .....#.......... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, // ................ 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, // .......GLSL.std. 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // 450............. - 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m - 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x75, // ain....f...j...u - 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, // ...main........# - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, // ...s_texColorSam - 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, // pler.......&...s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // _texColorTexture - 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x47, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, // .......G...Unifo - 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x47, // rmBlock........G - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, // .......u_imageLo - 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x49, // dEnabled.......I - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00, 0x00, 0x67, // ...........f...g - 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, // l_FragCoord..... - 0x00, 0x05, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // ...j...v_texcoor - 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x75, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, // d0.....u...bgfx_ - 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, // FragData0..G...# - 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, // ...".......G...# - 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, // ...!.......G...& - 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, // ...".......G...& - 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x47, // ...!.......H...G - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // .......#.......G - 0x00, 0x03, 0x00, 0x47, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x49, // ...G.......G...I - 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x49, // ...".......G...I - 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x66, // ...!.......G...f - 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6a, // ...........G...j - 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x75, // ...........G...u - 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, // ...!............ - 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ....... ...".... - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, // .......;..."...# - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, // ....... ...%.... - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, // .......;...%...& - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x20, // ...........)... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2e, // .......+...).... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, // ...........2.... - 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x47, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, // .......G....... - 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x3b, // ...H.......G...; - 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, // ...H...I........ - 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, // ...O... .......+ - 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ...O...P....... - 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, // ...Q...........+ - 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3e, 0x2b, // .......W.....L>+ - 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x2b, // .......X.....L?+ - 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...O...Y....... - 0x00, 0x04, 0x00, 0x65, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, // ...e...........; - 0x00, 0x04, 0x00, 0x65, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...e...f....... - 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, // ...i...........; - 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...i...j....... - 0x00, 0x04, 0x00, 0x74, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, // ...t...........; - 0x00, 0x04, 0x00, 0x74, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, // ...t...u.......6 - 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=.... - 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...$...#...=.... - 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, // ...'...&...=.... - 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x51, // ...k...j...A...Q - 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x50, // .......I.......P - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x94, // ...=............ - 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x27, // ...V...2.......' - 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xb2, // ...$...X........ - 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x95, // .......k........ - 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x51, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x49, // ...A...Q.......I - 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // .......Y...=.... - 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x81, // .......X........ - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x9a, // ...........W.... - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0xb2, // ...Q............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9f, // .......Q........ - 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, // ...............P - 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9f, // ................ - 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x75, // ...........>...u - 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, // ...........8.... - 0x00, 0x10, 0x00, // ... -}; -static const uint8_t fs_imgui_image_dx9[400] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH.o.><.......s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, // ....u_imageLodEn - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, // abled..........L - 0x01, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x2e, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, // ...........CTAB. - 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, // ................ - 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, // ...........D.... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, // .......P.......` - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, // ...........t.... - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, // ...s_texColor... - 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, // ...............u - 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, // _imageLodEnabled - 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, // ...ps_3_0.Micros - 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, // oft (R) HLSL Sha - 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, // der Compiler 10. - 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, // 1..Q..........?. - 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x05, // .....L?..L>..... - 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, // ................ - 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xd0, 0xa0, 0x00, // ................ - 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, // ..............._ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, // ................ - 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x0c, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, // ................ - 0x00, 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // .U.............. + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m + 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x10, // ain....j...u.... + 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, // ................ + 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m + 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, // ain........#...s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler + 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......&...s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, // ColorTexture.... + 0x00, 0x06, 0x00, 0x47, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, // ...G...UniformBl + 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, // ock........G.... + 0x00, 0x00, 0x00, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, // ...u_imageLodEna + 0x62, 0x6c, 0x65, 0x64, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x49, 0x00, 0x00, 0x00, 0x00, // bled.......I.... + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, // .......j...v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x75, 0x00, 0x00, 0x00, 0x62, // coord0.....u...b + 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, // gfx_FragData0..G + 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...#...".......G + 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, // ...#...!.......G + 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...&...".......G + 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, // ...&...!.......H + 0x00, 0x05, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...G.......#.... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x47, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, // ...G...G.......G + 0x00, 0x04, 0x00, 0x49, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...I...".......G + 0x00, 0x04, 0x00, 0x49, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...I...!.......G + 0x00, 0x04, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...j...........G + 0x00, 0x04, 0x00, 0x75, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, // ...u............ + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // .......!........ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, // ... ............ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, // ................ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, // ........... ..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, // ...........;..." + 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, // ...#....... ...% + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, // ...........;...% + 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x29, // ...&...........) + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, // ... .......+...) + 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, // ...............2 + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x47, 0x00, 0x00, 0x00, 0x0e, // ...........G.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, // ... ...H.......G + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x02, // ...;...H...I.... + 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, // .......O... .... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, // ...+...O...P.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, // ... ...Q........ + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0xcd, // ...+.......W.... + 0xcc, 0x4c, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0xcd, // .L>+.......X.... + 0xcc, 0x4c, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x01, // .L?+...O...Y.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, // ... ...i........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x01, // ...;...i...j.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x74, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, // ... ...t........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x74, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x03, // ...;...t...u.... + 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // ...6............ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, // ...............= + 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, // .......$...#...= + 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, // .......'...&...= + 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x41, // .......k...j...A + 0x00, 0x06, 0x00, 0x51, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x2e, // ...Q.......I.... + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x95, // ...P...=........ + 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0xaf, // .......V...2.... + 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, // ...'...$...X.... + 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x02, // ...........k.... + 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x51, 0x00, 0x00, 0x00, 0x98, // .......A...Q.... + 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x3d, // ...I.......Y...= + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, // ...............2 + 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x51, // ...X.......W...Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0xb2, // ...Q............ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa0, // .......Q........ + 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, // ...........P.... + 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0xa0, // ................ + 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x75, 0x00, 0x00, 0x00, 0xa1, // .......>...u.... + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // .......8....... }; -static const uint8_t fs_imgui_image_dx11[480] = +static const uint8_t fs_imgui_image_dx11[471] = { - 0x46, 0x53, 0x48, 0x0b, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x11, 0x75, // FSH.o.><.......u + 0x46, 0x53, 0x48, 0x0b, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, 0x75, // FSH.o.><.......u 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, // _imageLodEnabled 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // Color0.......... - 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, // s_texColor0..... - 0x00, 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x60, 0x83, 0xa2, 0x5c, // ........DXBC`... - 0x77, 0x3d, 0xcc, 0x9b, 0xb9, 0x73, 0xdf, 0x41, 0x6b, 0x18, 0x8f, 0x0e, 0x01, 0x00, 0x00, 0x00, // w=...s.Ak....... - 0x84, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, // ........,....... - 0xb8, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....ISGNP....... - 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....8........... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, // ............D... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, // ....SV_POSITION. - 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, // TEXCOORD....OSGN - 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET... - 0x53, 0x48, 0x44, 0x52, 0xc4, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, // SHDR....@...1... - 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // Y...F. ......... - 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, // Z....`......X... - 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b... - 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // 2.......e.... .. - 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, // ....h.......H... - 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........F....... - 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F~.......`...... - 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // .. .........6... - 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r ......F....... - 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, // 2.... ........ . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, // .........@....L? - 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3e, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // .@....L>>....... + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, // Color0.......... + 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x93, 0x1f, 0x8d, 0x42, 0xd8, 0x6d, 0xd1, 0x2f, 0x7c, // ...DXBC...B.m./| + 0x9d, 0x3a, 0xc5, 0x21, 0x8c, 0xa9, 0x66, 0x01, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x03, // .:.!..f......... + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x49, // ...,...........I + 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, // SGNP...........8 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......D........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x53, // ...............S + 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, // V_POSITION.TEXCO + 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // ORD....OSGN,.... + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S + 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xd0, // V_TARGET...SHEX. + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, // ...P...4...j...Y + 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, // ...F. .........Z + 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, // ....`......X.... + 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, // p......UU..b...2 + 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, // .......e.... ... + 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8e, 0xc2, // ...h.......H.... + 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...CU..r.......F + 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......F~....... + 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // `........ ...... + 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...6...r ......F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, 0x00, 0x00, // .......2.... ... + 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ..... .......... + 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3e, 0x3e, // @....L?.@....L>> + 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ....... }; -static const uint8_t fs_imgui_image_mtl[833] = +static const uint8_t fs_imgui_image_mtl[850] = { 0x46, 0x53, 0x48, 0x0b, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x11, 0x73, // FSH.o.><.......s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler - 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x39, 0x01, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ........9..s_tex + 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... - 0x01, 0x00, 0x00, 0x00, 0x39, 0x01, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, // ....9..u_imageLo + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, // .......u_imageLo 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // dEnabled........ - 0x39, 0x01, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, // 9..s_texColor... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0x01, 0xc2, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, // .....9.....#incl + 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, // ...s_texColor... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, // ...........#incl 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, // ude .#include ..using @@ -248,14 +214,15 @@ static const uint8_t fs_imgui_image_mtl[833] = 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // mpler, in.v_texc 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x28, 0x5f, 0x6d, 0x74, // oord0, level(_mt 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, // l_u.u_imageLodEn - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x30, // abled.x)).xyz, 0 - 0x2e, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x39, 0x38, 0x30, 0x32, 0x33, 0x32, // .200000002980232 - 0x32, 0x34, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, // 24 + (0.80000001 - 0x31, 0x39, 0x32, 0x30, 0x39, 0x32, 0x38, 0x39, 0x36, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // 192092896 * _mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, // _u.u_imageLodEna - 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, // bled.y));. re - 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, // turn out;.}....0 - 0x00, // . + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, // abled.x)).xyz, f + 0x6d, 0x61, 0x28, 0x30, 0x2e, 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x31, 0x39, 0x32, // ma(0.80000001192 + 0x30, 0x39, 0x32, 0x38, 0x39, 0x35, 0x35, 0x30, 0x37, 0x38, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x5f, // 0928955078125, _ + 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, // mtl_u.u_imageLod + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x30, 0x30, // Enabled.y, 0.200 + 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x39, 0x38, 0x30, 0x32, 0x33, 0x32, 0x32, 0x33, 0x38, 0x37, // 0000029802322387 + 0x36, 0x39, 0x35, 0x33, 0x31, 0x32, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, // 6953125));. r + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, // eturn out;.}.... + 0x30, 0x00, // 0. }; extern const uint8_t* fs_imgui_image_pssl; extern const uint32_t fs_imgui_image_pssl_size; diff --git a/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h b/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h index ec34dc9b..7f7a598d 100644 --- a/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h +++ b/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h @@ -32,91 +32,69 @@ static const uint8_t fs_ocornut_imgui_essl[246] = 0x61, 0x72, 0x5f, 0x31, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x29, // ar_1 * v_color0) 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... }; -static const uint8_t fs_ocornut_imgui_spv[910] = +static const uint8_t fs_ocornut_imgui_spv[850] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x68, 0x03, // _tex0.........h. - 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x97, 0x00, // ....#........... + 0x5f, 0x74, 0x65, 0x78, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x2c, 0x03, // _tex0.......".,. + 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x97, 0x00, // ....#........... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // ................ 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, // ......GLSL.std.4 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // 50.............. - 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma - 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x55, 0x00, // in....N...Q...U. - 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, // ..b............. - 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, // ................ - 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ......main...... - 0x06, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, // ..#...s_texSampl - 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, // er........&...s_ - 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // texTexture...... - 0x06, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, // ..N...gl_FragCoo - 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, 0x00, 0x76, 0x5f, // rd........Q...v_ - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x55, 0x00, // color0........U. - 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, // ..v_texcoord0... - 0x06, 0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, // ..b...bgfx_FragD - 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, // ata0..G...#...". - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...#...!. - 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, // ......G...&...". - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...&...!. - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0b, 0x00, // ......G...N..... - 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...Q..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...U..... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...b..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, // ..............!. - 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, // ................ - 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, // .......... ..... - 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // .. ..."......... - 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;..."...#..... - 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // .. ...%......... - 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;...%...&..... - 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, // ......2....... . - 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..M...........;. - 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..M...N.......;. - 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..M...Q....... . - 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..T...........;. - 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..T...U....... . - 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..a...........;. - 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, // ..a...b.......6. - 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, // ..........=..... - 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, // ..$...#...=..... - 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..'...&...=..... - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, // ..R...Q...=..... - 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, 0x00, // ..V...U...V...2. - 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, 0x00, // ......'...$...W. - 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x56, 0x00, // ..............V. - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x96, 0x00, // ................ - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x62, 0x00, 0x00, 0x00, 0x86, 0x00, // ..R...>...b..... - 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ......8....... + 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x62, 0x00, // in....Q...U...b. + 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x23, 0x00, // ..main........#. + 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, // ..s_texSampler.. + 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, // ......&...s_texT + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x51, 0x00, // exture........Q. + 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ..v_color0...... + 0x05, 0x00, 0x55, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // ..U...v_texcoord + 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // 0.....b...bgfx_F + 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, // ragData0..G...#. + 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, // ..".......G...#. + 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, // ..!.......G...&. + 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, // ..".......G...&. + 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x51, 0x00, // ..!.......G...Q. + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x55, 0x00, // ..........G...U. + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, // ..........G...b. + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, // ................ + 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..!............. + 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . + 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, // ................ + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ..."..... + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, // ......;..."...#. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ...%..... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, // ......;...%...&. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, // ..........2..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ...M......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...M...Q..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // .. ...T......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...T...U..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ...a......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;...a...b..... + 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // ..6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......$...#...=. + 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......'...&...=. + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......R...Q...=. + 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, // ......V...U...V. + 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, // ..2.......'...$. + 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x94, 0x00, // ..W............. + 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x86, 0x00, // ..V............. + 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x62, 0x00, // ......R...>...b. + 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..........8..... + 0x00, 0x00, // .. }; -static const uint8_t fs_ocornut_imgui_dx9[239] = +static const uint8_t fs_ocornut_imgui_dx11[418] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, // _tex0........... - 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x1f, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ..........CTAB.. - 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..O............. - 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, // ......H...0..... - 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, // ......8.......s_ - 0x74, 0x65, 0x78, 0x00, 0xab, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // tex............. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // ......ps_3_0.Mic - 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL - 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler - 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, // 10.1............ - 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, // ................ - 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, // ..........B..... - 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, // ................ - 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ............... -}; -static const uint8_t fs_ocornut_imgui_dx11[422] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x05, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, // _tex0..........s - 0x5f, 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x01, // _tex0.........p. - 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xbe, 0x78, 0xe7, 0xa5, 0x19, 0x0c, 0x70, 0xeb, 0x4c, 0xb1, // ..DXBC.x....p.L. - 0xac, 0x1f, 0x16, 0x84, 0xe9, 0x97, 0x01, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x03, 0x00, // ..........p..... + 0x5f, 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x01, // _tex0.........|. + 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x9f, 0xc3, 0xdd, 0xee, 0xdf, 0xe0, 0xb0, 0x54, 0xaa, 0x51, // ..DXBC.......T.Q + 0xec, 0xb4, 0x2a, 0xf6, 0x8e, 0x43, 0x01, 0x00, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x03, 0x00, // ..*..C....|..... 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, // GNl...........P. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ @@ -128,17 +106,18 @@ static const uint8_t fs_ocornut_imgui_dx11[422] = 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,......... 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. ............. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR - 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x94, 0x00, 0x00, 0x00, 0x40, 0x00, // GET...SHDR....@. - 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..%...Z....`.... - 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, // ..X....p......UU - 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, // ..b...........b. - 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, // ..2.......e.... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, // ......h.......E. - 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, // ..........F..... - 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..F~.......`.... - 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..8.... ......F. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......F.......>. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ...... + 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xa0, 0x00, 0x00, 0x00, 0x50, 0x00, // GET...SHEX....P. + 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, // ..(...j...Z....` + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, // ......X....p.... + 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, // ..UU..b......... + 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, // ..b...2.......e. + 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, // ... ......h..... + 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, // ..E.......CU.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, // ......F.......F~ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // .......`......8. + 0x00, 0x07, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ... ......F..... + 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, // ..F.......>..... + 0x00, 0x00, // .. }; static const uint8_t fs_ocornut_imgui_mtl[609] = { diff --git a/bgfx/examples/common/imgui/fs_ocornut_imgui.sc b/bgfx/examples/common/imgui/fs_ocornut_imgui.sc index f07729cb..0b9c9828 100644 --- a/bgfx/examples/common/imgui/fs_ocornut_imgui.sc +++ b/bgfx/examples/common/imgui/fs_ocornut_imgui.sc @@ -7,5 +7,5 @@ SAMPLER2D(s_tex, 0); void main() { vec4 texel = texture2D(s_tex, v_texcoord0); - gl_FragColor = texel * v_color0; + gl_FragColor = texel * v_color0; } diff --git a/bgfx/examples/common/imgui/imgui.cpp b/bgfx/examples/common/imgui/imgui.cpp index da932cb7..a788bfe2 100644 --- a/bgfx/examples/common/imgui/imgui.cpp +++ b/bgfx/examples/common/imgui/imgui.cpp @@ -14,12 +14,14 @@ #include "imgui.h" #include "../bgfx_utils.h" -//#define USE_ENTRY 1 - #ifndef USE_ENTRY # define USE_ENTRY 0 #endif // USE_ENTRY +#ifndef USE_LOCAL_STB +# define USE_LOCAL_STB 1 +#endif // USE_LOCAL_STB + #if USE_ENTRY # include "../entry/entry.h" # include "../entry/input.h" @@ -66,10 +68,13 @@ struct OcornutImguiContext void render(ImDrawData* _drawData) { // Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates) - int fb_width = (int)(_drawData->DisplaySize.x * _drawData->FramebufferScale.x); - int fb_height = (int)(_drawData->DisplaySize.y * _drawData->FramebufferScale.y); - if (fb_width <= 0 || fb_height <= 0) + int32_t dispWidth = _drawData->DisplaySize.x * _drawData->FramebufferScale.x; + int32_t dispHeight = _drawData->DisplaySize.y * _drawData->FramebufferScale.y; + if (dispWidth <= 0 + || dispHeight <= 0) + { return; + } bgfx::setViewName(m_viewId, "ImGui"); bgfx::setViewMode(m_viewId, bgfx::ViewMode::Sequential); @@ -134,14 +139,16 @@ struct OcornutImguiContext bgfx::TextureHandle th = m_texture; bgfx::ProgramHandle program = m_program; - if (NULL != cmd->TextureId) + if (ImU64(0) != cmd->TextureId) { union { ImTextureID ptr; struct { bgfx::TextureHandle handle; uint8_t flags; uint8_t mip; } s; } texture = { cmd->TextureId }; + state |= 0 != (IMGUI_FLAGS_ALPHA_BLEND & texture.s.flags) ? BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA) : BGFX_STATE_NONE ; th = texture.s.handle; + if (0 != texture.s.mip) { const float lodEnabled[4] = { float(texture.s.mip), 1.0f, 0.0f, 0.0f }; @@ -161,8 +168,8 @@ struct OcornutImguiContext clipRect.z = (cmd->ClipRect.z - clipPos.x) * clipScale.x; clipRect.w = (cmd->ClipRect.w - clipPos.y) * clipScale.y; - if (clipRect.x < fb_width - && clipRect.y < fb_height + if (clipRect.x < dispWidth + && clipRect.y < dispHeight && clipRect.z >= 0.0f && clipRect.w >= 0.0f) { @@ -465,10 +472,10 @@ struct OcornutImguiContext #if USE_ENTRY uint8_t modifiers = inputGetModifiersState(); - io.AddKeyEvent(ImGuiKey_ModShift, 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) ) ); - io.AddKeyEvent(ImGuiKey_ModCtrl, 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) ) ); - io.AddKeyEvent(ImGuiKey_ModAlt, 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) ) ); - io.AddKeyEvent(ImGuiKey_ModSuper, 0 != (modifiers & (entry::Modifier::LeftMeta | entry::Modifier::RightMeta ) ) ); + io.AddKeyEvent(ImGuiMod_Shift, 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) ) ); + io.AddKeyEvent(ImGuiMod_Ctrl, 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) ) ); + io.AddKeyEvent(ImGuiMod_Alt, 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) ) ); + io.AddKeyEvent(ImGuiMod_Super, 0 != (modifiers & (entry::Modifier::LeftMeta | entry::Modifier::RightMeta ) ) ); for (int32_t ii = 0; ii < (int32_t)entry::Key::Count; ++ii) { io.AddKeyEvent(m_keyMap[ii], inputGetKeyState(entry::Key::Enum(ii) ) ); @@ -561,15 +568,29 @@ namespace ImGui } // namespace ImGui +#if USE_LOCAL_STB BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4505); // error C4505: '' : unreferenced local function has been removed BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wunused-function"); // warning: 'int rect_width_compare(const void*, const void*)' defined but not used -BX_PRAGMA_DIAGNOSTIC_PUSH(); BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunknown-pragmas") BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wtype-limits"); // warning: comparison is always true due to limited range of data type -#define STBTT_malloc(_size, _userData) memAlloc(_size, _userData) -#define STBTT_free(_ptr, _userData) memFree(_ptr, _userData) -#define STB_RECT_PACK_IMPLEMENTATION -#include -#define STB_TRUETYPE_IMPLEMENTATION -#include -BX_PRAGMA_DIAGNOSTIC_POP(); + +# define STBTT_ifloor(_a) int32_t(bx::floor(_a) ) +# define STBTT_iceil(_a) int32_t(bx::ceil(_a) ) +# define STBTT_sqrt(_a) bx::sqrt(_a) +# define STBTT_pow(_a, _b) bx::pow(_a, _b) +# define STBTT_fmod(_a, _b) bx::mod(_a, _b) +# define STBTT_cos(_a) bx::cos(_a) +# define STBTT_acos(_a) bx::acos(_a) +# define STBTT_fabs(_a) bx::abs(_a) +# define STBTT_strlen(_str) bx::strLen(_str) + +# define STBTT_memcpy(_dst, _src, _numBytes) bx::memCopy(_dst, _src, _numBytes) +# define STBTT_memset(_dst, _ch, _numBytes) bx::memSet(_dst, _ch, _numBytes) +# define STBTT_malloc(_size, _userData) memAlloc(_size, _userData) +# define STBTT_free(_ptr, _userData) memFree(_ptr, _userData) + +# define STB_RECT_PACK_IMPLEMENTATION +# include +# define STB_TRUETYPE_IMPLEMENTATION +# include +#endif // USE_LOCAL_STB diff --git a/bgfx/examples/common/imgui/imgui.h b/bgfx/examples/common/imgui/imgui.h index ac1bafc0..b9933877 100644 --- a/bgfx/examples/common/imgui/imgui.h +++ b/bgfx/examples/common/imgui/imgui.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/imgui/makefile b/bgfx/examples/common/imgui/makefile index 7e77033b..a0b79f92 100644 --- a/bgfx/examples/common/imgui/makefile +++ b/bgfx/examples/common/imgui/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/common/imgui/vs_imgui_image.bin.h b/bgfx/examples/common/imgui/vs_imgui_image.bin.h index 4bf4691d..7dd125b3 100644 --- a/bgfx/examples/common/imgui/vs_imgui_image.bin.h +++ b/bgfx/examples/common/imgui/vs_imgui_image.bin.h @@ -1,7 +1,7 @@ static const uint8_t vs_imgui_image_glsl[311] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, // VSH.....o.><...u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj....... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // .......attribute 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // vec2 a_position 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, // ;.attribute vec2 @@ -24,7 +24,7 @@ static const uint8_t vs_imgui_image_glsl[311] = static const uint8_t vs_imgui_image_essl[341] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, // VSH.....o.><...u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj....... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... 0x00, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // ...-...attribute 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, // highp vec2 a_po 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // sition;.attribut @@ -49,8 +49,8 @@ static const uint8_t vs_imgui_image_essl[341] = static const uint8_t vs_imgui_image_spv[1051] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, // VSH.....o.><...u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0xec, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, // .........#...... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... + 0x00, 0x00, 0x00, 0xec, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, // .........#...... 0x00, 0x08, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ...]............ 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, // ...........GLSL. 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, // std.450......... @@ -115,34 +115,12 @@ static const uint8_t vs_imgui_image_spv[1051] = 0x00, 0x03, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, // ...>...2.......8 0x00, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // .........@. }; -static const uint8_t vs_imgui_image_dx9[292] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, // VSH.....o.><...u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, // ............. .C - 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, // TAB....S........ - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, // ...........L...0 - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, // ...........<.... - 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0xab, 0x03, // ...u_viewProj... - 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, // ...............v - 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, // s_3_0.Microsoft - 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, // (R) HLSL Shader - 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, // Compiler 10.1... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, // ................ - 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, // ................ - 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0xe0, 0x05, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, // .............U.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, // ................ - 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, 0x90, 0xff, // ................ - 0xff, 0x00, 0x00, 0x00, // .... -}; -static const uint8_t vs_imgui_image_dx11[483] = +static const uint8_t vs_imgui_image_dx11[487] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, // VSH.....o.><...u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xfd, 0x09, 0x41, 0xa3, 0x52, // .......DXBC..A.R - 0x84, 0xc1, 0x51, 0xab, 0x1b, 0xf1, 0x5e, 0xed, 0xfa, 0xf6, 0x14, 0x01, 0x00, 0x00, 0x00, 0xb4, // ..Q...^......... + 0x00, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xd8, 0xa9, 0x97, 0x32, 0xdf, // .......DXBC...2. + 0x93, 0x0d, 0xa9, 0x44, 0xeb, 0x32, 0xe5, 0xd9, 0x58, 0xf7, 0x91, 0x01, 0x00, 0x00, 0x00, 0xb8, // ...D.2..X....... 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xd8, // .......,........ 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, // ...ISGNL........ 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...8............ @@ -155,27 +133,27 @@ static const uint8_t vs_imgui_image_dx11[483] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // ................ 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, // .......SV_POSITI 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, // ON.TEXCOORD....S - 0x48, 0x44, 0x52, 0xd4, 0x00, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x35, 0x00, 0x00, 0x00, 0x59, // HDR....@...5...Y - 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, // ...F. ........._ - 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, // ...2......._...2 - 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, // .......g.... ... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x01, // .......e...2 ... - 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, // ...h.......8.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......V.......F - 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, // . .........2.... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......F. ...... - 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, // ...........F.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ........ ......F - 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // .......F. ...... - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // ...6...2 ......F - 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x10, // .......>........ - 0x00, 0x40, 0x00, // .@. + 0x48, 0x45, 0x58, 0xd8, 0x00, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x36, 0x00, 0x00, 0x00, 0x6a, // HEX....P...6...j + 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, // ...Y...F. ...... + 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, // ..._...2......._ + 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, // ...2.......g.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, // ..........e...2 + 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, // ......h.......8 + 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, // ...........V.... + 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, // ...F. .........2 + 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...........F. .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...............F + 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, // ............ ... + 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...F.......F. .. + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x01, // .......6...2 ... + 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, // ...F.......>.... + 0x02, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // .....@. }; -static const uint8_t vs_imgui_image_mtl[687] = +static const uint8_t vs_imgui_image_mtl[735] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, // VSH.....o.><...u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // .......#include + 0x00, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // .......#include 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, // .# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, // include ..using nam @@ -184,7 +162,10 @@ static const uint8_t vs_imgui_image_mtl[687] = 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x76, // float4x4 u_v 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, // iewProj;.};..str 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, // uct xlatMtlMain_ - 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // out.{. float2 + 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, // out.{..float bgf + 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, // x_metal_pointSiz + 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, // e [[point_size]] + 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // = 1;. float2 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, // _entryPointOutp 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, // ut_v_texcoord0 [ 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, // [user(locn0)]];. diff --git a/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h b/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h index 167563a9..a7639479 100644 --- a/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h +++ b/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h @@ -1,7 +1,7 @@ static const uint8_t vs_ocornut_imgui_glsl[460] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj....... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // .......attribute 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // vec4 a_color0;. 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, // attribute vec2 a @@ -33,7 +33,7 @@ static const uint8_t vs_ocornut_imgui_glsl[460] = static const uint8_t vs_ocornut_imgui_essl[508] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj....... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // .......attribute 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, // highp vec4 a_co 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, // lor0;.attribute @@ -68,8 +68,8 @@ static const uint8_t vs_ocornut_imgui_essl[508] = static const uint8_t vs_ocornut_imgui_spv[1293] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0xdc, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, // .........#...... + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... + 0x00, 0x00, 0x00, 0xdc, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, // .........#...... 0x00, 0x08, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ...|............ 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, // ...........GLSL. 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, // std.450......... @@ -149,38 +149,12 @@ static const uint8_t vs_ocornut_imgui_spv[1293] = 0x00, 0x03, 0x00, 0x57, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, // ...W...F.......8 0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ...........@. }; -static const uint8_t vs_ocornut_imgui_dx9[364] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, // ...D......... .C - 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, // TAB....S........ - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, // ...........L...0 - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, // ...........<.... - 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0xab, 0x03, // ...u_viewProj... - 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, // ...............v - 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, // s_3_0.Microsoft - 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, // (R) HLSL Shader - 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, // Compiler 10.1..Q - 0x00, 0x00, 0x05, 0x04, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, // ..............?. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, // ................ - 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, // ................ - 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, // ................ - 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x03, 0xe0, 0x05, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, // .............U.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, // ................ - 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0xe0, 0x04, 0x00, 0x44, 0xa0, 0x01, // .............D.. - 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, // ................ - 0x00, 0x03, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ............ -}; -static const uint8_t vs_ocornut_imgui_dx11[617] = +static const uint8_t vs_ocornut_imgui_dx11[621] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xa9, 0x5b, 0xb0, 0xfb, 0xae, // ...8...DXBC.[... - 0x5e, 0xc6, 0x4a, 0xef, 0x25, 0x0b, 0x81, 0x23, 0x55, 0x3d, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, // ^.J.%..#U=.....8 + 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xf7, 0x40, 0x03, 0xbd, 0x59, // ...<...DXBC.@..Y + 0x4b, 0x0a, 0x7a, 0xe0, 0xf3, 0xad, 0xa1, 0xda, 0xcb, 0xc4, 0x1b, 0x01, 0x00, 0x00, 0x00, 0x3c, // K.z............< 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, // .......,........ 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, // ...ISGNh........ 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...P............ @@ -196,32 +170,32 @@ static const uint8_t vs_ocornut_imgui_dx11[617] = 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...b............ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX - 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, 0x20, 0x01, 0x00, 0x00, 0x40, // COORD..SHDR ...@ - 0x00, 0x01, 0x00, 0x48, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...H...Y...F. .. - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, // ......._........ - 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, // ..._...2......._ - 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, // ...2.......g.... - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ..........e.... - 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x02, // ......e...2 ... - 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x32, // ...h.......8...2 - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......V.......F - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x32, // . .........2...2 - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......F. ...... - 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, // ...........F.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x32, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......2 ......F - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // .......F. ...... - 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // ...6.... ....... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // @............... - 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // ..?6.... ......F - 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x02, // .......6...2 ... - 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, // ...F.......>.... - 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // .......@. + 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, 0x24, 0x01, 0x00, 0x00, 0x50, // COORD..SHEX$...P + 0x00, 0x01, 0x00, 0x49, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, // ...I...j...Y...F + 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, // . ........._.... + 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, // ......._...2.... + 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, // ..._...2.......g + 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, // .... ..........e + 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, // .... ......e...2 + 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, // ......h.......8 + 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, // ...2.......V.... + 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, // ...F. .........2 + 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, // ...2.......F. .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // ...............F + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x32, 0x20, 0x10, 0x00, 0x00, // ...........2 ... + 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, // ...F.......F. .. + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00, 0x00, // .......6.... ... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....@........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, // ......?6.... ... + 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, // ...F.......6...2 + 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, // ......F.......> + 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ...........@. }; -static const uint8_t vs_ocornut_imgui_mtl[855] = +static const uint8_t vs_ocornut_imgui_mtl[903] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj....... - 0x00, 0x00, 0x00, 0x26, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // ...&...#include + 0x00, 0x00, 0x00, 0x56, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // ...V...#include 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, // .# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, // include ..using nam @@ -230,7 +204,10 @@ static const uint8_t vs_ocornut_imgui_mtl[855] = 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x76, // float4x4 u_v 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, // iewProj;.};..str 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, // uct xlatMtlMain_ - 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // out.{. float4 + 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, // out.{..float bgf + 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, // x_metal_pointSiz + 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, // e [[point_size]] + 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // = 1;. float4 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, // _entryPointOutp 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, // ut_v_color0 [[us 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, // er(locn0)]];. diff --git a/bgfx/examples/common/imgui/vs_ocornut_imgui.sc b/bgfx/examples/common/imgui/vs_ocornut_imgui.sc index c4f6eb10..2d203f5b 100644 --- a/bgfx/examples/common/imgui/vs_ocornut_imgui.sc +++ b/bgfx/examples/common/imgui/vs_ocornut_imgui.sc @@ -10,4 +10,3 @@ void main() v_texcoord0 = a_texcoord0; v_color0 = a_color0; } - diff --git a/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h b/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h index 3b2b9551..00a3142a 100644 --- a/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h +++ b/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h @@ -1,9 +1,9 @@ static const uint8_t fs_nanovg_fill_glsl[2827] = { 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x75, // FSH............u - 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x03, 0x01, 0x00, 0x00, 0x01, // _scissorMat..... + 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x03, 0x01, 0x00, 0x00, 0x03, // _scissorMat..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, // ......u_paintMat - 0x03, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // ...........u_inn + 0x03, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // ...........u_inn 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // erCol........... 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, // u_outerCol...... 0x00, 0x00, 0x00, 0x00, 0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, // .....u_scissorEx @@ -181,9 +181,9 @@ static const uint8_t fs_nanovg_fill_glsl[2827] = static const uint8_t fs_nanovg_fill_essl[2964] = { 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x75, // FSH............u - 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x03, 0x01, 0x00, 0x00, 0x01, // _scissorMat..... + 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x03, 0x01, 0x00, 0x00, 0x03, // _scissorMat..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, // ......u_paintMat - 0x03, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // ...........u_inn + 0x03, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // ...........u_inn 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // erCol........... 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, // u_outerCol...... 0x00, 0x00, 0x00, 0x00, 0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, // .....u_scissorEx @@ -367,474 +367,365 @@ static const uint8_t fs_nanovg_fill_essl[2964] = 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, // lor = result_1;. 0x7d, 0x0a, 0x0a, 0x00, // }... }; -static const uint8_t fs_nanovg_fill_spv[5704] = +static const uint8_t fs_nanovg_fill_spv[5636] = { 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x75, // FSH............u - 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x13, 0x00, 0x00, 0x00, 0x03, // _scissorMat..... + 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x13, 0x01, 0x00, 0x00, 0x03, // _scissorMat..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, // ......u_scissorE - 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // xtScale......... - 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0xa0, 0x00, 0x01, 0x00, // ..u_params...... + 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x01, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // xtScale......... + 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0xa0, 0x00, 0x01, 0x00, // ..u_params...... 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x13, // .....u_paintMat. - 0x00, 0x30, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // .0........u_exte - 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x00, 0x90, 0x00, 0x01, 0x00, 0x00, 0x00, // ntRadius........ - 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x00, 0x60, // ...u_innerCol..` + 0x01, 0x30, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // .0........u_exte + 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x01, 0x90, 0x00, 0x01, 0x00, 0x00, 0x00, // ntRadius........ + 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x01, 0x60, // ...u_innerCol..` 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, // ........u_outerC - 0x6f, 0x6c, 0x12, 0x00, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // ol..p........s_t - 0x65, 0x78, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x84, 0x15, 0x00, 0x00, // ex0............. - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0xb7, 0x02, 0x00, 0x00, // ..#............. + 0x6f, 0x6c, 0x12, 0x01, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // ol..p........s_t + 0x65, 0x78, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x40, 0x15, 0x00, 0x00, // ex0.......".@... + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xba, 0x02, 0x00, 0x00, // ..#............. 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, // ................ 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, // ....GLSL.std.450 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, // ............main - 0x00, 0x00, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, // ....d...h...k... - 0x78, 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, // x............... - 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, // ................ - 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, // ....main........ - 0x36, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // 6...s_texSampler - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x39, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, // ........9...s_te - 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, // xTexture........ - 0x7e, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, // ~...UniformBlock - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........~....... - 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00, // u_scissorMat.... - 0x06, 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, // ....~.......u_pa - 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, // intMat......~... - 0x02, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, 0x00, // ....u_innerCol.. - 0x06, 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6f, 0x75, // ....~.......u_ou - 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x7e, 0x00, 0x00, 0x00, // terCol......~... - 0x04, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, // ....u_scissorExt - 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x7e, 0x00, 0x00, 0x00, // Scale.......~... - 0x05, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, // ....u_extentRadi - 0x75, 0x73, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, // us......~....... - 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, // u_params........ - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x64, 0x01, 0x00, 0x00, // ............d... - 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, // gl_FragCoord.... - 0x05, 0x00, 0x05, 0x00, 0x68, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // ....h...v_positi - 0x6f, 0x6e, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, // on......k...v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x78, 0x01, 0x00, 0x00, // xcoord0.....x... - 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, // bgfx_FragData0.. - 0x47, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // G...6..."....... - 0x47, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, // G...6...!....... - 0x47, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // G...9..."....... - 0x47, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // G...9...!....... - 0x48, 0x00, 0x04, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // H...~........... - 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // H...~.......#... - 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...~....... - 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x7e, 0x00, 0x00, 0x00, // ........H...~... - 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, // ........H...~... - 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, // ....#...0...H... - 0x7e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // ~............... - 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // H...~.......#... - 0x60, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // `...H...~....... - 0x23, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, // #...p...H...~... - 0x04, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, // ....#.......H... - 0x7e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, // ~.......#....... - 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // H...~.......#... - 0xa0, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....G...~....... - 0x47, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // G......."....... - 0x47, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // G.......!....... - 0x47, 0x00, 0x04, 0x00, 0x64, 0x01, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // G...d........... - 0x47, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // G...h........... - 0x47, 0x00, 0x04, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // G...k........... - 0x47, 0x00, 0x04, 0x00, 0x78, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // G...x........... - 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, // ........!....... - 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, // ................ - 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, // .... ........... - 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, // ................ - 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, // ................ - 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, // ............ ... - 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, // 5...........;... - 0x35, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, // 5...6....... ... - 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, // 8...........;... - 0x38, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, // 8...9........... - 0x3c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // <... .......+... - 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // <...=.......+... - 0x3c, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, // <...A........... - 0x45, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x63, 0x00, 0x00, 0x00, // E...........c... - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x63, 0x00, 0x00, 0x00, // .......+...c... - 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x63, 0x00, 0x00, 0x00, // d.......+...c... - 0x67, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // g.......+....... - 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, // k.......,....... - 0x6e, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // n...k...k...+... - 0x07, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x17, 0x00, 0x04, 0x00, // ....x......?.... - 0x79, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, // y............... - 0x7d, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x09, 0x00, // }...y........... - 0x7e, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, // ~...}...}....... + 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, // ............main + 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, // ....h...k...x... + 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, // ................ + 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, // ................ + 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x36, 0x00, 0x00, 0x00, // main........6... + 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, // s_texSampler.... + 0x05, 0x00, 0x06, 0x00, 0x39, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, // ....9...s_texTex + 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, // ture........~... + 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, // UniformBlock.... + 0x06, 0x00, 0x07, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x63, // ....~.......u_sc + 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, // issorMat........ + 0x7e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, // ~.......u_paintM + 0x61, 0x74, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // at......~....... + 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, // u_innerCol...... + 0x7e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, // ~.......u_outerC + 0x6f, 0x6c, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // ol......~....... + 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, // u_scissorExtScal + 0x65, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, // e.......~....... + 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x00, 0x00, // u_extentRadius.. + 0x06, 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, // ....~.......u_pa + 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x80, 0x00, 0x00, 0x00, // rams............ + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x68, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x70, 0x6f, // ........h...v_po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x6b, 0x01, 0x00, 0x00, // sition......k... + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, // v_texcoord0..... + 0x78, 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, // x...bgfx_FragDat + 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, // a0..G...6..."... + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, // ....G...6...!... + 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, // ....G...9..."... + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, // ....G...9...!... + 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...~....... + 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...~....... + 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, // #.......H...~... + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, // ............H... + 0x7e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, // ~...........H... + 0x7e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, // ~.......#...0... + 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, // H...~........... + 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....H...~....... + 0x23, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, // #...`...H...~... + 0x03, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, // ....#...p...H... + 0x7e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // ~.......#....... + 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // H...~.......#... + 0x90, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, // ....H...~....... + 0x23, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x7e, 0x00, 0x00, 0x00, // #.......G...~... + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, // ....G......."... + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, // ....G.......!... + 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, // ....G...h....... + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, // ....G...k....... + 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x78, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, // ....G...x....... + 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, // ............!... + 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, // ................ + 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, // ........ ....... + 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ + 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // ................ + 0x20, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, // ...5........... + 0x3b, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ;...5...6....... + 0x20, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ...8........... + 0x3b, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ;...8...9....... + 0x15, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....<... ....... + 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // +...<...=....... + 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // +...<...A....... + 0x1b, 0x00, 0x03, 0x00, 0x45, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, // ....E........... + 0x63, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // c... .......+... + 0x63, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // c...d.......+... + 0x63, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // c...g.......+... + 0x07, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x05, 0x00, // ....k.......,... + 0x0b, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, // ....n...k...k... + 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // +.......x......? + 0x17, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....y........... + 0x18, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....}...y....... + 0x1e, 0x00, 0x09, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, // ....~...}...}... 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, // ................ - 0x20, 0x00, 0x04, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, // ...........~... - 0x3b, 0x00, 0x04, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ;............... - 0x20, 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, // ...........}... - 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // +...<........... - 0x20, 0x00, 0x04, 0x00, 0x88, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, // ............... - 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, // +..............? - 0x2c, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, // ,............... - 0x8d, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, // ....+........... - 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, // ...@+...<....... - 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // .... ........... - 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x63, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, // ....+...c....... - 0x03, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // ............+... - 0x3c, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // <...........+... - 0x63, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // c...........+... - 0x3c, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // <...........+... - 0x3c, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x07, 0x00, // <...........,... - 0x0d, 0x00, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, // ....5...x...x... - 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // x...x...+....... - 0x39, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x20, 0x00, 0x04, 0x00, 0x63, 0x01, 0x00, 0x00, // 9.....@@ ...c... - 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x63, 0x01, 0x00, 0x00, // ........;...c... - 0x64, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x67, 0x01, 0x00, 0x00, // d....... ...g... - 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x67, 0x01, 0x00, 0x00, // ........;...g... - 0x68, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x67, 0x01, 0x00, 0x00, // h.......;...g... - 0x6b, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x77, 0x01, 0x00, 0x00, // k....... ...w... - 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x77, 0x01, 0x00, 0x00, // ........;...w... - 0x78, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x0d, 0x00, 0x00, 0x00, // x............... - 0xb6, 0x02, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // ....6........... - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, // ................ - 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, // =.......7...6... - 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, // =.......:...9... - 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, // =.......i...h... - 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, // =.......l...k... - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, // Q.......A...i... - 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, // ....Q.......B... - 0x69, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x79, 0x00, 0x00, 0x00, // i.......P...y... - 0x43, 0x02, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, // C...A...B...x... - 0x41, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A.......D....... - 0x41, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, // A...=...}...E... - 0x44, 0x02, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x79, 0x00, 0x00, 0x00, 0x46, 0x02, 0x00, 0x00, // D.......y...F... - 0x43, 0x02, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, // C...E...O....... - 0x47, 0x02, 0x00, 0x00, 0x46, 0x02, 0x00, 0x00, 0x46, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // G...F...F....... - 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, // ............H... - 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x02, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // ........G...A... - 0x88, 0x00, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, // ....I........... - 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, // =.......J...I... - 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x4b, 0x02, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, // O.......K...J... - 0x4a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, // J............... - 0x0b, 0x00, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x4b, 0x02, 0x00, 0x00, // ....L...H...K... - 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A.......N....... - 0x87, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, // ....=.......O... - 0x4e, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, // N...O.......P... - 0x4f, 0x02, 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // O...O........... - 0x85, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, // ........Q...L... - 0x50, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, // P...........R... - 0x8e, 0x00, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ....Q...Q....... - 0x54, 0x02, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, // T...R........... - 0x07, 0x00, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, // ....U.......+... - 0x54, 0x02, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // T...k...x...Q... - 0x07, 0x00, 0x00, 0x00, 0x57, 0x02, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....W...R....... - 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........X....... - 0x2b, 0x00, 0x00, 0x00, 0x57, 0x02, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, // +...W...k...x... - 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, // ........Y...U... - 0x58, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, // X...Q.......]... - 0x6c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // l............... - 0x5e, 0x02, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, // ^...]........... - 0x07, 0x00, 0x00, 0x00, 0x5f, 0x02, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, // ...._...^...x... - 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........`....... - 0x04, 0x00, 0x00, 0x00, 0x5f, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ...._........... - 0x61, 0x02, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, // a...x...`...A... - 0xa6, 0x00, 0x00, 0x00, 0x62, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, // ....b........... - 0x67, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, // g...=.......c... - 0x62, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x64, 0x02, 0x00, 0x00, // b...........d... - 0x61, 0x02, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, // a...c........... - 0x65, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, // e.......%...x... - 0x64, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x67, 0x02, 0x00, 0x00, // d...Q.......g... - 0x6c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, // l............... - 0x68, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, // h.......%...x... - 0x67, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x69, 0x02, 0x00, 0x00, // g...........i... - 0x65, 0x02, 0x00, 0x00, 0x68, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, // e...h...A....... - 0xa9, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, // ................ - 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0xa9, 0x01, 0x00, 0x00, // =............... - 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, // ................ - 0x6b, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x34, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // k.......4....... - 0xfa, 0x00, 0x04, 0x00, 0xab, 0x01, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, // ................ - 0xf8, 0x00, 0x02, 0x00, 0xac, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... - 0xae, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ....i.......Q... - 0x07, 0x00, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........i....... - 0x50, 0x00, 0x06, 0x00, 0x79, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, // P...y........... - 0xaf, 0x01, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, // ....x...A....... - 0xb1, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, // ........=...=... - 0x7d, 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, // }............... - 0x79, 0x00, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, // y............... - 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, // O............... - 0xb3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // ............A... - 0x88, 0x00, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, // ................ - 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, // =............... - 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, // O............... - 0xb7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, // ............A... - 0xa6, 0x00, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, // ................ - 0xd5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, // ....=........... - 0xb9, 0x01, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, // ....P.......q... - 0xba, 0x01, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, // ................ - 0x72, 0x02, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, // r.......q....... - 0x0b, 0x00, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // ....t........... - 0xb4, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, // ............v... - 0x74, 0x02, 0x00, 0x00, 0x72, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // t...r...Q....... - 0x78, 0x02, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // x...v.......Q... - 0x07, 0x00, 0x00, 0x00, 0x7a, 0x02, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....z...v....... - 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7b, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........{....... - 0x28, 0x00, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x7a, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, // (...x...z....... - 0x07, 0x00, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, // ....|.......%... - 0x7b, 0x02, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, // {...k........... - 0x7e, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, // ~.......(...v... - 0x6e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, // n............... - 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, // ....B...~....... - 0x07, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, // ........|....... - 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x82, 0x02, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, // ................ - 0xba, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, // ....A........... - 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, // ........d...=... - 0x07, 0x00, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, // ................ - 0x07, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, // ................ - 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0x82, 0x02, 0x00, 0x00, // ................ - 0xbe, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, // ....A........... - 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, // ........d...=... - 0x07, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, // ................ - 0x07, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, // ................ - 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x2b, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, // +.......k...x... - 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, // P............... - 0xc3, 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // ............A... - 0x88, 0x00, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, // ................ - 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, // =............... - 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A............... - 0xe3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, // ....=........... - 0xc8, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, // ................ - 0xc5, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, // ................ - 0x69, 0x02, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, // i...Y........... - 0xcf, 0x01, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // ................ - 0x34, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, // 4...........A... - 0xa6, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, // ................ - 0xbc, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, // ....=........... - 0xd2, 0x01, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, // ................ - 0xd3, 0x01, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x33, 0x02, 0x00, 0x00, // ....x.......3... - 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xd4, 0x01, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, // ................ - 0x06, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... - 0x07, 0x00, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........i....... - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, // Q...........i... - 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x79, 0x00, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, // ....P...y....... - 0xd7, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // ........x...A... - 0x81, 0x00, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, // ............=... - 0x3d, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, // =...}........... - 0x90, 0x00, 0x05, 0x00, 0x79, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, // ....y........... - 0xdb, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, // ....O........... - 0xdc, 0x01, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A............... - 0xcd, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, // ....=........... - 0xde, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, // ....O........... - 0xdf, 0x01, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x88, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, // ................ - 0xe0, 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x45, 0x00, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, // ....V...E....... - 0x3a, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, // :...7...W....... - 0x91, 0x02, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, // ............A... - 0xa6, 0x00, 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, // ................ - 0xd5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, // ....=........... - 0xe5, 0x01, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xe7, 0x01, 0x00, 0x00, // ................ - 0xe6, 0x01, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xf4, 0x01, 0x00, 0x00, // ....x........... - 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xe7, 0x01, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, // ................ - 0xf4, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, // ............O... - 0x79, 0x00, 0x00, 0x00, 0xea, 0x01, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, // y............... - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... - 0x07, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................ - 0x8e, 0x00, 0x05, 0x00, 0x79, 0x00, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0xea, 0x01, 0x00, 0x00, // ....y........... - 0xec, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xef, 0x01, 0x00, 0x00, // ....Q........... - 0x91, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... - 0xf0, 0x01, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... - 0x07, 0x00, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf2, 0x01, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, // Q............... - 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, // ....P........... - 0xf0, 0x01, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, 0xf2, 0x01, 0x00, 0x00, 0xef, 0x01, 0x00, 0x00, // ................ - 0xf9, 0x00, 0x02, 0x00, 0xf4, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf4, 0x01, 0x00, 0x00, // ................ - 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, // ................ - 0xd5, 0x01, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, // ............A... - 0xa6, 0x00, 0x00, 0x00, 0xf5, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, // ................ - 0xd5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, // ....=........... - 0xf5, 0x01, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00, // ................ - 0xf6, 0x01, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xfb, 0x01, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xf7, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, // ................ - 0xfb, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, // ............O... - 0x0d, 0x00, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0xf9, 0x00, 0x02, 0x00, 0xfb, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xfb, 0x01, 0x00, 0x00, // ................ - 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, // ................ - 0xf4, 0x01, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // ............A... - 0x88, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, // ................ - 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xfd, 0x01, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, // =............... - 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, // ................ - 0xfd, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, // ................ - 0x69, 0x02, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, // i...Y........... - 0x04, 0x02, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // ................ - 0x33, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x06, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, // 3...........A... - 0xa6, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, // ................ - 0xbc, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, // ....=........... - 0x07, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, // ................ - 0x08, 0x02, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x32, 0x02, 0x00, 0x00, // ............2... - 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x09, 0x02, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, // ................ - 0x0b, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0a, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // ................ - 0x32, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0b, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, // 2...........A... - 0xa6, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, // ................ - 0xbc, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0d, 0x02, 0x00, 0x00, // ....=........... - 0x0c, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, // ................ - 0x0d, 0x02, 0x00, 0x00, 0x39, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x31, 0x02, 0x00, 0x00, // ....9.......1... - 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x0f, 0x02, 0x00, 0x00, // ................ - 0x31, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0f, 0x02, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, // 1...........V... - 0x45, 0x00, 0x00, 0x00, 0x98, 0x02, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, // E.......:...7... - 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0x98, 0x02, 0x00, 0x00, // W............... - 0x6c, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, // l...A........... - 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, // ............=... - 0x07, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, // ................ - 0xbf, 0x00, 0x00, 0x00, 0x15, 0x02, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, // ............x... - 0xf7, 0x00, 0x03, 0x00, 0x22, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, // ...."........... - 0x15, 0x02, 0x00, 0x00, 0x16, 0x02, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // ........"....... - 0x16, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x79, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, // ....O...y....... - 0x9a, 0x02, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, // ....Q........... - 0x9a, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x79, 0x00, 0x00, 0x00, // ............y... - 0x1b, 0x02, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... - 0x07, 0x00, 0x00, 0x00, 0x1d, 0x02, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................ - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, // Q............... - 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1f, 0x02, 0x00, 0x00, // ....Q........... - 0x1b, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... - 0x20, 0x02, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, // ...........P... - 0x0d, 0x00, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, 0x1f, 0x02, 0x00, 0x00, // ....!........... - 0x20, 0x02, 0x00, 0x00, 0x1d, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x22, 0x02, 0x00, 0x00, // ..........."... - 0xf8, 0x00, 0x02, 0x00, 0x22, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, // ...."........... - 0xae, 0x02, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0x0f, 0x02, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, // ............!... - 0x16, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, // ....A.......#... - 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, // ............=... - 0x07, 0x00, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, // ....$...#....... - 0xbf, 0x00, 0x00, 0x00, 0x25, 0x02, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, // ....%...$....... - 0xf7, 0x00, 0x03, 0x00, 0x29, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, // ....)........... - 0x25, 0x02, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, 0x29, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // %...&...)....... - 0x26, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, // &...O.......(... - 0xae, 0x02, 0x00, 0x00, 0xae, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x29, 0x02, 0x00, 0x00, // ............)... - 0xf8, 0x00, 0x02, 0x00, 0x29, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, // ....)........... - 0xaf, 0x02, 0x00, 0x00, 0xae, 0x02, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, // ........"...(... - 0x26, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, // &...........,... - 0xaf, 0x02, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, // ....Y...A....... - 0x2e, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, // ............=... - 0x0d, 0x00, 0x00, 0x00, 0x2f, 0x02, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, // ..../........... - 0x0d, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x2f, 0x02, 0x00, 0x00, // ....0...,.../... - 0xf9, 0x00, 0x02, 0x00, 0x31, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x31, 0x02, 0x00, 0x00, // ....1.......1... - 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb5, 0x02, 0x00, 0x00, 0xb6, 0x02, 0x00, 0x00, // ................ - 0x0b, 0x02, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x29, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // ....0...)....... - 0x32, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x32, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, // 2.......2....... - 0x0d, 0x00, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, // ........5....... - 0xb5, 0x02, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x33, 0x02, 0x00, 0x00, // ....1.......3... - 0xf8, 0x00, 0x02, 0x00, 0x33, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, // ....3........... - 0xb3, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0xfb, 0x01, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, // ................ - 0x32, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x34, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // 2.......4....... - 0x34, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb2, 0x02, 0x00, 0x00, // 4............... - 0xcf, 0x01, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0xb3, 0x02, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, // ............3... - 0x3e, 0x00, 0x03, 0x00, 0x78, 0x01, 0x00, 0x00, 0xb2, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, // >...x........... - 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0xb0, 0x00, // 8....... -}; -static const uint8_t fs_nanovg_fill_dx9[1621] = -{ - 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x05, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x75, // _tex0..........u - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x01, 0x09, // _extentRadius... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, // ........u_innerC - 0x6f, 0x6c, 0x12, 0x01, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x6f, // ol...........u_o - 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x01, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // uterCol......... - 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x13, 0x01, 0x03, 0x00, // ..u_paintMat.... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, // .......u_params. - 0x01, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, // ..........u_scis - 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x01, 0x08, 0x00, 0x01, // sorExtScale..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, // ......u_scissorM - 0x61, 0x74, 0x13, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x05, 0x00, 0x00, // at.............. - 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x61, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, // ......a.CTAB.... - 0x57, 0x01, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, // W............... - 0x00, 0x91, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....P........... - 0x01, 0x00, 0x02, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, // ................ - 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0xf4, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, // ................ - 0x03, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, // ............(... - 0x02, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x31, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, // 1............... - 0x00, 0x00, 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....C........... - 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x00, 0xab, 0xab, // ........s_tex... - 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x00, 0xab, // u_extentRadius.. - 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, 0x75, 0x5f, 0x6f, 0x75, 0x74, // u_innerCol.u_out - 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, // erCol.u_paintMat - 0x00, 0xab, 0xab, 0xab, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x75, 0x5f, 0x73, // ....u_params.u_s - 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0x75, // cissorExtScale.u - 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x00, 0x70, 0x73, 0x5f, 0x33, // _scissorMat.ps_3 - 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, // _0.Microsoft (R) - 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, // HLSL Shader Com - 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, // piler 10.1..Q... - 0x0b, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0xbf, // .......?...@.... - 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x0c, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x00, // ...?Q........... - 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, // ..@@............ - 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, // ................ - 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x02, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xe4, 0x8b, // ................ - 0x08, 0x00, 0xe4, 0xa1, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0b, 0x80, 0x0b, 0x00, 0xe4, 0xa0, // ................ - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x13, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0xee, 0xa1, // ................ - 0x01, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, // ..............U. - 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x01, 0x00, 0x00, 0x90, // ................ - 0x0b, 0x00, 0x55, 0xa0, 0x0b, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, // ..U............. - 0x00, 0x00, 0x55, 0x8c, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, // ..U............. - 0x00, 0x00, 0x55, 0x80, 0x0a, 0x00, 0x55, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, // ..U...U......... - 0x00, 0x00, 0x55, 0x80, 0x0b, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, // ..U............. - 0x01, 0x00, 0x55, 0x90, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, // ..U............. - 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x23, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, // ..U.....#....... - 0x0a, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x03, 0x80, 0x04, 0x00, 0xe4, 0xa0, // ................ - 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x03, 0x80, 0x03, 0x00, 0xe4, 0xa0, // ..U............. - 0x00, 0x00, 0x00, 0x90, 0x02, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x03, 0x80, // ................ - 0x02, 0x00, 0xe4, 0x80, 0x05, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0c, 0x80, // ................ - 0x09, 0x00, 0xaa, 0xa1, 0x09, 0x00, 0x44, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0c, 0x80, // ......D......... - 0x02, 0x00, 0xe4, 0x81, 0x02, 0x00, 0x44, 0x8b, 0x0b, 0x00, 0x00, 0x03, 0x03, 0x00, 0x03, 0x80, // ......D......... - 0x02, 0x00, 0xee, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x5a, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, // ........Z....... - 0x03, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, // ................ - 0x00, 0x00, 0xff, 0x80, 0x0b, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, // ................ - 0x02, 0x00, 0xff, 0x80, 0x0a, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, // ................ - 0x0c, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, // ................ - 0x02, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, // ................ - 0x09, 0x00, 0xaa, 0xa1, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x0a, 0x00, 0x00, 0xa0, // ................ - 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0x80, 0x06, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, // ................ - 0x0a, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x18, 0x80, 0x00, 0x00, 0xff, 0x80, // ................ - 0x01, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, // ................ - 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x09, 0x00, 0x00, 0xa0, // ..U............. - 0x06, 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x09, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, // ..........U..... - 0x01, 0x00, 0x05, 0x80, 0x02, 0x00, 0xd4, 0x80, 0x03, 0x00, 0xd4, 0x80, 0x42, 0x00, 0x00, 0x03, // ............B... - 0x02, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe8, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, // ................ - 0x01, 0x00, 0x0d, 0x80, 0x01, 0x00, 0x77, 0x81, 0x0a, 0x00, 0xa7, 0xa0, 0x05, 0x00, 0x00, 0x03, // ......w......... - 0x03, 0x00, 0x07, 0x80, 0x02, 0x00, 0xff, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x58, 0x00, 0x00, 0x04, // ............X... - 0x02, 0x00, 0x07, 0x80, 0x01, 0x00, 0xaa, 0x8c, 0x03, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80, // ................ - 0x58, 0x00, 0x00, 0x04, 0x02, 0x00, 0x0e, 0x80, 0x01, 0x00, 0xff, 0x8c, 0x02, 0x00, 0x00, 0x80, // X............... - 0x02, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80, // ................ - 0x06, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, // ..............U. - 0x02, 0x00, 0xe4, 0x80, 0x29, 0x00, 0x02, 0x02, 0x0a, 0x00, 0xff, 0xa0, 0x01, 0x00, 0x55, 0x80, // ....).........U. - 0x01, 0x00, 0x00, 0x02, 0x03, 0x00, 0x0f, 0x80, 0x0b, 0x00, 0xff, 0xa0, 0x2a, 0x00, 0x00, 0x00, // ............*... - 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x0c, 0x00, 0x55, 0xa0, 0x29, 0x00, 0x02, 0x02, // ..........U.)... - 0x0a, 0x00, 0xff, 0xa0, 0x01, 0x00, 0x55, 0x80, 0x42, 0x00, 0x00, 0x03, 0x04, 0x00, 0x0f, 0x80, // ......U.B....... - 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x05, 0x00, 0x07, 0x80, // ................ - 0x04, 0x00, 0xff, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x58, 0x00, 0x00, 0x04, 0x04, 0x00, 0x07, 0x80, // ........X....... - 0x01, 0x00, 0xaa, 0x8c, 0x05, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x58, 0x00, 0x00, 0x04, // ............X... - 0x04, 0x00, 0x0e, 0x80, 0x01, 0x00, 0xff, 0x8c, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0xe4, 0x80, // ................ - 0x05, 0x00, 0x00, 0x03, 0x04, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0xe4, 0x80, // ................ - 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x0f, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xe4, 0xa0, // ................ - 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x03, 0x00, 0x0f, 0x80, 0x0c, 0x00, 0x00, 0xa0, // *............... - 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, // +...+...X....... - 0x01, 0x00, 0x00, 0x8c, 0x02, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, // ................ - 0x02, 0x00, 0x0f, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, // ................ - 0x02, 0x00, 0xe4, 0x81, 0x07, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x0f, 0x80, // ................ - 0x00, 0x00, 0xff, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, // ................ - 0x02, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x58, 0x00, 0x00, 0x04, // ......U.....X... - 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x02, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, // ................ - 0xff, 0xff, 0x00, 0x00, 0x00, // ..... + 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // .... ........... + 0x7e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // ~...;........... + 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // .... ........... + 0x7d, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, // }...+...<....... + 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x88, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // .... ........... + 0x0d, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, // ....+........... + 0x00, 0x00, 0x00, 0x3f, 0x2c, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, // ...?,........... + 0x8d, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........+....... + 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, // .......@+...<... + 0xa5, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xa6, 0x00, 0x00, 0x00, // ........ ....... + 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x63, 0x00, 0x00, 0x00, // ........+...c... + 0xbc, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0xbf, 0x00, 0x00, 0x00, // ................ + 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, // +...<........... + 0x2b, 0x00, 0x04, 0x00, 0x63, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // +...c........... + 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // +...<........... + 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // +...<........... + 0x2c, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, // ,.......5...x... + 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // x...x...x...+... + 0x07, 0x00, 0x00, 0x00, 0x39, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x20, 0x00, 0x04, 0x00, // ....9.....@@ ... + 0x67, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, // g...........;... + 0x67, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, // g...h.......;... + 0x67, 0x01, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, // g...k....... ... + 0x77, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, // w...........;... + 0x77, 0x01, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // w...x.......+... + 0x07, 0x00, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x01, 0x00, 0x03, 0x00, // ................ + 0x0d, 0x00, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, // ........6....... + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // ................ + 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, // ....=.......7... + 0x36, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, // 6...=.......:... + 0x39, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, // 9...=.......i... + 0x68, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, // h...=.......l... + 0x6b, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, // k...Q.......A... + 0x69, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // i.......Q....... + 0x42, 0x02, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, // B...i.......P... + 0x79, 0x00, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, // y...C...A...B... + 0x78, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, // x...A.......D... + 0x80, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, 0x00, // ....A...=...}... + 0x45, 0x02, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x79, 0x00, 0x00, 0x00, // E...D.......y... + 0x46, 0x02, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, // F...C...E...O... + 0x0b, 0x00, 0x00, 0x00, 0x47, 0x02, 0x00, 0x00, 0x46, 0x02, 0x00, 0x00, 0x46, 0x02, 0x00, 0x00, // ....G...F...F... + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, // ................ + 0x48, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x02, 0x00, 0x00, // H...........G... + 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A.......I....... + 0x87, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, // ....=.......J... + 0x49, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x4b, 0x02, 0x00, 0x00, // I...O.......K... + 0x4a, 0x02, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // J...J........... + 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, // ........L...H... + 0x4b, 0x02, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, 0x4e, 0x02, 0x00, 0x00, // K...A.......N... + 0x80, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, // ........=....... + 0x4f, 0x02, 0x00, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, // O...N...O....... + 0x50, 0x02, 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // P...O...O....... + 0x03, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xae, 0x02, 0x00, 0x00, // ................ + 0x4c, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, // L...........R... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xae, 0x02, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, // ....2.......P... + 0x8e, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x54, 0x02, 0x00, 0x00, // ....Q.......T... + 0x52, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, // R............... + 0x55, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x54, 0x02, 0x00, 0x00, // U.......+...T... + 0x6b, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // k...x...Q....... + 0x57, 0x02, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, // W...R........... + 0x07, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, // ....X.......+... + 0x57, 0x02, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, // W...k...x....... + 0x07, 0x00, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, // ....Y...U...X... + 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, // Q.......]...l... + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5f, 0x02, 0x00, 0x00, // ............_... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, // ....2...]....... + 0xb0, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, // ............`... + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, // ........_....... + 0x07, 0x00, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, // ....a...x...`... + 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x62, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A.......b....... + 0xa5, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ....g...=....... + 0x63, 0x02, 0x00, 0x00, 0x62, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // c...b........... + 0x64, 0x02, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, // d...a...c....... + 0x07, 0x00, 0x00, 0x00, 0x65, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, // ....e.......%... + 0x78, 0x00, 0x00, 0x00, 0x64, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // x...d...Q....... + 0x67, 0x02, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, // g...l........... + 0x07, 0x00, 0x00, 0x00, 0x68, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, // ....h.......%... + 0x78, 0x00, 0x00, 0x00, 0x67, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // x...g........... + 0x69, 0x02, 0x00, 0x00, 0x65, 0x02, 0x00, 0x00, 0x68, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, // i...e...h...A... + 0xa6, 0x00, 0x00, 0x00, 0xa9, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, // ................ + 0xbc, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, // ....=........... + 0xa9, 0x01, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, // ................ + 0xaa, 0x01, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x34, 0x02, 0x00, 0x00, // ....k.......4... + 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xab, 0x01, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, // ................ + 0xd1, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xac, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... + 0x07, 0x00, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........i....... + 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, // Q...........i... + 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x79, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, // ....P...y....... + 0xae, 0x01, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // ........x...A... + 0x81, 0x00, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, // ............=... + 0x3d, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, // =...}........... + 0x90, 0x00, 0x05, 0x00, 0x79, 0x00, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, // ....y........... + 0xb2, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, // ....O........... + 0xb3, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A............... + 0xcd, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, // ....=........... + 0xb6, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, // ....O........... + 0xb7, 0x01, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A............... + 0xcd, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........=....... + 0xba, 0x01, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, // ........P....... + 0x71, 0x02, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, // q............... + 0x0b, 0x00, 0x00, 0x00, 0x72, 0x02, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, // ....r.......q... + 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........t....... + 0x04, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, // ................ + 0x76, 0x02, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, 0x72, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // v...t...r...Q... + 0x07, 0x00, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....x...v....... + 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7a, 0x02, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, // Q.......z...v... + 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7b, 0x02, 0x00, 0x00, // ............{... + 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x7a, 0x02, 0x00, 0x00, // ....(...x...z... + 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........|....... + 0x25, 0x00, 0x00, 0x00, 0x7b, 0x02, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, // %...{...k....... + 0x0b, 0x00, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, // ....~.......(... + 0x76, 0x02, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, // v...n........... + 0x7f, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, // ........B...~... + 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00, // ............|... + 0x7f, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x82, 0x02, 0x00, 0x00, // ................ + 0x80, 0x02, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, // ........A....... + 0xbc, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, // ............d... + 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, // =............... + 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x32, 0x00, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x82, 0x02, 0x00, 0x00, // 2............... + 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A............... + 0xa5, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ....d...=....... + 0xc1, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ................ + 0xc2, 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, // ................ + 0x07, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, // ............+... + 0xc2, 0x01, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, // ....k...x...P... + 0x0d, 0x00, 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, // ................ + 0xc3, 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, // ........A....... + 0xc6, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, // ............=... + 0x0d, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // ............A... + 0x88, 0x00, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, // ................ + 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, // =............... + 0x0c, 0x00, 0x08, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x2e, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, // ................ + 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x69, 0x02, 0x00, 0x00, // ............i... + 0x59, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xcf, 0x01, 0x00, 0x00, // Y............... + 0x88, 0x02, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x34, 0x02, 0x00, 0x00, // ............4... + 0xf8, 0x00, 0x02, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, // ........A....... + 0xd2, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, // ................ + 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, // =............... + 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, // ................ + 0x78, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x33, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // x.......3....... + 0xfa, 0x00, 0x04, 0x00, 0xd4, 0x01, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, // ................ + 0xf8, 0x00, 0x02, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... + 0xd7, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ....i.......Q... + 0x07, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........i....... + 0x50, 0x00, 0x06, 0x00, 0x79, 0x00, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, // P...y........... + 0xd8, 0x01, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, // ....x...A....... + 0xda, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, // ........=...=... + 0x7d, 0x00, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, // }............... + 0x79, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, // y............... + 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, // O............... + 0xdc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // ............A... + 0x88, 0x00, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, // ................ + 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, // =............... + 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, // O............... + 0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, // ................ + 0x0b, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, // ................ + 0x56, 0x00, 0x05, 0x00, 0x45, 0x00, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, // V...E.......:... + 0x37, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, // 7...W........... + 0x8f, 0x02, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, // ........A....... + 0xe5, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, // ................ + 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, // =............... + 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xe7, 0x01, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, // ................ + 0x78, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // x............... + 0xfa, 0x00, 0x04, 0x00, 0xe7, 0x01, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, // ................ + 0xf8, 0x00, 0x02, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x79, 0x00, 0x00, 0x00, // ........O...y... + 0xea, 0x01, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... + 0xec, 0x01, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, // ................ + 0x79, 0x00, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0xea, 0x01, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, // y............... + 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xef, 0x01, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, // Q............... + 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, // ....Q........... + 0xed, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... + 0xf1, 0x01, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... + 0x07, 0x00, 0x00, 0x00, 0xf2, 0x01, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ + 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, // P............... + 0xf1, 0x01, 0x00, 0x00, 0xf2, 0x01, 0x00, 0x00, 0xef, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // ................ + 0xf4, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf4, 0x01, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, // ................ + 0x0d, 0x00, 0x00, 0x00, 0xb3, 0x02, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, // ................ + 0xf3, 0x01, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, // ........A....... + 0xf5, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, // ................ + 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xf5, 0x01, 0x00, 0x00, // =............... + 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, // ................ + 0xa0, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xfb, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0xfa, 0x00, 0x04, 0x00, 0xf7, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xfb, 0x01, 0x00, 0x00, // ................ + 0xf8, 0x00, 0x02, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, // ........O....... + 0xfa, 0x01, 0x00, 0x00, 0xb3, 0x02, 0x00, 0x00, 0xb3, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // ................ + 0xfb, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xfb, 0x01, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, // ................ + 0x0d, 0x00, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0xb3, 0x02, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, // ................ + 0xfa, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, // ........A....... + 0xfc, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, // ............=... + 0x0d, 0x00, 0x00, 0x00, 0xfd, 0x01, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, // ................ + 0x0d, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0xfd, 0x01, 0x00, 0x00, // ................ + 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x69, 0x02, 0x00, 0x00, // ............i... + 0x59, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, // Y............... + 0xff, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x33, 0x02, 0x00, 0x00, // ............3... + 0xf8, 0x00, 0x02, 0x00, 0x06, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, // ........A....... + 0x07, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, // ................ + 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, // =............... + 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, // ................ + 0xa0, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x32, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........2....... + 0xfa, 0x00, 0x04, 0x00, 0x09, 0x02, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0x0b, 0x02, 0x00, 0x00, // ................ + 0xf8, 0x00, 0x02, 0x00, 0x0a, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x32, 0x02, 0x00, 0x00, // ............2... + 0xf8, 0x00, 0x02, 0x00, 0x0b, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, // ........A....... + 0x0c, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, // ................ + 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0d, 0x02, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, // =............... + 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x0d, 0x02, 0x00, 0x00, // ................ + 0x39, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x31, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 9.......1....... + 0xfa, 0x00, 0x04, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x0f, 0x02, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, // ............1... + 0xf8, 0x00, 0x02, 0x00, 0x0f, 0x02, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x45, 0x00, 0x00, 0x00, // ........V...E... + 0x98, 0x02, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, // ....:...7...W... + 0x0d, 0x00, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0x98, 0x02, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, // ............l... + 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A............... + 0xa5, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........=....... + 0x14, 0x02, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, // ................ + 0x15, 0x02, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, // ........x....... + 0x22, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x15, 0x02, 0x00, 0x00, // "............... + 0x16, 0x02, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x16, 0x02, 0x00, 0x00, // ...."........... + 0x4f, 0x00, 0x08, 0x00, 0x79, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, // O...y........... + 0x9a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ + 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, // Q............... + 0x03, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, // ........y....... + 0x18, 0x02, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... + 0x1d, 0x02, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... + 0x07, 0x00, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1f, 0x02, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, // Q............... + 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, // ....Q....... ... + 0x1b, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, // ........P....... + 0x21, 0x02, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, 0x1f, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, // !........... ... + 0x1d, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x22, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // ........"....... + 0x22, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, // "............... + 0x9a, 0x02, 0x00, 0x00, 0x0f, 0x02, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x16, 0x02, 0x00, 0x00, // ........!....... + 0x41, 0x00, 0x06, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // A.......#....... + 0xa5, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........=....... + 0x24, 0x02, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbf, 0x00, 0x00, 0x00, // $...#........... + 0x25, 0x02, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, // %...$........... + 0x29, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x25, 0x02, 0x00, 0x00, // )...........%... + 0x26, 0x02, 0x00, 0x00, 0x29, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x26, 0x02, 0x00, 0x00, // &...).......&... + 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, // O.......(....... + 0xb1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x29, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // ........)....... + 0x29, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb2, 0x02, 0x00, 0x00, // )............... + 0xb1, 0x02, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, // ...."...(...&... + 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0xb2, 0x02, 0x00, 0x00, // ........,....... + 0x59, 0x02, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x88, 0x00, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, // Y...A........... + 0x80, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, // ........=....... + 0x2f, 0x02, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, // /............... + 0x30, 0x02, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x2f, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // 0...,.../....... + 0x31, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x31, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, // 1.......1....... + 0x0d, 0x00, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0x0b, 0x02, 0x00, 0x00, // ................ + 0x30, 0x02, 0x00, 0x00, 0x29, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x32, 0x02, 0x00, 0x00, // 0...).......2... + 0xf8, 0x00, 0x02, 0x00, 0x32, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, // ....2........... + 0xb7, 0x02, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, // ....5........... + 0x31, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x33, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // 1.......3....... + 0x33, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb6, 0x02, 0x00, 0x00, // 3............... + 0x04, 0x02, 0x00, 0x00, 0xfb, 0x01, 0x00, 0x00, 0xb7, 0x02, 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, // ............2... + 0xf9, 0x00, 0x02, 0x00, 0x34, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x34, 0x02, 0x00, 0x00, // ....4.......4... + 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb5, 0x02, 0x00, 0x00, 0xcf, 0x01, 0x00, 0x00, // ................ + 0xac, 0x01, 0x00, 0x00, 0xb6, 0x02, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, // ........3...>... + 0x78, 0x01, 0x00, 0x00, 0xb5, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, // x...........8... + 0x00, 0x00, 0xb0, 0x00, // .... }; -static const uint8_t fs_nanovg_fill_dx11[2416] = +static const uint8_t fs_nanovg_fill_dx11[2420] = { - 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x75, // FSH............u 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x13, 0x00, 0x00, 0x00, 0x03, // _scissorMat..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, // ......u_paintMat 0x13, 0x00, 0x30, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // ..0........u_inn @@ -845,10 +736,9 @@ static const uint8_t fs_nanovg_fill_dx11[2416] = 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, // .u_extentRadius. 0x00, 0x90, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ..........u_para 0x6d, 0x73, 0x12, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // ms...........s_t - 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // ex0..........s_t - 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x08, 0x00, 0x00, // ex0............. - 0x44, 0x58, 0x42, 0x43, 0x21, 0x36, 0x2a, 0x19, 0x73, 0x28, 0xce, 0xe0, 0xff, 0xcd, 0x27, 0x27, // DXBC!6*.s(....'' - 0x8e, 0x5c, 0x18, 0x73, 0x01, 0x00, 0x00, 0x00, 0x9c, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ...s............ + 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x08, 0x00, 0x00, // ex0............. + 0x44, 0x58, 0x42, 0x43, 0x3f, 0x86, 0x86, 0x0a, 0xea, 0xf5, 0x27, 0x11, 0x51, 0x17, 0x18, 0x97, // DXBC?.....'.Q... + 0x9b, 0x8e, 0x53, 0xe7, 0x01, 0x00, 0x00, 0x00, 0xb0, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ..S............. 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, // ,...........ISGN 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, // h...........P... 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ @@ -860,149 +750,151 @@ static const uint8_t fs_nanovg_fill_dx11[2416] = 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET... - 0x53, 0x48, 0x44, 0x52, 0xc4, 0x07, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, // SHDR....@....... - 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, // Y...F. ......... - 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, // Z....`......X... - 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b... - 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xc2, 0x10, 0x10, 0x00, // 2.......b....... - 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ...... - 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, // h.......8...2... - 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, // ....V.......F. . - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, // ........2...2... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....F. ......... - 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, // ....2.......F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....F. ......... - 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x80, // ....2.......F... - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, // ........F. .A... - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x20, 0x00, 0x0e, 0x32, 0x00, 0x10, 0x00, // ........2 ..2... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....F...A....... - 0xe6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // .. ..........@.. - 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?...?........ - 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 8............... - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, // ............2... - 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ".......*....... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, // .@.....@.@...... - 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, // ...."........... - 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // .........@.....? - 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 8..."........... - 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ...... ......... - 0x33, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 3..."........... - 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x33, 0x00, 0x00, 0x07, // .....@.....?3... - 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // B.......:....... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, // .@.....?8..."... - 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // ....*........... - 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........B....... - 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // :. ..........@.. - 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, 0x03, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........*....... - 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // ...... ......... - 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, // 2............. . - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, // .............. . - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, // ............2... - 0x01, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... .A....... - 0x09, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, // ....F. ......... - 0x00, 0x00, 0x00, 0x09, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x80, // ................ - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // ............A... - 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....4........... - 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // :.......*....... - 0x33, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // 3............... - 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x0a, // .....@......4... - 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .@.............. - 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........B....... - 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x4b, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // K...B.......*... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........B....... - 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // *............... - 0x00, 0x00, 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // ....B.......*... - 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....*. .A....... - 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2...B....... - 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // .. ..........@.. - 0x00, 0x00, 0x00, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x20, 0x00, 0x08, // ...?*........ .. - 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // B.......*....... - 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // .. ............. - 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, // ........F. .A... - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... - 0x07, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....2........... - 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........F....... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // F. .........8... - 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // B............... - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x20, 0x10, 0x00, // ........8.... .. - 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... - 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, // ............B... + 0x53, 0x48, 0x45, 0x58, 0xd8, 0x07, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, // SHEX....P....... + 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // j...Y...F. ..... + 0x0b, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....Z....`...... + 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, // X....p......UU.. + 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // b...2.......b... + 0xc2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... .. + 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....h.......8... + 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // 2.......V....... + 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // F. .........2... + 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 2.......F. ..... + 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........2....... + 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F. ..... + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........2....... + 0x46, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x80, // F...........F. . + 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x20, 0x00, 0x0e, // A...........2 .. + 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // 2.......F...A... + 0x00, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ...... ......... + 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, // .@.....?...?.... + 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x10, 0x10, 0x00, // 2...".......*... + 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x40, 0x00, 0x00, // .....@.....@.@.. + 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........"....... + 0x1a, 0x00, 0x10, 0x80, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // .............@.. + 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?8..."....... + 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... + 0x0a, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....3..."....... + 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // .........@.....? + 0x33, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, // 3...B.......:... + 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x07, // .....@.....?8... + 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ".......*....... + 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, // ............B... 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ....:. ......... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x1f, 0x00, 0x04, 0x03, 0x2a, 0x00, 0x10, 0x00, // .@.....?....*... + 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, 0x03, 0x2a, 0x00, 0x10, 0x00, // .@..........*... 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V......... ..... 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // .. ............. 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ................ 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x08, // .. ............. - 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, // .. .........E... - 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F~.......`...... - 0x18, 0x00, 0x00, 0x0b, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, // .............. . - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........@...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x38, 0x00, 0x00, 0x07, // .......?...@8... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // r............... - 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, // F.......7...r... - 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ............F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, // ....F.......7... - 0xe2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........V....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // 8...........F... + 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // .. ............. + 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, // 2......... .A... + 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0xa6, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x10, 0x80, // ................ + 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // A.......4....... + 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // ....:.......*... + 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....3........... + 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........@...... + 0x34, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, // 4............... + 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....@.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, // ............B... + 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....K...B....... + 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, // *...........B... + 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // ....*........... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........B....... + 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, // *.......*. .A... + 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, // ........2...B... + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ...... ......... + 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // .@.....?*....... + 0x0e, 0x20, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // . ..B.......*... + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ...... ......... + 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x80, // ............F. . + 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // A...........F. . + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // ........2....... + 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, // ....F. ......... - 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // 8..."........... + 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // 8...B........... 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......V....... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . .............. 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, // F............... - 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ".......:. ..... - 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1f, 0x00, 0x04, 0x03, // .....@.....@.... - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // .....@.....?...? - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, // ...?...?........ - 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ".......:. ..... - 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x04, 0x03, // .....@....@@.... - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, // ........E....... - 0x01, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ............F~.. + 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // B.......:. ..... + 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x1f, 0x00, 0x04, 0x03, // .....@.....?.... + 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, // *.......8....... + 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, // ....V......... . + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, // ........2....... + 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ...... ......... + 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, // ...... ......... + 0x0e, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, // ...... ......... + 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, // E.......CU...... + 0x01, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ............F~.. 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0b, // .....`.......... - 0x62, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // b......... ..... - 0x0a, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // .....@.........? - 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, // ...@....8...r... + 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... + 0x0a, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....@.......... + 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, // ...?...@8...r... 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ............F... 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....7...r....... - 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // V.......F....... + 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........F....... 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, // F.......7....... - 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ....V.......8... - 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // F.......8.... .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. . - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, // ................ - 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0xb0, 0x00, // ........>....... + 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // ................ + 0x01, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....V.......8... + 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // F. .........8... + 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // "............... + 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x20, 0x10, 0x00, // ........8.... .. + 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ....V.......F... + 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, // ............"... + 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ....:. ......... + 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1f, 0x00, 0x04, 0x03, 0x1a, 0x00, 0x10, 0x00, // .@.....@........ + 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6.... ...... + 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // .@.....?...?...? + 0x00, 0x00, 0x80, 0x3f, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, // ...?........"... + 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ....:. ......... + 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x04, 0x03, 0x1a, 0x00, 0x10, 0x00, // .@....@@........ + 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, // ....E.......CU.. + 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F~.......`...... + 0x18, 0x00, 0x00, 0x0b, 0x62, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, // ....b......... . + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........@...... + 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ...?...@....8... + 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // r............... + 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, // F.......7...r... + 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....V.......F... + 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, // ....F.......7... + 0xe2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........V....... + 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // 8............... + 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....F.......8... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, // F. ............. + 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x01, // ............>... + 0x00, 0x00, 0xb0, 0x00, // .... }; -static const uint8_t fs_nanovg_fill_mtl[3752] = +static const uint8_t fs_nanovg_fill_mtl[3753] = { 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0c, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x11, 0x01, 0xff, 0xff, 0x01, // _texSampler..... - 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x0c, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, // ......s_texTextu - 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x0c, 0x75, 0x5f, 0x73, // re...........u_s + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, // ......s_texTextu + 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x75, 0x5f, 0x73, // re...........u_s 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x13, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, // cissorMat....... - 0x00, 0xfd, 0x7f, 0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, // ....u_scissorExt - 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x01, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x08, // Scale........... + 0x00, 0x00, 0x00, 0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, // ....u_scissorExt + 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x01, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // Scale........... 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0xa0, 0x00, 0x01, 0x00, 0x00, 0x00, // u_params........ - 0xfd, 0x7f, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x13, 0x01, 0x30, // ...u_paintMat..0 - 0x00, 0x03, 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, // ........u_extent - 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x01, 0x90, 0x00, 0x01, 0x00, 0x00, 0x00, 0xfd, 0x7f, // Radius.......... + 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x13, 0x01, 0x30, // ...u_paintMat..0 + 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, // ........u_extent + 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x01, 0x90, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // Radius.......... 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x01, 0x60, 0x00, 0x01, // .u_innerCol..`.. - 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x0a, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, // ......u_outerCol - 0x12, 0x01, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // ..p........s_tex - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x7f, 0xb6, 0x0d, 0x00, 0x00, 0x23, 0x69, // ..............#i + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, // ......u_outerCol + 0x12, 0x01, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // ..p........s_tex + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0x0d, 0x00, 0x00, 0x23, 0x69, // ..............#i 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, // nclude .#include < 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, 0x73, // simd/simd.h>..us @@ -1020,7 +912,7 @@ static const uint8_t fs_nanovg_fill_mtl[3752] = 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, // 4 u_extentRadius 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x70, // ;. float4 u_p 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, // arams;.};..const - 0x61, 0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x34, 0x20, // ant float4 _694 + 0x61, 0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x37, 0x20, // ant float4 _697 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // = {};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // float4 bgfx_ @@ -1047,182 +939,182 @@ static const uint8_t fs_nanovg_fill_mtl[3752] = 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // {. xlatMtlMai 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, // n_out out = {};. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x35, 0x39, 0x34, 0x20, // float2 _594 - 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2d, 0x20, // = float2(0.5) - - 0x28, 0x28, 0x61, 0x62, 0x73, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // ((abs((_mtl_u.u_ - 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, // scissorMat * flo + 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x2d, 0x28, 0x61, 0x62, 0x73, 0x28, 0x28, 0x5f, 0x6d, 0x74, // = fma(-(abs((_mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, // l_u.u_scissorMat + 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, // * float3(in.v_p + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, // osition, 1.0)).x + 0x79, 0x29, 0x20, 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, // y) - _mtl_u.u_sc + 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x78, 0x79, // issorExtScale.xy + 0x29, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, // ), _mtl_u.u_scis + 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x7a, 0x77, 0x2c, 0x20, // sorExtScale.zw, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // float2(0.5));. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x36, 0x30, 0x31, 0x20, 0x3d, 0x20, 0x66, // float _601 = f + 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x35, 0x39, 0x34, 0x2e, // ast::clamp(_594. + 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x66, // x, 0.0, 1.0) * f + 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x35, 0x39, 0x34, 0x2e, // ast::clamp(_594. + 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // y, 0.0, 1.0);. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x36, 0x31, 0x37, 0x20, 0x3d, 0x20, 0x66, // float _617 = f + 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, 0x6e, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x31, // ast::min(1.0, (1 + 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x69, 0x6e, 0x2e, // .0 - abs(fma(in. + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x2c, 0x20, 0x32, // v_texcoord0.x, 2 + 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, // .0, -1.0))) * _m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, // tl_u.u_params.y) + 0x20, 0x2a, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, 0x6e, 0x28, 0x31, 0x2e, 0x30, // * fast::min(1.0 + 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // , in.v_texcoord0 + 0x2e, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // .y);. float4 + 0x5f, 0x36, 0x39, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, // _693;. if (_m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, // tl_u.u_params.w + 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // == 0.0). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x36, 0x33, // float2 _63 + 0x30, 0x20, 0x3d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // 0 = abs((_mtl_u. + 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, // u_paintMat * flo 0x61, 0x74, 0x33, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // at3(in.v_positio - 0x6e, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x5f, // n, 1.0)).xy) - _ - 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, // mtl_u.u_scissorE - 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, // xtScale.xy) * _m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, // tl_u.u_scissorEx - 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x7a, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tScale.zw);. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x36, 0x30, 0x31, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, // float _601 = fas - 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x35, 0x39, 0x34, 0x2e, 0x78, 0x2c, // t::clamp(_594.x, - 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x61, 0x73, // 0.0, 1.0) * fas - 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x35, 0x39, 0x34, 0x2e, 0x79, 0x2c, // t::clamp(_594.y, - 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 0.0, 1.0);. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x36, 0x31, 0x37, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, // float _617 = fas - 0x74, 0x3a, 0x3a, 0x6d, 0x69, 0x6e, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x31, 0x2e, 0x30, // t::min(1.0, (1.0 - 0x20, 0x2d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, // - abs((in.v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, // coord0.x * 2.0) - 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // - 1.0)) * _mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x66, // .u_params.y) * f - 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, 0x6e, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x69, 0x6e, // ast::min(1.0, in - 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x29, 0x3b, // .v_texcoord0.y); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x30, // . float4 _690 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // ;. if (_mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x30, // .u_params.w == 0 - 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .0). {. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x36, 0x33, 0x30, 0x20, 0x3d, 0x20, // float2 _630 = - 0x61, 0x62, 0x73, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // abs((_mtl_u.u_pa - 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // intMat * float3( - 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, // in.v_position, 1 - 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // .0)).xy) - (_mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, // _u.u_extentRadiu - 0x73, 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x5f, 0x6d, // s.xy - float2(_m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, // tl_u.u_extentRad - 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ius.z));. - 0x20, 0x5f, 0x36, 0x39, 0x30, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // _690 = mix(_mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x5f, // _u.u_innerCol, _ - 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, // mtl_u.u_outerCol - 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, // , float4(fast::c - 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x28, 0x28, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, // lamp((((fast::mi - 0x6e, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x61, 0x78, 0x28, 0x5f, 0x36, 0x33, 0x30, // n(fast::max(_630 - 0x2e, 0x78, 0x2c, 0x20, 0x5f, 0x36, 0x33, 0x30, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, // .x, _630.y), 0.0 - 0x29, 0x20, 0x2b, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, // ) + length(fast: - 0x3a, 0x6d, 0x61, 0x78, 0x28, 0x5f, 0x36, 0x33, 0x30, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // :max(_630, float - 0x32, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // 2(0.0)))) - _mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, // _u.u_extentRadiu - 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // s.z) + (_mtl_u.u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, // _params.x * 0.5) - 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // ) / _mtl_u.u_par - 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, // ams.x, 0.0, 1.0) - 0x29, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x5f, 0x36, 0x31, 0x37, 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x30, // )) * (_617 * _60 - 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, // 1);. }. el - 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // se. {. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x31, 0x3b, 0x0a, 0x20, 0x20, // float4 _691;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // if (_mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x31, // .u_params.w == 1 - 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // .0). {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // float4 - 0x20, 0x5f, 0x36, 0x35, 0x37, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, // _657 = s_tex.sa - 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, // mple(s_texSample - 0x72, 0x2c, 0x20, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // r, ((_mtl_u.u_pa - 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // intMat * float3( - 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, // in.v_position, 1 - 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // .0)).xy / _mtl_u + 0x6e, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x28, // n, 1.0)).xy) - ( + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, // _mtl_u.u_extentR + 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // adius.xy - float + 0x32, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, // 2(_mtl_u.u_exten + 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // tRadius.z));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x33, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x28, // _693 = mix( + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, // _mtl_u.u_innerCo + 0x6c, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, // l, _mtl_u.u_oute + 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x66, 0x61, 0x73, // rCol, float4(fas + 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x6d, 0x74, // t::clamp(fma(_mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x2c, 0x20, // l_u.u_params.x, + 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, 0x6e, 0x28, // 0.5, (fast::min( + 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x61, 0x78, 0x28, 0x5f, 0x36, 0x33, 0x30, 0x2e, 0x78, // fast::max(_630.x + 0x2c, 0x20, 0x5f, 0x36, 0x33, 0x30, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x20, // , _630.y), 0.0) + 0x2b, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, // + length(fast::m + 0x61, 0x78, 0x28, 0x5f, 0x36, 0x33, 0x30, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, // ax(_630, float2( + 0x30, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // 0.0)))) - _mtl_u 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, // .u_extentRadius. - 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // xy));. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x38, 0x3b, 0x0a, 0x20, // float4 _688;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, // if (_ - 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, // mtl_u.u_params.z - 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // == 1.0). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x38, 0x20, 0x3d, 0x20, 0x66, 0x6c, // _688 = fl - 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x36, 0x35, 0x37, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, // oat4(_657.xyz * - 0x5f, 0x36, 0x35, 0x37, 0x2e, 0x77, 0x2c, 0x20, 0x5f, 0x36, 0x35, 0x37, 0x2e, 0x77, 0x29, 0x3b, // _657.w, _657.w); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // . }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, // _6 - 0x38, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x35, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 88 = _657;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x39, // float4 _689 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, // ;. if - 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // (_mtl_u.u_param - 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // s.z == 2.0). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x20, 0x3d, // _689 = - 0x20, 0x5f, 0x36, 0x38, 0x38, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // _688.xxxx;. + 0x7a, 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // z) / _mtl_u.u_pa + 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // rams.x, 0.0, 1.0 + 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x5f, 0x36, 0x31, 0x37, 0x20, 0x2a, 0x20, 0x5f, 0x36, // ))) * (_617 * _6 + 0x30, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, // 01);. }. e + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. {. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x34, 0x3b, 0x0a, 0x20, // float4 _694;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // if (_mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, // u.u_params.w == + 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // 1.0). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // float + 0x34, 0x20, 0x5f, 0x36, 0x35, 0x37, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, // 4 _657 = s_tex.s + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, // ample(s_texSampl + 0x65, 0x72, 0x2c, 0x20, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // er, ((_mtl_u.u_p + 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // aintMat * float3 + 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, // (in.v_position, + 0x31, 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // 1.0)).xy / _mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, // u.u_extentRadius + 0x2e, 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .xy));. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x31, 0x3b, 0x0a, // float4 _691;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // if ( + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, // _mtl_u.u_params. + 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // z == 1.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x31, 0x20, 0x3d, 0x20, 0x66, // _691 = f + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x36, 0x35, 0x37, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, // loat4(_657.xyz * + 0x20, 0x5f, 0x36, 0x35, 0x37, 0x2e, 0x77, 0x2c, 0x20, 0x5f, 0x36, 0x35, 0x37, 0x2e, 0x77, 0x29, // _657.w, _657.w) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // ;. }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, // else + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // . {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // _ + 0x36, 0x39, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x35, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 691 = _657;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, // float4 _69 + 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, // 2;. i + 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // f (_mtl_u.u_para + 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, // ms.z == 2.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x32, 0x20, // _692 + 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x31, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, // = _691.xxxx;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x32, 0x20, 0x3d, // _692 = + 0x20, 0x5f, 0x36, 0x39, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _691;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x5f, 0x36, 0x39, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x36, 0x39, 0x32, 0x20, 0x2a, 0x20, // _694 = (_692 * + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, // _mtl_u.u_innerCo + 0x6c, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x5f, 0x36, 0x31, 0x37, 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x30, // l) * (_617 * _60 + 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, // 1);. }. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x20, 0x3d, 0x20, // _689 = - 0x5f, 0x36, 0x38, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _688;. - 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x5f, 0x36, 0x39, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x36, 0x38, 0x39, 0x20, 0x2a, 0x20, 0x5f, // _691 = (_689 * _ - 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, // mtl_u.u_innerCol - 0x29, 0x20, 0x2a, 0x20, 0x28, 0x5f, 0x36, 0x31, 0x37, 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x30, 0x31, // ) * (_617 * _601 - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // );. }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. - 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float4 _692;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, // if (_mt - 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, // l_u.u_params.w = - 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = 2.0). 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x32, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // _692 = floa - 0x74, 0x34, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // t4(1.0);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x35, 0x3b, 0x0a, 0x20, 0x20, // float4 _695;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, // if (_m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, // tl_u.u_params.w + 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // == 2.0). 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, // float4 _69 - 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 3;. - 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // if (_mtl_u.u_ - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x2e, 0x30, 0x29, // params.w == 3.0) - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x35, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, // _695 = flo + 0x61, 0x74, 0x34, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // at4(1.0);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, // float4 _6 - 0x36, 0x36, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, // 66 = s_tex.sampl - 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, // e(s_texSampler, - 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, // in.v_texcoord0); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x36, // float4 _686 + 0x39, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 96;. + 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // if (_mtl_u.u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x2e, 0x30, // _params.w == 3.0 + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ). + 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, // float4 _ + 0x36, 0x36, 0x36, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, // 666 = s_tex.samp + 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, // le(s_texSampler, + 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, // in.v_texcoord0) 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // if (_mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, // .u_params.z == 1 - 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .0). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, // float4 _68 + 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 9;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // if (_mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, // u.u_params.z == + 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 1.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // {. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x5f, 0x36, 0x38, 0x36, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, // _686 = float4( - 0x5f, 0x36, 0x36, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x36, 0x36, 0x2e, // _666.xyz * _666. - 0x77, 0x2c, 0x20, 0x5f, 0x36, 0x36, 0x36, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // w, _666.w);. + 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // _689 = float4 + 0x28, 0x5f, 0x36, 0x36, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x36, 0x36, // (_666.xyz * _666 + 0x2e, 0x77, 0x2c, 0x20, 0x5f, 0x36, 0x36, 0x36, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // .w, _666.w);. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, // { - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x36, 0x20, 0x3d, 0x20, // _686 = - 0x5f, 0x36, 0x36, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _666;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, // else. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float4 _687;. + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x20, 0x3d, // _689 = + 0x20, 0x5f, 0x36, 0x36, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _666;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // }. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // if (_mtl_u.u_pa - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, // rams.z == 2.0). + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x30, 0x3b, 0x0a, 0x20, 0x20, // float4 _690;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, // _68 - 0x37, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x36, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, // 7 = _686.xxxx;. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // if (_mtl_u.u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, // arams.z == 2.0). 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, // _6 + 0x39, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, // 90 = _689.xxxx;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x37, // _687 - 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _686;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, // else. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x36, 0x38, 0x37, 0x20, // _693 = (_687 - 0x2a, 0x20, 0x5f, 0x36, 0x30, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // * _601) * _mtl_u - 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x20, // .u_innerCol;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // e - 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. - 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x33, 0x20, 0x3d, // _693 = - 0x20, 0x5f, 0x36, 0x39, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _694;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x32, 0x20, 0x3d, 0x20, // _692 = - 0x5f, 0x36, 0x39, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _693;. - 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x5f, 0x36, 0x39, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _691 = _692;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // }. _ - 0x36, 0x39, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 690 = _691;. - 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // }. out.bgfx_F - 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x30, 0x3b, // ragData0 = _690; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, // . return out; - 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0xd0, 0x00, // .}...... + 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, // _69 + 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0 = _689;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x36, 0x39, 0x30, // _696 = (_690 + 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x30, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // * _601) * _mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, // u.u_innerCol;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x36, 0x20, // _696 + 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _697;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x35, 0x20, 0x3d, // _695 = + 0x20, 0x5f, 0x36, 0x39, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _696;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x5f, 0x36, 0x39, 0x34, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x35, 0x3b, 0x0a, 0x20, 0x20, // _694 = _695;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x5f, 0x36, 0x39, 0x33, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _693 = _694;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, // }. out.bgfx_ + 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x33, // FragData0 = _693 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, // ;. return out + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0xd0, 0x00, // ;.}...... }; extern const uint8_t* fs_nanovg_fill_pssl; extern const uint32_t fs_nanovg_fill_pssl_size; diff --git a/bgfx/examples/common/nanovg/makefile b/bgfx/examples/common/nanovg/makefile index 9fe95f71..b4a4e8b3 100644 --- a/bgfx/examples/common/nanovg/makefile +++ b/bgfx/examples/common/nanovg/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/common/nanovg/nanovg_bgfx.cpp b/bgfx/examples/common/nanovg/nanovg_bgfx.cpp index 3446e405..13593b1b 100644 --- a/bgfx/examples/common/nanovg/nanovg_bgfx.cpp +++ b/bgfx/examples/common/nanovg/nanovg_bgfx.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -137,7 +137,6 @@ namespace bgfx::UniformHandle u_scissorExtScale; bgfx::UniformHandle u_extentRadius; bgfx::UniformHandle u_params; - bgfx::UniformHandle u_halfTexel; bgfx::UniformHandle s_tex; @@ -268,15 +267,6 @@ namespace gl->u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4); gl->s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Sampler); - if (bgfx::getRendererType() == bgfx::RendererType::Direct3D9) - { - gl->u_halfTexel = bgfx::createUniform("u_halfTexel", bgfx::UniformType::Vec4); - } - else - { - gl->u_halfTexel.idx = bgfx::kInvalidHandle; - } - s_nvgLayout .begin() .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float) @@ -549,12 +539,6 @@ namespace if (tex != NULL) { handle = tex->id; - - if (bgfx::isValid(gl->u_halfTexel) ) - { - float halfTexel[4] = { 0.5f / tex->width, 0.5f / tex->height }; - bgfx::setUniform(gl->u_halfTexel, halfTexel); - } } } @@ -572,8 +556,12 @@ namespace static void fan(uint32_t _start, uint32_t _count) { uint32_t numTris = _count-2; + BX_ASSERT(_count >= 3, "less than one triangle"); + BX_ASSERT(_start + ((numTris - 1) * 3) + 2 <= UINT16_MAX, "index overflow"); bgfx::TransientIndexBuffer tib; bgfx::allocTransientIndexBuffer(&tib, numTris*3); + BX_ASSERT(tib.size == numTris*3*(tib.isIndex16 ? 2 : 4), "did not get enough room for indices"); + uint16_t* data = (uint16_t*)tib.data; for (uint32_t ii = 0; ii < numTris; ++ii) { @@ -839,6 +827,7 @@ namespace return count; } + static int glnvg__mini(int a, int b) { return a < b ? a : b; } static int glnvg__maxi(int a, int b) { return a > b ? a : b; } static struct GLNVGcall* glnvg__allocCall(struct GLNVGcontext* gl) @@ -872,11 +861,15 @@ namespace static int glnvg__allocVerts(GLNVGcontext* gl, int n) { + // Before calling this function, make sure that glnvg__flushIfNeeded() + // is called, before allocating the NVGCall. int ret = 0; + BX_ASSERT(gl->nverts + n <= UINT16_MAX, "index overflow is imminent, please flush."); if (gl->nverts+n > gl->cverts) { NVGvertex* verts; int cverts = glnvg__maxi(gl->nverts + n, 4096) + gl->cverts/2; // 1.5x Overallocate + cverts = glnvg__mini(cverts, UINT16_MAX); verts = (NVGvertex*)bx::realloc(gl->allocator, gl->verts, sizeof(NVGvertex) * cverts); if (verts == NULL) return -1; gl->verts = verts; @@ -908,6 +901,12 @@ namespace vtx->v = v; } + static void glnvg__flushIfNeeded(struct GLNVGcontext *gl, int nverts) { + if (gl->nverts + nverts > UINT16_MAX) { + nvgRenderFlush(gl); + } + } + static void nvgRenderFill( void* _userPtr , NVGpaint* paint @@ -920,11 +919,13 @@ namespace ) { struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr; + int maxverts = glnvg__maxVertCount(paths, npaths) + 6; + glnvg__flushIfNeeded(gl, maxverts); struct GLNVGcall* call = glnvg__allocCall(gl); struct NVGvertex* quad; struct GLNVGfragUniforms* frag; - int i, maxverts, offset; + int i, offset; call->type = GLNVG_FILL; call->pathOffset = glnvg__allocPaths(gl, npaths); @@ -938,7 +939,6 @@ namespace } // Allocate vertices for all the paths. - maxverts = glnvg__maxVertCount(paths, npaths) + 6; offset = glnvg__allocVerts(gl, maxverts); for (i = 0; i < npaths; i++) @@ -1006,9 +1006,11 @@ namespace ) { struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr; + int maxverts = glnvg__maxVertCount(paths, npaths); + glnvg__flushIfNeeded(gl, maxverts); struct GLNVGcall* call = glnvg__allocCall(gl); - int i, maxverts, offset; + int i, offset; call->type = GLNVG_STROKE; call->pathOffset = glnvg__allocPaths(gl, npaths); @@ -1017,7 +1019,6 @@ namespace call->blendFunc = glnvg__blendCompositeOperation(compositeOperation); // Allocate vertices for all the paths. - maxverts = glnvg__maxVertCount(paths, npaths); offset = glnvg__allocVerts(gl, maxverts); for (i = 0; i < npaths; i++) @@ -1025,6 +1026,7 @@ namespace struct GLNVGpath* copy = &gl->paths[call->pathOffset + i]; const struct NVGpath* path = &paths[i]; bx::memSet(copy, 0, sizeof(struct GLNVGpath) ); + BX_ASSERT(path->nfill == 0, "strokes should not have any fill"); if (path->nstroke) { copy->strokeOffset = offset; @@ -1043,6 +1045,8 @@ namespace const struct NVGvertex* verts, int nverts) { struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr; + glnvg__flushIfNeeded(gl, nverts); + struct GLNVGcall* call = glnvg__allocCall(gl); struct GLNVGfragUniforms* frag; @@ -1084,11 +1088,6 @@ namespace bgfx::destroy(gl->u_params); bgfx::destroy(gl->s_tex); - if (bgfx::isValid(gl->u_halfTexel) ) - { - bgfx::destroy(gl->u_halfTexel); - } - for (uint32_t ii = 0, num = gl->ntextures; ii < num; ++ii) { if (bgfx::isValid(gl->textures[ii].id) diff --git a/bgfx/examples/common/nanovg/nanovg_bgfx.h b/bgfx/examples/common/nanovg/nanovg_bgfx.h index a0beb926..32512c12 100644 --- a/bgfx/examples/common/nanovg/nanovg_bgfx.h +++ b/bgfx/examples/common/nanovg/nanovg_bgfx.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h b/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h index 5086c83f..db6e3ec0 100644 --- a/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h +++ b/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h @@ -74,10 +74,10 @@ static const uint8_t vs_nanovg_fill_essl[553] = static const uint8_t vs_nanovg_fill_spv[1481] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0b, 0x75, // VSH............u - 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x00, 0x10, 0x00, 0x01, 0x00, // _halfTexel...... + 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x10, 0x00, 0x01, 0x00, // _halfTexel...... 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, // .....u_viewSize. - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0a, // ................ @@ -167,43 +167,12 @@ static const uint8_t vs_nanovg_fill_spv[1481] = 0x00, 0x56, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, // .V...v.......8.. 0x00, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x20, 0x00, // ....... . }; -static const uint8_t vs_nanovg_fill_dx9[438] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0b, 0x75, // VSH............u - 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x01, 0x00, 0x01, 0x00, // _halfTexel...... - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, // .....u_viewSize. - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, // .........x...... - 0xff, 0xfe, 0xff, 0x28, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, // ...(.CTAB....r.. - 0x00, 0x00, 0x03, 0xfe, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x6b, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // .k...D.......... - 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .P.......`...... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x68, // .....P.......u_h - 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, // alfTexel........ - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, // .........u_viewS - 0x69, 0x7a, 0x65, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ize.vs_3_0.Micro - 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh - 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, // ader Compiler 10 - 0x2e, 0x31, 0x00, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, // .1...Q.......... - 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // ....?........... - 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................ - 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, // ................ - 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0xe0, 0x1f, 0x00, 0x00, // ................ - 0x02, 0x05, 0x00, 0x01, 0x80, 0x02, 0x00, 0x03, 0xe0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x03, // ................ - 0xe0, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x90, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, // ................ - 0x80, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xd0, // ................ - 0x90, 0x00, 0x00, 0xd0, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x55, // ...............U - 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, // ................ - 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x00, 0xaa, // ...U............ - 0x80, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, // .......U........ - 0xe0, 0x02, 0x00, 0x64, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x00, 0x00, 0xe4, // ...d............ - 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ...... -}; -static const uint8_t vs_nanovg_fill_dx11[587] = +static const uint8_t vs_nanovg_fill_dx11[591] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x01, 0x00, 0x0a, 0x75, // VSH............u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... - 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x99, 0x64, 0x1c, 0x9f, 0xec, // .......DXBC.d... - 0x38, 0xd9, 0xd2, 0x91, 0x86, 0xde, 0x66, 0x7d, 0x52, 0x06, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x1c, // 8.....f}R....... + 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x3e, 0xd0, 0x99, 0xce, 0x93, // ... ...DXBC>.... + 0x29, 0x93, 0x48, 0x9b, 0x13, 0xb5, 0x51, 0xc0, 0x9c, 0x7c, 0xac, 0x01, 0x00, 0x00, 0x00, 0x20, // ).H...Q..|..... 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xf0, // .......,........ 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, // ...ISGNL........ 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...8............ @@ -217,33 +186,33 @@ static const uint8_t vs_nanovg_fill_dx11[587] = 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x53, // ...............S 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, // V_POSITION.TEXCO - 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x24, 0x01, 0x00, 0x00, 0x40, // ORD....SHDR$...@ - 0x00, 0x01, 0x00, 0x49, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...I...Y...F. .. - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x00, // ......._...2.... - 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, // ..._...2.......g - 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, // .... ..........e - 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xc2, // ...2 ......e.... - 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, // ......h........ - 0x00, 0x00, 0x07, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, // ...2.......F.... - 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x08, 0x32, // ...F...........2 - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......F.......F - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, // . .............. - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ............... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x08, 0x22, 0x20, 0x10, 0x00, 0x00, // @.........." ... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......A........ - 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00, 0x00, // @.....?6.... ... - 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....@........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x01, // ......?6...2 ... - 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xc2, // ...F.......6.... - 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x14, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, // ..............> - 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x10, 0x00, // ........... + 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x28, 0x01, 0x00, 0x00, 0x50, // ORD....SHEX(...P + 0x00, 0x01, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, // ...J...j...Y...F + 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, // . ........._...2 + 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, // ......._...2.... + 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...g.... ....... + 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, // ...e...2 ......e + 0x00, 0x00, 0x03, 0xc2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, // .... ......h.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......2.......F + 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, // .......F........ + 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, // ...2.......F.... + 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...F. .......... + 0x00, 0x00, 0x07, 0x12, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // .... ........... + 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x08, 0x22, // ....@.........." + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ..........A.... + 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x08, 0xc2, // ....@.....?6.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......@....... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0x32, // ..........?6...2 + 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // ......F.......6 + 0x00, 0x00, 0x05, 0xc2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x14, 0x10, 0x00, 0x01, // .... ........... + 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x10, 0x00, // ...>........... }; -static const uint8_t vs_nanovg_fill_mtl[941] = +static const uint8_t vs_nanovg_fill_mtl[989] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0b, 0x75, // VSH............u 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x10, 0x00, 0x01, 0x00, // _halfTexel...... 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, // .....u_viewSize. - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, // .........h...#in + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, // .............#in 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, // clude .#include ..usi @@ -254,7 +223,10 @@ static const uint8_t vs_nanovg_fill_mtl[941] = 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, // float4 u_halfTe 0x78, 0x65, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, // xel;.};..struct 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, // xlatMtlMain_out. - 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, // {. float2 _en + 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, // {..float bgfx_me + 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, // tal_pointSize [[ + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, // point_size]] = 1 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, // ;. float2 _en 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, // tryPointOutput_v 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, // _position [[user 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // (locn0)]];. f diff --git a/bgfx/examples/common/packrect.h b/bgfx/examples/common/packrect.h index f1a95b30..13d6bf57 100644 --- a/bgfx/examples/common/packrect.h +++ b/bgfx/examples/common/packrect.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/ps/fs_particle.bin.h b/bgfx/examples/common/ps/fs_particle.bin.h index 371f6928..ad185dc0 100644 --- a/bgfx/examples/common/ps/fs_particle.bin.h +++ b/bgfx/examples/common/ps/fs_particle.bin.h @@ -55,161 +55,134 @@ static const uint8_t fs_particle_essl[411] = 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, // gl_FragColor = r 0x67, 0x62, 0x61, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // gba_1;.}... }; -static const uint8_t fs_particle_spv[1303] = +static const uint8_t fs_particle_spv[1271] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // _texColor0...... - 0x02, 0x1a, 0x00, 0xec, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, // .........#...... - 0x00, 0x08, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ................ + 0x02, 0x22, 0x00, 0xcc, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, // .".......#...... + 0x00, 0x08, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ................ 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, // ...........GLSL. 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, // std.450......... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x6d, // ...main....j...m - 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, // ...p...}........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, // ................ - 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......#...s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, // ColorSampler.... - 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...&...s_texColo - 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x6a, // rTexture.......j - 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, // ...gl_FragCoord. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // .......m...v_col - 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x70, 0x00, 0x00, 0x00, 0x76, // or0........p...v - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x7d, // _texcoord0.....} - 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData - 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...#...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...#...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...&...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G...&...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G...j........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...m........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x70, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G...p........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...}........ - 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ - 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ..."...........; - 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ..."...#....... - 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...%...........; - 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, // ...%...&........ - 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x4b, // ...2...........K - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x20, 0x00, 0x04, 0x00, 0x69, // ...`......? ...i - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x69, // ...........;...i - 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x69, // ...j.......;...i - 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x69, // ...m.......;...i - 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7c, // ...p....... ...| - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7c, // ...........;...| - 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x03, 0x00, 0x0d, // ...}............ - 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, // .......6........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, // ................ - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, // ...=.......$...# - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, // ...=.......'...& - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6d, // ...=.......n...m - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x70, // ...=.......q...p - 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x71, // ...O...........q - 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, // ...q...........V - 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, // ...2.......'...$ - 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc5, // ...W............ - 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x4b, 0x00, 0x00, 0x00, 0xa1, // .......O...K.... - 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x4b, 0x00, 0x00, 0x00, 0xa3, // .......O...K.... - 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...n...n........ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x4b, 0x00, 0x00, 0x00, 0xa4, // ...........K.... - 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, // ................ - 0x00, 0x05, 0x00, 0x4b, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0xa6, // ...K............ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x6e, // ...Q...........n - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x4b, 0x00, 0x00, 0x00, 0xaa, // ...........K.... - 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, // ...........O.... - 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x6e, // ...Q...........n - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb1, // ................ - 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x83, // .......q........ - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xb3, // ...........`.... - 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0xb1, // ................ - 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xd2, // .......R........ - 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, // ...............> - 0x00, 0x03, 0x00, 0x7d, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, // ...}...........8 + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x76, // ...main....s...v + 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, // ................ + 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, // .......main..... + 0x00, 0x07, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...#...s_texColo + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x26, // rSampler.......& + 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, // ...s_texColorTex + 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x73, 0x00, 0x00, 0x00, 0x76, // ture.......s...v + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x76, // _color0........v + 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, // ...v_texcoord0.. + 0x00, 0x06, 0x00, 0x83, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // .......bgfx_Frag + 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, // Data0..G...#..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, // .......G...#...! + 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, // .......G...&..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, // .......G...&...! + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x73, 0x00, 0x00, 0x00, 0x1e, // .......G...s.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x76, 0x00, 0x00, 0x00, 0x1e, // .......G...v.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, // ...............! + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, // ................ + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, // ........... .... + 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ... ..."........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...;..."...#.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ... ...%........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, // ...;...%...&.... + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, // .......2........ + 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, // ...K...........+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x20, // .......g......? + 0x00, 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, // ...o...........; + 0x00, 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, // ...o...s.......; + 0x00, 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...o...v....... + 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, // ...............; + 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2e, // ................ + 0x00, 0x03, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, // ...........6.... + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, // ................ + 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, // .......=.......$ + 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, // ...#...=.......' + 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x74, // ...&...=.......t + 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x77, // ...s...=.......w + 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa3, // ...v...O........ + 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...w...w........ + 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x27, // ...V...2.......' + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xd1, // ...$...W........ + 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x4b, // ...........O...K + 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x4b, // ...........O...K + 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, // .......t...t.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x4b, // ...............K + 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x4b, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xaa, // .......K........ + 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaf, // .......Q........ + 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x4b, // ...t...........K + 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xb0, // ...Q............ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb6, // .......Q........ + 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x03, // ...........t.... + 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xb8, // ................ + 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbd, // .......Q........ + 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, // ...w............ + 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x85, // .......g........ + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbe, // ................ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0xb2, // ...P............ + 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x3e, // ...............> + 0x00, 0x03, 0x00, 0x83, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, // ...............8 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... }; -static const uint8_t fs_particle_dx9[336] = +static const uint8_t fs_particle_dx11[539] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, // ...(......... .C - 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, // TAB....S........ - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, // ...........L...0 - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, // ...........<.... - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, // ...s_texColor... - 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, // ...............p - 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, // s_3_0.Microsoft - 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, // (R) HLSL Shader - 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, // Compiler 10.1..Q - 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........?..... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, // ................ - 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x07, 0x90, 0x1f, // ................ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, // ...........B.... - 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x0f, 0x80, 0x00, 0x00, 0x54, 0x80, 0x00, 0x00, 0x93, 0x90, 0x05, 0x00, 0x00, 0x03, 0x00, // .....T.......... - 0x08, 0x07, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, 0xff, 0x90, 0x02, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0xaa, 0x91, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // .....U.......... + 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x8f, 0x83, 0x25, 0x3c, 0x11, // .......DXBC..%<. + 0xea, 0x33, 0x00, 0xb9, 0xe6, 0xdb, 0x76, 0x41, 0xd6, 0x4a, 0x0e, 0x01, 0x00, 0x00, 0x00, 0xf0, // .3....vA.J...... + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, // .......,........ + 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, // ...ISGNl........ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, // ...P............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...b............ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO + 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX + 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, // COORD..OSGN,.... + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, // ...............S + 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x14, // V_TARGET...SHEX. + 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x5a, // ...P...E...j...Z + 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, // ....`......X.... + 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, // p......UU..b.... + 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, // .......b...r.... + 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, // ...e.... ......h + 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, // .......E.......C + 0x55, 0x15, 0x00, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, // U..........F.... + 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, // ...F~.......`... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...8..."........ + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...............8 + 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x05, 0x10, 0x00, 0x00, // ...........F.... + 0x00, 0x00, 0x00, 0x36, 0x19, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, // ...6.......8...r + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, // ............... + 0x1f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, // ...........".... + 0x00, 0x00, 0x00, 0x2a, 0x10, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, // ...*...A........ + 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, // @.....?8.... ... + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ...>....... }; -static const uint8_t fs_particle_dx11[548] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, // ....s_texColor0. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0xdd, 0x04, 0xf1, 0x4a, 0xaa, 0xb0, 0xdf, 0xe0, 0xf5, 0x18, 0x2f, 0x3b, 0x6e, 0xa9, 0x0e, 0x0a, // ...J....../;n... - 0x01, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... - 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl... - 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... - 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ - 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00, 0x00, // ................ - 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN - 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET... - 0x53, 0x48, 0x44, 0x52, 0x08, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, // SHDR....@...B... - 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, // Z....`......X... - 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b... - 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // ........b...r... - 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ...... - 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, // h.......E....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // .....`......8... - 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // "............... - 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, // ........8....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x19, 0x10, 0x00, // ....F.......6... - 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8...r ...... - 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x1f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x10, 0x10, 0x80, // ....".......*... - 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // A........@.....? - 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 8.... .......... - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ............>... - 0x00, 0x00, 0x00, 0x00, // .... -}; -static const uint8_t fs_particle_mtl[856] = +static const uint8_t fs_particle_mtl[769] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x11, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x02, 0x00, 0x00, 0x23, // r..............# + 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x02, 0x00, 0x00, 0x23, // r..............# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, // include .#include 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, // ..u @@ -237,27 +210,22 @@ static const uint8_t fs_particle_mtl[856] = 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, // [[sampler(0)]]). 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // {. xlatMtlMai 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, // n_out out = {};. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x31, 0x39, 0x36, 0x20, // float4 _196 + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x32, 0x30, 0x36, 0x20, // float4 _206 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, // = s_texColor.sam 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, // ple(s_texColorSa 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // mpler, in.v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // oord0.xy);. f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x31, 0x36, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x5f, // loat3 _167 = ((_ - 0x31, 0x39, 0x36, 0x2e, 0x78, 0x78, 0x78, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, // 196.xxx * in.v_c - 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x31, 0x39, // olor0.xyz) * _19 - 0x36, 0x2e, 0x78, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // 6.x) * in.v_colo - 0x72, 0x30, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // r0.w;. float4 - 0x20, 0x5f, 0x32, 0x30, 0x37, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, // _207 = float4(_ - 0x31, 0x36, 0x37, 0x2e, 0x78, 0x2c, 0x20, 0x5f, 0x31, 0x36, 0x37, 0x2e, 0x79, 0x2c, 0x20, 0x5f, // 167.x, _167.y, _ - 0x31, 0x36, 0x37, 0x2e, 0x7a, 0x2c, 0x20, 0x5f, 0x31, 0x39, 0x36, 0x2e, 0x78, 0x29, 0x3b, 0x0a, // 167.z, _196.x);. - 0x20, 0x20, 0x20, 0x20, 0x5f, 0x32, 0x30, 0x37, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x31, // _207.w = (_1 - 0x39, 0x36, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // 96.x * in.v_colo - 0x72, 0x30, 0x2e, 0x77, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x69, // r0.w) * (1.0 - i - 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x7a, 0x29, // n.v_texcoord0.z) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // ;. out.bgfx_F - 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x32, 0x30, 0x37, 0x3b, // ragData0 = _207; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, // . return out; - 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, 0x00, // .}.... . + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, // oord0.xy);. o + 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ut.bgfx_FragData + 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x28, 0x28, 0x5f, 0x32, 0x30, // 0 = float4(((_20 + 0x36, 0x2e, 0x78, 0x78, 0x78, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // 6.xxx * in.v_col + 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x32, 0x30, 0x36, 0x2e, // or0.xyz) * _206. + 0x78, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // x) * in.v_color0 + 0x2e, 0x77, 0x2c, 0x20, 0x28, 0x5f, 0x32, 0x30, 0x36, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x69, 0x6e, // .w, (_206.x * in + 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x20, 0x2a, 0x20, 0x28, // .v_color0.w) * ( + 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // 1.0 - in.v_texco + 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, // ord0.z));. re + 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, // turn out;.}.... + 0x00, // . }; extern const uint8_t* fs_particle_pssl; extern const uint32_t fs_particle_pssl_size; diff --git a/bgfx/examples/common/ps/fs_particle.sc b/bgfx/examples/common/ps/fs_particle.sc index 6e731a14..33d78ad0 100644 --- a/bgfx/examples/common/ps/fs_particle.sc +++ b/bgfx/examples/common/ps/fs_particle.sc @@ -1,7 +1,7 @@ $input v_color0, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/ps/makefile b/bgfx/examples/common/ps/makefile index 9fe95f71..b4a4e8b3 100644 --- a/bgfx/examples/common/ps/makefile +++ b/bgfx/examples/common/ps/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/common/ps/particle_system.cpp b/bgfx/examples/common/ps/particle_system.cpp index 1939bdfd..2f3aee9d 100644 --- a/bgfx/examples/common/ps/particle_system.cpp +++ b/bgfx/examples/common/ps/particle_system.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/ps/particle_system.h b/bgfx/examples/common/ps/particle_system.h index 13206e82..5928dcad 100644 --- a/bgfx/examples/common/ps/particle_system.h +++ b/bgfx/examples/common/ps/particle_system.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/ps/vs_particle.bin.h b/bgfx/examples/common/ps/vs_particle.bin.h index 9a7638dc..d1fdb503 100644 --- a/bgfx/examples/common/ps/vs_particle.bin.h +++ b/bgfx/examples/common/ps/vs_particle.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_particle_glsl[386] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........U...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........U...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec3 a_position;. @@ -30,7 +30,7 @@ static const uint8_t vs_particle_essl[428] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // bute highp vec3 @@ -59,9 +59,9 @@ static const uint8_t vs_particle_essl[428] = static const uint8_t vs_particle_spv[1222] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........n....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........n....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, // ................ @@ -136,39 +136,13 @@ static const uint8_t vs_particle_spv[1222] = 0x3d, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, // =.......8....... 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ....@. }; -static const uint8_t vs_particle_dx9[357] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........8....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, // ................ - 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, // ................ - 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0f, 0xe0, 0x02, 0x00, 0xe4, 0x90, // ................ - 0xff, 0xff, 0x00, 0x00, 0x00, // ..... -}; -static const uint8_t vs_particle_dx11[630] = +static const uint8_t vs_particle_dx11[634] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........@...DXBC - 0x94, 0x83, 0x4e, 0xd2, 0x28, 0xd5, 0xeb, 0x87, 0x3e, 0xf5, 0xa1, 0x65, 0x63, 0x87, 0x0e, 0xf7, // ..N.(...>..ec... - 0x01, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....@.......,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........D...DXBC + 0xf9, 0x9c, 0xb4, 0x7f, 0x5c, 0x18, 0xb4, 0x74, 0x56, 0x51, 0x2f, 0x9b, 0xd4, 0x57, 0xd5, 0x8a, // .......tVQ/..W.. + 0x01, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....D.......,... 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, // ........ISGNh... 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -183,33 +157,33 @@ static const uint8_t vs_particle_dx11[630] = 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x28, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // (...@...J...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // ........_...r... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._........... - 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // g.... .......... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // F.......2....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....F. ......... - 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ..... ......F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....F. ......... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....6.... ...... - 0x46, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, // F.......>....... - 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ....@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x2c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ,...P...K...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // r......._....... + 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // ....F.......2... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F. ..... + 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // F.......6.... .. + 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>... + 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ........@. }; -static const uint8_t vs_particle_mtl[842] = +static const uint8_t vs_particle_mtl[890] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........D...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -219,6 +193,9 @@ static const uint8_t vs_particle_mtl[842] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/examples/common/ps/vs_particle.sc b/bgfx/examples/common/ps/vs_particle.sc index 3a6bd43a..58345152 100644 --- a/bgfx/examples/common/ps/vs_particle.sc +++ b/bgfx/examples/common/ps/vs_particle.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, a_texcoord0 $output v_color0, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/common/shaderlib.sh b/bgfx/examples/common/shaderlib.sh index 389a1ec6..4ae3b846 100644 --- a/bgfx/examples/common/shaderlib.sh +++ b/bgfx/examples/common/shaderlib.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/examples/makefile b/bgfx/examples/makefile index 7bc16837..682f9c45 100644 --- a/bgfx/examples/makefile +++ b/bgfx/examples/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/examples/runtime/.gitignore b/bgfx/examples/runtime/.gitignore index 5394aa12..aae08a5c 100644 --- a/bgfx/examples/runtime/.gitignore +++ b/bgfx/examples/runtime/.gitignore @@ -1,4 +1,5 @@ *.dll +*.dylib *.so *.pdb imgui* diff --git a/bgfx/examples/runtime/meshes/bunny.bin b/bgfx/examples/runtime/meshes/bunny.bin index ef3127bc..f22f7743 100644 Binary files a/bgfx/examples/runtime/meshes/bunny.bin and b/bgfx/examples/runtime/meshes/bunny.bin differ diff --git a/bgfx/examples/runtime/meshes/bunny_decimated.bin b/bgfx/examples/runtime/meshes/bunny_decimated.bin index 58ec040b..ed1fdc94 100644 Binary files a/bgfx/examples/runtime/meshes/bunny_decimated.bin and b/bgfx/examples/runtime/meshes/bunny_decimated.bin differ diff --git a/bgfx/examples/runtime/meshes/bunny_patched.bin b/bgfx/examples/runtime/meshes/bunny_patched.bin index 3af10d21..a6db7d3f 100644 Binary files a/bgfx/examples/runtime/meshes/bunny_patched.bin and b/bgfx/examples/runtime/meshes/bunny_patched.bin differ diff --git a/bgfx/examples/runtime/meshes/column.bin b/bgfx/examples/runtime/meshes/column.bin index 3a9f3783..6b80ae36 100644 Binary files a/bgfx/examples/runtime/meshes/column.bin and b/bgfx/examples/runtime/meshes/column.bin differ diff --git a/bgfx/examples/runtime/meshes/cube.bin b/bgfx/examples/runtime/meshes/cube.bin index 9395fc6a..60131d78 100644 Binary files a/bgfx/examples/runtime/meshes/cube.bin and b/bgfx/examples/runtime/meshes/cube.bin differ diff --git a/bgfx/examples/runtime/meshes/hollowcube.bin b/bgfx/examples/runtime/meshes/hollowcube.bin index 43e4717d..bde7860b 100644 Binary files a/bgfx/examples/runtime/meshes/hollowcube.bin and b/bgfx/examples/runtime/meshes/hollowcube.bin differ diff --git a/bgfx/examples/runtime/meshes/orb.bin b/bgfx/examples/runtime/meshes/orb.bin index 034ad075..d714a0a4 100644 Binary files a/bgfx/examples/runtime/meshes/orb.bin and b/bgfx/examples/runtime/meshes/orb.bin differ diff --git a/bgfx/examples/runtime/meshes/platform.bin b/bgfx/examples/runtime/meshes/platform.bin index 6e5a4639..30aaf38c 100644 Binary files a/bgfx/examples/runtime/meshes/platform.bin and b/bgfx/examples/runtime/meshes/platform.bin differ diff --git a/bgfx/examples/runtime/meshes/test_scene.bin b/bgfx/examples/runtime/meshes/test_scene.bin index c7e7472d..38add5d0 100644 Binary files a/bgfx/examples/runtime/meshes/test_scene.bin and b/bgfx/examples/runtime/meshes/test_scene.bin differ diff --git a/bgfx/examples/runtime/meshes/tree.bin b/bgfx/examples/runtime/meshes/tree.bin index cb3931b9..f5a40ad5 100644 Binary files a/bgfx/examples/runtime/meshes/tree.bin and b/bgfx/examples/runtime/meshes/tree.bin differ diff --git a/bgfx/examples/runtime/meshes/tree1b_lod0_1.bin b/bgfx/examples/runtime/meshes/tree1b_lod0_1.bin index 7ee3b77c..90a2666e 100644 Binary files a/bgfx/examples/runtime/meshes/tree1b_lod0_1.bin and b/bgfx/examples/runtime/meshes/tree1b_lod0_1.bin differ diff --git a/bgfx/examples/runtime/meshes/tree1b_lod0_2.bin b/bgfx/examples/runtime/meshes/tree1b_lod0_2.bin index 5c6398e6..41ab8f8a 100644 Binary files a/bgfx/examples/runtime/meshes/tree1b_lod0_2.bin and b/bgfx/examples/runtime/meshes/tree1b_lod0_2.bin differ diff --git a/bgfx/examples/runtime/meshes/tree1b_lod1_1.bin b/bgfx/examples/runtime/meshes/tree1b_lod1_1.bin index 7f15af46..4830e06b 100644 Binary files a/bgfx/examples/runtime/meshes/tree1b_lod1_1.bin and b/bgfx/examples/runtime/meshes/tree1b_lod1_1.bin differ diff --git a/bgfx/examples/runtime/meshes/tree1b_lod1_2.bin b/bgfx/examples/runtime/meshes/tree1b_lod1_2.bin index d4f48db0..79ac3d92 100644 Binary files a/bgfx/examples/runtime/meshes/tree1b_lod1_2.bin and b/bgfx/examples/runtime/meshes/tree1b_lod1_2.bin differ diff --git a/bgfx/examples/runtime/meshes/tree1b_lod2_1.bin b/bgfx/examples/runtime/meshes/tree1b_lod2_1.bin index a61a7f86..965aae32 100644 Binary files a/bgfx/examples/runtime/meshes/tree1b_lod2_1.bin and b/bgfx/examples/runtime/meshes/tree1b_lod2_1.bin differ diff --git a/bgfx/examples/runtime/meshes/tree1b_lod2_2.bin b/bgfx/examples/runtime/meshes/tree1b_lod2_2.bin index 91d37b78..dcff7baa 100644 Binary files a/bgfx/examples/runtime/meshes/tree1b_lod2_2.bin and b/bgfx/examples/runtime/meshes/tree1b_lod2_2.bin differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_albedo_output.bin b/bgfx/examples/runtime/shaders/dx9/fs_albedo_output.bin deleted file mode 100644 index 6f1296ea..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_albedo_output.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bloom_combine.bin b/bgfx/examples/runtime/shaders/dx9/fs_bloom_combine.bin deleted file mode 100644 index 329af459..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bloom_combine.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_copy.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_copy.bin deleted file mode 100644 index 84f6e01e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_copy.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_copy_linear_to_gamma.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_copy_linear_to_gamma.bin deleted file mode 100644 index 10757dad..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_copy_linear_to_gamma.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_combine.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_combine.bin deleted file mode 100644 index b43090a0..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_combine.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_debug.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_debug.bin deleted file mode 100644 index 881abf89..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_debug.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_downsample.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_downsample.bin deleted file mode 100644 index 66a9c558..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_downsample.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_second_pass.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_second_pass.bin deleted file mode 100644 index 213a9269..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_second_pass.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_single_pass.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_single_pass.bin deleted file mode 100644 index 4d6eea40..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_dof_single_pass.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_forward.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_forward.bin deleted file mode 100644 index d68d902a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_forward.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_forward_grid.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_forward_grid.bin deleted file mode 100644 index 7d37c87a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_forward_grid.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_linear_depth.bin b/bgfx/examples/runtime/shaders/dx9/fs_bokeh_linear_depth.bin deleted file mode 100644 index 6ba477ae..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bokeh_linear_depth.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bump.bin b/bgfx/examples/runtime/shaders/dx9/fs_bump.bin deleted file mode 100644 index 8593e324..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bump.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_bunnylod.bin b/bgfx/examples/runtime/shaders/dx9/fs_bunnylod.bin deleted file mode 100644 index 31146201..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_bunnylod.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_callback.bin b/bgfx/examples/runtime/shaders/dx9/fs_callback.bin deleted file mode 100644 index 31146201..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_callback.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin b/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin deleted file mode 100644 index 700d4073..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin b/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin deleted file mode 100644 index d87b5e3d..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin b/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin deleted file mode 100644 index 3408ef77..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin b/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin deleted file mode 100644 index 700d4073..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin b/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin deleted file mode 100644 index 2827cd7a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin b/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin deleted file mode 100644 index 61a7797e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_denoise_apply_lighting.bin b/bgfx/examples/runtime/shaders/dx9/fs_denoise_apply_lighting.bin deleted file mode 100644 index 147f365a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_denoise_apply_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_denoise_copy.bin b/bgfx/examples/runtime/shaders/dx9/fs_denoise_copy.bin deleted file mode 100644 index 84f6e01e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_denoise_copy.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_denoise_deferred_combine.bin b/bgfx/examples/runtime/shaders/dx9/fs_denoise_deferred_combine.bin deleted file mode 100644 index f11653a6..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_denoise_deferred_combine.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_denoise_gbuffer.bin b/bgfx/examples/runtime/shaders/dx9/fs_denoise_gbuffer.bin deleted file mode 100644 index 69a94009..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_denoise_gbuffer.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_denoise_spatial_3x3.bin b/bgfx/examples/runtime/shaders/dx9/fs_denoise_spatial_3x3.bin deleted file mode 100644 index b2979d36..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_denoise_spatial_3x3.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_denoise_spatial_5x5.bin b/bgfx/examples/runtime/shaders/dx9/fs_denoise_spatial_5x5.bin deleted file mode 100644 index a001e8ad..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_denoise_spatial_5x5.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_denoise_temporal.bin b/bgfx/examples/runtime/shaders/dx9/fs_denoise_temporal.bin deleted file mode 100644 index f39a8e42..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_denoise_temporal.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_denoise_txaa.bin b/bgfx/examples/runtime/shaders/dx9/fs_denoise_txaa.bin deleted file mode 100644 index ef144b84..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_denoise_txaa.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_downsample.bin b/bgfx/examples/runtime/shaders/dx9/fs_downsample.bin deleted file mode 100644 index 86067278..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_downsample.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin b/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin deleted file mode 100644 index a124b874..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin b/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin deleted file mode 100644 index 33d94212..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin b/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin deleted file mode 100644 index daab4160..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin b/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin deleted file mode 100644 index 87de810b..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin b/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin deleted file mode 100644 index ea8e437c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin b/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin deleted file mode 100644 index de5fcfdb..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin b/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin deleted file mode 100644 index 4c9bff1f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin b/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin deleted file mode 100644 index 944f4c57..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin b/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin deleted file mode 100644 index cc1c3859..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin b/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin deleted file mode 100644 index 55df9e53..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin b/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin deleted file mode 100644 index 6b1375fc..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_oit.bin b/bgfx/examples/runtime/shaders/dx9/fs_oit.bin deleted file mode 100644 index ac01fa75..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_oit.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin b/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin deleted file mode 100644 index 765033b3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin b/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin deleted file mode 100644 index 568e282c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin b/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin deleted file mode 100644 index ee88e29b..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin b/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin deleted file mode 100644 index 6ae21a41..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_particle.bin b/bgfx/examples/runtime/shaders/dx9/fs_particle.bin deleted file mode 100644 index bb6a3088..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_particle.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_picking_id.bin b/bgfx/examples/runtime/shaders/dx9/fs_picking_id.bin deleted file mode 100644 index 716a5005..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_picking_id.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_picking_shaded.bin b/bgfx/examples/runtime/shaders/dx9/fs_picking_shaded.bin deleted file mode 100644 index 943c5475..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_picking_shaded.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_pom.bin b/bgfx/examples/runtime/shaders/dx9/fs_pom.bin deleted file mode 100644 index 70e545bf..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_pom.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin b/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin deleted file mode 100644 index fa500228..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_rsm_combine.bin b/bgfx/examples/runtime/shaders/dx9/fs_rsm_combine.bin deleted file mode 100644 index 5ba1650a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_rsm_combine.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_rsm_gbuffer.bin b/bgfx/examples/runtime/shaders/dx9/fs_rsm_gbuffer.bin deleted file mode 100644 index ef34b363..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_rsm_gbuffer.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_rsm_lbuffer.bin b/bgfx/examples/runtime/shaders/dx9/fs_rsm_lbuffer.bin deleted file mode 100644 index bbbc8ca3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_rsm_lbuffer.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_rsm_shadow.bin b/bgfx/examples/runtime/shaders/dx9/fs_rsm_shadow.bin deleted file mode 100644 index 764c7d73..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_rsm_shadow.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_screen_space_shadows.bin b/bgfx/examples/runtime/shaders/dx9/fs_screen_space_shadows.bin deleted file mode 100644 index e3b1e33c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_screen_space_shadows.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin deleted file mode 100644 index b1b4264e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.bin deleted file mode 100644 index 1b2c351c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_csm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_csm.bin deleted file mode 100644 index b9f9afe3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear.bin deleted file mode 100644 index ed59592c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_csm.bin deleted file mode 100644 index 1dfd0f85..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_omni.bin deleted file mode 100644 index 77536d1c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_linear_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_omni.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_omni.bin deleted file mode 100644 index d37dc753..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_esm_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard.bin deleted file mode 100644 index 74af5f3e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_csm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_csm.bin deleted file mode 100644 index b5da6ecc..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear.bin deleted file mode 100644 index 079cce87..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_csm.bin deleted file mode 100644 index 268c8492..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_omni.bin deleted file mode 100644 index 12bac8dd..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_linear_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_omni.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_omni.bin deleted file mode 100644 index 08e480e5..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_hard_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf.bin deleted file mode 100644 index c92e5744..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_csm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_csm.bin deleted file mode 100644 index e16e59c9..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear.bin deleted file mode 100644 index db06beeb..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_csm.bin deleted file mode 100644 index bd9c4d94..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_omni.bin deleted file mode 100644 index ed939692..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_linear_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_omni.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_omni.bin deleted file mode 100644 index 686647e1..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_pcf_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm.bin deleted file mode 100644 index 9556bf4d..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_csm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_csm.bin deleted file mode 100644 index 2794791c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear.bin deleted file mode 100644 index 9f1a20e1..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_csm.bin deleted file mode 100644 index 2e95a18a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_omni.bin deleted file mode 100644 index 5d9b9a74..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_linear_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_omni.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_omni.bin deleted file mode 100644 index c7e51a18..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lighting_vsm_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin deleted file mode 100644 index ad50ba47..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin deleted file mode 100644 index 37abb823..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin deleted file mode 100644 index 7f275b11..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin deleted file mode 100644 index d1f651fc..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin deleted file mode 100644 index 63e0f78f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin deleted file mode 100644 index 954f0ead..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin deleted file mode 100644 index 239405a4..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin deleted file mode 100644 index 3408ef77..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin deleted file mode 100644 index 44c3a348..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin deleted file mode 100644 index cb0fe685..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin deleted file mode 100644 index 37abb823..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin deleted file mode 100644 index 7f275b11..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lighting.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lighting.bin deleted file mode 100644 index ef6bf604..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin deleted file mode 100644 index ad50ba47..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin deleted file mode 100644 index d7362dfd..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin deleted file mode 100644 index 58a70bbe..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin deleted file mode 100644 index 2cb49d20..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin deleted file mode 100644 index b2223d72..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin deleted file mode 100644 index 65dcdd0f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin deleted file mode 100644 index 58a70bbe..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin deleted file mode 100644 index 2cb49d20..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin deleted file mode 100644 index b2223d72..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin deleted file mode 100644 index 3e69e078..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin deleted file mode 100644 index dd05e0d9..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin deleted file mode 100644 index 95e0ad9a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin deleted file mode 100644 index 4bcfb148..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin deleted file mode 100644 index 3408ef77..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lighting.bin b/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lighting.bin deleted file mode 100644 index 0724e37a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sky.bin b/bgfx/examples/runtime/shaders/dx9/fs_sky.bin deleted file mode 100644 index 5064b58d..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sky.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sky_color_banding_fix.bin b/bgfx/examples/runtime/shaders/dx9/fs_sky_color_banding_fix.bin deleted file mode 100644 index 5afafb2c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sky_color_banding_fix.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sky_landscape.bin b/bgfx/examples/runtime/shaders/dx9/fs_sky_landscape.bin deleted file mode 100644 index b25b4354..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sky_landscape.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin b/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin deleted file mode 100644 index 41a0d91c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin b/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin deleted file mode 100644 index e645628c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin b/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin deleted file mode 100644 index b1b4264e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin b/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin deleted file mode 100644 index dd24490c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sss_deferred_combine.bin b/bgfx/examples/runtime/shaders/dx9/fs_sss_deferred_combine.bin deleted file mode 100644 index 9223fb96..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sss_deferred_combine.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sss_gbuffer.bin b/bgfx/examples/runtime/shaders/dx9/fs_sss_gbuffer.bin deleted file mode 100644 index f2b1affd..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sss_gbuffer.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sss_linear_depth.bin b/bgfx/examples/runtime/shaders/dx9/fs_sss_linear_depth.bin deleted file mode 100644 index d917ae3a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sss_linear_depth.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_sss_unlit.bin b/bgfx/examples/runtime/shaders/dx9/fs_sss_unlit.bin deleted file mode 100644 index 2b8dd1d1..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_sss_unlit.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin b/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin deleted file mode 100644 index b1b4264e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lighting.bin b/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lighting.bin deleted file mode 100644 index 222d6898..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin b/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin deleted file mode 100644 index ad50ba47..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin b/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin deleted file mode 100644 index 3408ef77..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lighting.bin b/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lighting.bin deleted file mode 100644 index e1e169b6..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_terrain.bin b/bgfx/examples/runtime/shaders/dx9/fs_terrain.bin deleted file mode 100644 index 6642221c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_terrain.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_tree.bin b/bgfx/examples/runtime/shaders/dx9/fs_tree.bin deleted file mode 100644 index 3a994d45..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_tree.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_update.bin b/bgfx/examples/runtime/shaders/dx9/fs_update.bin deleted file mode 100644 index 1f0eedd0..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_update.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin b/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin deleted file mode 100644 index f3563c9e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin b/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin deleted file mode 100644 index ec0c1e4a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_upsample.bin b/bgfx/examples/runtime/shaders/dx9/fs_upsample.bin deleted file mode 100644 index 08dbea04..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_upsample.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin b/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin deleted file mode 100644 index a5fb6ea0..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin b/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin deleted file mode 100644 index 4560d9a5..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin b/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin deleted file mode 100644 index 476ad6e5..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_vt_mip.bin b/bgfx/examples/runtime/shaders/dx9/fs_vt_mip.bin deleted file mode 100644 index 789adf25..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_vt_mip.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_vt_unlit.bin b/bgfx/examples/runtime/shaders/dx9/fs_vt_unlit.bin deleted file mode 100644 index eb46ab81..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_vt_unlit.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_wf_mesh.bin b/bgfx/examples/runtime/shaders/dx9/fs_wf_mesh.bin deleted file mode 100644 index 6bd8a8b5..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_wf_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/fs_wf_wireframe.bin b/bgfx/examples/runtime/shaders/dx9/fs_wf_wireframe.bin deleted file mode 100644 index 7f206c30..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/fs_wf_wireframe.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_albedo_output.bin b/bgfx/examples/runtime/shaders/dx9/vs_albedo_output.bin deleted file mode 100644 index 2b9543de..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_albedo_output.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_bokeh_forward.bin b/bgfx/examples/runtime/shaders/dx9/vs_bokeh_forward.bin deleted file mode 100644 index 6eb0f438..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_bokeh_forward.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_bokeh_screenquad.bin b/bgfx/examples/runtime/shaders/dx9/vs_bokeh_screenquad.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_bokeh_screenquad.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_bump.bin b/bgfx/examples/runtime/shaders/dx9/vs_bump.bin deleted file mode 100644 index 3124c71b..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_bump.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin b/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin deleted file mode 100644 index 52052445..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_bunnylod.bin b/bgfx/examples/runtime/shaders/dx9/vs_bunnylod.bin deleted file mode 100644 index 7b0b3084..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_bunnylod.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_callback.bin b/bgfx/examples/runtime/shaders/dx9/vs_callback.bin deleted file mode 100644 index 07698c2d..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_callback.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin b/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin deleted file mode 100644 index 95fd67dd..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin b/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin b/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin b/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin deleted file mode 100644 index 95fd67dd..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin b/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin deleted file mode 100644 index 87bb0ca3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin b/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_denoise_gbuffer.bin b/bgfx/examples/runtime/shaders/dx9/vs_denoise_gbuffer.bin deleted file mode 100644 index 0895188f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_denoise_gbuffer.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_denoise_screenquad.bin b/bgfx/examples/runtime/shaders/dx9/vs_denoise_screenquad.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_denoise_screenquad.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_fullscreen.bin b/bgfx/examples/runtime/shaders/dx9/vs_fullscreen.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_fullscreen.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin b/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin deleted file mode 100644 index 50df71ea..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin b/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin b/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin b/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin b/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin deleted file mode 100644 index 8fd46441..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin b/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin b/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin deleted file mode 100644 index 0fd8092d..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin b/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin deleted file mode 100644 index 99ef558a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin b/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin deleted file mode 100644 index 3571f1b5..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin b/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin deleted file mode 100644 index ab2bfe0a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin b/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin deleted file mode 100644 index 4bbac813..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_oit.bin b/bgfx/examples/runtime/shaders/dx9/vs_oit.bin deleted file mode 100644 index 2ab4489a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_oit.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin b/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_particle.bin b/bgfx/examples/runtime/shaders/dx9/vs_particle.bin deleted file mode 100644 index fe36bb2f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_particle.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_picking_shaded.bin b/bgfx/examples/runtime/shaders/dx9/vs_picking_shaded.bin deleted file mode 100644 index a43a3580..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_picking_shaded.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_pom.bin b/bgfx/examples/runtime/shaders/dx9/vs_pom.bin deleted file mode 100644 index c72f0c7b..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_pom.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin b/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin deleted file mode 100644 index 74a58a5a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_rsm_combine.bin b/bgfx/examples/runtime/shaders/dx9/vs_rsm_combine.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_rsm_combine.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_rsm_gbuffer.bin b/bgfx/examples/runtime/shaders/dx9/vs_rsm_gbuffer.bin deleted file mode 100644 index 32f847f0..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_rsm_gbuffer.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_rsm_lbuffer.bin b/bgfx/examples/runtime/shaders/dx9/vs_rsm_lbuffer.bin deleted file mode 100644 index 26adca04..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_rsm_lbuffer.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_rsm_shadow.bin b/bgfx/examples/runtime/shaders/dx9/vs_rsm_shadow.bin deleted file mode 100644 index b7f527de..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_rsm_shadow.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin deleted file mode 100644 index 40836a0f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting.bin deleted file mode 100644 index 2b2ad369..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_csm.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_csm.bin deleted file mode 100644 index d7ee0a32..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear.bin deleted file mode 100644 index 52c34d59..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_csm.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_csm.bin deleted file mode 100644 index 53953187..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_csm.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_omni.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_omni.bin deleted file mode 100644 index fd3ead2c..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_linear_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_omni.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_omni.bin deleted file mode 100644 index c385b453..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lighting_omni.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin deleted file mode 100644 index 40836a0f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin deleted file mode 100644 index 81363019..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin deleted file mode 100644 index e34df08b..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin deleted file mode 100644 index f18c87c6..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lighting.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lighting.bin deleted file mode 100644 index f71bff7e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin deleted file mode 100644 index 7793d9ee..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lighting.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lighting.bin deleted file mode 100644 index 3023ca0a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin deleted file mode 100644 index 26c6ba09..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin deleted file mode 100644 index 40836a0f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin deleted file mode 100644 index 9af4c93d..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lighting.bin b/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lighting.bin deleted file mode 100644 index eb98db90..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_sky.bin b/bgfx/examples/runtime/shaders/dx9/vs_sky.bin deleted file mode 100644 index bebd3006..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_sky.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_sky_landscape.bin b/bgfx/examples/runtime/shaders/dx9/vs_sky_landscape.bin deleted file mode 100644 index d8735fdc..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_sky_landscape.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin b/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin deleted file mode 100644 index 0c66d232..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin b/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin deleted file mode 100644 index 40836a0f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin b/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin deleted file mode 100644 index c9940da4..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_sss_gbuffer.bin b/bgfx/examples/runtime/shaders/dx9/vs_sss_gbuffer.bin deleted file mode 100644 index 2525e1e3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_sss_gbuffer.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_sss_screenquad.bin b/bgfx/examples/runtime/shaders/dx9/vs_sss_screenquad.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_sss_screenquad.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin b/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin deleted file mode 100644 index 40836a0f..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lighting.bin b/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lighting.bin deleted file mode 100644 index d3f9665e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin b/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin b/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin deleted file mode 100644 index 0f8b5da3..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lighting.bin b/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lighting.bin deleted file mode 100644 index c2d56e09..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lighting.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_terrain.bin b/bgfx/examples/runtime/shaders/dx9/vs_terrain.bin deleted file mode 100644 index 8542fc84..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_terrain.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_terrain_height_texture.bin b/bgfx/examples/runtime/shaders/dx9/vs_terrain_height_texture.bin deleted file mode 100644 index 6d8f02f5..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_terrain_height_texture.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_tree.bin b/bgfx/examples/runtime/shaders/dx9/vs_tree.bin deleted file mode 100644 index 061b530e..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_tree.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_update.bin b/bgfx/examples/runtime/shaders/dx9/vs_update.bin deleted file mode 100644 index f2abef75..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_update.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin b/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin deleted file mode 100644 index 74a58a5a..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_vt_generic.bin b/bgfx/examples/runtime/shaders/dx9/vs_vt_generic.bin deleted file mode 100644 index cf2fa64d..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_vt_generic.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_wf_mesh.bin b/bgfx/examples/runtime/shaders/dx9/vs_wf_mesh.bin deleted file mode 100644 index b6dd72c5..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_wf_mesh.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/dx9/vs_wf_wireframe.bin b/bgfx/examples/runtime/shaders/dx9/vs_wf_wireframe.bin deleted file mode 100644 index dcc4697d..00000000 Binary files a/bgfx/examples/runtime/shaders/dx9/vs_wf_wireframe.bin and /dev/null differ diff --git a/bgfx/examples/runtime/shaders/glsl/fs_deferred_clear_uav.bin b/bgfx/examples/runtime/shaders/glsl/fs_deferred_clear_uav.bin index 4a53606b..84809017 100644 Binary files a/bgfx/examples/runtime/shaders/glsl/fs_deferred_clear_uav.bin and b/bgfx/examples/runtime/shaders/glsl/fs_deferred_clear_uav.bin differ diff --git a/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_uav.bin b/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_uav.bin index 209b4f61..63caf179 100644 Binary files a/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_uav.bin and b/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_uav.bin differ diff --git a/bgfx/examples/runtime/shaders/glsl/fs_terrain_render.bin b/bgfx/examples/runtime/shaders/glsl/fs_terrain_render.bin index 102f5633..ff0ff320 100644 Binary files a/bgfx/examples/runtime/shaders/glsl/fs_terrain_render.bin and b/bgfx/examples/runtime/shaders/glsl/fs_terrain_render.bin differ diff --git a/bgfx/examples/runtime/shaders/glsl/fs_terrain_render_normal.bin b/bgfx/examples/runtime/shaders/glsl/fs_terrain_render_normal.bin index 40573a5e..3bc43bee 100644 Binary files a/bgfx/examples/runtime/shaders/glsl/fs_terrain_render_normal.bin and b/bgfx/examples/runtime/shaders/glsl/fs_terrain_render_normal.bin differ diff --git a/bgfx/examples/runtime/shaders/glsl/vs_terrain_render.bin b/bgfx/examples/runtime/shaders/glsl/vs_terrain_render.bin index 67a55701..86ed6029 100644 Binary files a/bgfx/examples/runtime/shaders/glsl/vs_terrain_render.bin and b/bgfx/examples/runtime/shaders/glsl/vs_terrain_render.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_apply.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_apply.bin index 8d0b6bd3..883963e8 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_apply.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_apply.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_importance_map.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_importance_map.bin index 34bb5112..7282d1c3 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_importance_map.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_importance_map.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q0.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q0.bin index 522038bd..fad5d345 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q0.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q0.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q1.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q1.bin index a1612a96..0746fec5 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q1.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q1.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q2.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q2.bin index 8aba44b1..70253d38 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q2.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q2.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q3.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q3.bin index 5c1ddc69..cec96f78 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q3.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q3.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q3base.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q3base.bin index e6ec3088..d4cd41d9 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q3base.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_generate_q3base.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_apply.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_apply.bin index dfbec451..eac33d7c 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_apply.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_apply.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_blur.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_blur.bin index 759a20ce..7a95d753 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_blur.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_blur.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_half_apply.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_half_apply.bin index 8a321b05..b755b68d 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_half_apply.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_non_smart_half_apply.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_postprocess_importance_map_a.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_postprocess_importance_map_a.bin index 4a76951a..82b3b3a8 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_postprocess_importance_map_a.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_postprocess_importance_map_a.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_postprocess_importance_map_b.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_postprocess_importance_map_b.bin index 024d6db7..9b697c02 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_postprocess_importance_map_b.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_postprocess_importance_map_b.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depth_mip.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depth_mip.bin index 35738210..a92299a8 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depth_mip.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depth_mip.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depths_and_normals.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depths_and_normals.bin index bc80e7a7..63bacaf3 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depths_and_normals.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depths_and_normals.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depths_and_normals_half.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depths_and_normals_half.bin index fff7eb8d..99e7d693 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depths_and_normals_half.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_prepare_depths_and_normals_half.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_smart_blur.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_smart_blur.bin index 2a9d7683..9aa55392 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_smart_blur.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_smart_blur.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_assao_smart_blur_wide.bin b/bgfx/examples/runtime/shaders/metal/cs_assao_smart_blur_wide.bin index 0fcba888..fe2577a3 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_assao_smart_blur_wide.bin and b/bgfx/examples/runtime/shaders/metal/cs_assao_smart_blur_wide.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_drawindirect.bin b/bgfx/examples/runtime/shaders/metal/cs_drawindirect.bin index c871d30b..737de60f 100755 Binary files a/bgfx/examples/runtime/shaders/metal/cs_drawindirect.bin and b/bgfx/examples/runtime/shaders/metal/cs_drawindirect.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_drawindirect_count.bin b/bgfx/examples/runtime/shaders/metal/cs_drawindirect_count.bin index 32ca0a98..0349c7e1 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_drawindirect_count.bin and b/bgfx/examples/runtime/shaders/metal/cs_drawindirect_count.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_16.bin b/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_16.bin index 472fa9e2..f2371e84 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_16.bin and b/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_16.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_32.bin b/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_32.bin index cd4acba5..9f531bc8 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_32.bin and b/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_32.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_16.bin b/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_16.bin index 1c4c1da2..ef63e724 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_16.bin and b/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_16.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_32.bin b/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_32.bin index acc3bf85..450444f2 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_32.bin and b/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_32.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_16.bin b/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_16.bin index d3635fea..ace74bd7 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_16.bin and b/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_16.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_32.bin b/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_32.bin index 976d0caa..a14cff0e 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_32.bin and b/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_32.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin b/bgfx/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin index 6b7f5bb7..2d4a64ff 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin and b/bgfx/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin b/bgfx/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin index c60b0b3d..c90ebf2f 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin and b/bgfx/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin b/bgfx/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin index 4c0d260e..1f3be4a5 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin and b/bgfx/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_init_instances.bin b/bgfx/examples/runtime/shaders/metal/cs_init_instances.bin index 3b054765..7743eac4 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_init_instances.bin and b/bgfx/examples/runtime/shaders/metal/cs_init_instances.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_terrain_lod.bin b/bgfx/examples/runtime/shaders/metal/cs_terrain_lod.bin index 393de7d5..336e2fce 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_terrain_lod.bin and b/bgfx/examples/runtime/shaders/metal/cs_terrain_lod.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/cs_update_instances.bin b/bgfx/examples/runtime/shaders/metal/cs_update_instances.bin index 441f2799..63708453 100644 Binary files a/bgfx/examples/runtime/shaders/metal/cs_update_instances.bin and b/bgfx/examples/runtime/shaders/metal/cs_update_instances.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_assao_deferred_combine.bin b/bgfx/examples/runtime/shaders/metal/fs_assao_deferred_combine.bin index 90a8cdcd..a1645704 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_assao_deferred_combine.bin and b/bgfx/examples/runtime/shaders/metal/fs_assao_deferred_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bloom_combine.bin b/bgfx/examples/runtime/shaders/metal/fs_bloom_combine.bin index f12faa8f..0b8e9e9f 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bloom_combine.bin and b/bgfx/examples/runtime/shaders/metal/fs_bloom_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy_linear_to_gamma.bin b/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy_linear_to_gamma.bin index e4d20f97..1dc0a3fe 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy_linear_to_gamma.bin and b/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy_linear_to_gamma.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_combine.bin b/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_combine.bin index a408380f..91b5f2c6 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_combine.bin and b/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_debug.bin b/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_debug.bin index ffbc8191..f319f519 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_debug.bin and b/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_debug.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_second_pass.bin b/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_second_pass.bin index e2a5b4ec..3ca73788 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_second_pass.bin and b/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_second_pass.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_single_pass.bin b/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_single_pass.bin index 7e845b40..c4a89be8 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_single_pass.bin and b/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_single_pass.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward.bin b/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward.bin index e989ae44..c8e3ea8d 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward.bin and b/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward_grid.bin b/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward_grid.bin index e42ca1c7..f1f1c0f6 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward_grid.bin and b/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward_grid.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bump.bin b/bgfx/examples/runtime/shaders/metal/fs_bump.bin index 5a16cdd8..4b80e34d 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bump.bin and b/bgfx/examples/runtime/shaders/metal/fs_bump.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_bunnylod.bin b/bgfx/examples/runtime/shaders/metal/fs_bunnylod.bin index d3c173ef..c8b88ab6 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_bunnylod.bin and b/bgfx/examples/runtime/shaders/metal/fs_bunnylod.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_callback.bin b/bgfx/examples/runtime/shaders/metal/fs_callback.bin index d3c173ef..c8b88ab6 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_callback.bin and b/bgfx/examples/runtime/shaders/metal/fs_callback.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin b/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin index db8adfc4..8b25cc2e 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin and b/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin b/bgfx/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin index d84f87f5..e4ce4a43 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin and b/bgfx/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_ta.bin b/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_ta.bin index 868ce15b..c8cf6bfa 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_ta.bin and b/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_ta.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin b/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin index a922dac5..a8ddc197 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin and b/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin b/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin index 8c85a648..d0db28ea 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin and b/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_deferred_light_ta.bin b/bgfx/examples/runtime/shaders/metal/fs_deferred_light_ta.bin index c2ae5106..c328c77b 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_deferred_light_ta.bin and b/bgfx/examples/runtime/shaders/metal/fs_deferred_light_ta.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_deferred_light_uav.bin b/bgfx/examples/runtime/shaders/metal/fs_deferred_light_uav.bin index 8bbf7405..75c02f55 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_deferred_light_uav.bin and b/bgfx/examples/runtime/shaders/metal/fs_deferred_light_uav.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_denoise_apply_lighting.bin b/bgfx/examples/runtime/shaders/metal/fs_denoise_apply_lighting.bin index c96d3a1e..1889b931 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_denoise_apply_lighting.bin and b/bgfx/examples/runtime/shaders/metal/fs_denoise_apply_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_denoise_deferred_combine.bin b/bgfx/examples/runtime/shaders/metal/fs_denoise_deferred_combine.bin index c9821e26..f062ca9e 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_denoise_deferred_combine.bin and b/bgfx/examples/runtime/shaders/metal/fs_denoise_deferred_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_denoise_gbuffer.bin b/bgfx/examples/runtime/shaders/metal/fs_denoise_gbuffer.bin index 8cb48c1b..b075db97 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_denoise_gbuffer.bin and b/bgfx/examples/runtime/shaders/metal/fs_denoise_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_3x3.bin b/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_3x3.bin index 9bebb9ad..38f1d7cc 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_3x3.bin and b/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_3x3.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_5x5.bin b/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_5x5.bin index 8b902685..e811b08e 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_5x5.bin and b/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_5x5.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_denoise_temporal.bin b/bgfx/examples/runtime/shaders/metal/fs_denoise_temporal.bin index 49d2736e..ff79c776 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_denoise_temporal.bin and b/bgfx/examples/runtime/shaders/metal/fs_denoise_temporal.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_denoise_txaa.bin b/bgfx/examples/runtime/shaders/metal/fs_denoise_txaa.bin index 124374d2..4c68b235 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_denoise_txaa.bin and b/bgfx/examples/runtime/shaders/metal/fs_denoise_txaa.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_downsample.bin b/bgfx/examples/runtime/shaders/metal/fs_downsample.bin index 5bdcbc85..3173850b 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_downsample.bin and b/bgfx/examples/runtime/shaders/metal/fs_downsample.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_fsr_copy_linear_to_gamma.bin b/bgfx/examples/runtime/shaders/metal/fs_fsr_copy_linear_to_gamma.bin index cea87573..f1f407f4 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_fsr_copy_linear_to_gamma.bin and b/bgfx/examples/runtime/shaders/metal/fs_fsr_copy_linear_to_gamma.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_fsr_forward.bin b/bgfx/examples/runtime/shaders/metal/fs_fsr_forward.bin index e989ae44..c8e3ea8d 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_fsr_forward.bin and b/bgfx/examples/runtime/shaders/metal/fs_fsr_forward.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_fsr_forward_grid.bin b/bgfx/examples/runtime/shaders/metal/fs_fsr_forward_grid.bin index e42ca1c7..f1f1c0f6 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_fsr_forward_grid.bin and b/bgfx/examples/runtime/shaders/metal/fs_fsr_forward_grid.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_gdr_instanced_indirect_rendering.bin b/bgfx/examples/runtime/shaders/metal/fs_gdr_instanced_indirect_rendering.bin index de6b3ea0..7175f3fa 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_gdr_instanced_indirect_rendering.bin and b/bgfx/examples/runtime/shaders/metal/fs_gdr_instanced_indirect_rendering.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin b/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin index 1cd4958c..6dc17678 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin and b/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin b/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin index bf6ffbea..7483a97f 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin and b/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin b/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin index ab499f18..588a27e2 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin and b/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin b/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin index cb597154..676cf6d9 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin and b/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin b/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin index e4b5ab96..903a2942 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin and b/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin b/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin index 9b653962..9d62cbce 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin and b/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_hextile.bin b/bgfx/examples/runtime/shaders/metal/fs_hextile.bin index 8aca708a..c69cd21b 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_hextile.bin and b/bgfx/examples/runtime/shaders/metal/fs_hextile.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin b/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin index 1c3f2442..1ef5765b 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin and b/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin b/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin index 9d6ee1ad..cd0c386e 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin and b/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_mesh.bin b/bgfx/examples/runtime/shaders/metal/fs_mesh.bin index ddc1c74f..978b7337 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_mesh.bin and b/bgfx/examples/runtime/shaders/metal/fs_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin b/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin index 2df948cf..d9babbf1 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin and b/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin b/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin index be4d580e..513fc046 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin and b/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin b/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin index fe19ccc1..a64885e7 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin and b/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin b/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin index 16cfa000..3ba675c4 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin and b/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_particle.bin b/bgfx/examples/runtime/shaders/metal/fs_particle.bin index de282dc3..549982dd 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_particle.bin and b/bgfx/examples/runtime/shaders/metal/fs_particle.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_picking_shaded.bin b/bgfx/examples/runtime/shaders/metal/fs_picking_shaded.bin index a63a5900..7eda94a5 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_picking_shaded.bin and b/bgfx/examples/runtime/shaders/metal/fs_picking_shaded.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_pom.bin b/bgfx/examples/runtime/shaders/metal/fs_pom.bin index e88822e9..5c251f0d 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_pom.bin and b/bgfx/examples/runtime/shaders/metal/fs_pom.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin b/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin index 24493299..ca15ad8f 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin and b/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_rsm_combine.bin b/bgfx/examples/runtime/shaders/metal/fs_rsm_combine.bin index 3c2f162d..09e25709 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_rsm_combine.bin and b/bgfx/examples/runtime/shaders/metal/fs_rsm_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin b/bgfx/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin index d81099b0..3b830efb 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin and b/bgfx/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_screen_space_shadows.bin b/bgfx/examples/runtime/shaders/metal/fs_screen_space_shadows.bin index 22b08628..2514786a 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_screen_space_shadows.bin and b/bgfx/examples/runtime/shaders/metal/fs_screen_space_shadows.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin index 39768c3d..e4cb3b53 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin index 12718c07..579d1b83 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin index 7c0fdb66..71d46a27 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin index a8998f62..37e81feb 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin index 2ba674e7..6c58fb66 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin index 60a9997c..2ec8ca1f 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin index bd51c832..99b18806 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin index 19c82e96..a76acf73 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin index a9915e6b..a3552fe0 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin index a5dee4ee..3b71722c 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin index 94f84bcd..65e41d14 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin index 38d4f13f..13474b98 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin index adecc61d..8bf8518c 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin index 6e74001a..1799637e 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin index d6f85b93..b3b6fcd7 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin index ed6ce55f..1d952e27 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin index 67d3d6c6..a878b72e 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin index ed456585..6eb274ac 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin index 395727c5..0883e851 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin index c687f1fd..a7436c4b 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin index ac4ae8a7..4412cbd8 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin index e1feaa51..3f7c9513 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin index 541214e8..caf36bb3 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin index 58ffb2e7..98999554 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin index 8535afb5..87c9b206 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin index 2df871e7..43a03a48 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin index db044bd1..63f051ce 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin index a43166ee..dfaa889f 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin index ad36ee45..9dc7bdcd 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin index faaafd78..43e0b4df 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin index e4ab6de7..0c518798 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin index acf8e51a..1a779e35 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin index a14b811d..9c001ade 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin index 2df871e7..43a03a48 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin index db044bd1..63f051ce 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lighting.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lighting.bin index d03d0e16..d43b6d6f 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lighting.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin index 8535afb5..87c9b206 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin index a223eea7..c6674b57 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin index f943776b..1ca7a8e1 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin index 4700728a..d9bf1a1a 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin index c702d2dc..1a2c7ed6 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin index 466c6c75..a00e23d2 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin index 74e302e7..7361f9e5 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lighting.bin b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lighting.bin index eb7469e0..e869cd1d 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lighting.bin and b/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_sky.bin b/bgfx/examples/runtime/shaders/metal/fs_sky.bin index b6c9327a..a2d09fa5 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_sky.bin and b/bgfx/examples/runtime/shaders/metal/fs_sky.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_sky_color_banding_fix.bin b/bgfx/examples/runtime/shaders/metal/fs_sky_color_banding_fix.bin index e1486e62..85e5b8ed 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_sky_color_banding_fix.bin and b/bgfx/examples/runtime/shaders/metal/fs_sky_color_banding_fix.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_sky_landscape.bin b/bgfx/examples/runtime/shaders/metal/fs_sky_landscape.bin index 05cdc843..ca604685 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_sky_landscape.bin and b/bgfx/examples/runtime/shaders/metal/fs_sky_landscape.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin b/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin index 38f098af..254abdc7 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin and b/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin b/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin index 59813b88..d69ab00e 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin and b/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin b/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin index f3ff6246..9a9b22af 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin and b/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_sss_deferred_combine.bin b/bgfx/examples/runtime/shaders/metal/fs_sss_deferred_combine.bin index 822281f6..723e770c 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_sss_deferred_combine.bin and b/bgfx/examples/runtime/shaders/metal/fs_sss_deferred_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_sss_gbuffer.bin b/bgfx/examples/runtime/shaders/metal/fs_sss_gbuffer.bin index bcf7fb1b..5a7de469 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_sss_gbuffer.bin and b/bgfx/examples/runtime/shaders/metal/fs_sss_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_sss_unlit.bin b/bgfx/examples/runtime/shaders/metal/fs_sss_unlit.bin index 34e421c8..b384e1f3 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_sss_unlit.bin and b/bgfx/examples/runtime/shaders/metal/fs_sss_unlit.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin b/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin index 6b83db7d..7edf5868 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin and b/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin b/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin index 8535afb5..87c9b206 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin and b/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin b/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin index b180c3c0..73d21a84 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin and b/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_terrain_render.bin b/bgfx/examples/runtime/shaders/metal/fs_terrain_render.bin index 0e112258..32dedc1b 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_terrain_render.bin and b/bgfx/examples/runtime/shaders/metal/fs_terrain_render.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_tree.bin b/bgfx/examples/runtime/shaders/metal/fs_tree.bin index 1472bb83..782d7e6f 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_tree.bin and b/bgfx/examples/runtime/shaders/metal/fs_tree.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin b/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin index 9698ebb9..3dc4ae8c 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin and b/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin b/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin index e89758b7..6fd6a7f5 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin and b/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_vt_mip.bin b/bgfx/examples/runtime/shaders/metal/fs_vt_mip.bin index d42339c5..e9d5b538 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_vt_mip.bin and b/bgfx/examples/runtime/shaders/metal/fs_vt_mip.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_vt_unlit.bin b/bgfx/examples/runtime/shaders/metal/fs_vt_unlit.bin index 3d00906f..727165ed 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_vt_unlit.bin and b/bgfx/examples/runtime/shaders/metal/fs_vt_unlit.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin b/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin index 27641e60..29500caa 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin and b/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin b/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin index 20a83a0e..a0d4b6fc 100644 Binary files a/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin and b/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_fsr_forward.bin b/bgfx/examples/runtime/shaders/metal/vs_fsr_forward.bin index 2cb8194b..84c54ff5 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_fsr_forward.bin and b/bgfx/examples/runtime/shaders/metal/vs_fsr_forward.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin b/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin index 4115c0d0..6937b788 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin and b/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin b/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin index 1cd57a0b..7d41e526 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin and b/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_mesh.bin b/bgfx/examples/runtime/shaders/metal/vs_mesh.bin index 688c3e0c..ec7bdfef 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_mesh.bin and b/bgfx/examples/runtime/shaders/metal/vs_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_pom.bin b/bgfx/examples/runtime/shaders/metal/vs_pom.bin index 550d1e39..da118cfd 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_pom.bin and b/bgfx/examples/runtime/shaders/metal/vs_pom.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin b/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin index 54e455a2..5277705a 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin and b/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin b/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin index 6291c7c5..b9d93c67 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin and b/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin b/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin index 5f06d6bd..8fba42b9 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin and b/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_sky.bin b/bgfx/examples/runtime/shaders/metal/vs_sky.bin index 92196f76..ed226e34 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_sky.bin and b/bgfx/examples/runtime/shaders/metal/vs_sky.bin differ diff --git a/bgfx/examples/runtime/shaders/metal/vs_terrain_render.bin b/bgfx/examples/runtime/shaders/metal/vs_terrain_render.bin index 5805d14c..04be73a0 100644 Binary files a/bgfx/examples/runtime/shaders/metal/vs_terrain_render.bin and b/bgfx/examples/runtime/shaders/metal/vs_terrain_render.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_apply.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_apply.bin index aafd12d5..633216c2 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_apply.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_apply.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_importance_map.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_importance_map.bin index 10d157b6..1e1f6f53 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_importance_map.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_importance_map.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q0.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q0.bin index f91f705a..9684647f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q0.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q0.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q1.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q1.bin index 7981bb0b..cdc0b92b 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q1.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q1.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q2.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q2.bin index e68f8376..fcb469bc 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q2.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q2.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3.bin index 26e3cc82..c1912e7f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3base.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3base.bin index a6816656..d0ace6fa 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3base.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3base.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_load_counter_clear.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_load_counter_clear.bin index 742f2dfb..b58b7a92 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_load_counter_clear.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_load_counter_clear.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_apply.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_apply.bin index e6d6c376..f41f747a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_apply.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_apply.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_blur.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_blur.bin index 9c2245eb..95092449 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_blur.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_blur.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_half_apply.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_half_apply.bin index 228765ec..db74705d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_half_apply.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_half_apply.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_a.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_a.bin index 77f01856..6e77c2c9 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_a.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_a.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_b.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_b.bin index 084ba993..ea4e44a1 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_b.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_b.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depth_mip.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depth_mip.bin index c2884b3d..a911cc84 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depth_mip.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depth_mip.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths.bin index f6b30628..18c6c8d3 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals.bin index 6c34b8c4..6be1a281 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals_half.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals_half.bin index 7eb97b82..5703a7fd 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals_half.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals_half.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_half.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_half.bin index 28a7257a..3f9336cd 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_half.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_half.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur.bin index dbacc198..7bdbbe73 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur_wide.bin b/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur_wide.bin index 337b923d..d5639e93 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur_wide.bin and b/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur_wide.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_drawindirect.bin b/bgfx/examples/runtime/shaders/spirv/cs_drawindirect.bin index cfec922a..4d82d8e5 100755 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_drawindirect.bin and b/bgfx/examples/runtime/shaders/spirv/cs_drawindirect.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_drawindirect_count.bin b/bgfx/examples/runtime/shaders/spirv/cs_drawindirect_count.bin index 9b672b58..dbfd7bb5 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_drawindirect_count.bin and b/bgfx/examples/runtime/shaders/spirv/cs_drawindirect_count.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_16.bin b/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_16.bin index 8769d916..c5cf7401 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_16.bin and b/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_16.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_32.bin b/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_32.bin index f342749d..8e0c42b5 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_32.bin and b/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_32.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_16.bin b/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_16.bin index 9857ef31..deb5b71e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_16.bin and b/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_16.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_32.bin b/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_32.bin index d7478886..9b4a0b08 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_32.bin and b/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_32.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_16.bin b/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_16.bin index 7802bec5..e509225b 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_16.bin and b/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_16.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_32.bin b/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_32.bin index 814e45b6..9ade7552 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_32.bin and b/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_32.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin b/bgfx/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin index 25e706c4..ba6d047b 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin and b/bgfx/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin b/bgfx/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin index c099f691..cd82b78c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin and b/bgfx/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin b/bgfx/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin index f3a25ae9..35399d27 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin and b/bgfx/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin b/bgfx/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin index b05970a8..0f5ca870 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin and b/bgfx/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_indirect.bin b/bgfx/examples/runtime/shaders/spirv/cs_indirect.bin index 5d7c5143..9eeb544c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_indirect.bin and b/bgfx/examples/runtime/shaders/spirv/cs_indirect.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_init_instances.bin b/bgfx/examples/runtime/shaders/spirv/cs_init_instances.bin index d44b5ba9..8d54cc12 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_init_instances.bin and b/bgfx/examples/runtime/shaders/spirv/cs_init_instances.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_terrain_init.bin b/bgfx/examples/runtime/shaders/spirv/cs_terrain_init.bin index c8910492..ce8cc8eb 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_terrain_init.bin and b/bgfx/examples/runtime/shaders/spirv/cs_terrain_init.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_terrain_lod.bin b/bgfx/examples/runtime/shaders/spirv/cs_terrain_lod.bin index 79c7ab39..5ec12987 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_terrain_lod.bin and b/bgfx/examples/runtime/shaders/spirv/cs_terrain_lod.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_draw.bin b/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_draw.bin index 3106f019..ae603ce3 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_draw.bin and b/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_draw.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_indirect.bin b/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_indirect.bin index fb4131aa..0d4be66e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_indirect.bin and b/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_indirect.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_update.bin b/bgfx/examples/runtime/shaders/spirv/cs_update.bin index a6619986..d96fc0ad 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_update.bin and b/bgfx/examples/runtime/shaders/spirv/cs_update.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/cs_update_instances.bin b/bgfx/examples/runtime/shaders/spirv/cs_update_instances.bin index ff8ac028..04578b18 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/cs_update_instances.bin and b/bgfx/examples/runtime/shaders/spirv/cs_update_instances.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_albedo_output.bin b/bgfx/examples/runtime/shaders/spirv/fs_albedo_output.bin index 3b94290a..7e79cb05 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_albedo_output.bin and b/bgfx/examples/runtime/shaders/spirv/fs_albedo_output.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_assao_deferred_combine.bin b/bgfx/examples/runtime/shaders/spirv/fs_assao_deferred_combine.bin index 23f0f523..9a63cb4e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_assao_deferred_combine.bin and b/bgfx/examples/runtime/shaders/spirv/fs_assao_deferred_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_assao_gbuffer.bin b/bgfx/examples/runtime/shaders/spirv/fs_assao_gbuffer.bin index 228c3f6a..3d9b0164 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_assao_gbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/fs_assao_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bloom_combine.bin b/bgfx/examples/runtime/shaders/spirv/fs_bloom_combine.bin index 25d3dbb0..b978dd59 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bloom_combine.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bloom_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy.bin index 925ddad3..52ca4f2d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy_linear_to_gamma.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy_linear_to_gamma.bin index c1f2bf2f..fe2eab12 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy_linear_to_gamma.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy_linear_to_gamma.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_combine.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_combine.bin index dfe30963..cfdba396 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_combine.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_debug.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_debug.bin index 58f5768f..fcaf8ee2 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_debug.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_debug.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_downsample.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_downsample.bin index 05b1a60d..a8b485a5 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_downsample.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_downsample.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_second_pass.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_second_pass.bin index c2b6e971..dfb9f997 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_second_pass.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_second_pass.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_single_pass.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_single_pass.bin index 3247acbf..dd7c2133 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_single_pass.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_single_pass.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward.bin index f89df664..08d1cdad 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward_grid.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward_grid.bin index 218ac86a..4b48fe61 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward_grid.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward_grid.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_linear_depth.bin b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_linear_depth.bin index dcfb81f9..1d02b664 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bokeh_linear_depth.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bokeh_linear_depth.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bump.bin b/bgfx/examples/runtime/shaders/spirv/fs_bump.bin index 3e19a62e..030911a3 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bump.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bump.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_bunnylod.bin b/bgfx/examples/runtime/shaders/spirv/fs_bunnylod.bin index f41369ec..fc4302d5 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_bunnylod.bin and b/bgfx/examples/runtime/shaders/spirv/fs_bunnylod.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_callback.bin b/bgfx/examples/runtime/shaders/spirv/fs_callback.bin index f41369ec..fc4302d5 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_callback.bin and b/bgfx/examples/runtime/shaders/spirv/fs_callback.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_cubes.bin b/bgfx/examples/runtime/shaders/spirv/fs_cubes.bin index d863400a..c431f504 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_cubes.bin and b/bgfx/examples/runtime/shaders/spirv/fs_cubes.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_clear_uav.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_clear_uav.bin index a3836648..2d6e63f6 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_clear_uav.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_clear_uav.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine.bin index dfee6471..f9dd171a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine_ta.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine_ta.bin index b288cbe5..f30ea607 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine_ta.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine_ta.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug.bin index 49479d62..0411ecbe 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_line.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_line.bin index d863400a..c431f504 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_line.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_line.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_ta.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_ta.bin index 8018c88f..c2ebbd78 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_ta.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_ta.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_geom.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_geom.bin index 34a90611..d5b7cd7f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_geom.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_geom.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_light.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_light.bin index 2cff13e0..b0843a2d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_light.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_light.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_ta.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_ta.bin index c6b2a694..83c75058 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_ta.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_ta.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_uav.bin b/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_uav.bin index ee1b8a33..cc74b0de 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_uav.bin and b/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_uav.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_denoise_apply_lighting.bin b/bgfx/examples/runtime/shaders/spirv/fs_denoise_apply_lighting.bin index eeabafb0..28dc44ef 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_denoise_apply_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/fs_denoise_apply_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_denoise_copy.bin b/bgfx/examples/runtime/shaders/spirv/fs_denoise_copy.bin index 925ddad3..52ca4f2d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_denoise_copy.bin and b/bgfx/examples/runtime/shaders/spirv/fs_denoise_copy.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_denoise_deferred_combine.bin b/bgfx/examples/runtime/shaders/spirv/fs_denoise_deferred_combine.bin index 7c5e8eb9..aef54b14 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_denoise_deferred_combine.bin and b/bgfx/examples/runtime/shaders/spirv/fs_denoise_deferred_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_denoise_gbuffer.bin b/bgfx/examples/runtime/shaders/spirv/fs_denoise_gbuffer.bin index 4dc64433..6a812fcc 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_denoise_gbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/fs_denoise_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_3x3.bin b/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_3x3.bin index 33d36a3b..f1d97413 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_3x3.bin and b/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_3x3.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_5x5.bin b/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_5x5.bin index 0ae48231..4027574a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_5x5.bin and b/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_5x5.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_denoise_temporal.bin b/bgfx/examples/runtime/shaders/spirv/fs_denoise_temporal.bin index 86837123..f47f7864 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_denoise_temporal.bin and b/bgfx/examples/runtime/shaders/spirv/fs_denoise_temporal.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_denoise_txaa.bin b/bgfx/examples/runtime/shaders/spirv/fs_denoise_txaa.bin index cda8b5cb..1f451892 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_denoise_txaa.bin and b/bgfx/examples/runtime/shaders/spirv/fs_denoise_txaa.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_downsample.bin b/bgfx/examples/runtime/shaders/spirv/fs_downsample.bin index a5789075..37547584 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_downsample.bin and b/bgfx/examples/runtime/shaders/spirv/fs_downsample.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_fsr_copy_linear_to_gamma.bin b/bgfx/examples/runtime/shaders/spirv/fs_fsr_copy_linear_to_gamma.bin index f8a0bfa7..e3ed4ec2 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_fsr_copy_linear_to_gamma.bin and b/bgfx/examples/runtime/shaders/spirv/fs_fsr_copy_linear_to_gamma.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward.bin b/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward.bin index f89df664..08d1cdad 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward.bin and b/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward_grid.bin b/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward_grid.bin index 218ac86a..4b48fe61 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward_grid.bin and b/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward_grid.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_gdr_instanced_indirect_rendering.bin b/bgfx/examples/runtime/shaders/spirv/fs_gdr_instanced_indirect_rendering.bin index 6d3c9a25..19610c84 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_gdr_instanced_indirect_rendering.bin and b/bgfx/examples/runtime/shaders/spirv/fs_gdr_instanced_indirect_rendering.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_hdr_blur.bin b/bgfx/examples/runtime/shaders/spirv/fs_hdr_blur.bin index 8726fc35..3678f715 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_hdr_blur.bin and b/bgfx/examples/runtime/shaders/spirv/fs_hdr_blur.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_hdr_bright.bin b/bgfx/examples/runtime/shaders/spirv/fs_hdr_bright.bin index 590c90c7..16061239 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_hdr_bright.bin and b/bgfx/examples/runtime/shaders/spirv/fs_hdr_bright.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_hdr_lum.bin b/bgfx/examples/runtime/shaders/spirv/fs_hdr_lum.bin index f95afb3f..8ebd4e04 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_hdr_lum.bin and b/bgfx/examples/runtime/shaders/spirv/fs_hdr_lum.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_hdr_lumavg.bin b/bgfx/examples/runtime/shaders/spirv/fs_hdr_lumavg.bin index 62706f82..c77046fc 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_hdr_lumavg.bin and b/bgfx/examples/runtime/shaders/spirv/fs_hdr_lumavg.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_hdr_mesh.bin b/bgfx/examples/runtime/shaders/spirv/fs_hdr_mesh.bin index 9ce80235..4d6b9412 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_hdr_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/fs_hdr_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_hdr_skybox.bin b/bgfx/examples/runtime/shaders/spirv/fs_hdr_skybox.bin index a651277d..6778b401 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_hdr_skybox.bin and b/bgfx/examples/runtime/shaders/spirv/fs_hdr_skybox.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_hdr_tonemap.bin b/bgfx/examples/runtime/shaders/spirv/fs_hdr_tonemap.bin index 5fe4b247..9d3f58a0 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_hdr_tonemap.bin and b/bgfx/examples/runtime/shaders/spirv/fs_hdr_tonemap.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_hextile.bin b/bgfx/examples/runtime/shaders/spirv/fs_hextile.bin index 45e39e53..753079bd 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_hextile.bin and b/bgfx/examples/runtime/shaders/spirv/fs_hextile.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_ibl_mesh.bin b/bgfx/examples/runtime/shaders/spirv/fs_ibl_mesh.bin index 6bee5583..122c7cf2 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_ibl_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/fs_ibl_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_ibl_skybox.bin b/bgfx/examples/runtime/shaders/spirv/fs_ibl_skybox.bin index 12d383c6..e644c3af 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_ibl_skybox.bin and b/bgfx/examples/runtime/shaders/spirv/fs_ibl_skybox.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_instancing.bin b/bgfx/examples/runtime/shaders/spirv/fs_instancing.bin index d863400a..c431f504 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_instancing.bin and b/bgfx/examples/runtime/shaders/spirv/fs_instancing.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_mesh.bin b/bgfx/examples/runtime/shaders/spirv/fs_mesh.bin index f58222af..d480046e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/fs_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_oit.bin b/bgfx/examples/runtime/shaders/spirv/fs_oit.bin index d65bcb6d..a577e1d1 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_oit.bin and b/bgfx/examples/runtime/shaders/spirv/fs_oit.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_oit_wb.bin b/bgfx/examples/runtime/shaders/spirv/fs_oit_wb.bin index fadb68cb..4b560790 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_oit_wb.bin and b/bgfx/examples/runtime/shaders/spirv/fs_oit_wb.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_blit.bin b/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_blit.bin index 0a6158cc..6f3089d9 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_blit.bin and b/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_blit.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate.bin b/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate.bin index 4ec8c939..71937d59 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate.bin and b/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate_blit.bin b/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate_blit.bin index f02a5c44..4b6279d2 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate_blit.bin and b/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate_blit.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_particle.bin b/bgfx/examples/runtime/shaders/spirv/fs_particle.bin index fbb067b8..2908c534 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_particle.bin and b/bgfx/examples/runtime/shaders/spirv/fs_particle.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_picking_id.bin b/bgfx/examples/runtime/shaders/spirv/fs_picking_id.bin index 638bcfeb..70ed6a82 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_picking_id.bin and b/bgfx/examples/runtime/shaders/spirv/fs_picking_id.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_picking_shaded.bin b/bgfx/examples/runtime/shaders/spirv/fs_picking_shaded.bin index fae9b5a0..f4e83e4c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_picking_shaded.bin and b/bgfx/examples/runtime/shaders/spirv/fs_picking_shaded.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_pom.bin b/bgfx/examples/runtime/shaders/spirv/fs_pom.bin index b900f054..8ea23239 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_pom.bin and b/bgfx/examples/runtime/shaders/spirv/fs_pom.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_raymarching.bin b/bgfx/examples/runtime/shaders/spirv/fs_raymarching.bin index 14b41e26..9ab88deb 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_raymarching.bin and b/bgfx/examples/runtime/shaders/spirv/fs_raymarching.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_rsm_combine.bin b/bgfx/examples/runtime/shaders/spirv/fs_rsm_combine.bin index 0decfa13..90c8d63d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_rsm_combine.bin and b/bgfx/examples/runtime/shaders/spirv/fs_rsm_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_rsm_gbuffer.bin b/bgfx/examples/runtime/shaders/spirv/fs_rsm_gbuffer.bin index 24c4540f..84a41ece 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_rsm_gbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/fs_rsm_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_rsm_lbuffer.bin b/bgfx/examples/runtime/shaders/spirv/fs_rsm_lbuffer.bin index 1fe52db5..719f5bb3 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_rsm_lbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/fs_rsm_lbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_rsm_shadow.bin b/bgfx/examples/runtime/shaders/spirv/fs_rsm_shadow.bin index 44831829..c0dcd8cf 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_rsm_shadow.bin and b/bgfx/examples/runtime/shaders/spirv/fs_rsm_shadow.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_screen_space_shadows.bin b/bgfx/examples/runtime/shaders/spirv/fs_screen_space_shadows.bin index 93d9a7dc..44783131 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_screen_space_shadows.bin and b/bgfx/examples/runtime/shaders/spirv/fs_screen_space_shadows.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_black.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_black.bin index 070497da..53ec1673 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_black.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_black.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm.bin index 1a51a7c4..b1e23969 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_csm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_csm.bin index 9e11d13d..f53f1573 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_csm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear.bin index 9fefc49a..69174d5b 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_csm.bin index 535ebf32..e534c2b3 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_csm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_omni.bin index 0ab0bd89..72eabd74 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_omni.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_omni.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_omni.bin index 16315782..a0e2ae90 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_omni.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard.bin index ee548ee4..422dffc9 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_csm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_csm.bin index 5e955f98..217a8fa3 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_csm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear.bin index f9018728..b79e88fa 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_csm.bin index c37c9916..19e49d59 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_csm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_omni.bin index 0e134c37..7a2eea67 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_omni.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_omni.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_omni.bin index b63adea4..d2a49ac6 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_omni.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf.bin index 0b0a75b0..2134359d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_csm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_csm.bin index 7edd1113..c6a94a4a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_csm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear.bin index bb03cf38..698e53db 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_csm.bin index dd657c86..ae3f6bba 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_csm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_omni.bin index 2fa4e4bc..8d9682f9 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_omni.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_omni.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_omni.bin index a5256e84..8ec534e6 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_omni.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm.bin index 32e360b7..8d4e134a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_csm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_csm.bin index 42f08b75..1570ab22 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_csm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear.bin index 50b13489..a6ea571d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_csm.bin index 565ef78f..3d1c7858 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_csm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_omni.bin index 4c73341a..eb4f016e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_omni.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_omni.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_omni.bin index 0f04daef..cb420490 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_omni.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_texture.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_texture.bin index 8d6ce8fd..e21377ab 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_texture.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur.bin index 353cec8e..8788c627 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur_vsm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur_vsm.bin index d08787b2..bf688d0c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur_vsm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth.bin index 8e00753d..a22421d2 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_linear.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_linear.bin index ebf99a0c..923cf7d7 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_linear.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm.bin index 191ad695..35ca0cab 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm_linear.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm_linear.bin index 5ad5465e..88ea5ffe 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm_linear.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_texture.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_texture.bin index 49479d62..0411ecbe 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_texture.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth.bin index e5052880..8f078e23 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth_vsm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth_vsm.bin index 339f4ae4..f49acd5b 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth_vsm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur.bin index 353cec8e..8788c627 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur_vsm.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur_vsm.bin index d08787b2..bf688d0c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur_vsm.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur_vsm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_lighting.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_lighting.bin index 64fe767c..6ccf4b00 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_texture.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_texture.bin index 8d6ce8fd..e21377ab 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_texture.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackblank.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackblank.bin index 8b566a8d..e31ad892 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackblank.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackblank.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackcolor.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackcolor.bin index 5fb1843c..18ed21a7 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackcolor.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackcolor.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex1.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex1.bin index 86cb8874..30330537 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex1.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex1.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex2.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex2.bin index 45cd4f78..50ece5cc 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex2.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex2.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontblank.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontblank.bin index 6d3830d3..d8b6c171 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontblank.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontblank.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontcolor.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontcolor.bin index 5fb1843c..18ed21a7 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontcolor.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontcolor.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex1.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex1.bin index b07adfca..31e320bf 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex1.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex1.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex2.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex2.bin index 798468ad..94671a6d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex2.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex2.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svside.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svside.bin index b0b4d3f7..dff58e61 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svside.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svside.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsideblank.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsideblank.bin index 78005413..6447fb4a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsideblank.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsideblank.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidecolor.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidecolor.bin index 557d6602..0a8702d5 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidecolor.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidecolor.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidetex.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidetex.bin index b24b7226..d2c004da 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidetex.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidetex.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture.bin index 49479d62..0411ecbe 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture_lighting.bin b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture_lighting.bin index a90f552f..3f958c72 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sky.bin b/bgfx/examples/runtime/shaders/spirv/fs_sky.bin index 99ef5c23..7289c86d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sky.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sky.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sky_color_banding_fix.bin b/bgfx/examples/runtime/shaders/spirv/fs_sky_color_banding_fix.bin index 48440d1a..43f482f0 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sky_color_banding_fix.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sky_color_banding_fix.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sky_landscape.bin b/bgfx/examples/runtime/shaders/spirv/fs_sky_landscape.bin index d9bef5ab..00f2b0eb 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sky_landscape.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sky_landscape.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh.bin b/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh.bin index 662128b2..74b76e6d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh_pd.bin b/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh_pd.bin index 4677bff6..691acf4c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh_pd.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh_pd.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow.bin b/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow.bin index 2b0dc189..17fa0d54 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow_pd.bin b/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow_pd.bin index 74321b99..2fa14a99 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow_pd.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow_pd.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sss_deferred_combine.bin b/bgfx/examples/runtime/shaders/spirv/fs_sss_deferred_combine.bin index 295aa8b3..c8e76195 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sss_deferred_combine.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sss_deferred_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sss_gbuffer.bin b/bgfx/examples/runtime/shaders/spirv/fs_sss_gbuffer.bin index 1114f3ee..7d889103 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sss_gbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sss_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sss_linear_depth.bin b/bgfx/examples/runtime/shaders/spirv/fs_sss_linear_depth.bin index a336eccd..bb456ddf 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sss_linear_depth.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sss_linear_depth.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_sss_unlit.bin b/bgfx/examples/runtime/shaders/spirv/fs_sss_unlit.bin index a80bd52f..cf439a9c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_sss_unlit.bin and b/bgfx/examples/runtime/shaders/spirv/fs_sss_unlit.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_black.bin b/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_black.bin index 070497da..53ec1673 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_black.bin and b/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_black.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_lighting.bin b/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_lighting.bin index d56f5a82..52164c62 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_texture.bin b/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_texture.bin index 8d6ce8fd..e21377ab 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_texture.bin and b/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture.bin b/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture.bin index 49479d62..0411ecbe 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture.bin and b/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture_lighting.bin b/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture_lighting.bin index e09fe0ff..7b270048 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_terrain.bin b/bgfx/examples/runtime/shaders/spirv/fs_terrain.bin index dfd3eb67..8a066067 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_terrain.bin and b/bgfx/examples/runtime/shaders/spirv/fs_terrain.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_terrain_render.bin b/bgfx/examples/runtime/shaders/spirv/fs_terrain_render.bin index 6d7c4bf1..e2393064 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_terrain_render.bin and b/bgfx/examples/runtime/shaders/spirv/fs_terrain_render.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_terrain_render_normal.bin b/bgfx/examples/runtime/shaders/spirv/fs_terrain_render_normal.bin index ec73b1a2..e363bcbd 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_terrain_render_normal.bin and b/bgfx/examples/runtime/shaders/spirv/fs_terrain_render_normal.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_tree.bin b/bgfx/examples/runtime/shaders/spirv/fs_tree.bin index 0b45e637..d144ca2e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_tree.bin and b/bgfx/examples/runtime/shaders/spirv/fs_tree.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_update.bin b/bgfx/examples/runtime/shaders/spirv/fs_update.bin index 1d512777..9919c868 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_update.bin and b/bgfx/examples/runtime/shaders/spirv/fs_update.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_update_3d.bin b/bgfx/examples/runtime/shaders/spirv/fs_update_3d.bin index 8ef332ab..715c10bc 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_update_3d.bin and b/bgfx/examples/runtime/shaders/spirv/fs_update_3d.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_update_cmp.bin b/bgfx/examples/runtime/shaders/spirv/fs_update_cmp.bin index 52418f79..53766af1 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_update_cmp.bin and b/bgfx/examples/runtime/shaders/spirv/fs_update_cmp.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_upsample.bin b/bgfx/examples/runtime/shaders/spirv/fs_upsample.bin index b0e6ffa5..544de329 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_upsample.bin and b/bgfx/examples/runtime/shaders/spirv/fs_upsample.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blit.bin b/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blit.bin index 32c9e1db..abf0acb3 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blit.bin and b/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blit.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blur.bin b/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blur.bin index b7bbe828..3adb93a3 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blur.bin and b/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blur.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_fb.bin b/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_fb.bin index 9666230b..0aab50d8 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_fb.bin and b/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_fb.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_vt_mip.bin b/bgfx/examples/runtime/shaders/spirv/fs_vt_mip.bin index 9f1bb943..ff7f5767 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_vt_mip.bin and b/bgfx/examples/runtime/shaders/spirv/fs_vt_mip.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_vt_unlit.bin b/bgfx/examples/runtime/shaders/spirv/fs_vt_unlit.bin index bfedf494..a5600f57 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_vt_unlit.bin and b/bgfx/examples/runtime/shaders/spirv/fs_vt_unlit.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_wf_mesh.bin b/bgfx/examples/runtime/shaders/spirv/fs_wf_mesh.bin index 6ac6f40c..9ed2a46d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_wf_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/fs_wf_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/fs_wf_wireframe.bin b/bgfx/examples/runtime/shaders/spirv/fs_wf_wireframe.bin index 3ac95e9b..bed55024 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/fs_wf_wireframe.bin and b/bgfx/examples/runtime/shaders/spirv/fs_wf_wireframe.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_albedo_output.bin b/bgfx/examples/runtime/shaders/spirv/vs_albedo_output.bin index 14c8e76d..f3bc019c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_albedo_output.bin and b/bgfx/examples/runtime/shaders/spirv/vs_albedo_output.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_assao.bin b/bgfx/examples/runtime/shaders/spirv/vs_assao.bin index 435bc278..81478f3f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_assao.bin and b/bgfx/examples/runtime/shaders/spirv/vs_assao.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_assao_gbuffer.bin b/bgfx/examples/runtime/shaders/spirv/vs_assao_gbuffer.bin index 3a5bae15..e83bce2f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_assao_gbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/vs_assao_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_bokeh_forward.bin b/bgfx/examples/runtime/shaders/spirv/vs_bokeh_forward.bin index 7863f8a9..5f84f69a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_bokeh_forward.bin and b/bgfx/examples/runtime/shaders/spirv/vs_bokeh_forward.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_bokeh_screenquad.bin b/bgfx/examples/runtime/shaders/spirv/vs_bokeh_screenquad.bin index 435bc278..81478f3f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_bokeh_screenquad.bin and b/bgfx/examples/runtime/shaders/spirv/vs_bokeh_screenquad.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_bump.bin b/bgfx/examples/runtime/shaders/spirv/vs_bump.bin index 5ddd164c..ac93ac9a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_bump.bin and b/bgfx/examples/runtime/shaders/spirv/vs_bump.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_bump_instanced.bin b/bgfx/examples/runtime/shaders/spirv/vs_bump_instanced.bin index 55cdbdfe..d1ce3c29 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_bump_instanced.bin and b/bgfx/examples/runtime/shaders/spirv/vs_bump_instanced.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_bunnylod.bin b/bgfx/examples/runtime/shaders/spirv/vs_bunnylod.bin index af67ce37..c621414a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_bunnylod.bin and b/bgfx/examples/runtime/shaders/spirv/vs_bunnylod.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_callback.bin b/bgfx/examples/runtime/shaders/spirv/vs_callback.bin index d66216ae..db64a29b 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_callback.bin and b/bgfx/examples/runtime/shaders/spirv/vs_callback.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_cubes.bin b/bgfx/examples/runtime/shaders/spirv/vs_cubes.bin index 867b9f21..859a9c4e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_cubes.bin and b/bgfx/examples/runtime/shaders/spirv/vs_cubes.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_deferred_combine.bin b/bgfx/examples/runtime/shaders/spirv/vs_deferred_combine.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_deferred_combine.bin and b/bgfx/examples/runtime/shaders/spirv/vs_deferred_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug.bin b/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug.bin and b/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug_line.bin b/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug_line.bin index 867b9f21..859a9c4e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug_line.bin and b/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug_line.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_deferred_geom.bin b/bgfx/examples/runtime/shaders/spirv/vs_deferred_geom.bin index 78386900..5279f11e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_deferred_geom.bin and b/bgfx/examples/runtime/shaders/spirv/vs_deferred_geom.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_deferred_light.bin b/bgfx/examples/runtime/shaders/spirv/vs_deferred_light.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_deferred_light.bin and b/bgfx/examples/runtime/shaders/spirv/vs_deferred_light.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_denoise_gbuffer.bin b/bgfx/examples/runtime/shaders/spirv/vs_denoise_gbuffer.bin index e7456b5a..b6920523 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_denoise_gbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/vs_denoise_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_denoise_screenquad.bin b/bgfx/examples/runtime/shaders/spirv/vs_denoise_screenquad.bin index 435bc278..81478f3f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_denoise_screenquad.bin and b/bgfx/examples/runtime/shaders/spirv/vs_denoise_screenquad.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_fsr_forward.bin b/bgfx/examples/runtime/shaders/spirv/vs_fsr_forward.bin index 4b7946f0..57ffe48b 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_fsr_forward.bin and b/bgfx/examples/runtime/shaders/spirv/vs_fsr_forward.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_fsr_screenquad.bin b/bgfx/examples/runtime/shaders/spirv/vs_fsr_screenquad.bin index 435bc278..81478f3f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_fsr_screenquad.bin and b/bgfx/examples/runtime/shaders/spirv/vs_fsr_screenquad.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_fullscreen.bin b/bgfx/examples/runtime/shaders/spirv/vs_fullscreen.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_fullscreen.bin and b/bgfx/examples/runtime/shaders/spirv/vs_fullscreen.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_gdr_instanced_indirect_rendering.bin b/bgfx/examples/runtime/shaders/spirv/vs_gdr_instanced_indirect_rendering.bin index fa2817e1..ab2a21d7 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_gdr_instanced_indirect_rendering.bin and b/bgfx/examples/runtime/shaders/spirv/vs_gdr_instanced_indirect_rendering.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_gdr_render_occlusion.bin b/bgfx/examples/runtime/shaders/spirv/vs_gdr_render_occlusion.bin index 17e5d5b3..a6814810 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_gdr_render_occlusion.bin and b/bgfx/examples/runtime/shaders/spirv/vs_gdr_render_occlusion.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_hdr_blur.bin b/bgfx/examples/runtime/shaders/spirv/vs_hdr_blur.bin index b99dc7cf..27163680 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_hdr_blur.bin and b/bgfx/examples/runtime/shaders/spirv/vs_hdr_blur.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_hdr_bright.bin b/bgfx/examples/runtime/shaders/spirv/vs_hdr_bright.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_hdr_bright.bin and b/bgfx/examples/runtime/shaders/spirv/vs_hdr_bright.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_hdr_lum.bin b/bgfx/examples/runtime/shaders/spirv/vs_hdr_lum.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_hdr_lum.bin and b/bgfx/examples/runtime/shaders/spirv/vs_hdr_lum.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_hdr_lumavg.bin b/bgfx/examples/runtime/shaders/spirv/vs_hdr_lumavg.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_hdr_lumavg.bin and b/bgfx/examples/runtime/shaders/spirv/vs_hdr_lumavg.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_hdr_mesh.bin b/bgfx/examples/runtime/shaders/spirv/vs_hdr_mesh.bin index 7bcf673b..346386e6 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_hdr_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/vs_hdr_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_hdr_skybox.bin b/bgfx/examples/runtime/shaders/spirv/vs_hdr_skybox.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_hdr_skybox.bin and b/bgfx/examples/runtime/shaders/spirv/vs_hdr_skybox.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_hdr_tonemap.bin b/bgfx/examples/runtime/shaders/spirv/vs_hdr_tonemap.bin index 2d893db1..2d9c0563 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_hdr_tonemap.bin and b/bgfx/examples/runtime/shaders/spirv/vs_hdr_tonemap.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_hextile.bin b/bgfx/examples/runtime/shaders/spirv/vs_hextile.bin index 4d092b12..7988bc12 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_hextile.bin and b/bgfx/examples/runtime/shaders/spirv/vs_hextile.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_ibl_mesh.bin b/bgfx/examples/runtime/shaders/spirv/vs_ibl_mesh.bin index bfb2aa6b..e9e2b56b 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_ibl_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/vs_ibl_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_ibl_skybox.bin b/bgfx/examples/runtime/shaders/spirv/vs_ibl_skybox.bin index 71c331d6..8a2c391c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_ibl_skybox.bin and b/bgfx/examples/runtime/shaders/spirv/vs_ibl_skybox.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_instancing.bin b/bgfx/examples/runtime/shaders/spirv/vs_instancing.bin index 7f77bebb..0d824a6e 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_instancing.bin and b/bgfx/examples/runtime/shaders/spirv/vs_instancing.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_mesh.bin b/bgfx/examples/runtime/shaders/spirv/vs_mesh.bin index 30c017be..ca1bb544 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/vs_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_oit.bin b/bgfx/examples/runtime/shaders/spirv/vs_oit.bin index acdd3884..78eef3e8 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_oit.bin and b/bgfx/examples/runtime/shaders/spirv/vs_oit.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_oit_blit.bin b/bgfx/examples/runtime/shaders/spirv/vs_oit_blit.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_oit_blit.bin and b/bgfx/examples/runtime/shaders/spirv/vs_oit_blit.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_particle.bin b/bgfx/examples/runtime/shaders/spirv/vs_particle.bin index 2094ece5..5ec58b1d 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_particle.bin and b/bgfx/examples/runtime/shaders/spirv/vs_particle.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_picking_shaded.bin b/bgfx/examples/runtime/shaders/spirv/vs_picking_shaded.bin index 9e01d140..46099782 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_picking_shaded.bin and b/bgfx/examples/runtime/shaders/spirv/vs_picking_shaded.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_pom.bin b/bgfx/examples/runtime/shaders/spirv/vs_pom.bin index b22897c2..3276f5fb 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_pom.bin and b/bgfx/examples/runtime/shaders/spirv/vs_pom.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_raymarching.bin b/bgfx/examples/runtime/shaders/spirv/vs_raymarching.bin index f8976720..71cb9e38 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_raymarching.bin and b/bgfx/examples/runtime/shaders/spirv/vs_raymarching.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_rsm_combine.bin b/bgfx/examples/runtime/shaders/spirv/vs_rsm_combine.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_rsm_combine.bin and b/bgfx/examples/runtime/shaders/spirv/vs_rsm_combine.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_rsm_gbuffer.bin b/bgfx/examples/runtime/shaders/spirv/vs_rsm_gbuffer.bin index bb6eb79e..0f5ae548 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_rsm_gbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/vs_rsm_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_rsm_lbuffer.bin b/bgfx/examples/runtime/shaders/spirv/vs_rsm_lbuffer.bin index 6350504f..8a74498f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_rsm_lbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/vs_rsm_lbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_rsm_shadow.bin b/bgfx/examples/runtime/shaders/spirv/vs_rsm_shadow.bin index 3dd392de..e0817971 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_rsm_shadow.bin and b/bgfx/examples/runtime/shaders/spirv/vs_rsm_shadow.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color.bin index 804eef5b..743ca647 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting.bin index b3a65ed0..114d60c2 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_csm.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_csm.bin index e91d86bf..b5a328bc 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_csm.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear.bin index 15e26f1f..58940b37 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_csm.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_csm.bin index 2ff7bab0..1fdcbfd6 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_csm.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_csm.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_omni.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_omni.bin index 80641ff2..cc773fb7 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_omni.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_omni.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_omni.bin index f4cdf6d8..70d3efa1 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_omni.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_omni.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_texture.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_texture.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_texture.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_depth.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_depth.bin index 804eef5b..743ca647 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_depth.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_depth.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_hblur.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_hblur.bin index a1ef46a0..e90fd779 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_hblur.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_hblur.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth.bin index e737c89c..5ef4506c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth_linear.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth_linear.bin index dc0be9da..0bfb3ba0 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth_linear.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth_linear.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture_lighting.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture_lighting.bin index 4c83efac..afc93dfd 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_unpackdepth.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_unpackdepth.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_unpackdepth.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_unpackdepth.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_vblur.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_vblur.bin index 3befeee4..831718d1 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_vblur.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_vblur.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_lighting.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_lighting.bin index e5da7554..8bce4b19 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_texture.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_texture.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_texture.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svback.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svback.bin index 61d88912..e2b75648 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svback.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svback.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svfront.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svfront.bin index 804eef5b..743ca647 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svfront.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svfront.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svside.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svside.bin index 38782c90..a496b504 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svside.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svside.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture_lighting.bin b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture_lighting.bin index 4c83efac..afc93dfd 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_sky.bin b/bgfx/examples/runtime/shaders/spirv/vs_sky.bin index ac7f7350..a4560c84 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_sky.bin and b/bgfx/examples/runtime/shaders/spirv/vs_sky.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_sky_landscape.bin b/bgfx/examples/runtime/shaders/spirv/vs_sky_landscape.bin index 9c453bd2..d74599f0 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_sky_landscape.bin and b/bgfx/examples/runtime/shaders/spirv/vs_sky_landscape.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_sms_mesh.bin b/bgfx/examples/runtime/shaders/spirv/vs_sms_mesh.bin index 82fefe7e..4a0c8ae0 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_sms_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/vs_sms_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow.bin b/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow.bin index 804eef5b..743ca647 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow.bin and b/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow_pd.bin b/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow_pd.bin index e737c89c..5ef4506c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow_pd.bin and b/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow_pd.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_sss_gbuffer.bin b/bgfx/examples/runtime/shaders/spirv/vs_sss_gbuffer.bin index 54bf6b4a..e8e38601 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_sss_gbuffer.bin and b/bgfx/examples/runtime/shaders/spirv/vs_sss_gbuffer.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_sss_screenquad.bin b/bgfx/examples/runtime/shaders/spirv/vs_sss_screenquad.bin index 435bc278..81478f3f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_sss_screenquad.bin and b/bgfx/examples/runtime/shaders/spirv/vs_sss_screenquad.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_stencil_color.bin b/bgfx/examples/runtime/shaders/spirv/vs_stencil_color.bin index 804eef5b..743ca647 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_stencil_color.bin and b/bgfx/examples/runtime/shaders/spirv/vs_stencil_color.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_lighting.bin b/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_lighting.bin index 3d53a4e9..ac8a2656 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_texture.bin b/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_texture.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_texture.bin and b/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture.bin b/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture.bin index 66e24d49..2b627b32 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture.bin and b/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture_lighting.bin b/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture_lighting.bin index 4c83efac..afc93dfd 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture_lighting.bin and b/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture_lighting.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_terrain.bin b/bgfx/examples/runtime/shaders/spirv/vs_terrain.bin index 2748e574..21c5590f 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_terrain.bin and b/bgfx/examples/runtime/shaders/spirv/vs_terrain.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_terrain_height_texture.bin b/bgfx/examples/runtime/shaders/spirv/vs_terrain_height_texture.bin index 240883a1..2300b98b 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_terrain_height_texture.bin and b/bgfx/examples/runtime/shaders/spirv/vs_terrain_height_texture.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_terrain_render.bin b/bgfx/examples/runtime/shaders/spirv/vs_terrain_render.bin index 31991d54..a0a27dd6 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_terrain_render.bin and b/bgfx/examples/runtime/shaders/spirv/vs_terrain_render.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_tree.bin b/bgfx/examples/runtime/shaders/spirv/vs_tree.bin index 65d983a1..c9b4d5df 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_tree.bin and b/bgfx/examples/runtime/shaders/spirv/vs_tree.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_update.bin b/bgfx/examples/runtime/shaders/spirv/vs_update.bin index 17fbd59a..a19640d2 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_update.bin and b/bgfx/examples/runtime/shaders/spirv/vs_update.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_vectordisplay_fb.bin b/bgfx/examples/runtime/shaders/spirv/vs_vectordisplay_fb.bin index f8976720..71cb9e38 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_vectordisplay_fb.bin and b/bgfx/examples/runtime/shaders/spirv/vs_vectordisplay_fb.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_vt_generic.bin b/bgfx/examples/runtime/shaders/spirv/vs_vt_generic.bin index 28cafdcd..48a5709a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_vt_generic.bin and b/bgfx/examples/runtime/shaders/spirv/vs_vt_generic.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_wf_mesh.bin b/bgfx/examples/runtime/shaders/spirv/vs_wf_mesh.bin index 7e2b2a9e..1505638c 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_wf_mesh.bin and b/bgfx/examples/runtime/shaders/spirv/vs_wf_mesh.bin differ diff --git a/bgfx/examples/runtime/shaders/spirv/vs_wf_wireframe.bin b/bgfx/examples/runtime/shaders/spirv/vs_wf_wireframe.bin index 20f73ad3..c72cc93a 100644 Binary files a/bgfx/examples/runtime/shaders/spirv/vs_wf_wireframe.bin and b/bgfx/examples/runtime/shaders/spirv/vs_wf_wireframe.bin differ diff --git a/bgfx/examples/runtime/text/sherlock_holmes_a_scandal_in_bohemia_arthur_conan_doyle.txt b/bgfx/examples/runtime/text/sherlock_holmes_a_scandal_in_bohemia_arthur_conan_doyle.txt index 523a31cf..115c5b21 100644 --- a/bgfx/examples/runtime/text/sherlock_holmes_a_scandal_in_bohemia_arthur_conan_doyle.txt +++ b/bgfx/examples/runtime/text/sherlock_holmes_a_scandal_in_bohemia_arthur_conan_doyle.txt @@ -1,4 +1,4 @@ -Stripped down from project Gutenberg's +Stripped down from project Gutenberg's "The Adventures of Sherlock Holmes", by Arthur Conan Doyle This eBook is for the use of anyone anywhere at no cost and with @@ -1133,4 +1133,4 @@ of Bohemia, and how the best plans of Mr. Sherlock Holmes were beaten by a woman's wit. He used to make merry over the cleverness of women, but I have not heard him do it of late. And when he speaks of Irene Adler, or when he refers to her -photograph, it is always under the honourable title of the woman. \ No newline at end of file +photograph, it is always under the honourable title of the woman. diff --git a/bgfx/examples/runtime/textures/aerial_rocks_04_diff_2k.ktx b/bgfx/examples/runtime/textures/aerial_rocks_04_diff_2k.ktx index 9d2a7dbf..cb9eba87 100644 Binary files a/bgfx/examples/runtime/textures/aerial_rocks_04_diff_2k.ktx and b/bgfx/examples/runtime/textures/aerial_rocks_04_diff_2k.ktx differ diff --git a/bgfx/examples/runtime/textures/lightmap.ktx b/bgfx/examples/runtime/textures/lightmap.ktx index 93daf24a..a1ff31dc 100644 Binary files a/bgfx/examples/runtime/textures/lightmap.ktx and b/bgfx/examples/runtime/textures/lightmap.ktx differ diff --git a/bgfx/examples/runtime/textures/parallax-d.ktx b/bgfx/examples/runtime/textures/parallax-d.ktx index 54c74a06..11cc3286 100644 Binary files a/bgfx/examples/runtime/textures/parallax-d.ktx and b/bgfx/examples/runtime/textures/parallax-d.ktx differ diff --git a/bgfx/examples/runtime/textures/parallax-h.ktx b/bgfx/examples/runtime/textures/parallax-h.ktx index 01c3a125..abe87f20 100644 Binary files a/bgfx/examples/runtime/textures/parallax-h.ktx and b/bgfx/examples/runtime/textures/parallax-h.ktx differ diff --git a/bgfx/examples/runtime/textures/parallax-n.ktx b/bgfx/examples/runtime/textures/parallax-n.ktx index 1280e92c..2ff05d39 100644 Binary files a/bgfx/examples/runtime/textures/parallax-n.ktx and b/bgfx/examples/runtime/textures/parallax-n.ktx differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_10x10.dds b/bgfx/examples/runtime/textures/texture_compression_astc_10x10.dds index 8ac934e5..b4eba4ce 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_10x10.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_10x10.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_10x5.dds b/bgfx/examples/runtime/textures/texture_compression_astc_10x5.dds index b392a0b3..54bbff5c 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_10x5.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_10x5.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_10x6.dds b/bgfx/examples/runtime/textures/texture_compression_astc_10x6.dds index 92edd56d..47e39db3 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_10x6.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_10x6.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_10x8.dds b/bgfx/examples/runtime/textures/texture_compression_astc_10x8.dds index 9eb093ae..1c804267 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_10x8.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_10x8.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_12x10.dds b/bgfx/examples/runtime/textures/texture_compression_astc_12x10.dds index 23a64708..0ac98982 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_12x10.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_12x10.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_12x12.dds b/bgfx/examples/runtime/textures/texture_compression_astc_12x12.dds index 9c75905e..10b9539e 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_12x12.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_12x12.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_4x4.dds b/bgfx/examples/runtime/textures/texture_compression_astc_4x4.dds index 60d17bde..5504b264 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_4x4.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_4x4.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_5x4.dds b/bgfx/examples/runtime/textures/texture_compression_astc_5x4.dds index e47f966c..0f2ea64a 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_5x4.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_5x4.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_5x5.dds b/bgfx/examples/runtime/textures/texture_compression_astc_5x5.dds index 1a761903..63885994 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_5x5.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_5x5.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_6x5.dds b/bgfx/examples/runtime/textures/texture_compression_astc_6x5.dds index 0b716ab8..348c4b71 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_6x5.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_6x5.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_6x6.dds b/bgfx/examples/runtime/textures/texture_compression_astc_6x6.dds index d4d829e4..9d86775f 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_6x6.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_6x6.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_8x5.dds b/bgfx/examples/runtime/textures/texture_compression_astc_8x5.dds index e1a0dc6f..9205e305 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_8x5.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_8x5.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_8x6.dds b/bgfx/examples/runtime/textures/texture_compression_astc_8x6.dds index 24a66a6f..7e3a363e 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_8x6.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_8x6.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_astc_8x8.dds b/bgfx/examples/runtime/textures/texture_compression_astc_8x8.dds index d5bad8c4..617c6ac2 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_astc_8x8.dds and b/bgfx/examples/runtime/textures/texture_compression_astc_8x8.dds differ diff --git a/bgfx/examples/runtime/textures/texture_compression_bc1.ktx b/bgfx/examples/runtime/textures/texture_compression_bc1.ktx index 0be5ced9..2aa5377f 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_bc1.ktx and b/bgfx/examples/runtime/textures/texture_compression_bc1.ktx differ diff --git a/bgfx/examples/runtime/textures/texture_compression_bc2.ktx b/bgfx/examples/runtime/textures/texture_compression_bc2.ktx index 473406fa..6c02ecd5 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_bc2.ktx and b/bgfx/examples/runtime/textures/texture_compression_bc2.ktx differ diff --git a/bgfx/examples/runtime/textures/texture_compression_bc3.ktx b/bgfx/examples/runtime/textures/texture_compression_bc3.ktx index 8d3d8556..1b43033a 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_bc3.ktx and b/bgfx/examples/runtime/textures/texture_compression_bc3.ktx differ diff --git a/bgfx/examples/runtime/textures/texture_compression_bc7.ktx b/bgfx/examples/runtime/textures/texture_compression_bc7.ktx index 265dde5b..76a960fa 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_bc7.ktx and b/bgfx/examples/runtime/textures/texture_compression_bc7.ktx differ diff --git a/bgfx/examples/runtime/textures/texture_compression_etc1.ktx b/bgfx/examples/runtime/textures/texture_compression_etc1.ktx index 0206dead..810c5833 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_etc1.ktx and b/bgfx/examples/runtime/textures/texture_compression_etc1.ktx differ diff --git a/bgfx/examples/runtime/textures/texture_compression_etc2.ktx b/bgfx/examples/runtime/textures/texture_compression_etc2.ktx index f6dd5b45..22d1171f 100644 Binary files a/bgfx/examples/runtime/textures/texture_compression_etc2.ktx and b/bgfx/examples/runtime/textures/texture_compression_etc2.ktx differ diff --git a/bgfx/examples/runtime/textures/uffizi.ktx b/bgfx/examples/runtime/textures/uffizi.ktx index c078be17..cd3c2dbb 100644 Binary files a/bgfx/examples/runtime/textures/uffizi.ktx and b/bgfx/examples/runtime/textures/uffizi.ktx differ diff --git a/bgfx/include/bgfx/bgfx.h b/bgfx/include/bgfx/bgfx.h index 46347c38..06af00c5 100644 --- a/bgfx/include/bgfx/bgfx.h +++ b/bgfx/include/bgfx/bgfx.h @@ -1,11 +1,13 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #ifndef BGFX_H_HEADER_GUARD #define BGFX_H_HEADER_GUARD +#define BGFX_IDL_CPP 0 + #include // va_list #include // uint32_t #include // NULL @@ -53,7 +55,6 @@ namespace bgfx { Noop, //!< No rendering. Agc, //!< AGC - Direct3D9, //!< Direct3D 9.0 Direct3D11, //!< Direct3D 11.0 Direct3D12, //!< Direct3D 12.0 Gnm, //!< GNM @@ -62,7 +63,6 @@ namespace bgfx OpenGLES, //!< OpenGL ES 2.0+ OpenGL, //!< OpenGL 2.1+ Vulkan, //!< Vulkan - WebGPU, //!< WebGPU Count }; @@ -350,7 +350,7 @@ namespace bgfx enum Enum { TriListFlipWinding, //!< Flip winding order of triangle list. - TriStripFlipWinding, //!< Flip winding order of trinagle strip. + TriStripFlipWinding, //!< Flip winding order of triangle strip. TriListToLineList, //!< Convert triangle list to line list. TriStripToTriList, //!< Convert triangle strip to triangle list. LineStripToLineList, //!< Convert line strip to line list. @@ -1012,7 +1012,7 @@ namespace bgfx uint32_t numCompute; //!< Number of compute calls submitted. uint32_t numBlit; //!< Number of blit calls submitted. uint32_t maxGpuLatency; //!< GPU driver latency. - uint32_t gpuFrameNum; // #include "bgfx.h" +#include #define BGFX_EMBEDDED_SHADER_DXBC(...) -#define BGFX_EMBEDDED_SHADER_DX9BC(...) #define BGFX_EMBEDDED_SHADER_PSSL(...) #define BGFX_EMBEDDED_SHADER_ESSL(...) #define BGFX_EMBEDDED_SHADER_GLSL(...) @@ -18,10 +17,6 @@ #define BGFX_EMBEDDED_SHADER_NVN(...) #define BGFX_EMBEDDED_SHADER_SPIRV(...) -#define BGFX_PLATFORM_SUPPORTS_DX9BC (0 \ - || BX_PLATFORM_LINUX \ - || BX_PLATFORM_WINDOWS \ - ) #define BGFX_PLATFORM_SUPPORTS_DXBC (0 \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ @@ -39,10 +34,10 @@ || BX_PLATFORM_LINUX \ || BX_PLATFORM_OSX \ || BX_PLATFORM_RPI \ + || BX_PLATFORM_VISIONOS \ || BX_PLATFORM_WINDOWS \ ) #define BGFX_PLATFORM_SUPPORTS_GLSL (0 \ - || BX_PLATFORM_BSD \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_OSX \ || BX_PLATFORM_WINDOWS \ @@ -50,6 +45,7 @@ #define BGFX_PLATFORM_SUPPORTS_METAL (0 \ || BX_PLATFORM_IOS \ || BX_PLATFORM_OSX \ + || BX_PLATFORM_VISIONOS \ ) #define BGFX_PLATFORM_SUPPORTS_NVN (0 \ || BX_PLATFORM_NX \ @@ -60,48 +56,50 @@ || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ || BX_PLATFORM_OSX \ + || BX_PLATFORM_NX \ ) -#if BGFX_PLATFORM_SUPPORTS_DX9BC -# undef BGFX_EMBEDDED_SHADER_DX9BC -# define BGFX_EMBEDDED_SHADER_DX9BC(_renderer, _name) \ - { _renderer, BX_CONCATENATE(_name, _dx9 ), BX_COUNTOF(BX_CONCATENATE(_name, _dx9 ) ) }, -#endif // BGFX_PLATFORM_SUPPORTS_DX9BC +/// +#define BGFX_EMBEDDED_SHADER_CONCATENATE(_x, _y) BGFX_EMBEDDED_SHADER_CONCATENATE_(_x, _y) +#define BGFX_EMBEDDED_SHADER_CONCATENATE_(_x, _y) _x ## _y + +/// +#define BGFX_EMBEDDED_SHADER_COUNTOF(_x) (sizeof(_x)/sizeof(_x[0]) ) #if BGFX_PLATFORM_SUPPORTS_DXBC # undef BGFX_EMBEDDED_SHADER_DXBC # define BGFX_EMBEDDED_SHADER_DXBC(_renderer, _name) \ - { _renderer, BX_CONCATENATE(_name, _dx11), BX_COUNTOF(BX_CONCATENATE(_name, _dx11) ) }, + { _renderer, BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _dx11), BGFX_EMBEDDED_SHADER_COUNTOF(BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _dx11) ) }, #endif // BGFX_PLATFORM_SUPPORTS_DXBC #if BGFX_PLATFORM_SUPPORTS_PSSL # undef BGFX_EMBEDDED_SHADER_PSSL # define BGFX_EMBEDDED_SHADER_PSSL(_renderer, _name) \ - { _renderer, BX_CONCATENATE(_name, _pssl), BX_CONCATENATE(_name, _pssl_size) }, + { _renderer, BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _pssl), BGFX_EMBEDDED_SHADER_COUNTOF(BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _pssl_size) ) }, #endif // BGFX_PLATFORM_SUPPORTS_PSSL #if BGFX_PLATFORM_SUPPORTS_ESSL # undef BGFX_EMBEDDED_SHADER_ESSL # define BGFX_EMBEDDED_SHADER_ESSL(_renderer, _name) \ - { _renderer, BX_CONCATENATE(_name, _essl), BX_COUNTOF(BX_CONCATENATE(_name, _essl) ) }, + { _renderer, BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _essl), BGFX_EMBEDDED_SHADER_COUNTOF(BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _essl) ) }, #endif // BGFX_PLATFORM_SUPPORTS_ESSL #if BGFX_PLATFORM_SUPPORTS_GLSL # undef BGFX_EMBEDDED_SHADER_GLSL # define BGFX_EMBEDDED_SHADER_GLSL(_renderer, _name) \ - { _renderer, BX_CONCATENATE(_name, _glsl), BX_COUNTOF(BX_CONCATENATE(_name, _glsl) ) }, + { _renderer, BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _glsl), BGFX_EMBEDDED_SHADER_COUNTOF(BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _glsl) ) }, #endif // BGFX_PLATFORM_SUPPORTS_GLSL #if BGFX_PLATFORM_SUPPORTS_SPIRV # undef BGFX_EMBEDDED_SHADER_SPIRV # define BGFX_EMBEDDED_SHADER_SPIRV(_renderer, _name) \ - { _renderer, BX_CONCATENATE(_name, _spv), BX_COUNTOF(BX_CONCATENATE(_name, _spv) ) }, + { _renderer, BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _spv), BGFX_EMBEDDED_SHADER_COUNTOF(BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _spv) ) }, #endif // BGFX_PLATFORM_SUPPORTS_SPIRV #if BGFX_PLATFORM_SUPPORTS_METAL # undef BGFX_EMBEDDED_SHADER_METAL # define BGFX_EMBEDDED_SHADER_METAL(_renderer, _name) \ - { _renderer, BX_CONCATENATE(_name, _mtl), BX_COUNTOF(BX_CONCATENATE(_name, _mtl) ) }, + { _renderer, BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _mtl), BGFX_EMBEDDED_SHADER_COUNTOF(BGFX_EMBEDDED_SHADER_CONCATENATE(_name, _mtl) ) }, #endif // BGFX_PLATFORM_SUPPORTS_METAL #define BGFX_EMBEDDED_SHADER(_name) \ @@ -109,7 +107,6 @@ #_name, \ { \ BGFX_EMBEDDED_SHADER_PSSL (bgfx::RendererType::Agc, _name) \ - BGFX_EMBEDDED_SHADER_DX9BC(bgfx::RendererType::Direct3D9, _name) \ BGFX_EMBEDDED_SHADER_DXBC (bgfx::RendererType::Direct3D11, _name) \ BGFX_EMBEDDED_SHADER_DXBC (bgfx::RendererType::Direct3D12, _name) \ BGFX_EMBEDDED_SHADER_PSSL (bgfx::RendererType::Gnm, _name) \ @@ -118,7 +115,6 @@ BGFX_EMBEDDED_SHADER_ESSL (bgfx::RendererType::OpenGLES, _name) \ BGFX_EMBEDDED_SHADER_GLSL (bgfx::RendererType::OpenGL, _name) \ BGFX_EMBEDDED_SHADER_SPIRV(bgfx::RendererType::Vulkan, _name) \ - BGFX_EMBEDDED_SHADER_SPIRV(bgfx::RendererType::WebGPU, _name) \ { bgfx::RendererType::Noop, (const uint8_t*)"VSH\x5\x0\x0\x0\x0\x0\x0", 10 }, \ { bgfx::RendererType::Count, NULL, 0 } \ } \ diff --git a/bgfx/include/bgfx/platform.h b/bgfx/include/bgfx/platform.h index f7843b06..c352cce0 100644 --- a/bgfx/include/bgfx/platform.h +++ b/bgfx/include/bgfx/platform.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -12,6 +12,8 @@ #include "bgfx.h" +#if !BGFX_IDL_CPP + namespace bgfx { /// Render frame enum. @@ -133,4 +135,6 @@ namespace bgfx } // namespace bgfx +#endif // BGFX_IDL_CPP + #endif // BGFX_PLATFORM_H_HEADER_GUARD diff --git a/bgfx/makefile b/bgfx/makefile index 06e6573e..773c1107 100644 --- a/bgfx/makefile +++ b/bgfx/makefile @@ -1,19 +1,15 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # UNAME := $(shell uname) -ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin FreeBSD GNU/kFreeBSD)) +ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin)) ifeq ($(UNAME),$(filter $(UNAME),Darwin)) OS=darwin else -ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD)) -OS=bsd -else OS=linux endif -endif help: @echo Available targets: @@ -40,38 +36,22 @@ clean: ## Clean all intermediate files. @mkdir .build projgen: ## Generate project files for all configurations. - $(GENIE) --with-tools --with-combined-examples --with-shared-lib vs2019 - $(GENIE) --with-tools --with-combined-examples --vs=winstore100 vs2019 + $(GENIE) --with-tools --with-combined-examples --with-shared-lib vs2022 $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=mingw-gcc gmake + $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=mingw-clang gmake $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=linux-gcc gmake - $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=osx-x64 gmake + $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=linux-clang gmake $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=osx-arm64 gmake $(GENIE) --with-tools --with-combined-examples --with-shared-lib --xcode=osx xcode9 $(GENIE) --with-tools --with-combined-examples --with-shared-lib --xcode=ios xcode9 - $(GENIE) --with-combined-examples --with-shared-lib --gcc=freebsd gmake - $(GENIE) --with-combined-examples --with-shared-lib --gcc=android-arm gmake $(GENIE) --with-combined-examples --with-shared-lib --gcc=android-arm64 gmake - $(GENIE) --with-combined-examples --with-shared-lib --gcc=android-x86 gmake - $(GENIE) --with-combined-examples --with-shared-lib --gcc=android-x86_64 gmake - $(GENIE) --with-examples --gcc=wasm2js gmake - $(GENIE) --with-combined-examples --gcc=ios-arm gmake $(GENIE) --with-combined-examples --gcc=ios-arm64 gmake - $(GENIE) --with-combined-examples --gcc=ios-simulator gmake - $(GENIE) --with-combined-examples --gcc=ios-simulator64 gmake $(GENIE) --with-combined-examples --gcc=rpi gmake idl: ## Generate code from IDL. @echo Generating code from IDL. cd scripts && ../$(GENIE) idl -.build/projects/gmake-android-arm: - $(GENIE) --gcc=android-arm --with-combined-examples --with-shared-lib gmake -android-arm-debug: .build/projects/gmake-android-arm ## Build - Android ARM Debug - $(MAKE) -R -C .build/projects/gmake-android-arm config=debug -android-arm-release: .build/projects/gmake-android-arm ## Build - Android ARM Release - $(MAKE) -R -C .build/projects/gmake-android-arm config=release -android-arm: android-arm-debug android-arm-release ## Build - Android ARM Debug and Release - .build/projects/gmake-android-arm64: $(GENIE) --gcc=android-arm64 --with-combined-examples --with-shared-lib gmake android-arm64-debug: .build/projects/gmake-android-arm64 ## Build - Android ARM64 Debug @@ -80,30 +60,6 @@ android-arm64-release: .build/projects/gmake-android-arm64 ## Build - Android AR $(MAKE) -R -C .build/projects/gmake-android-arm64 config=release android-arm64: android-arm64-debug android-arm64-release ## Build - Android ARM64 Debug and Release -.build/projects/gmake-android-x86: - $(GENIE) --gcc=android-x86 --with-combined-examples --with-shared-lib gmake -android-x86-debug: .build/projects/gmake-android-x86 ## Build - Android x86 Debug and Release - $(MAKE) -R -C .build/projects/gmake-android-x86 config=debug -android-x86-release: .build/projects/gmake-android-x86 ## Build - Android x86 Debug and Release - $(MAKE) -R -C .build/projects/gmake-android-x86 config=release -android-x86: android-x86-debug android-x86-release ## Build - Android x86 Debug and Release - -.build/projects/gmake-android-x86_64: - $(GENIE) --gcc=android-x86_64 --with-combined-examples --with-shared-lib gmake -android-x86_64-debug: .build/projects/gmake-android-x86_64 ## Build - Android x86_64 Debug and Release - $(MAKE) -R -C .build/projects/gmake-android-x86_64 config=debug -android-x86_64-release: .build/projects/gmake-android-x86_64 ## Build - Android x86_64 Debug and Release - $(MAKE) -R -C .build/projects/gmake-android-x86_64 config=release -android-x86_64: android-x86_64-debug android-x86_64-release ## Build - Android x86_64 Debug and Release - -.build/projects/gmake-wasm2js: # Wasm2JS: The JavaScript fallback for web builds when Wasm is not supported by browser - $(GENIE) --gcc=wasm2js --with-combined-examples gmake -wasm2js-debug: .build/projects/gmake-wasm2js ## Build - Emscripten Debug - $(MAKE) -R -C .build/projects/gmake-wasm2js config=debug -wasm2js-release: .build/projects/gmake-wasm2js ## Build - Emscripten Release - $(MAKE) -R -C .build/projects/gmake-wasm2js config=release -wasm2js: wasm2js-debug wasm2js-release ## Build - Emscripten Debug and Release - .build/projects/gmake-wasm: $(GENIE) --gcc=wasm --with-combined-examples gmake wasm-debug: .build/projects/gmake-wasm ## Build - Emscripten Debug @@ -112,28 +68,24 @@ wasm-release: .build/projects/gmake-wasm ## Build - Emscripten Release $(MAKE) -R -C .build/projects/gmake-wasm config=release wasm: wasm-debug wasm-release ## Build - Emscripten Debug and Release -.build/projects/gmake-linux: +.build/projects/gmake-linux-gcc: $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=linux-gcc gmake -linux-debug64: .build/projects/gmake-linux ## Build - Linux x64 Debug - $(MAKE) -R -C .build/projects/gmake-linux config=debug64 -linux-release64: .build/projects/gmake-linux ## Build - Linux x64 Release - $(MAKE) -R -C .build/projects/gmake-linux config=release64 -linux: linux-debug64 linux-release64 ## Build - Linux x86/x64 Debug and Release - -.build/projects/gmake-freebsd: - $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=freebsd gmake -freebsd-debug32: .build/projects/gmake-freebsd ## Build - FreeBSD x86 Debug - $(MAKE) -R -C .build/projects/gmake-freebsd config=debug32 -freebsd-release32: .build/projects/gmake-freebsd ## Build - FreeBSD x86 Release - $(MAKE) -R -C .build/projects/gmake-freebsd config=release32 -freebsd-debug64: .build/projects/gmake-freebsd ## Build - FreeBSD x86 Debug - $(MAKE) -R -C .build/projects/gmake-freebsd config=debug64 -freebsd-release64: .build/projects/gmake-freebsd ## Build - FreeBSD x86 Release - $(MAKE) -R -C .build/projects/gmake-freebsd config=release64 -freebsd: freebsd-debug32 freebsd-release32 freebsd-debug64 freebsd-release64 ## Build - FreeBSD x86/x64 Debug and Release +linux-gcc-debug64: .build/projects/gmake-linux-gcc ## Build - Linux GCC x64 Debug + $(MAKE) -R -C .build/projects/gmake-linux-gcc config=debug64 +linux-gcc-release64: .build/projects/gmake-linux-gcc ## Build - Linux GCC x64 Release + $(MAKE) -R -C .build/projects/gmake-linux-gcc config=release64 +linux-gcc: linux-gcc-debug64 linux-gcc-release64 ## Build - Linux GCC x86/x64 Debug and Release + +.build/projects/gmake-linux-clang: + $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=linux-clang gmake +linux-clang-debug64: .build/projects/gmake-linux-clang ## Build - Linux Clang x64 Debug + $(MAKE) -R -C .build/projects/gmake-linux-clang config=debug64 +linux-clang-release64: .build/projects/gmake-linux-clang ## Build - Linux Clang x64 Release + $(MAKE) -R -C .build/projects/gmake-linux-clang config=release64 +linux-clang: linux-clang-debug64 linux-clang-release64 ## Build - Linux Clang x86/x64 Debug and Release .build/projects/gmake-mingw-gcc: - $(GENIE) --with-tools --with-combined-examples --with-shared-lib --os=windows --gcc=mingw-gcc gmake + $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=mingw-gcc gmake mingw-gcc-debug32: .build/projects/gmake-mingw-gcc ## Build - MinGW GCC x86 Debug $(MAKE) -R -C .build/projects/gmake-mingw-gcc config=debug32 mingw-gcc-release32: .build/projects/gmake-mingw-gcc ## Build - MinGW GCC x86 Release @@ -145,7 +97,7 @@ mingw-gcc-release64: .build/projects/gmake-mingw-gcc ## Build - MinGW GCC x64 Re mingw-gcc: mingw-gcc-debug32 mingw-gcc-release32 mingw-gcc-debug64 mingw-gcc-release64 ## Build - MinGW GCC x86/x64 Debug and Release .build/projects/gmake-mingw-clang: - $(GENIE) --with-tools --with-combined-examples --with-shared-lib --os=windows --gcc=mingw-clang gmake + $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=mingw-clang gmake mingw-clang-debug32: .build/projects/gmake-mingw-clang ## Build - MinGW Clang x86 Debug $(MAKE) -R -C .build/projects/gmake-mingw-clang config=debug32 mingw-clang-release32: .build/projects/gmake-mingw-clang ## Build - MinGW Clang x86 Release @@ -156,59 +108,26 @@ mingw-clang-release64: .build/projects/gmake-mingw-clang ## Build - MinGW Clang $(MAKE) -R -C .build/projects/gmake-mingw-clang config=release64 mingw-clang: mingw-clang-debug32 mingw-clang-release32 mingw-clang-debug64 mingw-clang-release64 ## Build - MinGW Clang x86/x64 Debug and Release -.build/projects/vs2019: - $(GENIE) --with-tools --with-combined-examples --with-shared-lib vs2019 -vs2019-debug32: .build/projects/vs2019 ## Build - vs2019 x86 Debug - devenv .build/projects/vs2019/bgfx.sln /Build "Debug|Win32" -vs2019-release32: .build/projects/vs2019 ## Build - vs2019 x86 Release - devenv .build/projects/vs2019/bgfx.sln /Build "Release|Win32" -vs2019-debug64: .build/projects/vs2019 ## Build - vs2019 x64 Debug - devenv .build/projects/vs2019/bgfx.sln /Build "Debug|x64" -vs2019-release64: .build/projects/vs2019 ## Build - vs2019 x64 Release - devenv .build/projects/vs2019/bgfx.sln /Build "Release|x64" -vs2019: vs2019-debug32 vs2019-release32 vs2019-debug64 vs2019-release64 ## Build - vs2019 x86/x64 Debug and Release - -.build/projects/vs2019-winstore100: - $(GENIE) --with-combined-examples --vs=winstore100 vs2019 -vs2019-winstore100-debug32: .build/projects/vs2019-winstore100 ## Build - vs2019-winstore100 x86 Debug - devenv .build/projects/vs2019-winstore100/bgfx.sln /Build "Debug|Win32" -vs2019-winstore100-release32: .build/projects/vs2019-winstore100 ## Build - vs2019-winstore100 x86 Release - devenv .build/projects/vs2019-winstore100/bgfx.sln /Build "Release|Win32" -vs2019-winstore100-debug64: .build/projects/vs2019-winstore100 ## Build - vs2019-winstore100 x64 Debug - devenv .build/projects/vs2019-winstore100/bgfx.sln /Build "Debug|x64" -vs2019-winstore100-release64: .build/projects/vs2019-winstore100 ## Build - vs2019-winstore100 x64 Release - devenv .build/projects/vs2019-winstore100/bgfx.sln /Build "Release|x64" -vs2019-winstore100: vs2019-winstore100-debug32 vs2019-winstore100-release32 vs2019-winstore100-debug64 vs2019-winstore100-release64 ## Build - vs2019-winstore100 x86/x64 Debug and Release +.build/projects/vs2022: + $(GENIE) --with-tools --with-combined-examples --with-shared-lib vs2022 +vs2022-debug32: .build/projects/vs2022 ## Build - vs2022 x86 Debug + devenv .build/projects/vs2022/bgfx.sln /Build "Debug|Win32" +vs2022-release32: .build/projects/vs2022 ## Build - vs2022 x86 Release + devenv .build/projects/vs2022/bgfx.sln /Build "Release|Win32" +vs2022-debug64: .build/projects/vs2022 ## Build - vs2022 x64 Debug + devenv .build/projects/vs2022/bgfx.sln /Build "Debug|x64" +vs2022-release64: .build/projects/vs2022 ## Build - vs2022 x64 Release + devenv .build/projects/vs2022/bgfx.sln /Build "Release|x64" +vs2022: vs2022-debug32 vs2022-release32 vs2022-debug64 vs2022-release64 ## Build - vs2022 x86/x64 Debug and Release -.build/projects/gmake-osx-x64: - $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=osx-x64 gmake .build/projects/gmake-osx-arm64: $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=osx-arm64 gmake - -osx-debug: osx-x64-debug osx-arm64-debug ## Build - macOS Universal Debug -osx-release: osx-x64-release osx-arm64-release ## Build - macOS Universal Release -osx: osx-debug osx-release ## Build - macOS Universal Debug and Release - -osx-x64-debug: .build/projects/gmake-osx-x64 ## Build - macOS x64 Debug - $(MAKE) -C .build/projects/gmake-osx-x64 config=debug -osx-x64-release: .build/projects/gmake-osx-x64 ## Build - macOS x64 Release - $(MAKE) -C .build/projects/gmake-osx-x64 config=release -osx-x64: osx-x64-debug osx-x64-release ## Build - macOS x64 Debug and Release - osx-arm64-debug: .build/projects/gmake-osx-arm64 ## Build - macOS ARM Debug $(MAKE) -C .build/projects/gmake-osx-arm64 config=debug osx-arm64-release: .build/projects/gmake-osx-arm64 ## Build - macOS ARM Release $(MAKE) -C .build/projects/gmake-osx-arm64 config=release osx-arm64: osx-arm64-debug osx-arm64-release ## Build - macOS ARM Debug and Release -.build/projects/gmake-ios-arm: - $(GENIE) --gcc=ios-arm gmake -ios-arm-debug: .build/projects/gmake-ios-arm ## Build - iOS ARM Debug - $(MAKE) -R -C .build/projects/gmake-ios-arm config=debug -ios-arm-release: .build/projects/gmake-ios-arm ## Build - iOS ARM Release - $(MAKE) -R -C .build/projects/gmake-ios-arm config=release -ios-arm: ios-arm-debug ios-arm-release ## Build - iOS ARM Debug and Release - .build/projects/gmake-ios-arm64: $(GENIE) --gcc=ios-arm64 gmake ios-arm64-debug: .build/projects/gmake-ios-arm64 ## Build - iOS ARM64 Debug @@ -217,22 +136,6 @@ ios-arm64-release: .build/projects/gmake-ios-arm64 ## Build - iOS ARM64 Release $(MAKE) -R -C .build/projects/gmake-ios-arm64 config=release ios-arm64: ios-arm64-debug ios-arm64-release ## Build - iOS ARM64 Debug and Release -.build/projects/gmake-ios-simulator: - $(GENIE) --gcc=ios-simulator gmake -ios-simulator-debug: .build/projects/gmake-ios-simulator ## Build - iOS Simulator Debug - $(MAKE) -R -C .build/projects/gmake-ios-simulator config=debug -ios-simulator-release: .build/projects/gmake-ios-simulator ## Build - iOS Simulator Release - $(MAKE) -R -C .build/projects/gmake-ios-simulator config=release -ios-simulator: ios-simulator-debug ios-simulator-release ## Build - iOS Simulator Debug and Release - -.build/projects/gmake-ios-simulator64: - $(GENIE) --gcc=ios-simulator64 gmake -ios-simulator64-debug: .build/projects/gmake-ios-simulator64 ## Build - iOS Simulator Debug - $(MAKE) -R -C .build/projects/gmake-ios-simulator64 config=debug -ios-simulator64-release: .build/projects/gmake-ios-simulator64 ## Build - iOS Simulator Release - $(MAKE) -R -C .build/projects/gmake-ios-simulator64 config=release -ios-simulator64: ios-simulator64-debug ios-simulator64-release ## Build - iOS Simulator Debug and Release - .build/projects/gmake-rpi: $(GENIE) --gcc=rpi gmake rpi-debug: .build/projects/gmake-rpi ## Build - RasberryPi Debug @@ -241,58 +144,27 @@ rpi-release: .build/projects/gmake-rpi ## Build - RasberryPi Release $(MAKE) -R -C .build/projects/gmake-rpi config=release rpi: rpi-debug rpi-release ## Build - RasberryPi Debug and Release -build-darwin: osx-x64 - -build-linux: linux-debug64 linux-release64 - -build-windows: mingw-gcc - -build: build-$(OS) - -rebuild-shaders: - $(MAKE) -R -C examples rebuild - -assets: # Build assets. - $(NINJA) -C scripts - -analyze: - cppcheck src/ - cppcheck examples/ - -docs: - doxygen scripts/bgfx.doxygen - markdown README.md > .build/docs/readme.html - ### SILENT ?= @ UNAME := $(shell uname) -ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin FreeBSD GNU/kFreeBSD)) +ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin)) ifeq ($(UNAME),$(filter $(UNAME),Darwin)) OS=darwin -BUILD_PROJECT_DIR=gmake-osx-x64 -BUILD_OUTPUT_DIR=osx-x64 +BUILD_PROJECT_DIR=gmake-osx-arm64 +BUILD_OUTPUT_DIR=osx-arm64 BUILD_TOOLS_CONFIG=release BUILD_TOOLS_SUFFIX=Release EXE= else -ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD)) -OS=bsd -BUILD_PROJECT_DIR=gmake-freebsd -BUILD_OUTPUT_DIR=freebsd64_gcc -BUILD_TOOLS_CONFIG=release64 -BUILD_TOOLS_SUFFIX=Release -EXE= -else OS=linux -BUILD_PROJECT_DIR=gmake-linux +BUILD_PROJECT_DIR=gmake-linux-gcc BUILD_OUTPUT_DIR=linux64_gcc BUILD_TOOLS_CONFIG=release64 BUILD_TOOLS_SUFFIX=Release EXE= endif -endif else OS=windows BUILD_PROJECT_DIR=gmake-mingw-gcc @@ -326,41 +198,3 @@ tools: geometryc geometryv shaderc texturec texturev ## Build tools. clean-tools: ## Clean tools projects. -$(SILENT) rm -r .build/projects/$(BUILD_PROJECT_DIR) - -dist-windows: .build/projects/gmake-mingw-gcc - $(SILENT) $(MAKE) -C .build/projects/gmake-mingw-gcc config=release64 -j 6 geometryc - $(SILENT) cp .build/win64_mingw-gcc/bin/geometrycRelease.exe tools/bin/windows/geometryc.exe - $(SILENT) $(MAKE) -C .build/projects/gmake-mingw-gcc config=release64 -j 6 geometryv - $(SILENT) cp .build/win64_mingw-gcc/bin/geometryvRelease.exe tools/bin/windows/geometryv.exe - $(SILENT) $(MAKE) -C .build/projects/gmake-mingw-gcc config=release64 -j 6 shaderc - $(SILENT) cp .build/win64_mingw-gcc/bin/shadercRelease.exe tools/bin/windows/shaderc.exe - $(SILENT) $(MAKE) -C .build/projects/gmake-mingw-gcc config=release64 -j 6 texturec - $(SILENT) cp .build/win64_mingw-gcc/bin/texturecRelease.exe tools/bin/windows/texturec.exe - $(SILENT) $(MAKE) -C .build/projects/gmake-mingw-gcc config=release64 -j 6 texturev - $(SILENT) cp .build/win64_mingw-gcc/bin/texturevRelease.exe tools/bin/windows/texturev.exe - -dist-linux: .build/projects/gmake-linux - $(SILENT) $(MAKE) -C .build/projects/gmake-linux config=release64 -j 6 geometryc - $(SILENT) cp .build/linux64_gcc/bin/geometrycRelease tools/bin/linux/geometryc - $(SILENT) $(MAKE) -C .build/projects/gmake-linux config=release64 -j 6 geometryv - $(SILENT) cp .build/linux64_gcc/bin/geometryvRelease tools/bin/linux/geometryv - $(SILENT) $(MAKE) -C .build/projects/gmake-linux config=release64 -j 6 shaderc - $(SILENT) cp .build/linux64_gcc/bin/shadercRelease tools/bin/linux/shaderc - $(SILENT) $(MAKE) -C .build/projects/gmake-linux config=release64 -j 6 texturec - $(SILENT) cp .build/linux64_gcc/bin/texturecRelease tools/bin/linux/texturec - $(SILENT) $(MAKE) -C .build/projects/gmake-linux config=release64 -j 6 texturev - $(SILENT) cp .build/linux64_gcc/bin/texturevRelease tools/bin/linux/texturev - -dist-darwin: .build/projects/gmake-osx-x64 - $(SILENT) $(MAKE) -C .build/projects/gmake-osx-x64 config=release -j 6 geometryc - $(SILENT) cp .build/osx-x64/bin/geometrycRelease tools/bin/darwin/geometryc - $(SILENT) $(MAKE) -C .build/projects/gmake-osx-x64 config=release -j 6 geometryv - $(SILENT) cp .build/osx-x64/bin/geometryvRelease tools/bin/darwin/geometryv - $(SILENT) $(MAKE) -C .build/projects/gmake-osx-x64 config=release -j 6 shaderc - $(SILENT) cp .build/osx-x64/bin/shadercRelease tools/bin/darwin/shaderc - $(SILENT) $(MAKE) -C .build/projects/gmake-osx-x64 config=release -j 6 texturec - $(SILENT) cp .build/osx-x64/bin/texturecRelease tools/bin/darwin/texturec - $(SILENT) $(MAKE) -C .build/projects/gmake-osx-x64 config=release -j 6 texturev - $(SILENT) cp .build/osx-x64/bin/texturevRelease tools/bin/darwin/texturev - -dist: clean dist-windows dist-linux dist-darwin diff --git a/bgfx/scripts/bgfx-codegen.lua b/bgfx/scripts/bgfx-codegen.lua index 508481dd..526841ee 100644 --- a/bgfx/scripts/bgfx-codegen.lua +++ b/bgfx/scripts/bgfx-codegen.lua @@ -32,7 +32,7 @@ local type_actions = { local function cfunc(f) return function(func) - if (not func.cpponly) and (not func.cppinline or func.conly) then + if (not func.cpponly) or func.conly then return f(func) end end @@ -177,7 +177,9 @@ function typegen.structs(typedef) if methods then local m = {} for _, func in ipairs(methods) do - m[#m+1] = cppdecl(func) + if not func.conly then + m[#m+1] = cppdecl(func) + end end methods = m end diff --git a/bgfx/scripts/bgfx.doxygen b/bgfx/scripts/bgfx.doxygen index a78861fd..d8234cec 100644 --- a/bgfx/scripts/bgfx.doxygen +++ b/bgfx/scripts/bgfx.doxygen @@ -1,1808 +1,1808 @@ -# Doxyfile 1.8.2 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = "bgfx" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "Cross-platform rendering library." - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = .build/docs - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. Note that you specify absolute paths here, but also -# relative paths, which will be relative from the directory where doxygen is -# started. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = YES - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, -# and language is one of the parsers supported by doxygen: IDL, Java, -# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, -# C++. For instance to make doxygen treat .inc files as Fortran files (default -# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note -# that for custom extensions you also need to set FILE_PATTERNS otherwise the -# files are not read by doxygen. - -EXTENSION_MAPPING = - -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented classes, -# or namespaces to their corresponding documentation. Such a link can be -# prevented in individual cases by by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields will be shown inline in the documentation -# of the scope in which they are defined (i.e. file, namespace, or group -# documentation), provided this scope is documented. If set to NO (the default), -# structs, classes, and unions are shown on a separate page (for HTML and Man -# pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = YES - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -SYMBOL_CACHE_SIZE = 0 - -# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be -# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given -# their name and scope. Since this can be an expensive process and often the -# same symbol appear multiple times in the code, doxygen keeps a cache of -# pre-resolved symbols. If the cache is too small doxygen will become slower. -# If the cache is too large, memory is wasted. The cache size is given by this -# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = include/bgfx.h README.md - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C, C++ and Fortran comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If left blank doxygen will -# generate a default style sheet. Note that it is recommended to use -# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this -# tag will in the future become obsolete. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional -# user-defined cascading style sheet that is included after the standard -# style sheets created by doxygen. Using this option one can overrule -# certain style aspects. This is preferred over using HTML_STYLESHEET -# since it does not replace the standard style sheet and is therefor more -# robust against future updates. Doxygen will copy the style sheet file to -# the output directory. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of -# entries shown in the various tree structured indices initially; the user -# can expand and collapse entries dynamically later on. Doxygen will expand -# the tree to such a level that at most the specified number of entries are -# visible (unless a fully collapsed tree already exceeds this amount). -# So setting the number of entries 1 will produce a full collapsed tree by -# default. 0 is a special value representing an infinite number of entries -# and will result in a full expanded tree by default. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely -# identify the documentation publisher. This should be a reverse domain-name -# style string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you may also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to -# the MathJax Content Delivery Network so you can quickly see the result without -# installing MathJax. -# However, it is strongly recommended to install a local -# copy of MathJax from http://www.mathjax.org before deployment. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = YES - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. For each -# tag file the location of the external documentation should be added. The -# format of a tag file without this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths -# or URLs. Note that each tag file must have a unique name (where the name does -# NOT include the path). If a tag file is not located in the directory in which -# doxygen is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside -# the class node. If there are many fields or methods and many nodes the -# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS -# threshold limits the number of items for each type to make the size more -# managable. Set this to 0 for no limit. Note that the threshold may be -# exceeded by 50% before the limit is enforced. - -UML_LIMIT_NUM_FIELDS = 10 - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES +# Doxyfile 1.8.2 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = "bgfx" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Cross-platform rendering library." + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = .build/docs + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. Note that you specify absolute paths here, but also +# relative paths, which will be relative from the directory where doxygen is +# started. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = YES + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, +# and language is one of the parsers supported by doxygen: IDL, Java, +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, +# C++. For instance to make doxygen treat .inc files as Fortran files (default +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note +# that for custom extensions you also need to set FILE_PATTERNS otherwise the +# files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented classes, +# or namespaces to their corresponding documentation. Such a link can be +# prevented in individual cases by by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = YES + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = include/bgfx.h README.md + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C, C++ and Fortran comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If left blank doxygen will +# generate a default style sheet. Note that it is recommended to use +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this +# tag will in the future become obsolete. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional +# user-defined cascading style sheet that is included after the standard +# style sheets created by doxygen. Using this option one can overrule +# certain style aspects. This is preferred over using HTML_STYLESHEET +# since it does not replace the standard style sheet and is therefor more +# robust against future updates. Doxygen will copy the style sheet file to +# the output directory. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of +# entries shown in the various tree structured indices initially; the user +# can expand and collapse entries dynamically later on. Doxygen will expand +# the tree to such a level that at most the specified number of entries are +# visible (unless a fully collapsed tree already exceeds this amount). +# So setting the number of entries 1 will produce a full collapsed tree by +# default. 0 is a special value representing an infinite number of entries +# and will result in a full expanded tree by default. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely +# identify the documentation publisher. This should be a reverse domain-name +# style string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. +# However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/bgfx/scripts/bgfx.idl b/bgfx/scripts/bgfx.idl index 32f143d2..e87b841b 100644 --- a/bgfx/scripts/bgfx.idl +++ b/bgfx/scripts/bgfx.idl @@ -1,7 +1,7 @@ -- vim: syntax=lua -- bgfx interface -version(122) +version(129) typedef "bool" typedef "char" @@ -370,6 +370,7 @@ flag.Caps { bits = 64, base = 1, name = "Caps" } .Compute --- Compute shaders are supported. .ConservativeRaster --- Conservative rasterization is supported. .DrawIndirect --- Draw indirect is supported. + .DrawIndirectCount --- Draw indirect with indirect count is supported. .FragmentDepth --- Fragment depth is available in fragment shader. .FragmentOrdering --- Fragment ordering is available in fragment shader. .GraphicsDebugger --- Graphics debugger is present. @@ -379,23 +380,23 @@ flag.Caps { bits = 64, base = 1, name = "Caps" } .Index32 --- 32-bit indices are supported. .Instancing --- Instancing is supported. .OcclusionQuery --- Occlusion query is supported. + .PrimitiveId --- PrimitiveID is available in fragment shader. .RendererMultithreaded --- Renderer is on separate thread. .SwapChain --- Multiple windows are supported. - .Texture_2dArray --- 2D texture array is supported. - .Texture_3d --- 3D textures are supported. .TextureBlit --- Texture blit is supported. - .TransparentBackbuffer --- Transparent back buffer supported. - .TextureCompareReserved .TextureCompareLequal --- Texture compare less equal mode is supported. + .TextureCompareReserved .TextureCubeArray --- Cubemap texture array is supported. .TextureDirectAccess --- CPU direct access to GPU texture memory. .TextureReadBack --- Read-back texture is supported. + .Texture_2dArray --- 2D texture array is supported. + .Texture_3d --- 3D textures are supported. + .TransparentBackbuffer --- Transparent back buffer supported. .VertexAttribHalf --- Vertex attribute half-float is supported. .VertexAttribUint10 --- Vertex attribute 10_10_10_2 is supported. .VertexId --- Rendering with VertexID only is supported. - .PrimitiveId --- PrimitiveID is available in fragment shader. .ViewportLayerArray --- Viewport layer is available in vertex shader. - .DrawIndirectCount --- Draw indirect with indirect count is supported. + .TextureCompareAll --- All texture compare modes are supported. { "TextureCompareReserved", "TextureCompareLequal" } () @@ -458,7 +459,6 @@ enum.Fatal { underscore, comment = "" } enum.RendererType { comment = "Renderer types:" } .Noop --- No rendering. .Agc --- AGC - .Direct3D9 --- Direct3D 9.0 .Direct3D11 --- Direct3D 11.0 .Direct3D12 --- Direct3D 12.0 .Gnm --- GNM @@ -467,7 +467,6 @@ enum.RendererType { comment = "Renderer types:" } .OpenGLES --- OpenGL ES 2.0+ .OpenGL --- OpenGL 2.1+ .Vulkan --- Vulkan - .WebGPU --- WebGPU () --- Access mode enum. @@ -802,7 +801,7 @@ struct.Resolution { ctor } .debugTextScale "uint8_t" --- Scale factor for debug text. --- Configurable runtime limits parameters. -struct.Limits { namespace = "Init" } +struct.Limits { ctor, namespace = "Init" } .maxEncoders "uint16_t" --- Maximum number of encoder threads. .minResourceCbSize "uint32_t" --- Minimum resource command buffer size. .transientVbSize "uint32_t" --- Maximum transient vertex buffer size. @@ -1047,7 +1046,7 @@ func.VertexLayout.decode { const } .asInt "bool &" { out } --- Attribute is packed as int. --- Returns `true` if VertexLayout contains attribute. -func.VertexLayout.has { const, conly, cppinline } +func.VertexLayout.has { const, cppinline } "bool" --- True if VertexLayout contains attribute. .attrib "Attrib::Enum" --- Attribute semantics. See: `bgfx::Attrib` @@ -1162,9 +1161,10 @@ func.getRendererName "const char*" --- Name of renderer. .type "RendererType::Enum" --- Renderer backend type. See: `bgfx::RendererType` +--- Fill bgfx::Init struct with default values, before using it to initialize the library. func.initCtor { cfunc } "void" - .init "Init*" + .init "Init*" --- Pointer to structure to be initialized. See: `bgfx::Init` for more info. --- Initialize the bgfx library. func.init { cfunc } @@ -1565,6 +1565,10 @@ func.destroy { cname = "destroy_indirect_buffer" } .handle "IndirectBufferHandle" --- Indirect buffer handle. --- Create shader from memory buffer. +--- +--- @remarks +--- Shader binary is obtained by compiling shader offline with shaderc command line tool. +--- func.createShader "ShaderHandle" --- Shader handle. .mem "const Memory*" --- Shader binary. @@ -1652,7 +1656,7 @@ func.createTexture "TextureHandle" --- Texture handle. .mem "const Memory*" --- DDS, KTX or PVR texture binary data. .flags "uint64_t" --- Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) - { "BGFX_TEXTURE_NONE|BGFX_SAMPLER_NONE" } --- flags. Default texture sampling mode is linear, and wrap mode is repeat. + { default = "BGFX_TEXTURE_NONE|BGFX_SAMPLER_NONE" } --- flags. Default texture sampling mode is linear, and wrap mode is repeat. --- - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap --- mode. --- - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic @@ -1672,7 +1676,7 @@ func.createTexture2D --- `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set. .format "TextureFormat::Enum" --- Texture format. See: `TextureFormat::Enum`. .flags "uint64_t" --- Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) - { "BGFX_TEXTURE_NONE|BGFX_SAMPLER_NONE" } --- flags. Default texture sampling mode is linear, and wrap mode is repeat. + { default = "BGFX_TEXTURE_NONE|BGFX_SAMPLER_NONE" } --- flags. Default texture sampling mode is linear, and wrap mode is repeat. --- - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap --- mode. --- - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic @@ -1994,6 +1998,15 @@ func.setPaletteColor .index "uint8_t" --- Index into palette. .rgba "const float[4]" --- RGBA floating point values. +--- Set palette color value. +func.setPaletteColor { cname = "set_palette_color_rgba32f" } + "void" + .index "uint8_t" --- Index into palette. + .r "float" --- Red value (RGBA floating point values) + .g "float" --- Green value (RGBA floating point values) + .b "float" --- Blue value (RGBA floating point values) + .a "float" --- Alpha value (RGBA floating point values) + --- Set palette color value. func.setPaletteColor { cname = "set_palette_color_rgba8" } "void" @@ -2014,8 +2027,10 @@ func.setPaletteColor { cname = "set_palette_color_rgba8" } --- func.setViewName "void" - .id "ViewId" --- View id. - .name "const char*" --- View name. + .id "ViewId" --- View id. + .name "const char*" --- View name. + .len "int32_t" --- View name length (if length is INT32_MAX, it's expected + { default = INT32_MAX } --- that _name is zero terminated string. --- Set view rectangle. Draw primitive outside view will be clipped. func.setViewRect @@ -2151,7 +2166,9 @@ func["end"] { cname = "encoder_end" } --- graphics debugging tools. func.Encoder.setMarker "void" - .marker "const char*" --- Marker string. + .name "const char*" --- Marker name. + .len "int32_t" --- Marker name length (if length is INT32_MAX, it's expected + { default = INT32_MAX } --- that _name is zero terminated string. --- Set render states for draw primitive. --- @@ -2464,9 +2481,9 @@ func.Encoder.submit { cname = "submit_indirect" } .id "ViewId" --- View id. .program "ProgramHandle" --- Program. .indirectHandle "IndirectBufferHandle" --- Indirect buffer. - .start "uint16_t" --- First element in indirect buffer. + .start "uint32_t" --- First element in indirect buffer. { default = 0 } - .num "uint16_t" --- Number of draws. + .num "uint32_t" --- Number of draws. { default = 1 } .depth "uint32_t" --- Depth for sorting. { default = 0 } @@ -2483,13 +2500,13 @@ func.Encoder.submit { cname = "submit_indirect_count" } .id "ViewId" --- View id. .program "ProgramHandle" --- Program. .indirectHandle "IndirectBufferHandle" --- Indirect buffer. - .start "uint16_t" --- First element in indirect buffer. + .start "uint32_t" --- First element in indirect buffer. .numHandle "IndexBufferHandle" --- Buffer for number of draws. Must be --- created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`. .numIndex "uint32_t" --- Element in number buffer. { default = 0 } - .numMax "uint16_t" --- Max number of draws. - { default = UINT16_MAX } + .numMax "uint32_t" --- Max number of draws. + { default = UINT32_MAX } .depth "uint32_t" --- Depth for sorting. { default = 0 } .flags "uint8_t" --- Discard or preserve states. See `BGFX_DISCARD_*`. @@ -2560,9 +2577,9 @@ func.Encoder.dispatch { cname = "dispatch_indirect" } .id "ViewId" --- View id. .program "ProgramHandle" --- Compute program. .indirectHandle "IndirectBufferHandle" --- Indirect buffer. - .start "uint16_t" --- First element in indirect buffer. + .start "uint32_t" --- First element in indirect buffer. { default = 0 } - .num "uint16_t" --- Number of dispatches. + .num "uint32_t" --- Number of dispatches. { default = 1 } .flags "uint8_t" --- Discard or preserve states. See `BGFX_DISCARD_*`. { default = "BGFX_DISCARD_ALL" } @@ -2713,6 +2730,7 @@ func.overrideInternal { cname = "override_internal_texture" } --- mode. --- - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic --- sampling. + { default = "BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE" } -- Legacy API: @@ -2720,7 +2738,9 @@ func.overrideInternal { cname = "override_internal_texture" } --- graphics debugging tools. func.setMarker "void" - .marker "const char*" --- Marker string. + .name "const char*" --- Marker name. + .len "int32_t" --- Marker name length (if length is INT32_MAX, it's expected + { default = INT32_MAX } --- that _name is zero terminated string. --- Set render states for draw primitive. --- @@ -2793,6 +2813,7 @@ func.setTransform --- to be used for other draw primitive call. .mtx "const void*" --- Pointer to first matrix in array. .num "uint16_t" --- Number of matrices in array. + { default = 1 } --- Set model matrix from matrix cache for draw primitive. func.setTransform { cname = "set_transform_cached" } @@ -3032,9 +3053,9 @@ func.submit { cname = "submit_indirect" } .id "ViewId" --- View id. .program "ProgramHandle" --- Program. .indirectHandle "IndirectBufferHandle" --- Indirect buffer. - .start "uint16_t" --- First element in indirect buffer. + .start "uint32_t" --- First element in indirect buffer. { default = 0 } - .num "uint16_t" --- Number of draws. + .num "uint32_t" --- Number of draws. { default = 1 } .depth "uint32_t" --- Depth for sorting. { default = 0 } @@ -3051,13 +3072,13 @@ func.submit { cname = "submit_indirect_count" } .id "ViewId" --- View id. .program "ProgramHandle" --- Program. .indirectHandle "IndirectBufferHandle" --- Indirect buffer. - .start "uint16_t" --- First element in indirect buffer. + .start "uint32_t" --- First element in indirect buffer. .numHandle "IndexBufferHandle" --- Buffer for number of draws. Must be --- created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`. .numIndex "uint32_t" --- Element in number buffer. { default = 0 } - .numMax "uint16_t" --- Max number of draws. - { default = UINT16_MAX } + .numMax "uint32_t" --- Max number of draws. + { default = UINT32_MAX } .depth "uint32_t" --- Depth for sorting. { default = 0 } .flags "uint8_t" --- Which states to discard for next draw. See `BGFX_DISCARD_*`. @@ -3128,9 +3149,9 @@ func.dispatch { cname = "dispatch_indirect" } .id "ViewId" --- View id. .program "ProgramHandle" --- Compute program. .indirectHandle "IndirectBufferHandle" --- Indirect buffer. - .start "uint16_t" --- First element in indirect buffer. + .start "uint32_t" --- First element in indirect buffer. { default = 0 } - .num "uint16_t" --- Number of dispatches. + .num "uint32_t" --- Number of dispatches. { default = 1 } .flags "uint8_t" --- Discard or preserve states. See `BGFX_DISCARD_*`. { default = "BGFX_DISCARD_ALL" } diff --git a/bgfx/scripts/bgfx.lua b/bgfx/scripts/bgfx.lua index 1117b9ee..6d4e2def 100644 --- a/bgfx/scripts/bgfx.lua +++ b/bgfx/scripts/bgfx.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- @@ -185,44 +185,6 @@ function bgfxProjectBase(_kind, _defines) path.join(BGFX_DIR, "src/renderer_nvn.h"), }) - if _OPTIONS["with-webgpu"] then - defines { - "BGFX_CONFIG_RENDERER_WEBGPU=1", - "BGFX_CONFIG_DEBUG_ANNOTATION=0", -- does not work - } - - local generator = "out/Cmake" - - configuration { "wasm*" } - defines { - "BGFX_CONFIG_RENDERER_OPENGL=0", - "BGFX_CONFIG_RENDERER_OPENGLES=0", - } - - configuration { "not wasm*" } - includedirs { - path.join(DAWN_DIR, "src/include"), - path.join(DAWN_DIR, "third_party/vulkan-deps/vulkan-headers/src/include"), - path.join(DAWN_DIR, generator, "gen/src/include"), - } - - files { - path.join(DAWN_DIR, generator, "gen/src/dawn/webgpu_cpp.cpp"), - } - configuration { "vs*" } - defines { - "NTDDI_VERSION=NTDDI_WIN10_RS2", - - -- We can't say `=_WIN32_WINNT_WIN10` here because some files do - -- `#if WINVER < 0x0600` without including windows.h before, - -- and then _WIN32_WINNT_WIN10 isn't yet known to be 0x0A00. - "_WIN32_WINNT=0x0A00", - "WINVER=0x0A00", - } - - configuration {} - end - if _OPTIONS["with-amalgamated"] then excludes { path.join(BGFX_DIR, "src/bgfx.cpp"), @@ -292,59 +254,3 @@ function bgfxProject(_name, _kind, _defines) copyLib() end - -if _OPTIONS["with-webgpu"] then - function usesWebGPU() - configuration { "wasm*" } - linkoptions { - "-s USE_WEBGPU=1", - } - - configuration { "not wasm*" } - local generator = "out/Cmake" - - includedirs { - path.join(DAWN_DIR, "src/include"), - path.join(DAWN_DIR, generator, "gen/src/include"), - } - - libdirs { - path.join(DAWN_DIR, generator), - path.join(DAWN_DIR, generator, "src/common/Debug"), - path.join(DAWN_DIR, generator, "src/dawn/Debug"), - path.join(DAWN_DIR, generator, "src/dawn_native/Debug"), - path.join(DAWN_DIR, generator, "src/dawn_platform/Debug"), - path.join(DAWN_DIR, generator, "third_party/tint/src/Debug"), - path.join(DAWN_DIR, generator, "third_party/vulkan-deps/spirv-tools/src/source/Debug"), - path.join(DAWN_DIR, generator, "third_party/vulkan-deps/spirv-tools/src/source/opt/Debug"), - path.join(DAWN_DIR, generator, "third_party/vulkan-deps/spirv-cross/src/Debug"), - } - - links { - -- shared - --"dawn_proc_shared", - --"dawn_native_shared", - --"shaderc_spvc_shared", - -- static - "dawn_common", - "dawn_proc", - "dawn_native", - "dawn_platform", - ----"shaderc", - "tint", - "SPIRV-Tools", - "SPIRV-Tools-opt", - "spirv-cross-cored", - "spirv-cross-hlsld", - "spirv-cross-glsld", - "spirv-cross-msld", - --"spirv-cross-reflectd", - } - - removeflags { - "FatalWarnings", - } - - configuration {} - end -end diff --git a/bgfx/scripts/bindings-bf.lua b/bgfx/scripts/bindings-bf.lua index 3423bd18..0a43edb5 100644 --- a/bgfx/scripts/bindings-bf.lua +++ b/bgfx/scripts/bindings-bf.lua @@ -3,7 +3,7 @@ local idl = codegen.idl "bgfx.idl" local beef_template = [[ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/scripts/bindings-cs.lua b/bgfx/scripts/bindings-cs.lua index 0e9f21ed..355922f6 100644 --- a/bgfx/scripts/bindings-cs.lua +++ b/bgfx/scripts/bindings-cs.lua @@ -3,7 +3,7 @@ local idl = codegen.idl "bgfx.idl" local csharp_template = [[ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -29,7 +29,7 @@ public static partial class bgfx local csharp_dllname_template = [[ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/scripts/bindings-d.lua b/bgfx/scripts/bindings-d.lua index dd899640..8f47d8a0 100644 --- a/bgfx/scripts/bindings-d.lua +++ b/bgfx/scripts/bindings-d.lua @@ -11,13 +11,12 @@ module bgfx; import bindbc.bgfx.config; -import bindbc.common.types: va_list; +import bindbc.common.types: c_int64, c_uint64, va_list; static import bgfx.fakeenum; $version alias ViewID = ushort; -deprecated("Please use `ViewID` instead.") alias ViewId = ushort; enum invalidHandle(T) = T(ushort.max); @@ -28,57 +27,57 @@ pragma(inline,true) nothrow @nogc pure @safe{ StateBlend_ blendFuncSeparate(StateBlend_ srcRGB, StateBlend_ dstRGB, StateBlend_ srcA, StateBlend_ dstA){ return (srcRGB | ((dstRGB) << 4)) | ((srcA | (dstA << 4)) << 8); } - + ///Blend equation separate. StateBlendEquation_ blendEquationSeparate(StateBlendEquation_ equationRGB, StateBlendEquation_ equationA){ return equationRGB | (equationA << 3); } - + ///Blend function. StateBlend_ blendFunc(StateBlend_ src, StateBlend_ dst){ return blendFuncSeparate(src, dst, src, dst); } - + ///Blend equation. StateBlendEquation_ blendEquation(StateBlendEquation_ equation){ return blendEquationSeparate(equation, equation); } - + ///Utility predefined blend modes. enum StateBlendFunc: StateBlend_{ ///Additive blending. add = blendFunc(StateBlend.one, StateBlend.one), - + ///Alpha blend. alpha = blendFunc(StateBlend.srcAlpha, StateBlend.invSrcAlpha), - + ///Selects darker color of blend. darken = blendFunc(StateBlend.one, StateBlend.one) | blendEquation(StateBlendEquation.min), - + ///Selects lighter color of blend. lighten = blendFunc(StateBlend.one, StateBlend.one) | blendEquation(StateBlendEquation.max), - + ///Multiplies colors. multiply = blendFunc(StateBlend.dstColor, StateBlend.zero), - + ///Opaque pixels will cover the pixels directly below them without any math or algorithm applied to them. normal = blendFunc(StateBlend.one, StateBlend.invSrcAlpha), - + ///Multiplies the inverse of the blend and base colors. screen = blendFunc(StateBlend.one, StateBlend.invSrcColor), - + ///Decreases the brightness of the base color based on the value of the blend color. linearBurn = blendFunc(StateBlend.dstColor, StateBlend.invDstColor) | blendEquation(StateBlendEquation.sub), } - + StateBlend_ blendFuncRTx(StateBlend_ src, StateBlend_ dst){ return cast(uint)(src >> StateBlend.shift) | (cast(uint)(dst >> StateBlend.shift) << 4); } - + StateBlend_ blendFuncRTxE(StateBlend_ src, StateBlend_ dst, StateBlendEquation_ equation){ return blendFuncRTx(src, dst) | (cast(uint)(equation >> StateBlendEquation.shift) << 8); } - + StateBlend_ blendFuncRT1(StateBlend_ src, StateBlend_ dst){ return blendFuncRTx(src, dst) << 0; } StateBlend_ blendFuncRT2(StateBlend_ src, StateBlend_ dst){ return blendFuncRTx(src, dst) << 11; } StateBlend_ blendFuncRT3(StateBlend_ src, StateBlend_ dst){ return blendFuncRTx(src, dst) << 22; } - + StateBlend_ blendFuncRT1E(StateBlend_ src, StateBlend_ dst, StateBlendEquation_ equation){ return blendFuncRTxE(src, dst, equation) << 0; } @@ -92,12 +91,11 @@ pragma(inline,true) nothrow @nogc pure @safe{ $structs mixin(joinFnBinds((){ - string[][] ret; - ret ~= makeFnBinds([ + FnBind[] ret = [ $funcs - ]); + ]; return ret; -}(), __MODULE__, $membersWithFns)); +}(), $membersWithFns)); static if(!staticBinding): import bindbc.loader; @@ -113,7 +111,7 @@ local dKeywords = {"abstract", "alias", "align", "asm", "assert", "auto", "bool" local function contains(table, val) for i=1,#table do - if table[i] == val then + if table[i] == val then return true end end @@ -137,6 +135,8 @@ local capsRepl = { notequal = "notEqual", gequal = "gEqual", Lequal = "LEqual", lequal = "lEqual", decrsat = "decrSat", incrsat = "incrSat", revsub = "revSub", linestrip = "lineStrip", tristrip = "triStrip", + bstencil = "bStencil", fstencil = "fStencil", + Rmask = "RMask", } local function abbrevsToUpper(name) @@ -180,6 +180,8 @@ local usEnSubs = { color = "colour", Color = "Colour", rasterize = "rasterise", Rasterize = "Rasterise", initialize = "initialise", Initialize = "Initialise", + normalize = "normalise", Normalize = "Normalise", + normalized = "normalised", Normalized = "Normalised", ccw = "acw", CCW = "ACW", } local function toIntlEn(name) @@ -197,6 +199,15 @@ local function toIntlEn(name) end end +-- Unconditionally convert +local function toIntlEnUncond(name) + local newName = toIntlEn(name) + if newName ~= nil then + return newName + end + return name +end + local function hexStr(val, bits) local digits = bits / 4 local str = string.format(string.format("%%0%iX", digits), val) @@ -205,7 +216,7 @@ local function hexStr(val, bits) str = str:sub(0, i) .. "_" .. str:sub(i+1) i = i + 5 end - + return "0x" .. str end @@ -218,20 +229,20 @@ local function convArray(array) end local typeSubs = { - uint32_t = "uint", int32_t = "int", - uint16_t = "ushort", int16_t = "short", - uint64_t = "ulong", int64_t = "long", - uint8_t = "ubyte", int8_t = "byte", - uintptr_t = "size_t" + {"uint32_t", "uint"}, {"int32_t", "int"}, + {"uint16_t", "ushort"}, {"int16_t", "short"}, + {"uint64_t", "c_uint64"}, {"int64_t", "c_int64"}, + {"uint8_t", "ubyte"}, {"int8_t", "byte"}, + {"uintptr_t", "size_t"} } local function convSomeType(arg, isFnArg) local type = arg.fulltype if type == "bx::AllocatorI*" or type == "CallbackI*" then type = "void*" else - for from, to in pairs(typeSubs) do - if type:find(from) then - type = type:gsub(from, to) + for _, item in ipairs(typeSubs) do + if type:find(item[1]) then + type = type:gsub(item[1], item[2]) break end end @@ -261,7 +272,7 @@ local function convSomeType(arg, isFnArg) type = type:gsub("const%s+([A-Za-z_][A-Za-z0-9_]*)%s*%*", "const(%1)*") --change `const x*` to `const(x)*` type = abbrevsToUpper(type) end - + return type end @@ -278,9 +289,9 @@ local valSubs = { UINT8_MAX = "ubyte.max", UINT16_MAX = "ushort.max", UINT32_MAX = "uint.max", - + BGFX_INVALID_HANDLE = "invalidHandle", - + BGFX_DISCARD_ALL = "Discard.all", BGFX_BUFFER_NONE = "Buffer.none", BGFX_STENCIL_NONE = "Stencil.none", @@ -307,7 +318,7 @@ local function convVal(arg, type) val = val:gsub("INT32_MAX", "int.max") end val = convArray(val) - + return val end @@ -348,7 +359,7 @@ local function genStructMemberFn(func) --NOTE: this does not work on nested stru line = line:gsub("@(%l)(%l+)", function(a, b) return a:upper() .. b .. ":" end) table.insert(st.fns, line) end - + local hasParamsComments = false for _, arg in ipairs(func.args) do if arg.comment ~= nil then @@ -356,14 +367,14 @@ local function genStructMemberFn(func) --NOTE: this does not work on nested stru break end end - + if hasParamsComments then table.insert(st.fns, "Params:") end - + for _, arg in ipairs(func.args) do if arg.comment ~= nil then - table.insert(st.fns, "\t" .. convName(arg.name:sub(2)) .. " = " .. arg.comment[1]) + table.insert(st.fns, "\t" .. toIntlEnUncond(convName(arg.name:sub(2))) .. " = " .. arg.comment[1]) for i, comment in ipairs(arg.comment) do if i > 1 then table.insert(st.fns, comment) @@ -371,10 +382,10 @@ local function genStructMemberFn(func) --NOTE: this does not work on nested stru end end end - + table.insert(st.fns, "*/") end - + local args = {} for _, arg in ipairs(func.args) do local def = "" @@ -384,18 +395,18 @@ local function genStructMemberFn(func) --NOTE: this does not work on nested stru if arg.fulltype == "..." then table.insert(args, "..." .. def) else - table.insert(args, convFnArgType(arg) .. " " .. convName(arg.name:sub(2)) .. def) + table.insert(args, convFnArgType(arg) .. " " .. toIntlEnUncond(convName(arg.name:sub(2))) .. def) end end - + if func.const ~= nil then attribs = "const" end if attribs ~= "" then - attribs = ", q{" .. attribs .. "}" + attribs = ", memAttr: q{" .. attribs .. "}" end - - table.insert(st.fns, string.format("[q{%s}, q{%s}, q{%s}, `C++`%s],", convType(func.ret), func.name, table.concat(args, ", "), attribs)) + + table.insert(st.fns, string.format("{q{%s}, q{%s}, q{%s}, ext: `C++`%s},", convType(func.ret), func.name, table.concat(args, ", "), attribs)) end end @@ -420,7 +431,7 @@ function gen.gen() local idx = 1; local r = template:gsub("$([a-zA-Z_]+)", function(what) local tmp = {} - + local ind_end = template:find("$"..what, idx, true) local ind_start = ind_end for j = 1, ind_end-1 do @@ -431,9 +442,9 @@ function gen.gen() break end end - + indent = string.sub(template, ind_start+1, ind_end-1) - + if what == "version" then return genVersion() elseif what == "structs" then @@ -487,13 +498,13 @@ function converter.structs(st, name, topLvl) for _, line in ipairs(st.comments) do yield(line) end - + if topLvl then yield("extern(C++, \"bgfx\") struct " .. name .. "{") else yield("extern(C++) struct " .. name .. "{") end - + local subN = 0 for _, subStruct in ipairs(st.subs) do subN = subN + 1 @@ -510,24 +521,23 @@ function converter.structs(st, name, topLvl) if subN > 0 then yield("\t") end - + for _, line in ipairs(st.fields) do yield(line) end - + if #st.fns > 0 then membersWithFns = membersWithFns .. name .. ", " yield("\textern(D) mixin(joinFnBinds((){") - yield("\t\tstring[][] ret;") - yield("\t\tret ~= makeFnBinds([") + yield("\t\tFnBind[] ret = [") for _, line in ipairs(st.fns) do yield("\t\t\t" .. line) end - yield("\t\t], true);") + yield("\t\t];") yield("\t\treturn ret;") - yield("\t}(), typeof(this).stringof));") + yield("\t}()));") end - + yield("}") end @@ -543,13 +553,13 @@ function converter.types(typ) yield("*/") end end - + if typ.handle then ---hnadle yield("extern(C++, \"bgfx\") struct " .. typ.name .. "{") yield("\tushort idx;") yield("}") --yield(typ.name .. " invalidHandle(){ return " .. typ.name .. "(ushort.max); }") - + -- For some reason, this has never worked, so I'm commenting it out just in case it does start working suddenly. :P --[[ elseif typ.funcptr then @@ -561,16 +571,16 @@ function converter.types(typ) table.insert(args, convFnArgType(arg) .. " " .. convName(arg.name:sub(2)) .. def) end end - + yield(string.format("alias %s = extern(C++) %s function(%s);", typ.name, convType(typ.ret), table.concat(args, ", "))) --]] elseif typ.enum then local typeName = abbrevsToUpper(typ.name:gsub("::Enum", "")) local otherName = string.format("bgfx.fakeenum.%s.Enum", typ.name:gsub("::Enum", "")) - + yield("enum " .. typeName .. ": " .. otherName .. "{") table.insert(enumTypes, typeName) - + local vals = "" for idx, enum in ipairs(typ.enum) do local comments = "" @@ -588,13 +598,13 @@ function converter.types(typ) local name = convName(toCamelCase(enum.name)) yield("\t" .. name .. " = " .. otherName .. "." .. name .. ",") vals = vals .. name .. "," - + local intlName = toIntlEn(enum.name) if intlName ~= nil then yield("\t" .. convName(toCamelCase(intlName)) .. " = " .. otherName .. "." .. name .. ",") end end - + gen.fakeEnumFile = gen.fakeEnumFile .. string.format([[ extern(C++, "bgfx") package final abstract class %s{ enum Enum{ @@ -602,16 +612,16 @@ extern(C++, "bgfx") package final abstract class %s{ } } ]], typeName, vals) - + yield("\t" .. "count = " .. otherName .. ".count,") yield("}") - + elseif typ.bits ~= nil then local typeName = convName(typ.name) if typeName == "Caps" then typeName = "CapFlags" end - + local enumType = "uint" if typ.bits == 64 then enumType = "ulong" @@ -622,7 +632,7 @@ extern(C++, "bgfx") package final abstract class %s{ elseif typ.bits == 8 then enumType = "ubyte" end - + local maxLen = 0 if typ.shift then maxLen = string.len("shift") @@ -632,10 +642,10 @@ extern(C++, "bgfx") package final abstract class %s{ for _, flag in ipairs(typ.flag) do maxLen = math.max(maxLen, flag.name:len()) end - + yield("alias " .. typeName .. "_ = " .. enumType .. ";") yield("enum " .. typeName .. ": " .. typeName .. "_{") - + local function getValOr(name) local t = typeName if typeName == "State" then @@ -675,7 +685,7 @@ extern(C++, "bgfx") package final abstract class %s{ end return abbrevsToUpper(t) .. "." .. convName(toCamelCase(name)) end - + for idx, flag in ipairs(typ.flag) do local value = flag.value if value ~= nil then @@ -689,7 +699,7 @@ extern(C++, "bgfx") package final abstract class %s{ end end end - + local comments = "" if flag.comment ~= nil then if #flag.comment == 1 then @@ -702,17 +712,17 @@ extern(C++, "bgfx") package final abstract class %s{ yield("\t*/") end end - + local name = convName(toCamelCase(flag.name)) yield("\t" .. name .. string.rep(" ", maxLen+2 - name:len()) .. "= " .. value .. "," .. comments) - + local intlName = toIntlEn(name) if intlName ~= nil then intlName = intlName yield("\t" .. intlName .. string.rep(" ", maxLen+2 - intlName:len()) .. "= " .. name .. ",") end end - + if typ.shift then local name = convName("shift") local value = typ.shift @@ -732,15 +742,15 @@ extern(C++, "bgfx") package final abstract class %s{ yield("\t" .. name .. string.rep(" ", maxLen+2 - name:len()) .. "= " .. value .. "," .. comments) end yield("}") - + local intlName = toIntlEn(typeName) if intlName ~= nil then yield("alias " .. intlName .. " = " .. typeName .. ";") end - + if typ.helper then yield(string.format( - "%s_ to%s(%s v){ return (v << %s) & %s; }", + "%s_ to%s(%s v) nothrow @nogc pure @safe{ return (v << %s) & %s; }", typeName, typeName, enumType, @@ -752,7 +762,7 @@ extern(C++, "bgfx") package final abstract class %s{ end elseif typ.struct ~= nil then local st = {name = typ.name, comments = {}, fields = {}, fns = {}, subs = {}} - + if typ.comments ~= nil then if #typ.comments == 1 then table.insert(st.comments, "///" .. typ.comments[1]) @@ -764,7 +774,7 @@ extern(C++, "bgfx") package final abstract class %s{ table.insert(st.comments, "*/") end end - + for _, member in ipairs(typ.struct) do local comments = "" if member.comment ~= nil then @@ -783,11 +793,11 @@ extern(C++, "bgfx") package final abstract class %s{ end table.insert(st.fields, "\t" .. convStructMember(member) .. ";" .. comments) end - + if typ.ctor ~= nil and typ.name ~= "PlatformData" then - table.insert(st.fns, "[q{void}, q{this}, q{}, `C++`],") + table.insert(st.fns, "{q{void}, q{this}, q{}, ext: `C++`},") end - + if typ.namespace ~= nil then --if this is a sub-struct if allStructs[typ.namespace] ~= nil then table.insert(allStructs[typ.namespace].subs, st) @@ -818,7 +828,7 @@ function converter.funcs(func) line = line:gsub("@(%l)(%l+)", function(a, b) return a:upper() .. b .. ":" end) yield("* " .. line) end - + local hasParamsComments = false for _, arg in ipairs(func.args) do if arg.comment ~= nil then @@ -826,14 +836,14 @@ function converter.funcs(func) break end end - + if hasParamsComments then yield("Params:") end - + for _, arg in ipairs(func.args) do if arg.comment ~= nil then - yield("\t" .. convName(arg.name:sub(2)) .. " = " .. arg.comment[1]) + yield("\t" .. toIntlEnUncond(convName(arg.name:sub(2))) .. " = " .. arg.comment[1]) for i, comment in ipairs(arg.comment) do if i > 1 then yield(comment) @@ -841,10 +851,10 @@ function converter.funcs(func) end end end - + yield("*/") end - + local args = {} for _, arg in ipairs(func.args) do local def = "" @@ -854,15 +864,15 @@ function converter.funcs(func) if arg.fulltype == "..." then table.insert(args, "..." .. def) else - table.insert(args, convFnArgType(arg) .. " " .. convName(arg.name:sub(2)) .. def) + table.insert(args, convFnArgType(arg) .. " " .. toIntlEnUncond(convName(arg.name:sub(2))) .. def) end end - + if attribs ~= "" then - attribs = ", q{" .. attribs .. "}" + attribs = ", memAttr: q{" .. attribs .. "}" end - - yield(string.format("[q{%s}, q{%s}, q{%s}, `%s`%s],", convType(func.ret), func.name, table.concat(args, ", "), extern, attribs)) + + yield(string.format("{q{%s}, q{%s}, q{%s}, ext: `%s`%s},", convType(func.ret), func.name, table.concat(args, ", "), extern, attribs)) end end diff --git a/bgfx/scripts/bindings-zig.lua b/bgfx/scripts/bindings-zig.lua index 18b2cce4..2db7204f 100644 --- a/bgfx/scripts/bindings-zig.lua +++ b/bgfx/scripts/bindings-zig.lua @@ -2,7 +2,7 @@ local codegen = require "codegen" local idl = codegen.idl "bgfx.idl" local zig_template = [[ -// Copyright 2011-2023 Branimir Karadzic. All rights reserved. +// Copyright 2011-2024 Branimir Karadzic. All rights reserved. // License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE diff --git a/bgfx/scripts/example-common.lua b/bgfx/scripts/example-common.lua index 4aaa056c..e635be07 100644 --- a/bgfx/scripts/example-common.lua +++ b/bgfx/scripts/example-common.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- @@ -38,6 +38,10 @@ project ("example-common") path.join(BGFX_DIR, "examples/common/**.h"), } + defines { + "USE_ENTRY=1", + } + using_bx() if filesexist(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-gnm"), @@ -75,12 +79,6 @@ project ("example-common") } end - if _OPTIONS["with-wayland"] then - defines { - "ENTRY_CONFIG_USE_WAYLAND=1", - } - end - configuration { "android-*" } includedirs { path.join(BGFX_DIR, "3rdparty/native_app_glue") diff --git a/bgfx/scripts/genie.lua b/bgfx/scripts/genie.lua index 114a97e1..9eb10a7b 100644 --- a/bgfx/scripts/genie.lua +++ b/bgfx/scripts/genie.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- @@ -20,11 +20,6 @@ newoption { description = "Enable GLFW entry.", } -newoption { - trigger = "with-wayland", - description = "Use Wayland backend.", -} - newoption { trigger = "with-profiler", description = "Enable build with intrusive profiler.", @@ -51,8 +46,8 @@ newoption { } newoption { - trigger = "with-webgpu", - description = "Enable webgpu experimental renderer.", + trigger = "with-libheif", + description = "Enable building bimg with libheif HEIF and AVIF file format decoder.", } newaction { @@ -70,6 +65,7 @@ newaction { end generate("temp.bgfx.h" , "../include/bgfx/c99/bgfx.h", " ") +-- generate("temp.bgfx.hpp" , "../include/bgfx/bgfx.h", "\t") generate("temp.bgfx.idl.inl", "../src/bgfx.idl.inl", "\t") generate("temp.defines.h", "../include/bgfx/defines.h", "\t") @@ -111,7 +107,7 @@ newaction { f:close() io.output(path.join(MODULE_DIR, "src/version.h")) io.write("/*\n") - io.write(" * Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n") + io.write(" * Copyright 2011-2024 Branimir Karadzic. All rights reserved.\n") io.write(" * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n") io.write(" */\n") io.write("\n") @@ -179,23 +175,6 @@ if not os.isdir(BX_DIR) or not os.isdir(BIMG_DIR) then os.exit() end -if _OPTIONS["with-webgpu"] then - DAWN_DIR = os.getenv("DAWN_DIR") - - if not DAWN_DIR then - DAWN_DIR = path.getabsolute(path.join(BGFX_DIR, "../dawn")) - end - - if not os.isdir(DAWN_DIR) and "wasm*" ~= _OPTIONS["gcc"] then - print("Dawn not found at \"" .. DAWN_DIR .. "\". git clone https://dawn.googlesource.com/dawn?") - - print("For more info see: https://bkaradzic.github.io/bgfx/build.html") - os.exit() - end - - _OPTIONS["with-windows"] = "10.0" -end - dofile (path.join(BX_DIR, "scripts/toolchain.lua")) if not toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR) then return -- no action specified @@ -204,10 +183,6 @@ end function copyLib() end -if _OPTIONS["with-wayland"] then - defines { "WL_EGL_PLATFORM=1" } -end - if _OPTIONS["with-sdl"] then if os.is("windows") then if not os.getenv("SDL2_DIR") then @@ -248,21 +223,10 @@ function exampleProjectDefaults() using_bx() - if _OPTIONS["with-webgpu"] then - usesWebGPU() - end - if _OPTIONS["with-sdl"] then defines { "ENTRY_CONFIG_USE_SDL=1" } links { "SDL2" } - configuration { "linux or freebsd" } - if _OPTIONS["with-wayland"] then - links { - "wayland-egl", - } - end - configuration { "osx*" } libdirs { "$(SDL2_DIR)/lib" } @@ -273,21 +237,6 @@ function exampleProjectDefaults() defines { "ENTRY_CONFIG_USE_GLFW=1" } links { "glfw3" } - configuration { "linux or freebsd" } - if _OPTIONS["with-wayland"] then - links { - "wayland-egl", - } - else - links { - "Xrandr", - "Xinerama", - "Xi", - "Xxf86vm", - "Xcursor", - } - end - configuration { "osx*" } linkoptions { "-framework CoreVideo", @@ -388,6 +337,7 @@ function exampleProjectDefaults() kind "ConsoleApp" linkoptions { + "-sGL_ENABLE_GET_PROC_ADDRESS", "-s TOTAL_MEMORY=32MB", "-s ALLOW_MEMORY_GROWTH=1", "--preload-file ../../../examples/runtime@/" diff --git a/bgfx/scripts/geometryc.lua b/bgfx/scripts/geometryc.lua index a12a54fe..b5316225 100644 --- a/bgfx/scripts/geometryc.lua +++ b/bgfx/scripts/geometryc.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- diff --git a/bgfx/scripts/geometryv.lua b/bgfx/scripts/geometryv.lua index de63a334..511bf55f 100644 --- a/bgfx/scripts/geometryv.lua +++ b/bgfx/scripts/geometryv.lua @@ -1,3 +1,8 @@ +-- +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. +-- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE +-- + project ("geometryv") uuid (os.uuid("geometryv") ) kind "ConsoleApp" @@ -30,13 +35,6 @@ project ("geometryv") defines { "ENTRY_CONFIG_USE_SDL=1" } links { "SDL2" } - configuration { "linux or freebsd" } - if _OPTIONS["with-wayland"] then - links { - "wayland-egl", - } - end - configuration { "x32", "windows" } libdirs { "$(SDL2_DIR)/lib/x86" } @@ -50,21 +48,6 @@ project ("geometryv") defines { "ENTRY_CONFIG_USE_GLFW=1" } links { "glfw3" } - configuration { "linux or freebsd" } - if _OPTIONS["with-wayland"] then - links { - "wayland-egl", - } - else - links { - "Xrandr", - "Xinerama", - "Xi", - "Xxf86vm", - "Xcursor", - } - end - configuration { "osx*" } linkoptions { "-framework CoreVideo", diff --git a/bgfx/scripts/shader-embeded.mk b/bgfx/scripts/shader-embeded.mk index 360ac3e5..e058be3e 100644 --- a/bgfx/scripts/shader-embeded.mk +++ b/bgfx/scripts/shader-embeded.mk @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # @@ -26,12 +26,10 @@ vs_%.bin.h : vs_%.sc @echo [$(<)] $(SILENT) $(SHADERC) $(VS_FLAGS) --platform linux -p 120 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_glsl @cat "$(SHADER_TMP)" > $(@) - -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform android -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_essl + -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform android -p 100_es -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_essl -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform linux -p spirv -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_spv -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform windows -p s_3_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx9 - -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform windows -p s_5_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl @@ -43,12 +41,10 @@ fs_%.bin.h : fs_%.sc @echo [$(<)] $(SILENT) $(SHADERC) $(FS_FLAGS) --platform linux -p 120 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_glsl @cat "$(SHADER_TMP)" > $(@) - -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform android -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_essl + -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform android -p 100_es -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_essl -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform linux -p spirv -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_spv -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform windows -p s_3_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx9 - -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform windows -p s_5_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl diff --git a/bgfx/scripts/shader.mk b/bgfx/scripts/shader.mk index 467cd396..1865625f 100644 --- a/bgfx/scripts/shader.mk +++ b/bgfx/scripts/shader.mk @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # @@ -15,7 +15,7 @@ ifndef TARGET .PHONY: all all: @echo Usage: make TARGET=# [clean, all, rebuild] - @echo " TARGET=0 (hlsl - d3d9 / Windows only!)" + @echo " TARGET=0 (hlsl - d3d11 / Windows only!)" @echo " TARGET=1 (hlsl - d3d11 / Windows only!)" @echo " TARGET=3 (essl - android)" @echo " TARGET=4 (glsl)" @@ -52,12 +52,7 @@ else ADDITIONAL_INCLUDES?= -ifeq ($(TARGET), 0) -VS_FLAGS=--platform windows -p s_3_0 -O 3 -FS_FLAGS=--platform windows -p s_3_0 -O 3 -SHADER_PATH=shaders/dx9 -else -ifeq ($(TARGET), 1) +ifeq ($(TARGET), $(filter $(TARGET), 0 1)) VS_FLAGS=--platform windows -p s_5_0 -O 3 FS_FLAGS=--platform windows -p s_5_0 -O 3 CS_FLAGS=--platform windows -p s_5_0 -O 1 @@ -98,7 +93,6 @@ endif endif endif endif -endif THISDIR := $(dir $(lastword $(MAKEFILE_LIST))) VS_FLAGS+=-i $(THISDIR)../src/ $(ADDITIONAL_INCLUDES) diff --git a/bgfx/scripts/shaderc.lua b/bgfx/scripts/shaderc.lua index 4da12faf..cc4d7d8a 100644 --- a/bgfx/scripts/shaderc.lua +++ b/bgfx/scripts/shaderc.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- @@ -82,6 +82,8 @@ project "spirv-opt" path.join(SPIRV_TOOLS, "source/text.h"), path.join(SPIRV_TOOLS, "source/text_handler.cpp"), path.join(SPIRV_TOOLS, "source/text_handler.h"), + path.join(SPIRV_TOOLS, "source/to_string.cpp"), + path.join(SPIRV_TOOLS, "source/to_string.h"), path.join(SPIRV_TOOLS, "source/util/bit_vector.cpp"), path.join(SPIRV_TOOLS, "source/util/bit_vector.h"), path.join(SPIRV_TOOLS, "source/util/bitutils.h"), @@ -560,7 +562,6 @@ project "shaderc" path.join(BIMG_DIR, "include"), path.join(BGFX_DIR, "include"), - path.join(BGFX_DIR, "3rdparty/webgpu/include"), path.join(BGFX_DIR, "3rdparty/dxsdk/include"), FCPP_DIR, diff --git a/bgfx/scripts/temp.bgfx.h b/bgfx/scripts/temp.bgfx.h index 9eec1b45..0b826c3a 100644 --- a/bgfx/scripts/temp.bgfx.h +++ b/bgfx/scripts/temp.bgfx.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/scripts/temp.bgfx.hpp b/bgfx/scripts/temp.bgfx.hpp new file mode 100644 index 00000000..1040d85d --- /dev/null +++ b/bgfx/scripts/temp.bgfx.hpp @@ -0,0 +1,258 @@ +/* + * Copyright 2011-2019 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE + */ + +/* + * + * AUTO GENERATED! DO NOT EDIT! ( source : $source ) + * + */ + +#ifndef BGFX_H_HEADER_GUARD +#define BGFX_H_HEADER_GUARD + +#define BGFX_IDL_CPP 1 + +#include // va_list +#include // uint32_t +#include // NULL + +#include "defines.h" + +/// +#define BGFX_HANDLE(_name) \ + struct _name { uint16_t idx; }; \ + inline bool isValid(_name _handle) { return bgfx::kInvalidHandle != _handle.idx; } + +#define BGFX_INVALID_HANDLE { bgfx::kInvalidHandle } + +namespace bx { struct AllocatorI; } + +/// BGFX +namespace bgfx +{ + struct CallbackI; + +$enums + +static const uint16_t kInvalidHandle = UINT16_MAX; + + /// View id. + typedef uint16_t ViewId; + +$handles + +$structs + + /// Callback interface to implement application specific behavior. + /// Cached items are currently used for OpenGL and Direct3D 12 binary + /// shaders. + /// + /// @remarks + /// 'fatal' and 'trace' callbacks can be called from any thread. Other + /// callbacks are called from the render thread. + /// + /// @attention C99's equivalent binding is `bgfx_callback_interface_t`. + /// + struct CallbackI + { + virtual ~CallbackI() = 0; + + /// This callback is called on unrecoverable errors. + /// It's not safe to continue (Excluding _code `Fatal::DebugCheck`), + /// inform the user and terminate the application. + /// + /// @param[in] _filePath File path where fatal message was generated. + /// @param[in] _line Line where fatal message was generated. + /// @param[in] _code Fatal error code. + /// @param[in] _str More information about error. + /// + /// @remarks + /// Not thread safe and it can be called from any thread. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.fatal`. + /// + virtual void fatal( + const char* _filePath + , uint16_t _line + , Fatal::Enum _code + , const char* _str + ) = 0; + + /// Print debug message. + /// + /// @param[in] _filePath File path where debug message was generated. + /// @param[in] _line Line where debug message was generated. + /// @param[in] _format `printf` style format. + /// @param[in] _argList Variable arguments list initialized with + /// `va_start`. + /// + /// @remarks + /// Not thread safe and it can be called from any thread. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.trace_vargs`. + /// + virtual void traceVargs( + const char* _filePath + , uint16_t _line + , const char* _format + , va_list _argList + ) = 0; + + /// Profiler region begin. + /// + /// @param[in] _name Region name, contains dynamic string. + /// @param[in] _abgr Color of profiler region. + /// @param[in] _filePath File path where `profilerBegin` was called. + /// @param[in] _line Line where `profilerBegin` was called. + /// + /// @remarks + /// Not thread safe and it can be called from any thread. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.profiler_begin`. + /// + virtual void profilerBegin( + const char* _name + , uint32_t _abgr + , const char* _filePath + , uint16_t _line + ) = 0; + + /// Profiler region begin with string literal name. + /// + /// @param[in] _name Region name, contains string literal. + /// @param[in] _abgr Color of profiler region. + /// @param[in] _filePath File path where `profilerBeginLiteral` was called. + /// @param[in] _line Line where `profilerBeginLiteral` was called. + /// + /// @remarks + /// Not thread safe and it can be called from any thread. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.profiler_begin_literal`. + /// + virtual void profilerBeginLiteral( + const char* _name + , uint32_t _abgr + , const char* _filePath + , uint16_t _line + ) = 0; + + /// Profiler region end. + /// + /// @remarks + /// Not thread safe and it can be called from any thread. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.profiler_end`. + /// + virtual void profilerEnd() = 0; + + /// Returns the size of a cached item. Returns 0 if no cached item was + /// found. + /// + /// @param[in] _id Cache id. + /// @returns Number of bytes to read. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.cache_read_size`. + /// + virtual uint32_t cacheReadSize(uint64_t _id) = 0; + + /// Read cached item. + /// + /// @param[in] _id Cache id. + /// @param[in] _data Buffer where to read data. + /// @param[in] _size Size of data to read. + /// + /// @returns True if data is read. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.cache_read`. + /// + virtual bool cacheRead(uint64_t _id, void* _data, uint32_t _size) = 0; + + /// Write cached item. + /// + /// @param[in] _id Cache id. + /// @param[in] _data Data to write. + /// @param[in] _size Size of data to write. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.cache_write`. + /// + virtual void cacheWrite(uint64_t _id, const void* _data, uint32_t _size) = 0; + + /// Screenshot captured. Screenshot format is always 4-byte BGRA. + /// + /// @param[in] _filePath File path. + /// @param[in] _width Image width. + /// @param[in] _height Image height. + /// @param[in] _pitch Number of bytes to skip between the start of + /// each horizontal line of the image. + /// @param[in] _data Image data. + /// @param[in] _size Image size. + /// @param[in] _yflip If true, image origin is bottom left. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.screen_shot`. + /// + virtual void screenShot( + const char* _filePath + , uint32_t _width + , uint32_t _height + , uint32_t _pitch + , const void* _data + , uint32_t _size + , bool _yflip + ) = 0; + + /// Called when a video capture begins. + /// + /// @param[in] _width Image width. + /// @param[in] _height Image height. + /// @param[in] _pitch Number of bytes to skip between the start of + /// each horizontal line of the image. + /// @param[in] _format Texture format. See: `TextureFormat::Enum`. + /// @param[in] _yflip If true, image origin is bottom left. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.capture_begin`. + /// + virtual void captureBegin( + uint32_t _width + , uint32_t _height + , uint32_t _pitch + , TextureFormat::Enum _format + , bool _yflip + ) = 0; + + /// Called when a video capture ends. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.capture_end`. + /// + virtual void captureEnd() = 0; + + /// Captured frame. + /// + /// @param[in] _data Image data. + /// @param[in] _size Image size. + /// + /// @attention C99's equivalent binding is `bgfx_callback_vtbl.capture_frame`. + /// + virtual void captureFrame(const void* _data, uint32_t _size) = 0; + }; + + inline CallbackI::~CallbackI() + { + } + +$funcptrs + +$cppdecl + +inline bool VertexLayout::has(Attrib::Enum _attrib) const { return UINT16_MAX != m_attributes[_attrib]; } + +inline uint16_t VertexLayout::getOffset(Attrib::Enum _attrib) const { return m_offset[_attrib]; } + +inline uint16_t VertexLayout::getStride() const { return m_stride; } + +inline uint32_t VertexLayout::getSize(uint32_t _num) const { return _num*m_stride; } + +} // namespace bgfx + +#endif // BGFX_H_HEADER_GUARD diff --git a/bgfx/scripts/temp.bgfx.idl.inl b/bgfx/scripts/temp.bgfx.idl.inl index 6cfa6034..0daee574 100644 --- a/bgfx/scripts/temp.bgfx.idl.inl +++ b/bgfx/scripts/temp.bgfx.idl.inl @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -13,7 +13,7 @@ */ #define BGFX_C99_ENUM_CHECK(_enum, _c99enumcount) \ - BX_STATIC_ASSERT(_enum::Count == _enum::Enum(_c99enumcount) ) + static_assert(_enum::Count == _enum::Enum(_c99enumcount) ) BGFX_C99_ENUM_CHECK(bgfx::Fatal, BGFX_FATAL_COUNT); BGFX_C99_ENUM_CHECK(bgfx::RendererType, BGFX_RENDERER_TYPE_COUNT); @@ -30,7 +30,7 @@ BGFX_C99_ENUM_CHECK(bgfx::RenderFrame, BGFX_RENDER_FRAME_COUNT); #undef BGFX_C99_ENUM_CHECK #define BGFX_C99_STRUCT_SIZE_CHECK(_cppstruct, _c99struct) \ - BX_STATIC_ASSERT(sizeof(_cppstruct) == sizeof(_c99struct) ) + static_assert(sizeof(_cppstruct) == sizeof(_c99struct) ) BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory, bgfx_memory_t); BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform, bgfx_transform_t); diff --git a/bgfx/scripts/temp.defines.h b/bgfx/scripts/temp.defines.h index a3b6b417..b1ea49c0 100644 --- a/bgfx/scripts/temp.defines.h +++ b/bgfx/scripts/temp.defines.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/scripts/texturec.lua b/bgfx/scripts/texturec.lua index 50d1ba53..4e403fad 100644 --- a/bgfx/scripts/texturec.lua +++ b/bgfx/scripts/texturec.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- @@ -23,6 +23,14 @@ project "texturec" "bimg", } + if _OPTIONS["with-libheif"] then + links { + "heif", + } + + configuration {} + end + using_bx() configuration { "mingw-*" } diff --git a/bgfx/scripts/texturev.lua b/bgfx/scripts/texturev.lua index 9cc003ec..ac9e0be3 100644 --- a/bgfx/scripts/texturev.lua +++ b/bgfx/scripts/texturev.lua @@ -1,4 +1,9 @@ -project ("texturev") +-- +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. +-- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE +-- + +project "texturev" uuid (os.uuid("texturev") ) kind "ConsoleApp" @@ -30,13 +35,6 @@ project ("texturev") defines { "ENTRY_CONFIG_USE_SDL=1" } links { "SDL2" } - configuration { "linux or freebsd" } - if _OPTIONS["with-wayland"] then - links { - "wayland-egl", - } - end - configuration { "x32", "windows" } libdirs { "$(SDL2_DIR)/lib/x86" } @@ -50,21 +48,6 @@ project ("texturev") defines { "ENTRY_CONFIG_USE_GLFW=1" } links { "glfw3" } - configuration { "linux or freebsd" } - if _OPTIONS["with-wayland"] then - links { - "wayland-egl", - } - else - links { - "Xrandr", - "Xinerama", - "Xi", - "Xxf86vm", - "Xcursor", - } - end - configuration { "osx*" } linkoptions { "-framework CoreVideo", @@ -73,6 +56,14 @@ project ("texturev") configuration {} end + if _OPTIONS["with-libheif"] then + links { + "heif", + } + + configuration {} + end + configuration { "vs*" } linkoptions { "/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll diff --git a/bgfx/scripts/tools.mk b/bgfx/scripts/tools.mk index 738bbfad..3be6cf0e 100644 --- a/bgfx/scripts/tools.mk +++ b/bgfx/scripts/tools.mk @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/src/amalgamated.cpp b/bgfx/src/amalgamated.cpp index a829512b..912a5ad2 100644 --- a/bgfx/src/amalgamated.cpp +++ b/bgfx/src/amalgamated.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -13,15 +13,12 @@ #include "renderer_agc.cpp" #include "renderer_d3d11.cpp" #include "renderer_d3d12.cpp" -#include "renderer_d3d9.cpp" #include "renderer_gl.cpp" #include "renderer_gnm.cpp" #include "renderer_noop.cpp" #include "renderer_nvn.cpp" #include "renderer_vk.cpp" -#include "renderer_webgpu.cpp" #include "shader.cpp" -#include "shader_dx9bc.cpp" #include "shader_dxbc.cpp" #include "shader_spirv.cpp" #include "topology.cpp" diff --git a/bgfx/src/amalgamated.mm b/bgfx/src/amalgamated.mm index a4d1cf59..bdbf0e10 100644 --- a/bgfx/src/amalgamated.mm +++ b/bgfx/src/amalgamated.mm @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/bgfx.cpp b/bgfx/src/bgfx.cpp index 9b70b9db..64090cb6 100644 --- a/bgfx/src/bgfx.cpp +++ b/bgfx/src/bgfx.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -12,7 +12,7 @@ #include "topology.h" -#if BX_PLATFORM_OSX || BX_PLATFORM_IOS +#if BX_PLATFORM_OSX || BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS # include #elif BX_PLATFORM_WINDOWS # ifndef WIN32_LEAN_AND_MEAN @@ -217,27 +217,30 @@ namespace bgfx } #endif // BGFX_CONFIG_MEMORY_TRACKING - return ::malloc(_size); + void* ptr = ::malloc(_size); + BX_ASSERT(NULL != ptr, "Out of memory!"); + + return ptr; } - return bx::alignedAlloc(this, _size, _align, bx::Location(_file, _line) ); + void* ptr = bx::alignedAlloc(this, _size, _align, bx::Location(_file, _line) ); + BX_ASSERT(NULL != ptr, "Out of memory!"); + + return ptr; } if (kNaturalAlignment >= _align) { -#if BGFX_CONFIG_MEMORY_TRACKING - if (NULL == _ptr) - { - bx::MutexScope scope(m_mutex); - ++m_numBlocks; - m_maxBlocks = bx::max(m_maxBlocks, m_numBlocks); - } -#endif // BGFX_CONFIG_MEMORY_TRACKING + void* ptr = ::realloc(_ptr, _size); + BX_ASSERT(NULL != ptr, "Out of memory!"); - return ::realloc(_ptr, _size); + return ptr; } - return bx::alignedRealloc(this, _ptr, _size, _align, bx::Location(_file, _line) ); + void* ptr = bx::alignedRealloc(this, _ptr, _size, _align, bx::Location(_file, _line) ); + BX_ASSERT(NULL != ptr, "Out of memory!"); + + return ptr; } void checkLeaks(); @@ -327,7 +330,7 @@ namespace bgfx { "VL", "VertexLayout" }, { "?", "?" }, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_typeName) == Handle::Count+1, ""); + static_assert(BX_COUNTOF(s_typeName) == Handle::Count+1, ""); const Handle::TypeName& Handle::getTypeName(Handle::Enum _enum) { @@ -745,7 +748,7 @@ namespace bgfx 0xff4fe9fc, // Yellow 0xffeceeee, // White }; - BX_STATIC_ASSERT(BX_COUNTOF(s_paletteSrgb) == 16); + static_assert(BX_COUNTOF(s_paletteSrgb) == 16); static const uint32_t s_paletteLinear[] = { @@ -766,7 +769,7 @@ namespace bgfx 0xff13cff8, // Yellow 0xffd5dada // White }; - BX_STATIC_ASSERT(BX_COUNTOF(s_paletteLinear) == 16); + static_assert(BX_COUNTOF(s_paletteLinear) == 16); void blit(RendererContextI* _renderCtx, TextVideoMemBlitter& _blitter, const TextVideoMem& _mem) { @@ -784,14 +787,12 @@ namespace bgfx uint32_t yy = 0; uint32_t xx = 0; - const float texelWidth = 1.0f/2048.0f; - const float texelWidthHalf = RendererType::Direct3D9 == g_caps.rendererType ? 0.0f : texelWidth*0.5f; - const float texelHeight = 1.0f/24.0f; - const float texelHeightHalf = RendererType::Direct3D9 == g_caps.rendererType ? texelHeight*0.5f : 0.0f; - const float utop = (_mem.m_small ? 0.0f : 8.0f)*texelHeight + texelHeightHalf; - const float ubottom = (_mem.m_small ? 8.0f : 24.0f)*texelHeight + texelHeightHalf; - const float fontHeight = (_mem.m_small ? 8.0f : 16.0f)*_blitter.m_scale; - const float fontWidth = 8.0f * _blitter.m_scale; + const float texelWidth = 1.0f/2048.0f; + const float texelHeight = 1.0f/24.0f; + const float utop = (_mem.m_small ? 0.0f : 8.0f)*texelHeight; + const float ubottom = (_mem.m_small ? 8.0f : 24.0f)*texelHeight; + const float fontHeight = (_mem.m_small ? 8.0f : 16.0f)*_blitter.m_scale; + const float fontWidth = 8.0f * _blitter.m_scale; _renderCtx->blitSetup(_blitter); @@ -830,10 +831,10 @@ namespace bgfx Vertex vert[4] = { - { (xx )*fontWidth, (yy )*fontHeight, 0.0f, fg, bg, (ch )*8.0f*texelWidth - texelWidthHalf, utop }, - { (xx+1)*fontWidth, (yy )*fontHeight, 0.0f, fg, bg, (ch+1)*8.0f*texelWidth - texelWidthHalf, utop }, - { (xx+1)*fontWidth, (yy+1)*fontHeight, 0.0f, fg, bg, (ch+1)*8.0f*texelWidth - texelWidthHalf, ubottom }, - { (xx )*fontWidth, (yy+1)*fontHeight, 0.0f, fg, bg, (ch )*8.0f*texelWidth - texelWidthHalf, ubottom }, + { (xx )*fontWidth, (yy )*fontHeight, 0.0f, fg, bg, (ch )*8.0f*texelWidth, utop }, + { (xx+1)*fontWidth, (yy )*fontHeight, 0.0f, fg, bg, (ch+1)*8.0f*texelWidth, utop }, + { (xx+1)*fontWidth, (yy+1)*fontHeight, 0.0f, fg, bg, (ch+1)*8.0f*texelWidth, ubottom }, + { (xx )*fontWidth, (yy+1)*fontHeight, 0.0f, fg, bg, (ch )*8.0f*texelWidth, ubottom }, }; bx::memCopy(vertex, vert, sizeof(vert) ); @@ -947,7 +948,7 @@ namespace bgfx "mat3", "mat4", }; - BX_STATIC_ASSERT(UniformType::Count == BX_COUNTOF(s_uniformTypeName) ); + static_assert(UniformType::Count == BX_COUNTOF(s_uniformTypeName) ); const char* getUniformTypeName(UniformType::Enum _enum) { @@ -1324,10 +1325,8 @@ namespace bgfx m_draw.clear(_flags); m_bind.clear(_flags); - if (_flags & BGFX_DISCARD_STATE) - { - m_uniformBegin = m_uniformEnd; - } + + m_uniformBegin = m_uniformEnd; } void EncoderImpl::dispatch(ViewId _id, ProgramHandle _handle, uint32_t _numX, uint32_t _numY, uint32_t _numZ, uint8_t _flags) @@ -1516,24 +1515,26 @@ namespace bgfx void UniformBuffer::writeUniform(UniformType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num) { - uint32_t opcode = encodeOpcode(_type, _loc, _num, true); + const uint32_t opcode = encodeOpcode(_type, _loc, _num, true); write(opcode); write(_value, g_uniformTypeSize[_type]*_num); } void UniformBuffer::writeUniformHandle(UniformType::Enum _type, uint16_t _loc, UniformHandle _handle, uint16_t _num) { - uint32_t opcode = encodeOpcode(_type, _loc, _num, false); + const uint32_t opcode = encodeOpcode(_type, _loc, _num, false); write(opcode); write(&_handle, sizeof(UniformHandle) ); } - void UniformBuffer::writeMarker(const char* _marker) + void UniformBuffer::writeMarker(const bx::StringView& _name) { - uint16_t num = (uint16_t)bx::strLen(_marker)+1; - uint32_t opcode = encodeOpcode(bgfx::UniformType::Count, 0, num, true); + const uint16_t num = bx::narrowCast(_name.getLength()+1); + const uint32_t opcode = encodeOpcode(bgfx::UniformType::Count, 0, num, true); write(opcode); - write(_marker, num); + write(_name.getPtr(), num-1); + const char zero = '\0'; + write(&zero, 1); } struct CapsFlags @@ -1823,7 +1824,7 @@ namespace bgfx "LineStrip", "Points", }; - BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_topologyName) ); + static_assert(Topology::Count == BX_COUNTOF(s_topologyName) ); const char* getName(Topology::Enum _topology) { @@ -2422,7 +2423,7 @@ namespace bgfx } } -#if BX_PLATFORM_OSX || BX_PLATFORM_IOS +#if BX_PLATFORM_OSX || BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS struct NSAutoreleasePoolScope { NSAutoreleasePoolScope() @@ -2446,7 +2447,7 @@ namespace bgfx { BGFX_PROFILER_SCOPE("bgfx::renderFrame", 0xff2040ff); -#if BX_PLATFORM_OSX || BX_PLATFORM_IOS +#if BX_PLATFORM_OSX || BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS NSAutoreleasePoolScope pool; #endif // BX_PLATFORM_OSX @@ -2523,8 +2524,9 @@ namespace bgfx uint16_t copy; UniformBuffer::decodeOpcode(opcode, type, loc, num, copy); - uint32_t size = g_uniformTypeSize[type]*num; + const uint32_t size = g_uniformTypeSize[type]*num; const char* data = _uniformBuffer->read(size); + if (UniformType::Count > type) { if (copy) @@ -2545,6 +2547,7 @@ namespace bgfx void Context::flushTextureUpdateBatch(CommandBuffer& _cmdbuf) { + BGFX_PROFILER_SCOPE("flushTextureUpdateBatch", 0xff2040ff); if (m_textureUpdateBatch.sort() ) { const uint32_t pos = _cmdbuf.m_pos; @@ -2618,7 +2621,6 @@ namespace bgfx BGFX_RENDERER_CONTEXT(noop); BGFX_RENDERER_CONTEXT(agc); - BGFX_RENDERER_CONTEXT(d3d9); BGFX_RENDERER_CONTEXT(d3d11); BGFX_RENDERER_CONTEXT(d3d12); BGFX_RENDERER_CONTEXT(gnm); @@ -2626,7 +2628,6 @@ namespace bgfx BGFX_RENDERER_CONTEXT(nvn); BGFX_RENDERER_CONTEXT(gl); BGFX_RENDERER_CONTEXT(vk); - BGFX_RENDERER_CONTEXT(webgpu); #undef BGFX_RENDERER_CONTEXT @@ -2642,47 +2643,59 @@ namespace bgfx { { noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NOOP_NAME, true }, // Noop { agc::rendererCreate, agc::rendererDestroy, BGFX_RENDERER_AGC_NAME, !!BGFX_CONFIG_RENDERER_AGC }, // GNM - { d3d9::rendererCreate, d3d9::rendererDestroy, BGFX_RENDERER_DIRECT3D9_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D9 }, // Direct3D9 { d3d11::rendererCreate, d3d11::rendererDestroy, BGFX_RENDERER_DIRECT3D11_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D11 }, // Direct3D11 { d3d12::rendererCreate, d3d12::rendererDestroy, BGFX_RENDERER_DIRECT3D12_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D12 }, // Direct3D12 { gnm::rendererCreate, gnm::rendererDestroy, BGFX_RENDERER_GNM_NAME, !!BGFX_CONFIG_RENDERER_GNM }, // GNM -#if BX_PLATFORM_OSX || BX_PLATFORM_IOS +#if BX_PLATFORM_OSX || BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS { mtl::rendererCreate, mtl::rendererDestroy, BGFX_RENDERER_METAL_NAME, !!BGFX_CONFIG_RENDERER_METAL }, // Metal #else { noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NOOP_NAME, false }, // Noop -#endif // BX_PLATFORM_OSX || BX_PLATFORM_IOS +#endif // BX_PLATFORM_OSX || BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS { nvn::rendererCreate, nvn::rendererDestroy, BGFX_RENDERER_NVN_NAME, !!BGFX_CONFIG_RENDERER_NVN }, // NVN { gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGLES }, // OpenGLES { gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGL }, // OpenGL { vk::rendererCreate, vk::rendererDestroy, BGFX_RENDERER_VULKAN_NAME, !!BGFX_CONFIG_RENDERER_VULKAN }, // Vulkan - { webgpu::rendererCreate, webgpu::rendererDestroy, BGFX_RENDERER_WEBGPU_NAME, !!BGFX_CONFIG_RENDERER_WEBGPU }, // WebGPU }; - BX_STATIC_ASSERT(BX_COUNTOF(s_rendererCreator) == RendererType::Count); + static_assert(BX_COUNTOF(s_rendererCreator) == RendererType::Count); - bool windowsVersionIs(Condition::Enum _op, uint32_t _version) + bool windowsVersionIs(Condition::Enum _op, uint32_t _version, uint32_t _build) { #if BX_PLATFORM_WINDOWS - static const uint8_t s_condition[] = - { - VER_LESS_EQUAL, - VER_GREATER_EQUAL, - }; - - OSVERSIONINFOEXA ovi; - bx::memSet(&ovi, 0, sizeof(ovi) ); + RTL_OSVERSIONINFOW ovi; + bx::memSet(&ovi, 0 , sizeof(ovi)); ovi.dwOSVersionInfoSize = sizeof(ovi); + const HMODULE hMod = GetModuleHandleW(L"ntdll.dll"); + if (NULL != hMod) + { + FARPROC (WINAPI* rtlGetVersionPtr) (PRTL_OSVERSIONINFOW) = reinterpret_cast(bx::dlsym(hMod, "RtlGetVersion")); + if (NULL != rtlGetVersionPtr) + { + rtlGetVersionPtr(&ovi); + if (ovi.dwMajorVersion == 0) + { + return false; + } + ovi.dwBuildNumber = UINT32_MAX == _build ? UINT32_MAX : ovi.dwBuildNumber; + } + } + // _WIN32_WINNT_WIN10 0x0A00 // _WIN32_WINNT_WINBLUE 0x0603 // _WIN32_WINNT_WIN8 0x0602 // _WIN32_WINNT_WIN7 0x0601 // _WIN32_WINNT_VISTA 0x0600 - ovi.dwMajorVersion = HIBYTE(_version); - ovi.dwMinorVersion = LOBYTE(_version); - DWORDLONG cond = 0; - VER_SET_CONDITION(cond, VER_MAJORVERSION, s_condition[_op]); - VER_SET_CONDITION(cond, VER_MINORVERSION, s_condition[_op]); - return !!VerifyVersionInfoA(&ovi, VER_MAJORVERSION | VER_MINORVERSION, cond); + const DWORD cMajorVersion = HIBYTE(_version); + const DWORD cMinorVersion = LOBYTE(_version); + switch (_op) + { + case Condition::LessEqual: + return (ovi.dwMajorVersion < cMajorVersion || (ovi.dwMajorVersion == cMajorVersion && ovi.dwMinorVersion <= cMinorVersion)) && ovi.dwBuildNumber <= _build; + case Condition::GreaterEqual: + return (ovi.dwMajorVersion > cMajorVersion || (ovi.dwMajorVersion == cMajorVersion && ovi.dwMinorVersion >= cMinorVersion)) && ovi.dwBuildNumber >= _build; + default: + return false; + } #else - BX_UNUSED(_op, _version); + BX_UNUSED(_op, _version, _build); return false; #endif // BX_PLATFORM_WINDOWS } @@ -2715,7 +2728,6 @@ namespace bgfx else if (windowsVersionIs(Condition::GreaterEqual, 0x0601) ) { score += RendererType::Direct3D11 == renderer ? 20 : 0; - score += RendererType::Direct3D9 == renderer ? 10 : 0; score += RendererType::Direct3D12 == renderer ? -100 : 0; } else @@ -2730,17 +2742,15 @@ namespace bgfx score += RendererType::OpenGLES == renderer ? 30 : 0; score += RendererType::Direct3D12 == renderer ? 20 : 0; score += RendererType::Direct3D11 == renderer ? 10 : 0; - score += RendererType::Direct3D9 == renderer ? 5 : 0; } else if (BX_ENABLED(BX_PLATFORM_OSX) ) { score += RendererType::Metal == renderer ? 20 : 0; - score += RendererType::OpenGL == renderer ? 10 : 0; + score += RendererType::Vulkan == renderer ? 10 : 0; } - else if (BX_ENABLED(BX_PLATFORM_IOS) ) + else if (BX_ENABLED(BX_PLATFORM_IOS) || BX_ENABLED(BX_PLATFORM_VISIONOS)) { score += RendererType::Metal == renderer ? 20 : 0; - score += RendererType::OpenGLES == renderer ? 10 : 0; } else if (BX_ENABLED(0 || BX_PLATFORM_ANDROID @@ -2864,7 +2874,7 @@ namespace bgfx m_exit = true; } - BX_FALLTHROUGH; + [[fallthrough]]; case CommandBuffer::End: end = true; @@ -3581,7 +3591,7 @@ namespace bgfx case ErrorState::ContextAllocated: bx::deleteObject(g_allocator, s_ctx, Context::kAlignment); s_ctx = NULL; - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::Default: if (NULL != s_callbackStub) @@ -3656,9 +3666,9 @@ namespace bgfx #define BGFX_ENCODER(_func) reinterpret_cast(this)->_func - void Encoder::setMarker(const char* _marker) + void Encoder::setMarker(const char* _name, int32_t _len) { - BGFX_ENCODER(setMarker(_marker) ); + BGFX_ENCODER(setMarker(bx::StringView(_name, _len) ) ); } void Encoder::setState(uint64_t _state, uint32_t _rgba) @@ -3887,7 +3897,7 @@ namespace bgfx BGFX_ENCODER(submit(_id, _program, _occlusionQuery, _depth, _flags) ); } - void Encoder::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, uint32_t _depth, uint8_t _flags) + void Encoder::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, uint32_t _num, uint32_t _depth, uint8_t _flags) { BGFX_CHECK_HANDLE_INVALID_OK("submit", s_ctx->m_programHandle, _program); BGFX_CHECK_HANDLE("submit", s_ctx->m_vertexBufferHandle, _indirectHandle); @@ -3895,7 +3905,7 @@ namespace bgfx BGFX_ENCODER(submit(_id, _program, _indirectHandle, _start, _num, _depth, _flags) ); } - void Encoder::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags) + void Encoder::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags) { BGFX_CHECK_HANDLE_INVALID_OK("submit", s_ctx->m_programHandle, _program); BGFX_CHECK_HANDLE("submit", s_ctx->m_vertexBufferHandle, _indirectHandle); @@ -3976,7 +3986,7 @@ namespace bgfx BGFX_ENCODER(dispatch(_id, _program, _numX, _numY, _numZ, _flags) ); } - void Encoder::dispatch(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags) + void Encoder::dispatch(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, uint32_t _num, uint8_t _flags) { BGFX_CHECK_CAPS(BGFX_CAPS_DRAW_INDIRECT, "Dispatch indirect is not supported!"); BGFX_CHECK_CAPS(BGFX_CAPS_COMPUTE, "Compute is not supported!"); @@ -5210,10 +5220,10 @@ namespace bgfx return id < BGFX_CONFIG_MAX_VIEWS; } - void setViewName(ViewId _id, const char* _name) + void setViewName(ViewId _id, const char* _name, int32_t _len) { BX_ASSERT(checkView(_id), "Invalid view id: %d", _id); - s_ctx->setViewName(_id, _name); + s_ctx->setViewName(_id, bx::StringView(_name, _len) ); } void setViewRect(ViewId _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height) @@ -5285,10 +5295,10 @@ namespace bgfx BGFX_FATAL(NULL != s_ctx->m_encoder0, Fatal::DebugCheck \ , "bgfx is configured to allow only encoder API. See: `BGFX_CONFIG_ENCODER_API_ONLY`.") - void setMarker(const char* _marker) + void setMarker(const char* _name, int32_t _len) { BGFX_CHECK_ENCODER0(); - s_ctx->m_encoder0->setMarker(_marker); + s_ctx->m_encoder0->setMarker(_name, _len); } void setState(uint64_t _state, uint32_t _rgba) @@ -5495,13 +5505,13 @@ namespace bgfx s_ctx->m_encoder0->submit(_id, _program, _occlusionQuery, _depth, _flags); } - void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, uint32_t _depth, uint8_t _flags) + void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, uint32_t _num, uint32_t _depth, uint8_t _flags) { BGFX_CHECK_ENCODER0(); s_ctx->m_encoder0->submit(_id, _program, _indirectHandle, _start, _num, _depth, _flags); } - void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags) + void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags) { BGFX_CHECK_ENCODER0(); s_ctx->m_encoder0->submit(_id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags); @@ -5549,7 +5559,7 @@ namespace bgfx s_ctx->m_encoder0->dispatch(_id, _handle, _numX, _numY, _numZ, _flags); } - void dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags) + void dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint32_t _start, uint32_t _num, uint8_t _flags) { BGFX_CHECK_ENCODER0(); s_ctx->m_encoder0->dispatch(_id, _handle, _indirectHandle, _start, _num, _flags); @@ -5602,7 +5612,7 @@ extern "C" #endif // BGFX_CONFIG_PREFER_DISCRETE_GPU #define BGFX_TEXTURE_FORMAT_BIMG(_fmt) \ - BX_STATIC_ASSERT(uint32_t(bgfx::TextureFormat::_fmt) == uint32_t(bimg::TextureFormat::_fmt) ) + static_assert(uint32_t(bgfx::TextureFormat::_fmt) == uint32_t(bimg::TextureFormat::_fmt) ) BGFX_TEXTURE_FORMAT_BIMG(BC1); BGFX_TEXTURE_FORMAT_BIMG(BC2); @@ -5708,29 +5718,29 @@ BGFX_TEXTURE_FORMAT_BIMG(Count); #define FLAGS_MASK_TEST(_flags, _mask) ( (_flags) == ( (_flags) & (_mask) ) ) -BX_STATIC_ASSERT(FLAGS_MASK_TEST(0 +static_assert(FLAGS_MASK_TEST(0 | BGFX_SAMPLER_INTERNAL_DEFAULT | BGFX_SAMPLER_INTERNAL_SHARED , BGFX_SAMPLER_RESERVED_MASK ) ); -BX_STATIC_ASSERT(FLAGS_MASK_TEST(0 +static_assert(FLAGS_MASK_TEST(0 | BGFX_RESET_INTERNAL_FORCE , BGFX_RESET_RESERVED_MASK ) ); -BX_STATIC_ASSERT(FLAGS_MASK_TEST(0 +static_assert(FLAGS_MASK_TEST(0 | BGFX_STATE_INTERNAL_SCISSOR | BGFX_STATE_INTERNAL_OCCLUSION_QUERY , BGFX_STATE_RESERVED_MASK ) ); -BX_STATIC_ASSERT(FLAGS_MASK_TEST(0 +static_assert(FLAGS_MASK_TEST(0 | BGFX_SUBMIT_INTERNAL_OCCLUSION_VISIBLE , BGFX_SUBMIT_INTERNAL_RESERVED_MASK ) ); -BX_STATIC_ASSERT( (0 +static_assert( (0 | BGFX_STATE_ALPHA_REF_MASK | BGFX_STATE_BLEND_ALPHA_TO_COVERAGE | BGFX_STATE_BLEND_EQUATION_MASK @@ -5764,9 +5774,9 @@ BX_STATIC_ASSERT( (0 ^ BGFX_STATE_WRITE_MASK ) ); -BX_STATIC_ASSERT(FLAGS_MASK_TEST(BGFX_CAPS_TEXTURE_COMPARE_LEQUAL, BGFX_CAPS_TEXTURE_COMPARE_ALL) ); +static_assert(FLAGS_MASK_TEST(BGFX_CAPS_TEXTURE_COMPARE_LEQUAL, BGFX_CAPS_TEXTURE_COMPARE_ALL) ); -BX_STATIC_ASSERT( (0 +static_assert( (0 | BGFX_CAPS_ALPHA_TO_COVERAGE | BGFX_CAPS_BLEND_INDEPENDENT | BGFX_CAPS_COMPUTE diff --git a/bgfx/src/bgfx.idl.inl b/bgfx/src/bgfx.idl.inl index 704f51d6..d6f46038 100644 --- a/bgfx/src/bgfx.idl.inl +++ b/bgfx/src/bgfx.idl.inl @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -13,7 +13,7 @@ */ #define BGFX_C99_ENUM_CHECK(_enum, _c99enumcount) \ - BX_STATIC_ASSERT(_enum::Count == _enum::Enum(_c99enumcount) ) + static_assert(_enum::Count == _enum::Enum(_c99enumcount) ) BGFX_C99_ENUM_CHECK(bgfx::Fatal, BGFX_FATAL_COUNT); BGFX_C99_ENUM_CHECK(bgfx::RendererType, BGFX_RENDERER_TYPE_COUNT); @@ -30,7 +30,7 @@ BGFX_C99_ENUM_CHECK(bgfx::RenderFrame, BGFX_RENDER_FRAME_COUNT); #undef BGFX_C99_ENUM_CHECK #define BGFX_C99_STRUCT_SIZE_CHECK(_cppstruct, _c99struct) \ - BX_STATIC_ASSERT(sizeof(_cppstruct) == sizeof(_c99struct) ) + static_assert(sizeof(_cppstruct) == sizeof(_c99struct) ) BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory, bgfx_memory_t); BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform, bgfx_transform_t); @@ -95,6 +95,24 @@ BGFX_C_API void bgfx_vertex_layout_end(bgfx_vertex_layout_t* _this) This->end(); } +BGFX_C_API uint16_t bgfx_vertex_layout_get_offset(const bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib) +{ + const bgfx::VertexLayout* This = (const bgfx::VertexLayout*)_this; + return This->getOffset((bgfx::Attrib::Enum)_attrib); +} + +BGFX_C_API uint16_t bgfx_vertex_layout_get_stride(const bgfx_vertex_layout_t* _this) +{ + const bgfx::VertexLayout* This = (const bgfx::VertexLayout*)_this; + return This->getStride(); +} + +BGFX_C_API uint32_t bgfx_vertex_layout_get_size(const bgfx_vertex_layout_t* _this, uint32_t _num) +{ + const bgfx::VertexLayout* This = (const bgfx::VertexLayout*)_this; + return This->getSize(_num); +} + BGFX_C_API void bgfx_vertex_pack(const float _input[4], bool _inputNormalized, bgfx_attrib_t _attr, const bgfx_vertex_layout_t * _layout, void* _data, uint32_t _index) { const bgfx::VertexLayout & layout = *(const bgfx::VertexLayout *)_layout; @@ -620,14 +638,19 @@ BGFX_C_API void bgfx_set_palette_color(uint8_t _index, const float _rgba[4]) bgfx::setPaletteColor(_index, _rgba); } +BGFX_C_API void bgfx_set_palette_color_rgba32f(uint8_t _index, float _r, float _g, float _b, float _a) +{ + bgfx::setPaletteColor(_index, _r, _g, _b, _a); +} + BGFX_C_API void bgfx_set_palette_color_rgba8(uint8_t _index, uint32_t _rgba) { bgfx::setPaletteColor(_index, _rgba); } -BGFX_C_API void bgfx_set_view_name(bgfx_view_id_t _id, const char* _name) +BGFX_C_API void bgfx_set_view_name(bgfx_view_id_t _id, const char* _name, int32_t _len) { - bgfx::setViewName((bgfx::ViewId)_id, _name); + bgfx::setViewName((bgfx::ViewId)_id, _name, _len); } BGFX_C_API void bgfx_set_view_rect(bgfx_view_id_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height) @@ -691,10 +714,10 @@ BGFX_C_API void bgfx_encoder_end(bgfx_encoder_t* _encoder) bgfx::end((bgfx::Encoder*)_encoder); } -BGFX_C_API void bgfx_encoder_set_marker(bgfx_encoder_t* _this, const char* _marker) +BGFX_C_API void bgfx_encoder_set_marker(bgfx_encoder_t* _this, const char* _name, int32_t _len) { bgfx::Encoder* This = (bgfx::Encoder*)_this; - This->setMarker(_marker); + This->setMarker(_name, _len); } BGFX_C_API void bgfx_encoder_set_state(bgfx_encoder_t* _this, uint64_t _state, uint32_t _rgba) @@ -877,7 +900,7 @@ BGFX_C_API void bgfx_encoder_submit_occlusion_query(bgfx_encoder_t* _this, bgfx_ This->submit((bgfx::ViewId)_id, program.cpp, occlusionQuery.cpp, _depth, _flags); } -BGFX_C_API void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint32_t _depth, uint8_t _flags) +BGFX_C_API void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, uint32_t _num, uint32_t _depth, uint8_t _flags) { bgfx::Encoder* This = (bgfx::Encoder*)_this; union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program }; @@ -885,7 +908,7 @@ BGFX_C_API void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id This->submit((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, _num, _depth, _flags); } -BGFX_C_API void bgfx_encoder_submit_indirect_count(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags) +BGFX_C_API void bgfx_encoder_submit_indirect_count(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags) { bgfx::Encoder* This = (bgfx::Encoder*)_this; union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program }; @@ -943,7 +966,7 @@ BGFX_C_API void bgfx_encoder_dispatch(bgfx_encoder_t* _this, bgfx_view_id_t _id, This->dispatch((bgfx::ViewId)_id, program.cpp, _numX, _numY, _numZ, _flags); } -BGFX_C_API void bgfx_encoder_dispatch_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags) +BGFX_C_API void bgfx_encoder_dispatch_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, uint32_t _num, uint8_t _flags) { bgfx::Encoder* This = (bgfx::Encoder*)_this; union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program }; @@ -999,9 +1022,9 @@ BGFX_C_API uintptr_t bgfx_override_internal_texture(bgfx_texture_handle_t _handl return bgfx::overrideInternal(handle.cpp, _width, _height, _numMips, (bgfx::TextureFormat::Enum)_format, _flags); } -BGFX_C_API void bgfx_set_marker(const char* _marker) +BGFX_C_API void bgfx_set_marker(const char* _name, int32_t _len) { - bgfx::setMarker(_marker); + bgfx::setMarker(_name, _len); } BGFX_C_API void bgfx_set_state(uint64_t _state, uint32_t _rgba) @@ -1157,14 +1180,14 @@ BGFX_C_API void bgfx_submit_occlusion_query(bgfx_view_id_t _id, bgfx_program_han bgfx::submit((bgfx::ViewId)_id, program.cpp, occlusionQuery.cpp, _depth, _flags); } -BGFX_C_API void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint32_t _depth, uint8_t _flags) +BGFX_C_API void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, uint32_t _num, uint32_t _depth, uint8_t _flags) { union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program }; union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } indirectHandle = { _indirectHandle }; bgfx::submit((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, _num, _depth, _flags); } -BGFX_C_API void bgfx_submit_indirect_count(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags) +BGFX_C_API void bgfx_submit_indirect_count(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags) { union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program }; union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } indirectHandle = { _indirectHandle }; @@ -1214,7 +1237,7 @@ BGFX_C_API void bgfx_dispatch(bgfx_view_id_t _id, bgfx_program_handle_t _program bgfx::dispatch((bgfx::ViewId)_id, program.cpp, _numX, _numY, _numZ, _flags); } -BGFX_C_API void bgfx_dispatch_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags) +BGFX_C_API void bgfx_dispatch_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, uint32_t _num, uint8_t _flags) { union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program }; union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } indirectHandle = { _indirectHandle }; @@ -1280,6 +1303,9 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version) bgfx_vertex_layout_has, bgfx_vertex_layout_skip, bgfx_vertex_layout_end, + bgfx_vertex_layout_get_offset, + bgfx_vertex_layout_get_stride, + bgfx_vertex_layout_get_size, bgfx_vertex_pack, bgfx_vertex_unpack, bgfx_vertex_convert, @@ -1367,6 +1393,7 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version) bgfx_get_result, bgfx_destroy_occlusion_query, bgfx_set_palette_color, + bgfx_set_palette_color_rgba32f, bgfx_set_palette_color_rgba8, bgfx_set_view_name, bgfx_set_view_rect, diff --git a/bgfx/src/bgfx_compute.sh b/bgfx/src/bgfx_compute.sh index c23361f1..bfe787cf 100644 --- a/bgfx/src/bgfx_compute.sh +++ b/bgfx/src/bgfx_compute.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -32,22 +32,22 @@ #define readwrite #define IMAGE2D_RO( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2D, readonly) #define UIMAGE2D_RO(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2D, readonly) -#define IMAGE2D_WR( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2D, writeonly) -#define UIMAGE2D_WR(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2D, writeonly) +#define IMAGE2D_WO( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2D, writeonly) +#define UIMAGE2D_WO(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2D, writeonly) #define IMAGE2D_RW( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2D, readwrite) #define UIMAGE2D_RW(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2D, readwrite) #define IMAGE2D_ARRAY_RO( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2DArray, readonly) #define UIMAGE2D_ARRAY_RO(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2DArray, readonly) -#define IMAGE2D_ARRAY_WR( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2DArray, writeonly) -#define UIMAGE2D_ARRAY_WR(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2DArray, writeonly) +#define IMAGE2D_ARRAY_WO( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2DArray, writeonly) +#define UIMAGE2D_ARRAY_WO(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2DArray, writeonly) #define IMAGE2D_ARRAY_RW( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2DArray, readwrite) #define UIMAGE2D_ARRAY_RW(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2DArray, readwrite) #define IMAGE3D_RO( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image3D, readonly) #define UIMAGE3D_RO(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage3D, readonly) -#define IMAGE3D_WR( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image3D, writeonly) -#define UIMAGE3D_WR(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage3D, writeonly) +#define IMAGE3D_WO( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image3D, writeonly) +#define UIMAGE3D_WO(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage3D, writeonly) #define IMAGE3D_RW( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image3D, readwrite) #define UIMAGE3D_RW(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage3D, readwrite) @@ -59,7 +59,7 @@ #define BUFFER_RO(_name, _type, _reg) __BUFFER_XX(_name, _type, _reg, readonly) #define BUFFER_RW(_name, _type, _reg) __BUFFER_XX(_name, _type, _reg, readwrite) -#define BUFFER_WR(_name, _type, _reg) __BUFFER_XX(_name, _type, _reg, writeonly) +#define BUFFER_WO(_name, _type, _reg) __BUFFER_XX(_name, _type, _reg, writeonly) #define NUM_THREADS(_x, _y, _z) layout (local_size_x = _x, local_size_y = _y, local_size_z = _z) in; @@ -99,10 +99,10 @@ #define UIMAGE2D_RO(_name, _format, _reg) IMAGE2D_RO(_name, _format, _reg) -#define IMAGE2D_WR( _name, _format, _reg) \ +#define IMAGE2D_WO( _name, _format, _reg) \ WRITEONLY FORMAT(_format) RWTexture2D _name : REGISTER(u, _reg); \ - -#define UIMAGE2D_WR(_name, _format, _reg) IMAGE2D_WR(_name, _format, _reg) + +#define UIMAGE2D_WO(_name, _format, _reg) IMAGE2D_WO(_name, _format, _reg) #define IMAGE2D_RW( _name, _format, _reg) \ FORMAT(_format) RWTexture2D _name : REGISTER(u, _reg); \ @@ -114,10 +114,10 @@ #define UIMAGE2D_ARRAY_RO(_name, _format, _reg) IMAGE2D_ARRAY_RO(_name, _format, _reg) -#define IMAGE2D_ARRAY_WR( _name, _format, _reg) \ +#define IMAGE2D_ARRAY_WO( _name, _format, _reg) \ WRITEONLY FORMAT(_format) RWTexture2DArray _name : REGISTER(u, _reg); \ -#define UIMAGE2D_ARRAY_WR(_name, _format, _reg) IMAGE2D_ARRAY_WR(_name, _format, _reg) +#define UIMAGE2D_ARRAY_WO(_name, _format, _reg) IMAGE2D_ARRAY_WO(_name, _format, _reg) #define IMAGE2D_ARRAY_RW(_name, _format, _reg) \ FORMAT(_format) RWTexture2DArray _name : REGISTER(u, _reg); \ @@ -129,10 +129,10 @@ #define UIMAGE3D_RO(_name, _format, _reg) IMAGE3D_RO(_name, _format, _reg) -#define IMAGE3D_WR( _name, _format, _reg) \ +#define IMAGE3D_WO( _name, _format, _reg) \ WRITEONLY FORMAT(_format) RWTexture3D _name : REGISTER(u, _reg); -#define UIMAGE3D_WR(_name, _format, _reg) IMAGE3D_RW(_name, _format, _reg) +#define UIMAGE3D_WO(_name, _format, _reg) IMAGE3D_RW(_name, _format, _reg) #define IMAGE3D_RW( _name, _format, _reg) \ FORMAT(_format) RWTexture3D _name : REGISTER(u, _reg); \ @@ -142,11 +142,11 @@ #if BGFX_SHADER_LANGUAGE_METAL || BGFX_SHADER_LANGUAGE_SPIRV #define BUFFER_RO(_name, _struct, _reg) StructuredBuffer<_struct> _name : REGISTER(t, _reg) #define BUFFER_RW(_name, _struct, _reg) RWStructuredBuffer <_struct> _name : REGISTER(u, _reg) -#define BUFFER_WR(_name, _struct, _reg) BUFFER_RW(_name, _struct, _reg) +#define BUFFER_WO(_name, _struct, _reg) BUFFER_RW(_name, _struct, _reg) #else #define BUFFER_RO(_name, _struct, _reg) Buffer<_struct> _name : REGISTER(t, _reg) #define BUFFER_RW(_name, _struct, _reg) RWBuffer<_struct> _name : REGISTER(u, _reg) -#define BUFFER_WR(_name, _struct, _reg) BUFFER_RW(_name, _struct, _reg) +#define BUFFER_WO(_name, _struct, _reg) BUFFER_RW(_name, _struct, _reg) #endif #define NUM_THREADS(_x, _y, _z) [numthreads(_x, _y, _z)] diff --git a/bgfx/src/bgfx_p.h b/bgfx/src/bgfx_p.h index a6ae7ed0..c07bf9ef 100644 --- a/bgfx/src/bgfx_p.h +++ b/bgfx/src/bgfx_p.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -92,13 +92,13 @@ namespace bgfx } \ BX_MACRO_BLOCK_END -#define _BGFX_ASSERT(_condition, _format, ...) \ - BX_MACRO_BLOCK_BEGIN \ - if (!BX_IGNORE_C4127(_condition) ) \ - { \ - BX_TRACE("ASSERT " _format, ##__VA_ARGS__); \ - bgfx::fatal(__FILE__, uint16_t(__LINE__), bgfx::Fatal::DebugCheck, _format, ##__VA_ARGS__); \ - } \ +#define _BGFX_ASSERT(_condition, _format, ...) \ + BX_MACRO_BLOCK_BEGIN \ + if (!BX_IGNORE_C4127(_condition) \ + && bx::assertFunction(bx::Location::current(), "ASSERT " #_condition " -> " _format, ##__VA_ARGS__) ) \ + { \ + bgfx::fatal(__FILE__, uint16_t(__LINE__), bgfx::Fatal::DebugCheck, _format, ##__VA_ARGS__); \ + } \ BX_MACRO_BLOCK_END #define BGFX_FATAL(_condition, _err, _format, ...) \ @@ -236,14 +236,12 @@ namespace stl = std; #define BGFX_RENDERER_NOOP_NAME "Noop" #define BGFX_RENDERER_AGC_NAME "AGC" -#define BGFX_RENDERER_DIRECT3D9_NAME "Direct3D 9" #define BGFX_RENDERER_DIRECT3D11_NAME "Direct3D 11" #define BGFX_RENDERER_DIRECT3D12_NAME "Direct3D 12" #define BGFX_RENDERER_GNM_NAME "GNM" #define BGFX_RENDERER_METAL_NAME "Metal" #define BGFX_RENDERER_NVN_NAME "NVN" #define BGFX_RENDERER_VULKAN_NAME "Vulkan" -#define BGFX_RENDERER_WEBGPU_NAME "WebGPU" #if BGFX_CONFIG_RENDERER_OPENGL # if BGFX_CONFIG_RENDERER_OPENGL >= 31 && BGFX_CONFIG_RENDERER_OPENGL <= 33 @@ -429,7 +427,7 @@ namespace bgfx }; }; - bool windowsVersionIs(Condition::Enum _op, uint32_t _version); + bool windowsVersionIs(Condition::Enum _op, uint32_t _version, uint32_t _build = UINT32_MAX); constexpr bool isShaderType(uint32_t _magic, char _type) { @@ -607,13 +605,6 @@ namespace bgfx release( (const Memory*)_mem); } - inline uint32_t castfu(float _value) - { - union { float fl; uint32_t ui; } un; - un.fl = _value; - return un.ui; - } - inline uint64_t packStencil(uint32_t _fstencil, uint32_t _bstencil) { return (uint64_t(_bstencil)<<32)|uint64_t(_fstencil); @@ -637,7 +628,7 @@ namespace bgfx if (_hasMips) { const uint32_t max = bx::max(_width, _height, _depth); - const uint32_t num = 1 + uint32_t(bx::log2(max) ); + const uint32_t num = 1 + bx::floorLog2(max); return uint8_t(num); } @@ -680,8 +671,8 @@ namespace bgfx || m_small != _small) { m_small = _small; - m_width = (uint16_t)width; - m_height = (uint16_t)height; + m_width = bx::narrowCast(width); + m_height = bx::narrowCast(height); uint32_t size = m_size; m_size = m_width * m_height; @@ -956,6 +947,14 @@ namespace bgfx write(reinterpret_cast(&_in), sizeof(Type) ); } + void write(const bx::StringView& _str) + { + const uint16_t len = bx::narrowCast(_str.getLength()+1); + write(len); + write(_str.getPtr(), len-1); + write('\0'); + } + void read(void* _data, uint32_t _size) { BX_ASSERT(m_pos + _size <= m_size @@ -1090,9 +1089,9 @@ namespace bgfx constexpr uint8_t kSortKeyComputeProgramShift = kSortKeyComputeSeqShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM; constexpr uint64_t kSortKeyComputeProgramMask = uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1)<(&m_num, num, BGFX_CONFIG_MAX_MATRIX_CACHE - 1); BX_WARN(first+num < BGFX_CONFIG_MAX_MATRIX_CACHE, "Matrix cache overflow. %d (max: %d)", first+num, BGFX_CONFIG_MAX_MATRIX_CACHE); num = bx::min(num, BGFX_CONFIG_MAX_MATRIX_CACHE-1-first); - *_num = (uint16_t)num; + *_num = bx::narrowCast(num); return first; } @@ -1585,7 +1584,7 @@ namespace bgfx void writeUniform(UniformType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num = 1); void writeUniformHandle(UniformType::Enum _type, uint16_t _loc, UniformHandle _handle, uint16_t _num = 1); - void writeMarker(const char* _marker); + void writeMarker(const bx::StringView& _name); private: UniformBuffer(uint32_t _size) @@ -1701,6 +1700,9 @@ namespace bgfx bind.m_idx = kInvalidHandle; bind.m_type = 0; bind.m_samplerFlags = 0; + bind.m_format = 0; + bind.m_access = 0; + bind.m_mip = 0; } } }; @@ -1757,12 +1759,12 @@ namespace bgfx m_submitFlags = isIndex16() ? 0 : BGFX_SUBMIT_INTERNAL_INDEX32; } - m_startIndirect = 0; - m_numIndirect = UINT16_MAX; + m_startIndirect = 0; + m_numIndirect = UINT32_MAX; m_numIndirectIndex = 0; - m_indirectBuffer.idx = kInvalidHandle; + m_indirectBuffer.idx = kInvalidHandle; m_numIndirectBuffer.idx = kInvalidHandle; - m_occlusionQuery.idx = kInvalidHandle; + m_occlusionQuery.idx = kInvalidHandle; } bool setStreamBit(uint8_t _stream, VertexBufferHandle _handle) @@ -1791,10 +1793,10 @@ namespace bgfx uint32_t m_numVertices; uint32_t m_instanceDataOffset; uint32_t m_numInstances; - uint16_t m_instanceDataStride; - uint16_t m_startIndirect; - uint16_t m_numIndirect; + uint32_t m_startIndirect; + uint32_t m_numIndirect; uint32_t m_numIndirectIndex; + uint16_t m_instanceDataStride; uint16_t m_numMatrices; uint16_t m_scissor; uint8_t m_submitFlags; @@ -1831,7 +1833,7 @@ namespace bgfx m_submitFlags = 0; m_indirectBuffer.idx = kInvalidHandle; m_startIndirect = 0; - m_numIndirect = UINT16_MAX; + m_numIndirect = UINT32_MAX; } uint32_t m_uniformBegin; @@ -1842,8 +1844,8 @@ namespace bgfx uint32_t m_numX; uint32_t m_numY; uint32_t m_numZ; - uint16_t m_startIndirect; - uint16_t m_numIndirect; + uint32_t m_startIndirect; + uint32_t m_numIndirect; uint16_t m_numMatrices; uint8_t m_submitFlags; uint8_t m_uniformIdx; @@ -2169,6 +2171,8 @@ namespace bgfx bx::memSet(m_occlusion, 0xff, sizeof(m_occlusion) ); m_perfStats.viewStats = m_viewStats; + + bx::memSet(&m_renderItemBind[0], 0, sizeof(m_renderItemBind)); } ~Frame() @@ -2446,6 +2450,13 @@ namespace bgfx { EncoderImpl() { + // Although it will be cleared by the discard(), the fact that the + // struct is padded to have a size equal to the cache line size, + // will leaves bytes uninitialized. This will influence the hashing + // as it reads those bytes too. To make this deterministic, we will + // clear all bytes (inclusively the padding) before we start. + bx::memSet(&m_bind, 0, sizeof(m_bind)); + discard(BGFX_DISCARD_ALL); } @@ -2487,7 +2498,7 @@ namespace bgfx } } - void setMarker(const char* _name) + void setMarker(const bx::StringView& _name) { UniformBuffer::update(&m_frame->m_uniformBuffer[m_uniformIdx]); UniformBuffer* uniformBuffer = m_frame->m_uniformBuffer[m_uniformIdx]; @@ -2503,7 +2514,7 @@ namespace bgfx , _handle.idx , getName(_handle) ); - m_uniformSet.insert(_handle.idx); +// m_uniformSet.insert(_handle.idx); } UniformBuffer::update(&m_frame->m_uniformBuffer[m_uniformIdx]); @@ -2552,7 +2563,7 @@ namespace bgfx uint16_t setScissor(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height) { - uint16_t scissor = (uint16_t)m_frame->m_frameCache.m_rectCache.add(_x, _y, _width, _height); + uint16_t scissor = bx::narrowCast(m_frame->m_frameCache.m_rectCache.add(_x, _y, _width, _height) ); m_draw.m_scissor = scissor; return scissor; } @@ -2726,6 +2737,9 @@ namespace bgfx ? BGFX_SAMPLER_INTERNAL_DEFAULT : _flags ; + bind.m_format = 0; + bind.m_access = 0; + bind.m_mip = 0; if (isValid(_sampler) ) { @@ -2779,7 +2793,7 @@ namespace bgfx void submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth, uint8_t _flags); - void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, uint32_t _depth, uint8_t _flags) + void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, uint32_t _num, uint32_t _depth, uint8_t _flags) { m_draw.m_startIndirect = _start; m_draw.m_numIndirect = _num; @@ -2788,16 +2802,16 @@ namespace bgfx submit(_id, _program, handle, _depth, _flags); } - void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags) + void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags) { - m_draw.m_numIndirectIndex = _numIndex; + m_draw.m_numIndirectIndex = _numIndex; m_draw.m_numIndirectBuffer = _numHandle; submit(_id, _program, _indirectHandle, _start, _numMax, _depth, _flags); } void dispatch(ViewId _id, ProgramHandle _handle, uint32_t _ngx, uint32_t _ngy, uint32_t _ngz, uint8_t _flags); - void dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags) + void dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint32_t _start, uint32_t _num, uint8_t _flags) { m_compute.m_indirectBuffer = _indirectHandle; m_compute.m_startIndirect = _start; @@ -3095,7 +3109,7 @@ namespace bgfx virtual void updateViewName(ViewId _id, const char* _name) = 0; virtual void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) = 0; virtual void invalidateOcclusionQuery(OcclusionQueryHandle _handle) = 0; - virtual void setMarker(const char* _marker, uint16_t _len) = 0; + virtual void setMarker(const char* _name, uint16_t _len) = 0; virtual void setName(Handle _handle, const char* _name, uint16_t _len) = 0; virtual void submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) = 0; virtual void blitSetup(TextVideoMemBlitter& _blitter) = 0; @@ -4915,7 +4929,7 @@ namespace bgfx cmdbuf.write(handle); cmdbuf.write(uniform.m_type); cmdbuf.write(uniform.m_num); - uint8_t len = (uint8_t)bx::strLen(_name)+1; + uint8_t len = bx::narrowCast(bx::strLen(_name)+1); cmdbuf.write(len); cmdbuf.write(_name, len); } @@ -4947,7 +4961,7 @@ namespace bgfx cmdbuf.write(handle); cmdbuf.write(_type); cmdbuf.write(_num); - uint8_t len = (uint8_t)bx::strLen(_name)+1; + uint8_t len = bx::narrowCast(bx::strLen(_name)+1); cmdbuf.write(len); cmdbuf.write(_name, len); @@ -5084,15 +5098,13 @@ namespace bgfx m_colorPaletteDirty = 2; } - BGFX_API_FUNC(void setViewName(ViewId _id, const char* _name) ) + BGFX_API_FUNC(void setViewName(ViewId _id, const bx::StringView& _name) ) { BGFX_MUTEX_SCOPE(m_resourceApiLock); CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::UpdateViewName); cmdbuf.write(_id); - uint16_t len = (uint16_t)bx::strLen(_name)+1; - cmdbuf.write(len); - cmdbuf.write(_name, len); + cmdbuf.write(_name); } BGFX_API_FUNC(void setViewRect(ViewId _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height) ) diff --git a/bgfx/src/bgfx_shader.sh b/bgfx/src/bgfx_shader.sh index 48dbfd07..3fe839a6 100644 --- a/bgfx/src/bgfx_shader.sh +++ b/bgfx/src/bgfx_shader.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/charset.h b/bgfx/src/charset.h index 159d38e7..f08b1165 100644 --- a/bgfx/src/charset.h +++ b/bgfx/src/charset.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/config.h b/bgfx/src/config.h index 36fb4eba..ed739f7e 100644 --- a/bgfx/src/config.h +++ b/bgfx/src/config.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -20,7 +20,6 @@ #endif // BX_CONFIG_DEBUG #if !defined(BGFX_CONFIG_RENDERER_AGC) \ - && !defined(BGFX_CONFIG_RENDERER_DIRECT3D9) \ && !defined(BGFX_CONFIG_RENDERER_DIRECT3D11) \ && !defined(BGFX_CONFIG_RENDERER_DIRECT3D12) \ && !defined(BGFX_CONFIG_RENDERER_GNM) \ @@ -28,8 +27,7 @@ && !defined(BGFX_CONFIG_RENDERER_NVN) \ && !defined(BGFX_CONFIG_RENDERER_OPENGL) \ && !defined(BGFX_CONFIG_RENDERER_OPENGLES) \ - && !defined(BGFX_CONFIG_RENDERER_VULKAN) \ - && !defined(BGFX_CONFIG_RENDERER_WEBGPU) + && !defined(BGFX_CONFIG_RENDERER_VULKAN) # ifndef BGFX_CONFIG_RENDERER_AGC # define BGFX_CONFIG_RENDERER_AGC (0 \ @@ -37,13 +35,6 @@ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_AGC -# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9 -# define BGFX_CONFIG_RENDERER_DIRECT3D9 (0 \ - || BX_PLATFORM_LINUX \ - || BX_PLATFORM_WINDOWS \ - ? 1 : 0) -# endif // BGFX_CONFIG_RENDERER_DIRECT3D9 - # ifndef BGFX_CONFIG_RENDERER_DIRECT3D11 # define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \ || BX_PLATFORM_LINUX \ @@ -69,10 +60,10 @@ # endif // BGFX_CONFIG_RENDERER_GNM # ifndef BGFX_CONFIG_RENDERER_METAL -# define BGFX_CONFIG_RENDERER_METAL (0 \ - || (BX_PLATFORM_IOS && BX_CPU_ARM) \ - || (BX_PLATFORM_IOS && BX_CPU_X86) \ - || (BX_PLATFORM_OSX >= 101100) \ +# define BGFX_CONFIG_RENDERER_METAL (0 \ + || BX_PLATFORM_IOS \ + || BX_PLATFORM_OSX \ + || BX_PLATFORM_VISIONOS \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_METAL @@ -88,7 +79,6 @@ # ifndef BGFX_CONFIG_RENDERER_OPENGL # define BGFX_CONFIG_RENDERER_OPENGL (0 \ - || BX_PLATFORM_BSD \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ ? BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION : 0) @@ -119,19 +109,11 @@ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_VULKAN -# ifndef BGFX_CONFIG_RENDERER_WEBGPU -# define BGFX_CONFIG_RENDERER_WEBGPU 0 -# endif // BGFX_CONFIG_RENDERER_WEBGPU - #else # ifndef BGFX_CONFIG_RENDERER_AGC # define BGFX_CONFIG_RENDERER_AGC 0 # endif // BGFX_CONFIG_RENDERER_AGC -# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9 -# define BGFX_CONFIG_RENDERER_DIRECT3D9 0 -# endif // BGFX_CONFIG_RENDERER_DIRECT3D9 - # ifndef BGFX_CONFIG_RENDERER_DIRECT3D11 # define BGFX_CONFIG_RENDERER_DIRECT3D11 0 # endif // BGFX_CONFIG_RENDERER_DIRECT3D11 @@ -163,10 +145,6 @@ # ifndef BGFX_CONFIG_RENDERER_VULKAN # define BGFX_CONFIG_RENDERER_VULKAN 0 # endif // BGFX_CONFIG_RENDERER_VULKAN - -# ifndef BGFX_CONFIG_RENDERER_WEBGPU -# define BGFX_CONFIG_RENDERER_WEBGPU 0 -# endif // BGFX_CONFIG_RENDERER_VULKAN #endif // !defined... #if BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGL < 21 @@ -188,6 +166,10 @@ # define BGFX_CONFIG_RENDERER_USE_EXTENSIONS 1 #endif // BGFX_CONFIG_RENDERER_USE_EXTENSIONS +#ifndef BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER +# define BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER 0 +#endif // BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER + /// Enable use of tinystl. #ifndef BGFX_CONFIG_USE_TINYSTL # define BGFX_CONFIG_USE_TINYSTL 1 @@ -257,12 +239,12 @@ // Cannot be configured via compiler options. #define BGFX_CONFIG_MAX_PROGRAMS (1<EnumAdapters(ii, reinterpret_cast(&adapter) ) && ii < BX_COUNTOF(_caps.gpu) + ; ii < BX_COUNTOF(_caps.gpu) && DXGI_ERROR_NOT_FOUND != m_factory->EnumAdapters(ii, reinterpret_cast(&adapter) ) ; ++ii ) { @@ -469,7 +469,19 @@ namespace bgfx { HRESULT hr = S_OK; - uint32_t scdFlags = _scd.flags; + DXGI_SWAP_CHAIN_DESC1 scd; + scd.Width = _scd.width; + scd.Height = _scd.height; + scd.Format = _scd.format; + scd.Stereo = _scd.stereo; + scd.SampleDesc.Count = 1; + scd.SampleDesc.Quality = 0; + scd.BufferUsage = _scd.bufferUsage; + scd.BufferCount = _scd.bufferCount; + scd.Scaling = _scd.scaling; + scd.SwapEffect = _scd.swapEffect; + scd.AlphaMode = _scd.alphaMode; + scd.Flags = _scd.flags; #if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS IDXGIFactory5* factory5; @@ -483,8 +495,8 @@ namespace bgfx hr = factory5->CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING, &allowTearing, sizeof(allowTearing) ); BX_TRACE("Allow tearing is %ssupported.", allowTearing ? "" : "not "); - scdFlags |= allowTearing ? DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0; - scdFlags |= false + scd.Flags |= allowTearing ? DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0; + scd.Flags |= false || _scd.swapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL || _scd.swapEffect == DXGI_SWAP_EFFECT_FLIP_DISCARD ? 0 // DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT @@ -496,43 +508,22 @@ namespace bgfx DX_RELEASE_I(factory5); } - DXGI_SWAP_CHAIN_DESC scd; - scd.BufferDesc.Width = _scd.width; - scd.BufferDesc.Height = _scd.height; - scd.BufferDesc.RefreshRate.Numerator = 1; - scd.BufferDesc.RefreshRate.Denominator = 60; - scd.BufferDesc.Format = _scd.format; - scd.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; - scd.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; - scd.SampleDesc.Count = 1; - scd.SampleDesc.Quality = 0; - scd.BufferUsage = _scd.bufferUsage; - scd.BufferCount = _scd.bufferCount; - scd.OutputWindow = (HWND)_scd.nwh; - scd.Windowed = _scd.windowed; - scd.SwapEffect = _scd.swapEffect; - scd.Flags = scdFlags; - - hr = m_factory->CreateSwapChain( + DXGI_SWAP_CHAIN_FULLSCREEN_DESC scfd; + scfd.RefreshRate.Numerator = 1; + scfd.RefreshRate.Denominator = 60; + scfd.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; + scfd.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; + scfd.Windowed = _scd.windowed; + + hr = m_factory->CreateSwapChainForHwnd( _device + , (HWND)_scd.nwh , &scd - , reinterpret_cast(_swapChain) - ); + , &scfd + , NULL + , reinterpret_cast(_swapChain) + ); #else - DXGI_SWAP_CHAIN_DESC1 scd; - scd.Width = _scd.width; - scd.Height = _scd.height; - scd.Format = _scd.format; - scd.Stereo = _scd.stereo; - scd.SampleDesc.Count = 1; - scd.SampleDesc.Quality = 0; - scd.BufferUsage = _scd.bufferUsage; - scd.BufferCount = _scd.bufferCount; - scd.Scaling = _scd.scaling; - scd.SwapEffect = _scd.swapEffect; - scd.AlphaMode = _scd.alphaMode; - scd.Flags = scdFlags; - if (NULL == _scd.ndt) { hr = m_factory->CreateSwapChainForCoreWindow( diff --git a/bgfx/src/dxgi.h b/bgfx/src/dxgi.h index e3a486d6..7a02f2d0 100644 --- a/bgfx/src/dxgi.h +++ b/bgfx/src/dxgi.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/emscripten.h b/bgfx/src/emscripten.h index 97da9940..8d9ecbb3 100644 --- a/bgfx/src/emscripten.h +++ b/bgfx/src/emscripten.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/fs_clear0.bin.h b/bgfx/src/fs_clear0.bin.h index d0313a27..3c05f2ef 100644 --- a/bgfx/src/fs_clear0.bin.h +++ b/bgfx/src/fs_clear0.bin.h @@ -22,71 +22,51 @@ static const uint8_t fs_clear0_essl[136] = 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, // gfx_clear_color[ 0x30, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 0];.}... }; -static const uint8_t fs_clear0_spv[749] = +static const uint8_t fs_clear0_spv[673] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........N...... + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x03, 0x02, 0x23, // .........p.....# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........N...... 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... - 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, // ................ + 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x06, // ................ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x2b, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, // .+...4.......... - 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, // ................ - 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x05, 0x00, 0x06, 0x00, 0x21, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // .....!...Uniform - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x21, 0x00, 0x00, // Block........!.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, // .....bgfx_clear_ - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x23, 0x00, 0x00, // color........#.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, // .........+...gl_ - 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // FragCoord....... - 0x00, 0x34, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .4...bgfx_FragDa - 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // ta0..G... ...... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....H...!...... - 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, // .#.......G...!.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // .....G...#...".. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .....G...#...!.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, // .....G...+...... - 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...4...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, // .............!.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, // ................ - 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // . .............. - 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // ............. .. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // .....+.......... - 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // ......... ...... - 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .........!... .. - 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // . ...".......!.. - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .;..."...#...... - 0x00, 0x15, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....$... ...... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+...$...%...... - 0x00, 0x20, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...&.......... - 0x00, 0x20, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...*.......... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .;...*...+...... - 0x00, 0x20, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...3.......... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...3...4...... - 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .6.............. - 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. - 0x00, 0x26, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, // .&...L...#...%.. - 0x00, 0x25, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, // .%...=.......M.. - 0x00, 0x4c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x34, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, // .L...>...4...M.. - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // .....8....... -}; -static const uint8_t fs_clear0_dx9[206] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b - 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, // ................ - 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // ...".CTAB....[.. - 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .T...0.......... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .D.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // ear_color....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x01, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // .............. + 0x00, 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, // .4.............. + 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, // ................ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....main....... + 0x00, 0x21, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, // .!...UniformBloc + 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // k........!...... + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // .bgfx_clear_colo + 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r........#...... + 0x00, 0x05, 0x00, 0x06, 0x00, 0x34, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....4...bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, // agData0..G... .. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, // .........H...!.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .....#.......G.. + 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, // .!.......G...#.. + 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, // .".......G...#.. + 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, // .!.......G...4.. + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, // .!.............. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // ..... .......... + 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, // ................ + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, // . .......+...... + 0x00, 0x1f, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, // ............. .. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, // .............!.. + 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // . ... ..."...... + 0x00, 0x21, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .!...;..."...#.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .........$... .. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, // .....+...$...%.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ..... ...&...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ..... ...3...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, // .....;...3...4.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .....6.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, // ................ + 0x00, 0x41, 0x00, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .A...&...L...#.. + 0x00, 0x25, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .%...%...=...... + 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x34, 0x00, 0x00, // .M...L...>...4.. + 0x00, 0x4d, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, // .M.......8...... + 0x00, // . }; static const uint8_t fs_clear0_dx11[269] = { diff --git a/bgfx/src/fs_clear0.sc b/bgfx/src/fs_clear0.sc index 31966bfb..c0ac1107 100644 --- a/bgfx/src/fs_clear0.sc +++ b/bgfx/src/fs_clear0.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/fs_clear1.bin.h b/bgfx/src/fs_clear1.bin.h index 15c9043c..24dc0804 100644 --- a/bgfx/src/fs_clear1.bin.h +++ b/bgfx/src/fs_clear1.bin.h @@ -28,80 +28,59 @@ static const uint8_t fs_clear1_essl[178] = 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x31, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, // ear_color[1];.}. 0x0a, 0x00, // .. }; -static const uint8_t fs_clear1_spv[877] = +static const uint8_t fs_clear1_spv[801] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, // .........<.....# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........Y...... + 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........Y...... 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... - 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, // ................ + 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, // ................ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, // ./...;...=...... - 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, // ................ - 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai - 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x22, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, // n........"...Uni - 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, // formBlock....... - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .".......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, // ear_color....... - 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x2f, 0x00, 0x00, // .$.........../.. - 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, // .gl_FragCoord... - 0x00, 0x05, 0x00, 0x06, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....;...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x3d, 0x00, 0x00, // agData0......=.. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, // .bgfx_FragData1. - 0x00, 0x47, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // .G...!.......... - 0x00, 0x48, 0x00, 0x05, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...".......#.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....G..."...... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...$..."...... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .G...$...!...... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // .G.../.......... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...;.......... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .G...=.......... - 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, // .........!...... - 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // ............. .. - 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x15, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .+....... ...... - 0x00, 0x1c, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .....!....... .. - 0x00, 0x1e, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // ....."...!... .. - 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .#......."...;.. - 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // .#...$.......... - 0x00, 0x25, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .%... .......+.. - 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .%...&....... .. - 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .'...........+.. - 0x00, 0x25, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .%...*....... .. - 0x00, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .............;.. - 0x00, 0x2e, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // ...../....... .. - 0x00, 0x3a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .:...........;.. - 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .:...;.......;.. - 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, // .:...=.......6.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, // .........A...'.. - 0x00, 0x55, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, // .U...$...&...&.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, // .=.......V...U.. - 0x00, 0x41, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, // .A...'...W...$.. - 0x00, 0x26, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .&...*...=...... - 0x00, 0x58, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x3b, 0x00, 0x00, // .X...W...>...;.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, // .V...>...=...X.. - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // .....8..... . -}; -static const uint8_t fs_clear1_dx9[218] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b - 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, // ................ - 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // ...".CTAB....[.. - 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .T...0.......... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .D.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // ear_color....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x01, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x08, 0x0f, // ................ - 0x80, 0x01, 0x00, 0xe4, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // .......... + 0x00, 0x3b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, // .;...=.......... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, // ................ + 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... + 0x00, 0x05, 0x00, 0x06, 0x00, 0x22, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // ....."...Uniform + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x22, 0x00, 0x00, // Block........".. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, // .....bgfx_clear_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x24, 0x00, 0x00, // color........$.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // .........;...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData0..... + 0x00, 0x3d, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .=...bgfx_FragDa + 0x74, 0x61, 0x31, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // ta1..G...!...... + 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....H..."...... + 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, // .#.......G...".. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // .....G...$...".. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .....G...$...!.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...;...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...=...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, // .............!.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, // ................ + 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // . .............. + 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // ............. .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .....+....... .. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .........!...... + 0x00, 0x20, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // . ......."...!.. + 0x00, 0x20, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // . ...#.......".. + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .;...#...$...... + 0x00, 0x15, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....%... ...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+...%...&...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...'.......... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .+...%...*...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...:.......... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...:...;...... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...:...=...... + 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .6.............. + 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x27, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, // .'...U...$...&.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, // .&...=.......V.. + 0x00, 0x55, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, // .U...A...'...W.. + 0x00, 0x24, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .$...&...*...=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .....X...W...>.. + 0x00, 0x3b, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x3d, 0x00, 0x00, // .;...V...>...=.. + 0x00, 0x58, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // .X.......8..... + 0x00, // . }; static const uint8_t fs_clear1_dx11[329] = { diff --git a/bgfx/src/fs_clear1.sc b/bgfx/src/fs_clear1.sc index 34546a13..1e95c43f 100644 --- a/bgfx/src/fs_clear1.sc +++ b/bgfx/src/fs_clear1.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/fs_clear2.bin.h b/bgfx/src/fs_clear2.bin.h index df0ce565..bf2f6046 100644 --- a/bgfx/src/fs_clear2.bin.h +++ b/bgfx/src/fs_clear2.bin.h @@ -32,89 +32,67 @@ static const uint8_t fs_clear2_essl[218] = 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // bgfx_clear_colo 0x72, 0x5b, 0x32, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r[2];.}... }; -static const uint8_t fs_clear2_spv[1005] = +static const uint8_t fs_clear2_spv[929] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........d...... + 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, // .........p.....# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........d...... 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... - 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, // ................ + 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, // ................ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x33, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, // .3...B...D...F.. - 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, // ................ - 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x23, 0x00, 0x00, // .main........#.. - 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, // .UniformBlock... - 0x00, 0x06, 0x00, 0x08, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // .....#.......bgf - 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, // x_clear_color... - 0x00, 0x05, 0x00, 0x03, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....%.......... - 0x00, 0x33, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, // .3...gl_FragCoor - 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x42, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // d........B...bgf - 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData0..... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .D...bgfx_FragDa - 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x46, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta1......F...bgf - 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x32, 0x00, 0x00, 0x47, 0x00, 0x04, // x_FragData2..G.. - 0x00, 0x22, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // ."...........H.. - 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .#.......#...... - 0x00, 0x47, 0x00, 0x03, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .G...#.......G.. - 0x00, 0x25, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .%...".......G.. - 0x00, 0x25, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .%...!.......G.. - 0x00, 0x33, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .3...........G.. - 0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .B...........G.. - 0x00, 0x44, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .D...........G.. - 0x00, 0x46, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, // .F.............. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....!.......... - 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, // ......... ...... - 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // ................ - 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // . ... .......+.. - 0x00, 0x20, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, // . ...!.......... - 0x00, 0x22, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, // .".......!...... - 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, // .#..."... ...$.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, // .....#...;...$.. - 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, // .%...........&.. - 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, // . .......+...&.. - 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, // .'....... ...(.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, // .........+...&.. - 0x00, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, // .+.......+...&.. - 0x00, 0x2e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, // ......... ...2.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, // .........;...2.. - 0x00, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x41, 0x00, 0x00, // .3....... ...A.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x41, 0x00, 0x00, // .........;...A.. - 0x00, 0x42, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x41, 0x00, 0x00, // .B.......;...A.. - 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x41, 0x00, 0x00, // .D.......;...A.. - 0x00, 0x46, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, // .F.......6...... - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ - 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x28, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, // .....A...(...^.. - 0x00, 0x25, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .%...'...'...=.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // ....._...^...A.. - 0x00, 0x28, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, // .(...`...%...'.. - 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, // .+...=.......a.. - 0x00, 0x60, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x28, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, // .`...A...(...b.. - 0x00, 0x25, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .%...'.......=.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .....c...b...>.. - 0x00, 0x42, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x44, 0x00, 0x00, // .B..._...>...D.. - 0x00, 0x61, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x46, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, // .a...>...F...c.. - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x30, 0x00, // .....8.....0. -}; -static const uint8_t fs_clear2_dx9[230] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b - 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, // ................ - 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // ...".CTAB....[.. - 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .T...0.......... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .D.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // ear_color....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x01, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x08, 0x0f, // ................ - 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xe4, // ................ - 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ...... + 0x00, 0x42, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, // .B...D...F...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, // ................ + 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai + 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x23, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, // n........#...Uni + 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, // formBlock....... + 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .#.......bgfx_cl + 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, // ear_color....... + 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x42, 0x00, 0x00, // .%...........B.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, // .bgfx_FragData0. + 0x00, 0x05, 0x00, 0x06, 0x00, 0x44, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....D...bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x46, 0x00, 0x00, // agData1......F.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x32, 0x00, // .bgfx_FragData2. + 0x00, 0x47, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // .G...".......... + 0x00, 0x48, 0x00, 0x05, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...#.......#.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....G...#...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...%..."...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .G...%...!...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...B.......... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x44, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .G...D.......... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x46, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .G...F.......... + 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, // .........!...... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // ............. .. + 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x15, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..... ... ...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .+... ...!...... + 0x00, 0x1c, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .....".......!.. + 0x00, 0x1e, 0x00, 0x03, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .....#..."... .. + 0x00, 0x24, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .$.......#...;.. + 0x00, 0x24, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // .$...%.......... + 0x00, 0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .&... .......+.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .&...'....... .. + 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .(...........+.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .&...+.......+.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .&........... .. + 0x00, 0x41, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .A...........;.. + 0x00, 0x41, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .A...B.......;.. + 0x00, 0x41, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .A...D.......;.. + 0x00, 0x41, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, // .A...F.......6.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x28, 0x00, 0x00, // .........A...(.. + 0x00, 0x5e, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, // .^...%...'...'.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, // .=......._...^.. + 0x00, 0x41, 0x00, 0x06, 0x00, 0x28, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, // .A...(...`...%.. + 0x00, 0x27, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .'...+...=...... + 0x00, 0x61, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x28, 0x00, 0x00, // .a...`...A...(.. + 0x00, 0x62, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, // .b...%...'...... + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, // .=.......c...b.. + 0x00, 0x3e, 0x00, 0x03, 0x00, 0x42, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...B..._...>.. + 0x00, 0x44, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x46, 0x00, 0x00, // .D...a...>...F.. + 0x00, 0x63, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x30, // .c.......8.....0 + 0x00, // . }; static const uint8_t fs_clear2_dx11[389] = { diff --git a/bgfx/src/fs_clear2.sc b/bgfx/src/fs_clear2.sc index 14c2e8ca..b27f3204 100644 --- a/bgfx/src/fs_clear2.sc +++ b/bgfx/src/fs_clear2.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/fs_clear3.bin.h b/bgfx/src/fs_clear3.bin.h index cc1a562b..ae438268 100644 --- a/bgfx/src/fs_clear3.bin.h +++ b/bgfx/src/fs_clear3.bin.h @@ -38,98 +38,75 @@ static const uint8_t fs_clear3_essl[258] = 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x33, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, // ear_color[3];.}. 0x0a, 0x00, // .. }; -static const uint8_t fs_clear3_spv[1133] = +static const uint8_t fs_clear3_spv[1057] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, // .........<.....# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........o...... + 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........o...... 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... - 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0a, // ................ + 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, // ................ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x37, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, // .7...I...K...M.. - 0x00, 0x4f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, // .O.............. - 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, // ................ - 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....main....... - 0x00, 0x24, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, // .$...UniformBloc - 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // k........$...... - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // .bgfx_clear_colo - 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r........&...... - 0x00, 0x05, 0x00, 0x06, 0x00, 0x37, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // .....7...gl_Frag - 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x49, 0x00, 0x00, // Coord........I.. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, // .bgfx_FragData0. - 0x00, 0x05, 0x00, 0x06, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....K...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x4d, 0x00, 0x00, // agData1......M.. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x32, 0x00, // .bgfx_FragData2. - 0x00, 0x05, 0x00, 0x06, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....O...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x33, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, // agData3..G...#.. - 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x24, 0x00, 0x00, // .........H...$.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .....#.......G.. - 0x00, 0x24, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, // .$.......G...&.. - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, // .".......G...&.. - 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x37, 0x00, 0x00, // .!.......G...7.. - 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x49, 0x00, 0x00, // .........G...I.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, // .........G...K.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, // .........G...M.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, // .........G...O.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, // ................ - 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, // .!.............. - 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // ..... .......... - 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, // .............!.. - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, // . .......+...!.. - 0x00, 0x22, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, // ."...........#.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x24, 0x00, 0x00, // .....".......$.. - 0x00, 0x23, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .#... ...%...... - 0x00, 0x24, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, // .$...;...%...&.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .........'... .. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .....+...'...(.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ..... ...)...... - 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .....+...'...,.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, // .....+...'.../.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .....+...'...2.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ..... ...6...... - 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, // .....;...6...7.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ..... ...H...... - 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, // .....;...H...I.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, // .....;...H...K.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, // .....;...H...M.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, // .....;...H...O.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .....6.......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, // ................ - 0x00, 0x41, 0x00, 0x06, 0x00, 0x29, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, // .A...)...g...&.. - 0x00, 0x28, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .(...(...=...... - 0x00, 0x68, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x29, 0x00, 0x00, // .h...g...A...).. - 0x00, 0x69, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .i...&...(...,.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, // .=.......j...i.. - 0x00, 0x41, 0x00, 0x06, 0x00, 0x29, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, // .A...)...k...&.. - 0x00, 0x28, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .(.../...=...... - 0x00, 0x6c, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x29, 0x00, 0x00, // .l...k...A...).. - 0x00, 0x6d, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .m...&...(...2.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, // .=.......n...m.. - 0x00, 0x3e, 0x00, 0x03, 0x00, 0x49, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...I...h...>.. - 0x00, 0x4b, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x4d, 0x00, 0x00, // .K...j...>...M.. - 0x00, 0x6c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, // .l...>...O...n.. - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, // .....8.....@. -}; -static const uint8_t fs_clear3_dx9[242] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b - 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, // ................ - 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // ...".CTAB....[.. - 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .T...0.......... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .D.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // ear_color....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x01, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x08, 0x0f, // ................ - 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xe4, // ................ - 0xa0, 0x01, 0x00, 0x00, 0x02, 0x03, 0x08, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0xff, 0xff, 0x00, // ................ - 0x00, 0x00, // .. + 0x00, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, // .I...K...M...O.. + 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, // ................ + 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x24, 0x00, 0x00, // .main........$.. + 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, // .UniformBlock... + 0x00, 0x06, 0x00, 0x08, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // .....$.......bgf + 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, // x_clear_color... + 0x00, 0x05, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....&.......... + 0x00, 0x49, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .I...bgfx_FragDa + 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta0......K...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData1..... + 0x00, 0x4d, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .M...bgfx_FragDa + 0x74, 0x61, 0x32, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta2......O...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x33, 0x00, 0x00, 0x47, 0x00, 0x04, // x_FragData3..G.. + 0x00, 0x23, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // .#...........H.. + 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .$.......#...... + 0x00, 0x47, 0x00, 0x03, 0x00, 0x24, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .G...$.......G.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .&...".......G.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .&...!.......G.. + 0x00, 0x49, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .I...........G.. + 0x00, 0x4b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .K...........G.. + 0x00, 0x4d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .M...........G.. + 0x00, 0x4f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, // .O.............. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....!.......... + 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, // ......... ...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // ................ + 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .!... .......+.. + 0x00, 0x21, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, // .!...".......... + 0x00, 0x23, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, // .#......."...... + 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, // .$...#... ...%.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, // .....$...;...%.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .&...........'.. + 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // . .......+...'.. + 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, // .(....... ...).. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .........+...'.. + 0x00, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .,.......+...'.. + 0x00, 0x2f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // ./.......+...'.. + 0x00, 0x32, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, // .2....... ...H.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, // .........;...H.. + 0x00, 0x49, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, // .I.......;...H.. + 0x00, 0x4b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, // .K.......;...H.. + 0x00, 0x4d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, // .M.......;...H.. + 0x00, 0x4f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, // .O.......6...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x29, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, // .....A...)...g.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .&...(...(...=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .....h...g...A.. + 0x00, 0x29, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .)...i...&...(.. + 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, // .,...=.......j.. + 0x00, 0x69, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x29, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, // .i...A...)...k.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .&...(.../...=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .....l...k...A.. + 0x00, 0x29, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .)...m...&...(.. + 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, // .2...=.......n.. + 0x00, 0x6d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x49, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, // .m...>...I...h.. + 0x00, 0x3e, 0x00, 0x03, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...K...j...>.. + 0x00, 0x4d, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x4f, 0x00, 0x00, // .M...l...>...O.. + 0x00, 0x6e, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, // .n.......8.....@ + 0x00, // . }; static const uint8_t fs_clear3_dx11[449] = { diff --git a/bgfx/src/fs_clear3.sc b/bgfx/src/fs_clear3.sc index cba45458..df04f057 100644 --- a/bgfx/src/fs_clear3.sc +++ b/bgfx/src/fs_clear3.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/fs_clear4.bin.h b/bgfx/src/fs_clear4.bin.h index 3ee58c67..820efe05 100644 --- a/bgfx/src/fs_clear4.bin.h +++ b/bgfx/src/fs_clear4.bin.h @@ -42,106 +42,83 @@ static const uint8_t fs_clear4_essl[298] = 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // bgfx_clear_colo 0x72, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r[4];.}... }; -static const uint8_t fs_clear4_spv[1261] = +static const uint8_t fs_clear4_spv[1185] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........z...... + 0x05, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, // .........p.....# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........z...... 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... - 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, // ................ + 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0a, // ................ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x3b, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, // .;...P...R...T.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, // .V...X.......... - 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, // ................ - 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x05, 0x00, 0x06, 0x00, 0x25, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // .....%...Uniform - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x25, 0x00, 0x00, // Block........%.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, // .....bgfx_clear_ - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x27, 0x00, 0x00, // color........'.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, // .........;...gl_ - 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // FragCoord....... - 0x00, 0x50, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .P...bgfx_FragDa - 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x52, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta0......R...bgf - 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData1..... - 0x00, 0x54, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .T...bgfx_FragDa - 0x74, 0x61, 0x32, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x56, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta2......V...bgf - 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x33, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData3..... - 0x00, 0x58, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .X...bgfx_FragDa - 0x74, 0x61, 0x34, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // ta4..G...$...... - 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....H...%...... - 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x25, 0x00, 0x00, // .#.......G...%.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // .....G...'...".. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .....G...'...!.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, // .....G...;...... - 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...P...... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x52, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...R...... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...T...... - 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...V...... - 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x58, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...X...... - 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, // .............!.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, // ................ - 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // . .............. - 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // ........."... .. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .....+..."...#.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .........$...... - 0x00, 0x23, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x25, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, // .#.......%...$.. - 0x00, 0x20, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, // . ...&.......%.. - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .;...&...'...... - 0x00, 0x15, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....(... ...... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+...(...)...... - 0x00, 0x20, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...*.......... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .+...(...-...... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .+...(...0...... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .+...(...3...... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .+...(...6...... - 0x00, 0x20, 0x00, 0x04, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...:.......... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .;...:...;...... - 0x00, 0x20, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...O.......... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...O...P...... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...O...R...... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...O...T...... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...O...V...... - 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...O...X...... - 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .6.............. - 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. - 0x00, 0x2a, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .*...p...'...).. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, // .)...=.......q.. - 0x00, 0x70, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, // .p...A...*...r.. - 0x00, 0x27, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .'...)...-...=.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .....s...r...A.. - 0x00, 0x2a, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .*...t...'...).. - 0x00, 0x30, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, // .0...=.......u.. - 0x00, 0x74, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, // .t...A...*...v.. - 0x00, 0x27, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .'...)...3...=.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .....w...v...A.. - 0x00, 0x2a, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .*...x...'...).. - 0x00, 0x36, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, // .6...=.......y.. - 0x00, 0x78, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x50, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, // .x...>...P...q.. - 0x00, 0x3e, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...R...s...>.. - 0x00, 0x54, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x56, 0x00, 0x00, // .T...u...>...V.. - 0x00, 0x77, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x58, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, // .w...>...X...y.. - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, // .....8.....P. -}; -static const uint8_t fs_clear4_dx9[242] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b - 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, // ................ - 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // ...".CTAB....[.. - 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .T...0.......... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .D.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // ear_color....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x01, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x08, 0x0f, // ................ - 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xe4, // ................ - 0xa0, 0x01, 0x00, 0x00, 0x02, 0x03, 0x08, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0xff, 0xff, 0x00, // ................ - 0x00, 0x00, // .. + 0x00, 0x50, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, // .P...R...T...V.. + 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, // .X.............. + 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, // ................ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....main....... + 0x00, 0x25, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, // .%...UniformBloc + 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // k........%...... + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // .bgfx_clear_colo + 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r........'...... + 0x00, 0x05, 0x00, 0x06, 0x00, 0x50, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....P...bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x52, 0x00, 0x00, // agData0......R.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, // .bgfx_FragData1. + 0x00, 0x05, 0x00, 0x06, 0x00, 0x54, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....T...bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x32, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x56, 0x00, 0x00, // agData2......V.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x33, 0x00, // .bgfx_FragData3. + 0x00, 0x05, 0x00, 0x06, 0x00, 0x58, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....X...bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x34, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, // agData4..G...$.. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x25, 0x00, 0x00, // .........H...%.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .....#.......G.. + 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .%.......G...'.. + 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .".......G...'.. + 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, // .!.......G...P.. + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x52, 0x00, 0x00, // .........G...R.. + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, // .........G...T.. + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, // .........G...V.. + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x58, 0x00, 0x00, // .........G...X.. + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, // .!.............. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // ..... .......... + 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, // .............".. + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, // . .......+...".. + 0x00, 0x23, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, // .#...........$.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x25, 0x00, 0x00, // .....#.......%.. + 0x00, 0x24, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .$... ...&...... + 0x00, 0x25, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, // .%...;...&...'.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .........(... .. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .....+...(...).. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ..... ...*...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, // .....+...(...-.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, // .....+...(...0.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, // .....+...(...3.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // .....+...(...6.. + 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ..... ...O...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, // .....;...O...P.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, // .....;...O...R.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, // .....;...O...T.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, // .....;...O...V.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, // .....;...O...X.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .....6.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, // ................ + 0x00, 0x41, 0x00, 0x06, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, // .A...*...p...'.. + 0x00, 0x29, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .)...)...=...... + 0x00, 0x71, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2a, 0x00, 0x00, // .q...p...A...*.. + 0x00, 0x72, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, // .r...'...)...-.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, // .=.......s...r.. + 0x00, 0x41, 0x00, 0x06, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, // .A...*...t...'.. + 0x00, 0x29, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .)...0...=...... + 0x00, 0x75, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2a, 0x00, 0x00, // .u...t...A...*.. + 0x00, 0x76, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, // .v...'...)...3.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, // .=.......w...v.. + 0x00, 0x41, 0x00, 0x06, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, // .A...*...x...'.. + 0x00, 0x29, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .)...6...=...... + 0x00, 0x79, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x50, 0x00, 0x00, // .y...x...>...P.. + 0x00, 0x71, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, // .q...>...R...s.. + 0x00, 0x3e, 0x00, 0x03, 0x00, 0x54, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...T...u...>.. + 0x00, 0x56, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x58, 0x00, 0x00, // .V...w...>...X.. + 0x00, 0x79, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, // .y.......8.....P + 0x00, // . }; static const uint8_t fs_clear4_dx11[509] = { diff --git a/bgfx/src/fs_clear4.sc b/bgfx/src/fs_clear4.sc index a49204d6..a098bad6 100644 --- a/bgfx/src/fs_clear4.sc +++ b/bgfx/src/fs_clear4.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/fs_clear5.bin.h b/bgfx/src/fs_clear5.bin.h index 6a950fa4..e1a3c72b 100644 --- a/bgfx/src/fs_clear5.bin.h +++ b/bgfx/src/fs_clear5.bin.h @@ -48,114 +48,91 @@ static const uint8_t fs_clear5_essl[338] = 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x35, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, // ear_color[5];.}. 0x0a, 0x00, // .. }; -static const uint8_t fs_clear5_spv[1389] = +static const uint8_t fs_clear5_spv[1313] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, // .........<.....# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... - 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0c, // ................ + 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, // ................ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x3f, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // .?...W...Y...[.. - 0x00, 0x5d, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, // .]..._...a...... - 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, // ................ - 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai - 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, // n........&...Uni - 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, // formBlock....... - 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .&.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, // ear_color....... - 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x3f, 0x00, 0x00, // .(...........?.. - 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, // .gl_FragCoord... - 0x00, 0x05, 0x00, 0x06, 0x00, 0x57, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....W...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x59, 0x00, 0x00, // agData0......Y.. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, // .bgfx_FragData1. - 0x00, 0x05, 0x00, 0x06, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....[...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x32, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x5d, 0x00, 0x00, // agData2......].. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x33, 0x00, // .bgfx_FragData3. - 0x00, 0x05, 0x00, 0x06, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // ....._...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x34, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x61, 0x00, 0x00, // agData4......a.. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x35, 0x00, // .bgfx_FragData5. - 0x00, 0x47, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // .G...%.......... - 0x00, 0x48, 0x00, 0x05, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...&.......#.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....G...&...... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...(..."...... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .G...(...!...... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // .G...?.......... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...W.......... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x59, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .G...Y.......... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .G...[.......... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .G...].......... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .G..._.......... - 0x00, 0x47, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, // .G...a.......... - 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, // .........!...... - 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // ............. .. - 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x15, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....#... ...... - 0x00, 0x2b, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .+...#...$...... - 0x00, 0x1c, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, // .....%.......$.. - 0x00, 0x1e, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .....&...%... .. - 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .'.......&...;.. - 0x00, 0x27, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // .'...(.......... - 0x00, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .)... .......+.. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .)...*....... .. - 0x00, 0x2b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .+...........+.. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .)...........+.. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .)...1.......+.. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .)...4.......+.. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .)...7.......+.. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .)...:....... .. - 0x00, 0x3e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .>...........;.. - 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .>...?....... .. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .V...........;.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .V...W.......;.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .V...Y.......;.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .V...[.......;.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .V...].......;.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .V..._.......;.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, // .V...a.......6.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ - 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, // .........A...+.. - 0x00, 0x79, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .y...(...*...*.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, // .=.......z...y.. - 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .A...+...{...(.. - 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .*.......=...... - 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, // .|...{...A...+.. - 0x00, 0x7d, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, // .}...(...*...1.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, // .=.......~...}.. - 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .A...+.......(.. - 0x00, 0x2a, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .*...4...=...... - 0x00, 0x80, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, // .........A...+.. - 0x00, 0x81, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, // .....(...*...7.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, // .=.............. - 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .A...+.......(.. - 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .*...:...=...... - 0x00, 0x84, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x57, 0x00, 0x00, // .........>...W.. - 0x00, 0x7a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x59, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, // .z...>...Y...|.. - 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...[...~...>.. - 0x00, 0x5d, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5f, 0x00, 0x00, // .].......>..._.. - 0x00, 0x82, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x61, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, // .....>...a...... - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, // .....8.....`. -}; -static const uint8_t fs_clear5_dx9[242] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b - 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, // ................ - 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // ...".CTAB....[.. - 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .T...0.......... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .D.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // ear_color....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x01, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x08, 0x0f, // ................ - 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xe4, // ................ - 0xa0, 0x01, 0x00, 0x00, 0x02, 0x03, 0x08, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0xff, 0xff, 0x00, // ................ - 0x00, 0x00, // .. + 0x00, 0x57, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, // .W...Y...[...].. + 0x00, 0x5f, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, // ._...a.......... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, // ................ + 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... + 0x00, 0x05, 0x00, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // .....&...Uniform + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x26, 0x00, 0x00, // Block........&.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, // .....bgfx_clear_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x28, 0x00, 0x00, // color........(.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x57, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // .........W...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData0..... + 0x00, 0x59, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .Y...bgfx_FragDa + 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta1......[...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x32, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData2..... + 0x00, 0x5d, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .]...bgfx_FragDa + 0x74, 0x61, 0x33, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta3......_...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x34, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData4..... + 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .a...bgfx_FragDa + 0x74, 0x61, 0x35, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // ta5..G...%...... + 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....H...&...... + 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00, // .#.......G...&.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // .....G...(...".. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .....G...(...!.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...W...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x59, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...Y...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...[...... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...]...... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G..._...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G...a...... + 0x00, 0x05, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, // .............!.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, // ................ + 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // . .............. + 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .........#... .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, // .....+...#...$.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .........%...... + 0x00, 0x24, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, // .$.......&...%.. + 0x00, 0x20, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, // . ...'.......&.. + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .;...'...(...... + 0x00, 0x15, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....)... ...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+...)...*...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...+.......... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .+...).......... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .+...)...1...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .+...)...4...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .+...)...7...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, // .+...)...:...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...V.......... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...V...W...... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...V...Y...... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...V...[...... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...V...]...... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...V..._...... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .;...V...a...... + 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .6.............. + 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x2b, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .+...y...(...*.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, // .*...=.......z.. + 0x00, 0x79, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, // .y...A...+...{.. + 0x00, 0x28, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .(...*.......=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .....|...{...A.. + 0x00, 0x2b, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .+...}...(...*.. + 0x00, 0x31, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, // .1...=.......~.. + 0x00, 0x7d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, // .}...A...+...... + 0x00, 0x28, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .(...*...4...=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x2b, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .+.......(...*.. + 0x00, 0x37, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, // .7...=.......... + 0x00, 0x81, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, // .....A...+...... + 0x00, 0x28, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .(...*...:...=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .............>.. + 0x00, 0x57, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x59, 0x00, 0x00, // .W...z...>...Y.. + 0x00, 0x7c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, // .|...>...[...~.. + 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...].......>.. + 0x00, 0x5f, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x61, 0x00, 0x00, // ._.......>...a.. + 0x00, 0x84, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x60, // .........8.....` + 0x00, // . }; static const uint8_t fs_clear5_dx11[569] = { diff --git a/bgfx/src/fs_clear5.sc b/bgfx/src/fs_clear5.sc index 9c1c2406..b8258a35 100644 --- a/bgfx/src/fs_clear5.sc +++ b/bgfx/src/fs_clear5.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/fs_clear6.bin.h b/bgfx/src/fs_clear6.bin.h index 1c28ca0b..8f29ba45 100644 --- a/bgfx/src/fs_clear6.bin.h +++ b/bgfx/src/fs_clear6.bin.h @@ -52,122 +52,99 @@ static const uint8_t fs_clear6_essl[378] = 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // bgfx_clear_colo 0x72, 0x5b, 0x36, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r[6];.}... }; -static const uint8_t fs_clear6_spv[1517] = +static const uint8_t fs_clear6_spv[1441] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, // .........p.....# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... - 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0d, // ................ + 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0c, // ................ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x43, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, // .C...^...`...b.. - 0x00, 0x64, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, // .d...f...h...j.. - 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, // ................ - 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, // ................ - 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, // .main........'.. - 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, // .UniformBlock... - 0x00, 0x06, 0x00, 0x08, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // .....'.......bgf - 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, // x_clear_color... - 0x00, 0x05, 0x00, 0x03, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....).......... - 0x00, 0x43, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, // .C...gl_FragCoor - 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // d........^...bgf - 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData0..... - 0x00, 0x60, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .`...bgfx_FragDa - 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta1......b...bgf - 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x32, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData2..... - 0x00, 0x64, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .d...bgfx_FragDa - 0x74, 0x61, 0x33, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta3......f...bgf - 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x34, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData4..... - 0x00, 0x68, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .h...bgfx_FragDa - 0x74, 0x61, 0x35, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta5......j...bgf - 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x36, 0x00, 0x00, 0x47, 0x00, 0x04, // x_FragData6..G.. - 0x00, 0x26, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // .&...........H.. - 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .'.......#...... - 0x00, 0x47, 0x00, 0x03, 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .G...'.......G.. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .)...".......G.. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .)...!.......G.. - 0x00, 0x43, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .C...........G.. - 0x00, 0x5e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .^...........G.. - 0x00, 0x60, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .`...........G.. - 0x00, 0x62, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .b...........G.. - 0x00, 0x64, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .d...........G.. - 0x00, 0x66, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .f...........G.. - 0x00, 0x68, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .h...........G.. - 0x00, 0x6a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, // .j.............. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....!.......... - 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, // ......... ...... - 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // ................ - 0x00, 0x24, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .$... .......+.. - 0x00, 0x24, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, // .$...%.......... - 0x00, 0x26, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, // .&.......%...... - 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, // .'...&... ...(.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, // .....'...;...(.. - 0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // .)...........*.. - 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // . .......+...*.. - 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, // .+....... ...,.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // .........+...*.. - 0x00, 0x2f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // ./.......+...*.. - 0x00, 0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // .2.......+...*.. - 0x00, 0x35, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // .5.......+...*.. - 0x00, 0x38, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // .8.......+...*.. - 0x00, 0x3b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // .;.......+...*.. - 0x00, 0x3e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, // .>....... ...B.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, // .........;...B.. - 0x00, 0x43, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, // .C....... ...].. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, // .........;...].. - 0x00, 0x5e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, // .^.......;...].. - 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, // .`.......;...].. - 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, // .b.......;...].. - 0x00, 0x64, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, // .d.......;...].. - 0x00, 0x66, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, // .f.......;...].. - 0x00, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, // .h.......;...].. - 0x00, 0x6a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, // .j.......6...... - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ - 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, // .....A...,...... - 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .)...+...+...=.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. - 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .,.......)...+.. - 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, // ./...=.......... - 0x00, 0x84, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, // .....A...,...... - 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .)...+...2...=.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. - 0x00, 0x2c, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .,.......)...+.. - 0x00, 0x35, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, // .5...=.......... - 0x00, 0x88, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, // .....A...,...... - 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .)...+...8...=.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. - 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .,.......)...+.. - 0x00, 0x3b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, // .;...=.......... - 0x00, 0x8c, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, // .....A...,...... - 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .)...+...>...=.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .............>.. - 0x00, 0x5e, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00, // .^.......>...`.. - 0x00, 0x85, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x62, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, // .....>...b...... - 0x00, 0x3e, 0x00, 0x03, 0x00, 0x64, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...d.......>.. - 0x00, 0x66, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x68, 0x00, 0x00, // .f.......>...h.. - 0x00, 0x8d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, // .....>...j...... - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x70, 0x00, // .....8.....p. -}; -static const uint8_t fs_clear6_dx9[242] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b - 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, // ................ - 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // ...".CTAB....[.. - 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .T...0.......... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .D.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // ear_color....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x01, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x08, 0x0f, // ................ - 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xe4, // ................ - 0xa0, 0x01, 0x00, 0x00, 0x02, 0x03, 0x08, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0xff, 0xff, 0x00, // ................ - 0x00, 0x00, // .. + 0x00, 0x5e, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, // .^...`...b...d.. + 0x00, 0x66, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, // .f...h...j...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, // ................ + 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai + 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, // n........'...Uni + 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, // formBlock....... + 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .'.......bgfx_cl + 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, // ear_color....... + 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x00, // .)...........^.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, // .bgfx_FragData0. + 0x00, 0x05, 0x00, 0x06, 0x00, 0x60, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....`...bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x62, 0x00, 0x00, // agData1......b.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x32, 0x00, // .bgfx_FragData2. + 0x00, 0x05, 0x00, 0x06, 0x00, 0x64, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....d...bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x33, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00, // agData3......f.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x34, 0x00, // .bgfx_FragData4. + 0x00, 0x05, 0x00, 0x06, 0x00, 0x68, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....h...bgfx_Fr + 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x35, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x6a, 0x00, 0x00, // agData5......j.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x36, 0x00, // .bgfx_FragData6. + 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // .G...&.......... + 0x00, 0x48, 0x00, 0x05, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...'.......#.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....G...'...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...)..."...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .G...)...!...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...^.......... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .G...`.......... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .G...b.......... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .G...d.......... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x66, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .G...f.......... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x68, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, // .G...h.......... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // .G...j.......... + 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, // .........!...... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // ............. .. + 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x15, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....$... ...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .+...$...%...... + 0x00, 0x1c, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, // .....&.......%.. + 0x00, 0x1e, 0x00, 0x03, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .....'...&... .. + 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .(.......'...;.. + 0x00, 0x28, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // .(...).......... + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .*... .......+.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .*...+....... .. + 0x00, 0x2c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .,...........+.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .*.../.......+.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .*...2.......+.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .*...5.......+.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .*...8.......+.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .*...;.......+.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .*...>....... .. + 0x00, 0x5d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .]...........;.. + 0x00, 0x5d, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .]...^.......;.. + 0x00, 0x5d, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .]...`.......;.. + 0x00, 0x5d, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .]...b.......;.. + 0x00, 0x5d, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .]...d.......;.. + 0x00, 0x5d, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .]...f.......;.. + 0x00, 0x5d, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .]...h.......;.. + 0x00, 0x5d, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, // .]...j.......6.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, // .........A...,.. + 0x00, 0x82, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .....)...+...+.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, // .=.............. + 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .A...,.......).. + 0x00, 0x2b, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .+.../...=...... + 0x00, 0x85, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, // .........A...,.. + 0x00, 0x86, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .....)...+...2.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, // .=.............. + 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .A...,.......).. + 0x00, 0x2b, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .+...5...=...... + 0x00, 0x89, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, // .........A...,.. + 0x00, 0x8a, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, // .....)...+...8.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, // .=.............. + 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .A...,.......).. + 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .+...;...=...... + 0x00, 0x8d, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x00, // .........A...,.. + 0x00, 0x8e, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, // .....)...+...>.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, // .=.............. + 0x00, 0x3e, 0x00, 0x03, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...^.......>.. + 0x00, 0x60, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x62, 0x00, 0x00, // .`.......>...b.. + 0x00, 0x87, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x64, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, // .....>...d...... + 0x00, 0x3e, 0x00, 0x03, 0x00, 0x66, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...f.......>.. + 0x00, 0x68, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x6a, 0x00, 0x00, // .h.......>...j.. + 0x00, 0x8f, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x70, // .........8.....p + 0x00, // . }; static const uint8_t fs_clear6_dx11[629] = { diff --git a/bgfx/src/fs_clear6.sc b/bgfx/src/fs_clear6.sc index af5dcbbd..77f7b632 100644 --- a/bgfx/src/fs_clear6.sc +++ b/bgfx/src/fs_clear6.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/fs_clear7.bin.h b/bgfx/src/fs_clear7.bin.h index 2f4c84a4..a88a1b83 100644 --- a/bgfx/src/fs_clear7.bin.h +++ b/bgfx/src/fs_clear7.bin.h @@ -58,130 +58,107 @@ static const uint8_t fs_clear7_essl[418] = 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x37, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, // ear_color[7];.}. 0x0a, 0x00, // .. }; -static const uint8_t fs_clear7_spv[1645] = +static const uint8_t fs_clear7_spv[1569] = { 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x06, 0x00, 0x00, 0x03, 0x02, 0x23, // .........<.....# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... - 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0e, // ................ + 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0d, // ................ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x47, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, // .G...e...g...i.. - 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, // .k...m...o...q.. - 0x00, 0x73, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, // .s.............. - 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, // ................ - 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....main....... - 0x00, 0x28, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, // .(...UniformBloc - 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // k........(...... - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // .bgfx_clear_colo - 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r........*...... - 0x00, 0x05, 0x00, 0x06, 0x00, 0x47, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // .....G...gl_Frag - 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x65, 0x00, 0x00, // Coord........e.. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, // .bgfx_FragData0. - 0x00, 0x05, 0x00, 0x06, 0x00, 0x67, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....g...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x69, 0x00, 0x00, // agData1......i.. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x32, 0x00, // .bgfx_FragData2. - 0x00, 0x05, 0x00, 0x06, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....k...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x33, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x6d, 0x00, 0x00, // agData3......m.. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x34, 0x00, // .bgfx_FragData4. - 0x00, 0x05, 0x00, 0x06, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....o...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x35, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x71, 0x00, 0x00, // agData5......q.. - 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x36, 0x00, // .bgfx_FragData6. - 0x00, 0x05, 0x00, 0x06, 0x00, 0x73, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, // .....s...bgfx_Fr - 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x37, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // agData7..G...'.. - 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, // .........H...(.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .....#.......G.. - 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // .(.......G...*.. - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // .".......G...*.. - 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x47, 0x00, 0x00, // .!.......G...G.. - 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x65, 0x00, 0x00, // .........G...e.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, // .........G...g.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, // .........G...i.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6b, 0x00, 0x00, // .........G...k.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6d, 0x00, 0x00, // .........G...m.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6f, 0x00, 0x00, // .........G...o.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x71, 0x00, 0x00, // .........G...q.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x73, 0x00, 0x00, // .........G...s.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, // ................ - 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, // .!.............. - 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // ..... .......... - 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, // .............%.. - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, // . .......+...%.. - 0x00, 0x26, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .&...........'.. - 0x00, 0x08, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x28, 0x00, 0x00, // .....&.......(.. - 0x00, 0x27, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .'... ...)...... - 0x00, 0x28, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .(...;...)...*.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // .........+... .. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .....+...+...,.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ..... ...-...... - 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, // .....+...+...0.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, // .....+...+...3.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // .....+...+...6.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, // .....+...+...9.. - 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, // .....+...+...<.. - 0x00, 0x05, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // .....+...+...?.. - 0x00, 0x06, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, // .....+...+...B.. - 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x46, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ..... ...F...... - 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x46, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, // .....;...F...G.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ..... ...d...... - 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, // .....;...d...e.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, // .....;...d...g.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, // .....;...d...i.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, // .....;...d...k.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, // .....;...d...m.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, // .....;...d...o.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, // .....;...d...q.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, // .....;...d...s.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .....6.......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, // ................ - 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .A...-.......*.. - 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .,...,...=...... - 0x00, 0x8c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, // .........A...-.. - 0x00, 0x8d, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, // .....*...,...0.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, // .=.............. - 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .A...-.......*.. - 0x00, 0x2c, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .,...3...=...... - 0x00, 0x90, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, // .........A...-.. - 0x00, 0x91, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // .....*...,...6.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // .=.............. - 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .A...-.......*.. - 0x00, 0x2c, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .,...9...=...... - 0x00, 0x94, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, // .........A...-.. - 0x00, 0x95, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, // .....*...,...<.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, // .=.............. - 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .A...-.......*.. - 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .,...?...=...... - 0x00, 0x98, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, // .........A...-.. - 0x00, 0x99, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, // .....*...,...B.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, // .=.............. - 0x00, 0x3e, 0x00, 0x03, 0x00, 0x65, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...e.......>.. - 0x00, 0x67, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x69, 0x00, 0x00, // .g.......>...i.. - 0x00, 0x90, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, // .....>...k...... - 0x00, 0x3e, 0x00, 0x03, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...m.......>.. - 0x00, 0x6f, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x71, 0x00, 0x00, // .o.......>...q.. - 0x00, 0x98, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x73, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, // .....>...s...... - 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, // .....8....... -}; -static const uint8_t fs_clear7_dx9[242] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // FSH............b - 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, // gfx_clear_color. - 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, // ................ - 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // ...".CTAB....[.. - 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .T...0.......... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .D.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // ear_color....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, // .............ps_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x01, 0x00, 0x00, // mpiler 10.1..... - 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x08, 0x0f, // ................ - 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xe4, // ................ - 0xa0, 0x01, 0x00, 0x00, 0x02, 0x03, 0x08, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0xff, 0xff, 0x00, // ................ - 0x00, 0x00, // .. + 0x00, 0x65, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, // .e...g...i...k.. + 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, // .m...o...q...s.. + 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, // ................ + 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x28, 0x00, 0x00, // .main........(.. + 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, // .UniformBlock... + 0x00, 0x06, 0x00, 0x08, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // .....(.......bgf + 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, // x_clear_color... + 0x00, 0x05, 0x00, 0x03, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....*.......... + 0x00, 0x65, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .e...bgfx_FragDa + 0x74, 0x61, 0x30, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x67, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta0......g...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x31, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData1..... + 0x00, 0x69, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .i...bgfx_FragDa + 0x74, 0x61, 0x32, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta2......k...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x33, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData3..... + 0x00, 0x6d, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .m...bgfx_FragDa + 0x74, 0x61, 0x34, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta4......o...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x35, 0x00, 0x00, 0x05, 0x00, 0x06, // x_FragData5..... + 0x00, 0x71, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // .q...bgfx_FragDa + 0x74, 0x61, 0x36, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x73, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta6......s...bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x37, 0x00, 0x00, 0x47, 0x00, 0x04, // x_FragData7..G.. + 0x00, 0x27, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // .'...........H.. + 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .(.......#...... + 0x00, 0x47, 0x00, 0x03, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .G...(.......G.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .*...".......G.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .*...!.......G.. + 0x00, 0x65, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .e...........G.. + 0x00, 0x67, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .g...........G.. + 0x00, 0x69, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .i...........G.. + 0x00, 0x6b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .k...........G.. + 0x00, 0x6d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .m...........G.. + 0x00, 0x6f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .o...........G.. + 0x00, 0x71, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .q...........G.. + 0x00, 0x73, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, // .s.............. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .....!.......... + 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, // ......... ...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // ................ + 0x00, 0x25, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .%... .......+.. + 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, // .%...&.......... + 0x00, 0x27, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, // .'.......&...... + 0x00, 0x28, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, // .(...'... ...).. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, // .....(...;...).. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // .*...........+.. + 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // . .......+...+.. + 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, // .,....... ...-.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // .........+...+.. + 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // .0.......+...+.. + 0x00, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // .3.......+...+.. + 0x00, 0x36, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // .6.......+...+.. + 0x00, 0x39, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // .9.......+...+.. + 0x00, 0x3c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // .<.......+...+.. + 0x00, 0x3f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // .?.......+...+.. + 0x00, 0x42, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, // .B....... ...d.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, // .........;...d.. + 0x00, 0x65, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, // .e.......;...d.. + 0x00, 0x67, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, // .g.......;...d.. + 0x00, 0x69, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, // .i.......;...d.. + 0x00, 0x6b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, // .k.......;...d.. + 0x00, 0x6d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, // .m.......;...d.. + 0x00, 0x6f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, // .o.......;...d.. + 0x00, 0x71, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, // .q.......;...d.. + 0x00, 0x73, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, // .s.......6...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, // .....A...-...... + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .*...,...,...=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x2d, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .-.......*...,.. + 0x00, 0x30, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, // .0...=.......... + 0x00, 0x8d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, // .....A...-...... + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .*...,...3...=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x2d, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .-.......*...,.. + 0x00, 0x36, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, // .6...=.......... + 0x00, 0x91, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, // .....A...-...... + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .*...,...9...=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x2d, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .-.......*...,.. + 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, // .<...=.......... + 0x00, 0x95, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, // .....A...-...... + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .*...,...?...=.. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x2d, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .-.......*...,.. + 0x00, 0x42, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, // .B...=.......... + 0x00, 0x99, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x65, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, // .....>...e...... + 0x00, 0x3e, 0x00, 0x03, 0x00, 0x67, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...g.......>.. + 0x00, 0x69, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x6b, 0x00, 0x00, // .i.......>...k.. + 0x00, 0x92, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, // .....>...m...... + 0x00, 0x3e, 0x00, 0x03, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...o.......>.. + 0x00, 0x71, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x73, 0x00, 0x00, // .q.......>...s.. + 0x00, 0x9a, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, // .........8...... + 0x00, // . }; static const uint8_t fs_clear7_dx11[689] = { diff --git a/bgfx/src/fs_clear7.sc b/bgfx/src/fs_clear7.sc index 0abe6e3a..bd4a025b 100644 --- a/bgfx/src/fs_clear7.sc +++ b/bgfx/src/fs_clear7.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/fs_debugfont.bin.h b/bgfx/src/fs_debugfont.bin.h index 8d08bca7..b39bfeb6 100644 --- a/bgfx/src/fs_debugfont.bin.h +++ b/bgfx/src/fs_debugfont.bin.h @@ -49,156 +49,124 @@ static const uint8_t fs_debugfont_essl[362] = 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, // FragColor = tmpv 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ar_1;.}... }; -static const uint8_t fs_debugfont_spv[1155] = +static const uint8_t fs_debugfont_spv[1095] = { 0x46, 0x53, 0x48, 0x0b, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH..."f.......s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // _texColor0...... - 0x02, 0x1a, 0x00, 0x58, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, // ...X.....#...... + 0x02, 0x22, 0x00, 0x1c, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, // .".......#...... 0x00, 0x08, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ................ 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, // ...........GLSL. 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, // std.450......... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x6d, // ...main....j...m - 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x10, // ...p...t........ - 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, // ................ - 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m - 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x73, // ain........*...s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler - 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......-...s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, // ColorTexture.... - 0x00, 0x06, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // ...j...gl_FragCo - 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x76, // ord........m...v - 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x70, // _color0........p - 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x00, 0x00, 0x00, 0x00, 0x05, // ...v_color1..... - 0x00, 0x05, 0x00, 0x74, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // ...t...v_texcoor - 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x83, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, // d0.........bgfx_ - 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2a, // FragData0..G...* - 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2a, // ...".......G...* - 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2d, // ...!.......G...- - 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2d, // ...".......G...- - 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6a, // ...!.......G...j - 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6d, // ...........G...m - 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x70, // ...........G...p - 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x74, // ...........G...t - 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x83, // ...........G.... - 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, // ...!............ - 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, // ....... ...).... - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, // .......;...)...* - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, // ....... ...,.... - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2d, // .......;...,...- - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x39, 0x00, 0x00, 0x00, 0x08, // ...........9.... - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x81, // ...+.......a.... - 0x80, 0x80, 0x3b, 0x14, 0x00, 0x02, 0x00, 0x62, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x69, // ..;....b... ...i - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x69, // ...........;...i - 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x69, // ...j.......;...i - 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x69, // ...m.......;...i - 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x73, // ...p....... ...s - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x73, // ...........;...s - 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x82, // ...t....... .... - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x82, // ...........;.... - 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, // ...........6.... - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, // ................ - 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2b, // .......=.......+ - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2e, // ...*...=........ - 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x6e, // ...-...=.......n - 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x71, // ...m...=.......q - 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x75, // ...p...=.......u - 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x39, 0x00, 0x00, 0x00, 0xbf, // ...t...V...9.... - 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, // .......+...W.... - 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x4f, // ...........u...O - 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc1, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0xa9, // .......q...n.... - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xc7, // ...Q............ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x62, 0x00, 0x00, 0x00, 0xad, // ...........b.... - 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xaf, // .......a........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xad, 0x00, 0x00, 0x00, 0xae, // ................ - 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xae, 0x00, 0x00, 0x00, 0xfc, // ................ - 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x83, // ...........>.... - 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, // ...........8.... - 0x00, 0x00, 0x00, // ... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x70, // ...main....m...p + 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, // ...t............ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, // ................ + 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. + 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......*...s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, // ColorSampler.... + 0x00, 0x07, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...-...s_texColo + 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x6d, // rTexture.......m + 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, // ...v_color0..... + 0x00, 0x05, 0x00, 0x70, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x00, // ...p...v_color1. + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x74, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, // .......t...v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x83, 0x00, 0x00, 0x00, 0x62, // coord0.........b + 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, // gfx_FragData0..G + 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...*...".......G + 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, // ...*...!.......G + 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...-...".......G + 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, // ...-...!.......G + 0x00, 0x04, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...m...........G + 0x00, 0x04, 0x00, 0x70, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...p...........G + 0x00, 0x04, 0x00, 0x74, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, // ...t...........G + 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, // ................ + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // .......!........ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, // ... ............ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, // ................ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x29, // ........... ...) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x29, // ...........;...) + 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2c, // ...*....... ..., + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2c, // ...........;..., + 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x39, // ...-...........9 + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x61, // .......+.......a + 0x00, 0x00, 0x00, 0x81, 0x80, 0x80, 0x3b, 0x14, 0x00, 0x02, 0x00, 0x62, 0x00, 0x00, 0x00, 0x20, // ......;....b... + 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, // ...i...........; + 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, // ...i...m.......; + 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...i...p....... + 0x00, 0x04, 0x00, 0x73, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, // ...s...........; + 0x00, 0x04, 0x00, 0x73, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...s...t....... + 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, // ...............; + 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, // ...............6 + 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=.... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...+...*...=.... + 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, // .......-...=.... + 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, // ...n...m...=.... + 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, // ...q...p...=.... + 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x39, // ...u...t...V...9 + 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x57, // ...........+...W + 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x75, // ...............u + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xc1, // ...O............ + 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc7, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x6e, // ...........q...n + 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xac, // .......Q........ + 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x62, // ...............b + 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0xf7, // ...........a.... + 0x00, 0x03, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xad, // ................ + 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xae, // ................ + 0x00, 0x00, 0x00, 0xfc, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x3e, // ...............> + 0x00, 0x03, 0x00, 0x83, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, // ...............8 + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... }; -static const uint8_t fs_debugfont_dx9[372] = +static const uint8_t fs_debugfont_dx11[547] = { 0x46, 0x53, 0x48, 0x0b, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, // FSH..."f.......s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x4c, 0x01, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, // ...L......... .C - 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, // TAB....S........ - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, // ...........L...0 - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, // ...........<.... - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, // ...s_texColor... - 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, // ...............p - 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, // s_3_0.Microsoft - 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, // (R) HLSL Shader - 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, // Compiler 10.1..Q - 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x81, 0x80, 0x80, 0xbb, 0x00, 0x00, 0x00, 0x80, 0x00, // ................ - 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, // ................ - 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, // ................ - 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x02, // .......B........ - 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0x80, 0x01, // ................ - 0x00, 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x81, 0x00, // ................ - 0x00, 0xe4, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x00, // ................ - 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x01, // .......X........ - 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x41, 0x00, 0x00, 0x01, 0x01, // .....U.....A.... - 0x00, 0x0f, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0xff, // ................ - 0xff, 0x00, 0x00, 0x00, // .... -}; -static const uint8_t fs_debugfont_dx11[568] = -{ - 0x46, 0x53, 0x48, 0x0b, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH..."f.......s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, // ....s_texColor0. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0x5a, 0xd5, 0xe8, 0x3a, 0x43, 0x7d, 0xa8, 0x34, 0xa8, 0x0a, 0x2d, 0x0c, 0xa2, 0xce, 0x50, 0x4f, // Z..:C}.4..-...PO - 0x01, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... - 0xb8, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x84, 0x00, 0x00, 0x00, // ........ISGN.... - 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........h....... - 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................ - 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // t............... - 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........t....... - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ - 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // z............... - 0x03, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT - 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, // ION.COLOR.TEXCOO - 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // RD..OSGN,....... - 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ........... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, // ............SV_T - 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x04, 0x01, 0x00, 0x00, // ARGET...SHDR.... - 0x40, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, // @...A...Z....`.. - 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....X....p...... - 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // UU..b........... - 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // b...........b... - 0x32, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // 2.......e.... .. - 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, // ....h.......E... - 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ........F....... - 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F~.......`...... - 0x00, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // ............F... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....F...A....... - 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // 2............... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // ....F.......F... - 0x02, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....1........... - 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x81, 0x80, 0x80, 0x3b, // :........@.....; - 0x0d, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ............6... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... - 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // >....... + 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x5a, 0xd5, 0xe8, 0x3a, 0x43, // .......DXBCZ..:C + 0x7d, 0xa8, 0x34, 0xa8, 0x0a, 0x2d, 0x0c, 0xa2, 0xce, 0x50, 0x4f, 0x01, 0x00, 0x00, 0x00, 0xf8, // }.4..-...PO..... + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0xec, // .......,........ + 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x84, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, // ...ISGN......... + 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, // ...h............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, // ...........t.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x0f, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...t............ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, // ...........z.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, // ................ + 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, // ...SV_POSITION.C + 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, // OLOR.TEXCOORD..O + 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, // SGN,........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, // .......SV_TARGET + 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x04, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x41, // ...SHDR....@...A + 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, // ...Z....`......X + 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, // ....p......UU..b + 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, // ...........b.... + 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x03, // .......b...2.... + 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, // ...e.... ......h + 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......E........ + 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, // ...F.......F~... + 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, // ....`........... + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......F.......F + 0x1e, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, // ...A.......2.... + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...............F + 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x31, // .......F.......1 + 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, // ...........:.... + 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x81, 0x80, 0x80, 0x3b, 0x0d, 0x00, 0x04, 0x03, 0x0a, // ....@.....;..... + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, // .......6.... ... + 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, // ...F.......>.... + 0x00, 0x00, 0x00, // ... }; -static const uint8_t fs_debugfont_mtl[831] = +static const uint8_t fs_debugfont_mtl[843] = { 0x46, 0x53, 0x48, 0x0b, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x11, 0x73, // FSH..."f.......s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x02, 0x00, 0x00, 0x23, // r..............# + 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x02, 0x00, 0x00, 0x23, // r..............# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, // include .#include 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, // ..u @@ -238,13 +206,14 @@ static const uint8_t fs_debugfont_mtl[831] = 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2c, 0x20, 0x5f, 0x31, 0x39, // in.v_color0, _19 0x30, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // 0.xxxx);. if 0x28, 0x5f, 0x31, 0x39, 0x36, 0x2e, 0x77, 0x20, 0x3c, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x39, // (_196.w < 0.0039 - 0x32, 0x31, 0x35, 0x36, 0x38, 0x38, 0x35, 0x39, 0x33, 0x36, 0x38, 0x35, 0x36, 0x32, 0x37, 0x29, // 215688593685627) - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, // . {. d - 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x28, // iscard_fragment( - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, // );. }. out - 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, // .bgfx_FragData0 - 0x3d, 0x20, 0x5f, 0x31, 0x39, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // = _196;. retu - 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, 0x00, // rn out;.}.... . + 0x32, 0x31, 0x35, 0x36, 0x38, 0x38, 0x35, 0x39, 0x33, 0x36, 0x38, 0x35, 0x36, 0x32, 0x36, 0x39, // 2156885936856269 + 0x38, 0x33, 0x36, 0x34, 0x32, 0x35, 0x37, 0x38, 0x31, 0x32, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, // 83642578125). + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x63, 0x61, // {. disca + 0x72, 0x64, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x3b, 0x0a, 0x20, // rd_fragment();. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, // }. out.bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x31, // x_FragData0 = _1 + 0x39, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, // 96;. return o + 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, 0x00, // ut;.}.... . }; extern const uint8_t* fs_debugfont_pssl; extern const uint32_t fs_debugfont_pssl_size; diff --git a/bgfx/src/fs_debugfont.sc b/bgfx/src/fs_debugfont.sc index ca6f2165..07460e16 100644 --- a/bgfx/src/fs_debugfont.sc +++ b/bgfx/src/fs_debugfont.sc @@ -1,7 +1,7 @@ $input v_color0, v_color1, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/glcontext_egl.cpp b/bgfx/src/glcontext_egl.cpp index dde4ead3..273c40b9 100644 --- a/bgfx/src/glcontext_egl.cpp +++ b/bgfx/src/glcontext_egl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -71,6 +71,7 @@ namespace bgfx { namespace gl EGL_IMPORT_FUNC(PFNEGLGETPROCADDRESSPROC, eglGetProcAddress); \ EGL_IMPORT_FUNC(PFNEGLINITIALIZEPROC, eglInitialize); \ EGL_IMPORT_FUNC(PFNEGLMAKECURRENTPROC, eglMakeCurrent); \ + EGL_IMPORT_FUNC(PFNEGLRELEASETHREADPROC, eglReleaseThread); \ EGL_IMPORT_FUNC(PFNEGLSWAPBUFFERSPROC, eglSwapBuffers); \ EGL_IMPORT_FUNC(PFNEGLSWAPINTERVALPROC, eglSwapInterval); \ EGL_IMPORT_FUNC(PFNEGLTERMINATEPROC, eglTerminate); \ @@ -123,6 +124,43 @@ EGL_IMPORT } #endif // BGFX_USE_GL_DYNAMIC_LIB +#if BX_PLATFORM_LINUX +# define WL_EGL_IMPORT \ + WL_EGL_FUNC(struct wl_egl_window *, wl_egl_window_create, (struct wl_surface *, int, int) ) \ + WL_EGL_FUNC(void, wl_egl_window_destroy, (struct wl_egl_window *)) \ + WL_EGL_FUNC(void, wl_egl_window_resize, (struct wl_egl_window *, int, int, int, int)) \ + WL_EGL_FUNC(void, wl_egl_window_get_attached_size, (struct wl_egl_window *, int *, int *) ) \ + +# define WL_EGL_FUNC(rt, fname, params) \ + typedef rt(*PFNWLEGL_##fname) params; \ + PFNWLEGL_##fname BGFX_WAYLAND_##fname; + +WL_EGL_IMPORT + +# undef WL_EGL_FUNC + + void* waylandEglOpen() + { + void* handle = bx::dlopen("libwayland-egl.so.1"); + BGFX_FATAL(handle != NULL, Fatal::UnableToInitialize, "Could not dlopen() libwayland-egl.so.1"); + +# define WL_EGL_FUNC(rt, fname, params) BGFX_WAYLAND_##fname = (PFNWLEGL_##fname) bx::dlsym(handle, #fname); + WL_EGL_IMPORT +# undef WL_EGL_FUNC + + return handle; + } + + void waylandEglClose(void* _handle) + { + bx::dlclose(_handle); + +# define WL_EGL_FUNC(rt, fname, params) BGFX_WAYLAND_##fname = NULL; + WL_EGL_IMPORT +# undef WL_EGL_FUNC + } +#endif // BX_PLATFORM_LINUX + # define GL_IMPORT(_optional, _proto, _func, _import) _proto _func = NULL # include "glimports.h" @@ -130,18 +168,32 @@ EGL_IMPORT struct SwapChainGL { - SwapChainGL(EGLDisplay _display, EGLConfig _config, EGLContext _context, EGLNativeWindowType _nwh) + SwapChainGL(EGLDisplay _display, EGLConfig _config, EGLContext _context, EGLNativeWindowType _nwh, int _width, int _height) : m_nwh(_nwh) , m_display(_display) +# if BX_PLATFORM_LINUX + , m_eglWindow(NULL) +# endif { EGLSurface defaultSurface = eglGetCurrentSurface(EGL_DRAW); + BX_UNUSED(_width, _height); + if (EGLNativeWindowType(0) == _nwh) { m_surface = eglCreatePbufferSurface(m_display, _config, NULL); } else { +# if BX_PLATFORM_LINUX + if (g_platformData.type == NativeWindowHandleType::Wayland) + { + // A wl_surface needs to be first wrapped in a wl_egl_window + // before it can be used to create the EGLSurface. + m_eglWindow = BGFX_WAYLAND_wl_egl_window_create( (wl_surface*)_nwh, _width, _height); + _nwh = (EGLNativeWindowType) m_eglWindow; + } +# endif m_surface = eglCreateWindowSurface(m_display, _config, _nwh, NULL); } @@ -169,6 +221,12 @@ EGL_IMPORT EGL_CHECK(eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) ); EGL_CHECK(eglDestroyContext(m_display, m_context) ); EGL_CHECK(eglDestroySurface(m_display, m_surface) ); +# if BX_PLATFORM_LINUX + if (m_eglWindow) + { + BGFX_WAYLAND_wl_egl_window_destroy(m_eglWindow); + } +# endif EGL_CHECK(eglMakeCurrent(m_display, defaultSurface, defaultSurface, defaultContext) ); } @@ -186,6 +244,9 @@ EGL_IMPORT EGLContext m_context; EGLDisplay m_display; EGLSurface m_surface; +# if BX_PLATFORM_LINUX + wl_egl_window *m_eglWindow; +# endif }; # if BX_PLATFORM_RPI @@ -200,7 +261,7 @@ EGL_IMPORT bcm_host_init(); # endif // BX_PLATFORM_RPI - m_eglLibrary = eglOpen(); + m_eglDll = eglOpen(); if (NULL == g_platformData.context) { @@ -219,7 +280,7 @@ EGL_IMPORT } # endif // BX_PLATFORM_WINDOWS - m_display = eglGetDisplay(NULL == ndt ? EGL_DEFAULT_DISPLAY : ndt); + m_display = eglGetDisplay(NULL == ndt ? EGL_DEFAULT_DISPLAY : ndt); BGFX_FATAL(m_display != EGL_NO_DISPLAY, Fatal::UnableToInitialize, "Failed to create display %p", m_display); EGLint major = 0; @@ -328,6 +389,13 @@ EGL_IMPORT vc_dispmanx_update_submit_sync(dispmanUpdate); # endif // BX_PLATFORM_ANDROID +# if BX_PLATFORM_LINUX + if (g_platformData.type == NativeWindowHandleType::Wayland) + { + m_waylandEglDll = waylandEglOpen(); + } +# endif + if (headless) { EGLint pbAttribs[] = @@ -342,6 +410,15 @@ EGL_IMPORT } else { +# if BX_PLATFORM_LINUX + if (g_platformData.type == NativeWindowHandleType::Wayland) + { + // A wl_surface needs to be first wrapped in a wl_egl_window + // before it can be used to create the EGLSurface. + m_eglWindow = BGFX_WAYLAND_wl_egl_window_create( (wl_surface*)nwh, _width, _height); + nwh = (EGLNativeWindowType) m_eglWindow; + } +# endif m_surface = eglCreateWindowSurface(m_display, m_config, nwh, NULL); } @@ -424,16 +501,29 @@ EGL_IMPORT void GlContext::destroy() { + BX_TRACE("GLContext::destroy()"); if (NULL != m_display) { EGL_CHECK(eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) ); EGL_CHECK(eglDestroyContext(m_display, m_context) ); EGL_CHECK(eglDestroySurface(m_display, m_surface) ); + +# if BX_PLATFORM_LINUX + if (m_eglWindow) + { + BGFX_WAYLAND_wl_egl_window_destroy(m_eglWindow); + waylandEglClose(m_waylandEglDll); + m_waylandEglDll = NULL; + } +# endif + EGL_CHECK(eglTerminate(m_display) ); m_context = NULL; } - eglClose(m_eglLibrary); + EGL_CHECK(eglReleaseThread() ); + eglClose(m_eglDll); + m_eglDll = NULL; # if BX_PLATFORM_RPI bcm_host_deinit(); @@ -459,6 +549,11 @@ EGL_IMPORT } # elif BX_PLATFORM_EMSCRIPTEN EMSCRIPTEN_CHECK(emscripten_set_canvas_element_size(HTML5_TARGET_CANVAS_SELECTOR, _width, _height) ); +# elif BX_PLATFORM_LINUX + if (NULL != m_eglWindow) + { + BGFX_WAYLAND_wl_egl_window_resize(m_eglWindow, _width, _height, 0, 0); + } # else BX_UNUSED(_width, _height); # endif // BX_PLATFORM_* @@ -482,9 +577,9 @@ EGL_IMPORT ; } - SwapChainGL* GlContext::createSwapChain(void* _nwh) + SwapChainGL* GlContext::createSwapChain(void* _nwh, int _width, int _height) { - return BX_NEW(g_allocator, SwapChainGL)(m_display, m_config, m_context, (EGLNativeWindowType)_nwh); + return BX_NEW(g_allocator, SwapChainGL)(m_display, m_config, m_context, (EGLNativeWindowType)_nwh, _width, _height); } void GlContext::destroySwapChain(SwapChainGL* _swapChain) diff --git a/bgfx/src/glcontext_egl.h b/bgfx/src/glcontext_egl.h index 0b58c10b..6848978f 100644 --- a/bgfx/src/glcontext_egl.h +++ b/bgfx/src/glcontext_egl.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -11,6 +11,8 @@ #include #include +struct wl_egl_window; + // EGL pulls X11 crap... #if defined(None) # undef None @@ -31,10 +33,15 @@ namespace bgfx { namespace gl struct GlContext { GlContext() - : m_current(NULL) + : m_eglDll(NULL) + , m_current(NULL) , m_context(NULL) , m_display(NULL) , m_surface(NULL) +#if BX_PLATFORM_LINUX + , m_waylandEglDll(NULL) + , m_eglWindow(NULL) +#endif , m_msaaContext(false) { } @@ -44,7 +51,7 @@ namespace bgfx { namespace gl void resize(uint32_t _width, uint32_t _height, uint32_t _flags); uint64_t getCaps() const; - SwapChainGL* createSwapChain(void* _nwh); + SwapChainGL* createSwapChain(void* _nwh, int _w, int _h); void destroySwapChain(SwapChainGL* _swapChain); void swap(SwapChainGL* _swapChain = NULL); void makeCurrent(SwapChainGL* _swapChain = NULL); @@ -56,12 +63,18 @@ namespace bgfx { namespace gl return NULL != m_context; } - void* m_eglLibrary; + void* m_eglDll; SwapChainGL* m_current; EGLConfig m_config; EGLContext m_context; EGLDisplay m_display; EGLSurface m_surface; + +#if BX_PLATFORM_LINUX + void* m_waylandEglDll; + struct wl_egl_window *m_eglWindow; +#endif + // true when MSAA is handled by the context instead of using MSAA FBO bool m_msaaContext; }; diff --git a/bgfx/src/glcontext_html5.cpp b/bgfx/src/glcontext_html5.cpp index db1dbf1d..ee126569 100644 --- a/bgfx/src/glcontext_html5.cpp +++ b/bgfx/src/glcontext_html5.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -71,7 +71,7 @@ namespace bgfx { namespace gl const char* canvas = (const char*) g_platformData.nwh; - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = (EMSCRIPTEN_WEBGL_CONTEXT_HANDLE) g_platformData.context; + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = bx::narrowCast((uintptr_t) g_platformData.context); if (context > 0) { if (emscripten_webgl_get_context_attributes(context, &s_attrs) >= 0) @@ -86,7 +86,7 @@ namespace bgfx { namespace gl } else { - m_primary = createSwapChain((void*)canvas); + m_primary = createSwapChain((void*)canvas, (int)_width, (int)_height); } if (0 != _width @@ -122,9 +122,10 @@ namespace bgfx { namespace gl EMSCRIPTEN_CHECK(emscripten_set_canvas_element_size(m_primary->m_canvas, (int) _width, (int) _height) ); } - SwapChainGL* GlContext::createSwapChain(void* _nwh) + SwapChainGL* GlContext::createSwapChain(void* _nwh, int _width, int _height) { emscripten_webgl_init_context_attributes(&s_attrs); + BX_UNUSED(_width, _height); // Work around bug https://bugs.chromium.org/p/chromium/issues/detail?id=1045643 in Chrome // by having alpha always enabled. diff --git a/bgfx/src/glcontext_html5.h b/bgfx/src/glcontext_html5.h index 26018ae9..49757892 100644 --- a/bgfx/src/glcontext_html5.h +++ b/bgfx/src/glcontext_html5.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -26,7 +26,7 @@ namespace bgfx { namespace gl void resize(uint32_t _width, uint32_t _height, uint32_t _flags); uint64_t getCaps() const; - SwapChainGL* createSwapChain(void* _nwh); + SwapChainGL* createSwapChain(void* _nwh, int _width, int _height); void destroySwapChain(SwapChainGL* _swapChain); void swap(SwapChainGL* _swapChain = NULL); void makeCurrent(SwapChainGL* _swapChain = NULL); diff --git a/bgfx/src/glcontext_wgl.cpp b/bgfx/src/glcontext_wgl.cpp index ce8f353f..71fe6359 100644 --- a/bgfx/src/glcontext_wgl.cpp +++ b/bgfx/src/glcontext_wgl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -272,7 +272,7 @@ namespace bgfx { namespace gl } BGFX_FATAL(NULL != m_context, Fatal::UnableToInitialize, "Failed to create context 0x%08x.", GetLastError() ); - BX_STATIC_ASSERT(sizeof(contextAttrs) == sizeof(m_contextAttrs) ); + static_assert(sizeof(contextAttrs) == sizeof(m_contextAttrs) ); bx::memCopy(m_contextAttrs, contextAttrs, sizeof(contextAttrs) ); } @@ -335,8 +335,9 @@ namespace bgfx { namespace gl return BGFX_CAPS_SWAP_CHAIN; } - SwapChainGL* GlContext::createSwapChain(void* _nwh) + SwapChainGL* GlContext::createSwapChain(void* _nwh, int _width, int _height) { + BX_UNUSED(_width, _height); SwapChainGL* swapChain = BX_NEW(g_allocator, SwapChainGL)(_nwh); int result = SetPixelFormat(swapChain->m_hdc, m_pixelFormat, &m_pfd); diff --git a/bgfx/src/glcontext_wgl.h b/bgfx/src/glcontext_wgl.h index 0560fbf6..abe94366 100644 --- a/bgfx/src/glcontext_wgl.h +++ b/bgfx/src/glcontext_wgl.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -74,7 +74,7 @@ typedef void (APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum z void resize(uint32_t _width, uint32_t _height, uint32_t _flags); uint64_t getCaps() const; - SwapChainGL* createSwapChain(void* _nwh); + SwapChainGL* createSwapChain(void* _nwh, int _width, int _height); void destroySwapChain(SwapChainGL* _swapChain); void swap(SwapChainGL* _swapChain = NULL); void makeCurrent(SwapChainGL* _swapChain = NULL); diff --git a/bgfx/src/glimports.h b/bgfx/src/glimports.h index 67f2f48c..ad7d6c04 100644 --- a/bgfx/src/glimports.h +++ b/bgfx/src/glimports.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/makefile b/bgfx/src/makefile index d8380dc7..8257fcd6 100644 --- a/bgfx/src/makefile +++ b/bgfx/src/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # @@ -27,13 +27,11 @@ define shader-embedded @echo [$(<)] $(SILENT) $(SHADERC) --type $(1) --platform linux -p 120 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_glsl @cat "$(SHADER_TMP)" > $(@) - -$(SILENT) $(SHADERC) --type $(1) --platform android -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_essl - -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) --type $(1) --platform linux -p spirv -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_spv + -$(SILENT) $(SHADERC) --type $(1) --platform android -p 100_es -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_essl -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) --type $(1) --platform windows -p $(2) -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx9 + -$(SILENT) $(SHADERC) --type $(1) --platform linux -p spirv -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_spv -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) --type $(1) --platform windows -p $(3) -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 + -$(SILENT) $(SHADERC) --type $(1) --platform windows -p $(2) -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) --type $(1) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl -@cat "$(SHADER_TMP)" >> $(@) @@ -42,37 +40,37 @@ define shader-embedded endef vs_debugfont.bin.h : vs_debugfont.sc - $(call shader-embedded, v, vs_3_0, vs_4_0) + $(call shader-embedded, v, s_4_0) fs_debugfont.bin.h : fs_debugfont.sc - $(call shader-embedded, f, ps_3_0, ps_4_0) + $(call shader-embedded, f, s_4_0) vs_clear.bin.h : vs_clear.sc - $(call shader-embedded, v, vs_3_0, vs_4_0) + $(call shader-embedded, v, s_4_0) fs_clear0.bin.h : fs_clear0.sc - $(call shader-embedded, f, ps_3_0, ps_4_0) + $(call shader-embedded, f, s_4_0) fs_clear1.bin.h : fs_clear1.sc - $(call shader-embedded, f, ps_3_0, ps_4_0) + $(call shader-embedded, f, s_4_0) fs_clear2.bin.h : fs_clear2.sc - $(call shader-embedded, f, ps_3_0, ps_4_0) + $(call shader-embedded, f, s_4_0) fs_clear3.bin.h : fs_clear3.sc - $(call shader-embedded, f, ps_3_0, ps_4_0) + $(call shader-embedded, f, s_4_0) fs_clear4.bin.h : fs_clear4.sc - $(call shader-embedded, f, ps_3_0, ps_4_0) + $(call shader-embedded, f, s_4_0) fs_clear5.bin.h : fs_clear5.sc - $(call shader-embedded, f, ps_3_0, ps_4_0) + $(call shader-embedded, f, s_4_0) fs_clear6.bin.h : fs_clear6.sc - $(call shader-embedded, f, ps_3_0, ps_4_0) + $(call shader-embedded, f, s_4_0) fs_clear7.bin.h : fs_clear7.sc - $(call shader-embedded, f, ps_3_0, ps_4_0) + $(call shader-embedded, f, s_4_0) .PHONY: clean clean: diff --git a/bgfx/src/nvapi.cpp b/bgfx/src/nvapi.cpp index 462600d5..8b4c7fc2 100644 --- a/bgfx/src/nvapi.cpp +++ b/bgfx/src/nvapi.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/nvapi.h b/bgfx/src/nvapi.h index 0a13dfc2..34b5f20d 100644 --- a/bgfx/src/nvapi.h +++ b/bgfx/src/nvapi.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/renderer.h b/bgfx/src/renderer.h index e81b7a99..8c08a94d 100644 --- a/bgfx/src/renderer.h +++ b/bgfx/src/renderer.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/renderer_agc.cpp b/bgfx/src/renderer_agc.cpp index b8c994f4..e25cd8c3 100644 --- a/bgfx/src/renderer_agc.cpp +++ b/bgfx/src/renderer_agc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/renderer_d3d.h b/bgfx/src/renderer_d3d.h index ae54f56d..7ec065f8 100644 --- a/bgfx/src/renderer_d3d.h +++ b/bgfx/src/renderer_d3d.h @@ -1,23 +1,13 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #ifndef BGFX_RENDERER_D3D_H_HEADER_GUARD #define BGFX_RENDERER_D3D_H_HEADER_GUARD -#if 0 // BGFX_CONFIG_DEBUG && BGFX_CONFIG_RENDERER_DIRECT3D9 && !(BX_COMPILER_GCC || BX_COMPILER_CLANG) -# include -# include -# if BX_COMPILER_MSVC -# pragma comment(lib, "dxerr.lib") -# endif // BX_COMPILER_MSVC -# define DX_CHECK_EXTRA_F " (%s): %s" -# define DX_CHECK_EXTRA_ARGS , DXGetErrorString(__hr__), DXGetErrorDescription(__hr__) -#else -# define DX_CHECK_EXTRA_F "" -# define DX_CHECK_EXTRA_ARGS -#endif // BGFX_CONFIG_DEBUG && BGFX_CONFIG_RENDERER_DIRECT3D9 +#define DX_CHECK_EXTRA_F "" +#define DX_CHECK_EXTRA_ARGS #ifndef DXGI_ERROR_NOT_CURRENTLY_AVAILABLE # define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE HRESULT(0x887A0022) diff --git a/bgfx/src/renderer_d3d11.cpp b/bgfx/src/renderer_d3d11.cpp index 9bde033e..3cd5437a 100644 --- a/bgfx/src/renderer_d3d11.cpp +++ b/bgfx/src/renderer_d3d11.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -46,7 +46,7 @@ namespace bgfx { namespace d3d11 { D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, 1, 1, 0 }, { D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED, 0, 0, 0 }, }; - BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo)-1); + static_assert(Topology::Count == BX_COUNTOF(s_primInfo)-1); union Zero { @@ -300,7 +300,7 @@ namespace bgfx { namespace d3d11 { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D32F { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D0S8 }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); + static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); static const D3D11_INPUT_ELEMENT_DESC s_attrib[] = { @@ -323,7 +323,7 @@ namespace bgfx { namespace d3d11 { "TEXCOORD", 6, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 7, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, }; - BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attrib) ); + static_assert(Attrib::Count == BX_COUNTOF(s_attrib) ); static const DXGI_FORMAT s_attribType[][4][2] = { @@ -358,7 +358,7 @@ namespace bgfx { namespace d3d11 { DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT }, }, }; - BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) ); + static_assert(AttribType::Count == BX_COUNTOF(s_attribType) ); static D3D11_INPUT_ELEMENT_DESC* fillVertexLayout(uint8_t _stream, D3D11_INPUT_ELEMENT_DESC* _out, const VertexLayout& _layout) { @@ -874,8 +874,6 @@ namespace bgfx { namespace d3d11 } #endif // USE_D3D11_DYNAMIC_LIB - m_device = (ID3D11Device*)g_platformData.context; - if (!m_dxgi.init(g_caps) ) { goto error; @@ -883,8 +881,10 @@ namespace bgfx { namespace d3d11 errorState = ErrorState::LoadedDXGI; - if (NULL != m_device) + if (NULL != g_platformData.context) { + m_device = (ID3D11Device*)g_platformData.context; + m_device->AddRef(); m_device->GetImmediateContext(&m_deviceCtx); @@ -1635,13 +1635,13 @@ namespace bgfx { namespace d3d11 #endif // USE_D3D11_DYNAMIC_LIB m_dxgi.shutdown(); - BX_FALLTHROUGH; + [[fallthrough]]; #if USE_D3D11_DYNAMIC_LIB case ErrorState::LoadedD3D11: bx::dlclose(m_d3d11Dll); m_d3d11Dll = NULL; - BX_FALLTHROUGH; + [[fallthrough]]; #endif // USE_D3D11_DYNAMIC_LIB case ErrorState::Default: @@ -3399,10 +3399,10 @@ namespace bgfx { namespace d3d11 { case UniformType::Mat3: case UniformType::Mat3|kUniformFragmentBit: - { + { float* value = (float*)data; for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3*16, value += 9) - { + { Matrix4 mtx; mtx.un.val[ 0] = value[0]; mtx.un.val[ 1] = value[1]; @@ -3830,7 +3830,7 @@ namespace bgfx { namespace d3d11 } else if (m_dynamic) { -#if USE_D3D11_STAGING_BUFFER +#if BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER desc.Usage = D3D11_USAGE_DEFAULT; desc.CPUAccessFlags = 0; @@ -3855,7 +3855,7 @@ namespace bgfx { namespace d3d11 , NULL , &m_ptr ) ); -#endif // USE_D3D11_STAGING_BUFFER +#endif // BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER } else { @@ -3887,7 +3887,7 @@ namespace bgfx { namespace d3d11 ID3D11DeviceContext* deviceCtx = s_renderD3D11->m_deviceCtx; BX_ASSERT(m_dynamic, "Must be dynamic!"); -#if USE_D3D11_STAGING_BUFFER +#if BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER BX_UNUSED(_discard); D3D11_MAPPED_SUBRESOURCE mapped; @@ -5877,7 +5877,7 @@ namespace bgfx { namespace d3d11 const VertexBufferD3D11& vb = m_vertexBuffers[compute.m_indirectBuffer.idx]; ID3D11Buffer* ptr = vb.m_ptr; - uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect + uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : compute.m_numIndirect ; @@ -6332,7 +6332,7 @@ namespace bgfx { namespace d3d11 if (isValid(draw.m_indexBuffer) ) { - numDrawIndirect = UINT16_MAX == draw.m_numIndirect + numDrawIndirect = UINT32_MAX == draw.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : draw.m_numIndirect ; @@ -6346,7 +6346,7 @@ namespace bgfx { namespace d3d11 } else { - numDrawIndirect = UINT16_MAX == draw.m_numIndirect + numDrawIndirect = UINT32_MAX == draw.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : draw.m_numIndirect ; @@ -6622,7 +6622,6 @@ namespace bgfx { namespace d3d11 } tvm.printf(10, pos++, 0x8b, " Indices: %7d ", statsNumIndices); -// tvm.printf(10, pos++, 0x8b, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax); tvm.printf(10, pos++, 0x8b, " DVB size: %7d ", _render->m_vboffset); tvm.printf(10, pos++, 0x8b, " DIB size: %7d ", _render->m_iboffset); diff --git a/bgfx/src/renderer_d3d11.h b/bgfx/src/renderer_d3d11.h index f193c2cc..75e326e1 100644 --- a/bgfx/src/renderer_d3d11.h +++ b/bgfx/src/renderer_d3d11.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -7,7 +7,6 @@ #define BGFX_RENDERER_D3D11_H_HEADER_GUARD #define USE_D3D11_DYNAMIC_LIB (BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS) -#define USE_D3D11_STAGING_BUFFER 0 #if !USE_D3D11_DYNAMIC_LIB # undef BGFX_CONFIG_DEBUG_ANNOTATION @@ -81,9 +80,9 @@ namespace bgfx { namespace d3d11 { BufferD3D11() : m_ptr(NULL) -#if USE_D3D11_STAGING_BUFFER +#if BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER , m_staging(NULL) -#endif // USE_D3D11_STAGING_BUFFER +#endif // BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER , m_srv(NULL) , m_uav(NULL) , m_flags(BGFX_BUFFER_NONE) @@ -102,18 +101,18 @@ namespace bgfx { namespace d3d11 m_dynamic = false; } -#if USE_D3D11_STAGING_BUFFER +#if BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER DX_RELEASE(m_staging, 0); -#endif // USE_D3D11_STAGING_BUFFER +#endif // BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER DX_RELEASE(m_srv, 0); DX_RELEASE(m_uav, 0); } ID3D11Buffer* m_ptr; -#if USE_D3D11_STAGING_BUFFER +#if BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER ID3D11Buffer* m_staging; -#endif // USE_D3D11_STAGING_BUFFER +#endif // BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER ID3D11ShaderResourceView* m_srv; ID3D11UnorderedAccessView* m_uav; uint32_t m_size; diff --git a/bgfx/src/renderer_d3d12.cpp b/bgfx/src/renderer_d3d12.cpp index d76e88e9..f627c681 100644 --- a/bgfx/src/renderer_d3d12.cpp +++ b/bgfx/src/renderer_d3d12.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -50,7 +50,7 @@ namespace bgfx { namespace d3d12 { D3D_PRIMITIVE_TOPOLOGY_POINTLIST, D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT, 1, 1, 0 }, { D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED, 0, 0, 0 }, }; - BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo)-1); + static_assert(Topology::Count == BX_COUNTOF(s_primInfo)-1); static const uint32_t s_checkMsaa[] = { @@ -296,7 +296,7 @@ namespace bgfx { namespace d3d12 #undef $B #undef $A }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); + static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); static const D3D12_INPUT_ELEMENT_DESC s_attrib[] = { @@ -319,7 +319,7 @@ namespace bgfx { namespace d3d12 { "TEXCOORD", 6, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 7, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, }; - BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attrib) ); + static_assert(Attrib::Count == BX_COUNTOF(s_attrib) ); static const DXGI_FORMAT s_attribType[][4][2] = { @@ -354,7 +354,7 @@ namespace bgfx { namespace d3d12 { DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT }, }, }; - BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) ); + static_assert(AttribType::Count == BX_COUNTOF(s_attribType) ); static D3D12_INPUT_ELEMENT_DESC* fillVertexLayout(uint8_t _stream, D3D12_INPUT_ELEMENT_DESC* _out, const VertexLayout& _layout) { @@ -470,17 +470,17 @@ namespace bgfx { namespace d3d12 { { D3D12_HEAP_TYPE_UPLOAD, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 0, 0 }, D3D12_RESOURCE_STATE_GENERIC_READ }, { { D3D12_HEAP_TYPE_READBACK, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 0, 0 }, D3D12_RESOURCE_STATE_COPY_DEST }, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_heapProperties) == HeapProperty::Count); + static_assert(BX_COUNTOF(s_heapProperties) == HeapProperty::Count); static inline D3D12_HEAP_PROPERTIES ID3D12DeviceGetCustomHeapProperties(ID3D12Device *device, uint32_t nodeMask, D3D12_HEAP_TYPE heapType) { -#if BX_COMPILER_MSVC +#if BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) return device->GetCustomHeapProperties(nodeMask, heapType); #else D3D12_HEAP_PROPERTIES ret; device->GetCustomHeapProperties(&ret, nodeMask, heapType); return ret; -#endif // BX_COMPILER_MSVC +#endif // BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) } static void initHeapProperties(ID3D12Device* _device, D3D12_HEAP_PROPERTIES& _properties) @@ -525,11 +525,11 @@ namespace bgfx { namespace d3d12 void* ptr; DX_CHECK(resource->Map(0, NULL, &ptr) ); D3D12_RESOURCE_ALLOCATION_INFO rai; -#if BX_COMPILER_MSVC +#if BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) rai = _device->GetResourceAllocationInfo(1, 1, _resourceDesc); #else _device->GetResourceAllocationInfo(&rai, 1, 1, _resourceDesc); -#endif // BX_COMPILER_MSVC +#endif // BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) bx::memSet(ptr, 0, size_t(rai.SizeInBytes) ); resource->Unmap(0, NULL); } @@ -626,35 +626,35 @@ namespace bgfx { namespace d3d12 inline D3D12_CPU_DESCRIPTOR_HANDLE getCPUHandleHeapStart(ID3D12DescriptorHeap* _heap) { -#if BX_COMPILER_MSVC +#if BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) return _heap->GetCPUDescriptorHandleForHeapStart(); #else D3D12_CPU_DESCRIPTOR_HANDLE handle; _heap->GetCPUDescriptorHandleForHeapStart(&handle); return handle; -#endif // BX_COMPILER_MSVC +#endif // BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) } inline D3D12_GPU_DESCRIPTOR_HANDLE getGPUHandleHeapStart(ID3D12DescriptorHeap* _heap) { -#if BX_COMPILER_MSVC +#if BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) return _heap->GetGPUDescriptorHandleForHeapStart(); #else D3D12_GPU_DESCRIPTOR_HANDLE handle; _heap->GetGPUDescriptorHandleForHeapStart(&handle); return handle; -#endif // BX_COMPILER_MSVC +#endif // BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) } inline D3D12_RESOURCE_DESC getResourceDesc(ID3D12Resource* _resource) { -#if BX_COMPILER_MSVC +#if BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) return _resource->GetDesc(); #else D3D12_RESOURCE_DESC desc; _resource->GetDesc(&desc); return desc; -#endif // BX_COMPILER_MSVC +#endif // BX_COMPILER_MSVC || (BX_COMPILER_CLANG && defined(_MSC_VER)) } #if BGFX_CONFIG_DEBUG_ANNOTATION && (BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT) @@ -815,6 +815,14 @@ namespace bgfx { namespace d3d12 HRESULT hr; + if (NULL != g_platformData.context) + { + m_device = (ID3D12Device*)g_platformData.context; + + m_device->AddRef(); + hr = S_OK; + } + else { #if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT if (_init.debug @@ -836,16 +844,23 @@ namespace bgfx { namespace d3d12 if (SUCCEEDED(hr)) { -// debug1->SetEnableGPUBasedValidation(true); - // https://discordapp.com/channels/590611987420020747/593519198995742733/703642988345032804 // D3D12 Bug Number: 26131261 // There is a bug in the D3D12 validation that causes example-21 to fail when using UAV - // Setting this function below to false avoids the bug - debug1->SetEnableSynchronizedCommandQueueValidation(false); - } + // Setting SetEnableSynchronizedCommandQueueValidation below to false avoids the bug + // It was fixed in (probably) the first windows 11 sdk, 22000 + // However, the fix causes any dx12 context with validation to break if this is set to false, so we can't do that anymore + if (windowsVersionIs(Condition::GreaterEqual, 0x0A00, 22000)) + { + debug1->SetEnableGPUBasedValidation(true); + } + else + { + debug1->SetEnableSynchronizedCommandQueueValidation(false); + } - DX_RELEASE(debug1, 1); + DX_RELEASE(debug1, 1); + } } #endif // BX_PLATFORM_WINDOWS } @@ -911,12 +926,12 @@ namespace bgfx { namespace d3d12 m_device->SetDebugErrorFilterX(0x8EC9B15C, D3D12XBOX_DEBUG_FILTER_FLAG_DISABLE_OUTPUT); } #endif // BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT - } - if (FAILED(hr) ) - { - BX_TRACE("Init error: Unable to create Direct3D12 device."); - goto error; + if (FAILED(hr) ) + { + BX_TRACE("Init error: Unable to create Direct3D12 device."); + goto error; + } } #if !BX_PLATFORM_LINUX @@ -1086,7 +1101,7 @@ namespace bgfx { namespace d3d12 break; } - for (D3D12_FEATURE_DATA_D3D12_OPTIONS13 options13; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options13, sizeof(options13)));) + for (D3D12_FEATURE_DATA_D3D12_OPTIONS13 options13; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS13, &options13, sizeof(options13)));) { BX_TRACE("D3D12 options 13:"); BX_TRACE("\tUnrestrictedBufferTextureCopyPitchSupported %d", options13.UnrestrictedBufferTextureCopyPitchSupported); @@ -1098,7 +1113,7 @@ namespace bgfx { namespace d3d12 break; } - for (D3D12_FEATURE_DATA_D3D12_OPTIONS14 options14; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options14, sizeof(options14)));) + for (D3D12_FEATURE_DATA_D3D12_OPTIONS14 options14; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS14, &options14, sizeof(options14)));) { BX_TRACE("D3D12 options 14:"); BX_TRACE("\tAdvancedTextureOpsSupported %d", options14.AdvancedTextureOpsSupported); @@ -1107,7 +1122,7 @@ namespace bgfx { namespace d3d12 break; } - for (D3D12_FEATURE_DATA_D3D12_OPTIONS15 options15; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options15, sizeof(options15)));) + for (D3D12_FEATURE_DATA_D3D12_OPTIONS15 options15; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS15, &options15, sizeof(options15)));) { BX_TRACE("D3D12 options 15:"); BX_TRACE("\tTriangleFanSupported %d", options15.TriangleFanSupported); @@ -1293,7 +1308,7 @@ namespace bgfx { namespace d3d12 { D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, 0, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND }, { D3D12_DESCRIPTOR_RANGE_TYPE_UAV, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, 0, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND }, }; - BX_STATIC_ASSERT(BX_COUNTOF(descRange) == Rdt::Count); + static_assert(BX_COUNTOF(descRange) == Rdt::Count); D3D12_ROOT_PARAMETER rootParameter[] = { @@ -1573,24 +1588,24 @@ namespace bgfx { namespace d3d12 case ErrorState::CreatedCommandQueue: m_device->SetPrivateDataInterface(IID_ID3D12CommandQueue, NULL); m_cmd.shutdown(); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::CreatedDXGIFactory: DX_RELEASE(m_device, 0); #if !BX_PLATFORM_LINUX m_dxgi.shutdown(); #endif // !BX_PLATFORM_LINUX - BX_FALLTHROUGH; + [[fallthrough]]; #if USE_D3D12_DYNAMIC_LIB case ErrorState::LoadedDXGI: case ErrorState::LoadedD3D12: bx::dlclose(m_d3d12Dll); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::LoadedKernel32: bx::dlclose(m_kernel32Dll); - BX_FALLTHROUGH; + [[fallthrough]]; #endif // USE_D3D12_DYNAMIC_LIB case ErrorState::Default: @@ -2495,9 +2510,9 @@ namespace bgfx { namespace d3d12 { #if BX_PLATFORM_WINDOWS uint32_t nodeMask[] = { 1, 1, 1, 1 }; - BX_STATIC_ASSERT(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(nodeMask) ); + static_assert(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(nodeMask) ); IUnknown* presentQueue[] ={ m_cmd.m_commandQueue, m_cmd.m_commandQueue, m_cmd.m_commandQueue, m_cmd.m_commandQueue }; - BX_STATIC_ASSERT(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(presentQueue) ); + static_assert(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(presentQueue) ); DX_CHECK(m_dxgi.resizeBuffers(m_swapChain, m_scd, nodeMask, presentQueue) ); #elif BX_PLATFORM_WINRT DX_CHECK(m_dxgi.resizeBuffers(m_swapChain, m_scd)); @@ -4240,18 +4255,18 @@ namespace bgfx { namespace d3d12 const uint16_t layoutIdx = !isValid(vb.m_layoutHandle) ? stream.m_layoutHandle.idx : vb.m_layoutHandle.idx; const VertexLayout& layout = s_renderD3D12->m_vertexLayouts[layoutIdx]; - uint32_t stride = layout.m_stride; - - D3D12_VERTEX_BUFFER_VIEW& vbv = _vbv[numStreams]; - vbv.BufferLocation = vb.m_gpuVA + stream.m_startVertex * stride; - vbv.StrideInBytes = layout.m_stride; - vbv.SizeInBytes = vb.m_size; + const uint32_t stride = layout.m_stride; _outNumVertices = bx::uint32_min(UINT32_MAX == _draw.m_numVertices ? vb.m_size/stride : _draw.m_numVertices , _outNumVertices ); + + D3D12_VERTEX_BUFFER_VIEW& vbv = _vbv[numStreams]; + vbv.BufferLocation = vb.m_gpuVA + stream.m_startVertex * stride; + vbv.StrideInBytes = stride; + vbv.SizeInBytes = _outNumVertices * stride; } } @@ -4285,7 +4300,7 @@ namespace bgfx { namespace d3d12 ); const VertexBufferD3D12& indirect = s_renderD3D12->m_vertexBuffers[_draw.m_indirectBuffer.idx]; - const uint32_t numDrawIndirect = UINT16_MAX == _draw.m_numIndirect + const uint32_t numDrawIndirect = UINT32_MAX == _draw.m_numIndirect ? indirect.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : _draw.m_numIndirect ; @@ -4438,7 +4453,7 @@ namespace bgfx { namespace d3d12 sizeof(BatchD3D12::DrawIndirectCommand), sizeof(BatchD3D12::DrawIndexedIndirectCommand), }; - BX_STATIC_ASSERT(BX_COUNTOF(s_indirectCommandSize) == BatchD3D12::Count); + static_assert(BX_COUNTOF(s_indirectCommandSize) == BatchD3D12::Count); void BatchD3D12::flush(ID3D12GraphicsCommandList* _commandList, Enum _type) { @@ -6734,7 +6749,7 @@ namespace bgfx { namespace d3d12 { const VertexBufferD3D12& indirect = m_vertexBuffers[compute.m_indirectBuffer.idx]; - uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect + uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect ? indirect.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : compute.m_numIndirect ; @@ -7376,7 +7391,6 @@ namespace bgfx { namespace d3d12 } tvm.printf(10, pos++, 0x8b, " Indices: %7d ", statsNumIndices); -// tvm.printf(10, pos++, 0x8b, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax); tvm.printf(10, pos++, 0x8b, " DVB size: %7d ", _render->m_vboffset); tvm.printf(10, pos++, 0x8b, " DIB size: %7d ", _render->m_iboffset); diff --git a/bgfx/src/renderer_d3d12.h b/bgfx/src/renderer_d3d12.h index 703f9393..f10ed678 100644 --- a/bgfx/src/renderer_d3d12.h +++ b/bgfx/src/renderer_d3d12.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -397,7 +397,7 @@ namespace bgfx { namespace d3d12 , m_completedFence(0) , m_control(BX_COUNTOF(m_commandList) ) { - BX_STATIC_ASSERT(BX_COUNTOF(m_commandList) == BX_COUNTOF(m_release) ); + static_assert(BX_COUNTOF(m_commandList) == BX_COUNTOF(m_release) ); } void init(ID3D12Device* _device); diff --git a/bgfx/src/renderer_d3d9.cpp b/bgfx/src/renderer_d3d9.cpp deleted file mode 100644 index 915406b6..00000000 --- a/bgfx/src/renderer_d3d9.cpp +++ /dev/null @@ -1,4606 +0,0 @@ -/* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE - */ - -#include "bgfx_p.h" - -#if BGFX_CONFIG_RENDERER_DIRECT3D9 -# include "renderer_d3d9.h" -# include - -namespace bgfx { namespace d3d9 -{ - static wchar_t s_viewNameW[BGFX_CONFIG_MAX_VIEWS][BGFX_CONFIG_MAX_VIEW_NAME]; - static char s_viewName [BGFX_CONFIG_MAX_VIEWS][BGFX_CONFIG_MAX_VIEW_NAME]; - - struct PrimInfo - { - D3DPRIMITIVETYPE m_type; - uint32_t m_min; - uint32_t m_div; - uint32_t m_sub; - }; - - static const PrimInfo s_primInfo[] = - { - { D3DPT_TRIANGLELIST, 3, 3, 0 }, - { D3DPT_TRIANGLESTRIP, 3, 1, 2 }, - { D3DPT_LINELIST, 2, 2, 0 }, - { D3DPT_LINESTRIP, 2, 1, 1 }, - { D3DPT_POINTLIST, 1, 1, 0 }, - { D3DPRIMITIVETYPE(0), 0, 0, 0 }, - }; - BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo)-1); - - static const D3DMULTISAMPLE_TYPE s_checkMsaa[] = - { - D3DMULTISAMPLE_NONE, - D3DMULTISAMPLE_2_SAMPLES, - D3DMULTISAMPLE_4_SAMPLES, - D3DMULTISAMPLE_8_SAMPLES, - D3DMULTISAMPLE_16_SAMPLES, - }; - - static Msaa s_msaa[] = - { - { D3DMULTISAMPLE_NONE, 0 }, - { D3DMULTISAMPLE_2_SAMPLES, 0 }, - { D3DMULTISAMPLE_4_SAMPLES, 0 }, - { D3DMULTISAMPLE_8_SAMPLES, 0 }, - { D3DMULTISAMPLE_16_SAMPLES, 0 }, - }; - - struct Blend - { - D3DBLEND m_src; - D3DBLEND m_dst; - bool m_factor; - }; - - static const Blend s_blendFactor[] = - { - { (D3DBLEND)0, (D3DBLEND)0, false }, // ignored - { D3DBLEND_ZERO, D3DBLEND_ZERO, false }, // ZERO - { D3DBLEND_ONE, D3DBLEND_ONE, false }, // ONE - { D3DBLEND_SRCCOLOR, D3DBLEND_SRCCOLOR, false }, // SRC_COLOR - { D3DBLEND_INVSRCCOLOR, D3DBLEND_INVSRCCOLOR, false }, // INV_SRC_COLOR - { D3DBLEND_SRCALPHA, D3DBLEND_SRCALPHA, false }, // SRC_ALPHA - { D3DBLEND_INVSRCALPHA, D3DBLEND_INVSRCALPHA, false }, // INV_SRC_ALPHA - { D3DBLEND_DESTALPHA, D3DBLEND_DESTALPHA, false }, // DST_ALPHA - { D3DBLEND_INVDESTALPHA, D3DBLEND_INVDESTALPHA, false }, // INV_DST_ALPHA - { D3DBLEND_DESTCOLOR, D3DBLEND_DESTCOLOR, false }, // DST_COLOR - { D3DBLEND_INVDESTCOLOR, D3DBLEND_INVDESTCOLOR, false }, // INV_DST_COLOR - { D3DBLEND_SRCALPHASAT, D3DBLEND_ONE, false }, // SRC_ALPHA_SAT - { D3DBLEND_BLENDFACTOR, D3DBLEND_BLENDFACTOR, true }, // FACTOR - { D3DBLEND_INVBLENDFACTOR, D3DBLEND_INVBLENDFACTOR, true }, // INV_FACTOR - }; - - static const D3DBLENDOP s_blendEquation[] = - { - D3DBLENDOP_ADD, - D3DBLENDOP_SUBTRACT, - D3DBLENDOP_REVSUBTRACT, - D3DBLENDOP_MIN, - D3DBLENDOP_MAX, - }; - - static const D3DCMPFUNC s_cmpFunc[] = - { - (D3DCMPFUNC)0, // ignored - D3DCMP_LESS, - D3DCMP_LESSEQUAL, - D3DCMP_EQUAL, - D3DCMP_GREATEREQUAL, - D3DCMP_GREATER, - D3DCMP_NOTEQUAL, - D3DCMP_NEVER, - D3DCMP_ALWAYS, - }; - - static const D3DSTENCILOP s_stencilOp[] = - { - D3DSTENCILOP_ZERO, - D3DSTENCILOP_KEEP, - D3DSTENCILOP_REPLACE, - D3DSTENCILOP_INCR, - D3DSTENCILOP_INCRSAT, - D3DSTENCILOP_DECR, - D3DSTENCILOP_DECRSAT, - D3DSTENCILOP_INVERT, - }; - - static const D3DRENDERSTATETYPE s_stencilFuncRs[] = - { - D3DRS_STENCILFUNC, - D3DRS_CCW_STENCILFUNC, - }; - - static const D3DRENDERSTATETYPE s_stencilFailRs[] = - { - D3DRS_STENCILFAIL, - D3DRS_CCW_STENCILFAIL, - }; - - static const D3DRENDERSTATETYPE s_stencilZFailRs[] = - { - D3DRS_STENCILZFAIL, - D3DRS_CCW_STENCILZFAIL, - }; - - static const D3DRENDERSTATETYPE s_stencilZPassRs[] = - { - D3DRS_STENCILPASS, - D3DRS_CCW_STENCILPASS, - }; - - static const D3DCULL s_cullMode[] = - { - D3DCULL_NONE, - D3DCULL_CW, - D3DCULL_CCW, - }; - - static const D3DTEXTUREADDRESS s_textureAddress[] = - { - D3DTADDRESS_WRAP, - D3DTADDRESS_MIRROR, - D3DTADDRESS_CLAMP, - D3DTADDRESS_BORDER, - }; - - static const D3DTEXTUREFILTERTYPE s_textureFilter[] = - { - D3DTEXF_LINEAR, - D3DTEXF_POINT, - D3DTEXF_ANISOTROPIC, - }; - - struct TextureFormatInfo - { - D3DFORMAT m_fmt; - }; - - static TextureFormatInfo s_textureFormat[] = - { - { D3DFMT_DXT1 }, // BC1 - { D3DFMT_DXT3 }, // BC2 - { D3DFMT_DXT5 }, // BC3 - { D3DFMT_UNKNOWN }, // BC4 - { D3DFMT_UNKNOWN }, // BC5 - { D3DFMT_UNKNOWN }, // BC6H - { D3DFMT_UNKNOWN }, // BC7 - { D3DFMT_UNKNOWN }, // ETC1 - { D3DFMT_UNKNOWN }, // ETC2 - { D3DFMT_UNKNOWN }, // ETC2A - { D3DFMT_UNKNOWN }, // ETC2A1 - { D3DFMT_UNKNOWN }, // PTC12 - { D3DFMT_UNKNOWN }, // PTC14 - { D3DFMT_UNKNOWN }, // PTC12A - { D3DFMT_UNKNOWN }, // PTC14A - { D3DFMT_UNKNOWN }, // PTC22 - { D3DFMT_UNKNOWN }, // PTC24 - { D3DFMT_UNKNOWN }, // ATC, - { D3DFMT_UNKNOWN }, // ATCE, - { D3DFMT_UNKNOWN }, // ATCI, - { D3DFMT_UNKNOWN }, // ASTC4x4 - { D3DFMT_UNKNOWN }, // ASTC5x4 - { D3DFMT_UNKNOWN }, // ASTC5x5 - { D3DFMT_UNKNOWN }, // ASTC6x5 - { D3DFMT_UNKNOWN }, // ASTC6x6 - { D3DFMT_UNKNOWN }, // ASTC8x5 - { D3DFMT_UNKNOWN }, // ASTC8x6 - { D3DFMT_UNKNOWN }, // ASTC8x8 - { D3DFMT_UNKNOWN }, // ASTC10x5 - { D3DFMT_UNKNOWN }, // ASTC10x6 - { D3DFMT_UNKNOWN }, // ASTC10x8 - { D3DFMT_UNKNOWN }, // ASTC10x10 - { D3DFMT_UNKNOWN }, // ASTC12x10 - { D3DFMT_UNKNOWN }, // ASTC12x12 - { D3DFMT_UNKNOWN }, // Unknown - { D3DFMT_A1 }, // R1 - { D3DFMT_A8 }, // A8 - { D3DFMT_L8 }, // R8 - { D3DFMT_UNKNOWN }, // R8I - { D3DFMT_UNKNOWN }, // R8U - { D3DFMT_UNKNOWN }, // R8S - { D3DFMT_L16 }, // R16 - { D3DFMT_UNKNOWN }, // R16I - { D3DFMT_UNKNOWN }, // R16U - { D3DFMT_R16F }, // R16F - { D3DFMT_UNKNOWN }, // R16S - { D3DFMT_UNKNOWN }, // R32I - { D3DFMT_UNKNOWN }, // R32U - { D3DFMT_R32F }, // R32F - { D3DFMT_A8L8 }, // RG8 - { D3DFMT_UNKNOWN }, // RG8I - { D3DFMT_UNKNOWN }, // RG8U - { D3DFMT_UNKNOWN }, // RG8S - { D3DFMT_G16R16 }, // RG16 - { D3DFMT_UNKNOWN }, // RG16I - { D3DFMT_UNKNOWN }, // RG16U - { D3DFMT_G16R16F }, // RG16F - { D3DFMT_UNKNOWN }, // RG16S - { D3DFMT_UNKNOWN }, // RG32I - { D3DFMT_UNKNOWN }, // RG32U - { D3DFMT_G32R32F }, // RG32F - { D3DFMT_UNKNOWN }, // RGB8 - { D3DFMT_UNKNOWN }, // RGB8I - { D3DFMT_UNKNOWN }, // RGB8U - { D3DFMT_UNKNOWN }, // RGB8S - { D3DFMT_UNKNOWN }, // RGB9E5F - { D3DFMT_A8R8G8B8 }, // BGRA8 - { D3DFMT_UNKNOWN }, // RGBA8 - { D3DFMT_UNKNOWN }, // RGBA8I - { D3DFMT_UNKNOWN }, // RGBA8U - { D3DFMT_UNKNOWN }, // RGBA8S - { D3DFMT_A16B16G16R16 }, // RGBA16 - { D3DFMT_UNKNOWN }, // RGBA16I - { D3DFMT_UNKNOWN }, // RGBA16U - { D3DFMT_A16B16G16R16F }, // RGBA16F - { D3DFMT_UNKNOWN }, // RGBA16S - { D3DFMT_UNKNOWN }, // RGBA32I - { D3DFMT_UNKNOWN }, // RGBA32U - { D3DFMT_A32B32G32R32F }, // RGBA32F - { D3DFMT_R5G6B5 }, // B5G6R5 - { D3DFMT_R5G6B5 }, // R5G6B5 - { D3DFMT_A4R4G4B4 }, // BGRA4 - { D3DFMT_A4R4G4B4 }, // RGBA4 - { D3DFMT_A1R5G5B5 }, // BGR5A1 - { D3DFMT_A1R5G5B5 }, // RGB5A1 - { D3DFMT_A2B10G10R10 }, // RGB10A2 - { D3DFMT_UNKNOWN }, // RG11B10F - { D3DFMT_UNKNOWN }, // UnknownDepth - { D3DFMT_D16 }, // D16 - { D3DFMT_D24X8 }, // D24 - { D3DFMT_D24S8 }, // D24S8 - { D3DFMT_D32 }, // D32 - { D3DFMT_DF16 }, // D16F - { D3DFMT_DF24 }, // D24F - { D3DFMT_D32F_LOCKABLE }, // D32F - { D3DFMT_S8_LOCKABLE }, // D0S8 - }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); - - static ExtendedFormat s_extendedFormats[ExtendedFormat::Count] = - { - { D3DFMT_ATI1, 0, D3DRTYPE_TEXTURE, false }, - { D3DFMT_ATI2, 0, D3DRTYPE_TEXTURE, false }, - { D3DFMT_DF16, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, false }, - { D3DFMT_DF24, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, false }, - { D3DFMT_INST, 0, D3DRTYPE_SURFACE, false }, - { D3DFMT_INTZ, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, false }, - { D3DFMT_NULL, D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, false }, - { D3DFMT_RESZ, D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, false }, - { D3DFMT_RAWZ, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, false }, - { D3DFMT_ATOC, 0, D3DRTYPE_SURFACE, false }, - }; - - static const GUID IID_IDirect3D9 = { 0x81bdcbca, 0x64d4, 0x426d, { 0xae, 0x8d, 0xad, 0x1, 0x47, 0xf4, 0x27, 0x5c } }; - static const GUID IID_IDirect3DDevice9Ex = { 0xb18b10ce, 0x2649, 0x405a, { 0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a } }; - - typedef HRESULT (WINAPI *Direct3DCreate9ExFn)(UINT SDKVersion, IDirect3D9Ex**); - static Direct3DCreate9ExFn Direct3DCreate9Ex; - typedef IDirect3D9* (WINAPI *Direct3DCreate9Fn)(UINT SDKVersion); - static Direct3DCreate9Fn Direct3DCreate9; - static PFN_D3DPERF_SET_MARKER D3DPERF_SetMarker; - static PFN_D3DPERF_BEGIN_EVENT D3DPERF_BeginEvent; - static PFN_D3DPERF_END_EVENT D3DPERF_EndEvent; - - static const D3DVERTEXELEMENT9 s_attrib[] = - { - { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, - { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, - { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0 }, - { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL, 0 }, - { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, - { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1 }, - { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 2 }, - { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 3 }, - { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDINDICES, 0 }, - { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, - { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 }, - { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 2 }, - { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 3 }, - { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 4 }, - { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 5 }, - { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 6 }, - { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 7 }, - D3DDECL_END() - }; - BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attrib)-1); - - static const uint8_t s_attribType[][4][2] = - { - { // Uint8 - { D3DDECLTYPE_UBYTE4, D3DDECLTYPE_UBYTE4N }, - { D3DDECLTYPE_UBYTE4, D3DDECLTYPE_UBYTE4N }, - { D3DDECLTYPE_UBYTE4, D3DDECLTYPE_UBYTE4N }, - { D3DDECLTYPE_UBYTE4, D3DDECLTYPE_UBYTE4N }, - }, - { // Uint10 - { D3DDECLTYPE_UDEC3, D3DDECLTYPE_DEC3N }, - { D3DDECLTYPE_UDEC3, D3DDECLTYPE_DEC3N }, - { D3DDECLTYPE_UDEC3, D3DDECLTYPE_DEC3N }, - { D3DDECLTYPE_UDEC3, D3DDECLTYPE_DEC3N }, - }, - { // Int16 - { D3DDECLTYPE_SHORT2, D3DDECLTYPE_SHORT2N }, - { D3DDECLTYPE_SHORT2, D3DDECLTYPE_SHORT2N }, - { D3DDECLTYPE_SHORT4, D3DDECLTYPE_SHORT4N }, - { D3DDECLTYPE_SHORT4, D3DDECLTYPE_SHORT4N }, - }, - { // Half - { D3DDECLTYPE_FLOAT16_2, D3DDECLTYPE_FLOAT16_2 }, - { D3DDECLTYPE_FLOAT16_2, D3DDECLTYPE_FLOAT16_2 }, - { D3DDECLTYPE_FLOAT16_4, D3DDECLTYPE_FLOAT16_4 }, - { D3DDECLTYPE_FLOAT16_4, D3DDECLTYPE_FLOAT16_4 }, - }, - { // Float - { D3DDECLTYPE_FLOAT1, D3DDECLTYPE_FLOAT1 }, - { D3DDECLTYPE_FLOAT2, D3DDECLTYPE_FLOAT2 }, - { D3DDECLTYPE_FLOAT3, D3DDECLTYPE_FLOAT3 }, - { D3DDECLTYPE_FLOAT4, D3DDECLTYPE_FLOAT4 }, - }, - }; - BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) ); - - static D3DVERTEXELEMENT9* fillVertexLayout(uint8_t _stream, D3DVERTEXELEMENT9* _out, const VertexLayout& _layout) - { - D3DVERTEXELEMENT9* elem = _out; - - for (uint32_t attr = 0; attr < Attrib::Count; ++attr) - { - if (UINT16_MAX != _layout.m_attributes[attr]) - { - uint8_t num; - AttribType::Enum type; - bool normalized; - bool asInt; - _layout.decode(Attrib::Enum(attr), num, type, normalized, asInt); - - bx::memCopy(elem, &s_attrib[attr], sizeof(D3DVERTEXELEMENT9) ); - - elem->Stream = _stream; - elem->Type = s_attribType[type][num-1][normalized]; - elem->Offset = _layout.m_offset[attr]; - ++elem; - } - } - - return elem; - } - - inline bool isLost(HRESULT _hr) - { - return false - || _hr == D3DERR_DEVICELOST - || _hr == D3DERR_DRIVERINTERNALERROR -#if !defined(D3D_DISABLE_9EX) - || _hr == D3DERR_DEVICEHUNG - || _hr == D3DERR_DEVICEREMOVED -#endif // !defined(D3D_DISABLE_9EX) - ; - } - - inline bool useD3D9Pitch(bimg::TextureFormat::Enum _format) - { - // Reference(s): - // - For BC4 and B5 in DX9 LockRect returns wrong number of - // bytes. If actual mip size is used it causes memory corruption. - // https://web.archive.org/web/20190207230133/http://www.aras-p.info/texts/D3D9GPUHacks.html - return true - && _format != bimg::TextureFormat::BC4 - && _format != bimg::TextureFormat::BC5 - ; - } - - static inline uint32_t calcRowPitch(const bimg::ImageBlockInfo& _blockInfo, uint8_t _lod, uint32_t _width) - { - const uint8_t blockWidth = _blockInfo.blockWidth; - const uint8_t blockHeight = _blockInfo.blockHeight; - const uint8_t minBlockX = _blockInfo.minBlockX; - const uint8_t bitsPerPixel = _blockInfo.bitsPerPixel; - - // Calculate the row pitch - const uint32_t minBlkWidth = minBlockX; - const uint32_t lodBlkWidth = (((_width >> _lod) + blockWidth - 1) / blockWidth); - const uint32_t rowBlkWidth = bx::max(minBlkWidth, lodBlkWidth); - const uint32_t pixBlkWidth = rowBlkWidth * blockWidth * blockHeight; - const uint32_t rowPitch = pixBlkWidth * bitsPerPixel / 8u; - - return rowPitch; - } - - struct RendererContextD3D9 : public RendererContextI - { - RendererContextD3D9() - : m_d3d9(NULL) - , m_device(NULL) - , m_flushQuery(NULL) - , m_swapChain(NULL) - , m_captureTexture(NULL) - , m_captureSurface(NULL) - , m_captureResolve(NULL) - , m_maxAnisotropy(1) - , m_initialized(false) - , m_amd(false) - , m_nvidia(false) - , m_atocSupport(false) - , m_instancingSupport(false) - , m_occlusionQuerySupport(false) - , m_timerQuerySupport(false) - , m_rtMsaa(false) - { - } - - ~RendererContextD3D9() - { - } - - bool init(const Init& _init) - { - struct ErrorState - { - enum Enum - { - Default, - LoadedD3D9, - CreatedD3D9, - CreatedDevice, - }; - }; - - ErrorState::Enum errorState = ErrorState::Default; - - m_fbh.idx = kInvalidHandle; - bx::memSet(m_uniforms, 0, sizeof(m_uniforms) ); - bx::memSet(&m_resolution, 0, sizeof(m_resolution) ); - - D3DFORMAT adapterFormat = D3DFMT_X8R8G8B8; - - // Reference(s): - // - https://web.archive.org/web/20190207230309/https://docs.microsoft.com/en-us/windows/desktop/direct3d9/d3dpresent-parameters - bx::memSet(&m_params, 0, sizeof(m_params) ); - m_params.BackBufferWidth = _init.resolution.width; - m_params.BackBufferHeight = _init.resolution.height; - m_params.BackBufferFormat = adapterFormat; - m_params.BackBufferCount = bx::clamp(_init.resolution.numBackBuffers, 2, BGFX_CONFIG_MAX_BACK_BUFFERS); - m_params.MultiSampleType = D3DMULTISAMPLE_NONE; - m_params.MultiSampleQuality = 0; - m_params.EnableAutoDepthStencil = TRUE; - m_params.AutoDepthStencilFormat = D3DFMT_D24S8; - m_params.Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL; - - m_params.FullScreen_RefreshRateInHz = 0; - m_params.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; - m_params.SwapEffect = D3DSWAPEFFECT_DISCARD; - m_params.hDeviceWindow = NULL; - m_params.Windowed = true; - m_params.BackBufferWidth = _init.resolution.width; - m_params.BackBufferHeight = _init.resolution.height; - - const char* d3d9DllName = -#if BX_PLATFORM_LINUX - "d3d9.so" -#else - "d3d9.dll" -#endif // BX_PLATFORM_LINUX - ; - - m_d3d9Dll = bx::dlopen(d3d9DllName); - - if (NULL == m_d3d9Dll) - { - BX_TRACE("Init error: Failed to load %s.", d3d9DllName); - goto error; - } - - errorState = ErrorState::LoadedD3D9; - - m_nvapi.init(); - - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION) ) - { - D3DPERF_SetMarker = (PFN_D3DPERF_SET_MARKER )bx::dlsym(m_d3d9Dll, "D3DPERF_SetMarker"); - D3DPERF_BeginEvent = (PFN_D3DPERF_BEGIN_EVENT)bx::dlsym(m_d3d9Dll, "D3DPERF_BeginEvent"); - D3DPERF_EndEvent = (PFN_D3DPERF_END_EVENT )bx::dlsym(m_d3d9Dll, "D3DPERF_EndEvent"); - - if (NULL == D3DPERF_SetMarker - || NULL == D3DPERF_BeginEvent - || NULL == D3DPERF_EndEvent) - { - BX_TRACE("Failed to initialize PIX events."); - - D3DPERF_SetMarker = NULL; - D3DPERF_BeginEvent = NULL; - D3DPERF_EndEvent = NULL; - } - } - - m_d3d9ex = NULL; - m_deviceEx = NULL; - - Direct3DCreate9Ex = (Direct3DCreate9ExFn)bx::dlsym(m_d3d9Dll, "Direct3DCreate9Ex"); - if (BX_ENABLED(BGFX_CONFIG_RENDERER_DIRECT3D9EX) - && NULL != Direct3DCreate9Ex) - { - Direct3DCreate9Ex(D3D_SDK_VERSION, &m_d3d9ex); - if (NULL != m_d3d9ex) - { - HRESULT hr = m_d3d9ex->QueryInterface(IID_IDirect3D9, (void**)&m_d3d9); - if (FAILED(hr) ) - { - BX_TRACE("Failed to query D3D9 interface 0x%08x.", hr); - DX_RELEASE(m_d3d9ex, 0); - } - else - { - m_pool = D3DPOOL_DEFAULT; - } - } - } - - if (NULL == m_d3d9) - { - Direct3DCreate9 = (Direct3DCreate9Fn)bx::dlsym(m_d3d9Dll, "Direct3DCreate9"); - - if (NULL == Direct3DCreate9) - { - BX_TRACE("Init error: Function Direct3DCreate9 not found."); - goto error; - } - - m_d3d9 = Direct3DCreate9(D3D_SDK_VERSION); - m_pool = D3DPOOL_MANAGED; - } - - if (NULL == m_d3d9) - { - BX_TRACE("Init error: Unable to create Direct3D."); - goto error; - } - - errorState = ErrorState::CreatedD3D9; - - { - m_adapter = D3DADAPTER_DEFAULT; - m_deviceType = BGFX_PCI_ID_SOFTWARE_RASTERIZER == g_caps.vendorId - ? D3DDEVTYPE_REF - : D3DDEVTYPE_HAL - ; - - uint8_t numGPUs = uint8_t(bx::uint32_min(BX_COUNTOF(g_caps.gpu), m_d3d9->GetAdapterCount() ) ); - for (uint32_t ii = 0; ii < numGPUs; ++ii) - { - D3DADAPTER_IDENTIFIER9 desc; - HRESULT hr = m_d3d9->GetAdapterIdentifier(ii, 0, &desc); - if (SUCCEEDED(hr) ) - { - BX_TRACE("Adapter #%d", ii); - BX_TRACE("\tDriver: %s", desc.Driver); - BX_TRACE("\tDescription: %s", desc.Description); - BX_TRACE("\tDeviceName: %s", desc.DeviceName); - BX_TRACE("\tVendorId: 0x%08x, DeviceId: 0x%08x, SubSysId: 0x%08x, Revision: 0x%08x" - , desc.VendorId - , desc.DeviceId - , desc.SubSysId - , desc.Revision - ); - - g_caps.gpu[ii].vendorId = (uint16_t)desc.VendorId; - g_caps.gpu[ii].deviceId = (uint16_t)desc.DeviceId; - - if (D3DADAPTER_DEFAULT == m_adapter) - { - if ( (BGFX_PCI_ID_NONE != g_caps.vendorId || 0 != g_caps.deviceId) - && (BGFX_PCI_ID_NONE == g_caps.vendorId || desc.VendorId == g_caps.vendorId) - && ( 0 == g_caps.deviceId || desc.DeviceId == g_caps.deviceId) ) - { - m_adapter = ii; - } - - if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD) - && !bx::strFind(desc.Description, "PerfHUD").isEmpty() ) - { - m_adapter = ii; - m_deviceType = D3DDEVTYPE_REF; - } - } - } - } - - DX_CHECK(m_d3d9->GetAdapterIdentifier(m_adapter, 0, &m_identifier) ); - m_amd = m_identifier.VendorId == BGFX_PCI_ID_AMD; - m_nvidia = m_identifier.VendorId == BGFX_PCI_ID_NVIDIA; - g_caps.vendorId = 0 == m_identifier.VendorId - ? BGFX_PCI_ID_SOFTWARE_RASTERIZER - : (uint16_t)m_identifier.VendorId - ; - g_caps.deviceId = (uint16_t)m_identifier.DeviceId; - - uint32_t behaviorFlags[] = - { - D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE | D3DCREATE_PUREDEVICE, - D3DCREATE_MIXED_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, - D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, - }; - - for (uint32_t ii = 0; ii < BX_COUNTOF(behaviorFlags) && NULL == m_device; ++ii) - { - if (NULL != m_d3d9ex) - { - DX_CHECK(m_d3d9ex->CreateDeviceEx(m_adapter - , m_deviceType - , (HWND)g_platformData.nwh - , behaviorFlags[ii] - , &m_params - , NULL - , &m_deviceEx - ) ); - - m_device = m_deviceEx; - } - else - { - DX_CHECK(m_d3d9->CreateDevice(m_adapter - , m_deviceType - , (HWND)g_platformData.nwh - , behaviorFlags[ii] - , &m_params - , &m_device - ) ); - } - } - } - - if (NULL == m_device) - { - BX_TRACE("Init error: Unable to create Direct3D9 device."); - goto error; - } - - errorState = ErrorState::CreatedDevice; - - m_numWindows = 1; - - if (NULL != m_d3d9ex) - { - DX_CHECK(m_device->QueryInterface(IID_IDirect3DDevice9Ex, (void**)&m_deviceEx) ); - } - - { - IDirect3DQuery9* timerQueryTest[3] = {}; - m_timerQuerySupport = true - && SUCCEEDED(m_device->CreateQuery(D3DQUERYTYPE_TIMESTAMPDISJOINT, &timerQueryTest[0]) ) - && SUCCEEDED(m_device->CreateQuery(D3DQUERYTYPE_TIMESTAMP, &timerQueryTest[1]) ) - && SUCCEEDED(m_device->CreateQuery(D3DQUERYTYPE_TIMESTAMPFREQ, &timerQueryTest[2]) ) - ; - DX_RELEASE(timerQueryTest[0], 0); - DX_RELEASE(timerQueryTest[1], 0); - DX_RELEASE(timerQueryTest[2], 0); - } - - { - IDirect3DQuery9* occlusionQueryTest; - m_occlusionQuerySupport = true - && SUCCEEDED(m_device->CreateQuery(D3DQUERYTYPE_OCCLUSION, &occlusionQueryTest) ) - ; - DX_RELEASE(occlusionQueryTest, 0); - } - - DX_CHECK(m_device->GetDeviceCaps(&m_caps) ); - - // For shit GPUs that can create DX9 device but can't do simple stuff. GTFO! - BX_WARN( (D3DPTEXTURECAPS_SQUAREONLY & m_caps.TextureCaps) == 0, "D3DPTEXTURECAPS_SQUAREONLY"); - BX_WARN( (D3DPTEXTURECAPS_MIPMAP & m_caps.TextureCaps) == D3DPTEXTURECAPS_MIPMAP, "D3DPTEXTURECAPS_MIPMAP"); - BX_WARN( (D3DPTEXTURECAPS_ALPHA & m_caps.TextureCaps) == D3DPTEXTURECAPS_ALPHA, "D3DPTEXTURECAPS_ALPHA"); - BX_WARN(m_caps.VertexShaderVersion >= D3DVS_VERSION(2, 0) && m_caps.PixelShaderVersion >= D3DPS_VERSION(2, 1) - , "Shader Model Version (vs: %x, ps: %x)." - , m_caps.VertexShaderVersion - , m_caps.PixelShaderVersion - ); - - if ( (D3DPTEXTURECAPS_SQUAREONLY & m_caps.TextureCaps) != 0 - || (D3DPTEXTURECAPS_MIPMAP & m_caps.TextureCaps) != D3DPTEXTURECAPS_MIPMAP - || (D3DPTEXTURECAPS_ALPHA & m_caps.TextureCaps) != D3DPTEXTURECAPS_ALPHA - || !(m_caps.VertexShaderVersion >= D3DVS_VERSION(2, 0) && m_caps.PixelShaderVersion >= D3DPS_VERSION(2, 1) ) ) - { - BX_TRACE("Init error: Min spec not satisfied."); - goto error; - } - - BX_TRACE("Max vertex shader 3.0 instr. slots: %d", m_caps.MaxVertexShader30InstructionSlots); - BX_TRACE("Max vertex shader constants: %d", m_caps.MaxVertexShaderConst); - BX_TRACE("Max fragment shader 2.0 instr. slots: %d", m_caps.PS20Caps.NumInstructionSlots); - BX_TRACE("Max fragment shader 3.0 instr. slots: %d", m_caps.MaxPixelShader30InstructionSlots); - BX_TRACE("Num simultaneous render targets: %d", m_caps.NumSimultaneousRTs); - BX_TRACE("Max vertex index: %d", m_caps.MaxVertexIndex); - BX_TRACE("Max streams: %d", m_caps.MaxStreams); - - g_caps.supported |= ( 0 - | BGFX_CAPS_TEXTURE_3D - | BGFX_CAPS_TEXTURE_COMPARE_LEQUAL - | BGFX_CAPS_VERTEX_ATTRIB_HALF - | BGFX_CAPS_VERTEX_ATTRIB_UINT10 - | BGFX_CAPS_FRAGMENT_DEPTH - | BGFX_CAPS_SWAP_CHAIN - | ( (m_caps.DevCaps2 & D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES) ? BGFX_CAPS_TEXTURE_BLIT : 0) - | BGFX_CAPS_TEXTURE_READ_BACK - | (m_occlusionQuerySupport ? BGFX_CAPS_OCCLUSION_QUERY : 0) - | ((m_caps.MaxVertexIndex > UINT16_MAX) ? BGFX_CAPS_INDEX32 : 0) - ); - - m_caps.NumSimultaneousRTs = bx::uint32_min(m_caps.NumSimultaneousRTs, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS); - m_caps.MaxStreams = bx::uint32_min(m_caps.MaxStreams, BGFX_CONFIG_MAX_VERTEX_STREAMS); - m_caps.MaxAnisotropy = bx::uint32_max(m_caps.MaxAnisotropy, 1); - - g_caps.limits.maxTextureSize = uint16_t(bx::uint32_min(m_caps.MaxTextureWidth, m_caps.MaxTextureHeight) ); - g_caps.limits.maxFBAttachments = uint8_t(m_caps.NumSimultaneousRTs); - g_caps.limits.maxVertexStreams = uint8_t(m_caps.MaxStreams); - - if (BX_ENABLED(BGFX_CONFIG_RENDERER_USE_EXTENSIONS) ) - { - BX_TRACE("Extended formats:"); - for (uint32_t ii = 0; ii < ExtendedFormat::Count; ++ii) - { - ExtendedFormat& fmt = s_extendedFormats[ii]; - fmt.m_supported = SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter, m_deviceType, adapterFormat, fmt.m_usage, fmt.m_type, fmt.m_fmt) ); - const char* fourcc = (const char*)&fmt.m_fmt; - BX_TRACE("\t%2d: %c%c%c%c %s", ii, fourcc[0], fourcc[1], fourcc[2], fourcc[3], fmt.m_supported ? "supported" : ""); - BX_UNUSED(fourcc); - } - - m_instancingSupport = false - || s_extendedFormats[ExtendedFormat::Inst].m_supported - || (m_caps.VertexShaderVersion >= D3DVS_VERSION(3, 0) ) - ; - - m_atocSupport = false - || s_extendedFormats[ExtendedFormat::Atoc].m_supported - ; - - if (m_amd - && s_extendedFormats[ExtendedFormat::Inst].m_supported) - { // AMD only - m_device->SetRenderState(D3DRS_POINTSIZE, D3DFMT_INST); - } - - if (s_extendedFormats[ExtendedFormat::Intz].m_supported) - { - s_textureFormat[TextureFormat::D24].m_fmt = D3DFMT_INTZ; - s_textureFormat[TextureFormat::D32].m_fmt = D3DFMT_INTZ; - } - - s_textureFormat[TextureFormat::BC4].m_fmt = s_extendedFormats[ExtendedFormat::Ati1].m_supported ? D3DFMT_ATI1 : D3DFMT_UNKNOWN; - s_textureFormat[TextureFormat::BC5].m_fmt = s_extendedFormats[ExtendedFormat::Ati2].m_supported ? D3DFMT_ATI2 : D3DFMT_UNKNOWN; - - g_caps.supported |= m_instancingSupport ? BGFX_CAPS_INSTANCING : 0; - g_caps.supported |= m_atocSupport ? BGFX_CAPS_ALPHA_TO_COVERAGE : 0; - } - - for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii) - { - uint16_t support = BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter - , m_deviceType - , adapterFormat - , 0 - , D3DRTYPE_TEXTURE - , s_textureFormat[ii].m_fmt - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter - , m_deviceType - , adapterFormat - , D3DUSAGE_QUERY_SRGBREAD - , D3DRTYPE_TEXTURE - , s_textureFormat[ii].m_fmt - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter - , m_deviceType - , adapterFormat - , 0 - , D3DRTYPE_VOLUMETEXTURE - , s_textureFormat[ii].m_fmt - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter - , m_deviceType - , adapterFormat - , D3DUSAGE_QUERY_SRGBREAD - , D3DRTYPE_VOLUMETEXTURE - , s_textureFormat[ii].m_fmt - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter - , m_deviceType - , adapterFormat - , 0 - , D3DRTYPE_CUBETEXTURE - , s_textureFormat[ii].m_fmt - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter - , m_deviceType - , adapterFormat - , D3DUSAGE_QUERY_SRGBREAD - , D3DRTYPE_CUBETEXTURE - , s_textureFormat[ii].m_fmt - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter - , m_deviceType - , adapterFormat - , D3DUSAGE_QUERY_VERTEXTEXTURE - , D3DRTYPE_TEXTURE - , s_textureFormat[ii].m_fmt - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter - , m_deviceType - , adapterFormat - , bimg::isDepth(bimg::TextureFormat::Enum(ii) ) ? D3DUSAGE_DEPTHSTENCIL : D3DUSAGE_RENDERTARGET - , D3DRTYPE_TEXTURE - , s_textureFormat[ii].m_fmt - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceMultiSampleType(m_adapter - , m_deviceType - , s_textureFormat[ii].m_fmt - , true - , D3DMULTISAMPLE_2_SAMPLES - , NULL - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter - , m_deviceType - , adapterFormat - , bimg::isDepth(bimg::TextureFormat::Enum(ii) ) ? D3DUSAGE_DEPTHSTENCIL : D3DUSAGE_RENDERTARGET - , D3DRTYPE_TEXTURE - , s_textureFormat[ii].m_fmt - ) ) ? BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN : BGFX_CAPS_FORMAT_TEXTURE_NONE; - - g_caps.formats[ii] = support; - } - - m_fmtDepth = D3DFMT_D24S8; - - { - IDirect3DSwapChain9* swapChain; - DX_CHECK(m_device->GetSwapChain(0, &swapChain) ); - - // GPA increases swapchain ref count. - // - // This causes assert in debug. When debugger is present refcount - // checks are off. - setGraphicsDebuggerPresent(1 != getRefCount(swapChain) ); - - DX_RELEASE(swapChain, 0); - } - - // Init reserved part of view name. - for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii) - { - bx::snprintf(s_viewName[ii], BGFX_CONFIG_MAX_VIEW_NAME_RESERVED + 1, "%3d ", ii); - mbstowcs(s_viewNameW[ii], s_viewName[ii], BGFX_CONFIG_MAX_VIEW_NAME_RESERVED); - } - - if (NULL != m_deviceEx) - { - int32_t gpuPriority; - DX_CHECK(m_deviceEx->GetGPUThreadPriority(&gpuPriority) ); - BX_TRACE("GPU thread priority: %d", gpuPriority); - - uint32_t maxLatency; - DX_CHECK(m_deviceEx->GetMaximumFrameLatency(&maxLatency) ); - BX_TRACE("GPU max frame latency: %d", maxLatency); - } - - postReset(); - - m_initialized = true; - - g_internalData.context = m_device; - return true; - - error: - switch (errorState) - { - case ErrorState::CreatedDevice: - if (NULL != m_d3d9ex) - { - DX_RELEASE(m_deviceEx, 1); - DX_RELEASE(m_device, 0); - } - else - { - DX_RELEASE(m_device, 0); - } - BX_FALLTHROUGH; - - case ErrorState::CreatedD3D9: - if (NULL != m_d3d9ex) - { - DX_RELEASE(m_d3d9, 1); - DX_RELEASE(m_d3d9ex, 0); - } - else - { - DX_RELEASE(m_d3d9, 0); - } - BX_FALLTHROUGH; - - case ErrorState::LoadedD3D9: - m_nvapi.shutdown(); - bx::dlclose(m_d3d9Dll); - BX_FALLTHROUGH; - - case ErrorState::Default: - break; - } - - return false; - } - - void shutdown() - { - preReset(); - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_indexBuffers); ++ii) - { - m_indexBuffers[ii].destroy(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_vertexBuffers); ++ii) - { - m_vertexBuffers[ii].destroy(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_shaders); ++ii) - { - m_shaders[ii].destroy(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii) - { - m_textures[ii].destroy(); - } - - if (NULL != m_d3d9ex) - { - DX_RELEASE(m_deviceEx, 1); - DX_RELEASE(m_device, 0); - DX_RELEASE(m_d3d9, 1); - DX_RELEASE(m_d3d9ex, 0); - } - else - { - DX_RELEASE(m_device, 0); - DX_RELEASE(m_d3d9, 0); - } - - m_nvapi.shutdown(); - bx::dlclose(m_d3d9Dll); - - m_initialized = false; - } - - RendererType::Enum getRendererType() const override - { - return RendererType::Direct3D9; - } - - const char* getRendererName() const override - { - if (NULL != m_d3d9ex) - { - return BGFX_RENDERER_DIRECT3D9_NAME " Ex"; - } - - return BGFX_RENDERER_DIRECT3D9_NAME; - } - - void createIndexBuffer(IndexBufferHandle _handle, const Memory* _mem, uint16_t _flags) override - { - m_indexBuffers[_handle.idx].create(_mem->size, _mem->data, _flags); - } - - void destroyIndexBuffer(IndexBufferHandle _handle) override - { - m_indexBuffers[_handle.idx].destroy(); - } - - void createVertexLayout(VertexLayoutHandle _handle, const VertexLayout& _layout) override - { - VertexLayout& layout = m_vertexLayouts[_handle.idx]; - bx::memCopy(&layout, &_layout, sizeof(VertexLayout) ); - dump(layout); - } - - void destroyVertexLayout(VertexLayoutHandle /*_handle*/) override - { - } - - void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexLayoutHandle _layoutHandle, uint16_t /*_flags*/) override - { - m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _layoutHandle); - } - - void destroyVertexBuffer(VertexBufferHandle _handle) override - { - m_vertexBuffers[_handle.idx].destroy(); - } - - void createDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _size, uint16_t _flags) override - { - m_indexBuffers[_handle.idx].create(_size, NULL, _flags); - } - - void updateDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _offset, uint32_t _size, const Memory* _mem) override - { - m_indexBuffers[_handle.idx].update(_offset, bx::uint32_min(_size, _mem->size), _mem->data); - } - - void destroyDynamicIndexBuffer(IndexBufferHandle _handle) override - { - m_indexBuffers[_handle.idx].destroy(); - } - - void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t /*_flags*/) override - { - VertexLayoutHandle layoutHandle = BGFX_INVALID_HANDLE; - m_vertexBuffers[_handle.idx].create(_size, NULL, layoutHandle); - } - - void updateDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _offset, uint32_t _size, const Memory* _mem) override - { - m_vertexBuffers[_handle.idx].update(_offset, bx::uint32_min(_size, _mem->size), _mem->data); - } - - void destroyDynamicVertexBuffer(VertexBufferHandle _handle) override - { - m_vertexBuffers[_handle.idx].destroy(); - } - - void createShader(ShaderHandle _handle, const Memory* _mem) override - { - m_shaders[_handle.idx].create(_mem); - } - - void destroyShader(ShaderHandle _handle) override - { - m_shaders[_handle.idx].destroy(); - } - - void createProgram(ProgramHandle _handle, ShaderHandle _vsh, ShaderHandle _fsh) override - { - m_program[_handle.idx].create(&m_shaders[_vsh.idx], isValid(_fsh) ? &m_shaders[_fsh.idx] : NULL); - } - - void destroyProgram(ProgramHandle _handle) override - { - m_program[_handle.idx].destroy(); - } - - void* createTexture(TextureHandle _handle, const Memory* _mem, uint64_t _flags, uint8_t _skip) override - { - m_textures[_handle.idx].create(_mem, _flags, _skip); - return NULL; - } - - void updateTextureBegin(TextureHandle _handle, uint8_t _side, uint8_t _mip) override - { - m_updateTexture = &m_textures[_handle.idx]; - m_updateTexture->updateBegin(_side, _mip); - } - - void updateTexture(TextureHandle /*_handle*/, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem) override - { - m_updateTexture->update(_side, _mip, _rect, _z, _depth, _pitch, _mem); - } - - void updateTextureEnd() override - { - m_updateTexture->updateEnd(); - m_updateTexture = NULL; - } - - void readTexture(TextureHandle _handle, void* _data, uint8_t _mip) override - { - TextureD3D9& texture = m_textures[_handle.idx]; - - D3DLOCKED_RECT lockedRect; - DX_CHECK(texture.m_texture2d->LockRect(_mip - , &lockedRect - , NULL - , D3DLOCK_NO_DIRTY_UPDATE|D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY - ) ); - - uint32_t srcWidth = bx::uint32_max(1, texture.m_width >>_mip); - uint32_t srcHeight = bx::uint32_max(1, texture.m_height>>_mip); - uint32_t srcPitch = lockedRect.Pitch; - uint8_t* src = (uint8_t*)lockedRect.pBits; - - const uint8_t bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(texture.m_textureFormat) ); - uint8_t* dst = (uint8_t*)_data; - uint32_t dstPitch = srcWidth*bpp/8; - - uint32_t pitch = bx::uint32_min(srcPitch, dstPitch); - - for (uint32_t yy = 0, height = srcHeight; yy < height; ++yy) - { - bx::memCopy(dst, src, pitch); - - src += srcPitch; - dst += dstPitch; - } - - DX_CHECK(texture.m_texture2d->UnlockRect(_mip) ); - } - - void resizeTexture(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, uint16_t _numLayers) override - { - TextureD3D9& texture = m_textures[_handle.idx]; - - uint32_t size = sizeof(uint32_t) + sizeof(TextureCreate); - const Memory* mem = alloc(size); - - bx::StaticMemoryBlockWriter writer(mem->data, mem->size); - uint32_t magic = BGFX_CHUNK_MAGIC_TEX; - bx::write(&writer, magic, bx::ErrorAssert{}); - - TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_depth = 0; - tc.m_numLayers = _numLayers; - tc.m_numMips = _numMips; - tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); - tc.m_cubeMap = false; - tc.m_mem = NULL; - bx::write(&writer, tc, bx::ErrorAssert{}); - - texture.destroy(true); - texture.create(mem, texture.m_flags, 0); - - release(mem); - } - - void overrideInternal(TextureHandle _handle, uintptr_t _ptr) override - { - // Resource ref. counts might be messed up outside of bgfx. - // Disabling ref. count check once texture is overridden. - setGraphicsDebuggerPresent(true); - m_textures[_handle.idx].overrideInternal(_ptr); - } - - uintptr_t getInternal(TextureHandle _handle) override - { - // Resource ref. counts might be messed up outside of bgfx. - // Disabling ref. count check once texture is overridden. - setGraphicsDebuggerPresent(true); - return uintptr_t(m_textures[_handle.idx].m_ptr); - } - - void destroyTexture(TextureHandle _handle) override - { - m_textures[_handle.idx].destroy(); - } - - void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const Attachment* _attachment) override - { - m_frameBuffers[_handle.idx].create(_num, _attachment); - } - - void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _format, TextureFormat::Enum _depthFormat) override - { - uint16_t denseIdx = m_numWindows++; - m_windows[denseIdx] = _handle; - m_frameBuffers[_handle.idx].create(denseIdx, _nwh, _width, _height, _format, _depthFormat); - } - - void destroyFrameBuffer(FrameBufferHandle _handle) override - { - uint16_t denseIdx = m_frameBuffers[_handle.idx].destroy(); - if (UINT16_MAX != denseIdx) - { - --m_numWindows; - if (m_numWindows > 1) - { - FrameBufferHandle handle = m_windows[m_numWindows]; - m_windows[m_numWindows] = {kInvalidHandle}; - if (m_numWindows != denseIdx) - { - m_windows[denseIdx] = handle; - m_frameBuffers[handle.idx].m_denseIdx = denseIdx; - } - } - } - } - - void createUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name) override - { - if (NULL != m_uniforms[_handle.idx]) - { - bx::free(g_allocator, m_uniforms[_handle.idx]); - } - - const uint32_t size = bx::alignUp(g_uniformTypeSize[_type]*_num, 16); - void* data = bx::alloc(g_allocator, size); - bx::memSet(data, 0, size); - m_uniforms[_handle.idx] = data; - m_uniformReg.add(_handle, _name); - } - - void destroyUniform(UniformHandle _handle) override - { - bx::free(g_allocator, m_uniforms[_handle.idx]); - m_uniforms[_handle.idx] = NULL; - m_uniformReg.remove(_handle); - } - - void requestScreenShot(FrameBufferHandle _handle, const char* _filePath) override - { -#if BX_PLATFORM_WINDOWS - IDirect3DSwapChain9* swapChain = isValid(_handle) - ? m_frameBuffers[_handle.idx].m_swapChain - : m_swapChain - ; - - if (NULL == swapChain) - { - BX_TRACE("Unable to capture screenshot %s.", _filePath); - return; - } - - D3DPRESENT_PARAMETERS params; - DX_CHECK(swapChain->GetPresentParameters(¶ms)); - - IDirect3DSurface9* surface; - D3DDEVICE_CREATION_PARAMETERS dcp; - DX_CHECK(m_device->GetCreationParameters(&dcp) ); - - D3DDISPLAYMODE dm; - DX_CHECK(m_d3d9->GetAdapterDisplayMode(dcp.AdapterOrdinal, &dm) ); - - DX_CHECK(m_device->CreateOffscreenPlainSurface(dm.Width - , dm.Height - , D3DFMT_A8R8G8B8 - , D3DPOOL_SCRATCH - , &surface - , NULL - ) ); - - HWND nwh = params.hDeviceWindow; - - SetWindowPos(nwh, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); - - DX_CHECK(m_device->GetFrontBufferData(0, surface) ); - - SetWindowPos(nwh, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); - - D3DLOCKED_RECT rect; - DX_CHECK(surface->LockRect(&rect - , NULL - , D3DLOCK_NO_DIRTY_UPDATE|D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY - ) ); - - RECT rc; - GetClientRect(nwh, &rc); - POINT point; - point.x = rc.left; - point.y = rc.top; - ClientToScreen(nwh, &point); - uint8_t* data = (uint8_t*)rect.pBits; - uint32_t bytesPerPixel = rect.Pitch/dm.Width; - - g_callback->screenShot(_filePath - , params.BackBufferWidth - , params.BackBufferHeight - , rect.Pitch - , &data[point.y*rect.Pitch+point.x*bytesPerPixel] - , params.BackBufferHeight*rect.Pitch - , false - ); - - DX_CHECK(surface->UnlockRect() ); - DX_RELEASE(surface, 0); -#else - BX_TRACE("Screenshot not supported!"); - BX_UNUSED(_handle, _filePath); -#endif // BX_PLATFORM_WINDOWS - } - - void updateViewName(ViewId _id, const char* _name) override - { - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION) ) - { - mbstowcs(&s_viewNameW[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED] - , _name - , BX_COUNTOF(s_viewNameW[0])-BGFX_CONFIG_MAX_VIEW_NAME_RESERVED - ); - } - - bx::strCopy(&s_viewName[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED] - , BX_COUNTOF(s_viewName[0]) - BGFX_CONFIG_MAX_VIEW_NAME_RESERVED - , _name - ); - } - - void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) override - { - bx::memCopy(m_uniforms[_loc], _data, _size); - } - - void invalidateOcclusionQuery(OcclusionQueryHandle _handle) override - { - m_occlusionQuery.invalidate(_handle); - } - - void setMarker(const char* _marker, uint16_t _len) override - { - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION) ) - { - uint32_t size = _len*sizeof(wchar_t); - wchar_t* name = (wchar_t*)alloca(size+2); - mbstowcs(name, _marker, size); - name[_len] = L'\0'; - PIX_SETMARKER(kColorMarker, name); - } - } - - virtual void setName(Handle _handle, const char* _name, uint16_t _len) override - { - BX_UNUSED(_handle, _name, _len) - } - - void submitBlit(BlitState& _bs, uint16_t _view); - - void submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) override; - - void blitSetup(TextVideoMemBlitter& _blitter) override - { - uint32_t width = m_params.BackBufferWidth; - uint32_t height = m_params.BackBufferHeight; - - FrameBufferHandle fbh = BGFX_INVALID_HANDLE; - setFrameBuffer(fbh, false, false); - - D3DVIEWPORT9 vp; - vp.X = 0; - vp.Y = 0; - vp.Width = width; - vp.Height = height; - vp.MinZ = 0.0f; - vp.MaxZ = 1.0f; - - IDirect3DDevice9* device = m_device; - DX_CHECK(device->SetViewport(&vp) ); - DX_CHECK(device->SetRenderState(D3DRS_STENCILENABLE, FALSE) ); - DX_CHECK(device->SetRenderState(D3DRS_ZENABLE, FALSE) ); - DX_CHECK(device->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS) ); - DX_CHECK(device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE) ); - DX_CHECK(device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE) ); - DX_CHECK(device->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER) ); - DX_CHECK(device->SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_RED|D3DCOLORWRITEENABLE_GREEN|D3DCOLORWRITEENABLE_BLUE) ); - DX_CHECK(device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID) ); - - ProgramD3D9& program = m_program[_blitter.m_program.idx]; - DX_CHECK(device->SetVertexShader(program.m_vsh->m_vertexShader) ); - DX_CHECK(device->SetPixelShader(program.m_fsh->m_pixelShader) ); - - VertexBufferD3D9& vb = m_vertexBuffers[_blitter.m_vb->handle.idx]; - VertexLayout& layout = m_vertexLayouts[_blitter.m_vb->layoutHandle.idx]; - DX_CHECK(device->SetStreamSource(0, vb.m_ptr, 0, layout.m_stride) ); - setInputLayout(layout, 0); - - IndexBufferD3D9& ib = m_indexBuffers[_blitter.m_ib->handle.idx]; - DX_CHECK(device->SetIndices(ib.m_ptr) ); - - float proj[16]; - bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f, 0.0f, false); - - PredefinedUniform& predefined = program.m_predefined[0]; - uint8_t flags = predefined.m_type; - setShaderUniform(flags, predefined.m_loc, proj, 4); - - m_textures[_blitter.m_texture.idx].commit(0, BGFX_SAMPLER_INTERNAL_DEFAULT, NULL); - } - - void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) override - { - const uint32_t numVertices = _numIndices*4/6; - if (0 < numVertices) - { - m_indexBuffers[_blitter.m_ib->handle.idx].update(0, _numIndices * 2, _blitter.m_ib->data, true); - m_vertexBuffers[_blitter.m_vb->handle.idx].update(0, numVertices*_blitter.m_layout.m_stride, _blitter.m_vb->data, true); - - DX_CHECK(m_device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST - , 0 - , 0 - , numVertices - , 0 - , _numIndices / 3 - ) ); - } - } - - void updateMsaa() - { - for (uint32_t ii = 1, last = 0; ii < BX_COUNTOF(s_checkMsaa); ++ii) - { - D3DMULTISAMPLE_TYPE msaa = s_checkMsaa[ii]; - DWORD quality; - - HRESULT hr = m_d3d9->CheckDeviceMultiSampleType(m_adapter - , m_deviceType - , m_params.BackBufferFormat - , m_params.Windowed - , msaa - , &quality - ); - - if (SUCCEEDED(hr) ) - { - s_msaa[ii].m_type = msaa; - s_msaa[ii].m_quality = bx::uint32_imax(0, quality-1); - last = ii; - } - else - { - s_msaa[ii] = s_msaa[last]; - } - } - } - - void updateResolution(const Resolution& _resolution) - { - m_maxAnisotropy = !!(_resolution.reset & BGFX_RESET_MAXANISOTROPY) - ? m_caps.MaxAnisotropy - : 1 - ; - const uint32_t maskFlags = ~(0 - | BGFX_RESET_MAXANISOTROPY - | BGFX_RESET_DEPTH_CLAMP - | BGFX_RESET_SUSPEND - ); - - if (m_resolution.width != _resolution.width - || m_resolution.height != _resolution.height - || (m_resolution.reset&maskFlags) != (_resolution.reset&maskFlags) ) - { - uint32_t flags = _resolution.reset & (~BGFX_RESET_INTERNAL_FORCE); - - m_resolution = _resolution; - m_resolution.reset = flags; - - m_textVideoMem.resize(false, _resolution.width, _resolution.height); - m_textVideoMem.clear(); - - D3DDEVICE_CREATION_PARAMETERS dcp; - DX_CHECK(m_device->GetCreationParameters(&dcp) ); - - D3DDISPLAYMODE dm; - DX_CHECK(m_d3d9->GetAdapterDisplayMode(dcp.AdapterOrdinal, &dm) ); - - m_params.BackBufferFormat = dm.Format; - - m_params.BackBufferWidth = _resolution.width; - m_params.BackBufferHeight = _resolution.height; - m_params.FullScreen_RefreshRateInHz = BGFX_RESET_FULLSCREEN == (m_resolution.reset&BGFX_RESET_FULLSCREEN_MASK) ? 60 : 0; - m_params.PresentationInterval = !!(m_resolution.reset&BGFX_RESET_VSYNC) ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; - - updateMsaa(); - - Msaa& msaa = s_msaa[(m_resolution.reset&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT]; - m_params.MultiSampleType = msaa.m_type; - m_params.MultiSampleQuality = msaa.m_quality; - - preReset(); - DX_CHECK(m_device->Reset(&m_params) ); - postReset(); - } - } - - void setFrameBuffer(FrameBufferHandle _fbh, bool _msaa = true, bool _needPresent = true) - { - if (isValid(m_fbh) - && m_fbh.idx != _fbh.idx) - { - FrameBufferD3D9& frameBuffer = m_frameBuffers[m_fbh.idx]; - frameBuffer.resolve(); - } - - if (!isValid(_fbh) ) - { - m_needPresent |= _needPresent; - DX_CHECK(m_device->SetRenderTarget(0, m_backBufferColor) ); - for (uint32_t ii = 1, num = g_caps.limits.maxFBAttachments; ii < num; ++ii) - { - DX_CHECK(m_device->SetRenderTarget(ii, NULL) ); - } - DX_CHECK(m_device->SetDepthStencilSurface(m_backBufferDepthStencil) ); - - DX_CHECK(m_device->SetRenderState(D3DRS_SRGBWRITEENABLE, 0 != (m_resolution.reset & BGFX_RESET_SRGB_BACKBUFFER) ) ); - } - else - { - m_frameBuffers[_fbh.idx].set(); - } - - m_fbh = _fbh; - m_rtMsaa = _msaa; - } - - void setShaderUniform(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) - { - if (_flags&kUniformFragmentBit) - { - DX_CHECK(m_device->SetPixelShaderConstantF(_regIndex, (const float*)_val, _numRegs) ); - } - else - { - DX_CHECK(m_device->SetVertexShaderConstantF(_regIndex, (const float*)_val, _numRegs) ); - } - } - - void setShaderUniform4f(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) - { - setShaderUniform(_flags, _regIndex, _val, _numRegs); - } - - void setShaderUniform4x4f(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) - { - setShaderUniform(_flags, _regIndex, _val, _numRegs); - } - - void reset() - { - preReset(); - - HRESULT hr; - - do - { - hr = m_device->Reset(&m_params); - } while (FAILED(hr) ); - - postReset(); - } - - void flush() - { - m_flushQuery->Issue(D3DISSUE_END); - m_flushQuery->GetData(NULL, 0, D3DGETDATA_FLUSH); - } - - bool isDeviceRemoved() override - { - return false; - } - - void flip() override - { - if (NULL != m_swapChain) - { - for (uint32_t ii = 0, num = m_numWindows; ii < num; ++ii) - { - HRESULT hr = S_OK; - if (0 == ii) - { - if (m_needPresent) - { - hr = m_swapChain->Present(NULL, NULL, (HWND)g_platformData.nwh, NULL, 0); - m_needPresent = false; - } - else - { - flush(); - } - } - else - { - hr = m_frameBuffers[m_windows[ii].idx].present(); - } - - if (isLost(hr) ) - { - do - { - do - { - hr = m_device->TestCooperativeLevel(); - } - while (D3DERR_DEVICENOTRESET != hr); - - reset(); - hr = m_device->TestCooperativeLevel(); - } - while (FAILED(hr) ); - - break; - } - else if (FAILED(hr) ) - { - BX_TRACE("Present failed with err 0x%08x.", hr); - } - } - } - } - - void preReset() - { - m_needPresent = false; - - invalidateSamplerState(); - m_inputLayoutCache.invalidate(); - - for (uint32_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage) - { - DX_CHECK(m_device->SetTexture(stage, NULL) ); - } - - DX_CHECK(m_device->SetRenderTarget(0, m_backBufferColor) ); - for (uint32_t ii = 1, num = g_caps.limits.maxFBAttachments; ii < num; ++ii) - { - DX_CHECK(m_device->SetRenderTarget(ii, NULL) ); - } - DX_CHECK(m_device->SetDepthStencilSurface(m_backBufferDepthStencil) ); - DX_CHECK(m_device->SetVertexShader(NULL) ); - DX_CHECK(m_device->SetPixelShader(NULL) ); - DX_CHECK(m_device->SetStreamSource(0, NULL, 0, 0) ); - DX_CHECK(m_device->SetIndices(NULL) ); - - DX_RELEASE(m_backBufferColor, 0); - DX_RELEASE(m_backBufferDepthStencil, 0); - DX_RELEASE(m_swapChain, 0); - - capturePreReset(); - - DX_RELEASE(m_flushQuery, 0); - if (m_timerQuerySupport) - { - m_gpuTimer.preReset(); - } - - if (m_occlusionQuerySupport) - { - m_occlusionQuery.preReset(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_indexBuffers); ++ii) - { - m_indexBuffers[ii].preReset(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_vertexBuffers); ++ii) - { - m_vertexBuffers[ii].preReset(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_frameBuffers); ++ii) - { - m_frameBuffers[ii].preReset(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii) - { - m_textures[ii].preReset(); - } - } - - void postReset() - { - DX_CHECK(m_device->GetSwapChain(0, &m_swapChain) ); - DX_CHECK(m_swapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &m_backBufferColor) ); - DX_CHECK(m_device->GetDepthStencilSurface(&m_backBufferDepthStencil) ); - - DX_CHECK(m_device->CreateQuery(D3DQUERYTYPE_EVENT, &m_flushQuery) ); - if (m_timerQuerySupport) - { - m_gpuTimer.postReset(); - } - - if (m_occlusionQuerySupport) - { - m_occlusionQuery.postReset(); - } - - capturePostReset(); - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_indexBuffers); ++ii) - { - m_indexBuffers[ii].postReset(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_vertexBuffers); ++ii) - { - m_vertexBuffers[ii].postReset(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii) - { - m_textures[ii].postReset(); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_frameBuffers); ++ii) - { - m_frameBuffers[ii].postReset(); - } - } - - void invalidateSamplerState() - { - for (uint32_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage) - { - m_samplerFlags[stage] = UINT32_MAX; - } - } - - static void setSamplerState(IDirect3DDevice9* _device, DWORD _stage, D3DSAMPLERSTATETYPE _type, DWORD _value) - { - DX_CHECK(_device->SetSamplerState(_stage, _type, _value) ); - if (4 > _stage) - { - DX_CHECK(_device->SetSamplerState(D3DVERTEXTEXTURESAMPLER0 + _stage, _type, _value) ); - } - } - - void setSamplerState(uint8_t _stage, uint64_t _flags, const float _rgba[4]) - { - const uint64_t flags = _flags&( (~BGFX_SAMPLER_RESERVED_MASK) | BGFX_SAMPLER_BITS_MASK | BGFX_TEXTURE_SRGB); - BX_ASSERT(_stage < BX_COUNTOF(m_samplerFlags), ""); - if (m_samplerFlags[_stage] != flags) - { - m_samplerFlags[_stage] = flags; - IDirect3DDevice9* device = m_device; - D3DTEXTUREADDRESS tau = s_textureAddress[(_flags&BGFX_SAMPLER_U_MASK)>>BGFX_SAMPLER_U_SHIFT]; - D3DTEXTUREADDRESS tav = s_textureAddress[(_flags&BGFX_SAMPLER_V_MASK)>>BGFX_SAMPLER_V_SHIFT]; - D3DTEXTUREADDRESS taw = s_textureAddress[(_flags&BGFX_SAMPLER_W_MASK)>>BGFX_SAMPLER_W_SHIFT]; - D3DTEXTUREFILTERTYPE minFilter = s_textureFilter[(_flags&BGFX_SAMPLER_MIN_MASK)>>BGFX_SAMPLER_MIN_SHIFT]; - D3DTEXTUREFILTERTYPE magFilter = s_textureFilter[(_flags&BGFX_SAMPLER_MAG_MASK)>>BGFX_SAMPLER_MAG_SHIFT]; - D3DTEXTUREFILTERTYPE mipFilter = s_textureFilter[(_flags&BGFX_SAMPLER_MIP_MASK)>>BGFX_SAMPLER_MIP_SHIFT]; - - setSamplerState(device, _stage, D3DSAMP_ADDRESSU, tau); - setSamplerState(device, _stage, D3DSAMP_ADDRESSV, tav); - setSamplerState(device, _stage, D3DSAMP_ADDRESSW, taw); - setSamplerState(device, _stage, D3DSAMP_MINFILTER, minFilter); - setSamplerState(device, _stage, D3DSAMP_MAGFILTER, magFilter); - setSamplerState(device, _stage, D3DSAMP_MIPFILTER, mipFilter); - setSamplerState(device, _stage, D3DSAMP_MAXANISOTROPY, m_maxAnisotropy); - setSamplerState(device, _stage, D3DSAMP_SRGBTEXTURE, 0 != (flags & BGFX_TEXTURE_SRGB) ); - if (NULL != _rgba) - { - if (needBorderColor(_flags) ) - { - DWORD bc = D3DCOLOR_COLORVALUE(_rgba[0], _rgba[1], _rgba[2], _rgba[3]); - setSamplerState(device - , _stage - , D3DSAMP_BORDERCOLOR - , bc - ); - } - } - } - } - - bool isVisible(Frame* _render, OcclusionQueryHandle _handle, bool _visible) - { - m_occlusionQuery.resolve(_render); - return _visible == (0 != _render->m_occlusion[_handle.idx]); - } - - void capturePreReset() - { - if (NULL != m_captureSurface) - { - g_callback->captureEnd(); - } - DX_RELEASE(m_captureSurface, 1); - DX_RELEASE(m_captureTexture, 0); - DX_RELEASE(m_captureResolve, 0); - } - - void capturePostReset() - { - if (m_resolution.reset&BGFX_RESET_CAPTURE) - { - uint32_t width = m_params.BackBufferWidth; - uint32_t height = m_params.BackBufferHeight; - D3DFORMAT fmt = m_params.BackBufferFormat; - - DX_CHECK(m_device->CreateTexture(width - , height - , 1 - , 0 - , fmt - , D3DPOOL_SYSTEMMEM - , &m_captureTexture - , NULL - ) ); - - DX_CHECK(m_captureTexture->GetSurfaceLevel(0 - , &m_captureSurface - ) ); - - if (m_params.MultiSampleType != D3DMULTISAMPLE_NONE) - { - DX_CHECK(m_device->CreateRenderTarget(width - , height - , fmt - , D3DMULTISAMPLE_NONE - , 0 - , false - , &m_captureResolve - , NULL - ) ); - } - - g_callback->captureBegin(width, height, width*4, TextureFormat::BGRA8, false); - } - } - - void capture() - { - if (NULL != m_captureSurface) - { - IDirect3DSurface9* resolve = m_backBufferColor; - - if (NULL != m_captureResolve) - { - resolve = m_captureResolve; - DX_CHECK(m_device->StretchRect(m_backBufferColor - , 0 - , m_captureResolve - , NULL - , D3DTEXF_NONE - ) ); - } - - HRESULT hr = m_device->GetRenderTargetData(resolve, m_captureSurface); - if (SUCCEEDED(hr) ) - { - D3DLOCKED_RECT rect; - DX_CHECK(m_captureSurface->LockRect(&rect - , NULL - , D3DLOCK_NO_DIRTY_UPDATE|D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY - ) ); - - g_callback->captureFrame(rect.pBits, m_params.BackBufferHeight*rect.Pitch); - - DX_CHECK(m_captureSurface->UnlockRect() ); - } - } - } - - void commit(UniformBuffer& _uniformBuffer) - { - _uniformBuffer.reset(); - - IDirect3DDevice9* device = m_device; - - for (;;) - { - uint32_t opcode = _uniformBuffer.read(); - - if (UniformType::End == opcode) - { - break; - } - - UniformType::Enum type; - uint16_t loc; - uint16_t num; - uint16_t copy; - UniformBuffer::decodeOpcode(opcode, type, loc, num, copy); - - const char* data; - if (copy) - { - data = _uniformBuffer.read(g_uniformTypeSize[type]*num); - } - else - { - UniformHandle handle; - bx::memCopy(&handle, _uniformBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) ); - data = (const char*)m_uniforms[handle.idx]; - } - -#define CASE_IMPLEMENT_UNIFORM(_uniform, _dxsuffix, _type) \ - case UniformType::_uniform: \ - { \ - _type* value = (_type*)data; \ - DX_CHECK(device->SetVertexShaderConstant##_dxsuffix(loc, value, num) ); \ - } \ - break; \ - \ - case UniformType::_uniform|kUniformFragmentBit: \ - { \ - _type* value = (_type*)data; \ - DX_CHECK(device->SetPixelShaderConstant##_dxsuffix(loc, value, num) ); \ - } \ - break - - switch ( (int32_t)type) - { - case UniformType::Mat3: - { - float* value = (float*)data; - for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3, value += 9) - { - Matrix4 mtx; - mtx.un.val[ 0] = value[0]; - mtx.un.val[ 1] = value[1]; - mtx.un.val[ 2] = value[2]; - mtx.un.val[ 3] = 0.0f; - mtx.un.val[ 4] = value[3]; - mtx.un.val[ 5] = value[4]; - mtx.un.val[ 6] = value[5]; - mtx.un.val[ 7] = 0.0f; - mtx.un.val[ 8] = value[6]; - mtx.un.val[ 9] = value[7]; - mtx.un.val[10] = value[8]; - mtx.un.val[11] = 0.0f; - DX_CHECK(device->SetVertexShaderConstantF(loc, &mtx.un.val[0], 3) ); - } - } - break; - - case UniformType::Mat3|kUniformFragmentBit: - { - float* value = (float*)data; - for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3, value += 9) - { - Matrix4 mtx; - mtx.un.val[ 0] = value[0]; - mtx.un.val[ 1] = value[1]; - mtx.un.val[ 2] = value[2]; - mtx.un.val[ 3] = 0.0f; - mtx.un.val[ 4] = value[3]; - mtx.un.val[ 5] = value[4]; - mtx.un.val[ 6] = value[5]; - mtx.un.val[ 7] = 0.0f; - mtx.un.val[ 8] = value[6]; - mtx.un.val[ 9] = value[7]; - mtx.un.val[10] = value[8]; - mtx.un.val[11] = 0.0f; - DX_CHECK(device->SetPixelShaderConstantF(loc, &mtx.un.val[0], 3) ); - } - } - break; - - CASE_IMPLEMENT_UNIFORM(Sampler, I, int); - CASE_IMPLEMENT_UNIFORM(Vec4, F, float); - CASE_IMPLEMENT_UNIFORM(Mat4, F, float); - - case UniformType::End: - break; - - default: - BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _uniformBuffer.getPos(), opcode, type, loc, num, copy); - break; - } -#undef CASE_IMPLEMENT_UNIFORM - } - } - - void clearQuad(ClearQuad& _clearQuad, const Rect& _rect, const Clear& _clear, const float _palette[][4]) - { - IDirect3DDevice9* device = m_device; - - uint32_t numMrt = 1; - FrameBufferHandle fbh = m_fbh; - if (isValid(fbh) ) - { - const FrameBufferD3D9& fb = m_frameBuffers[fbh.idx]; - numMrt = bx::uint32_max(1, fb.m_num); - } - - if (1 == numMrt) - { - D3DCOLOR color = 0; - DWORD flags = 0; - - if (BGFX_CLEAR_COLOR & _clear.m_flags) - { - if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags) - { - uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, _clear.m_index[0]); - const float* rgba = _palette[index]; - const float rr = rgba[0]; - const float gg = rgba[1]; - const float bb = rgba[2]; - const float aa = rgba[3]; - color = D3DCOLOR_COLORVALUE(rr, gg, bb, aa); - } - else - { - color = D3DCOLOR_RGBA(_clear.m_index[0], _clear.m_index[1], _clear.m_index[2], _clear.m_index[3]); - } - - flags |= D3DCLEAR_TARGET; - DX_CHECK(device->SetRenderState(D3DRS_COLORWRITEENABLE - , D3DCOLORWRITEENABLE_RED - | D3DCOLORWRITEENABLE_GREEN - | D3DCOLORWRITEENABLE_BLUE - | D3DCOLORWRITEENABLE_ALPHA - ) ); - } - - if (BGFX_CLEAR_DEPTH & _clear.m_flags) - { - flags |= D3DCLEAR_ZBUFFER; - DX_CHECK(device->SetRenderState(D3DRS_ZWRITEENABLE, TRUE) ); - } - - if (BGFX_CLEAR_STENCIL & _clear.m_flags) - { - flags |= D3DCLEAR_STENCIL; - } - - if (0 != flags) - { - RECT rc; - rc.left = _rect.m_x; - rc.top = _rect.m_y; - rc.right = _rect.m_x + _rect.m_width; - rc.bottom = _rect.m_y + _rect.m_height; - DX_CHECK(device->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE) ); - DX_CHECK(device->SetScissorRect(&rc) ); - DX_CHECK(device->Clear(0, NULL, flags, color, _clear.m_depth, _clear.m_stencil) ); - DX_CHECK(device->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE) ); - } - } - else - { - DX_CHECK(device->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE) ); - DX_CHECK(device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE) ); - DX_CHECK(device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE) ); - - if (BGFX_CLEAR_COLOR & _clear.m_flags) - { - DX_CHECK(device->SetRenderState(D3DRS_COLORWRITEENABLE - , D3DCOLORWRITEENABLE_RED - | D3DCOLORWRITEENABLE_GREEN - | D3DCOLORWRITEENABLE_BLUE - | D3DCOLORWRITEENABLE_ALPHA - ) ); - } - else - { - DX_CHECK(device->SetRenderState(D3DRS_COLORWRITEENABLE, 0) ); - } - - if (BGFX_CLEAR_DEPTH & _clear.m_flags) - { - DX_CHECK(device->SetRenderState(D3DRS_ZWRITEENABLE, TRUE) ); - DX_CHECK(device->SetRenderState(D3DRS_ZENABLE, TRUE) ); - DX_CHECK(device->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS) ); - } - else - { - DX_CHECK(device->SetRenderState(D3DRS_ZWRITEENABLE, FALSE) ); - DX_CHECK(device->SetRenderState(D3DRS_ZENABLE, FALSE) ); - } - - if (BGFX_CLEAR_STENCIL & _clear.m_flags) - { - DX_CHECK(device->SetRenderState(D3DRS_STENCILENABLE, TRUE) ); - DX_CHECK(device->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, TRUE) ); - DX_CHECK(device->SetRenderState(D3DRS_STENCILREF, _clear.m_stencil) ); - DX_CHECK(device->SetRenderState(D3DRS_STENCILMASK, 0xff) ); - DX_CHECK(device->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_ALWAYS) ); - DX_CHECK(device->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_REPLACE) ); - DX_CHECK(device->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_REPLACE) ); - DX_CHECK(device->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE) ); - } - else - { - DX_CHECK(device->SetRenderState(D3DRS_STENCILENABLE, FALSE) ); - } - - VertexBufferD3D9& vb = m_vertexBuffers[_clearQuad.m_vb.idx]; - VertexLayout& layout = _clearQuad.m_layout; - uint32_t stride = _clearQuad.m_layout.m_stride; - - ProgramD3D9& program = m_program[_clearQuad.m_program[numMrt-1].idx]; - device->SetVertexShader(program.m_vsh->m_vertexShader); - device->SetPixelShader(program.m_fsh->m_pixelShader); - - float mrtClearDepth[4] = { _clear.m_depth }; - DX_CHECK(device->SetVertexShaderConstantF(0, mrtClearDepth, 1)); - - float mrtClearColor[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4]; - - if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags) - { - for (uint32_t ii = 0; ii < numMrt; ++ii) - { - uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE - 1, _clear.m_index[ii]); - bx::memCopy(mrtClearColor[ii], _palette[index], 16); - } - } - else - { - float rgba[4] = - { - _clear.m_index[0] * 1.0f / 255.0f, - _clear.m_index[1] * 1.0f / 255.0f, - _clear.m_index[2] * 1.0f / 255.0f, - _clear.m_index[3] * 1.0f / 255.0f, - }; - - for (uint32_t ii = 0; ii < numMrt; ++ii) - { - bx::memCopy(mrtClearColor[ii], rgba, 16); - } - } - - DX_CHECK(device->SetPixelShaderConstantF(0, mrtClearColor[0], numMrt)); - - DX_CHECK(device->SetStreamSource(0, vb.m_ptr, 0, stride) ); - DX_CHECK(device->SetStreamSourceFreq(0, 1) ); - DX_CHECK(device->SetStreamSource(1, NULL, 0, 0) ); - setInputLayout(layout, 0); - DX_CHECK(device->SetIndices(NULL) ); - DX_CHECK(device->DrawPrimitive(D3DPT_TRIANGLESTRIP - , 0 - , 2 - ) ); - } - } - - void setInputLayout(uint8_t _numStreams, const VertexLayout** _layouts, uint16_t _numInstanceData) - { - bx::HashMurmur2A murmur; - murmur.begin(); - murmur.add(_numInstanceData); - for (uint8_t stream = 0; stream < _numStreams; ++stream) - { - murmur.add(_layouts[stream]->m_hash); - } - uint64_t layoutHash = murmur.end(); - - IDirect3DVertexDeclaration9* layout = m_inputLayoutCache.find(layoutHash); - if (NULL == layout) - { - D3DVERTEXELEMENT9 vertexElements[Attrib::Count+1+BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT]; - D3DVERTEXELEMENT9* elem = vertexElements; - - for (uint8_t stream = 0; stream < _numStreams; ++stream) - { - elem = fillVertexLayout(stream, elem, *_layouts[stream]); - } - - const D3DVERTEXELEMENT9 inst = { _numStreams, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }; - - for (uint8_t ii = 0; ii < _numInstanceData; ++ii) - { - bx::memCopy(elem, &inst, sizeof(D3DVERTEXELEMENT9) ); - elem->UsageIndex = uint8_t(7-ii); // TEXCOORD7 = i_data0, TEXCOORD6 = i_data1, etc. - elem->Offset = ii*16; - ++elem; - } - - bx::memCopy(elem, &s_attrib[Attrib::Count], sizeof(D3DVERTEXELEMENT9) ); - - DX_CHECK(m_device->CreateVertexDeclaration(vertexElements, &layout) ); - - m_inputLayoutCache.add(layoutHash, layout); - } - - DX_CHECK(m_device->SetVertexDeclaration(layout) ); - } - - void setInputLayout(const VertexLayout& _layout, uint16_t _numInstanceData) - { - const VertexLayout* layouts[1] = { &_layout }; - setInputLayout(BX_COUNTOF(layouts), layouts, _numInstanceData); - } - - D3DCAPS9 m_caps; - - IDirect3D9Ex* m_d3d9ex; - IDirect3DDevice9Ex* m_deviceEx; - - IDirect3D9* m_d3d9; - IDirect3DDevice9* m_device; - IDirect3DQuery9* m_flushQuery; - TimerQueryD3D9 m_gpuTimer; - OcclusionQueryD3D9 m_occlusionQuery; - D3DPOOL m_pool; - - IDirect3DSwapChain9* m_swapChain; - - bool m_needPresent; - uint16_t m_numWindows; - FrameBufferHandle m_windows[BGFX_CONFIG_MAX_FRAME_BUFFERS]; - - IDirect3DSurface9* m_backBufferColor; - IDirect3DSurface9* m_backBufferDepthStencil; - - IDirect3DTexture9* m_captureTexture; - IDirect3DSurface9* m_captureSurface; - IDirect3DSurface9* m_captureResolve; - - IDirect3DVertexDeclaration9* m_instanceDataDecls[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT]; - - void* m_d3d9Dll; - NvApi m_nvapi; - uint32_t m_adapter; - D3DDEVTYPE m_deviceType; - D3DPRESENT_PARAMETERS m_params; - uint32_t m_maxAnisotropy; - D3DADAPTER_IDENTIFIER9 m_identifier; - Resolution m_resolution; - - bool m_initialized; - bool m_amd; - bool m_nvidia; - bool m_atocSupport; - bool m_instancingSupport; - bool m_occlusionQuerySupport; - bool m_timerQuerySupport; - - D3DFORMAT m_fmtDepth; - - IndexBufferD3D9 m_indexBuffers[BGFX_CONFIG_MAX_INDEX_BUFFERS]; - VertexBufferD3D9 m_vertexBuffers[BGFX_CONFIG_MAX_VERTEX_BUFFERS]; - ShaderD3D9 m_shaders[BGFX_CONFIG_MAX_SHADERS]; - ProgramD3D9 m_program[BGFX_CONFIG_MAX_PROGRAMS]; - TextureD3D9 m_textures[BGFX_CONFIG_MAX_TEXTURES]; - VertexLayout m_vertexLayouts[BGFX_CONFIG_MAX_VERTEX_LAYOUTS]; - FrameBufferD3D9 m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS]; - UniformRegistry m_uniformReg; - void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS]; - - uint64_t m_samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; - - TextureD3D9* m_updateTexture; - uint8_t* m_updateTextureBits; - uint32_t m_updateTexturePitch; - uint8_t m_updateTextureSide; - uint8_t m_updateTextureMip; - - StateCacheT m_inputLayoutCache; - - TextVideoMem m_textVideoMem; - - FrameBufferHandle m_fbh; - bool m_rtMsaa; - }; - - static RendererContextD3D9* s_renderD3D9; - - RendererContextI* rendererCreate(const Init& _init) - { - s_renderD3D9 = BX_NEW(g_allocator, RendererContextD3D9); - if (!s_renderD3D9->init(_init) ) - { - bx::deleteObject(g_allocator, s_renderD3D9); - s_renderD3D9 = NULL; - } - return s_renderD3D9; - } - - void rendererDestroy() - { - s_renderD3D9->shutdown(); - bx::deleteObject(g_allocator, s_renderD3D9); - s_renderD3D9 = NULL; - } - - void IndexBufferD3D9::create(uint32_t _size, void* _data, uint16_t _flags) - { - m_size = _size; - m_flags = _flags; - - uint32_t usage = D3DUSAGE_WRITEONLY; - D3DPOOL pool = s_renderD3D9->m_pool; - - if (NULL == _data) - { - usage |= D3DUSAGE_DYNAMIC; - pool = D3DPOOL_DEFAULT; - m_dynamic = (uint8_t*)bx::alloc(g_allocator, _size); - } - - const D3DFORMAT format = 0 == (_flags & BGFX_BUFFER_INDEX32) - ? D3DFMT_INDEX16 - : D3DFMT_INDEX32 - ; - - DX_CHECK(s_renderD3D9->m_device->CreateIndexBuffer(m_size - , usage - , format - , pool - , &m_ptr - , NULL - ) ); - - if (NULL != _data) - { - update(0, _size, _data); - } - } - - void IndexBufferD3D9::preReset() - { - if (NULL != m_dynamic) - { - DX_RELEASE(m_ptr, 0); - } - } - - void IndexBufferD3D9::postReset() - { - if (NULL != m_dynamic) - { - const D3DFORMAT format = 0 == (m_flags & BGFX_BUFFER_INDEX32) - ? D3DFMT_INDEX16 - : D3DFMT_INDEX32 - ; - - DX_CHECK(s_renderD3D9->m_device->CreateIndexBuffer(m_size - , D3DUSAGE_WRITEONLY|D3DUSAGE_DYNAMIC - , format - , D3DPOOL_DEFAULT - , &m_ptr - , NULL - ) ); - - update(0, m_size, m_dynamic); - } - } - - void VertexBufferD3D9::create(uint32_t _size, void* _data, VertexLayoutHandle _layoutHandle) - { - m_size = _size; - m_layoutHandle = _layoutHandle; - - uint32_t usage = D3DUSAGE_WRITEONLY; - D3DPOOL pool = s_renderD3D9->m_pool; - - if (NULL == _data) - { - usage |= D3DUSAGE_DYNAMIC; - pool = D3DPOOL_DEFAULT; - m_dynamic = (uint8_t*)bx::alloc(g_allocator, _size); - } - - DX_CHECK(s_renderD3D9->m_device->CreateVertexBuffer(m_size - , usage - , 0 - , pool - , &m_ptr - , NULL - ) ); - - if (NULL != _data) - { - update(0, _size, _data); - } - } - - void VertexBufferD3D9::preReset() - { - if (NULL != m_dynamic) - { - DX_RELEASE(m_ptr, 0); - } - } - - void VertexBufferD3D9::postReset() - { - if (NULL != m_dynamic) - { - DX_CHECK(s_renderD3D9->m_device->CreateVertexBuffer(m_size - , D3DUSAGE_WRITEONLY|D3DUSAGE_DYNAMIC - , 0 - , D3DPOOL_DEFAULT - , &m_ptr - , NULL - ) ); - - update(0, m_size, m_dynamic); - } - } - - void ShaderD3D9::create(const Memory* _mem) - { - bx::MemoryReader reader(_mem->data, _mem->size); - - bx::ErrorAssert err; - - uint32_t magic; - bx::read(&reader, magic, &err); - - const bool fragment = isShaderType(magic, 'F'); - - uint32_t hashIn; - bx::read(&reader, hashIn, &err); - - uint32_t hashOut; - - if (isShaderVerLess(magic, 6) ) - { - hashOut = hashIn; - } - else - { - bx::read(&reader, hashOut, &err); - } - - uint16_t count; - bx::read(&reader, count, &err); - - m_numPredefined = 0; - - BX_TRACE("Shader consts %d", count); - - uint8_t fragmentBit = fragment ? kUniformFragmentBit : 0; - - if (0 < count) - { - for (uint32_t ii = 0; ii < count; ++ii) - { - uint8_t nameSize = 0; - bx::read(&reader, nameSize, &err); - - char name[256] = {}; - bx::read(&reader, &name, nameSize, &err); - name[nameSize] = '\0'; - - uint8_t type = 0; - bx::read(&reader, type, &err); - - uint8_t num = 0; - bx::read(&reader, num, &err); - - uint16_t regIndex = 0; - bx::read(&reader, regIndex, &err); - - uint16_t regCount = 0; - bx::read(&reader, regCount, &err); - - if (!isShaderVerLess(magic, 8) ) - { - uint16_t texInfo = 0; - bx::read(&reader, texInfo, &err); - } - - if (!isShaderVerLess(magic, 10) ) - { - uint16_t texFormat = 0; - bx::read(&reader, texFormat, &err); - } - - const char* kind = "invalid"; - - PredefinedUniform::Enum predefined = nameToPredefinedUniformEnum(name); - if (PredefinedUniform::Count != predefined) - { - kind = "predefined"; - m_predefined[m_numPredefined].m_loc = regIndex; - m_predefined[m_numPredefined].m_count = regCount; - m_predefined[m_numPredefined].m_type = uint8_t(predefined|fragmentBit); - m_numPredefined++; - } - else if (0 == (kUniformSamplerBit & type) ) - { - const UniformRegInfo* info = s_renderD3D9->m_uniformReg.find(name); - BX_WARN(NULL != info, "User defined uniform '%s' is not found, it won't be set.", name); - - if (NULL != info) - { - if (NULL == m_constantBuffer) - { - m_constantBuffer = UniformBuffer::create(1024); - } - - kind = "user"; - m_constantBuffer->writeUniformHandle( (UniformType::Enum)(type|fragmentBit), regIndex, info->m_handle, regCount); - } - } - else - { - kind = "sampler"; - } - - BX_TRACE("\t%s: %s (%s), num %2d, r.index %3d, r.count %2d" - , kind - , name - , getUniformTypeName(UniformType::Enum(type&~kUniformMask) ) - , num - , regIndex - , regCount - ); - BX_UNUSED(kind); - } - - if (NULL != m_constantBuffer) - { - m_constantBuffer->finish(); - } - } - - uint32_t shaderSize; - bx::read(&reader, shaderSize, &err); - - const DWORD* code = (const DWORD*)reader.getDataPtr(); - - if (fragment) - { - m_type = 1; - DX_CHECK(s_renderD3D9->m_device->CreatePixelShader(code, &m_pixelShader) ); - BGFX_FATAL(NULL != m_pixelShader, bgfx::Fatal::InvalidShader, "Failed to create fragment shader."); - } - else - { - m_type = 0; - DX_CHECK(s_renderD3D9->m_device->CreateVertexShader(code, &m_vertexShader) ); - BGFX_FATAL(NULL != m_vertexShader, bgfx::Fatal::InvalidShader, "Failed to create vertex shader."); - } - } - - void TextureD3D9::createTexture(uint32_t _width, uint32_t _height, uint8_t _numMips) - { - m_type = Texture2D; - const bimg::TextureFormat::Enum fmt = (bimg::TextureFormat::Enum)m_textureFormat; - - DWORD usage = 0; - D3DPOOL pool = D3DPOOL_DEFAULT; - - const bool renderTarget = 0 != (m_flags&BGFX_TEXTURE_RT_MASK); - const bool blit = 0 != (m_flags&BGFX_TEXTURE_BLIT_DST); - const bool readBack = 0 != (m_flags&BGFX_TEXTURE_READ_BACK); - if (bimg::isDepth(fmt) ) - { - usage = D3DUSAGE_DEPTHSTENCIL; - } - else if (readBack) - { - usage = 0; - pool = D3DPOOL_SYSTEMMEM; - } - else if (renderTarget || blit) - { - usage = 0 - | D3DUSAGE_RENDERTARGET - | (1 < _numMips ? D3DUSAGE_AUTOGENMIPMAP : 0) - ; - } - - IDirect3DDevice9* device = s_renderD3D9->m_device; - - if (renderTarget) - { - uint32_t msaaQuality = ( (m_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT); - msaaQuality = bx::uint32_satsub(msaaQuality, 1); - - bool writeOnly = 0 != (m_flags&BGFX_TEXTURE_RT_WRITE_ONLY); - - if (0 != msaaQuality - || writeOnly) - { - const Msaa& msaa = s_msaa[msaaQuality]; - - if (bimg::isDepth(fmt) ) - { - DX_CHECK(device->CreateDepthStencilSurface( - m_width - , m_height - , s_textureFormat[m_textureFormat].m_fmt - , msaa.m_type - , msaa.m_quality - , FALSE - , &m_surface - , NULL - ) ); - } - else - { - DX_CHECK(device->CreateRenderTarget( - m_width - , m_height - , s_textureFormat[m_textureFormat].m_fmt - , msaa.m_type - , msaa.m_quality - , FALSE - , &m_surface - , NULL - ) ); - } - - if (writeOnly) - { - // This is render buffer, there is no sampling, no need - // to create texture. - return; - } - } - } - - DX_CHECK(device->CreateTexture(_width - , _height - , _numMips - , usage - , s_textureFormat[fmt].m_fmt - , pool - , &m_texture2d - , NULL - ) ); - - if (!renderTarget - && !readBack) - { - if (NULL == m_staging) - { - DX_CHECK(device->CreateTexture(_width - , _height - , _numMips - , 0 - , s_textureFormat[fmt].m_fmt - , D3DPOOL_SYSTEMMEM - , &m_staging2d - , NULL - ) ); - } - else - { - DX_CHECK(m_staging2d->AddDirtyRect(NULL)); - DX_CHECK(device->UpdateTexture(m_staging2d, m_texture2d)); - } - } - - BGFX_FATAL(NULL != m_texture2d, Fatal::UnableToCreateTexture, "Failed to create texture (size: %dx%d, mips: %d, fmt: %d)." - , _width - , _height - , _numMips - , bimg::getName(fmt) - ); - } - - void TextureD3D9::createVolumeTexture(uint32_t _width, uint32_t _height, uint32_t _depth, uint8_t _numMips) - { - m_type = Texture3D; - const TextureFormat::Enum fmt = (TextureFormat::Enum)m_textureFormat; - - IDirect3DDevice9* device = s_renderD3D9->m_device; - DX_CHECK(device->CreateVolumeTexture(_width - , _height - , _depth - , _numMips - , 0 - , s_textureFormat[fmt].m_fmt - , D3DPOOL_DEFAULT - , &m_texture3d - , NULL - ) ); - - if (NULL == m_staging) - { - DX_CHECK(device->CreateVolumeTexture(_width - , _height - , _depth - , _numMips - , 0 - , s_textureFormat[fmt].m_fmt - , D3DPOOL_SYSTEMMEM - , &m_staging3d - , NULL - ) ); - } - else - { - DX_CHECK(m_staging3d->AddDirtyBox(NULL) ); - DX_CHECK(device->UpdateTexture(m_staging3d, m_texture3d) ); - } - - BGFX_FATAL(NULL != m_texture3d, Fatal::UnableToCreateTexture, "Failed to create volume texture (size: %dx%dx%d, mips: %d, fmt: %s)." - , _width - , _height - , _depth - , _numMips - , getName(fmt) - ); - } - - void TextureD3D9::createCubeTexture(uint32_t _width, uint8_t _numMips) - { - m_type = TextureCube; - const bimg::TextureFormat::Enum fmt = (bimg::TextureFormat::Enum)m_textureFormat; - - DWORD usage = 0; - - const bool renderTarget = 0 != (m_flags&BGFX_TEXTURE_RT_MASK); - const bool blit = 0 != (m_flags&BGFX_TEXTURE_BLIT_DST); - if (bimg::isDepth(fmt) ) - { - usage = D3DUSAGE_DEPTHSTENCIL; - } - else if (renderTarget || blit) - { - usage = D3DUSAGE_RENDERTARGET; - } - - IDirect3DDevice9* device = s_renderD3D9->m_device; - DX_CHECK(device->CreateCubeTexture(_width - , _numMips - , usage - , s_textureFormat[fmt].m_fmt - , D3DPOOL_DEFAULT - , &m_textureCube - , NULL - ) ); - - if (!renderTarget) - { - if (NULL == m_staging) - { - DX_CHECK(device->CreateCubeTexture(_width - , _numMips - , 0 - , s_textureFormat[fmt].m_fmt - , D3DPOOL_SYSTEMMEM - , &m_stagingCube - , NULL - ) ); - } - else - { - for (uint8_t ii = 0; ii < 6; ++ii) - { - DX_CHECK(m_stagingCube->AddDirtyRect(D3DCUBEMAP_FACES(ii), NULL) ); - } - DX_CHECK(device->UpdateTexture(m_stagingCube, m_textureCube) ); - } - } - - BGFX_FATAL(NULL != m_textureCube, Fatal::UnableToCreateTexture, "Failed to create cube texture (edge: %d, mips: %d, fmt: %s)." - , _width - , _numMips - , getName(fmt) - ); - } - - uint8_t* TextureD3D9::lock(uint8_t _side, uint8_t _lod, uint32_t& _pitch, uint32_t& _slicePitch, const Rect* _rect) - { - switch (m_type) - { - case Texture2D: - { - D3DLOCKED_RECT lockedRect; - - if (NULL != _rect) - { - RECT rect; - rect.left = _rect->m_x; - rect.top = _rect->m_y; - rect.right = rect.left + _rect->m_width; - rect.bottom = rect.top + _rect->m_height; - DX_CHECK(m_staging2d->LockRect(_lod, &lockedRect, &rect, 0) ); - DX_CHECK(m_staging2d->AddDirtyRect(&rect) ); - } - else - { - DX_CHECK(m_staging2d->LockRect(_lod, &lockedRect, NULL, 0) ); - DX_CHECK(m_staging2d->AddDirtyRect(NULL) ); - } - - _pitch = lockedRect.Pitch; - _slicePitch = 0; - return (uint8_t*)lockedRect.pBits; - } - - case Texture3D: - { - D3DLOCKED_BOX box; - DX_CHECK(m_staging3d->LockBox(_lod, &box, NULL, 0) ); - DX_CHECK(m_staging3d->AddDirtyBox(NULL) ); - _pitch = box.RowPitch; - _slicePitch = box.SlicePitch; - return (uint8_t*)box.pBits; - } - - case TextureCube: - { - D3DLOCKED_RECT lockedRect; - - if (NULL != _rect) - { - RECT rect; - rect.left = _rect->m_x; - rect.top = _rect->m_y; - rect.right = rect.left + _rect->m_width; - rect.bottom = rect.top + _rect->m_height; - DX_CHECK(m_stagingCube->LockRect(D3DCUBEMAP_FACES(_side), _lod, &lockedRect, &rect, 0) ); - DX_CHECK(m_textureCube->AddDirtyRect(D3DCUBEMAP_FACES(_side), &rect) ); - } - else - { - DX_CHECK(m_stagingCube->LockRect(D3DCUBEMAP_FACES(_side), _lod, &lockedRect, NULL, 0) ); - DX_CHECK(m_textureCube->AddDirtyRect(D3DCUBEMAP_FACES(_side), NULL) ); - } - - _pitch = lockedRect.Pitch; - _slicePitch = 0; - return (uint8_t*)lockedRect.pBits; - } - } - - BX_ASSERT(false, "You should not be here."); - _pitch = 0; - _slicePitch = 0; - return NULL; - } - - void TextureD3D9::unlock(uint8_t _side, uint8_t _lod) - { - IDirect3DDevice9* device = s_renderD3D9->m_device; - - switch (m_type) - { - case Texture2D: - { - DX_CHECK(m_staging2d->UnlockRect(_lod) ); - DX_CHECK(device->UpdateTexture(m_staging2d, m_texture2d) ); - } - return; - - case Texture3D: - { - DX_CHECK(m_staging3d->UnlockBox(_lod) ); - DX_CHECK(device->UpdateTexture(m_staging3d, m_texture3d) ); - } - return; - - case TextureCube: - { - DX_CHECK(m_stagingCube->UnlockRect(D3DCUBEMAP_FACES(_side), _lod) ); - DX_CHECK(device->UpdateTexture(m_stagingCube, m_textureCube) ); - } - return; - } - - BX_ASSERT(false, "You should not be here."); - } - - void TextureD3D9::dirty(uint8_t _side, const Rect& _rect, uint16_t _z, uint16_t _depth) - { - switch (m_type) - { - case Texture2D: - { - RECT rect; - rect.left = _rect.m_x; - rect.top = _rect.m_y; - rect.right = rect.left + _rect.m_width; - rect.bottom = rect.top + _rect.m_height; - DX_CHECK(m_texture2d->AddDirtyRect(&rect) ); - } - return; - - case Texture3D: - { - D3DBOX box; - box.Left = _rect.m_x; - box.Top = _rect.m_y; - box.Right = box.Left + _rect.m_width; - box.Bottom = box.Top + _rect.m_height; - box.Front = _z; - box.Back = box.Front + _depth; - DX_CHECK(m_texture3d->AddDirtyBox(&box) ); - } - return; - - case TextureCube: - { - RECT rect; - rect.left = _rect.m_x; - rect.top = _rect.m_y; - rect.right = rect.left + _rect.m_width; - rect.bottom = rect.top + _rect.m_height; - DX_CHECK(m_textureCube->AddDirtyRect(D3DCUBEMAP_FACES(_side), &rect) ); - } - return; - } - - BX_ASSERT(false, "You should not be here."); - } - - IDirect3DSurface9* TextureD3D9::getSurface(uint8_t _side, uint8_t _mip) const - { - IDirect3DSurface9* surface = NULL; - - switch (m_type) - { - case Texture2D: - DX_CHECK(m_texture2d->GetSurfaceLevel(_mip, &surface) ); - break; - - case Texture3D: - BX_ASSERT(false, ""); - break; - - case TextureCube: - DX_CHECK(m_textureCube->GetCubeMapSurface(D3DCUBEMAP_FACES(_side), _mip, &surface) ); - break; - } - - return surface; - } - - void TextureD3D9::create(const Memory* _mem, uint64_t _flags, uint8_t _skip) - { - bimg::ImageContainer imageContainer; - - if (bimg::imageParse(imageContainer, _mem->data, _mem->size) ) - { - const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(imageContainer.m_format) ); - - const uint8_t startLod = bx::min(_skip, imageContainer.m_numMips-1); - - bimg::TextureInfo ti; - bimg::imageGetSize( - &ti - , uint16_t(imageContainer.m_width >>startLod) - , uint16_t(imageContainer.m_height>>startLod) - , uint16_t(imageContainer.m_depth >>startLod) - , imageContainer.m_cubeMap - , 1 < imageContainer.m_numMips - , imageContainer.m_numLayers - , imageContainer.m_format - ); - ti.numMips = bx::min(imageContainer.m_numMips-startLod, ti.numMips); - - m_flags = _flags; - m_width = ti.width; - m_height = ti.height; - m_depth = ti.depth; - m_numMips = ti.numMips; - m_requestedFormat = uint8_t(imageContainer.m_format); - m_textureFormat = uint8_t(getViableTextureFormat(imageContainer) ); - const bool convert = m_textureFormat != m_requestedFormat; - - uint8_t bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(m_textureFormat) ); - - if (imageContainer.m_cubeMap) - { - createCubeTexture(ti.width, ti.numMips); - } - else if (imageContainer.m_depth > 1) - { - createVolumeTexture(ti.width, ti.height, ti.depth, ti.numMips); - } - else - { - createTexture(ti.width, ti.height, ti.numMips); - } - - BX_TRACE("Texture %3d: %s (requested: %s), %dx%d%s%s." - , this - s_renderD3D9->m_textures - , getName( (TextureFormat::Enum)m_textureFormat) - , getName( (TextureFormat::Enum)m_requestedFormat) - , ti.width - , ti.height - , imageContainer.m_cubeMap ? "x6" : "" - , 0 != (m_flags&BGFX_TEXTURE_RT_MASK) ? " (render target)" : "" - ); - - if (0 != (_flags&BGFX_TEXTURE_RT_WRITE_ONLY) ) - { - return; - } - - const bool useMipSize = useD3D9Pitch(imageContainer.m_format); - for (uint8_t side = 0, numSides = imageContainer.m_cubeMap ? 6 : 1; side < numSides; ++side) - { - uint32_t width = ti.width; - uint32_t height = ti.height; - uint32_t depth = ti.depth; - uint32_t mipWidth = ti.width; - uint32_t mipHeight = ti.height; - - for (uint8_t lod = 0, num = ti.numMips; lod < num; ++lod) - { - width = bx::max(1, width); - height = bx::max(1, height); - depth = bx::max(1, depth); - mipWidth = bx::max(blockInfo.blockWidth, mipWidth); - mipHeight = bx::max(blockInfo.blockHeight, mipHeight); - uint32_t mipSize = width*height*depth*bpp/8; - - bimg::ImageMip mip; - if (bimg::imageGetRawData(imageContainer, side, lod+startLod, _mem->data, _mem->size, mip) ) - { - uint32_t pitch; - uint32_t slicePitch; - uint8_t* bits = lock(side, lod, pitch, slicePitch); - - if (convert) - { - if (width != mipWidth - || height != mipHeight) - { - uint32_t srcpitch = mipWidth*bpp/8; - - uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, srcpitch*mipHeight); - bimg::imageDecodeToBgra8( - g_allocator - , temp - , mip.m_data - , mip.m_width - , mip.m_height - , srcpitch - , mip.m_format - ); - - bx::memCopy(bits, pitch, temp, srcpitch, pitch, height); - - bx::free(g_allocator, temp); - } - else - { - bimg::imageDecodeToBgra8(g_allocator, bits, mip.m_data, mip.m_width, mip.m_height, pitch, mip.m_format); - } - } - else - { - uint32_t size = useMipSize ? mip.m_size : mipSize; - switch (m_textureFormat) - { - case TextureFormat::R5G6B5: - bimg::imageConvert(bits, 16, bx::packB5G6R5, mip.m_data, bx::unpackR5G6B5, size); - break; - - case TextureFormat::RGBA4: - bimg::imageConvert(bits, 16, bx::packBgra4, mip.m_data, bx::unpackRgba4, size); - break; - - case TextureFormat::RGB5A1: - bimg::imageConvert(bits, 16, bx::packBgr5a1, mip.m_data, bx::unpackRgb5a1, size); - break; - - default: - bx::memCopy(bits, mip.m_data, size); - break; - } - } - - unlock(side, lod); - } - - width >>= 1; - height >>= 1; - depth >>= 1; - mipWidth >>= 1; - mipHeight >>= 1; - } - } - } - } - - void TextureD3D9::updateBegin(uint8_t _side, uint8_t _mip) - { - uint32_t slicePitch; - s_renderD3D9->m_updateTextureSide = _side; - s_renderD3D9->m_updateTextureMip = _mip; - s_renderD3D9->m_updateTextureBits = lock(_side, _mip, s_renderD3D9->m_updateTexturePitch, slicePitch); - } - - void TextureD3D9::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem) - { - const bimg::ImageBlockInfo & blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat) ); - const uint16_t blockHeight = blockInfo.blockHeight; - const uint16_t bpp = blockInfo.bitsPerPixel; - const bool useLockedPitch = useD3D9Pitch(bimg::TextureFormat::Enum(m_textureFormat) ); - const uint32_t rectpitch = calcRowPitch(blockInfo, 0, _rect.m_width); - const uint32_t srcpitch = UINT16_MAX == _pitch ? rectpitch : _pitch; - const uint32_t dstpitch = (useLockedPitch) ? s_renderD3D9->m_updateTexturePitch : calcRowPitch(blockInfo, _mip, m_width); - uint8_t* bits = s_renderD3D9->m_updateTextureBits + _rect.m_y*dstpitch/blockHeight + _rect.m_x*blockHeight*bpp/8; - - const bool convert = m_textureFormat != m_requestedFormat; - - uint8_t* data = _mem->data; - uint8_t* temp = NULL; - - if (convert) - { - temp = (uint8_t*)bx::alloc(g_allocator, rectpitch*_rect.m_height); - bimg::imageDecodeToBgra8(g_allocator, temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) ); - data = temp; - } - - { - uint8_t* src = data; - uint8_t* dst = bits; - for (uint32_t yy = 0, height = _rect.m_height; yy < height; yy += blockHeight) - { - switch (m_textureFormat) - { - case TextureFormat::R5G6B5: - bimg::imageConvert(dst, 16, bx::packB5G6R5, src, bx::unpackR5G6B5, rectpitch); - break; - - case TextureFormat::RGBA4: - bimg::imageConvert(dst, 16, bx::packBgra4, src, bx::unpackRgba4, rectpitch); - break; - - case TextureFormat::RGB5A1: - bimg::imageConvert(dst, 16, bx::packBgr5a1, src, bx::unpackRgb5a1, rectpitch); - break; - - default: - bx::memCopy(dst, src, rectpitch); - break; - } - src += srcpitch; - dst += dstpitch; - } - } - - if (NULL != temp) - { - bx::free(g_allocator, temp); - } - - if (0 == _mip) - { - dirty(_side, _rect, _z, _depth); - } - } - - void TextureD3D9::updateEnd() - { - unlock(s_renderD3D9->m_updateTextureSide, s_renderD3D9->m_updateTextureMip); - } - - void TextureD3D9::commit(uint8_t _stage, uint32_t _flags, const float _palette[][4]) - { - const uint64_t flags = (m_flags & BGFX_TEXTURE_SRGB) - | (0 == (BGFX_SAMPLER_INTERNAL_DEFAULT & _flags) ? _flags : uint32_t(m_flags) ) - ; - uint32_t index = (flags & BGFX_SAMPLER_BORDER_COLOR_MASK) >> BGFX_SAMPLER_BORDER_COLOR_SHIFT; - s_renderD3D9->setSamplerState(_stage, flags, _palette[index]); - - IDirect3DDevice9* device = s_renderD3D9->m_device; - DX_CHECK(device->SetTexture(_stage, m_ptr) ); - if (4 > _stage) - { - DX_CHECK(device->SetTexture(D3DVERTEXTEXTURESAMPLER0 + _stage, m_ptr) ); - } - } - - void TextureD3D9::resolve(uint8_t _resolve) const - { - if (NULL != m_surface - && NULL != m_ptr) - { - IDirect3DSurface9* surface = getSurface(); - DX_CHECK(s_renderD3D9->m_device->StretchRect(m_surface - , NULL - , surface - , NULL - , D3DTEXF_LINEAR - ) ); - DX_RELEASE(surface, 1); - - if (1 < m_numMips - && 0 != (_resolve & BGFX_RESOLVE_AUTO_GEN_MIPS) ) - { - m_ptr->GenerateMipSubLevels(); - } - } - } - - void TextureD3D9::preReset() - { - TextureFormat::Enum fmt = (TextureFormat::Enum)m_textureFormat; - if (TextureFormat::Unknown != fmt) - { - DX_RELEASE(m_ptr, 0); - DX_RELEASE(m_surface, 0); - } - } - - void TextureD3D9::postReset() - { - TextureFormat::Enum fmt = (TextureFormat::Enum)m_textureFormat; - if (TextureFormat::Unknown != fmt) - { - switch (m_type) - { - default: - case Texture2D: - createTexture(m_width, m_height, m_numMips); - break; - - case Texture3D: - createVolumeTexture(m_width, m_height, m_depth, m_numMips); - break; - - case TextureCube: - createCubeTexture(m_width, m_numMips); - break; - } - } - } - - void FrameBufferD3D9::create(uint8_t _num, const Attachment* _attachment) - { - for (uint32_t ii = 0; ii < BX_COUNTOF(m_surface); ++ii) - { - m_surface[ii] = NULL; - } - - m_denseIdx = UINT16_MAX; - m_dsIdx = UINT8_MAX; - m_num = 0; - m_numTh = _num; - m_needResolve = false; - bx::memCopy(m_attachment, _attachment, _num*sizeof(Attachment) ); - - for (uint32_t ii = 0; ii < _num; ++ii) - { - const Attachment& at = m_attachment[ii]; - - if (isValid(at.handle) ) - { - const TextureD3D9& texture = s_renderD3D9->m_textures[at.handle.idx]; - - if (NULL != texture.m_surface) - { - m_surface[ii] = texture.m_surface; - m_surface[ii]->AddRef(); - } - else - { - m_surface[ii] = texture.getSurface(uint8_t(at.layer), uint8_t(at.mip) ); - } - - if (0 == m_num) - { - m_width = texture.m_width; - m_height = texture.m_height; - } - - if (bimg::isDepth(bimg::TextureFormat::Enum(texture.m_textureFormat) ) ) - { - m_dsIdx = uint8_t(ii); - } - else - { - ++m_num; - } - - m_needResolve |= true - && (NULL != texture.m_surface) - && (NULL != texture.m_texture2d) - ; - } - } - - if (0 == m_num) - { - createNullColorRT(); - } - } - - void FrameBufferD3D9::create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _format, TextureFormat::Enum _depthFormat) - { - BX_UNUSED(_depthFormat); - - m_hwnd = (HWND)_nwh; - - m_width = bx::uint32_max(_width, 16); - m_height = bx::uint32_max(_height, 16); - - D3DPRESENT_PARAMETERS params; - bx::memCopy(¶ms, &s_renderD3D9->m_params, sizeof(D3DPRESENT_PARAMETERS) ); - params.BackBufferFormat = TextureFormat::Count == _format ? params.BackBufferFormat : s_textureFormat[_format].m_fmt; - params.BackBufferWidth = m_width; - params.BackBufferHeight = m_height; - params.MultiSampleType = s_msaa[0].m_type; - params.MultiSampleQuality = s_msaa[0].m_quality; - - DX_CHECK(s_renderD3D9->m_device->CreateAdditionalSwapChain(¶ms, &m_swapChain) ); - DX_CHECK(m_swapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &m_surface[0]) ); - - DX_CHECK(s_renderD3D9->m_device->CreateDepthStencilSurface( - params.BackBufferWidth - , params.BackBufferHeight - , params.AutoDepthStencilFormat - , params.MultiSampleType - , params.MultiSampleQuality - , FALSE - , &m_surface[1] - , NULL - ) ); - - m_dsIdx = 1; - m_denseIdx = _denseIdx; - m_num = 1; - m_needResolve = false; - m_needPresent = false; - } - - uint16_t FrameBufferD3D9::destroy() - { - if (NULL != m_hwnd) - { - DX_RELEASE(m_surface[0], 0); - DX_RELEASE(m_surface[1], 0); - DX_RELEASE(m_swapChain, 0); - } - else - { - uint32_t num = m_numTh; - num += uint32_t(0 < m_numTh && 0 == m_num); - - for (uint32_t ii = 0; ii < num; ++ii) - { - IDirect3DSurface9* ptr = m_surface[ii]; - if (NULL != ptr) - { - ptr->Release(); - m_surface[ii] = NULL; - } - } - } - - m_hwnd = NULL; - m_num = 0; - m_numTh = 0; - m_needPresent = false; - - uint16_t denseIdx = m_denseIdx; - m_denseIdx = UINT16_MAX; - - return denseIdx; - } - - HRESULT FrameBufferD3D9::present() - { - if (m_needPresent) - { - HRESULT hr = m_swapChain->Present(NULL, NULL, m_hwnd, NULL, 0); - m_needPresent = false; - return hr; - } - - return S_OK; - } - - void FrameBufferD3D9::resolve() const - { - if (m_needResolve) - { - for (uint32_t ii = 0, num = m_numTh; ii < num; ++ii) - { - const Attachment& at = m_attachment[ii]; - - if (isValid(at.handle) ) - { - const TextureD3D9& texture = s_renderD3D9->m_textures[at.handle.idx]; - texture.resolve(at.resolve); - } - } - } - } - - void FrameBufferD3D9::preReset() - { - if (NULL != m_hwnd) - { - DX_RELEASE(m_surface[0], 0); - DX_RELEASE(m_surface[1], 0); - DX_RELEASE(m_swapChain, 0); - } - else - { - uint32_t num = m_numTh; - num += uint32_t(0 < m_numTh && 0 == m_num); - - for (uint32_t ii = 0; ii < num; ++ii) - { - m_surface[ii]->Release(); - m_surface[ii] = NULL; - } - } - } - - void FrameBufferD3D9::postReset() - { - if (NULL != m_hwnd) - { - D3DPRESENT_PARAMETERS params; - bx::memCopy(¶ms, &s_renderD3D9->m_params, sizeof(D3DPRESENT_PARAMETERS) ); - params.BackBufferWidth = m_width; - params.BackBufferHeight = m_height; - - DX_CHECK(s_renderD3D9->m_device->CreateAdditionalSwapChain(¶ms, &m_swapChain) ); - DX_CHECK(m_swapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &m_surface[0]) ); - DX_CHECK(s_renderD3D9->m_device->CreateDepthStencilSurface(params.BackBufferWidth - , params.BackBufferHeight - , params.AutoDepthStencilFormat - , params.MultiSampleType - , params.MultiSampleQuality - , FALSE - , &m_surface[1] - , NULL - ) ); - } - else if (0 < m_numTh) - { - for (uint32_t ii = 0, num = m_numTh; ii < num; ++ii) - { - const Attachment& at = m_attachment[ii]; - - if (isValid(at.handle) ) - { - TextureD3D9& texture = s_renderD3D9->m_textures[at.handle.idx]; - - if (NULL != texture.m_surface) - { - m_surface[ii] = texture.m_surface; - m_surface[ii]->AddRef(); - } - else if (Access::Write == at.access) - { - m_surface[ii] = texture.getSurface(uint8_t(at.layer), uint8_t(at.mip) ); - } - else - { - BX_ASSERT(false, ""); - } - } - } - - if (0 == m_num) - { - createNullColorRT(); - } - } - } - - void FrameBufferD3D9::createNullColorRT() - { - DX_CHECK(s_renderD3D9->m_device->CreateRenderTarget( - m_width - , m_height - , D3DFMT_NULL - , D3DMULTISAMPLE_NONE - , 0 - , false - , &m_surface[1] - , NULL - ) ); - } - - void FrameBufferD3D9::set() - { - m_needPresent = UINT16_MAX != m_denseIdx; - - // If frame buffer has only depth attachment D3DFMT_NULL - // render target is created. - const uint32_t fbnum = bx::uint32_max(2, m_numTh); - const uint8_t dsIdx = m_dsIdx; - - IDirect3DDevice9* device = s_renderD3D9->m_device; - - DX_CHECK(device->SetDepthStencilSurface(UINT8_MAX == dsIdx - ? s_renderD3D9->m_backBufferDepthStencil - : m_surface[dsIdx] - ) ); - - uint32_t rtIdx = 0; - for (uint32_t ii = 0; ii < fbnum; ++ii) - { - IDirect3DSurface9* surface = m_surface[ii]; - if (ii != dsIdx) - { - DX_CHECK(device->SetRenderTarget(rtIdx, surface) ); - ++rtIdx; - } - } - - for (uint32_t ii = rtIdx, num = g_caps.limits.maxFBAttachments; ii < num; ++ii) - { - DX_CHECK(device->SetRenderTarget(ii, NULL) ); - } - - DX_CHECK(device->SetRenderState(D3DRS_SRGBWRITEENABLE, FALSE) ); - } - - void TimerQueryD3D9::postReset() - { - IDirect3DDevice9* device = s_renderD3D9->m_device; - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_query); ++ii) - { - Query& frame = m_query[ii]; - DX_CHECK(device->CreateQuery(D3DQUERYTYPE_TIMESTAMPDISJOINT, &frame.m_disjoint) ); - DX_CHECK(device->CreateQuery(D3DQUERYTYPE_TIMESTAMP, &frame.m_begin) ); - DX_CHECK(device->CreateQuery(D3DQUERYTYPE_TIMESTAMP, &frame.m_end) ); - DX_CHECK(device->CreateQuery(D3DQUERYTYPE_TIMESTAMPFREQ, &frame.m_freq) ); - } - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_result); ++ii) - { - Result& result = m_result[ii]; - result.reset(); - } - - m_control.reset(); - } - - void TimerQueryD3D9::preReset() - { - for (uint32_t ii = 0; ii < BX_COUNTOF(m_query); ++ii) - { - Query& frame = m_query[ii]; - DX_RELEASE(frame.m_disjoint, 0); - DX_RELEASE(frame.m_begin, 0); - DX_RELEASE(frame.m_end, 0); - DX_RELEASE(frame.m_freq, 0); - } - } - - uint32_t TimerQueryD3D9::begin(uint32_t _resultIdx, uint32_t _frameNum) - { - while (0 == m_control.reserve(1) ) - { - update(); - } - - Result& result = m_result[_resultIdx]; - ++result.m_pending; - - const uint32_t idx = m_control.m_current; - Query& query = m_query[idx]; - query.m_resultIdx = _resultIdx; - query.m_ready = false; - query.m_frameNum = _frameNum; - - query.m_disjoint->Issue(D3DISSUE_BEGIN); - query.m_begin->Issue(D3DISSUE_END); - - m_control.commit(1); - - return idx; - } - - void TimerQueryD3D9::end(uint32_t _idx) - { - Query& query = m_query[_idx]; - query.m_ready = true; - - query.m_disjoint->Issue(D3DISSUE_END); - query.m_freq->Issue(D3DISSUE_END); - query.m_end->Issue(D3DISSUE_END); - - while (update() ) - { - } - } - - bool TimerQueryD3D9::update() - { - if (0 != m_control.available() ) - { - Query& query = m_query[m_control.m_read]; - - if (!query.m_ready) - { - return false; - } - - uint64_t timeEnd; - const bool flush = BX_COUNTOF(m_query)-1 == m_control.available(); - HRESULT hr = query.m_end->GetData(&timeEnd, sizeof(timeEnd), flush ? D3DGETDATA_FLUSH : 0); - if (S_OK == hr - || isLost(hr) ) - { - m_control.consume(1); - - uint64_t timeBegin; - DX_CHECK(query.m_begin->GetData(&timeBegin, sizeof(timeBegin), 0) ); - - uint64_t freq; - DX_CHECK(query.m_freq->GetData(&freq, sizeof(freq), 0) ); - - Result& result = m_result[query.m_resultIdx]; - --result.m_pending; - result.m_frameNum = query.m_frameNum; - - result.m_frequency = freq; - result.m_begin = timeBegin; - result.m_end = timeEnd; - - return true; - } - } - - return false; - } - - void OcclusionQueryD3D9::postReset() - { - IDirect3DDevice9* device = s_renderD3D9->m_device; - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_query); ++ii) - { - Query& query = m_query[ii]; - DX_CHECK(device->CreateQuery(D3DQUERYTYPE_OCCLUSION, &query.m_ptr) ); - } - } - - void OcclusionQueryD3D9::preReset() - { - for (uint32_t ii = 0; ii < BX_COUNTOF(m_query); ++ii) - { - Query& query = m_query[ii]; - DX_RELEASE(query.m_ptr, 0); - } - } - - void OcclusionQueryD3D9::begin(Frame* _render, OcclusionQueryHandle _handle) - { - while (0 == m_control.reserve(1) ) - { - resolve(_render, true); - } - - Query& query = m_query[m_control.m_current]; - query.m_ptr->Issue(D3DISSUE_BEGIN); - query.m_handle = _handle; - } - - void OcclusionQueryD3D9::end() - { - Query& query = m_query[m_control.m_current]; - query.m_ptr->Issue(D3DISSUE_END); - m_control.commit(1); - } - - void OcclusionQueryD3D9::resolve(Frame* _render, bool) - { - while (0 != m_control.available() ) - { - Query& query = m_query[m_control.m_read]; - - if (isValid(query.m_handle) ) - { - uint32_t result; - HRESULT hr = query.m_ptr->GetData(&result, sizeof(result), 0); - if (S_FALSE == hr) - { - break; - } - - _render->m_occlusion[query.m_handle.idx] = int32_t(result); - } - - m_control.consume(1); - } - } - - void OcclusionQueryD3D9::invalidate(OcclusionQueryHandle _handle) - { - const uint32_t size = m_control.m_size; - - for (uint32_t ii = 0, num = m_control.available(); ii < num; ++ii) - { - Query& query = m_query[(m_control.m_read + ii) % size]; - if (query.m_handle.idx == _handle.idx) - { - query.m_handle.idx = bgfx::kInvalidHandle; - } - } - } - - void RendererContextD3D9::submitBlit(BlitState& _bs, uint16_t _view) - { - while (_bs.hasItem(_view) ) - { - const BlitItem& blit = _bs.advance(); - - const TextureD3D9& src = m_textures[blit.m_src.idx]; - const TextureD3D9& dst = m_textures[blit.m_dst.idx]; - - RECT srcRect = { LONG(blit.m_srcX), LONG(blit.m_srcY), LONG(blit.m_srcX + blit.m_width), LONG(blit.m_srcY + blit.m_height) }; - RECT dstRect = { LONG(blit.m_dstX), LONG(blit.m_dstY), LONG(blit.m_dstX + blit.m_width), LONG(blit.m_dstY + blit.m_height) }; - - IDirect3DSurface9* srcSurface = src.getSurface(uint8_t(blit.m_srcZ), blit.m_srcMip); - IDirect3DSurface9* dstSurface = dst.getSurface(uint8_t(blit.m_dstZ), blit.m_dstMip); - - // UpdateSurface (pool src: SYSTEMMEM, dst: DEFAULT) - // s/d T RTT RT - // T y y y - // RTT - - - - // RT - - - - // - // StretchRect (pool src and dst must be DEFAULT) - // s/d T RTT RT - // T - y y - // RTT - y y - // RT - y y - // - // GetRenderTargetData (dst must be SYSTEMMEM) - - bool depth = bimg::isDepth(bimg::TextureFormat::Enum(src.m_textureFormat) ); - HRESULT hr = m_device->StretchRect(srcSurface - , depth ? NULL : &srcRect - , dstSurface - , depth ? NULL : &dstRect - , D3DTEXF_NONE - ); - if (FAILED(hr) ) - { - hr = m_device->GetRenderTargetData(srcSurface, dstSurface); - BX_WARN(SUCCEEDED(hr), "StretchRect and GetRenderTargetData failed %x.", hr); - } - - srcSurface->Release(); - dstSurface->Release(); - } - } - - void RendererContextD3D9::submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) - { - IDirect3DDevice9* device = m_device; - - updateResolution(_render->m_resolution); - - BGFX_D3D9_PROFILER_BEGIN_LITERAL("rendererSubmit", kColorView); - - int64_t timeBegin = bx::getHPCounter(); - int64_t captureElapsed = 0; - - uint32_t frameQueryIdx = UINT32_MAX; - - device->BeginScene(); - if (m_timerQuerySupport) - { - frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS, _render->m_frameNum); - } - - if (0 < _render->m_iboffset) - { - BGFX_PROFILER_SCOPE("bgfx/Update transient index buffer", kColorResource); - TransientIndexBuffer* ib = _render->m_transientIb; - m_indexBuffers[ib->handle.idx].update(0, _render->m_iboffset, ib->data, true); - } - - if (0 < _render->m_vboffset) - { - BGFX_PROFILER_SCOPE("bgfx/Update transient vertex buffer", kColorResource); - TransientVertexBuffer* vb = _render->m_transientVb; - m_vertexBuffers[vb->handle.idx].update(0, _render->m_vboffset, vb->data, true); - } - - _render->sort(); - - RenderDraw currentState; - currentState.clear(); - currentState.m_stateFlags = BGFX_STATE_NONE; - currentState.m_stencil = packStencil(BGFX_STENCIL_NONE, BGFX_STENCIL_NONE); - - RenderBind currentBind; - currentBind.clear(); - - static ViewState viewState; - viewState.reset(_render); - - DX_CHECK(device->SetRenderState(D3DRS_FILLMODE, _render->m_debug&BGFX_DEBUG_WIREFRAME ? D3DFILL_WIREFRAME : D3DFILL_SOLID) ); - ProgramHandle currentProgram = BGFX_INVALID_HANDLE; - SortKey key; - uint16_t view = UINT16_MAX; - FrameBufferHandle fbh = { BGFX_CONFIG_MAX_FRAME_BUFFERS }; - uint32_t blendFactor = 0; - - BlitState bs(_render); - - uint8_t primIndex; - { - const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0; - primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); - } - PrimInfo prim = s_primInfo[primIndex]; - - bool viewHasScissor = false; - Rect viewScissorRect; - viewScissorRect.clear(); - - uint32_t statsNumPrimsSubmitted[BX_COUNTOF(s_primInfo)] = {}; - uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; - uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; - uint32_t statsNumIndices = 0; - uint32_t statsKeyType[2] = {}; - - invalidateSamplerState(); - - Profiler profiler( - _render - , m_gpuTimer - , s_viewName - , m_timerQuerySupport - ); - - if (m_occlusionQuerySupport) - { - m_occlusionQuery.resolve(_render); - } - - if (0 == (_render->m_debug&BGFX_DEBUG_IFH) ) - { - for (uint32_t item = 0, numItems = _render->m_numRenderItems; item < numItems; ++item) - { - const uint64_t encodedKey = _render->m_sortKeys[item]; - const bool isCompute = key.decode(encodedKey, _render->m_viewRemap); - statsKeyType[isCompute]++; - - if (isCompute) - { - BX_ASSERT(false, "Compute is not supported on DirectX 9."); - continue; - } - - const uint32_t itemIdx = _render->m_sortValues[item]; - const RenderDraw& draw = _render->m_renderItem[itemIdx].draw; - const RenderBind& renderBind = _render->m_renderItemBind[itemIdx]; - - const bool hasOcclusionQuery = 0 != (draw.m_stateFlags & BGFX_STATE_INTERNAL_OCCLUSION_QUERY); - { - const bool occluded = true - && isValid(draw.m_occlusionQuery) - && !hasOcclusionQuery - && !isVisible(_render, draw.m_occlusionQuery, 0 != (draw.m_submitFlags&BGFX_SUBMIT_INTERNAL_OCCLUSION_VISIBLE) ) - ; - - if (occluded - || _render->m_frameCache.isZeroArea(viewScissorRect, draw.m_scissor) ) - { - continue; - } - } - - const uint64_t newFlags = draw.m_stateFlags; - uint64_t changedFlags = currentState.m_stateFlags ^ draw.m_stateFlags; - currentState.m_stateFlags = newFlags; - - const uint64_t newStencil = draw.m_stencil; - uint64_t changedStencil = currentState.m_stencil ^ draw.m_stencil; - currentState.m_stencil = newStencil; - - if (key.m_view != view) - { - currentState.clear(); - currentState.m_scissor = !draw.m_scissor; - changedFlags = BGFX_STATE_MASK; - changedStencil = packStencil(BGFX_STENCIL_MASK, BGFX_STENCIL_MASK); - currentState.m_stateFlags = newFlags; - currentState.m_stencil = newStencil; - - view = key.m_view; - currentProgram = BGFX_INVALID_HANDLE; - - if (item > 0) - { - profiler.end(); - } - - BGFX_D3D9_PROFILER_END(); - BGFX_D3D9_PROFILER_BEGIN(view, kColorView); - - profiler.begin(view); - - if (_render->m_view[view].m_fbh.idx != fbh.idx) - { - fbh = _render->m_view[view].m_fbh; - setFrameBuffer(fbh); - } - - viewState.m_rect = _render->m_view[view].m_rect; - const Rect& scissorRect = _render->m_view[view].m_scissor; - viewHasScissor = !scissorRect.isZero(); - viewScissorRect = viewHasScissor ? scissorRect : viewState.m_rect; - - D3DVIEWPORT9 vp; - vp.X = viewState.m_rect.m_x; - vp.Y = viewState.m_rect.m_y; - vp.Width = viewState.m_rect.m_width; - vp.Height = viewState.m_rect.m_height; - vp.MinZ = 0.0f; - vp.MaxZ = 1.0f; - DX_CHECK(device->SetViewport(&vp) ); - - Clear& clear = _render->m_view[view].m_clear; - - if (BGFX_CLEAR_NONE != (clear.m_flags & BGFX_CLEAR_MASK) ) - { - clearQuad(_clearQuad, viewState.m_rect, clear, _render->m_colorPalette); - } - - DX_CHECK(device->SetRenderState(D3DRS_STENCILENABLE, FALSE) ); - DX_CHECK(device->SetRenderState(D3DRS_ZENABLE, TRUE) ); - DX_CHECK(device->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS) ); - DX_CHECK(device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE) ); - DX_CHECK(device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE) ); - DX_CHECK(device->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER) ); - - submitBlit(bs, view); - } - - uint16_t scissor = draw.m_scissor; - if (currentState.m_scissor != scissor) - { - currentState.m_scissor = scissor; - - if (UINT16_MAX == scissor) - { - DX_CHECK(device->SetRenderState(D3DRS_SCISSORTESTENABLE, viewHasScissor) ); - if (viewHasScissor) - { - RECT rc; - rc.left = viewScissorRect.m_x; - rc.top = viewScissorRect.m_y; - rc.right = viewScissorRect.m_x + viewScissorRect.m_width; - rc.bottom = viewScissorRect.m_y + viewScissorRect.m_height; - DX_CHECK(device->SetScissorRect(&rc) ); - } - } - else - { - Rect scissorRect; - scissorRect.setIntersect(viewScissorRect, _render->m_frameCache.m_rectCache.m_cache[scissor]); - - DX_CHECK(device->SetRenderState(D3DRS_SCISSORTESTENABLE, true) ); - RECT rc; - rc.left = scissorRect.m_x; - rc.top = scissorRect.m_y; - rc.right = scissorRect.m_x + scissorRect.m_width; - rc.bottom = scissorRect.m_y + scissorRect.m_height; - DX_CHECK(device->SetScissorRect(&rc) ); - } - } - - if (0 != changedStencil) - { - bool enable = 0 != newStencil; - DX_CHECK(device->SetRenderState(D3DRS_STENCILENABLE, enable) ); - - if (0 != newStencil) - { - uint32_t fstencil = unpackStencil(0, newStencil); - uint32_t bstencil = unpackStencil(1, newStencil); - uint8_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != fstencil; - DX_CHECK(device->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, 0 != frontAndBack) ); - - uint32_t fchanged = unpackStencil(0, changedStencil); - if ( (BGFX_STENCIL_FUNC_REF_MASK|BGFX_STENCIL_FUNC_RMASK_MASK) & fchanged) - { - uint32_t ref = (fstencil&BGFX_STENCIL_FUNC_REF_MASK)>>BGFX_STENCIL_FUNC_REF_SHIFT; - DX_CHECK(device->SetRenderState(D3DRS_STENCILREF, ref) ); - - uint32_t rmask = (fstencil&BGFX_STENCIL_FUNC_RMASK_MASK)>>BGFX_STENCIL_FUNC_RMASK_SHIFT; - DX_CHECK(device->SetRenderState(D3DRS_STENCILMASK, rmask) ); - } - -// uint32_t bchanged = unpackStencil(1, changedStencil); -// if (BGFX_STENCIL_FUNC_RMASK_MASK & bchanged) -// { -// uint32_t wmask = (bstencil&BGFX_STENCIL_FUNC_RMASK_MASK)>>BGFX_STENCIL_FUNC_RMASK_SHIFT; -// DX_CHECK(device->SetRenderState(D3DRS_STENCILWRITEMASK, wmask) ); -// } - - for (uint8_t ii = 0, num = frontAndBack+1; ii < num; ++ii) - { - uint32_t stencil = unpackStencil(ii, newStencil); - uint32_t changed = unpackStencil(ii, changedStencil); - - if ( (BGFX_STENCIL_TEST_MASK|BGFX_STENCIL_FUNC_REF_MASK|BGFX_STENCIL_FUNC_RMASK_MASK) & changed) - { - uint32_t func = (stencil&BGFX_STENCIL_TEST_MASK)>>BGFX_STENCIL_TEST_SHIFT; - DX_CHECK(device->SetRenderState(s_stencilFuncRs[ii], s_cmpFunc[func]) ); - } - - if ( (BGFX_STENCIL_OP_FAIL_S_MASK|BGFX_STENCIL_OP_FAIL_Z_MASK|BGFX_STENCIL_OP_PASS_Z_MASK) & changed) - { - uint32_t sfail = (stencil&BGFX_STENCIL_OP_FAIL_S_MASK)>>BGFX_STENCIL_OP_FAIL_S_SHIFT; - DX_CHECK(device->SetRenderState(s_stencilFailRs[ii], s_stencilOp[sfail]) ); - - uint32_t zfail = (stencil&BGFX_STENCIL_OP_FAIL_Z_MASK)>>BGFX_STENCIL_OP_FAIL_Z_SHIFT; - DX_CHECK(device->SetRenderState(s_stencilZFailRs[ii], s_stencilOp[zfail]) ); - - uint32_t zpass = (stencil&BGFX_STENCIL_OP_PASS_Z_MASK)>>BGFX_STENCIL_OP_PASS_Z_SHIFT; - DX_CHECK(device->SetRenderState(s_stencilZPassRs[ii], s_stencilOp[zpass]) ); - } - } - } - } - - if ( (0 - | BGFX_STATE_CULL_MASK -// | BGFX_STATE_FRONT_CCW - | BGFX_STATE_WRITE_Z - | BGFX_STATE_DEPTH_TEST_MASK - | BGFX_STATE_WRITE_RGB - | BGFX_STATE_WRITE_A - | BGFX_STATE_BLEND_MASK - | BGFX_STATE_BLEND_EQUATION_MASK - | BGFX_STATE_ALPHA_REF_MASK - | BGFX_STATE_PT_MASK - | BGFX_STATE_POINT_SIZE_MASK - | BGFX_STATE_MSAA - ) & changedFlags) - { - if (BGFX_STATE_CULL_MASK & changedFlags) - { - uint32_t cull = (newFlags&BGFX_STATE_CULL_MASK)>>BGFX_STATE_CULL_SHIFT; - DX_CHECK(device->SetRenderState(D3DRS_CULLMODE, s_cullMode[cull]) ); - } - - if (BGFX_STATE_WRITE_Z & changedFlags) - { - DX_CHECK(device->SetRenderState(D3DRS_ZWRITEENABLE, !!(BGFX_STATE_WRITE_Z & newFlags) ) ); - } - - if (BGFX_STATE_DEPTH_TEST_MASK & changedFlags) - { - uint32_t func = (newFlags&BGFX_STATE_DEPTH_TEST_MASK)>>BGFX_STATE_DEPTH_TEST_SHIFT; - DX_CHECK(device->SetRenderState(D3DRS_ZENABLE, 0 != func) ); - - if (0 != func) - { - DX_CHECK(device->SetRenderState(D3DRS_ZFUNC, s_cmpFunc[func]) ); - } - } - - if (BGFX_STATE_ALPHA_REF_MASK & changedFlags) - { - uint32_t ref = (newFlags&BGFX_STATE_ALPHA_REF_MASK)>>BGFX_STATE_ALPHA_REF_SHIFT; - viewState.m_alphaRef = ref/255.0f; - } - - if ( (BGFX_STATE_PT_POINTS|BGFX_STATE_POINT_SIZE_MASK) & changedFlags) - { - DX_CHECK(device->SetRenderState(D3DRS_POINTSIZE, castfu( (float)( (newFlags&BGFX_STATE_POINT_SIZE_MASK)>>BGFX_STATE_POINT_SIZE_SHIFT) ) ) ); - } - - if (BGFX_STATE_MSAA & changedFlags) - { - DX_CHECK(device->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, (newFlags&BGFX_STATE_MSAA) == BGFX_STATE_MSAA) ); - } - - if (BGFX_STATE_LINEAA & changedFlags) - { - DX_CHECK(m_device->SetRenderState(D3DRS_ANTIALIASEDLINEENABLE, !!(newFlags&BGFX_STATE_LINEAA) ) ); - } - - if ( (BGFX_STATE_WRITE_A|BGFX_STATE_WRITE_RGB) & changedFlags) - { - uint32_t writeEnable = 0; - writeEnable |= (newFlags&BGFX_STATE_WRITE_R) ? D3DCOLORWRITEENABLE_RED : 0; - writeEnable |= (newFlags&BGFX_STATE_WRITE_G) ? D3DCOLORWRITEENABLE_GREEN : 0; - writeEnable |= (newFlags&BGFX_STATE_WRITE_B) ? D3DCOLORWRITEENABLE_BLUE : 0; - writeEnable |= (newFlags&BGFX_STATE_WRITE_A) ? D3DCOLORWRITEENABLE_ALPHA : 0; - DX_CHECK(device->SetRenderState(D3DRS_COLORWRITEENABLE, writeEnable) ); - } - - if ( ( (0 - | BGFX_STATE_BLEND_MASK - | BGFX_STATE_BLEND_EQUATION_MASK - | BGFX_STATE_BLEND_ALPHA_TO_COVERAGE - ) & changedFlags) - || blendFactor != draw.m_rgba) - { - bool enabled = !!(BGFX_STATE_BLEND_MASK & newFlags); - DX_CHECK(device->SetRenderState(D3DRS_ALPHABLENDENABLE, enabled) ); - - if (m_atocSupport - && BGFX_STATE_BLEND_ALPHA_TO_COVERAGE & changedFlags) - { - DX_CHECK(m_device->SetRenderState(D3DRS_ADAPTIVETESS_Y - , !!(newFlags&BGFX_STATE_BLEND_ALPHA_TO_COVERAGE) - ? D3DFMT_ATOC - : 0 - ) ); - } - - if (enabled) - { - const uint32_t blend = uint32_t( (newFlags&BGFX_STATE_BLEND_MASK)>>BGFX_STATE_BLEND_SHIFT); - const uint32_t equation = uint32_t( (newFlags&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT); - - const uint32_t srcRGB = (blend )&0xf; - const uint32_t dstRGB = (blend>> 4)&0xf; - const uint32_t srcA = (blend>> 8)&0xf; - const uint32_t dstA = (blend>>12)&0xf; - - const uint32_t equRGB = (equation )&0x7; - const uint32_t equA = (equation>>3)&0x7; - - DX_CHECK(device->SetRenderState(D3DRS_SRCBLEND, s_blendFactor[srcRGB].m_src) ); - DX_CHECK(device->SetRenderState(D3DRS_DESTBLEND, s_blendFactor[dstRGB].m_dst) ); - DX_CHECK(device->SetRenderState(D3DRS_BLENDOP, s_blendEquation[equRGB]) ); - - const bool separate = srcRGB != srcA || dstRGB != dstA || equRGB != equA; - - DX_CHECK(device->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, separate) ); - if (separate) - { - DX_CHECK(device->SetRenderState(D3DRS_SRCBLENDALPHA, s_blendFactor[srcA].m_src) ); - DX_CHECK(device->SetRenderState(D3DRS_DESTBLENDALPHA, s_blendFactor[dstA].m_dst) ); - DX_CHECK(device->SetRenderState(D3DRS_BLENDOPALPHA, s_blendEquation[equA]) ); - } - - if ( (s_blendFactor[srcRGB].m_factor || s_blendFactor[dstRGB].m_factor) - && blendFactor != draw.m_rgba) - { - const uint32_t rgba = draw.m_rgba; - D3DCOLOR color = D3DCOLOR_RGBA( - rgba>>24 - , (rgba>>16)&0xff - , (rgba>> 8)&0xff - , (rgba )&0xff - ); - DX_CHECK(device->SetRenderState(D3DRS_BLENDFACTOR, color) ); - } - } - - blendFactor = draw.m_rgba; - } - - const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : newFlags&BGFX_STATE_PT_MASK; - primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); - prim = s_primInfo[primIndex]; - } - - bool programChanged = false; - bool constantsChanged = draw.m_uniformBegin < draw.m_uniformEnd; - rendererUpdateUniforms(this, _render->m_uniformBuffer[draw.m_uniformIdx], draw.m_uniformBegin, draw.m_uniformEnd); - - if (key.m_program.idx != currentProgram.idx) - { - currentProgram = key.m_program; - - if (!isValid(currentProgram) ) - { - device->SetVertexShader(NULL); - device->SetPixelShader(NULL); - } - else - { - ProgramD3D9& program = m_program[currentProgram.idx]; - device->SetVertexShader(program.m_vsh->m_vertexShader); - device->SetPixelShader(NULL == program.m_fsh - ? NULL - : program.m_fsh->m_pixelShader - ); - } - - programChanged = - constantsChanged = true; - } - - if (isValid(currentProgram) ) - { - ProgramD3D9& program = m_program[currentProgram.idx]; - - if (constantsChanged) - { - UniformBuffer* vcb = program.m_vsh->m_constantBuffer; - if (NULL != vcb) - { - commit(*vcb); - } - - if (NULL != program.m_fsh) - { - UniformBuffer* fcb = program.m_fsh->m_constantBuffer; - if (NULL != fcb) - { - commit(*fcb); - } - } - } - - viewState.setPredefined<4>(this, view, program, _render, draw); - } - - { - for (uint8_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage) - { - const Binding& bind = renderBind.m_bind[stage]; - Binding& current = currentBind.m_bind[stage]; - - if (current.m_idx != bind.m_idx - || current.m_samplerFlags != bind.m_samplerFlags - || programChanged) - { - if (kInvalidHandle != bind.m_idx) - { - m_textures[bind.m_idx].commit(stage, bind.m_samplerFlags, _render->m_colorPalette); - } - else - { - DX_CHECK(device->SetTexture(stage, NULL) ); - } - } - - current = bind; - } - } - - bool vertexStreamChanged = hasVertexStreamChanged(currentState, draw); - - if (programChanged - || vertexStreamChanged) - { - currentState.m_streamMask = draw.m_streamMask; - currentState.m_instanceDataBuffer.idx = draw.m_instanceDataBuffer.idx; - currentState.m_instanceDataOffset = draw.m_instanceDataOffset; - currentState.m_instanceDataStride = draw.m_instanceDataStride; - - const VertexLayout* layouts[BGFX_CONFIG_MAX_VERTEX_STREAMS]; - - const bool instanced = true - && isValid(draw.m_instanceDataBuffer) - && m_instancingSupport - ; - - const uint32_t freq = instanced - ? D3DSTREAMSOURCE_INDEXEDDATA|draw.m_numInstances - : 1 - ; - - uint32_t numVertices = draw.m_numVertices; - uint8_t numStreams = 0; - for (uint32_t idx = 0, streamMask = draw.m_streamMask - ; 0 != streamMask - ; streamMask >>= 1, idx += 1, ++numStreams - ) - { - const uint32_t ntz = bx::uint32_cnttz(streamMask); - streamMask >>= ntz; - idx += ntz; - - currentState.m_stream[idx].m_layoutHandle = draw.m_stream[idx].m_layoutHandle; - currentState.m_stream[idx].m_handle = draw.m_stream[idx].m_handle; - currentState.m_stream[idx].m_startVertex = draw.m_stream[idx].m_startVertex; - - const uint16_t handle = draw.m_stream[idx].m_handle.idx; - const VertexBufferD3D9& vb = m_vertexBuffers[handle]; - const uint16_t layoutIdx = isValid(draw.m_stream[idx].m_layoutHandle) - ? draw.m_stream[idx].m_layoutHandle.idx - : vb.m_layoutHandle.idx; - const VertexLayout& layout = m_vertexLayouts[layoutIdx]; - const uint32_t stride = layout.m_stride; - - layouts[numStreams] = &layout; - - numVertices = bx::uint32_min(UINT32_MAX == draw.m_numVertices - ? vb.m_size/stride - : draw.m_numVertices - , numVertices - ); - - DX_CHECK(device->SetStreamSourceFreq(0, freq) ); - DX_CHECK(device->SetStreamSource(numStreams, vb.m_ptr, 0, stride) ); - } - - if (0 < numStreams) - { - if (instanced) - { - const VertexBufferD3D9& inst = m_vertexBuffers[draw.m_instanceDataBuffer.idx]; - DX_CHECK(device->SetStreamSourceFreq(numStreams, UINT(D3DSTREAMSOURCE_INSTANCEDATA|1) ) ); - DX_CHECK(device->SetStreamSource(numStreams, inst.m_ptr, draw.m_instanceDataOffset, draw.m_instanceDataStride) ); - setInputLayout(numStreams, layouts, draw.m_instanceDataStride/16); - } - else - { - DX_CHECK(device->SetStreamSource(numStreams, NULL, 0, 0) ); - setInputLayout(numStreams, layouts, 0); - } - } - else - { - DX_CHECK(device->SetStreamSource(0, NULL, 0, 0) ); - DX_CHECK(device->SetStreamSource(1, NULL, 0, 0) ); - } - } - - if (currentState.m_indexBuffer.idx != draw.m_indexBuffer.idx) - { - currentState.m_indexBuffer = draw.m_indexBuffer; - - uint16_t handle = draw.m_indexBuffer.idx; - if (kInvalidHandle != handle) - { - const IndexBufferD3D9& ib = m_indexBuffers[handle]; - DX_CHECK(device->SetIndices(ib.m_ptr) ); - } - else - { - DX_CHECK(device->SetIndices(NULL) ); - } - } - - if (0 != currentState.m_streamMask) - { - uint32_t numVertices = draw.m_numVertices; - uint32_t numIndices = 0; - uint32_t numPrimsSubmitted = 0; - uint32_t numInstances = 0; - uint32_t numPrimsRendered = 0; - - if (hasOcclusionQuery) - { - m_occlusionQuery.begin(_render, draw.m_occlusionQuery); - } - - if (isValid(draw.m_indexBuffer) ) - { - if (UINT32_MAX == draw.m_numIndices) - { - const IndexBufferD3D9& ib = m_indexBuffers[draw.m_indexBuffer.idx]; - const bool isIndex16 = draw.isIndex16(); - const uint32_t indexSize = isIndex16 ? 2 : 4; - numIndices = ib.m_size/indexSize; - numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub; - numInstances = draw.m_numInstances; - numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; - - DX_CHECK(device->DrawIndexedPrimitive(prim.m_type - , draw.m_stream[0].m_startVertex - , 0 - , numVertices - , 0 - , numPrimsSubmitted - ) ); - } - else if (prim.m_min <= draw.m_numIndices) - { - numIndices = draw.m_numIndices; - numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub; - numInstances = draw.m_numInstances; - numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; - - DX_CHECK(device->DrawIndexedPrimitive(prim.m_type - , draw.m_stream[0].m_startVertex - , 0 - , numVertices - , draw.m_startIndex - , numPrimsSubmitted - ) ); - } - } - else - { - numPrimsSubmitted = numVertices/prim.m_div - prim.m_sub; - numInstances = draw.m_numInstances; - numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; - - DX_CHECK(device->DrawPrimitive(prim.m_type - , draw.m_stream[0].m_startVertex - , numPrimsSubmitted - ) ); - } - - if (hasOcclusionQuery) - { - m_occlusionQuery.end(); - } - - statsNumPrimsSubmitted[primIndex] += numPrimsSubmitted; - statsNumPrimsRendered[primIndex] += numPrimsRendered; - statsNumInstances[primIndex] += numInstances; - statsNumIndices += numIndices; - } - } - - submitBlit(bs, BGFX_CONFIG_MAX_VIEWS); - - if (0 < _render->m_numRenderItems) - { - if (0 != (m_resolution.reset & BGFX_RESET_FLUSH_AFTER_RENDER) ) - { - flush(); - } - - captureElapsed = -bx::getHPCounter(); - capture(); - captureElapsed += bx::getHPCounter(); - - profiler.end(); - } - } - - BGFX_D3D9_PROFILER_END(); - - int64_t timeEnd = bx::getHPCounter(); - int64_t frameTime = timeEnd - timeBegin; - - static int64_t min = frameTime; - static int64_t max = frameTime; - min = min > frameTime ? frameTime : min; - max = max < frameTime ? frameTime : max; - - static uint32_t maxGpuLatency = 0; - static double maxGpuElapsed = 0.0f; - double elapsedGpuMs = 0.0; - - if (UINT32_MAX != frameQueryIdx) - { - m_gpuTimer.end(frameQueryIdx); - - const TimerQueryD3D9::Result& result = m_gpuTimer.m_result[BGFX_CONFIG_MAX_VIEWS]; - double toGpuMs = 1000.0 / double(result.m_frequency); - elapsedGpuMs = (result.m_end - result.m_begin) * toGpuMs; - maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed; - - maxGpuLatency = bx::uint32_imax(maxGpuLatency, result.m_pending-1); - } - - const int64_t timerFreq = bx::getHPFrequency(); - - Stats& perfStats = _render->m_perfStats; - perfStats.cpuTimeBegin = timeBegin; - perfStats.cpuTimeEnd = timeEnd; - perfStats.cpuTimerFreq = timerFreq; - const TimerQueryD3D9::Result& result = m_gpuTimer.m_result[BGFX_CONFIG_MAX_VIEWS]; - perfStats.gpuTimeBegin = result.m_begin; - perfStats.gpuTimeEnd = result.m_end; - perfStats.gpuTimerFreq = result.m_frequency; - perfStats.numDraw = statsKeyType[0]; - perfStats.numCompute = statsKeyType[1]; - perfStats.numBlit = _render->m_numBlitItems; - perfStats.maxGpuLatency = maxGpuLatency; - perfStats.gpuFrameNum = result.m_frameNum; - bx::memCopy(perfStats.numPrims, statsNumPrimsRendered, sizeof(perfStats.numPrims) ); - m_nvapi.getMemoryInfo(perfStats.gpuMemoryUsed, perfStats.gpuMemoryMax); - - if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) ) - { - BGFX_D3D9_PROFILER_BEGIN_LITERAL("debugstats", kColorFrame); - - m_needPresent = true; - TextVideoMem& tvm = m_textVideoMem; - - static int64_t next = timeEnd; - - if (timeEnd >= next) - { - next = timeEnd + timerFreq; - - double freq = double(timerFreq); - double toMs = 1000.0/freq; - - tvm.clear(); - uint16_t pos = 0; - tvm.printf(0, pos++, BGFX_CONFIG_DEBUG ? 0x8c : 0x8f - , " %s / " BX_COMPILER_NAME - " / " BX_CPU_NAME - " / " BX_ARCH_NAME - " / " BX_PLATFORM_NAME - " / Version 1.%d.%d (commit: " BGFX_REV_SHA1 ")" - , getRendererName() - , BGFX_API_VERSION - , BGFX_REV_NUMBER - ); - - const D3DADAPTER_IDENTIFIER9& identifier = m_identifier; - tvm.printf(0, pos++, 0x8f, " Device: %s (%s)", identifier.Description, identifier.Driver); - - char processMemoryUsed[16]; - bx::prettify(processMemoryUsed, BX_COUNTOF(processMemoryUsed), bx::getProcessMemoryUsed() ); - tvm.printf(0, pos++, 0x8f, " Memory: %s (process) ", processMemoryUsed); - - pos = 10; - tvm.printf(10, pos++, 0x8b, " Frame: %7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS " - , double(frameTime)*toMs - , double(min)*toMs - , double(max)*toMs - , freq/frameTime - ); - - const uint32_t msaa = (m_resolution.reset&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT; - tvm.printf(10, pos++, 0x8b, " Reset flags: [%c] vsync, [%c] MSAAx%d, [%c] MaxAnisotropy " - , !!(m_resolution.reset&BGFX_RESET_VSYNC) ? '\xfe' : ' ' - , 0 != msaa ? '\xfe' : ' ' - , 1<m_numRenderItems - , statsKeyType[0] - , statsKeyType[1] - , elapsedCpuMs - , elapsedCpuMs > maxGpuElapsed ? '>' : '<' - , maxGpuElapsed - , maxGpuLatency - ); - maxGpuLatency = 0; - maxGpuElapsed = 0.0; - - for (uint32_t ii = 0; ii < Topology::Count; ++ii) - { - tvm.printf(10, pos++, 0x8b, " %10s: %7d (#inst: %5d), submitted: %7d" - , getName(Topology::Enum(ii) ) - , statsNumPrimsRendered[ii] - , statsNumInstances[ii] - , statsNumPrimsSubmitted[ii] - ); - } - - tvm.printf(10, pos++, 0x8b, " Indices: %7d ", statsNumIndices); -// tvm.printf(10, pos++, 0x8b, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax); - tvm.printf(10, pos++, 0x8b, " DVB size: %7d ", _render->m_vboffset); - tvm.printf(10, pos++, 0x8b, " DIB size: %7d ", _render->m_iboffset); - - pos++; - tvm.printf(10, pos++, 0x8b, " Occlusion queries: %3d ", m_occlusionQuery.m_control.available() ); - - pos++; - tvm.printf(10, pos++, 0x8b, " State cache: "); - tvm.printf(10, pos++, 0x8b, " Input "); - tvm.printf(10, pos++, 0x8b, " %6d " - , m_inputLayoutCache.getCount() - ); - pos++; - - double captureMs = double(captureElapsed)*toMs; - tvm.printf(10, pos++, 0x8b, " Capture: %7.4f [ms]", captureMs); - - uint8_t attr[2] = { 0x8c, 0x8a }; - uint8_t attrIndex = _render->m_waitSubmit < _render->m_waitRender; - - tvm.printf(10, pos++, attr[attrIndex&1], " Submit wait: %7.4f [ms]", _render->m_waitSubmit*toMs); - tvm.printf(10, pos++, attr[(attrIndex+1)&1], " Render wait: %7.4f [ms]", _render->m_waitRender*toMs); - - min = frameTime; - max = frameTime; - } - - blit(this, _textVideoMemBlitter, tvm); - - BGFX_D3D9_PROFILER_END(); - } - else if (_render->m_debug & BGFX_DEBUG_TEXT) - { - BGFX_D3D9_PROFILER_BEGIN_LITERAL("debugtext", kColorFrame); - - blit(this, _textVideoMemBlitter, _render->m_textVideoMem); - - BGFX_D3D9_PROFILER_END(); - } - - device->EndScene(); - } -} /* namespace d3d9 */ } // namespace bgfx - -#else - -namespace bgfx { namespace d3d9 -{ - RendererContextI* rendererCreate(const Init& _init) - { - BX_UNUSED(_init); - return NULL; - } - - void rendererDestroy() - { - } -} /* namespace d3d9 */ } // namespace bgfx - -#endif // BGFX_CONFIG_RENDERER_DIRECT3D9 diff --git a/bgfx/src/renderer_d3d9.h b/bgfx/src/renderer_d3d9.h deleted file mode 100644 index 52c803f0..00000000 --- a/bgfx/src/renderer_d3d9.h +++ /dev/null @@ -1,513 +0,0 @@ -/* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE - */ - -#ifndef BGFX_RENDERER_D3D9_H_HEADER_GUARD -#define BGFX_RENDERER_D3D9_H_HEADER_GUARD - -#define BGFX_CONFIG_RENDERER_DIRECT3D9EX (BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS) - -#include -#include -#include - -#ifndef D3DSTREAMSOURCE_INDEXEDDATA -# define D3DSTREAMSOURCE_INDEXEDDATA (1<<30) -#endif// D3DSTREAMSOURCE_INDEXEDDATA - -#ifndef D3DSTREAMSOURCE_INSTANCEDATA -# define D3DSTREAMSOURCE_INSTANCEDATA (2<<30) -#endif // D3DSTREAMSOURCE_INSTANCEDATA - -#include "renderer.h" -#include "renderer_d3d.h" -#include "nvapi.h" - -#define BGFX_D3D9_PROFILER_BEGIN(_view, _abgr) \ - BX_MACRO_BLOCK_BEGIN \ - PIX_BEGINEVENT(_abgr, s_viewNameW[_view]); \ - BGFX_PROFILER_BEGIN(s_viewName[view], _abgr); \ - BX_MACRO_BLOCK_END - -#define BGFX_D3D9_PROFILER_BEGIN_LITERAL(_name, _abgr) \ - BX_MACRO_BLOCK_BEGIN \ - PIX_BEGINEVENT(_abgr, L"" _name); \ - BGFX_PROFILER_BEGIN_LITERAL("" _name, _abgr); \ - BX_MACRO_BLOCK_END - -#define BGFX_D3D9_PROFILER_END() \ - BX_MACRO_BLOCK_BEGIN \ - BGFX_PROFILER_END(); \ - PIX_ENDEVENT(); \ - BX_MACRO_BLOCK_END - -namespace bgfx { namespace d3d9 -{ -# if defined(D3D_DISABLE_9EX) -# define D3DFMT_S8_LOCKABLE D3DFORMAT( 85) -# define D3DFMT_A1 D3DFORMAT(118) -# endif // defined(D3D_DISABLE_9EX) - -# ifndef D3DFMT_ATI1 -# define D3DFMT_ATI1 ( (D3DFORMAT)BX_MAKEFOURCC('A', 'T', 'I', '1') ) -# endif // D3DFMT_ATI1 - -# ifndef D3DFMT_ATI2 -# define D3DFMT_ATI2 ( (D3DFORMAT)BX_MAKEFOURCC('A', 'T', 'I', '2') ) -# endif // D3DFMT_ATI2 - -# ifndef D3DFMT_ATOC -# define D3DFMT_ATOC ( (D3DFORMAT)BX_MAKEFOURCC('A', 'T', 'O', 'C') ) -# endif // D3DFMT_ATOC - -# ifndef D3DFMT_DF16 -# define D3DFMT_DF16 ( (D3DFORMAT)BX_MAKEFOURCC('D', 'F', '1', '6') ) -# endif // D3DFMT_DF16 - -# ifndef D3DFMT_DF24 -# define D3DFMT_DF24 ( (D3DFORMAT)BX_MAKEFOURCC('D', 'F', '2', '4') ) -# endif // D3DFMT_DF24 - -# ifndef D3DFMT_INST -# define D3DFMT_INST ( (D3DFORMAT)BX_MAKEFOURCC('I', 'N', 'S', 'T') ) -# endif // D3DFMT_INST - -# ifndef D3DFMT_INTZ -# define D3DFMT_INTZ ( (D3DFORMAT)BX_MAKEFOURCC('I', 'N', 'T', 'Z') ) -# endif // D3DFMT_INTZ - -# ifndef D3DFMT_NULL -# define D3DFMT_NULL ( (D3DFORMAT)BX_MAKEFOURCC('N', 'U', 'L', 'L') ) -# endif // D3DFMT_NULL - -# ifndef D3DFMT_RESZ -# define D3DFMT_RESZ ( (D3DFORMAT)BX_MAKEFOURCC('R', 'E', 'S', 'Z') ) -# endif // D3DFMT_RESZ - -# ifndef D3DFMT_RAWZ -# define D3DFMT_RAWZ ( (D3DFORMAT)BX_MAKEFOURCC('R', 'A', 'W', 'Z') ) -# endif // D3DFMT_RAWZ - -# ifndef D3DFMT_S8_LOCKABLE -# define D3DFMT_S8_LOCKABLE ( (D3DFORMAT)85) -# endif // D3DFMT_S8_LOCKABLE - -# ifndef D3DFMT_A1 -# define D3DFMT_A1 ( (D3DFORMAT)118) -# endif // D3DFMT_A1 - - struct ExtendedFormat - { - enum Enum - { - Ati1, - Ati2, - Df16, - Df24, - Inst, - Intz, - Null, - Resz, - Rawz, - Atoc, - - Count, - }; - - D3DFORMAT m_fmt; - DWORD m_usage; - D3DRESOURCETYPE m_type; - bool m_supported; - }; - - struct Msaa - { - D3DMULTISAMPLE_TYPE m_type; - DWORD m_quality; - }; - - struct IndexBufferD3D9 - { - IndexBufferD3D9() - : m_ptr(NULL) - , m_dynamic(NULL) - , m_size(0) - , m_flags(BGFX_BUFFER_NONE) - { - } - - void create(uint32_t _size, void* _data, uint16_t _flags); - void update(uint32_t _offset, uint32_t _size, void* _data, bool _discard = false) - { - if (NULL != m_dynamic - && _data != m_dynamic) - { - bx::memCopy(&m_dynamic[_offset], _data, _size); - } - - void* buffer; - DX_CHECK(m_ptr->Lock(_offset - , _size - , &buffer - , _discard || (m_dynamic && 0 == _offset && m_size == _size) ? D3DLOCK_DISCARD : 0 - ) ); - - bx::memCopy(buffer, _data, _size); - - DX_CHECK(m_ptr->Unlock() ); - } - - void destroy() - { - if (NULL != m_ptr) - { - DX_RELEASE(m_ptr, 0); - - if (NULL != m_dynamic) - { - bx::free(g_allocator, m_dynamic); - m_dynamic = NULL; - } - } - } - - void preReset(); - void postReset(); - - IDirect3DIndexBuffer9* m_ptr; - uint8_t* m_dynamic; - uint32_t m_size; - uint16_t m_flags; - }; - - struct VertexBufferD3D9 - { - VertexBufferD3D9() - : m_ptr(NULL) - , m_dynamic(NULL) - , m_size(0) - { - } - - void create(uint32_t _size, void* _data, VertexLayoutHandle _layoutHandle); - void update(uint32_t _offset, uint32_t _size, void* _data, bool _discard = false) - { - if (NULL != m_dynamic - && _data != m_dynamic) - { - bx::memCopy(&m_dynamic[_offset], _data, _size); - } - - void* buffer; - DX_CHECK(m_ptr->Lock(_offset - , _size - , &buffer - , _discard || (m_dynamic && 0 == _offset && m_size == _size) ? D3DLOCK_DISCARD : 0 - ) ); - - bx::memCopy(buffer, _data, _size); - - DX_CHECK(m_ptr->Unlock() ); - } - - void destroy() - { - if (NULL != m_ptr) - { - DX_RELEASE(m_ptr, 0); - - if (NULL != m_dynamic) - { - bx::free(g_allocator, m_dynamic); - m_dynamic = NULL; - } - } - } - - void preReset(); - void postReset(); - - IDirect3DVertexBuffer9* m_ptr; - uint8_t* m_dynamic; - uint32_t m_size; - VertexLayoutHandle m_layoutHandle; - }; - - struct ShaderD3D9 - { - ShaderD3D9() - : m_vertexShader(NULL) - , m_constantBuffer(NULL) - , m_numPredefined(0) - , m_type(0) - { - } - - void create(const Memory* _mem); - - void destroy() - { - if (NULL != m_constantBuffer) - { - UniformBuffer::destroy(m_constantBuffer); - m_constantBuffer = NULL; - } - m_numPredefined = 0; - - switch (m_type) - { - case 0: DX_RELEASE(m_vertexShader, 0); BX_FALLTHROUGH; - default: DX_RELEASE(m_pixelShader, 0); - } - } - - union - { - // X360 doesn't have interface inheritance (can't use IUnknown*). - IDirect3DVertexShader9* m_vertexShader; - IDirect3DPixelShader9* m_pixelShader; - }; - UniformBuffer* m_constantBuffer; - PredefinedUniform m_predefined[PredefinedUniform::Count]; - uint8_t m_numPredefined; - uint8_t m_type; - }; - - struct ProgramD3D9 - { - void create(const ShaderD3D9* _vsh, const ShaderD3D9* _fsh) - { - m_vsh = _vsh; - m_fsh = _fsh; - - bx::memCopy(&m_predefined[0], _vsh->m_predefined, _vsh->m_numPredefined*sizeof(PredefinedUniform) ); - m_numPredefined = _vsh->m_numPredefined; - - if (NULL != _fsh) - { - bx::memCopy(&m_predefined[_vsh->m_numPredefined], _fsh->m_predefined, _fsh->m_numPredefined*sizeof(PredefinedUniform) ); - m_numPredefined += _fsh->m_numPredefined; - } - } - - void destroy() - { - m_numPredefined = 0; - m_vsh = NULL; - m_fsh = NULL; - } - - const ShaderD3D9* m_vsh; - const ShaderD3D9* m_fsh; - - PredefinedUniform m_predefined[PredefinedUniform::Count*2]; - uint8_t m_numPredefined; - }; - - struct TextureD3D9 - { - enum Enum - { - Texture2D, - Texture3D, - TextureCube, - }; - - TextureD3D9() - : m_ptr(NULL) - , m_surface(NULL) - , m_staging(NULL) - , m_textureFormat(TextureFormat::Unknown) - { - } - - void createTexture(uint32_t _width, uint32_t _height, uint8_t _numMips); - void createVolumeTexture(uint32_t _width, uint32_t _height, uint32_t _depth, uint8_t _numMips); - void createCubeTexture(uint32_t _width, uint8_t _numMips); - - uint8_t* lock(uint8_t _side, uint8_t _lod, uint32_t& _pitch, uint32_t& _slicePitch, const Rect* _rect = NULL); - void unlock(uint8_t _side, uint8_t _lod); - void dirty(uint8_t _side, const Rect& _rect, uint16_t _z, uint16_t _depth); - IDirect3DSurface9* getSurface(uint8_t _side = 0, uint8_t _mip = 0) const; - - void create(const Memory* _mem, uint64_t _flags, uint8_t _skip); - - void destroy(bool _resize = false) - { - if (0 == (m_flags & BGFX_SAMPLER_INTERNAL_SHARED) ) - { - if (_resize) - { - // BK - at the time of resize there might be one reference held by frame buffer - // surface. This frame buffer will be recreated later, and release reference - // to existing surface. That's why here we don't care about ref count. - m_ptr->Release(); - } - else - { - DX_RELEASE(m_ptr, 0); - } - } - DX_RELEASE(m_surface, 0); - DX_RELEASE(m_staging, 0); - m_textureFormat = TextureFormat::Unknown; - } - - void overrideInternal(uintptr_t _ptr) - { - destroy(); - m_flags |= BGFX_SAMPLER_INTERNAL_SHARED; - m_ptr = (IDirect3DBaseTexture9*)_ptr; - } - - void updateBegin(uint8_t _side, uint8_t _mip); - void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem); - void updateEnd(); - void commit(uint8_t _stage, uint32_t _flags, const float _palette[][4]); - void resolve(uint8_t _resolve) const; - - void preReset(); - void postReset(); - - union - { - IDirect3DBaseTexture9* m_ptr; - IDirect3DTexture9* m_texture2d; - IDirect3DVolumeTexture9* m_texture3d; - IDirect3DCubeTexture9* m_textureCube; - }; - - IDirect3DSurface9* m_surface; - - union - { - IDirect3DBaseTexture9* m_staging; - IDirect3DTexture9* m_staging2d; - IDirect3DVolumeTexture9* m_staging3d; - IDirect3DCubeTexture9* m_stagingCube; - }; - - uint64_t m_flags; - uint32_t m_width; - uint32_t m_height; - uint32_t m_depth; - uint8_t m_numMips; - uint8_t m_type; - uint8_t m_requestedFormat; - uint8_t m_textureFormat; - }; - - struct FrameBufferD3D9 - { - FrameBufferD3D9() - : m_hwnd(NULL) - , m_denseIdx(UINT16_MAX) - , m_num(0) - , m_numTh(0) - , m_dsIdx(UINT8_MAX) - , m_needResolve(false) - , m_needPresent(false) - { - } - - void create(uint8_t _num, const Attachment* _attachment); - void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _format, TextureFormat::Enum _depthFormat); - uint16_t destroy(); - HRESULT present(); - void resolve() const; - void preReset(); - void postReset(); - void createNullColorRT(); - void set(); - - IDirect3DSurface9* m_surface[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS-1]; - IDirect3DSwapChain9* m_swapChain; - HWND m_hwnd; - uint32_t m_width; - uint32_t m_height; - - Attachment m_attachment[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS]; - uint16_t m_denseIdx; - uint8_t m_num; - uint8_t m_numTh; - uint8_t m_dsIdx; - bool m_needResolve; - bool m_needPresent; - }; - - struct TimerQueryD3D9 - { - TimerQueryD3D9() - : m_control(BX_COUNTOF(m_query) ) - { - } - - void postReset(); - void preReset(); - uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum); - void end(uint32_t _idx); - bool update(); - - struct Query - { - IDirect3DQuery9* m_disjoint; - IDirect3DQuery9* m_begin; - IDirect3DQuery9* m_end; - IDirect3DQuery9* m_freq; - uint32_t m_resultIdx; - uint32_t m_frameNum; - bool m_ready; - }; - - struct Result - { - void reset() - { - m_begin = 0; - m_end = 0; - m_frequency = 1; - m_pending = 0; - m_frameNum = 0; - } - - uint64_t m_begin; - uint64_t m_end; - uint64_t m_frequency; - uint32_t m_pending; - uint32_t m_frameNum; - }; - - Result m_result[BGFX_CONFIG_MAX_VIEWS+1]; - - Query m_query[BGFX_CONFIG_MAX_VIEWS*4]; - bx::RingBufferControl m_control; - }; - - struct OcclusionQueryD3D9 - { - OcclusionQueryD3D9() - : m_control(BX_COUNTOF(m_query) ) - { - } - - void postReset(); - void preReset(); - void begin(Frame* _render, OcclusionQueryHandle _handle); - void end(); - void resolve(Frame* _render, bool _wait = false); - void invalidate(OcclusionQueryHandle _handle); - - struct Query - { - IDirect3DQuery9* m_ptr; - OcclusionQueryHandle m_handle; - }; - - Query m_query[BGFX_CONFIG_MAX_OCCLUSION_QUERIES]; - bx::RingBufferControl m_control; - }; - -} /* namespace d3d9 */ } // namespace bgfx - -#endif // BGFX_RENDERER_D3D9_H_HEADER_GUARD diff --git a/bgfx/src/renderer_gl.cpp b/bgfx/src/renderer_gl.cpp index 883dc48c..eb4d051b 100644 --- a/bgfx/src/renderer_gl.cpp +++ b/bgfx/src/renderer_gl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -40,7 +40,7 @@ namespace bgfx { namespace gl { GL_POINTS, 1, 1, 0 }, { GL_ZERO, 0, 0, 0 }, }; - BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo)-1); + static_assert(Topology::Count == BX_COUNTOF(s_primInfo)-1); static const char* s_attribName[] = { @@ -63,7 +63,7 @@ namespace bgfx { namespace gl "a_texcoord6", "a_texcoord7", }; - BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attribName) ); + static_assert(Attrib::Count == BX_COUNTOF(s_attribName) ); static const char* s_instanceDataName[] = { @@ -73,7 +73,7 @@ namespace bgfx { namespace gl "i_data3", "i_data4", }; - BX_STATIC_ASSERT(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) ); + static_assert(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) ); static const GLenum s_access[] = { @@ -81,7 +81,7 @@ namespace bgfx { namespace gl GL_WRITE_ONLY, GL_READ_WRITE, }; - BX_STATIC_ASSERT(Access::Count == BX_COUNTOF(s_access) ); + static_assert(Access::Count == BX_COUNTOF(s_access) ); static const GLenum s_attribType[] = { @@ -91,7 +91,7 @@ namespace bgfx { namespace gl GL_HALF_FLOAT, // Half GL_FLOAT, // Float }; - BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) ); + static_assert(AttribType::Count == BX_COUNTOF(s_attribType) ); struct Blend { @@ -320,7 +320,7 @@ namespace bgfx { namespace gl #undef $B #undef $A }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); + static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); static bool s_textureFilter[TextureFormat::Count+1]; @@ -423,7 +423,7 @@ namespace bgfx { namespace gl GL_DEPTH_COMPONENT32F, // D32F GL_STENCIL_INDEX8, // D0S8 }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_rboFormat) ); + static_assert(TextureFormat::Count == BX_COUNTOF(s_rboFormat) ); static GLenum s_imageFormat[] = { @@ -524,7 +524,7 @@ namespace bgfx { namespace gl GL_ZERO, // D32F GL_ZERO, // D0S8 }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_imageFormat) ); + static_assert(TextureFormat::Count == BX_COUNTOF(s_imageFormat) ); struct Extension { @@ -936,7 +936,7 @@ namespace bgfx { namespace gl { "WEBKIT_WEBGL_compressed_texture_s3tc", false, true }, { "WEBKIT_WEBGL_depth_texture", false, true }, }; - BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) ); + static_assert(Extension::Count == BX_COUNTOF(s_extension) ); static const char* s_ARB_shader_texture_lod[] = { @@ -1274,6 +1274,13 @@ namespace bgfx { namespace gl static uint64_t s_vertexAttribArraysPendingDisable = 0; static uint64_t s_vertexAttribArraysPendingEnable = 0; + void initLazyEnabledVertexAttributes() + { + s_currentlyEnabledVertexAttribArrays = 0; + s_vertexAttribArraysPendingDisable = 0; + s_vertexAttribArraysPendingEnable = 0; + } + void lazyEnableVertexAttribArray(GLuint index) { if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN) ) @@ -1324,7 +1331,7 @@ namespace bgfx { namespace gl { while (s_vertexAttribArraysPendingDisable) { - uint32_t index = bx::uint32_cnttz(s_vertexAttribArraysPendingDisable); + uint32_t index = bx::countTrailingZeros(s_vertexAttribArraysPendingDisable); uint64_t mask = ~(UINT64_C(1) << index); s_vertexAttribArraysPendingDisable &= mask; s_currentlyEnabledVertexAttribArrays &= mask; @@ -1333,7 +1340,7 @@ namespace bgfx { namespace gl while (s_vertexAttribArraysPendingEnable) { - uint32_t index = bx::uint32_cnttz(s_vertexAttribArraysPendingEnable); + uint32_t index = bx::countTrailingZeros(s_vertexAttribArraysPendingEnable); uint64_t mask = UINT64_C(1) << index; s_vertexAttribArraysPendingEnable &= ~mask; s_currentlyEnabledVertexAttribArrays |= mask; @@ -1851,7 +1858,7 @@ namespace bgfx { namespace gl if (_array) { glTexStorage3D(target - , 1 + GLsizei(bx::log2( (int32_t)_dim) ) + , 1 + GLsizei(bx::ceilLog2( (int32_t)_dim) ) , internalFmt , _dim , _dim @@ -1979,7 +1986,7 @@ namespace bgfx { namespace gl { return true; } - BX_FALLTHROUGH; + [[fallthrough]]; case TextureFormat::RGBA32F: if (_writeOnly) @@ -2265,6 +2272,8 @@ namespace bgfx { namespace gl ErrorState::Enum errorState = ErrorState::Default; + initLazyEnabledVertexAttributes(); + if (_init.debug || _init.profile) { @@ -2910,7 +2919,7 @@ namespace bgfx { namespace gl : 0 ; - g_caps.limits.maxTextureSize = uint16_t(glGet(GL_MAX_TEXTURE_SIZE) ); + g_caps.limits.maxTextureSize = uint32_t(glGet(GL_MAX_TEXTURE_SIZE) ); g_caps.limits.maxTextureLayers = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 30) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) || s_extension[Extension::EXT_texture_array].m_supported ? uint16_t(bx::max(glGet(GL_MAX_ARRAY_TEXTURE_LAYERS), 1) ) : 1; g_caps.limits.maxComputeBindings = computeSupport ? BGFX_MAX_COMPUTE_BINDINGS : 0; g_caps.limits.maxVertexStreams = BGFX_CONFIG_MAX_VERTEX_STREAMS; @@ -2947,6 +2956,7 @@ namespace bgfx { namespace gl if (m_vaoSupport) { GL_CHECK(glGenVertexArrays(1, &m_vao) ); + GL_CHECK(glBindVertexArray(m_vao) ); } m_samplerObjectSupport = false @@ -3050,7 +3060,8 @@ namespace bgfx { namespace gl } #if BGFX_CONFIG_RENDERER_OPENGLES && (BGFX_CONFIG_RENDERER_OPENGLES < 30) - if (!m_maxMsaa && s_extension[Extension::IMG_multisampled_render_to_texture].m_supported) { + if (!m_maxMsaa && s_extension[Extension::IMG_multisampled_render_to_texture].m_supported) + { GL_CHECK(glGetIntegerv(GL_MAX_SAMPLES_IMG, &m_maxMsaa) ); } #endif // BGFX_CONFIG_RENDERER_OPENGLES < 30 @@ -3659,13 +3670,9 @@ namespace bgfx { namespace gl void submitBlit(BlitState& _bs, uint16_t _view); void submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) override; + void blitSetup(TextVideoMemBlitter& _blitter) override { - if (0 != m_vao) - { - GL_CHECK(glBindVertexArray(m_vao) ); - } - uint32_t width = m_resolution.width; uint32_t height = m_resolution.height; @@ -3842,6 +3849,13 @@ namespace bgfx { namespace gl } } + if (0 != m_vao) + { + GL_CHECK(glDeleteVertexArrays(1, &m_vao) ); + GL_CHECK(glGenVertexArrays(1, &m_vao) ); + GL_CHECK(glBindVertexArray(m_vao) ); + } + if (m_srgbWriteControlSupport) { if (0 == m_currentFbo) @@ -4543,10 +4557,9 @@ namespace bgfx { namespace gl } else { - const GLuint defaultVao = m_vao; - if (0 != defaultVao) + if (0 != m_vao) { - GL_CHECK(glBindVertexArray(defaultVao) ); + GL_CHECK(glBindVertexArray(m_vao) ); } GL_CHECK(glDisable(GL_SCISSOR_TEST) ); @@ -6534,6 +6547,7 @@ namespace bgfx { namespace gl || usesVertexID || usesUint || usesTexelFetch + || usesGpuShader4 || usesGpuShader5 || usesInterpQ ? 130 @@ -6835,9 +6849,22 @@ namespace bgfx { namespace gl char* temp = (char*)alloca(tempLen); bx::StaticMemoryBlockWriter writer(temp, tempLen); + int32_t verLen = 0; + if (s_renderGL->m_gles3) + { + const char* str = "#version 310 es\n"; + verLen = bx::strLen(str); + bx::write(&writer, &err, str); + } + else + { + const char* str = "#version 430\n"; + verLen = bx::strLen(str); + bx::write(&writer, &err, str); + } + bx::write(&writer - , "#version 430\n" - "#define texture2DLod textureLod\n" + , "#define texture2DLod textureLod\n" "#define texture2DLodOffset textureLodOffset\n" "#define texture2DArrayLod textureLod\n" "#define texture2DArrayLodOffset textureLodOffset\n" @@ -6849,7 +6876,6 @@ namespace bgfx { namespace gl , &err ); - int32_t verLen = bx::strLen("#version 430\n"); bx::write(&writer, code.getPtr()+verLen, codeLen-verLen, &err); bx::write(&writer, '\0', &err); @@ -7096,7 +7122,9 @@ namespace bgfx { namespace gl { attachment = GL_DEPTH_ATTACHMENT; } - } else { + } + else + { attachment = GL_COLOR_ATTACHMENT0 + colorIdx; ++colorIdx; } @@ -7126,7 +7154,7 @@ namespace bgfx { namespace gl void FrameBufferGL::create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _format, TextureFormat::Enum _depthFormat) { BX_UNUSED(_format, _depthFormat); - m_swapChain = s_renderGL->m_glctx.createSwapChain(_nwh); + m_swapChain = s_renderGL->m_glctx.createSwapChain(_nwh, _width, _height); m_width = _width; m_height = _height; m_numTh = 0; @@ -7444,19 +7472,9 @@ namespace bgfx { namespace gl BGFX_GL_PROFILER_BEGIN_LITERAL("rendererSubmit", kColorView); - if (1 < m_numWindows - && m_vaoSupport) - { - m_vaoSupport = false; - GL_CHECK(glBindVertexArray(0) ); - GL_CHECK(glDeleteVertexArrays(1, &m_vao) ); - m_vao = 0; - } - - const GLuint defaultVao = m_vao; - if (0 != defaultVao) + if (0 != m_vao) { - GL_CHECK(glBindVertexArray(defaultVao) ); + GL_CHECK(glBindVertexArray(m_vao) ); } GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_backBufferFbo) ); @@ -7722,7 +7740,7 @@ namespace bgfx { namespace gl GL_CHECK(glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, vb.m_id) ); } - uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect + uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : compute.m_numIndirect ; @@ -8394,7 +8412,7 @@ namespace bgfx { namespace gl : GL_UNSIGNED_INT ; - numDrawIndirect = UINT16_MAX == draw.m_numIndirect + numDrawIndirect = UINT32_MAX == draw.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : draw.m_numIndirect ; @@ -8421,7 +8439,7 @@ namespace bgfx { namespace gl } else { - numDrawIndirect = UINT16_MAX == draw.m_numIndirect + numDrawIndirect = UINT32_MAX == draw.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : draw.m_numIndirect ; @@ -8544,11 +8562,6 @@ namespace bgfx { namespace gl blitMsaaFbo(); - if (m_vaoSupport) - { - GL_CHECK(glBindVertexArray(m_vao) ); - } - if (0 < _render->m_numRenderItems) { if (0 != (m_resolution.reset & BGFX_RESET_FLUSH_AFTER_RENDER) ) @@ -8698,7 +8711,6 @@ namespace bgfx { namespace gl } tvm.printf(10, pos++, 0x8b, " Indices: %7d ", statsNumIndices); -// tvm.printf(10, pos++, 0x8b, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax); tvm.printf(10, pos++, 0x8b, " DVB size: %7d ", _render->m_vboffset); tvm.printf(10, pos++, 0x8b, " DIB size: %7d ", _render->m_iboffset); @@ -8806,6 +8818,11 @@ namespace bgfx { namespace gl BGFX_GL_PROFILER_END(); } + + if (0 != m_vao) + { + GL_CHECK(glBindVertexArray(0) ); + } } } } // namespace bgfx diff --git a/bgfx/src/renderer_gl.h b/bgfx/src/renderer_gl.h index d45769c2..c721bd37 100644 --- a/bgfx/src/renderer_gl.h +++ b/bgfx/src/renderer_gl.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -8,7 +8,6 @@ #define BGFX_USE_EGL ( (BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES) && (0 \ || BX_PLATFORM_ANDROID \ - || BX_PLATFORM_BSD \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NX \ || BX_PLATFORM_RPI \ @@ -23,7 +22,6 @@ ) ) #define BGFX_USE_GL_DYNAMIC_LIB (0 \ - || BX_PLATFORM_BSD \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ ) @@ -62,7 +60,7 @@ # if BGFX_CONFIG_RENDERER_OPENGL >= 31 # include # else -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD +# if BX_PLATFORM_LINUX # define GL_PROTOTYPES # define GL_GLEXT_LEGACY # include diff --git a/bgfx/src/renderer_gnm.cpp b/bgfx/src/renderer_gnm.cpp index 640dfd70..168f6fd0 100644 --- a/bgfx/src/renderer_gnm.cpp +++ b/bgfx/src/renderer_gnm.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/renderer_mtl.h b/bgfx/src/renderer_mtl.h index e22875a5..c04a9941 100644 --- a/bgfx/src/renderer_mtl.h +++ b/bgfx/src/renderer_mtl.h @@ -14,10 +14,14 @@ #import #import -#if BX_PLATFORM_IOS +#if BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS # import #endif // BX_PLATFORM_* +#if BX_PLATFORM_VISIONOS +#import +#endif + #define BGFX_MTL_PROFILER_BEGIN(_view, _abgr) \ BX_MACRO_BLOCK_BEGIN \ BGFX_PROFILER_BEGIN(s_viewName[view], _abgr); \ @@ -38,7 +42,7 @@ namespace bgfx { namespace mtl //runtime os check inline bool iOSVersionEqualOrGreater(const char* _version) { -#if BX_PLATFORM_IOS +#if BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS return ([[[UIDevice currentDevice] systemVersion] compare:@(_version) options:NSNumericSearch] != NSOrderedAscending); #else BX_UNUSED(_version); @@ -386,19 +390,23 @@ namespace bgfx { namespace mtl bool supportsTextureSampleCount(int sampleCount) { - if (BX_ENABLED(BX_PLATFORM_IOS) && !iOSVersionEqualOrGreater("9.0.0") ) + if (BX_ENABLED(BX_PLATFORM_IOS) && !iOSVersionEqualOrGreater("9.0.0")) + { return sampleCount == 1 || sampleCount == 2 || sampleCount == 4; + } else + { return [m_obj supportsTextureSampleCount:sampleCount]; + } } bool depth24Stencil8PixelFormatSupported() { -#if BX_PLATFORM_IOS +#if BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS return false; #else return m_obj.depth24Stencil8PixelFormatSupported; -#endif // BX_PLATFORM_IOS +#endif // BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS } MTL_CLASS_END @@ -431,6 +439,11 @@ namespace bgfx { namespace mtl [m_obj setBlendColorRed:_red green:_green blue:_blue alpha:_alpha]; } + void setVertexAmplificationCount(NSUInteger count, MTLVertexAmplificationViewMapping* viewMappings) + { + [m_obj setVertexAmplificationCount:count viewMappings:viewMappings]; + } + void setCullMode(MTLCullMode _cullMode) { [m_obj setCullMode:_cullMode]; @@ -476,6 +489,11 @@ namespace bgfx { namespace mtl [m_obj setViewport:_viewport]; } + void setViewports(MTLViewport _viewport[], NSInteger count) + { + [m_obj setViewports:_viewport count:count]; + } + void setVisibilityResultMode(MTLVisibilityResultMode _mode, NSUInteger _offset) { [m_obj setVisibilityResultMode:_mode offset:_offset]; @@ -1033,6 +1051,12 @@ namespace bgfx { namespace mtl { SwapChainMtl() : m_metalLayer(nil) +#if BX_PLATFORM_VISIONOS + , m_layerRenderer(NULL) + , m_layerRendererDrawable(NULL) + , m_frame(NULL) + , m_useLayerRenderer(true) +#endif , m_drawable(nil) , m_drawableTexture(nil) , m_backBufferColorMsaa() @@ -1050,7 +1074,15 @@ namespace bgfx { namespace mtl id currentDrawableTexture(); CAMetalLayer* m_metalLayer; +#if BX_PLATFORM_VISIONOS + cp_layer_renderer_t m_layerRenderer; + cp_drawable_t m_layerRendererDrawable; + cp_layer_renderer_configuration_t m_layerRendererConfiguration; + cp_frame_t m_frame; + bool m_useLayerRenderer; +#endif id m_drawable; + id m_drawableTexture; Texture m_backBufferColorMsaa; Texture m_backBufferDepth; diff --git a/bgfx/src/renderer_mtl.mm b/bgfx/src/renderer_mtl.mm index c9c6b42f..33280b58 100644 --- a/bgfx/src/renderer_mtl.mm +++ b/bgfx/src/renderer_mtl.mm @@ -9,6 +9,7 @@ #include "renderer_mtl.h" #include "renderer.h" +#include #if BX_PLATFORM_OSX # include @@ -46,7 +47,7 @@ inline void setViewType(ViewId _view, const bx::StringView _str) { MTLPrimitiveTypeLineStrip, 2, 1, 1 }, { MTLPrimitiveTypePoint, 1, 1, 0 }, }; - BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo) ); + static_assert(Topology::Count == BX_COUNTOF(s_primInfo) ); static const char* s_attribName[] = { @@ -69,7 +70,7 @@ inline void setViewType(ViewId _view, const bx::StringView _str) "a_texcoord6", "a_texcoord7", }; - BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attribName) ); + static_assert(Attrib::Count == BX_COUNTOF(s_attribName) ); static const char* s_instanceDataName[] = { @@ -79,7 +80,7 @@ inline void setViewType(ViewId _view, const bx::StringView _str) "i_data3", "i_data4", }; - BX_STATIC_ASSERT(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) ); + static_assert(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) ); static const MTLVertexFormat s_attribType[][4][2] = //type, count, normalized { @@ -124,7 +125,7 @@ inline void setViewType(ViewId _view, const bx::StringView _str) { MTLVertexFormatFloat4, MTLVertexFormatFloat4 }, }, }; - BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) ); + static_assert(AttribType::Count == BX_COUNTOF(s_attribType) ); static const MTLCullMode s_cullMode[] = { @@ -216,6 +217,8 @@ inline void setViewType(ViewId _view, const bx::StringView _str) bool m_autoGetMipmap; }; + BX_PRAGMA_DIAGNOSTIC_PUSH(); + BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunguarded-availability-new"); static TextureFormatInfo s_textureFormat[] = { #define $0 MTLTextureSwizzleZero @@ -244,7 +247,7 @@ inline void setViewType(ViewId _view, const bx::StringView _str) { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ATC { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ATCE { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ATCI -#if BX_PLATFORM_IOS && !TARGET_OS_MACCATALYST +#if (BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS) && !TARGET_OS_MACCATALYST { MTLPixelFormatASTC_4x4_LDR, MTLPixelFormatASTC_4x4_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC4x4 { MTLPixelFormatASTC_5x4_LDR, MTLPixelFormatASTC_5x4_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC5x4 { MTLPixelFormatASTC_5x5_LDR, MTLPixelFormatASTC_5x5_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC5x5 @@ -274,7 +277,7 @@ inline void setViewType(ViewId _view, const bx::StringView _str) { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC10x10 { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC12x10 { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC12x12 -#endif // BX_PLATFORM_IOS && !TARGET_OS_MACCATALYST +#endif // (BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS) && !TARGET_OS_MACCATALYST { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // Unknown { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // R1 { MTLPixelFormatA8Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // A8 @@ -329,7 +332,7 @@ inline void setViewType(ViewId _view, const bx::StringView _str) { MTLPixelFormatRGB10A2Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RGB10A2 { MTLPixelFormatRG11B10Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RG11B10F { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // UnknownDepth - { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D16 + { MTLPixelFormatDepth16Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D16 { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D24 { MTLPixelFormat(255/*Depth24Unorm_Stencil8*/), MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D24S8 { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D32 @@ -344,7 +347,8 @@ inline void setViewType(ViewId _view, const bx::StringView _str) #undef $B #undef $A }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); + BX_PRAGMA_DIAGNOSTIC_POP(); + static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); int32_t s_msaa[] = { @@ -416,14 +420,56 @@ static uint32_t getEntryProperty(io_registry_entry_t _entry, CFStringRef _proper } #endif // BX_PLATFORM_OSX - static const char* s_accessNames[] = { "Access::Read", "Access::Write", "Access::ReadWrite", }; +static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames count"); -BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames count"); +#ifndef __IPHONE_OS_VERSION_MAX_ALLOWED +# define __IPHONE_OS_VERSION_MAX_ALLOWED 0 +#endif +#ifndef __MAC_OS_X_VERSION_MAX_ALLOWED +# define __MAC_OS_X_VERSION_MAX_ALLOWED 0 +#endif +#ifndef __VISION_OS_VERSION_MAX_ALLOWED +# define __VISION_OS_VERSION_MAX_ALLOWED 0 +#endif + +#ifndef BX_XCODE_15 +# define BX_XCODE_15 (0 \ + || (__MAC_OS_X_VERSION_MAX_ALLOWED >= 140000) \ + || (__IPHONE_OS_VERSION_MAX_ALLOWED >= 170000) \ + ) +#endif // BX_XCODE_15 + +#ifndef BX_XCODE_14 +# define BX_XCODE_14 (0 \ + || (__MAC_OS_X_VERSION_MAX_ALLOWED >= 130000) \ + || (__IPHONE_OS_VERSION_MAX_ALLOWED >= 160000) \ + ) +#endif // BX_XCODE_14 + +#ifndef BX_XCODE_13 +# define BX_XCODE_13 (0 \ + || (__MAC_OS_X_VERSION_MAX_ALLOWED >= 120000) \ + || (__IPHONE_OS_VERSION_MAX_ALLOWED >= 150000) \ + ) +#endif // BX_XCODE_13 + +#ifndef BX_XCODE_12 +# define BX_XCODE_12 (0 \ + || (__MAC_OS_X_VERSION_MAX_ALLOWED >= 110000) \ + || (__IPHONE_OS_VERSION_MAX_ALLOWED >= 140000) \ + ) +#endif // BX_XCODE_12 + +#if __VISION_OS_VERSION_MAX_ALLOWED >= 10000 +# define VISION_OS_MINIMUM visionOS 1.0, +#else +# define VISION_OS_MINIMUM +#endif #define SHADER_FUNCTION_NAME "xlatMtlMain" #define SHADER_UNIFORM_NAME "_mtl_u" @@ -452,6 +498,14 @@ bool init(const Init& _init) BX_UNUSED(_init); BX_TRACE("Init."); +#define CHECK_FEATURE_AVAILABLE(feature, ...) if (@available(__VA_ARGS__)) { feature = true; } else { feature = false; } + + CHECK_FEATURE_AVAILABLE(m_usesMTLBindings, macOS 13.0, iOS 16.0, tvOS 16.0, macCatalyst 16.0, VISION_OS_MINIMUM *); + CHECK_FEATURE_AVAILABLE(m_hasCPUCacheModesAndStorageModes, iOS 9.0, macOS 10.11, macCatalyst 13.1, tvOS 9.0, VISION_OS_MINIMUM *); + CHECK_FEATURE_AVAILABLE(m_hasSynchronizeResource, macOS 10.11, macCatalyst 13.0, *); + CHECK_FEATURE_AVAILABLE(m_hasVSync, macOS 10.13, macCatalyst 13.1, *); + CHECK_FEATURE_AVAILABLE(m_hasMaximumDrawableCount, iOS 11.2, macOS 10.13.2, macCatalyst 13.1, tvOS 11.2, VISION_OS_MINIMUM *); + m_fbh.idx = kInvalidHandle; bx::memSet(m_uniforms, 0, sizeof(m_uniforms) ); bx::memSet(&m_resolution, 0, sizeof(m_resolution) ); @@ -479,9 +533,25 @@ bool init(const Init& _init) , TextureFormat::Unknown , TextureFormat::UnknownDepth ); + +#if BX_PLATFORM_VISIONOS + if (m_mainFrameBuffer.m_swapChain->m_useLayerRenderer) + { + m_deviceAnchor = ar_device_anchor_create(); + m_worldTracking = ar_world_tracking_provider_create(ar_world_tracking_configuration_create()); + m_arSession = ar_session_create(); + ar_session_run(m_arSession, ar_data_providers_create_with_data_providers(m_worldTracking, nil)); + } +#endif m_numWindows = 1; +#if BX_PLATFORM_VISIONOS + bool useLayerRenderer = m_mainFrameBuffer.m_swapChain->m_useLayerRenderer; + if ((useLayerRenderer && NULL == m_mainFrameBuffer.m_swapChain->m_layerRenderer) + || (!useLayerRenderer && NULL == m_mainFrameBuffer.m_swapChain->m_metalLayer)) +#else if (NULL == m_mainFrameBuffer.m_swapChain->m_metalLayer) +#endif // BX_PLATFORM_VISIONOS { release(m_device); return false; @@ -545,7 +615,13 @@ bool init(const Init& _init) m_screenshotBlitProgram.create(&m_screenshotBlitProgramVsh, &m_screenshotBlitProgramFsh); reset(m_renderPipelineDescriptor); - m_renderPipelineDescriptor.colorAttachments[0].pixelFormat = m_mainFrameBuffer.m_swapChain->m_metalLayer.pixelFormat; + m_renderPipelineDescriptor.colorAttachments[0].pixelFormat = getSwapChainPixelFormat(m_mainFrameBuffer.m_swapChain); +#if BX_PLATFORM_VISIONOS + if (m_mainFrameBuffer.m_swapChain->m_useLayerRenderer) + { + m_renderPipelineDescriptor.depthAttachmentPixelFormat = cp_layer_renderer_configuration_get_depth_format(m_mainFrameBuffer.m_swapChain->m_layerRendererConfiguration); + } +#endif // BX_PLATFORM_VISIONOS m_renderPipelineDescriptor.vertexFunction = m_screenshotBlitProgram.m_vsh->m_function; m_renderPipelineDescriptor.fragmentFunction = m_screenshotBlitProgram.m_fsh->m_function; m_screenshotBlitRenderPipelineState = m_device.newRenderPipelineStateWithDescriptor(m_renderPipelineDescriptor); @@ -655,38 +731,42 @@ bool init(const Init& _init) // It is decremented by 1 because 1 entry is used for uniforms. g_caps.limits.maxComputeBindings = bx::uint32_min(30, BGFX_MAX_COMPUTE_BINDINGS); - m_hasPixelFormatDepth32Float_Stencil8 = false - || BX_ENABLED(BX_PLATFORM_OSX) - || (BX_ENABLED(BX_PLATFORM_IOS) && iOSVersionEqualOrGreater("9.0.0") ) - ; - - m_hasStoreActionStoreAndMultisampleResolve = false - || (BX_ENABLED(BX_PLATFORM_OSX) && macOSVersionEqualOrGreater(10, 12, 0) ) - || (BX_ENABLED(BX_PLATFORM_IOS) && iOSVersionEqualOrGreater("10.0.0") ) - ; - - m_macOS11Runtime = true - && BX_ENABLED(BX_PLATFORM_OSX) - && macOSVersionEqualOrGreater(10, 11, 0) - ; + CHECK_FEATURE_AVAILABLE(m_hasPixelFormatDepth32Float_Stencil8, iOS 9.0, macOS 10.11, macCatalyst 13.1, tvOS 9.0, VISION_OS_MINIMUM *); + CHECK_FEATURE_AVAILABLE(m_hasStoreActionStoreAndMultisampleResolve, iOS 10.0, macOS 10.12, macCatalyst 13.1, tvOS 10.0, VISION_OS_MINIMUM *); - m_iOS9Runtime = true - && BX_ENABLED(BX_PLATFORM_IOS) - && iOSVersionEqualOrGreater("9.0.0") - ; - - if (BX_ENABLED(BX_PLATFORM_OSX) ) + if (BX_ENABLED(BX_PLATFORM_OSX)) { s_textureFormat[TextureFormat::R8].m_fmtSrgb = MTLPixelFormatInvalid; s_textureFormat[TextureFormat::RG8].m_fmtSrgb = MTLPixelFormatInvalid; } + bool hasPacked16Formats; + CHECK_FEATURE_AVAILABLE(hasPacked16Formats, iOS 8.0, macOS 11.0, macCatalyst 14.0, tvOS 9.0, VISION_OS_MINIMUM *); + if (g_caps.vendorId == BGFX_PCI_ID_AMD) + { + hasPacked16Formats = false; + } + if (!hasPacked16Formats) + { + s_textureFormat[bgfx::TextureFormat::R5G6B5].m_fmt = MTLPixelFormatInvalid; + s_textureFormat[bgfx::TextureFormat::B5G6R5].m_fmt = MTLPixelFormatInvalid; + s_textureFormat[bgfx::TextureFormat::BGRA4].m_fmt = MTLPixelFormatInvalid; + s_textureFormat[bgfx::TextureFormat::RGBA4].m_fmt = MTLPixelFormatInvalid; + } + const MTLReadWriteTextureTier rwTier = [m_device readWriteTextureSupport]; g_caps.supported |= rwTier != MTLReadWriteTextureTierNone ? BGFX_CAPS_IMAGE_RW : 0 ; + bool hasD16Format; + CHECK_FEATURE_AVAILABLE(hasD16Format, iOS 13.0, macOS 10.12, macCatalyst 13.1, tvOS 13.0, VISION_OS_MINIMUM *); + if (!hasD16Format) + { + s_textureFormat[TextureFormat::D16].m_fmt = MTLPixelFormatDepth32Float; + } + for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii) { uint16_t support = 0; @@ -737,7 +817,7 @@ bool init(const Init& _init) g_caps.formats[TextureFormat::RGBA32I] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA); g_caps.formats[TextureFormat::RGBA32U] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA); - if (BX_ENABLED(BX_PLATFORM_IOS) ) + if (BX_ENABLED(BX_PLATFORM_IOS) || BX_ENABLED(BX_PLATFORM_VISIONOS)) { s_textureFormat[TextureFormat::D24S8].m_fmt = MTLPixelFormatDepth32Float_Stencil8; @@ -844,6 +924,16 @@ void shutdown() MTL_RELEASE(m_textureDescriptor); MTL_RELEASE(m_samplerDescriptor); +#if BX_PLATFORM_VISIONOS + if (m_mainFrameBuffer.m_swapChain->m_useLayerRenderer) + { + ar_session_stop(m_arSession); + MTL_RELEASE(m_arSession); + MTL_RELEASE(m_worldTracking); + MTL_RELEASE(m_deviceAnchor); + } +#endif // BX_PLATFORM_VISIONOS + m_mainFrameBuffer.destroy(); for (uint8_t i=0; i < BGFX_CONFIG_MAX_FRAME_LATENCY; ++i) @@ -978,6 +1068,19 @@ void updateTextureEnd() override { } + MTLPixelFormat getSwapChainPixelFormat(SwapChainMtl *swapChain) + { +#if BX_PLATFORM_VISIONOS + if (swapChain->m_useLayerRenderer) + { + cp_layer_renderer_configuration_t layerConfiguration = cp_layer_renderer_get_configuration(swapChain->m_layerRenderer); + return cp_layer_renderer_configuration_get_color_format(layerConfiguration); + } +#endif // BX_PLATFORM_VISIONOS + + return swapChain->m_metalLayer.pixelFormat; + } + void readTexture(TextureHandle _handle, void* _data, uint8_t _mip) override { const TextureMtl& texture = m_textures[_handle.idx]; @@ -1226,6 +1329,35 @@ void blitSetup(TextVideoMemBlitter& _blitter) override BX_UNUSED(_blitter); } +#if BX_PLATFORM_VISIONOS + void calculateViewPorts(MTLViewport (&viewports)[2]) + { + const int viewCount = 2; + for (int i = 0; i < viewCount; i++) + { + cp_view_t view = cp_drawable_get_view(m_mainFrameBuffer.m_swapChain->m_layerRendererDrawable, i); + cp_view_texture_map_t texture_map = cp_view_get_view_texture_map(view); + viewports[i] = cp_view_texture_map_get_viewport(texture_map); + } + } + + void setVertexAmplification(RenderCommandEncoder& _rce) + { + MTLVertexAmplificationViewMapping mapping0; + MTLVertexAmplificationViewMapping mapping1; + + mapping0.renderTargetArrayIndexOffset = 0; + mapping1.renderTargetArrayIndexOffset = 1; + + mapping0.viewportArrayIndexOffset = 1; + mapping1.viewportArrayIndexOffset = 2; + + MTLVertexAmplificationViewMapping mappings[] = { mapping0, mapping1 }; + + _rce.setVertexAmplificationCount(2, mappings); + } +#endif // BX_PLATFORM_VISIONOS + void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) override { const uint32_t numVertices = _numIndices*4/6; @@ -1267,11 +1399,26 @@ void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) override m_renderCommandEncoderFrameBufferHandle = fbh; MTL_RELEASE(renderPassDescriptor); - MTLViewport viewport = { 0.0f, 0.0f, (float)width, (float)height, 0.0f, 1.0f }; - rce.setViewport(viewport); +#if BX_PLATFORM_VISIONOS + if (m_mainFrameBuffer.m_swapChain->m_useLayerRenderer) + { + if (cp_layer_renderer_configuration_get_layout(m_mainFrameBuffer.m_swapChain->m_layerRendererConfiguration) == cp_layer_renderer_layout_layered) + { + MTLViewport viewports[2]; + calculateViewPorts(viewports); + rce.setViewports(viewports, 2); + setVertexAmplification(rce); + } + } + else +#endif // BX_PLATFORM_VISIONOS + { + MTLViewport viewport = { 0.0f, 0.0f, (float)width, (float)height, 0.0f, 1.0f }; + rce.setViewport(viewport); - MTLScissorRect rc = { 0, 0, width, height }; - rce.setScissorRect(rc); + MTLScissorRect rc = { 0, 0, width, height }; + rce.setScissorRect(rc); + } rce.setCullMode(MTLCullModeNone); @@ -1344,6 +1491,19 @@ bool isDeviceRemoved() override return false; } +#if BX_PLATFORM_VISIONOS + void createPoseForTiming(cp_frame_timing_t timing, ar_world_tracking_provider_t world_tracking) + { + cp_time_t presentationTime = cp_frame_timing_get_presentation_time(timing); + CFTimeInterval queryTime = cp_time_to_cf_time_interval(presentationTime); + ar_device_anchor_query_status_t status = ar_world_tracking_provider_query_device_anchor_at_timestamp(world_tracking, queryTime, m_deviceAnchor); + if (status != ar_device_anchor_query_status_success) + { + BX_WARN(false, "Device anchor query failed.") + } + } +#endif // BX_PLATFORM_VISIONOS + void flip() override { if (NULL == m_commandBuffer) @@ -1359,6 +1519,23 @@ void flip() override { MTL_RELEASE(frameBuffer.m_swapChain->m_drawableTexture); +#if BX_PLATFORM_VISIONOS + if (frameBuffer.m_swapChain->m_useLayerRenderer) + { + if (NULL != frameBuffer.m_swapChain->m_layerRendererDrawable) + { + if (m_worldTracking != NULL) + { + auto timingInfo = cp_drawable_get_frame_timing(frameBuffer.m_swapChain->m_layerRendererDrawable); + createPoseForTiming(timingInfo, m_worldTracking); + cp_drawable_set_device_anchor(frameBuffer.m_swapChain->m_layerRendererDrawable, m_deviceAnchor); + } + cp_drawable_encode_present(frameBuffer.m_swapChain->m_layerRendererDrawable, m_commandBuffer); + cp_frame_end_submission(frameBuffer.m_swapChain->m_frame); + } + } + else +#endif // BX_PLATFORM_VISIONOS if (NULL != frameBuffer.m_swapChain->m_drawable) { m_commandBuffer.presentDrawable(frameBuffer.m_swapChain->m_drawable); @@ -1388,8 +1565,7 @@ void updateResolution(const Resolution& _resolution) || m_resolution.height != _resolution.height || (m_resolution.reset&maskFlags) != (_resolution.reset&maskFlags) ) { - MTLPixelFormat prevMetalLayerPixelFormat = m_mainFrameBuffer.m_swapChain->m_metalLayer.pixelFormat; - + MTLPixelFormat prevMetalLayerPixelFormat = getSwapChainPixelFormat(m_mainFrameBuffer.m_swapChain); m_resolution = _resolution; if (m_resolution.reset & BGFX_RESET_INTERNAL_FORCE @@ -1411,12 +1587,13 @@ void updateResolution(const Resolution& _resolution) m_textVideoMem.resize(false, _resolution.width, _resolution.height); m_textVideoMem.clear(); - if (prevMetalLayerPixelFormat != m_mainFrameBuffer.m_swapChain->m_metalLayer.pixelFormat) + + if (prevMetalLayerPixelFormat != getSwapChainPixelFormat(m_mainFrameBuffer.m_swapChain)) { MTL_RELEASE(m_screenshotBlitRenderPipelineState) reset(m_renderPipelineDescriptor); - m_renderPipelineDescriptor.colorAttachments[0].pixelFormat = m_mainFrameBuffer.m_swapChain->m_metalLayer.pixelFormat; + m_renderPipelineDescriptor.colorAttachments[0].pixelFormat = getSwapChainPixelFormat(m_mainFrameBuffer.m_swapChain); m_renderPipelineDescriptor.vertexFunction = m_screenshotBlitProgram.m_vsh->m_function; m_renderPipelineDescriptor.fragmentFunction = m_screenshotBlitProgram.m_fsh->m_function; m_screenshotBlitRenderPipelineState = m_device.newRenderPipelineStateWithDescriptor(m_renderPipelineDescriptor); @@ -1804,9 +1981,30 @@ void setFrameBuffer(RenderPassDescriptor _renderPassDescriptor, FrameBufferHandl : swapChain->currentDrawableTexture() ; } +#if BX_PLATFORM_VISIONOS + if (m_mainFrameBuffer.m_swapChain->m_useLayerRenderer) + { + Texture texture = cp_drawable_get_depth_texture(swapChain->m_layerRendererDrawable, 0); + _renderPassDescriptor.depthAttachment.texture = texture; + _renderPassDescriptor.stencilAttachment.texture = swapChain->m_backBufferStencil; - _renderPassDescriptor.depthAttachment.texture = swapChain->m_backBufferDepth; - _renderPassDescriptor.stencilAttachment.texture = swapChain->m_backBufferStencil; + cp_layer_renderer_configuration_t layerConfiguration = cp_layer_renderer_get_configuration(swapChain->m_layerRenderer); + cp_layer_renderer_layout layout = cp_layer_renderer_configuration_get_layout(layerConfiguration); + if (layout == cp_layer_renderer_layout_layered) + { + _renderPassDescriptor.renderTargetArrayLength = cp_drawable_get_view_count(swapChain->m_layerRendererDrawable); + } + else + { + _renderPassDescriptor.renderTargetArrayLength = 1; + } + } + else +#endif // BX_PLATFORM_VISIONOS + { + _renderPassDescriptor.depthAttachment.texture = swapChain->m_backBufferDepth; + _renderPassDescriptor.stencilAttachment.texture = swapChain->m_backBufferStencil; + } } else { @@ -1929,6 +2127,9 @@ void setDepthStencilState(uint64_t _state, uint64_t _stencil = 0) m_renderCommandEncoder.setStencilReferenceValue(ref); } + BX_PRAGMA_DIAGNOSTIC_PUSH(); + BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunguarded-availability-new"); + BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wincompatible-pointer-types"); void processArguments( PipelineStateMtl* ps , NSArray>* _vertexArgs @@ -1949,7 +2150,7 @@ void processArguments( { BX_TRACE("arg: %s type:%d", utf8String(arg.name), arg.type); - if (arg.used) + if ((!m_usesMTLBindings && [(MTLArgument*)arg isActive]) || (m_usesMTLBindings && arg.used)) { if (arg.type == MTLBindingTypeBuffer) { @@ -2049,7 +2250,7 @@ void processArguments( } else { - ps->m_bindingTypes[arg.index-1] = fragmentBit + ps->m_bindingTypes[arg.index-1] |= fragmentBit ? PipelineStateMtl::BindToFragmentShader : PipelineStateMtl::BindToVertexShader ; @@ -2067,7 +2268,7 @@ void processArguments( } else { - ps->m_bindingTypes[arg.index] = fragmentBit + ps->m_bindingTypes[arg.index] |= fragmentBit ? PipelineStateMtl::BindToFragmentShader : PipelineStateMtl::BindToVertexShader ; @@ -2097,6 +2298,7 @@ void processArguments( } } } + BX_PRAGMA_DIAGNOSTIC_POP(); PipelineStateMtl* getPipelineState( uint64_t _state @@ -2175,8 +2377,17 @@ void processArguments( : 1 ; pd.colorAttachments[0].pixelFormat = swapChain->currentDrawableTexture().pixelFormat; - pd.depthAttachmentPixelFormat = swapChain->m_backBufferDepth.m_obj.pixelFormat; - pd.stencilAttachmentPixelFormat = swapChain->m_backBufferStencil.m_obj.pixelFormat; +#if BX_PLATFORM_VISIONOS + if (m_mainFrameBuffer.m_swapChain->m_useLayerRenderer) + { + pd.depthAttachmentPixelFormat = cp_layer_renderer_configuration_get_depth_format(swapChain->m_layerRendererConfiguration); + } + else +#endif // BX_PLATFORM_VISIONOS + { + pd.depthAttachmentPixelFormat = swapChain->m_backBufferDepth.m_obj.pixelFormat; + } + pd.stencilAttachmentPixelFormat = swapChain->m_backBufferStencil.m_obj.pixelFormat; } else { @@ -2275,6 +2486,16 @@ void processArguments( pd.vertexFunction = program.m_vsh->m_function; pd.fragmentFunction = program.m_fsh != NULL ? program.m_fsh->m_function : NULL; +#if BX_PLATFORM_VISIONOS + if (m_mainFrameBuffer.m_swapChain->m_useLayerRenderer) + { + if (cp_layer_renderer_configuration_get_layout(m_mainFrameBuffer.m_swapChain->m_layerRendererConfiguration) == cp_layer_renderer_layout_layered) + { + auto properties = cp_layer_renderer_get_properties(m_mainFrameBuffer.m_swapChain->m_layerRenderer); + pd.maxVertexAmplificationCount = cp_layer_renderer_properties_get_view_count(properties); + } + } +#endif VertexDescriptor vertexDesc = m_vertexDescriptor; reset(vertexDesc); @@ -2313,7 +2534,8 @@ void processArguments( } } - if (streamUsed) { + if (streamUsed) + { vertexDesc.layouts[stream+1].stride = layout.getStride(); vertexDesc.layouts[stream+1].stepFunction = MTLVertexStepFunctionPerVertex; } @@ -2354,7 +2576,18 @@ void processArguments( if (NULL != reflection) { - processArguments(pso, reflection.vertexBindings, reflection.fragmentBindings); + BX_PRAGMA_DIAGNOSTIC_PUSH(); + BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunguarded-availability-new"); + BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wincompatible-pointer-types"); + if (m_usesMTLBindings) + { + processArguments(pso, reflection.vertexBindings, reflection.fragmentBindings); + } + else + { + processArguments(pso, reflection.vertexArguments, reflection.fragmentArguments); + } + BX_PRAGMA_DIAGNOSTIC_POP(); } } @@ -2401,7 +2634,19 @@ void processArguments( , MTLPipelineOptionBufferTypeInfo , &reflection ); - processArguments(pso, reflection.bindings, NULL); + + BX_PRAGMA_DIAGNOSTIC_PUSH(); + BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunguarded-availability-new"); + BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wincompatible-pointer-types"); + if (m_usesMTLBindings) + { + processArguments(pso, reflection.bindings, NULL); + } + else + { + processArguments(pso, reflection.arguments, NULL); + } + BX_PRAGMA_DIAGNOSTIC_POP(); for (uint32_t ii = 0; ii < 3; ++ii) { @@ -2498,10 +2743,13 @@ void endEncoding() TimerQueryMtl m_gpuTimer; CommandQueueMtl m_cmd; - bool m_iOS9Runtime; - bool m_macOS11Runtime; bool m_hasPixelFormatDepth32Float_Stencil8; bool m_hasStoreActionStoreAndMultisampleResolve; + bool m_hasCPUCacheModesAndStorageModes; + bool m_hasSynchronizeResource; + bool m_usesMTLBindings; + bool m_hasVSync; + bool m_hasMaximumDrawableCount; Buffer m_uniformBuffer; Buffer m_uniformBuffers[BGFX_CONFIG_MAX_FRAME_LATENCY]; @@ -2546,6 +2794,11 @@ void endEncoding() Resolution m_resolution; void* m_capture; uint32_t m_captureSize; +#if BX_PLATFORM_VISIONOS + ar_session_t m_arSession; + ar_world_tracking_provider_t m_worldTracking; + ar_device_anchor_t m_deviceAnchor; +#endif // descriptors RenderPipelineDescriptor m_renderPipelineDescriptor; @@ -2926,8 +3179,7 @@ void writeString(bx::WriterI* _writer, const char* _str) desc.arrayLength = ti.numLayers; desc.swizzle = tfi.m_mapping; - if (s_renderMtl->m_iOS9Runtime - || s_renderMtl->m_macOS11Runtime) + if (s_renderMtl->m_hasCPUCacheModesAndStorageModes) { desc.cpuCacheMode = MTLCPUCacheModeDefaultCache; @@ -2935,7 +3187,7 @@ void writeString(bx::WriterI* _writer, const char* _str) || writeOnly || bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) ? 2 /* MTLStorageModePrivate */ - : (BX_ENABLED(BX_PLATFORM_IOS) + : (BX_ENABLED(BX_PLATFORM_IOS) || BX_ENABLED(BX_PLATFORM_VISIONOS) ? 0 /* MTLStorageModeShared */ : 1 /* MTLStorageModeManaged */ ) ); @@ -2959,8 +3211,7 @@ void writeString(bx::WriterI* _writer, const char* _str) desc.textureType = MTLTextureType2DMultisample; desc.sampleCount = sampleCount; - if (s_renderMtl->m_iOS9Runtime - || s_renderMtl->m_macOS11Runtime) + if (s_renderMtl->m_hasCPUCacheModesAndStorageModes) { desc.storageMode = (MTLStorageMode)(2 /* MTLStorageModePrivate */); } @@ -3126,11 +3377,10 @@ void writeString(bx::WriterI* _writer, const char* _str) desc.sampleCount = 1; desc.arrayLength = 1; - if (s_renderMtl->m_iOS9Runtime - || s_renderMtl->m_macOS11Runtime) + if (s_renderMtl->m_hasCPUCacheModesAndStorageModes) { desc.cpuCacheMode = MTLCPUCacheModeDefaultCache; - desc.storageMode = BX_ENABLED(BX_PLATFORM_IOS) + desc.storageMode = BX_ENABLED(BX_PLATFORM_IOS) || BX_ENABLED(BX_PLATFORM_VISIONOS) ? (MTLStorageMode)0 // MTLStorageModeShared : (MTLStorageMode)1 // MTLStorageModeManaged ; @@ -3218,8 +3468,13 @@ void writeString(bx::WriterI* _writer, const char* _str) SwapChainMtl::~SwapChainMtl() { +#if BX_PLATFORM_VISIONOS + MTL_RELEASE(m_layerRenderer); +#else MTL_RELEASE(m_metalLayer); MTL_RELEASE(m_drawable); +#endif // BX_PLATFORM_VISIONOS + MTL_RELEASE(m_drawableTexture); MTL_RELEASE(m_backBufferDepth); @@ -3234,108 +3489,135 @@ void writeString(bx::WriterI* _writer, const char* _str) void SwapChainMtl::init(void* _nwh) { - if (m_metalLayer) +#if BX_PLATFORM_VISIONOS + NSObject* nvh = (NSObject*)_nwh; + m_useLayerRenderer = ![nvh isKindOfClass:[CAMetalLayer class]]; + if (m_useLayerRenderer) { - release(m_metalLayer); + cp_layer_renderer_t layerRenderer = (cp_layer_renderer_t)_nwh; + m_layerRenderer = layerRenderer; + m_layerRendererConfiguration = cp_layer_renderer_get_configuration(m_layerRenderer); + + if (cp_layer_renderer_configuration_get_layout(m_layerRendererConfiguration) == cp_layer_renderer_layout_dedicated) + { + BX_WARN(false, "Dedicated layer renderer layout is not supported."); + } + + retain(m_layerRendererConfiguration); + retain(m_layerRenderer); } - if (NULL != NSClassFromString(@"MTKView") ) + else +#endif // BX_PLATFORM_VISIONOS { - MTKView *view = (MTKView *)_nwh; - if (NULL != view && [view isKindOfClass:NSClassFromString(@"MTKView")]) + if (m_metalLayer) { - m_metalLayer = (CAMetalLayer *)view.layer; + release(m_metalLayer); } - } - if (NULL != NSClassFromString(@"CAMetalLayer") ) - { - if (NULL == m_metalLayer) -#if BX_PLATFORM_IOS +#if !BX_PLATFORM_VISIONOS + if (NULL != NSClassFromString(@"MTKView") ) { - CAMetalLayer* metalLayer = (CAMetalLayer*)_nwh; - if (NULL == metalLayer - || ![metalLayer isKindOfClass:NSClassFromString(@"CAMetalLayer")]) + MTKView *view = (MTKView *)_nwh; + + if (NULL != view + && [view isKindOfClass:NSClassFromString(@"MTKView")]) { - BX_WARN(false, "Unable to create Metal device. Please set platform data window to a CAMetalLayer"); - return; + m_metalLayer = (CAMetalLayer *)view.layer; } - - m_metalLayer = metalLayer; } -#elif BX_PLATFORM_OSX +#endif + + if (NULL != NSClassFromString(@"CAMetalLayer") ) { - NSObject* nvh = (NSObject*)_nwh; - if ([nvh isKindOfClass:[CAMetalLayer class]]) + if (NULL == m_metalLayer) +# if BX_PLATFORM_IOS || BX_PLATFORM_VISIONOS { CAMetalLayer* metalLayer = (CAMetalLayer*)_nwh; + if (NULL == metalLayer + || ![metalLayer isKindOfClass:NSClassFromString(@"CAMetalLayer")]) + { + BX_WARN(false, "Unable to create Metal device. Please set platform data window to a CAMetalLayer"); + return; + } + m_metalLayer = metalLayer; } - else +# elif BX_PLATFORM_OSX { - NSView *contentView; - - if ([nvh isKindOfClass:[NSView class]]) - { - contentView = (NSView*)nvh; - } - else if ([nvh isKindOfClass:[NSWindow class]]) + NSObject* nvh = (NSObject*)_nwh; + if ([nvh isKindOfClass:[CAMetalLayer class]]) { - NSWindow* nsWindow = (NSWindow*)nvh; - contentView = [nsWindow contentView]; + CAMetalLayer* metalLayer = (CAMetalLayer*)_nwh; + m_metalLayer = metalLayer; } else { - BX_WARN(0, "Unable to create Metal device. Please set platform data window to an NSWindow, NSView, or CAMetalLayer"); - return; - } + NSView *contentView; - void (^setLayer)(void) = ^{ - CALayer* layer = contentView.layer; - if(NULL != layer && [layer isKindOfClass:NSClassFromString(@"CAMetalLayer")]) + if ([nvh isKindOfClass:[NSView class]]) + { + contentView = (NSView*)nvh; + } + else if ([nvh isKindOfClass:[NSWindow class]]) { - m_metalLayer = (CAMetalLayer*)layer; + NSWindow* nsWindow = (NSWindow*)nvh; + contentView = [nsWindow contentView]; } else { - [contentView setWantsLayer:YES]; - m_metalLayer = [CAMetalLayer layer]; - [contentView setLayer:m_metalLayer]; + BX_WARN(0, "Unable to create Metal device. Please set platform data window to an NSWindow, NSView, or CAMetalLayer"); + return; } - }; - if ([NSThread isMainThread]) - { - setLayer(); - } - else - { - bx::Semaphore semaphore; - bx::Semaphore* psemaphore = &semaphore; - - CFRunLoopPerformBlock([[NSRunLoop mainRunLoop] getCFRunLoop], - kCFRunLoopCommonModes, - ^{ - setLayer(); - psemaphore->post(); - }); - semaphore.wait(); + void (^setLayer)(void) = ^{ + CALayer* layer = contentView.layer; + if(NULL != layer && [layer isKindOfClass:NSClassFromString(@"CAMetalLayer")]) + { + m_metalLayer = (CAMetalLayer*)layer; + } + else + { + [contentView setWantsLayer:YES]; + m_metalLayer = [CAMetalLayer layer]; + [contentView setLayer:m_metalLayer]; + } + }; + + if ([NSThread isMainThread]) + { + setLayer(); + } + else + { + bx::Semaphore semaphore; + bx::Semaphore* psemaphore = &semaphore; + + CFRunLoopPerformBlock([[NSRunLoop mainRunLoop] getCFRunLoop], + kCFRunLoopCommonModes, + ^{ + setLayer(); + psemaphore->post(); + }); + semaphore.wait(); + } } } +# endif // BX_PLATFORM_* } -#endif // BX_PLATFORM_* - } - if (NULL == m_metalLayer) - { - BX_WARN(NULL != s_renderMtl->m_device, "Unable to create Metal device."); - return; + if (NULL == m_metalLayer) + { + BX_WARN(NULL != s_renderMtl->m_device, "Unable to create Metal device."); + return; + } + + m_metalLayer.device = s_renderMtl->m_device; + m_metalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm; + m_metalLayer.magnificationFilter = kCAFilterNearest; + retain(m_metalLayer); } - m_metalLayer.device = s_renderMtl->m_device; - m_metalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm; - m_metalLayer.magnificationFilter = kCAFilterNearest; m_nwh = _nwh; - retain(m_metalLayer); } void SwapChainMtl::resize(FrameBufferMtl &_frameBuffer, uint32_t _width, uint32_t _height, uint32_t _flags, uint32_t _maximumDrawableCount) @@ -3344,12 +3626,12 @@ void writeString(bx::WriterI* _writer, const char* _str) #if BX_PLATFORM_OSX # if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 - if (@available(macOS 10.13, *) ) + if (s_renderMtl->m_hasVSync) { m_metalLayer.displaySyncEnabled = 0 != (_flags&BGFX_RESET_VSYNC); } - if (@available(macOS 10.13.2, *) ) + if (s_renderMtl->m_hasMaximumDrawableCount) { m_metalLayer.maximumDrawableCount = bx::clamp( _maximumDrawableCount != 0 ? _maximumDrawableCount : BGFX_CONFIG_MAX_FRAME_LATENCY @@ -3360,11 +3642,16 @@ void writeString(bx::WriterI* _writer, const char* _str) # endif // __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 #endif // BX_PLATFORM_OSX - m_metalLayer.drawableSize = CGSizeMake(_width, _height); - m_metalLayer.pixelFormat = (_flags & BGFX_RESET_SRGB_BACKBUFFER) +#if BX_PLATFORM_VISIONOS + if (!m_useLayerRenderer) +#endif // BX_PLATFORM_VISIONOS + { + m_metalLayer.drawableSize = CGSizeMake(_width, _height); + m_metalLayer.pixelFormat = (_flags & BGFX_RESET_SRGB_BACKBUFFER) ? MTLPixelFormatBGRA8Unorm_sRGB : MTLPixelFormatBGRA8Unorm ; + } TextureDescriptor desc = s_renderMtl->m_textureDescriptor; @@ -3386,8 +3673,7 @@ void writeString(bx::WriterI* _writer, const char* _str) desc.sampleCount = sampleCount; desc.arrayLength = 1; - if (s_renderMtl->m_iOS9Runtime - || s_renderMtl->m_macOS11Runtime) + if (s_renderMtl->m_hasCPUCacheModesAndStorageModes) { desc.cpuCacheMode = MTLCPUCacheModeDefaultCache; desc.storageMode = MTLStorageModePrivate; @@ -3399,8 +3685,19 @@ void writeString(bx::WriterI* _writer, const char* _str) release(m_backBufferDepth); } - m_backBufferDepth = s_renderMtl->m_device.newTextureWithDescriptor(desc); - +#if BX_PLATFORM_VISIONOS + if (m_useLayerRenderer) + { + if (m_layerRendererDrawable) + { + m_backBufferDepth = cp_drawable_get_depth_texture(m_layerRendererDrawable, 0); + } + } + else +#endif // BX_PLATFORM_VISIONOS + { + m_backBufferDepth = s_renderMtl->m_device.newTextureWithDescriptor(desc); + } if (NULL != m_backBufferStencil) { release(m_backBufferStencil); @@ -3425,14 +3722,28 @@ void writeString(bx::WriterI* _writer, const char* _str) if (sampleCount > 1) { - desc.pixelFormat = m_metalLayer.pixelFormat; +#if BX_PLATFORM_VISIONOS + if (m_useLayerRenderer) + { + desc.pixelFormat = MTLPixelFormatBGRA8Unorm_sRGB; + } + else +#endif // BX_PLATFORM_VISIONOS + { + desc.pixelFormat = m_metalLayer.pixelFormat; + } m_backBufferColorMsaa = s_renderMtl->m_device.newTextureWithDescriptor(desc); } bx::HashMurmur2A murmur; murmur.begin(); murmur.add(1); - murmur.add( (uint32_t)m_metalLayer.pixelFormat); +#if BX_PLATFORM_VISIONOS + if (!m_useLayerRenderer) +#endif // !BX_PLATFORM_VISIONOS + { + murmur.add( (uint32_t)m_metalLayer.pixelFormat); + } murmur.add( (uint32_t)m_backBufferDepth.pixelFormat() ); murmur.add( (uint32_t)m_backBufferStencil.pixelFormat() ); murmur.add( (uint32_t)sampleCount); @@ -3443,30 +3754,74 @@ void writeString(bx::WriterI* _writer, const char* _str) { if (NULL == m_drawableTexture) { - m_drawable = m_metalLayer.nextDrawable; +#if BX_PLATFORM_VISIONOS + if (m_useLayerRenderer) + { + m_frame = cp_layer_renderer_query_next_frame(m_layerRenderer); + if (m_frame) + { + cp_frame_timing_t timing = cp_frame_predict_timing(m_frame); + if (timing == nullptr) { return nullptr; } + + cp_frame_start_update(m_frame); + + cp_frame_end_update(m_frame); + + cp_time_wait_until(cp_frame_timing_get_optimal_input_time(timing)); + cp_frame_start_submission(m_frame); + m_layerRendererDrawable = cp_frame_query_drawable(m_frame); + } + } + else +#endif // BX_PLATFORM_VISIONOS + { + m_drawable = m_metalLayer.nextDrawable; + } + +#if BX_PLATFORM_VISIONOS + if (m_useLayerRenderer) + { + if (m_layerRendererDrawable != NULL) + { + m_drawableTexture = cp_drawable_get_color_texture(m_layerRendererDrawable, 0); + retain(m_drawableTexture); + } + } + else +#endif // BX_PLATFORM_VISIONOS if (m_drawable != NULL) { m_drawableTexture = m_drawable.texture; + retain(m_drawable); // keep alive to be usable at 'flip' retain(m_drawableTexture); - retain(m_drawable); // keep alive to be useable at 'flip' } else { TextureDescriptor desc = s_renderMtl->m_textureDescriptor; desc.textureType = MTLTextureType2D; - desc.pixelFormat = m_metalLayer.pixelFormat; - desc.width = m_metalLayer.drawableSize.width; - desc.height = m_metalLayer.drawableSize.height; + +#if BX_PLATFORM_VISIONOS + if (m_useLayerRenderer) + { + desc.pixelFormat = MTLPixelFormatBGRA8Unorm_sRGB; + } + else +#endif // BX_PLATFORM_VISIONOS + { + desc.pixelFormat = m_metalLayer.pixelFormat; + desc.width = m_metalLayer.drawableSize.width; + desc.height = m_metalLayer.drawableSize.height; + } + desc.depth = 1; desc.mipmapLevelCount = 1; desc.sampleCount = 1; desc.arrayLength = 1; - if (s_renderMtl->m_iOS9Runtime - || s_renderMtl->m_macOS11Runtime) + if (s_renderMtl->m_hasCPUCacheModesAndStorageModes) { desc.cpuCacheMode = MTLCPUCacheModeDefaultCache; - desc.storageMode = BX_ENABLED(BX_PLATFORM_IOS) + desc.storageMode = BX_ENABLED(BX_PLATFORM_IOS) || BX_ENABLED(BX_PLATFORM_VISIONOS) ? (MTLStorageMode)0 // MTLStorageModeShared : (MTLStorageMode)1 // MTLStorageModeManaged ; @@ -3858,8 +4213,7 @@ static void setTimestamp(void* _data) , MTLOriginMake(blit.m_dstX, blit.m_dstY, blit.m_dstZ) ); #if BX_PLATFORM_OSX - if (m_macOS11Runtime - && readBack) + if (m_hasSynchronizeResource && readBack) { m_blitCommandEncoder.synchronizeResource(dst.m_ptr); } @@ -3879,8 +4233,7 @@ static void setTimestamp(void* _data) , MTLOriginMake(blit.m_dstX, blit.m_dstY, 0) ); #if BX_PLATFORM_OSX - if (m_macOS11Runtime - && readBack) + if (m_hasSynchronizeResource && readBack) { m_blitCommandEncoder.synchronizeTexture(dst.m_ptr, 0, blit.m_dstMip); } @@ -3934,7 +4287,7 @@ static void setTimestamp(void* _data) if (NULL == m_screenshotTarget) { m_textureDescriptor.textureType = MTLTextureType2D; - m_textureDescriptor.pixelFormat = m_mainFrameBuffer.m_swapChain->m_metalLayer.pixelFormat; + m_textureDescriptor.pixelFormat = getSwapChainPixelFormat(m_mainFrameBuffer.m_swapChain); m_textureDescriptor.width = m_resolution.width; m_textureDescriptor.height = m_resolution.height; m_textureDescriptor.depth = 1; @@ -3942,11 +4295,10 @@ static void setTimestamp(void* _data) m_textureDescriptor.sampleCount = 1; m_textureDescriptor.arrayLength = 1; - if (m_iOS9Runtime - || m_macOS11Runtime) + if (s_renderMtl->m_hasCPUCacheModesAndStorageModes) { m_textureDescriptor.cpuCacheMode = MTLCPUCacheModeDefaultCache; - m_textureDescriptor.storageMode = BX_ENABLED(BX_PLATFORM_IOS) + m_textureDescriptor.storageMode = BX_ENABLED(BX_PLATFORM_IOS) || BX_ENABLED(BX_PLATFORM_VISIONOS) ? (MTLStorageMode)0 // MTLStorageModeShared : (MTLStorageMode)1 // MTLStorageModeManaged ; @@ -4254,22 +4606,37 @@ static void setTimestamp(void* _data) rce.setTriangleFillMode(wireframe ? MTLTriangleFillModeLines : MTLTriangleFillModeFill); - MTLViewport vp; - vp.originX = viewState.m_rect.m_x; - vp.originY = viewState.m_rect.m_y; - vp.width = viewState.m_rect.m_width; - vp.height = viewState.m_rect.m_height; - vp.znear = 0.0f; - vp.zfar = 1.0f; - rce.setViewport(vp); - - MTLScissorRect sciRect = { - viewState.m_rect.m_x, - viewState.m_rect.m_y, - viewState.m_rect.m_width, - viewState.m_rect.m_height - }; - rce.setScissorRect(sciRect); +#if BX_PLATFORM_VISIONOS + if (m_mainFrameBuffer.m_swapChain->m_useLayerRenderer) + { + if (cp_layer_renderer_configuration_get_layout(m_mainFrameBuffer.m_swapChain->m_layerRendererConfiguration) == cp_layer_renderer_layout_layered) + { + MTLViewport viewports[2]; + calculateViewPorts(viewports); + rce.setViewports(viewports, 1); + setVertexAmplification(rce); + } + } + else +#endif // BX_PLATFORM_VISIONOS + { + MTLViewport vp; + vp.originX = viewState.m_rect.m_x; + vp.originY = viewState.m_rect.m_y; + vp.width = viewState.m_rect.m_width; + vp.height = viewState.m_rect.m_height; + vp.znear = 0.0f; + vp.zfar = 1.0f; + rce.setViewport(vp); + + MTLScissorRect sciRect = { + viewState.m_rect.m_x, + viewState.m_rect.m_y, + viewState.m_rect.m_width, + viewState.m_rect.m_height + }; + rce.setScissorRect(sciRect); + } if (BGFX_CLEAR_NONE != (clr.m_flags & BGFX_CLEAR_MASK) && !clearWithRenderPass) @@ -4407,7 +4774,7 @@ static void setTimestamp(void* _data) { const VertexBufferMtl& vb = m_vertexBuffers[compute.m_indirectBuffer.idx]; - uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect + uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : compute.m_numIndirect ; @@ -4774,7 +5141,7 @@ static void setTimestamp(void* _data) BGFX_FATAL( false , Fatal::DebugCheck - , "Failed to set image with access: %s, format:%s is not supoort" + , "Failed to set image with access: %s, format:%s is not supported" , s_accessNames[bind.m_access] , bimg::getName(bimg::TextureFormat::Enum(bind.m_format) ) ); @@ -4862,7 +5229,7 @@ static void setTimestamp(void* _data) const MTLIndexType indexFormat = isIndex16 ? MTLIndexTypeUInt16 : MTLIndexTypeUInt32; const IndexBufferMtl& ib = m_indexBuffers[draw.m_indexBuffer.idx]; - numDrawIndirect = UINT16_MAX == draw.m_numIndirect + numDrawIndirect = UINT32_MAX == draw.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : draw.m_numIndirect ; @@ -4874,7 +5241,7 @@ static void setTimestamp(void* _data) } else { - numDrawIndirect = UINT16_MAX == draw.m_numIndirect + numDrawIndirect = UINT32_MAX == draw.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : draw.m_numIndirect ; @@ -5077,7 +5444,6 @@ static void setTimestamp(void* _data) } tvm.printf(10, pos++, 0x8b, " Indices: %7d ", statsNumIndices); -// tvm.printf(10, pos++, 0x8b, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax); tvm.printf(10, pos++, 0x8b, " DVB size: %7d ", _render->m_vboffset); tvm.printf(10, pos++, 0x8b, " DIB size: %7d ", _render->m_iboffset); diff --git a/bgfx/src/renderer_noop.cpp b/bgfx/src/renderer_noop.cpp index 2c3dc0b2..f9264969 100644 --- a/bgfx/src/renderer_noop.cpp +++ b/bgfx/src/renderer_noop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -18,13 +18,17 @@ namespace bgfx { namespace noop | BGFX_CAPS_COMPUTE | BGFX_CAPS_CONSERVATIVE_RASTER | BGFX_CAPS_DRAW_INDIRECT + | BGFX_CAPS_DRAW_INDIRECT_COUNT | BGFX_CAPS_FRAGMENT_DEPTH | BGFX_CAPS_FRAGMENT_ORDERING | BGFX_CAPS_GRAPHICS_DEBUGGER + | BGFX_CAPS_HDR10 | BGFX_CAPS_HIDPI + | BGFX_CAPS_IMAGE_RW | BGFX_CAPS_INDEX32 | BGFX_CAPS_INSTANCING | BGFX_CAPS_OCCLUSION_QUERY + | BGFX_CAPS_PRIMITIVE_ID | BGFX_CAPS_RENDERER_MULTITHREADED | BGFX_CAPS_SWAP_CHAIN | BGFX_CAPS_TEXTURE_2D_ARRAY @@ -34,8 +38,11 @@ namespace bgfx { namespace noop | BGFX_CAPS_TEXTURE_COMPARE_LEQUAL | BGFX_CAPS_TEXTURE_CUBE_ARRAY | BGFX_CAPS_TEXTURE_READ_BACK + | BGFX_CAPS_TRANSPARENT_BACKBUFFER | BGFX_CAPS_VERTEX_ATTRIB_HALF | BGFX_CAPS_VERTEX_ATTRIB_UINT10 + | BGFX_CAPS_VERTEX_ID + | BGFX_CAPS_VIEWPORT_LAYER_ARRAY ; // Pretend all features are available for all texture formats. diff --git a/bgfx/src/renderer_nvn.cpp b/bgfx/src/renderer_nvn.cpp index 4cfa7344..2d412088 100644 --- a/bgfx/src/renderer_nvn.cpp +++ b/bgfx/src/renderer_nvn.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/renderer_vk.cpp b/bgfx/src/renderer_vk.cpp index 04679a96..e16cf802 100644 --- a/bgfx/src/renderer_vk.cpp +++ b/bgfx/src/renderer_vk.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -17,10 +17,6 @@ # import #endif // BX_PLATFORM_OSX -#if defined(WL_EGL_PLATFORM) -# include -#endif // defined(WL_EGL_PLATFORM) - namespace bgfx { namespace vk { static char s_viewName[BGFX_CONFIG_MAX_VIEWS][BGFX_CONFIG_MAX_VIEW_NAME]; @@ -50,7 +46,7 @@ namespace bgfx { namespace vk { VK_PRIMITIVE_TOPOLOGY_POINT_LIST, 1, 1, 0 }, { VK_PRIMITIVE_TOPOLOGY_MAX_ENUM, 0, 0, 0 }, }; - BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo)-1); + static_assert(Topology::Count == BX_COUNTOF(s_primInfo)-1); static MsaaSamplerVK s_msaa[] = { @@ -275,7 +271,26 @@ VK_IMPORT_DEVICE #undef $B #undef $A }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); + static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); + + struct ImageTest + { + VkImageType type; + VkImageUsageFlags usage; + VkImageCreateFlags flags; + uint32_t formatCaps[2]; + }; + + static const ImageTest s_imageTest[] = + { + { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_SAMPLED_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_2D, BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB } }, + { VK_IMAGE_TYPE_3D, VK_IMAGE_USAGE_SAMPLED_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_3D, BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB } }, + { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_SAMPLED_BIT, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, { BGFX_CAPS_FORMAT_TEXTURE_CUBE, BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB } }, + { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER, 0 } }, + { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER, 0 } }, + { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_STORAGE_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ, 0 } }, + { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_STORAGE_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE, 0 } }, + }; struct LayerInfo { @@ -287,8 +302,8 @@ VK_IMPORT_DEVICE { enum Enum { - VK_LAYER_LUNARG_standard_validation, VK_LAYER_KHRONOS_validation, + VK_LAYER_LUNARG_standard_validation, Count }; @@ -303,11 +318,11 @@ VK_IMPORT_DEVICE // static Layer s_layer[] = { - { "VK_LAYER_LUNARG_standard_validation", 1, { false, false }, { false, false } }, { "VK_LAYER_KHRONOS_validation", 1, { false, false }, { false, false } }, + { "VK_LAYER_LUNARG_standard_validation", 1, { false, false }, { false, false } }, { "", 0, { false, false }, { false, false } }, }; - BX_STATIC_ASSERT(Layer::Count == BX_COUNTOF(s_layer)-1); + static_assert(Layer::Count == BX_COUNTOF(s_layer)-1); void updateLayer(const char* _name, uint32_t _version, bool _instanceLayer) { @@ -337,15 +352,29 @@ VK_IMPORT_DEVICE { enum Enum { - EXT_debug_utils, - EXT_debug_report, - EXT_memory_budget, - KHR_get_physical_device_properties2, EXT_conservative_rasterization, + EXT_custom_border_color, + EXT_debug_report, + EXT_debug_utils, EXT_line_rasterization, + EXT_memory_budget, EXT_shader_viewport_index_layer, - EXT_custom_border_color, KHR_draw_indirect_count, + KHR_get_physical_device_properties2, + +# if BX_PLATFORM_ANDROID + KHR_android_surface, +# elif BX_PLATFORM_LINUX + KHR_wayland_surface, + KHR_xlib_surface, + KHR_xcb_surface, +# elif BX_PLATFORM_WINDOWS + KHR_win32_surface, +# elif BX_PLATFORM_OSX + MVK_macos_surface, +# elif BX_PLATFORM_NX + NN_vi_surface, +# endif Count }; @@ -362,17 +391,30 @@ VK_IMPORT_DEVICE // static Extension s_extension[] = { + { "VK_EXT_conservative_rasterization", 1, false, false, true, Layer::Count }, + { "VK_EXT_custom_border_color", 1, false, false, true, Layer::Count }, + { "VK_EXT_debug_report", 1, false, false, false, Layer::Count }, { "VK_EXT_debug_utils", 1, false, false, BGFX_CONFIG_DEBUG_OBJECT_NAME || BGFX_CONFIG_DEBUG_ANNOTATION, Layer::Count }, - { "VK_EXT_debug_report", 1, false, false, false , Layer::Count }, - { "VK_EXT_memory_budget", 1, false, false, true , Layer::Count }, - { "VK_KHR_get_physical_device_properties2", 1, false, false, true , Layer::Count }, - { "VK_EXT_conservative_rasterization", 1, false, false, true , Layer::Count }, - { "VK_EXT_line_rasterization", 1, false, false, true , Layer::Count }, - { "VK_EXT_shader_viewport_index_layer", 1, false, false, true , Layer::Count }, - { "VK_EXT_custom_border_color", 1, false, false, true , Layer::Count }, - { "VK_KHR_draw_indirect_count", 1, false, false, true , Layer::Count }, + { "VK_EXT_line_rasterization", 1, false, false, true, Layer::Count }, + { "VK_EXT_memory_budget", 1, false, false, true, Layer::Count }, + { "VK_EXT_shader_viewport_index_layer", 1, false, false, true, Layer::Count }, + { "VK_KHR_draw_indirect_count", 1, false, false, true, Layer::Count }, + { "VK_KHR_get_physical_device_properties2", 1, false, false, true, Layer::Count }, +# if BX_PLATFORM_ANDROID + { VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count }, +# elif BX_PLATFORM_LINUX + { VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count }, + { VK_KHR_XLIB_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count }, + { VK_KHR_XCB_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count }, +# elif BX_PLATFORM_WINDOWS + { VK_KHR_WIN32_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count }, +# elif BX_PLATFORM_OSX + { VK_MVK_MACOS_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count }, +# elif BX_PLATFORM_NX + { VK_NN_VI_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count }, +# endif }; - BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) ); + static_assert(Extension::Count == BX_COUNTOF(s_extension) ); bool updateExtension(const char* _name, uint32_t _version, bool _instanceExt, Extension _extensions[Extension::Count]) { @@ -440,7 +482,7 @@ VK_IMPORT_DEVICE { VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_SFLOAT }, }, }; - BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) ); + static_assert(AttribType::Count == BX_COUNTOF(s_attribType) ); void fillVertexLayout(const ShaderVK* _vsh, VkPipelineVertexInputStateCreateInfo& _vertexInputState, const VertexLayout& _layout) { @@ -529,36 +571,39 @@ VK_IMPORT_DEVICE "vkDevice", "vkInstance", }; - BX_STATIC_ASSERT(VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE == BX_COUNTOF(s_allocScopeName)-1); + static_assert(VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE == BX_COUNTOF(s_allocScopeName)-1); - constexpr size_t kMinAlignment = 8; + constexpr size_t kMinAlignment = 16; static void* VKAPI_PTR allocationFunction(void* _userData, size_t _size, size_t _alignment, VkSystemAllocationScope _allocationScope) { - BX_UNUSED(_userData); - return bx::alignedAlloc(g_allocator, _size, bx::max(kMinAlignment, _alignment), bx::Location(s_allocScopeName[_allocationScope], 0) ); + bx::AllocatorI* allocator = (bx::AllocatorI*)_userData; + return bx::alignedAlloc(allocator, _size, bx::max(kMinAlignment, _alignment), bx::Location(s_allocScopeName[_allocationScope], 0) ); } - static void* VKAPI_PTR reallocationFunction(void* _userData, void* _original, size_t _size, size_t _alignment, VkSystemAllocationScope _allocationScope) + static void* VKAPI_PTR reallocationFunction(void* _userData, void* _ptr, size_t _size, size_t _alignment, VkSystemAllocationScope _allocationScope) { + bx::AllocatorI* allocator = (bx::AllocatorI*)_userData; + BX_UNUSED(_userData); - if (_size == 0) { - bx::alignedFree(g_allocator, _original, 0); + if (0 == _size) + { + bx::alignedFree(allocator, _ptr, 0); return NULL; } - return bx::alignedRealloc(g_allocator, _original, _size, bx::max(kMinAlignment, _alignment), bx::Location(s_allocScopeName[_allocationScope], 0) ); + + return bx::alignedRealloc(allocator, _ptr, _size, bx::max(kMinAlignment, _alignment), bx::Location(s_allocScopeName[_allocationScope], 0) ); } - static void VKAPI_PTR freeFunction(void* _userData, void* _memory) + static void VKAPI_PTR freeFunction(void* _userData, void* _ptr) { - BX_UNUSED(_userData); - - if (NULL == _memory) + if (NULL == _ptr) { return; } - bx::alignedFree(g_allocator, _memory, 0); + bx::AllocatorI* allocator = (bx::AllocatorI*)_userData; + bx::alignedFree(allocator, _ptr, kMinAlignment); } static void VKAPI_PTR internalAllocationNotification(void* _userData, size_t _size, VkInternalAllocationType _allocationType, VkSystemAllocationScope _allocationScope) @@ -636,26 +681,17 @@ VK_IMPORT_DEVICE }; VkBool32 VKAPI_PTR debugReportCb( - VkDebugReportFlagsEXT _flags, - VkDebugReportObjectTypeEXT _objectType, - uint64_t _object, - size_t _location, - int32_t _messageCode, - const char* _layerPrefix, - const char* _message, - void* _userData - ) - { - BX_UNUSED(_flags - , _objectType - , _object - , _location - , _messageCode - , _layerPrefix - , _message - , _userData - , s_debugReportObjectType - ); + VkDebugReportFlagsEXT _flags + , VkDebugReportObjectTypeEXT _objectType + , uint64_t _object + , size_t _location + , int32_t _messageCode + , const char* _layerPrefix + , const char* _message + , void* _userData + ) + { + BX_UNUSED(_flags, _objectType, _object, _location, _messageCode, _layerPrefix, _message, _userData, s_debugReportObjectType); // For more info about 'VUID-VkSwapchainCreateInfoKHR-imageExtent-01274' // check https://github.com/KhronosGroup/Vulkan-Docs/issues/1144 @@ -666,6 +702,7 @@ VK_IMPORT_DEVICE { return VK_FALSE; } + BX_TRACE("%c%c%c%c%c %19s, %s, %d: %s" , 0 != (_flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT ) ? 'I' : '-' , 0 != (_flags & VK_DEBUG_REPORT_WARNING_BIT_EXT ) ? 'W' : '-' @@ -677,6 +714,7 @@ VK_IMPORT_DEVICE , _messageCode , _message ); + return VK_FALSE; } @@ -774,6 +812,7 @@ VK_IMPORT_DEVICE , layerProperties[layer].implementationVersion , layerProperties[layer].description ); + uint32_t numExtensionProperties; result = enumerateExtensionProperties(_physicalDevice , layerProperties[layer].layerName @@ -793,7 +832,7 @@ VK_IMPORT_DEVICE for (uint32_t extension = 0; extension < numExtensionProperties; ++extension) { - bool supported = updateExtension( + const bool supported = updateExtension( extensionProperties[extension].extensionName , extensionProperties[extension].specVersion , VK_NULL_HANDLE == _physicalDevice @@ -1077,7 +1116,8 @@ VK_IMPORT_DEVICE imb.subresourceRange.levelCount = _levelCount; imb.subresourceRange.baseArrayLayer = _baseArrayLayer; imb.subresourceRange.layerCount = _layerCount; - vkCmdPipelineBarrier(_commandBuffer + vkCmdPipelineBarrier( + _commandBuffer , srcStageMask , dstStageMask , 0 @@ -1161,11 +1201,11 @@ VK_IMPORT_DEVICE #elif BX_PLATFORM_ANDROID "libvulkan.so" #elif BX_PLATFORM_OSX - "libvulkan.dylib" + "libMoltenVK.dylib" #else "libvulkan.so.1" #endif // BX_PLATFORM_* - ); + ); if (NULL == m_vulkan1Dll) { @@ -1214,7 +1254,6 @@ VK_IMPORT } uint32_t numEnabledLayers = 0; - const char* enabledLayer[Layer::Count]; BX_TRACE("Enabled instance layers:"); @@ -1230,22 +1269,14 @@ VK_IMPORT BX_TRACE("\t%s", layer.m_name); } } -#if BX_PLATFORM_OSX || defined(WL_EGL_PLATFORM) - uint32_t numEnabledExtensions = headless ? 0 : 3; - const char* enabledExtension[Extension::Count + 3] = -#else - uint32_t numEnabledExtensions = headless ? 0 : 2; + uint32_t numEnabledExtensions = 0; + const char* enabledExtension[Extension::Count + 1]; - const char* enabledExtension[Extension::Count + 2] = -#endif + if (!headless) { - VK_KHR_SURFACE_EXTENSION_NAME, - KHR_SURFACE_EXTENSION_NAME, -#if BX_PLATFORM_OSX - VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME, -#endif - }; + enabledExtension[numEnabledExtensions++] = VK_KHR_SURFACE_EXTENSION_NAME; + } for (uint32_t ii = 0; ii < Extension::Count; ++ii) { @@ -1253,8 +1284,7 @@ VK_IMPORT const LayerInfo& layerInfo = s_layer[extension.m_layer].m_instance; const bool layerEnabled = false - || extension.m_layer == Layer::Count - || (layerInfo.m_supported && layerInfo.m_initialize) + || extension.m_layer == Layer::Count || (layerInfo.m_supported && layerInfo.m_initialize) ; if (extension.m_supported @@ -1306,11 +1336,9 @@ VK_IMPORT VkInstanceCreateInfo ici; ici.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; ici.pNext = NULL; -#if BX_PLATFORM_OSX - ici.flags = 0 | VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR; -#else - ici.flags = 0; -#endif + ici.flags = 0 + | (BX_ENABLED(BX_PLATFORM_OSX) ? VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR : 0) + ; ici.pApplicationInfo = &appInfo; ici.enabledLayerCount = numEnabledLayers; ici.ppEnabledLayerNames = enabledLayer; @@ -1319,7 +1347,15 @@ VK_IMPORT if (BX_ENABLED(BGFX_CONFIG_DEBUG) ) { - m_allocatorCb = &s_allocationCb; + // Validation layer is calling freeFunction with pointers that are not allocated + // via callback mechanism. This is bug in validation layer, and work-around + // would be to keep track of allocated pointers and ignore those that are not + // allocated by it. + // + // Anyhow we just let VK take care of memory, until they fix the issue... + // + // s_allocationCb.pUserData = g_allocator; + // m_allocatorCb = &s_allocationCb; BX_UNUSED(s_allocationCb); } @@ -1552,25 +1588,25 @@ VK_IMPORT_INSTANCE bx::memSet(&m_deviceFeatures, 0, sizeof(m_deviceFeatures) ); - m_deviceFeatures.fullDrawIndexUint32 = supportedFeatures.fullDrawIndexUint32; - m_deviceFeatures.imageCubeArray = supportedFeatures.imageCubeArray && (_init.capabilities & BGFX_CAPS_TEXTURE_CUBE_ARRAY); - m_deviceFeatures.independentBlend = supportedFeatures.independentBlend && (_init.capabilities & BGFX_CAPS_BLEND_INDEPENDENT); - m_deviceFeatures.multiDrawIndirect = supportedFeatures.multiDrawIndirect && (_init.capabilities & BGFX_CAPS_DRAW_INDIRECT); - m_deviceFeatures.drawIndirectFirstInstance = supportedFeatures.drawIndirectFirstInstance && (_init.capabilities & BGFX_CAPS_DRAW_INDIRECT); - m_deviceFeatures.depthClamp = supportedFeatures.depthClamp; - m_deviceFeatures.fillModeNonSolid = supportedFeatures.fillModeNonSolid; - m_deviceFeatures.largePoints = supportedFeatures.largePoints; - m_deviceFeatures.samplerAnisotropy = supportedFeatures.samplerAnisotropy; - m_deviceFeatures.textureCompressionETC2 = supportedFeatures.textureCompressionETC2; - m_deviceFeatures.textureCompressionBC = supportedFeatures.textureCompressionBC; - m_deviceFeatures.vertexPipelineStoresAndAtomics = supportedFeatures.vertexPipelineStoresAndAtomics; - m_deviceFeatures.fragmentStoresAndAtomics = supportedFeatures.fragmentStoresAndAtomics; - m_deviceFeatures.shaderImageGatherExtended = supportedFeatures.shaderImageGatherExtended; + m_deviceFeatures.fullDrawIndexUint32 = supportedFeatures.fullDrawIndexUint32; + m_deviceFeatures.imageCubeArray = supportedFeatures.imageCubeArray && (_init.capabilities & BGFX_CAPS_TEXTURE_CUBE_ARRAY); + m_deviceFeatures.independentBlend = supportedFeatures.independentBlend && (_init.capabilities & BGFX_CAPS_BLEND_INDEPENDENT); + m_deviceFeatures.multiDrawIndirect = supportedFeatures.multiDrawIndirect && (_init.capabilities & BGFX_CAPS_DRAW_INDIRECT); + m_deviceFeatures.drawIndirectFirstInstance = supportedFeatures.drawIndirectFirstInstance && (_init.capabilities & BGFX_CAPS_DRAW_INDIRECT); + m_deviceFeatures.depthClamp = supportedFeatures.depthClamp; + m_deviceFeatures.fillModeNonSolid = supportedFeatures.fillModeNonSolid; + m_deviceFeatures.largePoints = supportedFeatures.largePoints; + m_deviceFeatures.samplerAnisotropy = supportedFeatures.samplerAnisotropy; + m_deviceFeatures.textureCompressionETC2 = supportedFeatures.textureCompressionETC2; + m_deviceFeatures.textureCompressionBC = supportedFeatures.textureCompressionBC; + m_deviceFeatures.vertexPipelineStoresAndAtomics = supportedFeatures.vertexPipelineStoresAndAtomics; + m_deviceFeatures.fragmentStoresAndAtomics = supportedFeatures.fragmentStoresAndAtomics; + m_deviceFeatures.shaderImageGatherExtended = supportedFeatures.shaderImageGatherExtended; m_deviceFeatures.shaderStorageImageExtendedFormats = supportedFeatures.shaderStorageImageExtendedFormats; - m_deviceFeatures.shaderClipDistance = supportedFeatures.shaderClipDistance; - m_deviceFeatures.shaderCullDistance = supportedFeatures.shaderCullDistance; - m_deviceFeatures.shaderResourceMinLod = supportedFeatures.shaderResourceMinLod; - m_deviceFeatures.geometryShader = supportedFeatures.geometryShader; + m_deviceFeatures.shaderClipDistance = supportedFeatures.shaderClipDistance; + m_deviceFeatures.shaderCullDistance = supportedFeatures.shaderCullDistance; + m_deviceFeatures.shaderResourceMinLod = supportedFeatures.shaderResourceMinLod; + m_deviceFeatures.geometryShader = supportedFeatures.geometryShader; m_lineAASupport = true && s_extension[Extension::EXT_line_rasterization].m_supported @@ -1648,83 +1684,63 @@ VK_IMPORT_INSTANCE } } + for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii) { - struct ImageTest - { - VkImageType type; - VkImageUsageFlags usage; - VkImageCreateFlags flags; - uint32_t formatCaps[2]; - }; - - const ImageTest imageTest[] = - { - { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_SAMPLED_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_2D, BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB } }, - { VK_IMAGE_TYPE_3D, VK_IMAGE_USAGE_SAMPLED_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_3D, BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB } }, - { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_SAMPLED_BIT, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, { BGFX_CAPS_FORMAT_TEXTURE_CUBE, BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB } }, - { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER, 0 } }, - { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER, 0 } }, - { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_STORAGE_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ, 0 } }, - { VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_STORAGE_BIT, 0, { BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE, 0 } }, - }; - - for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii) - { - uint16_t support = BGFX_CAPS_FORMAT_TEXTURE_NONE; + uint16_t support = BGFX_CAPS_FORMAT_TEXTURE_NONE; - const bool depth = bimg::isDepth(bimg::TextureFormat::Enum(ii) ); - VkFormat fmt = depth - ? s_textureFormat[ii].m_fmtDsv - : s_textureFormat[ii].m_fmt - ; + const bool depth = bimg::isDepth(bimg::TextureFormat::Enum(ii) ); + VkFormat fmt = depth + ? s_textureFormat[ii].m_fmtDsv + : s_textureFormat[ii].m_fmt + ; - for (uint32_t jj = 0, num = depth ? 1 : 2; jj < num; ++jj) + for (uint32_t jj = 0, num = depth ? 1 : 2; jj < num; ++jj) + { + if (VK_FORMAT_UNDEFINED != fmt) { - if (VK_FORMAT_UNDEFINED != fmt) + for (uint32_t test = 0; test < BX_COUNTOF(s_imageTest); ++test) { - for (uint32_t test = 0; test < BX_COUNTOF(imageTest); ++test) + const ImageTest& it = s_imageTest[test]; + + VkImageFormatProperties ifp; + result = vkGetPhysicalDeviceImageFormatProperties( + m_physicalDevice + , fmt + , it.type + , VK_IMAGE_TILING_OPTIMAL + , it.usage + , it.flags + , &ifp + ); + + if (VK_SUCCESS == result) { - const ImageTest& it = imageTest[test]; - - VkImageFormatProperties ifp; - result = vkGetPhysicalDeviceImageFormatProperties(m_physicalDevice - , fmt - , it.type - , VK_IMAGE_TILING_OPTIMAL - , it.usage - , it.flags - , &ifp - ); - - if (VK_SUCCESS == result) + support |= it.formatCaps[jj]; + + const bool multisample = VK_SAMPLE_COUNT_1_BIT < ifp.sampleCounts; + if (it.usage & VK_IMAGE_USAGE_SAMPLED_BIT) + { + support |= 0 + | BGFX_CAPS_FORMAT_TEXTURE_VERTEX + | (multisample ? BGFX_CAPS_FORMAT_TEXTURE_MSAA : 0) + ; + } + + if (it.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) ) { - support |= it.formatCaps[jj]; - - const bool multisample = VK_SAMPLE_COUNT_1_BIT < ifp.sampleCounts; - if (it.usage & VK_IMAGE_USAGE_SAMPLED_BIT) - { - support |= 0 - | BGFX_CAPS_FORMAT_TEXTURE_VERTEX - | (multisample ? BGFX_CAPS_FORMAT_TEXTURE_MSAA : 0) - ; - } - - if (it.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) ) - { - support |= 0 - | BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN - | (multisample ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : 0) - ; - } + support |= 0 + | BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN + | (multisample ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : 0) + ; } } } - - fmt = s_textureFormat[ii].m_fmtSrgb; } - g_caps.formats[ii] = support; + fmt = s_textureFormat[ii].m_fmtSrgb; } + + g_caps.formats[ii] = support; } vkGetPhysicalDeviceMemoryProperties(m_physicalDevice, &m_memoryProperties); @@ -1781,7 +1797,6 @@ VK_IMPORT_INSTANCE { uint32_t numEnabledLayers = 0; - const char* enabledLayer[Layer::Count]; BX_TRACE("Enabled device layers:"); @@ -1797,30 +1812,29 @@ VK_IMPORT_INSTANCE BX_TRACE("\t%s", layer.m_name); } } -#if BX_PLATFORM_OSX - uint32_t numEnabledExtensions = headless ? 1 : 3; - const char* enabledExtension[Extension::Count + 3] = -#else - uint32_t numEnabledExtensions = headless ? 1 : 2; + uint32_t numEnabledExtensions = 0; + const char* enabledExtension[Extension::Count + 3]; + + enabledExtension[numEnabledExtensions++] = VK_KHR_MAINTENANCE1_EXTENSION_NAME; - const char* enabledExtension[Extension::Count + 2] = -#endif + if (!headless) { - VK_KHR_MAINTENANCE1_EXTENSION_NAME, - VK_KHR_SWAPCHAIN_EXTENSION_NAME, -#if BX_PLATFORM_OSX - "VK_KHR_portability_subset", -#endif - }; + enabledExtension[numEnabledExtensions++] = VK_KHR_SWAPCHAIN_EXTENSION_NAME; + } + + if (BX_ENABLED(BX_PLATFORM_OSX) ) + { + enabledExtension[numEnabledExtensions++] = VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME; + } for (uint32_t ii = 0; ii < Extension::Count; ++ii) { const Extension& extension = s_extension[ii]; - bool layerEnabled = extension.m_layer == Layer::Count || - (s_layer[extension.m_layer].m_device.m_supported && - s_layer[extension.m_layer].m_device.m_initialize); + bool layerEnabled = extension.m_layer == Layer::Count + || (s_layer[extension.m_layer].m_device.m_supported && s_layer[extension.m_layer].m_device.m_initialize) + ; if (extension.m_supported && extension.m_initialize @@ -1857,7 +1871,7 @@ VK_IMPORT_INSTANCE dci.ppEnabledLayerNames = enabledLayer; dci.enabledExtensionCount = numEnabledExtensions; dci.ppEnabledExtensionNames = enabledExtension; - dci.pEnabledFeatures = &m_deviceFeatures; + dci.pEnabledFeatures = &m_deviceFeatures; result = vkCreateDevice( m_physicalDevice @@ -1929,9 +1943,9 @@ VK_IMPORT_DEVICE m_textVideoMem.resize(false, _init.resolution.width, _init.resolution.height); m_textVideoMem.clear(); - for (uint8_t ii = 0; ii < BX_COUNTOF(m_swapchainFormats); ++ii) + for (uint8_t ii = 0; ii < BX_COUNTOF(m_swapChainFormats); ++ii) { - m_swapchainFormats[ii] = TextureFormat::Enum(ii); + m_swapChainFormats[ii] = TextureFormat::Enum(ii); } result = m_backBuffer.create(UINT16_MAX, g_platformData.nwh, m_resolution.width, m_resolution.height, m_resolution.format); @@ -1995,10 +2009,17 @@ VK_IMPORT_DEVICE { const uint32_t size = 128; const uint32_t count = BGFX_CONFIG_MAX_DRAW_CALLS; + for (uint32_t ii = 0; ii < m_numFramesInFlight; ++ii) { BX_TRACE("Create scratch buffer %d", ii); - m_scratchBuffer[ii].create(size, count); + m_scratchBuffer[ii].createUniform(size, count); + } + + for (uint32_t ii = 0; ii < m_numFramesInFlight; ++ii) + { + BX_TRACE("Create scratch staging buffer %d", ii); + m_scratchStagingBuffer[ii].createStaging(BGFX_CONFIG_PER_FRAME_SCRATCH_STAGING_BUFFER_SIZE); } } @@ -2060,28 +2081,29 @@ VK_IMPORT_DEVICE { m_gpuTimer.shutdown(); } - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::DescriptorCreated: for (uint32_t ii = 0; ii < m_numFramesInFlight; ++ii) { m_scratchBuffer[ii].destroy(); + m_scratchStagingBuffer[ii].destroy(); } vkDestroy(m_pipelineCache); vkDestroy(m_descriptorPool); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::SwapChainCreated: m_backBuffer.destroy(); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::CommandQueueCreated: m_cmd.shutdown(); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::DeviceCreated: vkDestroyDevice(m_device, m_allocatorCb); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::InstanceCreated: if (VK_NULL_HANDLE != m_debugReportCallback) @@ -2090,14 +2112,14 @@ VK_IMPORT_DEVICE } vkDestroyInstance(m_instance, m_allocatorCb); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::LoadedVulkan1: bx::dlclose(m_vulkan1Dll); m_vulkan1Dll = NULL; m_allocatorCb = NULL; unloadRenderDoc(m_renderDocDll); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::Default: break; @@ -2130,6 +2152,11 @@ VK_IMPORT_DEVICE m_scratchBuffer[ii].destroy(); } + for (uint32_t ii = 0; ii < m_numFramesInFlight; ++ii) + { + m_scratchStagingBuffer[ii].destroy(); + } + for (uint32_t ii = 0; ii < BX_COUNTOF(m_frameBuffers); ++ii) { m_frameBuffers[ii].destroy(); @@ -2678,6 +2705,7 @@ VK_IMPORT_DEVICE m_indexBuffers[_blitter.m_ib->handle.idx].update(m_commandBuffer, 0, _numIndices*2, _blitter.m_ib->data); m_vertexBuffers[_blitter.m_vb->handle.idx].update(m_commandBuffer, 0, numVertices*_blitter.m_layout.m_stride, _blitter.m_vb->data, true); + VkRenderPassBeginInfo rpbi; rpbi.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; rpbi.pNext = NULL; @@ -2778,19 +2806,13 @@ VK_IMPORT_DEVICE | BGFX_RESET_DEPTH_CLAMP ); - // Note: m_needToRefreshSwapchain is deliberately ignored when deciding whether to recreate the swapchain - // because it can happen several frames before submit is called with the new resolution. - // Instead, vkAcquireNextImageKHR and all draws to the backbuffer are skipped until the window size is updated. - // That also fixes a related issue where VK_ERROR_OUT_OF_DATE_KHR is returned from - // vkQueuePresentKHR when the window doesn't exist anymore, and vkGetPhysicalDeviceSurfaceCapabilitiesKHR - // fails with VK_ERROR_SURFACE_LOST_KHR. - if (false || m_resolution.format != _resolution.format || m_resolution.width != _resolution.width || m_resolution.height != _resolution.height || m_resolution.reset != flags - || m_backBuffer.m_swapChain.m_needToRecreateSurface) + || m_backBuffer.m_swapChain.m_needToRecreateSurface + || m_backBuffer.m_swapChain.m_needToRecreateSwapchain) { flags &= ~BGFX_RESET_INTERNAL_FORCE; @@ -2808,6 +2830,10 @@ VK_IMPORT_DEVICE preReset(); m_backBuffer.update(m_commandBuffer, m_resolution); + // Update the resolution again here, as the actual width and height + // is now final (as it was potentially clamped by the Vulkan driver). + m_resolution.width = m_backBuffer.m_width; + m_resolution.height = m_backBuffer.m_height; postReset(); } @@ -2839,6 +2865,7 @@ VK_IMPORT_DEVICE void setFrameBuffer(FrameBufferHandle _fbh, bool _acquire = true) { + BGFX_PROFILER_SCOPE("Vk::setFrameBuffer()", kColorFrame); BX_ASSERT(false || isValid(_fbh) || NULL != m_backBuffer.m_nwh @@ -4145,10 +4172,10 @@ VK_IMPORT_DEVICE { case UniformType::Mat3: case UniformType::Mat3|kUniformFragmentBit: - { + { float* value = (float*)data; for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3*16, value += 9) - { + { Matrix4 mtx; mtx.un.val[ 0] = value[0]; mtx.un.val[ 1] = value[1]; @@ -4288,6 +4315,10 @@ VK_IMPORT_DEVICE if (0 != depthAspectMask) { + attachments[mrt].colorAttachment = VK_ATTACHMENT_UNUSED; + // The above is meaningless and not required by the spec, but Khronos + // Validation Layer has a conditional jump depending on this, even + // without VK_IMAGE_ASPECT_COLOR_BIT set. Valgrind found this. attachments[mrt].aspectMask = depthAspectMask; attachments[mrt].clearValue.depthStencil.stencil = _clear.m_stencil; attachments[mrt].clearValue.depthStencil.depth = _clear.m_depth; @@ -4325,6 +4356,7 @@ VK_IMPORT_DEVICE VkResult allocateMemory(const VkMemoryRequirements* requirements, VkMemoryPropertyFlags propertyFlags, ::VkDeviceMemory* memory) const { + BGFX_PROFILER_SCOPE("RendererContextVK::allocateMemory", kColorResource); VkMemoryAllocateInfo ma; ma.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; ma.pNext = NULL; @@ -4351,6 +4383,7 @@ VK_IMPORT_DEVICE VkResult createHostBuffer(uint32_t _size, VkMemoryPropertyFlags _flags, ::VkBuffer* _buffer, ::VkDeviceMemory* _memory, const void* _data = NULL) { + BGFX_PROFILER_SCOPE("createHostBuffer", kColorResource); VkResult result = VK_SUCCESS; VkBufferCreateInfo bci; @@ -4396,6 +4429,7 @@ VK_IMPORT_DEVICE if (_data != NULL) { + BGFX_PROFILER_SCOPE("map and copy data", kColorResource); void* dst; result = vkMapMemory(m_device, *_memory, 0, _size, 0, &dst); if (VK_SUCCESS != result) @@ -4420,6 +4454,48 @@ VK_IMPORT_DEVICE return createHostBuffer(_size, flags, _buffer, _memory, _data); } + StagingBufferVK allocFromScratchStagingBuffer(uint32_t _size, uint32_t _align, const void *_data = NULL) + { + BGFX_PROFILER_SCOPE("allocFromScratchStagingBuffer", kColorResource); + + StagingBufferVK result; + ScratchBufferVK &scratch = m_scratchStagingBuffer[m_cmd.m_currentFrameInFlight]; + + if (_size <= BGFX_CONFIG_MAX_STAGING_SIZE_FOR_SCRATCH_BUFFER) + { + const uint32_t scratchOffset = scratch.alloc(_size, _align); + + if (scratchOffset != UINT32_MAX) + { + result.m_isFromScratch = true; + result.m_size = _size; + result.m_offset = scratchOffset; + result.m_buffer = scratch.m_buffer; + result.m_deviceMem = scratch.m_deviceMem; + result.m_data = scratch.m_data + result.m_offset; + + if (_data != NULL) + { + BGFX_PROFILER_SCOPE("copy to scratch", kColorResource); + bx::memCopy(result.m_data, _data, _size); + } + + return result; + } + } + + // Not enough space or too big, we will create a new staging buffer on the spot. + result.m_isFromScratch = false; + + VK_CHECK(createStagingBuffer(_size, &result.m_buffer, &result.m_deviceMem, _data)); + + result.m_size = _size; + result.m_offset = 0; + result.m_data = NULL; + + return result; + } + VkResult createReadbackBuffer(uint32_t _size, ::VkBuffer* _buffer, ::VkDeviceMemory* _memory) { const VkMemoryPropertyFlags flags = 0 @@ -4427,6 +4503,7 @@ VK_IMPORT_DEVICE | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT ; + return createHostBuffer(_size, flags, _buffer, _memory, NULL); } @@ -4445,13 +4522,14 @@ VK_IMPORT_DEVICE bool m_timerQuerySupport; FrameBufferVK m_backBuffer; - TextureFormat::Enum m_swapchainFormats[TextureFormat::Count]; + TextureFormat::Enum m_swapChainFormats[TextureFormat::Count]; uint16_t m_numWindows; FrameBufferHandle m_windows[BGFX_CONFIG_MAX_FRAME_BUFFERS]; int64_t m_presentElapsed; ScratchBufferVK m_scratchBuffer[BGFX_CONFIG_MAX_FRAME_LATENCY]; + ScratchBufferVK m_scratchStagingBuffer[BGFX_CONFIG_MAX_FRAME_LATENCY]; uint32_t m_numFramesInFlight; CommandQueueVK m_cmd; @@ -4530,6 +4608,7 @@ VK_IMPORT_DEVICE { \ if (VK_NULL_HANDLE != _obj) \ { \ + BGFX_PROFILER_SCOPE("vkDestroy" #_name, kColorResource); \ vkDestroy##_name(s_renderVK->m_device, _obj.vk, s_renderVK->m_allocatorCb); \ _obj = VK_NULL_HANDLE; \ } \ @@ -4545,6 +4624,7 @@ VK_DESTROY { if (VK_NULL_HANDLE != _obj) { + BGFX_PROFILER_SCOPE("vkFreeMemory", kColorResource); vkFreeMemory(s_renderVK->m_device, _obj.vk, s_renderVK->m_allocatorCb); _obj = VK_NULL_HANDLE; } @@ -4554,6 +4634,7 @@ VK_DESTROY { if (VK_NULL_HANDLE != _obj) { + BGFX_PROFILER_SCOPE("vkDestroySurfaceKHR", kColorResource); vkDestroySurfaceKHR(s_renderVK->m_instance, _obj.vk, s_renderVK->m_allocatorCb); _obj = VK_NULL_HANDLE; } @@ -4563,6 +4644,7 @@ VK_DESTROY { if (VK_NULL_HANDLE != _obj) { + BGFX_PROFILER_SCOPE("vkFreeDescriptorSets", kColorResource); vkFreeDescriptorSets(s_renderVK->m_device, s_renderVK->m_descriptorPool, 1, &_obj); _obj = VK_NULL_HANDLE; } @@ -4583,14 +4665,12 @@ VK_DESTROY s_renderVK->release(_obj); } - void ScratchBufferVK::create(uint32_t _size, uint32_t _count) + void ScratchBufferVK::create(uint32_t _size, uint32_t _count, VkBufferUsageFlags usage, uint32_t _align) { const VkAllocationCallbacks* allocatorCb = s_renderVK->m_allocatorCb; const VkDevice device = s_renderVK->m_device; - const VkPhysicalDeviceLimits& deviceLimits = s_renderVK->m_deviceProperties.limits; - const uint32_t align = uint32_t(deviceLimits.minUniformBufferOffsetAlignment); - const uint32_t entrySize = bx::strideAlign(_size, align); + const uint32_t entrySize = bx::strideAlign(_size, _align); const uint32_t totalSize = entrySize * _count; VkBufferCreateInfo bci; @@ -4598,7 +4678,7 @@ VK_DESTROY bci.pNext = NULL; bci.flags = 0; bci.size = totalSize; - bci.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT; + bci.usage = usage; bci.sharingMode = VK_SHARING_MODE_EXCLUSIVE; bci.queueFamilyIndexCount = 0; bci.pQueueFamilyIndices = NULL; @@ -4628,12 +4708,29 @@ VK_DESTROY m_size = (uint32_t)mr.size; m_pos = 0; + m_align = _align; VK_CHECK(vkBindBufferMemory(device, m_buffer, m_deviceMem, 0) ); VK_CHECK(vkMapMemory(device, m_deviceMem, 0, m_size, 0, (void**)&m_data) ); } + void ScratchBufferVK::createUniform(uint32_t _size, uint32_t _count) + { + const VkPhysicalDeviceLimits& deviceLimits = s_renderVK->m_deviceProperties.limits; + const uint32_t align = uint32_t(deviceLimits.minUniformBufferOffsetAlignment); + + create(_size, _count, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, align); + } + + void ScratchBufferVK::createStaging(uint32_t _size) + { + const VkPhysicalDeviceLimits& deviceLimits = s_renderVK->m_deviceProperties.limits; + const uint32_t align = uint32_t(deviceLimits.optimalBufferCopyOffsetAlignment); + + create(_size, 1, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, align); + } + void ScratchBufferVK::destroy() { reset(); @@ -4649,26 +4746,34 @@ VK_DESTROY m_pos = 0; } - uint32_t ScratchBufferVK::write(const void* _data, uint32_t _size) + uint32_t ScratchBufferVK::alloc(uint32_t _size, uint32_t _minAlign) { - BX_ASSERT(m_pos < m_size, "Out of scratch buffer memory"); - - const uint32_t offset = m_pos; + const uint32_t align = bx::uint32_lcm(m_align, _minAlign); + const uint32_t dstOffset = bx::strideAlign(m_pos, align); - if (_size > 0) + if (dstOffset + _size <= m_size) { - bx::memCopy(&m_data[m_pos], _data, _size); + m_pos = dstOffset + _size; + return dstOffset; + } + + return UINT32_MAX; + } - const VkPhysicalDeviceLimits& deviceLimits = s_renderVK->m_deviceProperties.limits; - const uint32_t align = uint32_t(deviceLimits.minUniformBufferOffsetAlignment); - const uint32_t alignedSize = bx::strideAlign(_size, align); + uint32_t ScratchBufferVK::write(const void* _data, uint32_t _size, uint32_t _minAlign) + { + uint32_t dstOffset = alloc(_size, _minAlign); + BX_ASSERT(dstOffset != UINT32_MAX, "Not enough space on ScratchBuffer left to allocate %u bytes with alignment %u.", _size, _minAlign); - m_pos += alignedSize; + if (_size > 0) + { + bx::memCopy(&m_data[dstOffset], _data, _size); } - return offset; + return dstOffset; } + void ScratchBufferVK::flush() { const VkPhysicalDeviceLimits& deviceLimits = s_renderVK->m_deviceProperties.limits; @@ -4731,17 +4836,16 @@ VK_DESTROY void BufferVK::update(VkCommandBuffer _commandBuffer, uint32_t _offset, uint32_t _size, void* _data, bool _discard) { + BGFX_PROFILER_SCOPE("BufferVK::update", kColorFrame); BX_UNUSED(_discard); - VkBuffer stagingBuffer; - VkDeviceMemory stagingMem; - VK_CHECK(s_renderVK->createStagingBuffer(_size, &stagingBuffer, &stagingMem, _data) ); + StagingBufferVK stagingBuffer = s_renderVK->allocFromScratchStagingBuffer(_size, 8, _data); VkBufferCopy region; - region.srcOffset = 0; + region.srcOffset = stagingBuffer.m_offset; region.dstOffset = _offset; region.size = _size; - vkCmdCopyBuffer(_commandBuffer, stagingBuffer, m_buffer, 1, ®ion); + vkCmdCopyBuffer(_commandBuffer, stagingBuffer.m_buffer, m_buffer, 1, ®ion); setMemoryBarrier( _commandBuffer @@ -4749,8 +4853,11 @@ VK_DESTROY , VK_PIPELINE_STAGE_TRANSFER_BIT ); - s_renderVK->release(stagingBuffer); - s_renderVK->release(stagingMem); + if (!stagingBuffer.m_isFromScratch) + { + s_renderVK->release(stagingBuffer.m_buffer); + s_renderVK->release(stagingBuffer.m_deviceMem); + } } void BufferVK::destroy() @@ -5022,8 +5129,6 @@ VK_DESTROY smci.codeSize = m_code->size; smci.pCode = (const uint32_t*)m_code->data; -// disassemble(bx::getDebugOut(), m_code->data, m_code->size); - VK_CHECK(vkCreateShaderModule( s_renderVK->m_device , &smci @@ -5313,6 +5418,7 @@ VK_DESTROY VkResult TimerQueryVK::init() { + BGFX_PROFILER_SCOPE("TimerQueryVK::init", kColorFrame); VkResult result = VK_SUCCESS; const VkDevice device = s_renderVK->m_device; @@ -5376,6 +5482,7 @@ VK_DESTROY uint32_t TimerQueryVK::begin(uint32_t _resultIdx, uint32_t _frameNum) { + BGFX_PROFILER_SCOPE("TimerQueryVK::begin", kColorFrame); while (0 == m_control.reserve(1) ) { m_control.consume(1); @@ -5403,6 +5510,7 @@ VK_DESTROY void TimerQueryVK::end(uint32_t _idx) { + BGFX_PROFILER_SCOPE("TimerQueryVK::end", kColorFrame); Query& query = m_query[_idx]; query.m_ready = true; query.m_completed = s_renderVK->m_cmd.m_submitted + s_renderVK->m_cmd.m_numFramesInFlight; @@ -5465,6 +5573,7 @@ VK_DESTROY VkResult OcclusionQueryVK::init() { + BGFX_PROFILER_SCOPE("OcclusionQueryVK::init", kColorFrame); VkResult result = VK_SUCCESS; const VkDevice device = s_renderVK->m_device; @@ -5521,6 +5630,7 @@ VK_DESTROY void OcclusionQueryVK::begin(OcclusionQueryHandle _handle) { + BGFX_PROFILER_SCOPE("OcclusionQueryVK::shutdown", kColorFrame); m_control.reserve(1); const VkCommandBuffer commandBuffer = s_renderVK->m_commandBuffer; @@ -5531,6 +5641,7 @@ VK_DESTROY void OcclusionQueryVK::end() { + BGFX_PROFILER_SCOPE("OcclusionQueryVK::end", kColorFrame); const VkCommandBuffer commandBuffer = s_renderVK->m_commandBuffer; const OcclusionQueryHandle handle = m_handle[m_control.m_current]; @@ -5541,6 +5652,7 @@ VK_DESTROY void OcclusionQueryVK::flush(Frame* _render) { + BGFX_PROFILER_SCOPE("OcclusionQueryVK::flush", kColorFrame); if (0 < m_control.available() ) { VkCommandBuffer commandBuffer = s_renderVK->m_commandBuffer; @@ -5629,6 +5741,7 @@ VK_DESTROY void ReadbackVK::copyImageToBuffer(VkCommandBuffer _commandBuffer, VkBuffer _buffer, VkImageLayout _layout, VkImageAspectFlags _aspect, uint8_t _mip) const { + BGFX_PROFILER_SCOPE("ReadbackVK::copyImageToBuffer", kColorFrame); uint32_t mipWidth = bx::uint32_max(1, m_width >> _mip); uint32_t mipHeight = bx::uint32_max(1, m_height >> _mip); @@ -5686,6 +5799,7 @@ VK_DESTROY void ReadbackVK::readback(VkDeviceMemory _memory, VkDeviceSize _offset, void* _data, uint8_t _mip) const { + BGFX_PROFILER_SCOPE("ReadbackVK::readback", kColorResource); if (m_image == VK_NULL_HANDLE) { return; @@ -5711,6 +5825,7 @@ VK_DESTROY VkResult TextureVK::create(VkCommandBuffer _commandBuffer, uint32_t _width, uint32_t _height, uint64_t _flags, VkFormat _format) { + BGFX_PROFILER_SCOPE("TextureVK::create", kColorResource); BX_ASSERT(0 != (_flags & BGFX_TEXTURE_RT_MASK), ""); _flags |= BGFX_TEXTURE_RT_WRITE_ONLY; @@ -5745,6 +5860,7 @@ VK_DESTROY VkResult TextureVK::createImages(VkCommandBuffer _commandBuffer) { + BGFX_PROFILER_SCOPE("TextureVK::createImages", kColorResource); VkResult result = VK_SUCCESS; const VkAllocationCallbacks* allocatorCb = s_renderVK->m_allocatorCb; @@ -5874,6 +5990,7 @@ VK_DESTROY void* TextureVK::create(VkCommandBuffer _commandBuffer, const Memory* _mem, uint64_t _flags, uint8_t _skip) { + BGFX_PROFILER_SCOPE("TextureVK::create", kColorResource); bimg::ImageContainer imageContainer; if (bimg::imageParse(imageContainer, _mem->data, _mem->size) ) @@ -6100,34 +6217,53 @@ VK_DESTROY if (totalMemSize > 0) { const VkDevice device = s_renderVK->m_device; + const bimg::ImageBlockInfo &dstBlockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat)); - VkBuffer stagingBuffer; - VkDeviceMemory stagingDeviceMem; - VK_CHECK(s_renderVK->createStagingBuffer(totalMemSize, &stagingBuffer, &stagingDeviceMem) ); + StagingBufferVK stagingBuffer = s_renderVK->allocFromScratchStagingBuffer(totalMemSize, dstBlockInfo.blockSize); uint8_t* mappedMemory; - VK_CHECK(vkMapMemory( - device - , stagingDeviceMem - , 0 - , totalMemSize - , 0 - , (void**)&mappedMemory - ) ); + + if (!stagingBuffer.m_isFromScratch) + { + VK_CHECK(vkMapMemory( + device + , stagingBuffer.m_deviceMem + , 0 + , totalMemSize + , 0 + , (void**)&mappedMemory + ) ); + } + else + { + mappedMemory = stagingBuffer.m_data; + } // copy image to staging buffer for (uint32_t ii = 0; ii < numSrd; ++ii) { bx::memCopy(mappedMemory, imageInfos[ii].data, imageInfos[ii].size); mappedMemory += imageInfos[ii].size; + bufferCopyInfo[ii].bufferOffset += stagingBuffer.m_offset; + BX_ASSERT( + bx::uint32_mod(bufferCopyInfo[ii].bufferOffset, dstBlockInfo.blockSize) == 0 + , "Alignment for subimage %u is not aligned correctly (%u)." + , ii, bufferCopyInfo[ii].bufferOffset, dstBlockInfo.blockSize + ); } - vkUnmapMemory(device, stagingDeviceMem); + if (!stagingBuffer.m_isFromScratch) + { + vkUnmapMemory(device, stagingBuffer.m_deviceMem); + } - copyBufferToTexture(_commandBuffer, stagingBuffer, numSrd, bufferCopyInfo); + copyBufferToTexture(_commandBuffer, stagingBuffer.m_buffer, numSrd, bufferCopyInfo); - s_renderVK->release(stagingBuffer); - s_renderVK->release(stagingDeviceMem); + if (!stagingBuffer.m_isFromScratch) + { + s_renderVK->release(stagingBuffer.m_buffer); + s_renderVK->release(stagingBuffer.m_deviceMem); + } } else { @@ -6151,6 +6287,7 @@ VK_DESTROY void TextureVK::destroy() { + BGFX_PROFILER_SCOPE("TextureVK::destroy", kColorResource); m_readback.destroy(); if (VK_NULL_HANDLE != m_textureImage) @@ -6171,12 +6308,14 @@ VK_DESTROY void TextureVK::update(VkCommandBuffer _commandBuffer, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem) { + BGFX_PROFILER_SCOPE("TextureVK::update", kColorResource); const uint32_t bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(m_textureFormat) ); + const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat) ); uint32_t rectpitch = _rect.m_width * bpp / 8; uint32_t slicepitch = rectpitch * _rect.m_height; + uint32_t align = blockInfo.blockSize; if (bimg::isCompressed(bimg::TextureFormat::Enum(m_textureFormat) ) ) { - const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat) ); rectpitch = (_rect.m_width / blockInfo.blockWidth ) * blockInfo.blockSize; slicepitch = (_rect.m_height / blockInfo.blockHeight) * rectpitch; } @@ -6212,9 +6351,11 @@ VK_DESTROY }; } - VkBuffer stagingBuffer = VK_NULL_HANDLE; - VkDeviceMemory stagingDeviceMem = VK_NULL_HANDLE; - VK_CHECK(s_renderVK->createStagingBuffer(size, &stagingBuffer, &stagingDeviceMem, data) ); + StagingBufferVK stagingBuffer = s_renderVK->allocFromScratchStagingBuffer(size, align, data); + region.bufferOffset += stagingBuffer.m_offset; + BX_ASSERT(region.bufferOffset % align == 0, + "Alignment for image (mip %u, z %s) is not aligned correctly (%u).", + _mip, _z, region.bufferOffset, align); if (VK_IMAGE_VIEW_TYPE_3D == m_type) { @@ -6230,10 +6371,13 @@ VK_DESTROY region.imageSubresource.baseArrayLayer = _z; } - copyBufferToTexture(_commandBuffer, stagingBuffer, 1, ®ion); + copyBufferToTexture(_commandBuffer, stagingBuffer.m_buffer, 1, ®ion); - s_renderVK->release(stagingBuffer); - s_renderVK->release(stagingDeviceMem); + if (!stagingBuffer.m_isFromScratch) + { + s_renderVK->release(stagingBuffer.m_buffer); + s_renderVK->release(stagingBuffer.m_deviceMem); + } if (NULL != temp) { @@ -6243,6 +6387,7 @@ VK_DESTROY void TextureVK::resolve(VkCommandBuffer _commandBuffer, uint8_t _resolve, uint32_t _layer, uint32_t _numLayers, uint32_t _mip) { + BGFX_PROFILER_SCOPE("TextureVK::resolve", kColorResource); const bool needResolve = VK_NULL_HANDLE != m_singleMsaaImage; const bool needMipGen = true @@ -6250,11 +6395,19 @@ VK_DESTROY && 0 != (m_flags & BGFX_TEXTURE_RT_MASK) && 0 == (m_flags & BGFX_TEXTURE_RT_WRITE_ONLY) && (_mip + 1) < m_numMips - && 0 != (_resolve & BGFX_RESOLVE_AUTO_GEN_MIPS); + && 0 != (_resolve & BGFX_RESOLVE_AUTO_GEN_MIPS) + ; const VkImageLayout oldLayout = m_currentImageLayout; const VkImageLayout oldSingleMsaaLayout = m_currentSingleMsaaImageLayout; + const uint32_t numLayers = false + || m_type == VK_IMAGE_VIEW_TYPE_CUBE + || m_type == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY + ? m_numSides + : _numLayers + ; + if (needResolve) { setImageMemoryBarrier(_commandBuffer, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); @@ -6270,11 +6423,11 @@ VK_DESTROY resolve.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; resolve.srcSubresource.mipLevel = _mip; resolve.srcSubresource.baseArrayLayer = _layer; - resolve.srcSubresource.layerCount = _numLayers; + resolve.srcSubresource.layerCount = numLayers; resolve.dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; resolve.dstSubresource.mipLevel = _mip; resolve.dstSubresource.baseArrayLayer = _layer; - resolve.dstSubresource.layerCount = _numLayers; + resolve.dstSubresource.layerCount = numLayers; resolve.extent.width = m_width; resolve.extent.height = m_height; resolve.extent.depth = 1; @@ -6292,6 +6445,7 @@ VK_DESTROY if (needMipGen) { + BGFX_PROFILER_SCOPE("TextureVK::resolve genMipmaps", kColorResource); setImageMemoryBarrier(_commandBuffer, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); int32_t mipWidth = bx::max(int32_t(m_width) >> _mip, 1); @@ -6305,19 +6459,20 @@ VK_DESTROY VkImageBlit blit; blit.srcOffsets[0] = { 0, 0, 0 }; blit.srcOffsets[1] = { mipWidth, mipHeight, 1 }; - blit.srcSubresource.aspectMask = m_aspectMask; - blit.srcSubresource.mipLevel = 0; + blit.srcSubresource.aspectMask = m_aspectMask; + blit.srcSubresource.mipLevel = 0; blit.srcSubresource.baseArrayLayer = _layer; - blit.srcSubresource.layerCount = _numLayers; + blit.srcSubresource.layerCount = numLayers; blit.dstOffsets[0] = { 0, 0, 0 }; blit.dstOffsets[1] = { mipWidth, mipHeight, 1 }; - blit.dstSubresource.aspectMask = m_aspectMask; - blit.dstSubresource.mipLevel = 0; + blit.dstSubresource.aspectMask = m_aspectMask; + blit.dstSubresource.mipLevel = 0; blit.dstSubresource.baseArrayLayer = _layer; - blit.dstSubresource.layerCount = _numLayers; + blit.dstSubresource.layerCount = numLayers; for (uint32_t i = _mip + 1; i < m_numMips; i++) { + BGFX_PROFILER_SCOPE("mipmap", kColorResource); blit.srcOffsets[1] = { mipWidth, mipHeight, 1 }; blit.srcSubresource.mipLevel = i - 1; @@ -6336,7 +6491,7 @@ VK_DESTROY , blit.srcSubresource.mipLevel , 1 , _layer - , _numLayers + , numLayers ); vkCmdBlitImage( @@ -6360,7 +6515,7 @@ VK_DESTROY , _mip , m_numMips - _mip - 1 , _layer - , _numLayers + , numLayers ); } @@ -6370,6 +6525,7 @@ VK_DESTROY void TextureVK::copyBufferToTexture(VkCommandBuffer _commandBuffer, VkBuffer _stagingBuffer, uint32_t _bufferImageCopyCount, VkBufferImageCopy* _bufferImageCopy) { + BGFX_PROFILER_SCOPE("TextureVK::copyBufferToTexture", kColorResource); const VkImageLayout oldLayout = m_currentImageLayout == VK_IMAGE_LAYOUT_UNDEFINED ? m_sampledLayout : m_currentImageLayout @@ -6377,6 +6533,18 @@ VK_DESTROY setImageMemoryBarrier(_commandBuffer, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); + bimg::TextureFormat::Enum format = bimg::TextureFormat::Enum(m_textureFormat); + const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(format); + for (uint32_t ii = 0; ii < _bufferImageCopyCount; ++ii) + { + BX_ASSERT( + bx::uint32_mod(_bufferImageCopy[ii].bufferOffset, blockInfo.blockSize) == 0 + , "Misaligned texture of type %s to offset %u, which is not a multiple of %u." + , bimg::getName(format), _bufferImageCopy[ii].bufferOffset, blockInfo.blockSize + ); + } + BX_UNUSED(blockInfo); + vkCmdCopyBufferToImage( _commandBuffer , _stagingBuffer @@ -6560,7 +6728,10 @@ VK_DESTROY m_sci.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; m_sci.queueFamilyIndexCount = 0; m_sci.pQueueFamilyIndices = NULL; - m_sci.preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; + m_sci.preTransform = BX_ENABLED(BX_PLATFORM_NX) + ? VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR + : VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR + ; m_sci.oldSwapchain = VK_NULL_HANDLE; for (uint32_t ii = 0; ii < BX_COUNTOF(m_backBufferColorImageView); ++ii) @@ -6617,15 +6788,15 @@ VK_DESTROY { case ErrorState::AttachmentsCreated: releaseAttachments(); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::SwapChainCreated: releaseSwapChain(); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::SurfaceCreated: releaseSurface(); - BX_FALLTHROUGH; + [[fallthrough]]; case ErrorState::Default: break; @@ -6639,7 +6810,7 @@ VK_DESTROY void SwapChainVK::destroy() { - if (VK_NULL_HANDLE != m_swapchain) + if (VK_NULL_HANDLE != m_swapChain) { releaseFrameBuffer(); releaseAttachments(); @@ -6656,6 +6827,7 @@ VK_DESTROY void SwapChainVK::update(VkCommandBuffer _commandBuffer, void* _nwh, const Resolution& _resolution) { + BGFX_PROFILER_SCOPE("SwapChainVK::update", kColorFrame); const VkPhysicalDevice physicalDevice = s_renderVK->m_physicalDevice; m_lastImageRenderedSemaphore = VK_NULL_HANDLE; @@ -6672,6 +6844,7 @@ VK_DESTROY ; const bool recreateSwapchain = false + || m_needToRecreateSwapchain || m_resolution.format != _resolution.format || m_resolution.width != _resolution.width || m_resolution.height != _resolution.height @@ -6745,6 +6918,7 @@ VK_DESTROY VkResult SwapChainVK::createSurface() { + BGFX_PROFILER_SCOPE("SwapChainVK::createSurface", kColorFrame); VkResult result = VK_ERROR_INITIALIZATION_FAILED; const VkInstance instance = s_renderVK->m_instance; @@ -6761,6 +6935,7 @@ VK_DESTROY sci.hinstance = (HINSTANCE)GetModuleHandle(NULL); sci.hwnd = (HWND)m_nwh; result = vkCreateWin32SurfaceKHR(instance, &sci, allocatorCb, &m_surface); + BX_WARN(VK_SUCCESS == result, "vkCreateWin32SurfaceKHR failed %d: %s.", result, getName(result) ); } } #elif BX_PLATFORM_ANDROID @@ -6773,26 +6948,33 @@ VK_DESTROY sci.flags = 0; sci.window = (ANativeWindow*)m_nwh; result = vkCreateAndroidSurfaceKHR(instance, &sci, allocatorCb, &m_surface); + BX_WARN(VK_SUCCESS == result, "vkCreateAndroidSurfaceKHR failed %d: %s.", result, getName(result) ); } } #elif BX_PLATFORM_LINUX { -#if defined(WL_EGL_PLATFORM) - if (g_platformData.type == bgfx::NativeWindowHandleType::Wayland) + if (g_platformData.type == bgfx::NativeWindowHandleType::Wayland + && s_extension[Extension::KHR_wayland_surface].m_supported + && NULL != vkCreateWaylandSurfaceKHR + ) { + BX_TRACE("Attempting Wayland surface creation."); VkWaylandSurfaceCreateInfoKHR sci; sci.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR; sci.pNext = NULL; sci.flags = 0; sci.display = (wl_display*)g_platformData.ndt; - sci.surface = (wl_surface*)((wl_egl_window*)m_nwh)->surface; + sci.surface = (wl_surface*)m_nwh; result = vkCreateWaylandSurfaceKHR(instance, &sci, allocatorCb, &m_surface); + BX_WARN(VK_SUCCESS == result, "vkCreateWaylandSurfaceKHR failed %d: %s.", result, getName(result) ); } else -#endif // defined(WL_EGL_PLATFORM) { - if (NULL != vkCreateXlibSurfaceKHR) + if (s_extension[Extension::KHR_xlib_surface].m_supported + && NULL != vkCreateXlibSurfaceKHR + ) { + BX_TRACE("Attempting Xlib surface creation."); VkXlibSurfaceCreateInfoKHR sci; sci.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR; sci.pNext = NULL; @@ -6800,27 +6982,30 @@ VK_DESTROY sci.dpy = (Display*)g_platformData.ndt; sci.window = (Window)m_nwh; result = vkCreateXlibSurfaceKHR(instance, &sci, allocatorCb, &m_surface); + BX_WARN(VK_SUCCESS == result, "vkCreateXlibSurfaceKHR failed %d: %s.", result, getName(result) ); } - if (VK_SUCCESS != result) + if (VK_SUCCESS != result + && s_extension[Extension::KHR_xcb_surface].m_supported + && NULL != vkCreateXcbSurfaceKHR + ) { void* xcbdll = bx::dlopen("libX11-xcb.so.1"); - if (NULL != xcbdll - && NULL != vkCreateXcbSurfaceKHR) + if (NULL != xcbdll) { + BX_TRACE("Attempting XCB surface creation."); typedef xcb_connection_t* (*PFN_XGETXCBCONNECTION)(Display*); PFN_XGETXCBCONNECTION XGetXCBConnection = (PFN_XGETXCBCONNECTION)bx::dlsym(xcbdll, "XGetXCBConnection"); - union { void* ptr; xcb_window_t window; } cast = { m_nwh }; - VkXcbSurfaceCreateInfoKHR sci; sci.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; sci.pNext = NULL; sci.flags = 0; sci.connection = XGetXCBConnection( (Display*)g_platformData.ndt); - sci.window = cast.window; + sci.window = bx::narrowCast(uintptr_t(m_nwh) ); result = vkCreateXcbSurfaceKHR(instance, &sci, allocatorCb, &m_surface); + BX_WARN(VK_SUCCESS == result, "vkCreateXcbSurfaceKHR failed %d: %s.", result, getName(result) ); bx::dlclose(xcbdll); } @@ -6865,8 +7050,20 @@ VK_DESTROY sci.flags = 0; sci.pView = (__bridge void*)layer; result = vkCreateMacOSSurfaceMVK(instance, &sci, allocatorCb, &m_surface); + BX_WARN(VK_SUCCESS == result, "vkCreateMacOSSurfaceMVK failed %d: %s.", result, getName(result) ); } } +#elif BX_PLATFORM_NX + if (NULL != vkCreateViSurfaceNN) + { + VkViSurfaceCreateInfoNN sci; + sci.sType = VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN; + sci.pNext = NULL; + sci.flags = 0; + sci.window = m_nwh; + result = vkCreateViSurfaceNN(instance, &sci, allocatorCb, &m_surface); + BX_WARN(VK_SUCCESS == result, "vkCreateViSurfaceNN failed %d: %s.", result, getName(result) ); + } #else # error "Figure out KHR surface..." #endif // BX_PLATFORM_ @@ -6902,12 +7099,20 @@ VK_DESTROY VkResult SwapChainVK::createSwapChain() { + BGFX_PROFILER_SCOPE("SwapChainVK::createSwapchain", kColorFrame); VkResult result = VK_SUCCESS; const VkPhysicalDevice physicalDevice = s_renderVK->m_physicalDevice; const VkDevice device = s_renderVK->m_device; const VkAllocationCallbacks* allocatorCb = s_renderVK->m_allocatorCb; + // Waiting for the device to be idle seems to get rid of VK_DEVICE_LOST + // upon resizing the window quickly. See: + // - https://github.com/mpv-player/mpv/issues/8360 + // - https://github.com/bkaradzic/bgfx/issues/3227 + result = vkDeviceWaitIdle(device); + BX_WARN(VK_SUCCESS == result, "Create swapchain error: vkDeviceWaitIdle() failed: %d: %s", result, getName(result)); + VkSurfaceCapabilitiesKHR surfaceCapabilities; result = vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, m_surface, &surfaceCapabilities); @@ -6961,6 +7166,15 @@ VK_DESTROY , surfaceCapabilities.minImageExtent.height , surfaceCapabilities.maxImageExtent.height ); + if (width != m_resolution.width || height != m_resolution.height) + { + BX_TRACE("Clamped swapchain resolution from %dx%d to %dx%d" + , m_resolution.width + , m_resolution.height + , width + , height + ); + } VkCompositeAlphaFlagBitsKHR compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; @@ -7006,41 +7220,47 @@ VK_DESTROY m_sci.presentMode = s_presentMode[presentModeIdx].mode; m_sci.clipped = VK_FALSE; - result = vkCreateSwapchainKHR(device, &m_sci, allocatorCb, &m_swapchain); + result = vkCreateSwapchainKHR(device, &m_sci, allocatorCb, &m_swapChain); if (VK_SUCCESS != result) { BX_TRACE("Create swapchain error: vkCreateSwapchainKHR failed %d: %s.", result, getName(result) ); return result; } - m_sci.oldSwapchain = m_swapchain; + m_sci.oldSwapchain = m_swapChain; - result = vkGetSwapchainImagesKHR(device, m_swapchain, &m_numSwapchainImages, NULL); + result = vkGetSwapchainImagesKHR(device, m_swapChain, &m_numSwapChainImages, NULL); if (VK_SUCCESS != result) { BX_TRACE("Create swapchain error: vkGetSwapchainImagesKHR failed %d: %s.", result, getName(result) ); return result; } - if (m_numSwapchainImages < m_sci.minImageCount) + BX_TRACE("Create swapchain numSwapChainImages %d, minImageCount %d, BX_COUNTOF(m_backBufferColorImage) %d" + , m_numSwapChainImages + , m_sci.minImageCount + , BX_COUNTOF(m_backBufferColorImage) + ); + + if (m_numSwapChainImages < m_sci.minImageCount) { BX_TRACE("Create swapchain error: vkGetSwapchainImagesKHR: numSwapchainImages %d < minImageCount %d." - , m_numSwapchainImages + , m_numSwapChainImages , m_sci.minImageCount ); return VK_ERROR_INITIALIZATION_FAILED; } - if (m_numSwapchainImages > BX_COUNTOF(m_backBufferColorImage) ) + if (m_numSwapChainImages > BX_COUNTOF(m_backBufferColorImage) ) { BX_TRACE("Create swapchain error: vkGetSwapchainImagesKHR: numSwapchainImages %d > countof(m_backBufferColorImage) %d." - , m_numSwapchainImages + , m_numSwapChainImages , BX_COUNTOF(m_backBufferColorImage) ); return VK_ERROR_INITIALIZATION_FAILED; } - result = vkGetSwapchainImagesKHR(device, m_swapchain, &m_numSwapchainImages, &m_backBufferColorImage[0]); + result = vkGetSwapchainImagesKHR(device, m_swapChain, &m_numSwapChainImages, &m_backBufferColorImage[0]); if (VK_SUCCESS != result && VK_INCOMPLETE != result) { BX_TRACE("Create swapchain error: vkGetSwapchainImagesKHR failed %d: %s." @@ -7066,7 +7286,7 @@ VK_DESTROY ivci.subresourceRange.baseArrayLayer = 0; ivci.subresourceRange.layerCount = 1; - for (uint32_t ii = 0; ii < m_numSwapchainImages; ++ii) + for (uint32_t ii = 0; ii < m_numSwapChainImages; ++ii) { ivci.image = m_backBufferColorImage[ii]; @@ -7081,12 +7301,17 @@ VK_DESTROY m_backBufferColorImageLayout[ii] = VK_IMAGE_LAYOUT_UNDEFINED; } + BX_TRACE("Succesfully created swapchain (%dx%d) with %d images.", width, height, m_numSwapChainImages); + VkSemaphoreCreateInfo sci; sci.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; sci.pNext = NULL; sci.flags = 0; - for (uint32_t ii = 0; ii < m_numSwapchainImages; ++ii) + // We will make a fully filled pool of semaphores and cycle through those. + // This is to make sure we have enough, even in the case where there are + // more frames in flight than images on the swapchain. + for (uint32_t ii = 0; ii < kMaxBackBuffers; ++ii) { if (VK_SUCCESS != vkCreateSemaphore(device, &sci, allocatorCb, &m_presentDoneSemaphore[ii]) || VK_SUCCESS != vkCreateSemaphore(device, &sci, allocatorCb, &m_renderDoneSemaphore[ii]) ) @@ -7100,28 +7325,33 @@ VK_DESTROY m_currentSemaphore = 0; m_needPresent = false; - m_needToRefreshSwapchain = false; + m_needToRecreateSwapchain = false; return result; } void SwapChainVK::releaseSwapChain() { + BGFX_PROFILER_SCOPE("SwapChainVK::releaseSwapChain", kColorFrame); for (uint32_t ii = 0; ii < BX_COUNTOF(m_backBufferColorImageView); ++ii) { release(m_backBufferColorImageView[ii]); m_backBufferFence[ii] = VK_NULL_HANDLE; + } + for (uint32_t ii = 0; ii < kMaxBackBuffers; ++ii) + { release(m_presentDoneSemaphore[ii]); release(m_renderDoneSemaphore[ii]); } - release(m_swapchain); + release(m_swapChain); } VkResult SwapChainVK::createAttachments(VkCommandBuffer _commandBuffer) { + BGFX_PROFILER_SCOPE("SwapChainVK::createAttachments", kColorFrame); VkResult result = VK_SUCCESS; const uint32_t samplerIndex = (m_resolution.reset & BGFX_RESET_MSAA_MASK) >> BGFX_RESET_MSAA_SHIFT; @@ -7197,6 +7427,7 @@ VK_DESTROY void SwapChainVK::releaseAttachments() { + BGFX_PROFILER_SCOPE("SwapChainVK::releaseAttachments", kColorFrame); release(m_backBufferDepthStencilImageView); release(m_backBufferColorMsaaImageView); @@ -7206,6 +7437,7 @@ VK_DESTROY VkResult SwapChainVK::createFrameBuffer() { + BGFX_PROFILER_SCOPE("SwapChainVK::createFrameBuffer", kColorFrame); VkResult result = VK_SUCCESS; const VkDevice device = s_renderVK->m_device; @@ -7219,7 +7451,7 @@ VK_DESTROY return result; } - for (uint32_t ii = 0; ii < m_numSwapchainImages; ++ii) + for (uint32_t ii = 0; ii < m_numSwapChainImages; ++ii) { uint32_t numAttachments = 2; ::VkImageView attachments[3] = @@ -7267,6 +7499,7 @@ VK_DESTROY uint32_t SwapChainVK::findPresentMode(bool _vsync) { + BGFX_PROFILER_SCOPE("SwapChainVK::findPresentMode", kColorFrame); VkResult result = VK_SUCCESS; const VkPhysicalDevice physicalDevice = s_renderVK->m_physicalDevice; @@ -7328,6 +7561,7 @@ VK_DESTROY TextureFormat::Enum SwapChainVK::findSurfaceFormat(TextureFormat::Enum _format, VkColorSpaceKHR _colorSpace, bool _srgb) { + BGFX_PROFILER_SCOPE("SwapChainVK::findSurfaceFormat", kColorFrame); VkResult result = VK_SUCCESS; TextureFormat::Enum selectedFormat = TextureFormat::Count; @@ -7375,9 +7609,9 @@ VK_DESTROY { selectedFormat = requested; if (0 != ii - && s_renderVK->m_swapchainFormats[_format] != selectedFormat) + && s_renderVK->m_swapChainFormats[_format] != selectedFormat) { - s_renderVK->m_swapchainFormats[_format] = selectedFormat; + s_renderVK->m_swapChainFormats[_format] = selectedFormat; BX_TRACE( "findSurfaceFormat: Surface format %s not found! Defaulting to %s." , bimg::getName(bimg::TextureFormat::Enum(_format) ) @@ -7401,8 +7635,9 @@ VK_DESTROY bool SwapChainVK::acquire(VkCommandBuffer _commandBuffer) { - if (VK_NULL_HANDLE == m_swapchain - || m_needToRefreshSwapchain) + BGFX_PROFILER_SCOPE("SwapChainVK::acquire", kColorFrame); + if (VK_NULL_HANDLE == m_swapChain + || m_needToRecreateSwapchain) { return false; } @@ -7413,16 +7648,26 @@ VK_DESTROY m_lastImageAcquiredSemaphore = m_presentDoneSemaphore[m_currentSemaphore]; m_lastImageRenderedSemaphore = m_renderDoneSemaphore[m_currentSemaphore]; - m_currentSemaphore = (m_currentSemaphore + 1) % m_numSwapchainImages; - - VkResult result = vkAcquireNextImageKHR( - device - , m_swapchain - , UINT64_MAX - , m_lastImageAcquiredSemaphore - , VK_NULL_HANDLE - , &m_backBufferColorIdx - ); + m_currentSemaphore = (m_currentSemaphore + 1) % kMaxBackBuffers; + + VkResult result; + { + BGFX_PROFILER_SCOPE("vkAcquireNextImageKHR", kColorFrame); + result = vkAcquireNextImageKHR( + device + , m_swapChain + , UINT64_MAX + , m_lastImageAcquiredSemaphore + , VK_NULL_HANDLE + , &m_backBufferColorIdx + ); + } + + + if (result != VK_SUCCESS) + { + BX_TRACE("vkAcquireNextImageKHR(...): result = %s", getName(result)); + } switch (result) { @@ -7431,11 +7676,12 @@ VK_DESTROY case VK_ERROR_SURFACE_LOST_KHR: m_needToRecreateSurface = true; - BX_FALLTHROUGH; + m_needToRecreateSwapchain = true; + return false; case VK_ERROR_OUT_OF_DATE_KHR: case VK_SUBOPTIMAL_KHR: - m_needToRefreshSwapchain = true; + m_needToRecreateSwapchain = true; return false; default: @@ -7445,6 +7691,7 @@ VK_DESTROY if (VK_NULL_HANDLE != m_backBufferFence[m_backBufferColorIdx]) { + BGFX_PROFILER_SCOPE("vkWaitForFences", kColorFrame); VK_CHECK(vkWaitForFences( device , 1 @@ -7464,7 +7711,8 @@ VK_DESTROY void SwapChainVK::present() { - if (VK_NULL_HANDLE != m_swapchain + BGFX_PROFILER_SCOPE("SwapChainVk::present", kColorFrame); + if (VK_NULL_HANDLE != m_swapChain && m_needPresent) { VkPresentInfoKHR pi; @@ -7473,20 +7721,30 @@ VK_DESTROY pi.waitSemaphoreCount = 1; pi.pWaitSemaphores = &m_lastImageRenderedSemaphore; pi.swapchainCount = 1; - pi.pSwapchains = &m_swapchain; + pi.pSwapchains = &m_swapChain; pi.pImageIndices = &m_backBufferColorIdx; pi.pResults = NULL; - VkResult result = vkQueuePresentKHR(m_queue, &pi); + VkResult result; + { + BGFX_PROFILER_SCOPE("vkQueuePresentHKR", kColorFrame); + result = vkQueuePresentKHR(m_queue, &pi); + } + + if (result != VK_SUCCESS) + { + BX_TRACE("vkQueuePresentKHR(...): result = %s", getName(result)); + } switch (result) { case VK_ERROR_SURFACE_LOST_KHR: m_needToRecreateSurface = true; - BX_FALLTHROUGH; + m_needToRecreateSwapchain = true; + break; case VK_ERROR_OUT_OF_DATE_KHR: case VK_SUBOPTIMAL_KHR: - m_needToRefreshSwapchain = true; + m_needToRecreateSwapchain = true; break; default: @@ -7525,6 +7783,7 @@ VK_DESTROY void FrameBufferVK::create(uint8_t _num, const Attachment* _attachment) { + BGFX_PROFILER_SCOPE("FrameBufferVK::create", kColorFrame); m_numTh = _num; bx::memCopy(m_attachment, _attachment, sizeof(Attachment) * _num); @@ -7533,6 +7792,7 @@ VK_DESTROY VkResult FrameBufferVK::create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _format, TextureFormat::Enum _depthFormat) { + BGFX_PROFILER_SCOPE("FrameBufferVK::create", kColorFrame); VkResult result = VK_SUCCESS; Resolution resolution = s_renderVK->m_resolution; @@ -7569,6 +7829,7 @@ VK_DESTROY void FrameBufferVK::preReset() { + BGFX_PROFILER_SCOPE("FrameBufferVK::preReset", kColorFrame); if (VK_NULL_HANDLE != m_framebuffer) { s_renderVK->release(m_framebuffer); @@ -7582,6 +7843,7 @@ VK_DESTROY void FrameBufferVK::postReset() { + BGFX_PROFILER_SCOPE("FrameBufferVK::postReset", kColorFrame); if (m_numTh > 0) { const VkDevice device = s_renderVK->m_device; @@ -7642,10 +7904,13 @@ VK_DESTROY void FrameBufferVK::update(VkCommandBuffer _commandBuffer, const Resolution& _resolution) { + BGFX_PROFILER_SCOPE("FrameBufferVK::update", kColorResource); m_swapChain.update(_commandBuffer, m_nwh, _resolution); VK_CHECK(s_renderVK->getRenderPass(m_swapChain, &m_renderPass) ); - m_width = _resolution.width; - m_height = _resolution.height; + // Don't believe the passed Resolution, as the Vulkan driver might have + // specified another resolution, which we had to obey. + m_width = m_swapChain.m_sci.imageExtent.width; + m_height = m_swapChain.m_sci.imageExtent.height; m_sampler = m_swapChain.m_sampler; } @@ -7656,6 +7921,7 @@ VK_DESTROY return; } + BGFX_PROFILER_SCOPE("FrameBufferVK::resolve", kColorFrame); if (NULL == m_nwh) { for (uint32_t ii = 0; ii < m_numTh; ++ii) @@ -7687,6 +7953,7 @@ VK_DESTROY uint16_t FrameBufferVK::destroy() { + BGFX_PROFILER_SCOPE("FrameBufferVK::destroy", kColorFrame); preReset(); if (NULL != m_nwh) @@ -7709,6 +7976,7 @@ VK_DESTROY bool FrameBufferVK::acquire(VkCommandBuffer _commandBuffer) { + BGFX_PROFILER_SCOPE("FrameBufferVK::acquire", kColorFrame); bool acquired = true; if (NULL != m_nwh) @@ -7725,6 +7993,7 @@ VK_DESTROY void FrameBufferVK::present() { + BGFX_PROFILER_SCOPE("FrameBufferVK::present", kColorFrame); m_swapChain.present(); m_needPresent = false; } @@ -7743,6 +8012,7 @@ VK_DESTROY m_queue = _queue; m_numFramesInFlight = bx::clamp(_numFramesInFlight, 1, BGFX_CONFIG_MAX_FRAME_LATENCY); m_activeCommandBuffer = VK_NULL_HANDLE; + m_consumeIndex = 0; return reset(); } @@ -7843,6 +8113,7 @@ VK_DESTROY VkResult CommandQueueVK::alloc(VkCommandBuffer* _commandBuffer) { + BGFX_PROFILER_SCOPE("CommandQueueVK::alloc", kColorResource); VkResult result = VK_SUCCESS; if (m_activeCommandBuffer == VK_NULL_HANDLE) @@ -7850,7 +8121,10 @@ VK_DESTROY const VkDevice device = s_renderVK->m_device; CommandList& commandList = m_commandList[m_currentFrameInFlight]; - result = vkWaitForFences(device, 1, &commandList.m_fence, VK_TRUE, UINT64_MAX); + { + BGFX_PROFILER_SCOPE("vkWaitForFences", kColorFrame); + result = vkWaitForFences(device, 1, &commandList.m_fence, VK_TRUE, UINT64_MAX); + } if (VK_SUCCESS != result) { @@ -7911,6 +8185,7 @@ VK_DESTROY void CommandQueueVK::kick(bool _wait) { + BGFX_PROFILER_SCOPE("CommandQueueVK::kick", kColorDraw); if (VK_NULL_HANDLE != m_activeCommandBuffer) { const VkDevice device = s_renderVK->m_device; @@ -7942,10 +8217,14 @@ VK_DESTROY m_numWaitSemaphores = 0; m_numSignalSemaphores = 0; - VK_CHECK(vkQueueSubmit(m_queue, 1, &si, m_completedFence) ); + { + BGFX_PROFILER_SCOPE("CommandQueueVK::kick vkQueueSubmit", kColorDraw); + VK_CHECK(vkQueueSubmit(m_queue, 1, &si, m_completedFence) ); + } if (_wait) { + BGFX_PROFILER_SCOPE("CommandQueue::kick vkWaitForFences", kColorDraw); VK_CHECK(vkWaitForFences(device, 1, &m_completedFence, VK_TRUE, UINT64_MAX) ); } @@ -7958,6 +8237,7 @@ VK_DESTROY void CommandQueueVK::finish(bool _finishAll) { + BGFX_PROFILER_SCOPE("CommandQueueVK::finish", kColorDraw); if (_finishAll) { for (uint32_t ii = 0; ii < m_numFramesInFlight; ++ii) @@ -7983,6 +8263,7 @@ VK_DESTROY void CommandQueueVK::consume() { + BGFX_PROFILER_SCOPE("CommandQueueVK::consume", kColorResource); m_consumeIndex = (m_consumeIndex + 1) % m_numFramesInFlight; for (const Resource& resource : m_release[m_consumeIndex]) @@ -8014,6 +8295,7 @@ VK_DESTROY void RendererContextVK::submitBlit(BlitState& _bs, uint16_t _view) { + BGFX_PROFILER_SCOPE("RendererContextVK::submitBlit", kColorFrame); VkImageLayout srcLayouts[BGFX_CONFIG_MAX_BLIT_ITEMS]; VkImageLayout dstLayouts[BGFX_CONFIG_MAX_BLIT_ITEMS]; @@ -8221,6 +8503,9 @@ VK_DESTROY ScratchBufferVK& scratchBuffer = m_scratchBuffer[m_cmd.m_currentFrameInFlight]; scratchBuffer.reset(); + ScratchBufferVK& scratchStagingBuffer = m_scratchStagingBuffer[m_cmd.m_currentFrameInFlight]; + scratchStagingBuffer.reset(); + setMemoryBarrier( m_commandBuffer , VK_PIPELINE_STAGE_TRANSFER_BIT @@ -8304,12 +8589,26 @@ VK_DESTROY if (isFrameBufferValid) { viewState.m_rect = _render->m_view[view].m_rect; - const Rect& rect = _render->m_view[view].m_rect; - const Rect& scissorRect = _render->m_view[view].m_scissor; + Rect rect = _render->m_view[view].m_rect; + Rect scissorRect = _render->m_view[view].m_scissor; viewHasScissor = !scissorRect.isZero(); viewScissorRect = viewHasScissor ? scissorRect : rect; restoreScissor = false; + // Clamp the rect to what's valid according to Vulkan. + rect.m_width = bx::min(rect.m_width, fb.m_width - rect.m_x); + rect.m_height = bx::min(rect.m_height, fb.m_height - rect.m_y); + if (_render->m_view[view].m_rect.m_width != rect.m_width + || _render->m_view[view].m_rect.m_height != rect.m_height) + { + BX_TRACE("Clamp render pass from %dx%d to %dx%d" + , _render->m_view[view].m_rect.m_width + , _render->m_view[view].m_rect.m_height + , rect.m_width + , rect.m_height + ); + } + rpbi.framebuffer = fb.m_currentFramebuffer; rpbi.renderPass = fb.m_renderPass; rpbi.renderArea.offset.x = rect.m_x; @@ -8462,7 +8761,7 @@ VK_DESTROY { const VertexBufferVK& vb = m_vertexBuffers[compute.m_indirectBuffer.idx]; - uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect + uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE : compute.m_numIndirect ; @@ -8778,7 +9077,7 @@ VK_DESTROY { const VertexBufferVK& vb = m_vertexBuffers[draw.m_indirectBuffer.idx]; bufferIndirect = vb.m_buffer; - numDrawIndirect = UINT16_MAX == draw.m_numIndirect + numDrawIndirect = UINT32_MAX == draw.m_numIndirect ? vb.m_size / BGFX_CONFIG_DRAW_INDIRECT_STRIDE : draw.m_numIndirect ; @@ -9083,7 +9382,7 @@ VK_DESTROY } pos = 10; - tvm.printf(10, pos++, 0x8b, " Frame: % 7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS " + tvm.printf(10, pos++, 0x8b, " Frame: % 7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS" , double(frameTime)*toMs , double(min)*toMs , double(max)*toMs @@ -9104,11 +9403,14 @@ VK_DESTROY ); double elapsedCpuMs = double(frameTime)*toMs; - tvm.printf(10, pos++, 0x8b, " Submitted: %5d (draw %5d, compute %4d) / CPU %7.4f [ms] " + tvm.printf(10, pos++, 0x8b, " Submitted: %5d (draw %5d, compute %4d) / CPU %7.4f [ms] %c GPU %7.4f [ms] (latency %d) " , _render->m_numRenderItems , statsKeyType[0] , statsKeyType[1] , elapsedCpuMs + , elapsedCpuMs > maxGpuElapsed ? '>' : '<' + , maxGpuElapsed + , maxGpuLatency ); for (uint32_t ii = 0; ii < Topology::Count; ++ii) @@ -9127,7 +9429,6 @@ VK_DESTROY } tvm.printf(10, pos++, 0x8b, " Indices: %7d ", statsNumIndices); -// tvm.printf(10, pos++, 0x8b, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax); tvm.printf(10, pos++, 0x8b, " DVB size: %7d ", _render->m_vboffset); tvm.printf(10, pos++, 0x8b, " DIB size: %7d ", _render->m_iboffset); @@ -9174,7 +9475,15 @@ VK_DESTROY m_presentElapsed = 0; - scratchBuffer.flush(); + { + BGFX_PROFILER_SCOPE("scratchBuffer::flush", kColorResource); + scratchBuffer.flush(); + } + + { + BGFX_PROFILER_SCOPE("scratchStagingBuffer::flush", kColorResource); + scratchStagingBuffer.flush(); + } for (uint16_t ii = 0; ii < m_numWindows; ++ii) { diff --git a/bgfx/src/renderer_vk.h b/bgfx/src/renderer_vk.h index 3f0c75dc..f89b58cb 100644 --- a/bgfx/src/renderer_vk.h +++ b/bgfx/src/renderer_vk.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -8,37 +8,29 @@ #if BX_PLATFORM_ANDROID # define VK_USE_PLATFORM_ANDROID_KHR -# define KHR_SURFACE_EXTENSION_NAME VK_KHR_ANDROID_SURFACE_EXTENSION_NAME # define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_ANDROID #elif BX_PLATFORM_LINUX -# if defined(WL_EGL_PLATFORM) -# define VK_USE_PLATFORM_WAYLAND_KHR -# endif // defined(WL_EGL_PLATFORM) +# define VK_USE_PLATFORM_WAYLAND_KHR # define VK_USE_PLATFORM_XLIB_KHR # define VK_USE_PLATFORM_XCB_KHR -# if defined(WL_EGL_PLATFORM) -# define KHR_SURFACE_EXTENSION_NAME VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, \ - VK_KHR_XCB_SURFACE_EXTENSION_NAME -# else -# define KHR_SURFACE_EXTENSION_NAME VK_KHR_XCB_SURFACE_EXTENSION_NAME -# endif // defined(WL_EGL_PLATFORM) # define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_LINUX #elif BX_PLATFORM_WINDOWS # define VK_USE_PLATFORM_WIN32_KHR -# define KHR_SURFACE_EXTENSION_NAME VK_KHR_WIN32_SURFACE_EXTENSION_NAME # define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_WINDOWS #elif BX_PLATFORM_OSX # define VK_USE_PLATFORM_MACOS_MVK -# define KHR_SURFACE_EXTENSION_NAME VK_MVK_MACOS_SURFACE_EXTENSION_NAME # define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_MACOS +#elif BX_PLATFORM_NX +# define VK_USE_PLATFORM_VI_NN +# define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_NX #else -# define KHR_SURFACE_EXTENSION_NAME "" # define VK_IMPORT_INSTANCE_PLATFORM #endif // BX_PLATFORM_* #define VK_NO_STDINT_H #define VK_NO_PROTOTYPES #include +#include // vulkan.h pulls X11 crap... #if defined(None) @@ -69,7 +61,6 @@ /* VK_KHR_android_surface */ \ VK_IMPORT_INSTANCE_FUNC(true, vkCreateAndroidSurfaceKHR); \ -#if defined(WL_EGL_PLATFORM) #define VK_IMPORT_INSTANCE_LINUX \ /* VK_KHR_wayland_surface */ \ VK_IMPORT_INSTANCE_FUNC(true, vkCreateWaylandSurfaceKHR); \ @@ -81,17 +72,6 @@ VK_IMPORT_INSTANCE_FUNC(true, vkCreateXcbSurfaceKHR); \ VK_IMPORT_INSTANCE_FUNC(true, vkGetPhysicalDeviceXcbPresentationSupportKHR); \ -#else -#define VK_IMPORT_INSTANCE_LINUX \ - /* VK_KHR_xlib_surface */ \ - VK_IMPORT_INSTANCE_FUNC(true, vkCreateXlibSurfaceKHR); \ - VK_IMPORT_INSTANCE_FUNC(true, vkGetPhysicalDeviceXlibPresentationSupportKHR); \ - /* VK_KHR_xcb_surface */ \ - VK_IMPORT_INSTANCE_FUNC(true, vkCreateXcbSurfaceKHR); \ - VK_IMPORT_INSTANCE_FUNC(true, vkGetPhysicalDeviceXcbPresentationSupportKHR); \ - -#endif // defined(WL_EGL_PLATFORM) - #define VK_IMPORT_INSTANCE_WINDOWS \ /* VK_KHR_win32_surface */ \ VK_IMPORT_INSTANCE_FUNC(true, vkCreateWin32SurfaceKHR); \ @@ -101,6 +81,10 @@ /* VK_MVK_macos_surface */ \ VK_IMPORT_INSTANCE_FUNC(true, vkCreateMacOSSurfaceMVK); \ +#define VK_IMPORT_INSTANCE_NX \ + /* VK_NN_vi_surface */ \ + VK_IMPORT_INSTANCE_FUNC(true, vkCreateViSurfaceNN); \ + #define VK_IMPORT_INSTANCE \ VK_IMPORT_INSTANCE_FUNC(false, vkDestroyInstance); \ VK_IMPORT_INSTANCE_FUNC(false, vkEnumeratePhysicalDevices); \ @@ -323,7 +307,7 @@ namespace bgfx { namespace vk ::Vk##_name* operator &() { return &vk; } \ const ::Vk##_name* operator &() const { return &vk; } \ }; \ - BX_STATIC_ASSERT(sizeof(::Vk##_name) == sizeof(Vk##_name) ); \ + static_assert(sizeof(::Vk##_name) == sizeof(Vk##_name) ); \ void vkDestroy(Vk##_name&); \ void release(Vk##_name&) VK_DESTROY @@ -388,6 +372,17 @@ VK_DESTROY_FUNC(DescriptorSet); HashMap m_hashMap; }; + struct StagingBufferVK + { + VkBuffer m_buffer; + VkDeviceMemory m_deviceMem; + + uint8_t* m_data; + uint32_t m_size; + uint32_t m_offset; + bool m_isFromScratch; + }; + class ScratchBufferVK { public: @@ -399,17 +394,22 @@ VK_DESTROY_FUNC(DescriptorSet); { } - void create(uint32_t _size, uint32_t _count); + void create(uint32_t _size, uint32_t _count, VkBufferUsageFlags _usage, uint32_t align); + void createUniform(uint32_t _size, uint32_t _count); + void createStaging(uint32_t _size); void destroy(); void reset(); - uint32_t write(const void* _data, uint32_t _size); + uint32_t alloc(uint32_t _size, uint32_t _minAlign = 1); + uint32_t write(const void* _data, uint32_t _size, uint32_t _minAlign = 1); void flush(); VkBuffer m_buffer; VkDeviceMemory m_deviceMem; + uint8_t* m_data; uint32_t m_size; uint32_t m_pos; + uint32_t m_align; }; struct BufferVK @@ -704,7 +704,7 @@ VK_DESTROY_FUNC(DescriptorSet); { SwapChainVK() : m_nwh(NULL) - , m_swapchain(VK_NULL_HANDLE) + , m_swapChain(VK_NULL_HANDLE) , m_lastImageRenderedSemaphore(VK_NULL_HANDLE) , m_lastImageAcquiredSemaphore(VK_NULL_HANDLE) , m_backBufferColorMsaaImageView(VK_NULL_HANDLE) @@ -745,8 +745,8 @@ VK_DESTROY_FUNC(DescriptorSet); TextureFormat::Enum m_depthFormat; VkSurfaceKHR m_surface; - VkSwapchainKHR m_swapchain; - uint32_t m_numSwapchainImages; + VkSwapchainKHR m_swapChain; + uint32_t m_numSwapChainImages; VkImageLayout m_backBufferColorImageLayout[kMaxBackBuffers]; VkImage m_backBufferColorImage[kMaxBackBuffers]; VkImageView m_backBufferColorImageView[kMaxBackBuffers]; @@ -762,7 +762,7 @@ VK_DESTROY_FUNC(DescriptorSet); VkSemaphore m_lastImageAcquiredSemaphore; bool m_needPresent; - bool m_needToRefreshSwapchain; + bool m_needToRecreateSwapchain; bool m_needToRecreateSurface; TextureVK m_backBufferDepthStencil; diff --git a/bgfx/src/renderer_webgpu.cpp b/bgfx/src/renderer_webgpu.cpp deleted file mode 100644 index ba18f7b6..00000000 --- a/bgfx/src/renderer_webgpu.cpp +++ /dev/null @@ -1,5019 +0,0 @@ -/* - * Copyright 2011-2019 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE - */ - -#include "bgfx_p.h" - -//#define DAWN_ENABLE_BACKEND_D3D12 -#define DAWN_ENABLE_BACKEND_VULKAN - -#if BGFX_CONFIG_RENDERER_WEBGPU -# include "renderer_webgpu.h" -# include "renderer.h" -# include "debug_renderdoc.h" -# include "emscripten.h" -# include "shader_spirv.h" - -# if BX_PLATFORM_ANDROID -# define VK_USE_PLATFORM_ANDROID_KHR -# elif BX_PLATFORM_LINUX -# define VK_USE_PLATFORM_XLIB_KHR -# define VK_USE_PLATFORM_XCB_KHR -# elif BX_PLATFORM_WINDOWS -# define VK_USE_PLATFORM_WIN32_KHR -# elif BX_PLATFORM_OSX -# define VK_USE_PLATFORM_MACOS_MVK -# endif // BX_PLATFORM_* - -# define VK_NO_STDINT_H -# define VK_NO_PROTOTYPES -# include - -# if BX_PLATFORM_EMSCRIPTEN -# include "emscripten.h" -# include "emscripten/html5_webgpu.h" -# else -# ifdef DAWN_ENABLE_BACKEND_D3D12 -# include -# endif // !BX_PLATFORM_EMSCRIPTEN - -# ifdef DAWN_ENABLE_BACKEND_VULKAN -# include -# endif // DAWN_ENABLE_BACKEND_VULKAN - -# include -# include -# include -# endif // !BX_PLATFORM_EMSCRIPTEN - -namespace bgfx { namespace webgpu -{ - // TODO (hugoam) cleanup - template - T defaultDescriptor() { return T(); } - - template <> wgpu::BlendComponent defaultDescriptor() { return { wgpu::BlendOperation::Add, wgpu::BlendFactor::One, wgpu::BlendFactor::Zero }; } - template <> wgpu::ColorTargetState defaultDescriptor() { return { NULL, wgpu::TextureFormat::RGBA8Unorm, NULL, wgpu::ColorWriteMask::All }; } - template <> wgpu::StencilFaceState defaultDescriptor() { return { wgpu::CompareFunction::Always, wgpu::StencilOperation::Keep, wgpu::StencilOperation::Keep, wgpu::StencilOperation::Keep }; } - template <> wgpu::VertexState defaultDescriptor() { return { NULL, {}, "main", 0, NULL }; } - template <> wgpu::FragmentState defaultDescriptor() { return { NULL, {}, "main", 0, NULL }; } - template <> wgpu::VertexBufferLayout defaultDescriptor() { return { 0, wgpu::InputStepMode::Vertex, 0, NULL }; } - template <> wgpu::VertexAttribute defaultDescriptor() { return { wgpu::VertexFormat::Float, 0, 0 }; } - template <> wgpu::PrimitiveState defaultDescriptor() { return { NULL, wgpu::PrimitiveTopology::TriangleList, wgpu::IndexFormat::Undefined, wgpu::FrontFace::CCW, wgpu::CullMode::None }; } - template <> wgpu::DepthStencilState defaultDescriptor() { return { NULL, wgpu::TextureFormat::Depth24PlusStencil8, false, wgpu::CompareFunction::Always, defaultDescriptor(), defaultDescriptor(), 0xff, 0xff }; } - template <> wgpu::PipelineLayoutDescriptor defaultDescriptor() { return { NULL, "", 0, NULL }; } - template <> wgpu::TextureViewDescriptor defaultDescriptor() { return {}; } - - template <> wgpu::RenderPassColorAttachment defaultDescriptor() { return { {}, {}, wgpu::LoadOp::Clear, wgpu::StoreOp::Store, { 0.0f, 0.0f, 0.0f, 0.0f } }; } - template <> wgpu::RenderPassDepthStencilAttachment defaultDescriptor() { return { {}, wgpu::LoadOp::Clear, wgpu::StoreOp::Store, 1.0f, false, wgpu::LoadOp::Clear, wgpu::StoreOp::Store, 0, false }; } - - RenderPassDescriptor::RenderPassDescriptor() - { - depthStencilAttachment = defaultDescriptor(); - - for(uint32_t i = 0; i < kMaxColorAttachments; ++i) - { - colorAttachments[i] = defaultDescriptor(); - } - - desc = defaultDescriptor(); - //desc.colorAttachmentCount = colorAttachmentCount; - desc.colorAttachments = colorAttachments; - desc.colorAttachmentCount = 1; // TODO (hugoam) set it properly everywhere - } - - VertexStateDescriptor::VertexStateDescriptor() - { - for(uint32_t i = 0; i < kMaxVertexInputs; ++i) - { - buffers[i] = defaultDescriptor(); - } - - for (uint32_t i = 0; i < kMaxVertexAttributes; ++i) - { - attributes[i] = defaultDescriptor(); - } - - buffers[0].attributes = &attributes[0]; - //buffers[0].attributeCount = numAttributes; - - desc = defaultDescriptor(); - - desc.buffers = buffers; - //desc.vertexBufferCount = numVertexBuffers; - } - - RenderPipelineDescriptor::RenderPipelineDescriptor() - { - //vertex = defaultDescriptor(); - fragment = defaultDescriptor(); - depthStencil = defaultDescriptor(); - - for(uint32_t i = 0; i < kMaxColorAttachments; ++i) - { - targets[i] = defaultDescriptor(); - } - - desc = defaultDescriptor(); - - desc.primitive.topology = wgpu::PrimitiveTopology::TriangleList; - desc.multisample.count = 1; - - fragment.targetCount = 1; - fragment.targets = targets; - - //wgpu::VertexStateDescriptor inputState = inputState.descriptor(); - - desc.vertex = defaultDescriptor(); - desc.fragment = NULL; - //desc.vertexState = &inputState; - desc.primitive = defaultDescriptor(); - desc.depthStencil = NULL; - } - // TODO (hugoam) cleanup (end) - - static char s_viewName[BGFX_CONFIG_MAX_VIEWS][BGFX_CONFIG_MAX_VIEW_NAME]; - - inline void setViewType(ViewId _view, const bx::StringView _str) - { - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION || BGFX_CONFIG_PROFILER) ) - { - bx::memCopy(&s_viewName[_view][3], _str.getPtr(), _str.getLength() ); - } - } - - struct PrimInfo - { - wgpu::PrimitiveTopology m_type; - uint32_t m_min; - uint32_t m_div; - uint32_t m_sub; - }; - - static const PrimInfo s_primInfo[] = - { - { wgpu::PrimitiveTopology::TriangleList, 3, 3, 0 }, - { wgpu::PrimitiveTopology::TriangleStrip, 3, 1, 2 }, - { wgpu::PrimitiveTopology::LineList, 2, 2, 0 }, - { wgpu::PrimitiveTopology::LineStrip, 2, 1, 1 }, - { wgpu::PrimitiveTopology::PointList, 1, 1, 0 }, - }; - BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo) ); - - static const wgpu::VertexFormat s_attribType[][4][2] = - { - { // Uint8 - { wgpu::VertexFormat::Uint8x2, wgpu::VertexFormat::Unorm8x2 }, - { wgpu::VertexFormat::Uint8x2, wgpu::VertexFormat::Unorm8x2 }, - { wgpu::VertexFormat::Uint8x4, wgpu::VertexFormat::Unorm8x4 }, - { wgpu::VertexFormat::Uint8x4, wgpu::VertexFormat::Unorm8x4 }, - }, - { // Uint10 - { wgpu::VertexFormat::Uint16x2, wgpu::VertexFormat::Unorm16x2 }, - { wgpu::VertexFormat::Uint16x2, wgpu::VertexFormat::Unorm16x2 }, - { wgpu::VertexFormat::Uint16x4, wgpu::VertexFormat::Unorm16x4 }, - { wgpu::VertexFormat::Uint16x4, wgpu::VertexFormat::Unorm16x4 }, - }, - { // Int16 - { wgpu::VertexFormat::Sint16x2, wgpu::VertexFormat::Snorm16x2 }, - { wgpu::VertexFormat::Sint16x2, wgpu::VertexFormat::Snorm16x2 }, - { wgpu::VertexFormat::Sint16x4, wgpu::VertexFormat::Snorm16x4 }, - { wgpu::VertexFormat::Sint16x4, wgpu::VertexFormat::Snorm16x4 }, - }, - { // Half - { wgpu::VertexFormat::Float16x2, wgpu::VertexFormat::Float16x2 }, - { wgpu::VertexFormat::Float16x2, wgpu::VertexFormat::Float16x2 }, - { wgpu::VertexFormat::Float16x4, wgpu::VertexFormat::Float16x4 }, - { wgpu::VertexFormat::Float16x4, wgpu::VertexFormat::Float16x4 }, - }, - { // Float - { wgpu::VertexFormat::Float32, wgpu::VertexFormat::Float32 }, - { wgpu::VertexFormat::Float32x2, wgpu::VertexFormat::Float32x2 }, - { wgpu::VertexFormat::Float32x3, wgpu::VertexFormat::Float32x3 }, - { wgpu::VertexFormat::Float32x4, wgpu::VertexFormat::Float32x4 }, - }, - }; - BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) ); - - static const wgpu::CullMode s_cullMode[] = - { - wgpu::CullMode::None, - wgpu::CullMode::Front, - wgpu::CullMode::Back, - wgpu::CullMode::None, - }; - - static const wgpu::BlendFactor s_blendFactor[][2] = - { - { wgpu::BlendFactor(0), wgpu::BlendFactor(0) }, // ignored - { wgpu::BlendFactor::Zero, wgpu::BlendFactor::Zero }, // ZERO - { wgpu::BlendFactor::One, wgpu::BlendFactor::One }, // ONE - { wgpu::BlendFactor::SrcColor, wgpu::BlendFactor::SrcAlpha }, // SRC_COLOR - { wgpu::BlendFactor::OneMinusSrcColor, wgpu::BlendFactor::OneMinusSrcAlpha }, // INV_SRC_COLOR - { wgpu::BlendFactor::SrcAlpha, wgpu::BlendFactor::SrcAlpha }, // SRC_ALPHA - { wgpu::BlendFactor::OneMinusSrcAlpha, wgpu::BlendFactor::OneMinusSrcAlpha }, // INV_SRC_ALPHA - { wgpu::BlendFactor::DstAlpha, wgpu::BlendFactor::DstAlpha }, // DST_ALPHA - { wgpu::BlendFactor::OneMinusDstAlpha, wgpu::BlendFactor::OneMinusDstAlpha }, // INV_DST_ALPHA - { wgpu::BlendFactor::DstColor, wgpu::BlendFactor::DstAlpha }, // DST_COLOR - { wgpu::BlendFactor::OneMinusDstColor, wgpu::BlendFactor::OneMinusDstAlpha }, // INV_DST_COLOR - { wgpu::BlendFactor::SrcAlphaSaturated, wgpu::BlendFactor::One }, // SRC_ALPHA_SAT - { wgpu::BlendFactor::BlendColor, wgpu::BlendFactor::BlendColor }, // FACTOR - { wgpu::BlendFactor::OneMinusBlendColor, wgpu::BlendFactor::OneMinusBlendColor }, // INV_FACTOR - }; - - static const wgpu::BlendOperation s_blendEquation[] = - { - wgpu::BlendOperation::Add, - wgpu::BlendOperation::Subtract, - wgpu::BlendOperation::ReverseSubtract, - wgpu::BlendOperation::Min, - wgpu::BlendOperation::Max, - }; - - static const wgpu::CompareFunction s_cmpFunc[] = - { - wgpu::CompareFunction::Always, // ignored - wgpu::CompareFunction::Less, - wgpu::CompareFunction::LessEqual, - wgpu::CompareFunction::Equal, - wgpu::CompareFunction::GreaterEqual, - wgpu::CompareFunction::Greater, - wgpu::CompareFunction::NotEqual, - wgpu::CompareFunction::Never, - wgpu::CompareFunction::Always, - }; - - static const wgpu::StencilOperation s_stencilOp[] = - { - wgpu::StencilOperation::Zero, - wgpu::StencilOperation::Keep, - wgpu::StencilOperation::Replace, - wgpu::StencilOperation::IncrementWrap, - wgpu::StencilOperation::IncrementClamp, - wgpu::StencilOperation::DecrementWrap, - wgpu::StencilOperation::DecrementClamp, - wgpu::StencilOperation::Invert, - }; - - static const wgpu::AddressMode s_textureAddress[] = - { - wgpu::AddressMode::Repeat, - wgpu::AddressMode::MirrorRepeat, - wgpu::AddressMode::ClampToEdge, - wgpu::AddressMode(0), // Border ? ClampToZero ? - }; - - static const wgpu::FilterMode s_textureFilterMinMag[] = - { - wgpu::FilterMode::Linear, - wgpu::FilterMode::Nearest, - wgpu::FilterMode::Linear, - }; - - static const wgpu::FilterMode s_textureFilterMip[] = - { - wgpu::FilterMode::Linear, - wgpu::FilterMode::Nearest, - }; - - struct TextureFormatInfo - { - wgpu::TextureFormat m_fmt; - wgpu::TextureFormat m_fmtSrgb; - }; - - static TextureFormatInfo s_textureFormat[] = - { - { wgpu::TextureFormat::BC1RGBAUnorm, wgpu::TextureFormat::BC1RGBAUnormSrgb }, // BC1 - { wgpu::TextureFormat::BC2RGBAUnorm, wgpu::TextureFormat::BC2RGBAUnormSrgb }, // BC2 - { wgpu::TextureFormat::BC3RGBAUnorm, wgpu::TextureFormat::BC3RGBAUnormSrgb }, // BC3 - { wgpu::TextureFormat::BC4RUnorm, wgpu::TextureFormat::Undefined }, // BC4 // BC4RSnorm ?? - { wgpu::TextureFormat::BC5RGUnorm, wgpu::TextureFormat::Undefined }, // BC5 // BC5RGSnorm ?? - { wgpu::TextureFormat::BC6HRGBUfloat, wgpu::TextureFormat::Undefined }, // BC6H // BC6HRGBSfloat ?? - { wgpu::TextureFormat::BC7RGBAUnorm, wgpu::TextureFormat::BC7RGBAUnormSrgb }, // BC7 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ETC1 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ETC2 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ETC2A - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ETC2A1 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // PTC12 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // PTC14 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // PTC12A - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // PTC14A - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // PTC22 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // PTC24 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ATC - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ATCE - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ATCI - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC4x4 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC5x4 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC5x5 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC6x5 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC6x6 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC8x5 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC8x6 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC8x8 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC10x5 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC10x6 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC10x8 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC10x10 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC12x10 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC12x12 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // Unknown - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // R1 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // A8 - { wgpu::TextureFormat::R8Unorm, wgpu::TextureFormat::Undefined }, // R8 - { wgpu::TextureFormat::R8Sint, wgpu::TextureFormat::Undefined }, // R8I - { wgpu::TextureFormat::R8Uint, wgpu::TextureFormat::Undefined }, // R8U - { wgpu::TextureFormat::R8Snorm, wgpu::TextureFormat::Undefined }, // R8S - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // R16 - { wgpu::TextureFormat::R16Sint, wgpu::TextureFormat::Undefined }, // R16I - { wgpu::TextureFormat::R16Uint, wgpu::TextureFormat::Undefined }, // R16U - { wgpu::TextureFormat::R16Float, wgpu::TextureFormat::Undefined }, // R16F - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // R16S - { wgpu::TextureFormat::R32Sint, wgpu::TextureFormat::Undefined }, // R32I - { wgpu::TextureFormat::R32Uint, wgpu::TextureFormat::Undefined }, // R32U - { wgpu::TextureFormat::R32Float, wgpu::TextureFormat::Undefined }, // R32F - { wgpu::TextureFormat::RG8Unorm, wgpu::TextureFormat::Undefined }, // RG8 - { wgpu::TextureFormat::RG8Sint, wgpu::TextureFormat::Undefined }, // RG8I - { wgpu::TextureFormat::RG8Uint, wgpu::TextureFormat::Undefined }, // RG8U - { wgpu::TextureFormat::RG8Snorm, wgpu::TextureFormat::Undefined }, // RG8S - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RG16 - { wgpu::TextureFormat::RG16Sint, wgpu::TextureFormat::Undefined }, // RG16I - { wgpu::TextureFormat::RG16Uint, wgpu::TextureFormat::Undefined }, // RG16U - { wgpu::TextureFormat::RG16Float, wgpu::TextureFormat::Undefined }, // RG16F - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RG16S - { wgpu::TextureFormat::RG32Sint, wgpu::TextureFormat::Undefined }, // RG32I - { wgpu::TextureFormat::RG32Uint, wgpu::TextureFormat::Undefined }, // RG32U - { wgpu::TextureFormat::RG32Float, wgpu::TextureFormat::Undefined }, // RG32F - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGB8 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGB8I - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGB8U - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGB8S - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGB9E5F - { wgpu::TextureFormat::BGRA8Unorm, wgpu::TextureFormat::BGRA8UnormSrgb }, // BGRA8 - { wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureFormat::RGBA8UnormSrgb }, // RGBA8 - { wgpu::TextureFormat::RGBA8Sint, wgpu::TextureFormat::Undefined }, // RGBA8I - { wgpu::TextureFormat::RGBA8Uint, wgpu::TextureFormat::Undefined }, // RGBA8U - { wgpu::TextureFormat::RGBA8Snorm, wgpu::TextureFormat::Undefined }, // RGBA8S - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGBA16 - { wgpu::TextureFormat::RGBA16Sint, wgpu::TextureFormat::Undefined }, // RGBA16I - { wgpu::TextureFormat::RGBA16Uint, wgpu::TextureFormat::Undefined }, // RGBA16U - { wgpu::TextureFormat::RGBA16Float, wgpu::TextureFormat::Undefined }, // RGBA16F - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGBA16S - { wgpu::TextureFormat::RGBA32Sint, wgpu::TextureFormat::Undefined }, // RGBA32I - { wgpu::TextureFormat::RGBA32Uint, wgpu::TextureFormat::Undefined }, // RGBA32U - { wgpu::TextureFormat::RGBA32Float, wgpu::TextureFormat::Undefined }, // RGBA32F - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // B5G6R5 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // R5G6B5 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // BGRA4 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGBA4 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // BGR5A1 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGB5A1 - { wgpu::TextureFormat::RGB10A2Unorm, wgpu::TextureFormat::Undefined }, // RGB10A2 - { wgpu::TextureFormat::RG11B10Ufloat, wgpu::TextureFormat::Undefined }, // RG11B10F - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // UnknownDepth - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // D16 - { wgpu::TextureFormat::Depth24Plus, wgpu::TextureFormat::Undefined }, // D24 - { wgpu::TextureFormat::Depth24PlusStencil8, wgpu::TextureFormat::Undefined }, // D24S8 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // D32 - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // D16F - { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // D24F - { wgpu::TextureFormat::Depth32Float, wgpu::TextureFormat::Undefined }, // D32F - { wgpu::TextureFormat::Stencil8, wgpu::TextureFormat::Undefined }, // D0S8 - }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat)); - - int32_t s_msaa[] = - { - 1, - 2, - 4, - 8, - 16, - }; - - struct RendererContextWgpu; - static RendererContextWgpu* s_renderWgpu; - - static bool s_ignoreError = false; - -#if !BX_PLATFORM_EMSCRIPTEN - DawnSwapChainImplementation(*createSwapChain)(wgpu::Device device, void* nwh); - -# if defined(DAWN_ENABLE_BACKEND_D3D12) - DawnSwapChainImplementation CreateSwapChainD3D12(wgpu::Device device, void* nwh) - { - HWND win32Window = (HWND)nwh; - return dawn_native::d3d12::CreateNativeSwapChainImpl(device.Get(), win32Window); - } -# endif // defined(DAWN_ENABLE_BACKEND_D3D12) - -# if defined(DAWN_ENABLE_BACKEND_VULKAN) - DawnSwapChainImplementation CreateSwapChainVulkan(wgpu::Device device, void* nwh) - { - VkInstance instance = dawn_native::vulkan::GetInstance(device.Get()); - - PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR = (PFN_vkCreateWin32SurfaceKHR)dawn_native::vulkan::GetInstanceProcAddr(device.Get(), "vkCreateWin32SurfaceKHR"); - - VkSurfaceKHR surface; -# if BX_PLATFORM_WINDOWS - // Copied from renderer_vk.cpp -> needs refactor - { - VkWin32SurfaceCreateInfoKHR sci; - sci.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; - sci.pNext = NULL; - sci.flags = 0; - sci.hinstance = (HINSTANCE)GetModuleHandle(NULL); - sci.hwnd = (HWND)nwh; - VkResult result = vkCreateWin32SurfaceKHR(instance, &sci, NULL, &surface); - } -# endif // BX_PLATFORM_WINDOWS - return dawn_native::vulkan::CreateNativeSwapChainImpl(device.Get(), surface); - } -# endif // defined(DAWN_ENABLE_BACKEND_VULKAN) - -#endif // !BX_PLATFORM_EMSCRIPTEN - - struct RendererContextWgpu : public RendererContextI - { - RendererContextWgpu() - : m_frameIndex(0) - , m_numWindows(0) - , m_rtMsaa(false) - , m_capture(NULL) - , m_captureSize(0) - { - bx::memSet(&m_windows, 0xff, sizeof(m_windows) ); - } - - ~RendererContextWgpu() - { - } - - bool init(const Init& _init) - { - BX_UNUSED(_init); - BX_TRACE("Init."); - - if (_init.debug - || _init.profile) - { - m_renderDocDll = loadRenderDoc(); - } - - setGraphicsDebuggerPresent(NULL != m_renderDocDll); - - m_fbh.idx = kInvalidHandle; - bx::memSet(m_uniforms, 0, sizeof(m_uniforms) ); - bx::memSet(&m_resolution, 0, sizeof(m_resolution) ); - -#if !BX_PLATFORM_EMSCRIPTEN - // Default to D3D12, Metal, Vulkan, OpenGL in that order as D3D12 and Metal are the preferred on - // their respective platforms, and Vulkan is preferred to OpenGL -# if defined(DAWN_ENABLE_BACKEND_D3D12) - static wgpu::BackendType backendType = wgpu::BackendType::D3D12; -# elif defined(DAWN_ENABLE_BACKEND_METAL) - static wgpu::BackendType backendType = wgpu::BackendType::Metal; -# elif defined(DAWN_ENABLE_BACKEND_OPENGL) - static wgpu::BackendType backendType = wgpu::BackendType::OpenGL; -# elif defined(DAWN_ENABLE_BACKEND_VULKAN) - static wgpu::BackendType backendType = wgpu::BackendType::Vulkan; -# else -# error "Unknown platform." -# endif // defined(DAWN_ENABLE_BACKEND_*) - - if (BX_ENABLED(BGFX_CONFIG_DEBUG)) - { - m_instance.EnableBackendValidation(true); - } - - m_instance.DiscoverDefaultAdapters(); - - dawn_native::Adapter backendAdapter; - std::vector adapters = m_instance.GetAdapters(); - for (dawn_native::Adapter& adapter : adapters) - { - wgpu::AdapterProperties properties; - adapter.GetProperties(&properties); - if (properties.backendType == backendType) - { - backendAdapter = adapter; - break; - } - } - - //BX_ASSERT(adapterIt != adapters.end()); - - dawn_native::DeviceDescriptor desc; -# if defined(DAWN_ENABLE_BACKEND_D3D12) - desc.forceEnabledToggles.push_back("use_dxc"); -# endif - - desc.forceDisabledToggles.push_back("disallow_unsafe_apis"); - - WGPUDevice backendDevice = backendAdapter.CreateDevice(&desc); - DawnProcTable backendProcs = dawn_native::GetProcs(); - - using CreateSwapChain = DawnSwapChainImplementation (*)(wgpu::Device device, void* nwh); - -# if defined(DAWN_ENABLE_BACKEND_D3D12) - createSwapChain = CreateSwapChainD3D12; -# elif defined(DAWN_ENABLE_BACKEND_METAL) - createSwapChain = CreateSwapChainMetal; -# elif defined(DAWN_ENABLE_BACKEND_NULL) - createSwapChain = CreateSwapChainNull; -# elif defined(DAWN_ENABLE_BACKEND_OPENGL) - createSwapChain = CreateSwapChainOpenGL; -# elif defined(DAWN_ENABLE_BACKEND_VULKAN) - createSwapChain = CreateSwapChainVulkan; -# endif // defined(DAWN_ENABLE_BACKEND_*) - - // Choose whether to use the backend procs and devices directly, or set up the wire. - WGPUDevice cDevice = backendDevice; - DawnProcTable procs = backendProcs; - dawnProcSetProcs(&procs); - - m_device = wgpu::Device::Acquire(cDevice); -#else - m_device = wgpu::Device(emscripten_webgpu_get_device()); -#endif // !BX_PLATFORM_EMSCRIPTEN - - auto PrintDeviceError = [](WGPUErrorType errorType, const char* message, void*) { - BX_UNUSED(errorType); - - if (s_ignoreError) - { - BX_TRACE("Device error: %s", message); - } - else - { - BX_ASSERT(false, "Device error: %s", message); - } - - s_ignoreError = false; - }; - - if (!m_device) - { - BX_WARN(!m_device, "Unable to create WebGPU device."); - return false; - } - - m_device.SetUncapturedErrorCallback(PrintDeviceError, NULL); - - bool success = m_mainFrameBuffer.create( - 0 - , g_platformData.nwh - , _init.resolution.width - , _init.resolution.height - , TextureFormat::Unknown - , TextureFormat::UnknownDepth - ); - m_numWindows = 1; - - if (!success) - { - return false; - } - - m_queue = m_device.GetQueue(); - - m_cmd.init(m_queue); - //BGFX_FATAL(NULL != m_cmd.m_commandQueue, Fatal::UnableToInitialize, "Unable to create Metal device."); - - for (uint8_t ii = 0; ii < BGFX_CONFIG_MAX_FRAME_LATENCY; ++ii) - { - BX_TRACE("Create scratch buffer %d", ii); - m_scratchBuffers[ii].create(BGFX_CONFIG_MAX_DRAW_CALLS * 128); - m_bindStateCache[ii].create(); // (1024); - } - - for (uint8_t ii = 0; ii < WEBGPU_NUM_UNIFORM_BUFFERS; ++ii) - { - bool mapped = true; // ii == WEBGPU_NUM_UNIFORM_BUFFERS - 1; - m_uniformBuffers[ii].create(BGFX_CONFIG_MAX_DRAW_CALLS * 128, mapped); - } - - g_caps.supported |= (0 - | BGFX_CAPS_ALPHA_TO_COVERAGE - | BGFX_CAPS_BLEND_INDEPENDENT - | BGFX_CAPS_FRAGMENT_DEPTH - | BGFX_CAPS_INDEX32 - | BGFX_CAPS_INSTANCING - // | BGFX_CAPS_OCCLUSION_QUERY - | BGFX_CAPS_SWAP_CHAIN - | BGFX_CAPS_TEXTURE_2D_ARRAY - | BGFX_CAPS_TEXTURE_3D - | BGFX_CAPS_TEXTURE_BLIT - | BGFX_CAPS_TEXTURE_COMPARE_ALL - | BGFX_CAPS_TEXTURE_COMPARE_LEQUAL - | BGFX_CAPS_TEXTURE_READ_BACK - | BGFX_CAPS_VERTEX_ATTRIB_HALF - | BGFX_CAPS_VERTEX_ATTRIB_UINT10 - | BGFX_CAPS_COMPUTE - ); - - g_caps.limits.maxTextureSize = 8192; - g_caps.limits.maxFBAttachments = 4; - g_caps.supported |= BGFX_CAPS_TEXTURE_CUBE_ARRAY; - g_caps.supported |= BGFX_CAPS_DRAW_INDIRECT; - - g_caps.limits.maxTextureLayers = 2048; - g_caps.limits.maxVertexStreams = BGFX_CONFIG_MAX_VERTEX_STREAMS; - // Maximum number of entries in the buffer argument table, per graphics or compute function are 31. - // It is decremented by 1 because 1 entry is used for uniforms. - g_caps.limits.maxComputeBindings = bx::uint32_min(30, BGFX_MAX_COMPUTE_BINDINGS); - - for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii) - { - uint16_t support = 0; - - support |= wgpu::TextureFormat::Undefined != s_textureFormat[ii].m_fmt - ? BGFX_CAPS_FORMAT_TEXTURE_2D - | BGFX_CAPS_FORMAT_TEXTURE_3D - | BGFX_CAPS_FORMAT_TEXTURE_CUBE - | BGFX_CAPS_FORMAT_TEXTURE_VERTEX - : BGFX_CAPS_FORMAT_TEXTURE_NONE - ; - - support |= wgpu::TextureFormat::Undefined != s_textureFormat[ii].m_fmtSrgb - ? BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB - | BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB - | BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB - | BGFX_CAPS_FORMAT_TEXTURE_VERTEX - : BGFX_CAPS_FORMAT_TEXTURE_NONE - ; - - if (!bimg::isCompressed(bimg::TextureFormat::Enum(ii) ) ) - { - support |= 0 - | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER - // | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA - ; - } - - g_caps.formats[ii] = support; - } - - g_caps.formats[TextureFormat::A8 ] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA); - g_caps.formats[TextureFormat::RG32I ] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA); - g_caps.formats[TextureFormat::RG32U ] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA); - g_caps.formats[TextureFormat::RGBA32I] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA); - g_caps.formats[TextureFormat::RGBA32U] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA); - - g_caps.formats[TextureFormat::ETC2 ] = - g_caps.formats[TextureFormat::ETC2A ] = - g_caps.formats[TextureFormat::ETC2A1] = - g_caps.formats[TextureFormat::PTC12 ] = - g_caps.formats[TextureFormat::PTC14 ] = - g_caps.formats[TextureFormat::PTC12A] = - g_caps.formats[TextureFormat::PTC14A] = - g_caps.formats[TextureFormat::B5G6R5] = - g_caps.formats[TextureFormat::R5G6B5] = - g_caps.formats[TextureFormat::BGRA4 ] = - g_caps.formats[TextureFormat::RGBA4 ] = - g_caps.formats[TextureFormat::BGR5A1] = - g_caps.formats[TextureFormat::RGB5A1] = BGFX_CAPS_FORMAT_TEXTURE_NONE; - - g_caps.formats[TextureFormat::RGB9E5F] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA); - g_caps.formats[TextureFormat::RG11B10F] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA); - - // disable compressed formats - for (uint32_t ii = 0; ii < TextureFormat::Unknown; ++ii) - { - s_textureFormat[ii].m_fmt = wgpu::TextureFormat::Undefined; - } - - for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii) - { - if (BGFX_CAPS_FORMAT_TEXTURE_NONE == g_caps.formats[ii]) - { - s_textureFormat[ii].m_fmt = wgpu::TextureFormat::Undefined; - s_textureFormat[ii].m_fmtSrgb = wgpu::TextureFormat::Undefined; - } - } - - for (uint32_t ii = 1, last = 0; ii < BX_COUNTOF(s_msaa); ++ii) - { - // TODO (hugoam) - //const int32_t sampleCount = 1; //1<size, _mem->data, _flags); - } - - void destroyIndexBuffer(IndexBufferHandle _handle) override - { - m_indexBuffers[_handle.idx].destroy(); - } - - void createVertexLayout(VertexLayoutHandle _handle, const VertexLayout& _decl) override - { - VertexLayout& decl = m_vertexDecls[_handle.idx]; - bx::memCopy(&decl, &_decl, sizeof(VertexLayout) ); - dump(decl); - } - - void destroyVertexLayout(VertexLayoutHandle /*_handle*/) override - { - } - - void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexLayoutHandle _declHandle, uint16_t _flags) override - { - m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags); - } - - void destroyVertexBuffer(VertexBufferHandle _handle) override - { - m_vertexBuffers[_handle.idx].destroy(); - } - - void createDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _size, uint16_t _flags) override - { - m_indexBuffers[_handle.idx].create(_size, NULL, _flags); - } - - void updateDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _offset, uint32_t _size, const Memory* _mem) override - { - m_indexBuffers[_handle.idx].update(_offset, bx::uint32_min(_size, _mem->size), _mem->data); - } - - void destroyDynamicIndexBuffer(IndexBufferHandle _handle) override - { - m_indexBuffers[_handle.idx].destroy(); - } - - void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override - { - VertexLayoutHandle decl = BGFX_INVALID_HANDLE; - m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags); - } - - void updateDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _offset, uint32_t _size, const Memory* _mem) override - { - m_vertexBuffers[_handle.idx].update(_offset, bx::uint32_min(_size, _mem->size), _mem->data); - } - - void destroyDynamicVertexBuffer(VertexBufferHandle _handle) override - { - m_vertexBuffers[_handle.idx].destroy(); - } - - void createShader(ShaderHandle _handle, const Memory* _mem) override - { - m_shaders[_handle.idx].create(_handle, _mem); - } - - void destroyShader(ShaderHandle _handle) override - { - m_shaders[_handle.idx].destroy(); - } - - void createProgram(ProgramHandle _handle, ShaderHandle _vsh, ShaderHandle _fsh) override - { - m_program[_handle.idx].create(&m_shaders[_vsh.idx], isValid(_fsh) ? &m_shaders[_fsh.idx] : NULL); - } - - void destroyProgram(ProgramHandle _handle) override - { - m_program[_handle.idx].destroy(); - } - - void* createTexture(TextureHandle _handle, const Memory* _mem, uint64_t _flags, uint8_t _skip) override - { - m_textures[_handle.idx].create(_handle, _mem, _flags, _skip); - return NULL; - } - - void updateTextureBegin(TextureHandle /*_handle*/, uint8_t /*_side*/, uint8_t /*_mip*/) override - { - } - - void updateTexture(TextureHandle _handle, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem) override - { - m_textures[_handle.idx].update(_side, _mip, _rect, _z, _depth, _pitch, _mem); - } - - void updateTextureEnd() override - { - } - - void readback(ReadbackWgpu& readback, const TextureWgpu& texture, void* _data) - { - m_cmd.kick(false, true); - m_cmd.beginRender(); - - if (readback.m_mapped) - return; - - BX_ASSERT(readback.m_mip> readback.m_mip); - uint32_t srcHeight = bx::uint32_max(1, texture.m_height >> readback.m_mip); - - const uint32_t bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(texture.m_textureFormat)); - const uint32_t pitch = srcWidth * bpp / 8; - - const uint32_t dstpitch = bx::strideAlign(pitch, kMinBufferOffsetAlignment); - const uint32_t size = dstpitch * srcHeight; - - // TODO move inside ReadbackWgpu::create - if (!readback.m_buffer) - { - wgpu::BufferDescriptor desc; - desc.size = size; - desc.usage = wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::MapRead; - - readback.m_buffer = m_device.CreateBuffer(&desc); - } - - wgpu::ImageCopyTexture imageCopyTexture; - imageCopyTexture.texture = texture.m_ptr; - imageCopyTexture.origin = { 0, 0, 0 }; - - wgpu::ImageCopyBuffer imageCopyBuffer; - imageCopyBuffer.buffer = readback.m_buffer; - imageCopyBuffer.layout.bytesPerRow = dstpitch; - imageCopyBuffer.layout.rowsPerImage = srcHeight; - - wgpu::Extent3D extent3D = { srcWidth, srcHeight, 1 }; - getBlitCommandEncoder().CopyTextureToBuffer(&imageCopyTexture, &imageCopyBuffer, &extent3D); - - auto finish = [](WGPUBufferMapAsyncStatus status, void* userdata) - { - ReadbackWgpu* readback = static_cast(userdata); - void const* data = readback->m_buffer.GetConstMappedRange(); - if(status == WGPUBufferMapAsyncStatus_Success) - readback->readback(data); - }; - - m_cmd.finish(); - - m_cmd.kick(true); - - readback.m_mapped = true; - readback.m_data = _data; - readback.m_size = pitch * srcHeight; - - readback.m_buffer.MapAsync(wgpu::MapMode::Read, 0, size, finish, &readback); - } - - void readTexture(TextureHandle _handle, void* _data, uint8_t _mip) override - { - TextureWgpu& texture = m_textures[_handle.idx]; - - readback(texture.m_readback, texture, _data); - } - - void resizeTexture(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, uint16_t _numLayers) override - { - TextureWgpu& texture = m_textures[_handle.idx]; - - uint32_t size = sizeof(uint32_t) + sizeof(TextureCreate); - const Memory* mem = alloc(size); - - bx::StaticMemoryBlockWriter writer(mem->data, mem->size); - uint32_t magic = BGFX_CHUNK_MAGIC_TEX; - bx::write(&writer, magic); - - TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_depth = 0; - tc.m_numLayers = _numLayers; - tc.m_numMips = _numMips; - tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); - tc.m_cubeMap = false; - tc.m_mem = NULL; - bx::write(&writer, tc); - - texture.destroy(); - texture.create(_handle, mem, texture.m_flags, 0); - - release(mem); - } - - void overrideInternal(TextureHandle _handle, uintptr_t _ptr) override - { - BX_UNUSED(_handle, _ptr); - } - - uintptr_t getInternal(TextureHandle _handle) override - { - BX_UNUSED(_handle); - return 0; - } - - void destroyTexture(TextureHandle _handle) override - { - m_textures[_handle.idx].destroy(); - } - - void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const Attachment* _attachment) override - { - m_frameBuffers[_handle.idx].create(_num, _attachment); - } - - void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _format, TextureFormat::Enum _depthFormat) override - { - for (uint32_t ii = 0, num = m_numWindows; ii < num; ++ii) - { - FrameBufferHandle handle = m_windows[ii]; - if (isValid(handle) - && m_frameBuffers[handle.idx].m_nwh == _nwh) - { - destroyFrameBuffer(handle); - } - } - - uint16_t denseIdx = m_numWindows++; - m_windows[denseIdx] = _handle; - - FrameBufferWgpu& fb = m_frameBuffers[_handle.idx]; - fb.create(denseIdx, _nwh, _width, _height, _format, _depthFormat); - fb.m_swapChain->resize(m_frameBuffers[_handle.idx], _width, _height, 0); - } - - void destroyFrameBuffer(FrameBufferHandle _handle) override - { - uint16_t denseIdx = m_frameBuffers[_handle.idx].destroy(); - - if (UINT16_MAX != denseIdx) - { - --m_numWindows; - - if (m_numWindows > 1) - { - FrameBufferHandle handle = m_windows[m_numWindows]; - m_windows[m_numWindows] = {kInvalidHandle}; - - if (m_numWindows != denseIdx) - { - m_windows[denseIdx] = handle; - m_frameBuffers[handle.idx].m_denseIdx = denseIdx; - } - } - } - } - - void createUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name) override - { - if (NULL != m_uniforms[_handle.idx]) - { - bx::free(g_allocator, m_uniforms[_handle.idx]); - } - - uint32_t size = bx::alignUp(g_uniformTypeSize[_type]*_num, 16); - void* data = bx::alloc(g_allocator, size); - bx::memSet(data, 0, size); - m_uniforms[_handle.idx] = data; - m_uniformReg.add(_handle, _name); - } - - void destroyUniform(UniformHandle _handle) override - { - bx::free(g_allocator, m_uniforms[_handle.idx]); - m_uniforms[_handle.idx] = NULL; - m_uniformReg.remove(_handle); - } - - void requestScreenShot(FrameBufferHandle _handle, const char* _filePath) override - { - BX_UNUSED(_handle); BX_UNUSED(_filePath); - } - - void updateViewName(ViewId _id, const char* _name) override - { - bx::strCopy( - &s_viewName[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED] - , BX_COUNTOF(s_viewName[0])-BGFX_CONFIG_MAX_VIEW_NAME_RESERVED - , _name - ); - } - - void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) override - { - bx::memCopy(m_uniforms[_loc], _data, _size); - } - - void invalidateOcclusionQuery(OcclusionQueryHandle _handle) override - { - BX_UNUSED(_handle); - } - - void setMarker(const char* _marker, uint16_t _len) override - { - BX_UNUSED(_len); - - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION) ) - { - m_renderEncoder.InsertDebugMarker(_marker); - } - } - - virtual void setName(Handle _handle, const char* _name, uint16_t _len) override - { - BX_UNUSED(_handle); BX_UNUSED(_name); BX_UNUSED(_len); - BX_UNUSED(_len); - - switch (_handle.type) - { - case Handle::IndexBuffer: - m_indexBuffers[_handle.idx].m_label.clear(); - m_indexBuffers[_handle.idx].m_label.append(_name); - break; - - case Handle::Shader: - m_shaders[_handle.idx].m_label.clear(); - m_shaders[_handle.idx].m_label.append(_name); - break; - - case Handle::Texture: - m_textures[_handle.idx].m_label.clear(); - m_textures[_handle.idx].m_label.append(_name); - break; - - case Handle::VertexBuffer: - m_vertexBuffers[_handle.idx].m_label.clear(); - m_vertexBuffers[_handle.idx].m_label.append(_name); - break; - - default: - BX_ASSERT(false, "Invalid handle type?! %d", _handle.type); - break; - } - } - - void submitBlit(BlitState& _bs, uint16_t _view); - - void submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) override; - - void blitSetup(TextVideoMemBlitter& _blitter) override - { - BX_UNUSED(_blitter); - } - - void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) override - { - const uint32_t numVertices = _numIndices*4/6; - if (0 < numVertices) - { - m_indexBuffers [_blitter.m_ib->handle.idx].update( - 0 - , bx::strideAlign(_numIndices*2, 4) - , _blitter.m_ib->data - , true - ); - m_vertexBuffers[_blitter.m_vb->handle.idx].update( - 0 - , numVertices*_blitter.m_layout.m_stride - , _blitter.m_vb->data - , true - ); - - endEncoding(); - - uint32_t width = m_resolution.width; - uint32_t height = m_resolution.height; - - FrameBufferHandle fbh = BGFX_INVALID_HANDLE; - - uint64_t state = 0 - | BGFX_STATE_WRITE_RGB - | BGFX_STATE_WRITE_A - | BGFX_STATE_DEPTH_TEST_ALWAYS - ; - - PipelineStateWgpu* pso = getPipelineState( - state - , 0 - , 0 - , fbh - , _blitter.m_vb->layoutHandle - , false - , _blitter.m_program - , 0 - ); - - RenderPassDescriptor renderPassDescriptor; - wgpu::RenderPassColorAttachment& color = renderPassDescriptor.colorAttachments[0]; - - setFrameBuffer(renderPassDescriptor, fbh); - - color.loadOp = wgpu::LoadOp::Load; - color.storeOp = wgpu::StoreOp::Store; - // NULL != renderPassDescriptor.colorAttachments[0].resolveTexture - // ? wgpu::StoreOp::MultisampleResolve - // : wgpu::StoreOp::Store - //; - - wgpu::RenderPassEncoder rce = m_cmd.m_renderEncoder.BeginRenderPass(&renderPassDescriptor.desc); - m_renderEncoder = rce; - - rce.SetViewport(0.0f, 0.0f, (float)width, (float)height, 0.0f, 1.0f); - rce.SetScissorRect(0.0f, 0.0f, (float)width, (float)height); - - rce.SetPipeline(pso->m_rps); - - ProgramWgpu& program = m_program[_blitter.m_program.idx]; - - ScratchBufferWgpu& scratchBuffer = m_scratchBuffers[0]; - BindStateCacheWgpu& bindStates = m_bindStateCache[0]; - - float proj[16]; - bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f, 0.0f, false); - - PredefinedUniform& predefined = program.m_predefined[0]; - uint8_t flags = predefined.m_type; - setShaderUniform(flags, predefined.m_loc, proj, 4); - - BX_ASSERT(program.m_vsh->m_size > 0, "Not supposed to happen"); - const uint32_t voffset = scratchBuffer.write(m_vsScratch, program.m_vsh->m_gpuSize); - - const uint32_t fsize = (NULL != program.m_fsh ? program.m_fsh->m_gpuSize : 0); - BX_ASSERT(fsize == 0, "Not supposed to happen"); - - TextureWgpu& texture = m_textures[_blitter.m_texture.idx]; - - BindingsWgpu b; - - BindStateWgpu& bindState = allocBindState(program, bindStates, b, scratchBuffer); - - wgpu::BindGroupEntry& textureEntry = b.m_entries[b.numEntries++]; - textureEntry.binding = program.m_textures[0].binding; - textureEntry.textureView = texture.m_ptr.CreateView(); - - wgpu::BindGroupEntry& samplerEntry = b.m_entries[b.numEntries++]; - samplerEntry.binding = program.m_samplers[0].binding; - samplerEntry.sampler = 0 == (BGFX_SAMPLER_INTERNAL_DEFAULT & state) - ? getSamplerState(state) - : texture.m_sampler; - - bindGroups(program, bindState, b); - - uint32_t numOffset = 1; - uint32_t offsets[1] = { voffset }; - - bindProgram(rce, program, bindState, numOffset, offsets); - - VertexBufferWgpu& vb = m_vertexBuffers[_blitter.m_vb->handle.idx]; - rce.SetVertexBuffer(0, vb.m_ptr); - - IndexBufferWgpu& ib = m_indexBuffers[_blitter.m_ib->handle.idx]; - rce.SetIndexBuffer(ib.m_ptr, ib.m_format); - rce.DrawIndexed(_numIndices, 1, 0, 0, 0); - } - } - - bool isDeviceRemoved() override - { - return false; - } - - void flip() override - { - for (uint32_t ii = 0, num = m_numWindows; ii < num; ++ii) - { - FrameBufferWgpu& frameBuffer = ii == 0 ? m_mainFrameBuffer : m_frameBuffers[m_windows[ii].idx]; - if (NULL != frameBuffer.m_swapChain) - //&& frameBuffer.m_swapChain->m_drawable) - { - SwapChainWgpu& swapChain = *frameBuffer.m_swapChain; - swapChain.flip(); - } - } - - m_cmd.m_stagingEncoder = NULL; - m_cmd.m_renderEncoder = NULL; - } - - void updateResolution(const Resolution& _resolution) - { - m_resolution = _resolution; - return; // TODO (hugoam) - - m_mainFrameBuffer.m_swapChain->m_maxAnisotropy = !!(_resolution.reset & BGFX_RESET_MAXANISOTROPY) - ? 16 - : 1 - ; - - const uint32_t maskFlags = ~(0 - | BGFX_RESET_MAXANISOTROPY - | BGFX_RESET_DEPTH_CLAMP - | BGFX_RESET_SUSPEND - ); - - if (m_resolution.width != _resolution.width - || m_resolution.height != _resolution.height - || (m_resolution.reset&maskFlags) != (_resolution.reset&maskFlags) ) - { - wgpu::TextureFormat prevMetalLayerPixelFormat; // = m_mainFrameBuffer.m_swapChain->m_metalLayer.pixelFormat; - BX_UNUSED(prevMetalLayerPixelFormat); - - m_resolution = _resolution; - m_resolution.reset &= ~BGFX_RESET_INTERNAL_FORCE; - - m_mainFrameBuffer.m_swapChain->resize(m_mainFrameBuffer, _resolution.width, _resolution.height, _resolution.reset); - - for (uint32_t ii = 0; ii < BX_COUNTOF(m_frameBuffers); ++ii) - { - m_frameBuffers[ii].postReset(); - } - - updateCapture(); - - m_textVideoMem.resize(false, _resolution.width, _resolution.height); - m_textVideoMem.clear(); - - //if (prevMetalLayerPixelFormat != m_mainFrameBuffer.m_swapChain->m_metalLayer.pixelFormat) - { - //MTL_RELEASE(m_screenshotBlitRenderPipelineState) - //reset(m_renderPipelineDescriptor); - - //m_renderPipelineDescriptor.colorAttachments[0].pixelFormat = m_mainFrameBuffer.m_swapChain->m_metalLayer.pixelFormat; - //m_renderPipelineDescriptor.vertexFunction = m_screenshotBlitProgram.m_vsh->m_function; - //m_renderPipelineDescriptor.fragmentFunction = m_screenshotBlitProgram.m_fsh->m_function; - //m_screenshotBlitRenderPipelineState = m_device.newRenderPipelineStateWithDescriptor(m_renderPipelineDescriptor); - } - } - } - - void invalidateCompute() - { - if (m_computeEncoder) - { - m_computeEncoder.EndPass(); - m_computeEncoder = NULL; - } - } - - void updateCapture() - { - } - - void capture() - { - } - - void captureFinish() - { - } - - BindStateWgpu& allocBindState(const ProgramWgpu& program, BindStateCacheWgpu& bindStates, BindingsWgpu& bindings, ScratchBufferWgpu& scratchBuffer) - { - BindStateWgpu& bindState = bindStates.m_bindStates[bindStates.m_currentBindState]; - bindStates.m_currentBindState++; - - bindState.numOffset = program.m_numUniforms; - - // first two bindings are always uniform buffer (vertex/fragment) - if (0 < program.m_vsh->m_gpuSize) - { - bindings.m_entries[0].binding = kSpirvVertexBinding; - bindings.m_entries[0].offset = 0; - bindings.m_entries[0].size = program.m_vsh->m_gpuSize; - bindings.m_entries[0].buffer = scratchBuffer.m_buffer; - bindings.numEntries++; - } - - if (NULL != program.m_fsh - && 0 < program.m_fsh->m_gpuSize) - { - bindings.m_entries[1].binding = kSpirvFragmentBinding; - bindings.m_entries[1].offset = 0; - bindings.m_entries[1].size = program.m_fsh->m_gpuSize; - bindings.m_entries[1].buffer = scratchBuffer.m_buffer; - bindings.numEntries++; - } - - return bindState; - } - - void bindGroups(const ProgramWgpu& program, BindStateWgpu& bindState, BindingsWgpu& bindings) - { - wgpu::BindGroupDescriptor bindGroupDesc; - bindGroupDesc.layout = program.m_bindGroupLayout; - bindGroupDesc.entryCount = bindings.numEntries; - bindGroupDesc.entries = bindings.m_entries; - - bindState.m_bindGroup = m_device.CreateBindGroup(&bindGroupDesc); - } - - template - void bindProgram(Encoder& encoder, const ProgramWgpu& program, BindStateWgpu& bindState, uint32_t numOffset, uint32_t* offsets) - { - BX_ASSERT(bindState.numOffset == numOffset, "We're obviously doing something wrong"); - encoder.SetBindGroup(0, bindState.m_bindGroup, numOffset, offsets); - } - - BindStateWgpu& allocAndFillBindState(const ProgramWgpu& program, BindStateCacheWgpu& bindStates, ScratchBufferWgpu& scratchBuffer, const RenderBind& renderBind) - { - BindingsWgpu b; - - BindStateWgpu& bindState = allocBindState(program, bindStates, b, scratchBuffer); - - for (uint8_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage) - { - const Binding& bind = renderBind.m_bind[stage]; - const BindInfo& bindInfo = program.m_bindInfo[stage]; - - bool isUsed = isValid(program.m_bindInfo[stage].m_uniform); - - BX_ASSERT(!isUsed || kInvalidHandle != bind.m_idx, "All expected bindings must be bound with WebGPU"); - - if (kInvalidHandle != bind.m_idx) - { - switch (bind.m_type) - { - case Binding::Image: - { - TextureWgpu& texture = m_textures[bind.m_idx]; - wgpu::BindGroupEntry& entry = b.m_entries[b.numEntries++]; - entry.binding = bindInfo.m_binding; - entry.textureView = texture.getTextureMipLevel(bind.m_mip); - - if (Access::Read == bind.m_access) - { - wgpu::BindGroupEntry& samplerEntry = b.m_entries[b.numEntries++]; - samplerEntry.binding = bindInfo.m_binding + 16; - samplerEntry.sampler = texture.m_sampler; - } - } - break; - - case Binding::Texture: - { - // apparently bgfx allows to set a texture to a stage that a program does not even use - if (isUsed) - { - TextureWgpu& texture = m_textures[bind.m_idx]; - uint32_t flags = bind.m_samplerFlags; - - wgpu::TextureViewDescriptor viewDesc = defaultDescriptor(); - viewDesc.dimension = program.m_textures[bindInfo.m_index].texture.viewDimension; - - wgpu::BindGroupEntry& textureEntry = b.m_entries[b.numEntries++]; - textureEntry.binding = bindInfo.m_binding; - //textureEntry.textureView = texture.m_ptr.CreateView(); - textureEntry.textureView = texture.m_ptr.CreateView(&viewDesc); - - wgpu::BindGroupEntry& samplerEntry = b.m_entries[b.numEntries++]; - samplerEntry.binding = bindInfo.m_binding + kSpirvSamplerShift; - samplerEntry.sampler = 0 == (BGFX_SAMPLER_INTERNAL_DEFAULT & flags) - ? getSamplerState(flags) - : texture.m_sampler; - } - } - break; - - case Binding::IndexBuffer: - case Binding::VertexBuffer: - { - const BufferWgpu& buffer = Binding::IndexBuffer == bind.m_type - ? (const BufferWgpu&) m_indexBuffers[bind.m_idx] - : (const BufferWgpu&) m_vertexBuffers[bind.m_idx] - ; - - wgpu::BindGroupEntry& entry = b.m_entries[b.numEntries++]; - entry.binding = bindInfo.m_binding; - entry.offset = 0; - entry.size = buffer.m_size; - entry.buffer = buffer.m_ptr; - } - break; - } - } - } - - bindGroups(program, bindState, b); - - return bindState; - }; - - void setShaderUniform(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) - { - if(_flags&kUniformFragmentBit) - { - bx::memCopy(&m_fsScratch[_regIndex], _val, _numRegs * 16); - } - else - { - bx::memCopy(&m_vsScratch[_regIndex], _val, _numRegs * 16); - } - } - - void setShaderUniform4f(uint8_t _flags, uint32_t _loc, const void* _val, uint32_t _numRegs) - { - setShaderUniform(_flags, _loc, _val, _numRegs); - } - - void setShaderUniform4x4f(uint8_t _flags, uint32_t _loc, const void* _val, uint32_t _numRegs) - { - setShaderUniform(_flags, _loc, _val, _numRegs); - } - - void commit(UniformBuffer& _uniformBuffer) - { - _uniformBuffer.reset(); - - for (;;) - { - uint32_t opcode = _uniformBuffer.read(); - - if (UniformType::End == opcode) - { - break; - } - - UniformType::Enum type; - uint16_t loc; - uint16_t num; - uint16_t copy; - UniformBuffer::decodeOpcode(opcode, type, loc, num, copy); - - const char* data; - if (copy) - { - data = _uniformBuffer.read(g_uniformTypeSize[type]*num); - } - else - { - UniformHandle handle; - bx::memCopy(&handle, _uniformBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) ); - data = (const char*)m_uniforms[handle.idx]; - } - - switch ( (uint32_t)type) - { - case UniformType::Mat3: - case UniformType::Mat3|kUniformFragmentBit: - { - float* value = (float*)data; - for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3*16, value += 9) - { - Matrix4 mtx; - mtx.un.val[ 0] = value[0]; - mtx.un.val[ 1] = value[1]; - mtx.un.val[ 2] = value[2]; - mtx.un.val[ 3] = 0.0f; - mtx.un.val[ 4] = value[3]; - mtx.un.val[ 5] = value[4]; - mtx.un.val[ 6] = value[5]; - mtx.un.val[ 7] = 0.0f; - mtx.un.val[ 8] = value[6]; - mtx.un.val[ 9] = value[7]; - mtx.un.val[10] = value[8]; - mtx.un.val[11] = 0.0f; - setShaderUniform(uint8_t(type), loc, &mtx.un.val[0], 3); - } - } - break; - - case UniformType::Sampler: - case UniformType::Sampler | kUniformFragmentBit: - case UniformType::Vec4: - case UniformType::Vec4 | kUniformFragmentBit: - case UniformType::Mat4: - case UniformType::Mat4 | kUniformFragmentBit: - { - setShaderUniform(uint8_t(type), loc, data, num); - } - break; - case UniformType::End: - break; - - default: - BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _uniformBuffer.getPos(), opcode, type, loc, num, copy); - break; - } - } - } - - void clearQuad(ClearQuad& _clearQuad, const Rect& _rect, const Clear& _clear, const float _palette[][4]) - { - uint32_t width; - uint32_t height; - - if (isValid(m_fbh) ) - { - const FrameBufferWgpu& fb = m_frameBuffers[m_fbh.idx]; - width = fb.m_width; - height = fb.m_height; - } - else - { - width = m_resolution.width; - height = m_resolution.height; - } - - uint64_t state = 0; - state |= _clear.m_flags & BGFX_CLEAR_COLOR ? BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A : 0; - state |= _clear.m_flags & BGFX_CLEAR_DEPTH ? BGFX_STATE_DEPTH_TEST_ALWAYS|BGFX_STATE_WRITE_Z : 0; - state |= BGFX_STATE_PT_TRISTRIP; - - uint64_t stencil = 0; - stencil |= _clear.m_flags & BGFX_CLEAR_STENCIL ? 0 - | BGFX_STENCIL_TEST_ALWAYS - | BGFX_STENCIL_FUNC_REF(_clear.m_stencil) - | BGFX_STENCIL_FUNC_RMASK(0xff) - | BGFX_STENCIL_OP_FAIL_S_REPLACE - | BGFX_STENCIL_OP_FAIL_Z_REPLACE - | BGFX_STENCIL_OP_PASS_Z_REPLACE - : 0 - ; - - uint32_t numMrt = 1; - FrameBufferHandle fbh = m_fbh; - if (isValid(fbh) && m_frameBuffers[fbh.idx].m_swapChain == NULL) - { - const FrameBufferWgpu& fb = m_frameBuffers[fbh.idx]; - numMrt = bx::uint32_max(1, fb.m_num); - } - - wgpu::RenderPassEncoder rce = m_renderEncoder; - ProgramHandle programHandle = _clearQuad.m_program[numMrt-1]; - - const VertexLayout* decl = &_clearQuad.m_layout; - const PipelineStateWgpu* pso = getPipelineState( - state - , stencil - , 0 - , fbh - , 1 - , &decl - , false - , programHandle - , 0 - ); - rce.SetPipeline(pso->m_rps); - - float mrtClearColor[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4]; - float mrtClearDepth[4] = { _clear.m_depth }; - - if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags) - { - for (uint32_t ii = 0; ii < numMrt; ++ii) - { - uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, _clear.m_index[ii]); - bx::memCopy(mrtClearColor[ii], _palette[index], 16); - } - } - else - { - float rgba[4] = - { - _clear.m_index[0]*1.0f/255.0f, - _clear.m_index[1]*1.0f/255.0f, - _clear.m_index[2]*1.0f/255.0f, - _clear.m_index[3]*1.0f/255.0f, - }; - - for (uint32_t ii = 0; ii < numMrt; ++ii) - { - bx::memCopy( mrtClearColor[ii] - , rgba - , 16 - ); - } - } - - ProgramWgpu& program = m_program[programHandle.idx]; - - ScratchBufferWgpu& scratchBuffer = m_scratchBuffers[0]; - BindStateCacheWgpu& bindStates = m_bindStateCache[0]; - - BindingsWgpu b; - BindStateWgpu& bindState = allocBindState(program, bindStates, b, scratchBuffer); - - const uint32_t voffset = scratchBuffer.write(mrtClearDepth, sizeof(mrtClearDepth), program.m_vsh->m_gpuSize); - const uint32_t foffset = scratchBuffer.write(mrtClearColor, sizeof(mrtClearColor), program.m_fsh->m_gpuSize); - - uint32_t numOffset = 2; - uint32_t offsets[2] = { voffset, foffset }; - - bindGroups(program, bindState, b); - - const VertexBufferWgpu& vb = m_vertexBuffers[_clearQuad.m_vb.idx]; - - bindProgram(rce, program, bindState, numOffset, offsets); - - rce.SetViewport(_rect.m_x, _rect.m_y, _rect.m_width, _rect.m_height, 0.0f, 1.0f); - rce.SetScissorRect(_rect.m_x, _rect.m_y, _rect.m_width, _rect.m_height); - - rce.SetVertexBuffer(0, vb.m_ptr); - rce.Draw(4, 1, 0, 0); - } - - wgpu::TextureViewDescriptor attachmentView(const Attachment& _at, const TextureWgpu& _texture) - { - bool _resolve = bool(_texture.m_ptrMsaa); - BX_UNUSED(_resolve); - - wgpu::TextureViewDescriptor desc; - if (1 < _texture.m_numSides) - { - desc.baseArrayLayer = _at.layer; - } - desc.baseMipLevel = _at.mip; - desc.arrayLayerCount = 1; - desc.mipLevelCount = 1; - - if (_texture.m_type == TextureWgpu::Texture3D) - { - desc.dimension = wgpu::TextureViewDimension::e3D; - } - - return desc; - } - - void setFrameBuffer(RenderPassDescriptor& _renderPassDescriptor, FrameBufferHandle _fbh, bool _msaa = true) - { - if (!isValid(_fbh) - || m_frameBuffers[_fbh.idx].m_swapChain) - { - SwapChainWgpu* swapChain = !isValid(_fbh) - ? m_mainFrameBuffer.m_swapChain - : m_frameBuffers[_fbh.idx].m_swapChain - ; - - _renderPassDescriptor.colorAttachments[0] = defaultDescriptor(); - _renderPassDescriptor.desc.colorAttachmentCount = 1; - - // Force 1 array layers for attachments - wgpu::TextureViewDescriptor desc; - desc.arrayLayerCount = 1; - - if (swapChain->m_backBufferColorMsaa) - { - _renderPassDescriptor.colorAttachments[0].view = swapChain->m_backBufferColorMsaa.CreateView(&desc); - _renderPassDescriptor.colorAttachments[0].resolveTarget = swapChain->current(); - } - else - { - _renderPassDescriptor.colorAttachments[0].view = swapChain->current(); - } - - _renderPassDescriptor.depthStencilAttachment = defaultDescriptor(); - _renderPassDescriptor.depthStencilAttachment.view = swapChain->m_backBufferDepth.CreateView(); - _renderPassDescriptor.desc.depthStencilAttachment = &_renderPassDescriptor.depthStencilAttachment; - } - else - { - FrameBufferWgpu& frameBuffer = m_frameBuffers[_fbh.idx]; - - _renderPassDescriptor.desc.colorAttachmentCount = frameBuffer.m_num; - - for (uint32_t ii = 0; ii < frameBuffer.m_num; ++ii) - { - const TextureWgpu& texture = m_textures[frameBuffer.m_colorHandle[ii].idx]; - - const wgpu::TextureViewDescriptor desc = attachmentView(frameBuffer.m_colorAttachment[ii], texture); - - _renderPassDescriptor.colorAttachments[ii] = defaultDescriptor(); - _renderPassDescriptor.colorAttachments[ii].view = texture.m_ptrMsaa - ? texture.m_ptrMsaa.CreateView(&desc) - : texture.m_ptr.CreateView(&desc) - ; - _renderPassDescriptor.colorAttachments[ii].resolveTarget = texture.m_ptrMsaa - ? texture.m_ptr.CreateView(&desc) - : wgpu::TextureView() - ; - } - - if (isValid(frameBuffer.m_depthHandle) ) - { - const TextureWgpu& texture = m_textures[frameBuffer.m_depthHandle.idx]; - const wgpu::TextureViewDescriptor desc = attachmentView(frameBuffer.m_depthAttachment, texture); - - _renderPassDescriptor.depthStencilAttachment = defaultDescriptor(); - _renderPassDescriptor.depthStencilAttachment.view = texture.m_ptrMsaa - ? texture.m_ptrMsaa.CreateView(&desc) - : texture.m_ptr.CreateView(&desc) - ; - - _renderPassDescriptor.desc.depthStencilAttachment = &_renderPassDescriptor.depthStencilAttachment; - } - } - - m_fbh = _fbh; - m_rtMsaa = _msaa; - } - - void setDepthStencilState(wgpu::DepthStencilState& desc, uint64_t _state, uint64_t _stencil = 0) - { - const uint32_t fstencil = unpackStencil(0, _stencil); - const uint32_t func = (_state&BGFX_STATE_DEPTH_TEST_MASK) >> BGFX_STATE_DEPTH_TEST_SHIFT; - - desc.depthWriteEnabled = !!(BGFX_STATE_WRITE_Z & _state); - desc.depthCompare = s_cmpFunc[func]; - - uint32_t bstencil = unpackStencil(1, _stencil); - const uint32_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != fstencil; - bstencil = frontAndBack ? bstencil : fstencil; - - desc.stencilFront = defaultDescriptor(); - desc.stencilBack = defaultDescriptor(); - - if (0 != _stencil) - { - // TODO (hugoam) - const uint32_t readMask = (fstencil&BGFX_STENCIL_FUNC_RMASK_MASK)>>BGFX_STENCIL_FUNC_RMASK_SHIFT; - const uint32_t writeMask = 0xff; - - desc.stencilReadMask = readMask; - desc.stencilWriteMask = writeMask; - - desc.stencilFront.failOp = s_stencilOp[(fstencil&BGFX_STENCIL_OP_FAIL_S_MASK)>>BGFX_STENCIL_OP_FAIL_S_SHIFT]; - desc.stencilFront.depthFailOp = s_stencilOp[(fstencil&BGFX_STENCIL_OP_FAIL_Z_MASK)>>BGFX_STENCIL_OP_FAIL_Z_SHIFT]; - desc.stencilFront.passOp = s_stencilOp[(fstencil&BGFX_STENCIL_OP_PASS_Z_MASK)>>BGFX_STENCIL_OP_PASS_Z_SHIFT]; - desc.stencilFront.compare = s_cmpFunc[(fstencil&BGFX_STENCIL_TEST_MASK)>>BGFX_STENCIL_TEST_SHIFT]; - - desc.stencilBack.failOp = s_stencilOp[(bstencil&BGFX_STENCIL_OP_FAIL_S_MASK)>>BGFX_STENCIL_OP_FAIL_S_SHIFT]; - desc.stencilBack.depthFailOp = s_stencilOp[(bstencil&BGFX_STENCIL_OP_FAIL_Z_MASK)>>BGFX_STENCIL_OP_FAIL_Z_SHIFT]; - desc.stencilBack.passOp = s_stencilOp[(bstencil&BGFX_STENCIL_OP_PASS_Z_MASK)>>BGFX_STENCIL_OP_PASS_Z_SHIFT]; - desc.stencilBack.compare = s_cmpFunc[(bstencil&BGFX_STENCIL_TEST_MASK)>>BGFX_STENCIL_TEST_SHIFT]; - } - } - - RenderPassStateWgpu* getRenderPassState(bgfx::FrameBufferHandle fbh, bool clear, Clear clr) - { - bx::HashMurmur2A murmur; - murmur.begin(); - murmur.add(fbh.idx); - murmur.add(clear); - murmur.add(&clr, sizeof(clr)); - uint32_t hash = murmur.end(); - - RenderPassStateWgpu* rps = m_renderPassStateCache.find(hash); - - if (NULL == rps) - { - rps = BX_NEW(g_allocator, RenderPassStateWgpu); - m_renderPassStateCache.add(hash, rps); - } - - return rps; - } - - PipelineStateWgpu* getPipelineState( - uint64_t _state - , uint64_t _stencil - , uint32_t _rgba - , FrameBufferHandle _fbh - , uint8_t _numStreams - , const VertexLayout** _vertexDecls - , bool _isIndex16 - , ProgramHandle _program - , uint8_t _numInstanceData - ) - { - _state &= 0 - | BGFX_STATE_WRITE_RGB - | BGFX_STATE_WRITE_A - | BGFX_STATE_WRITE_Z - | BGFX_STATE_DEPTH_TEST_MASK - | BGFX_STATE_BLEND_MASK - | BGFX_STATE_BLEND_EQUATION_MASK - | BGFX_STATE_BLEND_INDEPENDENT - | BGFX_STATE_BLEND_ALPHA_TO_COVERAGE - | BGFX_STATE_CULL_MASK - | BGFX_STATE_MSAA - | BGFX_STATE_LINEAA - | BGFX_STATE_CONSERVATIVE_RASTER - | BGFX_STATE_PT_MASK - ; - - const bool independentBlendEnable = !!(BGFX_STATE_BLEND_INDEPENDENT & _state); - const ProgramWgpu& program = m_program[_program.idx]; - - bx::HashMurmur2A murmur; - murmur.begin(); - murmur.add(_state); - murmur.add(_stencil); - murmur.add(independentBlendEnable ? _rgba : 0); - murmur.add(_numInstanceData); - - FrameBufferWgpu& frameBuffer = !isValid(_fbh) ? m_mainFrameBuffer : m_frameBuffers[_fbh.idx]; - murmur.add(frameBuffer.m_pixelFormatHash); - - murmur.add(program.m_vsh->m_hash); - if (NULL != program.m_fsh) - { - murmur.add(program.m_fsh->m_hash); - } - - for (uint8_t ii = 0; ii < _numStreams; ++ii) - { - murmur.add(_vertexDecls[ii]->m_hash); - } - - uint32_t hash = murmur.end(); - - PipelineStateWgpu* pso = m_pipelineStateCache.find(hash); - - if (NULL == pso) - { - pso = BX_NEW(g_allocator, PipelineStateWgpu); - - //pd.alphaToCoverageEnabled = !!(BGFX_STATE_BLEND_ALPHA_TO_COVERAGE & _state); - - RenderPipelineDescriptor& pd = pso->m_rpd; - - uint32_t frameBufferAttachment = 1; - uint32_t sampleCount = 1; - - if (!isValid(_fbh) - || s_renderWgpu->m_frameBuffers[_fbh.idx].m_swapChain) - { - SwapChainWgpu& swapChain = !isValid(_fbh) - ? *s_renderWgpu->m_mainFrameBuffer.m_swapChain - : *s_renderWgpu->m_frameBuffers[_fbh.idx].m_swapChain - ; - sampleCount = swapChain.m_backBufferColorMsaa - ? swapChain.m_sampleCount - : 1 - ; - pd.targets[0].format = swapChain.m_colorFormat; - pd.depthStencil.format = swapChain.m_depthFormat; - pd.desc.depthStencil = &pd.depthStencil; - } - else - { - frameBufferAttachment = frameBuffer.m_num; - - for (uint32_t ii = 0; ii < frameBuffer.m_num; ++ii) - { - const TextureWgpu& texture = m_textures[frameBuffer.m_colorHandle[ii].idx]; - sampleCount = texture.m_ptrMsaa - ? texture.m_sampleCount - : 1 - ; - pd.targets[ii].format = s_textureFormat[texture.m_textureFormat].m_fmt; - } - - pd.fragment.targetCount = frameBuffer.m_num; - - if (isValid(frameBuffer.m_depthHandle) ) - { - const TextureWgpu& texture = m_textures[frameBuffer.m_depthHandle.idx]; - pd.depthStencil.format = s_textureFormat[texture.m_textureFormat].m_fmt; - pd.desc.depthStencil = &pd.depthStencil; - } - } - - const uint32_t blend = uint32_t( (_state&BGFX_STATE_BLEND_MASK )>>BGFX_STATE_BLEND_SHIFT); - const uint32_t equation = uint32_t( (_state&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT); - - const uint32_t srcRGB = (blend )&0xf; - const uint32_t dstRGB = (blend>> 4)&0xf; - const uint32_t srcA = (blend>> 8)&0xf; - const uint32_t dstA = (blend>>12)&0xf; - - const uint32_t equRGB = (equation )&0x7; - const uint32_t equA = (equation>>3)&0x7; - - wgpu::ColorWriteMask writeMask = wgpu::ColorWriteMask::None; - writeMask |= (_state&BGFX_STATE_WRITE_R) ? wgpu::ColorWriteMask::Red : wgpu::ColorWriteMask::None; - writeMask |= (_state&BGFX_STATE_WRITE_G) ? wgpu::ColorWriteMask::Green : wgpu::ColorWriteMask::None; - writeMask |= (_state&BGFX_STATE_WRITE_B) ? wgpu::ColorWriteMask::Blue : wgpu::ColorWriteMask::None; - writeMask |= (_state&BGFX_STATE_WRITE_A) ? wgpu::ColorWriteMask::Alpha : wgpu::ColorWriteMask::None; - - for (uint32_t ii = 0; ii < (independentBlendEnable ? 1 : frameBufferAttachment); ++ii) - { - wgpu::ColorTargetState& drt = pd.targets[ii]; - wgpu::BlendState& blend = pd.blends[ii]; - - if(!(BGFX_STATE_BLEND_MASK & _state)) - { - // useless - blend.color = defaultDescriptor(); - blend.alpha = defaultDescriptor(); - - drt.blend = NULL; - } - else - { - blend.color.srcFactor = s_blendFactor[srcRGB][0]; - blend.color.dstFactor = s_blendFactor[dstRGB][0]; - blend.color.operation = s_blendEquation[equRGB]; - - blend.alpha.srcFactor = s_blendFactor[srcA][1]; - blend.alpha.dstFactor = s_blendFactor[dstA][1]; - blend.alpha.operation = s_blendEquation[equA]; - - drt.blend = &blend; - } - - drt.writeMask = writeMask; - } - - if (independentBlendEnable) - { - for (uint32_t ii = 1, rgba = _rgba; ii < frameBufferAttachment; ++ii, rgba >>= 11) - { - wgpu::ColorTargetState& drt = pd.targets[ii]; - wgpu::BlendState& blend = pd.blends[ii]; - - //drt.blendingEnabled = 0 != (rgba&0x7ff); - - const uint32_t src = (rgba )&0xf; - const uint32_t dst = (rgba>>4)&0xf; - const uint32_t equationIndex = (rgba>>8)&0x7; - - blend.color.srcFactor = s_blendFactor[src][0]; - blend.color.dstFactor = s_blendFactor[dst][0]; - blend.color.operation = s_blendEquation[equationIndex]; - - blend.alpha.srcFactor = s_blendFactor[src][1]; - blend.alpha.dstFactor = s_blendFactor[dst][1]; - blend.alpha.operation = s_blendEquation[equationIndex]; - - drt.writeMask = writeMask; - } - } - - pd.desc.vertex.module = program.m_vsh->m_module; - - if (NULL != program.m_fsh) - { - pd.fragment.module = program.m_fsh->m_module; - pd.desc.fragment = &pd.fragment; - } - - setDepthStencilState(pd.depthStencil, _state, _stencil); - - const uint64_t cull = _state & BGFX_STATE_CULL_MASK; - const uint8_t cullIndex = uint8_t(cull >> BGFX_STATE_CULL_SHIFT); - pd.desc.primitive.cullMode = s_cullMode[cullIndex]; - - pd.desc.primitive.frontFace = (_state & BGFX_STATE_FRONT_CCW) ? wgpu::FrontFace::CCW : wgpu::FrontFace::CW; - - // pd.desc = m_renderPipelineDescriptor; - pd.desc.multisample.count = sampleCount; - - wgpu::PipelineLayoutDescriptor layout = defaultDescriptor(); - layout.bindGroupLayouts = &program.m_bindGroupLayout; - layout.bindGroupLayoutCount = 1; - - BX_TRACE("Creating WebGPU render pipeline layout for program %s", program.m_vsh->name()); - pd.desc.layout = m_device.CreatePipelineLayout(&layout); - // TODO (hugoam) this should be cached too ? - - //uint32_t ref = (_state&BGFX_STATE_ALPHA_REF_MASK) >> BGFX_STATE_ALPHA_REF_SHIFT; - //viewState.m_alphaRef = ref / 255.0f; - - const uint64_t primType = _state & BGFX_STATE_PT_MASK; - uint8_t primIndex = uint8_t(primType >> BGFX_STATE_PT_SHIFT); - - PrimInfo prim = s_primInfo[primIndex]; - pd.desc.primitive.topology = prim.m_type; - - VertexStateDescriptor vertex; - vertex.desc.module = program.m_vsh->m_module; - vertex.desc.bufferCount = 0; - - wgpu::VertexBufferLayout* inputBinding = vertex.buffers; - wgpu::VertexAttribute* inputAttrib = vertex.attributes; - - auto fillVertexDecl = [&](const ShaderWgpu* _vsh, const VertexLayout& _decl) - { - vertex.desc.bufferCount += 1; - - inputBinding->arrayStride = _decl.m_stride; - inputBinding->stepMode = wgpu::InputStepMode::Vertex; - inputBinding->attributes = inputAttrib; - - uint32_t numAttribs = 0; - - for(uint32_t attr = 0; attr < Attrib::Count; ++attr) - { - if(UINT16_MAX != _decl.m_attributes[attr]) - { - if(UINT8_MAX == _vsh->m_attrRemap[attr]) - continue; - - inputAttrib->shaderLocation = _vsh->m_attrRemap[attr]; - - if(0 == _decl.m_attributes[attr]) - { - inputAttrib->format = wgpu::VertexFormat::Float3; - inputAttrib->offset = 0; - } - else - { - uint8_t num; - AttribType::Enum type; - bool normalized; - bool asInt; - _decl.decode(Attrib::Enum(attr), num, type, normalized, asInt); - inputAttrib->format = s_attribType[type][num-1][normalized]; - inputAttrib->offset = _decl.m_offset[attr]; - } - - ++inputAttrib; - ++numAttribs; - } - } - - inputBinding->attributeCount = numAttribs; - inputBinding++; - - return numAttribs; - }; - - //bool attrSet[Attrib::Count] = {}; - - uint16_t unsettedAttr[Attrib::Count]; - bx::memCopy(unsettedAttr, program.m_vsh->m_attrMask, sizeof(uint16_t) * Attrib::Count); - - uint8_t stream = 0; - for (; stream < _numStreams; ++stream) - { - VertexLayout layout; - bx::memCopy(&layout, _vertexDecls[stream], sizeof(VertexLayout)); - const uint16_t* attrMask = program.m_vsh->m_attrMask; - - for (uint32_t ii = 0; ii < Attrib::Count; ++ii) - { - Attrib::Enum iiattr = Attrib::Enum(ii); - uint16_t mask = attrMask[ii]; - uint16_t attr = (layout.m_attributes[ii] & mask); - if (attr == 0) - { - layout.m_attributes[ii] = UINT16_MAX; - } - if (unsettedAttr[ii] && attr != UINT16_MAX) - { - unsettedAttr[ii] = 0; - } - } - - fillVertexDecl(program.m_vsh, layout); - } - - for (uint32_t ii = 0; ii < Attrib::Count; ++ii) - { - Attrib::Enum iiattr = Attrib::Enum(ii); - if (0 < unsettedAttr[ii]) - { - //uint32_t numAttribs = vertexs.buffers[stream].attributeCount; - //uint32_t numAttribs = inputBinding->attributeCount; - //wgpu::VertexBufferLayout* inputAttrib = const_cast(_vertexInputState.pVertexAttributeDescriptions + numAttribs); - inputAttrib->shaderLocation = program.m_vsh->m_attrRemap[ii]; - //inputAttrib->binding = 0; - inputAttrib->format = wgpu::VertexFormat::Float3; // VK_FORMAT_R32G32B32_SFLOAT; - inputAttrib->offset = 0; - vertex.buffers[stream-1].attributeCount++; - ++inputAttrib; - } - } - - // TODO (hugoam) WebGPU will crash whenever we are not supplying the correct number of attributes (which depends on the stride passed to bgfx::allocInstanceDataBuffer) - // so we need to know the number of live instance attributes in the shader and if they aren't all supplied: - // - fail the pipeline state creation - // - bind dummy attributes - if (0 < _numInstanceData) - { - uint32_t numBindings = vertex.desc.bufferCount; // == stream+1 // .vertexBindingDescriptionCount; - uint32_t firstAttrib = vertex.buffers[stream-1].attributeCount; - uint32_t numAttribs = firstAttrib; - - inputBinding->arrayStride = _numInstanceData * 16; - inputBinding->stepMode = wgpu::InputStepMode::Instance; - - for (uint32_t inst = 0; inst < _numInstanceData; ++inst) - { - inputAttrib->shaderLocation = numAttribs; - inputAttrib->format = wgpu::VertexFormat::Float32x4; - inputAttrib->offset = inst * 16; - - ++numAttribs; - ++inputAttrib; - } - - vertex.desc.bufferCount = numBindings + 1; - vertex.buffers[stream].attributeCount = numAttribs - firstAttrib; - vertex.buffers[stream].attributes = &vertex.attributes[firstAttrib]; - } - - bool isStrip = prim.m_type == wgpu::PrimitiveTopology::LineStrip - || prim.m_type == wgpu::PrimitiveTopology::TriangleStrip; - if (isStrip) - pd.desc.primitive.stripIndexFormat = _isIndex16 ? wgpu::IndexFormat::Uint16 : wgpu::IndexFormat::Uint32; - else - pd.desc.primitive.stripIndexFormat = wgpu::IndexFormat::Undefined; - - pd.desc.vertex = vertex.desc; - - BX_TRACE("Creating WebGPU render pipeline state for program %s", program.m_vsh->name()); - pso->m_rps = m_device.CreateRenderPipeline2(&pd.desc); - - m_pipelineStateCache.add(hash, pso); - } - - return pso; - } - - PipelineStateWgpu* getPipelineState( - uint64_t _state - , uint64_t _stencil - , uint32_t _rgba - , FrameBufferHandle _fbh - , VertexLayoutHandle _declHandle - , bool _isIndex16 - , ProgramHandle _program - , uint8_t _numInstanceData - ) - { - const VertexLayout* decl = &m_vertexDecls[_declHandle.idx]; - return getPipelineState( - _state - , _stencil - , _rgba - , _fbh - , 1 - , &decl - , _isIndex16 - , _program - , _numInstanceData - ); - } - - PipelineStateWgpu* getComputePipelineState(ProgramHandle _program) - { - ProgramWgpu& program = m_program[_program.idx]; - - if (NULL == program.m_computePS) - { - PipelineStateWgpu* pso = BX_NEW(g_allocator, PipelineStateWgpu); - program.m_computePS = pso; - - wgpu::PipelineLayoutDescriptor layout = defaultDescriptor(); - layout.bindGroupLayouts = &program.m_bindGroupLayout; - layout.bindGroupLayoutCount = 1; - - BX_TRACE("Creating WebGPU render pipeline layout for program %s", program.m_vsh->name()); - pso->m_layout = m_device.CreatePipelineLayout(&layout); - - wgpu::ComputePipelineDescriptor desc; - desc.layout = pso->m_layout; - desc.computeStage = { NULL, program.m_vsh->m_module, "main" }; - - BX_TRACE("Creating WebGPU render pipeline state for program %s", program.m_vsh->name()); - pso->m_cps = m_device.CreateComputePipeline(&desc); - } - - return program.m_computePS; - } - - - wgpu::Sampler getSamplerState(uint32_t _flags) - { - _flags &= BGFX_SAMPLER_BITS_MASK; - SamplerStateWgpu* sampler = m_samplerStateCache.find(_flags); - - if (NULL == sampler) - { - sampler = BX_NEW(g_allocator, SamplerStateWgpu); - - wgpu::SamplerDescriptor desc; - desc.addressModeU = s_textureAddress[(_flags&BGFX_SAMPLER_U_MASK)>>BGFX_SAMPLER_U_SHIFT]; - desc.addressModeV = s_textureAddress[(_flags&BGFX_SAMPLER_V_MASK)>>BGFX_SAMPLER_V_SHIFT]; - desc.addressModeW = s_textureAddress[(_flags&BGFX_SAMPLER_W_MASK)>>BGFX_SAMPLER_W_SHIFT]; - desc.minFilter = s_textureFilterMinMag[(_flags&BGFX_SAMPLER_MIN_MASK)>>BGFX_SAMPLER_MIN_SHIFT]; - desc.magFilter = s_textureFilterMinMag[(_flags&BGFX_SAMPLER_MAG_MASK)>>BGFX_SAMPLER_MAG_SHIFT]; - desc.mipmapFilter = s_textureFilterMip[(_flags&BGFX_SAMPLER_MIP_MASK)>>BGFX_SAMPLER_MIP_SHIFT]; - desc.lodMinClamp = 0; - desc.lodMaxClamp = bx::kFloatMax; - - const uint32_t cmpFunc = (_flags&BGFX_SAMPLER_COMPARE_MASK)>>BGFX_SAMPLER_COMPARE_SHIFT; - desc.compare = 0 == cmpFunc - ? wgpu::CompareFunction::Undefined - : s_cmpFunc[cmpFunc] - ; - - sampler->m_sampler = s_renderWgpu->m_device.CreateSampler(&desc); - m_samplerStateCache.add(_flags, sampler); - } - - return sampler->m_sampler; - } - - wgpu::CommandEncoder& getRenderEncoder() - { - if (!m_cmd.m_renderEncoder) - m_cmd.beginRender(); - - return m_cmd.m_renderEncoder; - } - - wgpu::CommandEncoder& getStagingEncoder() - { - if (!m_cmd.m_stagingEncoder) - m_cmd.beginStaging(); - - return m_cmd.m_stagingEncoder; - } - - wgpu::CommandEncoder& getBlitCommandEncoder() - { - if (m_renderEncoder || m_computeEncoder) - endEncoding(); - - return getRenderEncoder(); - } - - wgpu::RenderPassEncoder renderPass(bgfx::Frame* _render, bgfx::FrameBufferHandle fbh, bool clear, Clear clr, const char* name = NULL) - { - RenderPassStateWgpu* rps = s_renderWgpu->getRenderPassState(fbh, clear, clr); - - RenderPassDescriptor& renderPassDescriptor = rps->m_rpd; - renderPassDescriptor.desc.label = name; - - setFrameBuffer(renderPassDescriptor, fbh); - - if(clear) - { - for(uint32_t ii = 0; ii < g_caps.limits.maxFBAttachments; ++ii) - { - wgpu::RenderPassColorAttachment& color = renderPassDescriptor.colorAttachments[ii]; - - if(0 != (BGFX_CLEAR_COLOR & clr.m_flags)) - { - if(0 != (BGFX_CLEAR_COLOR_USE_PALETTE & clr.m_flags)) - { - uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE - 1, clr.m_index[ii]); - const float* rgba = _render->m_colorPalette[index]; - const float rr = rgba[0]; - const float gg = rgba[1]; - const float bb = rgba[2]; - const float aa = rgba[3]; - color.clearColor = { rr, gg, bb, aa }; - } - else - { - float rr = clr.m_index[0] * 1.0f / 255.0f; - float gg = clr.m_index[1] * 1.0f / 255.0f; - float bb = clr.m_index[2] * 1.0f / 255.0f; - float aa = clr.m_index[3] * 1.0f / 255.0f; - color.clearColor = { rr, gg, bb, aa }; - } - - color.loadOp = wgpu::LoadOp::Clear; - } - else - { - color.loadOp = wgpu::LoadOp::Load; - } - - //desc.storeOp = desc.view.sampleCount > 1 ? wgpu::StoreOp::MultisampleResolve : wgpu::StoreOp::Store; - color.storeOp = wgpu::StoreOp::Store; - } - - wgpu::RenderPassDepthStencilAttachment& depthStencil = renderPassDescriptor.depthStencilAttachment; - - if(depthStencil.view) - { - depthStencil.clearDepth = clr.m_depth; - depthStencil.depthLoadOp = 0 != (BGFX_CLEAR_DEPTH & clr.m_flags) - ? wgpu::LoadOp::Clear - : wgpu::LoadOp::Load - ; - depthStencil.depthStoreOp = m_mainFrameBuffer.m_swapChain->m_backBufferColorMsaa - ? wgpu::StoreOp(0) //wgpu::StoreOp::DontCare - : wgpu::StoreOp::Store - ; - - depthStencil.clearStencil = clr.m_stencil; - depthStencil.stencilLoadOp = 0 != (BGFX_CLEAR_STENCIL & clr.m_flags) - ? wgpu::LoadOp::Clear - : wgpu::LoadOp::Load - ; - depthStencil.stencilStoreOp = m_mainFrameBuffer.m_swapChain->m_backBufferColorMsaa - ? wgpu::StoreOp(0) //wgpu::StoreOp::DontCare - : wgpu::StoreOp::Store - ; - } - } - else - { - for(uint32_t ii = 0; ii < g_caps.limits.maxFBAttachments; ++ii) - { - wgpu::RenderPassColorAttachment& color = renderPassDescriptor.colorAttachments[ii]; - if(color.view) - { - color.loadOp = wgpu::LoadOp::Load; - } - } - - wgpu::RenderPassDepthStencilAttachment& depthStencil = renderPassDescriptor.depthStencilAttachment; - - if(depthStencil.view) - { - depthStencil.depthLoadOp = wgpu::LoadOp::Load; - depthStencil.depthStoreOp = wgpu::StoreOp::Store; - - depthStencil.stencilLoadOp = wgpu::LoadOp::Load; - depthStencil.stencilStoreOp = wgpu::StoreOp::Store; - } - } - - wgpu::RenderPassEncoder rce = m_cmd.m_renderEncoder.BeginRenderPass(&renderPassDescriptor.desc); - m_renderEncoder = rce; - return rce; - } - - void endEncoding() - { - if (m_renderEncoder) - { - m_renderEncoder.EndPass(); - m_renderEncoder = NULL; - } - - if (m_computeEncoder) - { - m_computeEncoder.EndPass(); - m_computeEncoder = NULL; - } - } - - void* m_renderDocDll; - -#if !BX_PLATFORM_EMSCRIPTEN - dawn_native::Instance m_instance; -#endif - wgpu::Device m_device; - wgpu::Queue m_queue; - TimerQueryWgpu m_gpuTimer; - CommandQueueWgpu m_cmd; - - StagingBufferWgpu m_uniformBuffers[WEBGPU_NUM_UNIFORM_BUFFERS]; - ScratchBufferWgpu m_scratchBuffers[BGFX_CONFIG_MAX_FRAME_LATENCY]; - - BindStateCacheWgpu m_bindStateCache[BGFX_CONFIG_MAX_FRAME_LATENCY]; - - uint8_t m_frameIndex; - - uint16_t m_numWindows; - FrameBufferHandle m_windows[BGFX_CONFIG_MAX_FRAME_BUFFERS]; - - IndexBufferWgpu m_indexBuffers[BGFX_CONFIG_MAX_INDEX_BUFFERS]; - VertexBufferWgpu m_vertexBuffers[BGFX_CONFIG_MAX_VERTEX_BUFFERS]; - ShaderWgpu m_shaders[BGFX_CONFIG_MAX_SHADERS]; - ProgramWgpu m_program[BGFX_CONFIG_MAX_PROGRAMS]; - TextureWgpu m_textures[BGFX_CONFIG_MAX_TEXTURES]; - ReadbackWgpu m_readbacks[BGFX_CONFIG_MAX_TEXTURES]; - FrameBufferWgpu m_mainFrameBuffer; - FrameBufferWgpu m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS]; - VertexLayout m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_LAYOUTS]; - UniformRegistry m_uniformReg; - void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS]; - - //StateCacheT m_bindStateCache; - StateCacheT m_renderPassStateCache; - StateCacheT m_pipelineStateCache; - StateCacheT m_samplerStateCache; - - TextVideoMem m_textVideoMem; - - uint8_t m_fsScratch[64 << 10]; - uint8_t m_vsScratch[64 << 10]; - - FrameBufferHandle m_fbh; - bool m_rtMsaa; - - Resolution m_resolution; - void* m_capture; - uint32_t m_captureSize; - - wgpu::RenderPassEncoder m_renderEncoder; - wgpu::ComputePassEncoder m_computeEncoder; - }; - - RendererContextI* rendererCreate(const Init& _init) - { - s_renderWgpu = BX_NEW(g_allocator, RendererContextWgpu); - if (!s_renderWgpu->init(_init) ) - { - bx::deleteObject(g_allocator, s_renderWgpu); - s_renderWgpu = NULL; - } - return s_renderWgpu; - } - - void rendererDestroy() - { - s_renderWgpu->shutdown(); - bx::deleteObject(g_allocator, s_renderWgpu); - s_renderWgpu = NULL; - } - - void writeString(bx::WriterI* _writer, const char* _str) - { - bx::write(_writer, _str, (int32_t)bx::strLen(_str) ); - } - - void ShaderWgpu::create(ShaderHandle _handle, const Memory* _mem) - { - m_handle = _handle; - - BX_TRACE("Creating shader %s", getName(_handle)); - - bx::MemoryReader reader(_mem->data, _mem->size); - - bx::ErrorAssert err; - - uint32_t magic; - bx::read(&reader, magic, &err); - - wgpu::ShaderStage shaderStage; - - if (isShaderType(magic, 'C')) - { - shaderStage = wgpu::ShaderStage::Compute; - } - else if (isShaderType(magic, 'F')) - { - shaderStage = wgpu::ShaderStage::Fragment; - } - else if (isShaderType(magic, 'G')) - { - //shaderStage = wgpu::ShaderStage::Geometry; - } - else if (isShaderType(magic, 'V')) - { - shaderStage = wgpu::ShaderStage::Vertex; - } - - m_stage = shaderStage; - - uint32_t hashIn; - bx::read(&reader, hashIn, &err); - - uint32_t hashOut; - - if (isShaderVerLess(magic, 6) ) - { - hashOut = hashIn; - } - else - { - bx::read(&reader, hashOut, &err); - } - - uint16_t count; - bx::read(&reader, count, &err); - - m_numPredefined = 0; - m_numUniforms = count; - - BX_TRACE("%s Shader consts %d" - , getShaderTypeName(magic) - , count - ); - - const bool fragment = isShaderType(magic, 'F'); - uint8_t fragmentBit = fragment ? kUniformFragmentBit : 0; - - BX_ASSERT(!isShaderVerLess(magic, 11), "WebGPU backend supports only shader binary version >= 11"); - - if (0 < count) - { - for (uint32_t ii = 0; ii < count; ++ii) - { - uint8_t nameSize = 0; - bx::read(&reader, nameSize, &err); - - char name[256]; - bx::read(&reader, &name, nameSize, &err); - name[nameSize] = '\0'; - - uint8_t type = 0; - bx::read(&reader, type, &err); - - uint8_t num; - bx::read(&reader, num, &err); - - uint16_t regIndex; - bx::read(&reader, regIndex, &err); - - uint16_t regCount; - bx::read(&reader, regCount, &err); - - uint8_t texComponent; - bx::read(&reader, texComponent, &err); - - uint8_t texDimension; - bx::read(&reader, texDimension, &err); - - uint16_t texFormat = 0; - bx::read(&reader, texFormat, &err); - - const char* kind = "invalid"; - - PredefinedUniform::Enum predefined = nameToPredefinedUniformEnum(name); - if (PredefinedUniform::Count != predefined) - { - kind = "predefined"; - m_predefined[m_numPredefined].m_loc = regIndex; - m_predefined[m_numPredefined].m_count = regCount; - m_predefined[m_numPredefined].m_type = uint8_t(predefined|fragmentBit); - m_numPredefined++; - } - else if (UniformType::End == (~kUniformMask & type)) - { - // regCount is used for descriptor type - const bool buffer = idToDescriptorType(regCount) == DescriptorType::StorageBuffer; - const bool readonly = (type & kUniformReadOnlyBit) != 0; - - const uint8_t reverseShift = kSpirvBindShift; - const uint8_t stage = regIndex - reverseShift; - - m_bindInfo[stage].m_index = m_numBuffers; - m_bindInfo[stage].m_binding = regIndex; - m_bindInfo[stage].m_uniform = { 0 }; - - m_buffers[m_numBuffers] = wgpu::BindGroupLayoutEntry(); - m_buffers[m_numBuffers].binding = regIndex; - m_buffers[m_numBuffers].visibility = shaderStage; - - if (buffer) - { - m_buffers[m_numBuffers].buffer.type = readonly - ? wgpu::BufferBindingType::ReadOnlyStorage - : wgpu::BufferBindingType::Storage; - } - else - { - m_buffers[m_numBuffers].storageTexture.access = readonly - ? wgpu::StorageTextureAccess::ReadOnly - : wgpu::StorageTextureAccess::WriteOnly; - - m_buffers[m_numBuffers].storageTexture.format = s_textureFormat[texFormat].m_fmt; - } - - m_numBuffers++; - - kind = "storage"; - } - else if (UniformType::Sampler == (~kUniformMask & type)) - { - const UniformRegInfo* info = s_renderWgpu->m_uniformReg.find(name); - BX_ASSERT(NULL != info, "User defined uniform '%s' is not found, it won't be set.", name); - - const uint8_t reverseShift = kSpirvBindShift; - const uint8_t stage = regIndex - reverseShift; - - m_bindInfo[stage].m_index = m_numSamplers; - m_bindInfo[stage].m_binding = regIndex; - m_bindInfo[stage].m_uniform = info->m_handle; - - auto textureDimensionToWgpu = [](TextureDimension::Enum dimension) - { - switch (dimension) - { - case TextureDimension::Dimension1D: return wgpu::TextureViewDimension::e1D; - case TextureDimension::Dimension2D: return wgpu::TextureViewDimension::e2D; - case TextureDimension::Dimension2DArray: return wgpu::TextureViewDimension::e2DArray; - case TextureDimension::DimensionCube: return wgpu::TextureViewDimension::Cube; - case TextureDimension::DimensionCubeArray: return wgpu::TextureViewDimension::CubeArray; - case TextureDimension::Dimension3D: return wgpu::TextureViewDimension::e3D; - default: return wgpu::TextureViewDimension::Undefined; - } - }; - - auto textureComponentToWgpuSampleType = [](TextureComponentType::Enum componentType) - { - switch (componentType) - { - case TextureComponentType::Float: return wgpu::TextureSampleType::Float; - case TextureComponentType::Int: return wgpu::TextureSampleType::Sint; - case TextureComponentType::Uint: return wgpu::TextureSampleType::Uint; - default: return wgpu::TextureSampleType::Float; - } - }; - - m_textures[m_numSamplers] = wgpu::BindGroupLayoutEntry(); - m_textures[m_numSamplers].binding = regIndex; - m_textures[m_numSamplers].visibility = shaderStage; - m_textures[m_numSamplers].texture.viewDimension = textureDimensionToWgpu(idToTextureDimension(texDimension)); - m_textures[m_numSamplers].texture.sampleType = textureComponentToWgpuSampleType(idToTextureComponentType(texComponent)); - - const bool comparisonSampler = (type & kUniformCompareBit) != 0; - - m_samplers[m_numSamplers] = wgpu::BindGroupLayoutEntry(); - m_samplers[m_numSamplers].binding = regIndex + kSpirvSamplerShift; - m_samplers[m_numSamplers].visibility = shaderStage; - m_samplers[m_numSamplers].sampler.type = comparisonSampler - ? wgpu::SamplerBindingType::Comparison - : wgpu::SamplerBindingType::Filtering - ; - - m_numSamplers++; - - kind = "sampler"; - } - else - { - const UniformRegInfo* info = s_renderWgpu->m_uniformReg.find(name); - BX_ASSERT(NULL != info, "User defined uniform '%s' is not found, it won't be set.", name); - - if(NULL == m_constantBuffer) - { - m_constantBuffer = UniformBuffer::create(1024); - } - - kind = "user"; - m_constantBuffer->writeUniformHandle((UniformType::Enum)(type | fragmentBit), regIndex, info->m_handle, regCount); - } - - BX_TRACE("\t%s: %s (%s), r.index %3d, r.count %2d, r.texComponent %1d, r.texDimension %1d" - , kind - , name - , getUniformTypeName(UniformType::Enum(type&~kUniformMask) ) - , regIndex - , regCount - , texComponent - , texDimension - ); - BX_UNUSED(kind); - } - - if (NULL != m_constantBuffer) - { - m_constantBuffer->finish(); - } - } - - uint32_t shaderSize; - bx::read(&reader, shaderSize, &err); - - BX_TRACE("Shader body is at %lld size %u remaining %lld", reader.getPos(), shaderSize, reader.remaining()); - - const uint32_t* code = (const uint32_t*)reader.getDataPtr(); - bx::skip(&reader, shaderSize+1); - - m_code = (uint32_t*)bx::alloc(g_allocator, shaderSize); - m_codeSize = shaderSize; - - bx::memCopy(m_code, code, shaderSize); - // TODO (hugoam) delete this - - BX_TRACE("First word %08" PRIx32, code[0]); - - uint8_t numAttrs = 0; - bx::read(&reader, numAttrs, &err); - - m_numAttrs = numAttrs; - - bx::memSet(m_attrMask, 0, sizeof(m_attrMask)); - bx::memSet(m_attrRemap, UINT8_MAX, sizeof(m_attrRemap)); - - for(uint8_t ii = 0; ii < numAttrs; ++ii) - { - uint16_t id; - bx::read(&reader, id, &err); - - auto toString = [](Attrib::Enum attr) - { - if (attr == Attrib::Position) return "Position"; - else if (attr == Attrib::Normal) return "Normal"; - else if (attr == Attrib::Tangent) return "Tangent"; - else if (attr == Attrib::Bitangent) return "Bitangent"; - else if (attr == Attrib::Color0) return "Color0"; - else if (attr == Attrib::Color1) return "Color1"; - else if (attr == Attrib::Color2) return "Color2"; - else if (attr == Attrib::Color3) return "Color3"; - else if (attr == Attrib::Indices) return "Indices"; - else if (attr == Attrib::Weight) return "Weight"; - else if (attr == Attrib::TexCoord0) return "TexCoord0"; - else if (attr == Attrib::TexCoord1) return "TexCoord1"; - else if (attr == Attrib::TexCoord2) return "TexCoord2"; - else if (attr == Attrib::TexCoord3) return "TexCoord3"; - else if (attr == Attrib::TexCoord4) return "TexCoord4"; - else if (attr == Attrib::TexCoord5) return "TexCoord5"; - else if (attr == Attrib::TexCoord6) return "TexCoord6"; - else if (attr == Attrib::TexCoord7) return "TexCoord7"; - return "Invalid"; - }; - - Attrib::Enum attr = idToAttrib(id); - - if(Attrib::Count != attr) - { - m_attrMask[attr] = UINT16_MAX; - m_attrRemap[attr] = ii; - BX_TRACE("\tattrib: %s (%i) at index %i", toString(attr), attr, ii); - } - } - - wgpu::ShaderModuleSPIRVDescriptor spirv; - spirv.code = m_code; - spirv.codeSize = shaderSize / 4; - - wgpu::ShaderModuleDescriptor desc; - desc.label = getName(_handle); - desc.nextInChain = &spirv; - - m_module = s_renderWgpu->m_device.CreateShaderModule(&desc); - - BGFX_FATAL(m_module - , bgfx::Fatal::InvalidShader - , "Failed to create %s shader." - , getShaderTypeName(magic) - ); - - bx::HashMurmur2A murmur; - murmur.begin(); - murmur.add(hashIn); - murmur.add(hashOut); - murmur.add(code, shaderSize); - murmur.add(numAttrs); - murmur.add(m_attrMask, numAttrs); - m_hash = murmur.end(); - - auto roundUp = [](auto value, auto multiple) - { - return ((value + multiple - 1) / multiple) * multiple; - }; - - bx::read(&reader, m_size, &err); - - const uint32_t align = kMinBufferOffsetAlignment; - m_gpuSize = uint16_t(bx::strideAlign(m_size, align) ); - - BX_TRACE("shader size %d (used=%d) (prev=%d)", (int)m_size, (int)m_gpuSize, (int)bx::strideAlign(roundUp(m_size, 4), align)); - } - - void ProgramWgpu::create(const ShaderWgpu* _vsh, const ShaderWgpu* _fsh) - { - BX_ASSERT(_vsh->m_module, "Vertex shader doesn't exist."); - m_vsh = _vsh; - m_fsh = _fsh; - m_gpuSize = _vsh->m_gpuSize + (_fsh ? _fsh->m_gpuSize : 0); - - //BX_ASSERT(NULL != _vsh->m_code, "Vertex shader doesn't exist."); - m_vsh = _vsh; - bx::memCopy(&m_predefined[0], _vsh->m_predefined, _vsh->m_numPredefined * sizeof(PredefinedUniform)); - m_numPredefined = _vsh->m_numPredefined; - - if(NULL != _fsh) - { - //BX_ASSERT(NULL != _fsh->m_code, "Fragment shader doesn't exist."); - m_fsh = _fsh; - bx::memCopy(&m_predefined[m_numPredefined], _fsh->m_predefined, _fsh->m_numPredefined * sizeof(PredefinedUniform)); - m_numPredefined += _fsh->m_numPredefined; - } - - wgpu::BindGroupLayoutEntry bindings[2 + BGFX_CONFIG_MAX_TEXTURE_SAMPLERS * 3]; - - m_numUniforms = 0 + (_vsh->m_size > 0 ? 1 : 0) + (NULL != _fsh && _fsh->m_size > 0 ? 1 : 0); - - uint8_t numBindings = 0; - - if (_vsh->m_size > 0) - { - bindings[numBindings].binding = kSpirvVertexBinding; - bindings[numBindings].visibility = _vsh->m_stage; - bindings[numBindings].buffer.type = wgpu::BufferBindingType::Uniform; - bindings[numBindings].buffer.hasDynamicOffset = true; - numBindings++; - } - - if (NULL != _fsh && _fsh->m_size > 0) - { - bindings[numBindings].binding = kSpirvFragmentBinding; - bindings[numBindings].visibility = wgpu::ShaderStage::Fragment; - bindings[numBindings].buffer.type = wgpu::BufferBindingType::Uniform; - bindings[numBindings].buffer.hasDynamicOffset = true; - numBindings++; - } - - uint8_t numSamplers = 0; - - for (uint32_t ii = 0; ii < _vsh->m_numSamplers; ++ii) - { - m_textures[ii] = _vsh->m_textures[ii]; - m_samplers[ii] = _vsh->m_samplers[ii]; - bindings[numBindings++] = _vsh->m_textures[ii]; - bindings[numBindings++] = _vsh->m_samplers[ii]; - } - - numSamplers += _vsh->m_numSamplers; - - if (NULL != _fsh) - { - for (uint32_t ii = 0; ii < _fsh->m_numSamplers; ++ii) - { - m_textures[numSamplers + ii] = _fsh->m_textures[ii]; - m_samplers[numSamplers + ii] = _fsh->m_samplers[ii]; - bindings[numBindings++] = _fsh->m_textures[ii]; - bindings[numBindings++] = _fsh->m_samplers[ii]; - } - - numSamplers += _fsh->m_numSamplers; - } - - for (uint8_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage) - { - if (isValid(m_vsh->m_bindInfo[stage].m_uniform)) - { - m_bindInfo[stage] = m_vsh->m_bindInfo[stage]; - } - else if (NULL != m_fsh && isValid(m_fsh->m_bindInfo[stage].m_uniform)) - { - m_bindInfo[stage] = m_fsh->m_bindInfo[stage]; - m_bindInfo[stage].m_index += _vsh->m_numSamplers; - } - } - - m_numSamplers = numSamplers; - - uint8_t numBuffers = 0; - - for (uint32_t ii = 0; ii < _vsh->m_numBuffers; ++ii) - { - m_buffers[ii] = _vsh->m_buffers[ii]; - bindings[numBindings++] = _vsh->m_buffers[ii]; - } - - numBuffers += _vsh->m_numBuffers; - - if (NULL != _fsh) - { - for (uint32_t ii = 0; ii < _fsh->m_numBuffers; ++ii) - { - m_buffers[numBuffers + ii] = _fsh->m_buffers[ii]; - bindings[numBindings++] = _fsh->m_buffers[ii]; - } - - numBuffers += _fsh->m_numBuffers; - } - - m_numBuffers = numBuffers; - - BX_ASSERT(m_numUniforms + m_numSamplers * 2 + m_numBuffers == numBindings, ""); - - wgpu::BindGroupLayoutDescriptor bindGroupDesc; - bindGroupDesc.entryCount = numBindings; - bindGroupDesc.entries = bindings; - m_bindGroupLayout = s_renderWgpu->m_device.CreateBindGroupLayout(&bindGroupDesc); - - bx::HashMurmur2A murmur; - murmur.begin(); - murmur.add(m_numUniforms); - murmur.add(m_textures, sizeof(wgpu::BindGroupLayoutEntry) * numSamplers); - murmur.add(m_samplers, sizeof(wgpu::BindGroupLayoutEntry) * numSamplers); - murmur.add(m_buffers, sizeof(wgpu::BindGroupLayoutEntry) * m_numBuffers); - m_bindGroupLayoutHash = murmur.end(); - } - - void ProgramWgpu::destroy() - { - m_vsh = NULL; - m_fsh = NULL; - if ( NULL != m_computePS ) - { - bx::deleteObject(g_allocator, m_computePS); - m_computePS = NULL; - } - } - - void BufferWgpu::create(uint32_t _size, void* _data, uint16_t _flags, uint16_t _stride, bool _vertex) - { - BX_UNUSED(_stride); - - m_size = _size; - m_flags = _flags; - m_vertex = _vertex; - - const uint32_t paddedSize = bx::strideAlign(_size, 4); - - bool storage = m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE; - bool indirect = m_flags & BGFX_BUFFER_DRAW_INDIRECT; - - wgpu::BufferDescriptor desc; - desc.size = paddedSize; - desc.usage = _vertex ? wgpu::BufferUsage::Vertex : wgpu::BufferUsage::Index; - desc.usage |= (storage || indirect) ? wgpu::BufferUsage::Storage : wgpu::BufferUsage::None; - desc.usage |= indirect ? wgpu::BufferUsage::Indirect : wgpu::BufferUsage::None; - desc.usage |= NULL == _data ? wgpu::BufferUsage::CopyDst : wgpu::BufferUsage::None; - desc.mappedAtCreation = NULL != _data; - - m_ptr = s_renderWgpu->m_device.CreateBuffer(&desc); - - if(NULL != _data) - { - bx::memCopy(m_ptr.GetMappedRange(), _data, _size); - m_ptr.Unmap(); - } - } - - void BufferWgpu::update(uint32_t _offset, uint32_t _size, void* _data, bool _discard) - { - wgpu::CommandEncoder& bce = s_renderWgpu->getBlitCommandEncoder(); - - if (!m_vertex && !_discard) - { - if ( m_dynamic == NULL ) - { - m_dynamic = (uint8_t*)bx::alloc(g_allocator, m_size); - } - - bx::memCopy(m_dynamic + _offset, _data, _size); - uint32_t start = _offset & 4; - uint32_t end = bx::strideAlign(_offset + _size, 4); - - wgpu::BufferDescriptor desc; - desc.size = end - start; - desc.usage = wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::CopySrc; - desc.mappedAtCreation = true; - - wgpu::Buffer staging = s_renderWgpu->m_device.CreateBuffer(&desc); - bx::memCopy(staging.GetMappedRange(), m_dynamic, end - start); - staging.Unmap(); - - // TODO pad to 4 bytes - bce.CopyBufferToBuffer(staging, 0, m_ptr, start, end - start); - s_renderWgpu->m_cmd.release(staging); - } - else - { - wgpu::BufferDescriptor desc; - desc.size = _size; - desc.usage = wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::CopySrc; - desc.mappedAtCreation = true; - - wgpu::Buffer staging = s_renderWgpu->m_device.CreateBuffer(&desc); - bx::memCopy(staging.GetMappedRange(), _data, _size); - staging.Unmap(); - - bce.CopyBufferToBuffer(staging, 0, m_ptr, _offset, _size); - s_renderWgpu->m_cmd.release(staging); - } - } - - void IndexBufferWgpu::create(uint32_t _size, void* _data, uint16_t _flags) - { - m_format = (_flags & BGFX_BUFFER_INDEX32) != 0 - ? wgpu::IndexFormat::Uint32 - : wgpu::IndexFormat::Uint16; - - BufferWgpu::create(_size, _data, _flags); - } - - void VertexBufferWgpu::create(uint32_t _size, void* _data, VertexLayoutHandle _layoutHandle, uint16_t _flags) - { - m_layoutHandle = _layoutHandle; - uint16_t stride = isValid(_layoutHandle) - ? s_renderWgpu->m_vertexDecls[_layoutHandle.idx].m_stride - : 0 - ; - - BufferWgpu::create(_size, _data, _flags, stride, true); - } - - void TextureWgpu::create(TextureHandle _handle, const Memory* _mem, uint64_t _flags, uint8_t _skip) - { - m_handle = _handle; - - m_sampler = s_renderWgpu->getSamplerState(uint32_t(_flags) ); - - bimg::ImageContainer imageContainer; - - if (bimg::imageParse(imageContainer, _mem->data, _mem->size) ) - { - const bimg::ImageBlockInfo& blockInfo = getBlockInfo(bimg::TextureFormat::Enum(imageContainer.m_format) ); - const uint8_t startLod = bx::min(_skip, imageContainer.m_numMips-1); - - bimg::TextureInfo ti; - bimg::imageGetSize( - &ti - , uint16_t(imageContainer.m_width >>startLod) - , uint16_t(imageContainer.m_height>>startLod) - , uint16_t(imageContainer.m_depth >>startLod) - , imageContainer.m_cubeMap - , 1 < imageContainer.m_numMips - , imageContainer.m_numLayers - , imageContainer.m_format - ); - ti.numMips = bx::min(imageContainer.m_numMips-startLod, ti.numMips); - - m_flags = _flags; - m_width = ti.width; - m_height = ti.height; - m_depth = ti.depth; - m_numLayers = ti.numLayers; - m_numMips = ti.numMips; - m_numSides = ti.numLayers * (imageContainer.m_cubeMap ? 6 : 1); - m_requestedFormat = TextureFormat::Enum(imageContainer.m_format); - m_textureFormat = getViableTextureFormat(imageContainer); - - if (m_requestedFormat == bgfx::TextureFormat::D16) - m_textureFormat = bgfx::TextureFormat::D32F; - - const bool compressed = bimg::isCompressed(bimg::TextureFormat::Enum(imageContainer.m_format)); - - if (compressed) - m_textureFormat = bgfx::TextureFormat::BGRA8; - - const bool convert = m_textureFormat != m_requestedFormat; - const uint8_t bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(m_textureFormat) ); - - wgpu::TextureDescriptor desc = defaultDescriptor(); - //desc.label = getName(_handle); - - if (1 < ti.numLayers) - { - if (imageContainer.m_cubeMap) - { - m_type = TextureCube; - desc.dimension = wgpu::TextureDimension::e2D; - } - else - { - m_type = Texture2D; - desc.dimension = wgpu::TextureDimension::e2D; - } - } - else if (imageContainer.m_cubeMap) - { - m_type = TextureCube; - desc.dimension = wgpu::TextureDimension::e2D; - } - else if (1 < imageContainer.m_depth) - { - m_type = Texture3D; - desc.dimension = wgpu::TextureDimension::e3D; - } - else - { - m_type = Texture2D; - desc.dimension = wgpu::TextureDimension::e2D; - } - - const uint16_t numSides = ti.numLayers * (imageContainer.m_cubeMap ? 6 : 1); - const uint32_t numSrd = numSides * ti.numMips; - - const bool writeOnly = 0 != (_flags&BGFX_TEXTURE_RT_WRITE_ONLY); - const bool computeWrite = 0 != (_flags&BGFX_TEXTURE_COMPUTE_WRITE); - const bool renderTarget = 0 != (_flags&BGFX_TEXTURE_RT_MASK); - const bool srgb = 0 != (_flags&BGFX_TEXTURE_SRGB); - - BX_TRACE("Texture %3d: %s (requested: %s), layers %d, %dx%d%s RT[%c], WO[%c], CW[%c], sRGB[%c]" - , this - s_renderWgpu->m_textures - , getName( (TextureFormat::Enum)m_textureFormat) - , getName( (TextureFormat::Enum)m_requestedFormat) - , ti.numLayers - , ti.width - , ti.height - , imageContainer.m_cubeMap ? "x6" : "" - , renderTarget ? 'x' : ' ' - , writeOnly ? 'x' : ' ' - , computeWrite ? 'x' : ' ' - , srgb ? 'x' : ' ' - ); - - const uint32_t msaaQuality = bx::uint32_satsub( (_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT, 1); - const int32_t sampleCount = s_msaa[msaaQuality]; - - - wgpu::TextureFormat format = wgpu::TextureFormat::Undefined; - if (srgb) - { - format = s_textureFormat[m_textureFormat].m_fmtSrgb; - BX_WARN(format != wgpu::TextureFormat::Undefined - , "sRGB not supported for texture format %d" - , m_textureFormat - ); - } - - if (format == wgpu::TextureFormat::Undefined) - { - // not swizzled and not sRGB, or sRGB unsupported - format = s_textureFormat[m_textureFormat].m_fmt; - } - - desc.format = format; - desc.size.width = m_width; - desc.size.height = m_height; - desc.size.depthOrArrayLayers = m_numSides * bx::uint32_max(1,imageContainer.m_depth); - desc.mipLevelCount = m_numMips; - desc.sampleCount = 1; - - desc.usage = wgpu::TextureUsage::Sampled; - desc.usage |= wgpu::TextureUsage::CopyDst; - desc.usage |= wgpu::TextureUsage::CopySrc; - - if (computeWrite) - { - desc.usage |= wgpu::TextureUsage::Storage; - } - - if (renderTarget) - { - desc.usage |= wgpu::TextureUsage::OutputAttachment; - } - - m_ptr = s_renderWgpu->m_device.CreateTexture(&desc); - - if (sampleCount > 1) - { - desc.sampleCount = sampleCount; - - m_ptrMsaa = s_renderWgpu->m_device.CreateTexture(&desc); - } - - // decode images - struct ImageInfo - { - uint8_t* data; - uint32_t width; - uint32_t height; - uint32_t depth; - uint32_t pitch; - uint32_t slice; - uint32_t size; - uint8_t mipLevel; - uint8_t layer; - }; - - ImageInfo* imageInfos = (ImageInfo*)bx::alloc(g_allocator, sizeof(ImageInfo) * numSrd); - bx::memSet(imageInfos, 0, sizeof(ImageInfo) * numSrd); - uint32_t alignment = 1; // tightly aligned buffer - - uint32_t kk = 0; - - for (uint8_t side = 0; side < numSides; ++side) - { - for (uint8_t lod = 0; lod < ti.numMips; ++lod) - { - bimg::ImageMip mip; - if (bimg::imageGetRawData(imageContainer, side, lod + startLod, _mem->data, _mem->size, mip)) - { - if (convert) - { - const uint32_t pitch = bx::strideAlign(bx::max(mip.m_width, 4) * bpp / 8, alignment); - const uint32_t slice = bx::strideAlign(bx::max(mip.m_height, 4) * pitch, alignment); - const uint32_t size = slice * mip.m_depth; - - uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); - bimg::imageDecodeToBgra8( - g_allocator - , temp - , mip.m_data - , mip.m_width - , mip.m_height - , pitch - , mip.m_format - ); - - imageInfos[kk].data = temp; - imageInfos[kk].width = mip.m_width; - imageInfos[kk].height = mip.m_height; - imageInfos[kk].depth = mip.m_depth; - imageInfos[kk].pitch = pitch; - imageInfos[kk].slice = slice; - imageInfos[kk].size = size; - imageInfos[kk].mipLevel = lod; - imageInfos[kk].layer = side; - } - else if (compressed) - { - const uint32_t pitch = bx::strideAlign((mip.m_width / blockInfo.blockWidth) * mip.m_blockSize, alignment); - const uint32_t slice = bx::strideAlign((mip.m_height / blockInfo.blockHeight) * pitch, alignment); - const uint32_t size = slice * mip.m_depth; - - uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); - bimg::imageCopy( - temp - , mip.m_height / blockInfo.blockHeight - , (mip.m_width / blockInfo.blockWidth) * mip.m_blockSize - , mip.m_depth - , mip.m_data - , pitch - ); - - imageInfos[kk].data = temp; - imageInfos[kk].width = mip.m_width; - imageInfos[kk].height = mip.m_height; - imageInfos[kk].depth = mip.m_depth; - imageInfos[kk].pitch = pitch; - imageInfos[kk].slice = slice; - imageInfos[kk].size = size; - imageInfos[kk].mipLevel = lod; - imageInfos[kk].layer = side; - } - else - { - const uint32_t pitch = bx::strideAlign(mip.m_width * mip.m_bpp / 8, alignment); - const uint32_t slice = bx::strideAlign(mip.m_height * pitch, alignment); - const uint32_t size = slice * mip.m_depth; - - uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); - bimg::imageCopy(temp - , mip.m_height - , mip.m_width * mip.m_bpp / 8 - , mip.m_depth - , mip.m_data - , pitch - ); - - imageInfos[kk].data = temp; - imageInfos[kk].width = mip.m_width; - imageInfos[kk].height = mip.m_height; - imageInfos[kk].depth = mip.m_depth; - imageInfos[kk].pitch = pitch; - imageInfos[kk].slice = slice; - imageInfos[kk].size = size; - imageInfos[kk].mipLevel = lod; - imageInfos[kk].layer = side; - } - } - ++kk; - } - } - - uint32_t totalMemSize = 0; - for (uint32_t ii = 0; ii < numSrd; ++ii) - { - const uint32_t dstpitch = bx::strideAlign(imageInfos[ii].pitch, kMinBufferOffsetAlignment); - totalMemSize += dstpitch * imageInfos[ii].height; - //totalMemSize += imageInfos[ii].size; - } - - wgpu::Buffer stagingBuffer; - if (totalMemSize > 0) - { - wgpu::BufferDescriptor staginBufferDesc; - staginBufferDesc.size = totalMemSize; - staginBufferDesc.usage = wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::CopySrc; - staginBufferDesc.mappedAtCreation = true; - - stagingBuffer = s_renderWgpu->m_device.CreateBuffer(&staginBufferDesc); - void* stagingData = stagingBuffer.GetMappedRange(); - - uint64_t offset = 0; - - for (uint32_t ii = 0; ii < numSrd; ++ii) - { - const uint32_t dstpitch = bx::strideAlign(imageInfos[ii].pitch, kMinBufferOffsetAlignment); - - const uint8_t* src = (uint8_t*)imageInfos[ii].data; - uint8_t* dst = (uint8_t*)stagingData; - - for (uint32_t yy = 0; yy < imageInfos[ii].height; ++yy, src += imageInfos[ii].pitch, offset += dstpitch) - { - bx::memCopy(dst + offset, src, imageInfos[ii].pitch); - } - - //bx::memCopy(dst + offset, imageInfos[ii].data, imageInfos[ii].size); - //offset += imageInfos[ii].size; - } - - stagingBuffer.Unmap(); - } - - wgpu::ImageCopyBuffer* imageCopyBuffer = (wgpu::ImageCopyBuffer*)bx::alloc(g_allocator, sizeof(wgpu::ImageCopyBuffer) * numSrd); - wgpu::ImageCopyTexture* imageCopyTexture = (wgpu::ImageCopyTexture*)bx::alloc(g_allocator, sizeof(wgpu::ImageCopyTexture) * numSrd); - wgpu::Extent3D* textureCopySize = (wgpu::Extent3D*)bx::alloc(g_allocator, sizeof(wgpu::Extent3D) * numSrd); - - uint64_t offset = 0; - - for (uint32_t ii = 0; ii < numSrd; ++ii) - { - const uint32_t dstpitch = bx::strideAlign(imageInfos[ii].pitch, kMinBufferOffsetAlignment); - - uint32_t idealWidth = bx::max(1, m_width >> imageInfos[ii].mipLevel); - uint32_t idealHeight = bx::max(1, m_height >> imageInfos[ii].mipLevel); - BX_PLACEMENT_NEW(&imageCopyBuffer[ii], wgpu::ImageCopyBuffer)(); - BX_PLACEMENT_NEW(&imageCopyTexture[ii], wgpu::ImageCopyTexture)(); - BX_PLACEMENT_NEW(&textureCopySize[ii], wgpu::Extent3D)(); - imageCopyBuffer[ii].buffer = stagingBuffer; - imageCopyBuffer[ii].layout.offset = offset; - imageCopyBuffer[ii].layout.bytesPerRow = dstpitch; // assume that image data are tightly aligned - imageCopyBuffer[ii].layout.rowsPerImage = 0; // assume that image data are tightly aligned - imageCopyTexture[ii].texture = m_ptr; - imageCopyTexture[ii].mipLevel = imageInfos[ii].mipLevel; - imageCopyTexture[ii].origin = { 0, 0, imageInfos[ii].layer }; - textureCopySize[ii] = { idealWidth, idealHeight, imageInfos[ii].depth }; - - offset += dstpitch * imageInfos[ii].height; - //offset += imageInfos[ii].size; - } - - - if (stagingBuffer) - { - wgpu::CommandEncoder encoder = s_renderWgpu->getBlitCommandEncoder(); - //wgpu::CommandEncoder encoder = s_renderWgpu->m_cmd.m_encoder; - for (uint32_t ii = 0; ii < numSrd; ++ii) - { - encoder.CopyBufferToTexture(&imageCopyBuffer[ii], &imageCopyTexture[ii], &textureCopySize[ii]); - } - } - else - { - //VkCommandBuffer commandBuffer = s_renderVK->beginNewCommand(); - //setImageMemoryBarrier( - // commandBuffer - // , (m_flags & BGFX_TEXTURE_COMPUTE_WRITE - // ? VK_IMAGE_LAYOUT_GENERAL - // : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL - // ) - //); - //s_renderVK->submitCommandAndWait(commandBuffer); - } - - //vkFreeMemory(device, stagingDeviceMem, allocatorCb); - //vkDestroy(stagingBuffer); - - bx::free(g_allocator, imageCopyBuffer); - bx::free(g_allocator, imageCopyTexture); - bx::free(g_allocator, textureCopySize); - for (uint32_t ii = 0; ii < numSrd; ++ii) - { - bx::free(g_allocator, imageInfos[ii].data); - } - bx::free(g_allocator, imageInfos); - } - } - - void TextureWgpu::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem) - { - const uint32_t bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(m_textureFormat) ); - const uint32_t rectpitch = _rect.m_width*bpp/8; - const uint32_t srcpitch = UINT16_MAX == _pitch ? rectpitch : _pitch; - const uint16_t zz = (m_type == Texture3D) ? _z : _side; - // TODO (hugoam) This won't work for 3D texture arrays, but do we even support that - - const bool convert = m_textureFormat != m_requestedFormat; - - uint8_t* data = _mem->data; - uint8_t* temp = NULL; - - if (convert) - { - temp = (uint8_t*)bx::alloc(g_allocator, rectpitch*_rect.m_height); - bimg::imageDecodeToBgra8( - g_allocator - , temp - , data - , _rect.m_width - , _rect.m_height - , srcpitch - , bimg::TextureFormat::Enum(m_requestedFormat) - ); - data = temp; - } - - const uint32_t dstpitch = bx::strideAlign(rectpitch, kMinBufferOffsetAlignment); - - wgpu::BufferDescriptor desc; - desc.size = dstpitch * _rect.m_height; - desc.usage = wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::CopySrc; - desc.mappedAtCreation = true; - - wgpu::Buffer staging = s_renderWgpu->m_device.CreateBuffer(&desc); - - const uint8_t* src = (uint8_t*)data; - uint8_t* dst = (uint8_t*)staging.GetMappedRange(); - uint64_t offset = 0; - - for (uint32_t yy = 0; yy < _rect.m_height; ++yy, src += srcpitch, offset += dstpitch) - { - const uint32_t size = bx::strideAlign(rectpitch, 4); - bx::memCopy(dst + offset, src, size); - } - - staging.Unmap(); - - wgpu::ImageCopyBuffer srcView; - srcView.buffer = staging; - srcView.layout.bytesPerRow = dstpitch; - srcView.layout.rowsPerImage = 0; - - wgpu::ImageCopyTexture destView; - destView.texture = m_ptr; - destView.mipLevel = _mip; - destView.origin = { _rect.m_x, _rect.m_y, zz }; - - wgpu::Extent3D destExtent = { _rect.m_width, _rect.m_height, _depth }; - - //region.imageSubresource.aspectMask = m_vkTextureAspect; - - wgpu::CommandEncoder encoder = s_renderWgpu->getBlitCommandEncoder(); - //wgpu::CommandEncoder encoder = s_renderWgpu->m_cmd.m_encoder; - encoder.CopyBufferToTexture(&srcView, &destView, &destExtent); - - //wgpu::CommandBuffer copy = encoder.Finish(); - //wgpu::Queue queue = s_renderWgpu->m_queue; - //queue.Submit(1, ©); - - //staging.Destroy(); - - if (NULL != temp) - { - bx::free(g_allocator, temp); - } - } - - void BindStateWgpu::clear() - { - m_bindGroup = NULL; - } - - void StagingBufferWgpu::create(uint32_t _size, bool mapped) - { - m_size = _size; - - wgpu::BufferDescriptor desc; - desc.size = _size; - desc.usage = wgpu::BufferUsage::MapWrite | wgpu::BufferUsage::CopySrc; - desc.mappedAtCreation = mapped; - - m_buffer = s_renderWgpu->m_device.CreateBuffer(&desc); - - if (mapped) - { - m_data = m_buffer.GetMappedRange(); - } - else - { - map(); - } - } - - void StagingBufferWgpu::map() - { - auto ready = [](WGPUBufferMapAsyncStatus status, void* userdata) - { - StagingBufferWgpu* staging = static_cast(userdata); - BX_WARN(status == WGPUBufferMapAsyncStatus_Success, "Failed mapping staging buffer (size %d) for writing with error %d", staging->m_size, status); - if (status == WGPUBufferMapAsyncStatus_Success) - { - void* data = staging->m_buffer.GetMappedRange(); - staging->mapped(data); - } - }; - - m_buffer.MapAsync(wgpu::MapMode::Write, 0, m_size, ready, this); - } - - void StagingBufferWgpu::unmap() - { - m_data = NULL; - m_buffer.Unmap(); - } - - void StagingBufferWgpu::destroy() - { - m_buffer = NULL; - } - - void StagingBufferWgpu::mapped(void* _data) - { - m_data = _data; - } - - void ScratchBufferWgpu::create(uint32_t _size) - { - m_offset = 0; - m_size = _size; - - wgpu::BufferDescriptor desc; - desc.size = BGFX_CONFIG_MAX_DRAW_CALLS * 128; - desc.usage = wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::Uniform; - - m_buffer = s_renderWgpu->m_device.CreateBuffer(&desc); - } - - void ScratchBufferWgpu::destroy() - { - } - - void ScratchBufferWgpu::begin() - { - for (uint8_t ii = 0; ii < WEBGPU_NUM_UNIFORM_BUFFERS; ++ii) - { - if (NULL != s_renderWgpu->m_uniformBuffers[ii].m_data) - { - m_staging = &s_renderWgpu->m_uniformBuffers[ii]; - break; - } - } - - BX_ASSERT(NULL != m_staging, "No available mapped uniform buffer"); - } - - uint32_t ScratchBufferWgpu::write(void* data, uint64_t _size, uint64_t _offset) - { - BX_ASSERT(nullptr != m_staging, "Cannot write uniforms outside of begin()/submit() calls"); - BX_ASSERT(m_size > m_offset + _offset, "Out-of-bounds scratch buffer write"); - uint32_t offset = m_offset; - bx::memCopy((void*)((uint8_t*)m_staging->m_data + offset), data, _size); - m_offset += _offset; - return offset; - } - - uint32_t ScratchBufferWgpu::write(void* data, uint64_t _size) - { - BX_ASSERT(nullptr != m_staging, "Cannot write uniforms outside of begin()/submit() calls"); - BX_ASSERT(m_size > m_offset + _size, "Out-of-bounds scratch buffer write"); - uint32_t offset = m_offset; - bx::memCopy((void*)((uint8_t*)m_staging->m_data + offset), data, _size); - m_offset += _size; - return offset; - } - - void ScratchBufferWgpu::submit() - { - m_staging->unmap(); - - if (m_offset != 0) - { - wgpu::CommandEncoder& bce = s_renderWgpu->getStagingEncoder(); - bce.CopyBufferToBuffer(m_staging->m_buffer, 0, m_buffer, 0, m_offset); - } - } - - void ScratchBufferWgpu::release() - { - m_staging->map(); - m_staging = NULL; - m_offset = 0; - } - - void BindStateCacheWgpu::create() //(uint32_t _maxBindGroups) - { - //m_maxBindStates = 1024; // _maxBindStates; - m_currentBindState = 0; - } - - void BindStateCacheWgpu::destroy() - { - reset(); - } - - void BindStateCacheWgpu::reset() - { - for (size_t i = 0; i < m_currentBindState; ++i) - { - m_bindStates[i] = {}; - } - - m_currentBindState = 0; - } - - wgpu::TextureView TextureWgpu::getTextureMipLevel(int _mip) - { - if (_mip >= 0 - && _mip < m_numMips - && m_ptr) - { - if (!m_ptrMips[_mip]) - { - wgpu::TextureViewDescriptor desc; - desc.baseMipLevel = _mip; - desc.mipLevelCount = 1; - - desc.format = s_textureFormat[m_textureFormat].m_fmt; - - if (TextureCube == m_type) - { - //desc.dimension = MTLTextureType2DArray; - desc.baseArrayLayer = 0; - desc.arrayLayerCount = m_numLayers * 6; - } - else - { - desc.baseArrayLayer = 0; - desc.arrayLayerCount = m_numLayers; - } - - m_ptrMips[_mip] = m_ptr.CreateView(&desc); - } - - return m_ptrMips[_mip]; - } - - return wgpu::TextureView(); - } - - void SwapChainWgpu::init(wgpu::Device _device, void* _nwh, uint32_t _width, uint32_t _height) - { - BX_UNUSED(_nwh); - - wgpu::SwapChainDescriptor desc; - desc.usage = wgpu::TextureUsage::OutputAttachment; - desc.width = _width; - desc.height = _height; - -#if !BX_PLATFORM_EMSCRIPTEN - m_impl = createSwapChain(_device, _nwh); - - desc.presentMode = wgpu::PresentMode::Immediate; - desc.format = wgpu::TextureFormat::RGBA8Unorm; - desc.implementation = reinterpret_cast(&m_impl); - m_swapChain = _device.CreateSwapChain(nullptr, &desc); -#else - wgpu::SurfaceDescriptorFromCanvasHTMLSelector canvasDesc{}; - canvasDesc.selector = "#canvas"; - - wgpu::SurfaceDescriptor surfDesc{}; - surfDesc.nextInChain = &canvasDesc; - wgpu::Surface surface = wgpu::Instance().CreateSurface(&surfDesc); - - desc.presentMode = wgpu::PresentMode::Fifo; - desc.format = wgpu::TextureFormat::BGRA8Unorm; - m_swapChain = _device.CreateSwapChain(surface, &desc); -#endif - - m_colorFormat = desc.format; - m_depthFormat = wgpu::TextureFormat::Depth24PlusStencil8; - } - - void SwapChainWgpu::resize(FrameBufferWgpu& _frameBuffer, uint32_t _width, uint32_t _height, uint32_t _flags) - { - BX_TRACE("SwapChainWgpu::resize"); - - const int32_t sampleCount = s_msaa[(_flags&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT]; - - wgpu::TextureFormat format = (_flags & BGFX_RESET_SRGB_BACKBUFFER) -#ifdef DAWN_ENABLE_BACKEND_VULKAN - ? wgpu::TextureFormat::BGRA8UnormSrgb - : wgpu::TextureFormat::BGRA8Unorm -#else - ? wgpu::TextureFormat::RGBA8UnormSrgb - : wgpu::TextureFormat::RGBA8Unorm -#endif - ; - -#if !BX_PLATFORM_EMSCRIPTEN - m_swapChain.Configure(format, wgpu::TextureUsage::OutputAttachment, _width, _height); -#endif - - m_colorFormat = format; - m_depthFormat = wgpu::TextureFormat::Depth24PlusStencil8; - - bx::HashMurmur2A murmur; - murmur.begin(); - murmur.add(1); - murmur.add((uint32_t)m_colorFormat); - murmur.add((uint32_t)m_depthFormat); - murmur.add((uint32_t)sampleCount); - _frameBuffer.m_pixelFormatHash = murmur.end(); - - wgpu::TextureDescriptor desc; - - desc.dimension = wgpu::TextureDimension::e2D; - - desc.size.width = _width; - desc.size.height = _height; - desc.size.depthOrArrayLayers = 1; - desc.mipLevelCount = 1; - desc.sampleCount = sampleCount; - desc.usage = wgpu::TextureUsage::OutputAttachment; - - if (m_backBufferDepth) - { - m_backBufferDepth.Destroy(); - } - - desc.format = wgpu::TextureFormat::Depth24PlusStencil8; - - m_backBufferDepth = s_renderWgpu->m_device.CreateTexture(&desc); - - if (sampleCount > 1) - { - if (m_backBufferColorMsaa) - { - m_backBufferColorMsaa.Destroy(); - } - - desc.format = m_colorFormat; - desc.sampleCount = sampleCount; - - m_backBufferColorMsaa = s_renderWgpu->m_device.CreateTexture(&desc); - } - } - - void SwapChainWgpu::flip() - { - m_drawable = m_swapChain.GetCurrentTextureView(); - } - - wgpu::TextureView SwapChainWgpu::current() - { - if (!m_drawable) - m_drawable = m_swapChain.GetCurrentTextureView(); - return m_drawable; - } - - void FrameBufferWgpu::create(uint8_t _num, const Attachment* _attachment) - { - m_swapChain = NULL; - m_denseIdx = UINT16_MAX; - m_num = 0; - m_width = 0; - m_height = 0; - - for (uint32_t ii = 0; ii < _num; ++ii) - { - const Attachment& at = _attachment[ii]; - TextureHandle handle = at.handle; - - if (isValid(handle) ) - { - const TextureWgpu& texture = s_renderWgpu->m_textures[handle.idx]; - - if (0 == m_width) - { - m_width = texture.m_width; - m_height = texture.m_height; - } - - if (bimg::isDepth(bimg::TextureFormat::Enum(texture.m_textureFormat) ) ) - { - m_depthHandle = handle; - m_depthAttachment = at; - } - else - { - m_colorHandle[m_num] = handle; - m_colorAttachment[m_num] = at; - m_num++; - } - } - } - - bx::HashMurmur2A murmur; - murmur.begin(); - murmur.add(m_num); - - for (uint32_t ii = 0; ii < m_num; ++ii) - { - const TextureWgpu& texture = s_renderWgpu->m_textures[m_colorHandle[ii].idx]; - murmur.add(uint32_t(s_textureFormat[texture.m_textureFormat].m_fmt) ); - } - - if (!isValid(m_depthHandle) ) - { - murmur.add(uint32_t(wgpu::TextureFormat::Undefined) ); - } - else - { - const TextureWgpu& depthTexture = s_renderWgpu->m_textures[m_depthHandle.idx]; - murmur.add(uint32_t(s_textureFormat[depthTexture.m_textureFormat].m_fmt) ); - } - - murmur.add(1); // SampleCount - - m_pixelFormatHash = murmur.end(); - } - - bool FrameBufferWgpu::create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _format, TextureFormat::Enum _depthFormat) - { - BX_UNUSED(_format, _depthFormat); - m_swapChain = BX_NEW(g_allocator, SwapChainWgpu); - m_num = 0; - m_width = _width; - m_height = _height; - m_nwh = _nwh; - m_denseIdx = _denseIdx; - - m_swapChain->init(s_renderWgpu->m_device, _nwh, _width, _height); - m_swapChain->resize(*this, _width, _height, 0); - - return m_swapChain->m_swapChain != NULL; - } - - void FrameBufferWgpu::postReset() - { - } - - uint16_t FrameBufferWgpu::destroy() - { - if (NULL != m_swapChain) - { - bx::deleteObject(g_allocator, m_swapChain); - m_swapChain = NULL; - } - - m_num = 0; - m_nwh = NULL; - m_depthHandle.idx = kInvalidHandle; - - uint16_t denseIdx = m_denseIdx; - m_denseIdx = UINT16_MAX; - - return denseIdx; - } - - void CommandQueueWgpu::init(wgpu::Queue _queue) - { - m_queue = _queue; -#if BGFX_CONFIG_MULTITHREADED - //m_framesSemaphore.post(BGFX_CONFIG_MAX_FRAME_LATENCY); -#endif - } - - void CommandQueueWgpu::shutdown() - { - finish(true); - } - - void CommandQueueWgpu::beginRender() - { - m_renderEncoder = s_renderWgpu->m_device.CreateCommandEncoder(); - } - - void CommandQueueWgpu::beginStaging() - { - m_stagingEncoder = s_renderWgpu->m_device.CreateCommandEncoder(); - } - - inline void commandBufferFinishedCallback(void* _data) - { -#if BGFX_CONFIG_MULTITHREADED - CommandQueueWgpu* queue = (CommandQueueWgpu*)_data; - if (queue) - { - //queue->m_framesSemaphore.post(); - } -#else - BX_UNUSED(_data); -#endif - } - - void CommandQueueWgpu::kick(bool _endFrame, bool _waitForFinish) - { - if (m_renderEncoder) - { - if (_endFrame) - { - m_releaseWriteIndex = (m_releaseWriteIndex + 1) % BGFX_CONFIG_MAX_FRAME_LATENCY; - //m_encoder.addCompletedHandler(commandBufferFinishedCallback, this); - } - - if (m_stagingEncoder) - { - wgpu::CommandBuffer commands = m_stagingEncoder.Finish(); - m_queue.Submit(1, &commands); - } - - wgpu::CommandBuffer commands = m_renderEncoder.Finish(); - m_queue.Submit(1, &commands); - - if (_waitForFinish) - { -#if BGFX_CONFIG_MULTITHREADED - //m_framesSemaphore.post(); -#endif - } - - m_stagingEncoder = NULL; - m_renderEncoder = NULL; - } - } - - void CommandQueueWgpu::finish(bool _finishAll) - { - if (_finishAll) - { - uint32_t count = m_renderEncoder - ? 2 - : 3 - ; - - for (uint32_t ii = 0; ii < count; ++ii) - { - consume(); - } - -#if BGFX_CONFIG_MULTITHREADED - //m_framesSemaphore.post(count); -#endif - } - else - { - consume(); - } - } - - void CommandQueueWgpu::release(wgpu::Buffer _buffer) - { - m_release[m_releaseWriteIndex].push_back(_buffer); - } - - void CommandQueueWgpu::consume() - { -#if BGFX_CONFIG_MULTITHREADED - //m_framesSemaphore.wait(); -#endif - - m_releaseReadIndex = (m_releaseReadIndex + 1) % BGFX_CONFIG_MAX_FRAME_LATENCY; - - for (wgpu::Buffer& buffer : m_release[m_releaseReadIndex]) - { - buffer.Destroy(); - } - - m_release[m_releaseReadIndex].clear(); - } - - void TimerQueryWgpu::init() - { - m_frequency = bx::getHPFrequency(); - } - - void TimerQueryWgpu::shutdown() - { - } - - uint32_t TimerQueryWgpu::begin(uint32_t _resultIdx, uint32_t _frameNum) - { - BX_UNUSED(_resultIdx); - BX_UNUSED(_frameNum); - return 0; - } - - void TimerQueryWgpu::end(uint32_t _idx) - { - BX_UNUSED(_idx); - } - -#if 0 - static void setTimestamp(void* _data) - { - *( (int64_t*)_data) = bx::getHPCounter(); - } -#endif - - void TimerQueryWgpu::addHandlers(wgpu::CommandBuffer& _commandBuffer) - { - BX_UNUSED(_commandBuffer); - - while (0 == m_control.reserve(1) ) - { - m_control.consume(1); - } - - //uint32_t offset = m_control.m_current; - //_commandBuffer.addScheduledHandler(setTimestamp, &m_result[offset].m_begin); - //_commandBuffer.addCompletedHandler(setTimestamp, &m_result[offset].m_end); - m_control.commit(1); - } - - bool TimerQueryWgpu::get() - { - if (0 != m_control.available() ) - { - uint32_t offset = m_control.m_read; - m_begin = m_result[offset].m_begin; - m_end = m_result[offset].m_end; - m_elapsed = m_end - m_begin; - - m_control.consume(1); - - return true; - } - - return false; - } - - void RendererContextWgpu::submitBlit(BlitState& _bs, uint16_t _view) - { - if (!_bs.hasItem(_view) ) - { - return; - } - - endEncoding(); - - wgpu::CommandEncoder& bce = getBlitCommandEncoder(); - - while (_bs.hasItem(_view) ) - { - const BlitItem& blit = _bs.advance(); - - const TextureWgpu& src = m_textures[blit.m_src.idx]; - const TextureWgpu& dst = m_textures[blit.m_dst.idx]; - - bool readBack = !!(dst.m_flags & BGFX_TEXTURE_READ_BACK); - - wgpu::ImageCopyTexture srcView; - srcView.texture = src.m_ptr; - srcView.origin = { blit.m_srcX, blit.m_srcY, blit.m_srcZ }; - srcView.mipLevel = blit.m_srcMip; - - wgpu::ImageCopyTexture dstView; - dstView.texture = dst.m_ptr; - dstView.origin = { blit.m_dstX, blit.m_dstY, blit.m_dstZ }; - dstView.mipLevel = blit.m_dstMip; - - if (blit.m_depth == 0) - { - wgpu::Extent3D copyExtent = { blit.m_width, blit.m_height, 1 }; - bce.CopyTextureToTexture(&srcView, &dstView, ©Extent); - } - else - { - wgpu::Extent3D copyExtent = { blit.m_width, blit.m_height, blit.m_depth }; - bce.CopyTextureToTexture(&srcView, &dstView, ©Extent); - } - - if (readBack) - { - //bce..synchronizeTexture(dst.m_ptr, 0, blit.m_dstMip); - } - } - - //if (bce) - //{ - // bce.endEncoding(); - // bce = 0; - //} - } - - void RendererContextWgpu::submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) - { - if(_render->m_capture) - { - renderDocTriggerCapture(); - } - - m_cmd.finish(false); - - if (!m_cmd.m_renderEncoder) - { - m_cmd.beginRender(); - } - - BGFX_WEBGPU_PROFILER_BEGIN_LITERAL("rendererSubmit", kColorFrame); - - int64_t timeBegin = bx::getHPCounter(); - int64_t captureElapsed = 0; - - //m_gpuTimer.addHandlers(m_encoder); - - updateResolution(_render->m_resolution); - - m_frameIndex = 0; // (m_frameIndex + 1) % BGFX_CONFIG_MAX_FRAME_LATENCY; - - ScratchBufferWgpu& scratchBuffer = m_scratchBuffers[m_frameIndex]; - scratchBuffer.begin(); - - BindStateCacheWgpu& bindStates = m_bindStateCache[m_frameIndex]; - bindStates.reset(); - - if (0 < _render->m_iboffset) - { - BGFX_PROFILER_SCOPE("bgfx/Update transient index buffer", kColorResource); - TransientIndexBuffer* ib = _render->m_transientIb; - m_indexBuffers[ib->handle.idx].update(0, bx::strideAlign(_render->m_iboffset,4), ib->data, true); - } - - if (0 < _render->m_vboffset) - { - BGFX_PROFILER_SCOPE("bgfx/Update transient vertex buffer", kColorResource); - TransientVertexBuffer* vb = _render->m_transientVb; - m_vertexBuffers[vb->handle.idx].update(0, bx::strideAlign(_render->m_vboffset,4), vb->data, true); - } - - _render->sort(); - - RenderDraw currentState; - currentState.clear(); - currentState.m_stateFlags = BGFX_STATE_NONE; - currentState.m_stencil = packStencil(BGFX_STENCIL_NONE, BGFX_STENCIL_NONE); - - RenderBind currentBind; - currentBind.clear(); - - static ViewState viewState; - viewState.reset(_render); - uint32_t blendFactor = 0; - - //bool wireframe = !!(_render->m_debug&BGFX_DEBUG_WIREFRAME); - - ProgramHandle currentProgram = BGFX_INVALID_HANDLE; - uint32_t currentBindHash = 0; - uint32_t currentBindLayoutHash = 0; - BindStateWgpu* previousBindState = NULL; - SortKey key; - uint16_t view = UINT16_MAX; - FrameBufferHandle fbh = { BGFX_CONFIG_MAX_FRAME_BUFFERS }; - - BlitState bs(_render); - - const uint64_t primType = 0; - uint8_t primIndex = uint8_t(primType >> BGFX_STATE_PT_SHIFT); - PrimInfo prim = s_primInfo[primIndex]; - const uint32_t maxComputeBindings = g_caps.limits.maxComputeBindings; - - // TODO store this - static wgpu::RenderPassEncoder rce; - - PipelineStateWgpu* currentPso = NULL; - - bool wasCompute = false; - bool viewHasScissor = false; - Rect viewScissorRect; - viewScissorRect.clear(); - - uint32_t statsNumPrimsSubmitted[BX_COUNTOF(s_primInfo)] = {}; - uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; - uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; - uint32_t statsNumDrawIndirect[BX_COUNTOF(s_primInfo)] = {}; - uint32_t statsNumIndices = 0; - uint32_t statsKeyType[2] = {}; - - Profiler profiler( - _render - , m_gpuTimer - , s_viewName - ); - - if (0 == (_render->m_debug & BGFX_DEBUG_IFH)) - { - viewState.m_rect = _render->m_view[0].m_rect; - int32_t numItems = _render->m_numRenderItems; - - for (int32_t item = 0; item < numItems;) - { - const uint64_t encodedKey = _render->m_sortKeys[item]; - const bool isCompute = key.decode(encodedKey, _render->m_viewRemap); - statsKeyType[isCompute]++; - - const bool viewChanged = 0 - || key.m_view != view - || item == numItems - ; - - const uint32_t itemIdx = _render->m_sortValues[item]; - const RenderItem& renderItem = _render->m_renderItem[itemIdx]; - const RenderBind& renderBind = _render->m_renderItemBind[itemIdx]; - ++item; - - if (viewChanged - || (!isCompute && wasCompute)) - { - view = key.m_view; - currentProgram = BGFX_INVALID_HANDLE; - - if (item > 1) - { - profiler.end(); - } - - BGFX_WEBGPU_PROFILER_END(); - setViewType(view, " "); - BGFX_WEBGPU_PROFILER_BEGIN(view, kColorView); - - profiler.begin(view); - - viewState.m_rect = _render->m_view[view].m_rect; - - submitBlit(bs, view); - - if (!isCompute) - { - const Rect& scissorRect = _render->m_view[view].m_scissor; - viewHasScissor = !scissorRect.isZero(); - viewScissorRect = viewHasScissor ? scissorRect : viewState.m_rect; - Clear& clr = _render->m_view[view].m_clear; - - Rect viewRect = viewState.m_rect; - bool clearWithRenderPass = false; - - if (!m_renderEncoder - || fbh.idx != _render->m_view[view].m_fbh.idx) - { - endEncoding(); - - fbh = _render->m_view[view].m_fbh; - - uint32_t width = m_resolution.width; - uint32_t height = m_resolution.height; - - if (isValid(fbh)) - { - FrameBufferWgpu& frameBuffer = m_frameBuffers[fbh.idx]; - width = frameBuffer.m_width; - height = frameBuffer.m_height; - } - - clearWithRenderPass = true - && 0 == viewRect.m_x - && 0 == viewRect.m_y - && width == viewRect.m_width - && height == viewRect.m_height - ; - - rce = renderPass(_render, fbh, clearWithRenderPass, clr, s_viewName[view]); - } - else if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION)) - { - rce.PopDebugGroup(); - } - - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION)) - { - rce.PushDebugGroup(s_viewName[view]); - } - - //rce.setTriangleFillMode(wireframe ? MTLTriangleFillModeLines : MTLTriangleFillModeFill); - - const Rect& rect = viewState.m_rect; - rce.SetViewport(rect.m_x, rect.m_y, rect.m_width, rect.m_height, 0.0f, 1.0f); - rce.SetScissorRect(rect.m_x, rect.m_y, rect.m_width, rect.m_height); - - - if (BGFX_CLEAR_NONE != (clr.m_flags & BGFX_CLEAR_MASK) - && !clearWithRenderPass) - { - clearQuad(_clearQuad, viewState.m_rect, clr, _render->m_colorPalette); - } - } - } - - if (isCompute) - { - if (!wasCompute) - { - wasCompute = true; - - endEncoding(); - rce = NULL; - - setViewType(view, "C"); - BGFX_WEBGPU_PROFILER_END(); - BGFX_WEBGPU_PROFILER_BEGIN(view, kColorCompute); - - m_computeEncoder = m_cmd.m_renderEncoder.BeginComputePass(); - } - else if (viewChanged) - { - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION)) - { - m_computeEncoder.PopDebugGroup(); - } - - endEncoding(); - m_computeEncoder = m_cmd.m_renderEncoder.BeginComputePass(); - } - - if (viewChanged) - { - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION)) - { - s_viewName[view][3] = L'C'; - m_computeEncoder.PushDebugGroup(s_viewName[view]); - s_viewName[view][3] = L' '; - } - } - - const RenderCompute& compute = renderItem.compute; - - bool programChanged = false; - bool constantsChanged = compute.m_uniformBegin < compute.m_uniformEnd; - rendererUpdateUniforms(this, _render->m_uniformBuffer[compute.m_uniformIdx], compute.m_uniformBegin, compute.m_uniformEnd); - - if (key.m_program.idx != currentProgram.idx) - { - currentProgram = key.m_program; - - currentPso = getComputePipelineState(currentProgram); - - if (NULL == currentPso) - { - currentProgram = BGFX_INVALID_HANDLE; - continue; - } - - m_computeEncoder.SetPipeline(currentPso->m_cps); - programChanged = - constantsChanged = true; - } - - if (!isValid(currentProgram) - || NULL == currentPso) - BX_WARN(false, "Invalid program / No PSO"); - - const ProgramWgpu& program = m_program[currentProgram.idx]; - - if (constantsChanged) - { - UniformBuffer* vcb = program.m_vsh->m_constantBuffer; - if (NULL != vcb) - { - commit(*vcb); - } - } - - viewState.setPredefined<4>(this, view, program, _render, compute); - - uint32_t numOffset = 0; - uint32_t offsets[2] = { 0, 0 }; - if (program.m_vsh->m_size > 0) - { - offsets[numOffset++] = scratchBuffer.write(m_vsScratch, program.m_vsh->m_gpuSize); - } - - BindStateWgpu& bindState = allocAndFillBindState(program, bindStates, scratchBuffer, renderBind); - - bindProgram(m_computeEncoder, program, bindState, numOffset, offsets); - - if (isValid(compute.m_indirectBuffer)) - { - const VertexBufferWgpu& vb = m_vertexBuffers[compute.m_indirectBuffer.idx]; - - uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect - ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE - : compute.m_numIndirect - ; - - uint32_t args = compute.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE; - for (uint32_t ii = 0; ii < numDrawIndirect; ++ii) - { - m_computeEncoder.DispatchIndirect( - vb.m_ptr - , args - ); - args += BGFX_CONFIG_DRAW_INDIRECT_STRIDE; - } - } - else - { - m_computeEncoder.Dispatch(compute.m_numX, compute.m_numY, compute.m_numZ); - } - - continue; - } - - - bool resetState = viewChanged || wasCompute; - - if (wasCompute) - { - wasCompute = false; - currentProgram = BGFX_INVALID_HANDLE; - - setViewType(view, " "); - BGFX_WEBGPU_PROFILER_END(); - BGFX_WEBGPU_PROFILER_BEGIN(view, kColorDraw); - } - - const RenderDraw& draw = renderItem.draw; - - // TODO (hugoam) - //const bool depthWrite = !!(BGFX_STATE_WRITE_Z & draw.m_stateFlags); - const uint64_t newFlags = draw.m_stateFlags; - uint64_t changedFlags = currentState.m_stateFlags ^ draw.m_stateFlags; - currentState.m_stateFlags = newFlags; - - const uint64_t newStencil = draw.m_stencil; - uint64_t changedStencil = (currentState.m_stencil ^ draw.m_stencil) & BGFX_STENCIL_FUNC_REF_MASK; - currentState.m_stencil = newStencil; - - if (resetState) - { - wasCompute = false; - - currentState.clear(); - currentState.m_scissor = !draw.m_scissor; - changedFlags = BGFX_STATE_MASK; - changedStencil = packStencil(BGFX_STENCIL_MASK, BGFX_STENCIL_MASK); - currentState.m_stateFlags = newFlags; - currentState.m_stencil = newStencil; - - currentBind.clear(); - - currentProgram = BGFX_INVALID_HANDLE; - const uint64_t pt = newFlags & BGFX_STATE_PT_MASK; - primIndex = uint8_t(pt >> BGFX_STATE_PT_SHIFT); - } - - if (prim.m_type != s_primInfo[primIndex].m_type) - { - prim = s_primInfo[primIndex]; - } - - uint16_t scissor = draw.m_scissor; - if (currentState.m_scissor != scissor) - { - currentState.m_scissor = scissor; - - if (UINT16_MAX == scissor) - { - if (viewHasScissor) - { - const auto& r = viewScissorRect; - rce.SetScissorRect(r.m_x, r.m_y, r.m_width, r.m_height); - } - else - { // can't disable: set to view rect - const auto& r = viewState.m_rect; - rce.SetScissorRect(r.m_x, r.m_y, r.m_width, r.m_height); - } - } - else - { - Rect scissorRect; - scissorRect.setIntersect(viewScissorRect, _render->m_frameCache.m_rectCache.m_cache[scissor]); - - const auto& r = scissorRect; - if (r.m_width == 0 || r.m_height == 0) - { - continue; - } - rce.SetScissorRect(r.m_x, r.m_y, r.m_width, r.m_height); - } - - } - - if (0 != changedStencil) - { - const uint32_t fstencil = unpackStencil(0, draw.m_stencil); - const uint32_t ref = (fstencil & BGFX_STENCIL_FUNC_REF_MASK) >> BGFX_STENCIL_FUNC_REF_SHIFT; - rce.SetStencilReference(ref); - } - - if ((0 | BGFX_STATE_PT_MASK) & changedFlags) - { - const uint64_t pt = newFlags & BGFX_STATE_PT_MASK; - primIndex = uint8_t(pt >> BGFX_STATE_PT_SHIFT); - if (prim.m_type != s_primInfo[primIndex].m_type) - { - prim = s_primInfo[primIndex]; - } - } - - if (blendFactor != draw.m_rgba - && !(newFlags & BGFX_STATE_BLEND_INDEPENDENT)) - { - const uint32_t rgba = draw.m_rgba; - float rr = ((rgba >> 24)) / 255.0f; - float gg = ((rgba >> 16) & 0xff) / 255.0f; - float bb = ((rgba >> 8) & 0xff) / 255.0f; - float aa = ((rgba) & 0xff) / 255.0f; - wgpu::Color color = { rr, gg, bb, aa }; - rce.SetBlendColor(&color); - - blendFactor = draw.m_rgba; - } - - bool programChanged = false; - bool constantsChanged = draw.m_uniformBegin < draw.m_uniformEnd; - rendererUpdateUniforms(this, _render->m_uniformBuffer[draw.m_uniformIdx], draw.m_uniformBegin, draw.m_uniformEnd); - - bool vertexStreamChanged = hasVertexStreamChanged(currentState, draw); - - if (key.m_program.idx != currentProgram.idx - || vertexStreamChanged - || (0 - | BGFX_STATE_BLEND_MASK - | BGFX_STATE_BLEND_EQUATION_MASK - | BGFX_STATE_WRITE_RGB - | BGFX_STATE_WRITE_A - | BGFX_STATE_BLEND_INDEPENDENT - | BGFX_STATE_MSAA - | BGFX_STATE_BLEND_ALPHA_TO_COVERAGE - ) & changedFlags - || ((blendFactor != draw.m_rgba) && !!(newFlags & BGFX_STATE_BLEND_INDEPENDENT))) - { - currentProgram = key.m_program; - - currentState.m_streamMask = draw.m_streamMask; - currentState.m_instanceDataBuffer.idx = draw.m_instanceDataBuffer.idx; - currentState.m_instanceDataOffset = draw.m_instanceDataOffset; - currentState.m_instanceDataStride = draw.m_instanceDataStride; - - const VertexLayout* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS]; - - uint32_t numVertices = draw.m_numVertices; - uint8_t numStreams = 0; - for (uint32_t idx = 0, streamMask = draw.m_streamMask - ; 0 != streamMask - ; streamMask >>= 1, idx += 1, ++numStreams - ) - { - const uint32_t ntz = bx::uint32_cnttz(streamMask); - streamMask >>= ntz; - idx += ntz; - - currentState.m_stream[idx].m_layoutHandle = draw.m_stream[idx].m_layoutHandle; - currentState.m_stream[idx].m_handle = draw.m_stream[idx].m_handle; - currentState.m_stream[idx].m_startVertex = draw.m_stream[idx].m_startVertex; - - const uint16_t handle = draw.m_stream[idx].m_handle.idx; - const VertexBufferWgpu& vb = m_vertexBuffers[handle]; - const uint16_t decl = isValid(draw.m_stream[idx].m_layoutHandle) - ? draw.m_stream[idx].m_layoutHandle.idx - : vb.m_layoutHandle.idx; - const VertexLayout& vertexDecl = m_vertexDecls[decl]; - const uint32_t stride = vertexDecl.m_stride; - - decls[numStreams] = &vertexDecl; - - numVertices = bx::uint32_min(UINT32_MAX == draw.m_numVertices - ? vb.m_size / stride - : draw.m_numVertices - , numVertices - ); - const uint32_t offset = draw.m_stream[idx].m_startVertex * stride; - - rce.SetVertexBuffer(idx, vb.m_ptr, offset); - } - - if (!isValid(currentProgram)) - { - continue; - } - else - { - currentPso = NULL; - - if (0 < numStreams) - { - currentPso = getPipelineState( - newFlags - , newStencil - , draw.m_rgba - , fbh - , numStreams - , decls - , draw.isIndex16() - , currentProgram - , uint8_t(draw.m_instanceDataStride / 16) - ); - } - - if (NULL == currentPso) - { - currentProgram = BGFX_INVALID_HANDLE; - continue; - } - - rce.SetPipeline(currentPso->m_rps); - } - - if (isValid(draw.m_instanceDataBuffer)) - { - const VertexBufferWgpu& inst = m_vertexBuffers[draw.m_instanceDataBuffer.idx]; - rce.SetVertexBuffer(numStreams/*+1*/, inst.m_ptr, draw.m_instanceDataOffset); - } - - programChanged = - constantsChanged = true; - } - - if (isValid(currentProgram)) - { - const ProgramWgpu& program = m_program[currentProgram.idx]; - - if (constantsChanged) - { - UniformBuffer* vcb = program.m_vsh->m_constantBuffer; - if (NULL != vcb) - { - commit(*vcb); - } - } - - if (constantsChanged) - { - UniformBuffer* fcb = program.m_fsh->m_constantBuffer; - if (NULL != fcb) - { - commit(*fcb); - } - } - - viewState.setPredefined<4>(this, view, program, _render, draw); - - bool hasPredefined = 0 < program.m_numPredefined; - - uint32_t numOffset = 0; - uint32_t offsets[2] = { 0, 0 }; - if (constantsChanged - || hasPredefined) - { - //viewState.setPredefined<4>(this, view, program, _render, draw, programChanged || viewChanged); - - const uint32_t vsize = program.m_vsh->m_gpuSize; - const uint32_t fsize = (NULL != program.m_fsh ? program.m_fsh->m_gpuSize : 0); - - if (program.m_vsh->m_size > 0) - { - offsets[numOffset++] = scratchBuffer.write(m_vsScratch, vsize); - } - if (fsize > 0) - { - offsets[numOffset++] = scratchBuffer.write(m_fsScratch, fsize); - } - } - - uint32_t bindHash = bx::hash(renderBind.m_bind, sizeof(renderBind.m_bind)); - if (currentBindHash != bindHash - || currentBindLayoutHash != program.m_bindGroupLayoutHash) - { - currentBindHash = bindHash; - currentBindLayoutHash = program.m_bindGroupLayoutHash; - previousBindState = &bindStates.m_bindStates[bindStates.m_currentBindState]; - - allocAndFillBindState(program, bindStates, scratchBuffer, renderBind); - } - - BindStateWgpu& bindState = bindStates.m_bindStates[bindStates.m_currentBindState-1]; - - bindProgram(rce, program, bindState, numOffset, offsets); - } - - if (0 != currentState.m_streamMask) - { - uint32_t numVertices = draw.m_numVertices; - if (UINT32_MAX == numVertices) - { - const VertexBufferWgpu& vb = m_vertexBuffers[currentState.m_stream[0].m_handle.idx]; - uint16_t decl = !isValid(vb.m_layoutHandle) ? draw.m_stream[0].m_layoutHandle.idx : vb.m_layoutHandle.idx; - const VertexLayout& vertexDecl = m_vertexDecls[decl]; - numVertices = vb.m_size/vertexDecl.m_stride; - } - - uint32_t numIndices = 0; - uint32_t numPrimsSubmitted = 0; - uint32_t numInstances = 0; - uint32_t numPrimsRendered = 0; - uint32_t numDrawIndirect = 0; - - if (isValid(draw.m_indirectBuffer) ) - { - const VertexBufferWgpu& vb = m_vertexBuffers[draw.m_indirectBuffer.idx]; - - if (isValid(draw.m_indexBuffer) ) - { - const IndexBufferWgpu& ib = m_indexBuffers[draw.m_indexBuffer.idx]; - - numDrawIndirect = UINT16_MAX == draw.m_numIndirect - ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE - : draw.m_numIndirect - ; - - for (uint32_t ii = 0; ii < numDrawIndirect; ++ii) - { - rce.SetIndexBuffer(ib.m_ptr, ib.m_format, 0); - rce.DrawIndexedIndirect(vb.m_ptr, (draw.m_startIndirect + ii)* BGFX_CONFIG_DRAW_INDIRECT_STRIDE); - } - } - else - { - numDrawIndirect = UINT16_MAX == draw.m_numIndirect - ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE - : draw.m_numIndirect - ; - for (uint32_t ii = 0; ii < numDrawIndirect; ++ii) - { - rce.DrawIndirect(vb.m_ptr, (draw.m_startIndirect + ii)* BGFX_CONFIG_DRAW_INDIRECT_STRIDE); - } - } - } - else - { - if (isValid(draw.m_indexBuffer) ) - { - const IndexBufferWgpu& ib = m_indexBuffers[draw.m_indexBuffer.idx]; - const uint32_t indexSize = draw.isIndex16() ? 2 : 4; - - if (UINT32_MAX == draw.m_numIndices) - { - numIndices = ib.m_size/indexSize; - numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub; - numInstances = draw.m_numInstances; - numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; - - rce.SetIndexBuffer(ib.m_ptr, ib.m_format, 0); - rce.DrawIndexed(numIndices, draw.m_numInstances, 0, 0, 0); - } - else if (prim.m_min <= draw.m_numIndices) - { - numIndices = draw.m_numIndices; - numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub; - numInstances = draw.m_numInstances; - numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; - - rce.SetIndexBuffer(ib.m_ptr, ib.m_format, 0); - rce.DrawIndexed(numIndices, numInstances, draw.m_startIndex, 0, 0); - } - } - else - { - numPrimsSubmitted = numVertices/prim.m_div - prim.m_sub; - numInstances = draw.m_numInstances; - numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; - - rce.Draw(numVertices, draw.m_numInstances, 0, 0); - } - } - - statsNumPrimsSubmitted[primIndex] += numPrimsSubmitted; - statsNumPrimsRendered[primIndex] += numPrimsRendered; - statsNumInstances[primIndex] += numInstances; - statsNumDrawIndirect[primIndex] += numDrawIndirect; - statsNumIndices += numIndices; - } - } - - if (wasCompute) - { - invalidateCompute(); - - setViewType(view, "C"); - BGFX_WEBGPU_PROFILER_END(); - BGFX_WEBGPU_PROFILER_BEGIN(view, kColorCompute); - } - - submitBlit(bs, BGFX_CONFIG_MAX_VIEWS); - - if (0 < _render->m_numRenderItems) - { - captureElapsed = -bx::getHPCounter(); - capture(); - rce = m_renderEncoder; - captureElapsed += bx::getHPCounter(); - - profiler.end(); - } - } - - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION) ) - { - if (0 < _render->m_numRenderItems) - { - rce.PopDebugGroup(); - } - } - - BGFX_WEBGPU_PROFILER_END(); - - int64_t timeEnd = bx::getHPCounter(); - int64_t frameTime = timeEnd - timeBegin; - - static int64_t min = frameTime; - static int64_t max = frameTime; - min = bx::min(min, frameTime); - max = bx::max(max, frameTime); - - static uint32_t maxGpuLatency = 0; - static double maxGpuElapsed = 0.0f; - double elapsedGpuMs = 0.0; - - do - { - double toGpuMs = 1000.0 / double(m_gpuTimer.m_frequency); - elapsedGpuMs = m_gpuTimer.m_elapsed * toGpuMs; - maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed; - } - while (m_gpuTimer.get() ); - - maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1); - - const int64_t timerFreq = bx::getHPFrequency(); - - Stats& perfStats = _render->m_perfStats; - perfStats.cpuTimeBegin = timeBegin; - perfStats.cpuTimeEnd = timeEnd; - perfStats.cpuTimerFreq = timerFreq; - perfStats.gpuTimeBegin = m_gpuTimer.m_begin; - perfStats.gpuTimeEnd = m_gpuTimer.m_end; - perfStats.gpuTimerFreq = m_gpuTimer.m_frequency; - perfStats.numDraw = statsKeyType[0]; - perfStats.numCompute = statsKeyType[1]; - perfStats.numBlit = _render->m_numBlitItems; - perfStats.maxGpuLatency = maxGpuLatency; - perfStats.gpuFrameNum = result.m_frameNum; - bx::memCopy(perfStats.numPrims, statsNumPrimsRendered, sizeof(perfStats.numPrims) ); - perfStats.gpuMemoryMax = -INT64_MAX; - perfStats.gpuMemoryUsed = -INT64_MAX; - - //rce.setTriangleFillMode(MTLTriangleFillModeFill); - if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) ) - { - rce = renderPass(_render, BGFX_INVALID_HANDLE, false, Clear()); - - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION)) - { - rce.PushDebugGroup("debugstats"); - } - - TextVideoMem& tvm = m_textVideoMem; - - static int64_t next = timeEnd; - - if (timeEnd >= next) - { - next = timeEnd + timerFreq; - - double freq = double(timerFreq); - double toMs = 1000.0/freq; - - tvm.clear(); - uint16_t pos = 0; - tvm.printf(0, pos++, BGFX_CONFIG_DEBUG ? 0x8c : 0x8f - , " %s / " BX_COMPILER_NAME - " / " BX_CPU_NAME - " / " BX_ARCH_NAME - " / " BX_PLATFORM_NAME - " / Version 1.%d.%d (commit: " BGFX_REV_SHA1 ")" - , getRendererName() - , BGFX_API_VERSION - , BGFX_REV_NUMBER - ); - - pos = 10; - tvm.printf(10, pos++, 0x8b, " Frame: %7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS " - , double(frameTime)*toMs - , double(min)*toMs - , double(max)*toMs - , freq/frameTime - ); - - const uint32_t msaa = (m_resolution.reset&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT; - tvm.printf(10, pos++, 0x8b, " Reset flags: [%c] vsync, [%c] MSAAx%d, [%c] MaxAnisotropy " - , !!(m_resolution.reset&BGFX_RESET_VSYNC) ? '\xfe' : ' ' - , 0 != msaa ? '\xfe' : ' ' - , 1<m_numRenderItems - , statsKeyType[0] - , statsKeyType[1] - , elapsedCpuMs - , elapsedCpuMs > maxGpuElapsed ? '>' : '<' - , maxGpuElapsed - , maxGpuLatency - ); - maxGpuLatency = 0; - maxGpuElapsed = 0.0; - - for (uint32_t ii = 0; ii < Topology::Count; ++ii) - { - tvm.printf(10, pos++, 0x8b, " %10s: %7d (#inst: %5d), submitted: %7d" - , getName(Topology::Enum(ii) ) - , statsNumPrimsRendered[ii] - , statsNumInstances[ii] - , statsNumPrimsSubmitted[ii] - ); - } - - tvm.printf(10, pos++, 0x8b, " Indices: %7d ", statsNumIndices); -// tvm.printf(10, pos++, 0x8b, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax); - tvm.printf(10, pos++, 0x8b, " DVB size: %7d ", _render->m_vboffset); - tvm.printf(10, pos++, 0x8b, " DIB size: %7d ", _render->m_iboffset); - - pos++; - double captureMs = double(captureElapsed)*toMs; - tvm.printf(10, pos++, 0x8b, " Capture: %3.4f [ms]", captureMs); - - uint8_t attr[2] = { 0x8c, 0x8a }; - uint8_t attrIndex = _render->m_waitSubmit < _render->m_waitRender; - - tvm.printf(10, pos++, attr[attrIndex &1], " Submit wait: %3.4f [ms]", _render->m_waitSubmit*toMs); - tvm.printf(10, pos++, attr[(attrIndex+1)&1], " Render wait: %3.4f [ms]", _render->m_waitRender*toMs); - - min = frameTime; - max = frameTime; - } - - blit(this, _textVideoMemBlitter, tvm); - rce = m_renderEncoder; - - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION)) - { - rce.PopDebugGroup(); - } - } - else if (_render->m_debug & BGFX_DEBUG_TEXT) - { - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION)) - { - rce.PushDebugGroup("debugtext"); - } - - blit(this, _textVideoMemBlitter, _render->m_textVideoMem); - rce = m_renderEncoder; - - if (BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION)) - { - rce.PopDebugGroup(); - } - } - - endEncoding(); - - scratchBuffer.submit(); - - m_cmd.kick(true); - - scratchBuffer.release(); - -#if !BX_PLATFORM_EMSCRIPTEN - for (uint32_t ii = 0, num = m_numWindows; ii < num; ++ii) - { - FrameBufferWgpu& frameBuffer = ii == 0 ? m_mainFrameBuffer : m_frameBuffers[m_windows[ii].idx]; - if (NULL != frameBuffer.m_swapChain - && frameBuffer.m_swapChain->m_drawable) - { - SwapChainWgpu& swapChain = *frameBuffer.m_swapChain; - swapChain.m_swapChain.Present(); - } - } -#endif - } - -} /* namespace webgpu */ } // namespace bgfx - -#else - -namespace bgfx { namespace webgpu - { - RendererContextI* rendererCreate(const Init& _init) - { - BX_UNUSED(_init); - return NULL; - } - - void rendererDestroy() - { - } - } /* namespace webgpu */ } // namespace bgfx - -#endif // BGFX_CONFIG_RENDERER_WEBGPU diff --git a/bgfx/src/renderer_webgpu.h b/bgfx/src/renderer_webgpu.h deleted file mode 100644 index 5d728fa6..00000000 --- a/bgfx/src/renderer_webgpu.h +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Copyright 2011-2019 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE - */ - -#ifndef BGFX_RENDERER_WEBGPU_H_HEADER_GUARD -#define BGFX_RENDERER_WEBGPU_H_HEADER_GUARD - -#include "bgfx_p.h" - -#if BGFX_CONFIG_RENDERER_WEBGPU - -#if !BX_PLATFORM_EMSCRIPTEN -# include -# include -#else -# include -#endif // !BX_PLATFORM_EMSCRIPTEN - -#define BGFX_WEBGPU_PROFILER_BEGIN(_view, _abgr) \ - BX_MACRO_BLOCK_BEGIN \ - BGFX_PROFILER_BEGIN(s_viewName[view], _abgr); \ - BX_MACRO_BLOCK_END - -#define BGFX_WEBGPU_PROFILER_BEGIN_LITERAL(_name, _abgr) \ - BX_MACRO_BLOCK_BEGIN \ - BGFX_PROFILER_BEGIN_LITERAL("" # _name, _abgr); \ - BX_MACRO_BLOCK_END - -#define BGFX_WEBGPU_PROFILER_END() \ - BX_MACRO_BLOCK_BEGIN \ - BGFX_PROFILER_END(); \ - BX_MACRO_BLOCK_END - -#define WEBGPU_NUM_UNIFORM_BUFFERS 8 - -namespace bgfx { namespace webgpu -{ - template - class StateCacheT - { - public: - void add(uint64_t _id, Ty _item) - { - invalidate(_id); - m_hashMap.insert(stl::make_pair(_id, _item)); - } - - Ty find(uint64_t _id) - { - typename HashMap::iterator it = m_hashMap.find(_id); - if(it != m_hashMap.end()) - { - return it->second; - } - - return NULL; - } - - void invalidate(uint64_t _id) - { - typename HashMap::iterator it = m_hashMap.find(_id); - if(it != m_hashMap.end()) - { - release(it->second); - m_hashMap.erase(it); - } - } - - void invalidate() - { - for(typename HashMap::iterator it = m_hashMap.begin(), itEnd = m_hashMap.end(); it != itEnd; ++it) - { - release(it->second); - } - - m_hashMap.clear(); - } - - uint32_t getCount() const - { - return uint32_t(m_hashMap.size()); - } - - private: - typedef stl::unordered_map HashMap; - HashMap m_hashMap; - }; - - struct BufferWgpu - { - void create(uint32_t _size, void* _data, uint16_t _flags, uint16_t _stride = 0, bool _vertex = false); - void update(uint32_t _offset, uint32_t _size, void* _data, bool _discard = false); - - void destroy() - { - m_ptr.Destroy(); - - if(NULL != m_dynamic) - { - bx::deleteObject(g_allocator, m_dynamic); - m_dynamic = NULL; - } - } - - uint32_t m_size; - uint16_t m_flags = BGFX_BUFFER_NONE; - bool m_vertex; - - String m_label; - wgpu::Buffer m_ptr; - uint8_t* m_dynamic = NULL; - }; - - struct IndexBufferWgpu : public BufferWgpu - { - void create(uint32_t _size, void* _data, uint16_t _flags); - - wgpu::IndexFormat m_format; - }; - - struct VertexBufferWgpu : public BufferWgpu - { - void create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags); - - VertexLayoutHandle m_layoutHandle; - }; - - struct BindInfo - { - uint32_t m_index = UINT32_MAX; - uint32_t m_binding = UINT32_MAX; - UniformHandle m_uniform = BGFX_INVALID_HANDLE; - }; - - struct ShaderWgpu - { - void create(ShaderHandle _handle, const Memory* _mem); - void destroy() - { - if (NULL != m_constantBuffer) - { - UniformBuffer::destroy(m_constantBuffer); - m_constantBuffer = NULL; - } - - m_module = NULL; - } - - const char* name() const { return getName(m_handle); } - - ShaderHandle m_handle; - String m_label; - - wgpu::ShaderStage m_stage; - wgpu::ShaderModule m_module; - - uint32_t* m_code = NULL; - size_t m_codeSize = 0; - - UniformBuffer* m_constantBuffer = NULL; - - PredefinedUniform m_predefined[PredefinedUniform::Count]; - uint16_t m_attrMask[Attrib::Count]; - uint8_t m_attrRemap[Attrib::Count]; - - uint32_t m_hash = 0; - uint16_t m_numUniforms = 0; - uint16_t m_size = 0; - uint16_t m_gpuSize = 0; - uint8_t m_numPredefined = 0; - uint8_t m_numAttrs = 0; - - BindInfo m_bindInfo[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; - wgpu::BindGroupLayoutEntry m_samplers[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; - wgpu::BindGroupLayoutEntry m_textures[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; - uint8_t m_numSamplers = 0; - wgpu::BindGroupLayoutEntry m_buffers[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; - uint32_t m_numBuffers = 0; - }; - - struct PipelineStateWgpu; - - struct ProgramWgpu - { - void create(const ShaderWgpu* _vsh, const ShaderWgpu* _fsh); - void destroy(); - - const ShaderWgpu* m_vsh = NULL; - const ShaderWgpu* m_fsh = NULL; - - PredefinedUniform m_predefined[PredefinedUniform::Count * 2]; - uint8_t m_numPredefined; - - PipelineStateWgpu* m_computePS = NULL; - - wgpu::BindGroupLayout m_bindGroupLayout; - uint16_t m_gpuSize = 0; - uint32_t m_numUniforms; - uint32_t m_bindGroupLayoutHash; - - BindInfo m_bindInfo[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; - wgpu::BindGroupLayoutEntry m_samplers[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; - wgpu::BindGroupLayoutEntry m_textures[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; - uint32_t m_numSamplers = 0; - wgpu::BindGroupLayoutEntry m_buffers[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; - uint32_t m_numBuffers = 0; - }; - - constexpr size_t kMaxVertexInputs = 16; - constexpr size_t kMaxVertexAttributes = 16; - constexpr size_t kMaxColorAttachments = BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS; - - constexpr uint32_t kMinBufferOffsetAlignment = 256; - - struct RenderPassDescriptor - { - RenderPassDescriptor(); - - wgpu::RenderPassDescriptor desc; - - wgpu::RenderPassColorAttachment colorAttachments[kMaxColorAttachments]; - wgpu::RenderPassDepthStencilAttachment depthStencilAttachment; - }; - - struct VertexStateDescriptor - { - VertexStateDescriptor(); - - wgpu::VertexState desc; - - wgpu::VertexBufferLayoutDescriptor buffers[kMaxVertexInputs]; - wgpu::VertexAttributeDescriptor attributes[kMaxVertexAttributes]; - }; - - struct RenderPipelineDescriptor - { - RenderPipelineDescriptor(); - - wgpu::RenderPipelineDescriptor2 desc; - - wgpu::FragmentState fragment; - wgpu::DepthStencilState depthStencil; - - wgpu::ColorTargetState targets[kMaxColorAttachments]; - wgpu::BlendState blends[kMaxColorAttachments]; - }; - - struct BindingsWgpu - { - uint32_t numEntries = 0; - wgpu::BindGroupEntry m_entries[2 + BGFX_CONFIG_MAX_TEXTURE_SAMPLERS*3]; - }; - - struct BindStateWgpu - { - void clear(); - - uint32_t numOffset; - - wgpu::BindGroup m_bindGroup; - }; - - struct RenderPassStateWgpu - { - RenderPassDescriptor m_rpd; - }; - - struct PipelineStateWgpu - { - RenderPipelineDescriptor m_rpd; - - wgpu::PipelineLayout m_layout; - - wgpu::RenderPipeline m_rps; - wgpu::ComputePipeline m_cps; - }; - - void release(RenderPassStateWgpu* _ptr) - { - bx::deleteObject(g_allocator, _ptr); - } - - void release(PipelineStateWgpu* _ptr) - { - bx::deleteObject(g_allocator, _ptr); - } - - class StagingBufferWgpu - { - public: - void create(uint32_t _size, bool mapped); - void map(); - void unmap(); - void destroy(); - - void mapped(void* _data); - - wgpu::Buffer m_buffer; - void* m_data = NULL; - uint64_t m_size = 0; - }; - - class ScratchBufferWgpu - { - public: - void create(uint32_t _size); // , uint32_t _maxBindGroups); - void destroy(); - void begin(); - uint32_t write(void* data, uint64_t _size, uint64_t _offset); - uint32_t write(void* data, uint64_t _size); - void submit(); - void release(); - - StagingBufferWgpu* m_staging = NULL; - wgpu::Buffer m_buffer; - uint32_t m_offset; - uint32_t m_size; - uint8_t m_stagingIndex = 0; - }; - - class BindStateCacheWgpu - { - public: - void create(); // , uint32_t _maxBindGroups); - void destroy(); - void reset(); - - BindStateWgpu m_bindStates[1024] = {}; - uint32_t m_currentBindState; - //uint32_t m_maxBindStates; - }; - - struct ReadbackWgpu - { - void create(TextureHandle _texture) { m_texture = _texture; } - - void destroy() - { - m_buffer.Destroy(); - } - - void readback(void const* data) - { - bx::memCopy(m_data, data, m_size); - m_buffer.Unmap(); - m_mapped = false; - } - - TextureHandle m_texture; - wgpu::Buffer m_buffer; - uint32_t m_mip = 0; - bool m_mapped = false; - void* m_data = NULL; - size_t m_size = 0; - }; - - struct TextureWgpu - { - enum Enum - { - Texture2D, - Texture3D, - TextureCube, - }; - - void create(TextureHandle _handle, const Memory* _mem, uint64_t _flags, uint8_t _skip); - - void destroy() - { - m_ptr.Destroy(); - } - - void update( - uint8_t _side - , uint8_t _mip - , const Rect& _rect - , uint16_t _z - , uint16_t _depth - , uint16_t _pitch - , const Memory* _mem - ); - - TextureHandle m_handle; - String m_label; - - wgpu::TextureView m_view; - wgpu::TextureView getTextureMipLevel(int _mip); - - wgpu::Texture m_ptr; - wgpu::Texture m_ptrMsaa; - wgpu::TextureView m_ptrMips[14] = {}; - wgpu::Sampler m_sampler; - uint64_t m_flags = 0; - uint32_t m_width = 0; - uint32_t m_height = 0; - uint32_t m_depth = 0; - uint8_t m_type; - TextureFormat::Enum m_requestedFormat; - TextureFormat::Enum m_textureFormat; - uint8_t m_numMips = 0; - uint8_t m_numLayers; - uint32_t m_numSides; - uint8_t m_sampleCount; - - ReadbackWgpu m_readback; - }; - - struct SamplerStateWgpu - { - wgpu::Sampler m_sampler; - }; - - void release(SamplerStateWgpu* _ptr) - { - bx::deleteObject(g_allocator, _ptr); - } - - struct FrameBufferWgpu; - - struct SwapChainWgpu - { - void init(wgpu::Device _device, void* _nwh, uint32_t _width, uint32_t _height); - void resize(FrameBufferWgpu& _frameBuffer, uint32_t _width, uint32_t _height, uint32_t _flags); - - void flip(); - - wgpu::TextureView current(); - -#if !BX_PLATFORM_EMSCRIPTEN - DawnSwapChainImplementation m_impl; -#endif - - wgpu::SwapChain m_swapChain; - - wgpu::TextureView m_drawable; - - wgpu::Texture m_backBufferColorMsaa; - wgpu::Texture m_backBufferDepth; - - wgpu::TextureFormat m_colorFormat; - wgpu::TextureFormat m_depthFormat; - - uint32_t m_maxAnisotropy = 0; - uint8_t m_sampleCount; - }; - - struct FrameBufferWgpu - { - void create(uint8_t _num, const Attachment* _attachment); - bool create( - uint16_t _denseIdx - , void* _nwh - , uint32_t _width - , uint32_t _height - , TextureFormat::Enum _format - , TextureFormat::Enum _depthFormat - ); - void postReset(); - uint16_t destroy(); - - SwapChainWgpu* m_swapChain = NULL; - void* m_nwh = NULL; - uint32_t m_width; - uint32_t m_height; - uint16_t m_denseIdx = UINT16_MAX; - - uint32_t m_pixelFormatHash = 0; - - TextureHandle m_colorHandle[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS - 1]; - TextureHandle m_depthHandle = { kInvalidHandle }; - Attachment m_colorAttachment[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS - 1]; - Attachment m_depthAttachment; - uint8_t m_num = 0; // number of color handles - }; - - struct CommandQueueWgpu - { - void init(wgpu::Queue _queue); - void shutdown(); - void beginRender(); - void beginStaging(); - void kick(bool _endFrame, bool _waitForFinish = false); - void finish(bool _finishAll = false); - void release(wgpu::Buffer _buffer); - void consume(); - -#if BGFX_CONFIG_MULTITHREADED - //bx::Semaphore m_framesSemaphore; -#endif - - wgpu::Queue m_queue; - wgpu::CommandEncoder m_stagingEncoder; - wgpu::CommandEncoder m_renderEncoder; - - int m_releaseWriteIndex = 0; - int m_releaseReadIndex = 0; - - typedef stl::vector ResourceArray; - ResourceArray m_release[BGFX_CONFIG_MAX_FRAME_LATENCY]; - }; - - struct TimerQueryWgpu - { - TimerQueryWgpu() - : m_control(4) - { - } - - void init(); - void shutdown(); - uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum); - void end(uint32_t _idx); - void addHandlers(wgpu::CommandBuffer& _commandBuffer); - bool get(); - - struct Result - { - void reset() - { - m_begin = 0; - m_end = 0; - m_pending = 0; - m_frameNum = 0; - } - - uint64_t m_begin; - uint64_t m_end; - uint32_t m_pending; - uint32_t m_frameNum; // TODO: implement (currently stays 0) - }; - - uint64_t m_begin; - uint64_t m_end; - uint64_t m_elapsed; - uint64_t m_frequency; - - Result m_result[4 * 2]; - bx::RingBufferControl m_control; - }; - - struct OcclusionQueryWgpu - { - OcclusionQueryWgpu() - : m_control(BX_COUNTOF(m_query)) - { - } - - void postReset(); - void preReset(); - void begin(wgpu::RenderPassEncoder& _rce, Frame* _render, OcclusionQueryHandle _handle); - void end(wgpu::RenderPassEncoder& _rce); - void resolve(Frame* _render, bool _wait = false); - void invalidate(OcclusionQueryHandle _handle); - - struct Query - { - OcclusionQueryHandle m_handle; - }; - - wgpu::Buffer m_buffer; - Query m_query[BGFX_CONFIG_MAX_OCCLUSION_QUERIES]; - bx::RingBufferControl m_control; - }; - -} /* namespace webgpu */ } // namespace bgfx - -#endif // BGFX_CONFIG_RENDERER_WEBGPU - -#endif // BGFX_RENDERER_WEBGPU_H_HEADER_GUARD diff --git a/bgfx/src/shader.cpp b/bgfx/src/shader.cpp index 9e0ba24c..2b61fe9d 100644 --- a/bgfx/src/shader.cpp +++ b/bgfx/src/shader.cpp @@ -1,11 +1,10 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #include "bgfx_p.h" #include "shader_dxbc.h" -#include "shader_dx9bc.h" #include "shader_spirv.h" namespace bgfx @@ -24,7 +23,7 @@ namespace bgfx { DescriptorType::StorageBuffer, 0x0007 }, { DescriptorType::StorageImage, 0x0003 }, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_descriptorTypeToId) == DescriptorType::Count); + static_assert(BX_COUNTOF(s_descriptorTypeToId) == DescriptorType::Count); DescriptorType::Enum idToDescriptorType(uint16_t _id) { @@ -59,7 +58,7 @@ namespace bgfx { TextureComponentType::Depth, 0x03 }, { TextureComponentType::UnfilterableFloat, 0x04 }, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_textureComponentTypeToId) == TextureComponentType::Count); + static_assert(BX_COUNTOF(s_textureComponentTypeToId) == TextureComponentType::Count); TextureComponentType::Enum idToTextureComponentType(uint8_t _id) { @@ -95,7 +94,7 @@ namespace bgfx { TextureDimension::DimensionCubeArray, 0x05 }, { TextureDimension::Dimension3D, 0x06 }, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_textureDimensionToId) == TextureDimension::Count); + static_assert(BX_COUNTOF(s_textureDimensionToId) == TextureDimension::Count); TextureDimension::Enum idToTextureDimension(uint8_t _id) { @@ -128,19 +127,6 @@ namespace bgfx return true; } - static bool printAsm(uint32_t _offset, const Dx9bcInstruction& _instruction, void* _userData) - { - BX_UNUSED(_offset); - bx::WriterI* writer = reinterpret_cast(_userData); - char temp[512]; - toString(temp, sizeof(temp), _instruction); - - bx::Error err; - bx::write(writer, temp, (int32_t)bx::strLen(temp), &err); - bx::write(writer, '\n', &err); - return true; - } - static bool printAsm(uint32_t _offset, const SpvInstruction& _instruction, void* _userData) { BX_UNUSED(_offset); @@ -173,9 +159,8 @@ namespace bgfx } else { - Dx9bc dx9bc; - read(_reader, dx9bc, _err); - parse(dx9bc.shader, printAsm, _writer, _err); + BX_TRACE("Unrecognized shader binary format (magic: 0x%08x)!", magic); + BX_ERROR_SET(_err, kShaderInvalidHeader, "Failed to read shader binary. Invalid magic number."); } } diff --git a/bgfx/src/shader.h b/bgfx/src/shader.h index 0a2f507e..e44cb712 100644 --- a/bgfx/src/shader.h +++ b/bgfx/src/shader.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -10,6 +10,9 @@ namespace bgfx { + BX_ERROR_RESULT(kShaderInvalidHeader, BX_MAKEFOURCC('S', 'H', 0, 1) ); + BX_ERROR_RESULT(kShaderInvalidInstruction, BX_MAKEFOURCC('S', 'H', 0, 2) ); + struct DescriptorType { enum Enum diff --git a/bgfx/src/shader_dx9bc.cpp b/bgfx/src/shader_dx9bc.cpp deleted file mode 100644 index 4501435c..00000000 --- a/bgfx/src/shader_dx9bc.cpp +++ /dev/null @@ -1,755 +0,0 @@ -/* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE - */ - -#include "bgfx_p.h" -#include "shader_dx9bc.h" - -BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wunused-parameter"); -BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunneeded-internal-declaration"); - -namespace bgfx -{ - struct Dx9bcOpcodeInfo - { - uint8_t numOperands; - uint8_t numValues; - }; - - static const Dx9bcOpcodeInfo s_dx9bcOpcodeInfo[] = - { - { 0, 0 }, // NOP - { 2, 0 }, // MOV - { 3, 0 }, // ADD - { 1, 0 }, // SUB - { 4, 0 }, // MAD - { 3, 0 }, // MUL - { 2, 0 }, // RCP - { 2, 0 }, // RSQ - { 3, 0 }, // DP3 - { 3, 0 }, // DP4 - { 3, 0 }, // MIN - { 3, 0 }, // MAX - { 3, 0 }, // SLT - { 3, 0 }, // SGE - { 2, 0 }, // EXP - { 2, 0 }, // LOG - { 1, 0 }, // LIT - { 1, 0 }, // DST - { 4, 0 }, // LRP - { 2, 0 }, // FRC - { 1, 0 }, // M4X4 - { 1, 0 }, // M4X3 - { 1, 0 }, // M3X4 - { 1, 0 }, // M3X3 - { 1, 0 }, // M3X2 - { 0, 0 }, // CALL - { 0, 0 }, // CALLNZ - { 0, 0 }, // LOOP - { 0, 0 }, // RET - { 0, 0 }, // ENDLOOP - { 0, 0 }, // LABEL - { 1, 1 }, // DCL - { 3, 0 }, // POW - { 1, 0 }, // CRS - { 1, 0 }, // SGN - { 1, 0 }, // ABS - { 2, 0 }, // NRM - { 4, 0 }, // SINCOS - { 1, 0 }, // REP - { 0, 0 }, // ENDREP - { 1, 0 }, // IF - { 2, 0 }, // IFC - { 0, 0 }, // ELSE - { 0, 0 }, // ENDIF - { 0, 0 }, // BREAK - { 2, 0 }, // BREAKC - { 2, 0 }, // MOVA - { 1, 4 }, // DEFB - { 1, 4 }, // DEFI - { 0, 0 }, // 0 - { 0, 0 }, // 1 - { 0, 0 }, // 2 - { 0, 0 }, // 3 - { 0, 0 }, // 4 - { 0, 0 }, // 5 - { 0, 0 }, // 6 - { 0, 0 }, // 7 - { 0, 0 }, // 8 - { 0, 0 }, // 9 - { 0, 0 }, // 10 - { 0, 0 }, // 11 - { 0, 0 }, // 12 - { 0, 0 }, // 13 - { 0, 0 }, // 14 - { 1, 0 }, // TEXCOORD - { 1, 0 }, // TEXKILL - { 3, 0 }, // TEX - { 1, 0 }, // TEXBEM - { 1, 0 }, // TEXBEM1 - { 1, 0 }, // TEXREG2AR - { 1, 0 }, // TEXREG2GB - { 1, 0 }, // TEXM3X2PAD - { 1, 0 }, // TEXM3X2TEX - { 1, 0 }, // TEXM3X3PAD - { 1, 0 }, // TEXM3X3TEX - { 1, 0 }, // TEXM3X3DIFF - { 1, 0 }, // TEXM3X3SPEC - { 1, 0 }, // TEXM3X3VSPEC - { 2, 0 }, // EXPP - { 2, 0 }, // LOGP - { 4, 0 }, // CND - { 1, 4 }, // DEF - { 1, 0 }, // TEXREG2RGB - { 1, 0 }, // TEXDP3TEX - { 1, 0 }, // TEXM3X2DEPTH - { 1, 0 }, // TEXDP3 - { 1, 0 }, // TEXM3X3 - { 1, 0 }, // TEXDEPTH - { 4, 0 }, // CMP - { 1, 0 }, // BEM - { 4, 0 }, // DP2ADD - { 2, 0 }, // DSX - { 2, 0 }, // DSY - { 5, 0 }, // TEXLDD - { 1, 0 }, // SETP - { 3, 0 }, // TEXLDL - { 0, 0 }, // BREAKP - }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dx9bcOpcodeInfo) == Dx9bcOpcode::Count); - - static const char* s_dx9bcOpcode[] = - { - "nop", - "mov", - "add", - "sub", - "mad", - "mul", - "rcp", - "rsq", - "dp3", - "dp4", - "min", - "max", - "slt", - "sge", - "exp", - "log", - "lit", - "dst", - "lrp", - "frc", - "m4x4", - "m4x3", - "m3x4", - "m3x3", - "m3x2", - "call", - "callnz", - "loop", - "ret", - "endloop", - "label", - "dcl", - "pow", - "crs", - "sgn", - "abs", - "nrm", - "sincos", - "rep", - "endrep", - "if", - "ifc", - "else", - "endif", - "break", - "breakc", - "mova", - "defb", - "defi", - - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - - "texcoord", - "texkill", - "tex", - "texbem", - "texbem1", - "texreg2ar", - "texreg2gb", - "texm3x2pad", - "texm3x2tex", - "texm3x3pad", - "texm3x3tex", - "texm3x3diff", - "texm3x3spec", - "texm3x3vspec", - "expp", - "logp", - "cnd", - "def", - "texreg2rgb", - "texdp3tex", - "texm3x2depth", - "texdp3", - "texm3x3", - "texdepth", - "cmp", - "bem", - "dp2add", - "dsx", - "dsy", - "texldd", - "setp", - "texldl", - "breakp", - }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dx9bcOpcode) == Dx9bcOpcode::Count); - - const char* getName(Dx9bcOpcode::Enum _opcode) - { - BX_ASSERT(_opcode < Dx9bcOpcode::Count, "Unknown opcode id %d (%x).", _opcode, _opcode); - return s_dx9bcOpcode[_opcode]; - } - - static const char* s_dx9bcOperandType[] = - { - "r", // Temporary Register File - "v", // Input Register File - "c", // Constant Register File - "t", // Texture Register File (PS) - "oPos", // Rasterizer Register File - "oD", // Attribute Output Register File - "oT", // Texture Coordinate Output Register File - "output", // Output register file for VS3.0+ - "i", // Constant Integer Vector Register File - "oColor", // Color Output Register File - "oDepth", // Depth Output Register File - "s", // Sampler State Register File - "c", // Constant Register File 2048 - 4095 - "c", // Constant Register File 4096 - 6143 - "c", // Constant Register File 6144 - 8191 - "b", // Constant Boolean register file - "aL", // Loop counter register file - "tempfloat16", // 16-bit float temp register file - "misctype", // Miscellaneous (single) registers. - "label", // Label - "p", // Predicate register - }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dx9bcOperandType) == Dx9bcOperandType::Count); - - static const char* s_dx9bcDeclUsage[] = - { - "position", - "blendweight", - "blendindices", - "normal", - "psize", - "texcoord", - "tangent", - "binormal", - "tessfactor", - "positiont", - "color", - "fog", - "depth", - "sample", - }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dx9bcDeclUsage) == Dx9bcDeclUsage::Count); - - int32_t read(bx::ReaderI* _reader, Dx9bcSubOperand& _subOperand, bx::Error* _err) - { - int32_t size = 0; - - uint32_t token; - size += bx::read(_reader, token, _err); - - _subOperand.type = Dx9bcOperandType::Enum( ( (token & UINT32_C(0x70000000) ) >> 28) - | ( (token & UINT32_C(0x00001800) ) >> 8) ); - _subOperand.regIndex = (token & UINT32_C(0x000007ff) ); - _subOperand.swizzleBits = uint8_t( (token & UINT32_C(0x00ff0000) ) >> 16); - - return size; - } - - int32_t write(bx::WriterI* _writer, const Dx9bcSubOperand& _subOperand, bx::Error* _err) - { - int32_t size = 0; - - uint32_t token = 0; - token |= (_subOperand.type << 28) & UINT32_C(0x70000000); - token |= (_subOperand.type << 8) & UINT32_C(0x00001800); - token |= _subOperand.regIndex & UINT32_C(0x000007ff); - token |= (_subOperand.swizzleBits << 16) & UINT32_C(0x00ff0000); - size += bx::write(_writer, token, _err); - - return size; - } - - int32_t read(bx::ReaderI* _reader, Dx9bcOperand& _operand, bx::Error* _err) - { - int32_t size = 0; - - uint32_t token; - size += bx::read(_reader, token, _err); - - _operand.type = Dx9bcOperandType::Enum( ( (token & UINT32_C(0x70000000) ) >> 28) - | ( (token & UINT32_C(0x00001800) ) >> 8) ); - _operand.regIndex = (token & UINT32_C(0x000007ff) ); - _operand.addrMode = Dx9bcOperandAddrMode::Enum( (token & UINT32_C(0x00002000) ) >> 13); - - if (_operand.destination) - { - // Destination Parameter Token - // https://msdn.microsoft.com/en-us/library/ff552738.aspx - - _operand.writeMask = uint8_t( (token & UINT32_C(0x000f0000) ) >> 16); - _operand.saturate = 0 != (token & UINT32_C(0x00100000) ); - _operand.partialPrecision = 0 != (token & UINT32_C(0x00200000) ); - _operand.centroid = 0 != (token & UINT32_C(0x00400000) ); - } - else - { - // Source Parameter Token - // https://msdn.microsoft.com/en-us/library/ff569716%28v=vs.85%29.aspx - - _operand.writeMask = 0; - _operand.saturate = false; - _operand.partialPrecision = false; - _operand.centroid = false; - _operand.swizzleBits = uint8_t( (token & UINT32_C(0x00ff0000) ) >> 16); - } - - if (Dx9bcOperandAddrMode::Relative == _operand.addrMode) - { - size += read(_reader, _operand.subOperand, _err); - } - - return size; - } - - int32_t write(bx::WriterI* _writer, const Dx9bcOperand& _operand, bx::Error* _err) - { - int32_t size = 0; - - uint32_t token = 0; - token |= (_operand.type << 28) & UINT32_C(0x70000000); - token |= (_operand.type << 8) & UINT32_C(0x00001800); - token |= _operand.regIndex & UINT32_C(0x000007ff); - token |= (_operand.addrMode << 13) & UINT32_C(0x00002000); - size += bx::write(_writer, token, _err); - - if (Dx9bcOperandAddrMode::Relative == _operand.addrMode) - { - size += write(_writer, _operand.subOperand, _err); - } - - return size; - } - - int32_t read(bx::ReaderI* _reader, Dx9bcInstruction& _instruction, bx::Error* _err) - { - int32_t size = 0; - - uint32_t token; - size += bx::read(_reader, token, _err); - - _instruction.opcode = Dx9bcOpcode::Enum( (token & UINT32_C(0x0000ffff) ) ); - - if (Dx9bcOpcode::Comment == _instruction.opcode) - { - _instruction.specific = 0; - _instruction.length = uint16_t( (token & UINT32_C(0x7fff0000) ) >> 16) + 1; - _instruction.predicated = false; - _instruction.coissue = false; - } - else - { - _instruction.specific = uint8_t( (token & UINT32_C(0x00ff0000) ) >> 16); - _instruction.length = uint8_t( (token & UINT32_C(0x0f000000) ) >> 24) + 1; - _instruction.predicated = 0 != (token & UINT32_C(0x10000000) ); - _instruction.coissue = 0 != (token & UINT32_C(0x40000000) ); - } - - if (Dx9bcOpcode::Count <= _instruction.opcode) - { - if (Dx9bcOpcode::Comment == _instruction.opcode) - { - for (int32_t ii = 0, num = _instruction.length-1; ii < num; ++ii) - { - uint32_t tmp; - size += bx::read(_reader, tmp, _err); - } - } - - return size; - } - - uint32_t currOp = 0; - - const Dx9bcOpcodeInfo& info = s_dx9bcOpcodeInfo[bx::uint32_min(_instruction.opcode, Dx9bcOpcode::Count)]; - _instruction.numOperands = info.numOperands; - _instruction.numValues = info.numValues; - - switch (_instruction.opcode) - { - case Dx9bcOpcode::SINCOS: - if (5 > _instruction.length) - { - _instruction.numOperands = 2; - } - break; - - default: - break; - }; - -//BX_TRACE("%d (%d), %d, %d, 0x%08x" -// , _instruction.opcode -// , bx::uint32_min(_instruction.opcode, Dx9bcOpcode::Count) -// , _instruction.length -// , _instruction.numOperands -// , token -// ); - - const bool valuesBeforeOpcode = false - || Dx9bcOpcode::DCL == _instruction.opcode - ; - - if (valuesBeforeOpcode - && 0 < info.numValues) - { - size += read(_reader, _instruction.value, info.numValues*sizeof(uint32_t), _err); - } - - _instruction.operand[0].destination = true; - - switch (_instruction.numOperands) - { - case 6: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 5: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 4: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 3: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 2: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 1: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 0: - if (!valuesBeforeOpcode - && 0 < info.numValues) - { - size += read(_reader, _instruction.value, info.numValues*sizeof(uint32_t), _err); - } - break; - - default: - BX_ASSERT(false, "Instruction %s with invalid number of operands %d (numValues %d)." - , getName(_instruction.opcode) - , _instruction.numOperands - , info.numValues - ); - break; - } - - return size; - } - - int32_t write(bx::WriterI* _writer, const Dx9bcInstruction& _instruction, bx::Error* _err) - { - int32_t size = 0; - - uint32_t token = 0; - token |= _instruction.opcode & UINT32_C(0x0000ffff); - token |= (_instruction.specific << 16) & UINT32_C(0x00ff0000); - token |= ( (_instruction.length - 1) << 24) & UINT32_C(0x0f000000); - size += bx::write(_writer, token, _err); - - uint32_t currOp = 0; - switch (_instruction.numOperands) - { - case 6: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 5: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 4: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 3: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 2: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 1: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 0: - break; - } - - return size; - } - - int32_t toString(char* _out, int32_t _size, const Dx9bcInstruction& _instruction) - { - int32_t size = 0; - - if (Dx9bcOpcode::Comment == _instruction.opcode - || Dx9bcOpcode::Phase == _instruction.opcode) - { - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , "// %x" - , _instruction.opcode - ); - return size; - } - - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , "%2d %s" - , _instruction.opcode - , getName(_instruction.opcode) - ); - - switch (_instruction.opcode) - { - case Dx9bcOpcode::DCL: - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , "_%s%d (%d, %d, %d, %d)" - , s_dx9bcDeclUsage[_instruction.value[0] & UINT32_C(0x0000000f)] - , (_instruction.value[0] & UINT32_C(0x000f0000) )>>16 - , (_instruction.value[0] & UINT32_C(0x08000000) )>>27 // ? - , (_instruction.value[0] & UINT32_C(0x10000000) )>>28 // texture2d - , (_instruction.value[0] & UINT32_C(0x20000000) )>>29 // textureCube - , (_instruction.value[0] & UINT32_C(0x40000000) )>>30 // texture3d - ); - break; - - default: - break; - } - - for (uint32_t ii = 0; ii < _instruction.numOperands; ++ii) - { - const Dx9bcOperand& operand = _instruction.operand[ii]; - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , "%s%s%d" - , 0 == ii ? " " : ", " - , s_dx9bcOperandType[operand.type] - , operand.regIndex - ); - - if (operand.destination) - { - if (0xf > operand.writeMask - && 0 < operand.writeMask) - { - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , ".%s%s%s%s" - , 0 == (operand.writeMask & 1) ? "" : "x" - , 0 == (operand.writeMask & 2) ? "" : "y" - , 0 == (operand.writeMask & 4) ? "" : "z" - , 0 == (operand.writeMask & 8) ? "" : "w" - ); - } - } - else - { - if (Dx9bcOperandAddrMode::Relative == operand.addrMode) - { - const bool array = true; - - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , "[" - ); - - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , "%s%d" - , s_dx9bcOperandType[operand.subOperand.type] - , operand.subOperand.regIndex - ); - - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , "%s" - , array ? "]" : "" - ); - } - - if (0xe4 != operand.swizzleBits) - { - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , ".%c%c%c%c" - , "xyzw"[(operand.swizzleBits )&0x3] - , "xyzw"[(operand.swizzleBits>>2)&0x3] - , "xyzw"[(operand.swizzleBits>>4)&0x3] - , "xyzw"[(operand.swizzleBits>>6)&0x3] - ); - } - } - } - - switch (_instruction.opcode) - { - case Dx9bcOpcode::DEF: - for (uint32_t jj = 0; jj < _instruction.numValues; ++jj) - { - union { int32_t i; float f; } cast = { _instruction.value[jj] }; - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , "%s%f%s" - , 0 == jj ? " (" : ", " - , cast.f - , uint32_t(_instruction.numValues-1) == jj ? ")" : "" - ); - } - break; - - case Dx9bcOpcode::DEFI: - for (uint32_t jj = 0; jj < _instruction.numValues; ++jj) - { - size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) - , "%s%d%s" - , 0 == jj ? " (" : ", " - , _instruction.value[jj] - , uint32_t(_instruction.numValues-1) == jj ? ")" : "" - ); - } - break; - - default: - break; - } - - return size; - } - - int32_t read(bx::ReaderSeekerI* _reader, Dx9bcShader& _shader, bx::Error* _err) - { - int32_t size = 0; - int64_t offset = bx::seek(_reader); - - for (;;) - { - Dx9bcInstruction instruction; - int32_t length = read(_reader, instruction, _err); - size += length; - - if (Dx9bcOpcode::Count > instruction.opcode) - { - char temp[512]; - toString(temp, 512, instruction); - - BX_ASSERT(length/4 == instruction.length - , "%s\nread %d, expected %d" - , temp - , length/4 - , instruction.length - ); - } - else - { - if (Dx9bcOpcode::End == instruction.opcode) - { - size -= length; - break; - } - } - } - - bx::seek(_reader, offset, bx::Whence::Begin); - - _shader.byteCode.resize(size); - bx::read(_reader, _shader.byteCode.data(), size, _err); - - return size; - } - - int32_t write(bx::WriterI* _writer, const Dx9bcShader& _shader, bx::Error* _err) - { - BX_UNUSED(_writer, _shader, _err); - return 0; - } - - int32_t read(bx::ReaderSeekerI* _reader, Dx9bc& _bc, bx::Error* _err) - { - int32_t size = 0; - - size += bx::read(_reader, _bc.version, _err); - - bool pixelShader = (0xffff0000 == (_bc.version & 0xffff0000) ); - uint32_t versionMajor = (_bc.version>>8)&0xff; - uint32_t versionMinor = _bc.version&0xff; - BX_UNUSED(pixelShader, versionMajor, versionMinor); - BX_TRACE("%s shader %d.%d" - , pixelShader ? "pixel" : "vertex" - , versionMajor - , versionMinor - ); - - size += read(_reader, _bc.shader, _err); - - return size; - } - - int32_t write(bx::WriterSeekerI* _writer, const Dx9bc& _dxbc, bx::Error* _err) - { - BX_UNUSED(_writer, _dxbc, _err); - return 0; - } - - void parse(const Dx9bcShader& _src, Dx9bcParseFn _fn, void* _userData, bx::Error* _err) - { - BX_ERROR_SCOPE(_err); - - bx::MemoryReader reader(_src.byteCode.data(), uint32_t(_src.byteCode.size() ) ); - - bx::Error err; - - for (uint32_t token = 0, numTokens = uint32_t(_src.byteCode.size() / sizeof(uint32_t) ); token < numTokens;) - { - Dx9bcInstruction instruction; - uint32_t size = read(&reader, instruction, _err); - BX_ASSERT(size/4 == instruction.length, "read %d, expected %d", size/4, instruction.length); BX_UNUSED(size); - - bool cont = _fn(token * sizeof(uint32_t), instruction, _userData); - if (!cont) - { - return; - } - - token += instruction.length; - } - } - - void filter(Dx9bcShader& _dst, const Dx9bcShader& _src, Dx9bcFilterFn _fn, void* _userData, bx::Error* _err) - { - BX_ERROR_SCOPE(_err); - - bx::MemoryReader reader(_src.byteCode.data(), uint32_t(_src.byteCode.size() ) ); - - bx::MemoryBlock mb(g_allocator); - bx::MemoryWriter writer(&mb); - - for (uint32_t token = 0, numTokens = uint32_t(_src.byteCode.size() / sizeof(uint32_t) ); token < numTokens;) - { - Dx9bcInstruction instruction; - uint32_t size = read(&reader, instruction, _err); - BX_ASSERT(size/4 == instruction.length, "read %d, expected %d", size/4, instruction.length); BX_UNUSED(size); - - _fn(instruction, _userData); - - write(&writer, instruction, _err); - - token += instruction.length; - } - - uint8_t* data = (uint8_t*)mb.more(); - uint32_t size = uint32_t(bx::getSize(&writer) ); - _dst.byteCode.reserve(size); - bx::memCopy(_dst.byteCode.data(), data, size); - } - -} // namespace bgfx diff --git a/bgfx/src/shader_dx9bc.h b/bgfx/src/shader_dx9bc.h deleted file mode 100644 index ca239a7c..00000000 --- a/bgfx/src/shader_dx9bc.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE - */ - -#ifndef BGFX_SHADER_DX9BC_H -#define BGFX_SHADER_DX9BC_H - -#include - -namespace bgfx -{ - struct Dx9bcOpcode - { - enum Enum - { - NOP, - MOV, - ADD, - SUB, - MAD, - MUL, - RCP, - RSQ, - DP3, - DP4, - MIN, - MAX, - SLT, - SGE, - EXP, - LOG, - LIT, - DST, - LRP, - FRC, - M4X4, - M4X3, - M3X4, - M3X3, - M3X2, - CALL, - CALLNZ, - LOOP, - RET, - ENDLOOP, - LABEL, - DCL, - POW, - CRS, - SGN, - ABS, - NRM, - SINCOS, - REP, - ENDREP, - IF, - IFC, - ELSE, - ENDIF, - BREAK, - BREAKC, - MOVA, - DEFB, - DEFI, - - Unknown = 63, - TEXCOORD, - TEXKILL, - TEX, - TEXBEM, - TEXBEM1, - TEXREG2AR, - TEXREG2GB, - TEXM3X2PAD, - TEXM3X2TEX, - TEXM3X3PAD, - TEXM3X3TEX, - TEXM3X3DIFF, - TEXM3X3SPEC, - TEXM3X3VSPEC, - EXPP, - LOGP, - CND, - DEF, - TEXREG2RGB, - TEXDP3TEX, - TEXM3X2DEPTH, - TEXDP3, - TEXM3X3, - TEXDEPTH, - CMP, - BEM, - DP2ADD, - DSX, - DSY, - TEXLDD, - SETP, - TEXLDL, - BREAKP, - - Count, - - Phase = 0xfffd, - Comment = 0xfffe, - End = 0xffff - }; - }; - - const char* getName(Dx9bcOpcode::Enum _opcode); - - struct Dx9bcResourceDim - { - enum Enum - { - Unknown, - Texture1D, - Texture2D, - TextureCube, - Texture3D, - }; - }; - - struct Dx9bcOperandType - { - enum Enum - { - Temp, - Input, - Const, - Texture, - RastOut, - AttrOut, - TexCrdOut, - Output, - ConstInt, - ColorOut, - DepthOut, - Sampler, - Const2, - Const3, - Const4, - ConstBool, - Loop, - TempFloat16, - MiscType, - Label, - Predicate, - - Count - }; - }; - - struct Dx9bcDeclUsage - { - enum Enum - { - Position, - BlendWeight, - BlendIndices, - Normal, - Psize, - Texcoord, - Tangent, - Binormal, - TessFactor, - PositionT, - Color, - Fog, - Depth, - Sample, - - Count - }; - }; - - struct Dx9bcOperandAddrMode - { - enum Enum - { - Absolute, - Relative, - - Count - }; - }; - - struct Dx9bcSubOperand - { - Dx9bcSubOperand() { /* not pod */ } - - Dx9bcOperandType::Enum type; - uint32_t regIndex; - uint8_t swizzleBits; - }; - - struct Dx9bcOperand - { - Dx9bcOperand() { /* not pod */ } - - Dx9bcOperandType::Enum type; - uint32_t regIndex; - - bool destination; - - // Destination - uint8_t writeMask; - bool saturate; - bool partialPrecision; - bool centroid; - - // Source - uint8_t swizzleBits; - - Dx9bcOperandAddrMode::Enum addrMode; - Dx9bcSubOperand subOperand; - }; - - struct Dx9bcInstruction - { - Dx9bcInstruction() { /* not pod */ } - - Dx9bcOpcode::Enum opcode; - uint16_t length; - uint8_t numOperands; - uint8_t numValues; - uint8_t specific; - bool predicated; - bool coissue; - - Dx9bcOperand operand[6]; - int32_t value[4]; - }; - - int32_t read(bx::ReaderI* _reader, Dx9bcInstruction& _instruction, bx::Error* _err); - int32_t write(bx::WriterI* _writer, const Dx9bcInstruction& _instruction, bx::Error* _err); - int32_t toString(char* _out, int32_t _size, const Dx9bcInstruction& _instruction); - - struct Dx9bcShader - { - Dx9bcShader() { /* not pod */ } - - stl::vector byteCode; - }; - - int32_t read(bx::ReaderSeekerI* _reader, Dx9bcShader& _shader, bx::Error* _err); - int32_t write(bx::WriterI* _writer, const Dx9bcShader& _shader, bx::Error* _err); - - struct Dx9bc - { - Dx9bc() { /* not pod */ } - - uint32_t version; - Dx9bcShader shader; - }; - - int32_t read(bx::ReaderSeekerI* _reader, Dx9bc& _dx9bc, bx::Error* _err); - int32_t write(bx::WriterSeekerI* _writer, const Dx9bc& _dx9bc, bx::Error* _err); - - typedef bool (*Dx9bcParseFn)(uint32_t _offset, const Dx9bcInstruction& _instruction, void* _userData); - void parse(const Dx9bcShader& _src, Dx9bcParseFn _fn, void* _userData, bx::Error* _err = NULL); - - typedef void (*Dx9bcFilterFn)(Dx9bcInstruction& _instruction, void* _userData); - void filter(Dx9bcShader& _dst, const Dx9bcShader& _src, Dx9bcFilterFn _fn, void* _userData, bx::Error* _err = NULL); - -} // namespace bgfx - -#endif // BGFX_SHADER_DX9BC_H diff --git a/bgfx/src/shader_dxbc.cpp b/bgfx/src/shader_dxbc.cpp index 33cf7eb2..f9f879a0 100644 --- a/bgfx/src/shader_dxbc.cpp +++ b/bgfx/src/shader_dxbc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -238,7 +238,7 @@ namespace bgfx { 0, 0 }, // ITOD { 0, 0 }, // UTOD }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcOpcodeInfo) == DxbcOpcode::Count); + static_assert(BX_COUNTOF(s_dxbcOpcodeInfo) == DxbcOpcode::Count); static const char* s_dxbcOpcode[] = { @@ -464,7 +464,7 @@ namespace bgfx "itod", "utod", }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcOpcode) == DxbcOpcode::Count); + static_assert(BX_COUNTOF(s_dxbcOpcode) == DxbcOpcode::Count); const char* getName(DxbcOpcode::Enum _opcode) { @@ -488,7 +488,7 @@ namespace bgfx "RawBuffer", // RawBuffer "StructuredBuffer", // StructuredBuffer }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcSrvType) == DxbcResourceDim::Count); + static_assert(BX_COUNTOF(s_dxbcSrvType) == DxbcResourceDim::Count); const char* s_dxbcInterpolationName[] = { @@ -501,7 +501,7 @@ namespace bgfx "linear sample", "linear noperspective sample", }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcInterpolationName) == DxbcInterpolation::Count); + static_assert(BX_COUNTOF(s_dxbcInterpolationName) == DxbcInterpolation::Count); const char *s_dxbcPrimitiveTopologyName[] = { @@ -520,7 +520,7 @@ namespace bgfx "TriangleListAdj", "TriangleStripAdj", }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcPrimitiveTopologyName) == DxbcPrimitiveTopology::Count); + static_assert(BX_COUNTOF(s_dxbcPrimitiveTopologyName) == DxbcPrimitiveTopology::Count); const char *s_dxbcPrimitiveName[] = { "", @@ -564,7 +564,7 @@ namespace bgfx "_31ControlPointPatch", "_32ControlPointPatch", }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcPrimitiveName) == DxbcPrimitive::Count); + static_assert(BX_COUNTOF(s_dxbcPrimitiveName) == DxbcPrimitive::Count); // mesa/src/gallium/state_trackers/d3d1x/d3d1xshader/defs/shortfiles.txt static const char* s_dxbcOperandType[] = @@ -611,7 +611,7 @@ namespace bgfx "oDepthLE", // OutputDepthLessEqual "vCycleCounter", // CycleCounter }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcOperandType) == DxbcOperandType::Count); + static_assert(BX_COUNTOF(s_dxbcOperandType) == DxbcOperandType::Count); static const char* s_dxbcCustomDataClass[] = { @@ -622,7 +622,7 @@ namespace bgfx "ShaderMessage", "ClipPlaneConstantMappingsForDx9", }; - BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcCustomDataClass) == DxbcCustomDataClass::Count); + static_assert(BX_COUNTOF(s_dxbcCustomDataClass) == DxbcCustomDataClass::Count); #define DXBC_MAX_NAME_STRING 512 @@ -1230,7 +1230,7 @@ namespace bgfx _instruction.primitiveTopology = DxbcPrimitiveTopology::Enum( (token & UINT32_C(0x0001f800) ) >> 11); break; - case DxbcOpcode::DCL_INPUT_PS: BX_FALLTHROUGH; + case DxbcOpcode::DCL_INPUT_PS: [[fallthrough]]; case DxbcOpcode::DCL_INPUT_PS_SIV: // 0 1 2 3 // 76543210765432107654321076543210 @@ -1395,12 +1395,12 @@ namespace bgfx _instruction.numOperands = info.numOperands; switch (info.numOperands) { - case 6: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 5: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 4: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 3: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 2: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; - case 1: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH; + case 6: size += read(_reader, _instruction.operand[currOp++], _err); [[fallthrough]]; + case 5: size += read(_reader, _instruction.operand[currOp++], _err); [[fallthrough]]; + case 4: size += read(_reader, _instruction.operand[currOp++], _err); [[fallthrough]]; + case 3: size += read(_reader, _instruction.operand[currOp++], _err); [[fallthrough]]; + case 2: size += read(_reader, _instruction.operand[currOp++], _err); [[fallthrough]]; + case 1: size += read(_reader, _instruction.operand[currOp++], _err); [[fallthrough]]; case 0: if (0 < info.numValues) { @@ -1471,7 +1471,7 @@ namespace bgfx token |= (_instruction.primitiveTopology << 11) & UINT32_C(0x0001f800); break; - case DxbcOpcode::DCL_INPUT_PS: BX_FALLTHROUGH; + case DxbcOpcode::DCL_INPUT_PS: [[fallthrough]]; case DxbcOpcode::DCL_INPUT_PS_SIV: token |= (_instruction.interpolation << 11) & UINT32_C(0x0000f800); break; @@ -1723,11 +1723,10 @@ namespace bgfx case DxbcOperandType::Imm64: for (uint32_t jj = 0; jj < operand.num; ++jj) { - union { uint32_t i; float f; } cast = { operand.un.imm32[jj] }; size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size) , "%s%f" , 0 == jj ? "(" : ", " - , cast.f + , bx::bitCast(operand.un.imm32[jj]) ); } @@ -1991,7 +1990,7 @@ namespace bgfx { case DXBC_CHUNK_SHADER_EX: _dxbc.shader.shex = true; - BX_FALLTHROUGH; + [[fallthrough]]; case DXBC_CHUNK_SHADER: size += read(_reader, _dxbc.shader, _err); diff --git a/bgfx/src/shader_dxbc.h b/bgfx/src/shader_dxbc.h index 5bd16641..b3a7cc3d 100644 --- a/bgfx/src/shader_dxbc.h +++ b/bgfx/src/shader_dxbc.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/shader_spirv.cpp b/bgfx/src/shader_spirv.cpp index 87a22b28..9dd71679 100644 --- a/bgfx/src/shader_spirv.cpp +++ b/bgfx/src/shader_spirv.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -17,12 +17,8 @@ namespace bgfx #define SPV_OPERAND_7(_a0, _a1, _a2, _a3, _a4, _a5, _a6) SPV_OPERAND_1(_a0), SPV_OPERAND_6(_a1, _a2, _a3, _a4, _a5, _a6) #define SPV_OPERAND_8(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7) SPV_OPERAND_1(_a0), SPV_OPERAND_7(_a1, _a2, _a3, _a4, _a5, _a6, _a7) #define SPV_OPERAND_9(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) SPV_OPERAND_1(_a0), SPV_OPERAND_8(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) -#if BX_COMPILER_MSVC -// Workaround MSVS bug... -# define SPV_OPERAND(...) { BX_MACRO_DISPATCHER(SPV_OPERAND_, __VA_ARGS__) BX_VA_ARGS_PASS(__VA_ARGS__) } -#else -# define SPV_OPERAND(...) { BX_MACRO_DISPATCHER(SPV_OPERAND_, __VA_ARGS__)(__VA_ARGS__) } -#endif // BX_COMPILER_MSVC +#define SPV_OPERAND(...) { BX_MACRO_DISPATCHER(SPV_OPERAND_, __VA_ARGS__)(__VA_ARGS__) } + #define _ Count bool isDebug(SpvOpcode::Enum _opcode) @@ -363,7 +359,7 @@ namespace bgfx { false, false, /* AtomicFlagClear, // 319 */ SPV_OPERAND(_) }, { true, true, /* ImageSparseRead, // 320 */ SPV_OPERAND(_) }, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_spvOpcodeInfo) == SpvOpcode::Count); + static_assert(BX_COUNTOF(s_spvOpcodeInfo) == SpvOpcode::Count); const char* s_spvOpcode[] = { @@ -690,7 +686,7 @@ namespace bgfx "ImageSparseRead", "", }; - BX_STATIC_ASSERT(BX_COUNTOF(s_spvOpcode)-1 == SpvOpcode::Count); + static_assert(BX_COUNTOF(s_spvOpcode)-1 == SpvOpcode::Count); const char* getName(SpvOpcode::Enum _opcode) { @@ -804,7 +800,7 @@ namespace bgfx "Alignment", "" }; - BX_STATIC_ASSERT(BX_COUNTOF(s_spvDecoration)-1 == SpvDecoration::Count); + static_assert(BX_COUNTOF(s_spvDecoration)-1 == SpvDecoration::Count); const char* getName(SpvDecoration::Enum _enum) { @@ -835,7 +831,7 @@ namespace bgfx "Image", "" }; - BX_STATIC_ASSERT(BX_COUNTOF(s_spvStorageClass)-1 == SpvStorageClass::Count); + static_assert(BX_COUNTOF(s_spvStorageClass)-1 == SpvStorageClass::Count); const char* getName(SpvStorageClass::Enum _enum) { @@ -891,7 +887,7 @@ namespace bgfx "InstanceIndex", "", }; - BX_STATIC_ASSERT(BX_COUNTOF(s_spvBuiltin)-1 == SpvBuiltin::Count); + static_assert(BX_COUNTOF(s_spvBuiltin)-1 == SpvBuiltin::Count); const char* getName(SpvBuiltin::Enum _enum) { @@ -940,7 +936,7 @@ namespace bgfx if (_instruction.opcode >= SpvOpcode::Count) { - BX_ERROR_SET(_err, BGFX_SHADER_SPIRV_INVALID_INSTRUCTION, "SPIR-V: Invalid instruction."); + BX_ERROR_SET(_err, kShaderInvalidInstruction, "SPIR-V: Invalid instruction."); return size; } @@ -1158,7 +1154,7 @@ namespace bgfx || _spirv.header.magic != SPIRV_MAGIC ) { - BX_ERROR_SET(_err, BGFX_SHADER_SPIRV_INVALID_HEADER, "SPIR-V: Invalid header."); + BX_ERROR_SET(_err, kShaderInvalidHeader, "SPIR-V: Invalid header."); return size; } @@ -1198,7 +1194,7 @@ namespace bgfx , instruction.length , getName(instruction.opcode) ); - BX_ERROR_SET(_err, BGFX_SHADER_SPIRV_INVALID_INSTRUCTION, "SPIR-V: Invalid instruction."); + BX_ERROR_SET(_err, kShaderInvalidInstruction, "SPIR-V: Invalid instruction."); return; } diff --git a/bgfx/src/shader_spirv.h b/bgfx/src/shader_spirv.h index f94422a7..aa2e4f8c 100644 --- a/bgfx/src/shader_spirv.h +++ b/bgfx/src/shader_spirv.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -8,9 +8,6 @@ #include -BX_ERROR_RESULT(BGFX_SHADER_SPIRV_INVALID_HEADER, BX_MAKEFOURCC('S', 'H', 0, 1) ); -BX_ERROR_RESULT(BGFX_SHADER_SPIRV_INVALID_INSTRUCTION, BX_MAKEFOURCC('S', 'H', 0, 2) ); - #define SPV_CHUNK_HEADER BX_MAKEFOURCC(0x03, 0x02, 0x23, 0x07) namespace bgfx diff --git a/bgfx/src/topology.cpp b/bgfx/src/topology.cpp index 69378f4c..77de735d 100644 --- a/bgfx/src/topology.cpp +++ b/bgfx/src/topology.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/topology.h b/bgfx/src/topology.h index e4d5e32a..9730647b 100644 --- a/bgfx/src/topology.h +++ b/bgfx/src/topology.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/version.h b/bgfx/src/version.h index c0d7b974..895b67f6 100644 --- a/bgfx/src/version.h +++ b/bgfx/src/version.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -9,5 +9,5 @@ * */ -#define BGFX_REV_NUMBER 8546 -#define BGFX_REV_SHA1 "878767e751e332309369beecb83e86494f90f8fa" +#define BGFX_REV_NUMBER 8834 +#define BGFX_REV_SHA1 "fe41532c40a6ca6572c8a1c5cb070409bd3640ec" diff --git a/bgfx/src/vertexlayout.cpp b/bgfx/src/vertexlayout.cpp index e43221fa..2ad8a85f 100644 --- a/bgfx/src/vertexlayout.cpp +++ b/bgfx/src/vertexlayout.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -14,15 +14,6 @@ namespace bgfx { - static const uint8_t s_attribTypeSizeD3D9[AttribType::Count][4] = - { - { 4, 4, 4, 4 }, // Uint8 - { 4, 4, 4, 4 }, // Uint10 - { 4, 4, 8, 8 }, // Int16 - { 4, 4, 8, 8 }, // Half - { 4, 8, 12, 16 }, // Float - }; - static const uint8_t s_attribTypeSizeD3D1x[AttribType::Count][4] = { { 1, 2, 4, 4 }, // Uint8 @@ -43,9 +34,8 @@ namespace bgfx static const uint8_t (*s_attribTypeSize[])[AttribType::Count][4] = { - &s_attribTypeSizeD3D9, // Noop + &s_attribTypeSizeD3D1x, // Noop &s_attribTypeSizeD3D1x, // Agc - &s_attribTypeSizeD3D9, // Direct3D9 &s_attribTypeSizeD3D1x, // Direct3D11 &s_attribTypeSizeD3D1x, // Direct3D12 &s_attribTypeSizeD3D1x, // Gnm @@ -54,10 +44,9 @@ namespace bgfx &s_attribTypeSizeGl, // OpenGLES &s_attribTypeSizeGl, // OpenGL &s_attribTypeSizeD3D1x, // Vulkan - &s_attribTypeSizeD3D1x, // WebGPU - &s_attribTypeSizeD3D9, // Count + &s_attribTypeSizeD3D1x, // Count }; - BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeSize) == RendererType::Count+1); + static_assert(BX_COUNTOF(s_attribTypeSize) == RendererType::Count+1); void initAttribTypeSizeTable(RendererType::Enum _type) { @@ -130,7 +119,7 @@ namespace bgfx true, // Half true, // Float }; - BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeIsFloat) == AttribType::Count); + static_assert(BX_COUNTOF(s_attribTypeIsFloat) == AttribType::Count); bool isFloat(AttribType::Enum _type) { @@ -158,7 +147,7 @@ namespace bgfx "T6", "Attrib::TexCoord6", "T7", "Attrib::TexCoord7", }; - BX_STATIC_ASSERT(BX_COUNTOF(s_attrName) == Attrib::Count*2); + static_assert(BX_COUNTOF(s_attrName) == Attrib::Count*2); const char* getAttribNameShort(Attrib::Enum _attr) { @@ -200,7 +189,7 @@ namespace bgfx { Attrib::TexCoord6, 0x0016 }, { Attrib::TexCoord7, 0x0017 }, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_attribToId) == Attrib::Count); + static_assert(BX_COUNTOF(s_attribToId) == Attrib::Count); Attrib::Enum idToAttrib(uint16_t id) { @@ -238,7 +227,7 @@ namespace bgfx { AttribType::Half, 0x0003 }, { AttribType::Float, 0x0004 }, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeToId) == AttribType::Count); + static_assert(BX_COUNTOF(s_attribTypeToId) == AttribType::Count); AttribType::Enum idToAttribType(uint16_t id) { @@ -382,9 +371,9 @@ namespace bgfx { switch (num) { - default: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); BX_FALLTHROUGH; - case 3: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); BX_FALLTHROUGH; - case 2: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); BX_FALLTHROUGH; + default: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); [[fallthrough]]; + case 3: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); [[fallthrough]]; + case 2: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); [[fallthrough]]; case 1: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); } } @@ -392,9 +381,9 @@ namespace bgfx { switch (num) { - default: *packed++ = uint8_t(*_input++ * 255.0f); BX_FALLTHROUGH; - case 3: *packed++ = uint8_t(*_input++ * 255.0f); BX_FALLTHROUGH; - case 2: *packed++ = uint8_t(*_input++ * 255.0f); BX_FALLTHROUGH; + default: *packed++ = uint8_t(*_input++ * 255.0f); [[fallthrough]]; + case 3: *packed++ = uint8_t(*_input++ * 255.0f); [[fallthrough]]; + case 2: *packed++ = uint8_t(*_input++ * 255.0f); [[fallthrough]]; case 1: *packed++ = uint8_t(*_input++ * 255.0f); } } @@ -403,9 +392,9 @@ namespace bgfx { switch (num) { - default: *packed++ = uint8_t(*_input++); BX_FALLTHROUGH; - case 3: *packed++ = uint8_t(*_input++); BX_FALLTHROUGH; - case 2: *packed++ = uint8_t(*_input++); BX_FALLTHROUGH; + default: *packed++ = uint8_t(*_input++); [[fallthrough]]; + case 3: *packed++ = uint8_t(*_input++); [[fallthrough]]; + case 2: *packed++ = uint8_t(*_input++); [[fallthrough]]; case 1: *packed++ = uint8_t(*_input++); } } @@ -421,9 +410,9 @@ namespace bgfx { switch (num) { - default: BX_FALLTHROUGH; - case 3: packed |= uint32_t(*_input++ * 511.0f + 512.0f); BX_FALLTHROUGH; - case 2: packed <<= 10; packed |= uint32_t(*_input++ * 511.0f + 512.0f); BX_FALLTHROUGH; + default: [[fallthrough]]; + case 3: packed |= uint32_t(*_input++ * 511.0f + 512.0f); [[fallthrough]]; + case 2: packed <<= 10; packed |= uint32_t(*_input++ * 511.0f + 512.0f); [[fallthrough]]; case 1: packed <<= 10; packed |= uint32_t(*_input++ * 511.0f + 512.0f); } } @@ -431,9 +420,9 @@ namespace bgfx { switch (num) { - default: BX_FALLTHROUGH; - case 3: packed |= uint32_t(*_input++ * 1023.0f); BX_FALLTHROUGH; - case 2: packed <<= 10; packed |= uint32_t(*_input++ * 1023.0f); BX_FALLTHROUGH; + default: [[fallthrough]]; + case 3: packed |= uint32_t(*_input++ * 1023.0f); [[fallthrough]]; + case 2: packed <<= 10; packed |= uint32_t(*_input++ * 1023.0f); [[fallthrough]]; case 1: packed <<= 10; packed |= uint32_t(*_input++ * 1023.0f); } } @@ -442,9 +431,9 @@ namespace bgfx { switch (num) { - default: BX_FALLTHROUGH; - case 3: packed |= uint32_t(*_input++); BX_FALLTHROUGH; - case 2: packed <<= 10; packed |= uint32_t(*_input++); BX_FALLTHROUGH; + default: [[fallthrough]]; + case 3: packed |= uint32_t(*_input++); [[fallthrough]]; + case 2: packed <<= 10; packed |= uint32_t(*_input++); [[fallthrough]]; case 1: packed <<= 10; packed |= uint32_t(*_input++); } } @@ -461,9 +450,9 @@ namespace bgfx { switch (num) { - default: *packed++ = int16_t(*_input++ * 32767.0f); BX_FALLTHROUGH; - case 3: *packed++ = int16_t(*_input++ * 32767.0f); BX_FALLTHROUGH; - case 2: *packed++ = int16_t(*_input++ * 32767.0f); BX_FALLTHROUGH; + default: *packed++ = int16_t(*_input++ * 32767.0f); [[fallthrough]]; + case 3: *packed++ = int16_t(*_input++ * 32767.0f); [[fallthrough]]; + case 2: *packed++ = int16_t(*_input++ * 32767.0f); [[fallthrough]]; case 1: *packed++ = int16_t(*_input++ * 32767.0f); } } @@ -471,9 +460,9 @@ namespace bgfx { switch (num) { - default: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); BX_FALLTHROUGH; - case 3: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); BX_FALLTHROUGH; - case 2: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); BX_FALLTHROUGH; + default: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); [[fallthrough]]; + case 3: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); [[fallthrough]]; + case 2: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); [[fallthrough]]; case 1: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); } } @@ -482,9 +471,9 @@ namespace bgfx { switch (num) { - default: *packed++ = int16_t(*_input++); BX_FALLTHROUGH; - case 3: *packed++ = int16_t(*_input++); BX_FALLTHROUGH; - case 2: *packed++ = int16_t(*_input++); BX_FALLTHROUGH; + default: *packed++ = int16_t(*_input++); [[fallthrough]]; + case 3: *packed++ = int16_t(*_input++); [[fallthrough]]; + case 2: *packed++ = int16_t(*_input++); [[fallthrough]]; case 1: *packed++ = int16_t(*_input++); } } @@ -496,9 +485,9 @@ namespace bgfx uint16_t* packed = (uint16_t*)data; switch (num) { - default: *packed++ = bx::halfFromFloat(*_input++); BX_FALLTHROUGH; - case 3: *packed++ = bx::halfFromFloat(*_input++); BX_FALLTHROUGH; - case 2: *packed++ = bx::halfFromFloat(*_input++); BX_FALLTHROUGH; + default: *packed++ = bx::halfFromFloat(*_input++); [[fallthrough]]; + case 3: *packed++ = bx::halfFromFloat(*_input++); [[fallthrough]]; + case 2: *packed++ = bx::halfFromFloat(*_input++); [[fallthrough]]; case 1: *packed++ = bx::halfFromFloat(*_input++); } } @@ -537,9 +526,9 @@ namespace bgfx { switch (num) { - default: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; BX_FALLTHROUGH; - case 3: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; BX_FALLTHROUGH; - case 2: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; BX_FALLTHROUGH; + default: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; [[fallthrough]]; + case 3: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; [[fallthrough]]; + case 2: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; [[fallthrough]]; case 1: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; } } @@ -547,9 +536,9 @@ namespace bgfx { switch (num) { - default: *_output++ = float(*packed++)*1.0f/255.0f; BX_FALLTHROUGH; - case 3: *_output++ = float(*packed++)*1.0f/255.0f; BX_FALLTHROUGH; - case 2: *_output++ = float(*packed++)*1.0f/255.0f; BX_FALLTHROUGH; + default: *_output++ = float(*packed++)*1.0f/255.0f; [[fallthrough]]; + case 3: *_output++ = float(*packed++)*1.0f/255.0f; [[fallthrough]]; + case 2: *_output++ = float(*packed++)*1.0f/255.0f; [[fallthrough]]; case 1: *_output++ = float(*packed++)*1.0f/255.0f; } } @@ -563,9 +552,9 @@ namespace bgfx { switch (num) { - default: BX_FALLTHROUGH; - case 3: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10; BX_FALLTHROUGH; - case 2: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10; BX_FALLTHROUGH; + default: [[fallthrough]]; + case 3: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10; [[fallthrough]]; + case 2: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10; [[fallthrough]]; case 1: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; } } @@ -573,9 +562,9 @@ namespace bgfx { switch (num) { - default: BX_FALLTHROUGH; - case 3: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10; BX_FALLTHROUGH; - case 2: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10; BX_FALLTHROUGH; + default: [[fallthrough]]; + case 3: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10; [[fallthrough]]; + case 2: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10; [[fallthrough]]; case 1: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; } } @@ -589,9 +578,9 @@ namespace bgfx { switch (num) { - default: *_output++ = float(*packed++)*1.0f/32767.0f; BX_FALLTHROUGH; - case 3: *_output++ = float(*packed++)*1.0f/32767.0f; BX_FALLTHROUGH; - case 2: *_output++ = float(*packed++)*1.0f/32767.0f; BX_FALLTHROUGH; + default: *_output++ = float(*packed++)*1.0f/32767.0f; [[fallthrough]]; + case 3: *_output++ = float(*packed++)*1.0f/32767.0f; [[fallthrough]]; + case 2: *_output++ = float(*packed++)*1.0f/32767.0f; [[fallthrough]]; case 1: *_output++ = float(*packed++)*1.0f/32767.0f; } } @@ -599,9 +588,9 @@ namespace bgfx { switch (num) { - default: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; BX_FALLTHROUGH; - case 3: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; BX_FALLTHROUGH; - case 2: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; BX_FALLTHROUGH; + default: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; [[fallthrough]]; + case 3: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; [[fallthrough]]; + case 2: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; [[fallthrough]]; case 1: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; } } @@ -613,9 +602,9 @@ namespace bgfx uint16_t* packed = (uint16_t*)data; switch (num) { - default: *_output++ = bx::halfToFloat(*packed++); BX_FALLTHROUGH; - case 3: *_output++ = bx::halfToFloat(*packed++); BX_FALLTHROUGH; - case 2: *_output++ = bx::halfToFloat(*packed++); BX_FALLTHROUGH; + default: *_output++ = bx::halfToFloat(*packed++); [[fallthrough]]; + case 3: *_output++ = bx::halfToFloat(*packed++); [[fallthrough]]; + case 2: *_output++ = bx::halfToFloat(*packed++); [[fallthrough]]; case 1: *_output++ = bx::halfToFloat(*packed++); } } @@ -629,9 +618,9 @@ namespace bgfx switch (num) { - case 1: *_output++ = 0.0f; BX_FALLTHROUGH; - case 2: *_output++ = 0.0f; BX_FALLTHROUGH; - case 3: *_output++ = 0.0f; BX_FALLTHROUGH; + case 1: *_output++ = 0.0f; [[fallthrough]]; + case 2: *_output++ = 0.0f; [[fallthrough]]; + case 3: *_output++ = 0.0f; [[fallthrough]]; default: break; } } diff --git a/bgfx/src/vertexlayout.h b/bgfx/src/vertexlayout.h index 74c90983..3305d0fa 100644 --- a/bgfx/src/vertexlayout.h +++ b/bgfx/src/vertexlayout.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/vs_clear.bin.h b/bgfx/src/vs_clear.bin.h index 7c0d7254..38a7151d 100644 --- a/bgfx/src/vs_clear.bin.h +++ b/bgfx/src/vs_clear.bin.h @@ -41,8 +41,8 @@ static const uint8_t vs_clear_spv[835] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // VSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x74, 0x68, 0x02, // gfx_clear_depth. - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........M...... + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# + 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........M...... 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, // ................ @@ -93,27 +93,6 @@ static const uint8_t vs_clear_spv[835] = 0x00, 0x4c, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, // .L.......8...... 0x00, 0x10, 0x00, // ... }; -static const uint8_t vs_clear_dx9[274] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // VSH............b - 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x74, 0x68, 0x02, // gfx_clear_depth. - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, // ................ - 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // ...".CTAB....[.. - 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................ - 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .T...0.......... - 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, // .D.......bgfx_cl - 0x65, 0x61, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x74, 0x68, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, // ear_depth....... - 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, // .............vs_ - 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, // 3_0.Microsoft (R - 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, // ) HLSL Shader Co - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, // mpiler 10.1..Q.. - 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........?....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, // ................ - 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x04, 0x00, 0x00, // ................ - 0x04, 0x00, 0x00, 0x0b, 0xe0, 0x00, 0x00, 0x24, 0x90, 0x01, 0x00, 0x60, 0xa0, 0x01, 0x00, 0x25, // .......$...`...% - 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0xa0, 0xff, 0xff, 0x00, // ................ - 0x00, 0x00, // .. -}; static const uint8_t vs_clear_dx11[327] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // VSH............b @@ -138,11 +117,11 @@ static const uint8_t vs_clear_dx11[327] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, // ......@.....?>.. 0x01, 0x00, 0x01, 0x01, 0x00, 0x10, 0x00, // ....... }; -static const uint8_t vs_clear_mtl[545] = +static const uint8_t vs_clear_mtl[593] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, // VSH............b 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x74, 0x68, 0x02, // gfx_clear_depth. - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x01, 0x00, 0x00, 0x23, 0x69, 0x6e, // .............#in + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, // .............#in 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, // clude .#include ..usi @@ -152,6 +131,9 @@ static const uint8_t vs_clear_mtl[545] = 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x74, // bgfx_clear_dept 0x68, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // h;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // float4 gl_Po 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // sition [[positio 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, // n]];.};..struct diff --git a/bgfx/src/vs_clear.sc b/bgfx/src/vs_clear.sc index 0ffc7368..03da05ca 100644 --- a/bgfx/src/vs_clear.sc +++ b/bgfx/src/vs_clear.sc @@ -1,7 +1,7 @@ $input a_position /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/src/vs_debugfont.bin.h b/bgfx/src/vs_debugfont.bin.h index 461f0360..08510cd6 100644 --- a/bgfx/src/vs_debugfont.bin.h +++ b/bgfx/src/vs_debugfont.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_debugfont_glsl[457] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, // VSH......."f...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color1;.at @@ -34,7 +34,7 @@ static const uint8_t vs_debugfont_essl[511] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, // VSH......."f...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // bute highp vec4 @@ -68,9 +68,9 @@ static const uint8_t vs_debugfont_essl[511] = static const uint8_t vs_debugfont_spv[1428] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, // VSH......."f...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0d, 0x00, // ................ @@ -158,34 +158,6 @@ static const uint8_t vs_debugfont_spv[1428] = 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x04, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, // ....8........... 0x10, 0x00, 0x40, 0x00, // ..@. }; -static const uint8_t vs_debugfont_dx9[393] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, // VSH......."f...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ................ - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, // ................ - 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0xe0, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x01, 0x80, 0x02, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x05, 0x00, 0x00, 0x80, 0x03, 0x00, 0x03, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ................ - 0x01, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ......U......... - 0x00, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, // ................ - 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, // ................ - 0x02, 0x00, 0x0f, 0xe0, 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x03, 0x00, 0x03, 0xe0, // ................ - 0x03, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......... -}; static const uint8_t vs_debugfont_dx11[724] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, // VSH......."f...u @@ -235,11 +207,11 @@ static const uint8_t vs_debugfont_dx11[724] = 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x04, 0x05, 0x00, 0x06, 0x00, 0x01, 0x00, // ....>........... 0x10, 0x00, 0x40, 0x00, // ..@. }; -static const uint8_t vs_debugfont_mtl[987] = +static const uint8_t vs_debugfont_mtl[1035] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, // VSH......."f...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -249,6 +221,9 @@ static const uint8_t vs_debugfont_mtl[987] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/src/vs_debugfont.sc b/bgfx/src/vs_debugfont.sc index 7737cab4..a8c4fa48 100644 --- a/bgfx/src/vs_debugfont.sc +++ b/bgfx/src/vs_debugfont.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, a_color1, a_texcoord0 $output v_color0, v_color1, v_texcoord0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/geometryc/geometryc.cpp b/bgfx/tools/geometryc/geometryc.cpp index 96a39ca0..8f548cae 100644 --- a/bgfx/tools/geometryc/geometryc.cpp +++ b/bgfx/tools/geometryc/geometryc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -653,7 +653,7 @@ void parseObj(char* _data, uint32_t _size, Mesh* _mesh, bool _hasBc) { case 4: bx::fromString(&texcoord.z, argv[3]); - BX_FALLTHROUGH; + [[fallthrough]]; case 3: bx::fromString(&texcoord.y, argv[2]); @@ -925,7 +925,7 @@ void help(const char* _error = NULL) bx::printf( "geometryc, bgfx geometry compiler tool, version %d.%d.%d.\n" - "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2024 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n\n" , BGFX_GEOMETRYC_VERSION_MAJOR , BGFX_GEOMETRYC_VERSION_MINOR diff --git a/bgfx/tools/geometryv/fs_mesh.bin.h b/bgfx/tools/geometryv/fs_mesh.bin.h index 6bf1cfdf..6ec0f483 100644 --- a/bgfx/tools/geometryv/fs_mesh.bin.h +++ b/bgfx/tools/geometryv/fs_mesh.bin.h @@ -133,225 +133,175 @@ static const uint8_t fs_mesh_essl[1029] = 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, // agColor.w = 1.0; 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... }; -static const uint8_t fs_mesh_spv[2642] = +static const uint8_t fs_mesh_spv[2566] = { - 0x46, 0x53, 0x48, 0x0b, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x0a, // FSH....e......<. - 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x23, 0x02, // ....#.........#. + 0x46, 0x53, 0x48, 0x0b, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x09, // FSH....e........ + 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x34, 0x02, // ....#.........4. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // ................ 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, // ......GLSL.std.4 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // 50.............. - 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma - 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x29, 0x01, // in............). - 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, // ................ - 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x1a, 0x01, // ..main.......... - 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, // ..gl_FragCoord.. - 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // ..........v_norm - 0x61, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x29, 0x01, 0x00, 0x00, 0x62, 0x67, // al........)...bg - 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, // fx_FragData0..G. - 0x04, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. - 0x04, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. - 0x04, 0x00, 0x29, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, // ..)............. - 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... - 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, // .......... ..... - 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ - 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x14, 0xb1, 0xc4, 0xbe, 0x2b, 0x00, // ......8.......+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0xfb, 0xd3, 0xd8, 0xbe, 0x2b, 0x00, // ......9.......+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x6d, 0xdf, 0xd9, 0xbe, 0x2c, 0x00, // ......:...m...,. - 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x39, 0x00, // ......;...8...9. - 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..:...+.......>. - 0x00, 0x00, 0x00, 0xfe, 0x64, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3f, 0x00, // ....d=+.......?. - 0x00, 0x00, 0x2c, 0xf2, 0x67, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x40, 0x00, // ..,.g=+.......@. - 0x00, 0x00, 0x66, 0x4c, 0x8f, 0x3d, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x41, 0x00, // ..fL.=,.......A. - 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..>...?...@...+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x11, 0xc7, 0xf7, 0x3d, 0x2b, 0x00, // ......D......=+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x82, 0x52, 0xf4, 0x3d, 0x2b, 0x00, // ......E....R.=+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x66, 0xd8, 0xef, 0x3d, 0x2c, 0x00, // ......F...f..=,. - 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x45, 0x00, // ......G...D...E. - 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4a, 0x00, // ..F...+.......J. - 0x00, 0x00, 0xe5, 0xf3, 0x34, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4b, 0x00, // ....4.+.......K. - 0x00, 0x00, 0x5b, 0x6b, 0x2e, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4c, 0x00, // ..[k..+.......L. - 0x00, 0x00, 0x30, 0xfa, 0x1a, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4d, 0x00, // ..0...,.......M. - 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..J...K...L...+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x56, 0x59, 0xff, 0xbd, 0x2b, 0x00, // ......P...VY..+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0xf1, 0x68, 0xf4, 0xbd, 0x2b, 0x00, // ......Q....h..+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x1f, 0x39, 0xc5, 0xbd, 0x2c, 0x00, // ......R....9..,. - 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x51, 0x00, // ......S...P...Q. - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x56, 0x00, // ..R...+.......V. - 0x00, 0x00, 0x83, 0xcb, 0xf2, 0x3a, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x57, 0x00, // .....:+.......W. - 0x00, 0x00, 0x03, 0x80, 0x05, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x58, 0x00, // ......+.......X. - 0x00, 0x00, 0x8f, 0xa4, 0xb4, 0xbd, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x59, 0x00, // ......,.......Y. - 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..V...W...X...+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x37, 0xbd, 0x97, 0x3e, 0x2b, 0x00, // ..........7..>+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x73, 0x02, 0x90, 0x3e, 0x2b, 0x00, // ......]...s..>+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x09, 0x2b, 0x79, 0x3e, 0x2c, 0x00, // ......^....+y>,. - 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5d, 0x00, // ......_.......]. - 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x62, 0x00, // ..^...+.......b. - 0x00, 0x00, 0x2a, 0x7c, 0xa3, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x63, 0x00, // ..*|..+.......c. - 0x00, 0x00, 0x27, 0xee, 0xdf, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64, 0x00, // ..'...+.......d. - 0x00, 0x00, 0x5c, 0xfb, 0x20, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x65, 0x00, // .... .,.......e. - 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..b...c...d...+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x1c, 0x2a, 0xfa, 0xbe, 0x2b, 0x00, // ......o....*..+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x1c, 0x2a, 0xfa, 0x3e, 0x2b, 0x00, // ......u....*.>+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa1, 0xd8, 0x8b, 0x3f, 0x2b, 0x00, // .............?+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xa1, 0xd8, 0x8b, 0xbf, 0x2b, 0x00, // ..............+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x01, 0x7b, 0xa1, 0x3e, 0x2b, 0x00, // ...........{.>+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x2b, 0x00, // ............@@+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, // .............?+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa1, 0xd8, 0x0b, 0x3f, 0x2b, 0x00, // .............?+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, // .............@+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x00, // .............? . - 0x04, 0x00, 0x19, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x19, 0x01, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. - 0x04, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . - 0x04, 0x00, 0x28, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..(...........;. - 0x04, 0x00, 0x28, 0x01, 0x00, 0x00, 0x29, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..(...).......+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0x8e, 0xc6, 0x8b, 0x3e, 0x2b, 0x00, // .............>+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x6b, 0x0a, 0x8d, 0x3e, 0x2b, 0x00, // ..........k..>+. - 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1d, 0x02, 0x00, 0x00, 0x8e, 0xb8, 0x80, 0x3e, 0x2c, 0x00, // .............>,. - 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0x1c, 0x02, // ................ - 0x00, 0x00, 0x1d, 0x02, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x02, // ......+....... . - 0x00, 0x00, 0xcd, 0xcc, 0xcc, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0x02, // .....>,.......!. - 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x01, 0x00, // .. ... ... ..... - 0x03, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, // ......"...6..... - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, // ................ - 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1f, 0x01, // ......=......... - 0x00, 0x00, 0x1e, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x47, 0x01, // ..............G. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x1f, 0x01, 0x00, 0x00, 0x51, 0x00, // ......E.......Q. - 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x00, 0x00, // ......h...G..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x6f, 0x00, // ..........i...o. - 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6c, 0x01, // ..h...Q.......l. - 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..G............. - 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x51, 0x00, // ..m...u...l...Q. - 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x02, 0x00, // ......p...G..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x6f, 0x00, // ..........q...o. - 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x01, // ..p...Q.......t. - 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..G............. - 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x74, 0x01, 0x00, 0x00, 0x51, 0x00, // ..u.......t...Q. - 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x77, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x02, 0x00, // ......w...G..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x75, 0x01, // ..........x...u. - 0x00, 0x00, 0x77, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7b, 0x01, // ..w...Q.......{. - 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..G............. - 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x51, 0x00, // ..|.......{...Q. - 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x01, 0x00, // ......~...G..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x7c, 0x01, // ..............|. - 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x82, 0x01, // ..~...Q......... - 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..G............. - 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. - 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........G..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0x83, 0x01, // ................ - 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x87, 0x01, // ................ - 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ................ - 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. - 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x02, 0x00, // ..........G..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x88, 0x00, // ................ - 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8e, 0x01, // ......Q......... - 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..G............. - 0x00, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x8e, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. - 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x92, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x02, 0x00, // ..........G..... - 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x47, 0x01, // ..Q...........G. - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x95, 0x01, // ................ - 0x00, 0x00, 0x92, 0x01, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, // ..........Q..... - 0x00, 0x00, 0x97, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, // ......G.......Q. - 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x99, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x00, 0x00, // ..........G..... - 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0x97, 0x01, // ................ - 0x00, 0x00, 0x99, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9b, 0x01, // ................ - 0x00, 0x00, 0x95, 0x01, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ................ - 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ - 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x69, 0x01, // ..........;...i. - 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0xab, 0x01, // ................ - 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xae, 0x01, // ................ - 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ......!......... - 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ - 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x6d, 0x01, // ..........A...m. - 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0xb5, 0x01, // ................ - 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xb8, 0x01, // ................ - 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ......!......... - 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ - 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x71, 0x01, // ..........G...q. - 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xbf, 0x01, // ................ - 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc2, 0x01, // ................ - 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ......!......... - 0x00, 0x00, 0xc4, 0x01, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ - 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x78, 0x01, // ..........M...x. - 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xca, 0x01, 0x00, 0x00, 0xc9, 0x01, // ................ - 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xcc, 0x01, // ................ - 0x00, 0x00, 0xca, 0x01, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ......!......... - 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0xc4, 0x01, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ - 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x7f, 0x01, // ..........S..... - 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0xd3, 0x01, // ................ - 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xd6, 0x01, // ................ - 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ - 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x8e, 0x00, // ......Y......... - 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xec, 0x00, // ................ - 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0xd6, 0x01, // ................ - 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xe3, 0x01, // ................ - 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, // .._............. - 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x81, 0x00, // ................ - 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0xe4, 0x01, // ................ - 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0x65, 0x00, // ..............e. - 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xec, 0x01, // ................ - 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ - 0x00, 0x00, 0xee, 0x01, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..............O. - 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0xee, 0x01, // ......K..."..... - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x98, 0x00, // ..R............. - 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x29, 0x01, // ..K.......>...). - 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..........8..... - 0x00, 0x00, // .. -}; -static const uint8_t fs_mesh_dx9[663] = -{ - 0x46, 0x53, 0x48, 0x0b, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x02, // FSH....e........ - 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x14, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ..........CTAB.. - 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..#............. - 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, // ..........ps_3_0 - 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, // .Microsoft (R) H - 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, // LSL Shader Compi - 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x00, 0x00, // ler 10.1..Q..... - 0x0f, 0xa0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // ....@@.......?.. - 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x8e, 0xc6, 0x8b, 0x3e, 0x6b, 0x0a, // ..Q..........>k. - 0x8d, 0x3e, 0x8e, 0xb8, 0x80, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, // .>...>....Q..... - 0x0f, 0xa0, 0x3a, 0xc4, 0x19, 0x3e, 0x25, 0x82, 0x29, 0x3e, 0x39, 0x53, 0x2a, 0x3e, 0x00, 0x00, // ..:..>%.)>9S*>.. - 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0x92, 0x04, 0xb3, 0x3c, 0xb8, 0x53, // ..Q..........<.S - 0xb5, 0x3c, 0x16, 0x0d, 0xe0, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x04, 0x00, // .<...<....Q..... - 0x0f, 0xa0, 0x20, 0xb4, 0x41, 0xbd, 0x9c, 0x00, 0x3f, 0xbd, 0xa0, 0x80, 0x3b, 0xbd, 0x00, 0x00, // .. .A...?...;... - 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x05, 0x00, 0x0f, 0xa0, 0xe2, 0x28, 0x9e, 0xbd, 0x04, 0x73, // ..Q........(...s - 0x98, 0xbd, 0xc8, 0x74, 0x87, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x06, 0x00, // ...t......Q..... - 0x0f, 0xa0, 0x96, 0x7d, 0x8b, 0x3d, 0xcd, 0x83, 0x85, 0x3d, 0xd0, 0x79, 0x57, 0x3d, 0x00, 0x00, // ...}.=...=.yW=.. - 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x07, 0x00, 0x0f, 0xa0, 0xa6, 0x26, 0x99, 0x39, 0x4e, 0x6b, // ..Q........&.9Nk - 0xa8, 0xbb, 0x93, 0xe4, 0x63, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x08, 0x00, // ....c.....Q..... - 0x0f, 0xa0, 0x48, 0xc8, 0x25, 0xbe, 0x62, 0x56, 0x1d, 0xbe, 0x37, 0x1d, 0x08, 0xbe, 0x00, 0x00, // ..H.%.bV..7..... - 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x09, 0x00, 0x0f, 0xa0, 0x85, 0x9d, 0xb2, 0xbc, 0x9a, 0xa7, // ..Q............. - 0xf4, 0xbc, 0x69, 0xe1, 0x2f, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, // ..i./........... - 0x00, 0x80, 0x00, 0x00, 0x07, 0x90, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................ - 0xe4, 0x90, 0x00, 0x00, 0xe4, 0x90, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................ - 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0x90, 0x90, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x04, 0x00, // ................ - 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, // ........U....... - 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x03, 0x00, // ................ - 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, // ................ - 0xff, 0x80, 0x04, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, // ................ - 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xab, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, // ................ - 0x07, 0x80, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, // ................ - 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0x55, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ........U....... - 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x00, 0x00, // ................ - 0x00, 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, // ....U........... - 0x00, 0x80, 0x07, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, // ................ - 0x07, 0x80, 0x02, 0x00, 0xff, 0x80, 0x08, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x55, 0x80, 0x04, 0x00, // ........U...U... - 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, // ................ - 0x00, 0x81, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0x00, 0x80, 0x09, 0x00, // ................ - 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, // ................ - 0xaa, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ....... + 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x10, 0x00, // in...."...-..... + 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x22, 0x01, 0x00, 0x00, 0x76, 0x5f, // in........"...v_ + 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x2d, 0x01, // normal........-. + 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, // ..bgfx_FragData0 + 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x22, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G..."......... + 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..G...-......... + 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, // ..........!..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x14, 0xb1, // ..+.......8..... + 0xc4, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0xfb, 0xd3, // ..+.......9..... + 0xd8, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x6d, 0xdf, // ..+.......:...m. + 0xd9, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x38, 0x00, // ..,.......;...8. + 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..9...:...+..... + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x64, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..>.....d=+..... + 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x2c, 0xf2, 0x67, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..?...,.g=+..... + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x66, 0x4c, 0x8f, 0x3d, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, // ..@...fL.=,..... + 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, // ..A...>...?...@. + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x11, 0xc7, // ..+.......D..... + 0xf7, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x82, 0x52, // .=+.......E....R + 0xf4, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x66, 0xd8, // .=+.......F...f. + 0xef, 0x3d, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x44, 0x00, // .=,.......G...D. + 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..E...F...+..... + 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0xe5, 0xf3, 0x34, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..J.....4.+..... + 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x5b, 0x6b, 0x2e, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..K...[k..+..... + 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0xfa, 0x1a, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, // ..L...0...,..... + 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x4c, 0x00, // ..M...J...K...L. + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x56, 0x59, // ..+.......P...VY + 0xff, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0xf1, 0x68, // ..+.......Q....h + 0xf4, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x1f, 0x39, // ..+.......R....9 + 0xc5, 0xbd, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x50, 0x00, // ..,.......S...P. + 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..Q...R...+..... + 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x83, 0xcb, 0xf2, 0x3a, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..V......:+..... + 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x03, 0x80, 0x05, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..W.......+..... + 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x8f, 0xa4, 0xb4, 0xbd, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, // ..X.......,..... + 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x58, 0x00, // ..Y...V...W...X. + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x37, 0xbd, // ..+...........7. + 0x97, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x73, 0x02, // .>+.......]...s. + 0x90, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x09, 0x2b, // .>+.......^....+ + 0x79, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x5c, 0x00, // y>,......._..... + 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..]...^...+..... + 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x2a, 0x7c, 0xa3, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..b...*|..+..... + 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x27, 0xee, 0xdf, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..c...'...+..... + 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x5c, 0xfb, 0x20, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, // ..d..... .,..... + 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x64, 0x00, // ..e...b...c...d. + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x1c, 0x2a, // ..+.......o....* + 0xfa, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x1c, 0x2a, // ..+.......u....* + 0xfa, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xa1, 0xd8, // .>+............. + 0x8b, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xa1, 0xd8, // .?+............. + 0x8b, 0xbf, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x01, 0x7b, // ..+............{ + 0xa1, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, // .>+............. + 0x40, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, // @@+............. + 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa1, 0xd8, // .?+............. + 0x0b, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, // .?+............. + 0x00, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, 0x00, // .@+............. + 0x00, 0x3f, 0x20, 0x00, 0x04, 0x00, 0x21, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // .? ...!......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x21, 0x01, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x01, 0x00, // ..;...!..."..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, // .. ...,......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x03, 0x00, // ..;...,...-..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2b, 0x02, 0x00, 0x00, 0x8e, 0xc6, // ..+.......+..... + 0x8b, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x6b, 0x0a, // .>+.......,...k. + 0x8d, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2d, 0x02, 0x00, 0x00, 0x8e, 0xb8, // .>+.......-..... + 0x80, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x2b, 0x02, // .>,...........+. + 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x2d, 0x02, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, // ..,...-...+..... + 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0xcd, 0xcc, 0xcc, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, // ..0......>,..... + 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x30, 0x02, // ..1...0...0...0. + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0x00, 0x00, // ..+.......3..... + 0x80, 0xbf, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // ..6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0x01, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x0c, 0x00, // ......#..."..... + 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, // ......K.......E. + 0x00, 0x00, 0x23, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x70, 0x01, // ..#...Q.......p. + 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..K............. + 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x51, 0x00, // ..q...o...p...Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x01, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x01, 0x00, // ......t...K..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x75, 0x00, // ..........u...u. + 0x00, 0x00, 0x74, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x78, 0x01, // ..t...Q.......x. + 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..K............. + 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x51, 0x00, // ..y...o...x...Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x00, 0x00, // ......|...K..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x80, 0x00, // ..........}..... + 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7f, 0x01, // ..|...Q......... + 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..K............. + 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x51, 0x00, // ......}.......Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x00, 0x00, // ..........K..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x88, 0x00, // ................ + 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x86, 0x01, // ......Q......... + 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..K............. + 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x01, 0x00, // ..........K..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8b, 0x01, 0x00, 0x00, 0x91, 0x00, // ................ + 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8d, 0x01, // ......Q......... + 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x06, 0x00, // ..K............. + 0x00, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x8b, 0x01, // ..........2..... + 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ......3......... + 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x93, 0x01, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x02, 0x00, // ..........K..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x88, 0x00, // ................ + 0x00, 0x00, 0x93, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x96, 0x01, // ......Q......... + 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..K............. + 0x00, 0x00, 0x97, 0x01, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x96, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x02, 0x00, // ..........K..... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x4b, 0x01, // ..Q...........K. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9f, 0x01, // ......Q......... + 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, // ..K.......Q..... + 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, // ......K......... + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0xa1, 0x01, // ................ + 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x29, 0x02, 0x00, 0x00, 0xa2, 0x01, // ..........)..... + 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x29, 0x02, // ..2...........). + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0xa3, 0x00, // ................ + 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xb3, 0x01, // ................ + 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, // ..;...q......... + 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x0c, 0x00, // ................ + 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x8e, 0x00, // ......1......... + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x75, 0x01, // ..........A...u. + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0xbd, 0x01, // ................ + 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc2, 0x01, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0x31, 0x02, // ......2.......1. + 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc7, 0x01, // ................ + 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, // ..G...y......... + 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x0c, 0x00, // ................ + 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x8e, 0x00, // ......1......... + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x80, 0x01, // ..........M..... + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0xd1, 0x01, // ................ + 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0xd6, 0x01, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x31, 0x02, // ......2.......1. + 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xdb, 0x01, // ................ + 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, // ..S............. + 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x81, 0x00, // ................ + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0xdc, 0x01, // ................ + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0x59, 0x00, // ..............Y. + 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xe4, 0x01, // ................ + 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ + 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x97, 0x01, // .........._..... + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0xeb, 0x01, // ................ + 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xee, 0x01, // ................ + 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ + 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x8e, 0x00, // ......e......... + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, 0xec, 0x00, // ................ + 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xee, 0x01, // ................ + 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4f, 0x01, // ......Q.......O. + 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, // ..........Q..... + 0x00, 0x00, 0x51, 0x01, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, // ..Q...........Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x53, 0x01, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0x02, 0x00, // ......S......... + 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, 0x4f, 0x01, // ..P.......2...O. + 0x00, 0x00, 0x51, 0x01, 0x00, 0x00, 0x53, 0x01, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..Q...S.......>. + 0x03, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..-...2.......8. + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... }; -static const uint8_t fs_mesh_dx11[878] = +static const uint8_t fs_mesh_dx11[882] = { - 0x46, 0x53, 0x48, 0x0b, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x03, // FSH....e......X. - 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x44, 0x44, 0xd1, 0x1e, 0x9d, 0xd3, 0x3f, 0xa4, 0x1f, 0x99, // ..DXBCDD....?... - 0x9d, 0x06, 0x1d, 0x10, 0x35, 0xc7, 0x01, 0x00, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0x03, 0x00, // ....5.....X..... + 0x46, 0x53, 0x48, 0x0b, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x03, // FSH....e........ + 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x15, 0x86, 0xf4, 0xff, 0x46, 0x5a, 0xea, 0x4b, 0x79, 0xb0, // ..DXBC....FZ.Ky. + 0xc8, 0xc2, 0xb2, 0x75, 0xb4, 0x10, 0x01, 0x00, 0x00, 0x00, 0x5c, 0x03, 0x00, 0x00, 0x03, 0x00, // ...u............ 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNL...........8. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ @@ -361,165 +311,178 @@ static const uint8_t fs_mesh_dx11[878] = 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,......... 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. ............. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR - 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x9c, 0x02, 0x00, 0x00, 0x40, 0x00, // GET...SHDR....@. - 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, // ......b...r..... - 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e.... ......h. - 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, // ..F.......F..... - 0x00, 0x00, 0x44, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..D............. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... - 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x01, 0x00, // ................ - 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, // ..2...r.......V. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3a, 0xc4, 0x19, 0x3e, 0x25, 0x82, // .......@..:..>%. - 0x29, 0x3e, 0x39, 0x53, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x8e, 0xc6, // )>9S*>.....@.... - 0x8b, 0x3e, 0x6b, 0x0a, 0x8d, 0x3e, 0x8e, 0xb8, 0x80, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // .>k..>...>....2. - 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, // ..r............. - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x92, 0x04, 0xb3, 0x3c, 0xb8, 0x53, 0xb5, 0x3c, 0x16, 0x0d, // ...@.....<.S.<.. - 0xe0, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // .<....F.......2. - 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, // ..r............. - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x20, 0xb4, 0x41, 0xbd, 0x9c, 0x00, 0x3f, 0xbd, 0xa0, 0x80, // ...@.. .A...?... - 0x3b, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, // ;.....F.......8. - 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ..........F..... - 0x00, 0x00, 0xb6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, // ..........2...r. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, // ...............@ - 0x00, 0x00, 0xe2, 0x28, 0x9e, 0xbd, 0x04, 0x73, 0x98, 0xbd, 0xc8, 0x74, 0x87, 0xbd, 0x00, 0x00, // ...(...s...t.... - 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, // ..F.......2...r. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, // ......V........@ - 0x00, 0x00, 0x96, 0x7d, 0x8b, 0x3d, 0xcd, 0x83, 0x85, 0x3d, 0xd0, 0x79, 0x57, 0x3d, 0x00, 0x00, // ...}.=...=.yW=.. - 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, // ..F.......2..... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, // ......*........@ - 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x32, 0x00, // ....@@.@......2. - 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, // ..r............. - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xa6, 0x26, 0x99, 0x39, 0x4e, 0x6b, 0xa8, 0xbb, 0x93, 0xe4, // ...@...&.9Nk.... - 0x63, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // c.....F.......2. - 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x02, 0x00, // ..r............. - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x48, 0xc8, 0x25, 0xbe, 0x62, 0x56, 0x1d, 0xbe, 0x37, 0x1d, // ...@..H.%.bV..7. - 0x08, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, // ......F.......8. - 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x12, 0x00, // ..........2..... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ......:.......:. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........A..... - 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ..2...r ........ - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x85, 0x9d, 0xb2, 0xbc, 0x9a, 0xa7, // .......@........ - 0xf4, 0xbc, 0x69, 0xe1, 0x2f, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, // ..i./.....F..... - 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ..6.... .......@ - 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // .....?>....... + 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xa0, 0x02, 0x00, 0x00, 0x50, 0x00, // GET...SHEX....P. + 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, // ......j...b...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......e.... .... + 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x12, 0x00, // ..h............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, // ......F.......F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......D......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, // ..........8..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, // ................ + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......2...r..... + 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3a, 0xc4, // ..V........@..:. + 0x19, 0x3e, 0x25, 0x82, 0x29, 0x3e, 0x39, 0x53, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // .>%.)>9S*>.....@ + 0x00, 0x00, 0x8e, 0xc6, 0x8b, 0x3e, 0x6b, 0x0a, 0x8d, 0x3e, 0x8e, 0xb8, 0x80, 0x3e, 0x00, 0x00, // .....>k..>...>.. + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, // ..2...r......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x92, 0x04, 0xb3, 0x3c, 0xb8, 0x53, // .......@.....<.S + 0xb5, 0x3c, 0x16, 0x0d, 0xe0, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, // .<...<....F..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, // ..2...r......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x20, 0xb4, 0x41, 0xbd, 0x9c, 0x00, // .......@.. .A... + 0x3f, 0xbd, 0xa0, 0x80, 0x3b, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, // ?...;.....F..... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..8...........F. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, // ..r............. + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xe2, 0x28, 0x9e, 0xbd, 0x04, 0x73, 0x98, 0xbd, 0xc8, 0x74, // ...@...(...s...t + 0x87, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. + 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x02, 0x00, // ..r.......V..... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x96, 0x7d, 0x8b, 0x3d, 0xcd, 0x83, 0x85, 0x3d, 0xd0, 0x79, // ...@...}.=...=.y + 0x57, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // W=....F.......2. + 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x02, 0x00, // ..........*..... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@....@@.@.... + 0x80, 0xbf, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, // ..2...r......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xa6, 0x26, 0x99, 0x39, 0x4e, 0x6b, // .......@...&.9Nk + 0xa8, 0xbb, 0x93, 0xe4, 0x63, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, // ....c.....F..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, // ..2...r......... + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x48, 0xc8, 0x25, 0xbe, 0x62, 0x56, // .......@..H.%.bV + 0x1d, 0xbe, 0x37, 0x1d, 0x08, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, // ..7.......F..... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ..8............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........:..... + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, // ..:...........A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, // ......2...r .... + 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x85, 0x9d, // ...........@.... + 0xb2, 0xbc, 0x9a, 0xa7, 0xf4, 0xbc, 0x69, 0xe1, 0x2f, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ......i./.....F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, // ......6.... .... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, // ...@.....?>..... + 0x00, 0x00, // .. }; -static const uint8_t fs_mesh_mtl[1798] = +static const uint8_t fs_mesh_mtl[1987] = { - 0x46, 0x53, 0x48, 0x0b, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x06, // FSH....e........ + 0x46, 0x53, 0x48, 0x0b, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x07, // FSH....e........ 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, // ..#include .#inclu 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, // de 0x0a, 0x0a, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, // ..using namespac - 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, // e metal;..consta - 0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x35, 0x34, 0x33, 0x20, 0x3d, // nt float4 _543 = - 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, // {};..struct xla - 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, // tMtlMain_out.{. - 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // float4 bgfx_F - 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ragData0 [[color - 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, // (0)]];.};..struc - 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, // t xlatMtlMain_in - 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, // .{. float3 v_ - 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, // normal [[user(lo - 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, // cn0)]];.};..frag - 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, // ment xlatMtlMain - 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, // _out xlatMtlMain - 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, // (xlatMtlMain_in - 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x29, // in [[stage_in]]) - 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // .{. xlatMtlMa - 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, // in_out out = {}; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x33, 0x32, 0x34, // . float3 _324 - 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x69, 0x6e, 0x2e, // = normalize(in. - 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // v_normal);. f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, 0x39, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x28, // loat3 _491 = ((( - 0x28, 0x28, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x37, 0x32, // ((((float3(0.272 - 0x39, 0x39, 0x39, 0x32, 0x32, 0x37, 0x30, 0x34, 0x36, 0x39, 0x36, 0x36, 0x35, 0x35, 0x2c, 0x20, // 99922704696655, - 0x30, 0x2e, 0x32, 0x37, 0x35, 0x34, 0x37, 0x30, 0x31, 0x30, 0x37, 0x37, 0x39, 0x33, 0x38, 0x30, // 0.27547010779380 - 0x37, 0x39, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x31, 0x34, 0x30, 0x38, 0x30, 0x34, 0x30, // 798, 0.251408040 - 0x35, 0x32, 0x33, 0x35, 0x32, 0x39, 0x30, 0x35, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x28, 0x66, // 52352905) + (((f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x33, 0x38, 0x34, 0x31, 0x36, 0x33, 0x34, // loat3(-0.3841634 - 0x39, 0x38, 0x38, 0x37, 0x38, 0x34, 0x37, 0x39, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x34, 0x32, 0x33, // 98878479, -0.423 - 0x34, 0x39, 0x32, 0x32, 0x38, 0x32, 0x36, 0x32, 0x39, 0x30, 0x31, 0x33, 0x30, 0x36, 0x2c, 0x20, // 49228262901306, - 0x2d, 0x30, 0x2e, 0x34, 0x32, 0x35, 0x35, 0x33, 0x32, 0x37, 0x32, 0x38, 0x34, 0x33, 0x33, 0x36, // -0.4255327284336 - 0x30, 0x39, 0x30, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x28, 0x2d, 0x30, 0x2e, 0x34, 0x38, 0x38, // 0901) * ((-0.488 - 0x36, 0x30, 0x32, 0x35, 0x31, 0x39, 0x30, 0x33, 0x35, 0x33, 0x33, 0x39, 0x33, 0x36, 0x29, 0x20, // 60251903533936) - 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x78, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, // * _324.x)) * 2.0 - 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x30, 0x30, // ) * float3(0.400 - 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x39, 0x36, 0x30, 0x34, 0x36, 0x34, 0x34, 0x38, 0x29, 0x29, // 00000596046448)) - 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, // ) + (((float3(0. - 0x30, 0x35, 0x35, 0x39, 0x30, 0x36, 0x32, 0x39, 0x35, 0x37, 0x37, 0x36, 0x33, 0x36, 0x37, 0x31, // 0559062957763671 - 0x38, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x36, 0x36, 0x32, 0x37, 0x34, 0x33, 0x37, 0x34, // 88, 0.0566274374 - 0x37, 0x32, 0x33, 0x34, 0x33, 0x34, 0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x36, 0x39, 0x39, // 72343445, 0.0699 - 0x36, 0x39, 0x39, 0x33, 0x37, 0x32, 0x30, 0x35, 0x33, 0x31, 0x34, 0x36, 0x33, 0x36, 0x29, 0x20, // 69937205314636) - 0x2a, 0x20, 0x28, 0x30, 0x2e, 0x34, 0x38, 0x38, 0x36, 0x30, 0x32, 0x35, 0x31, 0x39, 0x30, 0x33, // * (0.48860251903 - 0x35, 0x33, 0x33, 0x39, 0x33, 0x36, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x79, 0x29, // 533936 * _324.y) - 0x29, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // ) * 2.0) * float - 0x33, 0x28, 0x30, 0x2e, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x39, 0x36, 0x30, // 3(0.400000005960 - 0x34, 0x36, 0x34, 0x34, 0x38, 0x29, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x28, 0x66, 0x6c, // 46448))) + (((fl - 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x31, 0x32, 0x30, 0x39, 0x38, 0x35, 0x31, 0x35, 0x37, // oat3(0.120985157 - 0x37, 0x38, 0x37, 0x37, 0x39, 0x39, 0x38, 0x34, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, 0x39, 0x32, // 78779984, 0.1192 - 0x39, 0x37, 0x39, 0x39, 0x36, 0x31, 0x36, 0x33, 0x33, 0x36, 0x38, 0x32, 0x33, 0x2c, 0x20, 0x30, // 9799616336823, 0 - 0x2e, 0x31, 0x31, 0x37, 0x31, 0x31, 0x31, 0x39, 0x36, 0x36, 0x30, 0x31, 0x33, 0x39, 0x30, 0x38, // .117111966013908 - 0x33, 0x39, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x28, 0x2d, 0x30, 0x2e, 0x34, 0x38, 0x38, 0x36, 0x30, // 39) * ((-0.48860 - 0x32, 0x35, 0x31, 0x39, 0x30, 0x33, 0x35, 0x33, 0x33, 0x39, 0x33, 0x36, 0x29, 0x20, 0x2a, 0x20, // 251903533936) * - 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, // _324.z)) * 2.0) - 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x30, 0x30, 0x30, 0x30, // * float3(0.40000 - 0x30, 0x30, 0x30, 0x35, 0x39, 0x36, 0x30, 0x34, 0x36, 0x34, 0x34, 0x38, 0x29, 0x29, 0x29, 0x20, // 000596046448))) - 0x2b, 0x20, 0x28, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x31, // + (((float3(-0.1 - 0x37, 0x36, 0x37, 0x31, 0x31, 0x36, 0x33, 0x33, 0x38, 0x30, 0x31, 0x34, 0x36, 0x30, 0x32, 0x37, // 7671163380146027 - 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x37, 0x30, 0x33, 0x33, 0x31, 0x34, 0x30, 0x33, 0x36, 0x31, // , -0.17033140361 - 0x33, 0x30, 0x39, 0x30, 0x35, 0x32, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x35, 0x31, 0x33, 0x34, // 309052, -0.15134 - 0x35, 0x30, 0x31, 0x34, 0x35, 0x37, 0x32, 0x31, 0x34, 0x33, 0x35, 0x35, 0x29, 0x20, 0x2a, 0x20, // 501457214355) * - 0x28, 0x28, 0x31, 0x2e, 0x30, 0x39, 0x32, 0x35, 0x34, 0x38, 0x34, 0x38, 0x39, 0x35, 0x37, 0x30, // ((1.092548489570 - 0x36, 0x31, 0x37, 0x37, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x78, 0x29, 0x20, 0x2a, // 6177 * _324.x) * - 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x31, 0x2e, 0x30, 0x29, // _324.z)) * 1.0) - 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x30, 0x30, 0x30, // * float3(0.4000 - 0x30, 0x30, 0x30, 0x30, 0x35, 0x39, 0x36, 0x30, 0x34, 0x36, 0x34, 0x34, 0x38, 0x29, 0x29, 0x29, // 0000596046448))) - 0x20, 0x2b, 0x20, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x31, // + ((float3(-0.1 - 0x32, 0x34, 0x36, 0x38, 0x32, 0x31, 0x31, 0x33, 0x35, 0x32, 0x38, 0x32, 0x35, 0x31, 0x36, 0x35, // 2468211352825165 + 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // e metal;..struct + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, // xlatMtlMain_out + 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, // .{. float4 bg + 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, // fx_FragData0 [[c + 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, // olor(0)]];.};..s + 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // truct xlatMtlMai + 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // n_in.{. float + 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, // 3 v_normal [[use + 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, // r(locn0)]];.};.. + 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // fragment xlatMtl + 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // Main_out xlatMtl + 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, // Main(xlatMtlMain + 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, // _in in [[stage_i + 0x6e, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // n]]).{. xlatM + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, // tlMain_out out = + 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, // {};. float3 + 0x5f, 0x33, 0x32, 0x38, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6e, 0x6f, 0x72, // _328 = fast::nor + 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // malize(in.v_norm + 0x61, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, // al);. out.bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, // x_FragData0 = fl + 0x6f, 0x61, 0x74, 0x34, 0x28, 0x28, 0x28, 0x28, 0x66, 0x6d, 0x61, 0x28, 0x28, 0x66, 0x6c, 0x6f, // oat4((((fma((flo + 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x31, 0x37, 0x36, 0x37, 0x31, 0x31, 0x36, 0x33, 0x33, // at3(-0.176711633 + 0x38, 0x30, 0x31, 0x34, 0x36, 0x30, 0x32, 0x36, 0x36, 0x31, 0x31, 0x33, 0x32, 0x38, 0x31, 0x32, // 8014602661132812 + 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x37, 0x30, 0x33, 0x33, 0x31, 0x34, 0x30, 0x33, 0x36, // 5, -0.1703314036 + 0x31, 0x33, 0x30, 0x39, 0x30, 0x35, 0x31, 0x35, 0x31, 0x33, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, // 1309051513671875 + 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x35, 0x31, 0x33, 0x34, 0x35, 0x30, 0x31, 0x34, 0x35, 0x37, // , -0.15134501457 + 0x32, 0x31, 0x34, 0x33, 0x35, 0x35, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x20, 0x2a, 0x20, 0x28, // 21435546875) * ( + 0x28, 0x31, 0x2e, 0x30, 0x39, 0x32, 0x35, 0x34, 0x38, 0x34, 0x38, 0x39, 0x35, 0x37, 0x30, 0x36, // (1.0925484895706 + 0x31, 0x37, 0x36, 0x37, 0x35, 0x37, 0x38, 0x31, 0x32, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, // 1767578125 * _32 + 0x38, 0x2e, 0x78, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x7a, 0x29, 0x29, 0x20, // 8.x) * _328.z)) + 0x2a, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, // * 1.0, float3(0. + 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x39, 0x36, 0x30, 0x34, 0x36, 0x34, 0x34, // 4000000059604644 + 0x37, 0x37, 0x35, 0x33, 0x39, 0x30, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, // 775390625), fma( + 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x31, 0x32, 0x30, 0x39, 0x38, 0x35, // (float3(0.120985 + 0x31, 0x35, 0x37, 0x37, 0x38, 0x37, 0x37, 0x39, 0x39, 0x38, 0x33, 0x35, 0x32, 0x30, 0x35, 0x30, // 1577877998352050 + 0x37, 0x38, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, 0x39, 0x32, 0x39, 0x37, 0x39, // 78125, 0.1192979 + 0x39, 0x36, 0x31, 0x36, 0x33, 0x33, 0x36, 0x38, 0x32, 0x32, 0x35, 0x30, 0x39, 0x37, 0x36, 0x35, // 9616336822509765 + 0x36, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, 0x37, 0x31, 0x31, 0x31, 0x39, 0x36, 0x36, // 625, 0.117111966 + 0x30, 0x31, 0x33, 0x39, 0x30, 0x38, 0x33, 0x38, 0x36, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, // 0139083862304687 + 0x35, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x28, 0x2d, 0x30, 0x2e, 0x34, 0x38, 0x38, 0x36, 0x30, 0x32, // 5) * ((-0.488602 + 0x35, 0x31, 0x39, 0x30, 0x33, 0x35, 0x33, 0x33, 0x39, 0x33, 0x35, 0x35, 0x34, 0x36, 0x38, 0x37, // 5190353393554687 + 0x35, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, // 5) * _328.z)) * + 0x32, 0x2e, 0x30, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x30, // 2.0, float3(0.40 + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x39, 0x36, 0x30, 0x34, 0x36, 0x34, 0x34, 0x37, 0x37, // 0000005960464477 + 0x35, 0x33, 0x39, 0x30, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x28, 0x66, // 5390625), fma((f + 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x35, 0x35, 0x39, 0x30, 0x36, 0x32, 0x39, // loat3(0.05590629 + 0x35, 0x37, 0x37, 0x36, 0x33, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, // 57763671875, 0.0 + 0x35, 0x36, 0x36, 0x32, 0x37, 0x34, 0x33, 0x37, 0x34, 0x37, 0x32, 0x33, 0x34, 0x33, 0x34, 0x34, // 5662743747234344 + 0x34, 0x38, 0x32, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x36, 0x39, // 482421875, 0.069 + 0x39, 0x36, 0x39, 0x39, 0x33, 0x37, 0x32, 0x30, 0x35, 0x33, 0x31, 0x34, 0x36, 0x33, 0x36, 0x32, // 9699372053146362 + 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x30, 0x2e, 0x34, 0x38, // 3046875) * (0.48 + 0x38, 0x36, 0x30, 0x32, 0x35, 0x31, 0x39, 0x30, 0x33, 0x35, 0x33, 0x33, 0x39, 0x33, 0x35, 0x35, // 8602519035339355 + 0x34, 0x36, 0x38, 0x37, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x79, 0x29, 0x29, // 46875 * _328.y)) + 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // * 2.0, float3(0 + 0x2e, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x39, 0x36, 0x30, 0x34, 0x36, 0x34, // .400000005960464 + 0x34, 0x37, 0x37, 0x35, 0x33, 0x39, 0x30, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6d, 0x61, // 4775390625), fma + 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x33, 0x38, 0x34, 0x31, // ((float3(-0.3841 + 0x36, 0x33, 0x34, 0x39, 0x38, 0x38, 0x37, 0x38, 0x34, 0x37, 0x39, 0x30, 0x30, 0x33, 0x39, 0x30, // 6349887847900390 + 0x36, 0x32, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x34, 0x32, 0x33, 0x34, 0x39, 0x32, 0x32, 0x38, // 625, -0.42349228 + 0x32, 0x36, 0x32, 0x39, 0x30, 0x31, 0x33, 0x30, 0x36, 0x31, 0x35, 0x32, 0x33, 0x34, 0x33, 0x37, // 2629013061523437 + 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x34, 0x32, 0x35, 0x35, 0x33, 0x32, 0x37, 0x32, 0x38, 0x34, // 5, -0.4255327284 + 0x33, 0x33, 0x36, 0x30, 0x39, 0x30, 0x30, 0x38, 0x37, 0x38, 0x39, 0x30, 0x36, 0x32, 0x35, 0x29, // 336090087890625) + 0x20, 0x2a, 0x20, 0x28, 0x28, 0x2d, 0x30, 0x2e, 0x34, 0x38, 0x38, 0x36, 0x30, 0x32, 0x35, 0x31, // * ((-0.48860251 + 0x39, 0x30, 0x33, 0x35, 0x33, 0x33, 0x39, 0x33, 0x35, 0x35, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, // 903533935546875) + 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x78, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x32, 0x2e, // * _328.x)) * 2. + 0x30, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x30, 0x30, 0x30, // 0, float3(0.4000 + 0x30, 0x30, 0x30, 0x30, 0x35, 0x39, 0x36, 0x30, 0x34, 0x36, 0x34, 0x34, 0x37, 0x37, 0x35, 0x33, // 0000596046447753 + 0x39, 0x30, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // 90625), float3(0 + 0x2e, 0x32, 0x37, 0x32, 0x39, 0x39, 0x39, 0x32, 0x32, 0x37, 0x30, 0x34, 0x36, 0x39, 0x36, 0x36, // .272999227046966 + 0x35, 0x35, 0x32, 0x37, 0x33, 0x34, 0x33, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x37, 0x35, // 552734375, 0.275 + 0x34, 0x37, 0x30, 0x31, 0x30, 0x37, 0x37, 0x39, 0x33, 0x38, 0x30, 0x37, 0x39, 0x38, 0x33, 0x33, // 4701077938079833 + 0x39, 0x38, 0x34, 0x33, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x31, 0x34, 0x30, 0x38, // 984375, 0.251408 + 0x30, 0x34, 0x30, 0x35, 0x32, 0x33, 0x35, 0x32, 0x39, 0x30, 0x35, 0x32, 0x37, 0x33, 0x34, 0x33, // 0405235290527343 + 0x37, 0x35, 0x29, 0x29, 0x29, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, // 75))))) + ((floa + 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x31, 0x32, 0x34, 0x36, 0x38, 0x32, 0x31, 0x31, 0x33, 0x35, // t3(-0.1246821135 + 0x32, 0x38, 0x32, 0x35, 0x31, 0x36, 0x34, 0x37, 0x39, 0x34, 0x39, 0x32, 0x31, 0x38, 0x37, 0x35, // 2825164794921875 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x31, 0x39, 0x33, 0x34, 0x30, 0x37, 0x38, 0x34, 0x38, 0x34, // , -0.11934078484 - 0x37, 0x37, 0x33, 0x36, 0x33, 0x36, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x39, 0x36, 0x33, 0x30, // 773636, -0.09630 - 0x30, 0x33, 0x35, 0x36, 0x30, 0x39, 0x30, 0x30, 0x36, 0x38, 0x38, 0x31, 0x37, 0x29, 0x20, 0x2a, // 0356090068817) * + 0x37, 0x37, 0x33, 0x36, 0x33, 0x35, 0x38, 0x36, 0x34, 0x32, 0x35, 0x37, 0x38, 0x31, 0x32, 0x35, // 7736358642578125 + 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x39, 0x36, 0x33, 0x30, 0x30, 0x33, 0x35, 0x36, 0x30, 0x39, // , -0.09630035609 + 0x30, 0x30, 0x36, 0x38, 0x38, 0x31, 0x37, 0x31, 0x33, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, // 0068817138671875 + 0x29, 0x20, 0x2a, 0x20, 0x28, 0x28, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x39, 0x32, 0x35, 0x34, 0x38, // ) * (((-1.092548 + 0x34, 0x38, 0x39, 0x35, 0x37, 0x30, 0x36, 0x31, 0x37, 0x36, 0x37, 0x35, 0x37, 0x38, 0x31, 0x32, // 4895706176757812 + 0x35, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x78, 0x29, 0x20, 0x2a, 0x20, 0x5f, // 5) * _328.x) * _ + 0x33, 0x32, 0x38, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, // 328.y)) * 0.5)) + 0x2b, 0x20, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x30, 0x31, // + ((float3(0.001 + 0x38, 0x35, 0x32, 0x33, 0x37, 0x38, 0x35, 0x39, 0x38, 0x34, 0x31, 0x34, 0x33, 0x36, 0x31, 0x34, // 8523785984143614 + 0x37, 0x36, 0x38, 0x39, 0x38, 0x31, 0x39, 0x33, 0x33, 0x35, 0x39, 0x33, 0x37, 0x35, 0x2c, 0x20, // 76898193359375, + 0x2d, 0x30, 0x2e, 0x30, 0x33, 0x32, 0x35, 0x39, 0x32, 0x37, 0x38, 0x34, 0x36, 0x31, 0x33, 0x33, // -0.0325927846133 + 0x37, 0x30, 0x38, 0x39, 0x35, 0x33, 0x38, 0x35, 0x37, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, // 708953857421875, + 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x38, 0x38, 0x32, 0x30, 0x34, 0x34, 0x39, 0x35, 0x36, 0x30, 0x38, // -0.088204495608 + 0x38, 0x30, 0x36, 0x36, 0x31, 0x30, 0x31, 0x30, 0x37, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, 0x29, // 806610107421875) + 0x20, 0x2a, 0x20, 0x28, 0x30, 0x2e, 0x33, 0x31, 0x35, 0x33, 0x39, 0x31, 0x35, 0x37, 0x30, 0x33, // * (0.3153915703 + 0x32, 0x39, 0x36, 0x36, 0x36, 0x31, 0x33, 0x37, 0x36, 0x39, 0x35, 0x33, 0x31, 0x32, 0x35, 0x20, // 296661376953125 + 0x2a, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x38, // * fma(3.0 * _328 + 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x79, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, // .y, _328.y, -1.0 + 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, // ))) * 0.5)) + (( + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x39, 0x36, 0x33, 0x36, 0x35, 0x34, // float3(0.2963654 + 0x36, 0x39, 0x36, 0x39, 0x34, 0x31, 0x33, 0x37, 0x35, 0x37, 0x33, 0x32, 0x34, 0x32, 0x31, 0x38, // 6969413757324218 + 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x38, 0x31, 0x32, 0x36, 0x38, 0x36, 0x38, 0x36, 0x30, // 75, 0.2812686860 + 0x35, 0x36, 0x31, 0x33, 0x37, 0x30, 0x38, 0x34, 0x39, 0x36, 0x30, 0x39, 0x33, 0x37, 0x35, 0x2c, // 561370849609375, + 0x20, 0x30, 0x2e, 0x32, 0x34, 0x33, 0x33, 0x32, 0x38, 0x32, 0x32, 0x38, 0x35, 0x39, 0x32, 0x38, // 0.2433282285928 + 0x37, 0x32, 0x36, 0x31, 0x39, 0x36, 0x32, 0x38, 0x39, 0x30, 0x36, 0x32, 0x35, 0x29, 0x20, 0x2a, // 7261962890625) * 0x20, 0x28, 0x28, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x39, 0x32, 0x35, 0x34, 0x38, 0x34, 0x38, 0x39, // (((-1.092548489 - 0x35, 0x37, 0x30, 0x36, 0x31, 0x37, 0x37, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, // 5706177) * _324. - 0x78, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x2a, 0x20, // x) * _324.y)) * - 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // 0.5)) + ((float3 - 0x28, 0x30, 0x2e, 0x30, 0x30, 0x31, 0x38, 0x35, 0x32, 0x33, 0x37, 0x38, 0x35, 0x39, 0x38, 0x34, // (0.0018523785984 - 0x31, 0x34, 0x33, 0x36, 0x31, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x33, 0x32, 0x35, 0x39, // 143615, -0.03259 - 0x32, 0x37, 0x38, 0x34, 0x36, 0x31, 0x33, 0x33, 0x37, 0x30, 0x38, 0x39, 0x35, 0x2c, 0x20, 0x2d, // 2784613370895, - - 0x30, 0x2e, 0x30, 0x38, 0x38, 0x32, 0x30, 0x34, 0x34, 0x39, 0x35, 0x36, 0x30, 0x38, 0x38, 0x30, // 0.08820449560880 - 0x36, 0x36, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x30, 0x2e, 0x33, 0x31, 0x35, 0x33, 0x39, 0x31, // 661) * (0.315391 - 0x35, 0x37, 0x30, 0x33, 0x32, 0x39, 0x36, 0x36, 0x36, 0x31, 0x34, 0x20, 0x2a, 0x20, 0x28, 0x28, // 57032966614 * (( - 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x79, 0x29, 0x20, 0x2a, // (3.0 * _324.y) * - 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, // _324.y) - 1.0)) - 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x66, 0x6c, // ) * 0.5)) + ((fl - 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x39, 0x36, 0x33, 0x36, 0x35, 0x34, 0x36, 0x39, // oat3(0.296365469 - 0x36, 0x39, 0x34, 0x31, 0x33, 0x37, 0x35, 0x37, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x38, 0x31, 0x32, // 69413757, 0.2812 - 0x36, 0x38, 0x36, 0x38, 0x36, 0x30, 0x35, 0x36, 0x31, 0x33, 0x37, 0x30, 0x38, 0x2c, 0x20, 0x30, // 6868605613708, 0 - 0x2e, 0x32, 0x34, 0x33, 0x33, 0x32, 0x38, 0x32, 0x32, 0x38, 0x35, 0x39, 0x32, 0x38, 0x37, 0x32, // .243328228592872 - 0x36, 0x32, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x28, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x39, 0x32, 0x35, // 62) * (((-1.0925 - 0x34, 0x38, 0x34, 0x38, 0x39, 0x35, 0x37, 0x30, 0x36, 0x31, 0x37, 0x37, 0x29, 0x20, 0x2a, 0x20, // 484895706177) * - 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x7a, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x79, // _324.z) * _324.y - 0x29, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x66, // )) * 0.5)) + ((f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x30, 0x37, 0x39, 0x38, 0x32, 0x36, 0x36, // loat3(-0.0798266 - 0x36, 0x37, 0x39, 0x30, 0x34, 0x38, 0x35, 0x33, 0x38, 0x32, 0x31, 0x2c, 0x20, 0x2d, 0x30, 0x2e, // 67904853821, -0. - 0x31, 0x30, 0x39, 0x33, 0x34, 0x30, 0x39, 0x35, 0x38, 0x32, 0x39, 0x37, 0x32, 0x35, 0x32, 0x36, // 1093409582972526 - 0x36, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x35, 0x37, 0x32, 0x30, 0x38, 0x38, 0x35, 0x39, 0x39, // 6, -0.1572088599 - 0x32, 0x30, 0x35, 0x30, 0x31, 0x37, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x34, // 2050171) * (0.54 - 0x36, 0x32, 0x37, 0x34, 0x32, 0x34, 0x34, 0x37, 0x38, 0x35, 0x33, 0x30, 0x38, 0x38, 0x34, 0x20, // 627424478530884 - 0x2a, 0x20, 0x28, 0x28, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x7a, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, // * ((_324.z * _32 - 0x34, 0x2e, 0x7a, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x78, 0x20, 0x2a, // 4.z) - (_324.x * - 0x20, 0x5f, 0x33, 0x32, 0x34, 0x2e, 0x78, 0x29, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, // _324.x)))) * 0. - 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, // 5);. float4 _ - 0x35, 0x33, 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x34, 0x39, // 533 = float4(_49 - 0x31, 0x2e, 0x78, 0x2c, 0x20, 0x5f, 0x34, 0x39, 0x31, 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x34, 0x39, // 1.x, _491.y, _49 - 0x31, 0x2e, 0x7a, 0x2c, 0x20, 0x5f, 0x35, 0x34, 0x33, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, // 1.z, _543.w);. - 0x20, 0x20, 0x5f, 0x35, 0x33, 0x33, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, // _533.w = 1.0;. - 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, // out.bgfx_Fra - 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x33, 0x33, 0x3b, 0x0a, 0x20, // gData0 = _533;. - 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, // return out;.} - 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, // ...... + 0x35, 0x37, 0x30, 0x36, 0x31, 0x37, 0x36, 0x37, 0x35, 0x37, 0x38, 0x31, 0x32, 0x35, 0x29, 0x20, // 57061767578125) + 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x7a, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x38, // * _328.z) * _328 + 0x2e, 0x79, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, // .y)) * 0.5)) + ( + 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x30, 0x37, 0x39, 0x38, 0x32, // (float3(-0.07982 + 0x36, 0x36, 0x36, 0x37, 0x39, 0x30, 0x34, 0x38, 0x35, 0x33, 0x38, 0x32, 0x30, 0x38, 0x30, 0x30, // 6667904853820800 + 0x37, 0x38, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x30, 0x39, 0x33, 0x34, 0x30, // 78125, -0.109340 + 0x39, 0x35, 0x38, 0x32, 0x39, 0x37, 0x32, 0x35, 0x32, 0x36, 0x35, 0x35, 0x30, 0x32, 0x39, 0x32, // 9582972526550292 + 0x39, 0x36, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x35, 0x37, 0x32, 0x30, 0x38, // 96875, -0.157208 + 0x38, 0x35, 0x39, 0x39, 0x32, 0x30, 0x35, 0x30, 0x31, 0x37, 0x30, 0x38, 0x39, 0x38, 0x34, 0x33, // 8599205017089843 + 0x37, 0x35, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x34, 0x36, 0x32, 0x37, 0x34, 0x32, // 75) * (0.5462742 + 0x34, 0x34, 0x37, 0x38, 0x35, 0x33, 0x30, 0x38, 0x38, 0x33, 0x37, 0x38, 0x39, 0x30, 0x36, 0x32, // 4478530883789062 + 0x35, 0x20, 0x2a, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x7a, 0x2c, 0x20, // 5 * fma(_328.z, + 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x7a, 0x2c, 0x20, 0x2d, 0x28, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x78, // _328.z, -(_328.x + 0x20, 0x2a, 0x20, 0x5f, 0x33, 0x32, 0x38, 0x2e, 0x78, 0x29, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, // * _328.x)))) * + 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 0.5), 1.0);. + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // return out;.}... + 0x00, 0x00, 0x00, // ... }; extern const uint8_t* fs_mesh_pssl; extern const uint32_t fs_mesh_pssl_size; diff --git a/bgfx/tools/geometryv/fs_mesh.sc b/bgfx/tools/geometryv/fs_mesh.sc index de56ba5c..f17c54eb 100644 --- a/bgfx/tools/geometryv/fs_mesh.sc +++ b/bgfx/tools/geometryv/fs_mesh.sc @@ -61,4 +61,4 @@ void main() gl_FragColor.xyz = evalSh(nn); gl_FragColor.w = 1.0; -} +} diff --git a/bgfx/tools/geometryv/geometryv.cpp b/bgfx/tools/geometryv/geometryv.cpp index 70fe3ddb..87d2048d 100644 --- a/bgfx/tools/geometryv/geometryv.cpp +++ b/bgfx/tools/geometryv/geometryv.cpp @@ -67,7 +67,7 @@ static const char* s_attribShortNames[] = "TC6", // TexCoord6 "TC7", // TexCoord7 }; -BX_STATIC_ASSERT(BX_COUNTOF(s_attribShortNames) == bgfx::Attrib::Count); +static_assert(BX_COUNTOF(s_attribShortNames) == bgfx::Attrib::Count); static const char* s_supportedExt[] = @@ -150,7 +150,7 @@ static const char* s_bindingName[] = "Help", "About", }; -BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_bindingName) ); +static_assert(Binding::Count == BX_COUNTOF(s_bindingName) ); static const InputBinding* s_binding[] = { @@ -159,7 +159,7 @@ static const InputBinding* s_binding[] = s_bindingHelp, s_bindingAbout, }; -BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_binding) ); +static_assert(Binding::Count == BX_COUNTOF(s_binding) ); static const char* s_filter = "" "Bgfx geometry (bin) | *.bin\n" diff --git a/bgfx/tools/geometryv/vs_mesh.bin.h b/bgfx/tools/geometryv/vs_mesh.bin.h index 269edf1f..7aabe545 100644 --- a/bgfx/tools/geometryv/vs_mesh.bin.h +++ b/bgfx/tools/geometryv/vs_mesh.bin.h @@ -1,9 +1,9 @@ static const uint8_t vs_mesh_glsl[446] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x07, 0x75, // VSH........e...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. .. ..... + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj - 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x61, 0x74, // ..............at + 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x61, 0x74, // ..............at 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x6e, // tribute vec3 a_n 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // ormal;.attribute 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // vec3 a_position @@ -32,9 +32,9 @@ static const uint8_t vs_mesh_glsl[446] = static const uint8_t vs_mesh_essl[482] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x07, 0x75, // VSH........e...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. .. ..... + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj - 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0x61, 0x74, // ..............at + 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0x61, 0x74, // ..............at 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // tribute highp ve 0x63, 0x33, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x61, 0x74, 0x74, // c3 a_normal;.att 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // ribute highp vec @@ -66,10 +66,10 @@ static const uint8_t vs_mesh_essl[482] = static const uint8_t vs_mesh_spv[1514] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x0f, 0x75, // VSH........e...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // .........u_model - 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x05, 0x00, 0x00, 0x03, 0x02, // ................ - 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, // #............... + 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x05, 0x00, 0x00, 0x03, 0x02, // ................ + 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, // #............... 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, // ................ 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, // ..GLSL.std.450.. 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................ @@ -161,47 +161,14 @@ static const uint8_t vs_mesh_spv[1514] = 0x03, 0x00, 0x50, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..P...y.......8. 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x00, 0x40, 0x08, // ........@. }; -static const uint8_t vs_mesh_dx9[471] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x07, 0x75, // VSH........e...u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ - 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj - 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x01, 0x00, 0x00, 0x00, 0x03, // ................ - 0xfe, 0xff, 0xfe, 0xff, 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, // ....,.CTAB...... - 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, // ................ - 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x03, 0x00, // ..|...D......... - 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x02, 0x00, // ..L............. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......l.......u_ - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x00, // model......... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // ......u_modelVie - 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, // wProj........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // ......vs_3_0.Mic - 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL - 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler - 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x07, 0x00, 0x0f, 0xa0, 0x00, 0x00, // 10.1..Q......... - 0x00, 0x40, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, // .@.............. - 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ - 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ - 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x07, 0xe0, 0x05, 0x00, // ................ - 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, // ............U... - 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, // ................ - 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................ - 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................ - 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, // ................ - 0xe4, 0x90, 0x07, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, // ........U....... - 0x07, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ....U........... - 0x0b, 0x80, 0x04, 0x00, 0xa4, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xa4, 0x80, 0x04, 0x00, // ................ - 0x00, 0x04, 0x01, 0x00, 0x07, 0xe0, 0x06, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, // ................ - 0xf4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ....... -}; -static const uint8_t vs_mesh_dx11[690] = +static const uint8_t vs_mesh_dx11[694] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x07, 0x75, // VSH........e...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // _model. ........ 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj - 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x44, 0x58, // ..........l...DX - 0x42, 0x43, 0xb4, 0x48, 0x12, 0xfe, 0xc5, 0x93, 0x9f, 0x35, 0x29, 0x47, 0xbd, 0x09, 0x87, 0xcd, // BC.H.....5)G.... - 0x71, 0xa2, 0x01, 0x00, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, // q.....l.......,. + 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x44, 0x58, // ..........p...DX + 0x42, 0x43, 0x46, 0xb8, 0xf1, 0xf9, 0x38, 0x10, 0x02, 0x2d, 0x2f, 0x04, 0x36, 0x88, 0x35, 0xed, // BCF...8..-/.6.5. + 0x4e, 0xb0, 0x01, 0x00, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, // N.....p.......,. 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x48, 0x00, // ..|.......ISGNH. 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........8..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, // ................ @@ -213,40 +180,40 @@ static const uint8_t vs_mesh_dx11[690] = 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ..D............. 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, // ..........SV_POS 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x00, 0xab, 0x53, 0x48, // ITION.NORMAL..SH - 0x44, 0x52, 0x94, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x65, 0x00, 0x00, 0x00, 0x59, 0x00, // DR....@...e...Y. - 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x5f, 0x00, // ..F. ........._. - 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, // ..r......._...r. - 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......g.... .... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, // ......e...r .... - 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, // ..h.......8..... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, // ......V.......F. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, // .........2..... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, // ......F. ....... - 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ..........F..... - 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ..2...........F. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, // ............... - 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, // ..F............ - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, // ......F.......F. - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, // .........2...r. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ......F........@ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, // .....@...@...@.. - 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, // ...@............ - 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......8...r..... - 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ... - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xb2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... - 0x00, 0x00, 0x46, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ..F. ........... - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x08, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2. - 0x00, 0x0a, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, // ..r ......F. ... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x03, // ..............F. - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x00, 0x01, 0x00, // ......>......... - 0x40, 0x08, // @. + 0x45, 0x58, 0x98, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x66, 0x00, 0x00, 0x00, 0x6a, 0x08, // EX....P...f...j. + 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, // ..Y...F. ....... + 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, // .._...r......._. + 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, // ..r.......g.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, // ..........e...r + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, // ......h.......8. + 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, // ..........V..... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2. + 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ... + 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0xa6, 0x1a, // ..F. ........... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F......... + 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ... ......F..... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2. + 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x00, 0x00, // ..r.......F..... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, // ...@.....@...@.. + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, // .@.....@........ + 0x80, 0xbf, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, // ..........8...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, // ......V.......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xb2, 0x00, // .........2..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F. ....... + 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x08, 0x10, 0x00, 0x01, 0x00, // ..........F..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, // ..2...r ......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x46, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, // ..F.......>..... + 0x02, 0x00, 0x01, 0x00, 0x40, 0x08, // ....@. }; -static const uint8_t vs_mesh_mtl[790] = +static const uint8_t vs_mesh_mtl[838] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x0f, 0x75, // VSH........e...u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // .........u_model - 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x23, 0x69, // ..............#i + 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x23, 0x69, // ..............#i 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, // nclude .#include < 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, 0x73, // simd/simd.h>..us @@ -257,7 +224,10 @@ static const uint8_t vs_mesh_mtl[790] = 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, // . float4x4 u_ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, // modelViewProj;.} 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // ;..struct xlatMt - 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // lMain_out.{. + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, // lMain_out.{..flo + 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, // at bgfx_metal_po + 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, // intSize [[point_ + 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // size]] = 1;. 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, // float3 _entryPoi 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, // ntOutput_v_norma 0x6c, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, // l [[user(locn0)] diff --git a/bgfx/tools/shaderc/shaderc.cpp b/bgfx/tools/shaderc/shaderc.cpp index 4d49d396..e374f666 100644 --- a/bgfx/tools/shaderc/shaderc.cpp +++ b/bgfx/tools/shaderc/shaderc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -51,7 +51,7 @@ namespace bgfx "Unknown?!" }; - BX_STATIC_ASSERT(BX_COUNTOF(s_shadingLangName) == ShadingLang::Count+1, "ShadingLang::Enum and s_shadingLangName mismatch"); + static_assert(BX_COUNTOF(s_shadingLangName) == ShadingLang::Count+1, "ShadingLang::Enum and s_shadingLangName mismatch"); const char* getName(ShadingLang::Enum _lang) { @@ -77,6 +77,25 @@ namespace bgfx // 4.3 430 vhdgf+c // 4.4 440 // + // Metal Shading Language (MSL) profile naming convention: + // metal- + // + // See section "Compiler Options Controlling the Language Version" from the + // MSL spec for the correlation between MSL version and platform OS version: + // https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf + // + // MSL version | SPIR-V version | shaderc encoding + // 1.0 | 1.0 | 1000 (deprecated) + // 1.1 | 1.0 | 1110 + // 1.2 | 1.0 | 1210 + // 2.0 | 1.1 | 2011 + // 2.1 | 1.1 | 2111 + // 2.2 | 1.1 | 2211 + // 2.3 | 1.4 | 2314 + // 2.4 | 1.4 | 2414 + // 3.0 | 1.4 | 3014 + // 3.1 | 1.4 | 3114 + // // SPIR-V profile naming convention: // spirv- // @@ -100,10 +119,19 @@ namespace bgfx { ShadingLang::ESSL, 300, "300_es" }, { ShadingLang::ESSL, 310, "310_es" }, { ShadingLang::ESSL, 320, "320_es" }, - { ShadingLang::HLSL, 300, "s_3_0" }, { ShadingLang::HLSL, 400, "s_4_0" }, { ShadingLang::HLSL, 500, "s_5_0" }, - { ShadingLang::Metal, 1000, "metal" }, + { ShadingLang::Metal, 1210, "metal" }, + { ShadingLang::Metal, 1000, "metal10-10" }, + { ShadingLang::Metal, 1110, "metal11-10" }, + { ShadingLang::Metal, 1210, "metal12-10" }, + { ShadingLang::Metal, 2011, "metal20-11" }, + { ShadingLang::Metal, 2111, "metal21-11" }, + { ShadingLang::Metal, 2211, "metal22-11" }, + { ShadingLang::Metal, 2314, "metal23-14" }, + { ShadingLang::Metal, 2414, "metal24-14" }, + { ShadingLang::Metal, 3014, "metal30-14" }, + { ShadingLang::Metal, 3114, "metal31-14" }, { ShadingLang::PSSL, 1000, "pssl" }, { ShadingLang::SpirV, 1010, "spirv" }, { ShadingLang::SpirV, 1010, "spirv10-10" }, @@ -265,10 +293,13 @@ namespace bgfx NULL }; - static const char* s_unsignedVecs[] = + static const char* s_integerVecs[] = { + "ivec2", "uvec2", + "ivec3", "uvec3", + "ivec4", "uvec4", NULL }; @@ -281,7 +312,7 @@ namespace bgfx "mat3", "float3x3", "mat4", "float4x4", }; - BX_STATIC_ASSERT(BX_COUNTOF(s_uniformTypeName) == UniformType::Count*2); + static_assert(BX_COUNTOF(s_uniformTypeName) == UniformType::Count*2); static const char* s_allowedVertexShaderInputs[] = { @@ -401,17 +432,17 @@ namespace bgfx for (size_t ii = 0; ii < includeDirs.size(); ++ii) { - BX_TRACE("\t include :%s\n", includeDirs[ii].c_str()); + BX_TRACE("\t include :%s\n", includeDirs[ii].c_str() ); } for (size_t ii = 0; ii < defines.size(); ++ii) { - BX_TRACE("\t define :%s\n", defines[ii].c_str()); + BX_TRACE("\t define :%s\n", defines[ii].c_str() ); } for (size_t ii = 0; ii < dependencies.size(); ++ii) { - BX_TRACE("\t dependency :%s\n", dependencies[ii].c_str()); + BX_TRACE("\t dependency :%s\n", dependencies[ii].c_str() ); } } @@ -996,7 +1027,7 @@ namespace bgfx bx::printf( "shaderc, bgfx shader compiler tool, version %d.%d.%d.\n" - "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2024 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n\n" , BGFX_SHADERC_VERSION_MAJOR , BGFX_SHADERC_VERSION_MINOR @@ -1008,7 +1039,7 @@ namespace bgfx "\n" "Options:\n" - " -h, --help Display this help and exit.\n" + " -h, --help Display this help and exit.\n" " -v, --version Output version information and exit.\n" " -f Input's file path.\n" " -i Include path. (for multiple paths use -i multiple times)\n" @@ -1036,11 +1067,11 @@ namespace bgfx { lang = profile.lang; bx::printf("\n"); - bx::printf(" %-20s %s\n", profile.name, getName(profile.lang) ); + bx::printf(" %-20S %s\n", &profile.name, getName(profile.lang) ); } else { - bx::printf(" %s\n", profile.name); + bx::printf(" %S\n", &profile.name); } } @@ -1055,10 +1086,15 @@ namespace bgfx " --verbose Be verbose.\n" "\n" - "(DX9 and DX11 only):\n" + "(Vulkan, DirectX and Metal):\n" "\n" " --debug Debug information.\n" + + "\n" + "(DirectX only):\n" + + "\n" " --disasm Disassemble compiled shader.\n" " -O Set optimization level. Can be 0 to 3.\n" " --Werror Treat warnings as errors.\n" @@ -1127,6 +1163,7 @@ namespace bgfx preprocessor.setDefaultDefine("BX_PLATFORM_ANDROID"); preprocessor.setDefaultDefine("BX_PLATFORM_EMSCRIPTEN"); preprocessor.setDefaultDefine("BX_PLATFORM_IOS"); + preprocessor.setDefaultDefine("BX_PLATFORM_VISIONOS"); preprocessor.setDefaultDefine("BX_PLATFORM_LINUX"); preprocessor.setDefaultDefine("BX_PLATFORM_OSX"); preprocessor.setDefaultDefine("BX_PLATFORM_PS4"); @@ -1180,44 +1217,47 @@ namespace bgfx preprocessor.setDefine("BX_PLATFORM_EMSCRIPTEN=1"); preprocessor.setDefine(glslDefine); } - else if (0 == bx::strCmpI(platform, "ios") ) + else if (0 == bx::strCmpI(platform, "linux") ) { - preprocessor.setDefine("BX_PLATFORM_IOS=1"); - if (profile->lang == ShadingLang::Metal) + preprocessor.setDefine("BX_PLATFORM_LINUX=1"); + if (profile->lang == ShadingLang::SpirV) { - preprocessor.setDefine("BGFX_SHADER_LANGUAGE_METAL=1"); + preprocessor.setDefine("BGFX_SHADER_LANGUAGE_SPIRV=1"); } else { preprocessor.setDefine(glslDefine); } } - else if (0 == bx::strCmpI(platform, "linux") ) + else if ( + 0 == bx::strCmpI(platform, "ios") || + 0 == bx::strCmpI(platform, "osx") || + 0 == bx::strCmpI(platform, "visionos") + ) { - preprocessor.setDefine("BX_PLATFORM_LINUX=1"); - if (profile->lang == ShadingLang::SpirV) + if (0 == bx::strCmpI(platform, "osx")) { - preprocessor.setDefine("BGFX_SHADER_LANGUAGE_SPIRV=1"); + preprocessor.setDefine("BX_PLATFORM_OSX=1"); + } + else if (0 == bx::strCmpI(platform, "visionos")) { + preprocessor.setDefine("BX_PLATFORM_VISIONOS=1"); } else { - preprocessor.setDefine(glslDefine); + preprocessor.setDefine("BX_PLATFORM_IOS=1"); } - } - else if (0 == bx::strCmpI(platform, "osx") ) - { - preprocessor.setDefine("BX_PLATFORM_OSX=1"); + if (profile->lang != ShadingLang::Metal) { preprocessor.setDefine(glslDefine); } - char temp[256]; + char temp[32]; bx::snprintf( - temp + temp , sizeof(temp) , "BGFX_SHADER_LANGUAGE_METAL=%d" , (profile->lang == ShadingLang::Metal) ? profile->id : 0 - ); + ); preprocessor.setDefine(temp); } else if (0 == bx::strCmpI(platform, "windows") ) @@ -1341,7 +1381,7 @@ namespace bgfx bx::StringView assign = bx::strSubstr(parse, 0, 1); bx::StringView init; - if (0 == bx::strCmp(assign, "=", 1)) + if (0 == bx::strCmp(assign, "=", 1) ) { parse = bx::strLTrimSpace(bx::StringView(parse.getPtr() + 1, parse.getTerm() ) ); init.set(parse.getPtr(), eol.getPtr() ); @@ -1504,7 +1544,7 @@ namespace bgfx { bx::write(_shaderWriter, uint16_t(0), &err); - uint32_t shaderSize = (uint32_t)bx::strLen(input); + const uint32_t shaderSize = (uint32_t)bx::strLen(input); bx::write(_shaderWriter, shaderSize, &err); bx::write(_shaderWriter, input, shaderSize, &err); bx::write(_shaderWriter, uint8_t(0), &err); @@ -1513,7 +1553,7 @@ namespace bgfx } else if (profile->lang == ShadingLang::Metal) { - compiled = compileMetalShader(_options, BX_MAKEFOURCC('M', 'T', 'L', 0), input, _shaderWriter, _messageWriter); + compiled = compileMetalShader(_options, profile->id, input, _shaderWriter, _messageWriter); } else if (profile->lang == ShadingLang::SpirV) { @@ -1543,7 +1583,7 @@ namespace bgfx } else { - if (profile->lang != ShadingLang::PSSL) + if (profile->lang == ShadingLang::PSSL) { preprocessor.writef(getPsslPreamble() ); } @@ -1670,7 +1710,7 @@ namespace bgfx if (profile->lang == ShadingLang::Metal) { - compiled = compileMetalShader(_options, BX_MAKEFOURCC('M', 'T', 'L', 0), code, _shaderWriter, _messageWriter); + compiled = compileMetalShader(_options, profile->id, code, _shaderWriter, _messageWriter); } else if (profile->lang == ShadingLang::SpirV) { @@ -2230,7 +2270,7 @@ namespace bgfx const bool usesTextureArray = !bx::findIdentifierMatch(input, s_textureArray).isEmpty(); const bool usesPacking = !bx::findIdentifierMatch(input, s_ARB_shading_language_packing).isEmpty(); const bool usesViewportLayerArray = !bx::findIdentifierMatch(input, s_ARB_shader_viewport_layer_array).isEmpty(); - const bool usesUnsignedVecs = !bx::findIdentifierMatch(preprocessedInput, s_unsignedVecs).isEmpty(); + const bool usesIntegerVecs = !bx::findIdentifierMatch(preprocessedInput, s_integerVecs).isEmpty(); if (profile->lang != ShadingLang::ESSL) { @@ -2238,7 +2278,7 @@ namespace bgfx || !bx::findIdentifierMatch(input, s_130).isEmpty() || usesInterpolationQualifiers || usesTexelFetch - || usesUnsignedVecs + || usesIntegerVecs ) ); bx::stringPrintf(code, "#version %d\n", need130 ? 130 : glsl_profile); @@ -2320,15 +2360,6 @@ namespace bgfx ); } - if (130 > glsl_profile) - { - bx::stringPrintf(code, - "#define ivec2 vec2\n" - "#define ivec3 vec3\n" - "#define ivec4 vec4\n" - ); - } - if (ARB_shader_texture_lod) { bx::stringPrintf(code, @@ -2348,11 +2379,11 @@ namespace bgfx ); } - if (need130 || (glsl_profile >= 130)) + if (need130 || (glsl_profile >= 130) ) { bx::stringPrintf(code - , "#define bgfxShadow2D(_sampler, _coord) vec4_splat(texture(_sampler, _coord))\n" - "#define bgfxShadow2DProj(_sampler, _coord) vec4_splat(textureProj(_sampler, _coord))\n" + , "#define bgfxShadow2D(_sampler, _coord) vec4_splat(texture(_sampler, _coord) )\n" + "#define bgfxShadow2DProj(_sampler, _coord) vec4_splat(textureProj(_sampler, _coord) )\n" ); } else @@ -2366,7 +2397,7 @@ namespace bgfx else { if (glsl_profile < 300 - && usesUnsignedVecs) + && usesIntegerVecs) { glsl_profile = 300; } @@ -2412,7 +2443,8 @@ namespace bgfx bx::stringPrintf(code, "#extension GL_OES_texture_3D : enable\n"); } - if ((glsl_profile < 300) && (!bx::findIdentifierMatch(input, s_EXT_shadow_samplers).isEmpty())) + if (glsl_profile < 300 + && !bx::findIdentifierMatch(input, s_EXT_shadow_samplers).isEmpty() ) { bx::stringPrintf(code , "#extension GL_EXT_shadow_samplers : enable\n" @@ -2442,7 +2474,8 @@ namespace bgfx ); } - if ((glsl_profile < 300) && (!bx::findIdentifierMatch(input, "gl_FragDepth").isEmpty() )) + if (glsl_profile < 300 + && !bx::findIdentifierMatch(input, "gl_FragDepth").isEmpty() ) { bx::stringPrintf(code , "#extension GL_EXT_frag_depth : enable\n" @@ -2535,8 +2568,8 @@ namespace bgfx ); bx::stringPrintf(code - , "#define bgfxShadow2D(_sampler, _coord) vec4_splat(texture(_sampler, _coord))\n" - "#define bgfxShadow2DProj(_sampler, _coord) vec4_splat(textureProj(_sampler, _coord))\n" + , "#define bgfxShadow2D(_sampler, _coord) vec4_splat(texture(_sampler, _coord) )\n" + "#define bgfxShadow2DProj(_sampler, _coord) vec4_splat(textureProj(_sampler, _coord) )\n" ); } @@ -2574,7 +2607,7 @@ namespace bgfx if (profile->lang == ShadingLang::Metal) { - compiled = compileMetalShader(_options, BX_MAKEFOURCC('M', 'T', 'L', 0), code, _shaderWriter, _messageWriter); + compiled = compileMetalShader(_options, profile->id, code, _shaderWriter, _messageWriter); } else if (profile->lang == ShadingLang::SpirV) { @@ -2645,7 +2678,8 @@ namespace bgfx bool consoleOut = cmdLine.hasArg("stdout"); const char* outFilePath = cmdLine.findOption('o'); - if (NULL == outFilePath && !consoleOut) + if (NULL == outFilePath + && !consoleOut) { help("Output file name must be specified or use \"--stdout\" to output to stdout."); return bx::kExitFailure; @@ -2794,6 +2828,7 @@ namespace bgfx const char* varyingdef = cmdLine.findOption("varyingdef", defaultVarying.c_str() ); attribdef.load(varyingdef); varying = attribdef.getData(); + if (NULL != varying && *varying != '\0') { @@ -2805,11 +2840,12 @@ namespace bgfx } } - const size_t padding = 16384; - uint32_t size = (uint32_t)bx::getSize(&reader); - char* data = new char[size+padding+1]; - size = (uint32_t)bx::read(&reader, data, size, bx::ErrorAssert{}); + int32_t size = (int32_t)bx::getSize(&reader); + const int32_t total = size + 16384; + char* data = new char[total]; + size = bx::read(&reader, data, size, bx::ErrorAssert{}); + // Trim UTF-8 BOM if (data[0] == '\xef' && data[1] == '\xbb' && data[2] == '\xbf') @@ -2818,38 +2854,65 @@ namespace bgfx size -= 3; } + const char ch = data[0]; + if (false // https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding + || '\x00' == ch + || '\x0e' == ch + || '\x2b' == ch + || '\x84' == ch + || '\xdd' == ch + || '\xf7' == ch + || '\xfb' == ch + || '\xfe' == ch + || '\xff' == ch + ) + { + bx::printf("Shader input file has unsupported BOM.\n"); + return bx::kExitFailure; + } + // Compiler generates "error X3000: syntax error: unexpected end of file" // if input doesn't have empty line at EOF. data[size] = '\n'; - bx::memSet(&data[size+1], 0, padding); + bx::memSet(&data[size+1], 0, total-size-1); bx::close(&reader); - bx::FileWriter* writer = NULL; - - if (!consoleOut) { - if (!bin2c.isEmpty()) - { - writer = new Bin2cWriter(bin2c); - } - else - { - writer = new bx::FileWriter; - } + bx::FileWriter* writer = NULL; - if (!bx::open(writer, outFilePath)) + if (!consoleOut) { - bx::printf("Unable to open output file '%s'.\n", outFilePath); - return bx::kExitFailure; + if (!bin2c.isEmpty() ) + { + writer = new Bin2cWriter(bin2c); + } + else + { + writer = new bx::FileWriter; + } + + if (!bx::open(writer, outFilePath) ) + { + bx::printf("Unable to open output file '%s'.\n", outFilePath); + return bx::kExitFailure; + } } - } - compiled = compileShader(varying, commandLineComment.c_str(), data, size, options, consoleOut ? bx::getStdOut() : writer, bx::getStdOut()); + compiled = compileShader( + varying + , commandLineComment.c_str() + , data + , size + , options + , consoleOut ? bx::getStdOut() : writer + , bx::getStdOut() + ); - if (!consoleOut) - { - bx::close(writer); - delete writer; + if (!consoleOut) + { + bx::close(writer); + delete writer; + } } } diff --git a/bgfx/tools/shaderc/shaderc.h b/bgfx/tools/shaderc/shaderc.h index 43a1fc69..00f860b1 100644 --- a/bgfx/tools/shaderc/shaderc.h +++ b/bgfx/tools/shaderc/shaderc.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/shaderc/shaderc_glsl.cpp b/bgfx/tools/shaderc/shaderc_glsl.cpp index 273e2a3d..c63db613 100644 --- a/bgfx/tools/shaderc/shaderc_glsl.cpp +++ b/bgfx/tools/shaderc/shaderc_glsl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/shaderc/shaderc_hlsl.cpp b/bgfx/tools/shaderc/shaderc_hlsl.cpp index 82a92449..5e1a1dc4 100644 --- a/bgfx/tools/shaderc/shaderc_hlsl.cpp +++ b/bgfx/tools/shaderc/shaderc_hlsl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -287,7 +287,7 @@ namespace bgfx { namespace hlsl const uint32_t D3DSIO_END = 0x0000FFFF; const uint32_t D3DSI_OPCODE_MASK = 0x0000FFFF; const uint32_t D3DSI_COMMENTSIZE_MASK = 0x7FFF0000; - const uint32_t CTAB_CONSTANT = MAKEFOURCC('C', 'T', 'A', 'B'); + const uint32_t CTAB_CONSTANT = BX_MAKEFOURCC('C', 'T', 'A', 'B'); // parse the shader blob for the constant table const size_t codeSize = _code->GetBufferSize(); diff --git a/bgfx/tools/shaderc/shaderc_metal.cpp b/bgfx/tools/shaderc/shaderc_metal.cpp index 978c9f0c..583248d7 100644 --- a/bgfx/tools/shaderc/shaderc_metal.cpp +++ b/bgfx/tools/shaderc/shaderc_metal.cpp @@ -1,10 +1,12 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #include "shaderc.h" +#include // std::cout + BX_PRAGMA_DIAGNOSTIC_PUSH() BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4100) // error C4100: 'inclusionDepth' : unreferenced formal parameter BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4265) // error C4265: 'spv::spirvbin_t': class has virtual functions, but destructor is not virtual @@ -15,8 +17,9 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow") // warning: declaration of 'u #define ENABLE_OPT 1 #include #include -#include #include +#include +#include #define SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS #include #include @@ -194,7 +197,7 @@ namespace bgfx { namespace metal "a_texcoord6", "a_texcoord7", }; - BX_STATIC_ASSERT(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) ); + static_assert(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) ); bgfx::Attrib::Enum toAttribEnum(const bx::StringView& _name) { @@ -263,6 +266,90 @@ namespace bgfx { namespace metal return size; } + static spv_target_env getSpirvTargetVersion(uint32_t _version, bx::WriterI* _messageWriter) + { + bx::ErrorAssert err; + + switch (_version) + { + case 1000: + case 1110: + case 1210: + return SPV_ENV_VULKAN_1_0; + case 2011: + case 2111: + case 2211: + return SPV_ENV_VULKAN_1_1; + case 2314: + case 2414: + case 3014: + case 3114: + return SPV_ENV_VULKAN_1_1_SPIRV_1_4; + default: + bx::write(_messageWriter, &err, "Warning: Unknown SPIR-V version requested. Returning SPV_ENV_VULKAN_1_0 as default.\n"); + return SPV_ENV_VULKAN_1_0; + } + } + + static glslang::EShTargetLanguageVersion getGlslangTargetSpirvVersion(uint32_t _version, bx::WriterI* _messageWriter) + { + bx::ErrorAssert err; + + switch (_version) + { + case 1000: + case 1110: + case 1210: + return glslang::EShTargetSpv_1_0; + case 2011: + case 2111: + case 2211: + return glslang::EShTargetSpv_1_1; + case 2314: + case 2414: + case 3014: + case 3114: + return glslang::EShTargetSpv_1_4; + default: + bx::write(_messageWriter, &err, "Warning: Unknown SPIR-V version requested. Returning EShTargetSpv_1_0 as default.\n"); + return glslang::EShTargetSpv_1_0; + } + } + + static spirv_cross::CompilerMSL::Options::Platform getMslPlatform(const std::string& _platform) + { + return "ios" == _platform + ? spirv_cross::CompilerMSL::Options::Platform::iOS + : spirv_cross::CompilerMSL::Options::Platform::macOS; + } + + static void getMSLVersion(const uint32_t _version, uint32_t& _major, uint32_t& _minor, bx::WriterI* _messageWriter) + { + bx::ErrorAssert err; + + _major = _version / 1000; + _minor = (_version / 100) % 10; + + switch (_version) + { + case 1000: + case 1110: + case 1210: + case 2011: + case 2111: + case 2211: + case 2314: + case 2414: + case 3014: + case 3114: + return; + default: + bx::write(_messageWriter, &err, "Warning: Unknown MSL version requested. Returning 1.0 as default.\n"); + _major = 1; + _minor = 0; + } + } + static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter, bool _firstPass) { BX_UNUSED(_version); @@ -286,10 +373,12 @@ namespace bgfx { namespace metal | EShMsgReadHlsl | EShMsgVulkanRules | EShMsgSpvRules + | EShMsgDebugInfo ); shader->setEntryPoint("main"); shader->setAutoMapBindings(true); + shader->setEnvTarget(glslang::EShTargetSpv, getGlslangTargetSpirvVersion(_version, _messageWriter)); const int textureBindingOffset = 16; shader->setShiftBinding(glslang::EResTexture, textureBindingOffset); shader->setShiftBinding(glslang::EResSampler, textureBindingOffset); @@ -338,7 +427,7 @@ namespace bgfx { namespace metal end = start + 20; } - printCode(_code.c_str(), line, start, end, column); + printCode(_code.c_str(), bx::uint32_satsub(line, 1), start, end, column); bx::write(_messageWriter, &messageErr, "%s\n", log); } @@ -379,7 +468,8 @@ namespace bgfx { namespace metal // If the line declares a uniform, merge all next // lines until we encounter a semicolon. bx::StringView lineEnd = strFind(strLine, ";"); - while (lineEnd.isEmpty() && !reader.isDone()) { + while (lineEnd.isEmpty() && !reader.isDone()) + { bx::StringView nextLine = reader.next(); strLine.set(strLine.getPtr(), nextLine.getTerm()); lineEnd = strFind(nextLine, ";"); @@ -488,17 +578,18 @@ namespace bgfx { namespace metal program->dumpReflection(); } - BX_UNUSED(spv::MemorySemanticsAllMemory); - glslang::TIntermediate* intermediate = program->getIntermediate(stage); std::vector spirv; glslang::SpvOptions options; - options.disableOptimizer = false; + options.disableOptimizer = _options.debugInformation; + options.generateDebugInfo = _options.debugInformation; + options.emitNonSemanticShaderDebugInfo = _options.debugInformation; + options.emitNonSemanticShaderDebugSource = _options.debugInformation; glslang::GlslangToSpv(*intermediate, spirv, &options); - spvtools::Optimizer opt(SPV_ENV_VULKAN_1_0); + spvtools::Optimizer opt(getSpirvTargetVersion(_version, _messageWriter)); auto print_msg_to_stderr = [_messageWriter, &messageErr]( spv_message_level_t @@ -531,7 +622,7 @@ namespace bgfx { namespace metal { if (g_verbose) { - glslang::SpirvToolsDisassemble(std::cout, spirv, SPV_ENV_VULKAN_1_0); + glslang::SpirvToolsDisassemble(std::cout, spirv, getSpirvTargetVersion(_version, _messageWriter)); } spirv_cross::CompilerReflection refl(spirv); @@ -561,132 +652,134 @@ namespace bgfx { namespace metal bx::Error err; - if (_version == BX_MAKEFOURCC('M', 'T', 'L', 0) ) + spirv_cross::CompilerMSL msl(std::move(spirv) ); + + // Configure MSL cross compiler + spirv_cross::CompilerMSL::Options mslOptions = msl.get_msl_options(); { - spirv_cross::CompilerMSL msl(std::move(spirv) ); + // - Platform + mslOptions.platform = getMslPlatform(_options.platform); - auto executionModel = msl.get_execution_model(); - spirv_cross::MSLResourceBinding newBinding; - newBinding.stage = executionModel; + // - MSL Version + uint32_t major, minor; + getMSLVersion(_version, major, minor, _messageWriter); + mslOptions.set_msl_version(major, minor); + } + msl.set_msl_options(mslOptions); - spirv_cross::ShaderResources resources = msl.get_shader_resources(); + auto executionModel = msl.get_execution_model(); + spirv_cross::MSLResourceBinding newBinding; + newBinding.stage = executionModel; - spirv_cross::SmallVector entryPoints = msl.get_entry_points_and_stages(); - if (!entryPoints.empty() ) - { - msl.rename_entry_point( - entryPoints[0].name - , "xlatMtlMain" - , entryPoints[0].execution_model - ); - } + spirv_cross::ShaderResources resources = msl.get_shader_resources(); - for (auto& resource : resources.uniform_buffers) - { - unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); - unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); - newBinding.desc_set = set; - newBinding.binding = binding; - newBinding.msl_buffer = 0; - msl.add_msl_resource_binding(newBinding); - - msl.set_name(resource.id, "_mtl_u"); - } - - for (auto& resource : resources.storage_buffers) - { - unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); - unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); - newBinding.desc_set = set; - newBinding.binding = binding; - newBinding.msl_buffer = binding + 1; - msl.add_msl_resource_binding(newBinding); - } + spirv_cross::SmallVector entryPoints = msl.get_entry_points_and_stages(); + if (!entryPoints.empty() ) + { + msl.rename_entry_point( + entryPoints[0].name + , "xlatMtlMain" + , entryPoints[0].execution_model + ); + } - for (auto& resource : resources.separate_samplers) - { - unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); - unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); - newBinding.desc_set = set; - newBinding.binding = binding; - newBinding.msl_texture = binding - textureBindingOffset; - newBinding.msl_sampler = binding - textureBindingOffset; - msl.add_msl_resource_binding(newBinding); - } + for (auto& resource : resources.uniform_buffers) + { + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; + newBinding.msl_buffer = 0; + msl.add_msl_resource_binding(newBinding); + + msl.set_name(resource.id, "_mtl_u"); + } - for (auto& resource : resources.separate_images) - { - std::string name = msl.get_name(resource.id); - if (name.size() > 7 && 0 == bx::strCmp(name.c_str() + name.length() - 7, "Texture") ) - { - msl.set_name(resource.id, name.substr(0, name.length() - 7) ); - } + for (auto& resource : resources.storage_buffers) + { + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; + newBinding.msl_buffer = binding + 1; + msl.add_msl_resource_binding(newBinding); + } - unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); - unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); - newBinding.desc_set = set; - newBinding.binding = binding; - newBinding.msl_texture = binding - textureBindingOffset; - newBinding.msl_sampler = binding - textureBindingOffset; - msl.add_msl_resource_binding(newBinding); - } + for (auto& resource : resources.separate_samplers) + { + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; + newBinding.msl_texture = binding - textureBindingOffset; + newBinding.msl_sampler = binding - textureBindingOffset; + msl.add_msl_resource_binding(newBinding); + } - for (auto& resource : resources.storage_images) + for (auto& resource : resources.separate_images) + { + std::string name = msl.get_name(resource.id); + if (name.size() > 7 && 0 == bx::strCmp(name.c_str() + name.length() - 7, "Texture") ) { - std::string name = msl.get_name(resource.id); - - unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); - unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); - newBinding.desc_set = set; - newBinding.binding = binding; - newBinding.msl_texture = binding - textureBindingOffset; - newBinding.msl_sampler = binding - textureBindingOffset; - msl.add_msl_resource_binding(newBinding); + msl.set_name(resource.id, name.substr(0, name.length() - 7) ); } - std::string source = msl.compile(); + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; + newBinding.msl_texture = binding - textureBindingOffset; + newBinding.msl_sampler = binding - textureBindingOffset; + msl.add_msl_resource_binding(newBinding); + } - // fix https://github.com/bkaradzic/bgfx/issues/2822 - // insert struct member which declares point size, defaulted to 1 - if ('v' == _options.shaderType) - { - const bx::StringView xlatMtlMainOut("xlatMtlMain_out\n{"); - size_t pos = source.find(xlatMtlMainOut.getPtr() ); + for (auto& resource : resources.storage_images) + { + std::string name = msl.get_name(resource.id); + + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; + newBinding.msl_texture = binding - textureBindingOffset; + newBinding.msl_sampler = binding - textureBindingOffset; + msl.add_msl_resource_binding(newBinding); + } - if (pos != std::string::npos) - { - pos += xlatMtlMainOut.getLength(); - source.insert(pos, "\n\tfloat bgfx_metal_pointSize [[point_size]] = 1;"); - } - } + std::string source = msl.compile(); + + // fix https://github.com/bkaradzic/bgfx/issues/2822 + // insert struct member which declares point size, defaulted to 1 + if ('v' == _options.shaderType) + { + const bx::StringView xlatMtlMainOut("xlatMtlMain_out\n{"); + size_t pos = source.find(xlatMtlMainOut.getPtr() ); - if ('c' == _options.shaderType) + if (pos != std::string::npos) { - for (int i = 0; i < 3; ++i) - { - uint16_t dim = (uint16_t)msl.get_execution_mode_argument( - spv::ExecutionMode::ExecutionModeLocalSize - , i - ); - bx::write(_shaderWriter, dim, &err); - } + pos += xlatMtlMainOut.getLength(); + source.insert(pos, "\n\tfloat bgfx_metal_pointSize [[point_size]] = 1;"); } - - uint32_t shaderSize = (uint32_t)source.size(); - bx::write(_shaderWriter, shaderSize, &err); - bx::write(_shaderWriter, source.c_str(), shaderSize, &err); - uint8_t nul = 0; - bx::write(_shaderWriter, nul, &err); } - else + + if ('c' == _options.shaderType) { - uint32_t shaderSize = (uint32_t)spirv.size() * sizeof(uint32_t); - bx::write(_shaderWriter, shaderSize, &err); - bx::write(_shaderWriter, spirv.data(), shaderSize, &err); - uint8_t nul = 0; - bx::write(_shaderWriter, nul, &err); + for (int i = 0; i < 3; ++i) + { + uint16_t dim = (uint16_t)msl.get_execution_mode_argument( + spv::ExecutionMode::ExecutionModeLocalSize + , i + ); + bx::write(_shaderWriter, dim, &err); + } } - // + + const uint32_t shaderSize = (uint32_t)source.size(); + bx::write(_shaderWriter, shaderSize, &err); + bx::write(_shaderWriter, source.c_str(), shaderSize, &err); + const uint8_t nul = 0; + bx::write(_shaderWriter, nul, &err); + const uint8_t numAttr = (uint8_t)program->getNumLiveAttributes(); bx::write(_shaderWriter, numAttr, &err); diff --git a/bgfx/tools/shaderc/shaderc_pssl.cpp b/bgfx/tools/shaderc/shaderc_pssl.cpp index 9a6dc838..d086f7e1 100644 --- a/bgfx/tools/shaderc/shaderc_pssl.cpp +++ b/bgfx/tools/shaderc/shaderc_pssl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/shaderc/shaderc_spirv.cpp b/bgfx/tools/shaderc/shaderc_spirv.cpp index a8d3d4e1..99f466c8 100644 --- a/bgfx/tools/shaderc/shaderc_spirv.cpp +++ b/bgfx/tools/shaderc/shaderc_spirv.cpp @@ -1,10 +1,12 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #include "shaderc.h" +#include // std::cout + BX_PRAGMA_DIAGNOSTIC_PUSH() BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4100) // error C4100: 'inclusionDepth' : unreferenced formal parameter BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4265) // error C4265: 'spv::spirvbin_t': class has virtual functions, but destructor is not virtual @@ -17,7 +19,7 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow") // warning: declaration of 'u #include #include #include -#include +#include #define SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS #include #include @@ -300,7 +302,7 @@ namespace bgfx { namespace spirv "a_texcoord6", "a_texcoord7", }; - BX_STATIC_ASSERT(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) ); + static_assert(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) ); bgfx::Attrib::Enum toAttribEnum(const bx::StringView& _name) { @@ -373,9 +375,11 @@ namespace bgfx { namespace spirv return size; } - static spv_target_env getSpirvTargetVersion(uint32_t version) + static spv_target_env getSpirvTargetVersion(uint32_t _version, bx::WriterI* _messageWriter) { - switch (version) + bx::ErrorAssert err; + + switch (_version) { case 1010: return SPV_ENV_VULKAN_1_0; @@ -388,14 +392,16 @@ namespace bgfx { namespace spirv case 1613: return SPV_ENV_VULKAN_1_3; default: - BX_ASSERT(0, "Unknown SPIR-V version requested. Returning SPV_ENV_VULKAN_1_0 as default."); + bx::write(_messageWriter, &err, "Warning: Unknown SPIR-V version requested. Returning SPV_ENV_VULKAN_1_0 as default.\n"); return SPV_ENV_VULKAN_1_0; } } - static glslang::EShTargetClientVersion getGlslangTargetVulkanVersion(uint32_t version) + static glslang::EShTargetClientVersion getGlslangTargetVulkanVersion(uint32_t _version, bx::WriterI* _messageWriter) { - switch (version) + bx::ErrorAssert err; + + switch (_version) { case 1010: return glslang::EShTargetVulkan_1_0; @@ -407,14 +413,16 @@ namespace bgfx { namespace spirv case 1613: return glslang::EShTargetVulkan_1_3; default: - BX_ASSERT(0, "Unknown SPIR-V version requested. Returning EShTargetVulkan_1_0 as default."); + bx::write(_messageWriter, &err, "Warning: Unknown SPIR-V version requested. Returning EShTargetVulkan_1_0 as default.\n"); return glslang::EShTargetVulkan_1_0; } } - static glslang::EShTargetLanguageVersion getGlslangTargetSpirvVersion(uint32_t version) + static glslang::EShTargetLanguageVersion getGlslangTargetSpirvVersion(uint32_t _version, bx::WriterI* _messageWriter) { - switch (version) + bx::ErrorAssert err; + + switch (_version) { case 1010: return glslang::EShTargetSpv_1_0; @@ -427,7 +435,7 @@ namespace bgfx { namespace spirv case 1613: return glslang::EShTargetSpv_1_6; default: - BX_ASSERT(0, "Unknown SPIR-V version requested. Returning EShTargetSpv_1_0 as default."); + bx::write(_messageWriter, &err, "Warning: Unknown SPIR-V version requested. Returning EShTargetSpv_1_0 as default.\n"); return glslang::EShTargetSpv_1_0; } } @@ -461,13 +469,14 @@ namespace bgfx { namespace spirv | EShMsgReadHlsl | EShMsgVulkanRules | EShMsgSpvRules + | EShMsgDebugInfo ); shader->setEntryPoint("main"); shader->setAutoMapBindings(true); shader->setEnvInput(glslang::EShSourceHlsl, stage, glslang::EShClientVulkan, s_GLSL_VULKAN_CLIENT_VERSION); - shader->setEnvClient(glslang::EShClientVulkan, getGlslangTargetVulkanVersion(_version)); - shader->setEnvTarget(glslang::EShTargetSpv, getGlslangTargetSpirvVersion(_version)); + shader->setEnvClient(glslang::EShClientVulkan, getGlslangTargetVulkanVersion(_version, _messageWriter)); + shader->setEnvTarget(glslang::EShTargetSpv, getGlslangTargetSpirvVersion(_version, _messageWriter)); // Reserve two spots for the stage UBOs shader->setShiftBinding(glslang::EResUbo, (stage == EShLanguage::EShLangFragment ? kSpirvFragmentBinding : kSpirvVertexBinding)); @@ -519,7 +528,7 @@ namespace bgfx { namespace spirv end = start + 20; } - printCode(_code.c_str(), line, start, end, column); + printCode(_code.c_str(), bx::uint32_satsub(line, 1), start, end, column); bx::write(_messageWriter, &messageErr, "%s\n", log); } @@ -698,17 +707,18 @@ namespace bgfx { namespace spirv program->dumpReflection(); } - BX_UNUSED(spv::MemorySemanticsAllMemory); - glslang::TIntermediate* intermediate = program->getIntermediate(stage); std::vector spirv; glslang::SpvOptions options; - options.disableOptimizer = false; + options.disableOptimizer = _options.debugInformation; + options.generateDebugInfo = _options.debugInformation; + options.emitNonSemanticShaderDebugInfo = _options.debugInformation; + options.emitNonSemanticShaderDebugSource = _options.debugInformation; glslang::GlslangToSpv(*intermediate, spirv, &options); - spvtools::Optimizer opt(getSpirvTargetVersion(_version)); + spvtools::Optimizer opt(getSpirvTargetVersion(_version, _messageWriter)); auto print_msg_to_stderr = [_messageWriter, &messageErr]( spv_message_level_t @@ -741,7 +751,7 @@ namespace bgfx { namespace spirv { if (g_verbose) { - glslang::SpirvToolsDisassemble(std::cout, spirv, getSpirvTargetVersion(_version)); + glslang::SpirvToolsDisassemble(std::cout, spirv, getSpirvTargetVersion(_version, _messageWriter)); } spirv_cross::CompilerReflection refl(spirv); diff --git a/bgfx/tools/texturev/common.sh b/bgfx/tools/texturev/common.sh index e3e41902..d77c2719 100644 --- a/bgfx/tools/texturev/common.sh +++ b/bgfx/tools/texturev/common.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -116,7 +116,7 @@ vec4 toOutput(vec4 _color, float _outputFormat, float _sdrWhiteNits) else if (_outputFormat < 2.5) { // output == 2 -> PQ - + // change primaries from sRGB/rec709 to rec2020 vec3 _xyz = toXyzFromSrgb(_color.xyz); outColor = toRec2020FromXyz(_xyz); diff --git a/bgfx/tools/texturev/fs_texture.bin.h b/bgfx/tools/texturev/fs_texture.bin.h index d231fd39..730177cc 100644 --- a/bgfx/tools/texturev/fs_texture.bin.h +++ b/bgfx/tools/texturev/fs_texture.bin.h @@ -305,496 +305,398 @@ static const uint8_t fs_texture_essl[2478] = 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, // gl_FragColor = 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tmpvar_3;.}... }; -static const uint8_t fs_texture_spv[4427] = +static const uint8_t fs_texture_spv[4379] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ - 0xfd, 0x7f, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x00, 0x10, 0x00, // ...u_params1.... - 0x01, 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1a, 0x00, 0xf8, 0x10, 0x00, 0x00, 0x03, // r0.............. - 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0xc9, 0x02, 0x00, 0x00, 0x00, // .#.............. + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ + 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x01, 0x10, 0x00, // ...u_params1.... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo + 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0xc8, 0x10, 0x00, 0x00, 0x03, // r0......."...... + 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xd9, 0x02, 0x00, 0x00, 0x00, // .#.............. 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, // ................ 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, // ...GLSL.std.450. 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. - 0x00, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x79, // ...e...h...l...y - 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4d, // ...main........M - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, // ...s_texColorSam - 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x50, 0x00, 0x00, 0x00, 0x73, // pler.......P...s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // _texColorTexture - 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x82, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, // ...........Unifo - 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x82, // rmBlock......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0 - 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x82, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, // ...............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x84, // _params1........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x65, 0x01, 0x00, 0x00, 0x67, // ...........e...g - 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, // l_FragCoord..... - 0x00, 0x05, 0x00, 0x68, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, // ...h...v_color0. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, // .......l...v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x79, 0x01, 0x00, 0x00, 0x62, // coord0.....y...b - 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, // gfx_FragData0..G - 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...M...".......G - 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, // ...M...!.......G - 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...P...".......G - 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, // ...P...!.......H - 0x00, 0x05, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...........#.... - 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x82, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, // ...H...........# - 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x82, 0x00, 0x00, 0x00, 0x02, // .......G........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G.......".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, // ...G.......!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x65, 0x01, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G...e........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...h........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G...l........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x79, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...y........ - 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ - 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ...L...........; - 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ...L...M....... - 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...O...........; - 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, // ...O...P........ - 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...S... .......+ - 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...S...T.......+ - 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, // ...S...X........ - 0x00, 0x03, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x1e, 0x00, 0x04, 0x00, 0x82, // ...x......@..... - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x83, // ........... .... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x83, // ...........;.... - 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x85, // ................ - 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x85, // ... .......+.... - 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x87, // ........... .... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x85, // ..........@+.... - 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x14, 0x00, 0x02, 0x00, 0x9b, // .........M;..... - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x52, // ...+...........R - 0xb8, 0x4e, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x3d, // .NA+...........= - 0x0a, 0x87, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x55, // ..?+...........U - 0x55, 0xd5, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xae, // U.>+............ - 0x47, 0x61, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x00, // Ga=+............ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x01, // ...+............ - 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x98, // ...+............ - 0x3a, 0xd3, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x37, // :.>+...........7 - 0x14, 0xb7, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x9c, // ..>+............ - 0xc4, 0x38, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc4, // .8>,............ - 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, // .........Y>+.... - 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x37, 0x14, 0x37, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, // .......7.7?+.... - 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0x7d, 0xd0, 0x93, 0x3d, 0x2c, 0x00, 0x06, 0x00, 0x15, // .......}..=,.... - 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xca, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x21, // ...+...........! - 0x62, 0x9e, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0xef, // b.<+............ - 0x1a, 0xf4, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x21, // ..=+...........! - 0x47, 0x73, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0xcc, // Gs?,............ - 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0xc1, // ...........,.... - 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xcf, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x3a, // ...+...........: - 0xbb, 0xdb, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x7c, // ..?+...........| - 0x1a, 0xb6, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0x3a, // ...+...........: - 0xb9, 0x81, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xd7, // ...,............ - 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0x2b, 0x00, 0x04, 0x00, 0x07, // .........*.+.... - 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xdb, 0xe8, 0xce, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, // ..........?+.... - 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xf1, 0x2c, 0x81, 0x3c, 0x2c, 0x00, 0x06, 0x00, 0x15, // ........,.<,.... - 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xdd, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x8d, // ...+............ - 0x81, 0x90, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x3a, // ..<+...........: - 0x30, 0x2f, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xab, // 0/.+............ - 0x2d, 0x71, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0xdf, // -q?,............ - 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0xc1, // ...........,.... - 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xe2, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, // ...+............ - 0x20, 0x23, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, // #>+............ - 0xb0, 0x9d, 0x42, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x00, // ..B+............ - 0x00, 0x56, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, // .V?+............ - 0xd0, 0x96, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0x00, // ..A+............ - 0x80, 0x95, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x17, // ..A+............ - 0xb7, 0xd1, 0x38, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, // ..8+............ - 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x00, // ..?+............ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x00, // ...+............ - 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x00, // ..?+.......".... - 0x00, 0xc0, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x00, // ..?+.......*.... - 0x00, 0x20, 0x40, 0x20, 0x00, 0x04, 0x00, 0x64, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, // . @ ...d........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x01, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x01, // ...;...d...e.... - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x01, // ...;...d...h.... - 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, // ... ...k........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x01, // ...;...k...l.... - 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x78, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, // ... ...x........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x78, 0x01, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x03, // ...;...x...y.... - 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xb7, 0x02, 0x00, 0x00, 0x78, // ...,...........x - 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x15, // ...x...x...,.... - 0x00, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x11, // ................ - 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0xea, // ...,............ - 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x15, // ...........,.... - 0x00, 0x00, 0x00, 0xba, 0x02, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xee, // ................ - 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xbb, 0x02, 0x00, 0x00, 0x01, // ...,............ - 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x15, // ...........,.... - 0x00, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc8, 0x02, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=.... - 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...N...M...=.... - 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, // ...Q...P...=.... - 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x15, // ...i...h...=.... - 0x00, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, // ...m...l...O.... - 0x00, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x00, // .......m...m.... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x87, 0x00, 0x00, 0x00, 0xa4, // .......A........ - 0x01, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x3d, // .......X.......= - 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x56, // ...............V - 0x00, 0x05, 0x00, 0x5c, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x4e, // ...........Q...N - 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, 0xc2, // ...X............ - 0x01, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0x4f, // ...............O - 0x00, 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, 0xc5, // ................ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x15, 0x00, 0x00, 0x00, 0xdf, // ................ - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0xb7, // ................ - 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x87, 0x00, 0x00, 0x00, 0xcf, 0x01, 0x00, 0x00, 0x84, // ...A............ - 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...X.......=.... - 0x00, 0x00, 0x00, 0xd0, 0x01, 0x00, 0x00, 0xcf, 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x15, // ...........P.... - 0x00, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0xd0, 0x01, 0x00, 0x00, 0xd0, 0x01, 0x00, 0x00, 0xd0, // ................ - 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0xd1, // ................ - 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x87, 0x00, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x84, // ...A............ - 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...X.......=.... - 0x00, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x91, // ................ - 0x00, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0xd8, // ................ - 0x01, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0e, // ...........O.... - 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, // ................ - 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x69, // ...............i - 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x87, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0x84, // ...A............ - 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...T.......=.... - 0x00, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x87, // ...........A.... - 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0xb4, // ...........T.... - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xb2, // ...=............ - 0x01, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9b, 0x00, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00, 0xb1, // ................ - 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x14, 0x02, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xf7, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xff, // ................ - 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xff, 0x01, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9b, // ................ - 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0xf7, // ...........".... - 0x00, 0x03, 0x00, 0x13, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x01, // ................ - 0x02, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x05, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, // ................ - 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0xb1, // ................ - 0x01, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x12, 0x02, 0x00, 0x00, 0x00, // ...*............ - 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x07, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x12, // ................ - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x08, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x15, // ...........O.... - 0x00, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x15, // ................ - 0x00, 0x00, 0x00, 0x6f, 0x02, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x90, // ...o............ - 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00, 0x6f, 0x02, 0x00, 0x00, 0xe3, // .......u...o.... - 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x75, // ...............u - 0x02, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x82, // ................ - 0x02, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x15, // ................ - 0x00, 0x00, 0x00, 0x85, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x82, // ................ - 0x02, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x89, // ................ - 0x02, 0x00, 0x00, 0x85, 0x02, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x15, // ................ - 0x00, 0x00, 0x00, 0x8b, 0x02, 0x00, 0x00, 0xba, 0x02, 0x00, 0x00, 0x89, 0x02, 0x00, 0x00, 0x8e, // ................ - 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0x85, 0x02, 0x00, 0x00, 0xf2, // ................ - 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0xbb, // ................ - 0x02, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x91, // ................ - 0x02, 0x00, 0x00, 0x8b, 0x02, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x15, // ................ - 0x00, 0x00, 0x00, 0x94, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x91, // ................ - 0x02, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x12, 0x02, 0x00, 0x00, 0xf8, // ................ - 0x00, 0x02, 0x00, 0x12, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc5, // ................ - 0x02, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, 0x05, 0x02, 0x00, 0x00, 0x94, 0x02, 0x00, 0x00, 0x08, // ................ - 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x13, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x02, // ................ - 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0xae, // ...O............ - 0x01, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x13, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x13, // ................ - 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc4, 0x02, 0x00, 0x00, 0xc5, // ................ - 0x02, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0xf9, // ................ - 0x00, 0x02, 0x00, 0x14, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x4f, // ...............O - 0x00, 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0xae, // ................ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0xfd, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...............+ - 0x00, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, 0xbb, 0x02, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0xfd, 0x01, 0x00, 0x00, 0x00, // .......(........ - 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x44, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, // .......D........ - 0x00, 0x03, 0x00, 0xae, 0x00, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x38, // .......8.......8 - 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x3a, 0x02, 0x00, 0x00, 0x28, // ...........:...( - 0x02, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x43, 0x02, 0x00, 0x00, 0x00, // ...........C.... - 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x3a, 0x02, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x3e, // .......:...;...> - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x3e, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // .......>........ - 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x28, // ...@...........( - 0x02, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x41, // ...............A - 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, // .......@........ - 0x00, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xf9, // ...B...A........ - 0x00, 0x02, 0x00, 0x44, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x85, // ...D.......;.... - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x28, // .......=.......( - 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x44, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x43, // .......D.......C - 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x44, 0x02, 0x00, 0x00, 0xf5, // ...........D.... - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbd, 0x02, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0x3e, // ...........B...> - 0x02, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x15, // ...=...;...R.... - 0x00, 0x00, 0x00, 0xae, 0x02, 0x00, 0x00, 0xbd, 0x02, 0x00, 0x00, 0xc8, 0x02, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0xfd, // ...Q.......,.... - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x56, 0x02, 0x00, 0x00, 0x00, // ...........V.... - 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xae, 0x00, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0xf8, // ...........J.... - 0x00, 0x02, 0x00, 0x4a, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x4c, // ...J...........L - 0x02, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x55, // ...,...........U - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x4d, // ...........L...M - 0x02, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x50, 0x02, 0x00, 0x00, 0x0c, // ...P.......P.... - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // .......R........ - 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // ...,............ - 0x00, 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0x83, // ...S.......R.... - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x54, 0x02, 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0xa9, // .......T...S.... - 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x56, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x4d, // .......V.......M - 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, 0x9f, // ...........O.... - 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x56, 0x02, 0x00, 0x00, 0xf8, // ...,.......V.... - 0x00, 0x02, 0x00, 0x55, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x56, // ...U...........V - 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbf, 0x02, 0x00, 0x00, 0x54, // ...............T - 0x02, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x52, // ...P...O...M...R - 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0xbf, 0x02, 0x00, 0x00, 0xae, // ................ - 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x30, // .......Q.......0 - 0x02, 0x00, 0x00, 0xfd, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x68, // ...............h - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xae, 0x00, 0x00, 0x00, 0x5c, // ................ - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x5c, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9b, // ................ - 0x00, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0xf7, // ...^...0........ - 0x00, 0x03, 0x00, 0x67, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x5e, // ...g...........^ - 0x02, 0x00, 0x00, 0x5f, 0x02, 0x00, 0x00, 0x62, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x62, // ..._...b.......b - 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x64, 0x02, 0x00, 0x00, 0x01, // ...........d.... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x85, // .......0........ - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x65, 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x64, // .......e.......d - 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x66, 0x02, 0x00, 0x00, 0x65, // ...........f...e - 0x02, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x68, 0x02, 0x00, 0x00, 0xf8, // ...........h.... - 0x00, 0x02, 0x00, 0x5f, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x61, // ..._...........a - 0x02, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x68, // .......0.......h - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x67, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, // .......g........ - 0x00, 0x02, 0x00, 0x68, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc1, // ...h............ - 0x02, 0x00, 0x00, 0x66, 0x02, 0x00, 0x00, 0x62, 0x02, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0x5f, // ...f...b...a..._ - 0x02, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0xc1, // ...R............ - 0x02, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x14, // ................ - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x14, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x15, // ................ - 0x00, 0x00, 0x00, 0xc3, 0x02, 0x00, 0x00, 0xc4, 0x02, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0xb4, // ................ - 0x02, 0x00, 0x00, 0x68, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, // ...h...Q........ - 0x02, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0xc3, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x19, 0x02, 0x00, 0x00, 0xc3, 0x02, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0xc3, // ...Q............ - 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1b, // .......P........ - 0x02, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x19, 0x02, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x17, // ................ - 0x02, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x79, 0x01, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0xfd, // ...>...y........ + 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. + 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x10, // ...l...p...}.... + 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, // ................ + 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m + 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x73, // ain........M...s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler + 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x50, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......P...s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, // ColorTexture.... + 0x00, 0x06, 0x00, 0x82, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, // .......UniformBl + 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, // ock............. + 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x06, // ...u_params0.... + 0x00, 0x06, 0x00, 0x82, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par + 0x61, 0x6d, 0x73, 0x31, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, // ams1............ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // .......l...v_col + 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x70, 0x01, 0x00, 0x00, 0x76, // or0........p...v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x7d, // _texcoord0.....} + 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData + 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...M...".... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...M...!.... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...P...".... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G...P...!.... + 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, // ...H...........# + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x82, 0x00, 0x00, 0x00, 0x01, // .......H........ + 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x82, // ...#.......G.... + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0x22, // .......G......." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0x21, // .......G.......! + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x1e, // .......G...l.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x70, 0x01, 0x00, 0x00, 0x1e, // .......G...p.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x1e, // .......G...}.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, // ...............! + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, // ................ + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, // ........... .... + 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ... ...L........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, // ...;...L...M.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ... ...O........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, // ...;...O...P.... + 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, // .......S... .... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, // ...+...S...T.... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, // ...+...S...X.... + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x1e, // .......x......@. + 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x3b, // ...............; + 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, // ................ + 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, // ....... .......+ + 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, // ..............@+ + 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x14, // .............M;. + 0x00, 0x02, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9f, // .......+........ + 0x00, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa4, // ...R.NA+........ + 0x00, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa6, // ...=..?+........ + 0x00, 0x00, 0x00, 0x55, 0x55, 0xd5, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0xae, // ...UU.>+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0xb4, // .......+........ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x15, // ................ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, // .......+........ + 0x00, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc5, // ....:.>+........ + 0x00, 0x00, 0x00, 0x37, 0x14, 0xb7, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc6, // ...7..>+........ + 0x00, 0x00, 0x00, 0x9c, 0xc4, 0x38, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc7, // .....8>,........ + 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x2b, // .............Y>+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x37, 0x14, 0x37, 0x3f, 0x2b, // ...........7.7?+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0x7d, 0xd0, 0x93, 0x3d, 0x2c, // ...........}..=, + 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0xc9, // ................ + 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, // .......+........ + 0x00, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, // ...!b.<+........ + 0x00, 0x00, 0x00, 0xef, 0x1a, 0xf4, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, // ......=+........ + 0x00, 0x00, 0x00, 0x21, 0x47, 0x73, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xcf, // ...!Gs?,........ + 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xcb, // ................ + 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, // .......+........ + 0x00, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, // ...:..?+........ + 0x00, 0x00, 0x00, 0x7c, 0x1a, 0xb6, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd9, // ...|...+........ + 0x00, 0x00, 0x00, 0x3a, 0xb9, 0x81, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xda, // ...:...,........ + 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0x2b, // .............*.+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xdb, 0xe8, 0xce, 0x3f, 0x2b, // ..............?+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xf1, 0x2c, 0x81, 0x3c, 0x2c, // ............,.<, + 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xdc, // ................ + 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, // .......+........ + 0x00, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe0, // ......<+........ + 0x00, 0x00, 0x00, 0x3a, 0x30, 0x2f, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe1, // ...:0/.+........ + 0x00, 0x00, 0x00, 0xab, 0x2d, 0x71, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xe2, // ....-q?,........ + 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xde, // ................ + 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xea, // .......+........ + 0x00, 0x00, 0x00, 0x00, 0x20, 0x23, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xec, // .... #>+........ + 0x00, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xee, // ......B+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, // .....V?+........ + 0x00, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf2, // ......A+........ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x95, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf5, // ......A+........ + 0x00, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, // ......8+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, // ......?+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, // .......+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x22, // ......?+......." + 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2a, // ......?+.......* + 0x01, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x20, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x01, // ..... @ ...h.... + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x6c, // .......;...h...l + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x01, // ....... ...o.... + 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x70, // .......;...o...p + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x03, // ....... ...|.... + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x7d, // .......;...|...} + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc5, // .......,........ + 0x02, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x2c, // ...x...x...x..., + 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc6, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x11, // ................ + 0x01, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc7, // .......,........ + 0x02, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc8, 0x02, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xee, // ................ + 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xc9, // .......,........ + 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xca, 0x02, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, // ................ + 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, // .......+........ + 0x02, 0x00, 0x00, 0xae, 0x47, 0x61, 0xbd, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, // ....Ga.6........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, // ................ + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x4d, // ...=.......N...M + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x50, // ...=.......Q...P + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x6c, // ...=.......m...l + 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x70, // ...=.......q...p + 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa7, 0x01, 0x00, 0x00, 0x71, // ...O...........q + 0x01, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, // ...q...........A + 0x00, 0x06, 0x00, 0x87, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x58, // ...............X + 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa9, // .......=........ + 0x01, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x5c, 0x00, 0x00, 0x00, 0xca, // .......V........ + 0x01, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, // ...Q...N...X.... + 0x00, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0xca, 0x01, 0x00, 0x00, 0xa7, 0x01, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0xa9, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0xac, // .......O........ + 0x01, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xe5, // ................ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x07, 0x00, 0x15, 0x00, 0x00, 0x00, 0xe7, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ................ + 0x00, 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0xc5, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x87, // ...........A.... + 0x00, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x86, // ...........X.... + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0xd7, // ...=............ + 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0xd8, // ...P............ + 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x15, // ................ + 0x00, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xe7, // ................ + 0x01, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x87, // ...........A.... + 0x00, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x92, // ...........X.... + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0xdd, // ...=............ + 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0x8e, // ................ + 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, 0xdf, // ................ + 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0xe0, // ...Q............ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xb5, // .......R........ + 0x02, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xb7, 0x02, 0x00, 0x00, 0xb1, // ...R............ + 0x01, 0x00, 0x00, 0xb5, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x52, // ...............R + 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xb7, // ................ + 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xb6, // ................ + 0x01, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x87, // .......m...A.... + 0x00, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0xae, // ...........T.... + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0xb8, // ...=............ + 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x87, 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x84, // ...A............ + 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...T.......=.... + 0x00, 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9b, // ................ + 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0xf7, // ................ + 0x00, 0x03, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xff, // ................ + 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x07, // ................ + 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0xb9, // ................ + 0x01, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x1b, 0x02, 0x00, 0x00, 0x00, // ..."............ + 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x09, 0x02, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0x0d, // ................ + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0d, 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9b, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x02, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0xf7, // ...........*.... + 0x00, 0x03, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x0f, // ................ + 0x02, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x10, // ................ + 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0xb6, // ...O............ + 0x01, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x77, 0x02, 0x00, 0x00, 0x12, // ...........w.... + 0x02, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x7d, // ...............} + 0x02, 0x00, 0x00, 0x77, 0x02, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x15, // ...w............ + 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x7d, 0x02, 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, 0x8e, // .......}........ + 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x8a, 0x02, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0xf5, // ................ + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x15, 0x00, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x8a, 0x02, 0x00, 0x00, 0xc7, 0x02, 0x00, 0x00, 0x8e, // ................ + 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0xf0, // ................ + 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x93, 0x02, 0x00, 0x00, 0xc8, // ................ + 0x02, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x97, // ................ + 0x02, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x15, // ................ + 0x00, 0x00, 0x00, 0x98, 0x02, 0x00, 0x00, 0xc9, 0x02, 0x00, 0x00, 0x97, 0x02, 0x00, 0x00, 0x88, // ................ + 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x99, 0x02, 0x00, 0x00, 0x93, 0x02, 0x00, 0x00, 0x98, // ................ + 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x15, 0x00, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x99, 0x02, 0x00, 0x00, 0xca, 0x02, 0x00, 0x00, 0xf9, // ................ + 0x00, 0x02, 0x00, 0x1a, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x1a, 0x02, 0x00, 0x00, 0xf5, // ................ + 0x00, 0x07, 0x00, 0x15, 0x00, 0x00, 0x00, 0xd7, 0x02, 0x00, 0x00, 0xc6, 0x02, 0x00, 0x00, 0x0d, // ................ + 0x02, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x1b, // ................ + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0a, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x15, // ...........O.... + 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x1b, // ................ + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x1b, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x15, // ................ + 0x00, 0x00, 0x00, 0xd6, 0x02, 0x00, 0x00, 0xd7, 0x02, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x0c, // ................ + 0x02, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x1c, 0x02, 0x00, 0x00, 0xf8, // ................ + 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x02, // .......O........ + 0x02, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x05, // ................ + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0xc6, // .......+........ + 0x02, 0x00, 0x00, 0xc9, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x30, // .......Q.......0 + 0x02, 0x00, 0x00, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x4c, // ...............L + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xae, 0x00, 0x00, 0x00, 0x40, // ...............@ + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x40, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9b, // .......@........ + 0x00, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0xf7, // ...B...0........ + 0x00, 0x03, 0x00, 0x4b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x42, // ...K...........B + 0x02, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, 0x46, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x46, // ...C...F.......F + 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x01, // ...........H.... + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x0c, // .......0........ + 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, // .......J.......2 + 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0xce, 0x02, 0x00, 0x00, 0xf9, // .......H........ + 0x00, 0x02, 0x00, 0x4c, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x43, 0x02, 0x00, 0x00, 0x85, // ...L.......C.... + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x30, // .......E.......0 + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x4c, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x4b, // .......L.......K + 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x4c, 0x02, 0x00, 0x00, 0xf5, // ...........L.... + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcf, 0x02, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0x46, // ...........J...F + 0x02, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...E...C...Q.... + 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x05, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf7, // ...4............ + 0x00, 0x03, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xae, // ...^............ + 0x00, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x52, 0x02, 0x00, 0x00, 0xbc, // ...R.......R.... + 0x00, 0x05, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x54, 0x02, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x9a, // .......T...4.... + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // .......]........ + 0x00, 0x04, 0x00, 0x54, 0x02, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0xf8, // ...T...U...X.... + 0x00, 0x02, 0x00, 0x58, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5a, // ...X...........Z + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0xa6, // ...........4.... + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5c, 0x02, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0xce, // ...2.......Z.... + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x5e, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x55, // .......^.......U + 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x57, 0x02, 0x00, 0x00, 0x9f, // ...........W.... + 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x5e, 0x02, 0x00, 0x00, 0xf8, // ...4.......^.... + 0x00, 0x02, 0x00, 0x5d, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x5e, // ...]...........^ + 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd1, 0x02, 0x00, 0x00, 0x5c, // ................ + 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x57, 0x02, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x51, // ...X...W...U...Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x05, 0x02, 0x00, 0x00, 0x02, // .......8........ + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x70, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, // .......p........ + 0x00, 0x03, 0x00, 0xae, 0x00, 0x00, 0x00, 0x64, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x64, // .......d.......d + 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x66, 0x02, 0x00, 0x00, 0x38, // ...........f...8 + 0x02, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x6f, 0x02, 0x00, 0x00, 0x00, // ...........o.... + 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x66, 0x02, 0x00, 0x00, 0x67, 0x02, 0x00, 0x00, 0x6a, // .......f...g...j + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // .......j........ + 0x00, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x38, // ...l...........8 + 0x02, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6e, // ...............n + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x6c, // .......2.......l + 0x02, 0x00, 0x00, 0xce, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x70, 0x02, 0x00, 0x00, 0xf8, // ...........p.... + 0x00, 0x02, 0x00, 0x67, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x69, // ...g...........i + 0x02, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x70, // .......8.......p + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x6f, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, // .......o........ + 0x00, 0x02, 0x00, 0x70, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd3, // ...p............ + 0x02, 0x00, 0x00, 0x6e, 0x02, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x69, 0x02, 0x00, 0x00, 0x67, // ...n...j...i...g + 0x02, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0xd8, 0x02, 0x00, 0x00, 0xcf, // ...P............ + 0x02, 0x00, 0x00, 0xd1, 0x02, 0x00, 0x00, 0xd3, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x1c, // ................ + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x1c, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x15, // ................ + 0x00, 0x00, 0x00, 0xd5, 0x02, 0x00, 0x00, 0xd6, 0x02, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0xd8, // ................ + 0x02, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1f, // ...p...Q........ + 0x02, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0xd5, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // ... ...........Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0xd5, 0x02, 0x00, 0x00, 0x01, // .......!........ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0xd5, // ...Q.......".... + 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x23, // .......P.......# + 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x1f, // ... ...!...".... + 0x02, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0xfd, // ...>...}...#.... 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ...8..... . }; -static const uint8_t fs_texture_dx9[1452] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, // ....u_params0... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // ........u_params - 0x31, 0x12, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x05, 0x00, 0x00, 0x00, // 1............... - 0x03, 0xff, 0xff, 0xfe, 0xff, 0x34, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0xa1, // .....4.CTAB..... - 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, // ................ - 0x91, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // .......X........ - 0x00, 0x02, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x02, // ...d.......t.... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, // ...s_texColor... - 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, // ...............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, // _params0........ - 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par - 0x61, 0x6d, 0x73, 0x31, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // ams1.ps_3_0.Micr - 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S - 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1 - 0x30, 0x2e, 0x31, 0x00, 0xab, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x1c, // 0.1....Q........ - 0x2e, 0x4d, 0x3b, 0x52, 0xb8, 0x4e, 0x41, 0x55, 0x55, 0xd5, 0x3e, 0x17, 0xb7, 0xd1, 0x38, 0x51, // .M;R.NAUU.>...8Q - 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0x3d, 0x0a, 0x87, 0x3f, 0xae, 0x47, 0x61, 0xbd, 0x00, // .......=..?.Ga.. - 0x00, 0xc0, 0xbf, 0x00, 0x00, 0x20, 0xc0, 0x51, 0x00, 0x00, 0x05, 0x04, 0x00, 0x0f, 0xa0, 0x00, // ..... .Q........ - 0xd0, 0x96, 0x41, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x80, 0x3f, 0x51, // ..A..V?...A...?Q - 0x00, 0x00, 0x05, 0x05, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xcd, // ..........?..... - 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x06, 0x00, 0x0f, 0xa0, 0xed, // ..@...?Q........ - 0xc6, 0x59, 0x3e, 0x37, 0x14, 0x37, 0x3f, 0x7d, 0xd0, 0x93, 0x3d, 0x00, 0xb0, 0x9d, 0x42, 0x51, // .Y>7.7?}..=...BQ - 0x00, 0x00, 0x05, 0x07, 0x00, 0x0f, 0xa0, 0x98, 0x3a, 0xd3, 0x3e, 0x37, 0x14, 0xb7, 0x3e, 0x9c, // ........:.>7..>. - 0xc4, 0x38, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x51, 0x00, 0x00, 0x05, 0x08, 0x00, 0x0f, 0xa0, 0x21, // .8>. #>Q.......! - 0x62, 0x9e, 0x3c, 0xef, 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x51, // b.<...=!Gs?....Q - 0x00, 0x00, 0x05, 0x09, 0x00, 0x0f, 0xa0, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, // .......:..?|...: - 0xb9, 0x81, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x0f, 0xa0, 0xd4, // .......Q........ - 0xab, 0x2a, 0xbf, 0xdb, 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x51, // .*....?.,.<....Q - 0x00, 0x00, 0x05, 0x0b, 0x00, 0x0f, 0xa0, 0x8d, 0x81, 0x90, 0x3c, 0x3a, 0x30, 0x2f, 0xbd, 0xab, // ..........<:0/.. - 0x2d, 0x71, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, // -q?............. - 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, // ................ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x05, // ................ - 0x00, 0xd0, 0xa0, 0x01, 0x00, 0xc4, 0x90, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, // ......._........ - 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x00, // ................ - 0x00, 0x00, 0x8b, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x8b, 0x0f, // .............U.. - 0x00, 0x00, 0x02, 0x01, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x8b, 0x05, 0x00, 0x00, 0x03, 0x01, // ................ - 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0xaa, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, // ................ - 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, // ................ - 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x12, // .U.............. - 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x02, // ................ - 0x00, 0xe4, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x01, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0xa0, 0x05, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, // ................ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x08, 0x80, 0x05, 0x00, 0xff, 0xa0, 0x29, 0x00, 0x04, 0x02, 0x01, // ...........).... - 0x00, 0x00, 0xa0, 0x01, 0x00, 0xff, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x17, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x02, // ... ............ - 0x00, 0xaa, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x03, // ................ - 0x00, 0x00, 0xa0, 0x03, 0x00, 0x55, 0xa0, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80, 0x00, // .....U. ........ - 0x00, 0x00, 0x80, 0x02, 0x00, 0xaa, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x02, 0x80, 0x01, // ................ - 0x00, 0x55, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x55, 0xa0, 0x20, 0x00, 0x00, 0x03, 0x01, // .U.......U. .... - 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0xaa, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, // .....U.......... - 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x55, 0xa0, 0x02, // .............U.. - 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x81, 0x02, 0x00, 0x00, 0xa0, 0x05, // ................ - 0x00, 0x00, 0x03, 0x03, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x55, 0xa0, 0x58, // .............U.X - 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x01, // ................ - 0x00, 0xc9, 0x80, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x07, // ...*............ - 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80, 0x06, // ................ - 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, 0x08, // ................ - 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, 0x80, 0x0b, // ................ - 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80, 0x09, // ................ - 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x02, 0x80, 0x0a, // ................ - 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x02, // ................ - 0x00, 0xe4, 0x80, 0x01, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, // .....U.......... - 0x00, 0xe4, 0x80, 0x02, 0x00, 0xff, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x01, // ................ - 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x0f, // .............U.. - 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, // ................ - 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x07, 0x00, 0xff, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, // ................ - 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, // ................ - 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x04, // .U.............. - 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xaa, 0xa0, 0x04, // ................ - 0x00, 0xff, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x06, // ................ - 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x03, // .........U...... - 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0c, 0x80, 0x03, // ................ - 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x03, 0x80, 0x01, 0x00, 0xee, 0x80, 0x01, // ................ - 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x04, // ................ - 0x00, 0x00, 0xa0, 0x04, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x03, // .....U.......... - 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x02, // ................ - 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0f, // .............U.. - 0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, // ................ - 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xff, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x03, // ................ - 0x00, 0x01, 0x80, 0x02, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x02, // ................ - 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x58, // .U.............X - 0x00, 0x00, 0x04, 0x01, 0x00, 0x0e, 0x80, 0x01, 0x00, 0x55, 0x80, 0x05, 0x00, 0x55, 0xa0, 0x03, // .........U...U.. - 0x00, 0x90, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, // ...X............ - 0x00, 0xf9, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, // .......+........ - 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ............ -}; -static const uint8_t fs_texture_dx11[1784] = +static const uint8_t fs_texture_dx11[1775] = { - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x09, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x00, 0x10, 0x00, // ...u_params1.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, // r0..........s_te - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // xColor0......... - 0x90, 0x06, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xa5, 0xc9, 0xc1, 0xcf, 0xd2, 0xcf, 0x2f, 0xfe, // ....DXBC....../. - 0xbc, 0x1f, 0x61, 0x29, 0x3e, 0x1c, 0x0d, 0x81, 0x01, 0x00, 0x00, 0x00, 0x90, 0x06, 0x00, 0x00, // ..a)>........... - 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, // ....,........... - 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNl........... - 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // P............... - 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ - 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // b............... - 0x02, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT - 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, // ION.COLOR.TEXCOO - 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // RD..OSGN,....... - 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ........... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, // ............SV_T - 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xb4, 0x05, 0x00, 0x00, // ARGET...SHDR.... - 0x40, 0x00, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, // @...m...Y...F. . - 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, // ........Z....`.. - 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....X....p...... - 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // UU..b........... - 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...2.......e... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, // . ......h....... - 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, // H...........F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, // ....F~.......`.. - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ......... - 0x2f, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, // /...r.......F... - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, // ........8...r... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@...@...@.... - 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....r.......F... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........r....... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // F.......F...A... - 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....2...r....... - 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // .. .........F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, // ....F........... - 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........:. ..... - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8...r....... - 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........F....... - 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // 8...........F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x08, // ....F.......1... - 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... - 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x04, 0x03, // .....@.....?.... - 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x20, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // ........6 ..r... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x0a, // ....F........... - 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, // r........@....M; - 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ..M;..M;....F... - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....8...r....... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, // F........@..R.NA - 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, // R.NAR.NA..../... - 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r.......F....... - 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 8...r.......F... - 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x55, 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, // .....@..UU.>UU.> - 0x55, 0x55, 0xd5, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // UU.>........r... - 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, // ....F.......2... - 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, // .@..=..?=..?=..? - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xae, 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, // .....@...Ga..Ga. - 0xae, 0x47, 0x61, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, // .Ga.....7...r... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....F.......F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, // ....F........... - 0x31, 0x00, 0x00, 0x0b, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, // 1...2......... . - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, // .........@.....? - 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, // .. @............ - 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, // .........@...:.> - 0x37, 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 7..>..8>....F... - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........"....... - 0x02, 0x40, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x37, 0x14, 0x37, 0x3f, 0x7d, 0xd0, 0x93, 0x3d, // .@....Y>7.7?}..= - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, // ....F........... - 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, // B........@..!b.< - 0xef, 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ...=!Gs?....F... - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ................ - 0x02, 0x40, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, 0xb9, 0x81, 0xbe, // .@..:..?|...:... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, // ....F........... - 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, // "........@....*. - 0xdb, 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ...?.,.<....F... - 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ........B....... - 0x02, 0x40, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x3a, 0x30, 0x2f, 0xbd, 0xab, 0x2d, 0x71, 0x3f, // .@.....<:0/..-q? - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....F.......8... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // r.......F....... - 0x56, 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, // V. .........8... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, // .@.....8...8...8 - 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ..../...r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, // F.......8...r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x00, 0x00, 0x00, // . #>. #>. #>.... - 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....r.......F... - 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ....2...r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, // F........@.....A - 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ...A...A.....@.. - 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x00, 0x00, // ..V?..V?..V?.... - 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 2...r.......F... - 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, // .....@.....A...A - 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // ...A.....@.....? - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, // ...?...?........ - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // r.......F....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // F......./...r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, // ....F.......8... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, // .@.....B...B...B - 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0xe2, 0x00, 0x10, 0x00, // F............... - 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, // ....V........... - 0x02, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....7...r....... - 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x96, 0x07, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05, // ............6... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... - 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, // >..... . + 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x06, 0x00, 0x00, 0x44, // r0.............D + 0x58, 0x42, 0x43, 0x4f, 0xe2, 0x4c, 0xcb, 0xf2, 0x57, 0x0d, 0x89, 0x4f, 0xdc, 0x8c, 0xbf, 0x27, // XBCO.L..W..O...' + 0x3d, 0xdf, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x9c, 0x06, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // =.m............, + 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, // ...........ISGNl + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, // ...........P.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, // ...........b.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, // ................ + 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, // ...SV_POSITION.C + 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, // OLOR.TEXCOORD..O + 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, // SGN,........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, // .......SV_TARGET + 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xc0, 0x05, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x70, // ...SHEX....P...p + 0x01, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...j...Y...F. .. + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, // .......Z....`... + 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, // ...X....p......U + 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, // U..b...........b + 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ...2.......e.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x48, // ......h.......H + 0x00, 0x00, 0x8e, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......CU....... + 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, // ...F.......F~... + 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, // ....`........ .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x01, // ......./...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...F...........8 + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, // ....@.....@...@. + 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, // ..@........r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, // ...F...........r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......F.......F + 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, // ...A.......2...r + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...F.......F.... + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, // ...............: + 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, // . .........8...r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // ...............F + 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......8........ + 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, // ...F.......F.... + 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, // ...1............ + 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, // . ..........@... + 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, // ..?............6 + 0x20, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ..r.......F.... + 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // .......r........ + 0x40, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x00, // @....M;..M;..M;. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, // ...F.......8...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x00, // @..R.NAR.NAR.NA. + 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, // .../...r.......F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x03, // .......8...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x55, // ...F........@..U + 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, // U.>UU.>UU.>..... + 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, // ...r.......F.... + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, // ...2...r.......F + 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, // ........@..=..?= + 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xae, // ..?=..?.....@... + 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x37, // Ga..Ga..Ga.....7 + 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...r.......F.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, // ...F.......F.... + 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x0b, 0x32, 0x00, 0x10, 0x00, 0x01, // .......1...2.... + 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ..... .......... + 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // @.....?.. @..... + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // ................ + 0x40, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, 0x37, 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, 0x00, // @...:.>7..>..8>. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, // ...F..........." + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x37, // ........@....Y>7 + 0x14, 0x37, 0x3f, 0x7d, 0xd0, 0x93, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // .7?}..=....F.... + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // .......B........ + 0x40, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, 0xef, 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, // @..!b.<...=!Gs?. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, // ...F............ + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, // ........@..:..?| + 0x1a, 0xb6, 0xbe, 0x3a, 0xb9, 0x81, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...:.......F.... + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // ......."........ + 0x40, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0xdb, 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, // @....*....?.,.<. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, // ...F...........B + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x3a, // ........@.....<: + 0x30, 0x2f, 0xbd, 0xab, 0x2d, 0x71, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // 0/..-q?....F.... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // ...8...r.......F + 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x56, 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......V. ...... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // ...8...r.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x17, // ........@.....8. + 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, // ..8...8..../...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, // .......F.......8 + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, // ....@... #>. #>. + 0x20, 0x23, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, // #>........r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, // ...F.......2...r + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, // @.....A...A...A. + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, // ....@....V?..V?. + 0x00, 0x56, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x02, // .V?....2...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ...F........@... + 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, // ..A...A...A..... + 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, // @.....?...?...?. + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // .......r.......F + 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2f, // .......F......./ + 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...r.......F.... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // ...8...r.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x00, // ........@.....B. + 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, // ..B...B........r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, // .......F........ + 0x00, 0x00, 0x07, 0xe2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x01, // ...........V.... + 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, // ...........7...r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // ...............F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, // ................ + 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...6.... ......F + 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, // .......>..... . }; -static const uint8_t fs_texture_mtl[3729] = +static const uint8_t fs_texture_mtl[4044] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ @@ -804,7 +706,7 @@ static const uint8_t fs_texture_mtl[3729] = 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par 0x61, 0x6d, 0x73, 0x31, 0x12, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, // ams1...........s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // _texColor....... - 0x00, 0x00, 0x00, 0x06, 0x0e, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // .......#include + 0x00, 0x00, 0x00, 0x41, 0x0f, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // ...A...#include 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, // .# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, // include ..using nam @@ -813,223 +715,242 @@ static const uint8_t fs_texture_mtl[3729] = 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, // float4 u_par 0x61, 0x6d, 0x73, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // ams0;. float4 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, // u_params1;.};.. - 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, // constant float3 - 0x5f, 0x37, 0x31, 0x32, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, // _712 = {};..stru - 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // ct xlatMtlMain_o - 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // ut.{. float4 - 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, // bgfx_FragData0 [ - 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // [color(0)]];.};. - 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // .struct xlatMtlM - 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ain_in.{. flo - 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, // at4 v_color0 [[u - 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // ser(locn0)]];. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // float3 v_texco - 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, // ord0 [[user(locn - 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, // 1)]];.};..fragme - 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // nt xlatMtlMain_o - 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, // ut xlatMtlMain(x - 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, // latMtlMain_in in - 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, // [[stage_in]], c - 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, // onstant _Global& - 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, // _mtl_u [[buffer - 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, // (0)]], texture2d - 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // s_texCol - 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, // or [[texture(0)] - 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, // ], sampler s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, // ColorSampler [[s - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // ampler(0)]]).{. - 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // xlatMtlMain_o - 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, // ut out = {};. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x35, 0x33, 0x20, 0x3d, 0x20, 0x73, // float4 _453 = s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, // _texColor.sample - 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, // (s_texColorSampl - 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // er, in.v_texcoor - 0x64, 0x30, 0x2e, 0x78, 0x79, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x28, 0x5f, 0x6d, 0x74, // d0.xy, level(_mt - 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x78, 0x29, // l_u.u_params0.x) - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, // );. float3 _4 - 0x32, 0x34, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x35, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // 24 = _453.xyz;. - 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, 0x37, 0x32, 0x20, 0x3d, // float3 _472 = - 0x20, 0x6d, 0x69, 0x78, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x61, 0x62, 0x73, 0x28, 0x5f, 0x34, 0x32, // mix(pow(abs(_42 - 0x34, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, 0x2e, 0x32, 0x30, 0x30, // 4), float3(2.200 - 0x30, 0x30, 0x30, 0x30, 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, 0x38, 0x29, 0x29, 0x2c, // 0000476837158)), - 0x20, 0x5f, 0x34, 0x32, 0x34, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x5f, 0x6d, // _424, float3(_m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x7a, // tl_u.u_params0.z - 0x29, 0x29, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x32, 0x2e, 0x30, 0x2c, 0x20, 0x5f, 0x6d, // )) * pow(2.0, _m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x77, // tl_u.u_params0.w - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, // );. float4 _4 - 0x33, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x34, 0x37, 0x32, // 30 = float4(_472 - 0x2e, 0x78, 0x2c, 0x20, 0x5f, 0x34, 0x37, 0x32, 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x34, 0x37, 0x32, // .x, _472.y, _472 - 0x2e, 0x7a, 0x2c, 0x20, 0x5f, 0x34, 0x35, 0x33, 0x2e, 0x77, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, // .z, _453.w) * in - 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // .v_color0;. f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x30, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // loat3 _707;. - 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // if (_mtl_u.u_par - 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, // ams1.x < 0.5). - 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // {. floa - 0x74, 0x33, 0x20, 0x5f, 0x35, 0x30, 0x39, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, // t3 _509 = fast:: - 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x34, 0x33, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, // clamp(_430.xyz, - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, // float3(0.0), flo - 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // at3(1.0));. - 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x35, 0x32, 0x20, 0x3d, 0x20, // float _552 = - 0x5f, 0x35, 0x30, 0x39, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _509.x;. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x30, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // float _701;. + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // struct xlatMtlMa + 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // in_out.{. flo + 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, // at4 bgfx_FragDat + 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, // a0 [[color(0)]]; + 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // .};..struct xlat + 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, // MtlMain_in.{. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // float4 v_color0 + 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, // [[user(locn0)]] + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x74, // ;. float3 v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, // excoord0 [[user( + 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, // locn1)]];.};..fr + 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // agment xlatMtlMa + 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // in_out xlatMtlMa + 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, // in(xlatMtlMain_i + 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, // n in [[stage_in] + 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, // ], constant _Glo + 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // bal& _mtl_u [[bu + 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // ffer(0)]], textu + 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, // re2d s_te + 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // xColor [[texture + 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, // (0)]], sampler s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler + 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, // [[sampler(0)]]) + 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // .{. xlatMtlMa + 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, // in_out out = {}; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x36, 0x31, // . float4 _461 + 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, // = s_texColor.sa + 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, // mple(s_texColorS + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, // ampler, in.v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, // coord0.xy, level + 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // (_mtl_u.u_params + 0x30, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 0.x));. float + 0x33, 0x20, 0x5f, 0x34, 0x32, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x36, 0x31, 0x2e, 0x78, 0x79, // 3 _428 = _461.xy + 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, // z;. float3 _4 + 0x38, 0x30, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x61, 0x62, 0x73, // 80 = mix(pow(abs + 0x28, 0x5f, 0x34, 0x32, 0x38, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, // (_428), float3(2 + 0x2e, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, // .200000047683715 + 0x38, 0x32, 0x30, 0x33, 0x31, 0x32, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x5f, 0x34, 0x32, 0x38, 0x2c, // 8203125)), _428, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // float3(_mtl_u.u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x70, // _params0.z)) * p + 0x6f, 0x77, 0x28, 0x32, 0x2e, 0x30, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // ow(2.0, _mtl_u.u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _params0.w);. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x39, 0x33, 0x20, 0x3d, 0x20, 0x5f, // float4 _693 = _ + 0x34, 0x36, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x33, 0x2e, 0x78, 0x20, // 461;. _693.x + 0x3d, 0x20, 0x5f, 0x34, 0x38, 0x30, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, // = _480.x;. _6 + 0x39, 0x33, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x38, 0x30, 0x2e, 0x79, 0x3b, 0x0a, 0x20, // 93.y = _480.y;. + 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x33, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x38, 0x30, // _693.z = _480 + 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, // .z;. float4 _ + 0x34, 0x33, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x33, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, // 438 = _693 * in. + 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // v_color0;. fl + 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x32, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, // oat3 _725;. i + 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // f (_mtl_u.u_para + 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, // ms1.x < 0.5). + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // {. float + 0x33, 0x20, 0x5f, 0x35, 0x31, 0x37, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, // 3 _517 = fast::c + 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x34, 0x33, 0x38, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, // lamp(_438.xyz, f + 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, // loat3(0.0), floa + 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // t3(1.0));. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x36, 0x30, 0x20, 0x3d, 0x20, 0x5f, // float _560 = _ + 0x35, 0x31, 0x37, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // 517.x;. f + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x31, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // loat _719;. + 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // do. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // if ( + 0x5f, 0x35, 0x36, 0x30, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, // _560 <= 0.003130 + 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, 0x30, // 8000907301902770 + 0x39, 0x39, 0x36, 0x30, 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 99609375). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x39, 0x20, 0x3d, 0x20, 0x31, // _719 = 1 + 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, // 2.92000007629394 + 0x35, 0x33, 0x31, 0x32, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x36, 0x30, 0x3b, 0x0a, 0x20, 0x20, // 53125 * _560;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, // br + 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // eak;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // }. e + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x5f, 0x37, 0x31, 0x39, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, 0x30, // _719 = fma(1.0 + 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, 0x39, // 5499994754791259 + 0x37, 0x36, 0x35, 0x36, 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x36, 0x30, // 765625, pow(_560 + 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, // , 0.416666656732 + 0x35, 0x35, 0x39, 0x32, 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, // 5592041015625), + 0x2d, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, // -0.0549999997019 + 0x37, 0x36, 0x37, 0x37, 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x3b, // 76776123046875); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . + 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, 0x65, // break; // unre + 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, 0x75, // achable workarou + 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, // nd. } whi + 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // le(false);. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x36, 0x34, 0x20, 0x3d, 0x20, // float _564 = + 0x5f, 0x35, 0x31, 0x37, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _517.y;. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x32, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // float _721;. 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, // do. { 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // . if - 0x28, 0x5f, 0x35, 0x35, 0x32, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, // (_552 <= 0.00313 - 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, // 08000907301903). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, // _7 - 0x30, 0x31, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, // 01 = 12.92000007 - 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x35, 0x32, 0x3b, 0x0a, // 6293945 * _552;. + 0x28, 0x5f, 0x35, 0x36, 0x34, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, // (_564 <= 0.00313 + 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, // 0800090730190277 + 0x30, 0x39, 0x39, 0x36, 0x30, 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 099609375). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x31, 0x20, 0x3d, 0x20, // _721 = + 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, // 12.9200000762939 + 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x36, 0x34, 0x3b, 0x0a, 0x20, // 453125 * _564;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, // b + 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // reak;. + 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x31, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, // _721 = fma(1. + 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, // 0549999475479125 + 0x39, 0x37, 0x36, 0x35, 0x36, 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x36, // 9765625, pow(_56 + 0x34, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, // 4, 0.41666665673 + 0x32, 0x35, 0x35, 0x39, 0x32, 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, // 25592041015625), + 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, // -0.054999999701 + 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, // 976776123046875) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. + 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, // break; // unr + 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, // eachable workaro + 0x75, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, // und. } wh + 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ile(false);. + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x36, 0x38, 0x20, 0x3d, // float _568 = + 0x20, 0x5f, 0x35, 0x31, 0x37, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _517.z;. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x32, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float _723;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // do. + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, // {. if + 0x20, 0x28, 0x5f, 0x35, 0x36, 0x38, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, // (_568 <= 0.0031 + 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, // 3080009073019027 + 0x37, 0x30, 0x39, 0x39, 0x36, 0x30, 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // 7099609375). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x33, 0x20, 0x3d, // _723 = + 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, // 12.920000076293 + 0x39, 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x36, 0x38, 0x3b, 0x0a, // 9453125 * _568;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, // _701 = (1.05 - 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, // 49999475479126 * - 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x35, 0x32, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, // pow(_552, 0.416 - 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, // 6666567325592)) - 0x2d, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, // - 0.054999999701 - 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 976776;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, // } while(fal - 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // se);. flo - 0x61, 0x74, 0x33, 0x20, 0x5f, 0x36, 0x38, 0x36, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x31, 0x32, 0x3b, // at3 _686 = _712; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x36, 0x2e, 0x78, 0x20, // . _686.x - 0x3d, 0x20, 0x5f, 0x37, 0x30, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _701;. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x35, 0x36, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x30, // float _556 = _50 - 0x39, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // 9.y;. flo - 0x61, 0x74, 0x20, 0x5f, 0x37, 0x30, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // at _703;. - 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // do. {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, // if (_5 - 0x35, 0x36, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, // 56 <= 0.00313080 - 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x20, // 00907301903). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x33, 0x20, // _703 - 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, // = 12.92000007629 - 0x33, 0x39, 0x34, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x35, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 3945 * _556;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, // bre - 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ak;. - 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, // }. el - 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, // se. { - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x5f, 0x37, 0x30, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, // _703 = (1.05499 - 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x70, 0x6f, // 99475479126 * po - 0x77, 0x28, 0x5f, 0x35, 0x35, 0x36, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, // w(_556, 0.416666 - 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x30, // 6567325592)) - 0 - 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, // .054999999701976 - 0x37, 0x37, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 776;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, // } while(false) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // ;. float3 - 0x20, 0x5f, 0x36, 0x38, 0x39, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x36, 0x3b, 0x0a, 0x20, 0x20, // _689 = _686;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x5f, // _689.y = _ - 0x37, 0x30, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // 703;. flo - 0x61, 0x74, 0x20, 0x5f, 0x35, 0x36, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x30, 0x39, 0x2e, 0x7a, // at _560 = _509.z - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // ;. float - 0x5f, 0x37, 0x30, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, // _705;. do - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // . {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, 0x36, 0x30, 0x20, // if (_560 - 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, // <= 0.00313080009 - 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 07301903). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x35, 0x20, 0x3d, 0x20, 0x31, // _705 = 1 - 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, // 2.92000007629394 - 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x36, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 5 * _560;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, // break; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // . }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, // _7 - 0x30, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, // 05 = (1.05499994 - 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, // 75479126 * pow(_ - 0x35, 0x36, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, // 560, 0.416666656 - 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x30, 0x2e, 0x30, 0x35, // 7325592)) - 0.05 - 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, // 4999999701976776 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. - 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // }. } - 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, // while(false);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x36, // float3 _6 - 0x39, 0x32, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 92 = _689;. - 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x32, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x30, 0x35, // _692.z = _705 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x37, 0x20, 0x3d, // ;. _707 = - 0x20, 0x5f, 0x36, 0x39, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // _692;. }. - 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // else. {. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x30, 0x38, 0x3b, // float3 _708; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, // . if (_mt - 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, // l_u.u_params1.x - 0x3c, 0x20, 0x31, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, // < 1.5). { - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, // . _70 - 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x33, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, // 8 = _430.xyz;. + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, // _723 = fma(1 + 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, // .054999947547912 + 0x35, 0x39, 0x37, 0x36, 0x35, 0x36, 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, // 59765625, pow(_5 + 0x36, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, // 68, 0.4166666567 + 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, // 325592041015625) + 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, // , -0.05499999970 + 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, // 1976776123046875 + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // );. + 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // else. {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // float - 0x33, 0x20, 0x5f, 0x37, 0x30, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 3 _709;. - 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // if (_mtl_u.u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x32, 0x2e, 0x35, // _params1.x < 2.5 - 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // ). {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x36, 0x34, 0x35, 0x20, 0x3d, 0x20, 0x70, 0x6f, // float3 _645 = po - 0x77, 0x28, 0x28, 0x28, 0x28, 0x5f, 0x34, 0x33, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, // w((((_430.xyz * - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // float3x3(float3( - 0x30, 0x2e, 0x34, 0x31, 0x32, 0x35, 0x35, 0x36, 0x34, 0x30, 0x39, 0x38, 0x33, 0x35, 0x38, 0x31, // 0.41255640983581 - 0x35, 0x34, 0x33, 0x2c, 0x20, 0x30, 0x2e, 0x33, 0x35, 0x37, 0x35, 0x37, 0x36, 0x31, 0x30, 0x32, // 543, 0.357576102 - 0x30, 0x31, 0x38, 0x33, 0x35, 0x36, 0x33, 0x32, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x38, 0x30, 0x34, // 01835632, 0.1804 - 0x33, 0x37, 0x35, 0x30, 0x35, 0x32, 0x34, 0x35, 0x32, 0x30, 0x38, 0x37, 0x34, 0x29, 0x2c, 0x20, // 3750524520874), - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x31, 0x32, 0x36, 0x37, 0x32, 0x39, // float3(0.2126729 - 0x30, 0x34, 0x31, 0x33, 0x33, 0x37, 0x39, 0x36, 0x36, 0x39, 0x2c, 0x20, 0x30, 0x2e, 0x37, 0x31, // 0413379669, 0.71 - 0x35, 0x31, 0x35, 0x32, 0x32, 0x30, 0x34, 0x30, 0x33, 0x36, 0x37, 0x31, 0x32, 0x36, 0x35, 0x2c, // 515220403671265, - 0x20, 0x30, 0x2e, 0x30, 0x37, 0x32, 0x31, 0x37, 0x35, 0x30, 0x30, 0x33, 0x35, 0x38, 0x38, 0x31, // 0.0721750035881 - 0x39, 0x39, 0x36, 0x31, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // 99615), float3(0 - 0x2e, 0x30, 0x31, 0x39, 0x33, 0x33, 0x33, 0x39, 0x30, 0x30, 0x38, 0x38, 0x33, 0x37, 0x39, 0x33, // .019333900883793 - 0x38, 0x33, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, 0x39, 0x31, 0x39, 0x31, 0x39, 0x39, 0x36, // 831, 0.119191996 - 0x37, 0x35, 0x33, 0x32, 0x31, 0x35, 0x37, 0x39, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x35, 0x30, 0x33, // 75321579, 0.9503 - 0x30, 0x34, 0x30, 0x39, 0x30, 0x39, 0x37, 0x36, 0x37, 0x31, 0x35, 0x30, 0x39, 0x29, 0x29, 0x29, // 0409097671509))) - 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, // * float3x3(floa - 0x74, 0x33, 0x28, 0x31, 0x2e, 0x37, 0x31, 0x36, 0x36, 0x35, 0x31, 0x32, 0x30, 0x31, 0x32, 0x34, // t3(1.71665120124 - 0x38, 0x31, 0x36, 0x38, 0x39, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x33, 0x35, 0x35, 0x36, 0x37, 0x30, // 81689, -0.355670 - 0x38, 0x30, 0x39, 0x37, 0x34, 0x35, 0x37, 0x38, 0x38, 0x35, 0x37, 0x2c, 0x20, 0x2d, 0x30, 0x2e, // 80974578857, -0. - 0x32, 0x35, 0x33, 0x33, 0x36, 0x36, 0x32, 0x39, 0x31, 0x35, 0x32, 0x32, 0x39, 0x37, 0x39, 0x37, // 2533662915229797 - 0x34, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x36, 0x36, // 4), float3(-0.66 - 0x36, 0x36, 0x38, 0x34, 0x33, 0x38, 0x39, 0x31, 0x31, 0x34, 0x33, 0x37, 0x39, 0x38, 0x38, 0x2c, // 668438911437988, + 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, // break; // un + 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, // reachable workar + 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, // ound. } w + 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // hile(false);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x35, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // _725 = floa + 0x74, 0x33, 0x28, 0x5f, 0x37, 0x31, 0x39, 0x2c, 0x20, 0x5f, 0x37, 0x32, 0x31, 0x2c, 0x20, 0x5f, // t3(_719, _721, _ + 0x37, 0x32, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // 723);. }. + 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // else. {. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x32, 0x36, 0x3b, 0x0a, // float3 _726;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // if (_mtl + 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, // _u.u_params1.x < + 0x20, 0x31, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // 1.5). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x36, // _726 + 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x33, 0x38, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, // = _438.xyz;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // }. e + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // lse. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // float3 + 0x20, 0x5f, 0x37, 0x32, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _727;. + 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // if (_mtl_u.u_ + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x32, 0x2e, 0x35, 0x29, // params1.x < 2.5) + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // . {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // f + 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x36, 0x35, 0x33, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, // loat3 _653 = pow + 0x28, 0x28, 0x28, 0x28, 0x5f, 0x34, 0x33, 0x38, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x66, // ((((_438.xyz * f + 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // loat3x3(float3(0 + 0x2e, 0x34, 0x31, 0x32, 0x35, 0x35, 0x36, 0x34, 0x30, 0x39, 0x38, 0x33, 0x35, 0x38, 0x31, 0x35, // .412556409835815 + 0x34, 0x32, 0x39, 0x36, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x33, 0x35, 0x37, 0x35, 0x37, // 4296875, 0.35757 + 0x36, 0x31, 0x30, 0x32, 0x30, 0x31, 0x38, 0x33, 0x35, 0x36, 0x33, 0x32, 0x33, 0x32, 0x34, 0x32, // 6102018356323242 + 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x38, 0x30, 0x34, 0x33, 0x37, 0x35, 0x30, // 1875, 0.18043750 + 0x35, 0x32, 0x34, 0x35, 0x32, 0x30, 0x38, 0x37, 0x34, 0x30, 0x32, 0x33, 0x34, 0x33, 0x37, 0x35, // 5245208740234375 + 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x31, 0x32, 0x36, // ), float3(0.2126 + 0x37, 0x32, 0x39, 0x30, 0x34, 0x31, 0x33, 0x33, 0x37, 0x39, 0x36, 0x36, 0x39, 0x31, 0x38, 0x39, // 7290413379669189 + 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x37, 0x31, 0x35, 0x31, 0x35, 0x32, // 453125, 0.715152 + 0x32, 0x30, 0x34, 0x30, 0x33, 0x36, 0x37, 0x31, 0x32, 0x36, 0x34, 0x36, 0x34, 0x38, 0x34, 0x33, // 2040367126464843 + 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x37, 0x32, 0x31, 0x37, 0x35, 0x30, 0x30, 0x33, 0x35, // 75, 0.0721750035 + 0x38, 0x38, 0x31, 0x39, 0x39, 0x36, 0x31, 0x35, 0x34, 0x37, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, // 8819961547851562 + 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x39, // 5), float3(0.019 + 0x33, 0x33, 0x33, 0x39, 0x30, 0x30, 0x38, 0x38, 0x33, 0x37, 0x39, 0x33, 0x38, 0x33, 0x30, 0x38, // 3339008837938308 + 0x37, 0x31, 0x35, 0x38, 0x32, 0x30, 0x33, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, // 7158203125, 0.11 + 0x39, 0x31, 0x39, 0x31, 0x39, 0x39, 0x36, 0x37, 0x35, 0x33, 0x32, 0x31, 0x35, 0x37, 0x38, 0x39, // 9191996753215789 + 0x37, 0x39, 0x34, 0x39, 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x35, 0x30, // 794921875, 0.950 + 0x33, 0x30, 0x34, 0x30, 0x39, 0x30, 0x39, 0x37, 0x36, 0x37, 0x31, 0x35, 0x30, 0x38, 0x37, 0x38, // 3040909767150878 + 0x39, 0x30, 0x36, 0x32, 0x35, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 90625))) * float + 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x37, 0x31, 0x36, // 3x3(float3(1.716 + 0x36, 0x35, 0x31, 0x32, 0x30, 0x31, 0x32, 0x34, 0x38, 0x31, 0x36, 0x38, 0x39, 0x34, 0x35, 0x33, // 6512012481689453 + 0x31, 0x32, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x33, 0x35, 0x35, 0x36, 0x37, 0x30, 0x38, 0x30, // 125, -0.35567080 + 0x39, 0x37, 0x34, 0x35, 0x37, 0x38, 0x38, 0x35, 0x37, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, // 974578857421875, + 0x20, 0x2d, 0x30, 0x2e, 0x32, 0x35, 0x33, 0x33, 0x36, 0x36, 0x32, 0x39, 0x31, 0x35, 0x32, 0x32, // -0.253366291522 + 0x39, 0x37, 0x39, 0x37, 0x33, 0x36, 0x33, 0x32, 0x38, 0x31, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, // 979736328125), f + 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x36, 0x36, 0x36, 0x36, 0x38, 0x34, 0x33, // loat3(-0.6666843 + 0x38, 0x39, 0x31, 0x31, 0x34, 0x33, 0x37, 0x39, 0x38, 0x38, 0x32, 0x38, 0x31, 0x32, 0x35, 0x2c, // 891143798828125, 0x20, 0x31, 0x2e, 0x36, 0x31, 0x36, 0x34, 0x38, 0x31, 0x31, 0x38, 0x34, 0x39, 0x35, 0x39, 0x34, // 1.6164811849594 - 0x31, 0x31, 0x36, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x31, 0x35, 0x37, 0x36, 0x38, 0x35, 0x30, 0x30, // 116, 0.015768500 - 0x30, 0x34, 0x34, 0x39, 0x34, 0x31, 0x39, 0x30, 0x32, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, // 044941902), floa - 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x37, 0x36, 0x33, 0x39, 0x38, 0x39, 0x39, 0x36, 0x32, // t3(0.01763989962 - 0x36, 0x33, 0x37, 0x34, 0x32, 0x34, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x34, 0x32, 0x37, // 6374245, -0.0427 - 0x37, 0x30, 0x36, 0x30, 0x31, 0x38, 0x30, 0x39, 0x30, 0x32, 0x34, 0x38, 0x31, 0x31, 0x2c, 0x20, // 70601809024811, - 0x30, 0x2e, 0x39, 0x34, 0x32, 0x31, 0x30, 0x33, 0x30, 0x38, 0x37, 0x39, 0x30, 0x32, 0x30, 0x36, // 0.94210308790206 - 0x39, 0x30, 0x39, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // 909))) * _mtl_u. - 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x39, // u_params1.y) * 9 - 0x2e, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x34, 0x37, 0x33, 0x37, 0x38, 0x37, 0x35, 0x31, // .999999747378751 - 0x36, 0x65, 0x2d, 0x30, 0x30, 0x35, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // 6e-005, float3(0 - 0x2e, 0x31, 0x35, 0x39, 0x33, 0x30, 0x31, 0x37, 0x35, 0x37, 0x38, 0x31, 0x32, 0x35, 0x29, 0x29, // .1593017578125)) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. - 0x20, 0x20, 0x5f, 0x37, 0x30, 0x39, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x66, 0x6c, // _709 = pow((fl - 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x38, 0x33, 0x35, 0x39, 0x33, 0x37, 0x35, 0x29, 0x20, // oat3(0.8359375) - 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x34, 0x35, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x38, 0x35, 0x31, // + (_645 * 18.851 - 0x35, 0x36, 0x32, 0x35, 0x29, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // 5625)) / (float3 - 0x28, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x34, 0x35, 0x20, 0x2a, 0x20, // (1.0) + (_645 * - 0x31, 0x38, 0x2e, 0x36, 0x38, 0x37, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 18.6875)), float - 0x33, 0x28, 0x37, 0x38, 0x2e, 0x38, 0x34, 0x33, 0x37, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // 3(78.84375));. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x39, 0x20, // _709 - 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, // = float3(0.0);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x38, 0x20, 0x3d, 0x20, // _708 = - 0x5f, 0x37, 0x30, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // _709;. }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x37, 0x20, 0x3d, 0x20, 0x5f, // _707 = _ - 0x37, 0x30, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, // 708;. }. o - 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ut.bgfx_FragData - 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x37, 0x30, 0x37, 0x2c, // 0 = float4(_707, - 0x20, 0x5f, 0x34, 0x33, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, // _430.w);. re - 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x40, // turn out;.}....@ - 0x00, // . + 0x31, 0x31, 0x36, 0x32, 0x31, 0x30, 0x39, 0x33, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x31, // 1162109375, 0.01 + 0x35, 0x37, 0x36, 0x38, 0x35, 0x30, 0x30, 0x30, 0x34, 0x34, 0x39, 0x34, 0x31, 0x39, 0x30, 0x32, // 5768500044941902 + 0x31, 0x36, 0x30, 0x36, 0x34, 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, // 16064453125), fl + 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x37, 0x36, 0x33, 0x39, 0x38, 0x39, 0x39, // oat3(0.017639899 + 0x36, 0x32, 0x36, 0x33, 0x37, 0x34, 0x32, 0x34, 0x34, 0x36, 0x38, 0x39, 0x39, 0x34, 0x31, 0x34, // 6263742446899414 + 0x30, 0x36, 0x32, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x34, 0x32, 0x37, 0x37, 0x30, 0x36, // 0625, -0.0427706 + 0x30, 0x31, 0x38, 0x30, 0x39, 0x30, 0x32, 0x34, 0x38, 0x31, 0x30, 0x37, 0x39, 0x31, 0x30, 0x31, // 0180902481079101 + 0x35, 0x36, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x34, 0x32, 0x31, 0x30, 0x33, 0x30, 0x38, // 5625, 0.94210308 + 0x37, 0x39, 0x30, 0x32, 0x30, 0x36, 0x39, 0x30, 0x39, 0x31, 0x37, 0x39, 0x36, 0x38, 0x37, 0x35, // 7902069091796875 + 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // ))) * _mtl_u.u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x39, 0x2e, 0x39, 0x39, // arams1.y) * 9.99 + 0x39, 0x39, 0x39, 0x39, 0x37, 0x34, 0x37, 0x33, 0x37, 0x38, 0x37, 0x35, 0x31, 0x36, 0x33, 0x35, // 9999747378751635 + 0x35, 0x35, 0x31, 0x34, 0x35, 0x32, 0x36, 0x33, 0x36, 0x37, 0x31, 0x38, 0x38, 0x65, 0x2d, 0x30, // 5514526367188e-0 + 0x35, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x31, 0x35, 0x39, 0x33, // 5, float3(0.1593 + 0x30, 0x31, 0x37, 0x35, 0x37, 0x38, 0x31, 0x32, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 017578125));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, // _72 + 0x37, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // 7 = pow((float3( + 0x30, 0x2e, 0x38, 0x33, 0x35, 0x39, 0x33, 0x37, 0x35, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, // 0.8359375) + (_6 + 0x35, 0x33, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, // 53 * 18.8515625) + 0x29, 0x20, 0x2f, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, // ) / (float3(1.0) + 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x35, 0x33, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x36, 0x38, // + (_653 * 18.68 + 0x37, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x37, 0x38, 0x2e, // 75)), float3(78. + 0x38, 0x34, 0x33, 0x37, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 84375));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x37, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, // _727 = flo + 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // at3(0.0);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x36, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x32, 0x37, 0x3b, // _726 = _727; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // . }. + 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x32, 0x36, 0x3b, 0x0a, // _725 = _726;. + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, // }. out.bg + 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, // fx_FragData0 = f + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x37, 0x32, 0x35, 0x2c, 0x20, 0x5f, 0x34, 0x33, 0x38, // loat4(_725, _438 + 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, // .w);. return + 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x40, 0x00, // out;.}....@. }; extern const uint8_t* fs_texture_pssl; extern const uint32_t fs_texture_pssl_size; diff --git a/bgfx/tools/texturev/fs_texture.sc b/bgfx/tools/texturev/fs_texture.sc index 4ac9dfe4..ce398906 100644 --- a/bgfx/tools/texturev/fs_texture.sc +++ b/bgfx/tools/texturev/fs_texture.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/texturev/fs_texture_3d.bin.h b/bgfx/tools/texturev/fs_texture_3d.bin.h index f54b675e..bfd228c8 100644 --- a/bgfx/tools/texturev/fs_texture_3d.bin.h +++ b/bgfx/tools/texturev/fs_texture_3d.bin.h @@ -316,503 +316,405 @@ static const uint8_t fs_texture_3d_essl[2564] = 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, // lor = tmpvar_4;. 0x7d, 0x0a, 0x0a, 0x00, // }... }; -static const uint8_t fs_texture_3d_spv[4487] = +static const uint8_t fs_texture_3d_spv[4439] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ - 0xfd, 0x7f, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x00, 0x10, 0x00, // ...u_params1.... - 0x01, 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1a, 0x00, 0x34, 0x11, 0x00, 0x00, 0x03, // r0.........4.... - 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0xd2, 0x02, 0x00, 0x00, 0x00, // .#.............. + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ + 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x01, 0x10, 0x00, // ...u_params1.... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo + 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x06, 0x22, 0x00, 0x04, 0x11, 0x00, 0x00, 0x03, // r0......."...... + 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xe2, 0x02, 0x00, 0x00, 0x00, // .#.............. 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, // ................ 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, // ...GLSL.std.450. 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. - 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x7d, // ...i...l...p...} - 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4b, // ...main........K - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, // ...s_texColorSam - 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x73, // pler.......N...s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // _texColorTexture - 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, // ...........Unifo - 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x80, // rmBlock......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0 - 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, // ...............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x82, // _params1........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x69, 0x01, 0x00, 0x00, 0x67, // ...........i...g - 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, // l_FragCoord..... - 0x00, 0x05, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, // ...l...v_color0. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x70, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, // .......p...v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x62, // coord0.....}...b - 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, // gfx_FragData0..G - 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...K...".......G - 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, // ...K...!.......G - 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...N...".......G - 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, // ...N...!.......H - 0x00, 0x05, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...........#.... - 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, // ...H...........# - 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x80, 0x00, 0x00, 0x00, 0x02, // .......G........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G.......".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, // ...G.......!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x69, 0x01, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G...i........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...l........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x70, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G...p........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...}........ - 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ - 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ...J...........; - 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ...J...K....... - 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...M...........; - 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, // ...M...N........ - 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...Q... .......+ - 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...Q...R.......+ - 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, // ...Q...V........ - 0x00, 0x03, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...Z.......+.... - 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x1e, 0x00, 0x04, 0x00, 0x80, // ...v......@..... - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x81, // ........... .... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x81, // ...........;.... - 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x83, // ................ - 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x83, // ... .......+.... - 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x85, // ........... .... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x83, // ..........@+.... - 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x14, 0x00, 0x02, 0x00, 0x99, // .........M;..... - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x52, // ...+...........R - 0xb8, 0x4e, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x3d, // .NA+...........= - 0x0a, 0x87, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x55, // ..?+...........U - 0x55, 0xd5, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xae, // U.>+............ - 0x47, 0x61, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x00, // Ga=+............ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x01, // ...+............ - 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x98, // ...+............ - 0x3a, 0xd3, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x37, // :.>+...........7 - 0x14, 0xb7, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x9c, // ..>+............ - 0xc4, 0x38, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc2, // .8>,............ - 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, // .........Y>+.... - 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x37, 0x14, 0x37, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, // .......7.7?+.... - 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x7d, 0xd0, 0x93, 0x3d, 0x2c, 0x00, 0x06, 0x00, 0x0b, // .......}..=,.... - 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc8, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0x21, // ...+...........! - 0x62, 0x9e, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xef, // b.<+............ - 0x1a, 0xf4, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x21, // ..=+...........! - 0x47, 0x73, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0xca, // Gs?,............ - 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0xbf, // ...........,.... - 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xcd, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x3a, // ...+...........: - 0xbb, 0xdb, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x7c, // ..?+...........| - 0x1a, 0xb6, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x3a, // ...+...........: - 0xb9, 0x81, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xd5, // ...,............ - 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0x2b, 0x00, 0x04, 0x00, 0x07, // .........*.+.... - 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xdb, 0xe8, 0xce, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, // ..........?+.... - 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xf1, 0x2c, 0x81, 0x3c, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ........,.<,.... - 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xdb, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x8d, // ...+............ - 0x81, 0x90, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x3a, // ..<+...........: - 0x30, 0x2f, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0xab, // 0/.+............ - 0x2d, 0x71, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xdd, // -q?,............ - 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0xbf, // ...........,.... - 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xe0, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x00, // ...+............ - 0x20, 0x23, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, // #>+............ - 0xb0, 0x9d, 0x42, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, // ..B+............ - 0x00, 0x56, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x00, // .V?+............ - 0xd0, 0x96, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, // ..A+............ - 0x80, 0x95, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x17, // ..A+............ - 0xb7, 0xd1, 0x38, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, // ..8+............ - 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x00, // ..?+............ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x01, 0x00, 0x00, 0x00, // ...+............ - 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, // ..?+....... .... - 0x00, 0xc0, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0x00, // ..?+.......(.... - 0x00, 0x20, 0x40, 0x20, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, // . @ ...h........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x01, // ...;...h...i.... - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x01, // ...;...h...l.... - 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, // ... ...o........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x01, // ...;...o...p.... - 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, // ... ...|........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x03, // ...;...|...}.... - 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x76, // ...,...........v - 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...v...v...,.... - 0x00, 0x00, 0x00, 0xc1, 0x02, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0f, // ................ - 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc2, 0x02, 0x00, 0x00, 0xe8, // ...,............ - 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...........,.... - 0x00, 0x00, 0x00, 0xc3, 0x02, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, // ................ - 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc4, 0x02, 0x00, 0x00, 0xff, // ...,............ - 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...........,.... - 0x00, 0x00, 0x00, 0xc5, 0x02, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd1, 0x02, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=.... - 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...L...K...=.... - 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, // ...O...N...=.... - 0x00, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, // ...m...l...=.... - 0x00, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, // ...q...p...A.... - 0x00, 0x00, 0x00, 0xa7, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0xb2, // ...........V.... - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0xa7, // ...=............ - 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa9, 0x01, 0x00, 0x00, 0x71, // ...Q...........q - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaa, // .......Q........ - 0x01, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, // ...q.......P.... - 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0xa9, 0x01, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0xa8, // ................ - 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x82, // ...A............ - 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...V.......=.... - 0x00, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x5a, // ...........V...Z - 0x00, 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x58, // .......O...L...X - 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0xab, // ................ - 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, // ...........O.... - 0x00, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xb1, // ................ - 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x41, // ...............A - 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, // ...............V - 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd9, // .......=........ - 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xda, // .......P........ - 0x01, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, // ................ - 0x00, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0x41, // ...............A - 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, // ...............V - 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, // .......=........ - 0x01, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe0, // ................ - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0xdf, // ................ - 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0xf4, // ................ - 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xb4, // .......O........ - 0x01, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, // ................ - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0e, // ................ - 0x00, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x41, // ...........m...A - 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x52, // ...............R - 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xba, // .......=........ - 0x01, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xbb, // .......A........ - 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x3d, // .......R.......= - 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, 0xb8, // ................ - 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x13, // ................ - 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x1d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // ................ - 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0xf8, // ................ - 0x00, 0x02, 0x00, 0x08, 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x0a, // ................ - 0x02, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x1c, // ....... ........ - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x0a, 0x02, 0x00, 0x00, 0x0b, // ................ - 0x02, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0e, 0x02, 0x00, 0x00, 0xb8, // ................ - 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x28, // ...............( - 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x1b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // ................ - 0x00, 0x04, 0x00, 0x10, 0x02, 0x00, 0x00, 0x11, 0x02, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0xf8, // ................ - 0x00, 0x02, 0x00, 0x11, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x13, // .......O........ - 0x02, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x78, // ...............x - 0x02, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x8e, // ...~...x........ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x19, 0x02, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, 0xbc, // ...........~.... - 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x8b, 0x02, 0x00, 0x00, 0x19, // ................ - 0x02, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x8e, // ................ - 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x8b, 0x02, 0x00, 0x00, 0xc2, // ................ - 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, 0x8e, // ................ - 0x02, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x94, // ................ - 0x02, 0x00, 0x00, 0xc3, 0x02, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0x98, 0x02, 0x00, 0x00, 0x8e, 0x02, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x81, // ................ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x99, 0x02, 0x00, 0x00, 0xc4, 0x02, 0x00, 0x00, 0x98, // ................ - 0x02, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0x94, // ................ - 0x02, 0x00, 0x00, 0x99, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9d, // ................ - 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0xc5, // ................ - 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x1b, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x1b, // ................ - 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xce, 0x02, 0x00, 0x00, 0xc1, // ................ - 0x02, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x9d, 0x02, 0x00, 0x00, 0x11, 0x02, 0x00, 0x00, 0xf9, // ................ - 0x00, 0x02, 0x00, 0x1c, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0b, 0x02, 0x00, 0x00, 0x4f, // ...............O - 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0d, 0x02, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0xb7, // ................ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf9, // ................ - 0x00, 0x02, 0x00, 0x1c, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x1c, 0x02, 0x00, 0x00, 0xf5, // ................ - 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xcd, 0x02, 0x00, 0x00, 0xce, 0x02, 0x00, 0x00, 0x1b, // ................ - 0x02, 0x00, 0x00, 0x0d, 0x02, 0x00, 0x00, 0x0b, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x1d, // ................ - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x01, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, // ...........O.... - 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x03, // ...........+.... - 0x02, 0x00, 0x00, 0xc1, 0x02, 0x00, 0x00, 0xc4, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, // ...1............ - 0x00, 0x03, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, // ...M............ - 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x41, 0x02, 0x00, 0x00, 0xbc, // ...A.......A.... - 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x98, // .......C...1.... - 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // .......L........ - 0x00, 0x04, 0x00, 0x43, 0x02, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x47, 0x02, 0x00, 0x00, 0xf8, // ...C...D...G.... - 0x00, 0x02, 0x00, 0x47, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x49, // ...G...........I - 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0xa4, // ...........1.... - 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0xa2, // ...........J.... - 0x00, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4b, // ...I...........K - 0x02, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x4d, // ...J...........M - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x44, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // .......D........ - 0x00, 0x00, 0x00, 0x46, 0x02, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0xf9, // ...F.......1.... - 0x00, 0x02, 0x00, 0x4d, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x4c, 0x02, 0x00, 0x00, 0xff, // ...M.......L.... - 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x4d, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, // .......M........ - 0x00, 0x00, 0x00, 0xc6, 0x02, 0x00, 0x00, 0x4b, 0x02, 0x00, 0x00, 0x47, 0x02, 0x00, 0x00, 0x46, // .......K...G...F - 0x02, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb7, // ...D...R........ - 0x02, 0x00, 0x00, 0xc6, 0x02, 0x00, 0x00, 0xd1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x35, 0x02, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0x01, // .......5........ - 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x5f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, // ......._........ - 0x00, 0x03, 0x00, 0xac, 0x00, 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x53, // .......S.......S - 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x35, // ...........U...5 - 0x02, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x00, // ...........^.... - 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x55, 0x02, 0x00, 0x00, 0x56, 0x02, 0x00, 0x00, 0x59, // .......U...V...Y - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x59, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // .......Y........ - 0x00, 0x00, 0x00, 0x5b, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x35, // ...[...........5 - 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5c, // ................ - 0x02, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x5b, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, // .......[........ - 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x5c, 0x02, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xf9, // ...]............ - 0x00, 0x02, 0x00, 0x5f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x56, 0x02, 0x00, 0x00, 0x85, // ..._.......V.... - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x35, // .......X.......5 - 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x5f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x5e, // ......._.......^ - 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x5f, 0x02, 0x00, 0x00, 0xf5, // ..........._.... - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc8, 0x02, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x59, // ...........]...Y - 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x56, 0x02, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0b, // ...X...V...R.... - 0x00, 0x00, 0x00, 0xba, 0x02, 0x00, 0x00, 0xc8, 0x02, 0x00, 0x00, 0xb7, 0x02, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0x06, // ...Q.......9.... - 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x71, 0x02, 0x00, 0x00, 0x00, // ...........q.... - 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, 0x00, 0x00, 0x00, 0x65, 0x02, 0x00, 0x00, 0xf8, // ...........e.... - 0x00, 0x02, 0x00, 0x65, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x67, // ...e...........g - 0x02, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x70, // ...9...........p - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x67, 0x02, 0x00, 0x00, 0x68, // ...........g...h - 0x02, 0x00, 0x00, 0x6b, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x0c, // ...k.......k.... - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6d, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // .......m........ - 0x00, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // ...9............ - 0x00, 0x00, 0x00, 0x6e, 0x02, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x6d, 0x02, 0x00, 0x00, 0x83, // ...n.......m.... - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6f, 0x02, 0x00, 0x00, 0x6e, 0x02, 0x00, 0x00, 0xa7, // .......o...n.... - 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x71, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x68, // .......q.......h - 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x9d, // ...........j.... - 0x00, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x71, 0x02, 0x00, 0x00, 0xf8, // ...9.......q.... - 0x00, 0x02, 0x00, 0x70, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x71, // ...p...........q - 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xca, 0x02, 0x00, 0x00, 0x6f, // ...............o - 0x02, 0x00, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x68, 0x02, 0x00, 0x00, 0x52, // ...k...j...h...R - 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xbd, 0x02, 0x00, 0x00, 0xca, 0x02, 0x00, 0x00, 0xba, // ................ - 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x1d, 0x02, 0x00, 0x00, 0xf8, // ................ - 0x00, 0x02, 0x00, 0x1d, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xcc, // ................ - 0x02, 0x00, 0x00, 0xcd, 0x02, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0xbd, 0x02, 0x00, 0x00, 0x71, // ...............q - 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0xb7, // ...Q....... .... - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x21, // .......Q.......! - 0x02, 0x00, 0x00, 0xcc, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0xcc, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, // ..."...........Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0xcc, 0x02, 0x00, 0x00, 0x02, // .......#........ - 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0x21, // ...P.......$...! - 0x02, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x3e, // ..."...#... ...> - 0x00, 0x03, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, // ...}...$.......8 + 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. + 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x74, 0x01, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x10, // ...p...t........ + 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, // ................ + 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m + 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x73, // ain........K...s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler + 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......N...s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, // ColorTexture.... + 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, // .......UniformBl + 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, // ock............. + 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x06, // ...u_params0.... + 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par + 0x61, 0x6d, 0x73, 0x31, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, // ams1............ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x70, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // .......p...v_col + 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x74, 0x01, 0x00, 0x00, 0x76, // or0........t...v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x81, // _texcoord0...... + 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData + 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...K...".... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...K...!.... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...N...".... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G...N...!.... + 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, // ...H...........# + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, // .......H........ + 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x80, // ...#.......G.... + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x22, // .......G......." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x21, // .......G.......! + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x70, 0x01, 0x00, 0x00, 0x1e, // .......G...p.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x74, 0x01, 0x00, 0x00, 0x1e, // .......G...t.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x81, 0x01, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, // ...............! + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, // ................ + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, // ........... .... + 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ... ...J........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, // ...;...J...K.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ... ...M........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, // ...;...M...N.... + 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, // .......Q... .... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x01, // ...+...Q...R.... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, // ...+...Q...V.... + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, // .......Z.......+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x1e, // .......v......@. + 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3b, // ...............; + 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, // ................ + 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, // ....... .......+ + 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, // ..............@+ + 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x14, // .............M;. + 0x00, 0x02, 0x00, 0x99, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9d, // .......+........ + 0x00, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa2, // ...R.NA+........ + 0x00, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa4, // ...=..?+........ + 0x00, 0x00, 0x00, 0x55, 0x55, 0xd5, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0xac, // ...UU.>+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0xb2, // .......+........ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc2, // .......+........ + 0x00, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, // ....:.>+........ + 0x00, 0x00, 0x00, 0x37, 0x14, 0xb7, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, // ...7..>+........ + 0x00, 0x00, 0x00, 0x9c, 0xc4, 0x38, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc5, // .....8>,........ + 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x2b, // .............Y>+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x37, 0x14, 0x37, 0x3f, 0x2b, // ...........7.7?+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x7d, 0xd0, 0x93, 0x3d, 0x2c, // ...........}..=, + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc7, // ................ + 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xca, // .......+........ + 0x00, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, // ...!b.<+........ + 0x00, 0x00, 0x00, 0xef, 0x1a, 0xf4, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, // ......=+........ + 0x00, 0x00, 0x00, 0x21, 0x47, 0x73, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xcd, // ...!Gs?,........ + 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc9, // ................ + 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd5, // .......+........ + 0x00, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd6, // ...:..?+........ + 0x00, 0x00, 0x00, 0x7c, 0x1a, 0xb6, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, // ...|...+........ + 0x00, 0x00, 0x00, 0x3a, 0xb9, 0x81, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd8, // ...:...,........ + 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0x2b, // .............*.+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xdb, 0xe8, 0xce, 0x3f, 0x2b, // ..............?+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xf1, 0x2c, 0x81, 0x3c, 0x2c, // ............,.<, + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xda, // ................ + 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdd, // .......+........ + 0x00, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xde, // ......<+........ + 0x00, 0x00, 0x00, 0x3a, 0x30, 0x2f, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, // ...:0/.+........ + 0x00, 0x00, 0x00, 0xab, 0x2d, 0x71, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe0, // ....-q?,........ + 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xdc, // ................ + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe8, // .......+........ + 0x00, 0x00, 0x00, 0x00, 0x20, 0x23, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xea, // .... #>+........ + 0x00, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xec, // ......B+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xee, // .....V?+........ + 0x00, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, // ......A+........ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x95, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf3, // ......A+........ + 0x00, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xff, // ......8+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0f, // ......?+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, // .......+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, // ......?+....... + 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, // ......?+.......( + 0x01, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x20, 0x00, 0x04, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x01, // ..... @ ...l.... + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x70, // .......;...l...p + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x73, 0x01, 0x00, 0x00, 0x01, // ....... ...s.... + 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x73, 0x01, 0x00, 0x00, 0x74, // .......;...s...t + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x80, 0x01, 0x00, 0x00, 0x03, // ....... ........ + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x80, 0x01, 0x00, 0x00, 0x81, // .......;........ + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xce, // .......,........ + 0x02, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x2c, // ...v...v...v..., + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xcf, 0x02, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0f, // ................ + 0x01, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd0, // .......,........ + 0x02, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd1, 0x02, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, // ................ + 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd2, // .......,........ + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd3, 0x02, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, // ................ + 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, // .......+........ + 0x02, 0x00, 0x00, 0xae, 0x47, 0x61, 0xbd, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, // ....Ga.6........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, // ................ + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4b, // ...=.......L...K + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4e, // ...=.......O...N + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x70, // ...=.......q...p + 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x74, // ...=.......u...t + 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x82, // ...A............ + 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...V.......=.... + 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // .......u.......Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x01, // ...........u.... + 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0xad, // ...P............ + 0x01, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, // ...........A.... + 0x00, 0x00, 0x00, 0xb1, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0xac, // ...........V.... + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0xb1, // ...=............ + 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x5a, 0x00, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x4f, // ...V...Z.......O + 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xd6, // ...L...X........ + 0x01, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb2, // ................ + 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0xd6, // ...O............ + 0x01, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xee, 0x01, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xee, // ................ + 0x01, 0x00, 0x00, 0xce, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xe0, // .......A........ + 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x3d, // .......V.......= + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x50, // ...............P + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe2, 0x01, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0xe1, // ................ + 0x01, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xfc, // ................ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xb5, // ................ + 0x01, 0x00, 0x00, 0xe2, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xe6, // .......A........ + 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x3d, // .......V.......= + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe7, 0x01, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ................ + 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0xe7, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xbe, 0x02, 0x00, 0x00, 0xb8, // ...R............ + 0x01, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x52, // ...............R + 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0xbe, // ................ + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbc, // .......Q........ + 0x01, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0e, // ...........R.... + 0x00, 0x00, 0x00, 0xc2, 0x02, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0xc2, // ................ + 0x02, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xc1, // ...q...A........ + 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x3d, // .......R.......= + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x41, // ...............A + 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x52, // ...............R + 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, // .......=........ + 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x08, // ................ + 0x02, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x13, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x25, // ...............% + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x08, 0x02, 0x00, 0x00, 0x09, // ................ + 0x02, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x10, 0x02, 0x00, 0x00, 0xb8, // ................ + 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x20, // ............... + 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x24, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // .......$........ + 0x00, 0x04, 0x00, 0x12, 0x02, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x16, 0x02, 0x00, 0x00, 0xf8, // ................ + 0x00, 0x02, 0x00, 0x16, 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x18, // ................ + 0x02, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x23, // .......(.......# + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x18, 0x02, 0x00, 0x00, 0x19, // ................ + 0x02, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x19, 0x02, 0x00, 0x00, 0x4f, // ...#...........O + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0xbf, // ................ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, // ................ + 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0xce, // ................ + 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x86, 0x02, 0x00, 0x00, 0x80, // ................ + 0x02, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x21, // ...............! + 0x02, 0x00, 0x00, 0x86, 0x02, 0x00, 0x00, 0xc4, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x93, 0x02, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x0c, // .......!........ + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x96, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ................ + 0x00, 0x00, 0x00, 0x93, 0x02, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x00, 0x96, 0x02, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x81, // ................ + 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0xd1, 0x02, 0x00, 0x00, 0x9a, // ................ + 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x96, // ................ + 0x02, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa1, // ................ + 0x02, 0x00, 0x00, 0xd2, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0xa2, 0x02, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0xa1, 0x02, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa5, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ................ + 0x00, 0x00, 0x00, 0xa2, 0x02, 0x00, 0x00, 0xd3, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x23, // ...............# + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x23, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, // .......#........ + 0x00, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0xcf, 0x02, 0x00, 0x00, 0x16, 0x02, 0x00, 0x00, 0xa5, // ................ + 0x02, 0x00, 0x00, 0x19, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x24, 0x02, 0x00, 0x00, 0xf8, // ...........$.... + 0x00, 0x02, 0x00, 0x13, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x15, // .......O........ + 0x02, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x24, 0x02, 0x00, 0x00, 0xf8, // ...........$.... + 0x00, 0x02, 0x00, 0x24, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xdf, // ...$............ + 0x02, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x15, 0x02, 0x00, 0x00, 0x13, // .......#........ + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x25, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x09, // .......%........ + 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0b, 0x02, 0x00, 0x00, 0xbf, // ...O............ + 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x0b, 0x02, 0x00, 0x00, 0xcf, 0x02, 0x00, 0x00, 0xd2, // ...+............ + 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0x0e, // ...Q.......9.... + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x55, 0x02, 0x00, 0x00, 0x00, // ...........U.... + 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, 0x00, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, 0xf8, // ...........I.... + 0x00, 0x02, 0x00, 0x49, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x4b, // ...I...........K + 0x02, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x54, // ...9...........T + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x4b, 0x02, 0x00, 0x00, 0x4c, // ...........K...L + 0x02, 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x4f, 0x02, 0x00, 0x00, 0x0c, // ...O.......O.... + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // .......Q........ + 0x00, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, // ...9............ + 0x00, 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xa2, // ...S.......2.... + 0x00, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, 0xd7, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x55, // ...Q...........U + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // .......L........ + 0x00, 0x00, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0xf9, // ...N.......9.... + 0x00, 0x02, 0x00, 0x55, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x54, 0x02, 0x00, 0x00, 0xff, // ...U.......T.... + 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x55, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, // .......U........ + 0x00, 0x00, 0x00, 0xd8, 0x02, 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, 0x4e, // .......S...O...N + 0x02, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3d, // ...L...Q.......= + 0x02, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x67, // ...............g + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, 0x00, 0x00, 0x00, 0x5b, // ...............[ + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x5b, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x99, // .......[........ + 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0xf7, // ...]...=........ + 0x00, 0x03, 0x00, 0x66, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x5d, // ...f...........] + 0x02, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x61, // ...^...a.......a + 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x01, // ...........c.... + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x0c, // .......=........ + 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x65, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, // .......e.......2 + 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0xd7, 0x02, 0x00, 0x00, 0xf9, // .......c........ + 0x00, 0x02, 0x00, 0x67, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x85, // ...g.......^.... + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x3d, // .......`.......= + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x67, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x66, // .......g.......f + 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x67, 0x02, 0x00, 0x00, 0xf5, // ...........g.... + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x02, 0x00, 0x00, 0x65, 0x02, 0x00, 0x00, 0x61, // ...........e...a + 0x02, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...`...^...Q.... + 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf7, // ...A............ + 0x00, 0x03, 0x00, 0x79, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, // ...y............ + 0x00, 0x00, 0x00, 0x6d, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x6d, 0x02, 0x00, 0x00, 0xbc, // ...m.......m.... + 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x6f, 0x02, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x98, // .......o...A.... + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x78, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // .......x........ + 0x00, 0x04, 0x00, 0x6f, 0x02, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x73, 0x02, 0x00, 0x00, 0xf8, // ...o...p...s.... + 0x00, 0x02, 0x00, 0x73, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x75, // ...s...........u + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0xa4, // ...........A.... + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x77, 0x02, 0x00, 0x00, 0x01, // ...........w.... + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00, 0xd7, // ...2.......u.... + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x79, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x70, // .......y.......p + 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x72, 0x02, 0x00, 0x00, 0x9d, // ...........r.... + 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x79, 0x02, 0x00, 0x00, 0xf8, // ...A.......y.... + 0x00, 0x02, 0x00, 0x78, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x79, // ...x...........y + 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdc, 0x02, 0x00, 0x00, 0x77, // ...............w + 0x02, 0x00, 0x00, 0x73, 0x02, 0x00, 0x00, 0x72, 0x02, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x50, // ...s...r...p...P + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe1, 0x02, 0x00, 0x00, 0xd8, 0x02, 0x00, 0x00, 0xda, // ................ + 0x02, 0x00, 0x00, 0xdc, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x25, 0x02, 0x00, 0x00, 0xf8, // ...........%.... + 0x00, 0x02, 0x00, 0x25, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xde, // ...%............ + 0x02, 0x00, 0x00, 0xdf, 0x02, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0xe1, 0x02, 0x00, 0x00, 0x79, // .......$.......y + 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0xbf, // ...Q.......(.... + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x29, // .......Q.......) + 0x02, 0x00, 0x00, 0xde, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0xde, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, // ...*...........Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x02, 0x00, 0x00, 0xde, 0x02, 0x00, 0x00, 0x02, // .......+........ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x29, // ...P.......,...) + 0x02, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x2b, 0x02, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x3e, // ...*...+...(...> + 0x00, 0x03, 0x00, 0x81, 0x01, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, // .......,.......8 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..... . }; -static const uint8_t fs_texture_3d_dx9[1448] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, // ....u_params0... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // ........u_params - 0x31, 0x12, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x05, 0x00, 0x00, 0x00, // 1..........X.... - 0x03, 0xff, 0xff, 0xfe, 0xff, 0x34, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0xa1, // .....4.CTAB..... - 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, // ................ - 0x91, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // .......X........ - 0x00, 0x02, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x02, // ...d.......t.... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, // ...s_texColor... - 0x00, 0x0d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, // ...............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, // _params0........ - 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par - 0x61, 0x6d, 0x73, 0x31, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // ams1.ps_3_0.Micr - 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S - 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1 - 0x30, 0x2e, 0x31, 0x00, 0xab, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, // 0.1....Q........ - 0xd0, 0x96, 0x41, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x80, 0x3f, 0x51, // ..A..V?...A...?Q - 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x1c, // ..........@...?. - 0x2e, 0x4d, 0x3b, 0x52, 0xb8, 0x4e, 0x41, 0x51, 0x00, 0x00, 0x05, 0x04, 0x00, 0x0f, 0xa0, 0x55, // .M;R.NAQ.......U - 0x55, 0xd5, 0x3e, 0x3d, 0x0a, 0x87, 0x3f, 0xae, 0x47, 0x61, 0xbd, 0x17, 0xb7, 0xd1, 0x38, 0x51, // U.>=..?.Ga....8Q - 0x00, 0x00, 0x05, 0x05, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0xc0, 0xbf, 0x00, 0x00, 0x20, 0xc0, 0x00, // ............. .. - 0x20, 0x23, 0x3e, 0x00, 0xb0, 0x9d, 0x42, 0x51, 0x00, 0x00, 0x05, 0x06, 0x00, 0x0f, 0xa0, 0x98, // #>...BQ........ - 0x3a, 0xd3, 0x3e, 0x37, 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x51, // :.>7..>..8>....Q - 0x00, 0x00, 0x05, 0x07, 0x00, 0x0f, 0xa0, 0xed, 0xc6, 0x59, 0x3e, 0x37, 0x14, 0x37, 0x3f, 0x7d, // .........Y>7.7?} - 0xd0, 0x93, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x08, 0x00, 0x0f, 0xa0, 0x21, // ..=....Q.......! - 0x62, 0x9e, 0x3c, 0xef, 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x51, // b.<...=!Gs?....Q - 0x00, 0x00, 0x05, 0x09, 0x00, 0x0f, 0xa0, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, // .......:..?|...: - 0xb9, 0x81, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x0f, 0xa0, 0xd4, // .......Q........ - 0xab, 0x2a, 0xbf, 0xdb, 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x51, // .*....?.,.<....Q - 0x00, 0x00, 0x05, 0x0b, 0x00, 0x0f, 0xa0, 0x8d, 0x81, 0x90, 0x3c, 0x3a, 0x30, 0x2f, 0xbd, 0xab, // ..........<:0/.. - 0x2d, 0x71, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, // -q?............. - 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, // ................ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x08, 0x0f, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x03, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0x80, 0x00, // ................ - 0x00, 0x14, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, // ..._............ - 0x08, 0xe4, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x8b, 0x0f, // ................ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x8b, 0x0f, 0x00, 0x00, 0x02, 0x01, // .........U...... - 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x8b, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x01, // ................ - 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x0e, // .............U.. - 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x12, 0x00, 0x00, 0x04, 0x01, // ................ - 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x0e, // ................ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x07, 0x80, 0x01, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x01, // ................ - 0x00, 0x02, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x29, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0xa0, 0x01, // .....U.)........ - 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x17, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x20, // .U............. - 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, 0xa0, 0x04, // ................ - 0x00, 0x00, 0x04, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x04, 0x00, 0x55, 0xa0, 0x04, // .............U.. - 0x00, 0xaa, 0xa0, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, // ... ............ - 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x04, // .............U.. - 0x00, 0x55, 0xa0, 0x04, 0x00, 0xaa, 0xa0, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, 0x00, // .U..... ........ - 0x00, 0x55, 0x80, 0x04, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x04, 0x80, 0x01, // .U.............. - 0x00, 0xaa, 0x80, 0x04, 0x00, 0x55, 0xa0, 0x04, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x02, // .....U.......... - 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x81, 0x03, 0x00, 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x03, // ................ - 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xff, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, // ...........X.... - 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xc9, 0x80, 0x2a, // ...............* - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80, 0x07, 0x00, 0xe4, 0xa0, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, 0x08, 0x00, 0xe4, 0xa0, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, 0x80, 0x0b, 0x00, 0xe4, 0xa0, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80, 0x09, 0x00, 0xe4, 0xa0, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x02, 0x80, 0x0a, 0x00, 0xe4, 0xa0, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x01, // ................ - 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, // .U.............. - 0x00, 0xff, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x0f, // ................ - 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x02, // .........U...... - 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x02, // ................ - 0x00, 0xe4, 0x80, 0x05, 0x00, 0xaa, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x01, // ................ - 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x0e, // .............U.. - 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, // ................ - 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xff, 0xa0, 0x06, // ................ - 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0x02, 0x03, // ................ - 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x80, 0x01, // .....U.......... - 0x00, 0xaa, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0x80, 0x05, 0x00, 0xe4, 0xa0, 0x02, // ................ - 0x00, 0x00, 0x03, 0x01, 0x00, 0x03, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x04, // ................ - 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, // ................ - 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x02, // .U.............. - 0x00, 0xe4, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x02, 0x00, 0x00, 0x80, 0x0f, // ................ - 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x03, // .........U...... - 0x00, 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x03, // ................ - 0x00, 0xe4, 0x80, 0x05, 0x00, 0xff, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x02, // ................ - 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0e, // .............U.. - 0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x58, 0x00, 0x00, 0x04, 0x01, // ...........X.... - 0x00, 0x0e, 0x80, 0x01, 0x00, 0x55, 0x80, 0x06, 0x00, 0xff, 0xa0, 0x03, 0x00, 0x90, 0x80, 0x58, // .....U.........X - 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0xf9, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, // ...+............ - 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ........ -}; -static const uint8_t fs_texture_3d_dx11[1828] = +static const uint8_t fs_texture_3d_dx11[1819] = { - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x09, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x00, 0x10, 0x00, // ...u_params1.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, // r0..........s_te - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // xColor0......... - 0xbc, 0x06, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xe8, 0x75, 0x88, 0xa8, 0x62, 0x1b, 0x56, 0x9f, // ....DXBC.u..b.V. - 0xd3, 0x8b, 0xbd, 0x79, 0xc8, 0x40, 0x19, 0x3c, 0x01, 0x00, 0x00, 0x00, 0xbc, 0x06, 0x00, 0x00, // ...y.@.<........ - 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, // ....,........... - 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNl........... - 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // P............... - 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ - 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // b............... - 0x02, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT - 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, // ION.COLOR.TEXCOO - 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // RD..OSGN,....... - 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ........... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, // ............SV_T - 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xe0, 0x05, 0x00, 0x00, // ARGET...SHDR.... - 0x40, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, // @...x...Y...F. . - 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, // ........Z....`.. - 0x00, 0x00, 0x00, 0x00, 0x58, 0x28, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....X(...p...... - 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // UU..b........... - 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...2.......e... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, // . ......h....... - 0x36, 0x00, 0x00, 0x05, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, // 6...2.......F... - 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...B....... - 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, // .. .........H... - 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F~.......`...... - 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x06, // .. ........./... - 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, // r.......F....... - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....8...r....... - 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, // F........@.....@ - 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, // ...@...@........ - 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // r.......F....... - 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....r.......F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F...A....... - 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, // 2...r......... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........F....... - 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, 0x82, 0x00, 0x10, 0x00, // F............... - 0x01, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....:. ......... - 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, // 8...r........... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ....F.......8... - 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, // F.......1....... - 0x01, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ...... ......... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, // .@.....?........ - 0x01, 0x00, 0x00, 0x00, 0x36, 0x20, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6 ..r....... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, // F...........r... - 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, // .....@....M;..M; - 0x1c, 0x2e, 0x4d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ..M;....F....... - 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 8...r.......F... - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, // .....@..R.NAR.NA - 0x52, 0xb8, 0x4e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // R.NA..../...r... - 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, // ....F.......8... - 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x55, 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, // .@..UU.>UU.>UU.> - 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ........r....... - 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, // F.......2...r... - 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x00, 0x00, 0x00, 0x00, // =..?=..?=..?.... - 0x02, 0x40, 0x00, 0x00, 0xae, 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, // .@...Ga..Ga..Ga. - 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....7...r....... - 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // F.......F....... - 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x0b, // F...........1... - 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 2......... ..... - 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x20, 0x40, // .....@.....?.. @ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, // ................ - 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, 0x37, 0x14, 0xb7, 0x3e, // .....@...:.>7..> - 0x9c, 0xc4, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ..8>....F....... - 0x10, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ...."........@.. - 0xed, 0xc6, 0x59, 0x3e, 0x37, 0x14, 0x37, 0x3f, 0x7d, 0xd0, 0x93, 0x3d, 0x00, 0x00, 0x00, 0x00, // ..Y>7.7?}..=.... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, // F...........B... - 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, 0xef, 0x1a, 0xf4, 0x3d, // .....@..!b.<...= - 0x21, 0x47, 0x73, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // !Gs?....F....... - 0x10, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // .............@.. - 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, 0xb9, 0x81, 0xbe, 0x00, 0x00, 0x00, 0x00, // :..?|...:....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, // F..........."... - 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0xdb, 0xe8, 0xce, 0x3f, // .....@....*....? - 0xf1, 0x2c, 0x81, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // .,.<....F....... - 0x10, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....B........@.. - 0x8d, 0x81, 0x90, 0x3c, 0x3a, 0x30, 0x2f, 0xbd, 0xab, 0x2d, 0x71, 0x3f, 0x00, 0x00, 0x00, 0x00, // ...<:0/..-q?.... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, // F.......8...r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x56, 0x85, 0x20, 0x00, // ....F.......V. . - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, // ........8...r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x00, 0x00, 0x00, 0x00, // ...8...8...8.... - 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // /...r.......F... - 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....8...r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x20, 0x23, 0x3e, // F........@... #> - 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, // . #>. #>........ - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r.......F....... - 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 2...r.......F... - 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, // .....@.....A...A - 0x00, 0xd0, 0x96, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x56, 0x3f, // ...A.....@....V? - 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, // ..V?..V?....2... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x00, 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, // .@.....A...A...A - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // .....@.....?...? - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, // ...?........r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....F.......F... - 0x02, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ..../...r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, // F.......8...r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0x00, 0x00, 0x00, // ...B...B...B.... - 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....r.......F... - 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0xe2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x56, 0x05, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // V............... - 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // 7...r........... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, // ....F........... - 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>... - 0x00, 0x00, 0x20, 0x00, // .. . + 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x06, 0x00, 0x00, 0x44, // r0.............D + 0x58, 0x42, 0x43, 0xd6, 0x21, 0x53, 0x7a, 0xd0, 0x59, 0x46, 0xac, 0x45, 0xdd, 0x85, 0xdd, 0x53, // XBC.!Sz.YF.E...S + 0xbb, 0x30, 0x50, 0x01, 0x00, 0x00, 0x00, 0xc8, 0x06, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // .0P............, + 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, // ...........ISGNl + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, // ...........P.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, // ...........b.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, // ................ + 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, // ...SV_POSITION.C + 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, // OLOR.TEXCOORD..O + 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, // SGN,........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, // .......SV_TARGET + 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xec, 0x05, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x7b, // ...SHEX....P...{ + 0x01, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...j...Y...F. .. + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, // .......Z....`... + 0x00, 0x00, 0x00, 0x58, 0x28, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, // ...X(...p......U + 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, // U..b...........b + 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ...2.......e.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x36, // ......h.......6 + 0x00, 0x00, 0x05, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, // ...2.......F.... + 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // ...6...B........ + 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8e, 0x42, // . .........H...B + 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...CU..........F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......F~....... + 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // `........ ...... + 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .../...r.......F + 0x02, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, // ...........8...r + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0x00, // @.....@...@...@. + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......r.......F + 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x02, // ...........r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, // ...F.......F...A + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, // .......2...r.... + 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ..... .........F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, // .......F........ + 0x00, 0x00, 0x06, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, // ...........:. .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, // .......8...r.... + 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...........F.... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...8...........F + 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, // .......F.......1 + 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, // ............. .. + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, // ........@.....?. + 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x20, 0x00, 0x05, 0x72, // ...........6 ..r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, // .......F........ + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x1c, // ...r........@... + 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x46, // .M;..M;..M;....F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, // .......8...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x52, // ...F........@..R + 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x2f, // .NAR.NAR.NA..../ + 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ...r.......F.... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, // ...8...r.......F + 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x55, 0x55, 0xd5, 0x3e, 0x55, // ........@..UU.>U + 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, // U.>UU.>........r + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x32, // .......F.......2 + 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, // ....@..=..?=..?= + 0x0a, 0x87, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xae, 0x47, 0x61, 0xbd, 0xae, // ..?.....@...Ga.. + 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, // Ga..Ga.....7...r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......F.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x12, // .......F........ + 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x0b, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, // ...1...2........ + 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // . ..........@... + 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // ..?.. @......... + 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x98, // ............@... + 0x3a, 0xd3, 0x3e, 0x37, 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, // :.>7..>..8>....F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x02, // ...........".... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x37, 0x14, 0x37, 0x3f, 0x7d, // ....@....Y>7.7?} + 0xd0, 0x93, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // ..=....F........ + 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x21, // ...B........@..! + 0x62, 0x9e, 0x3c, 0xef, 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x46, // b.<...=!Gs?....F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, // ....@..:..?|...: + 0xb9, 0x81, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, // .......F........ + 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xd4, // ..."........@... + 0xab, 0x2a, 0xbf, 0xdb, 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x46, // .*....?.,.<....F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x03, // ...........B.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x3a, 0x30, 0x2f, 0xbd, 0xab, // ....@.....<:0/.. + 0x2d, 0x71, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, // -q?....F.......8 + 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, // ...r.......F.... + 0x00, 0x00, 0x00, 0x56, 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, // ...V. .........8 + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x17, // ....@.....8...8. + 0xb7, 0xd1, 0x38, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, // ..8..../...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, // ...F.......8...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, // @... #>. #>. #>. + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // .......r.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x03, // .......2...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ...F........@... + 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, // ..A...A...A..... + 0x40, 0x00, 0x00, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, // @....V?..V?..V?. + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // ...2...r.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x80, 0x95, 0x41, 0x00, // ........@.....A. + 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ..A...A.....@... + 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x0e, // ..?...?...?..... + 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, // ...r.......F.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, // ...F......./...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, // .......F.......8 + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, // ....@.....B...B. + 0xb0, 0x9d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, // ..B........r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0xe2, // ...F............ + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, // .......V........ + 0x09, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, // .......7...r.... + 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ...........F.... + 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x36, // ...............6 + 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, // .... ......F.... + 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, // ...>..... . }; -static const uint8_t fs_texture_3d_mtl[3757] = +static const uint8_t fs_texture_3d_mtl[4072] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ @@ -822,7 +724,7 @@ static const uint8_t fs_texture_3d_mtl[3757] = 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par 0x61, 0x6d, 0x73, 0x31, 0x12, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, // ams1...........s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // _texColor....... - 0x00, 0x00, 0x00, 0x22, 0x0e, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // ..."...#include + 0x00, 0x00, 0x00, 0x5d, 0x0f, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // ...]...#include 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, // .# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, // include ..using nam @@ -831,224 +733,244 @@ static const uint8_t fs_texture_3d_mtl[3757] = 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, // float4 u_par 0x61, 0x6d, 0x73, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // ams0;. float4 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, // u_params1;.};.. - 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, // constant float3 - 0x5f, 0x37, 0x32, 0x31, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, // _721 = {};..stru - 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // ct xlatMtlMain_o - 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // ut.{. float4 - 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, // bgfx_FragData0 [ - 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // [color(0)]];.};. - 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // .struct xlatMtlM - 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ain_in.{. flo - 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, // at4 v_color0 [[u - 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // ser(locn0)]];. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // float3 v_texco - 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, // ord0 [[user(locn - 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, // 1)]];.};..fragme - 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // nt xlatMtlMain_o - 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, // ut xlatMtlMain(x - 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, // latMtlMain_in in - 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, // [[stage_in]], c - 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, // onstant _Global& - 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, // _mtl_u [[buffer - 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x33, 0x64, // (0)]], texture3d - 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // s_texCol - 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, // or [[texture(0)] - 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, // ], sampler s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, // ColorSampler [[s - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // ampler(0)]]).{. - 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // xlatMtlMain_o - 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, // ut out = {};. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x36, 0x32, 0x20, 0x3d, 0x20, 0x73, // float4 _462 = s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, // _texColor.sample - 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, // (s_texColorSampl - 0x65, 0x72, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // er, float3(in.v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x2c, 0x20, 0x5f, 0x6d, // texcoord0.xy, _m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x79, // tl_u.u_params0.y - 0x29, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // ), level(_mtl_u. - 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, // u_params0.x));. - 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, 0x33, 0x33, 0x20, 0x3d, // float3 _433 = - 0x20, 0x5f, 0x34, 0x36, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // _462.xyz;. f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, 0x38, 0x31, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, // loat3 _481 = mix - 0x28, 0x70, 0x6f, 0x77, 0x28, 0x61, 0x62, 0x73, 0x28, 0x5f, 0x34, 0x33, 0x33, 0x29, 0x2c, 0x20, // (pow(abs(_433), - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, 0x2e, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, // float3(2.2000000 - 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, 0x38, 0x29, 0x29, 0x2c, 0x20, 0x5f, 0x34, 0x33, // 476837158)), _43 - 0x33, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // 3, float3(_mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x7a, 0x29, 0x29, 0x20, 0x2a, // .u_params0.z)) * - 0x20, 0x70, 0x6f, 0x77, 0x28, 0x32, 0x2e, 0x30, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // pow(2.0, _mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, // .u_params0.w);. - 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x33, 0x39, 0x20, 0x3d, // float4 _439 = - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x34, 0x38, 0x31, 0x2e, 0x78, 0x2c, 0x20, // float4(_481.x, - 0x5f, 0x34, 0x38, 0x31, 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x34, 0x38, 0x31, 0x2e, 0x7a, 0x2c, 0x20, // _481.y, _481.z, - 0x5f, 0x34, 0x36, 0x32, 0x2e, 0x77, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, // _462.w) * in.v_c - 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // olor0;. float - 0x33, 0x20, 0x5f, 0x37, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // 3 _716;. if ( - 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, // _mtl_u.u_params1 - 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // .x < 0.5). {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, // float3 _ - 0x35, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, // 518 = fast::clam - 0x70, 0x28, 0x5f, 0x34, 0x33, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, // p(_439.xyz, floa - 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // t3(0.0), float3( - 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // 1.0));. f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x36, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x31, 0x38, // loat _561 = _518 - 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // .x;. floa - 0x74, 0x20, 0x5f, 0x37, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // t _710;. + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // struct xlatMtlMa + 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // in_out.{. flo + 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, // at4 bgfx_FragDat + 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, // a0 [[color(0)]]; + 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // .};..struct xlat + 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, // MtlMain_in.{. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // float4 v_color0 + 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, // [[user(locn0)]] + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x74, // ;. float3 v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, // excoord0 [[user( + 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, // locn1)]];.};..fr + 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // agment xlatMtlMa + 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // in_out xlatMtlMa + 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, // in(xlatMtlMain_i + 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, // n in [[stage_in] + 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, // ], constant _Glo + 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // bal& _mtl_u [[bu + 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // ffer(0)]], textu + 0x72, 0x65, 0x33, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, // re3d s_te + 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // xColor [[texture + 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, // (0)]], sampler s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler + 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, // [[sampler(0)]]) + 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // .{. xlatMtlMa + 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, // in_out out = {}; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x37, 0x30, // . float4 _470 + 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, // = s_texColor.sa + 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, // mple(s_texColorS + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x69, // ampler, float3(i + 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, // n.v_texcoord0.xy + 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // , _mtl_u.u_param + 0x73, 0x30, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x28, 0x5f, 0x6d, 0x74, // s0.y), level(_mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x78, 0x29, // l_u.u_params0.x) + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, // );. float3 _4 + 0x33, 0x37, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x37, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // 37 = _470.xyz;. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, 0x38, 0x39, 0x20, 0x3d, // float3 _489 = + 0x20, 0x6d, 0x69, 0x78, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x61, 0x62, 0x73, 0x28, 0x5f, 0x34, 0x33, // mix(pow(abs(_43 + 0x37, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, 0x2e, 0x32, 0x30, 0x30, // 7), float3(2.200 + 0x30, 0x30, 0x30, 0x30, 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, 0x38, 0x32, 0x30, 0x33, // 0000476837158203 + 0x31, 0x32, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x5f, 0x34, 0x33, 0x37, 0x2c, 0x20, 0x66, 0x6c, 0x6f, // 125)), _437, flo + 0x61, 0x74, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // at3(_mtl_u.u_par + 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x32, // ams0.z)) * pow(2 + 0x2e, 0x30, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // .0, _mtl_u.u_par + 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ams0.w);. flo + 0x61, 0x74, 0x34, 0x20, 0x5f, 0x37, 0x30, 0x32, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x37, 0x30, 0x3b, // at4 _702 = _470; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x32, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x5f, 0x34, // . _702.x = _4 + 0x38, 0x39, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x32, 0x2e, 0x79, // 89.x;. _702.y + 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x38, 0x39, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, // = _489.y;. _ + 0x37, 0x30, 0x32, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x38, 0x39, 0x2e, 0x7a, 0x3b, 0x0a, // 702.z = _489.z;. + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x34, 0x37, 0x20, // float4 _447 + 0x3d, 0x20, 0x5f, 0x37, 0x30, 0x32, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, // = _702 * in.v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // lor0;. float3 + 0x20, 0x5f, 0x37, 0x33, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, // _734;. if (_ + 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, // mtl_u.u_params1. + 0x78, 0x20, 0x3c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // x < 0.5). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x35, // float3 _5 + 0x32, 0x36, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, // 26 = fast::clamp + 0x28, 0x5f, 0x34, 0x34, 0x37, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // (_447.xyz, float + 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, // 3(0.0), float3(1 + 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // .0));. fl + 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x36, 0x39, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x32, 0x36, 0x2e, // oat _569 = _526. + 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // x;. float + 0x20, 0x5f, 0x37, 0x32, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, // _728;. d + 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // o. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, 0x36, 0x39, // if (_569 + 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, // <= 0.0031308000 + 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, 0x30, 0x39, 0x39, 0x36, 0x30, // 9073019027709960 + 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 9375). + 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x38, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, // _728 = 12.92 + 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x33, 0x31, 0x32, // 0000076293945312 + 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x36, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 5 * _569;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, // break; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // . }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, // _7 + 0x32, 0x38, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, // 28 = fma(1.05499 + 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, 0x39, 0x37, 0x36, 0x35, 0x36, // 9947547912597656 + 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x36, 0x39, 0x2c, 0x20, 0x30, 0x2e, // 25, pow(_569, 0. + 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, // 4166666567325592 + 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, // 041015625), -0.0 + 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, // 5499999970197677 + 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 6123046875);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, // bre + 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ak;. + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, // }. br + 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, // eak; // unreacha + 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x20, // ble workaround. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, // } while(f + 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // alse);. f + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x37, 0x33, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x32, 0x36, // loat _573 = _526 + 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // .y;. floa + 0x74, 0x20, 0x5f, 0x37, 0x33, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // t _730;. 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // do. {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, 0x36, // if (_56 - 0x31, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, // 1 <= 0.003130800 - 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // 0907301903). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x30, 0x20, 0x3d, // _710 = - 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, // 12.920000076293 - 0x39, 0x34, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x36, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 945 * _561;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, 0x37, // if (_57 + 0x33, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, // 3 <= 0.003130800 + 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, 0x30, 0x39, 0x39, 0x36, // 0907301902770996 + 0x30, 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 09375). + 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x33, 0x30, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, // _730 = 12.9 + 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x33, 0x31, // 2000007629394531 + 0x32, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x37, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 25 * _573;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, // break + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // ;. }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, // else + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // . {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // _ + 0x37, 0x33, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, // 730 = fma(1.0549 + 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, 0x39, 0x37, 0x36, 0x35, // 9994754791259765 + 0x36, 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x37, 0x33, 0x2c, 0x20, 0x30, // 625, pow(_573, 0 + 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, // .416666656732559 + 0x32, 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x2d, 0x30, 0x2e, // 2041015625), -0. + 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, // 0549999997019767 + 0x37, 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, // 76123046875);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, // br + 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // eak;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, // }. b + 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, // reak; // unreach + 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x0a, // able workaround. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, // } while( + 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // false);. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x37, 0x37, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x32, // float _577 = _52 + 0x36, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // 6.z;. flo + 0x61, 0x74, 0x20, 0x5f, 0x37, 0x33, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // at _732;. + 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // do. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, // if (_5 + 0x37, 0x37, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, // 77 <= 0.00313080 + 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, 0x30, 0x39, 0x39, // 0090730190277099 + 0x36, 0x30, 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 609375). + 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, // _732 = 12. + 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x33, // 9200000762939453 + 0x31, 0x32, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x37, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 125 * _577;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, // brea 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // k;. } 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, // . els 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // e. {. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x5f, 0x37, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, // _710 = (1.054999 - 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, // 9475479126 * pow - 0x28, 0x5f, 0x35, 0x36, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, // (_561, 0.4166666 - 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x30, 0x2e, // 567325592)) - 0. - 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, // 0549999997019767 - 0x37, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 76;. - 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, // } while(false); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, // . float3 - 0x5f, 0x36, 0x39, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x32, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _695 = _721;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x35, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x5f, 0x37, // _695.x = _7 - 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // 10;. floa - 0x74, 0x20, 0x5f, 0x35, 0x36, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x31, 0x38, 0x2e, 0x79, 0x3b, // t _565 = _518.y; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, // . float _ - 0x37, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, // 712;. do. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, 0x36, 0x35, 0x20, 0x3c, // if (_565 < - 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, // = 0.003130800090 - 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 7301903). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x32, 0x20, 0x3d, 0x20, 0x31, 0x32, // _712 = 12 - 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, // .920000076293945 - 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x36, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // * _565;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, // _71 - 0x32, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, // 2 = (1.054999947 - 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, // 5479126 * pow(_5 - 0x36, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, // 65, 0.4166666567 - 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x34, // 325592)) - 0.054 - 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x3b, // 999999701976776; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, // }. } - 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, // while(false);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x36, 0x39, // float3 _69 - 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x39, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 8 = _695;. - 0x20, 0x20, 0x5f, 0x36, 0x39, 0x38, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x31, 0x32, 0x3b, // _698.y = _712; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, // . float _ - 0x35, 0x36, 0x39, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x31, 0x38, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, // 569 = _518.z;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x31, 0x34, // float _714 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, // ;. do. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, 0x36, 0x39, 0x20, 0x3c, 0x3d, 0x20, 0x30, // if (_569 <= 0 - 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, // .003130800090730 - 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 1903). - 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x34, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, // _714 = 12.92 - 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x20, 0x2a, 0x20, // 0000076293945 * - 0x5f, 0x35, 0x36, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _569;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, // else. + 0x5f, 0x37, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, // _732 = fma(1.054 + 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, 0x39, 0x37, 0x36, // 9999475479125976 + 0x35, 0x36, 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x37, 0x37, 0x2c, 0x20, // 5625, pow(_577, + 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, // 0.41666665673255 + 0x39, 0x32, 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x2d, 0x30, // 92041015625), -0 + 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, // .054999999701976 + 0x37, 0x37, 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x3b, 0x0a, 0x20, // 776123046875);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, // b + 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // reak;. + 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x63, // break; // unreac + 0x68, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, // hable workaround + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, // . } while + 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // (false);. + 0x20, 0x5f, 0x37, 0x33, 0x34, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x5f, // _734 = float3(_ + 0x37, 0x32, 0x38, 0x2c, 0x20, 0x5f, 0x37, 0x33, 0x30, 0x2c, 0x20, 0x5f, 0x37, 0x33, 0x32, 0x29, // 728, _730, _732) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, // ;. }. else + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // . {. f + 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x33, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // loat3 _735;. + 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // if (_mtl_u.u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x31, 0x2e, 0x35, // _params1.x < 1.5 + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x33, 0x35, 0x20, 0x3d, 0x20, 0x5f, // _735 = _ + 0x34, 0x34, 0x37, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 447.xyz;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, // }. else. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x34, 0x20, 0x3d, // _714 = - 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, // (1.054999947547 - 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x36, 0x39, 0x2c, // 9126 * pow(_569, - 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, // 0.4166666567325 - 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, // 592)) - 0.054999 - 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x3b, 0x0a, 0x20, 0x20, // 999701976776;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, // br - 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // eak;. - 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, // }. } whi - 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // le(false);. - 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x30, 0x31, 0x20, 0x3d, // float3 _701 = - 0x20, 0x5f, 0x36, 0x39, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // _698;. _ - 0x37, 0x30, 0x31, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, // 701.z = _714;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x36, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x30, // _716 = _70 - 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, // 1;. }. els - 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // e. {. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float3 _717;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // if (_mtl_u. - 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x31, 0x2e, // u_params1.x < 1. - 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // 5). {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x37, 0x20, 0x3d, 0x20, // _717 = - 0x5f, 0x34, 0x33, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _439.xyz;. - 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, // }. else - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // . {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, // float3 _7 - 0x31, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 18;. - 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // if (_mtl_u.u_par - 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, // ams1.x < 2.5). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // floa - 0x74, 0x33, 0x20, 0x5f, 0x36, 0x35, 0x34, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x28, // t3 _654 = pow((( - 0x28, 0x5f, 0x34, 0x33, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, // (_439.xyz * floa - 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x31, // t3x3(float3(0.41 - 0x32, 0x35, 0x35, 0x36, 0x34, 0x30, 0x39, 0x38, 0x33, 0x35, 0x38, 0x31, 0x35, 0x34, 0x33, 0x2c, // 255640983581543, - 0x20, 0x30, 0x2e, 0x33, 0x35, 0x37, 0x35, 0x37, 0x36, 0x31, 0x30, 0x32, 0x30, 0x31, 0x38, 0x33, // 0.3575761020183 - 0x35, 0x36, 0x33, 0x32, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x38, 0x30, 0x34, 0x33, 0x37, 0x35, 0x30, // 5632, 0.18043750 - 0x35, 0x32, 0x34, 0x35, 0x32, 0x30, 0x38, 0x37, 0x34, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, // 524520874), floa - 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x31, 0x32, 0x36, 0x37, 0x32, 0x39, 0x30, 0x34, 0x31, 0x33, // t3(0.21267290413 - 0x33, 0x37, 0x39, 0x36, 0x36, 0x39, 0x2c, 0x20, 0x30, 0x2e, 0x37, 0x31, 0x35, 0x31, 0x35, 0x32, // 379669, 0.715152 - 0x32, 0x30, 0x34, 0x30, 0x33, 0x36, 0x37, 0x31, 0x32, 0x36, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, // 20403671265, 0.0 - 0x37, 0x32, 0x31, 0x37, 0x35, 0x30, 0x30, 0x33, 0x35, 0x38, 0x38, 0x31, 0x39, 0x39, 0x36, 0x31, // 7217500358819961 - 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x39, // 5), float3(0.019 - 0x33, 0x33, 0x33, 0x39, 0x30, 0x30, 0x38, 0x38, 0x33, 0x37, 0x39, 0x33, 0x38, 0x33, 0x31, 0x2c, // 333900883793831, - 0x20, 0x30, 0x2e, 0x31, 0x31, 0x39, 0x31, 0x39, 0x31, 0x39, 0x39, 0x36, 0x37, 0x35, 0x33, 0x32, // 0.1191919967532 - 0x31, 0x35, 0x37, 0x39, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x35, 0x30, 0x33, 0x30, 0x34, 0x30, 0x39, // 1579, 0.95030409 - 0x30, 0x39, 0x37, 0x36, 0x37, 0x31, 0x35, 0x30, 0x39, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x66, // 097671509))) * f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, // loat3x3(float3(1 - 0x2e, 0x37, 0x31, 0x36, 0x36, 0x35, 0x31, 0x32, 0x30, 0x31, 0x32, 0x34, 0x38, 0x31, 0x36, 0x38, // .716651201248168 - 0x39, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x33, 0x35, 0x35, 0x36, 0x37, 0x30, 0x38, 0x30, 0x39, 0x37, // 9, -0.3556708097 - 0x34, 0x35, 0x37, 0x38, 0x38, 0x35, 0x37, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x32, 0x35, 0x33, 0x33, // 4578857, -0.2533 - 0x36, 0x36, 0x32, 0x39, 0x31, 0x35, 0x32, 0x32, 0x39, 0x37, 0x39, 0x37, 0x34, 0x29, 0x2c, 0x20, // 6629152297974), - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x36, 0x36, 0x36, 0x36, 0x38, 0x34, // float3(-0.666684 - 0x33, 0x38, 0x39, 0x31, 0x31, 0x34, 0x33, 0x37, 0x39, 0x38, 0x38, 0x2c, 0x20, 0x31, 0x2e, 0x36, // 38911437988, 1.6 - 0x31, 0x36, 0x34, 0x38, 0x31, 0x31, 0x38, 0x34, 0x39, 0x35, 0x39, 0x34, 0x31, 0x31, 0x36, 0x2c, // 164811849594116, - 0x20, 0x30, 0x2e, 0x30, 0x31, 0x35, 0x37, 0x36, 0x38, 0x35, 0x30, 0x30, 0x30, 0x34, 0x34, 0x39, // 0.0157685000449 - 0x34, 0x31, 0x39, 0x30, 0x32, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // 41902), float3(0 - 0x2e, 0x30, 0x31, 0x37, 0x36, 0x33, 0x39, 0x38, 0x39, 0x39, 0x36, 0x32, 0x36, 0x33, 0x37, 0x34, // .017639899626374 - 0x32, 0x34, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x34, 0x32, 0x37, 0x37, 0x30, 0x36, 0x30, // 245, -0.04277060 - 0x31, 0x38, 0x30, 0x39, 0x30, 0x32, 0x34, 0x38, 0x31, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x34, // 1809024811, 0.94 - 0x32, 0x31, 0x30, 0x33, 0x30, 0x38, 0x37, 0x39, 0x30, 0x32, 0x30, 0x36, 0x39, 0x30, 0x39, 0x29, // 210308790206909) - 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // )) * _mtl_u.u_pa - 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x39, 0x2e, 0x39, 0x39, 0x39, // rams1.y) * 9.999 - 0x39, 0x39, 0x39, 0x37, 0x34, 0x37, 0x33, 0x37, 0x38, 0x37, 0x35, 0x31, 0x36, 0x65, 0x2d, 0x30, // 9997473787516e-0 - 0x30, 0x35, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x31, 0x35, 0x39, // 05, float3(0.159 - 0x33, 0x30, 0x31, 0x37, 0x35, 0x37, 0x38, 0x31, 0x32, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // 3017578125));. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, // _7 - 0x31, 0x38, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // 18 = pow((float3 - 0x28, 0x30, 0x2e, 0x38, 0x33, 0x35, 0x39, 0x33, 0x37, 0x35, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, // (0.8359375) + (_ - 0x36, 0x35, 0x34, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, 0x35, // 654 * 18.8515625 - 0x29, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, // )) / (float3(1.0 - 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x35, 0x34, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x36, // ) + (_654 * 18.6 - 0x38, 0x37, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x37, 0x38, // 875)), float3(78 - 0x2e, 0x38, 0x34, 0x33, 0x37, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .84375));. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x66, 0x6c, // _718 = fl - 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // oat3(0.0);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x37, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x31, 0x38, // _717 = _718 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // ;. }. - 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x36, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x31, 0x37, 0x3b, // _716 = _717; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, // . }. out.b - 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, // gfx_FragData0 = - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x37, 0x31, 0x36, 0x2c, 0x20, 0x5f, 0x34, 0x33, // float4(_716, _43 - 0x39, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, // 9.w);. return - 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x40, 0x00, // out;.}....@. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x33, // float3 _73 + 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, // 6;. i + 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // f (_mtl_u.u_para + 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, // ms1.x < 2.5). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // float + 0x33, 0x20, 0x5f, 0x36, 0x36, 0x32, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x28, 0x28, // 3 _662 = pow(((( + 0x5f, 0x34, 0x34, 0x37, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // _447.xyz * float + 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x31, 0x32, // 3x3(float3(0.412 + 0x35, 0x35, 0x36, 0x34, 0x30, 0x39, 0x38, 0x33, 0x35, 0x38, 0x31, 0x35, 0x34, 0x32, 0x39, 0x36, // 5564098358154296 + 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x33, 0x35, 0x37, 0x35, 0x37, 0x36, 0x31, 0x30, 0x32, // 875, 0.357576102 + 0x30, 0x31, 0x38, 0x33, 0x35, 0x36, 0x33, 0x32, 0x33, 0x32, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, // 0183563232421875 + 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x38, 0x30, 0x34, 0x33, 0x37, 0x35, 0x30, 0x35, 0x32, 0x34, 0x35, // , 0.180437505245 + 0x32, 0x30, 0x38, 0x37, 0x34, 0x30, 0x32, 0x33, 0x34, 0x33, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x66, // 208740234375), f + 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x31, 0x32, 0x36, 0x37, 0x32, 0x39, 0x30, // loat3(0.21267290 + 0x34, 0x31, 0x33, 0x33, 0x37, 0x39, 0x36, 0x36, 0x39, 0x31, 0x38, 0x39, 0x34, 0x35, 0x33, 0x31, // 4133796691894531 + 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x37, 0x31, 0x35, 0x31, 0x35, 0x32, 0x32, 0x30, 0x34, 0x30, // 25, 0.7151522040 + 0x33, 0x36, 0x37, 0x31, 0x32, 0x36, 0x34, 0x36, 0x34, 0x38, 0x34, 0x33, 0x37, 0x35, 0x2c, 0x20, // 36712646484375, + 0x30, 0x2e, 0x30, 0x37, 0x32, 0x31, 0x37, 0x35, 0x30, 0x30, 0x33, 0x35, 0x38, 0x38, 0x31, 0x39, // 0.07217500358819 + 0x39, 0x36, 0x31, 0x35, 0x34, 0x37, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, // 9615478515625), + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x39, 0x33, 0x33, 0x33, 0x39, // float3(0.0193339 + 0x30, 0x30, 0x38, 0x38, 0x33, 0x37, 0x39, 0x33, 0x38, 0x33, 0x30, 0x38, 0x37, 0x31, 0x35, 0x38, // 0088379383087158 + 0x32, 0x30, 0x33, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, 0x39, 0x31, 0x39, 0x31, // 203125, 0.119191 + 0x39, 0x39, 0x36, 0x37, 0x35, 0x33, 0x32, 0x31, 0x35, 0x37, 0x38, 0x39, 0x37, 0x39, 0x34, 0x39, // 9967532157897949 + 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x35, 0x30, 0x33, 0x30, 0x34, 0x30, // 21875, 0.9503040 + 0x39, 0x30, 0x39, 0x37, 0x36, 0x37, 0x31, 0x35, 0x30, 0x38, 0x37, 0x38, 0x39, 0x30, 0x36, 0x32, // 9097671508789062 + 0x35, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, // 5))) * float3x3( + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x37, 0x31, 0x36, 0x36, 0x35, 0x31, 0x32, // float3(1.7166512 + 0x30, 0x31, 0x32, 0x34, 0x38, 0x31, 0x36, 0x38, 0x39, 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x2c, // 012481689453125, + 0x20, 0x2d, 0x30, 0x2e, 0x33, 0x35, 0x35, 0x36, 0x37, 0x30, 0x38, 0x30, 0x39, 0x37, 0x34, 0x35, // -0.355670809745 + 0x37, 0x38, 0x38, 0x35, 0x37, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, // 78857421875, -0. + 0x32, 0x35, 0x33, 0x33, 0x36, 0x36, 0x32, 0x39, 0x31, 0x35, 0x32, 0x32, 0x39, 0x37, 0x39, 0x37, // 2533662915229797 + 0x33, 0x36, 0x33, 0x32, 0x38, 0x31, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 36328125), float + 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x36, 0x36, 0x36, 0x36, 0x38, 0x34, 0x33, 0x38, 0x39, 0x31, 0x31, // 3(-0.66668438911 + 0x34, 0x33, 0x37, 0x39, 0x38, 0x38, 0x32, 0x38, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x31, 0x2e, 0x36, // 43798828125, 1.6 + 0x31, 0x36, 0x34, 0x38, 0x31, 0x31, 0x38, 0x34, 0x39, 0x35, 0x39, 0x34, 0x31, 0x31, 0x36, 0x32, // 1648118495941162 + 0x31, 0x30, 0x39, 0x33, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x31, 0x35, 0x37, 0x36, 0x38, // 109375, 0.015768 + 0x35, 0x30, 0x30, 0x30, 0x34, 0x34, 0x39, 0x34, 0x31, 0x39, 0x30, 0x32, 0x31, 0x36, 0x30, 0x36, // 5000449419021606 + 0x34, 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // 4453125), float3 + 0x28, 0x30, 0x2e, 0x30, 0x31, 0x37, 0x36, 0x33, 0x39, 0x38, 0x39, 0x39, 0x36, 0x32, 0x36, 0x33, // (0.0176398996263 + 0x37, 0x34, 0x32, 0x34, 0x34, 0x36, 0x38, 0x39, 0x39, 0x34, 0x31, 0x34, 0x30, 0x36, 0x32, 0x35, // 7424468994140625 + 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x34, 0x32, 0x37, 0x37, 0x30, 0x36, 0x30, 0x31, 0x38, 0x30, // , -0.04277060180 + 0x39, 0x30, 0x32, 0x34, 0x38, 0x31, 0x30, 0x37, 0x39, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, // 9024810791015625 + 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x34, 0x32, 0x31, 0x30, 0x33, 0x30, 0x38, 0x37, 0x39, 0x30, 0x32, // , 0.942103087902 + 0x30, 0x36, 0x39, 0x30, 0x39, 0x31, 0x37, 0x39, 0x36, 0x38, 0x37, 0x35, 0x29, 0x29, 0x29, 0x20, // 069091796875))) + 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // * _mtl_u.u_param + 0x73, 0x31, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x39, 0x2e, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, // s1.y) * 9.999999 + 0x37, 0x34, 0x37, 0x33, 0x37, 0x38, 0x37, 0x35, 0x31, 0x36, 0x33, 0x35, 0x35, 0x35, 0x31, 0x34, // 7473787516355514 + 0x35, 0x32, 0x36, 0x33, 0x36, 0x37, 0x31, 0x38, 0x38, 0x65, 0x2d, 0x30, 0x35, 0x2c, 0x20, 0x66, // 526367188e-05, f + 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x31, 0x35, 0x39, 0x33, 0x30, 0x31, 0x37, 0x35, // loat3(0.15930175 + 0x37, 0x38, 0x31, 0x32, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 78125));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x33, 0x36, 0x20, 0x3d, 0x20, // _736 = + 0x70, 0x6f, 0x77, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x38, 0x33, // pow((float3(0.83 + 0x35, 0x39, 0x33, 0x37, 0x35, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x36, 0x32, 0x20, 0x2a, // 59375) + (_662 * + 0x20, 0x31, 0x38, 0x2e, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x29, 0x20, 0x2f, 0x20, // 18.8515625)) / + 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x28, // (float3(1.0) + ( + 0x5f, 0x36, 0x36, 0x32, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x36, 0x38, 0x37, 0x35, 0x29, 0x29, // _662 * 18.6875)) + 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x37, 0x38, 0x2e, 0x38, 0x34, 0x33, 0x37, // , float3(78.8437 + 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 5));. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // }. e + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x5f, 0x37, 0x33, 0x36, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // _736 = float3( + 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0.0);. + 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x5f, 0x37, 0x33, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x33, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _735 = _736;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // }. _ + 0x37, 0x33, 0x34, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x33, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 734 = _735;. + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // }. out.bgfx_F + 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // ragData0 = float + 0x34, 0x28, 0x5f, 0x37, 0x33, 0x34, 0x2c, 0x20, 0x5f, 0x34, 0x34, 0x37, 0x2e, 0x77, 0x29, 0x3b, // 4(_734, _447.w); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, // . return out; + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x40, 0x00, // .}....@. }; extern const uint8_t* fs_texture_3d_pssl; extern const uint32_t fs_texture_3d_pssl_size; diff --git a/bgfx/tools/texturev/fs_texture_3d.sc b/bgfx/tools/texturev/fs_texture_3d.sc index d7b2cb26..18ba465c 100644 --- a/bgfx/tools/texturev/fs_texture_3d.sc +++ b/bgfx/tools/texturev/fs_texture_3d.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/texturev/fs_texture_array.bin.h b/bgfx/tools/texturev/fs_texture_array.bin.h index 8e3671a8..42ec55ec 100644 --- a/bgfx/tools/texturev/fs_texture_array.bin.h +++ b/bgfx/tools/texturev/fs_texture_array.bin.h @@ -87,228 +87,182 @@ static const uint8_t fs_texture_array_essl[701] = 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, // gl_FragColor = t 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // mpvar_2;.}... }; -static const uint8_t fs_texture_array_spv[1915] = +static const uint8_t fs_texture_array_spv[1855] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x75, // FSH............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ - 0x84, 0x01, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, // ...s_texColor0.. - 0x00, 0x00, 0x00, 0x00, 0x03, 0x1a, 0x00, 0x3c, 0x07, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, // .......<.....#.. - 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x56, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, // .......V........ + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ + 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, // ...s_texColor0.. + 0x00, 0x00, 0x00, 0x00, 0x03, 0x22, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, // .....".......#.. + 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x56, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, // .......V........ 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...............G 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, // LSL.std.450..... - 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xbb, // .......main..... - 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x10, // ................ - 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, // ................ - 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m - 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x73, // ain........<...s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler - 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......?...s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, // ColorTexture.... - 0x00, 0x06, 0x00, 0x79, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, // ...y...UniformBl - 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x79, 0x00, 0x00, 0x00, 0x00, // ock........y.... - 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x05, // ...u_params0.... - 0x00, 0x03, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0xbb, // ...{............ - 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, // ...gl_FragCoord. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ...........v_col - 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x76, // or0............v - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0xcf, // _texcoord0...... - 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData - 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...<...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...<...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...?...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G...?...!.... - 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, // ...H...y.......# - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x79, 0x00, 0x00, 0x00, 0x02, // .......G...y.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...{...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, // ...G...{...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............ - 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ - 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ...;...........; - 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ...;...<....... - 0x00, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...>...........; - 0x00, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, // ...>...?........ - 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...B... .......+ - 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, // ...B...G........ - 0x00, 0x03, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...K.......+.... - 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...g......@+.... - 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x2f, 0xba, 0xe8, 0x3e, 0x1e, 0x00, 0x03, 0x00, 0x79, // ...o.../..>....y - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x02, // ....... ...z.... - 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x7b, // ...y...;...z...{ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x20, // ...........|... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7d, // .......+...|...} - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x02, // ....... ...~.... - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x88, // .......+........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x89, // ......@+...|.... - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xa6, // .......+...|.... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xb0, // .......+...|.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0x01, // ....... ........ - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0xbb, // .......;........ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0xbe, // .......;........ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x01, // ....... ........ - 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc2, // .......;........ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xce, 0x00, 0x00, 0x00, 0x03, // ....... ........ - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xce, 0x00, 0x00, 0x00, 0xcf, // .......;........ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x54, // .......,.......T - 0x01, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x2c, // ...g...g...g..., - 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x6f, // .......U...o...o - 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, // ...o...6........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, // ................ - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3c, // ...=.......=...< - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3f, // ...=.......@...? - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xbe, // ...=............ - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc2, // ...=............ - 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x7b, // ...A...~.......{ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...G.......=.... - 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0xf1, // ...P............ - 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x7e, // ...........A...~ - 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0xb0, // .......{...G.... - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0xf5, // ...=............ - 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x40, // ...V...K.......@ - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0c, // ...=...X........ - 0x01, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf6, // ................ - 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x0c, // ................ - 0x01, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x12, // .......O........ - 0x01, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x32, // ...............2 - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // .......4........ - 0x00, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x7e, // ...2...T...A...~ - 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x7d, // ...$...{...G...} - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x25, 0x01, 0x00, 0x00, 0x24, // ...=.......%...$ - 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x25, // ...P.......&...% - 0x01, 0x00, 0x00, 0x25, 0x01, 0x00, 0x00, 0x25, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, // ...%...%........ - 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x34, // ...@...........4 - 0x01, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x7e, // .......&...A...~ - 0x00, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x89, // ...*...{...G.... - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x01, 0x00, 0x00, 0x2a, // ...=.......+...* - 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x01, // ...........,.... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x2b, 0x01, 0x00, 0x00, 0x8e, // ...........+.... - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x2c, // .......-...@..., - 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x01, // ...........E.... - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, // .......-........ - 0x00, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x45, // ...G...........E - 0x01, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, // ...U...Q........ - 0x01, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // .......G.......Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x01, // ...........G.... - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x47, // ...Q...........G - 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1a, // .......P........ - 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x16, // ................ - 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0xfd, // ...>............ - 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ...8....... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xbe, // .......main..... + 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, // ................ + 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. + 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......<...s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, // ColorSampler.... + 0x00, 0x07, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...?...s_texColo + 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x79, // rTexture.......y + 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, // ...UniformBlock. + 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, // .......y.......u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x7b, // _params0.......{ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x76, // ...............v + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xc2, // _color0......... + 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, // ...v_texcoord0.. + 0x00, 0x06, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // .......bgfx_Frag + 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x22, // Data0..G...<..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x21, // .......G...<...! + 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x22, // .......G...?..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x21, // .......G...?...! + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x79, 0x00, 0x00, 0x00, 0x00, // .......H...y.... + 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x79, // ...#.......G...y + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x22, // .......G...{..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x21, // .......G...{...! + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x1e, // .......G........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, // ...............! + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, // ................ + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, // ........... .... + 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ... ...;........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, // ...;...;...<.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ... ...>........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, // ...;...>...?.... + 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, // .......B... .... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, // ...+...B...G.... + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, // .......K.......+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x2b, // .......g......@+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x2f, 0xba, 0xe8, 0x3e, 0x1e, // .......o.../..>. + 0x00, 0x03, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7a, // ...y....... ...z + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7a, // .......y...;...z + 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x7c, // ...{...........| + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x7c, // ... .......+...| + 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7e, // ...}....... ...~ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... + 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x7c, // ..........@+...| + 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x7c, // ...........+...| + 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x7c, // ...........+...| + 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xba, // ........... .... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xba, // ...........;.... + 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xc1, // ........... .... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xc1, // ...........;.... + 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xce, // ........... .... + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xce, // ...........;.... + 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...........,.... + 0x00, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x67, // ...T...g...g...g + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x6f, // ...,.......U...o + 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, // ...o...o...6.... + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, // ................ + 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3d, // .......=.......= + 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x40, // ...<...=.......@ + 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xbf, // ...?...=........ + 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc3, // .......=........ + 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xef, // .......A...~.... + 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x3d, // ...{...G.......= + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0xc3, // ...Q............ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf3, // .......P........ + 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x41, // ...............A + 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x47, // ...~.......{...G + 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, // .......=........ + 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x09, // .......V...K.... + 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, // ...@...=...X.... + 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xfa, // ................ + 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, // ...........O.... + 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, // ...2............ + 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x01, // ...........4.... + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x41, // .......2...T...A + 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x47, // ...~...$...{...G + 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x25, // ...}...=.......% + 0x01, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x26, // ...$...P.......& + 0x01, 0x00, 0x00, 0x25, 0x01, 0x00, 0x00, 0x25, 0x01, 0x00, 0x00, 0x25, 0x01, 0x00, 0x00, 0x0c, // ...%...%...%.... + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, // .......@........ + 0x00, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x41, // ...4.......&...A + 0x00, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x47, // ...~...*...{...G + 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, // .......=.......+ + 0x01, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2c, // ...*..........., + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x40, // ...........-...@ + 0x01, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x45, // ...,...........E + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x0c, // ...........-.... + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // .......G........ + 0x00, 0x00, 0x00, 0x45, 0x01, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...E...U...Q.... + 0x00, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x00, // ...........G.... + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x47, // ...Q...........G + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x19, // .......Q........ + 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, // ...G.......P.... + 0x00, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x19, // ................ + 0x01, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x1a, // .......>........ + 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // .......8....... }; -static const uint8_t fs_texture_array_dx9[624] = +static const uint8_t fs_texture_array_dx11[835] = { - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, // ....u_params0... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, // .......4........ - 0xff, 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, // .,.CTAB......... - 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, // ...............| - 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, // ...D...........P - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, // .......`........ - 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...l.......s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // Color........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0 - 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, // ...ps_3_0.Micros - 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, // oft (R) HLSL Sha - 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, // der Compiler 10. - 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, // 1..Q..........?. - 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x2f, 0xba, 0xe8, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x0a, // ......@/..>..... - 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, // ................ - 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x05, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xd0, 0xa0, 0x01, 0x00, 0xc4, 0x90, 0x01, // ................ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, // ..........._.... - 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, // ................ - 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x0f, 0x00, 0x00, 0x02, 0x02, // ................ - 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x8b, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, // ................ - 0x00, 0x55, 0x8b, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x8b, 0x01, // .U.............. - 0x00, 0x00, 0x02, 0x00, 0x08, 0x08, 0x80, 0x01, 0x00, 0xff, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, // ................ - 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xaa, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, // ................ - 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, // ................ - 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x04, // .U.............. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x02, // ................ - 0x00, 0xe4, 0x81, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, // ................ - 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x8b, 0x0f, // ................ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x8b, 0x0f, 0x00, 0x00, 0x02, 0x01, // .........U...... - 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x8b, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x01, 0x00, 0xff, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x01, 0x80, 0x00, // ................ - 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x0e, // .............U.. - 0x00, 0x00, 0x02, 0x00, 0x08, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ................ -}; -static const uint8_t fs_texture_array_dx11[844] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, // ...s_texColor0.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // ........s_texCol - 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x02, 0x00, 0x00, // or0............. - 0x44, 0x58, 0x42, 0x43, 0x77, 0x19, 0xf0, 0x17, 0xe9, 0x7f, 0x9c, 0x60, 0x64, 0x2e, 0x99, 0x47, // DXBCw......`d..G - 0xa5, 0xb8, 0x85, 0xdb, 0x01, 0x00, 0x00, 0x00, 0xf8, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................ - 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, // ,...........ISGN - 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, // l...........P... - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, // ............b... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x07, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, // ....SV_POSITION. - 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, // COLOR.TEXCOORD.. - 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // OSGN,........... - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ............... - 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, // ........SV_TARGE - 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x1c, 0x02, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // T...SHDR....@... - 0x87, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ....Y...F. ..... - 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....Z....`...... - 0x58, 0x40, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, // X@...p......UU.. - 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // b...........b... - 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // 2.......e.... .. - 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....h.......6... - 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // 2.......F....... - 0x36, 0x00, 0x00, 0x06, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, // 6...B......... . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, // ........H....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, // .....`........ . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, // ........8....... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // ....F.......F... - 0x01, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ..../...r....... - 0x46, 0x02, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // F...........6... - 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // . ......:....... - 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 8...r.......F... - 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, // .....@.....@...@ - 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // ...@........r... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // ....F.......2... - 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r.......F....... - 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // F.......F...A... - 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2...r....... - 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // .. .........F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, // ....F........... - 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........:. ..... - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8...r....... - 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x2f, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, // /...r.......F... - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, // ........8...r... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0x2f, 0xba, 0xe8, 0x3e, 0x2f, 0xba, 0xe8, 0x3e, 0x2f, 0xba, 0xe8, 0x3e, 0x00, 0x00, 0x00, 0x00, // /..>/..>/..>.... - 0x19, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....r ......F... - 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ....>....... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xad, // ...........DXBC. + 0xc5, 0x21, 0x80, 0x53, 0x76, 0x17, 0x29, 0xc2, 0x54, 0xa0, 0x98, 0xaa, 0xab, 0x4f, 0xa5, 0x01, // .!.Sv.).T....O.. + 0x00, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, // ...........,.... + 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, // .......ISGNl.... + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......P........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......b........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, 0x00, 0x53, // ...............S + 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, // V_POSITION.COLOR + 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, // .TEXCOORD..OSGN, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, // ........... .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, // ...SV_TARGET...S + 0x48, 0x45, 0x58, 0x28, 0x02, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x6a, // HEX(...P.......j + 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...Y...F. ...... + 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, // ...Z....`......X + 0x40, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, // @...p......UU..b + 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, // ...........b...2 + 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, // .......e.... ... + 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, // ...h.......6...2 + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x36, // .......F.......6 + 0x00, 0x00, 0x06, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, // ...B......... .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8e, 0x02, 0x02, 0x00, 0x80, 0x43, // .......H.......C + 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // U..........F.... + 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, // ...F~.......`... + 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ..... .........8 + 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, // ...........F.... + 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x06, 0x72, // ...F......./...r + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, // .......F........ + 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // ...6.... ......: + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, // .......8...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xcd, // ...F........@... + 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x19, // ..@...@...@..... + 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...r.......F.... + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...2...r.......F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......F.......F + 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, // ...A.......2...r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...F.......F.... + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, // ...............: + 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, // . .........8...r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...............F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x00, // ......./...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...F...........8 + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x2f, 0xba, 0xe8, 0x3e, 0x2f, 0xba, 0xe8, 0x3e, 0x2f, // ....@../..>/..>/ + 0xba, 0xe8, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, // ..>........r ... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, // ...F.......>.... + 0x00, 0x10, 0x00, // ... }; -static const uint8_t fs_texture_array_mtl[1074] = +static const uint8_t fs_texture_array_mtl[1087] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ @@ -316,7 +270,7 @@ static const uint8_t fs_texture_array_mtl[1074] = 0x70, 0x6c, 0x65, 0x72, 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, // pler...........s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // _texColorTexture 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbb, // Color........... + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, // Color........... 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, // ...#include .#incl 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, // ude +............ - 0x47, 0x61, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x00, // Ga=+............ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x01, // ...+............ - 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x98, // ...+............ - 0x3a, 0xd3, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x37, // :.>+...........7 - 0x14, 0xb7, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x9c, // ..>+............ - 0xc4, 0x38, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc3, // .8>,............ - 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, // .........Y>+.... - 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x37, 0x14, 0x37, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, // .......7.7?+.... - 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x7d, 0xd0, 0x93, 0x3d, 0x2c, 0x00, 0x06, 0x00, 0x0b, // .......}..=,.... - 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0xc9, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x21, // ...+...........! - 0x62, 0x9e, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xef, // b.<+............ - 0x1a, 0xf4, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x21, // ..=+...........! - 0x47, 0x73, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0xcb, // Gs?,............ - 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0xc0, // ...........,.... - 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xce, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x3a, // ...+...........: - 0xbb, 0xdb, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x7c, // ..?+...........| - 0x1a, 0xb6, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x3a, // ...+...........: - 0xb9, 0x81, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xd6, // ...,............ - 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0x2b, 0x00, 0x04, 0x00, 0x07, // .........*.+.... - 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xdb, 0xe8, 0xce, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, // ..........?+.... - 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xf1, 0x2c, 0x81, 0x3c, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ........,.<,.... - 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xdc, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x8d, // ...+............ - 0x81, 0x90, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x3a, // ..<+...........: - 0x30, 0x2f, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xab, // 0/.+............ - 0x2d, 0x71, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xde, // -q?,............ - 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0xc0, // ...........,.... - 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xe1, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x00, // ...+............ - 0x20, 0x23, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x00, // #>+............ - 0xb0, 0x9d, 0x42, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x00, // ..B+............ - 0x00, 0x56, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, // .V?+............ - 0xd0, 0x96, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x00, // ..A+............ - 0x80, 0x95, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x17, // ..A+............ - 0xb7, 0xd1, 0x38, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ..8+............ - 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, // ..?+............ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, // ...+............ - 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x21, 0x01, 0x00, 0x00, 0x00, // ..?+.......!.... - 0x00, 0xc0, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x29, 0x01, 0x00, 0x00, 0x00, // ..?+.......).... - 0x00, 0x20, 0x40, 0x17, 0x00, 0x04, 0x00, 0x47, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, // . @....G........ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4d, 0x01, 0x00, 0x00, 0x00, // ...+.......M.... - 0x00, 0x80, 0xbf, 0x2c, 0x00, 0x05, 0x00, 0x47, 0x01, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x00, // ...,...G...N.... - 0x01, 0x00, 0x00, 0x4d, 0x01, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x58, // ...M...+...Q...X - 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x59, 0x01, 0x00, 0x00, 0x02, // ....... ...Y.... - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x01, // ....... ...{.... - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x7c, // .......;...{...| - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x7f, // .......;...{.... - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x82, 0x01, 0x00, 0x00, 0x01, // ....... ........ - 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x82, 0x01, 0x00, 0x00, 0x83, // .......;........ - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x03, // ....... ........ - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x90, // .......;........ - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x05, 0x00, 0x47, 0x01, 0x00, 0x00, 0xe0, // .......,...G.... - 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...........,.... - 0x00, 0x00, 0x00, 0xe1, 0x02, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, // .......v...v...v - 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe2, 0x02, 0x00, 0x00, 0x10, // ...,............ - 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...........,.... - 0x00, 0x00, 0x00, 0xe3, 0x02, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xe9, // ................ - 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe4, 0x02, 0x00, 0x00, 0xed, // ...,............ - 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...........,.... - 0x00, 0x00, 0x00, 0xe5, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe6, 0x02, 0x00, 0x00, 0xeb, // ...,............ - 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0xf2, 0x02, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, // .......6........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, // ................ - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4b, // ...=.......L...K - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4e, // ...=.......O...N - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x7f, // ...=............ - 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x83, // ...=............ - 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x47, 0x01, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x84, // ...O...G........ - 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, // ................ - 0x00, 0x05, 0x00, 0x47, 0x01, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0x90, // ...G............ - 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x47, 0x01, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0xba, // .......G........ - 0x01, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x47, 0x01, 0x00, 0x00, 0xbd, // ...........G.... - 0x01, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0x4e, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // .......N...Q.... - 0x00, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xc5, 0x01, 0x00, 0x00, 0xbe, // ...P............ - 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x41, // ...............A - 0x00, 0x05, 0x00, 0x59, 0x01, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x58, // ...Y...........X - 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0xc6, // ...=............ - 0x01, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0xc5, // ................ - 0x01, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc9, // .......O........ - 0x01, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xca, // ................ - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x41, // .......E.......A - 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x56, // ...............V - 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, // .......=........ - 0x01, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x5a, 0x00, 0x00, 0x00, 0xeb, // .......V...Z.... - 0x01, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, // ...O...L...X.... - 0x00, 0x00, 0x00, 0xee, 0x01, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0xca, 0x01, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd1, // .......O........ - 0x01, 0x00, 0x00, 0xee, 0x01, 0x00, 0x00, 0xee, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x06, // ................ - 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x00, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0xe1, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x86, // ...........A.... - 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x85, // ...........V.... - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0xf8, // ...=............ - 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0xf9, // ...P............ - 0x01, 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x08, // ................ - 0x02, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0xfa, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x86, // ...........A.... - 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x91, // ...........V.... - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xfe, // ...=............ - 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x8e, // ................ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x00, // ................ - 0x02, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0xee, // ...O............ - 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, // ................ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xd7, // ................ - 0x01, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x86, // ...........A.... - 0x00, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xad, // ...........R.... - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0xd9, // ...=............ - 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0x83, // ...A............ - 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...R.......=.... - 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9a, // ................ - 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0xf7, // ... ............ - 0x00, 0x03, 0x00, 0x3d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x20, // ...=........... - 0x02, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x28, // ...!...(.......( - 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0xda, // ...........*.... - 0x01, 0x00, 0x00, 0x21, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x00, // ...!.......<.... - 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x2b, 0x02, 0x00, 0x00, 0x2e, // .......*...+.... - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x2e, 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9a, // ................ - 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0x29, 0x01, 0x00, 0x00, 0xf7, // ...0.......).... - 0x00, 0x03, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x30, // ...;...........0 - 0x02, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x31, // ...1...;.......1 - 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0xd7, // ...O.......3.... - 0x01, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x98, 0x02, 0x00, 0x00, 0x33, // ...............3 - 0x02, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x9e, // ................ - 0x02, 0x00, 0x00, 0x98, 0x02, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0x9e, 0x02, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x8e, // ...9............ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xab, 0x02, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0xf4, // ...........9.... - 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xae, 0x02, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xab, 0x02, 0x00, 0x00, 0xe3, 0x02, 0x00, 0x00, 0x8e, // ................ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb2, 0x02, 0x00, 0x00, 0xae, 0x02, 0x00, 0x00, 0xef, // ................ - 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0xe4, // ................ - 0x02, 0x00, 0x00, 0xb2, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb8, // ................ - 0x02, 0x00, 0x00, 0xae, 0x02, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0xe5, 0x02, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, 0x88, // ................ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xba, 0x02, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0xb9, // ................ - 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xbd, 0x02, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xba, 0x02, 0x00, 0x00, 0xe6, 0x02, 0x00, 0x00, 0xf9, // ................ - 0x00, 0x02, 0x00, 0x3b, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x3b, 0x02, 0x00, 0x00, 0xf5, // ...;.......;.... - 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xef, 0x02, 0x00, 0x00, 0xe2, 0x02, 0x00, 0x00, 0x2e, // ................ - 0x02, 0x00, 0x00, 0xbd, 0x02, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x3c, // .......1.......< - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x2b, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, // .......+...O.... - 0x00, 0x00, 0x00, 0x2d, 0x02, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x00, // ...-............ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x3c, // ...............< - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x3c, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, // .......<........ - 0x00, 0x00, 0x00, 0xee, 0x02, 0x00, 0x00, 0xef, 0x02, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x2d, // ...........;...- - 0x02, 0x00, 0x00, 0x2b, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x3d, 0x02, 0x00, 0x00, 0xf8, // ...+.......=.... - 0x00, 0x02, 0x00, 0x21, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x23, // ...!...O.......# - 0x02, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x26, // ...............& - 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0xe2, // .......+...#.... - 0x02, 0x00, 0x00, 0xe5, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x51, // .......Q.......Q - 0x02, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x6d, // ...&...........m - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0x61, // ...............a - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x61, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9a, // .......a........ - 0x00, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xf7, // ...c...Q........ - 0x00, 0x03, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x63, // ...l...........c - 0x02, 0x00, 0x00, 0x64, 0x02, 0x00, 0x00, 0x67, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x67, // ...d...g.......g - 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x69, 0x02, 0x00, 0x00, 0x01, // ...........i.... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x85, // .......Q........ - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x69, // .......j.......i - 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x6a, // ...........k...j - 0x02, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x6d, 0x02, 0x00, 0x00, 0xf8, // ...........m.... - 0x00, 0x02, 0x00, 0x64, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x66, // ...d...........f - 0x02, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x6d, // .......Q.......m - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x6c, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, // .......l........ - 0x00, 0x02, 0x00, 0x6d, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe7, // ...m............ - 0x02, 0x00, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x67, 0x02, 0x00, 0x00, 0x66, 0x02, 0x00, 0x00, 0x64, // ...k...g...f...d - 0x02, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd7, 0x02, 0x00, 0x00, 0xe7, // ...R............ - 0x02, 0x00, 0x00, 0xf2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf7, // ...U...&........ - 0x00, 0x03, 0x00, 0x7f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xad, // ................ - 0x00, 0x00, 0x00, 0x73, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x73, 0x02, 0x00, 0x00, 0xbc, // ...s.......s.... - 0x00, 0x05, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x99, // .......u...U.... - 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // .......~........ - 0x00, 0x04, 0x00, 0x75, 0x02, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, 0x79, 0x02, 0x00, 0x00, 0xf8, // ...u...v...y.... - 0x00, 0x02, 0x00, 0x79, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7b, // ...y...........{ - 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0xa5, // ...........U.... - 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00, 0xa3, // ...........|.... - 0x00, 0x00, 0x00, 0x7b, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7d, // ...{...........} - 0x02, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x7f, // ...|............ - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x76, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // .......v........ - 0x00, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0xf9, // ...x.......U.... - 0x00, 0x02, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x7e, 0x02, 0x00, 0x00, 0xff, // ...........~.... - 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0xe9, 0x02, 0x00, 0x00, 0x7d, 0x02, 0x00, 0x00, 0x79, 0x02, 0x00, 0x00, 0x78, // .......}...y...x - 0x02, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xda, // ...v...R........ - 0x02, 0x00, 0x00, 0xe9, 0x02, 0x00, 0x00, 0xd7, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, 0x02, // .......Y...&.... - 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x91, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, // ................ - 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0x85, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x85, // ................ - 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x87, 0x02, 0x00, 0x00, 0x59, // ...............Y - 0x02, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x90, 0x02, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x87, 0x02, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0x8b, // ................ - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x8b, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x59, // ...............Y - 0x02, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8e, // ................ - 0x02, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0x8e, 0x02, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xf9, // ................ - 0x00, 0x02, 0x00, 0x91, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x88, 0x02, 0x00, 0x00, 0x85, // ................ - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8a, 0x02, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x59, // ...............Y - 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x91, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x90, // ................ - 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x91, 0x02, 0x00, 0x00, 0xf5, // ................ - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xeb, 0x02, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0x8b, // ................ - 0x02, 0x00, 0x00, 0x8a, 0x02, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0b, // ...........R.... - 0x00, 0x00, 0x00, 0xdd, 0x02, 0x00, 0x00, 0xeb, 0x02, 0x00, 0x00, 0xda, 0x02, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x3d, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x3d, // .......=.......= - 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xed, 0x02, 0x00, 0x00, 0xee, // ................ - 0x02, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0xdd, 0x02, 0x00, 0x00, 0x91, 0x02, 0x00, 0x00, 0x51, // ...<...........Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x03, // .......@........ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0xed, // ...Q.......A.... - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x42, // .......Q.......B - 0x02, 0x00, 0x00, 0xed, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, 0xed, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, // ...C...........P - 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x42, // .......D...A...B - 0x02, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x90, // ...C...@...>.... - 0x01, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, // ...D.......8.... + 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. + 0x00, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x10, // ................ + 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, // ................ + 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m + 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x73, // ain........K...s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler + 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......N...s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, // ColorTexture.... + 0x00, 0x06, 0x00, 0x81, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, // .......UniformBl + 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, // ock............. + 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x06, // ...u_params0.... + 0x00, 0x06, 0x00, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par + 0x61, 0x6d, 0x73, 0x31, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, 0x02, // ams1............ + 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x74, 0x78, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x83, // ...u_mtx........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x83, 0x01, 0x00, 0x00, 0x76, // ...............v + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x87, // _color0......... + 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, // ...v_texcoord0.. + 0x00, 0x06, 0x00, 0x94, 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // .......bgfx_Frag + 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x22, // Data0..G...K..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x21, // .......G...K...! + 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x22, // .......G...N..." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x21, // .......G...N...! + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, // .......H........ + 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x81, // ...#.......H.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, // .......#.......H + 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, // ...............H + 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x20, // ...........#... + 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, // ...H............ + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x81, 0x00, 0x00, 0x00, 0x02, // .......G........ + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G.......".... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, // ...G.......!.... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x83, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............ + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x87, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G............ + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x94, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............ + 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ + 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ + 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, // ................ + 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ...J...........; + 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ...J...K....... + 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...M...........; + 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, // ...M...N........ + 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...Q... .......+ + 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...Q...R.......+ + 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, // ...Q...V........ + 0x00, 0x03, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...Z.......+.... + 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x18, 0x00, 0x04, 0x00, 0x80, // ...v......@..... + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x05, 0x00, 0x81, // ................ + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x3b, // ...............; + 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, // ................ + 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, // ....... .......+ + 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0x86, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, // ..............@+ + 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x14, // .............M;. + 0x00, 0x02, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9e, // .......+........ + 0x00, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa3, // ...R.NA+........ + 0x00, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa5, // ...=..?+........ + 0x00, 0x00, 0x00, 0x55, 0x55, 0xd5, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0xad, // ...UU.>+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb3, // .......+........ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, // .......+........ + 0x00, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, // ....:.>+........ + 0x00, 0x00, 0x00, 0x37, 0x14, 0xb7, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc5, // ...7..>+........ + 0x00, 0x00, 0x00, 0x9c, 0xc4, 0x38, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc6, // .....8>,........ + 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x2b, // .............Y>+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x37, 0x14, 0x37, 0x3f, 0x2b, // ...........7.7?+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x7d, 0xd0, 0x93, 0x3d, 0x2c, // ...........}..=, + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc8, // ................ + 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, // .......+........ + 0x00, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, // ...!b.<+........ + 0x00, 0x00, 0x00, 0xef, 0x1a, 0xf4, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, // ......=+........ + 0x00, 0x00, 0x00, 0x21, 0x47, 0x73, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xce, // ...!Gs?,........ + 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xca, // ................ + 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd6, // .......+........ + 0x00, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, // ...:..?+........ + 0x00, 0x00, 0x00, 0x7c, 0x1a, 0xb6, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, // ...|...+........ + 0x00, 0x00, 0x00, 0x3a, 0xb9, 0x81, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd9, // ...:...,........ + 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0x2b, // .............*.+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xdb, 0xe8, 0xce, 0x3f, 0x2b, // ..............?+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xf1, 0x2c, 0x81, 0x3c, 0x2c, // ............,.<, + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xdb, // ................ + 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xde, // .......+........ + 0x00, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, // ......<+........ + 0x00, 0x00, 0x00, 0x3a, 0x30, 0x2f, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe0, // ...:0/.+........ + 0x00, 0x00, 0x00, 0xab, 0x2d, 0x71, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe1, // ....-q?,........ + 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xdd, // ................ + 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe9, // .......+........ + 0x00, 0x00, 0x00, 0x00, 0x20, 0x23, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xeb, // .... #>+........ + 0x00, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xed, // ......B+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xef, // .....V?+........ + 0x00, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf1, // ......A+........ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x95, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf4, // ......A+........ + 0x00, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, // ......8+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, // ......?+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, // .......+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x21, // ......?+.......! + 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x29, // ......?+.......) + 0x01, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x17, 0x00, 0x04, 0x00, 0x47, 0x01, 0x00, 0x00, 0x07, // ..... @....G.... + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4d, // .......+.......M + 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x2c, 0x00, 0x05, 0x00, 0x47, 0x01, 0x00, 0x00, 0x4e, // .......,...G...N + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x4d, 0x01, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x51, // .......M...+...Q + 0x00, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x59, // ...X....... ...Y + 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7f, // ........... .... + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7f, // ...........;.... + 0x01, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x86, // ........... .... + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x86, // ...........;.... + 0x01, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x93, // ........... .... + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x93, // ...........;.... + 0x01, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x05, 0x00, 0x47, // ...........,...G + 0x01, 0x00, 0x00, 0xee, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xef, 0x02, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, // ...........v...v + 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf0, // ...v...,........ + 0x02, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf1, 0x02, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0xe9, // ................ + 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf2, // .......,........ + 0x02, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf3, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf4, // .......,........ + 0x02, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf8, 0x02, 0x00, 0x00, 0xae, 0x47, 0x61, 0xbd, 0x36, // ............Ga.6 + 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=.... + 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...L...K...=.... + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, // ...O...N...=.... + 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, // ...........=.... + 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x47, // ...........O...G + 0x01, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x47, 0x01, 0x00, 0x00, 0xbe, // ...........G.... + 0x01, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x47, // ...............G + 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0xee, 0x02, 0x00, 0x00, 0x85, // ................ + 0x00, 0x05, 0x00, 0x47, 0x01, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x4e, // ...G...........N + 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0xc1, // ...Q............ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, // .......Q........ + 0x01, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, // ...........P.... + 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, 0x00, // ................ + 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x59, 0x01, 0x00, 0x00, 0xca, // .......A...Y.... + 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x80, // .......X...=.... + 0x00, 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0xca, 0x01, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0e, // ................ + 0x00, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0x4f, // ...............O + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0xcc, // ................ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, // ...............E + 0x00, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, 0x00, 0xd1, // .......A........ + 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x3d, // .......V.......= + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x56, // ...............V + 0x00, 0x05, 0x00, 0x5a, 0x00, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4c, // ...Z.......O...L + 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xf3, // ...X............ + 0x01, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x4f, // ...............O + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xf6, // ................ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x10, // ................ + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0xef, // ................ + 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x83, // ...A............ + 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...V.......=.... + 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, // ...........P.... + 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, // ................ + 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x02, // ................ + 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0x83, // ...A............ + 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...V.......=.... + 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x90, // ................ + 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x09, // ................ + 0x02, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, // ...............R + 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xde, 0x02, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0xf6, // ................ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, // .......Q........ + 0x01, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0e, // ...........R.... + 0x00, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0xde, 0x02, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x09, // ...Q............ + 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xe2, // .......R........ + 0x02, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, // ................ + 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0xe2, 0x02, 0x00, 0x00, 0x84, // ................ + 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x83, // ...A............ + 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...R.......=.... + 0x00, 0x00, 0x00, 0xe2, 0x01, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x86, // ...........A.... + 0x00, 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xb3, // ...........R.... + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0xe3, // ...=............ + 0x01, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0xe2, // ...........(.... + 0x01, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x45, 0x02, 0x00, 0x00, 0x00, // ...........E.... + 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x28, 0x02, 0x00, 0x00, 0x29, 0x02, 0x00, 0x00, 0x30, // .......(...)...0 + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x30, 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9a, // .......0........ + 0x00, 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, 0xe2, 0x01, 0x00, 0x00, 0x21, 0x01, 0x00, 0x00, 0xf7, // ...2.......!.... + 0x00, 0x03, 0x00, 0x44, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x32, // ...D...........2 + 0x02, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0x36, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x36, // ...3...6.......6 + 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0xe2, // ...........8.... + 0x01, 0x00, 0x00, 0x29, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x43, 0x02, 0x00, 0x00, 0x00, // ...).......C.... + 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x38, 0x02, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0x43, // .......8...9...C + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x39, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, // .......9...O.... + 0x00, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0x00, // ...;............ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x90, // .......;........ + 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa6, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0xe2, // ................ + 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0xa6, // ...........A.... + 0x02, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb3, // ................ + 0x02, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, // ...A............ + 0x00, 0x00, 0x00, 0xb6, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xb3, // ................ + 0x02, 0x00, 0x00, 0xf1, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xba, // ................ + 0x02, 0x00, 0x00, 0xb6, 0x02, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0xf2, 0x02, 0x00, 0x00, 0xba, 0x02, 0x00, 0x00, 0x8e, // ................ + 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0xb6, 0x02, 0x00, 0x00, 0xf1, // ................ + 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc1, 0x02, 0x00, 0x00, 0xf3, // ................ + 0x02, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc2, // ................ + 0x02, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0xc1, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0xc5, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xc2, // ................ + 0x02, 0x00, 0x00, 0xf4, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x43, 0x02, 0x00, 0x00, 0xf8, // ...........C.... + 0x00, 0x02, 0x00, 0x43, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, // ...C............ + 0x03, 0x00, 0x00, 0xf0, 0x02, 0x00, 0x00, 0x36, 0x02, 0x00, 0x00, 0xc5, 0x02, 0x00, 0x00, 0x39, // .......6.......9 + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x44, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x33, // .......D.......3 + 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x35, 0x02, 0x00, 0x00, 0xdf, // ...O.......5.... + 0x01, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x44, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x44, // .......D.......D + 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................ + 0x03, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, 0x35, 0x02, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0xf9, // ...C...5...3.... + 0x00, 0x02, 0x00, 0x45, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x29, 0x02, 0x00, 0x00, 0x4f, // ...E.......)...O + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x2b, 0x02, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0xdf, // .......+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x00, 0x00, 0x2b, 0x02, 0x00, 0x00, 0xf0, 0x02, 0x00, 0x00, 0xf3, 0x02, 0x00, 0x00, 0x51, // ...+...........Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x00, // .......Y........ + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x75, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, // .......u........ + 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0x69, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x69, // .......i.......i + 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x59, // ...........k...Y + 0x02, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x74, 0x02, 0x00, 0x00, 0x00, // ...........t.... + 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x6f, // .......k...l...o + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x6f, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // .......o........ + 0x00, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x59, // ...q...........Y + 0x02, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x73, // ...............s + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x71, // .......2.......q + 0x02, 0x00, 0x00, 0xf8, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x75, 0x02, 0x00, 0x00, 0xf8, // ...........u.... + 0x00, 0x02, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6e, // ...l...........n + 0x02, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x75, // .......Y.......u + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x74, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, // .......t........ + 0x00, 0x02, 0x00, 0x75, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf9, // ...u............ + 0x02, 0x00, 0x00, 0x73, 0x02, 0x00, 0x00, 0x6f, 0x02, 0x00, 0x00, 0x6e, 0x02, 0x00, 0x00, 0x6c, // ...s...o...n...l + 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x2e, // ...Q.......].... + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x87, 0x02, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0x7b, 0x02, 0x00, 0x00, 0xf8, // ...........{.... + 0x00, 0x02, 0x00, 0x7b, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x7d, // ...{...........} + 0x02, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x86, // ...]............ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x7d, 0x02, 0x00, 0x00, 0x7e, // ...........}...~ + 0x02, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x81, 0x02, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x83, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ................ + 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, // ...]............ + 0x00, 0x00, 0x00, 0x85, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xa3, // ...........2.... + 0x00, 0x00, 0x00, 0x83, 0x02, 0x00, 0x00, 0xf8, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x87, // ................ + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // .......~........ + 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0xf9, // ...........].... + 0x00, 0x02, 0x00, 0x87, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x86, 0x02, 0x00, 0x00, 0xff, // ................ + 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x87, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0xfb, 0x02, 0x00, 0x00, 0x85, 0x02, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x80, // ................ + 0x02, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x61, // ...~...Q.......a + 0x02, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x99, // ................ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0x8d, // ................ + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x8d, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x9a, // ................ + 0x00, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xf7, // .......a........ + 0x00, 0x03, 0x00, 0x98, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x8f, // ................ + 0x02, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0x93, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x93, // ................ + 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x95, 0x02, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x0c, // .......a........ + 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x97, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, // ...............2 + 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x95, 0x02, 0x00, 0x00, 0xf8, 0x02, 0x00, 0x00, 0xf9, // ................ + 0x00, 0x02, 0x00, 0x99, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x90, 0x02, 0x00, 0x00, 0x85, // ................ + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x61, // ...............a + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x99, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x98, // ................ + 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x99, 0x02, 0x00, 0x00, 0xf5, // ................ + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfd, 0x02, 0x00, 0x00, 0x97, 0x02, 0x00, 0x00, 0x93, // ................ + 0x02, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, // ...........P.... + 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0xf9, 0x02, 0x00, 0x00, 0xfb, 0x02, 0x00, 0x00, 0xfd, // ................ + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x45, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x45, // .......E.......E + 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0x00, // ................ + 0x03, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x99, 0x02, 0x00, 0x00, 0x51, // ...D...........Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0x03, // .......H........ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, 0xff, // ...Q.......I.... + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4a, // .......Q.......J + 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0x4b, 0x02, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, // ...K...........P + 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, 0x4a, // .......L...I...J + 0x02, 0x00, 0x00, 0x4b, 0x02, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x94, // ...K...H...>.... + 0x01, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, // ...L.......8.... 0x00, 0x60, 0x00, // .`. }; -static const uint8_t fs_texture_cube_dx9[1596] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x05, 0x75, 0x5f, 0x6d, 0x74, 0x78, 0x14, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, // ....u_mtx....... - 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x03, // ....u_params0... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // ........u_params - 0x31, 0x12, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x05, 0x00, 0x00, 0x00, // 1............... - 0x03, 0xff, 0xff, 0xfe, 0xff, 0x3f, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0xcd, // .....?.CTAB..... - 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, // ................ - 0x91, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // .......l........ - 0x00, 0x02, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x02, // ...x............ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0xac, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // r............... - 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x74, 0x78, 0x00, 0xab, 0xab, 0x03, 0x00, 0x03, 0x00, 0x04, // ...u_mtx........ - 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par - 0x61, 0x6d, 0x73, 0x30, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, // ams0............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, // .......u_params1 - 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, // .ps_3_0.Microsof - 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, // t (R) HLSL Shade - 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, // r Compiler 10.1. - 0xab, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x05, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x00, // ...Q..........@. - 0x00, 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0xcd, 0xcc, 0x0c, 0x40, 0x51, 0x00, 0x00, 0x05, 0x06, // ......?...@Q.... - 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0x1c, 0x2e, 0x4d, 0x3b, 0x52, 0xb8, 0x4e, 0x41, 0x55, // ......?..M;R.NAU - 0x55, 0xd5, 0x3e, 0x51, 0x00, 0x00, 0x05, 0x07, 0x00, 0x0f, 0xa0, 0x3d, 0x0a, 0x87, 0x3f, 0xae, // U.>Q.......=..?. - 0x47, 0x61, 0xbd, 0x00, 0x00, 0xc0, 0xbf, 0x00, 0x00, 0x20, 0xc0, 0x51, 0x00, 0x00, 0x05, 0x08, // Ga....... .Q.... - 0x00, 0x0f, 0xa0, 0x98, 0x3a, 0xd3, 0x3e, 0x37, 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, 0x17, // ....:.>7..>..8>. - 0xb7, 0xd1, 0x38, 0x51, 0x00, 0x00, 0x05, 0x09, 0x00, 0x0f, 0xa0, 0x00, 0xd0, 0x96, 0x41, 0x00, // ..8Q..........A. - 0x00, 0x56, 0x3f, 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x0a, // .V?...A...?Q.... - 0x00, 0x0f, 0xa0, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, 0xb9, 0x81, 0xbe, 0x00, // ...:..?|...:.... - 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x0b, 0x00, 0x0f, 0xa0, 0x21, 0x62, 0x9e, 0x3c, 0xef, // ...Q.......!b.<. - 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, 0xb0, 0x9d, 0x42, 0x51, 0x00, 0x00, 0x05, 0x0c, // ..=!Gs?...BQ.... - 0x00, 0x0f, 0xa0, 0xed, 0xc6, 0x59, 0x3e, 0x37, 0x14, 0x37, 0x3f, 0x7d, 0xd0, 0x93, 0x3d, 0x00, // .....Y>7.7?}..=. - 0x20, 0x23, 0x3e, 0x51, 0x00, 0x00, 0x05, 0x0d, 0x00, 0x0f, 0xa0, 0xd4, 0xab, 0x2a, 0xbf, 0xdb, // #>Q.........*.. - 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x0e, // ..?.,.<....Q.... - 0x00, 0x0f, 0xa0, 0x8d, 0x81, 0x90, 0x3c, 0x3a, 0x30, 0x2f, 0xbd, 0xab, 0x2d, 0x71, 0x3f, 0x00, // ......<:0/..-q?. - 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, // ................ - 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x80, 0x01, // ................ - 0x00, 0xe4, 0x90, 0x05, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, // .........U...... - 0x00, 0x03, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0xe6, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x0e, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0x90, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, // .....U.......... - 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x02, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x24, // ...............$ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, // ................ - 0x00, 0x08, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, // ......._........ - 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x00, // ................ - 0x00, 0x00, 0x8b, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x8b, 0x0f, // .............U.. - 0x00, 0x00, 0x02, 0x01, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x8b, 0x05, 0x00, 0x00, 0x03, 0x01, // ................ - 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0xff, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, // ................ - 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, // ................ - 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x12, // .U.............. - 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x03, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x02, // ................ - 0x00, 0xe4, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x01, 0x00, 0x08, 0x80, 0x03, 0x00, 0xff, 0xa0, 0x05, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, // ................ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x06, 0x00, 0x00, 0xa0, 0x29, 0x00, 0x04, 0x02, 0x04, // ...........).... - 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x17, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x06, // ... ............ - 0x00, 0xff, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x07, // ................ - 0x00, 0x00, 0xa0, 0x07, 0x00, 0x55, 0xa0, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80, 0x00, // .....U. ........ - 0x00, 0x00, 0x80, 0x06, 0x00, 0xff, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x02, 0x80, 0x01, // ................ - 0x00, 0x55, 0x80, 0x07, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x55, 0xa0, 0x20, 0x00, 0x00, 0x03, 0x01, // .U.......U. .... - 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0xff, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, // .....U.......... - 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x07, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x55, 0xa0, 0x02, // .............U.. - 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x81, 0x06, 0x00, 0x55, 0xa0, 0x05, // .............U.. - 0x00, 0x00, 0x03, 0x03, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xaa, 0xa0, 0x58, // ...............X - 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x01, // ................ - 0x00, 0xc9, 0x80, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x08, // ...*............ - 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80, 0x0c, // ................ - 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, 0x0b, // ................ - 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, 0x80, 0x0e, // ................ - 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80, 0x0a, // ................ - 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x02, 0x80, 0x0d, // ................ - 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x02, // ................ - 0x00, 0xe4, 0x80, 0x04, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, // .....U.......... - 0x00, 0xe4, 0x80, 0x08, 0x00, 0xff, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x01, // ................ - 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x0f, // .............U.. - 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, // ................ - 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x0c, 0x00, 0xff, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, // ................ - 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, // ................ - 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x04, // .U.............. - 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x09, 0x00, 0xaa, 0xa0, 0x09, // ................ - 0x00, 0xff, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x06, // ................ - 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x03, // .........U...... - 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0c, 0x80, 0x07, // ................ - 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x03, 0x80, 0x01, 0x00, 0xee, 0x80, 0x04, // ................ - 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x09, // ................ - 0x00, 0x00, 0xa0, 0x09, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x03, // .....U.......... - 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x02, // ................ - 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0f, // .............U.. - 0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, // ................ - 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x0b, 0x00, 0xff, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x03, // ................ - 0x00, 0x01, 0x80, 0x02, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x02, // ................ - 0x00, 0x55, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x58, // .U.............X - 0x00, 0x00, 0x04, 0x01, 0x00, 0x0e, 0x80, 0x01, 0x00, 0x55, 0x80, 0x0a, 0x00, 0xff, 0xa0, 0x03, // .........U...... - 0x00, 0x90, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, // ...X............ - 0x00, 0xf9, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, // .......+........ - 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ............ -}; -static const uint8_t fs_texture_cube_dx11[2080] = +static const uint8_t fs_texture_cube_dx11[2071] = { - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x09, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x00, 0x10, 0x00, // ...u_params1.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x75, 0x5f, 0x6d, 0x74, 0x78, 0x14, 0x00, 0x20, 0x00, // .......u_mtx.. . 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, // r0..........s_te - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // xColor0......... - 0xa8, 0x07, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x80, 0x5f, 0x81, 0x67, 0x05, 0x7d, 0x62, 0xae, // ....DXBC._.g.}b. - 0x51, 0xfc, 0xdc, 0x7e, 0x3b, 0x72, 0x2d, 0x0c, 0x01, 0x00, 0x00, 0x00, 0xa8, 0x07, 0x00, 0x00, // Q..~;r-......... - 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, // ....,........... - 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNl........... - 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // P............... - 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ - 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // b............... - 0x02, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT - 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, // ION.COLOR.TEXCOO - 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // RD..OSGN,....... - 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ........... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, // ............SV_T - 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xcc, 0x06, 0x00, 0x00, // ARGET...SHDR.... - 0x40, 0x00, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, // @.......Y...F. . - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, // ........Z....`.. - 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....X0...p...... - 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // UU..b........... - 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...2.......e... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, // . ......h....... - 0x32, 0x00, 0x00, 0x0f, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, // 2...2.......F... - 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, // .....@.....@...@ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, // .........@...... - 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, // ............8... - 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // 2.......F....... - 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, // .@.....?........ - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... - 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x89, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V......... ..... - 0x03, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2...r....... - 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // F. ............. - 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ................ - 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r.......F....... - 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, // F. ............. - 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, // F.......D....... - 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ....:.......8... - 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r............... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, // F.......H....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, // .....`........ . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, // ......../...r... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....F........... - 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 8...r.......F... - 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, // .....@.....@...@ - 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // ...@........r... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ....F........... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r.......F....... - 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // F...A.......2... - 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // r......... ..... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....F.......F... - 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // :. .........8... - 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // r............... - 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, // F.......8....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // ....F.......F... - 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....1........... - 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // .. ..........@.. - 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ...?............ - 0x36, 0x20, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 6 ..r.......F... - 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........r....... - 0x02, 0x40, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, // .@....M;..M;..M; - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, // ....F.......8... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, // .@..R.NAR.NAR.NA - 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ..../...r....... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, // F.......8...r... - 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0x55, 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, 0x00, 0x00, 0x00, 0x00, // UU.>UU.>UU.>.... - 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....r.......F... - 0x03, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ....2...r....... - 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, // F........@..=..? - 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // =..?=..?.....@.. - 0xae, 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, 0x00, 0x00, 0x00, 0x00, // .Ga..Ga..Ga..... - 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 7...r.......F... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....F.......F... - 0x03, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x0b, 0x32, 0x00, 0x10, 0x00, // ........1...2... - 0x01, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ...... ......... - 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, // .@.....?.. @.... - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x02, 0x40, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, 0x37, 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, // .@...:.>7..>..8> - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, // ....F........... - 0x22, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, // "........@....Y> - 0x37, 0x14, 0x37, 0x3f, 0x7d, 0xd0, 0x93, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 7.7?}..=....F... - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........B....... - 0x02, 0x40, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, 0xef, 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, // .@..!b.<...=!Gs? - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, // ....F........... - 0x12, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, // .........@..:..? - 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, 0xb9, 0x81, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // |...:.......F... - 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ........"....... - 0x02, 0x40, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0xdb, 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, // .@....*....?.,.< - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, // ....F........... - 0x42, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, // B........@.....< - 0x3a, 0x30, 0x2f, 0xbd, 0xab, 0x2d, 0x71, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // :0/..-q?....F... - 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....8...r....... - 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x56, 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......V. ..... - 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....8...r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, // F........@.....8 - 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, // ...8...8..../... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r.......F....... - 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 8...r.......F... - 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, // .....@... #>. #> - 0x00, 0x20, 0x23, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // . #>........r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, // ....F.......2... - 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, // .@.....A...A...A - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, // .....@....V?..V? - 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, // ..V?....2...r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0x00, 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x00, 0x00, // ...A...A...A.... - 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // .@.....?...?...? - 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........r....... - 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // F.......F....... - 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // /...r.......F... - 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....8...r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, // F........@.....B - 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, // ...B...B........ - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r.......F....... - 0x01, 0x00, 0x00, 0x07, 0xe2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, // ............V... - 0x01, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, // ............7... - 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // r............... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // F............... - 0x15, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6.... ...... - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x60, 0x00, // F.......>.....`. + 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x07, 0x00, 0x00, 0x44, // r0.............D + 0x58, 0x42, 0x43, 0xd5, 0xf2, 0xa7, 0x2b, 0xa7, 0xfb, 0xcf, 0xb4, 0x73, 0x8c, 0x5f, 0x37, 0xc4, // XBC...+....s._7. + 0x6e, 0x4e, 0xb1, 0x01, 0x00, 0x00, 0x00, 0xb4, 0x07, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // nN............., + 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, // ...........ISGNl + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, // ...........P.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, // ...........b.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, // ................ + 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, // ...SV_POSITION.C + 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, // OLOR.TEXCOORD..O + 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, // SGN,........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, // .......SV_TARGET + 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xd8, 0x06, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xb6, // ...SHEX....P.... + 0x01, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...j...Y...F. .. + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, // .......Z....`... + 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, // ...X0...p......U + 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, // U..b...........b + 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ...2.......e.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x32, // ......h.......2 + 0x00, 0x00, 0x0f, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, // ...2.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, // ....@.....@...@. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, // ........@....... + 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x32, // ...........8...2 + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, // @.....?......... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, // ...8...........V + 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x89, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ......... ...... + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...2...r.......F + 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, // . .............. + 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, // ...............r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......F.......F + 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x82, // . .............. + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......F.......F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x00, // .......D........ + 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, // ...:.......8...r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...............F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8e, 0x82, 0x01, 0x00, 0x80, 0x43, // .......H.......C + 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // U..........F.... + 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, // ...F~.......`... + 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, // ..... ........./ + 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x81, // ...r.......F.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, // .......8...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xcd, // ...F........@... + 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x19, // ..@...@...@..... + 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...r.......F.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // .......r.......F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, // .......F...A.... + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, // ...2...r........ + 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // . .........F.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, 0x82, // ...F............ + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......:. ...... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, // ...8...r........ + 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, // .......F.......8 + 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, // ...........F.... + 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x08, 0x12, // ...F.......1.... + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ......... ...... + 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x04, 0x03, 0x0a, // ....@.....?..... + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x20, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, // .......6 ..r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x0a, 0x72, // ...F...........r + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, // ........@....M;. + 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // .M;..M;....F.... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // ...8...r.......F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, 0x52, // ........@..R.NAR + 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, // .NAR.NA..../...r + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // .......F.......8 + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x55, 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, 0x55, // ....@..UU.>UU.>U + 0x55, 0xd5, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x03, // U.>........r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, // ...F.......2...r + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x00, // @..=..?=..?=..?. + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xae, 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, 0xae, // ....@...Ga..Ga.. + 0x47, 0x61, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, // Ga.....7...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...F.......F.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x31, // ...F...........1 + 0x00, 0x00, 0x0b, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, // ...2......... .. + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, // ........@.....?. + 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, // . @............. + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, 0x37, // ........@...:.>7 + 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ..>..8>....F.... + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // ......."........ + 0x40, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x37, 0x14, 0x37, 0x3f, 0x7d, 0xd0, 0x93, 0x3d, 0x00, // @....Y>7.7?}..=. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, // ...F...........B + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, 0xef, // ........@..!b.<. + 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ..=!Gs?....F.... + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // ................ + 0x40, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, 0xb9, 0x81, 0xbe, 0x00, // @..:..?|...:.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, // ...F..........." + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0xdb, // ........@....*.. + 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ..?.,.<....F.... + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // .......B........ + 0x40, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x3a, 0x30, 0x2f, 0xbd, 0xab, 0x2d, 0x71, 0x3f, 0x00, // @.....<:0/..-q?. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, // ...F.......8...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x56, // .......F.......V + 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, // . .........8...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x00, // @.....8...8...8. + 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // .../...r.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, // .......8...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ...F........@... + 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, // #>. #>. #>..... + 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...r.......F.... + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, // ...2...r.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, 0x00, // ........@.....A. + 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ..A...A.....@... + 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x32, // .V?..V?..V?....2 + 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, 0x00, // ....@.....A...A. + 0x80, 0x95, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, // ..A.....@.....?. + 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x72, // ..?...?........r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, // .......F.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, // ......./...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, // ...F.......8...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, // @.....B...B...B. + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // .......r.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0xe2, 0x00, 0x10, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x02, // ...V............ + 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ...7...r........ + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, // .......F........ + 0x07, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05, 0xf2, // ...........6.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, // ......F.......> + 0x00, 0x00, 0x01, 0x00, 0x00, 0x60, 0x00, // .....`. }; -static const uint8_t fs_texture_cube_mtl[3861] = +static const uint8_t fs_texture_cube_mtl[4182] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ @@ -892,7 +786,7 @@ static const uint8_t fs_texture_cube_mtl[3861] = 0x14, 0x01, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, // .. ........u_par 0x61, 0x6d, 0x73, 0x31, 0x12, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, // ams1...........s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // _texColor....... - 0x00, 0x00, 0x00, 0x7a, 0x0e, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // ...z...#include + 0x00, 0x00, 0x00, 0xbb, 0x0f, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // .......#include 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, // .# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, // include ..using nam @@ -902,229 +796,249 @@ static const uint8_t fs_texture_cube_mtl[3861] = 0x61, 0x6d, 0x73, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // ams0;. float4 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // u_params1;. 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x74, 0x78, 0x3b, 0x0a, // float4x4 u_mtx;. - 0x7d, 0x3b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, // };..constant flo - 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x35, 0x34, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x0a, // at3 _754 = {};.. - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // struct xlatMtlMa - 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // in_out.{. flo - 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, // at4 bgfx_FragDat - 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, // a0 [[color(0)]]; - 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // .};..struct xlat - 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, // MtlMain_in.{. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // float4 v_color0 - 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, // [[user(locn0)]] - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x74, // ;. float3 v_t - 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, // excoord0 [[user( - 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, // locn1)]];.};..fr - 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // agment xlatMtlMa - 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // in_out xlatMtlMa - 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, // in(xlatMtlMain_i - 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, // n in [[stage_in] - 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, // ], constant _Glo - 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // bal& _mtl_u [[bu - 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // ffer(0)]], textu - 0x72, 0x65, 0x63, 0x75, 0x62, 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, // recube s_ - 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, // texColor [[textu - 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // re(0)]], sampler - 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, // s_texColorSampl - 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, // er [[sampler(0)] - 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // ]).{. xlatMtl - 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, // Main_out out = { - 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, // };. float4 _4 - 0x39, 0x34, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, // 94 = s_texColor. - 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // sample(s_texColo - 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, // rSampler, normal - 0x69, 0x7a, 0x65, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x74, // ize((_mtl_u.u_mt - 0x78, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x28, 0x28, 0x69, 0x6e, 0x2e, // x * float4(((in. - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x20, 0x2a, // v_texcoord0.xy * - 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x31, // 2.0) - float2(1 - 0x2e, 0x30, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x31, 0x2e, // .0)) * float2(1. - 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x30, // 0, -1.0), 1.0, 0 - 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, // .0)).xyz), level - 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // (_mtl_u.u_params - 0x30, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 0.x));. float - 0x33, 0x20, 0x5f, 0x34, 0x36, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x39, 0x34, 0x2e, 0x78, 0x79, // 3 _465 = _494.xy - 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x35, // z;. float3 _5 - 0x31, 0x33, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x61, 0x62, 0x73, // 13 = mix(pow(abs - 0x28, 0x5f, 0x34, 0x36, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, // (_465), float3(2 - 0x2e, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, // .200000047683715 - 0x38, 0x29, 0x29, 0x2c, 0x20, 0x5f, 0x34, 0x36, 0x35, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 8)), _465, float + 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // };..struct xlatM + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, // tlMain_out.{. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, // float4 bgfx_Fra + 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, // gData0 [[color(0 + 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, // )]];.};..struct + 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, // xlatMtlMain_in.{ + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // . float4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, // lor0 [[user(locn + 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // 0)]];. float3 + 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, // v_texcoord0 [[u + 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, // ser(locn1)]];.}; + 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // ..fragment xlatM + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // tlMain_out xlatM + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // tlMain(xlatMtlMa + 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, // in_in in [[stage + 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, // _in]], constant + 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, // _Global& _mtl_u + 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, // [[buffer(0)]], t + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x63, 0x75, 0x62, 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, // exturecube s_texColor [[t + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, // exture(0)]], sam + 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, // pler s_texColorS + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // ampler [[sampler + 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, // (0)]]).{. xla + 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, // tMtlMain_out out + 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // = {};. float + 0x34, 0x20, 0x5f, 0x35, 0x30, 0x32, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // 4 _502 = s_texCo + 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, // lor.sample(s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x66, 0x61, // ColorSampler, fa + 0x73, 0x74, 0x3a, 0x3a, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x28, 0x5f, // st::normalize((_ + 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x74, 0x78, 0x20, 0x2a, 0x20, 0x66, 0x6c, // mtl_u.u_mtx * fl + 0x6f, 0x61, 0x74, 0x34, 0x28, 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // oat4(((in.v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, // oord0.xy * 2.0) + 0x2d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x2a, // - float2(1.0)) * + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, // float2(1.0, -1. + 0x30, 0x29, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, // 0), 1.0, 0.0)).x + 0x79, 0x7a, 0x29, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // yz), level(_mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x78, 0x29, 0x29, 0x3b, // u.u_params0.x)); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, 0x36, 0x39, // . float3 _469 + 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x30, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, // = _502.xyz;. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x35, 0x32, 0x31, 0x20, 0x3d, 0x20, 0x6d, // float3 _521 = m + 0x69, 0x78, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x61, 0x62, 0x73, 0x28, 0x5f, 0x34, 0x36, 0x39, 0x29, // ix(pow(abs(_469) + 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, 0x2e, 0x32, 0x30, 0x30, 0x30, 0x30, // , float3(2.20000 + 0x30, 0x30, 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, 0x38, 0x32, 0x30, 0x33, 0x31, 0x32, // 0047683715820312 + 0x35, 0x29, 0x29, 0x2c, 0x20, 0x5f, 0x34, 0x36, 0x39, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 5)), _469, float 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // 3(_mtl_u.u_param 0x73, 0x30, 0x2e, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x32, 0x2e, 0x30, // s0.z)) * pow(2.0 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // , _mtl_u.u_param 0x73, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // s0.w);. float - 0x34, 0x20, 0x5f, 0x34, 0x37, 0x31, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, // 4 _471 = float4( - 0x5f, 0x35, 0x31, 0x33, 0x2e, 0x78, 0x2c, 0x20, 0x5f, 0x35, 0x31, 0x33, 0x2e, 0x79, 0x2c, 0x20, // _513.x, _513.y, - 0x5f, 0x35, 0x31, 0x33, 0x2e, 0x7a, 0x2c, 0x20, 0x5f, 0x34, 0x39, 0x34, 0x2e, 0x77, 0x29, 0x20, // _513.z, _494.w) - 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, // * in.v_color0;. - 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x34, 0x39, 0x3b, 0x0a, // float3 _749;. - 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // if (_mtl_u.u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x30, 0x2e, 0x35, // _params1.x < 0.5 - 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ). {. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x35, 0x35, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x61, // float3 _550 = fa - 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x34, 0x37, 0x31, 0x2e, 0x78, // st::clamp(_471.x - 0x79, 0x7a, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x2c, // yz, float3(0.0), - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, // float3(1.0));. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x39, // float _59 - 0x33, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x35, 0x30, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 3 = _550.x;. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x34, 0x33, 0x3b, 0x0a, // float _743;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // do. - 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, 0x39, 0x33, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, // if (_593 <= 0.0 - 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, // 0313080009073019 - 0x30, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 03). + 0x34, 0x20, 0x5f, 0x37, 0x33, 0x34, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x30, 0x32, 0x3b, 0x0a, 0x20, // 4 _734 = _502;. + 0x20, 0x20, 0x20, 0x5f, 0x37, 0x33, 0x34, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x32, 0x31, // _734.x = _521 + 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x33, 0x34, 0x2e, 0x79, 0x20, 0x3d, // .x;. _734.y = + 0x20, 0x5f, 0x35, 0x32, 0x31, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x33, // _521.y;. _73 + 0x34, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x32, 0x31, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, // 4.z = _521.z;. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x37, 0x39, 0x20, 0x3d, 0x20, // float4 _479 = + 0x5f, 0x37, 0x33, 0x34, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // _734 * in.v_colo + 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, // r0;. float3 _ + 0x37, 0x36, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, // 767;. if (_mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, // l_u.u_params1.x + 0x3c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // < 0.5). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x35, 0x35, 0x38, // float3 _558 + 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, // = fast::clamp(_ + 0x34, 0x37, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // 479.xyz, float3( + 0x30, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, // 0.0), float3(1.0 + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // ));. floa + 0x74, 0x20, 0x5f, 0x36, 0x30, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x35, 0x38, 0x2e, 0x78, 0x3b, // t _601 = _558.x; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, // . float _ + 0x37, 0x36, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, // 761;. do. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x36, 0x30, 0x31, 0x20, 0x3c, // if (_601 < + 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, // = 0.003130800090 + 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, 0x30, 0x39, 0x39, 0x36, 0x30, 0x39, 0x33, // 7301902770996093 + 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 75). 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x5f, 0x37, 0x34, 0x33, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, // _743 = 12.9200 - 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, // 00076293945 * _5 - 0x39, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 93;. - 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x34, 0x33, 0x20, 0x3d, 0x20, 0x28, // _743 = ( - 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, // 1.05499994754791 - 0x32, 0x36, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x39, 0x33, 0x2c, 0x20, 0x30, // 26 * pow(_593, 0 - 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, // .416666656732559 - 0x32, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, // 2)) - 0.05499999 - 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 9701976776;. + 0x20, 0x20, 0x5f, 0x37, 0x36, 0x31, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, // _761 = 12.9200 + 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x20, // 000762939453125 + 0x2a, 0x20, 0x5f, 0x36, 0x30, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // * _601;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, // break;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x36, 0x31, // _761 + 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, // = fma(1.0549999 + 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, 0x39, 0x37, 0x36, 0x35, 0x36, 0x32, 0x35, // 4754791259765625 + 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x36, 0x30, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, // , pow(_601, 0.41 + 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x30, 0x34, // 6666656732559204 + 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x35, 0x34, // 1015625), -0.054 + 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x31, // 9999997019767761 + 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 23046875);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, // break + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // ;. }. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, // brea - 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // k;. } - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, // . } while - 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // (false);. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x32, 0x37, 0x20, 0x3d, 0x20, 0x5f, // float3 _727 = _ - 0x37, 0x35, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, // 754;. _72 - 0x37, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x34, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 7.x = _743;. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x39, 0x37, 0x20, 0x3d, // float _597 = - 0x20, 0x5f, 0x35, 0x35, 0x30, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _550.y;. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x34, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float _745;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // do. - 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, // {. if - 0x20, 0x28, 0x5f, 0x35, 0x39, 0x37, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, // (_597 <= 0.0031 - 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, // 308000907301903) - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // . {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // _ - 0x37, 0x34, 0x35, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, // 745 = 12.9200000 - 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x39, 0x37, 0x3b, // 76293945 * _597; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. - 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x34, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, // _745 = (1.0 - 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, // 549999475479126 - 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x39, 0x37, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, // * pow(_597, 0.41 - 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, // 66666567325592)) - 0x20, 0x2d, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, // - 0.05499999970 - 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 1976776;. + 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, // k; // unreachabl + 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, // e workaround. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, // } while(fal + 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // se);. flo + 0x61, 0x74, 0x20, 0x5f, 0x36, 0x30, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x35, 0x38, 0x2e, 0x79, // at _605 = _558.y + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // ;. float + 0x5f, 0x37, 0x36, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, // _763;. do + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // . {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x36, 0x30, 0x35, 0x20, // if (_605 + 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, // <= 0.00313080009 + 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, 0x30, 0x39, 0x39, 0x36, 0x30, 0x39, // 0730190277099609 + 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 375). + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x5f, 0x37, 0x36, 0x33, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, // _763 = 12.920 + 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, // 0000762939453125 + 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x30, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // * _605;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, // break;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x36, // _76 + 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, // 3 = fma(1.054999 + 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, 0x39, 0x37, 0x36, 0x35, 0x36, 0x32, // 9475479125976562 + 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x36, 0x30, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, // 5, pow(_605, 0.4 + 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x30, // 1666665673255920 + 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x35, // 41015625), -0.05 + 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, // 4999999701976776 + 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 123046875);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, // brea + 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // k;. } + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, // . bre + 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, // ak; // unreachab + 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x20, 0x20, // le workaround. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, // } while(fa 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // lse);. fl - 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x33, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x32, 0x37, // oat3 _730 = _727 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x33, 0x30, 0x2e, 0x79, // ;. _730.y - 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x34, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _745;. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x36, 0x30, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x35, // float _601 = _5 - 0x35, 0x30, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // 50.z;. fl - 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x34, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // oat _747;. - 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // do. {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, // if (_ - 0x36, 0x30, 0x31, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, // 601 <= 0.0031308 - 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, 0x20, 0x20, // 000907301903). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x34, 0x37, // _747 - 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, // = 12.9200000762 - 0x39, 0x33, 0x39, 0x34, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x30, 0x31, 0x3b, 0x0a, 0x20, 0x20, // 93945 * _601;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, // br - 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // eak;. - 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // }. e - 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. - 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x5f, 0x37, 0x34, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, // _747 = (1.0549 - 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x70, // 999475479126 * p - 0x6f, 0x77, 0x28, 0x5f, 0x36, 0x30, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, // ow(_601, 0.41666 - 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, 0x2d, 0x20, // 66567325592)) - - 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, // 0.05499999970197 - 0x36, 0x37, 0x37, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 6776;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, // } while(false - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // );. float - 0x33, 0x20, 0x5f, 0x37, 0x33, 0x33, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x33, 0x30, 0x3b, 0x0a, 0x20, // 3 _733 = _730;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x33, 0x33, 0x2e, 0x7a, 0x20, 0x3d, 0x20, // _733.z = - 0x5f, 0x37, 0x34, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, // _747;. _7 - 0x34, 0x39, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x33, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, // 49 = _733;. } - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // . else. {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, // float3 _ - 0x37, 0x35, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // 750;. if - 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // (_mtl_u.u_params - 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x31, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 1.x < 1.5). - 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x5f, 0x37, 0x35, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x37, 0x31, 0x2e, 0x78, 0x79, 0x7a, // _750 = _471.xyz - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // ;. }. - 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. - 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // {. f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x35, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // loat3 _751;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // if (_mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, // _u.u_params1.x < - 0x20, 0x32, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 2.5). + 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x36, 0x30, 0x39, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x35, 0x38, 0x2e, // oat _609 = _558. + 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // z;. float + 0x20, 0x5f, 0x37, 0x36, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, // _765;. d + 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // o. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x36, 0x30, 0x39, // if (_609 + 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, // <= 0.0031308000 + 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, 0x30, 0x39, 0x39, 0x36, 0x30, // 9073019027709960 + 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 9375). 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x36, 0x38, 0x36, 0x20, // float3 _686 - 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x28, 0x28, 0x5f, 0x34, 0x37, 0x31, 0x2e, 0x78, 0x79, // = pow((((_471.xy - 0x7a, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, // z * float3x3(flo - 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x31, 0x32, 0x35, 0x35, 0x36, 0x34, 0x30, 0x39, 0x38, // at3(0.4125564098 - 0x33, 0x35, 0x38, 0x31, 0x35, 0x34, 0x33, 0x2c, 0x20, 0x30, 0x2e, 0x33, 0x35, 0x37, 0x35, 0x37, // 3581543, 0.35757 - 0x36, 0x31, 0x30, 0x32, 0x30, 0x31, 0x38, 0x33, 0x35, 0x36, 0x33, 0x32, 0x2c, 0x20, 0x30, 0x2e, // 610201835632, 0. - 0x31, 0x38, 0x30, 0x34, 0x33, 0x37, 0x35, 0x30, 0x35, 0x32, 0x34, 0x35, 0x32, 0x30, 0x38, 0x37, // 1804375052452087 - 0x34, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x31, 0x32, // 4), float3(0.212 - 0x36, 0x37, 0x32, 0x39, 0x30, 0x34, 0x31, 0x33, 0x33, 0x37, 0x39, 0x36, 0x36, 0x39, 0x2c, 0x20, // 67290413379669, - 0x30, 0x2e, 0x37, 0x31, 0x35, 0x31, 0x35, 0x32, 0x32, 0x30, 0x34, 0x30, 0x33, 0x36, 0x37, 0x31, // 0.71515220403671 - 0x32, 0x36, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x37, 0x32, 0x31, 0x37, 0x35, 0x30, 0x30, 0x33, // 265, 0.072175003 - 0x35, 0x38, 0x38, 0x31, 0x39, 0x39, 0x36, 0x31, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, // 588199615), floa - 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x39, 0x33, 0x33, 0x33, 0x39, 0x30, 0x30, 0x38, 0x38, // t3(0.01933390088 - 0x33, 0x37, 0x39, 0x33, 0x38, 0x33, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, 0x39, 0x31, 0x39, // 3793831, 0.11919 - 0x31, 0x39, 0x39, 0x36, 0x37, 0x35, 0x33, 0x32, 0x31, 0x35, 0x37, 0x39, 0x2c, 0x20, 0x30, 0x2e, // 199675321579, 0. - 0x39, 0x35, 0x30, 0x33, 0x30, 0x34, 0x30, 0x39, 0x30, 0x39, 0x37, 0x36, 0x37, 0x31, 0x35, 0x30, // 9503040909767150 - 0x39, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, // 9))) * float3x3( - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x37, 0x31, 0x36, 0x36, 0x35, 0x31, 0x32, // float3(1.7166512 - 0x30, 0x31, 0x32, 0x34, 0x38, 0x31, 0x36, 0x38, 0x39, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x33, 0x35, // 012481689, -0.35 - 0x35, 0x36, 0x37, 0x30, 0x38, 0x30, 0x39, 0x37, 0x34, 0x35, 0x37, 0x38, 0x38, 0x35, 0x37, 0x2c, // 567080974578857, - 0x20, 0x2d, 0x30, 0x2e, 0x32, 0x35, 0x33, 0x33, 0x36, 0x36, 0x32, 0x39, 0x31, 0x35, 0x32, 0x32, // -0.253366291522 - 0x39, 0x37, 0x39, 0x37, 0x34, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, // 97974), float3(- - 0x30, 0x2e, 0x36, 0x36, 0x36, 0x36, 0x38, 0x34, 0x33, 0x38, 0x39, 0x31, 0x31, 0x34, 0x33, 0x37, // 0.66668438911437 - 0x39, 0x38, 0x38, 0x2c, 0x20, 0x31, 0x2e, 0x36, 0x31, 0x36, 0x34, 0x38, 0x31, 0x31, 0x38, 0x34, // 988, 1.616481184 - 0x39, 0x35, 0x39, 0x34, 0x31, 0x31, 0x36, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x31, 0x35, 0x37, 0x36, // 9594116, 0.01576 - 0x38, 0x35, 0x30, 0x30, 0x30, 0x34, 0x34, 0x39, 0x34, 0x31, 0x39, 0x30, 0x32, 0x29, 0x2c, 0x20, // 8500044941902), - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x37, 0x36, 0x33, 0x39, 0x38, // float3(0.0176398 - 0x39, 0x39, 0x36, 0x32, 0x36, 0x33, 0x37, 0x34, 0x32, 0x34, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, // 99626374245, -0. - 0x30, 0x34, 0x32, 0x37, 0x37, 0x30, 0x36, 0x30, 0x31, 0x38, 0x30, 0x39, 0x30, 0x32, 0x34, 0x38, // 0427706018090248 - 0x31, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x34, 0x32, 0x31, 0x30, 0x33, 0x30, 0x38, 0x37, 0x39, // 11, 0.9421030879 - 0x30, 0x32, 0x30, 0x36, 0x39, 0x30, 0x39, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, // 0206909))) * _mt - 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x79, 0x29, // l_u.u_params1.y) - 0x20, 0x2a, 0x20, 0x39, 0x2e, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x34, 0x37, 0x33, 0x37, // * 9.99999974737 - 0x38, 0x37, 0x35, 0x31, 0x36, 0x65, 0x2d, 0x30, 0x30, 0x35, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, // 87516e-005, floa - 0x74, 0x33, 0x28, 0x30, 0x2e, 0x31, 0x35, 0x39, 0x33, 0x30, 0x31, 0x37, 0x35, 0x37, 0x38, 0x31, // t3(0.15930175781 - 0x32, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 25));. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x35, 0x31, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, // _751 = pow - 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x38, 0x33, 0x35, 0x39, 0x33, // ((float3(0.83593 - 0x37, 0x35, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x38, 0x36, 0x20, 0x2a, 0x20, 0x31, 0x38, // 75) + (_686 * 18 - 0x2e, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x66, 0x6c, // .8515625)) / (fl - 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x38, // oat3(1.0) + (_68 - 0x36, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x36, 0x38, 0x37, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x66, // 6 * 18.6875)), f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x37, 0x38, 0x2e, 0x38, 0x34, 0x33, 0x37, 0x35, 0x29, 0x29, // loat3(78.84375)) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // ;. }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, // else - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // . {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // _ - 0x37, 0x35, 0x31, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, // 751 = float3(0.0 + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x36, 0x35, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, // _765 = 12.92 + 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x33, 0x31, 0x32, // 0000076293945312 + 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x30, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 5 * _609;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, // break; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // . }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, // _7 + 0x36, 0x35, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, // 65 = fma(1.05499 + 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, 0x39, 0x37, 0x36, 0x35, 0x36, // 9947547912597656 + 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x36, 0x30, 0x39, 0x2c, 0x20, 0x30, 0x2e, // 25, pow(_609, 0. + 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, // 4166666567325592 + 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, // 041015625), -0.0 + 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, // 5499999970197677 + 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 6123046875);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, // bre + 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ak;. + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, // }. br + 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, // eak; // unreacha + 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x20, // ble workaround. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, // } while(f + 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // alse);. _ + 0x37, 0x36, 0x37, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x5f, 0x37, 0x36, // 767 = float3(_76 + 0x31, 0x2c, 0x20, 0x5f, 0x37, 0x36, 0x33, 0x2c, 0x20, 0x5f, 0x37, 0x36, 0x35, 0x29, 0x3b, 0x0a, // 1, _763, _765);. + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, // }. else. + 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // {. flo + 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x36, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // at3 _768;. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // if (_mtl_u.u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x31, 0x2e, 0x35, 0x29, 0x0a, // arams1.x < 1.5). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x36, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x37, // _768 = _47 + 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // 9.xyz;. } + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, // . else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x36, 0x39, 0x3b, // float3 _769; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // . if + 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // (_mtl_u.u_params + 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 1.x < 2.5). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, // float3 + 0x5f, 0x36, 0x39, 0x34, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x28, 0x28, 0x5f, 0x34, // _694 = pow((((_4 + 0x37, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, // 79.xyz * float3x + 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x31, 0x32, 0x35, 0x35, // 3(float3(0.41255 + 0x36, 0x34, 0x30, 0x39, 0x38, 0x33, 0x35, 0x38, 0x31, 0x35, 0x34, 0x32, 0x39, 0x36, 0x38, 0x37, // 6409835815429687 + 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x33, 0x35, 0x37, 0x35, 0x37, 0x36, 0x31, 0x30, 0x32, 0x30, 0x31, // 5, 0.35757610201 + 0x38, 0x33, 0x35, 0x36, 0x33, 0x32, 0x33, 0x32, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, // 83563232421875, + 0x30, 0x2e, 0x31, 0x38, 0x30, 0x34, 0x33, 0x37, 0x35, 0x30, 0x35, 0x32, 0x34, 0x35, 0x32, 0x30, // 0.18043750524520 + 0x38, 0x37, 0x34, 0x30, 0x32, 0x33, 0x34, 0x33, 0x37, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, // 8740234375), flo + 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x31, 0x32, 0x36, 0x37, 0x32, 0x39, 0x30, 0x34, 0x31, // at3(0.2126729041 + 0x33, 0x33, 0x37, 0x39, 0x36, 0x36, 0x39, 0x31, 0x38, 0x39, 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, // 3379669189453125 + 0x2c, 0x20, 0x30, 0x2e, 0x37, 0x31, 0x35, 0x31, 0x35, 0x32, 0x32, 0x30, 0x34, 0x30, 0x33, 0x36, // , 0.715152204036 + 0x37, 0x31, 0x32, 0x36, 0x34, 0x36, 0x34, 0x38, 0x34, 0x33, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, // 712646484375, 0. + 0x30, 0x37, 0x32, 0x31, 0x37, 0x35, 0x30, 0x30, 0x33, 0x35, 0x38, 0x38, 0x31, 0x39, 0x39, 0x36, // 0721750035881996 + 0x31, 0x35, 0x34, 0x37, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, // 15478515625), fl + 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x39, 0x33, 0x33, 0x33, 0x39, 0x30, 0x30, // oat3(0.019333900 + 0x38, 0x38, 0x33, 0x37, 0x39, 0x33, 0x38, 0x33, 0x30, 0x38, 0x37, 0x31, 0x35, 0x38, 0x32, 0x30, // 8837938308715820 + 0x33, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, 0x39, 0x31, 0x39, 0x31, 0x39, 0x39, // 3125, 0.11919199 + 0x36, 0x37, 0x35, 0x33, 0x32, 0x31, 0x35, 0x37, 0x38, 0x39, 0x37, 0x39, 0x34, 0x39, 0x32, 0x31, // 6753215789794921 + 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x35, 0x30, 0x33, 0x30, 0x34, 0x30, 0x39, 0x30, // 875, 0.950304090 + 0x39, 0x37, 0x36, 0x37, 0x31, 0x35, 0x30, 0x38, 0x37, 0x38, 0x39, 0x30, 0x36, 0x32, 0x35, 0x29, // 976715087890625) + 0x29, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, // )) * float3x3(fl + 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x37, 0x31, 0x36, 0x36, 0x35, 0x31, 0x32, 0x30, 0x31, // oat3(1.716651201 + 0x32, 0x34, 0x38, 0x31, 0x36, 0x38, 0x39, 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x2d, // 2481689453125, - + 0x30, 0x2e, 0x33, 0x35, 0x35, 0x36, 0x37, 0x30, 0x38, 0x30, 0x39, 0x37, 0x34, 0x35, 0x37, 0x38, // 0.35567080974578 + 0x38, 0x35, 0x37, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x32, 0x35, // 857421875, -0.25 + 0x33, 0x33, 0x36, 0x36, 0x32, 0x39, 0x31, 0x35, 0x32, 0x32, 0x39, 0x37, 0x39, 0x37, 0x33, 0x36, // 3366291522979736 + 0x33, 0x32, 0x38, 0x31, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // 328125), float3( + 0x2d, 0x30, 0x2e, 0x36, 0x36, 0x36, 0x36, 0x38, 0x34, 0x33, 0x38, 0x39, 0x31, 0x31, 0x34, 0x33, // -0.6666843891143 + 0x37, 0x39, 0x38, 0x38, 0x32, 0x38, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x31, 0x2e, 0x36, 0x31, 0x36, // 798828125, 1.616 + 0x34, 0x38, 0x31, 0x31, 0x38, 0x34, 0x39, 0x35, 0x39, 0x34, 0x31, 0x31, 0x36, 0x32, 0x31, 0x30, // 4811849594116210 + 0x39, 0x33, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x31, 0x35, 0x37, 0x36, 0x38, 0x35, 0x30, // 9375, 0.01576850 + 0x30, 0x30, 0x34, 0x34, 0x39, 0x34, 0x31, 0x39, 0x30, 0x32, 0x31, 0x36, 0x30, 0x36, 0x34, 0x34, // 0044941902160644 + 0x35, 0x33, 0x31, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // 53125), float3(0 + 0x2e, 0x30, 0x31, 0x37, 0x36, 0x33, 0x39, 0x38, 0x39, 0x39, 0x36, 0x32, 0x36, 0x33, 0x37, 0x34, // .017639899626374 + 0x32, 0x34, 0x34, 0x36, 0x38, 0x39, 0x39, 0x34, 0x31, 0x34, 0x30, 0x36, 0x32, 0x35, 0x2c, 0x20, // 24468994140625, + 0x2d, 0x30, 0x2e, 0x30, 0x34, 0x32, 0x37, 0x37, 0x30, 0x36, 0x30, 0x31, 0x38, 0x30, 0x39, 0x30, // -0.0427706018090 + 0x32, 0x34, 0x38, 0x31, 0x30, 0x37, 0x39, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x2c, 0x20, // 24810791015625, + 0x30, 0x2e, 0x39, 0x34, 0x32, 0x31, 0x30, 0x33, 0x30, 0x38, 0x37, 0x39, 0x30, 0x32, 0x30, 0x36, // 0.94210308790206 + 0x39, 0x30, 0x39, 0x31, 0x37, 0x39, 0x36, 0x38, 0x37, 0x35, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, // 9091796875))) * + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, // _mtl_u.u_params1 + 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x39, 0x2e, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x34, // .y) * 9.99999974 + 0x37, 0x33, 0x37, 0x38, 0x37, 0x35, 0x31, 0x36, 0x33, 0x35, 0x35, 0x35, 0x31, 0x34, 0x35, 0x32, // 7378751635551452 + 0x36, 0x33, 0x36, 0x37, 0x31, 0x38, 0x38, 0x65, 0x2d, 0x30, 0x35, 0x2c, 0x20, 0x66, 0x6c, 0x6f, // 6367188e-05, flo + 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x31, 0x35, 0x39, 0x33, 0x30, 0x31, 0x37, 0x35, 0x37, 0x38, // at3(0.1593017578 + 0x31, 0x32, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 125));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x36, 0x39, 0x20, 0x3d, 0x20, 0x70, 0x6f, // _769 = po + 0x77, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x38, 0x33, 0x35, 0x39, // w((float3(0.8359 + 0x33, 0x37, 0x35, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x39, 0x34, 0x20, 0x2a, 0x20, 0x31, // 375) + (_694 * 1 + 0x38, 0x2e, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x66, // 8.8515625)) / (f + 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, // loat3(1.0) + (_6 + 0x39, 0x34, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x36, 0x38, 0x37, 0x35, 0x29, 0x29, 0x2c, 0x20, // 94 * 18.6875)), + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x37, 0x38, 0x2e, 0x38, 0x34, 0x33, 0x37, 0x35, 0x29, // float3(78.84375) 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // );. } - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x35, // . _75 - 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x35, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0 = _751;. - 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x34, 0x39, // }. _749 - 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x35, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // = _750;. }. - 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, // out.bgfx_Frag - 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, // Data0 = float4(_ - 0x37, 0x34, 0x39, 0x2c, 0x20, 0x5f, 0x34, 0x37, 0x31, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, // 749, _471.w);. - 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, // return out;.}. - 0x0a, 0x00, 0x00, 0x80, 0x00, // ..... + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, // . els + 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // e. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x5f, 0x37, 0x36, 0x39, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, // _769 = float3(0. + 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0);. + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, // }. _7 + 0x36, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x36, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 68 = _769;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x36, // }. _76 + 0x37, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x36, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // 7 = _768;. }. + 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, // out.bgfx_Fra + 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, // gData0 = float4( + 0x5f, 0x37, 0x36, 0x37, 0x2c, 0x20, 0x5f, 0x34, 0x37, 0x39, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, // _767, _479.w);. + 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, // return out;.} + 0x0a, 0x0a, 0x00, 0x00, 0x80, 0x00, // ...... }; extern const uint8_t* fs_texture_cube_pssl; extern const uint32_t fs_texture_cube_pssl_size; diff --git a/bgfx/tools/texturev/fs_texture_cube.sc b/bgfx/tools/texturev/fs_texture_cube.sc index b8abb011..62977f63 100644 --- a/bgfx/tools/texturev/fs_texture_cube.sc +++ b/bgfx/tools/texturev/fs_texture_cube.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/texturev/fs_texture_cube2.bin.h b/bgfx/tools/texturev/fs_texture_cube2.bin.h index 961634a7..1e66b728 100644 --- a/bgfx/tools/texturev/fs_texture_cube2.bin.h +++ b/bgfx/tools/texturev/fs_texture_cube2.bin.h @@ -306,493 +306,395 @@ static const uint8_t fs_texture_cube2_essl[2484] = 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, // lor = tmpvar_3;. 0x7d, 0x0a, 0x0a, 0x00, // }... }; -static const uint8_t fs_texture_cube2_spv[4383] = +static const uint8_t fs_texture_cube2_spv[4335] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ - 0xfd, 0x7f, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x00, 0x10, 0x00, // ...u_params1.... - 0x01, 0x00, 0x00, 0x00, 0xfd, 0x7f, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x1a, 0x00, 0xcc, 0x10, 0x00, 0x00, 0x03, // r0.............. - 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0xc5, 0x02, 0x00, 0x00, 0x00, // .#.............. + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ + 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x01, 0x10, 0x00, // ...u_params1.... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo + 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x22, 0x00, 0x9c, 0x10, 0x00, 0x00, 0x03, // r0......."...... + 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xd5, 0x02, 0x00, 0x00, 0x00, // .#.............. 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, // ................ 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, // ...GLSL.std.450. 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................ - 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. - 0x00, 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x76, // ...b...e...i...v - 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4b, // ...main........K - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, // ...s_texColorSam - 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x73, // pler.......N...s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // _texColorTexture - 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, // ...........Unifo - 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x80, // rmBlock......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0 - 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, // ...............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x82, // _params1........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x62, 0x01, 0x00, 0x00, 0x67, // ...........b...g - 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, // l_FragCoord..... - 0x00, 0x05, 0x00, 0x65, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, // ...e...v_color0. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x69, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, // .......i...v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x76, 0x01, 0x00, 0x00, 0x62, // coord0.....v...b - 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, // gfx_FragData0..G - 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...K...".......G - 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, // ...K...!.......G - 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...N...".......G - 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, // ...N...!.......H - 0x00, 0x05, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...........#.... - 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, // ...H...........# - 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x80, 0x00, 0x00, 0x00, 0x02, // .......G........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G.......".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, // ...G.......!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x01, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G...b........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x65, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...e........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x69, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G...i........ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x76, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G...v........ - 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ - 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ...J...........; - 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ...J...K....... - 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...M...........; - 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, // ...M...N........ - 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...Q... .......+ - 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...Q...R.......+ - 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, // ...Q...V........ - 0x00, 0x03, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...Z.......+.... - 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x1e, 0x00, 0x04, 0x00, 0x80, // ...v......@..... - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x81, // ........... .... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x81, // ...........;.... - 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x83, // ................ - 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x83, // ... .......+.... - 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x85, // ........... .... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x83, // ..........@+.... - 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x14, 0x00, 0x02, 0x00, 0x99, // .........M;..... - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x52, // ...+...........R - 0xb8, 0x4e, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x3d, // .NA+...........= - 0x0a, 0x87, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x55, // ..?+...........U - 0x55, 0xd5, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xae, // U.>+............ - 0x47, 0x61, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x00, // Ga=+............ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x01, // ...+............ - 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x98, // ...+............ - 0x3a, 0xd3, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x37, // :.>+...........7 - 0x14, 0xb7, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x9c, // ..>+............ - 0xc4, 0x38, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc2, // .8>,............ - 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, // .........Y>+.... - 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x37, 0x14, 0x37, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, // .......7.7?+.... - 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x7d, 0xd0, 0x93, 0x3d, 0x2c, 0x00, 0x06, 0x00, 0x0b, // .......}..=,.... - 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc8, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0x21, // ...+...........! - 0x62, 0x9e, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xef, // b.<+............ - 0x1a, 0xf4, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x21, // ..=+...........! - 0x47, 0x73, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0xca, // Gs?,............ - 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0xbf, // ...........,.... - 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xcd, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x3a, // ...+...........: - 0xbb, 0xdb, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x7c, // ..?+...........| - 0x1a, 0xb6, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x3a, // ...+...........: - 0xb9, 0x81, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xd5, // ...,............ - 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... - 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0x2b, 0x00, 0x04, 0x00, 0x07, // .........*.+.... - 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xdb, 0xe8, 0xce, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, // ..........?+.... - 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xf1, 0x2c, 0x81, 0x3c, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ........,.<,.... - 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xdb, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x8d, // ...+............ - 0x81, 0x90, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x3a, // ..<+...........: - 0x30, 0x2f, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0xab, // 0/.+............ - 0x2d, 0x71, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xdd, // -q?,............ - 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0xbf, // ...........,.... - 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xe0, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x00, // ...+............ - 0x20, 0x23, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, // #>+............ - 0xb0, 0x9d, 0x42, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, // ..B+............ - 0x00, 0x56, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x00, // .V?+............ - 0xd0, 0x96, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, // ..A+............ - 0x80, 0x95, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x17, // ..A+............ - 0xb7, 0xd1, 0x38, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, // ..8+............ - 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x00, // ..?+............ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x01, 0x00, 0x00, 0x00, // ...+............ - 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, // ..?+....... .... - 0x00, 0xc0, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0x00, // ..?+.......(.... - 0x00, 0x20, 0x40, 0x20, 0x00, 0x04, 0x00, 0x61, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, // . @ ...a........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x61, 0x01, 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0x01, // ...;...a...b.... - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x61, 0x01, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x01, // ...;...a...e.... - 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, // ... ...h........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x68, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x01, // ...;...h...i.... - 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x75, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, // ... ...u........ - 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x75, 0x01, 0x00, 0x00, 0x76, 0x01, 0x00, 0x00, 0x03, // ...;...u...v.... - 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb3, 0x02, 0x00, 0x00, 0x76, // ...,...........v - 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...v...v...,.... - 0x00, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0f, // ................ - 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb5, 0x02, 0x00, 0x00, 0xe8, // ...,............ - 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...........,.... - 0x00, 0x00, 0x00, 0xb6, 0x02, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, // ................ - 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb7, 0x02, 0x00, 0x00, 0xff, // ...,............ - 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, // ...........,.... - 0x00, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc4, 0x02, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=.... - 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...L...K...=.... - 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, // ...O...N...=.... - 0x00, 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, // ...f...e...=.... - 0x00, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, // ...j...i...A.... - 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0xac, // ...........V.... - 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0xa0, // ...=............ - 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x5a, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0x4f, // ...V...Z.......O - 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xc1, // ...L...X........ - 0x01, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa1, // .......j........ - 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0xc1, // ...O............ - 0x01, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xd9, // ................ - 0x01, 0x00, 0x00, 0xb3, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xcb, // .......A........ - 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x3d, // .......V.......= - 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0x50, // ...............P - 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0xcc, // ................ - 0x01, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe7, // ................ - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xa4, // ................ - 0x01, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xd1, // .......A........ - 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x3d, // .......V.......= - 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0xe7, 0x01, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x4f, // ...............O - 0x00, 0x09, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xa7, 0x01, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0xd4, // ................ - 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0xa7, // ................ - 0x01, 0x00, 0x00, 0x66, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xac, // ...f...A........ - 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x3d, // .......R.......= - 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0x41, // ...............A - 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x52, // ...............R - 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaf, // .......=........ - 0x01, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0xf3, // ................ - 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x13, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x10, // ................ - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xf3, 0x01, 0x00, 0x00, 0xf4, // ................ - 0x01, 0x00, 0x00, 0xfb, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xfb, 0x01, 0x00, 0x00, 0xb8, // ................ - 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0xfd, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x20, // ............... - 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x0f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // ................ - 0x00, 0x04, 0x00, 0xfd, 0x01, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0xf8, // ................ - 0x00, 0x02, 0x00, 0x01, 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x03, // ................ - 0x02, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x0e, // .......(........ - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x03, 0x02, 0x00, 0x00, 0x04, // ................ - 0x02, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x04, 0x02, 0x00, 0x00, 0x4f, // ...............O - 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0xaa, // ................ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, // ................ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0xce, // .......k........ - 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0x6b, // ...........q...k - 0x02, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0c, // ................ - 0x02, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, // ...q............ - 0x00, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x0c, // ...~............ - 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x00, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, 0xb5, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, // ...~............ - 0x00, 0x00, 0x00, 0x85, 0x02, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x81, // ................ - 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x87, 0x02, 0x00, 0x00, 0xb6, 0x02, 0x00, 0x00, 0x85, // ................ - 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x8b, 0x02, 0x00, 0x00, 0x81, // ................ - 0x02, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x8c, // ................ - 0x02, 0x00, 0x00, 0xb7, 0x02, 0x00, 0x00, 0x8b, 0x02, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0x87, 0x02, 0x00, 0x00, 0x8c, 0x02, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // ................ - 0x00, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x0e, // ................ - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0e, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, // ................ - 0x00, 0x00, 0x00, 0xc1, 0x02, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x90, // ................ - 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x0f, 0x02, 0x00, 0x00, 0xf8, // ................ - 0x00, 0x02, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, // .......O........ - 0x02, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x0f, 0x02, 0x00, 0x00, 0xf8, // ................ - 0x00, 0x02, 0x00, 0x0f, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc0, // ................ - 0x02, 0x00, 0x00, 0xc1, 0x02, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xfe, // ................ - 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x10, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf4, // ................ - 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xaa, // ...O............ - 0x01, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0xb7, // ...+............ - 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0xf9, // ...Q.......$.... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, // ...........@.... - 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0xf8, // ...........4.... - 0x00, 0x02, 0x00, 0x34, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x36, // ...4...........6 - 0x02, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x3f, // ...$...........? - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x36, 0x02, 0x00, 0x00, 0x37, // ...........6...7 - 0x02, 0x00, 0x00, 0x3a, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x3a, 0x02, 0x00, 0x00, 0x0c, // ...:.......:.... - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // .......<........ - 0x00, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // ...$............ - 0x00, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x83, // ...=.......<.... - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3e, 0x02, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0xa7, // .......>...=.... - 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x40, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x37, // .......@.......7 - 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0x9d, // ...........9.... - 0x00, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x40, 0x02, 0x00, 0x00, 0xf8, // ...$.......@.... - 0x00, 0x02, 0x00, 0x3f, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x40, // ...?...........@ - 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0x3e, // ...............> - 0x02, 0x00, 0x00, 0x3a, 0x02, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0x37, 0x02, 0x00, 0x00, 0x52, // ...:...9...7...R - 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xaa, 0x02, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0xc4, // ................ - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, // .......Q.......( - 0x02, 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x52, // ...............R - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, 0x00, 0x00, 0x00, 0x46, // ...............F - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x46, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x99, // .......F........ - 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0xf7, // ...H...(........ - 0x00, 0x03, 0x00, 0x51, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x48, // ...Q...........H - 0x02, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x4c, // ...I...L.......L - 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x01, // ...........N.... - 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x85, // .......(........ - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x4e, // .......O.......N - 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x4f, // ...........P...O - 0x02, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x52, 0x02, 0x00, 0x00, 0xf8, // ...........R.... - 0x00, 0x02, 0x00, 0x49, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4b, // ...I...........K - 0x02, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x52, // .......(.......R - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x51, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, // .......Q........ - 0x00, 0x02, 0x00, 0x52, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbb, // ...R............ - 0x02, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x4b, 0x02, 0x00, 0x00, 0x49, // ...P...L...K...I - 0x02, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xad, 0x02, 0x00, 0x00, 0xbb, // ...R............ - 0x02, 0x00, 0x00, 0xaa, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... - 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf7, // ...,............ - 0x00, 0x03, 0x00, 0x64, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, // ...d............ - 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x58, 0x02, 0x00, 0x00, 0xbc, // ...X.......X.... - 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x98, // .......Z...,.... - 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x63, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // .......c........ - 0x00, 0x04, 0x00, 0x5a, 0x02, 0x00, 0x00, 0x5b, 0x02, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0xf8, // ...Z...[...^.... - 0x00, 0x02, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x60, // ...^...........` + 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. + 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x7a, 0x01, 0x00, 0x00, 0x10, // ...i...m...z.... + 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, // ................ + 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m + 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x73, // ain........K...s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler + 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......N...s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, // ColorTexture.... + 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, // .......UniformBl + 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, // ock............. + 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x06, // ...u_params0.... + 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par + 0x61, 0x6d, 0x73, 0x31, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, // ams1............ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x69, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // .......i...v_col + 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x76, // or0........m...v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x7a, // _texcoord0.....z + 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData + 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...K...".... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...K...!.... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...N...".... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G...N...!.... + 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, // ...H...........# + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, // .......H........ + 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x80, // ...#.......G.... + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x22, // .......G......." + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x21, // .......G.......! + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x69, 0x01, 0x00, 0x00, 0x1e, // .......G...i.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x1e, // .......G...m.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7a, 0x01, 0x00, 0x00, 0x1e, // .......G...z.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, // ...............! + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, // ................ + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, // ........... .... + 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ... ...J........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, // ...;...J...K.... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ... ...M........ + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, // ...;...M...N.... + 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, // .......Q... .... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x01, // ...+...Q...R.... + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, // ...+...Q...V.... + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, // .......Z.......+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0x1e, // .......v......@. + 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3b, // ...............; + 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, // ................ + 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, // ....... .......+ + 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, // ............... + 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, // ..............@+ + 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x14, // .............M;. + 0x00, 0x02, 0x00, 0x99, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9d, // .......+........ + 0x00, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa2, // ...R.NA+........ + 0x00, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa4, // ...=..?+........ + 0x00, 0x00, 0x00, 0x55, 0x55, 0xd5, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0xac, // ...UU.>+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x83, 0x00, 0x00, 0x00, 0xb2, // .......+........ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc2, // .......+........ + 0x00, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, // ....:.>+........ + 0x00, 0x00, 0x00, 0x37, 0x14, 0xb7, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc4, // ...7..>+........ + 0x00, 0x00, 0x00, 0x9c, 0xc4, 0x38, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc5, // .....8>,........ + 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x2b, // .............Y>+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x37, 0x14, 0x37, 0x3f, 0x2b, // ...........7.7?+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x7d, 0xd0, 0x93, 0x3d, 0x2c, // ...........}..=, + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc7, // ................ + 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xca, // .......+........ + 0x00, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, // ...!b.<+........ + 0x00, 0x00, 0x00, 0xef, 0x1a, 0xf4, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, // ......=+........ + 0x00, 0x00, 0x00, 0x21, 0x47, 0x73, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xcd, // ...!Gs?,........ + 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc9, // ................ + 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd5, // .......+........ + 0x00, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd6, // ...:..?+........ + 0x00, 0x00, 0x00, 0x7c, 0x1a, 0xb6, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd7, // ...|...+........ + 0x00, 0x00, 0x00, 0x3a, 0xb9, 0x81, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd8, // ...:...,........ + 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x2b, // ...............+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0x2b, // .............*.+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xdb, 0xe8, 0xce, 0x3f, 0x2b, // ..............?+ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xf1, 0x2c, 0x81, 0x3c, 0x2c, // ............,.<, + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xda, // ................ + 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdd, // .......+........ + 0x00, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xde, // ......<+........ + 0x00, 0x00, 0x00, 0x3a, 0x30, 0x2f, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdf, // ...:0/.+........ + 0x00, 0x00, 0x00, 0xab, 0x2d, 0x71, 0x3f, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe0, // ....-q?,........ + 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xdc, // ................ + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe8, // .......+........ + 0x00, 0x00, 0x00, 0x00, 0x20, 0x23, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xea, // .... #>+........ + 0x00, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xec, // ......B+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xee, // .....V?+........ + 0x00, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, // ......A+........ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x95, 0x41, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf3, // ......A+........ + 0x00, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xff, // ......8+........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0f, // ......?+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, // .......+........ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, // ......?+....... + 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, // ......?+.......( + 0x01, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x20, 0x00, 0x04, 0x00, 0x65, 0x01, 0x00, 0x00, 0x01, // ..... @ ...e.... + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x65, 0x01, 0x00, 0x00, 0x69, // .......;...e...i + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x01, // ....... ...l.... + 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x6d, // .......;...l...m + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x79, 0x01, 0x00, 0x00, 0x03, // ....... ...y.... + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x79, 0x01, 0x00, 0x00, 0x7a, // .......;...y...z + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc1, // .......,........ + 0x02, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x2c, // ...v...v...v..., + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc2, 0x02, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0f, // ................ + 0x01, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc3, // .......,........ + 0x02, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc4, 0x02, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xec, // ................ + 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc5, // .......,........ + 0x02, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xc6, 0x02, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, // ................ + 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xca, // .......+........ + 0x02, 0x00, 0x00, 0xae, 0x47, 0x61, 0xbd, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, // ....Ga.6........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, // ................ + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4b, // ...=.......L...K + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4e, // ...=.......O...N + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x69, // ...=.......j...i + 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x6e, 0x01, 0x00, 0x00, 0x6d, // ...=.......n...m + 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x82, // ...A............ + 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...V.......=.... + 0x00, 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x5a, // ...........V...Z + 0x00, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x58, // .......O...L...X + 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x6e, // ...............n + 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, // ...........O.... + 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa8, // ................ + 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0xc1, 0x02, 0x00, 0x00, 0x41, // ...............A + 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, // ...............V + 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd4, // .......=........ + 0x01, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd5, // .......P........ + 0x01, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x0c, // ................ + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xef, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, // ................ + 0x00, 0x00, 0x00, 0xe3, 0x01, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x41, // ...............A + 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x56, // ...............V + 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xda, // .......=........ + 0x01, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdb, // ................ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0xda, // ................ + 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xef, // ................ + 0x01, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xab, // .......Q........ + 0x01, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0e, // ...........R.... + 0x00, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xdc, // ...Q............ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xb3, // .......R........ + 0x02, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x02, // ................ + 0x00, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xb5, 0x02, 0x00, 0x00, 0xaf, // ...R............ + 0x01, 0x00, 0x00, 0xb3, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0e, // ................ + 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0xb5, 0x02, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x41, // ...........j...A + 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x52, // ...............R + 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb5, // .......=........ + 0x01, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x85, 0x00, 0x00, 0x00, 0xb6, // .......A........ + 0x01, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x3d, // .......R.......= + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0xb8, // ................ + 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0xfb, 0x01, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x13, // ................ + 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // ................ + 0x00, 0x04, 0x00, 0xfb, 0x01, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0xf8, // ................ + 0x00, 0x02, 0x00, 0x03, 0x02, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x05, // ................ + 0x02, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x17, // ....... ........ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x05, 0x02, 0x00, 0x00, 0x06, // ................ + 0x02, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x09, 0x02, 0x00, 0x00, 0xb8, // ................ + 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x0b, 0x02, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x28, // ...............( + 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x16, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // ................ + 0x00, 0x04, 0x00, 0x0b, 0x02, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x16, 0x02, 0x00, 0x00, 0xf8, // ................ + 0x00, 0x02, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0e, // .......O........ + 0x02, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x73, // ...............s + 0x02, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x79, 0x02, 0x00, 0x00, 0x73, 0x02, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x8e, // ...y...s........ + 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x79, 0x02, 0x00, 0x00, 0xb7, // ...........y.... + 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x86, 0x02, 0x00, 0x00, 0x14, // ................ + 0x02, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x89, // ................ + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x86, 0x02, 0x00, 0x00, 0xc3, // ................ + 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0x89, // ................ + 0x02, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x8f, // ................ + 0x02, 0x00, 0x00, 0xc4, 0x02, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x93, 0x02, 0x00, 0x00, 0x89, 0x02, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x81, // ................ + 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x94, 0x02, 0x00, 0x00, 0xc5, 0x02, 0x00, 0x00, 0x93, // ................ + 0x02, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x95, 0x02, 0x00, 0x00, 0x8f, // ................ + 0x02, 0x00, 0x00, 0x94, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x98, // ................ + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x95, 0x02, 0x00, 0x00, 0xc6, // ................ + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x16, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x16, // ................ + 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd3, 0x02, 0x00, 0x00, 0xc2, // ................ + 0x02, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0x98, 0x02, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0xf9, // ................ + 0x00, 0x02, 0x00, 0x17, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x06, 0x02, 0x00, 0x00, 0x4f, // ...............O + 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0xb2, // ................ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf9, // ................ + 0x00, 0x02, 0x00, 0x17, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x17, 0x02, 0x00, 0x00, 0xf5, // ................ + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd2, 0x02, 0x00, 0x00, 0xd3, 0x02, 0x00, 0x00, 0x16, // ................ + 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x18, // ................ + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x0b, // ...........O.... + 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0xfe, // ...........+.... + 0x01, 0x00, 0x00, 0xc2, 0x02, 0x00, 0x00, 0xc5, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, // ...,............ + 0x00, 0x03, 0x00, 0x48, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, // ...H............ + 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x3c, 0x02, 0x00, 0x00, 0xbc, // ...<.......<.... + 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x3e, 0x02, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x98, // .......>...,.... + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x47, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, // .......G........ + 0x00, 0x04, 0x00, 0x3e, 0x02, 0x00, 0x00, 0x3f, 0x02, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0xf8, // ...>...?...B.... + 0x00, 0x02, 0x00, 0x42, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x44, // ...B...........D 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0xa4, // ...........,.... - 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0xa2, // ...........a.... - 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x62, // ...`...........b - 0x02, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x64, // ...a...........d - 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x5b, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // .......[........ - 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0xf9, // ...].......,.... - 0x00, 0x02, 0x00, 0x64, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x63, 0x02, 0x00, 0x00, 0xff, // ...d.......c.... - 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x64, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, // .......d........ - 0x00, 0x00, 0x00, 0xbd, 0x02, 0x00, 0x00, 0x62, 0x02, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x5d, // .......b...^...] - 0x02, 0x00, 0x00, 0x5b, 0x02, 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb0, // ...[...R........ - 0x02, 0x00, 0x00, 0xbd, 0x02, 0x00, 0x00, 0xad, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf9, // ................ - 0x00, 0x02, 0x00, 0x10, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x10, 0x02, 0x00, 0x00, 0xf5, // ................ - 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xbf, 0x02, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x0f, // ................ - 0x02, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, 0x64, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // .......d...Q.... - 0x00, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0xbf, 0x02, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x02, 0x00, 0x00, 0xbf, // ...Q............ - 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, // .......Q........ - 0x02, 0x00, 0x00, 0xbf, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, // ...........P.... - 0x00, 0x00, 0x00, 0x17, 0x02, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x15, 0x02, 0x00, 0x00, 0x16, // ................ - 0x02, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x76, 0x01, 0x00, 0x00, 0x17, // .......>...v.... + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x46, 0x02, 0x00, 0x00, 0x01, // ...........F.... + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0xca, // ...2.......D.... + 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x48, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x3f, // .......H.......? + 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x9d, // ...........A.... + 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x48, 0x02, 0x00, 0x00, 0xf8, // ...,.......H.... + 0x00, 0x02, 0x00, 0x47, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x48, // ...G...........H + 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, 0x02, 0x00, 0x00, 0x46, // ...............F + 0x02, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x3f, 0x02, 0x00, 0x00, 0x51, // ...B...A...?...Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, // .......0........ + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x5a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, // .......Z........ + 0x00, 0x03, 0x00, 0xac, 0x00, 0x00, 0x00, 0x4e, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x4e, // .......N.......N + 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x30, // ...........P...0 + 0x02, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x59, 0x02, 0x00, 0x00, 0x00, // ...........Y.... + 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x50, 0x02, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, 0x54, // .......P...Q...T + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x54, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // .......T........ + 0x00, 0x00, 0x00, 0x56, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x30, // ...V...........0 + 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, // ...............X + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x56, // .......2.......V + 0x02, 0x00, 0x00, 0xca, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x5a, 0x02, 0x00, 0x00, 0xf8, // ...........Z.... + 0x00, 0x02, 0x00, 0x51, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x53, // ...Q...........S + 0x02, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x5a, // .......0.......Z + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x59, 0x02, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xf8, // .......Y........ + 0x00, 0x02, 0x00, 0x5a, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcd, // ...Z............ + 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x54, 0x02, 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0x51, // ...X...T...S...Q + 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x01, // ...Q.......4.... + 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x00, // ...........l.... + 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0xac, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0xf8, // ...........`.... + 0x00, 0x02, 0x00, 0x60, 0x02, 0x00, 0x00, 0xbc, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x62, // ...`...........b + 0x02, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x6b, // ...4...........k + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x62, 0x02, 0x00, 0x00, 0x63, // ...........b...c + 0x02, 0x00, 0x00, 0x66, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x66, 0x02, 0x00, 0x00, 0x0c, // ...f.......f.... + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, // .......h........ + 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, // ...4............ + 0x00, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xa2, // ...j.......2.... + 0x00, 0x00, 0x00, 0x68, 0x02, 0x00, 0x00, 0xca, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x6c, // ...h...........l + 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x63, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, // .......c........ + 0x00, 0x00, 0x00, 0x65, 0x02, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0xf9, // ...e.......4.... + 0x00, 0x02, 0x00, 0x6c, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x6b, 0x02, 0x00, 0x00, 0xff, // ...l.......k.... + 0x00, 0x01, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x6c, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x07, // .......l........ + 0x00, 0x00, 0x00, 0xcf, 0x02, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x66, 0x02, 0x00, 0x00, 0x65, // .......j...f...e + 0x02, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd4, // ...c...P........ + 0x02, 0x00, 0x00, 0xcb, 0x02, 0x00, 0x00, 0xcd, 0x02, 0x00, 0x00, 0xcf, 0x02, 0x00, 0x00, 0xf9, // ................ + 0x00, 0x02, 0x00, 0x18, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x18, 0x02, 0x00, 0x00, 0xf5, // ................ + 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd1, 0x02, 0x00, 0x00, 0xd2, 0x02, 0x00, 0x00, 0x17, // ................ + 0x02, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // .......l...Q.... + 0x00, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0xd1, 0x02, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1d, 0x02, 0x00, 0x00, 0xd1, // ...Q............ + 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1e, // .......Q........ + 0x02, 0x00, 0x00, 0xd1, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, // ...........P.... + 0x00, 0x00, 0x00, 0x1f, 0x02, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x1d, 0x02, 0x00, 0x00, 0x1e, // ................ + 0x02, 0x00, 0x00, 0x1b, 0x02, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x7a, 0x01, 0x00, 0x00, 0x1f, // .......>...z.... 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // .......8..... . }; -static const uint8_t fs_texture_cube2_dx9[1448] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, // ....u_params0... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // ........u_params - 0x31, 0x12, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x05, 0x00, 0x00, 0x00, // 1..........X.... - 0x03, 0xff, 0xff, 0xfe, 0xff, 0x34, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0xa1, // .....4.CTAB..... - 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, // ................ - 0x91, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // .......X........ - 0x00, 0x02, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x02, // ...d.......t.... - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, // ...s_texColor... - 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, // ...............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, // _params0........ - 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par - 0x61, 0x6d, 0x73, 0x31, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // ams1.ps_3_0.Micr - 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S - 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, // hader Compiler 1 - 0x30, 0x2e, 0x31, 0x00, 0xab, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, // 0.1....Q........ - 0xd0, 0x96, 0x41, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x80, 0x3f, 0x51, // ..A..V?...A...?Q - 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x1c, // ..........@...?. - 0x2e, 0x4d, 0x3b, 0x52, 0xb8, 0x4e, 0x41, 0x51, 0x00, 0x00, 0x05, 0x04, 0x00, 0x0f, 0xa0, 0x55, // .M;R.NAQ.......U - 0x55, 0xd5, 0x3e, 0x3d, 0x0a, 0x87, 0x3f, 0xae, 0x47, 0x61, 0xbd, 0x17, 0xb7, 0xd1, 0x38, 0x51, // U.>=..?.Ga....8Q - 0x00, 0x00, 0x05, 0x05, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0xc0, 0xbf, 0x00, 0x00, 0x20, 0xc0, 0x00, // ............. .. - 0x20, 0x23, 0x3e, 0x00, 0xb0, 0x9d, 0x42, 0x51, 0x00, 0x00, 0x05, 0x06, 0x00, 0x0f, 0xa0, 0x98, // #>...BQ........ - 0x3a, 0xd3, 0x3e, 0x37, 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x51, // :.>7..>..8>....Q - 0x00, 0x00, 0x05, 0x07, 0x00, 0x0f, 0xa0, 0xed, 0xc6, 0x59, 0x3e, 0x37, 0x14, 0x37, 0x3f, 0x7d, // .........Y>7.7?} - 0xd0, 0x93, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x08, 0x00, 0x0f, 0xa0, 0x21, // ..=....Q.......! - 0x62, 0x9e, 0x3c, 0xef, 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x51, // b.<...=!Gs?....Q - 0x00, 0x00, 0x05, 0x09, 0x00, 0x0f, 0xa0, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, // .......:..?|...: - 0xb9, 0x81, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x0f, 0xa0, 0xd4, // .......Q........ - 0xab, 0x2a, 0xbf, 0xdb, 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x51, // .*....?.,.<....Q - 0x00, 0x00, 0x05, 0x0b, 0x00, 0x0f, 0xa0, 0x8d, 0x81, 0x90, 0x3c, 0x3a, 0x30, 0x2f, 0xbd, 0xab, // ..........<:0/.. - 0x2d, 0x71, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, // -q?............. - 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x07, 0x90, 0x1f, // ................ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, 0x01, // ................ - 0x00, 0xe4, 0x90, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, // ..._............ - 0x08, 0xe4, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x8b, 0x0f, // ................ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x8b, 0x0f, 0x00, 0x00, 0x02, 0x01, // .........U...... - 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x8b, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x01, // ................ - 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x0e, // .............U.. - 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x12, 0x00, 0x00, 0x04, 0x01, // ................ - 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x0e, // ................ - 0x00, 0x00, 0x02, 0x01, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x07, 0x80, 0x01, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x01, // ................ - 0x00, 0x02, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x29, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0xa0, 0x01, // .....U.)........ - 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x17, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x20, // .U............. - 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, 0xa0, 0x04, // ................ - 0x00, 0x00, 0x04, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x04, 0x00, 0x55, 0xa0, 0x04, // .............U.. - 0x00, 0xaa, 0xa0, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, // ... ............ - 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x04, // .............U.. - 0x00, 0x55, 0xa0, 0x04, 0x00, 0xaa, 0xa0, 0x20, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, 0x00, // .U..... ........ - 0x00, 0x55, 0x80, 0x04, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x04, 0x80, 0x01, // .U.............. - 0x00, 0xaa, 0x80, 0x04, 0x00, 0x55, 0xa0, 0x04, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x02, // .....U.......... - 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x81, 0x03, 0x00, 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x03, // ................ - 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xff, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, // ...........X.... - 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xc9, 0x80, 0x2a, // ...............* - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80, 0x07, 0x00, 0xe4, 0xa0, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, 0x08, 0x00, 0xe4, 0xa0, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, 0x80, 0x0b, 0x00, 0xe4, 0xa0, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80, 0x09, 0x00, 0xe4, 0xa0, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x02, 0x80, 0x0a, 0x00, 0xe4, 0xa0, 0x01, // ................ - 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x01, // ................ - 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, // .U.............. - 0x00, 0xff, 0xa0, 0x0f, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x0f, // ................ - 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x02, // .........U...... - 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x02, // ................ - 0x00, 0xe4, 0x80, 0x05, 0x00, 0xaa, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80, 0x01, // ................ - 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x0e, // .............U.. - 0x00, 0x00, 0x02, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, // ................ - 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xff, 0xa0, 0x06, // ................ - 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0x02, 0x03, // ................ - 0x00, 0x02, 0x80, 0x01, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x80, 0x01, // .....U.......... - 0x00, 0xaa, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0x80, 0x05, 0x00, 0xe4, 0xa0, 0x02, // ................ - 0x00, 0x00, 0x03, 0x01, 0x00, 0x03, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x04, // ................ - 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, // ................ - 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x02, // .U.............. - 0x00, 0xe4, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x02, 0x00, 0x00, 0x80, 0x0f, // ................ - 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0f, 0x00, 0x00, 0x02, 0x03, // .........U...... - 0x00, 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x03, // ................ - 0x00, 0xe4, 0x80, 0x05, 0x00, 0xff, 0xa0, 0x0e, 0x00, 0x00, 0x02, 0x03, 0x00, 0x01, 0x80, 0x02, // ................ - 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x02, 0x03, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0e, // .............U.. - 0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x58, 0x00, 0x00, 0x04, 0x01, // ...........X.... - 0x00, 0x0e, 0x80, 0x01, 0x00, 0x55, 0x80, 0x06, 0x00, 0xff, 0xa0, 0x03, 0x00, 0x90, 0x80, 0x58, // .....U.........X - 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0xf9, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, // ...+............ - 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ........ -}; -static const uint8_t fs_texture_cube2_dx11[1784] = +static const uint8_t fs_texture_cube2_dx11[1775] = { - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x09, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x12, 0x00, 0x10, 0x00, // ...u_params1.... 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // .......s_texColo - 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, // r0..........s_te - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // xColor0......... - 0x90, 0x06, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xf6, 0xeb, 0xb4, 0x17, 0x2a, 0x57, 0x03, 0xc9, // ....DXBC....*W.. - 0xa5, 0x0c, 0x41, 0x19, 0xa4, 0x74, 0xfe, 0x03, 0x01, 0x00, 0x00, 0x00, 0x90, 0x06, 0x00, 0x00, // ..A..t.......... - 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, // ....,........... - 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNl........... - 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // P............... - 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ - 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // b............... - 0x02, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT - 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, // ION.COLOR.TEXCOO - 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // RD..OSGN,....... - 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ........... - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, // ............SV_T - 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xb4, 0x05, 0x00, 0x00, // ARGET...SHDR.... - 0x40, 0x00, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, // @...m...Y...F. . - 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, // ........Z....`.. - 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....X0...p...... - 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // UU..b........... - 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...r.......e... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, // . ......h....... - 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, // H...........F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, // ....F~.......`.. - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ......... - 0x2f, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, // /...r.......F... - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, // ........8...r... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, // ...@...@...@.... - 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....r.......F... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........r....... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // F.......F...A... - 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....2...r....... - 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // .. .........F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, // ....F........... - 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........:. ..... - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8...r....... - 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........F....... - 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // 8...........F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x08, // ....F.......1... - 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... - 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x04, 0x03, // .....@.....?.... - 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x20, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // ........6 ..r... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x0a, // ....F........... - 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, // r........@....M; - 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ..M;..M;....F... - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....8...r....... - 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, // F........@..R.NA - 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, // R.NAR.NA..../... - 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r.......F....... - 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 8...r.......F... - 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x55, 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, // .....@..UU.>UU.> - 0x55, 0x55, 0xd5, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // UU.>........r... - 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, // ....F.......2... - 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, // .@..=..?=..?=..? - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xae, 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, // .....@...Ga..Ga. - 0xae, 0x47, 0x61, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, // .Ga.....7...r... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....F.......F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, // ....F........... - 0x31, 0x00, 0x00, 0x0b, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, // 1...2......... . - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, // .........@.....? - 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, // .. @............ - 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, // .........@...:.> - 0x37, 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 7..>..8>....F... - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........"....... - 0x02, 0x40, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x37, 0x14, 0x37, 0x3f, 0x7d, 0xd0, 0x93, 0x3d, // .@....Y>7.7?}..= - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, // ....F........... - 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, // B........@..!b.< - 0xef, 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ...=!Gs?....F... - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ................ - 0x02, 0x40, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, 0x1a, 0xb6, 0xbe, 0x3a, 0xb9, 0x81, 0xbe, // .@..:..?|...:... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, // ....F........... - 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, // "........@....*. - 0xdb, 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ...?.,.<....F... - 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ........B....... - 0x02, 0x40, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x3a, 0x30, 0x2f, 0xbd, 0xab, 0x2d, 0x71, 0x3f, // .@.....<:0/..-q? - 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....F.......8... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // r.......F....... - 0x56, 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, // V. .........8... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, // .@.....8...8...8 - 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ..../...r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, // F.......8...r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@.. - 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x00, 0x00, 0x00, // . #>. #>. #>.... - 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....r.......F... - 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ....2...r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, // F........@.....A - 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ...A...A.....@.. - 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x00, 0x00, // ..V?..V?..V?.... - 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 2...r.......F... - 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, // .....@.....A...A - 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // ...A.....@.....? - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, // ...?...?........ - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // r.......F....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // F......./...r... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, // ....F.......8... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r.......F....... - 0x02, 0x40, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, // .@.....B...B...B - 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........r....... - 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0xe2, 0x00, 0x10, 0x00, // F............... - 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, // ....V........... - 0x02, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....7...r....... - 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x96, 0x07, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05, // ............6... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... - 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, // >..... . + 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x06, 0x00, 0x00, 0x44, // r0.............D + 0x58, 0x42, 0x43, 0xb7, 0xe9, 0xc1, 0x9d, 0xe5, 0xd1, 0xe8, 0x19, 0x23, 0xd6, 0x65, 0x54, 0xf9, // XBC........#.eT. + 0xc2, 0xbd, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x9c, 0x06, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, // ..............., + 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, // ...........ISGNl + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, // ...........P.... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, // ...........b.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, // ................ + 0x07, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, // ...SV_POSITION.C + 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, // OLOR.TEXCOORD..O + 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, // SGN,........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, // .......SV_TARGET + 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xc0, 0x05, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x70, // ...SHEX....P...p + 0x01, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...j...Y...F. .. + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, // .......Z....`... + 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, // ...X0...p......U + 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, // U..b...........b + 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ...r.......e.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x48, // ......h.......H + 0x00, 0x00, 0x8e, 0x82, 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......CU....... + 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, // ...F.......F~... + 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, // ....`........ .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x01, // ......./...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, // ...F...........8 + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, 0xcc, 0x0c, 0x40, 0xcd, // ....@.....@...@. + 0xcc, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, // ..@........r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, // ...F...........r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......F.......F + 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, // ...A.......2...r + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...F.......F.... + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, // ...............: + 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, // . .........8...r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // ...............F + 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......8........ + 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, // ...F.......F.... + 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, // ...1............ + 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, // . ..........@... + 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, // ..?............6 + 0x20, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // ..r.......F.... + 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // .......r........ + 0x40, 0x00, 0x00, 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x1c, 0x2e, 0x4d, 0x3b, 0x00, // @....M;..M;..M;. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, // ...F.......8...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x52, 0xb8, 0x4e, 0x41, 0x00, // @..R.NAR.NAR.NA. + 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, // .../...r.......F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x03, // .......8...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x55, // ...F........@..U + 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, 0x55, 0x55, 0xd5, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, // U.>UU.>UU.>..... + 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, // ...r.......F.... + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, // ...2...r.......F + 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3d, 0x0a, 0x87, 0x3f, 0x3d, // ........@..=..?= + 0x0a, 0x87, 0x3f, 0x3d, 0x0a, 0x87, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xae, // ..?=..?.....@... + 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, 0xae, 0x47, 0x61, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x37, // Ga..Ga..Ga.....7 + 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, // ...r.......F.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, // ...F.......F.... + 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x0b, 0x32, 0x00, 0x10, 0x00, 0x01, // .......1...2.... + 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, // ..... .......... + 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // @.....?.. @..... + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // ................ + 0x40, 0x00, 0x00, 0x98, 0x3a, 0xd3, 0x3e, 0x37, 0x14, 0xb7, 0x3e, 0x9c, 0xc4, 0x38, 0x3e, 0x00, // @...:.>7..>..8>. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, // ...F..........." + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xed, 0xc6, 0x59, 0x3e, 0x37, // ........@....Y>7 + 0x14, 0x37, 0x3f, 0x7d, 0xd0, 0x93, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, // .7?}..=....F.... + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // .......B........ + 0x40, 0x00, 0x00, 0x21, 0x62, 0x9e, 0x3c, 0xef, 0x1a, 0xf4, 0x3d, 0x21, 0x47, 0x73, 0x3f, 0x00, // @..!b.<...=!Gs?. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x12, // ...F............ + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3a, 0xbb, 0xdb, 0x3f, 0x7c, // ........@..:..?| + 0x1a, 0xb6, 0xbe, 0x3a, 0xb9, 0x81, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...:.......F.... + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // ......."........ + 0x40, 0x00, 0x00, 0xd4, 0xab, 0x2a, 0xbf, 0xdb, 0xe8, 0xce, 0x3f, 0xf1, 0x2c, 0x81, 0x3c, 0x00, // @....*....?.,.<. + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x42, // ...F...........B + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x8d, 0x81, 0x90, 0x3c, 0x3a, // ........@.....<: + 0x30, 0x2f, 0xbd, 0xab, 0x2d, 0x71, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // 0/..-q?....F.... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // ...8...r.......F + 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x56, 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......V. ...... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // ...8...r.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x17, 0xb7, 0xd1, 0x38, 0x17, // ........@.....8. + 0xb7, 0xd1, 0x38, 0x17, 0xb7, 0xd1, 0x38, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x05, 0x72, // ..8...8..../...r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, // .......F.......8 + 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...r.......F.... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x20, 0x23, 0x3e, 0x00, 0x20, 0x23, 0x3e, 0x00, // ....@... #>. #>. + 0x20, 0x23, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, // #>........r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, // ...F.......2...r + 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, // .......F........ + 0x40, 0x00, 0x00, 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, 0xd0, 0x96, 0x41, 0x00, // @.....A...A...A. + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x56, 0x3f, 0x00, 0x00, 0x56, 0x3f, 0x00, // ....@....V?..V?. + 0x00, 0x56, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x02, // .V?....2...r.... + 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ...F........@... + 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, 0x00, 0x80, 0x95, 0x41, 0x00, 0x00, 0x00, 0x00, 0x02, // ..A...A...A..... + 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, // @.....?...?...?. + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // .......r.......F + 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2f, // .......F......./ + 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, // ...r.......F.... + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, // ...8...r.......F + 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0xb0, 0x9d, 0x42, 0x00, // ........@.....B. + 0xb0, 0x9d, 0x42, 0x00, 0xb0, 0x9d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x05, 0x72, // ..B...B........r + 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, // .......F........ + 0x00, 0x00, 0x07, 0xe2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x01, // ...........V.... + 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, // ...........7...r + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // ...............F + 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, // ................ + 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...6.... ......F + 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, // .......>..... . }; -static const uint8_t fs_texture_cube2_mtl[3728] = +static const uint8_t fs_texture_cube2_mtl[4043] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ @@ -802,7 +704,7 @@ static const uint8_t fs_texture_cube2_mtl[3728] = 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...........u_par 0x61, 0x6d, 0x73, 0x31, 0x12, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, // ams1...........s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // _texColor....... - 0x00, 0x00, 0x00, 0x05, 0x0e, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // .......#include + 0x00, 0x00, 0x00, 0x40, 0x0f, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // ...@...#include 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, // .# 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, // include ..using nam @@ -811,222 +713,242 @@ static const uint8_t fs_texture_cube2_mtl[3728] = 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, // float4 u_par 0x61, 0x6d, 0x73, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // ams0;. float4 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, // u_params1;.};.. - 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, // constant float3 - 0x5f, 0x37, 0x30, 0x38, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, // _708 = {};..stru - 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // ct xlatMtlMain_o - 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // ut.{. float4 - 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, // bgfx_FragData0 [ - 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // [color(0)]];.};. - 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // .struct xlatMtlM - 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ain_in.{. flo - 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, // at4 v_color0 [[u - 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // ser(locn0)]];. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // float3 v_texco - 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, // ord0 [[user(locn - 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, // 1)]];.};..fragme - 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // nt xlatMtlMain_o - 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, // ut xlatMtlMain(x - 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, // latMtlMain_in in - 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, // [[stage_in]], c - 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, // onstant _Global& - 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, // _mtl_u [[buffer - 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x63, 0x75, // (0)]], texturecu - 0x62, 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // be s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, // olor [[texture(0 - 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, // )]], sampler s_t - 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, // exColorSampler [ - 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, // [sampler(0)]]).{ - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, // . xlatMtlMain - 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, // _out out = {};. - 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x34, 0x39, 0x20, 0x3d, // float4 _449 = - 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, // s_texColor.samp - 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, // le(s_texColorSam - 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // pler, in.v_texco - 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // ord0, level(_mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x78, 0x29, 0x29, // _u.u_params0.x)) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, 0x32, // ;. float3 _42 - 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x34, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, // 0 = _449.xyz;. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, 0x36, 0x38, 0x20, 0x3d, 0x20, // float3 _468 = - 0x6d, 0x69, 0x78, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x61, 0x62, 0x73, 0x28, 0x5f, 0x34, 0x32, 0x30, // mix(pow(abs(_420 - 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, 0x2e, 0x32, 0x30, 0x30, 0x30, // ), float3(2.2000 - 0x30, 0x30, 0x30, 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, 0x38, 0x29, 0x29, 0x2c, 0x20, // 000476837158)), - 0x5f, 0x34, 0x32, 0x30, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x5f, 0x6d, 0x74, // _420, float3(_mt - 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x7a, 0x29, // l_u.u_params0.z) - 0x29, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x32, 0x2e, 0x30, 0x2c, 0x20, 0x5f, 0x6d, 0x74, // ) * pow(2.0, _mt - 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x77, 0x29, // l_u.u_params0.w) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x32, // ;. float4 _42 - 0x36, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x34, 0x36, 0x38, 0x2e, // 6 = float4(_468. - 0x78, 0x2c, 0x20, 0x5f, 0x34, 0x36, 0x38, 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x34, 0x36, 0x38, 0x2e, // x, _468.y, _468. - 0x7a, 0x2c, 0x20, 0x5f, 0x34, 0x34, 0x39, 0x2e, 0x77, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, // z, _449.w) * in. - 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // v_color0;. fl - 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x30, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, // oat3 _703;. i - 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // f (_mtl_u.u_para - 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, // ms1.x < 0.5). - 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // {. float - 0x33, 0x20, 0x5f, 0x35, 0x30, 0x35, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, // 3 _505 = fast::c - 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x34, 0x32, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, // lamp(_426.xyz, f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, // loat3(0.0), floa - 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // t3(1.0));. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x34, 0x38, 0x20, 0x3d, 0x20, 0x5f, // float _548 = _ - 0x35, 0x30, 0x35, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // 505.x;. f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x36, 0x39, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // loat _697;. + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // struct xlatMtlMa + 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // in_out.{. flo + 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, // at4 bgfx_FragDat + 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, // a0 [[color(0)]]; + 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // .};..struct xlat + 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, // MtlMain_in.{. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // float4 v_color0 + 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, // [[user(locn0)]] + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x74, // ;. float3 v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, // excoord0 [[user( + 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, // locn1)]];.};..fr + 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // agment xlatMtlMa + 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // in_out xlatMtlMa + 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, // in(xlatMtlMain_i + 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, // n in [[stage_in] + 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, // ], constant _Glo + 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // bal& _mtl_u [[bu + 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // ffer(0)]], textu + 0x72, 0x65, 0x63, 0x75, 0x62, 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, // recube s_ + 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, // texColor [[textu + 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // re(0)]], sampler + 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, // s_texColorSampl + 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, // er [[sampler(0)] + 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // ]).{. xlatMtl + 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, // Main_out out = { + 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, // };. float4 _4 + 0x35, 0x37, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, // 57 = s_texColor. + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // sample(s_texColo + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, // rSampler, in.v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x28, // excoord0, level( + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // _mtl_u.u_params0 + 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // .x));. float3 + 0x20, 0x5f, 0x34, 0x32, 0x34, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x35, 0x37, 0x2e, 0x78, 0x79, 0x7a, // _424 = _457.xyz + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x34, 0x37, // ;. float3 _47 + 0x36, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x28, 0x70, 0x6f, 0x77, 0x28, 0x61, 0x62, 0x73, 0x28, // 6 = mix(pow(abs( + 0x5f, 0x34, 0x32, 0x34, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, 0x2e, // _424), float3(2. + 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, 0x38, // 2000000476837158 + 0x32, 0x30, 0x33, 0x31, 0x32, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x5f, 0x34, 0x32, 0x34, 0x2c, 0x20, // 203125)), _424, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // float3(_mtl_u.u_ + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x7a, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x70, 0x6f, // params0.z)) * po + 0x77, 0x28, 0x32, 0x2e, 0x30, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // w(2.0, _mtl_u.u_ + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // params0.w);. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x20, 0x3d, 0x20, 0x5f, 0x34, // float4 _689 = _4 + 0x35, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x2e, 0x78, 0x20, 0x3d, // 57;. _689.x = + 0x20, 0x5f, 0x34, 0x37, 0x36, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, // _476.x;. _68 + 0x39, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x37, 0x36, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, // 9.y = _476.y;. + 0x20, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x37, 0x36, 0x2e, // _689.z = _476. + 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, // z;. float4 _4 + 0x33, 0x34, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x39, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, // 34 = _689 * in.v + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // _color0;. flo + 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x32, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, // at3 _721;. if + 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // (_mtl_u.u_param + 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // s1.x < 0.5). + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // {. float3 + 0x20, 0x5f, 0x35, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, // _513 = fast::cl + 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x34, 0x33, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x66, 0x6c, // amp(_434.xyz, fl + 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // oat3(0.0), float + 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 3(1.0));. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x35, 0x36, 0x20, 0x3d, 0x20, 0x5f, 0x35, // float _556 = _5 + 0x31, 0x33, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // 13.x;. fl + 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // oat _715;. + 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // do. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, // if (_ + 0x35, 0x35, 0x36, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, // 556 <= 0.0031308 + 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, 0x30, 0x39, // 0009073019027709 + 0x39, 0x36, 0x30, 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 9609375). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x35, 0x20, 0x3d, 0x20, 0x31, 0x32, // _715 = 12 + 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, // .920000076293945 + 0x33, 0x31, 0x32, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x35, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 3125 * _556;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, // bre + 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ak;. + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, // }. el + 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, // se. { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . + 0x20, 0x5f, 0x37, 0x31, 0x35, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, 0x30, 0x35, // _715 = fma(1.05 + 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, 0x39, 0x37, // 4999947547912597 + 0x36, 0x35, 0x36, 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x35, 0x36, 0x2c, // 65625, pow(_556, + 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, // 0.4166666567325 + 0x35, 0x39, 0x32, 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x2d, // 592041015625), - + 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, // 0.05499999970197 + 0x36, 0x37, 0x37, 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x3b, 0x0a, // 6776123046875);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, 0x65, 0x61, // break; // unrea + 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, 0x75, 0x6e, // chable workaroun + 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, // d. } whil + 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // e(false);. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x36, 0x30, 0x20, 0x3d, 0x20, 0x5f, // float _560 = _ + 0x35, 0x31, 0x33, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // 513.y;. f + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // loat _717;. 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // do. {. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // if ( - 0x5f, 0x35, 0x34, 0x38, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, // _548 <= 0.003130 - 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, 0x20, // 8000907301903). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, // _69 - 0x37, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, // 7 = 12.920000076 - 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x34, 0x38, 0x3b, 0x0a, 0x20, // 293945 * _548;. + 0x5f, 0x35, 0x36, 0x30, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, // _560 <= 0.003130 + 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, 0x30, // 8000907301902770 + 0x39, 0x39, 0x36, 0x30, 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 99609375). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x37, 0x20, 0x3d, 0x20, 0x31, // _717 = 1 + 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, // 2.92000007629394 + 0x35, 0x33, 0x31, 0x32, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x36, 0x30, 0x3b, 0x0a, 0x20, 0x20, // 53125 * _560;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, // br + 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // eak;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // }. e + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x5f, 0x37, 0x31, 0x37, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, 0x30, // _717 = fma(1.0 + 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, 0x39, // 5499994754791259 + 0x37, 0x36, 0x35, 0x36, 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x36, 0x30, // 765625, pow(_560 + 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, // , 0.416666656732 + 0x35, 0x35, 0x39, 0x32, 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, 0x20, // 5592041015625), + 0x2d, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, // -0.0549999997019 + 0x37, 0x36, 0x37, 0x37, 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, 0x3b, // 76776123046875); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . + 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, 0x65, // break; // unre + 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, 0x75, // achable workarou + 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, // nd. } whi + 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // le(false);. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x36, 0x34, 0x20, 0x3d, 0x20, // float _564 = + 0x5f, 0x35, 0x31, 0x33, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _513.z;. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x37, 0x31, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // float _719;. + 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, // do. { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // . if + 0x28, 0x5f, 0x35, 0x36, 0x34, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, // (_564 <= 0.00313 + 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x32, 0x37, 0x37, // 0800090730190277 + 0x30, 0x39, 0x39, 0x36, 0x30, 0x39, 0x33, 0x37, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 099609375). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x39, 0x20, 0x3d, 0x20, // _719 = + 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, // 12.9200000762939 + 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x36, 0x34, 0x3b, 0x0a, 0x20, // 453125 * _564;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, // b 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // reak;. 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, // _697 = (1.054 - 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, 0x20, // 9999475479126 * - 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x34, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, // pow(_548, 0.4166 - 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, 0x2d, // 666567325592)) - - 0x20, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, // 0.0549999997019 - 0x37, 0x36, 0x37, 0x37, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 76776;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, // } while(fals - 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // e);. floa - 0x74, 0x33, 0x20, 0x5f, 0x36, 0x38, 0x32, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x30, 0x38, 0x3b, 0x0a, // t3 _682 = _708;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x32, 0x2e, 0x78, 0x20, 0x3d, // _682.x = - 0x20, 0x5f, 0x36, 0x39, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // _697;. f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x35, 0x32, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x30, 0x35, // loat _552 = _505 - 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // .y;. floa - 0x74, 0x20, 0x5f, 0x36, 0x39, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // t _699;. - 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // do. {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, 0x35, // if (_55 - 0x32, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, // 2 <= 0.003130800 - 0x30, 0x39, 0x30, 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // 0907301903). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x39, 0x39, 0x20, 0x3d, // _699 = - 0x20, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, // 12.920000076293 - 0x39, 0x34, 0x35, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x35, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 945 * _552;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, // brea - 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // k;. } - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, // . els - 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // e. {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x5f, 0x36, 0x39, 0x39, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, // _699 = (1.054999 - 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, // 9475479126 * pow - 0x28, 0x5f, 0x35, 0x35, 0x32, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, // (_552, 0.4166666 - 0x35, 0x36, 0x37, 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x30, 0x2e, // 567325592)) - 0. - 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, // 0549999997019767 - 0x37, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 76;. - 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, // } while(false); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, // . float3 - 0x5f, 0x36, 0x38, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _685 = _682;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x35, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x36, // _685.y = _6 - 0x39, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // 99;. floa - 0x74, 0x20, 0x5f, 0x35, 0x35, 0x36, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x30, 0x35, 0x2e, 0x7a, 0x3b, // t _556 = _505.z; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, // . float _ - 0x37, 0x30, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, // 701;. do. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x35, 0x35, 0x36, 0x20, 0x3c, // if (_556 < - 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x31, 0x33, 0x30, 0x38, 0x30, 0x30, 0x30, 0x39, 0x30, // = 0.003130800090 - 0x37, 0x33, 0x30, 0x31, 0x39, 0x30, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 7301903). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x31, 0x20, 0x3d, 0x20, 0x31, 0x32, // _701 = 12 - 0x2e, 0x39, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x36, 0x32, 0x39, 0x33, 0x39, 0x34, 0x35, // .920000076293945 - 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x35, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // * _556;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, // break;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, // _70 - 0x31, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, // 1 = (1.054999947 - 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x36, 0x20, 0x2a, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, // 5479126 * pow(_5 - 0x35, 0x36, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, // 56, 0.4166666567 - 0x33, 0x32, 0x35, 0x35, 0x39, 0x32, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x34, // 325592)) - 0.054 - 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x3b, // 999999701976776; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. - 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, // }. } - 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, // while(false);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x36, 0x38, // float3 _68 - 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 8 = _685;. - 0x20, 0x20, 0x5f, 0x36, 0x38, 0x38, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x30, 0x31, 0x3b, // _688.z = _701; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x33, 0x20, 0x3d, 0x20, // . _703 = - 0x5f, 0x36, 0x38, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // _688;. }. - 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // else. {. - 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x30, 0x34, 0x3b, 0x0a, // float3 _704;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // if (_mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, // _u.u_params1.x < - 0x20, 0x31, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // 1.5). {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x34, // _704 - 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x32, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, // = _426.xyz;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // }. e - 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // lse. {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // float3 - 0x20, 0x5f, 0x37, 0x30, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _705;. - 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // if (_mtl_u.u_ - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x32, 0x2e, 0x35, 0x29, // params1.x < 2.5) - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // . {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x36, 0x34, 0x31, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, // loat3 _641 = pow - 0x28, 0x28, 0x28, 0x28, 0x5f, 0x34, 0x32, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x66, // ((((_426.xyz * f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // loat3x3(float3(0 - 0x2e, 0x34, 0x31, 0x32, 0x35, 0x35, 0x36, 0x34, 0x30, 0x39, 0x38, 0x33, 0x35, 0x38, 0x31, 0x35, // .412556409835815 - 0x34, 0x33, 0x2c, 0x20, 0x30, 0x2e, 0x33, 0x35, 0x37, 0x35, 0x37, 0x36, 0x31, 0x30, 0x32, 0x30, // 43, 0.3575761020 - 0x31, 0x38, 0x33, 0x35, 0x36, 0x33, 0x32, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x38, 0x30, 0x34, 0x33, // 1835632, 0.18043 - 0x37, 0x35, 0x30, 0x35, 0x32, 0x34, 0x35, 0x32, 0x30, 0x38, 0x37, 0x34, 0x29, 0x2c, 0x20, 0x66, // 750524520874), f - 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x31, 0x32, 0x36, 0x37, 0x32, 0x39, 0x30, // loat3(0.21267290 - 0x34, 0x31, 0x33, 0x33, 0x37, 0x39, 0x36, 0x36, 0x39, 0x2c, 0x20, 0x30, 0x2e, 0x37, 0x31, 0x35, // 413379669, 0.715 - 0x31, 0x35, 0x32, 0x32, 0x30, 0x34, 0x30, 0x33, 0x36, 0x37, 0x31, 0x32, 0x36, 0x35, 0x2c, 0x20, // 15220403671265, - 0x30, 0x2e, 0x30, 0x37, 0x32, 0x31, 0x37, 0x35, 0x30, 0x30, 0x33, 0x35, 0x38, 0x38, 0x31, 0x39, // 0.07217500358819 - 0x39, 0x36, 0x31, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, // 9615), float3(0. - 0x30, 0x31, 0x39, 0x33, 0x33, 0x33, 0x39, 0x30, 0x30, 0x38, 0x38, 0x33, 0x37, 0x39, 0x33, 0x38, // 0193339008837938 - 0x33, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, 0x39, 0x31, 0x39, 0x31, 0x39, 0x39, 0x36, 0x37, // 31, 0.1191919967 - 0x35, 0x33, 0x32, 0x31, 0x35, 0x37, 0x39, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x35, 0x30, 0x33, 0x30, // 5321579, 0.95030 - 0x34, 0x30, 0x39, 0x30, 0x39, 0x37, 0x36, 0x37, 0x31, 0x35, 0x30, 0x39, 0x29, 0x29, 0x29, 0x20, // 409097671509))) - 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, // * float3x3(float - 0x33, 0x28, 0x31, 0x2e, 0x37, 0x31, 0x36, 0x36, 0x35, 0x31, 0x32, 0x30, 0x31, 0x32, 0x34, 0x38, // 3(1.716651201248 - 0x31, 0x36, 0x38, 0x39, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x33, 0x35, 0x35, 0x36, 0x37, 0x30, 0x38, // 1689, -0.3556708 - 0x30, 0x39, 0x37, 0x34, 0x35, 0x37, 0x38, 0x38, 0x35, 0x37, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x32, // 0974578857, -0.2 - 0x35, 0x33, 0x33, 0x36, 0x36, 0x32, 0x39, 0x31, 0x35, 0x32, 0x32, 0x39, 0x37, 0x39, 0x37, 0x34, // 5336629152297974 - 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x36, 0x36, 0x36, // ), float3(-0.666 - 0x36, 0x38, 0x34, 0x33, 0x38, 0x39, 0x31, 0x31, 0x34, 0x33, 0x37, 0x39, 0x38, 0x38, 0x2c, 0x20, // 68438911437988, + 0x20, 0x20, 0x20, 0x5f, 0x37, 0x31, 0x39, 0x20, 0x3d, 0x20, 0x66, 0x6d, 0x61, 0x28, 0x31, 0x2e, // _719 = fma(1. + 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x34, 0x37, 0x35, 0x34, 0x37, 0x39, 0x31, 0x32, 0x35, // 0549999475479125 + 0x39, 0x37, 0x36, 0x35, 0x36, 0x32, 0x35, 0x2c, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x5f, 0x35, 0x36, // 9765625, pow(_56 + 0x34, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x36, 0x36, 0x36, 0x36, 0x36, 0x35, 0x36, 0x37, 0x33, // 4, 0.41666665673 + 0x32, 0x35, 0x35, 0x39, 0x32, 0x30, 0x34, 0x31, 0x30, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x2c, // 25592041015625), + 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x30, 0x31, // -0.054999999701 + 0x39, 0x37, 0x36, 0x37, 0x37, 0x36, 0x31, 0x32, 0x33, 0x30, 0x34, 0x36, 0x38, 0x37, 0x35, 0x29, // 976776123046875) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. + 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x72, // break; // unr + 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x61, 0x72, 0x6f, // eachable workaro + 0x75, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, // und. } wh + 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ile(false);. + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x31, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // _721 = float + 0x33, 0x28, 0x5f, 0x37, 0x31, 0x35, 0x2c, 0x20, 0x5f, 0x37, 0x31, 0x37, 0x2c, 0x20, 0x5f, 0x37, // 3(_715, _717, _7 + 0x31, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, // 19);. }. e + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. {. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x37, 0x32, 0x32, 0x3b, 0x0a, 0x20, // float3 _722;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // if (_mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, // u.u_params1.x < + 0x31, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // 1.5). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x32, 0x20, // _722 + 0x3d, 0x20, 0x5f, 0x34, 0x33, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // = _434.xyz;. + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, // }. el + 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // se. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, // float3 + 0x5f, 0x37, 0x32, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _723;. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // if (_mtl_u.u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x78, 0x20, 0x3c, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x0a, // arams1.x < 2.5). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // fl + 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x36, 0x34, 0x39, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, // oat3 _649 = pow( + 0x28, 0x28, 0x28, 0x5f, 0x34, 0x33, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x66, 0x6c, // (((_434.xyz * fl + 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, // oat3x3(float3(0. + 0x34, 0x31, 0x32, 0x35, 0x35, 0x36, 0x34, 0x30, 0x39, 0x38, 0x33, 0x35, 0x38, 0x31, 0x35, 0x34, // 4125564098358154 + 0x32, 0x39, 0x36, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x33, 0x35, 0x37, 0x35, 0x37, 0x36, // 296875, 0.357576 + 0x31, 0x30, 0x32, 0x30, 0x31, 0x38, 0x33, 0x35, 0x36, 0x33, 0x32, 0x33, 0x32, 0x34, 0x32, 0x31, // 1020183563232421 + 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x38, 0x30, 0x34, 0x33, 0x37, 0x35, 0x30, 0x35, // 875, 0.180437505 + 0x32, 0x34, 0x35, 0x32, 0x30, 0x38, 0x37, 0x34, 0x30, 0x32, 0x33, 0x34, 0x33, 0x37, 0x35, 0x29, // 245208740234375) + 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x31, 0x32, 0x36, 0x37, // , float3(0.21267 + 0x32, 0x39, 0x30, 0x34, 0x31, 0x33, 0x33, 0x37, 0x39, 0x36, 0x36, 0x39, 0x31, 0x38, 0x39, 0x34, // 2904133796691894 + 0x35, 0x33, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x37, 0x31, 0x35, 0x31, 0x35, 0x32, 0x32, // 53125, 0.7151522 + 0x30, 0x34, 0x30, 0x33, 0x36, 0x37, 0x31, 0x32, 0x36, 0x34, 0x36, 0x34, 0x38, 0x34, 0x33, 0x37, // 0403671264648437 + 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x37, 0x32, 0x31, 0x37, 0x35, 0x30, 0x30, 0x33, 0x35, 0x38, // 5, 0.07217500358 + 0x38, 0x31, 0x39, 0x39, 0x36, 0x31, 0x35, 0x34, 0x37, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, 0x35, // 8199615478515625 + 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x39, 0x33, // ), float3(0.0193 + 0x33, 0x33, 0x39, 0x30, 0x30, 0x38, 0x38, 0x33, 0x37, 0x39, 0x33, 0x38, 0x33, 0x30, 0x38, 0x37, // 3390088379383087 + 0x31, 0x35, 0x38, 0x32, 0x30, 0x33, 0x31, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x31, 0x39, // 158203125, 0.119 + 0x31, 0x39, 0x31, 0x39, 0x39, 0x36, 0x37, 0x35, 0x33, 0x32, 0x31, 0x35, 0x37, 0x38, 0x39, 0x37, // 1919967532157897 + 0x39, 0x34, 0x39, 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x35, 0x30, 0x33, // 94921875, 0.9503 + 0x30, 0x34, 0x30, 0x39, 0x30, 0x39, 0x37, 0x36, 0x37, 0x31, 0x35, 0x30, 0x38, 0x37, 0x38, 0x39, // 0409097671508789 + 0x30, 0x36, 0x32, 0x35, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // 0625))) * float3 + 0x78, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x37, 0x31, 0x36, 0x36, // x3(float3(1.7166 + 0x35, 0x31, 0x32, 0x30, 0x31, 0x32, 0x34, 0x38, 0x31, 0x36, 0x38, 0x39, 0x34, 0x35, 0x33, 0x31, // 5120124816894531 + 0x32, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x33, 0x35, 0x35, 0x36, 0x37, 0x30, 0x38, 0x30, 0x39, // 25, -0.355670809 + 0x37, 0x34, 0x35, 0x37, 0x38, 0x38, 0x35, 0x37, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, 0x2c, 0x20, // 74578857421875, + 0x2d, 0x30, 0x2e, 0x32, 0x35, 0x33, 0x33, 0x36, 0x36, 0x32, 0x39, 0x31, 0x35, 0x32, 0x32, 0x39, // -0.2533662915229 + 0x37, 0x39, 0x37, 0x33, 0x36, 0x33, 0x32, 0x38, 0x31, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, // 79736328125), fl + 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x36, 0x36, 0x36, 0x36, 0x38, 0x34, 0x33, 0x38, // oat3(-0.66668438 + 0x39, 0x31, 0x31, 0x34, 0x33, 0x37, 0x39, 0x38, 0x38, 0x32, 0x38, 0x31, 0x32, 0x35, 0x2c, 0x20, // 91143798828125, 0x31, 0x2e, 0x36, 0x31, 0x36, 0x34, 0x38, 0x31, 0x31, 0x38, 0x34, 0x39, 0x35, 0x39, 0x34, 0x31, // 1.61648118495941 - 0x31, 0x36, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x31, 0x35, 0x37, 0x36, 0x38, 0x35, 0x30, 0x30, 0x30, // 16, 0.0157685000 - 0x34, 0x34, 0x39, 0x34, 0x31, 0x39, 0x30, 0x32, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 44941902), float - 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x37, 0x36, 0x33, 0x39, 0x38, 0x39, 0x39, 0x36, 0x32, 0x36, // 3(0.017639899626 - 0x33, 0x37, 0x34, 0x32, 0x34, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x34, 0x32, 0x37, 0x37, // 374245, -0.04277 - 0x30, 0x36, 0x30, 0x31, 0x38, 0x30, 0x39, 0x30, 0x32, 0x34, 0x38, 0x31, 0x31, 0x2c, 0x20, 0x30, // 0601809024811, 0 - 0x2e, 0x39, 0x34, 0x32, 0x31, 0x30, 0x33, 0x30, 0x38, 0x37, 0x39, 0x30, 0x32, 0x30, 0x36, 0x39, // .942103087902069 - 0x30, 0x39, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // 09))) * _mtl_u.u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x39, 0x2e, // _params1.y) * 9. - 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x37, 0x34, 0x37, 0x33, 0x37, 0x38, 0x37, 0x35, 0x31, 0x36, // 9999997473787516 - 0x65, 0x2d, 0x30, 0x30, 0x35, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, // e-005, float3(0. - 0x31, 0x35, 0x39, 0x33, 0x30, 0x31, 0x37, 0x35, 0x37, 0x38, 0x31, 0x32, 0x35, 0x29, 0x29, 0x3b, // 1593017578125)); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x5f, 0x37, 0x30, 0x35, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x66, 0x6c, 0x6f, // _705 = pow((flo - 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x38, 0x33, 0x35, 0x39, 0x33, 0x37, 0x35, 0x29, 0x20, 0x2b, // at3(0.8359375) + - 0x20, 0x28, 0x5f, 0x36, 0x34, 0x31, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x38, 0x35, 0x31, 0x35, // (_641 * 18.8515 - 0x36, 0x32, 0x35, 0x29, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // 625)) / (float3( - 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x34, 0x31, 0x20, 0x2a, 0x20, 0x31, // 1.0) + (_641 * 1 - 0x38, 0x2e, 0x36, 0x38, 0x37, 0x35, 0x29, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // 8.6875)), float3 - 0x28, 0x37, 0x38, 0x2e, 0x38, 0x34, 0x33, 0x37, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // (78.84375));. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x35, 0x20, 0x3d, // _705 = - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // float3(0.0);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x34, 0x20, 0x3d, 0x20, 0x5f, // _704 = _ - 0x37, 0x30, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // 705;. }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x30, 0x33, 0x20, 0x3d, 0x20, 0x5f, 0x37, // _703 = _7 - 0x30, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, // 04;. }. ou - 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, // t.bgfx_FragData0 - 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x37, 0x30, 0x33, 0x2c, 0x20, // = float4(_703, - 0x5f, 0x34, 0x32, 0x36, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, // _426.w);. ret - 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x40, 0x00, // urn out;.}....@. + 0x31, 0x36, 0x32, 0x31, 0x30, 0x39, 0x33, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x31, 0x35, // 162109375, 0.015 + 0x37, 0x36, 0x38, 0x35, 0x30, 0x30, 0x30, 0x34, 0x34, 0x39, 0x34, 0x31, 0x39, 0x30, 0x32, 0x31, // 7685000449419021 + 0x36, 0x30, 0x36, 0x34, 0x34, 0x35, 0x33, 0x31, 0x32, 0x35, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, // 6064453125), flo + 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x31, 0x37, 0x36, 0x33, 0x39, 0x38, 0x39, 0x39, 0x36, // at3(0.0176398996 + 0x32, 0x36, 0x33, 0x37, 0x34, 0x32, 0x34, 0x34, 0x36, 0x38, 0x39, 0x39, 0x34, 0x31, 0x34, 0x30, // 2637424468994140 + 0x36, 0x32, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x34, 0x32, 0x37, 0x37, 0x30, 0x36, 0x30, // 625, -0.04277060 + 0x31, 0x38, 0x30, 0x39, 0x30, 0x32, 0x34, 0x38, 0x31, 0x30, 0x37, 0x39, 0x31, 0x30, 0x31, 0x35, // 1809024810791015 + 0x36, 0x32, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x39, 0x34, 0x32, 0x31, 0x30, 0x33, 0x30, 0x38, 0x37, // 625, 0.942103087 + 0x39, 0x30, 0x32, 0x30, 0x36, 0x39, 0x30, 0x39, 0x31, 0x37, 0x39, 0x36, 0x38, 0x37, 0x35, 0x29, // 902069091796875) + 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // )) * _mtl_u.u_pa + 0x72, 0x61, 0x6d, 0x73, 0x31, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x39, 0x2e, 0x39, 0x39, 0x39, // rams1.y) * 9.999 + 0x39, 0x39, 0x39, 0x37, 0x34, 0x37, 0x33, 0x37, 0x38, 0x37, 0x35, 0x31, 0x36, 0x33, 0x35, 0x35, // 9997473787516355 + 0x35, 0x31, 0x34, 0x35, 0x32, 0x36, 0x33, 0x36, 0x37, 0x31, 0x38, 0x38, 0x65, 0x2d, 0x30, 0x35, // 514526367188e-05 + 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x31, 0x35, 0x39, 0x33, 0x30, // , float3(0.15930 + 0x31, 0x37, 0x35, 0x37, 0x38, 0x31, 0x32, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 17578125));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x33, // _723 + 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, // = pow((float3(0 + 0x2e, 0x38, 0x33, 0x35, 0x39, 0x33, 0x37, 0x35, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x34, // .8359375) + (_64 + 0x39, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x38, 0x35, 0x31, 0x35, 0x36, 0x32, 0x35, 0x29, 0x29, // 9 * 18.8515625)) + 0x20, 0x2f, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x20, // / (float3(1.0) + 0x2b, 0x20, 0x28, 0x5f, 0x36, 0x34, 0x39, 0x20, 0x2a, 0x20, 0x31, 0x38, 0x2e, 0x36, 0x38, 0x37, // + (_649 * 18.687 + 0x35, 0x29, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x37, 0x38, 0x2e, 0x38, // 5)), float3(78.8 + 0x34, 0x33, 0x37, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 4375));. + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // _723 = floa + 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // t3(0.0);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x5f, 0x37, 0x32, 0x32, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x32, 0x33, 0x3b, 0x0a, // _722 = _723;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x5f, 0x37, 0x32, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x37, 0x32, 0x32, 0x3b, 0x0a, 0x20, // _721 = _722;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, // }. out.bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, // x_FragData0 = fl + 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x37, 0x32, 0x31, 0x2c, 0x20, 0x5f, 0x34, 0x33, 0x34, 0x2e, // oat4(_721, _434. + 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, // w);. return o + 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x40, 0x00, // ut;.}....@. }; extern const uint8_t* fs_texture_cube2_pssl; extern const uint32_t fs_texture_cube2_pssl_size; diff --git a/bgfx/tools/texturev/fs_texture_cube2.sc b/bgfx/tools/texturev/fs_texture_cube2.sc index 51a90ac6..955a6d81 100644 --- a/bgfx/tools/texturev/fs_texture_cube2.sc +++ b/bgfx/tools/texturev/fs_texture_cube2.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/texturev/fs_texture_msdf.bin.h b/bgfx/tools/texturev/fs_texture_msdf.bin.h index 78827636..ad70671c 100644 --- a/bgfx/tools/texturev/fs_texture_msdf.bin.h +++ b/bgfx/tools/texturev/fs_texture_msdf.bin.h @@ -74,209 +74,165 @@ static const uint8_t fs_texture_msdf_essl[613] = 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, // olor = tmpvar_4; 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... }; -static const uint8_t fs_texture_msdf_spv[1731] = +static const uint8_t fs_texture_msdf_spv[1599] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x75, // FSH............u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ - 0xfd, 0x7f, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, // ...s_texColor0.. - 0x00, 0x00, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x84, 0x06, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, // .............#.. - 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, // ................ + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ + 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, // ...s_texColor0.. + 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x06, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, // .....".......#.. + 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, // ................ 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...............G 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, // LSL.std.450..... - 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, // ................ - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x96, // .......main..... - 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x10, // ................ - 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, // ................ - 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m - 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x30, 0x00, 0x00, 0x00, 0x73, // ain........0...s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler - 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x33, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // .......3...s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, // ColorTexture.... - 0x00, 0x06, 0x00, 0x71, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, // ...q...UniformBl - 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, // ock........q.... - 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x05, // ...u_params0.... - 0x00, 0x03, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x96, // ...s............ - 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, // ...gl_FragCoord. - 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ...........v_col - 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x76, // or0............v - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0xaa, // _texcoord0...... - 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData - 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...0...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...0...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...3...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G...3...!.... - 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, // ...H...q.......# - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x71, 0x00, 0x00, 0x00, 0x02, // .......G...q.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x73, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...s...".... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x73, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, // ...G...s...!.... - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x96, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x99, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G............ - 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............ - 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!.... - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................ - 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........ - 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x17, // ................ - 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, // ... ........... - 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // .../...........; - 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // .../...0....... - 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...2...........; - 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, // ...2...3........ - 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...6... .......+ - 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, // ...6...;........ - 0x00, 0x03, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x53, // ...?...........S - 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x53, // ... .......+...S - 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...T.......+.... - 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x07, 0x00, 0x0e, // ...h.......,.... - 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x68, // ...l...h...h...h - 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6e, // ...h...+.......n - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2c, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x6f, // ......?,.......o - 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6e, // ...n...n...n...n - 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x71, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, // .......q....... - 0x00, 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x3b, // ...r.......q...; - 0x00, 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, // ...r...s....... - 0x00, 0x04, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, // ...z...........+ - 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, // ..............? - 0x00, 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, // ...............; - 0x00, 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, // ...............; - 0x00, 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3b, // ........... ...; - 0x00, 0x04, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ............... - 0x00, 0x04, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, // ...............; - 0x00, 0x04, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, // ...............6 - 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................ - 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=.... - 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...1...0...=.... - 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x20, // ...4...3...=... - 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, // ...........O.... - 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x7a, 0x00, 0x00, 0x00, 0xd2, // .......A...z.... - 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x3d, // ...s...;...T...= - 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x56, // ...............V - 0x00, 0x05, 0x00, 0x3f, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x31, // ...?.......4...1 - 0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xf1, // ...X............ - 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x51, // ...............Q - 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0xf4, // ...Q............ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfb, // ................ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfa, // .......%........ - 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xf4, // ...Q............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xff, // .......Q........ - 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xfd, // ...........(.... - 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, // .......Q........ - 0x01, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, // ...........%.... - 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, // ................ - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x03, // .......(........ - 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x04, // ................ - 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdb, // ................ - 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdc, // ................ - 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, // ................ - 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x0c, // ................ - 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...............+ - 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x50, // .......h...n...P - 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xde, // ................ - 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0e, // ................ - 0x00, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x6c, // ...............l - 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xaa, // ...o.......>.... - 0x00, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, // ...........8.... - 0x00, 0x10, 0x00, // ... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x9d, // .......main..... + 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, // ................ + 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, // .......main..... + 0x00, 0x07, 0x00, 0x30, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...0...s_texColo + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x33, // rSampler.......3 + 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, // ...s_texColorTex + 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x71, 0x00, 0x00, 0x00, 0x55, // ture.......q...U + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, // niformBlock..... + 0x00, 0x06, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...q.......u_par + 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, // ams0.......s.... + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, // ...........v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x62, // coord0.........b + 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, // gfx_FragData0..G + 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...0...".......G + 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, // ...0...!.......G + 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...3...".......G + 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, // ...3...!.......H + 0x00, 0x05, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...q.......#.... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x71, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, // ...G...q.......G + 0x00, 0x04, 0x00, 0x73, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...s...".......G + 0x00, 0x04, 0x00, 0x73, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...s...!.......G + 0x00, 0x04, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...............G + 0x00, 0x04, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, // ................ + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // .......!........ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, // ... ............ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, // ................ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x20, // ............... + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2f, // ........... .../ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2f, // ...........;.../ + 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x32, // ...0....... ...2 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x32, // ...........;...2 + 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x36, // ...3...........6 + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x36, // ... .......+...6 + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x3f, // ...;...........? + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x20, // ...........S... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x54, // .......+...S...T + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, // .......+.......h + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x6c, // .......,.......l + 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x68, // ...h...h...h...h + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, // ...+.......n.... + 0x00, 0x80, 0x3f, 0x2c, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x6e, // ..?,.......o...n + 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x1e, // ...n...n...n.... + 0x00, 0x03, 0x00, 0x71, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x72, // ...q....... ...r + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x72, // .......q...;...r + 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7a, // ...s....... ...z + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... + 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x00, 0x04, 0x00, 0x9c, // ..........? .... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x9c, // ....... ...;.... + 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xa9, // ........... .... + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xa9, // ...........;.... + 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, // ...........6.... + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, // ................ + 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x31, // .......=.......1 + 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x34, // ...0...=.......4 + 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x9e, // ...3...=... .... + 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xd1, // .......O........ + 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x7a, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x73, // ...A...z.......s + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...;...T...=.... + 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x3f, // ...........V...? + 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x58, // .......4...1...X + 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0xd1, // ................ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, // ...............Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x51, // ...%...........Q + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xf4, // ...Q............ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, // ................ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xff, // .......(........ + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0xf4, // ...Q............ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, // ................ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, // .......%........ + 0x01, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x83, // ...(............ + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x83, // ................ + 0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xd8, // ................ + 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xd8, // ................ + 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdd, // ................ + 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0xdd, // ...........+.... + 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, // ...h...n...P.... + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xde, // ................ + 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0a, // ................ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x6f, // ...........l...o + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x0a, // .......>........ + 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // .......8....... }; -static const uint8_t fs_texture_msdf_dx9[508] = +static const uint8_t fs_texture_msdf_dx11[695] = { - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, // ....u_params0... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, // ................ - 0xff, 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, // .,.CTAB......... - 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, // ...............| - 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, // ...D...........P - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, // .......`........ - 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...l.......s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // Color........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0 - 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, // ...ps_3_0.Micros - 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, // oft (R) HLSL Sha - 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, // der Compiler 10. - 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, // 1..Q..........?. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x00, 0x02, 0x05, // ..........?..... - 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, // ................ - 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xd0, 0xa0, 0x00, // ................ - 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, // ..............._ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x02, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0x00, 0x80, 0x58, // .........U.....X - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xe1, 0x80, 0x00, // ................ - 0x00, 0xe4, 0x80, 0x0a, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, // ................ - 0x00, 0x55, 0x80, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, // .U.............. - 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, 0x00, 0x80, 0x01, // ................ - 0x00, 0xaa, 0xa0, 0x5b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x5c, // ...[............ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x02, 0x80, 0x00, 0x00, 0xaa, 0x8b, 0x00, 0x00, 0x55, 0x8b, 0x06, 0x00, 0x00, 0x02, 0x00, // .........U...... - 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, // .....U.......... - 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0xff, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, // .....U.......... - 0x08, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ............ -}; -static const uint8_t fs_texture_msdf_dx11[704] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, // ...s_texColor0.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // ........s_texCol - 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, // or0.........l... - 0x44, 0x58, 0x42, 0x43, 0xde, 0xd6, 0xcf, 0x5a, 0x51, 0xb1, 0xc9, 0x93, 0x7e, 0x1e, 0x77, 0x4e, // DXBC...ZQ...~.wN - 0x30, 0x56, 0xcd, 0x6a, 0x01, 0x00, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 0V.j....l....... - 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, // ,...........ISGN - 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, // l...........P... - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, // ............b... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x07, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, // ....SV_POSITION. - 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, // COLOR.TEXCOORD.. - 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // OSGN,........... - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ............... - 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, // ........SV_TARGE - 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x90, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // T...SHDR....@... - 0x64, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // d...Y...F. ..... - 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....Z....`...... - 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, // X....p......UU.. - 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...2.......e... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h....... - 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, // H...........F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, // ....F~.......`.. - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ......... - 0x34, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 4............... - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, // ............3... - 0x52, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x06, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // R.......V....... - 0x06, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // ........4....... - 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // ....*........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, // .........@...... - 0x0b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // ...."........... - 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........B....... - 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, // ............"... - 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....*........... - 0x1a, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, // ................ - 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // .............@.. - 0x00, 0x00, 0x00, 0x3f, 0x36, 0x20, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?6 ... ...... - 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ........>....... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xe8, // .......x...DXBC. + 0x17, 0xeb, 0xe0, 0xa9, 0x27, 0x8f, 0x9d, 0x5f, 0xda, 0x47, 0x4b, 0xde, 0x4f, 0x3e, 0xff, 0x01, // ....'.._.GK.O>.. + 0x00, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, // ...x.......,.... + 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, // .......ISGNl.... + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......P........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......b........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, 0x00, 0x53, // ...............S + 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, // V_POSITION.COLOR + 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, // .TEXCOORD..OSGN, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, // ........... .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, // ...SV_TARGET...S + 0x48, 0x45, 0x58, 0x9c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x6a, // HEX....P...g...j + 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...Y...F. ...... + 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, // ...Z....`......X + 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, // ....p......UU..b + 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ...2.......e.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x48, // ......h.......H + 0x00, 0x00, 0x8e, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x72, 0x00, 0x10, 0x00, 0x00, // .......CU..r.... + 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, // ...F.......F~... + 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, // ....`........ .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x00, // .......4........ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, 0x52, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, // ...3...R.......V + 0x06, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, // ...............4 + 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, // ...........*.... + 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, // ................ + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x7a, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, // @......z...".... + 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x05, 0x42, // ...........|...B + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x80, 0x81, // ...".......*.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ................ + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x20, 0x00, 0x05, 0xf2, // ....@.....?6 ... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, // ..............> + 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ....... }; static const uint8_t fs_texture_msdf_mtl[942] = { 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x11, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler - 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex + 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture.... - 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0 - 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x37, // Color..........7 + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0 + 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, // Color..........7 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, // ...#include .#incl 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, // ude ........ - 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // .......8....... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, // ................ + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x89, // .......main..... + 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, // ................ + 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, // .......main..... + 0x00, 0x07, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // ...,...s_texColo + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2f, // rSampler......./ + 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, // ...s_texColorTex + 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x59, 0x00, 0x00, 0x00, 0x55, // ture.......Y...U + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, // niformBlock..... + 0x00, 0x06, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, // ...Y.......u_par + 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, // ams0.......[.... + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x89, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, // ...........v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x96, 0x00, 0x00, 0x00, 0x62, // coord0.........b + 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, // gfx_FragData0..G + 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...,...".......G + 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, // ...,...!.......G + 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // .../...".......G + 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, // .../...!.......H + 0x00, 0x05, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ...Y.......#.... + 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x59, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, // ...G...Y.......G + 0x00, 0x04, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...[...".......G + 0x00, 0x04, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...[...!.......G + 0x00, 0x04, 0x00, 0x89, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...............G + 0x00, 0x04, 0x00, 0x96, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, // ................ + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // .......!........ + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, // ................ + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, // ... ............ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, // ................ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, // ................ + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x20, // ............... + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2b, // ........... ...+ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2b, // ...........;...+ + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2e, // ...,....... .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2e, // ...........;.... + 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x32, // .../...........2 + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x32, // ... .......+...2 + 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x3b, // ...7...........; + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x50, // .......+.......P + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x54, // .......,.......T + 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x50, // ...P...P...P...P + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, // ...+.......V.... + 0x00, 0x80, 0x3f, 0x2c, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x56, // ..?,.......W...V + 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x1e, // ...V...V...V.... + 0x00, 0x03, 0x00, 0x59, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5a, // ...Y....... ...Z + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5a, // .......Y...;...Z + 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x62, // ...[...........b + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x62, // ... .......+...b + 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x64, // ...c....... ...d + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...........+.... + 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x00, 0x04, 0x00, 0x88, // ...m......? .... + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x88, // ....... ...;.... + 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x95, // ........... .... + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x95, // ...........;.... + 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, // ...........6.... + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, // ................ + 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2d, // .......=.......- + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x30, // ...,...=.......0 + 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x8a, // .../...=... .... + 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xbd, // .......O........ + 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x64, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x5b, // ...A...d.......[ + 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, // ...7...c...=.... + 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x3b, // ...........V...; + 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x58, // .......0...-...X + 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0xbd, // ................ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, // ...........Q.... + 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, // ................ + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x83, // ................ + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0xc3, // ...........m.... + 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x6d, // ...............m + 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcb, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc9, // .......1........ + 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xcc, // ................ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x50, // .......+.......P + 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xce, // ...V...P........ + 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, // ................ + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0xce, // .......T...W.... + 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x96, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xfd, // ...>............ + 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // ...8....... }; -static const uint8_t fs_texture_sdf_dx9[544] = +static const uint8_t fs_texture_sdf_dx11[799] = { - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH............s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0...... - 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, // ....u_params0... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, // ................ - 0xff, 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, // .,.CTAB......... - 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, // ...............| - 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, // ...D...........P - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, // .......`........ - 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...l.......s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // Color........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0 - 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, // ...ps_3_0.Micros - 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, // oft (R) HLSL Sha - 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, // der Compiler 10. - 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, // 1..Q..........?. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, // ......?....Q.... - 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // .........@@..... - 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, // ................ - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x07, 0x80, 0x01, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, // ................ - 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, // ......._........ - 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x5b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, // .......[........ - 0x00, 0x00, 0x80, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xaa, 0x8b, 0x00, 0x00, 0x55, 0x8b, 0x02, // .............U.. - 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0xaa, 0xa0, 0x02, // .........U...... - 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x81, 0x01, 0x00, 0xaa, 0xa0, 0x02, // .........U...... - 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xe4, 0x80, 0x06, // .........U...... - 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, // ................ - 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, // .....U.......... - 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x05, // .............U.. - 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, // ................ - 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, // .............U.. - 0x00, 0x00, 0x02, 0x00, 0x08, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ................ -}; -static const uint8_t fs_texture_sdf_dx11[808] = -{ - 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x75, // FSH............u 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........ 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, // ...s_texColor0.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // ........s_texCol - 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, // or0............. - 0x44, 0x58, 0x42, 0x43, 0x03, 0x0d, 0x91, 0x21, 0x8e, 0x75, 0xa6, 0x21, 0xba, 0xe2, 0x0d, 0xbb, // DXBC...!.u.!.... - 0xa4, 0xa3, 0xae, 0x51, 0x01, 0x00, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ...Q............ - 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, // ,...........ISGN - 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, // l...........P... - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, // ............b... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x07, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, // ....SV_POSITION. - 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, // COLOR.TEXCOORD.. - 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // OSGN,........... - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ............... - 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, // ........SV_TARGE - 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xf8, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // T...SHDR....@... - 0x7e, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ~...Y...F. ..... - 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....Z....`...... - 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, // X....p......UU.. - 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...2.......e... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h....... - 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, // H...........F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, // ....F~.......`.. - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ......... - 0x0b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // ...."........... - 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........B....... - 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, // ............"... - 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....*........... - 0x1a, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, // ................ - 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // B............... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, // .@.....?...."... - 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........A....... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x52, 0x00, 0x10, 0x00, // .@.....?....R... - 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....V...A....... - 0x06, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, // ............"... - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // .....@.....?...? - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?...?*....... - 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 8 .............. - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, // ............2... - 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // "............... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, // .@.......@....@@ - 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // 8............... - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8... - 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x0a, 0xf2, 0x20, 0x10, 0x00, // ........3.... .. - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // .............@.. - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // ...?...?...?...? - 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // >....... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x4f, // ...........DXBCO + 0x1d, 0x84, 0x8c, 0xc3, 0x2e, 0xde, 0x50, 0x93, 0x1c, 0x37, 0x7a, 0x17, 0xdc, 0x82, 0x70, 0x01, // ......P..7z...p. + 0x00, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, // ...........,.... + 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, // .......ISGNl.... + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......P........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // ................ + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......b........ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, 0x00, 0x53, // ...............S + 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, // V_POSITION.COLOR + 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, // .TEXCOORD..OSGN, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, // ........... .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................ + 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, // ...SV_TARGET...S + 0x48, 0x45, 0x58, 0x04, 0x02, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x6a, // HEX....P.......j + 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...Y...F. ...... + 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, // ...Z....`......X + 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, // ....p......UU..b + 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ...2.......e.... + 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x48, // ......h.......H + 0x00, 0x00, 0x8e, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x12, 0x00, 0x10, 0x00, 0x00, // .......CU....... + 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, // ...F.......F~... + 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, // ....`........ .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, // .......z...".... + 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x05, 0x42, // ...........|...B + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x80, 0x81, // ...".......*.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, // .......B........ + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, // ........@.....?. + 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, // ..."...........A + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, // ........@.....?. + 0x00, 0x00, 0x08, 0x52, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x80, 0x41, // ...R.......V...A + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, // ................ + 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, // ..."........@... + 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x2a, // ..?...?...?...?* + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // .......8 ....... + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...2..."........ + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, // ........@....... + 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, // @....@@8........ + 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // ...8............ + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, // ...............3 + 0x00, 0x00, 0x0a, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, // .... ........... + 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, // ....@.....?...?. + 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ..?...?>....... }; static const uint8_t fs_texture_sdf_mtl[904] = { diff --git a/bgfx/tools/texturev/fs_texture_sdf.sc b/bgfx/tools/texturev/fs_texture_sdf.sc index 0bca90c1..49313ee3 100644 --- a/bgfx/tools/texturev/fs_texture_sdf.sc +++ b/bgfx/tools/texturev/fs_texture_sdf.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/texturev/makefile b/bgfx/tools/texturev/makefile index 3d0316ed..b33a590a 100644 --- a/bgfx/tools/texturev/makefile +++ b/bgfx/tools/texturev/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. +# Copyright 2011-2024 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/bgfx/tools/texturev/texturev.cpp b/bgfx/tools/texturev/texturev.cpp index dc6b8281..64513d14 100644 --- a/bgfx/tools/texturev/texturev.cpp +++ b/bgfx/tools/texturev/texturev.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -76,9 +76,10 @@ static const char* s_supportedExt[] = "exr", "gif", "gnf", - "jpg", - "jpeg", "hdr", + "heic", + "jpeg", + "jpg", "ktx", "pgm", "png", @@ -135,7 +136,9 @@ static const InputBinding s_bindingApp[] = const char* s_resetCmd = "view zoom 1.0\n" - "view rotate 0\n" + "view rotate x 0\n" + "view rotate y 0\n" + "view rotate z 0\n" "view cubemap\n" "view pan\n" "view ev\n" @@ -159,8 +162,11 @@ static const InputBinding s_bindingView[] = { entry::Key::Plus, entry::Modifier::None, 1, NULL, "view zoom +0.1" }, { entry::Key::Minus, entry::Modifier::None, 1, NULL, "view zoom -0.1" }, - { entry::Key::KeyZ, entry::Modifier::None, 1, NULL, "view rotate -90" }, - { entry::Key::KeyZ, entry::Modifier::LeftShift, 1, NULL, "view rotate +90" }, + { entry::Key::KeyZ, entry::Modifier::None, 1, NULL, "view rotate z -90" }, + { entry::Key::KeyZ, entry::Modifier::LeftShift, 1, NULL, "view rotate z +90" }, + + { entry::Key::KeyX, entry::Modifier::None, 1, NULL, "view rotate x +180" }, + { entry::Key::KeyY, entry::Modifier::None, 1, NULL, "view rotate y +180" }, { entry::Key::Up, entry::Modifier::None, 1, NULL, "view pan\n" "view file-up" }, @@ -213,7 +219,7 @@ static const char* s_bindingName[] = "Help", "About", }; -BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_bindingName) ); +static_assert(Binding::Count == BX_COUNTOF(s_bindingName) ); static const InputBinding* s_binding[] = { @@ -222,7 +228,7 @@ static const InputBinding* s_binding[] = s_bindingHelp, s_bindingAbout, }; -BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_binding) ); +static_assert(Binding::Count == BX_COUNTOF(s_binding) ); static const char* s_filter = "" "All Image Formats (bmp, dds, exr, gif, gnf, jpg, jpeg, hdr, ktx, pgm, png, ppm, psd, pvr, tga) | *.bmp *.dds *.exr *.gif *.gnf *.jpg *.jpeg *.hdr *.ktx *.pgm *.png *.ppm *.psd *.pvr *.tga\n" @@ -253,15 +259,6 @@ struct RendererTypeRemap bgfx::RendererType::Enum type; }; -static RendererTypeRemap s_rendererTypeRemap[] = -{ - { "gl", bgfx::RendererType::OpenGL }, - { "d3d11", bgfx::RendererType::Direct3D11 }, - { "d3d11", bgfx::RendererType::Direct3D12 }, - { "vk", bgfx::RendererType::Vulkan }, - { "mtl", bgfx::RendererType::Metal }, -}; - struct View { View() @@ -281,7 +278,6 @@ struct View , m_angx(0.0f) , m_angy(0.0f) , m_zoom(1.0f) - , m_angle(0.0f) , m_orientation(0.0f) , m_flipH(0.0f) , m_flipV(0.0f) @@ -298,6 +294,10 @@ struct View , m_sdf(false) , m_inLinear(false) { + m_rotate[0] = 0.0f; + m_rotate[1] = 0.0f; + m_rotate[2] = 0.0f; + load(); m_textureInfo.format = bgfx::TextureFormat::Count; @@ -484,24 +484,28 @@ struct View { if (_argc >= 3) { + int8_t axis = bx::clamp(bx::toLower(_argv[2][0]) - 'x', 0, 2); + float angle; - bx::fromString(&angle, _argv[2]); + bx::fromString(&angle, _argv[3]); - if (_argv[2][0] == '+' - || _argv[2][0] == '-') + if (_argv[3][0] == '+' + || _argv[3][0] == '-') { - m_angle += bx::toRad(angle); + m_rotate[axis] += bx::toRad(angle); } else { - m_angle = bx::toRad(angle); + m_rotate[axis] = bx::toRad(angle); } - m_angle = bx::wrap(m_angle, bx::kPi*2.0f); + m_rotate[axis] = bx::wrap(m_rotate[axis], bx::kPi*2.0f); } else { - m_angle = 0.0f; + m_rotate[0] = 0.0f; + m_rotate[1] = 0.0f; + m_rotate[2] = 0.0f; } } else if (0 == bx::strCmp(_argv[1], "orientation") ) @@ -524,7 +528,8 @@ struct View { float angle; bx::fromString(&angle, _argv[3]); - *dst = bx::toRad(angle); + angle = bx::toRad(angle); + *dst = bx::wrap(angle, bx::kPi*2.0f); } else { @@ -877,7 +882,7 @@ struct View float m_angx; float m_angy; float m_zoom; - float m_angle; + float m_rotate[3]; float m_orientation; float m_flipH; float m_flipV; @@ -1222,34 +1227,60 @@ void associate() } } #elif BX_PLATFORM_LINUX - std::string str; - str += "#/bin/bash\n\n"; + + std::string mimeType; + + auto associate = [&mimeType](const char* _ext) + { + std::string tmp; + bx::stringPrintf(tmp, "default texturev.desktop image/%s", _ext); + + bx::ProcessReader reader; + bx::Error err; + if (bx::open(&reader, "xdg-mime", tmp.c_str(), &err) ) + { + bx::close(&reader); + } + else + { + bx::printf("Failed to associate MIME type image/%s (error: \"%S\")!\n", _ext, &err.getMessage() ); + } + + bx::stringPrintf(mimeType, "image/%s;", _ext); + }; for (uint32_t ii = 0; ii < BX_COUNTOF(s_supportedExt); ++ii) { - const char* ext = s_supportedExt[ii]; - bx::stringPrintf(str, "xdg-mime default texturev.desktop image/%s\n", ext); + associate(s_supportedExt[ii]); } - bx::stringPrintf(str, "xdg-mime default texturev.desktop image/x-dds\n"); - - str += "\n"; + associate("x-dds"); bx::FileWriter writer; bx::Error err; - if (bx::open(&writer, "/tmp/texturev.sh", false, &err) ) + if (bx::open(&writer, "/usr/share/applications/texturev.desktop", false, &err) ) { - bx::write(&writer, str.c_str(), uint32_t(str.length()), &err); + bx::write(&writer, &err + , "[Desktop Entry]\n" + "Version=%d.%d.%d\n" + "Type=Application\n" + "Name=texturev\n" + "GenericName=bgfx Image/Texture Viewer\n" + "Exec=texturev %%U\n" + "Terminal=false\n" + "Categories=Graphics\n" + "StartupNotify=true\n" + "MimeType=%s\n" + , BGFX_TEXTUREV_VERSION_MAJOR + , BGFX_TEXTUREV_VERSION_MINOR + , BGFX_API_VERSION + , mimeType.c_str() + ); bx::close(&writer); - - if (err.isOk() ) - { - bx::ProcessReader reader; - if (bx::open(&reader, "/bin/bash", "/tmp/texturev.sh", &err) ) - { - bx::close(&reader); - } - } + } + else + { + bx::printf("Failed to create texturev desktop entry (error: \"%S\")! Permissions (try sudo)?!\n", &err.getMessage() ); } #endif // BX_PLATFORM_WINDOWS } @@ -1263,7 +1294,7 @@ void help(const char* _error = NULL) bx::printf( "texturev, bgfx texture viewer tool, version %d.%d.%d.\n" - "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2024 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n\n" , BGFX_TEXTUREV_VERSION_MAJOR , BGFX_TEXTUREV_VERSION_MINOR @@ -1433,7 +1464,9 @@ int _main_(int _argc, char** _argv) Interpolator scale(1.0f); Interpolator posx(0.0f); Interpolator posy(0.0f); - InterpolatorAngle angle(0.0f); + InterpolatorAngle rotateX(0.0f); + InterpolatorAngle rotateY(0.0f); + InterpolatorAngle rotateZ(0.0f); InterpolatorAngle angx(0.0f); InterpolatorAngle angy(0.0f); @@ -1449,7 +1482,9 @@ int _main_(int _argc, char** _argv) || scale.isActive() || posx.isActive() || posy.isActive() - || angle.isActive() + || rotateX.isActive() + || rotateY.isActive() + || rotateZ.isActive() || angx.isActive() || angy.isActive() ; @@ -1457,11 +1492,7 @@ int _main_(int _argc, char** _argv) const char* filePath = _argc < 2 ? "" : _argv[1]; - std::string path = filePath; - { - bx::FilePath fp(filePath); - view.updateFileList(fp); - } + view.updateFileList(filePath); int exitcode = bx::kExitSuccess; bgfx::TextureHandle texture = BGFX_INVALID_HANDLE; @@ -1854,11 +1885,15 @@ int _main_(int _argc, char** _argv) if (view.m_files) { + ImGui::PushFont(ImGui::Font::Mono); + const float itemHeight = ImGui::GetTextLineHeightWithSpacing(); + ImGui::PopFont(); + char temp[bx::kMaxFilePath]; bx::snprintf(temp, BX_COUNTOF(temp), "%s##File", view.m_path.getCPtr() ); ImGui::SetNextWindowSize( - ImVec2(400.0f, 400.0f) + ImVec2(400.0f, 20*itemHeight) , ImGuiCond_FirstUseEver ); @@ -1867,7 +1902,6 @@ int _main_(int _argc, char** _argv) if (ImGui::BeginChild("##file_list", ImVec2(0.0f, 0.0f) ) ) { ImGui::PushFont(ImGui::Font::Mono); - const float itemHeight = ImGui::GetTextLineHeightWithSpacing(); const float listHeight = bx::max(1.0f, bx::floor(ImGui::GetWindowHeight()/itemHeight) ) * itemHeight @@ -1881,26 +1915,23 @@ int _main_(int _argc, char** _argv) ImGuiListClipper clipper; clipper.Begin(itemCount, itemHeight); - int32_t start = clipper.DisplayStart; - int32_t end = clipper.DisplayEnd; + const int32_t index = int32_t(view.m_fileIndex); + static int32_t oldIndex = index; + const int32_t direction = bx::clamp(index - oldIndex, -1, 1); + oldIndex = index; - const int32_t index = int32_t(view.m_fileIndex); - if (index <= start) - { - ImGui::SetScrollY(ImGui::GetScrollY() - (start-index+1)*itemHeight); - } - else if (index >= end) - { - ImGui::SetScrollY(ImGui::GetScrollY() + (index-end+1)*itemHeight); - } + bool currentVisible = false; while (clipper.Step() ) { + currentVisible |= index > clipper.DisplayStart && index < clipper.DisplayEnd; + for (int32_t pos = clipper.DisplayStart; pos < clipper.DisplayEnd; ++pos) { ImGui::PushID(pos); - bool isSelected = uint32_t(pos) == view.m_fileIndex; + bool isSelected = pos == index; + if (ImGui::Selectable(view.m_fileList[pos].c_str(), &isSelected) ) { view.m_fileIndex = pos; @@ -1910,6 +1941,13 @@ int _main_(int _argc, char** _argv) } } + if (0 != direction && !currentVisible) + { + const int32_t num = int32_t(listHeight / itemHeight); + const int32_t posY = index + (1 == direction ? 1-num : 0); + ImGui::SetScrollY(posY*itemHeight); + } + clipper.End(); ImGui::EndListBox(); @@ -1929,7 +1967,7 @@ int _main_(int _argc, char** _argv) ImGui::Text( "texturev, bgfx texture viewer tool " ICON_KI_WRENCH ", version %d.%d.%d.\n" - "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2024 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n" , BGFX_TEXTUREV_VERSION_MAJOR , BGFX_TEXTUREV_VERSION_MINOR @@ -1962,7 +2000,9 @@ int _main_(int _argc, char** _argv) keyBindingHelp("LMB+drag", "Pan."); keyBindingHelp("=/- or MW", "Zoom in/out."); - keyBindingHelp("z/Z", "Rotate."); + keyBindingHelp("x", "Horizontal flip (z-axis relative)."); + keyBindingHelp("y", "Vertical flip (z-axis relative)."); + keyBindingHelp("z/Z", "Rotate around Z axis."); keyBindingHelp("0", "Reset."); keyBindingHelp("1", "Fit to window."); ImGui::NextLine(); @@ -2153,7 +2193,7 @@ int _main_(int _argc, char** _argv) bgfx::dbgTextClear(); float orientation[16]; - bx::mtxRotateXYZ(orientation, view.m_flipH, view.m_flipV, angle.getValue()+view.m_orientation); + bx::mtxRotateXYZ(orientation, rotateY.getValue()+view.m_flipH, rotateX.getValue()+view.m_flipV, rotateZ.getValue()+view.m_orientation); if (view.m_fit) { @@ -2171,7 +2211,9 @@ int _main_(int _argc, char** _argv) } zoom.set(view.m_zoom, transitionTime); - angle.set(view.m_angle, transitionTime); + rotateX.set(view.m_rotate[0], transitionTime); + rotateY.set(view.m_rotate[1], transitionTime); + rotateZ.set(view.m_rotate[2], transitionTime); angx.set(view.m_angx, transitionTime); angy.set(view.m_angy, transitionTime); diff --git a/bgfx/tools/texturev/vs_texture.bin.h b/bgfx/tools/texturev/vs_texture.bin.h index 3000b297..283f468f 100644 --- a/bgfx/tools/texturev/vs_texture.bin.h +++ b/bgfx/tools/texturev/vs_texture.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_texture_glsl[400] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........c...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........c...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec3 a_position;. @@ -30,7 +30,7 @@ static const uint8_t vs_texture_essl[442] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // bute highp vec3 @@ -60,9 +60,9 @@ static const uint8_t vs_texture_essl[442] = static const uint8_t vs_texture_spv[1234] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........p....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........p....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, // ................ @@ -138,38 +138,13 @@ static const uint8_t vs_texture_spv[1234] = 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, // ....8........... 0x40, 0x00, // @. }; -static const uint8_t vs_texture_dx9[337] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........$....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x07, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, // ................ - 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, // ................ - 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x07, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................ - 0x00, // . -}; -static const uint8_t vs_texture_dx11[590] = +static const uint8_t vs_texture_dx11[594] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC - 0xa1, 0x0d, 0xa3, 0xb8, 0x34, 0x19, 0x93, 0x74, 0x94, 0x6c, 0x61, 0x11, 0xe8, 0x09, 0x5f, 0x2c, // ....4..t.la..._, - 0x01, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ............DXBC + 0x02, 0x69, 0xf5, 0xe7, 0x92, 0xa7, 0xab, 0x4d, 0xfb, 0xf8, 0xc3, 0x21, 0x69, 0x94, 0x1d, 0x03, // .i.....M...!i... + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,... 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, // ........ISGNh... 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -184,30 +159,31 @@ static const uint8_t vs_texture_dx11[590] = 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...@...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........_...2... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._...r....... - 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // g.... .......... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // r ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, // F............ .. - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. . - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, // ........6.... .. - 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... - 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // r ......F....... - 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // >...........@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x04, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x41, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...A...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // 2......._...r... + 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e...r ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ....F........... + 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // F. .........6... + 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... + 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, // 6...r ......F... + 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, // ....>........... + 0x40, 0x00, // @. }; -static const uint8_t vs_texture_mtl[850] = +static const uint8_t vs_texture_mtl[898] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........L...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -217,6 +193,9 @@ static const uint8_t vs_texture_mtl[850] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/tools/texturev/vs_texture.sc b/bgfx/tools/texturev/vs_texture.sc index db0f113d..e6f556d7 100644 --- a/bgfx/tools/texturev/vs_texture.sc +++ b/bgfx/tools/texturev/vs_texture.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0, a_color0 $output v_texcoord0, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bgfx/tools/texturev/vs_texture_cube.bin.h b/bgfx/tools/texturev/vs_texture_cube.bin.h index 9dd901f1..07ec8075 100644 --- a/bgfx/tools/texturev/vs_texture_cube.bin.h +++ b/bgfx/tools/texturev/vs_texture_cube.bin.h @@ -2,7 +2,7 @@ static const uint8_t vs_texture_cube_glsl[386] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........U...attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ........U...attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // ibute vec4 a_col 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, // or0;.attribute v 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec3 a_position;. @@ -30,7 +30,7 @@ static const uint8_t vs_texture_cube_essl[428] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, // ............attr 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ibute highp vec4 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // a_color0;.attri 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // bute highp vec3 @@ -59,9 +59,9 @@ static const uint8_t vs_texture_cube_essl[428] = static const uint8_t vs_texture_cube_spv[1238] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, // ..............#. - 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........o....... + 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........o....... 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, // GLSL.std.450.... 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, // ................ @@ -137,39 +137,13 @@ static const uint8_t vs_texture_cube_spv[1238] = 0x3d, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, // =.......8....... 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ....@. }; -static const uint8_t vs_texture_cube_dx9[357] = -{ - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, // ........8....... - 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, // ..!.CTAB....W... - 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................ - 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // P...0........... - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // @.......u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, // iewProj......... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, // ........vs_3_0.M - 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS - 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile - 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // r 10.1.......... - 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, // ................ - 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // ................ - 0x01, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x07, 0xe0, // ................ - 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, // ..............U. - 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, // ................ - 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, // ................ - 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, // ................ - 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x07, 0xe0, 0x02, 0x00, 0xe4, 0x90, // ................ - 0xff, 0xff, 0x00, 0x00, 0x00, // ..... -}; -static const uint8_t vs_texture_cube_dx11[630] = +static const uint8_t vs_texture_cube_dx11[634] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........@...DXBC - 0x52, 0x1b, 0xf0, 0x79, 0x87, 0x20, 0xa0, 0x2d, 0xbc, 0x22, 0x0f, 0xb3, 0x05, 0x0c, 0xbf, 0x92, // R..y. .-."...... - 0x01, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....@.......,... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, // ........D...DXBC + 0x6b, 0xb9, 0x05, 0xe4, 0x44, 0xa3, 0x19, 0xd2, 0xa8, 0x21, 0xe3, 0x0d, 0xef, 0x47, 0xa6, 0x60, // k...D....!...G.` + 0x01, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....D.......,... 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, // ........ISGNh... 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................ @@ -184,33 +158,33 @@ static const uint8_t vs_texture_cube_dx11[630] = 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b....... 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, // ................ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO - 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, // R.TEXCOORD..SHDR - 0x28, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // (...@...J...Y... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... - 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // ........_...r... - 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ...._...r....... - 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // g.... .......... - 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... - 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // r ......h....... - 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, // 8...........V... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....F. ......... - 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // 2...........F. . - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // F.......2....... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....F. ......... - 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F....... - 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ..... ......F... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....F. ......... - 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // 6.... ......F... - 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....6...r ...... - 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, // F.......>....... - 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ....@. + 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, // R.TEXCOORD..SHEX + 0x2c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ,...P...K...j... + 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // Y...F. ......... + 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // _..........._... + 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // r......._...r... + 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e.... ...... + 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e...r ......h... + 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... + 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V.......F. ..... + 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // F. ............. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // ....F.......2... + 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... + 0x02, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ...... + 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F. ..... + 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....6.... ...... + 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, // F.......6...r .. + 0x02, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>... + 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ........@. }; -static const uint8_t vs_texture_cube_mtl[842] = +static const uint8_t vs_texture_cube_mtl[890] = { 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, // VSH............u 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, // _modelViewProj.. - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ............#inc + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, // ........D...#inc 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, // lude .#include ..usin @@ -220,6 +194,9 @@ static const uint8_t vs_texture_cube_mtl[842] = 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // j;.};..struct xl 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. + 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, // .float bgfx_meta + 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // l_pointSize [[po + 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, // int_size]] = 1;. 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, // float4 _entr 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, // yPointOutput_v_c 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // olor0 [[user(loc diff --git a/bgfx/tools/texturev/vs_texture_cube.sc b/bgfx/tools/texturev/vs_texture_cube.sc index 7c72921a..7923be39 100644 --- a/bgfx/tools/texturev/vs_texture_cube.sc +++ b/bgfx/tools/texturev/vs_texture_cube.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0, a_color0 $output v_texcoord0, v_color0 /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bimg/3rdparty/astc-encoder/include/astcenc.h b/bimg/3rdparty/astc-encoder/include/astcenc.h index c6c8c14a..3d04b4ea 100644 --- a/bimg/3rdparty/astc-encoder/include/astcenc.h +++ b/bimg/3rdparty/astc-encoder/include/astcenc.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2020-2023 Arm Limited +// Copyright 2020-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -215,6 +215,8 @@ enum astcenc_error { ASTCENC_ERR_BAD_CONTEXT, /** @brief The call failed due to unimplemented functionality. */ ASTCENC_ERR_NOT_IMPLEMENTED, + /** @brief The call failed due to an out-of-spec decode mode flag set. */ + ASTCENC_ERR_BAD_DECODE_MODE, #if defined(ASTCENC_DIAGNOSTICS) /** @brief The call failed due to an issue with diagnostic tracing. */ ASTCENC_ERR_DTRACE_FAILURE, @@ -302,6 +304,11 @@ enum astcenc_type ASTCENC_TYPE_F32 = 2 }; +/** + * @brief Function pointer type for compression progress reporting callback. + */ +extern "C" typedef void (*astcenc_progress_callback)(float); + /** * @brief Enable normal map compression. * @@ -312,6 +319,19 @@ enum astcenc_type */ static const unsigned int ASTCENC_FLG_MAP_NORMAL = 1 << 0; +/** + * @brief Enable compression heuristics that assume use of decode_unorm8 decode mode. + * + * The decode_unorm8 decode mode rounds differently to the decode_fp16 decode mode, so enabling this + * flag during compression will allow the compressor to use the correct rounding when selecting + * encodings. This will improve the compressed image quality if your application is using the + * decode_unorm8 decode mode, but will reduce image quality if using decode_fp16. + * + * Note that LDR_SRGB images will always use decode_unorm8 for the RGB channels, irrespective of + * this setting. + */ +static const unsigned int ASTCENC_FLG_USE_DECODE_UNORM8 = 1 << 1; + /** * @brief Enable alpha weighting. * @@ -378,6 +398,7 @@ static const unsigned int ASTCENC_ALL_FLAGS = ASTCENC_FLG_MAP_RGBM | ASTCENC_FLG_USE_ALPHA_WEIGHT | ASTCENC_FLG_USE_PERCEPTUAL | + ASTCENC_FLG_USE_DECODE_UNORM8 | ASTCENC_FLG_DECOMPRESS_ONLY | ASTCENC_FLG_SELF_DECOMPRESS_ONLY; @@ -550,6 +571,16 @@ struct astcenc_config */ float tune_search_mode0_enable; + /** + * @brief The progress callback, can be @c nullptr. + * + * If this is specified the codec will peridocially report progress for + * compression as a percentage between 0 and 100. The callback is called from one + * of the compressor threads, so doing significant work in the callback will + * reduce compression performance. + */ + astcenc_progress_callback progress_callback; + #if defined(ASTCENC_DIAGNOSTICS) /** * @brief The path to save the diagnostic trace data to. diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp index 10fb6bc5..2daa515e 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2021 Arm Limited +// Copyright 2011-2023 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -894,32 +894,55 @@ void unpack_color_endpoints( } } - vint4 ldr_scale(257); - vint4 hdr_scale(1); - vint4 output_scale = ldr_scale; + // Handle endpoint errors and expansion - // An LDR profile image - if ((decode_mode == ASTCENC_PRF_LDR) || - (decode_mode == ASTCENC_PRF_LDR_SRGB)) + // Linear LDR 8-bit endpoints are expanded to 16-bit by replication + if (decode_mode == ASTCENC_PRF_LDR) { - // Also matches HDR alpha, as cannot have HDR alpha without HDR RGB - if (rgb_hdr == true) + // Error color - HDR endpoint in an LDR encoding + if (rgb_hdr || alpha_hdr) { - output0 = vint4(0xFF00, 0x0000, 0xFF00, 0xFF00); - output1 = vint4(0xFF00, 0x0000, 0xFF00, 0xFF00); - output_scale = hdr_scale; + output0 = vint4(0xFF, 0x00, 0xFF, 0xFF); + output1 = vint4(0xFF, 0x00, 0xFF, 0xFF); + rgb_hdr = false; + alpha_hdr = false; + } + output0 = output0 * 257; + output1 = output1 * 257; + } + // sRGB LDR 8-bit endpoints are expanded to 16 bit by: + // - RGB = shift left by 8 bits and OR with 0x80 + // - A = replication + else if (decode_mode == ASTCENC_PRF_LDR_SRGB) + { + // Error color - HDR endpoint in an LDR encoding + if (rgb_hdr || alpha_hdr) + { + output0 = vint4(0xFF, 0x00, 0xFF, 0xFF); + output1 = vint4(0xFF, 0x00, 0xFF, 0xFF); rgb_hdr = false; alpha_hdr = false; } + + vmask4 mask(true, true, true, false); + + vint4 output0rgb = lsl<8>(output0) | vint4(0x80); + vint4 output0a = output0 * 257; + output0 = select(output0a, output0rgb, mask); + + vint4 output1rgb = lsl<8>(output1) | vint4(0x80); + vint4 output1a = output1 * 257; + output1 = select(output1a, output1rgb, mask); } - // An HDR profile image + // An HDR profile decode, but may be using linear LDR endpoints + // Linear LDR 8-bit endpoints are expanded to 16-bit by replication + // HDR endpoints are already 16-bit else { vmask4 hdr_lanes(rgb_hdr, rgb_hdr, rgb_hdr, alpha_hdr); - output_scale = select(ldr_scale, hdr_scale, hdr_lanes); + vint4 output_scale = select(vint4(257), vint4(1), hdr_lanes); + output0 = output0 * output_scale; + output1 = output1 * output_scale; } - - output0 = output0 * output_scale; - output1 = output1 * output_scale; } diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp index 0c90540c..98d24951 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2023 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -247,7 +247,7 @@ static bool realign_weights_decimated( } // Create an unquantized weight grid for this decimation level - alignas(ASTCENC_VECALIGN) float uq_weightsf[BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS float uq_weightsf[BLOCK_MAX_WEIGHTS]; for (unsigned int we_idx = 0; we_idx < weight_count; we_idx += ASTCENC_SIMD_WIDTH) { vint unquant_value(dec_weights_uquant + we_idx); @@ -467,7 +467,7 @@ static float compress_symbolic_block_for_partition_1plane( qwt_bitcounts[i] = static_cast(bitcount); - alignas(ASTCENC_VECALIGN) float dec_weights_uquantf[BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS float dec_weights_uquantf[BLOCK_MAX_WEIGHTS]; // Generate the optimized set of weights for the weight mode compute_quantized_weights_for_decimation( @@ -830,7 +830,7 @@ static float compress_symbolic_block_for_partition_2planes( unsigned int decimation_mode = bm.decimation_mode; const auto& di = bsd.get_decimation_info(decimation_mode); - alignas(ASTCENC_VECALIGN) float dec_weights_uquantf[BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS float dec_weights_uquantf[BLOCK_MAX_WEIGHTS]; // Generate the optimized set of weights for the mode compute_quantized_weights_for_decimation( diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp index dd331a9a..7463f7e2 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2023 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -27,15 +27,15 @@ /** * @brief Compute the integer linear interpolation of two color endpoints. * - * @param decode_mode The ASTC profile (linear or sRGB) + * @param u8_mask The mask for lanes using decode_unorm8 rather than decode_f16. * @param color0 The endpoint0 color. * @param color1 The endpoint1 color. - * @param weights The interpolation weight (between 0 and 64). + * @param weights The interpolation weight (between 0 and 64). * * @return The interpolated color. */ static vint4 lerp_color_int( - astcenc_profile decode_mode, + vmask4 u8_mask, vint4 color0, vint4 color1, vint4 weights @@ -43,24 +43,18 @@ static vint4 lerp_color_int( vint4 weight1 = weights; vint4 weight0 = vint4(64) - weight1; - if (decode_mode == ASTCENC_PRF_LDR_SRGB) - { - color0 = asr<8>(color0); - color1 = asr<8>(color1); - } - vint4 color = (color0 * weight0) + (color1 * weight1) + vint4(32); color = asr<6>(color); - if (decode_mode == ASTCENC_PRF_LDR_SRGB) - { - color = color * vint4(257); - } + // For decode_unorm8 values force the codec to bit replicate. This allows the + // rest of the codec to assume the full 0xFFFF range for everything and ignore + // the decode_mode setting + vint4 color_u8 = asr<8>(color) * vint4(257); + color = select(color, color_u8, u8_mask); return color; } - /** * @brief Convert integer color value into a float value for the decoder. * @@ -229,12 +223,13 @@ void decompress_symbolic_block( { vint4 colori(scb.constant_color); - // For sRGB decoding a real decoder would just use the top 8 bits for color conversion. - // We don't color convert, so rescale the top 8 bits into the full 16 bit dynamic range. - if (decode_mode == ASTCENC_PRF_LDR_SRGB) - { - colori = asr<8>(colori) * 257; - } + // Determine the UNORM8 rounding on the decode + vmask4 u8_mask = get_u8_component_mask(decode_mode, blk); + + // The real decoder would just use the top 8 bits, but we rescale + // in to a 16-bit value that rounds correctly. + vint4 colori_u8 = asr<8>(colori) * 257; + colori = select(colori, colori_u8, u8_mask); vint4 colorf16 = unorm16_to_sf16(colori); color = float16_to_float(colorf16); @@ -289,6 +284,8 @@ void decompress_symbolic_block( int plane2_component = scb.plane2_component; vmask4 plane2_mask = vint4::lane_id() == vint4(plane2_component); + vmask4 u8_mask = get_u8_component_mask(decode_mode, blk); + for (int i = 0; i < partition_count; i++) { // Decode the color endpoints for this partition @@ -310,7 +307,7 @@ void decompress_symbolic_block( { int tix = pi.texels_of_partition[i][j]; vint4 weight = select(vint4(plane1_weights[tix]), vint4(plane2_weights[tix]), plane2_mask); - vint4 color = lerp_color_int(decode_mode, ep0, ep1, weight); + vint4 color = lerp_color_int(u8_mask, ep0, ep1, weight); vfloat4 colorf = decode_texel(color, lns_mask); blk.data_r[tix] = colorf.lane<0>(); @@ -365,12 +362,14 @@ float compute_symbolic_block_difference_2plane( rgb_lns, a_lns, ep0, ep1); + vmask4 u8_mask = get_u8_component_mask(config.profile, blk); + // Unpack and compute error for each texel in the partition unsigned int texel_count = bsd.texel_count; for (unsigned int i = 0; i < texel_count; i++) { vint4 weight = select(vint4(plane1_weights[i]), vint4(plane2_weights[i]), plane2_mask); - vint4 colori = lerp_color_int(config.profile, ep0, ep1, weight); + vint4 colori = lerp_color_int(u8_mask, ep0, ep1, weight); vfloat4 color = int_to_float(colori); vfloat4 oldColor = blk.texel(i); @@ -444,6 +443,8 @@ float compute_symbolic_block_difference_1plane( int plane1_weights[BLOCK_MAX_TEXELS]; unpack_weights(bsd, scb, di, false, plane1_weights, nullptr); + vmask4 u8_mask = get_u8_component_mask(config.profile, blk); + vfloat4 summa = vfloat4::zero(); for (unsigned int i = 0; i < partition_count; i++) { @@ -464,7 +465,7 @@ float compute_symbolic_block_difference_1plane( for (unsigned int j = 0; j < texel_count; j++) { unsigned int tix = pi.texels_of_partition[i][j]; - vint4 colori = lerp_color_int(config.profile, ep0, ep1, + vint4 colori = lerp_color_int(u8_mask, ep0, ep1, vint4(plane1_weights[tix])); vfloat4 color = int_to_float(colori); @@ -532,7 +533,7 @@ float compute_symbolic_block_difference_1plane_1partition( const decimation_info& di = bsd.get_decimation_info(bm.decimation_mode); // Unquantize and undecimate the weights - alignas(ASTCENC_VECALIGN) int plane1_weights[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS int plane1_weights[BLOCK_MAX_TEXELS]; unpack_weights(bsd, scb, di, false, plane1_weights, nullptr); // Decode the color endpoints for this partition @@ -547,19 +548,12 @@ float compute_symbolic_block_difference_1plane_1partition( rgb_lns, a_lns, ep0, ep1); - - // Pre-shift sRGB so things round correctly - if (config.profile == ASTCENC_PRF_LDR_SRGB) - { - ep0 = asr<8>(ep0); - ep1 = asr<8>(ep1); - } + vmask4 u8_mask = get_u8_component_mask(config.profile, blk); // Unpack and compute error for each texel in the partition vfloatacc summav = vfloatacc::zero(); vint lane_id = vint::lane_id(); - vint srgb_scale(config.profile == ASTCENC_PRF_LDR_SRGB ? 257 : 1); unsigned int texel_count = bsd.texel_count; for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH) @@ -578,11 +572,25 @@ float compute_symbolic_block_difference_1plane_1partition( vint ep0_b = vint(ep0.lane<2>()) * weight0; vint ep0_a = vint(ep0.lane<3>()) * weight0; - // Shift so things round correctly - vint colori_r = asr<6>(ep0_r + ep1_r + vint(32)) * srgb_scale; - vint colori_g = asr<6>(ep0_g + ep1_g + vint(32)) * srgb_scale; - vint colori_b = asr<6>(ep0_b + ep1_b + vint(32)) * srgb_scale; - vint colori_a = asr<6>(ep0_a + ep1_a + vint(32)) * srgb_scale; + // Combine contributions + vint colori_r = asr<6>(ep0_r + ep1_r + vint(32)); + vint colori_g = asr<6>(ep0_g + ep1_g + vint(32)); + vint colori_b = asr<6>(ep0_b + ep1_b + vint(32)); + vint colori_a = asr<6>(ep0_a + ep1_a + vint(32)); + + // If using a U8 decode mode bit replicate top 8 bits + // so rest of codec can assume 0xFFFF max range everywhere + vint colori_r8 = asr<8>(colori_r) * vint(257); + colori_r = select(colori_r, colori_r8, vmask(u8_mask.lane<0>())); + + vint colori_g8 = asr<8>(colori_g) * vint(257); + colori_g = select(colori_g, colori_g8, vmask(u8_mask.lane<1>())); + + vint colori_b8 = asr<8>(colori_b) * vint(257); + colori_b = select(colori_b, colori_b8, vmask(u8_mask.lane<2>())); + + vint colori_a8 = asr<8>(colori_a) * vint(257); + colori_a = select(colori_a, colori_a8, vmask(u8_mask.lane<3>())); // Compute color diff vfloat color_r = int_to_float(colori_r); diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp index 03cf6a86..5dc38016 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2023 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -217,11 +217,13 @@ static astcenc_error validate_block_size( /** * @brief Validate flags. * - * @param flags The flags to check. + * @param profile The profile to check. + * @param flags The flags to check. * * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure. */ static astcenc_error validate_flags( + astcenc_profile profile, unsigned int flags ) { // Flags field must not contain any unknown flag bits @@ -239,6 +241,14 @@ static astcenc_error validate_flags( return ASTCENC_ERR_BAD_FLAGS; } + // Decode_unorm8 must only be used with an LDR profile + bool is_unorm8 = flags & ASTCENC_FLG_USE_DECODE_UNORM8; + bool is_hdr = (profile == ASTCENC_PRF_HDR) || (profile == ASTCENC_PRF_HDR_RGB_LDR_A); + if (is_unorm8 && is_hdr) + { + return ASTCENC_ERR_BAD_DECODE_MODE; + } + return ASTCENC_SUCCESS; } @@ -364,7 +374,7 @@ static astcenc_error validate_config( return status; } - status = validate_flags(config.flags); + status = validate_flags(config.profile, config.flags); if (status != ASTCENC_SUCCESS) { return status; @@ -591,7 +601,7 @@ astcenc_error astcenc_config_init( } // Flags field must not contain any unknown flag bits - status = validate_flags(flags); + status = validate_flags(profile, flags); if (status != ASTCENC_SUCCESS) { return status; @@ -689,6 +699,12 @@ astcenc_error astcenc_context_alloc( } ctx->bsd = aligned_malloc(sizeof(block_size_descriptor), ASTCENC_VECALIGN); + if (!ctx->bsd) + { + delete ctxo; + return ASTCENC_ERR_OUT_OF_MEM; + } + bool can_omit_modes = static_cast(config.flags & ASTCENC_FLG_SELF_DECOMPRESS_ONLY); init_block_size_descriptor(config.block_x, config.block_y, config.block_z, can_omit_modes, @@ -698,7 +714,7 @@ astcenc_error astcenc_context_alloc( #if !defined(ASTCENC_DECOMPRESS_ONLY) // Do setup only needed by compression - if (!(status & ASTCENC_FLG_DECOMPRESS_ONLY)) + if (!(ctx->config.flags & ASTCENC_FLG_DECOMPRESS_ONLY)) { // Turn a dB limit into a per-texel error for faster use later if ((ctx->config.profile == ASTCENC_PRF_LDR) || (ctx->config.profile == ASTCENC_PRF_LDR_SRGB)) @@ -712,7 +728,7 @@ astcenc_error astcenc_context_alloc( size_t worksize = sizeof(compression_working_buffers) * thread_count; ctx->working_buffers = aligned_malloc(worksize, ASTCENC_VECALIGN); - static_assert((sizeof(compression_working_buffers) % ASTCENC_VECALIGN) == 0, + static_assert((ASTCENC_VECALIGN == 0) || ((sizeof(compression_working_buffers) % ASTCENC_VECALIGN) == 0), "compression_working_buffers size must be multiple of vector alignment"); if (!ctx->working_buffers) { @@ -802,6 +818,8 @@ static void compress_image( int row_blocks = xblocks; int plane_blocks = xblocks * yblocks; + blk.decode_unorm8 = ctxo.context.config.flags & ASTCENC_FLG_USE_DECODE_UNORM8; + // Populate the block channel weights blk.channel_weight = vfloat4(ctx.config.cw_r_weight, ctx.config.cw_g_weight, @@ -812,7 +830,7 @@ static void compress_image( auto& temp_buffers = ctx.working_buffers[thread_index]; // Only the first thread actually runs the initializer - ctxo.manage_compress.init(block_count); + ctxo.manage_compress.init(block_count, ctx.config.progress_callback); // Determine if we can use an optimized load function bool needs_swz = (swizzle.r != ASTCENC_SWZ_R) || (swizzle.g != ASTCENC_SWZ_G) || @@ -1137,6 +1155,7 @@ astcenc_error astcenc_decompress_image( unsigned int xblocks = (image_out.dim_x + block_x - 1) / block_x; unsigned int yblocks = (image_out.dim_y + block_y - 1) / block_y; unsigned int zblocks = (image_out.dim_z + block_z - 1) / block_z; + unsigned int block_count = zblocks * yblocks * xblocks; int row_blocks = xblocks; int plane_blocks = xblocks * yblocks; @@ -1148,9 +1167,12 @@ astcenc_error astcenc_decompress_image( return ASTCENC_ERR_OUT_OF_MEM; } - image_block blk; + image_block blk {}; blk.texel_count = static_cast(block_x * block_y * block_z); + // Decode mode inferred from the output data type + blk.decode_unorm8 = image_out.data_type == ASTCENC_TYPE_U8; + // If context thread count is one then implicitly reset if (ctx->thread_count == 1) { @@ -1158,7 +1180,7 @@ astcenc_error astcenc_decompress_image( } // Only the first thread actually runs the initializer - ctxo->manage_decompress.init(zblocks * yblocks * xblocks); + ctxo->manage_decompress.init(block_count, nullptr); // All threads run this processing loop until there is no work remaining while (true) @@ -1356,6 +1378,8 @@ const char* astcenc_get_error_string( return "ASTCENC_ERR_BAD_CONTEXT"; case ASTCENC_ERR_NOT_IMPLEMENTED: return "ASTCENC_ERR_NOT_IMPLEMENTED"; + case ASTCENC_ERR_BAD_DECODE_MODE: + return "ASTCENC_ERR_BAD_DECODE_MODE"; #if defined(ASTCENC_DIAGNOSTICS) case ASTCENC_ERR_DTRACE_FAILURE: return "ASTCENC_ERR_DTRACE_FAILURE"; diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp index 89ec9dcf..051782fd 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2023 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -873,7 +873,7 @@ void compute_ideal_weights_for_decimation( } // Otherwise compute an estimate and perform single refinement iteration - alignas(ASTCENC_VECALIGN) float infilled_weights[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float infilled_weights[BLOCK_MAX_TEXELS]; // Compute an initial average for each decimated weight bool constant_wes = ei.is_constant_weight_error_scale; @@ -1171,7 +1171,7 @@ void recompute_ideal_colors_1plane( promise(total_texel_count > 0); promise(partition_count > 0); - alignas(ASTCENC_VECALIGN) float dec_weight[BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS float dec_weight[BLOCK_MAX_WEIGHTS]; for (unsigned int i = 0; i < weight_count; i += ASTCENC_SIMD_WIDTH) { vint unquant_value(dec_weights_uquant + i); @@ -1179,7 +1179,7 @@ void recompute_ideal_colors_1plane( storea(unquant_valuef, dec_weight + i); } - alignas(ASTCENC_VECALIGN) float undec_weight[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float undec_weight[BLOCK_MAX_TEXELS]; float* undec_weight_ref; if (di.max_texel_weight_count == 1) { @@ -1394,8 +1394,8 @@ void recompute_ideal_colors_2planes( promise(total_texel_count > 0); promise(weight_count > 0); - alignas(ASTCENC_VECALIGN) float dec_weight_plane1[BLOCK_MAX_WEIGHTS_2PLANE]; - alignas(ASTCENC_VECALIGN) float dec_weight_plane2[BLOCK_MAX_WEIGHTS_2PLANE]; + ASTCENC_ALIGNAS float dec_weight_plane1[BLOCK_MAX_WEIGHTS_2PLANE]; + ASTCENC_ALIGNAS float dec_weight_plane2[BLOCK_MAX_WEIGHTS_2PLANE]; assert(weight_count <= BLOCK_MAX_WEIGHTS_2PLANE); @@ -1410,8 +1410,8 @@ void recompute_ideal_colors_2planes( storea(unquant_value2f, dec_weight_plane2 + i); } - alignas(ASTCENC_VECALIGN) float undec_weight_plane1[BLOCK_MAX_TEXELS]; - alignas(ASTCENC_VECALIGN) float undec_weight_plane2[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float undec_weight_plane1[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float undec_weight_plane2[BLOCK_MAX_TEXELS]; float* undec_weight_plane1_ref; float* undec_weight_plane2_ref; diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp index b60d9cd8..079f69f1 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2022 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -109,7 +109,7 @@ static vfloat4 swz_texel( vfloat4 data, const astcenc_swizzle& swz ) { - alignas(16) float datas[6]; + ASTCENC_ALIGNAS float datas[6]; storea(data, datas); datas[ASTCENC_SWZ_0] = 0.0f; diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp index 41675037..41dc38b7 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2021 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -464,10 +464,10 @@ static inline void write_bits( } /** - * @brief Read up to 8 bits at an arbitrary bit offset. + * @brief Read up to 16 bits from two bytes. * - * The stored value is at most 8 bits, but can be stored at an offset of between 0 and 7 bits so may - * span two separate bytes in memory. + * This function reads a packed N-bit field from two bytes in memory. The stored value must exist + * within the two bytes, but can start at an arbitary bit offset and span the two bytes in memory. * * @param bitcount The number of bits to read. * @param bitoffset The bit offset to read from, between 0 and 7. diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_internal.h b/bimg/3rdparty/astc-encoder/source/astcenc_internal.h index b1da41b7..df6e07f9 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_internal.h +++ b/bimg/3rdparty/astc-encoder/source/astcenc_internal.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2023 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -29,6 +29,7 @@ #include #endif #include +#include #include "astcenc.h" #include "astcenc_mathlib.h" @@ -325,10 +326,10 @@ struct partition_info uint8_t partition_texel_count[BLOCK_MAX_PARTITIONS]; /** @brief The partition of each texel in the block. */ - uint8_t partition_of_texel[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS uint8_t partition_of_texel[BLOCK_MAX_TEXELS]; /** @brief The list of texels in each partition. */ - uint8_t texels_of_partition[BLOCK_MAX_PARTITIONS][BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS uint8_t texels_of_partition[BLOCK_MAX_PARTITIONS][BLOCK_MAX_TEXELS]; }; /** @@ -366,40 +367,40 @@ struct decimation_info * @brief The number of weights that contribute to each texel. * Value is between 1 and 4. */ - uint8_t texel_weight_count[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS uint8_t texel_weight_count[BLOCK_MAX_TEXELS]; /** * @brief The weight index of the N weights that are interpolated for each texel. * Stored transposed to improve vectorization. */ - uint8_t texel_weights_tr[4][BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS uint8_t texel_weights_tr[4][BLOCK_MAX_TEXELS]; /** * @brief The bilinear contribution of the N weights that are interpolated for each texel. * Value is between 0 and 16, stored transposed to improve vectorization. */ - uint8_t texel_weight_contribs_int_tr[4][BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS uint8_t texel_weight_contribs_int_tr[4][BLOCK_MAX_TEXELS]; /** * @brief The bilinear contribution of the N weights that are interpolated for each texel. * Value is between 0 and 1, stored transposed to improve vectorization. */ - alignas(ASTCENC_VECALIGN) float texel_weight_contribs_float_tr[4][BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float texel_weight_contribs_float_tr[4][BLOCK_MAX_TEXELS]; /** @brief The number of texels that each stored weight contributes to. */ - uint8_t weight_texel_count[BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS uint8_t weight_texel_count[BLOCK_MAX_WEIGHTS]; /** * @brief The list of texels that use a specific weight index. * Stored transposed to improve vectorization. */ - uint8_t weight_texels_tr[BLOCK_MAX_TEXELS][BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS uint8_t weight_texels_tr[BLOCK_MAX_TEXELS][BLOCK_MAX_WEIGHTS]; /** * @brief The bilinear contribution to the N texels that use each weight. * Value is between 0 and 1, stored transposed to improve vectorization. */ - alignas(ASTCENC_VECALIGN) float weights_texel_contribs_tr[BLOCK_MAX_TEXELS][BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS float weights_texel_contribs_tr[BLOCK_MAX_TEXELS][BLOCK_MAX_WEIGHTS]; /** * @brief The bilinear contribution to the Nth texel that uses each weight. @@ -579,7 +580,7 @@ struct block_size_descriptor decimation_mode decimation_modes[WEIGHTS_MAX_DECIMATION_MODES]; /** @brief The active decimation tables, stored in low indices. */ - alignas(ASTCENC_VECALIGN) decimation_info decimation_tables[WEIGHTS_MAX_DECIMATION_MODES]; + ASTCENC_ALIGNAS decimation_info decimation_tables[WEIGHTS_MAX_DECIMATION_MODES]; /** @brief The packed block mode array index, or @c BLOCK_BAD_BLOCK_MODE if not active. */ uint16_t block_mode_packed_index[WEIGHTS_MAX_BLOCK_MODES]; @@ -731,7 +732,11 @@ struct block_size_descriptor * * The @c data_[rgba] fields store the image data in an encoded SoA float form designed for easy * vectorization. Input data is converted to float and stored as values between 0 and 65535. LDR - * data is stored as direct UNORM data, HDR data is stored as LNS data. + * data is stored as direct UNORM data, HDR data is stored as LNS data. They are allocated SIMD + * elements over-size to allow vectorized stores of unaligned and partial SIMD lanes (e.g. in a + * 6x6x6 block the final row write will read elements 210-217 (vec8) or 214-217 (vec4), which is + * two elements above the last real data element). The overspill values are never written to memory, + * and would be benign, but the padding avoids hitting undefined behavior. * * The @c rgb_lns and @c alpha_lns fields that assigned a per-texel use of HDR are only used during * decompression. The current compressor will always use HDR endpoint formats when in HDR mode. @@ -739,16 +744,16 @@ struct block_size_descriptor struct image_block { /** @brief The input (compress) or output (decompress) data for the red color component. */ - alignas(ASTCENC_VECALIGN) float data_r[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float data_r[BLOCK_MAX_TEXELS + ASTCENC_SIMD_WIDTH - 1]; /** @brief The input (compress) or output (decompress) data for the green color component. */ - alignas(ASTCENC_VECALIGN) float data_g[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float data_g[BLOCK_MAX_TEXELS + ASTCENC_SIMD_WIDTH - 1]; /** @brief The input (compress) or output (decompress) data for the blue color component. */ - alignas(ASTCENC_VECALIGN) float data_b[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float data_b[BLOCK_MAX_TEXELS + ASTCENC_SIMD_WIDTH - 1]; /** @brief The input (compress) or output (decompress) data for the alpha color component. */ - alignas(ASTCENC_VECALIGN) float data_a[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float data_a[BLOCK_MAX_TEXELS + ASTCENC_SIMD_WIDTH - 1]; /** @brief The number of texels in the block. */ uint8_t texel_count; @@ -771,6 +776,9 @@ struct image_block /** @brief Is this grayscale block where R == G == B for all texels? */ bool grayscale; + /** @brief Is the eventual decode using decode_unorm8 rounding? */ + bool decode_unorm8; + /** @brief Set to 1 if a texel is using HDR RGB endpoints (decompression only). */ uint8_t rgb_lns[BLOCK_MAX_TEXELS]; @@ -897,10 +905,10 @@ struct endpoints_and_weights endpoints ep; /** @brief The ideal weight for each texel; may be undecimated or decimated. */ - alignas(ASTCENC_VECALIGN) float weights[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float weights[BLOCK_MAX_TEXELS]; /** @brief The ideal weight error scaling for each texel; may be undecimated or decimated. */ - alignas(ASTCENC_VECALIGN) float weight_error_scale[BLOCK_MAX_TEXELS]; + ASTCENC_ALIGNAS float weight_error_scale[BLOCK_MAX_TEXELS]; }; /** @@ -930,7 +938,7 @@ struct encoding_choice_errors /** * @brief Preallocated working buffers, allocated per thread during context creation. */ -struct alignas(ASTCENC_VECALIGN) compression_working_buffers +struct ASTCENC_ALIGNAS compression_working_buffers { /** @brief Ideal endpoints and weights for plane 1. */ endpoints_and_weights ei1; @@ -946,17 +954,17 @@ struct alignas(ASTCENC_VECALIGN) compression_working_buffers * * For two planes, second plane starts at @c WEIGHTS_PLANE2_OFFSET offsets. */ - alignas(ASTCENC_VECALIGN) float dec_weights_ideal[WEIGHTS_MAX_DECIMATION_MODES * BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS float dec_weights_ideal[WEIGHTS_MAX_DECIMATION_MODES * BLOCK_MAX_WEIGHTS]; /** * @brief Decimated quantized weight values in the unquantized 0-64 range. * * For two planes, second plane starts at @c WEIGHTS_PLANE2_OFFSET offsets. */ - uint8_t dec_weights_uquant[WEIGHTS_MAX_BLOCK_MODES * BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS uint8_t dec_weights_uquant[WEIGHTS_MAX_BLOCK_MODES * BLOCK_MAX_WEIGHTS]; /** @brief Error of the best encoding combination for each block mode. */ - alignas(ASTCENC_VECALIGN) float errors_of_best_combination[WEIGHTS_MAX_BLOCK_MODES]; + ASTCENC_ALIGNAS float errors_of_best_combination[WEIGHTS_MAX_BLOCK_MODES]; /** @brief The best color quant for each block mode. */ uint8_t best_quant_levels[WEIGHTS_MAX_BLOCK_MODES]; @@ -1107,7 +1115,7 @@ struct symbolic_compressed_block * * If dual plane, the second plane starts at @c weights[WEIGHTS_PLANE2_OFFSET]. */ - uint8_t weights[BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS uint8_t weights[BLOCK_MAX_WEIGHTS]; /** * @brief Get the weight quantization used by this block mode. @@ -1563,6 +1571,33 @@ unsigned int find_best_partition_candidates( Functionality for managing images and image related data. ============================================================================ */ +/** + * @brief Get a vector mask indicating lanes decompressing into a UNORM8 value. + * + * @param decode_mode The color profile for LDR_SRGB settings. + * @param blk The image block for output image bitness settings. + * + * @return The component mask vector. + */ +static inline vmask4 get_u8_component_mask( + astcenc_profile decode_mode, + const image_block& blk +) { + vmask4 u8_mask(false); + // Decode mode writing to a unorm8 output value + if (blk.decode_unorm8) + { + u8_mask = vmask4(true); + } + // SRGB writing to a unorm8 RGB value + else if (decode_mode == ASTCENC_PRF_LDR_SRGB) + { + u8_mask = vmask4(true, true, true, false); + } + + return u8_mask; +} + /** * @brief Setup computation of regional averages in an image. * @@ -1816,7 +1851,7 @@ uint8_t pack_color_endpoints( * * Endpoints must be unscrambled and converted into the 0-255 range before calling this functions. * - * @param decode_mode The decode mode (LDR, HDR). + * @param decode_mode The decode mode (LDR, HDR, etc). * @param format The color endpoint mode used. * @param input The raw array of encoded input integers. The length of this array * depends on @c format; it can be safely assumed to be large enough. @@ -2142,10 +2177,11 @@ Platform-specific functions. /** * @brief Allocate an aligned memory buffer. * - * Allocated memory must be freed by aligned_free; + * Allocated memory must be freed by aligned_free. * * @param size The desired buffer size. - * @param align The desired buffer alignment; must be 2^N. + * @param align The desired buffer alignment; must be 2^N, may be increased + * by the implementation to a minimum allowable alignment. * * @return The memory buffer pointer or nullptr on allocation failure. */ @@ -2155,10 +2191,14 @@ T* aligned_malloc(size_t size, size_t align) void* ptr; int error = 0; + // Don't allow this to under-align a type + size_t min_align = astc::max(alignof(T), sizeof(void*)); + size_t real_align = astc::max(min_align, align); + #if defined(_WIN32) - ptr = _aligned_malloc(size, align); + ptr = _aligned_malloc(size, real_align); #else - error = posix_memalign(&ptr, align, size); + error = posix_memalign(&ptr, real_align, size); #endif if (error || (!ptr)) diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_internal_entry.h b/bimg/3rdparty/astc-encoder/source/astcenc_internal_entry.h index 4e879454..c283c5ac 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_internal_entry.h +++ b/bimg/3rdparty/astc-encoder/source/astcenc_internal_entry.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2022 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -118,6 +118,18 @@ class ParallelManager /** @brief Number of tasks that need to be processed. */ unsigned int m_task_count; + /** @brief Progress callback (optional). */ + astcenc_progress_callback m_callback; + + /** @brief Lock used for callback synchronization. */ + std::mutex m_callback_lock; + + /** @brief Minimum progress before making a callback. */ + float m_callback_min_diff; + + /** @brief Last progress callback value. */ + float m_callback_last_value; + public: /** @brief Create a new ParallelManager. */ ParallelManager() @@ -138,6 +150,9 @@ class ParallelManager m_start_count = 0; m_done_count = 0; m_task_count = 0; + m_callback = nullptr; + m_callback_last_value = 0.0f; + m_callback_min_diff = 1.0f; } /** @@ -166,14 +181,20 @@ class ParallelManager * initialization. Other threads will block and wait for it to complete. * * @param task_count Total number of tasks needing processing. + * @param callback Function pointer for progress status callbacks. */ - void init(unsigned int task_count) + void init(unsigned int task_count, astcenc_progress_callback callback) { std::lock_guard lck(m_lock); if (!m_init_done) { + m_callback = callback; m_task_count = task_count; m_init_done = true; + + // Report every 1% or 4096 blocks, whichever is larger, to avoid callback overhead + float min_diff = (4096.0f / static_cast(task_count)) * 100.0f; + m_callback_min_diff = astc::max(min_diff, 1.0f); } } @@ -212,12 +233,49 @@ class ParallelManager { // Note: m_done_count cannot use an atomic without the mutex; this has a race between the // update here and the wait() for other threads - std::unique_lock lck(m_lock); - this->m_done_count += count; - if (m_done_count == m_task_count) + unsigned int local_count; + float local_last_value; { - lck.unlock(); - m_complete.notify_all(); + std::unique_lock lck(m_lock); + m_done_count += count; + local_count = m_done_count; + local_last_value = m_callback_last_value; + + if (m_done_count == m_task_count) + { + // Ensure the progress bar hits 100% + if (m_callback) + { + std::unique_lock cblck(m_callback_lock); + m_callback(100.0f); + m_callback_last_value = 100.0f; + } + + lck.unlock(); + m_complete.notify_all(); + } + } + + // Process progress callback if we have one + if (m_callback) + { + // Initial lockless test - have we progressed enough to emit? + float num = static_cast(local_count); + float den = static_cast(m_task_count); + float this_value = (num / den) * 100.0f; + bool report_test = (this_value - local_last_value) > m_callback_min_diff; + + // Recheck under lock, because another thread might report first + if (report_test) + { + std::unique_lock cblck(m_callback_lock); + bool report_retest = (this_value - m_callback_last_value) > m_callback_min_diff; + if (report_retest) + { + m_callback(this_value); + m_callback_last_value = this_value; + } + } } } diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.h b/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.h index 0540c4fe..562d6597 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.h +++ b/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2021 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -73,10 +73,22 @@ #endif #endif +// Force vector-sized SIMD alignment #if ASTCENC_AVX #define ASTCENC_VECALIGN 32 -#else +#elif ASTCENC_SSE || ASTCENC_NEON #define ASTCENC_VECALIGN 16 +// Use default alignment for non-SIMD builds +#else + #define ASTCENC_VECALIGN 0 +#endif + +// C++11 states that alignas(0) should be ignored but GCC doesn't do +// this on some versions, so workaround and avoid emitting alignas(0) +#if ASTCENC_VECALIGN > 0 + #define ASTCENC_ALIGNAS alignas(ASTCENC_VECALIGN) +#else + #define ASTCENC_ALIGNAS #endif #if ASTCENC_SSE != 0 || ASTCENC_AVX != 0 || ASTCENC_POPCNT != 0 diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_mathlib_softfloat.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_mathlib_softfloat.cpp index fa66036d..42db7645 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_mathlib_softfloat.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_mathlib_softfloat.cpp @@ -15,13 +15,13 @@ // under the License. // ---------------------------------------------------------------------------- -#include "astcenc_mathlib.h" - /** * @brief Soft-float library for IEEE-754. */ #if (ASTCENC_F16C == 0) && (ASTCENC_NEON == 0) +#include "astcenc_mathlib.h" + /* sized soft-float types. These are mapped to the sized integer types of C99, instead of C's floating-point types; this is because the library needs to maintain exact, bit-level control on all diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp index c4da678f..45d9abb6 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp @@ -330,12 +330,14 @@ void physical_to_symbolic( return; } + // Low values span 3 bytes so need two read_bits calls int vx_low_s = read_bits(8, 12, pcb) | (read_bits(5, 12 + 8, pcb) << 8); - int vx_high_s = read_bits(8, 25, pcb) | (read_bits(5, 25 + 8, pcb) << 8); + int vx_high_s = read_bits(13, 25, pcb); int vx_low_t = read_bits(8, 38, pcb) | (read_bits(5, 38 + 8, pcb) << 8); - int vx_high_t = read_bits(8, 51, pcb) | (read_bits(5, 51 + 8, pcb) << 8); + int vx_high_t = read_bits(13, 51, pcb); - int all_ones = vx_low_s == 0x1FFF && vx_high_s == 0x1FFF && vx_low_t == 0x1FFF && vx_high_t == 0x1FFF; + int all_ones = vx_low_s == 0x1FFF && vx_high_s == 0x1FFF && + vx_low_t == 0x1FFF && vx_high_t == 0x1FFF; if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t) && !all_ones) { @@ -350,12 +352,14 @@ void physical_to_symbolic( int vx_high_s = read_bits(9, 19, pcb); int vx_low_t = read_bits(9, 28, pcb); int vx_high_t = read_bits(9, 37, pcb); - int vx_low_p = read_bits(9, 46, pcb); - int vx_high_p = read_bits(9, 55, pcb); + int vx_low_r = read_bits(9, 46, pcb); + int vx_high_r = read_bits(9, 55, pcb); - int all_ones = vx_low_s == 0x1FF && vx_high_s == 0x1FF && vx_low_t == 0x1FF && vx_high_t == 0x1FF && vx_low_p == 0x1FF && vx_high_p == 0x1FF; + int all_ones = vx_low_s == 0x1FF && vx_high_s == 0x1FF && + vx_low_t == 0x1FF && vx_high_t == 0x1FF && + vx_low_r == 0x1FF && vx_high_r == 0x1FF; - if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t || vx_low_p >= vx_high_p) && !all_ones) + if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t || vx_low_r >= vx_high_r) && !all_ones) { scb.block_type = SYM_BTYPE_ERROR; return; @@ -470,8 +474,7 @@ void physical_to_symbolic( bitpos += 2; } } - scb.partition_index = static_cast(read_bits(6, 13, pcb) | - (read_bits(PARTITION_INDEX_BITS - 6, 19, pcb) << 6)); + scb.partition_index = static_cast(read_bits(10, 13, pcb)); } for (int i = 0; i < partition_count; i++) diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_avx2_8.h b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_avx2_8.h index 72ed19f7..3ca25e35 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_avx2_8.h +++ b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_avx2_8.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2019-2022 Arm Limited +// Copyright 2019-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -1170,7 +1170,7 @@ ASTCENC_SIMD_INLINE void store_lanes_masked(uint8_t* base, vint8 data, vmask8 ma */ ASTCENC_SIMD_INLINE void print(vint8 a) { - alignas(ASTCENC_VECALIGN) int v[8]; + alignas(32) int v[8]; storea(a, v); printf("v8_i32:\n %8d %8d %8d %8d %8d %8d %8d %8d\n", v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]); @@ -1181,7 +1181,7 @@ ASTCENC_SIMD_INLINE void print(vint8 a) */ ASTCENC_SIMD_INLINE void printx(vint8 a) { - alignas(ASTCENC_VECALIGN) int v[8]; + alignas(32) int v[8]; storea(a, v); printf("v8_i32:\n %08x %08x %08x %08x %08x %08x %08x %08x\n", v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]); @@ -1192,7 +1192,7 @@ ASTCENC_SIMD_INLINE void printx(vint8 a) */ ASTCENC_SIMD_INLINE void print(vfloat8 a) { - alignas(ASTCENC_VECALIGN) float v[8]; + alignas(32) float v[8]; storea(a, v); printf("v8_f32:\n %0.4f %0.4f %0.4f %0.4f %0.4f %0.4f %0.4f %0.4f\n", static_cast(v[0]), static_cast(v[1]), diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_common_4.h b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_common_4.h index 86ee4fd3..1e04367c 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_common_4.h +++ b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_common_4.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2020-2021 Arm Limited +// Copyright 2020-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -383,7 +383,7 @@ static ASTCENC_SIMD_INLINE void bit_transfer_signed( */ ASTCENC_SIMD_INLINE void print(vint4 a) { - alignas(16) int v[4]; + ASTCENC_ALIGNAS int v[4]; storea(a, v); printf("v4_i32:\n %8d %8d %8d %8d\n", v[0], v[1], v[2], v[3]); @@ -394,7 +394,7 @@ ASTCENC_SIMD_INLINE void print(vint4 a) */ ASTCENC_SIMD_INLINE void printx(vint4 a) { - alignas(16) int v[4]; + ASTCENC_ALIGNAS int v[4]; storea(a, v); printf("v4_i32:\n %08x %08x %08x %08x\n", v[0], v[1], v[2], v[3]); @@ -405,7 +405,7 @@ ASTCENC_SIMD_INLINE void printx(vint4 a) */ ASTCENC_SIMD_INLINE void print(vfloat4 a) { - alignas(16) float v[4]; + ASTCENC_ALIGNAS float v[4]; storea(a, v); printf("v4_f32:\n %0.4f %0.4f %0.4f %0.4f\n", static_cast(v[0]), static_cast(v[1]), diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_neon_4.h b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_neon_4.h index c5ad872b..42545e75 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_neon_4.h +++ b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_neon_4.h @@ -359,9 +359,9 @@ struct vmask4 /** * @brief Get the scalar from a single lane. */ - template ASTCENC_SIMD_INLINE uint32_t lane() const + template ASTCENC_SIMD_INLINE bool lane() const { - return vgetq_lane_u32(m, l); + return vgetq_lane_u32(m, l) != 0; } /** diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_none_4.h b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_none_4.h index 6dbb6599..be7348ef 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_none_4.h +++ b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_none_4.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2019-2022 Arm Limited +// Copyright 2019-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -351,6 +351,13 @@ struct vmask4 m[3] = d == false ? 0 : -1; } + /** + * @brief Get the scalar value of a single lane. + */ + template ASTCENC_SIMD_INLINE float lane() const + { + return m[l] != 0; + } /** * @brief The vector ... @@ -549,10 +556,16 @@ ASTCENC_SIMD_INLINE vmask4 operator>(vint4 a, vint4 b) */ template ASTCENC_SIMD_INLINE vint4 lsl(vint4 a) { - return vint4(a.m[0] << s, - a.m[1] << s, - a.m[2] << s, - a.m[3] << s); + // Cast to unsigned to avoid shift in/out of sign bit undefined behavior + unsigned int as0 = static_cast(a.m[0]) << s; + unsigned int as1 = static_cast(a.m[1]) << s; + unsigned int as2 = static_cast(a.m[2]) << s; + unsigned int as3 = static_cast(a.m[3]) << s; + + return vint4(static_cast(as0), + static_cast(as1), + static_cast(as2), + static_cast(as3)); } /** @@ -560,6 +573,7 @@ template ASTCENC_SIMD_INLINE vint4 lsl(vint4 a) */ template ASTCENC_SIMD_INLINE vint4 lsr(vint4 a) { + // Cast to unsigned to avoid shift in/out of sign bit undefined behavior unsigned int as0 = static_cast(a.m[0]) >> s; unsigned int as1 = static_cast(a.m[1]) >> s; unsigned int as2 = static_cast(a.m[2]) >> s; diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h index 4dd58d23..3dce5ba4 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h +++ b/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2019-2022 Arm Limited +// Copyright 2019-2023 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -379,9 +379,9 @@ struct vmask4 /** * @brief Get the scalar value of a single lane. */ - template ASTCENC_SIMD_INLINE float lane() const + template ASTCENC_SIMD_INLINE bool lane() const { - return _mm_cvtss_f32(_mm_shuffle_ps(m, m, l)); + return _mm_cvtss_f32(_mm_shuffle_ps(m, m, l)) != 0.0f; } /** diff --git a/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp b/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp index aa6ab61f..4e993e73 100644 --- a/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp +++ b/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// Copyright 2011-2023 Arm Limited +// Copyright 2011-2024 Arm Limited // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy @@ -60,8 +60,8 @@ static const uint8_t steps_for_quant_level[12] { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32 }; -alignas(ASTCENC_VECALIGN) static float sin_table[SINCOS_STEPS][ANGULAR_STEPS]; -alignas(ASTCENC_VECALIGN) static float cos_table[SINCOS_STEPS][ANGULAR_STEPS]; +ASTCENC_ALIGNAS static float sin_table[SINCOS_STEPS][ANGULAR_STEPS]; +ASTCENC_ALIGNAS static float cos_table[SINCOS_STEPS][ANGULAR_STEPS]; #if defined(ASTCENC_DIAGNOSTICS) static bool print_once { true }; @@ -99,7 +99,7 @@ static void compute_angular_offsets( promise(weight_count > 0); promise(max_angular_steps > 0); - alignas(ASTCENC_VECALIGN) int isamplev[BLOCK_MAX_WEIGHTS]; + ASTCENC_ALIGNAS int isamplev[BLOCK_MAX_WEIGHTS]; // Precompute isample; arrays are always allocated 64 elements long for (unsigned int i = 0; i < weight_count; i += ASTCENC_SIMD_WIDTH) @@ -242,16 +242,16 @@ static void compute_angular_endpoints_for_quant_levels( unsigned int max_quant_steps = steps_for_quant_level[max_quant_level]; unsigned int max_angular_steps = steps_for_quant_level[max_quant_level]; - alignas(ASTCENC_VECALIGN) float angular_offsets[ANGULAR_STEPS]; + ASTCENC_ALIGNAS float angular_offsets[ANGULAR_STEPS]; compute_angular_offsets(weight_count, dec_weight_ideal_value, max_angular_steps, angular_offsets); - alignas(ASTCENC_VECALIGN) float lowest_weight[ANGULAR_STEPS]; - alignas(ASTCENC_VECALIGN) int32_t weight_span[ANGULAR_STEPS]; - alignas(ASTCENC_VECALIGN) float error[ANGULAR_STEPS]; - alignas(ASTCENC_VECALIGN) float cut_low_weight_error[ANGULAR_STEPS]; - alignas(ASTCENC_VECALIGN) float cut_high_weight_error[ANGULAR_STEPS]; + ASTCENC_ALIGNAS float lowest_weight[ANGULAR_STEPS]; + ASTCENC_ALIGNAS int32_t weight_span[ANGULAR_STEPS]; + ASTCENC_ALIGNAS float error[ANGULAR_STEPS]; + ASTCENC_ALIGNAS float cut_low_weight_error[ANGULAR_STEPS]; + ASTCENC_ALIGNAS float cut_high_weight_error[ANGULAR_STEPS]; compute_lowest_and_highest_weight(weight_count, dec_weight_ideal_value, max_angular_steps, max_quant_steps, diff --git a/bimg/3rdparty/nvtt/nvcore/debug.h b/bimg/3rdparty/nvtt/nvcore/debug.h index 31d0f51a..f92eb60a 100644 --- a/bimg/3rdparty/nvtt/nvcore/debug.h +++ b/bimg/3rdparty/nvtt/nvcore/debug.h @@ -1,4 +1,4 @@ -// This code is in the public domain -- Ignacio Castaño +// This code is in the public domain -- Ignacio Castaño #ifndef NV_CORE_DEBUG_H #define NV_CORE_DEBUG_H @@ -24,6 +24,7 @@ # define nvAssert(exp) nvNoAssert(exp) # define nvCheck(exp) nvNoAssert(exp) +# define nvCheckMacro(exp) (exp) # define nvDebugAssert(exp) nvNoAssert(exp) # define nvDebugCheck(exp) nvNoAssert(exp) # define nvDebugBreak() nvNoAssert(0) diff --git a/bimg/3rdparty/nvtt/nvcore/nvcore.h b/bimg/3rdparty/nvtt/nvcore/nvcore.h index f650ee71..20a933c7 100644 --- a/bimg/3rdparty/nvtt/nvcore/nvcore.h +++ b/bimg/3rdparty/nvtt/nvcore/nvcore.h @@ -4,7 +4,7 @@ #define NV_CORE_H #define NVCORE_SHARED 0 -#define NV_NO_ASSERT 0 +#define NV_NO_ASSERT 1 // Function linkage #if NVCORE_SHARED diff --git a/bimg/3rdparty/nvtt/nvtt.cpp b/bimg/3rdparty/nvtt/nvtt.cpp index 3e202511..c85b3db0 100644 --- a/bimg/3rdparty/nvtt/nvtt.cpp +++ b/bimg/3rdparty/nvtt/nvtt.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ diff --git a/bimg/3rdparty/stb/stb_image.h b/bimg/3rdparty/stb/stb_image.h index 5e807a0a..a632d543 100644 --- a/bimg/3rdparty/stb/stb_image.h +++ b/bimg/3rdparty/stb/stb_image.h @@ -1,4 +1,4 @@ -/* stb_image - v2.28 - public domain image loader - http://nothings.org/stb +/* stb_image - v2.29 - public domain image loader - http://nothings.org/stb no warranty implied; use at your own risk Do this: @@ -48,6 +48,7 @@ LICENSE RECENT REVISION HISTORY: + 2.29 (2023-05-xx) optimizations 2.28 (2023-01-29) many error fixes, security errors, just tons of stuff 2.27 (2021-07-11) document stbi_info better, 16-bit PNM support, bug fixes 2.26 (2020-07-13) many minor fixes @@ -1072,8 +1073,8 @@ static int stbi__addints_valid(int a, int b) return a <= INT_MAX - b; } -// returns 1 if the product of two signed shorts is valid, 0 on overflow. -static int stbi__mul2shorts_valid(short a, short b) +// returns 1 if the product of two ints fits in a signed short, 0 on overflow. +static int stbi__mul2shorts_valid(int a, int b) { if (b == 0 || b == -1) return 1; // multiplication by 0 is always 0; check for -1 so SHRT_MIN/b doesn't overflow if ((a >= 0) == (b >= 0)) return a <= SHRT_MAX/b; // product is positive, so similar to mul2sizes_valid @@ -3384,13 +3385,13 @@ static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan) return 1; } -static int stbi__skip_jpeg_junk_at_end(stbi__jpeg *j) +static stbi_uc stbi__skip_jpeg_junk_at_end(stbi__jpeg *j) { // some JPEGs have junk at end, skip over it but if we find what looks // like a valid marker, resume there while (!stbi__at_eof(j->s)) { - int x = stbi__get8(j->s); - while (x == 255) { // might be a marker + stbi_uc x = stbi__get8(j->s); + while (x == 0xff) { // might be a marker if (stbi__at_eof(j->s)) return STBI__MARKER_none; x = stbi__get8(j->s); if (x != 0x00 && x != 0xff) { @@ -4176,6 +4177,7 @@ typedef struct { stbi_uc *zbuffer, *zbuffer_end; int num_bits; + int hit_zeof_once; stbi__uint32 code_buffer; char *zout; @@ -4242,9 +4244,20 @@ stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) int b,s; if (a->num_bits < 16) { if (stbi__zeof(a)) { - return -1; /* report error for unexpected end of data. */ + if (!a->hit_zeof_once) { + // This is the first time we hit eof, insert 16 extra padding btis + // to allow us to keep going; if we actually consume any of them + // though, that is invalid data. This is caught later. + a->hit_zeof_once = 1; + a->num_bits += 16; // add 16 implicit zero bits + } else { + // We already inserted our extra 16 padding bits and are again + // out, this stream is actually prematurely terminated. + return -1; + } + } else { + stbi__fill_bits(a); } - stbi__fill_bits(a); } b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; if (b) { @@ -4309,6 +4322,13 @@ static int stbi__parse_huffman_block(stbi__zbuf *a) int len,dist; if (z == 256) { a->zout = zout; + if (a->hit_zeof_once && a->num_bits < 16) { + // The first time we hit zeof, we inserted 16 extra zero bits into our bit + // buffer so the decoder can just do its speculative decoding. But if we + // actually consumed any of those bits (which is the case when num_bits < 16), + // the stream actually read past the end so it is malformed. + return stbi__err("unexpected end","Corrupt PNG"); + } return 1; } if (z >= 286) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, length codes 286 and 287 must not appear in compressed data @@ -4320,7 +4340,7 @@ static int stbi__parse_huffman_block(stbi__zbuf *a) dist = stbi__zdist_base[z]; if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]); if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG"); - if (zout + len > a->zout_end) { + if (len > a->zout_end - zout) { if (!stbi__zexpand(a, zout, len)) return 0; zout = a->zout; } @@ -4464,6 +4484,7 @@ static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) if (!stbi__parse_zlib_header(a)) return 0; a->num_bits = 0; a->code_buffer = 0; + a->hit_zeof_once = 0; do { final = stbi__zreceive(a,1); type = stbi__zreceive(a,2); @@ -4619,9 +4640,8 @@ enum { STBI__F_up=2, STBI__F_avg=3, STBI__F_paeth=4, - // synthetic filters used for first scanline to avoid needing a dummy row of 0s - STBI__F_avg_first, - STBI__F_paeth_first + // synthetic filter used for first scanline to avoid needing a dummy row of 0s + STBI__F_avg_first }; static stbi_uc first_row_filter[5] = @@ -4630,29 +4650,56 @@ static stbi_uc first_row_filter[5] = STBI__F_sub, STBI__F_none, STBI__F_avg_first, - STBI__F_paeth_first + STBI__F_sub // Paeth with b=c=0 turns out to be equivalent to sub }; static int stbi__paeth(int a, int b, int c) { - int p = a + b - c; - int pa = abs(p-a); - int pb = abs(p-b); - int pc = abs(p-c); - if (pa <= pb && pa <= pc) return a; - if (pb <= pc) return b; - return c; + // This formulation looks very different from the reference in the PNG spec, but is + // actually equivalent and has favorable data dependencies and admits straightforward + // generation of branch-free code, which helps performance significantly. + int thresh = c*3 - (a + b); + int lo = a < b ? a : b; + int hi = a < b ? b : a; + int t0 = (hi <= thresh) ? lo : c; + int t1 = (thresh <= lo) ? hi : t0; + return t1; } static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }; +// adds an extra all-255 alpha channel +// dest == src is legal +// img_n must be 1 or 3 +static void stbi__create_png_alpha_expand8(stbi_uc *dest, stbi_uc *src, stbi__uint32 x, int img_n) +{ + int i; + // must process data backwards since we allow dest==src + if (img_n == 1) { + for (i=x-1; i >= 0; --i) { + dest[i*2+1] = 255; + dest[i*2+0] = src[i]; + } + } else { + STBI_ASSERT(img_n == 3); + for (i=x-1; i >= 0; --i) { + dest[i*4+3] = 255; + dest[i*4+2] = src[i*3+2]; + dest[i*4+1] = src[i*3+1]; + dest[i*4+0] = src[i*3+0]; + } + } +} + // create the png data from post-deflated data static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) { - int bytes = (depth == 16? 2 : 1); + int bytes = (depth == 16 ? 2 : 1); stbi__context *s = a->s; stbi__uint32 i,j,stride = x*out_n*bytes; stbi__uint32 img_len, img_width_bytes; + stbi_uc *filter_buf; + int all_ok = 1; int k; int img_n = s->img_n; // copy it into a local for later @@ -4664,8 +4711,11 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into if (!a->out) return stbi__err("outofmem", "Out of memory"); + // note: error exits here don't need to clean up a->out individually, + // stbi__do_png always does on error. if (!stbi__mad3sizes_valid(img_n, x, depth, 7)) return stbi__err("too large", "Corrupt PNG"); img_width_bytes = (((img_n * x * depth) + 7) >> 3); + if (!stbi__mad2sizes_valid(img_width_bytes, y, img_width_bytes)) return stbi__err("too large", "Corrupt PNG"); img_len = (img_width_bytes + 1) * y; // we used to check for exact match between raw_len and img_len on non-interlaced PNGs, @@ -4673,189 +4723,137 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r // so just check for raw_len < img_len always. if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG"); + // Allocate two scan lines worth of filter workspace buffer. + filter_buf = (stbi_uc *) stbi__malloc_mad2(img_width_bytes, 2, 0); + if (!filter_buf) return stbi__err("outofmem", "Out of memory"); + + // Filtering for low-bit-depth images + if (depth < 8) { + filter_bytes = 1; + width = img_width_bytes; + } + for (j=0; j < y; ++j) { - stbi_uc *cur = a->out + stride*j; - stbi_uc *prior; + // cur/prior filter buffers alternate + stbi_uc *cur = filter_buf + (j & 1)*img_width_bytes; + stbi_uc *prior = filter_buf + (~j & 1)*img_width_bytes; + stbi_uc *dest = a->out + stride*j; + int nk = width * filter_bytes; int filter = *raw++; - if (filter > 4) - return stbi__err("invalid filter","Corrupt PNG"); - - if (depth < 8) { - if (img_width_bytes > x) return stbi__err("invalid width","Corrupt PNG"); - cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place - filter_bytes = 1; - width = img_width_bytes; + // check filter type + if (filter > 4) { + all_ok = stbi__err("invalid filter","Corrupt PNG"); + break; } - prior = cur - stride; // bugfix: need to compute this after 'cur +=' computation above // if first row, use special filter that doesn't sample previous row if (j == 0) filter = first_row_filter[filter]; - // handle first byte explicitly - for (k=0; k < filter_bytes; ++k) { - switch (filter) { - case STBI__F_none : cur[k] = raw[k]; break; - case STBI__F_sub : cur[k] = raw[k]; break; - case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break; - case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break; - case STBI__F_avg_first : cur[k] = raw[k]; break; - case STBI__F_paeth_first: cur[k] = raw[k]; break; - } - } - - if (depth == 8) { - if (img_n != out_n) - cur[img_n] = 255; // first pixel - raw += img_n; - cur += out_n; - prior += out_n; - } else if (depth == 16) { - if (img_n != out_n) { - cur[filter_bytes] = 255; // first pixel top byte - cur[filter_bytes+1] = 255; // first pixel bottom byte - } - raw += filter_bytes; - cur += output_bytes; - prior += output_bytes; - } else { - raw += 1; - cur += 1; - prior += 1; + // perform actual filtering + switch (filter) { + case STBI__F_none: + memcpy(cur, raw, nk); + break; + case STBI__F_sub: + memcpy(cur, raw, filter_bytes); + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); + break; + case STBI__F_up: + for (k = 0; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); + break; + case STBI__F_avg: + for (k = 0; k < filter_bytes; ++k) + cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); + break; + case STBI__F_paeth: + for (k = 0; k < filter_bytes; ++k) + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); // prior[k] == stbi__paeth(0,prior[k],0) + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes], prior[k], prior[k-filter_bytes])); + break; + case STBI__F_avg_first: + memcpy(cur, raw, filter_bytes); + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); + break; } - // this is a little gross, so that we don't switch per-pixel or per-component - if (depth < 8 || img_n == out_n) { - int nk = (width - 1)*filter_bytes; - #define STBI__CASE(f) \ - case f: \ - for (k=0; k < nk; ++k) - switch (filter) { - // "none" filter turns into a memcpy here; make that explicit. - case STBI__F_none: memcpy(cur, raw, nk); break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); } break; - } - #undef STBI__CASE - raw += nk; - } else { - STBI_ASSERT(img_n+1 == out_n); - #define STBI__CASE(f) \ - case f: \ - for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \ - for (k=0; k < filter_bytes; ++k) - switch (filter) { - STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); } break; - } - #undef STBI__CASE - - // the loop above sets the high byte of the pixels' alpha, but for - // 16 bit png files we also need the low byte set. we'll do that here. - if (depth == 16) { - cur = a->out + stride*j; // start at the beginning of the row again - for (i=0; i < x; ++i,cur+=output_bytes) { - cur[filter_bytes+1] = 255; - } - } - } - } + raw += nk; - // we make a separate pass to expand bits to pixels; for performance, - // this could run two scanlines behind the above code, so it won't - // intefere with filtering but will still be in the cache. - if (depth < 8) { - for (j=0; j < y; ++j) { - stbi_uc *cur = a->out + stride*j; - stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes; - // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit - // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop + // expand decoded bits in cur to dest, also adding an extra alpha channel if desired + if (depth < 8) { stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range + stbi_uc *in = cur; + stbi_uc *out = dest; + stbi_uc inb = 0; + stbi__uint32 nsmp = x*img_n; - // note that the final byte might overshoot and write more data than desired. - // we can allocate enough data that this never writes out of memory, but it - // could also overwrite the next scanline. can it overwrite non-empty data - // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel. - // so we need to explicitly clamp the final ones - + // expand bits to bytes first if (depth == 4) { - for (k=x*img_n; k >= 2; k-=2, ++in) { - *cur++ = scale * ((*in >> 4) ); - *cur++ = scale * ((*in ) & 0x0f); + for (i=0; i < nsmp; ++i) { + if ((i & 1) == 0) inb = *in++; + *out++ = scale * (inb >> 4); + inb <<= 4; } - if (k > 0) *cur++ = scale * ((*in >> 4) ); } else if (depth == 2) { - for (k=x*img_n; k >= 4; k-=4, ++in) { - *cur++ = scale * ((*in >> 6) ); - *cur++ = scale * ((*in >> 4) & 0x03); - *cur++ = scale * ((*in >> 2) & 0x03); - *cur++ = scale * ((*in ) & 0x03); + for (i=0; i < nsmp; ++i) { + if ((i & 3) == 0) inb = *in++; + *out++ = scale * (inb >> 6); + inb <<= 2; } - if (k > 0) *cur++ = scale * ((*in >> 6) ); - if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03); - if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03); - } else if (depth == 1) { - for (k=x*img_n; k >= 8; k-=8, ++in) { - *cur++ = scale * ((*in >> 7) ); - *cur++ = scale * ((*in >> 6) & 0x01); - *cur++ = scale * ((*in >> 5) & 0x01); - *cur++ = scale * ((*in >> 4) & 0x01); - *cur++ = scale * ((*in >> 3) & 0x01); - *cur++ = scale * ((*in >> 2) & 0x01); - *cur++ = scale * ((*in >> 1) & 0x01); - *cur++ = scale * ((*in ) & 0x01); + } else { + STBI_ASSERT(depth == 1); + for (i=0; i < nsmp; ++i) { + if ((i & 7) == 0) inb = *in++; + *out++ = scale * (inb >> 7); + inb <<= 1; } - if (k > 0) *cur++ = scale * ((*in >> 7) ); - if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01); - if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01); - if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01); - if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01); - if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01); - if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01); } - if (img_n != out_n) { - int q; - // insert alpha = 255 - cur = a->out + stride*j; + + // insert alpha=255 values if desired + if (img_n != out_n) + stbi__create_png_alpha_expand8(dest, dest, x, img_n); + } else if (depth == 8) { + if (img_n == out_n) + memcpy(dest, cur, x*img_n); + else + stbi__create_png_alpha_expand8(dest, cur, x, img_n); + } else if (depth == 16) { + // convert the image data from big-endian to platform-native + stbi__uint16 *dest16 = (stbi__uint16*)dest; + stbi__uint32 nsmp = x*img_n; + + if (img_n == out_n) { + for (i = 0; i < nsmp; ++i, ++dest16, cur += 2) + *dest16 = (cur[0] << 8) | cur[1]; + } else { + STBI_ASSERT(img_n+1 == out_n); if (img_n == 1) { - for (q=x-1; q >= 0; --q) { - cur[q*2+1] = 255; - cur[q*2+0] = cur[q]; + for (i = 0; i < x; ++i, dest16 += 2, cur += 2) { + dest16[0] = (cur[0] << 8) | cur[1]; + dest16[1] = 0xffff; } } else { STBI_ASSERT(img_n == 3); - for (q=x-1; q >= 0; --q) { - cur[q*4+3] = 255; - cur[q*4+2] = cur[q*3+2]; - cur[q*4+1] = cur[q*3+1]; - cur[q*4+0] = cur[q*3+0]; + for (i = 0; i < x; ++i, dest16 += 4, cur += 6) { + dest16[0] = (cur[0] << 8) | cur[1]; + dest16[1] = (cur[2] << 8) | cur[3]; + dest16[2] = (cur[4] << 8) | cur[5]; + dest16[3] = 0xffff; } } } } - } else if (depth == 16) { - // force the image data from big-endian to platform-native. - // this is done in a separate pass due to the decoding relying - // on the data being untouched, but could probably be done - // per-line during decode if care is taken. - stbi_uc *cur = a->out; - stbi__uint16 *cur16 = (stbi__uint16*)cur; - - for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) { - *cur16 = (cur[0] << 8) | cur[1]; - } } + STBI_FREE(filter_buf); + if (!all_ok) return 0; + return 1; } diff --git a/bimg/3rdparty/stb/stb_image_resize.h b/bimg/3rdparty/stb/stb_image_resize.h index 42a8efb1..ef9e6fe8 100644 --- a/bimg/3rdparty/stb/stb_image_resize.h +++ b/bimg/3rdparty/stb/stb_image_resize.h @@ -1,4 +1,4 @@ -/* stb_image_resize - v0.96 - public domain image resizing +/* stb_image_resize - v0.97 - public domain image resizing by Jorge L Rodriguez (@VinoBS) - 2014 http://github.com/nothings/stb @@ -1064,7 +1064,11 @@ static void stbir__calculate_coefficients_upsample(stbir_filter filter, float sc total_filter += coefficient_group[i]; } - STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0); + // NOTE(fg): Not actually true in general, nor is there any reason to expect it should be. + // It would be true in exact math but is at best approximately true in floating-point math, + // and it would not make sense to try and put actual bounds on this here because it depends + // on the image aspect ratio which can get pretty extreme. + //STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0); STBIR_ASSERT(total_filter > 0.9); STBIR_ASSERT(total_filter < 1.1f); // Make sure it's not way off. @@ -1089,7 +1093,7 @@ static void stbir__calculate_coefficients_downsample(stbir_filter filter, float { int i; - STBIR_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. + STBIR_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. contributor->n0 = out_first_pixel; contributor->n1 = out_last_pixel; @@ -1103,7 +1107,11 @@ static void stbir__calculate_coefficients_downsample(stbir_filter filter, float coefficient_group[i] = stbir__filter_info_table[filter].kernel(x, scale_ratio) * scale_ratio; } - STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0); + // NOTE(fg): Not actually true in general, nor is there any reason to expect it should be. + // It would be true in exact math but is at best approximately true in floating-point math, + // and it would not make sense to try and put actual bounds on this here because it depends + // on the image aspect ratio which can get pretty extreme. + //STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0); for (i = out_last_pixel - out_first_pixel; i >= 0; i--) { @@ -1552,7 +1560,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float { int out_pixel_index = k * 1; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; } } @@ -1573,7 +1580,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float { int out_pixel_index = k * 2; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; } @@ -1595,7 +1601,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float { int out_pixel_index = k * 3; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; @@ -1618,7 +1623,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float { int out_pixel_index = k * 4; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; @@ -1643,7 +1647,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float int c; int out_pixel_index = k * channels; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); for (c = 0; c < channels; c++) output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; } diff --git a/bimg/LICENSE b/bimg/LICENSE index f8393b90..0edd62e9 100644 --- a/bimg/LICENSE +++ b/bimg/LICENSE @@ -1,4 +1,4 @@ -Copyright 2010-2023 Branimir Karadzic +Copyright 2010-2024 Branimir Karadzic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/bimg/README.md b/bimg/README.md index 4cf9c15f..debdbebc 100644 --- a/bimg/README.md +++ b/bimg/README.md @@ -21,7 +21,7 @@ https://github.com/bkaradzic/bimg - Copyright 2010-2023 Branimir Karadzic + Copyright 2010-2024 Branimir Karadzic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/bimg/include/bimg/bimg.h b/bimg/include/bimg/bimg.h index 91ed4e03..e0508c8e 100644 --- a/bimg/include/bimg/bimg.h +++ b/bimg/include/bimg/bimg.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ diff --git a/bimg/include/bimg/decode.h b/bimg/include/bimg/decode.h index 3f224318..384003ac 100644 --- a/bimg/include/bimg/decode.h +++ b/bimg/include/bimg/decode.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ diff --git a/bimg/include/bimg/encode.h b/bimg/include/bimg/encode.h index ba0cf75c..1e22b8da 100644 --- a/bimg/include/bimg/encode.h +++ b/bimg/include/bimg/encode.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ diff --git a/bimg/makefile b/bimg/makefile deleted file mode 100644 index 4f760814..00000000 --- a/bimg/makefile +++ /dev/null @@ -1,306 +0,0 @@ -# -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. -# License: https://github.com/bkaradzic/bimg/blob/master/LICENSE -# - -UNAME := $(shell uname) -ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin FreeBSD GNU/kFreeBSD)) -ifeq ($(UNAME),$(filter $(UNAME),Darwin)) -OS=darwin -else -ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD)) -OS=bsd -else -OS=linux -endif -endif -else -OS=windows - -help: projgen - -endif - -# $(info $(OS)) - -BX_DIR?=../bx -GENIE?=$(BX_DIR)/tools/bin/$(OS)/genie -NINJA?=$(BX_DIR)/tools/bin/$(OS)/ninja - -.PHONY: help - -help: - @echo Available targets: - @grep -E "^[a-zA-Z0-9_-]+:.*?## .*$$" $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' - -clean: ## Clean all intermediate files. - @echo Cleaning... - -@rm -rf .build - @mkdir .build - -projgen: ## Generate project files for all configurations. - $(GENIE) --with-tools vs2017 - $(GENIE) --with-tools --gcc=mingw-gcc gmake - $(GENIE) --with-tools --gcc=linux-gcc gmake - $(GENIE) --with-tools --gcc=osx-x64 gmake - $(GENIE) --with-tools --xcode=osx xcode8 - $(GENIE) --with-tools --xcode=ios xcode8 - $(GENIE) --gcc=freebsd gmake - $(GENIE) --gcc=android-arm gmake - $(GENIE) --gcc=android-arm64 gmake - $(GENIE) --gcc=android-x86 gmake - $(GENIE) --gcc=wasm2js gmake - $(GENIE) --gcc=wasm gmake - $(GENIE) --gcc=ios-arm gmake - $(GENIE) --gcc=ios-arm64 gmake - $(GENIE) --gcc=ios-simulator gmake - $(GENIE) --gcc=ios-simulator64 gmake - $(GENIE) --gcc=rpi gmake - -.build/projects/gmake-android-arm: - $(GENIE) --gcc=android-arm gmake -android-arm-debug: .build/projects/gmake-android-arm ## Build - Android ARM Debug - $(MAKE) -R -C .build/projects/gmake-android-arm config=debug -android-arm-release: .build/projects/gmake-android-arm ## Build - Android ARM Release - $(MAKE) -R -C .build/projects/gmake-android-arm config=release -android-arm: android-arm-debug android-arm-release ## Build - Android ARM Debug and Release - -.build/projects/gmake-android-arm64: - $(GENIE) --gcc=android-arm64 gmake -android-arm64-debug: .build/projects/gmake-android-arm64 ## Build - Android ARM64 Debug - $(MAKE) -R -C .build/projects/gmake-android-arm64 config=debug -android-arm64-release: .build/projects/gmake-android-arm64 ## Build - Android ARM64 Release - $(MAKE) -R -C .build/projects/gmake-android-arm64 config=release -android-arm64: android-arm64-debug android-arm64-release ## Build - Android ARM64 Debug and Release - -.build/projects/gmake-android-x86: - $(GENIE) --gcc=android-x86 gmake -android-x86-debug: .build/projects/gmake-android-x86 ## Build - Android x86 Debug and Release - $(MAKE) -R -C .build/projects/gmake-android-x86 config=debug -android-x86-release: .build/projects/gmake-android-x86 ## Build - Android x86 Debug and Release - $(MAKE) -R -C .build/projects/gmake-android-x86 config=release -android-x86: android-x86-debug android-x86-release ## Build - Android x86 Debug and Release - -.build/projects/gmake-wasm2js: - $(GENIE) --gcc=wasm2js gmake -wasm2js-debug: .build/projects/gmake-wasm2js ## Build - Emscripten Debug - $(MAKE) -R -C .build/projects/gmake-wasm2js config=debug -wasm2js-release: .build/projects/gmake-wasm2js ## Build - Emscripten Release - $(MAKE) -R -C .build/projects/gmake-wasm2js config=release -wasm2js: wasm2js-debug wasm2js-release ## Build - Emscripten Debug and Release - -.build/projects/gmake-wasm: - $(GENIE) --gcc=wasm gmake -wasm-debug: .build/projects/gmake-wasm ## Build - Emscripten Debug - $(MAKE) -R -C .build/projects/gmake-wasm config=debug -wasm-release: .build/projects/gmake-wasm ## Build - Emscripten Release - $(MAKE) -R -C .build/projects/gmake-wasm config=release -wasm: wasm-debug wasm-release ## Build - Emscripten Debug and Release - -.build/projects/gmake-linux: - $(GENIE) --with-tools --gcc=linux-gcc gmake -linux-debug64: .build/projects/gmake-linux ## Build - Linux x64 Debug - $(MAKE) -R -C .build/projects/gmake-linux config=debug64 -linux-release64: .build/projects/gmake-linux ## Build - Linux x64 Release - $(MAKE) -R -C .build/projects/gmake-linux config=release64 -linux: linux-debug64 linux-release64 ## Build - Linux x64 Debug and Release - -.build/projects/gmake-freebsd: - $(GENIE) --with-tools --gcc=freebsd gmake -freebsd-debug32: .build/projects/gmake-freebsd ## Build - FreeBSD x86 Debug - $(MAKE) -R -C .build/projects/gmake-freebsd config=debug32 -freebsd-release32: .build/projects/gmake-freebsd ## Build - FreeBSD x86 Release - $(MAKE) -R -C .build/projects/gmake-freebsd config=release32 -freebsd-debug64: .build/projects/gmake-freebsd ## Build - FreeBSD x86 Debug - $(MAKE) -R -C .build/projects/gmake-freebsd config=debug64 -freebsd-release64: .build/projects/gmake-freebsd ## Build - FreeBSD x86 Release - $(MAKE) -R -C .build/projects/gmake-freebsd config=release64 -freebsd: freebsd-debug32 freebsd-release32 freebsd-debug64 freebsd-release64 ## Build - FreeBSD x86/x64 Debug and Release - -.build/projects/gmake-mingw-gcc: - $(GENIE) --with-tools --gcc=mingw-gcc gmake -mingw-gcc-debug32: .build/projects/gmake-mingw-gcc ## Build - MinGW GCC x86 Debug - $(MAKE) -R -C .build/projects/gmake-mingw-gcc config=debug32 -mingw-gcc-release32: .build/projects/gmake-mingw-gcc ## Build - MinGW GCC x86 Release - $(MAKE) -R -C .build/projects/gmake-mingw-gcc config=release32 -mingw-gcc-debug64: .build/projects/gmake-mingw-gcc ## Build - MinGW GCC x64 Debug - $(MAKE) -R -C .build/projects/gmake-mingw-gcc config=debug64 -mingw-gcc-release64: .build/projects/gmake-mingw-gcc ## Build - MinGW GCC x64 Release - $(MAKE) -R -C .build/projects/gmake-mingw-gcc config=release64 -mingw-gcc: mingw-gcc-debug32 mingw-gcc-release32 mingw-gcc-debug64 mingw-gcc-release64 ## Build - MinGW GCC x86/x64 Debug and Release - -.build/projects/gmake-mingw-clang: - $(GENIE) --gcc=mingw-clang gmake -mingw-clang-debug32: .build/projects/gmake-mingw-clang ## Build - MinGW Clang x86 Debug - $(MAKE) -R -C .build/projects/gmake-mingw-clang config=debug32 -mingw-clang-release32: .build/projects/gmake-mingw-clang ## Build - MinGW Clang x86 Release - $(MAKE) -R -C .build/projects/gmake-mingw-clang config=release32 -mingw-clang-debug64: .build/projects/gmake-mingw-clang ## Build - MinGW Clang x64 Debug - $(MAKE) -R -C .build/projects/gmake-mingw-clang config=debug64 -mingw-clang-release64: .build/projects/gmake-mingw-clang ## Build - MinGW Clang x64 Release - $(MAKE) -R -C .build/projects/gmake-mingw-clang config=release64 -mingw-clang: mingw-clang-debug32 mingw-clang-release32 mingw-clang-debug64 mingw-clang-release64 ## Build - MinGW Clang x86/x64 Debug and Release - -.build/projects/vs2017: - $(GENIE) --with-tools vs2017 -vs2017-debug32: .build/projects/vs2017 ## Build - vs2017 x86 Debug - devenv .build/projects/vs2017/bimg.sln /Build "Debug|Win32" -vs2017-release32: .build/projects/vs2017 ## Build - vs2017 x86 Release - devenv .build/projects/vs2017/bimg.sln /Build "Release|Win32" -vs2017-debug64: .build/projects/vs2017 ## Build - vs2017 x64 Debug - devenv .build/projects/vs2017/bimg.sln /Build "Debug|x64" -vs2017-release64: .build/projects/vs2017 ## Build - vs2017 x64 Release - devenv .build/projects/vs2017/bimg.sln /Build "Release|x64" -vs2017: vs2017-debug32 vs2017-release32 vs2017-debug64 vs2017-release64 ## Build - vs2017 x86/x64 Debug and Release - -.build/projects/gmake-osx-x64: - $(GENIE) --gcc=osx-x64 gmake -osx-x64-debug: .build/projects/gmake-osx-x64 - make -C .build/projects/gmake-osx config=debug -osx-x64-release: .build/projects/gmake-osx-x64 - make -C .build/projects/gmake-osx config=release -osx-x64: osx-x64-debug osx-x64-release - -.build/projects/gmake-osx-arm64: - $(GENIE) --gcc=osx-arm64 gmake -osx-arm64-debug: .build/projects/gmake-osx-arm64 - make -C .build/projects/gmake-osx-arm64 config=debug -osx-arm64-release: .build/projects/gmake-osx-arm64 - make -C .build/projects/gmake-osx-arm64 config=release -osx-arm64: osx-arm64-debug osx-arm64-release - -.build/projects/gmake-ios-arm: - $(GENIE) --gcc=ios-arm gmake -ios-arm-debug: .build/projects/gmake-ios-arm ## Build - iOS ARM Debug - $(MAKE) -R -C .build/projects/gmake-ios-arm config=debug -ios-arm-release: .build/projects/gmake-ios-arm ## Build - iOS ARM Release - $(MAKE) -R -C .build/projects/gmake-ios-arm config=release -ios-arm: ios-arm-debug ios-arm-release ## Build - iOS ARM Debug and Release - -.build/projects/gmake-ios-arm64: - $(GENIE) --gcc=ios-arm64 gmake -ios-arm64-debug: .build/projects/gmake-ios-arm64 ## Build - iOS ARM64 Debug - $(MAKE) -R -C .build/projects/gmake-ios-arm64 config=debug -ios-arm64-release: .build/projects/gmake-ios-arm64 ## Build - iOS ARM64 Release - $(MAKE) -R -C .build/projects/gmake-ios-arm64 config=release -ios-arm64: ios-arm64-debug ios-arm64-release ## Build - iOS ARM64 Debug and Release - -.build/projects/gmake-ios-simulator: - $(GENIE) --gcc=ios-simulator gmake -ios-simulator-debug: .build/projects/gmake-ios-simulator ## Build - iOS Simulator Debug - $(MAKE) -R -C .build/projects/gmake-ios-simulator config=debug -ios-simulator-release: .build/projects/gmake-ios-simulator ## Build - iOS Simulator Release - $(MAKE) -R -C .build/projects/gmake-ios-simulator config=release -ios-simulator: ios-simulator-debug ios-simulator-release ## Build - iOS Simulator Debug and Release - -.build/projects/gmake-ios-simulator64: - $(GENIE) --gcc=ios-simulator64 gmake -ios-simulator64-debug: .build/projects/gmake-ios-simulator64 ## Build - iOS Simulator 64 Debug - $(MAKE) -R -C .build/projects/gmake-ios-simulator64 config=debug -ios-simulator64-release: .build/projects/gmake-ios-simulator64 ## Build - iOS Simulator 64 Release - $(MAKE) -R -C .build/projects/gmake-ios-simulator64 config=release -ios-simulator64: ios-simulator64-debug ios-simulator64-release ## Build - iOS Simulator 64 Debug and Release - -.build/projects/gmake-rpi: - $(GENIE) --gcc=rpi gmake -rpi-debug: .build/projects/gmake-rpi ## Build - RasberryPi Debug - $(MAKE) -R -C .build/projects/gmake-rpi config=debug -rpi-release: .build/projects/gmake-rpi ## Build - RasberryPi Release - $(MAKE) -R -C .build/projects/gmake-rpi config=release -rpi: rpi-debug rpi-release ## Build - RasberryPi Debug and Release - -build-darwin: osx-x64 - -build-linux: linux-debug64 linux-release64 - -build-windows: mingw-gcc - -build: build-$(OS) - -rebuild-shaders: - $(MAKE) -R -C examples rebuild - -assets: # Build assets. - $(NINJA) -C scripts - -analyze: - cppcheck src/ - cppcheck examples/ - -docs: - doxygen scripts/bimg.doxygen - markdown README.md > .build/docs/readme.html - -### - -SILENT ?= @ - -UNAME := $(shell uname) -ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin FreeBSD GNU/kFreeBSD)) -ifeq ($(UNAME),$(filter $(UNAME),Darwin)) -OS=darwin -BUILD_PROJECT_DIR=gmake-osx-x64 -BUILD_OUTPUT_DIR=osx-x64 -BUILD_TOOLS_CONFIG=release -BUILD_TOOLS_SUFFIX=Release -EXE= -else -ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD)) -OS=bsd -BUILD_PROJECT_DIR=gmake-freebsd -BUILD_OUTPUT_DIR=freebsd64_gcc -BUILD_TOOLS_CONFIG=release64 -BUILD_TOOLS_SUFFIX=Release -EXE= -else -OS=linux -BUILD_PROJECT_DIR=gmake-linux -BUILD_OUTPUT_DIR=linux64_gcc -BUILD_TOOLS_CONFIG=release64 -BUILD_TOOLS_SUFFIX=Release -EXE= -endif -endif -else -OS=windows -BUILD_PROJECT_DIR=gmake-mingw-gcc -BUILD_OUTPUT_DIR=win64_mingw-gcc -BUILD_TOOLS_CONFIG=release64 -BUILD_TOOLS_SUFFIX=Release -EXE=.exe -endif - -geometryc: .build/projects/$(BUILD_PROJECT_DIR) ## Build geometryc tool. - $(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) geometryc config=$(BUILD_TOOLS_CONFIG) - $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/geometryc$(BUILD_TOOLS_SUFFIX)$(EXE) tools/bin/$(OS)/geometryc$(EXE) - -shaderc: .build/projects/$(BUILD_PROJECT_DIR) ## Build shaderc tool. - $(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) shaderc config=$(BUILD_TOOLS_CONFIG) - $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/shaderc$(BUILD_TOOLS_SUFFIX)$(EXE) tools/bin/$(OS)/shaderc$(EXE) - -texturec: .build/projects/$(BUILD_PROJECT_DIR) ## Build texturec tool. - $(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) texturec config=$(BUILD_TOOLS_CONFIG) - $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/texturec$(BUILD_TOOLS_SUFFIX)$(EXE) tools/bin/$(OS)/texturec$(EXE) - -texturev: .build/projects/$(BUILD_PROJECT_DIR) ## Build texturev tool. - $(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) texturev config=$(BUILD_TOOLS_CONFIG) - $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/texturev$(BUILD_TOOLS_SUFFIX)$(EXE) tools/bin/$(OS)/texturev$(EXE) - -tools: texturec ## Build tools. - -clean-tools: ## Clean tools projects. - -$(SILENT) rm -r .build/projects/$(BUILD_PROJECT_DIR) - -dist-windows: .build/projects/gmake-mingw-gcc - $(SILENT) $(MAKE) -C .build/projects/gmake-mingw-gcc config=release64 -j 6 texturec - $(SILENT) cp .build/win64_mingw-gcc/bin/texturecRelease.exe tools/bin/windows/texturec.exe - -dist-linux: .build/projects/gmake-linux - $(SILENT) $(MAKE) -C .build/projects/gmake-linux config=release64 -j 6 texturec - $(SILENT) cp .build/linux64_gcc/bin/texturecRelease tools/bin/linux/texturec - -dist-darwin: .build/projects/gmake-osx-x64 - $(SILENT) $(MAKE) -C .build/projects/gmake-osx-x64 config=release -j 6 texturec - $(SILENT) cp .build/osx-x64/bin/texturecRelease tools/bin/darwin/texturec - -dist: clean dist-windows dist-linux dist-darwin diff --git a/bimg/scripts/bimg.lua b/bimg/scripts/bimg.lua index 7420b6ad..2acafcd7 100644 --- a/bimg/scripts/bimg.lua +++ b/bimg/scripts/bimg.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bx#license-bsd-2-clause -- @@ -9,7 +9,6 @@ project "bimg" includedirs { path.join(BIMG_DIR, "include"), path.join(BIMG_DIR, "3rdparty/astc-encoder/include"), - path.join(BIMG_DIR, "3rdparty/tinyexr/deps/miniz"), } files { @@ -19,8 +18,6 @@ project "bimg" path.join(BIMG_DIR, "3rdparty/astc-encoder/source/**.cpp"), path.join(BIMG_DIR, "3rdparty/astc-encoder/source/**.h"), - - path.join(BIMG_DIR, "3rdparty/tinyexr/deps/miniz/miniz.*"), } using_bx() diff --git a/bimg/scripts/bimg_decode.lua b/bimg/scripts/bimg_decode.lua index cd309b9e..679a31c5 100644 --- a/bimg/scripts/bimg_decode.lua +++ b/bimg/scripts/bimg_decode.lua @@ -1,8 +1,18 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bx#license-bsd-2-clause -- +if _OPTIONS["with-libheif"] then + print('\n') + print('\tWARNING!') + print('') + print('\t*** LICENSE INCOMPATIBILITY WARNING!') + print('\t*** LibHeif is licensed under LGPL! See:') + print('\t*** https://github.com/strukturag/libheif/blob/master/COPYING') + print('\n') +end + project "bimg_decode" kind "StaticLib" @@ -15,8 +25,15 @@ project "bimg_decode" files { path.join(BIMG_DIR, "include/**"), path.join(BIMG_DIR, "src/image_decode.*"), + path.join(BIMG_DIR, "3rdparty/tinyexr/deps/miniz/miniz.*"), } + if _OPTIONS["with-libheif"] then + defines { + "BIMG_DECODE_HEIF=1", + } + end + using_bx() configuration { "linux-*" } diff --git a/bimg/scripts/bimg_encode.lua b/bimg/scripts/bimg_encode.lua index 5deb31cb..765e7977 100644 --- a/bimg/scripts/bimg_encode.lua +++ b/bimg/scripts/bimg_encode.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bx#license-bsd-2-clause -- diff --git a/bimg/scripts/genie.lua b/bimg/scripts/genie.lua index 586b686a..d0456ec1 100644 --- a/bimg/scripts/genie.lua +++ b/bimg/scripts/genie.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bimg/blob/master/LICENSE -- @@ -18,6 +18,11 @@ newoption { description = "Enable building tools.", } +newoption { + trigger = "with-libheif", + description = "Enable building with libheif HEIF and AVIF file format decoder.", +} + solution "bimg" configurations { "Debug", diff --git a/bimg/scripts/texturec.lua b/bimg/scripts/texturec.lua index b33d4835..f9ef5c6b 100644 --- a/bimg/scripts/texturec.lua +++ b/bimg/scripts/texturec.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bimg/blob/master/LICENSE -- @@ -21,6 +21,14 @@ project "texturec" "bimg", } + if _OPTIONS["with-libheif"] then + links { + "heif", + } + + configuration {} + end + using_bx() configuration { "mingw-*" } diff --git a/bimg/src/bimg_p.h b/bimg/src/bimg_p.h index 5b9a42ab..c7667af0 100644 --- a/bimg/src/bimg_p.h +++ b/bimg/src/bimg_p.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ @@ -31,13 +31,13 @@ } \ BX_MACRO_BLOCK_END -#define _BIMG_ASSERT(_condition, _format, ...) \ - BX_MACRO_BLOCK_BEGIN \ - if (!BX_IGNORE_C4127(_condition) ) \ - { \ - BX_TRACE("ASSERT " _format, ##__VA_ARGS__); \ - bx::debugBreak(); \ - } \ +#define _BIMG_ASSERT(_condition, _format, ...) \ + BX_MACRO_BLOCK_BEGIN \ + if (!BX_IGNORE_C4127(_condition) \ + && bx::assertFunction(bx::Location::current(), "ASSERT " #_condition " -> " _format, ##__VA_ARGS__) ) \ + { \ + bx::debugBreak(); \ + } \ BX_MACRO_BLOCK_END #include @@ -85,7 +85,7 @@ namespace bimg if (_hasMips) { const uint32_t max = bx::max(_width, _height, _depth); - const uint32_t num = 1 + uint32_t(bx::log2((int32_t)max) ); + const uint32_t num = 1 + bx::floorLog2(max); return uint8_t(num); } diff --git a/bimg/src/config.h b/bimg/src/config.h index f67258bc..91cb4812 100644 --- a/bimg/src/config.h +++ b/bimg/src/config.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ @@ -56,4 +56,8 @@ # define BIMG_DECODE_ETC2 BIMG_DECODE_ENABLE #endif // BIMG_DECODE_ETC2 +#ifndef BIMG_DECODE_HEIF +# define BIMG_DECODE_HEIF 0 +#endif // BIMG_DECODE_HEIF + #endif // BIMG_CONFIG_H_HEADER_GUARD diff --git a/bimg/src/image.cpp b/bimg/src/image.cpp index e70b274e..6fd87eef 100644 --- a/bimg/src/image.cpp +++ b/bimg/src/image.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ @@ -122,7 +122,7 @@ namespace bimg { 32, 1, 1, 4, 1, 1, 32, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Float) }, // D32F { 8, 1, 1, 1, 1, 1, 0, 8, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // D0S8 }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_imageBlockInfo) ); + static_assert(TextureFormat::Count == BX_COUNTOF(s_imageBlockInfo) ); static const char* s_textureFormatName[] = { @@ -223,7 +223,7 @@ namespace bimg "D32F", // D32F "D0S8", // D0S8 }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormatName) ); + static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormatName) ); bool isCompressed(TextureFormat::Enum _format) { @@ -1156,7 +1156,7 @@ namespace bimg { bx::packR32F, bx::unpackR32F }, // D32F { bx::packR8, bx::unpackR8 }, // D0S8 }; - BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_packUnpack) ); + static_assert(TextureFormat::Count == BX_COUNTOF(s_packUnpack) ); PackFn getPack(TextureFormat::Enum _format) { @@ -3348,6 +3348,7 @@ namespace bimg #define DDS_BC4U BX_MAKEFOURCC('B', 'C', '4', 'U') #define DDS_ATI2 BX_MAKEFOURCC('A', 'T', 'I', '2') #define DDS_BC5U BX_MAKEFOURCC('B', 'C', '5', 'U') +#define DDS_RXGB BX_MAKEFOURCC('R', 'X', 'G', 'B') #define DDS_DX10 BX_MAKEFOURCC('D', 'X', '1', '0') #define DDS_ETC1 BX_MAKEFOURCC('E', 'T', 'C', '1') @@ -3390,42 +3391,73 @@ namespace bimg #define DDS_G32R32F 115 #define DDS_A32B32G32R32F 116 -#define DDS_FORMAT_R32G32B32A32_FLOAT 2 -#define DDS_FORMAT_R32G32B32A32_UINT 3 -#define DDS_FORMAT_R16G16B16A16_FLOAT 10 -#define DDS_FORMAT_R16G16B16A16_UNORM 11 -#define DDS_FORMAT_R16G16B16A16_UINT 12 -#define DDS_FORMAT_R32G32_FLOAT 16 -#define DDS_FORMAT_R32G32_UINT 17 -#define DDS_FORMAT_R10G10B10A2_UNORM 24 -#define DDS_FORMAT_R11G11B10_FLOAT 26 -#define DDS_FORMAT_R8G8B8A8_UNORM 28 -#define DDS_FORMAT_R8G8B8A8_UNORM_SRGB 29 -#define DDS_FORMAT_R16G16_FLOAT 34 -#define DDS_FORMAT_R16G16_UNORM 35 -#define DDS_FORMAT_R32_FLOAT 41 -#define DDS_FORMAT_R32_UINT 42 -#define DDS_FORMAT_R8G8_UNORM 49 -#define DDS_FORMAT_R16_FLOAT 54 -#define DDS_FORMAT_R16_UNORM 56 -#define DDS_FORMAT_R8_UNORM 61 -#define DDS_FORMAT_R1_UNORM 66 -#define DDS_FORMAT_BC1_UNORM 71 -#define DDS_FORMAT_BC1_UNORM_SRGB 72 -#define DDS_FORMAT_BC2_UNORM 74 -#define DDS_FORMAT_BC2_UNORM_SRGB 75 -#define DDS_FORMAT_BC3_UNORM 77 -#define DDS_FORMAT_BC3_UNORM_SRGB 78 -#define DDS_FORMAT_BC4_UNORM 80 -#define DDS_FORMAT_BC5_UNORM 83 -#define DDS_FORMAT_B5G6R5_UNORM 85 -#define DDS_FORMAT_B5G5R5A1_UNORM 86 -#define DDS_FORMAT_B8G8R8A8_UNORM 87 -#define DDS_FORMAT_B8G8R8A8_UNORM_SRGB 91 -#define DDS_FORMAT_BC6H_SF16 96 -#define DDS_FORMAT_BC7_UNORM 98 -#define DDS_FORMAT_BC7_UNORM_SRGB 99 -#define DDS_FORMAT_B4G4R4A4_UNORM 115 +#define DDS_FORMAT_R32G32B32A32_FLOAT 2 +#define DDS_FORMAT_R32G32B32A32_UINT 3 +#define DDS_FORMAT_R16G16B16A16_FLOAT 10 +#define DDS_FORMAT_R16G16B16A16_UNORM 11 +#define DDS_FORMAT_R16G16B16A16_UINT 12 +#define DDS_FORMAT_R32G32_FLOAT 16 +#define DDS_FORMAT_R32G32_UINT 17 +#define DDS_FORMAT_R10G10B10A2_UNORM 24 +#define DDS_FORMAT_R11G11B10_FLOAT 26 +#define DDS_FORMAT_R8G8B8A8_UNORM 28 +#define DDS_FORMAT_R8G8B8A8_UNORM_SRGB 29 +#define DDS_FORMAT_R16G16_FLOAT 34 +#define DDS_FORMAT_R16G16_UNORM 35 +#define DDS_FORMAT_R32_FLOAT 41 +#define DDS_FORMAT_R32_UINT 42 +#define DDS_FORMAT_R8G8_UNORM 49 +#define DDS_FORMAT_R16_FLOAT 54 +#define DDS_FORMAT_R16_UNORM 56 +#define DDS_FORMAT_R8_UNORM 61 +#define DDS_FORMAT_A8_UNORM 65 +#define DDS_FORMAT_R1_UNORM 66 +#define DDS_FORMAT_BC1_UNORM 71 +#define DDS_FORMAT_BC1_UNORM_SRGB 72 +#define DDS_FORMAT_BC2_UNORM 74 +#define DDS_FORMAT_BC2_UNORM_SRGB 75 +#define DDS_FORMAT_BC3_UNORM 77 +#define DDS_FORMAT_BC3_UNORM_SRGB 78 +#define DDS_FORMAT_BC4_UNORM 80 +#define DDS_FORMAT_BC5_UNORM 83 +#define DDS_FORMAT_B5G6R5_UNORM 85 +#define DDS_FORMAT_B5G5R5A1_UNORM 86 +#define DDS_FORMAT_B8G8R8A8_UNORM 87 +#define DDS_FORMAT_B8G8R8A8_UNORM_SRGB 91 +#define DDS_FORMAT_BC6H_UF16 95 +#define DDS_FORMAT_BC6H_SF16 96 +#define DDS_FORMAT_BC7_UNORM 98 +#define DDS_FORMAT_BC7_UNORM_SRGB 99 +#define DDS_FORMAT_B4G4R4A4_UNORM 115 +#define DDS_FORMAT_ASTC_4X4_UNORM 134 +#define DDS_FORMAT_ASTC_4X4_UNORM_SRGB 135 +#define DDS_FORMAT_ASTC_5X4_UNORM 138 +#define DDS_FORMAT_ASTC_5X4_UNORM_SRGB 139 +#define DDS_FORMAT_ASTC_5X5_UNORM 142 +#define DDS_FORMAT_ASTC_5X5_UNORM_SRGB 143 +#define DDS_FORMAT_ASTC_6X5_UNORM 146 +#define DDS_FORMAT_ASTC_6X5_UNORM_SRGB 147 +#define DDS_FORMAT_ASTC_6X6_UNORM 150 +#define DDS_FORMAT_ASTC_6X6_UNORM_SRGB 151 +#define DDS_FORMAT_ASTC_8X5_UNORM 154 +#define DDS_FORMAT_ASTC_8X5_UNORM_SRGB 155 +#define DDS_FORMAT_ASTC_8X6_UNORM 158 +#define DDS_FORMAT_ASTC_8X6_UNORM_SRGB 159 +#define DDS_FORMAT_ASTC_8X8_UNORM 162 +#define DDS_FORMAT_ASTC_8X8_UNORM_SRGB 163 +#define DDS_FORMAT_ASTC_10X5_UNORM 166 +#define DDS_FORMAT_ASTC_10X5_UNORM_SRGB 167 +#define DDS_FORMAT_ASTC_10X6_UNORM 170 +#define DDS_FORMAT_ASTC_10X6_UNORM_SRGB 171 +#define DDS_FORMAT_ASTC_10X8_UNORM 174 +#define DDS_FORMAT_ASTC_10X8_UNORM_SRGB 175 +#define DDS_FORMAT_ASTC_10X10_UNORM 178 +#define DDS_FORMAT_ASTC_10X10_UNORM_SRGB 179 +#define DDS_FORMAT_ASTC_12X10_UNORM 182 +#define DDS_FORMAT_ASTC_12X10_UNORM_SRGB 183 +#define DDS_FORMAT_ASTC_12X12_UNORM 186 +#define DDS_FORMAT_ASTC_12X12_UNORM_SRGB 187 + #define DDS_DX10_DIMENSION_TEXTURE2D 3 #define DDS_DX10_DIMENSION_TEXTURE3D 4 @@ -3480,107 +3512,137 @@ namespace bimg static const TranslateDdsFormat s_translateDdsFourccFormat[] = { - { DDS_DXT1, TextureFormat::BC1, false }, - { DDS_DXT2, TextureFormat::BC2, false }, - { DDS_DXT3, TextureFormat::BC2, false }, - { DDS_DXT4, TextureFormat::BC3, false }, - { DDS_DXT5, TextureFormat::BC3, false }, - { DDS_ATI1, TextureFormat::BC4, false }, - { DDS_BC4U, TextureFormat::BC4, false }, - { DDS_ATI2, TextureFormat::BC5, false }, - { DDS_BC5U, TextureFormat::BC5, false }, - - { DDS_ETC1, TextureFormat::ETC1, false }, - { DDS_ETC2, TextureFormat::ETC2, false }, - { DDS_ET2A, TextureFormat::ETC2A, false }, - { DDS_PTC2, TextureFormat::PTC12A, false }, - { DDS_PTC4, TextureFormat::PTC14A, false }, - { DDS_ATC , TextureFormat::ATC, false }, - { DDS_ATCE, TextureFormat::ATCE, false }, - { DDS_ATCI, TextureFormat::ATCI, false }, - { DDS_ASTC4x4, TextureFormat::ASTC4x4, false }, - { DDS_ASTC5x4, TextureFormat::ASTC5x4, false }, - { DDS_ASTC5x5, TextureFormat::ASTC5x5, false }, - { DDS_ASTC6x5, TextureFormat::ASTC6x5, false }, - { DDS_ASTC6x6, TextureFormat::ASTC6x6, false }, - { DDS_ASTC8x5, TextureFormat::ASTC8x5, false }, - { DDS_ASTC8x6, TextureFormat::ASTC8x6, false }, - { DDS_ASTC8x8, TextureFormat::ASTC8x8, false }, - { DDS_ASTC10x5, TextureFormat::ASTC10x5, false }, - { DDS_ASTC10x6, TextureFormat::ASTC10x6, false }, - { DDS_ASTC10x8, TextureFormat::ASTC10x8, false }, - { DDS_ASTC10x10, TextureFormat::ASTC10x10,false }, - { DDS_ASTC12x10, TextureFormat::ASTC12x10,false }, - { DDS_ASTC12x12, TextureFormat::ASTC12x12,false }, - - { DDS_A16B16G16R16, TextureFormat::RGBA16, false }, - { DDS_A16B16G16R16F, TextureFormat::RGBA16F, false }, - { DDPF_RGB|DDPF_ALPHAPIXELS, TextureFormat::BGRA8, false }, - { DDPF_INDEXED, TextureFormat::R8, false }, - { DDPF_LUMINANCE, TextureFormat::R8, false }, - { DDPF_ALPHA, TextureFormat::R8, false }, - { DDS_R16F, TextureFormat::R16F, false }, - { DDS_R32F, TextureFormat::R32F, false }, - { DDS_A8L8, TextureFormat::RG8, false }, - { DDS_G16R16, TextureFormat::RG16, false }, - { DDS_G16R16F, TextureFormat::RG16F, false }, - { DDS_G32R32F, TextureFormat::RG32F, false }, - { DDS_R8G8B8, TextureFormat::RGB8, false }, - { DDS_A8R8G8B8, TextureFormat::BGRA8, false }, - { DDS_A16B16G16R16, TextureFormat::RGBA16, false }, - { DDS_A16B16G16R16F, TextureFormat::RGBA16F, false }, - { DDS_A32B32G32R32F, TextureFormat::RGBA32F, false }, - { DDS_R5G6B5, TextureFormat::B5G6R5, false }, - { DDS_R5G6B5, TextureFormat::R5G6B5, false }, - { DDS_A4R4G4B4, TextureFormat::BGRA4, false }, - { DDS_A4R4G4B4, TextureFormat::RGBA4, false }, - { DDS_A1R5G5B5, TextureFormat::BGR5A1, false }, - { DDS_A1R5G5B5, TextureFormat::RGB5A1, false }, - { DDS_A2B10G10R10, TextureFormat::RGB10A2, false }, + { DDS_DXT1, TextureFormat::BC1, false }, + { DDS_DXT2, TextureFormat::BC2, false }, + { DDS_DXT3, TextureFormat::BC2, false }, + { DDS_DXT4, TextureFormat::BC3, false }, + { DDS_DXT5, TextureFormat::BC3, false }, + { DDS_ATI1, TextureFormat::BC4, false }, + { DDS_BC4U, TextureFormat::BC4, false }, + { DDS_ATI2, TextureFormat::BC5, false }, + { DDS_BC5U, TextureFormat::BC5, false }, + { DDS_RXGB, TextureFormat::BC5, false }, + + { DDS_ETC1, TextureFormat::ETC1, false }, + { DDS_ETC2, TextureFormat::ETC2, false }, + { DDS_ET2A, TextureFormat::ETC2A, false }, + { DDS_PTC2, TextureFormat::PTC12A, false }, + { DDS_PTC4, TextureFormat::PTC14A, false }, + { DDS_ATC , TextureFormat::ATC, false }, + { DDS_ATCE, TextureFormat::ATCE, false }, + { DDS_ATCI, TextureFormat::ATCI, false }, + { DDS_ASTC4x4, TextureFormat::ASTC4x4, false }, + { DDS_ASTC5x4, TextureFormat::ASTC5x4, false }, + { DDS_ASTC5x5, TextureFormat::ASTC5x5, false }, + { DDS_ASTC6x5, TextureFormat::ASTC6x5, false }, + { DDS_ASTC6x6, TextureFormat::ASTC6x6, false }, + { DDS_ASTC8x5, TextureFormat::ASTC8x5, false }, + { DDS_ASTC8x6, TextureFormat::ASTC8x6, false }, + { DDS_ASTC8x8, TextureFormat::ASTC8x8, false }, + { DDS_ASTC10x5, TextureFormat::ASTC10x5, false }, + { DDS_ASTC10x6, TextureFormat::ASTC10x6, false }, + { DDS_ASTC10x8, TextureFormat::ASTC10x8, false }, + { DDS_ASTC10x10, TextureFormat::ASTC10x10, false }, + { DDS_ASTC12x10, TextureFormat::ASTC12x10, false }, + { DDS_ASTC12x12, TextureFormat::ASTC12x12, false }, + + { DDS_A16B16G16R16, TextureFormat::RGBA16, false }, + { DDS_A16B16G16R16F, TextureFormat::RGBA16F, false }, + { DDPF_RGB|DDPF_ALPHAPIXELS, TextureFormat::BGRA8, false }, + { DDPF_INDEXED, TextureFormat::R8, false }, + { DDPF_LUMINANCE, TextureFormat::R8, false }, + { DDPF_ALPHA, TextureFormat::R8, false }, + { DDS_R16F, TextureFormat::R16F, false }, + { DDS_R32F, TextureFormat::R32F, false }, + { DDS_A8L8, TextureFormat::RG8, false }, + { DDS_G16R16, TextureFormat::RG16, false }, + { DDS_G16R16F, TextureFormat::RG16F, false }, + { DDS_G32R32F, TextureFormat::RG32F, false }, + { DDS_R8G8B8, TextureFormat::RGB8, false }, + { DDS_A8R8G8B8, TextureFormat::BGRA8, false }, + { DDS_A16B16G16R16, TextureFormat::RGBA16, false }, + { DDS_A16B16G16R16F, TextureFormat::RGBA16F, false }, + { DDS_A32B32G32R32F, TextureFormat::RGBA32F, false }, + { DDS_R5G6B5, TextureFormat::B5G6R5, false }, + { DDS_R5G6B5, TextureFormat::R5G6B5, false }, + { DDS_A4R4G4B4, TextureFormat::BGRA4, false }, + { DDS_A4R4G4B4, TextureFormat::RGBA4, false }, + { DDS_A1R5G5B5, TextureFormat::BGR5A1, false }, + { DDS_A1R5G5B5, TextureFormat::RGB5A1, false }, + { DDS_A2B10G10R10, TextureFormat::RGB10A2, false }, }; static const TranslateDdsFormat s_translateDxgiFormat[] = { - { DDS_FORMAT_BC1_UNORM, TextureFormat::BC1, false }, - { DDS_FORMAT_BC1_UNORM_SRGB, TextureFormat::BC1, true }, - { DDS_FORMAT_BC2_UNORM, TextureFormat::BC2, false }, - { DDS_FORMAT_BC2_UNORM_SRGB, TextureFormat::BC2, true }, - { DDS_FORMAT_BC3_UNORM, TextureFormat::BC3, false }, - { DDS_FORMAT_BC3_UNORM_SRGB, TextureFormat::BC3, true }, - { DDS_FORMAT_BC4_UNORM, TextureFormat::BC4, false }, - { DDS_FORMAT_BC5_UNORM, TextureFormat::BC5, false }, - { DDS_FORMAT_BC6H_SF16, TextureFormat::BC6H, false }, - { DDS_FORMAT_BC7_UNORM, TextureFormat::BC7, false }, - { DDS_FORMAT_BC7_UNORM_SRGB, TextureFormat::BC7, true }, - - { DDS_FORMAT_R1_UNORM, TextureFormat::R1, false }, - { DDS_FORMAT_R8_UNORM, TextureFormat::R8, false }, - { DDS_FORMAT_R16_UNORM, TextureFormat::R16, false }, - { DDS_FORMAT_R16_FLOAT, TextureFormat::R16F, false }, - { DDS_FORMAT_R32_UINT, TextureFormat::R32U, false }, - { DDS_FORMAT_R32_FLOAT, TextureFormat::R32F, false }, - { DDS_FORMAT_R8G8_UNORM, TextureFormat::RG8, false }, - { DDS_FORMAT_R16G16_UNORM, TextureFormat::RG16, false }, - { DDS_FORMAT_R16G16_FLOAT, TextureFormat::RG16F, false }, - { DDS_FORMAT_R32G32_UINT, TextureFormat::RG32U, false }, - { DDS_FORMAT_R32G32_FLOAT, TextureFormat::RG32F, false }, - { DDS_FORMAT_B8G8R8A8_UNORM, TextureFormat::BGRA8, false }, - { DDS_FORMAT_B8G8R8A8_UNORM_SRGB, TextureFormat::BGRA8, true }, - { DDS_FORMAT_R8G8B8A8_UNORM, TextureFormat::RGBA8, false }, - { DDS_FORMAT_R8G8B8A8_UNORM_SRGB, TextureFormat::RGBA8, true }, - { DDS_FORMAT_R16G16B16A16_UNORM, TextureFormat::RGBA16, false }, - { DDS_FORMAT_R16G16B16A16_FLOAT, TextureFormat::RGBA16F, false }, - { DDS_FORMAT_R32G32B32A32_UINT, TextureFormat::RGBA32U, false }, - { DDS_FORMAT_R32G32B32A32_FLOAT, TextureFormat::RGBA32F, false }, - { DDS_FORMAT_B5G6R5_UNORM, TextureFormat::B5G6R5, false }, - { DDS_FORMAT_B5G6R5_UNORM, TextureFormat::R5G6B5, false }, - { DDS_FORMAT_B4G4R4A4_UNORM, TextureFormat::BGRA4, false }, - { DDS_FORMAT_B4G4R4A4_UNORM, TextureFormat::RGBA4, false }, - { DDS_FORMAT_B5G5R5A1_UNORM, TextureFormat::BGR5A1, false }, - { DDS_FORMAT_B5G5R5A1_UNORM, TextureFormat::RGB5A1, false }, - { DDS_FORMAT_R10G10B10A2_UNORM, TextureFormat::RGB10A2, false }, - { DDS_FORMAT_R11G11B10_FLOAT, TextureFormat::RG11B10F, false }, + { DDS_FORMAT_BC1_UNORM, TextureFormat::BC1, false }, + { DDS_FORMAT_BC1_UNORM_SRGB, TextureFormat::BC1, true }, + { DDS_FORMAT_BC2_UNORM, TextureFormat::BC2, false }, + { DDS_FORMAT_BC2_UNORM_SRGB, TextureFormat::BC2, true }, + { DDS_FORMAT_BC3_UNORM, TextureFormat::BC3, false }, + { DDS_FORMAT_BC3_UNORM_SRGB, TextureFormat::BC3, true }, + { DDS_FORMAT_BC4_UNORM, TextureFormat::BC4, false }, + { DDS_FORMAT_BC5_UNORM, TextureFormat::BC5, false }, + { DDS_FORMAT_BC6H_UF16, TextureFormat::BC6H, false }, + { DDS_FORMAT_BC6H_SF16, TextureFormat::BC6H, false }, + { DDS_FORMAT_BC7_UNORM, TextureFormat::BC7, false }, + { DDS_FORMAT_BC7_UNORM_SRGB, TextureFormat::BC7, true }, + { DDS_FORMAT_ASTC_4X4_UNORM, TextureFormat::ASTC4x4, false }, + { DDS_FORMAT_ASTC_4X4_UNORM_SRGB, TextureFormat::ASTC4x4, true }, + { DDS_FORMAT_ASTC_5X4_UNORM, TextureFormat::ASTC5x4, false }, + { DDS_FORMAT_ASTC_5X4_UNORM_SRGB, TextureFormat::ASTC5x4, true }, + { DDS_FORMAT_ASTC_5X5_UNORM, TextureFormat::ASTC5x5, false }, + { DDS_FORMAT_ASTC_5X5_UNORM_SRGB, TextureFormat::ASTC5x5, true }, + { DDS_FORMAT_ASTC_6X5_UNORM, TextureFormat::ASTC6x5, false }, + { DDS_FORMAT_ASTC_6X5_UNORM_SRGB, TextureFormat::ASTC6x5, true }, + { DDS_FORMAT_ASTC_6X6_UNORM, TextureFormat::ASTC6x6, false }, + { DDS_FORMAT_ASTC_6X6_UNORM_SRGB, TextureFormat::ASTC6x6, true }, + { DDS_FORMAT_ASTC_8X5_UNORM, TextureFormat::ASTC8x5, false }, + { DDS_FORMAT_ASTC_8X5_UNORM_SRGB, TextureFormat::ASTC8x5, true }, + { DDS_FORMAT_ASTC_8X6_UNORM, TextureFormat::ASTC8x6, false }, + { DDS_FORMAT_ASTC_8X6_UNORM_SRGB, TextureFormat::ASTC8x6, true }, + { DDS_FORMAT_ASTC_8X8_UNORM, TextureFormat::ASTC8x8, false }, + { DDS_FORMAT_ASTC_8X8_UNORM_SRGB, TextureFormat::ASTC8x8, true }, + { DDS_FORMAT_ASTC_10X5_UNORM, TextureFormat::ASTC10x5, false }, + { DDS_FORMAT_ASTC_10X5_UNORM_SRGB, TextureFormat::ASTC10x5, true }, + { DDS_FORMAT_ASTC_10X6_UNORM, TextureFormat::ASTC10x6, false }, + { DDS_FORMAT_ASTC_10X6_UNORM_SRGB, TextureFormat::ASTC10x6, true }, + { DDS_FORMAT_ASTC_10X8_UNORM, TextureFormat::ASTC10x8, false }, + { DDS_FORMAT_ASTC_10X8_UNORM_SRGB, TextureFormat::ASTC10x8, true }, + { DDS_FORMAT_ASTC_10X10_UNORM, TextureFormat::ASTC10x10, false }, + { DDS_FORMAT_ASTC_10X10_UNORM_SRGB, TextureFormat::ASTC10x10, true }, + { DDS_FORMAT_ASTC_12X10_UNORM, TextureFormat::ASTC12x10, false }, + { DDS_FORMAT_ASTC_12X10_UNORM_SRGB, TextureFormat::ASTC12x10, true }, + { DDS_FORMAT_ASTC_12X12_UNORM, TextureFormat::ASTC12x12, false }, + + { DDS_FORMAT_R1_UNORM, TextureFormat::R1, false }, + { DDS_FORMAT_R8_UNORM, TextureFormat::R8, false }, + { DDS_FORMAT_A8_UNORM, TextureFormat::R8, false }, + { DDS_FORMAT_R16_UNORM, TextureFormat::R16, false }, + { DDS_FORMAT_R16_FLOAT, TextureFormat::R16F, false }, + { DDS_FORMAT_R32_UINT, TextureFormat::R32U, false }, + { DDS_FORMAT_R32_FLOAT, TextureFormat::R32F, false }, + { DDS_FORMAT_R8G8_UNORM, TextureFormat::RG8, false }, + { DDS_FORMAT_R16G16_UNORM, TextureFormat::RG16, false }, + { DDS_FORMAT_R16G16_FLOAT, TextureFormat::RG16F, false }, + { DDS_FORMAT_R32G32_UINT, TextureFormat::RG32U, false }, + { DDS_FORMAT_R32G32_FLOAT, TextureFormat::RG32F, false }, + { DDS_FORMAT_B8G8R8A8_UNORM, TextureFormat::BGRA8, false }, + { DDS_FORMAT_B8G8R8A8_UNORM_SRGB, TextureFormat::BGRA8, true }, + { DDS_FORMAT_R8G8B8A8_UNORM, TextureFormat::RGBA8, false }, + { DDS_FORMAT_R8G8B8A8_UNORM_SRGB, TextureFormat::RGBA8, true }, + { DDS_FORMAT_R16G16B16A16_UNORM, TextureFormat::RGBA16, false }, + { DDS_FORMAT_R16G16B16A16_FLOAT, TextureFormat::RGBA16F, false }, + { DDS_FORMAT_R32G32B32A32_UINT, TextureFormat::RGBA32U, false }, + { DDS_FORMAT_R32G32B32A32_FLOAT, TextureFormat::RGBA32F, false }, + { DDS_FORMAT_B5G6R5_UNORM, TextureFormat::B5G6R5, false }, + { DDS_FORMAT_B5G6R5_UNORM, TextureFormat::R5G6B5, false }, + { DDS_FORMAT_B4G4R4A4_UNORM, TextureFormat::BGRA4, false }, + { DDS_FORMAT_B4G4R4A4_UNORM, TextureFormat::RGBA4, false }, + { DDS_FORMAT_B5G5R5A1_UNORM, TextureFormat::BGR5A1, false }, + { DDS_FORMAT_B5G5R5A1_UNORM, TextureFormat::RGB5A1, false }, + { DDS_FORMAT_R10G10B10A2_UNORM, TextureFormat::RGB10A2, false }, + { DDS_FORMAT_R11G11B10_FLOAT, TextureFormat::RG11B10F, false }, }; struct TranslateDdsPixelFormat @@ -3594,14 +3656,15 @@ namespace bimg static const TranslateDdsPixelFormat s_translateDdsPixelFormat[] = { { 8, DDPF_LUMINANCE, { 0x000000ff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R8 }, + { 8, DDPF_ALPHA, { 0x00000000, 0x00000000, 0x00000000, 0x000000ff }, TextureFormat::R8 }, { 16, DDPF_BUMPDUDV, { 0x000000ff, 0x0000ff00, 0x00000000, 0x00000000 }, TextureFormat::RG8S }, { 16, DDPF_RGB, { 0x0000ffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R16U }, - { 16, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x0000000f, 0x000000f0, 0x00000f00, 0x0000f000 }, TextureFormat::BGRA4 }, - { 16, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x00000f00, 0x000000f0, 0x0000000f, 0x0000f000 }, TextureFormat::RGBA4 }, - { 16, DDPF_RGB, { 0x0000001f, 0x000007e0, 0x0000f800, 0x00000000 }, TextureFormat::B5G6R5 }, - { 16, DDPF_RGB, { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 }, TextureFormat::R5G6B5 }, - { 16, DDPF_RGB, { 0x0000001f, 0x000003e0, 0x00007c00, 0x00008000 }, TextureFormat::BGR5A1 }, - { 16, DDPF_RGB, { 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 }, TextureFormat::RGB5A1 }, + { 16, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x0000000f, 0x000000f0, 0x00000f00, 0x0000f000 }, TextureFormat::RGBA4 }, + { 16, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x00000f00, 0x000000f0, 0x0000000f, 0x0000f000 }, TextureFormat::BGRA4 }, + { 16, DDPF_RGB, { 0x0000001f, 0x000007e0, 0x0000f800, 0x00000000 }, TextureFormat::R5G6B5 }, + { 16, DDPF_RGB, { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 }, TextureFormat::B5G6R5 }, + { 16, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x0000001f, 0x000003e0, 0x00007c00, 0x00008000 }, TextureFormat::BGR5A1 }, + { 16, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 }, TextureFormat::RGB5A1 }, { 24, DDPF_RGB, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::RGB8 }, { 24, DDPF_RGB, { 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000 }, TextureFormat::RGB8 }, { 32, DDPF_RGB, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::BGRA8 }, @@ -4061,7 +4124,7 @@ namespace bimg { KTX_RGB10_A2, KTX_ZERO, KTX_RGBA, KTX_UNSIGNED_INT_2_10_10_10_REV, }, // RGB10A2 { KTX_R11F_G11F_B10F, KTX_ZERO, KTX_RGB, KTX_UNSIGNED_INT_10F_11F_11F_REV, }, // RG11B10F }; - BX_STATIC_ASSERT(TextureFormat::UnknownDepth == BX_COUNTOF(s_translateKtxFormat) ); + static_assert(TextureFormat::UnknownDepth == BX_COUNTOF(s_translateKtxFormat) ); struct KtxFormatInfo2 { @@ -4155,7 +4218,7 @@ namespace bimg if (s_translateKtxFormat[ii].m_internalFmtSrgb == glInternalFormat && s_translateKtxFormat[ii].m_fmt == glBaseInternalFormat) - { + { format = TextureFormat::Enum(ii); srgb = true; break; @@ -4918,7 +4981,6 @@ namespace bimg case TextureFormat::ASTC10x10: case TextureFormat::ASTC12x10: case TextureFormat::ASTC12x12: - /* if (BX_ENABLED(BIMG_DECODE_ASTC) ) { const bimg::ImageBlockInfo& astcBlockInfo = bimg::getBlockInfo(_srcFormat); @@ -4991,7 +5053,6 @@ namespace bimg astcenc_context_free(context); } else - */ { BX_WARN(false, "ASTC decoder is disabled (BIMG_DECODE_ASTC)."); imageCheckerboard(_dst, _width, _height, 16, UINT32_C(0xff000000), UINT32_C(0xff00ff00) ); @@ -5212,7 +5273,7 @@ namespace bimg if (_imageContainer.m_ktx) { - const uint32_t size = numSides == 6 ? mipSize : mipSize * numSides; + const uint32_t size = _imageContainer.m_numLayers == 1 && _imageContainer.m_cubeMap ? mipSize : mipSize * numSides; uint32_t imageSize = bx::toHostEndian(*(const uint32_t*)&data[offset], _imageContainer.m_ktxLE); BX_ASSERT(size == imageSize, "KTX: Image size mismatch %d (expected %d).", size, imageSize); BX_UNUSED(size, imageSize); diff --git a/bimg/src/image_cubemap_filter.cpp b/bimg/src/image_cubemap_filter.cpp index 5a5ff578..1cc8f7b5 100644 --- a/bimg/src/image_cubemap_filter.cpp +++ b/bimg/src/image_cubemap_filter.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ diff --git a/bimg/src/image_decode.cpp b/bimg/src/image_decode.cpp index 755fb7d5..86f645ea 100644 --- a/bimg/src/image_decode.cpp +++ b/bimg/src/image_decode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ @@ -34,6 +34,10 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4334) // warning C4334: '<<' : result of 32 - #include BX_PRAGMA_DIAGNOSTIC_POP(); +#if BIMG_DECODE_HEIF +# include +#endif // BIMG_DECODE_HEIF + void* lodepng_malloc(size_t _size) { return ::malloc(_size); @@ -89,17 +93,16 @@ namespace bimg uint32_t width = 0; uint32_t height = 0; - unsigned error; LodePNGState state; lodepng_state_init(&state); state.decoder.color_convert = 0; uint8_t* data = NULL; - error = lodepng_decode(&data, &width, &height, &state, (uint8_t*)_data, _size); + const uint32_t lodePngError = lodepng_decode(&data, &width, &height, &state, (uint8_t*)_data, _size); - if (0 != error) + if (0 != lodePngError) { - _err->setError(BIMG_ERROR, lodepng_error_text(error) ); + BX_ERROR_SET(_err, BIMG_ERROR, "lodepng_decode failed."); } else { @@ -245,7 +248,8 @@ namespace bimg if (palette) { - if (1 == state.info_raw.bitdepth) { + if (1 == state.info_raw.bitdepth) + { for (uint32_t ii = 0, num = width*height/8; ii < num; ++ii) { uint8_t* dst = (uint8_t*)output->m_data + ii*32; @@ -259,7 +263,8 @@ namespace bimg bx::memCopy(dst + 28, state.info_raw.palette + ( data[ii] &0x1)*4, 4); } } - else if (2 == state.info_raw.bitdepth) { + else if (2 == state.info_raw.bitdepth) + { for (uint32_t ii = 0, num = width*height/4; ii < num; ++ii) { uint8_t* dst = (uint8_t*)output->m_data + ii*16; @@ -269,7 +274,8 @@ namespace bimg bx::memCopy(dst + 12, state.info_raw.palette + ( data[ii] &0x3)*4, 4); } } - else if (4 == state.info_raw.bitdepth) { + else if (4 == state.info_raw.bitdepth) + { for (uint32_t ii = 0, num = width*height/2; ii < num; ++ii) { uint8_t* dst = (uint8_t*)output->m_data + ii*8; @@ -277,7 +283,8 @@ namespace bimg bx::memCopy(dst + 4, state.info_raw.palette + ( data[ii] &0xf)*4, 4); } } - else { + else + { for (uint32_t ii = 0, num = width*height; ii < num; ++ii) { bx::memCopy( (uint8_t*)output->m_data + ii*4, state.info_raw.palette + data[ii]*4, 4); @@ -313,10 +320,10 @@ namespace bimg uint8_t* dst = (uint8_t*)output->m_data + ii*4; // Note: not exactly precise. // Correct way: dst[0] = uint8_t(float( (eightBits>>6)&0x3)*(255.0f/4.0f) ); - dst[0] = uint8_t(uint32_t(((eightBits>>6)&0x3)*64)&0xff); - dst[1] = uint8_t(uint32_t(((eightBits>>4)&0x3)*64)&0xff); - dst[2] = uint8_t(uint32_t(((eightBits>>2)&0x3)*64)&0xff); - dst[3] = uint8_t(uint32_t(((eightBits )&0x3)*64)&0xff); + dst[0] = uint8_t(uint32_t( ( (eightBits>>6)&0x3)*64)&0xff); + dst[1] = uint8_t(uint32_t( ( (eightBits>>4)&0x3)*64)&0xff); + dst[2] = uint8_t(uint32_t( ( (eightBits>>2)&0x3)*64)&0xff); + dst[3] = uint8_t(uint32_t( ( (eightBits )&0x3)*64)&0xff); } } else if (4 == state.info_raw.bitdepth) @@ -329,8 +336,8 @@ namespace bimg uint8_t* dst = (uint8_t*)output->m_data + ii*2; // Note: not exactly precise. // Correct way: dst[0] = uint8_t(float( (eightBits>>4)&0xf)*(255.0f/16.0f) ); - dst[0] = uint8_t(uint32_t(((eightBits>>4)&0xf)*16)&0xff); - dst[1] = uint8_t(uint32_t(((eightBits )&0xf)*16)&0xff); + dst[0] = uint8_t(uint32_t( ( (eightBits>>4)&0xf)*16)&0xff); + dst[1] = uint8_t(uint32_t( ( (eightBits )&0xf)*16)&0xff); } } else if (16 == state.info_raw.bitdepth @@ -367,7 +374,7 @@ namespace bimg } } } - else if(16 == state.info_raw.bitdepth) + else if (16 == state.info_raw.bitdepth) { for (uint32_t ii = 0, num = width * height; ii < num; ++ii) { @@ -632,7 +639,6 @@ namespace bimg output->m_hasAlpha = hasAlpha; } - return output; } @@ -679,8 +685,8 @@ namespace bimg ImageContainer* output = imageAlloc(_allocator , format - , uint16_t(width) - , uint16_t(height) + , bx::narrowCast(width) + , bx::narrowCast(height) , 0 , 1 , false @@ -828,6 +834,57 @@ namespace bimg return image; } + static ImageContainer* imageParseLibHeif(bx::AllocatorI* _allocator, const void* _data, uint32_t _size, bx::Error* _err) + { +#if BIMG_DECODE_HEIF + heif_context* ctx = heif_context_alloc(); + + heif_context_read_from_memory_without_copy(ctx, _data, _size, NULL); + + heif_image_handle* handle; + heif_context_get_primary_image_handle(ctx, &handle); + + heif_image* image; + heif_decode_image(handle, &image, heif_colorspace_RGB, heif_chroma_interleaved_RGBA, NULL); + + int32_t srcStride; + const uint8_t* data = heif_image_get_plane_readonly(image, heif_channel_interleaved, &srcStride); + + ImageContainer* output = NULL; + if (NULL != data) + { + const bimg::TextureFormat::Enum format = bimg::TextureFormat::RGBA8; + const int32_t width = heif_image_handle_get_width(handle); + const int32_t height = heif_image_handle_get_height(handle); + const int32_t dstStride = width*4; + + output = imageAlloc(_allocator + , format + , bx::narrowCast(width) + , bx::narrowCast(height) + , 0 + , 1 + , false + , false + , NULL + ); + + bx::memCopy(output->m_data, dstStride, data, srcStride, dstStride, height); + } + + heif_image_release(image); + heif_image_handle_release(handle); + + heif_context_free(ctx); + + BX_UNUSED(_err); + return output; +#else + BX_UNUSED(_allocator, _data, _size, _err); + return NULL; +#endif // BIMG_DECODE_HEIF + } + ImageContainer* imageParse(bx::AllocatorI* _allocator, const void* _data, uint32_t _size, TextureFormat::Enum _dstFormat, bx::Error* _err) { BX_ERROR_SCOPE(_err); @@ -840,6 +897,7 @@ namespace bimg input = NULL == input ? imageParseTinyExr (_allocator, _data, _size, _err) : input; input = NULL == input ? imageParseJpeg (_allocator, _data, _size, _err) : input; input = NULL == input ? imageParseStbImage(_allocator, _data, _size, _err) : input; + input = NULL == input ? imageParseLibHeif (_allocator, _data, _size, _err) : input; if (NULL == input) { diff --git a/bimg/src/image_encode.cpp b/bimg/src/image_encode.cpp index b4a2e6fb..6b44a77b 100644 --- a/bimg/src/image_encode.cpp +++ b/bimg/src/image_encode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ @@ -39,7 +39,7 @@ namespace bimg squish::kColourIterativeClusterFit, // Highest squish::kColourRangeFit, // Fastest }; - BX_STATIC_ASSERT(Quality::Count == BX_COUNTOF(s_squishQuality) ); + static_assert(Quality::Count == BX_COUNTOF(s_squishQuality) ); static const float s_astcQuality[] = { @@ -52,7 +52,7 @@ namespace bimg ASTCENC_PRE_THOROUGH, // Highest ASTCENC_PRE_FAST, // Fastest }; - BX_STATIC_ASSERT(Quality::Count == BX_COUNTOF(s_astcQuality) ); + static_assert(Quality::Count == BX_COUNTOF(s_astcQuality) ); void imageEncodeFromRgba8(bx::AllocatorI* _allocator, void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _depth, TextureFormat::Enum _format, Quality::Enum _quality, bx::Error* _err) { diff --git a/bimg/src/image_gnf.cpp b/bimg/src/image_gnf.cpp index dbfa439b..8f0a2928 100644 --- a/bimg/src/image_gnf.cpp +++ b/bimg/src/image_gnf.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ diff --git a/bimg/tools/texturec/texturec.cpp b/bimg/tools/texturec/texturec.cpp index a7a3aea8..593dc000 100644 --- a/bimg/tools/texturec/texturec.cpp +++ b/bimg/tools/texturec/texturec.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE */ @@ -911,7 +911,7 @@ void help(const char* _error = NULL, bool _showHelp = true) bx::printf( "texturec, bgfx texture compiler tool, version %d.%d.%d.\n" - "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2024 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bimg/blob/master/LICENSE\n\n" , BIMG_TEXTUREC_VERSION_MAJOR , BIMG_TEXTUREC_VERSION_MINOR diff --git a/build.rs b/build.rs index 4f1f5b2f..1ad7eef9 100644 --- a/build.rs +++ b/build.rs @@ -117,12 +117,12 @@ fn main() { build.file("bgfx/src/shader_dxbc.cpp"); build.file("bgfx/src/renderer_agc.cpp"); build.file("bgfx/src/renderer_gnm.cpp"); - build.file("bgfx/src/renderer_webgpu.cpp"); + // build.file("bgfx/src/renderer_webgpu.cpp"); build.file("bgfx/src/renderer_nvn.cpp"); build.file("bgfx/src/renderer_gl.cpp"); build.file("bgfx/src/renderer_vk.cpp"); build.file("bgfx/src/renderer_noop.cpp"); - build.file("bgfx/src/renderer_d3d9.cpp"); + // build.file("bgfx/src/renderer_d3d.cpp"); build.file("bgfx/src/renderer_d3d11.cpp"); build.file("bgfx/src/renderer_d3d12.cpp"); @@ -161,6 +161,14 @@ fn main() { println!("cargo:rustc-link-lib=pthread"); println!("cargo:rustc-link-lib=stdc++"); println!("cargo:rustc-link-lib=GL"); - println!("cargo:rustc-link-lib=X11"); + // println!("cargo:rustc-link-lib=X11"); + + if std::env::var("XDG_SESSION_TYPE").map_or(false, |v| v == "wayland") { + println!("cargo:rustc-link-lib=wayland-client"); + println!("cargo:rustc-link-lib=wayland-egl"); + println!("cargo:rustc-link-lib=wayland-cursor"); + } else { + println!("cargo:rustc-link-lib=X11"); + } } } diff --git a/bx/.github/workflows/main.yml b/bx/.github/workflows/main.yml new file mode 100644 index 00000000..4cad1057 --- /dev/null +++ b/bx/.github/workflows/main.yml @@ -0,0 +1,151 @@ +name: CI + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +on: + push: + pull_request: + +jobs: + msvc: + strategy: + fail-fast: true + matrix: + include: [ + { config: Debug, platform: x64, bindir: 'win64_vs2022' }, + { config: Release, platform: x64, bindir: 'win64_vs2022' }, + ] + name: msvc-${{ matrix.config }}-${{ matrix.platform }} + runs-on: windows-2022 + steps: + - name: Checkout bx + uses: actions/checkout@v4 + with: + repository: bkaradzic/bx + path: bx + - name: Prepare + uses: microsoft/setup-msbuild@v2 + - name: Build + shell: cmd + run: | + cd bx + tools\bin\windows\genie.exe vs2022 + msbuild ".build/projects/vs2022/bx.sln" /m /v:minimal /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }} + - name: Check + shell: cmd + run: | + cd bx + ".build\${{ matrix.bindir }}\bin\bx.test${{ matrix.config }}.exe" -d yes + mingw: + strategy: + fail-fast: true + matrix: + include: [ + { msystem: MINGW64, project: 'mingw-gcc', bindir: 'win64_mingw-gcc' }, +# { msystem: CLANG64, project: 'mingw-clang', bindir: 'win64_mingw-clang' }, + ] + name: mingw-${{ matrix.msystem }} + runs-on: windows-2022 + steps: + - name: Checkout bx + uses: actions/checkout@v4 + with: + repository: bkaradzic/bx + path: bx + - name: Prepare + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: make + pacboy: cc:p + - name: Build + shell: msys2 {0} + run: | + cd bx + tools/bin/windows/genie.exe --gcc=${{ matrix.project }} gmake + make -R -C .build/projects/gmake-${{ matrix.project }} config=release64 -j$(nproc) AR=ar CC=cc CXX=c++ MINGW=$MINGW_PREFIX + - name: Check + shell: cmd + run: | + cd bx + ".build\${{ matrix.bindir }}\bin\bx.testRelease.exe" -d yes + linux: + strategy: + fail-fast: true + matrix: + include: [ + { config: debug, binsuffix: Debug }, + { config: release, binsuffix: Release }, + ] + name: linux-gcc-${{ matrix.config }}64 + runs-on: ubuntu-24.04 + steps: + - name: Checkout bx + uses: actions/checkout@v4 + with: + repository: bkaradzic/bx + path: bx + - name: Build + run: | + cd bx + tools/bin/linux/genie --gcc=linux-gcc gmake + make -R -C .build/projects/gmake-linux-gcc config=${{ matrix.config }}64 -j$(nproc) + - name: Check + run: | + cd bx + ".build/linux64_gcc/bin/bx.test${{ matrix.binsuffix}}" -d yes + osx: + strategy: + fail-fast: true + matrix: + include: [ + { config: debug, binsuffix: Debug }, + { config: release, binsuffix: Release }, + ] + name: osx-x64-${{ matrix.config }} + runs-on: macos-14 + steps: + - name: Checkout bx + uses: actions/checkout@v4 + with: + repository: bkaradzic/bx + path: bx + - name: Build + run: | + cd bx + tools/bin/darwin/genie --gcc=osx-x64 gmake + make -C .build/projects/gmake-osx-x64 config=${{ matrix.config }} -j$(sysctl -n hw.physicalcpu) + - name: Check + run: | + cd bx + ".build/osx-x64/bin/bx.test${{ matrix.binsuffix}}" -d yes + emscripten: + strategy: + fail-fast: true + matrix: + include: [ + { config: debug, binsuffix: Debug }, + { config: release, binsuffix: Release }, + ] + name: wasm-${{ matrix.config }} + runs-on: ubuntu-24.04 + steps: + - name: Checkout bx + uses: actions/checkout@v4 + with: + repository: bkaradzic/bx + path: bx + - uses: mymindstorm/setup-emsdk@v14 + - uses: browser-actions/setup-chrome@v1 + - name: Build + run: | + cd bx + tools/bin/linux/genie --gcc=wasm gmake + make -C .build/projects/gmake-wasm config=${{ matrix.config }} -j$(nproc) EMSCRIPTEN=$EMSDK/upstream/emscripten + - name: Check + run: | + cd bx +# npx http-server -o .build/wasm/bin/ & chromium http://127.0.0.1:8080/.build/wasm/bin/bx.testRelease.html diff --git a/bx/3rdparty/catch/catch_amalgamated.cpp b/bx/3rdparty/catch/catch_amalgamated.cpp index ecda2301..f45c18a0 100644 --- a/bx/3rdparty/catch/catch_amalgamated.cpp +++ b/bx/3rdparty/catch/catch_amalgamated.cpp @@ -1,12 +1,13 @@ + // Copyright Catch2 Authors // Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// (See accompanying file LICENSE.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -// Catch v3.1.0 -// Generated: 2022-07-17 20:14:05.885021 +// Catch v3.7.1 +// Generated: 2024-09-17 10:36:45.608896 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -15,6 +16,28 @@ #include "catch_amalgamated.hpp" +#ifndef CATCH_WINDOWS_H_PROXY_HPP_INCLUDED +#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED + + +#if defined(CATCH_PLATFORM_WINDOWS) + +// We might end up with the define made globally through the compiler, +// and we don't want to trigger warnings for this +#if !defined(NOMINMAX) +# define NOMINMAX +#endif +#if !defined(WIN32_LEAN_AND_MEAN) +# define WIN32_LEAN_AND_MEAN +#endif + +#include + +#endif // defined(CATCH_PLATFORM_WINDOWS) + +#endif // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED + + namespace Catch { @@ -26,18 +49,99 @@ namespace Catch { } // namespace Catch +// Adapted from donated nonius code. + +#include namespace Catch { namespace Benchmark { namespace Detail { + SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDuration* last) { + if (!cfg.benchmarkNoAnalysis()) { + std::vector samples; + samples.reserve(static_cast(last - first)); + for (auto current = first; current != last; ++current) { + samples.push_back( current->count() ); + } + + auto analysis = Catch::Benchmark::Detail::analyse_samples( + cfg.benchmarkConfidenceInterval(), + cfg.benchmarkResamples(), + samples.data(), + samples.data() + samples.size() ); + auto outliers = Catch::Benchmark::Detail::classify_outliers( + samples.data(), samples.data() + samples.size() ); + + auto wrap_estimate = [](Estimate e) { + return Estimate { + FDuration(e.point), + FDuration(e.lower_bound), + FDuration(e.upper_bound), + e.confidence_interval, + }; + }; + std::vector samples2; + samples2.reserve(samples.size()); + for (auto s : samples) { + samples2.push_back( FDuration( s ) ); + } + + return { + CATCH_MOVE(samples2), + wrap_estimate(analysis.mean), + wrap_estimate(analysis.standard_deviation), + outliers, + analysis.outlier_variance, + }; + } else { + std::vector samples; + samples.reserve(static_cast(last - first)); + + FDuration mean = FDuration(0); + int i = 0; + for (auto it = first; it < last; ++it, ++i) { + samples.push_back(*it); + mean += *it; + } + mean /= i; + + return SampleAnalysis{ + CATCH_MOVE(samples), + Estimate{ mean, mean, mean, 0.0 }, + Estimate{ FDuration( 0 ), + FDuration( 0 ), + FDuration( 0 ), + 0.0 }, + OutlierClassification{}, + 0.0 + }; + } + } + } // namespace Detail + } // namespace Benchmark +} // namespace Catch + + + + +namespace Catch { + namespace Benchmark { + namespace Detail { + struct do_nothing { + void operator()() const {} + }; + BenchmarkFunction::callable::~callable() = default; + BenchmarkFunction::BenchmarkFunction(): + f( new model{ {} } ){} } // namespace Detail } // namespace Benchmark } // namespace Catch + #include namespace Catch { @@ -64,9 +168,11 @@ namespace Catch { +#include #include +#include #include -#include +#include #include @@ -74,139 +180,199 @@ namespace Catch { #include #endif -namespace { +namespace Catch { + namespace Benchmark { + namespace Detail { + namespace { + + template + static sample + resample( URng& rng, + unsigned int resamples, + double const* first, + double const* last, + Estimator& estimator ) { + auto n = static_cast( last - first ); + Catch::uniform_integer_distribution dist( 0, n - 1 ); + + sample out; + out.reserve( resamples ); + std::vector resampled; + resampled.reserve( n ); + for ( size_t i = 0; i < resamples; ++i ) { + resampled.clear(); + for ( size_t s = 0; s < n; ++s ) { + resampled.push_back( first[dist( rng )] ); + } + const auto estimate = + estimator( resampled.data(), resampled.data() + resampled.size() ); + out.push_back( estimate ); + } + std::sort( out.begin(), out.end() ); + return out; + } -using Catch::Benchmark::Detail::sample; - - template - sample resample(URng& rng, unsigned int resamples, std::vector::iterator first, std::vector::iterator last, Estimator& estimator) { - auto n = static_cast(last - first); - std::uniform_int_distribution dist(0, n - 1); - - sample out; - out.reserve(resamples); - std::generate_n(std::back_inserter(out), resamples, [n, first, &estimator, &dist, &rng] { - std::vector resampled; - resampled.reserve(n); - std::generate_n(std::back_inserter(resampled), n, [first, &dist, &rng] { return first[static_cast(dist(rng))]; }); - return estimator(resampled.begin(), resampled.end()); - }); - std::sort(out.begin(), out.end()); - return out; - } - - - double erf_inv(double x) { - // Code accompanying the article "Approximating the erfinv function" in GPU Computing Gems, Volume 2 - double w, p; - - w = -log((1.0 - x) * (1.0 + x)); - - if (w < 6.250000) { - w = w - 3.125000; - p = -3.6444120640178196996e-21; - p = -1.685059138182016589e-19 + p * w; - p = 1.2858480715256400167e-18 + p * w; - p = 1.115787767802518096e-17 + p * w; - p = -1.333171662854620906e-16 + p * w; - p = 2.0972767875968561637e-17 + p * w; - p = 6.6376381343583238325e-15 + p * w; - p = -4.0545662729752068639e-14 + p * w; - p = -8.1519341976054721522e-14 + p * w; - p = 2.6335093153082322977e-12 + p * w; - p = -1.2975133253453532498e-11 + p * w; - p = -5.4154120542946279317e-11 + p * w; - p = 1.051212273321532285e-09 + p * w; - p = -4.1126339803469836976e-09 + p * w; - p = -2.9070369957882005086e-08 + p * w; - p = 4.2347877827932403518e-07 + p * w; - p = -1.3654692000834678645e-06 + p * w; - p = -1.3882523362786468719e-05 + p * w; - p = 0.0001867342080340571352 + p * w; - p = -0.00074070253416626697512 + p * w; - p = -0.0060336708714301490533 + p * w; - p = 0.24015818242558961693 + p * w; - p = 1.6536545626831027356 + p * w; - } else if (w < 16.000000) { - w = sqrt(w) - 3.250000; - p = 2.2137376921775787049e-09; - p = 9.0756561938885390979e-08 + p * w; - p = -2.7517406297064545428e-07 + p * w; - p = 1.8239629214389227755e-08 + p * w; - p = 1.5027403968909827627e-06 + p * w; - p = -4.013867526981545969e-06 + p * w; - p = 2.9234449089955446044e-06 + p * w; - p = 1.2475304481671778723e-05 + p * w; - p = -4.7318229009055733981e-05 + p * w; - p = 6.8284851459573175448e-05 + p * w; - p = 2.4031110387097893999e-05 + p * w; - p = -0.0003550375203628474796 + p * w; - p = 0.00095328937973738049703 + p * w; - p = -0.0016882755560235047313 + p * w; - p = 0.0024914420961078508066 + p * w; - p = -0.0037512085075692412107 + p * w; - p = 0.005370914553590063617 + p * w; - p = 1.0052589676941592334 + p * w; - p = 3.0838856104922207635 + p * w; - } else { - w = sqrt(w) - 5.000000; - p = -2.7109920616438573243e-11; - p = -2.5556418169965252055e-10 + p * w; - p = 1.5076572693500548083e-09 + p * w; - p = -3.7894654401267369937e-09 + p * w; - p = 7.6157012080783393804e-09 + p * w; - p = -1.4960026627149240478e-08 + p * w; - p = 2.9147953450901080826e-08 + p * w; - p = -6.7711997758452339498e-08 + p * w; - p = 2.2900482228026654717e-07 + p * w; - p = -9.9298272942317002539e-07 + p * w; - p = 4.5260625972231537039e-06 + p * w; - p = -1.9681778105531670567e-05 + p * w; - p = 7.5995277030017761139e-05 + p * w; - p = -0.00021503011930044477347 + p * w; - p = -0.00013871931833623122026 + p * w; - p = 1.0103004648645343977 + p * w; - p = 4.8499064014085844221 + p * w; - } - return p * x; - } - - double standard_deviation(std::vector::iterator first, std::vector::iterator last) { - auto m = Catch::Benchmark::Detail::mean(first, last); - double variance = std::accumulate( first, - last, - 0., - [m]( double a, double b ) { - double diff = b - m; - return a + diff * diff; - } ) / - ( last - first ); - return std::sqrt( variance ); - } + static double outlier_variance( Estimate mean, + Estimate stddev, + int n ) { + double sb = stddev.point; + double mn = mean.point / n; + double mg_min = mn / 2.; + double sg = (std::min)( mg_min / 4., sb / std::sqrt( n ) ); + double sg2 = sg * sg; + double sb2 = sb * sb; + + auto c_max = [n, mn, sb2, sg2]( double x ) -> double { + double k = mn - x; + double d = k * k; + double nd = n * d; + double k0 = -n * nd; + double k1 = sb2 - n * sg2 + nd; + double det = k1 * k1 - 4 * sg2 * k0; + return static_cast( -2. * k0 / + ( k1 + std::sqrt( det ) ) ); + }; + + auto var_out = [n, sb2, sg2]( double c ) { + double nc = n - c; + return ( nc / n ) * ( sb2 - nc * sg2 ); + }; + + return (std::min)( var_out( 1 ), + var_out( + (std::min)( c_max( 0. ), + c_max( mg_min ) ) ) ) / + sb2; + } -} + static double erf_inv( double x ) { + // Code accompanying the article "Approximating the erfinv + // function" in GPU Computing Gems, Volume 2 + double w, p; + + w = -log( ( 1.0 - x ) * ( 1.0 + x ) ); + + if ( w < 6.250000 ) { + w = w - 3.125000; + p = -3.6444120640178196996e-21; + p = -1.685059138182016589e-19 + p * w; + p = 1.2858480715256400167e-18 + p * w; + p = 1.115787767802518096e-17 + p * w; + p = -1.333171662854620906e-16 + p * w; + p = 2.0972767875968561637e-17 + p * w; + p = 6.6376381343583238325e-15 + p * w; + p = -4.0545662729752068639e-14 + p * w; + p = -8.1519341976054721522e-14 + p * w; + p = 2.6335093153082322977e-12 + p * w; + p = -1.2975133253453532498e-11 + p * w; + p = -5.4154120542946279317e-11 + p * w; + p = 1.051212273321532285e-09 + p * w; + p = -4.1126339803469836976e-09 + p * w; + p = -2.9070369957882005086e-08 + p * w; + p = 4.2347877827932403518e-07 + p * w; + p = -1.3654692000834678645e-06 + p * w; + p = -1.3882523362786468719e-05 + p * w; + p = 0.0001867342080340571352 + p * w; + p = -0.00074070253416626697512 + p * w; + p = -0.0060336708714301490533 + p * w; + p = 0.24015818242558961693 + p * w; + p = 1.6536545626831027356 + p * w; + } else if ( w < 16.000000 ) { + w = sqrt( w ) - 3.250000; + p = 2.2137376921775787049e-09; + p = 9.0756561938885390979e-08 + p * w; + p = -2.7517406297064545428e-07 + p * w; + p = 1.8239629214389227755e-08 + p * w; + p = 1.5027403968909827627e-06 + p * w; + p = -4.013867526981545969e-06 + p * w; + p = 2.9234449089955446044e-06 + p * w; + p = 1.2475304481671778723e-05 + p * w; + p = -4.7318229009055733981e-05 + p * w; + p = 6.8284851459573175448e-05 + p * w; + p = 2.4031110387097893999e-05 + p * w; + p = -0.0003550375203628474796 + p * w; + p = 0.00095328937973738049703 + p * w; + p = -0.0016882755560235047313 + p * w; + p = 0.0024914420961078508066 + p * w; + p = -0.0037512085075692412107 + p * w; + p = 0.005370914553590063617 + p * w; + p = 1.0052589676941592334 + p * w; + p = 3.0838856104922207635 + p * w; + } else { + w = sqrt( w ) - 5.000000; + p = -2.7109920616438573243e-11; + p = -2.5556418169965252055e-10 + p * w; + p = 1.5076572693500548083e-09 + p * w; + p = -3.7894654401267369937e-09 + p * w; + p = 7.6157012080783393804e-09 + p * w; + p = -1.4960026627149240478e-08 + p * w; + p = 2.9147953450901080826e-08 + p * w; + p = -6.7711997758452339498e-08 + p * w; + p = 2.2900482228026654717e-07 + p * w; + p = -9.9298272942317002539e-07 + p * w; + p = 4.5260625972231537039e-06 + p * w; + p = -1.9681778105531670567e-05 + p * w; + p = 7.5995277030017761139e-05 + p * w; + p = -0.00021503011930044477347 + p * w; + p = -0.00013871931833623122026 + p * w; + p = 1.0103004648645343977 + p * w; + p = 4.8499064014085844221 + p * w; + } + return p * x; + } + + static double + standard_deviation( double const* first, double const* last ) { + auto m = Catch::Benchmark::Detail::mean( first, last ); + double variance = + std::accumulate( first, + last, + 0., + [m]( double a, double b ) { + double diff = b - m; + return a + diff * diff; + } ) / + ( last - first ); + return std::sqrt( variance ); + } + + static sample jackknife( double ( *estimator )( double const*, + double const* ), + double* first, + double* last ) { + const auto second = first + 1; + sample results; + results.reserve( static_cast( last - first ) ); + + for ( auto it = first; it != last; ++it ) { + std::iter_swap( it, first ); + results.push_back( estimator( second, last ) ); + } + + return results; + } + + + } // namespace + } // namespace Detail + } // namespace Benchmark +} // namespace Catch namespace Catch { namespace Benchmark { namespace Detail { -#if defined( __GNUC__ ) || defined( __clang__ ) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wfloat-equal" -#endif - bool directCompare( double lhs, double rhs ) { return lhs == rhs; } -#if defined( __GNUC__ ) || defined( __clang__ ) -# pragma GCC diagnostic pop -#endif - - double weighted_average_quantile(int k, int q, std::vector::iterator first, std::vector::iterator last) { + double weighted_average_quantile( int k, + int q, + double* first, + double* last ) { auto count = last - first; double idx = (count - 1) * k / static_cast(q); int j = static_cast(idx); double g = idx - j; std::nth_element(first, first + j, last); auto xj = first[j]; - if ( directCompare( g, 0 ) ) { + if ( Catch::Detail::directCompare( g, 0 ) ) { return xj; } @@ -214,6 +380,48 @@ namespace Catch { return xj + g * (xj1 - xj); } + OutlierClassification + classify_outliers( double const* first, double const* last ) { + std::vector copy( first, last ); + + auto q1 = weighted_average_quantile( 1, 4, copy.data(), copy.data() + copy.size() ); + auto q3 = weighted_average_quantile( 3, 4, copy.data(), copy.data() + copy.size() ); + auto iqr = q3 - q1; + auto los = q1 - ( iqr * 3. ); + auto lom = q1 - ( iqr * 1.5 ); + auto him = q3 + ( iqr * 1.5 ); + auto his = q3 + ( iqr * 3. ); + + OutlierClassification o; + for ( ; first != last; ++first ) { + const double t = *first; + if ( t < los ) { + ++o.low_severe; + } else if ( t < lom ) { + ++o.low_mild; + } else if ( t > his ) { + ++o.high_severe; + } else if ( t > him ) { + ++o.high_mild; + } + ++o.samples_seen; + } + return o; + } + + double mean( double const* first, double const* last ) { + auto count = last - first; + double sum = 0.; + while (first != last) { + sum += *first; + ++first; + } + return sum / static_cast(count); + } + + double normal_cdf( double x ) { + return std::erfc( -x / std::sqrt( 2.0 ) ) / 2.0; + } double erfc_inv(double x) { return erf_inv(1.0 - x); @@ -235,50 +443,77 @@ namespace Catch { return result; } + Estimate + bootstrap( double confidence_level, + double* first, + double* last, + sample const& resample, + double ( *estimator )( double const*, double const* ) ) { + auto n_samples = last - first; + + double point = estimator( first, last ); + // Degenerate case with a single sample + if ( n_samples == 1 ) + return { point, point, point, confidence_level }; + + sample jack = jackknife( estimator, first, last ); + double jack_mean = + mean( jack.data(), jack.data() + jack.size() ); + double sum_squares = 0, sum_cubes = 0; + for ( double x : jack ) { + auto difference = jack_mean - x; + auto square = difference * difference; + auto cube = square * difference; + sum_squares += square; + sum_cubes += cube; + } - double outlier_variance(Estimate mean, Estimate stddev, int n) { - double sb = stddev.point; - double mn = mean.point / n; - double mg_min = mn / 2.; - double sg = (std::min)(mg_min / 4., sb / std::sqrt(n)); - double sg2 = sg * sg; - double sb2 = sb * sb; + double accel = sum_cubes / ( 6 * std::pow( sum_squares, 1.5 ) ); + long n = static_cast( resample.size() ); + double prob_n = + std::count_if( resample.begin(), + resample.end(), + [point]( double x ) { return x < point; } ) / + static_cast( n ); + // degenerate case with uniform samples + if ( Catch::Detail::directCompare( prob_n, 0. ) ) { + return { point, point, point, confidence_level }; + } - auto c_max = [n, mn, sb2, sg2](double x) -> double { - double k = mn - x; - double d = k * k; - double nd = n * d; - double k0 = -n * nd; - double k1 = sb2 - n * sg2 + nd; - double det = k1 * k1 - 4 * sg2 * k0; - return static_cast(-2. * k0 / (k1 + std::sqrt(det))); - }; + double bias = normal_quantile( prob_n ); + double z1 = normal_quantile( ( 1. - confidence_level ) / 2. ); - auto var_out = [n, sb2, sg2](double c) { - double nc = n - c; - return (nc / n) * (sb2 - nc * sg2); + auto cumn = [n]( double x ) -> long { + return std::lround( normal_cdf( x ) * + static_cast( n ) ); }; - - return (std::min)(var_out(1), var_out((std::min)(c_max(0.), c_max(mg_min)))) / sb2; - } - - - bootstrap_analysis analyse_samples(double confidence_level, unsigned int n_resamples, std::vector::iterator first, std::vector::iterator last) { - CATCH_INTERNAL_START_WARNINGS_SUPPRESSION - CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS - static std::random_device entropy; - CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION - - auto n = static_cast(last - first); // seriously, one can't use integral types without hell in C++ - - auto mean = &Detail::mean::iterator>; + auto a = [bias, accel]( double b ) { + return bias + b / ( 1. - accel * b ); + }; + double b1 = bias + z1; + double b2 = bias - z1; + double a1 = a( b1 ); + double a2 = a( b2 ); + auto lo = static_cast( (std::max)( cumn( a1 ), 0l ) ); + auto hi = + static_cast( (std::min)( cumn( a2 ), n - 1 ) ); + + return { point, resample[lo], resample[hi], confidence_level }; + } + + bootstrap_analysis analyse_samples(double confidence_level, + unsigned int n_resamples, + double* first, + double* last) { + auto mean = &Detail::mean; auto stddev = &standard_deviation; #if defined(CATCH_CONFIG_USE_ASYNC) - auto Estimate = [=](double(*f)(std::vector::iterator, std::vector::iterator)) { - auto seed = entropy(); + auto Estimate = [=](double(*f)(double const*, double const*)) { + std::random_device rd; + auto seed = rd(); return std::async(std::launch::async, [=] { - std::mt19937 rng(seed); + SimplePcg32 rng( seed ); auto resampled = resample(rng, n_resamples, first, last, f); return bootstrap(confidence_level, first, last, resampled, f); }); @@ -290,9 +525,10 @@ namespace Catch { auto mean_estimate = mean_future.get(); auto stddev_estimate = stddev_future.get(); #else - auto Estimate = [=](double(*f)(std::vector::iterator, std::vector::iterator)) { - auto seed = entropy(); - std::mt19937 rng(seed); + auto Estimate = [=](double(*f)(double const* , double const*)) { + std::random_device rd; + auto seed = rd(); + SimplePcg32 rng( seed ); auto resampled = resample(rng, n_resamples, first, last, f); return bootstrap(confidence_level, first, last, resampled, f); }; @@ -301,6 +537,7 @@ namespace Catch { auto stddev_estimate = Estimate(stddev); #endif // CATCH_USE_ASYNC + auto n = static_cast(last - first); // seriously, one can't use integral types without hell in C++ double outlier_variance = Detail::outlier_variance(mean_estimate, stddev_estimate, n); return { mean_estimate, stddev_estimate, outlier_variance }; @@ -327,7 +564,7 @@ bool marginComparison(double lhs, double rhs, double margin) { namespace Catch { Approx::Approx ( double value ) - : m_epsilon( std::numeric_limits::epsilon()*100. ), + : m_epsilon( static_cast(std::numeric_limits::epsilon())*100. ), m_margin( 0.0 ), m_scale( 0.0 ), m_value( value ) @@ -372,10 +609,10 @@ namespace Catch { } namespace literals { - Approx operator "" _a(long double val) { + Approx operator ""_a(long double val) { return Approx(val); } - Approx operator "" _a(unsigned long long val) { + Approx operator ""_a(unsigned long long val) { return Approx(val); } } // end namespace literals @@ -390,7 +627,7 @@ std::string StringMaker::convert(Catch::Approx const& value) { namespace Catch { - AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const & _lazyExpression): + AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const& _lazyExpression): lazyExpression(_lazyExpression), resultType(_resultType) {} @@ -406,9 +643,9 @@ namespace Catch { return reconstructedExpression; } - AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data ) + AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData&& data ) : m_info( info ), - m_resultData( data ) + m_resultData( CATCH_MOVE(data) ) {} // Result was a success @@ -447,16 +684,15 @@ namespace Catch { } std::string AssertionResult::getExpressionInMacro() const { - std::string expr; - if( m_info.macroName.empty() ) - expr = static_cast(m_info.capturedExpression); - else { - expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 ); - expr += m_info.macroName; - expr += "( "; - expr += m_info.capturedExpression; - expr += " )"; + if ( m_info.macroName.empty() ) { + return static_cast( m_info.capturedExpression ); } + std::string expr; + expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 ); + expr += m_info.macroName; + expr += "( "; + expr += m_info.capturedExpression; + expr += " )"; return expr; } @@ -486,29 +722,73 @@ namespace Catch { -namespace { - bool provideBazelReporterOutput() { -#ifdef CATCH_CONFIG_BAZEL_SUPPORT - return true; +#include + +namespace Catch { + + namespace { + static bool enableBazelEnvSupport() { +#if defined( CATCH_CONFIG_BAZEL_SUPPORT ) + return true; #else + return Detail::getEnv( "BAZEL_TEST" ) != nullptr; +#endif + } -# if defined( _MSC_VER ) - // On Windows getenv throws a warning as there is no input validation, - // since the switch is hardcoded, this should not be an issue. -# pragma warning( push ) -# pragma warning( disable : 4996 ) -# endif + struct bazelShardingOptions { + unsigned int shardIndex, shardCount; + std::string shardFilePath; + }; - return std::getenv( "BAZEL_TEST" ) != nullptr; + static Optional readBazelShardingOptions() { + const auto bazelShardIndex = Detail::getEnv( "TEST_SHARD_INDEX" ); + const auto bazelShardTotal = Detail::getEnv( "TEST_TOTAL_SHARDS" ); + const auto bazelShardInfoFile = Detail::getEnv( "TEST_SHARD_STATUS_FILE" ); + + + const bool has_all = + bazelShardIndex && bazelShardTotal && bazelShardInfoFile; + if ( !has_all ) { + // We provide nice warning message if the input is + // misconfigured. + auto warn = []( const char* env_var ) { + Catch::cerr() + << "Warning: Bazel shard configuration is missing '" + << env_var << "'. Shard configuration is skipped.\n"; + }; + if ( !bazelShardIndex ) { + warn( "TEST_SHARD_INDEX" ); + } + if ( !bazelShardTotal ) { + warn( "TEST_TOTAL_SHARDS" ); + } + if ( !bazelShardInfoFile ) { + warn( "TEST_SHARD_STATUS_FILE" ); + } + return {}; + } -# if defined( _MSC_VER ) -# pragma warning( pop ) -# endif -#endif - } -} + auto shardIndex = parseUInt( bazelShardIndex ); + if ( !shardIndex ) { + Catch::cerr() + << "Warning: could not parse 'TEST_SHARD_INDEX' ('" << bazelShardIndex + << "') as unsigned int.\n"; + return {}; + } + auto shardTotal = parseUInt( bazelShardTotal ); + if ( !shardTotal ) { + Catch::cerr() + << "Warning: could not parse 'TEST_TOTAL_SHARD' ('" + << bazelShardTotal << "') as unsigned int.\n"; + return {}; + } + + return bazelShardingOptions{ + *shardIndex, *shardTotal, bazelShardInfoFile }; + + } + } // end namespace -namespace Catch { bool operator==( ProcessedReporterSpec const& lhs, ProcessedReporterSpec const& rhs ) { @@ -531,50 +811,34 @@ namespace Catch { elem = trim(elem); } - - TestSpecParser parser(ITagAliasRegistry::get()); - if (!m_data.testsOrTags.empty()) { - m_hasTestFilters = true; - for (auto const& testOrTags : m_data.testsOrTags) { - parser.parse(testOrTags); - } - } - m_testSpec = parser.testSpec(); - - - // Insert the default reporter if user hasn't asked for a specfic one + // Insert the default reporter if user hasn't asked for a specific one if ( m_data.reporterSpecifications.empty() ) { - m_data.reporterSpecifications.push_back( { #if defined( CATCH_CONFIG_DEFAULT_REPORTER ) - CATCH_CONFIG_DEFAULT_REPORTER, + const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER; #else - "console", + const auto default_spec = "console"; #endif - {}, {}, {} - } ); + auto parsed = parseReporterSpec(default_spec); + CATCH_ENFORCE( parsed, + "Cannot parse the provided default reporter spec: '" + << default_spec << '\'' ); + m_data.reporterSpecifications.push_back( std::move( *parsed ) ); } - if(provideBazelReporterOutput()){ - // Register a JUnit reporter for Bazel. Bazel sets an environment - // variable with the path to XML output. If this file is written to - // during test, Bazel will not generate a default XML output. - // This allows the XML output file to contain higher level of detail - // than what is possible otherwise. -# if defined( _MSC_VER ) - // On Windows getenv throws a warning as there is no input validation, - // since the key is hardcoded, this should not be an issue. -# pragma warning( push ) -# pragma warning( disable : 4996 ) -# endif - const auto bazelOutputFilePtr = std::getenv( "XML_OUTPUT_FILE" ); -# if defined( _MSC_VER ) -# pragma warning( pop ) -# endif - if ( bazelOutputFilePtr != nullptr ) { - m_data.reporterSpecifications.push_back( - { "junit", std::string( bazelOutputFilePtr ), {}, {} } ); + if ( enableBazelEnvSupport() ) { + readBazelEnvVars(); + } + + // Bazel support can modify the test specs, so parsing has to happen + // after reading Bazel env vars. + TestSpecParser parser( ITagAliasRegistry::get() ); + if ( !m_data.testsOrTags.empty() ) { + m_hasTestFilters = true; + for ( auto const& testOrTags : m_data.testsOrTags ) { + parser.parse( testOrTags ); } - } + } + m_testSpec = parser.testSpec(); // We now fixup the reporter specs to handle default output spec, @@ -655,10 +919,53 @@ namespace Catch { unsigned int Config::benchmarkResamples() const { return m_data.benchmarkResamples; } std::chrono::milliseconds Config::benchmarkWarmupTime() const { return std::chrono::milliseconds(m_data.benchmarkWarmupTime); } + void Config::readBazelEnvVars() { + // Register a JUnit reporter for Bazel. Bazel sets an environment + // variable with the path to XML output. If this file is written to + // during test, Bazel will not generate a default XML output. + // This allows the XML output file to contain higher level of detail + // than what is possible otherwise. + const auto bazelOutputFile = Detail::getEnv( "XML_OUTPUT_FILE" ); + + if ( bazelOutputFile ) { + m_data.reporterSpecifications.push_back( + { "junit", std::string( bazelOutputFile ), {}, {} } ); + } + + const auto bazelTestSpec = Detail::getEnv( "TESTBRIDGE_TEST_ONLY" ); + if ( bazelTestSpec ) { + // Presumably the test spec from environment should overwrite + // the one we got from CLI (if we got any) + m_data.testsOrTags.clear(); + m_data.testsOrTags.push_back( bazelTestSpec ); + } + + const auto bazelShardOptions = readBazelShardingOptions(); + if ( bazelShardOptions ) { + std::ofstream f( bazelShardOptions->shardFilePath, + std::ios_base::out | std::ios_base::trunc ); + if ( f.is_open() ) { + f << ""; + m_data.shardIndex = bazelShardOptions->shardIndex; + m_data.shardCount = bazelShardOptions->shardCount; + } + } + } + } // end namespace Catch + + +namespace Catch { + std::uint32_t getSeed() { + return getCurrentContext().getConfig()->rngSeed(); + } +} + + + #include #include @@ -667,8 +974,8 @@ namespace Catch { //////////////////////////////////////////////////////////////////////////// - ScopedMessage::ScopedMessage( MessageBuilder const& builder ): - m_info( builder.m_info ) { + ScopedMessage::ScopedMessage( MessageBuilder&& builder ): + m_info( CATCH_MOVE(builder.m_info) ) { m_info.message = builder.m_stream.str(); getResultCapture().pushScopedMessage( m_info ); } @@ -685,7 +992,11 @@ namespace Catch { } - Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ) { + Capturer::Capturer( StringRef macroName, + SourceLineInfo const& lineInfo, + ResultWas::OfType resultType, + StringRef names ): + m_resultCapture( getResultCapture() ) { auto trimmed = [&] (size_t start, size_t end) { while (names[start] == ',' || isspace(static_cast(names[start]))) { ++start; @@ -735,6 +1046,8 @@ namespace Catch { m_messages.back().message += " := "; start = pos; } + break; + default:; // noop } } assert(openings.empty() && "Mismatched openings"); @@ -762,6 +1075,8 @@ namespace Catch { +#include + namespace Catch { namespace { @@ -772,7 +1087,7 @@ namespace Catch { public: // IRegistryHub RegistryHub() = default; - IReporterRegistry const& getReporterRegistry() const override { + ReporterRegistry const& getReporterRegistry() const override { return m_reporterRegistry; } ITestCaseRegistry const& getTestCaseRegistry() const override { @@ -848,13 +1163,20 @@ namespace Catch { #include #include +#include #include #include namespace Catch { namespace { - const int MaxExitCode = 255; + static constexpr int TestFailureExitCode = 42; + static constexpr int UnspecifiedErrorExitCode = 1; + static constexpr int AllTestsSkippedExitCode = 4; + static constexpr int NoTestsRunExitCode = 2; + static constexpr int UnmatchedTestSpecExitCode = 3; + static constexpr int InvalidTestSpecExitCode = 5; + IEventListenerPtr createReporter(std::string const& reporterName, ReporterConfig&& config) { auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, CATCH_MOVE(config)); @@ -882,7 +1204,6 @@ namespace Catch { multi->addListener(listener->create(config)); } - std::size_t reporterIdx = 0; for ( auto const& reporterSpec : config->getProcessedReporterSpecs() ) { multi->addReporter( createReporter( reporterSpec.name, @@ -890,7 +1211,6 @@ namespace Catch { makeStream( reporterSpec.outputFilename ), reporterSpec.colourMode, reporterSpec.customOptions ) ) ); - reporterIdx++; } return multi; @@ -1020,8 +1340,7 @@ namespace Catch { } int Session::applyCommandLine( int argc, char const * const * argv ) { - if( m_startupExceptions ) - return 1; + if ( m_startupExceptions ) { return UnspecifiedErrorExitCode; } auto result = m_cli.parse( Clara::Args( argc, argv ) ); @@ -1037,7 +1356,7 @@ namespace Catch { << TextFlow::Column( result.errorMessage() ).indent( 2 ) << "\n\n"; errStream->stream() << "Run with -? for usage\n\n" << std::flush; - return MaxExitCode; + return UnspecifiedErrorExitCode; } if( m_configData.showHelp ) @@ -1107,8 +1426,7 @@ namespace Catch { } int Session::runInternal() { - if( m_startupExceptions ) - return 1; + if ( m_startupExceptions ) { return UnspecifiedErrorExitCode; } if (m_configData.showHelp || m_configData.libIdentify) { return 0; @@ -1119,7 +1437,7 @@ namespace Catch { << ") must be greater than the shard index (" << m_configData.shardIndex << ")\n" << std::flush; - return 1; + return UnspecifiedErrorExitCode; } CATCH_TRY { @@ -1142,7 +1460,7 @@ namespace Catch { for ( auto const& spec : invalidSpecs ) { reporter->reportInvalidTestSpec( spec ); } - return 1; + return InvalidTestSpecExitCode; } @@ -1156,23 +1474,29 @@ namespace Catch { if ( tests.hadUnmatchedTestSpecs() && m_config->warnAboutUnmatchedTestSpecs() ) { - return 3; + // UnmatchedTestSpecExitCode + return UnmatchedTestSpecExitCode; } if ( totals.testCases.total() == 0 && !m_config->zeroTestsCountAsSuccess() ) { - return 2; + return NoTestsRunExitCode; } - // Note that on unices only the lower 8 bits are usually used, clamping - // the return value to 255 prevents false negative when some multiple - // of 256 tests has failed - return (std::min) (MaxExitCode, static_cast(totals.assertions.failed)); + if ( totals.testCases.total() > 0 && + totals.testCases.total() == totals.testCases.skipped + && !m_config->zeroTestsCountAsSuccess() ) { + return AllTestsSkippedExitCode; + } + + if ( totals.assertions.failed ) { return TestFailureExitCode; } + return 0; + } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) catch( std::exception& ex ) { Catch::cerr() << ex.what() << '\n' << std::flush; - return MaxExitCode; + return UnspecifiedErrorExitCode; } #endif } @@ -1208,26 +1532,26 @@ namespace Catch { static_assert(sizeof(TestCaseProperties) == sizeof(TCP_underlying_type), "The size of the TestCaseProperties is different from the assumed size"); - TestCaseProperties operator|(TestCaseProperties lhs, TestCaseProperties rhs) { + constexpr TestCaseProperties operator|(TestCaseProperties lhs, TestCaseProperties rhs) { return static_cast( static_cast(lhs) | static_cast(rhs) ); } - TestCaseProperties& operator|=(TestCaseProperties& lhs, TestCaseProperties rhs) { + constexpr TestCaseProperties& operator|=(TestCaseProperties& lhs, TestCaseProperties rhs) { lhs = static_cast( static_cast(lhs) | static_cast(rhs) ); return lhs; } - TestCaseProperties operator&(TestCaseProperties lhs, TestCaseProperties rhs) { + constexpr TestCaseProperties operator&(TestCaseProperties lhs, TestCaseProperties rhs) { return static_cast( static_cast(lhs) & static_cast(rhs) ); } - bool applies(TestCaseProperties tcp) { + constexpr bool applies(TestCaseProperties tcp) { static_assert(static_cast(TestCaseProperties::None) == 0, "TestCaseProperties::None must be equal to 0"); return tcp != TestCaseProperties::None; @@ -1266,13 +1590,15 @@ namespace Catch { return "Anonymous test case " + std::to_string(++counter); } - StringRef extractFilenamePart(StringRef filename) { + constexpr StringRef extractFilenamePart(StringRef filename) { size_t lastDot = filename.size(); while (lastDot > 0 && filename[lastDot - 1] != '.') { --lastDot; } - --lastDot; + // In theory we could have filename without any extension in it + if ( lastDot == 0 ) { return StringRef(); } + --lastDot; size_t nameStart = lastDot; while (nameStart > 0 && filename[nameStart - 1] != '/' && filename[nameStart - 1] != '\\') { --nameStart; @@ -1282,7 +1608,7 @@ namespace Catch { } // Returns the upper bound on size of extra tags ([#file]+[.]) - size_t sizeOfExtraTags(StringRef filepath) { + constexpr size_t sizeOfExtraTags(StringRef filepath) { // [.] is 3, [#] is another 3 const size_t extras = 3 + 3; return extractFilenamePart(filepath).size() + extras; @@ -1326,12 +1652,20 @@ namespace Catch { for (size_t idx = 0; idx < originalTags.size(); ++idx) { auto c = originalTags[idx]; if (c == '[') { - assert(!inTag); + CATCH_ENFORCE( + !inTag, + "Found '[' inside a tag while registering test case '" + << _nameAndTags.name << "' at " << _lineInfo ); + inTag = true; tagStart = idx; } if (c == ']') { - assert(inTag); + CATCH_ENFORCE( + inTag, + "Found unmatched ']' while registering test case '" + << _nameAndTags.name << "' at " << _lineInfo ); + inTag = false; tagEnd = idx; assert(tagStart < tagEnd); @@ -1340,7 +1674,11 @@ namespace Catch { // it over to backing storage and actually reference the // backing storage in the saved tags StringRef tagStr = originalTags.substr(tagStart+1, tagEnd - tagStart - 1); - CATCH_ENFORCE(!tagStr.empty(), "Empty tags are not allowed"); + CATCH_ENFORCE( !tagStr.empty(), + "Found an empty tag while registering test case '" + << _nameAndTags.name << "' at " + << _lineInfo ); + enforceNotReservedTag(tagStr, lineInfo); properties |= parseSpecialTag(tagStr); // When copying a tag to the backing storage, we need to @@ -1354,8 +1692,12 @@ namespace Catch { // the tags. internalAppendTag(tagStr); } - (void)inTag; // Silence "set-but-unused" warning in release mode. } + CATCH_ENFORCE( !inTag, + "Found an unclosed tag while registering test case '" + << _nameAndTags.name << "' at " << _lineInfo ); + + // Add [.] if relevant if (isHidden()) { internalAppendTag("."_sr); @@ -1427,10 +1769,6 @@ namespace Catch { return lhs.tags < rhs.tags; } - TestCaseInfo const& TestCaseHandle::getTestCaseInfo() const { - return *m_info; - } - } // end namespace Catch @@ -1438,6 +1776,7 @@ namespace Catch { #include #include #include +#include namespace Catch { @@ -1461,6 +1800,10 @@ namespace Catch { return m_wildcardPattern.matches( testCase.name ); } + void TestSpec::NamePattern::serializeTo( std::ostream& out ) const { + out << '"' << name() << '"'; + } + TestSpec::TagPattern::TagPattern( std::string const& tag, std::string const& filterString ) : Pattern( filterString ) @@ -1473,6 +1816,10 @@ namespace Catch { Tag( m_tag ) ) != end( testCase.tags ); } + void TestSpec::TagPattern::serializeTo( std::ostream& out ) const { + out << name(); + } + bool TestSpec::Filter::matches( TestCaseInfo const& testCase ) const { bool should_use = !testCase.isHidden(); for (auto const& pattern : m_required) { @@ -1489,18 +1836,31 @@ namespace Catch { return should_use; } - std::string TestSpec::Filter::name() const { - std::string name; - for (auto const& p : m_required) { - name += p->name(); + void TestSpec::Filter::serializeTo( std::ostream& out ) const { + bool first = true; + for ( auto const& pattern : m_required ) { + if ( !first ) { + out << ' '; + } + out << *pattern; + first = false; } - for (auto const& p : m_forbidden) { - name += p->name(); + for ( auto const& pattern : m_forbidden ) { + if ( !first ) { + out << ' '; + } + out << *pattern; + first = false; } - return name; } + std::string TestSpec::extractFilterName( Filter const& filter ) { + Catch::ReusableStringStream sstr; + sstr << filter; + return sstr.str(); + } + bool TestSpec::hasFilters() const { return !m_filters.empty(); } @@ -1509,16 +1869,18 @@ namespace Catch { return std::any_of( m_filters.begin(), m_filters.end(), [&]( Filter const& f ){ return f.matches( testCase ); } ); } - TestSpec::Matches TestSpec::matchesByFilter( std::vector const& testCases, IConfig const& config ) const - { - Matches matches( m_filters.size() ); - std::transform( m_filters.begin(), m_filters.end(), matches.begin(), [&]( Filter const& filter ){ + TestSpec::Matches TestSpec::matchesByFilter( std::vector const& testCases, IConfig const& config ) const { + Matches matches; + matches.reserve( m_filters.size() ); + for ( auto const& filter : m_filters ) { std::vector currentMatches; - for( auto const& test : testCases ) - if( isThrowSafe( test, config ) && filter.matches( test.getTestCaseInfo() ) ) + for ( auto const& test : testCases ) + if ( isThrowSafe( test, config ) && + filter.matches( test.getTestCaseInfo() ) ) currentMatches.emplace_back( &test ); - return FilterMatch{ filter.name(), currentMatches }; - } ); + matches.push_back( + FilterMatch{ extractFilterName( filter ), currentMatches } ); + } return matches; } @@ -1526,6 +1888,17 @@ namespace Catch { return m_invalidSpecs; } + void TestSpec::serializeTo( std::ostream& out ) const { + bool first = true; + for ( auto const& filter : m_filters ) { + if ( !first ) { + out << ','; + } + out << filter; + first = false; + } + } + } @@ -1536,7 +1909,7 @@ namespace Catch { namespace { static auto getCurrentNanosecondsSinceEpoch() -> uint64_t { - return std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); + return std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count(); } } // end unnamed namespace @@ -1605,13 +1978,13 @@ namespace Detail { } } // end unnamed namespace - std::string convertIntoString(StringRef string, bool escape_invisibles) { + std::string convertIntoString(StringRef string, bool escapeInvisibles) { std::string ret; // This is enough for the "don't escape invisibles" case, and a good // lower bound on the "escape invisibles" case. ret.reserve(string.size() + 2); - if (!escape_invisibles) { + if (!escapeInvisibles) { ret += '"'; ret += string; ret += '"'; @@ -1689,7 +2062,7 @@ std::string StringMaker::convert(char const* str) { return{ "{null string}" }; } } -std::string StringMaker::convert(char* str) { +std::string StringMaker::convert(char* str) { // NOLINT(readability-non-const-parameter) if (str) { return Detail::convertIntoString( str ); } else { @@ -1786,17 +2159,17 @@ std::string StringMaker::convert(signed char value) { std::string StringMaker::convert(char c) { return ::Catch::Detail::stringify(static_cast(c)); } -std::string StringMaker::convert(unsigned char c) { - return ::Catch::Detail::stringify(static_cast(c)); +std::string StringMaker::convert(unsigned char value) { + return ::Catch::Detail::stringify(static_cast(value)); } -int StringMaker::precision = 5; +int StringMaker::precision = std::numeric_limits::max_digits10; std::string StringMaker::convert(float value) { return Detail::fpToString(value, precision) + 'f'; } -int StringMaker::precision = 10; +int StringMaker::precision = std::numeric_limits::max_digits10; std::string StringMaker::convert(double value) { return Detail::fpToString(value, precision); @@ -1813,6 +2186,7 @@ namespace Catch { diff.passed = passed - other.passed; diff.failed = failed - other.failed; diff.failedButOk = failedButOk - other.failedButOk; + diff.skipped = skipped - other.skipped; return diff; } @@ -1820,14 +2194,15 @@ namespace Catch { passed += other.passed; failed += other.failed; failedButOk += other.failedButOk; + skipped += other.skipped; return *this; } std::uint64_t Counts::total() const { - return passed + failed + failedButOk; + return passed + failed + failedButOk + skipped; } bool Counts::allPassed() const { - return failed == 0 && failedButOk == 0; + return failed == 0 && failedButOk == 0 && skipped == 0; } bool Counts::allOk() const { return failed == 0; @@ -1852,6 +2227,8 @@ namespace Catch { ++diff.testCases.failed; else if( diff.assertions.failedButOk > 0 ) ++diff.testCases.failedButOk; + else if ( diff.assertions.skipped > 0 ) + ++ diff.testCases.skipped; else ++diff.testCases.passed; return diff; @@ -1860,6 +2237,19 @@ namespace Catch { } + + +namespace Catch { + namespace Detail { + void registerTranslatorImpl( + Detail::unique_ptr&& translator ) { + getMutableRegistryHub().registerTranslator( + CATCH_MOVE( translator ) ); + } + } // namespace Detail +} // namespace Catch + + #include namespace Catch { @@ -1890,7 +2280,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 3, 1, 0, "", 0 ); + static Version version( 3, 7, 1, "", 0 ); return version; } @@ -1926,18 +2316,53 @@ namespace Detail { GeneratorUntypedBase::~GeneratorUntypedBase() = default; - auto acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& { + IGeneratorTracker* acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo ) { return getResultCapture().acquireGeneratorTracker( generatorName, lineInfo ); } + IGeneratorTracker* createGeneratorTracker( StringRef generatorName, + SourceLineInfo lineInfo, + GeneratorBasePtr&& generator ) { + return getResultCapture().createGeneratorTracker( + generatorName, lineInfo, CATCH_MOVE( generator ) ); + } + } // namespace Generators } // namespace Catch +#include + +namespace Catch { + namespace Generators { + namespace Detail { + std::uint32_t getSeed() { return sharedRng()(); } + } // namespace Detail + + struct RandomFloatingGenerator::PImpl { + PImpl( long double a, long double b, uint32_t seed ): + rng( seed ), dist( a, b ) {} + + Catch::SimplePcg32 rng; + std::uniform_real_distribution dist; + }; + + RandomFloatingGenerator::RandomFloatingGenerator( + long double a, long double b, std::uint32_t seed) : + m_pimpl(Catch::Detail::make_unique(a, b, seed)) { + static_cast( next() ); + } -std::uint32_t Catch::Generators::Detail::getSeed() { return sharedRng()(); } + RandomFloatingGenerator::~RandomFloatingGenerator() = + default; + bool RandomFloatingGenerator::next() { + m_current_number = m_pimpl->dist( m_pimpl->rng ); + return true; + } + } // namespace Generators +} // namespace Catch @@ -1997,9 +2422,7 @@ namespace Catch { -#include #include -#include namespace Catch { @@ -2034,24 +2457,21 @@ namespace Catch { infoMessages( _infoMessages ), totals( _totals ) { - assertionResult.m_resultData.lazyExpression.m_transientExpression = _assertionResult.m_resultData.lazyExpression.m_transientExpression; - if( assertionResult.hasMessage() ) { // Copy message into messages list. // !TBD This should have been done earlier, somewhere MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() ); - builder << assertionResult.getMessage(); - builder.m_info.message = builder.m_stream.str(); + builder.m_info.message = static_cast(assertionResult.getMessage()); - infoMessages.push_back( builder.m_info ); + infoMessages.push_back( CATCH_MOVE(builder.m_info) ); } } - SectionStats::SectionStats( SectionInfo const& _sectionInfo, + SectionStats::SectionStats( SectionInfo&& _sectionInfo, Counts const& _assertions, double _durationInSeconds, bool _missingAssertions ) - : sectionInfo( _sectionInfo ), + : sectionInfo( CATCH_MOVE(_sectionInfo) ), assertions( _assertions ), durationInSeconds( _durationInSeconds ), missingAssertions( _missingAssertions ) @@ -2060,13 +2480,13 @@ namespace Catch { TestCaseStats::TestCaseStats( TestCaseInfo const& _testInfo, Totals const& _totals, - std::string const& _stdOut, - std::string const& _stdErr, + std::string&& _stdOut, + std::string&& _stdErr, bool _aborting ) : testInfo( &_testInfo ), totals( _totals ), - stdOut( _stdOut ), - stdErr( _stdErr ), + stdOut( CATCH_MOVE(_stdOut) ), + stdErr( CATCH_MOVE(_stdErr) ), aborting( _aborting ) {} @@ -2095,14 +2515,6 @@ namespace Catch { namespace Catch { - IReporterRegistry::~IReporterRegistry() = default; -} - - - - -namespace Catch { - ITestInvoker::~ITestInvoker() = default; ITestCaseRegistry::~ITestCaseRegistry() = default; } @@ -2117,13 +2529,15 @@ namespace Catch { ResultDisposition::Flags resultDisposition ) : m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition }, m_resultCapture( getResultCapture() ) - {} + { + m_resultCapture.notifyAssertionStarted( m_assertionInfo ); + } void AssertionHandler::handleExpr( ITransientExpression const& expr ) { m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction ); } - void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef message) { - m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction ); + void AssertionHandler::handleMessage(ResultWas::OfType resultType, std::string&& message) { + m_resultCapture.handleMessage( m_assertionInfo, resultType, CATCH_MOVE(message), m_reaction ); } auto AssertionHandler::allowThrows() const -> bool { @@ -2131,7 +2545,7 @@ namespace Catch { } void AssertionHandler::complete() { - setCompleted(); + m_completed = true; if( m_reaction.shouldDebugBreak ) { // If you find your debugger stopping you here then go one level up on the @@ -2141,15 +2555,11 @@ namespace Catch { CATCH_BREAK_INTO_DEBUGGER(); } if (m_reaction.shouldThrow) { -#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) - throw Catch::TestFailureException(); -#else - CATCH_ERROR( "Test failure requires aborting test!" ); -#endif + throw_test_failure_exception(); + } + if ( m_reaction.shouldSkip ) { + throw_test_skip_exception(); } - } - void AssertionHandler::setCompleted() { - m_completed = true; } void AssertionHandler::handleUnexpectedInflightException() { @@ -2173,8 +2583,8 @@ namespace Catch { // This is the overload that takes a string and infers the Equals matcher from it // The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp - void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ) { - handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString ); + void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str ) { + handleExceptionMatchExpr( handler, Matchers::Equals( str ) ); } } // namespace Catch @@ -2222,13 +2632,29 @@ namespace { ; } - std::string normaliseOpt( std::string const& optName ) { -#ifdef CATCH_PLATFORM_WINDOWS - if ( optName[0] == '/' ) - return "-" + optName.substr( 1 ); - else + Catch::StringRef normaliseOpt( Catch::StringRef optName ) { + if ( optName[0] == '-' +#if defined(CATCH_PLATFORM_WINDOWS) + || optName[0] == '/' #endif - return optName; + ) { + return optName.substr( 1, optName.size() ); + } + + return optName; + } + + static size_t find_first_separator(Catch::StringRef sr) { + auto is_separator = []( char c ) { + return c == ' ' || c == ':' || c == '='; + }; + size_t pos = 0; + while (pos < sr.size()) { + if (is_separator(sr[pos])) { return pos; } + ++pos; + } + + return Catch::StringRef::npos; } } // namespace @@ -2246,23 +2672,23 @@ namespace Catch { } if ( it != itEnd ) { - auto const& next = *it; + StringRef next = *it; if ( isOptPrefix( next[0] ) ) { - auto delimiterPos = next.find_first_of( " :=" ); - if ( delimiterPos != std::string::npos ) { + auto delimiterPos = find_first_separator(next); + if ( delimiterPos != StringRef::npos ) { m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } ); m_tokenBuffer.push_back( { TokenType::Argument, - next.substr( delimiterPos + 1 ) } ); + next.substr( delimiterPos + 1, next.size() ) } ); } else { - if ( next[1] != '-' && next.size() > 2 ) { - std::string opt = "- "; + if ( next.size() > 1 && next[1] != '-' && next.size() > 2 ) { + // Combined short args, e.g. "-ab" for "-a -b" for ( size_t i = 1; i < next.size(); ++i ) { - opt[1] = next[i]; m_tokenBuffer.push_back( - { TokenType::Option, opt } ); + { TokenType::Option, + next.substr( i, 1 ) } ); } } else { m_tokenBuffer.push_back( @@ -2322,12 +2748,12 @@ namespace Catch { size_t ParserBase::cardinality() const { return 1; } InternalParseResult ParserBase::parse( Args const& args ) const { - return parse( args.exeName(), TokenStream( args ) ); + return parse( static_cast(args.exeName()), TokenStream( args ) ); } ParseState::ParseState( ParseResultType type, - TokenStream const& remainingTokens ): - m_type( type ), m_remainingTokens( remainingTokens ) {} + TokenStream remainingTokens ): + m_type( type ), m_remainingTokens( CATCH_MOVE(remainingTokens) ) {} ParserResult BoundFlagRef::setFlag( bool flag ) { m_ref = flag; @@ -2345,34 +2771,34 @@ namespace Catch { } // namespace Detail Detail::InternalParseResult Arg::parse(std::string const&, - Detail::TokenStream const& tokens) const { + Detail::TokenStream tokens) const { auto validationResult = validate(); if (!validationResult) return Detail::InternalParseResult(validationResult); - auto remainingTokens = tokens; - auto const& token = *remainingTokens; + auto token = *tokens; if (token.type != Detail::TokenType::Argument) return Detail::InternalParseResult::ok(Detail::ParseState( - ParseResultType::NoMatch, remainingTokens)); + ParseResultType::NoMatch, CATCH_MOVE(tokens))); assert(!m_ref->isFlag()); auto valueRef = static_cast(m_ref.get()); - auto result = valueRef->setValue(remainingTokens->token); - if (!result) - return Detail::InternalParseResult(result); + auto result = valueRef->setValue(static_cast(token.token)); + if ( !result ) + return Detail::InternalParseResult( result ); else - return Detail::InternalParseResult::ok(Detail::ParseState( - ParseResultType::Matched, ++remainingTokens)); + return Detail::InternalParseResult::ok( + Detail::ParseState( ParseResultType::Matched, + CATCH_MOVE( ++tokens ) ) ); } Opt::Opt(bool& ref) : ParserRefImpl(std::make_shared(ref)) {} - std::vector Opt::getHelpColumns() const { - std::ostringstream oss; + Detail::HelpColumns Opt::getHelpColumns() const { + ReusableStringStream oss; bool first = true; for (auto const& opt : m_optNames) { if (first) @@ -2383,10 +2809,10 @@ namespace Catch { } if (!m_hint.empty()) oss << " <" << m_hint << '>'; - return { { oss.str(), m_description } }; + return { oss.str(), m_description }; } - bool Opt::isMatch(std::string const& optToken) const { + bool Opt::isMatch(StringRef optToken) const { auto normalisedToken = normaliseOpt(optToken); for (auto const& name : m_optNames) { if (normaliseOpt(name) == normalisedToken) @@ -2396,15 +2822,14 @@ namespace Catch { } Detail::InternalParseResult Opt::parse(std::string const&, - Detail::TokenStream const& tokens) const { + Detail::TokenStream tokens) const { auto validationResult = validate(); if (!validationResult) return Detail::InternalParseResult(validationResult); - auto remainingTokens = tokens; - if (remainingTokens && - remainingTokens->type == Detail::TokenType::Option) { - auto const& token = *remainingTokens; + if (tokens && + tokens->type == Detail::TokenType::Option) { + auto const& token = *tokens; if (isMatch(token.token)) { if (m_ref->isFlag()) { auto flagRef = @@ -2416,35 +2841,35 @@ namespace Catch { if (result.value() == ParseResultType::ShortCircuitAll) return Detail::InternalParseResult::ok(Detail::ParseState( - result.value(), remainingTokens)); + result.value(), CATCH_MOVE(tokens))); } else { auto valueRef = static_cast( m_ref.get()); - ++remainingTokens; - if (!remainingTokens) + ++tokens; + if (!tokens) return Detail::InternalParseResult::runtimeError( "Expected argument following " + token.token); - auto const& argToken = *remainingTokens; + auto const& argToken = *tokens; if (argToken.type != Detail::TokenType::Argument) return Detail::InternalParseResult::runtimeError( "Expected argument following " + token.token); - const auto result = valueRef->setValue(argToken.token); + const auto result = valueRef->setValue(static_cast(argToken.token)); if (!result) return Detail::InternalParseResult(result); if (result.value() == ParseResultType::ShortCircuitAll) return Detail::InternalParseResult::ok(Detail::ParseState( - result.value(), remainingTokens)); + result.value(), CATCH_MOVE(tokens))); } return Detail::InternalParseResult::ok(Detail::ParseState( - ParseResultType::Matched, ++remainingTokens)); + ParseResultType::Matched, CATCH_MOVE(++tokens))); } } return Detail::InternalParseResult::ok( - Detail::ParseState(ParseResultType::NoMatch, remainingTokens)); + Detail::ParseState(ParseResultType::NoMatch, CATCH_MOVE(tokens))); } Detail::Result Opt::validate() const { @@ -2476,9 +2901,9 @@ namespace Catch { Detail::InternalParseResult ExeName::parse(std::string const&, - Detail::TokenStream const& tokens) const { + Detail::TokenStream tokens) const { return Detail::InternalParseResult::ok( - Detail::ParseState(ParseResultType::NoMatch, tokens)); + Detail::ParseState(ParseResultType::NoMatch, CATCH_MOVE(tokens))); } ParserResult ExeName::set(std::string const& newName) { @@ -2508,9 +2933,9 @@ namespace Catch { std::vector Parser::getHelpColumns() const { std::vector cols; + cols.reserve( m_options.size() ); for ( auto const& o : m_options ) { - auto childCols = o.getHelpColumns(); - cols.insert( cols.end(), childCols.begin(), childCols.end() ); + cols.push_back(o.getHelpColumns()); } return cols; } @@ -2548,12 +2973,12 @@ namespace Catch { optWidth = ( std::min )( optWidth, consoleWidth / 2 ); - for ( auto const& cols : rows ) { - auto row = TextFlow::Column( cols.left ) + for ( auto& cols : rows ) { + auto row = TextFlow::Column( CATCH_MOVE(cols.left) ) .width( optWidth ) .indent( 2 ) + TextFlow::Spacer( 4 ) + - TextFlow::Column( cols.right ) + TextFlow::Column( static_cast(cols.descriptions) ) .width( consoleWidth - 7 - optWidth ); os << row << '\n'; } @@ -2575,7 +3000,7 @@ namespace Catch { Detail::InternalParseResult Parser::parse( std::string const& exeName, - Detail::TokenStream const& tokens ) const { + Detail::TokenStream tokens ) const { struct ParserInfo { ParserBase const* parser = nullptr; @@ -2593,7 +3018,7 @@ namespace Catch { m_exeName.set( exeName ); auto result = Detail::InternalParseResult::ok( - Detail::ParseState( ParseResultType::NoMatch, tokens ) ); + Detail::ParseState( ParseResultType::NoMatch, CATCH_MOVE(tokens) ) ); while ( result.value().remainingTokens() ) { bool tokenParsed = false; @@ -2601,7 +3026,7 @@ namespace Catch { if ( parseInfo.parser->cardinality() == 0 || parseInfo.count < parseInfo.parser->cardinality() ) { result = parseInfo.parser->parse( - exeName, result.value().remainingTokens() ); + exeName, CATCH_MOVE(result).value().remainingTokens() ); if ( !result ) return result; if ( result.value().type() != @@ -2627,7 +3052,7 @@ namespace Catch { Args::Args(int argc, char const* const* argv) : m_exeName(argv[0]), m_args(argv + 1, argv + argc) {} - Args::Args(std::initializer_list args) : + Args::Args(std::initializer_list args) : m_exeName(*args.begin()), m_args(args.begin() + 1, args.end()) {} @@ -2679,7 +3104,7 @@ namespace Catch { line = trim(line); if( !line.empty() && !startsWith( line, '#' ) ) { if( !startsWith( line, '"' ) ) - line = '"' + line + '"'; + line = '"' + CATCH_MOVE(line) + '"'; config.testsOrTags.push_back( line ); config.testsOrTags.emplace_back( "," ); } @@ -2710,23 +3135,14 @@ namespace Catch { return ParserResult::ok(ParseResultType::Matched); } - CATCH_TRY { - std::size_t parsedTo = 0; - unsigned long parsedSeed = std::stoul(seed, &parsedTo, 0); - if (parsedTo != seed.size()) { - return ParserResult::runtimeError("Could not parse '" + seed + "' as seed"); - } - - // TODO: Ideally we could parse unsigned int directly, - // but the stdlib doesn't provide helper for that - // type. After this is refactored to use fixed size - // type, we should check the parsed value is in range - // of the underlying type. - config.rngSeed = static_cast(parsedSeed); - return ParserResult::ok(ParseResultType::Matched); - } CATCH_CATCH_ANON(std::exception const&) { - return ParserResult::runtimeError("Could not parse '" + seed + "' as seed"); + // TODO: ideally we should be parsing uint32_t directly + // fix this later when we add new parse overload + auto parsedSeed = parseUInt( seed, 0 ); + if ( !parsedSeed ) { + return ParserResult::runtimeError( "Could not parse '" + seed + "' as seed" ); } + config.rngSeed = *parsedSeed; + return ParserResult::ok( ParseResultType::Matched ); }; auto const setDefaultColourMode = [&]( std::string const& colourMode ) { Optional maybeMode = Catch::Detail::stringToColourMode(toLower( colourMode )); @@ -2786,7 +3202,7 @@ namespace Catch { auto const& reporterSpec = *parsed; - IReporterRegistry::FactoryMap const& factories = + auto const& factories = getRegistryHub().getReporterRegistry().getFactories(); auto result = factories.find( reporterSpec.name() ); @@ -2818,42 +3234,29 @@ namespace Catch { return ParserResult::ok( ParseResultType::Matched ); }; auto const setShardCount = [&]( std::string const& shardCount ) { - CATCH_TRY{ - std::size_t parsedTo = 0; - int64_t parsedCount = std::stoll(shardCount, &parsedTo, 0); - if (parsedTo != shardCount.size()) { - return ParserResult::runtimeError("Could not parse '" + shardCount + "' as shard count"); - } - if (parsedCount <= 0) { - return ParserResult::runtimeError("Shard count must be a positive number"); - } - - config.shardCount = static_cast(parsedCount); - return ParserResult::ok(ParseResultType::Matched); - } CATCH_CATCH_ANON(std::exception const&) { - return ParserResult::runtimeError("Could not parse '" + shardCount + "' as shard count"); + auto parsedCount = parseUInt( shardCount ); + if ( !parsedCount ) { + return ParserResult::runtimeError( + "Could not parse '" + shardCount + "' as shard count" ); + } + if ( *parsedCount == 0 ) { + return ParserResult::runtimeError( + "Shard count must be positive" ); } + config.shardCount = *parsedCount; + return ParserResult::ok( ParseResultType::Matched ); }; auto const setShardIndex = [&](std::string const& shardIndex) { - CATCH_TRY{ - std::size_t parsedTo = 0; - int64_t parsedIndex = std::stoll(shardIndex, &parsedTo, 0); - if (parsedTo != shardIndex.size()) { - return ParserResult::runtimeError("Could not parse '" + shardIndex + "' as shard index"); - } - if (parsedIndex < 0) { - return ParserResult::runtimeError("Shard index must be a non-negative number"); - } - - config.shardIndex = static_cast(parsedIndex); - return ParserResult::ok(ParseResultType::Matched); - } CATCH_CATCH_ANON(std::exception const&) { - return ParserResult::runtimeError("Could not parse '" + shardIndex + "' as shard index"); + auto parsedIndex = parseUInt( shardIndex ); + if ( !parsedIndex ) { + return ParserResult::runtimeError( + "Could not parse '" + shardIndex + "' as shard index" ); } + config.shardIndex = *parsedIndex; + return ParserResult::ok( ParseResultType::Matched ); }; - auto cli = ExeName( config.processName ) | Help( config.showHelp ) @@ -2955,8 +3358,8 @@ namespace Catch { ( "split the tests to execute into this many groups" ) | Opt( setShardIndex, "shard index" ) ["--shard-index"] - ( "index of the group of tests to execute (see --shard-count)" ) | - Opt( config.allowZeroTests ) + ( "index of the group of tests to execute (see --shard-count)" ) + | Opt( config.allowZeroTests ) ["--allow-running-no-tests"] ( "Treat 'No tests run' as a success" ) | Arg( config.testsOrTags, "test name|pattern|tags" ) @@ -3037,7 +3440,7 @@ namespace Catch { namespace { //! A do-nothing implementation of colour, used as fallback for unknown //! platforms, and when the user asks to deactivate all colours. - class NoColourImpl : public ColourImpl { + class NoColourImpl final : public ColourImpl { public: NoColourImpl( IStream* stream ): ColourImpl( stream ) {} @@ -3055,7 +3458,7 @@ namespace Catch { namespace Catch { namespace { - class Win32ColourImpl : public ColourImpl { + class Win32ColourImpl final : public ColourImpl { public: Win32ColourImpl(IStream* stream): ColourImpl(stream) { @@ -3121,7 +3524,7 @@ namespace { namespace Catch { namespace { - class ANSIColourImpl : public ColourImpl { + class ANSIColourImpl final : public ColourImpl { public: ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {} @@ -3182,21 +3585,21 @@ namespace { namespace Catch { - Detail::unique_ptr makeColourImpl( ColourMode implSelection, + Detail::unique_ptr makeColourImpl( ColourMode colourSelection, IStream* stream ) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) - if ( implSelection == ColourMode::Win32 ) { + if ( colourSelection == ColourMode::Win32 ) { return Detail::make_unique( stream ); } #endif - if ( implSelection == ColourMode::ANSI ) { + if ( colourSelection == ColourMode::ANSI ) { return Detail::make_unique( stream ); } - if ( implSelection == ColourMode::None ) { + if ( colourSelection == ColourMode::None ) { return Detail::make_unique( stream ); } - if ( implSelection == ColourMode::PlatformDefault) { + if ( colourSelection == ColourMode::PlatformDefault) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) if ( Win32ColourImpl::useImplementationForStream( *stream ) ) { return Detail::make_unique( stream ); @@ -3208,7 +3611,7 @@ namespace Catch { return Detail::make_unique( stream ); } - CATCH_ERROR( "Could not create colour impl for selection " << static_cast(implSelection) ); + CATCH_ERROR( "Could not create colour impl for selection " << static_cast(colourSelection) ); } bool isColourImplAvailable( ColourMode colourSelection ) { @@ -3237,49 +3640,21 @@ namespace Catch { namespace Catch { - class Context : public IMutableContext, private Detail::NonCopyable { - - public: // IContext - IResultCapture* getResultCapture() override { - return m_resultCapture; - } - - IConfig const* getConfig() const override { - return m_config; - } - - ~Context() override; - - public: // IMutableContext - void setResultCapture( IResultCapture* resultCapture ) override { - m_resultCapture = resultCapture; - } - void setConfig( IConfig const* config ) override { - m_config = config; - } + Context* Context::currentContext = nullptr; - friend IMutableContext& getCurrentMutableContext(); - - private: - IConfig const* m_config = nullptr; - IResultCapture* m_resultCapture = nullptr; - }; - - IMutableContext *IMutableContext::currentContext = nullptr; - - void IMutableContext::createContext() - { + void cleanUpContext() { + delete Context::currentContext; + Context::currentContext = nullptr; + } + void Context::createContext() { currentContext = new Context(); } - void cleanUpContext() { - delete IMutableContext::currentContext; - IMutableContext::currentContext = nullptr; + Context& getCurrentMutableContext() { + if ( !Context::currentContext ) { Context::createContext(); } + // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn) + return *Context::currentContext; } - IContext::~IContext() = default; - IMutableContext::~IMutableContext() = default; - Context::~Context() = default; - SimplePcg32& sharedRng() { static SimplePcg32 s_rng; @@ -3438,7 +3813,12 @@ namespace Catch { namespace Catch { - ITransientExpression::~ITransientExpression() = default; + void ITransientExpression::streamReconstructedExpression( + std::ostream& os ) const { + // We can't make this function pure virtual to keep ITransientExpression + // constexpr, so we write error message instead + os << "Some class derived from ITransientExpression without overriding streamReconstructedExpression"; + } void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) { if( lhs.size() + rhs.size() < 40 && @@ -3517,7 +3897,7 @@ namespace Catch { return parsed; } - EnumInfo::~EnumInfo() {} + EnumInfo::~EnumInfo() = default; StringRef EnumInfo::lookup( int value ) const { for( auto const& valueToName : m_values ) { @@ -3562,10 +3942,27 @@ namespace Catch { +#include + namespace Catch { - ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() { +#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) + namespace { + static std::string tryTranslators( + std::vector< + Detail::unique_ptr> const& translators ) { + if ( translators.empty() ) { + std::rethrow_exception( std::current_exception() ); + } else { + return translators[0]->translate( translators.begin() + 1, + translators.end() ); + } + } + } +#endif //!defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) + + ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() = default; void ExceptionTranslatorRegistry::registerTranslator( Detail::unique_ptr&& translator ) { m_translators.push_back( CATCH_MOVE( translator ) ); @@ -3588,13 +3985,16 @@ namespace Catch { // First we try user-registered translators. If none of them can // handle the exception, it will be rethrown handled by our defaults. try { - return tryTranslators(); + return tryTranslators(m_translators); } // To avoid having to handle TFE explicitly everywhere, we just // rethrow it so that it goes back up the caller. catch( TestFailureException& ) { std::rethrow_exception(std::current_exception()); } + catch( TestSkipException& ) { + std::rethrow_exception(std::current_exception()); + } catch( std::exception const& ex ) { return ex.what(); } @@ -3609,25 +4009,12 @@ namespace Catch { } } - std::string ExceptionTranslatorRegistry::tryTranslators() const { - if (m_translators.empty()) { - std::rethrow_exception(std::current_exception()); - } else { - return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end()); - } - } - #else // ^^ Exceptions are enabled // Exceptions are disabled vv std::string ExceptionTranslatorRegistry::translateActiveException() const { CATCH_INTERNAL_ERROR("Attempted to translate active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!"); } - - std::string ExceptionTranslatorRegistry::tryTranslators() const { - CATCH_INTERNAL_ERROR("Attempted to use exception translators under CATCH_CONFIG_DISABLE_EXCEPTIONS!"); - } #endif - } @@ -3884,6 +4271,17 @@ namespace Catch { return i; } +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + bool directCompare( float lhs, float rhs ) { return lhs == rhs; } + bool directCompare( double lhs, double rhs ) { return lhs == rhs; } +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic pop +#endif + + } // end namespace Detail } // end namespace Catch @@ -3891,6 +4289,35 @@ namespace Catch { + +#include + +namespace Catch { + namespace Detail { + +#if !defined (CATCH_CONFIG_GETENV) + char const* getEnv( char const* ) { return nullptr; } +#else + + char const* getEnv( char const* varName ) { +# if defined( _MSC_VER ) +# pragma warning( push ) +# pragma warning( disable : 4996 ) // use getenv_s instead of getenv +# endif + + return std::getenv( varName ); + +# if defined( _MSC_VER ) +# pragma warning( pop ) +# endif + } +#endif +} // namespace Detail +} // namespace Catch + + + + #include #include #include @@ -3903,7 +4330,7 @@ namespace Catch { namespace Detail { namespace { template - class StreamBufImpl : public std::streambuf { + class StreamBufImpl final : public std::streambuf { char data[bufferSize]; WriterF m_writer; @@ -3951,14 +4378,14 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - class FileStream : public IStream { + class FileStream final : public IStream { std::ofstream m_ofs; public: FileStream( std::string const& filename ) { m_ofs.open( filename.c_str() ); CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << '\'' ); + m_ofs << std::unitbuf; } - ~FileStream() override = default; public: // IStream std::ostream& stream() override { return m_ofs; @@ -3967,13 +4394,12 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - class CoutStream : public IStream { + class CoutStream final : public IStream { std::ostream m_os; public: // Store the streambuf from cout up-front because // cout may get redirected when running tests CoutStream() : m_os( Catch::cout().rdbuf() ) {} - ~CoutStream() override = default; public: // IStream std::ostream& stream() override { return m_os; } @@ -3987,7 +4413,6 @@ namespace Detail { // Store the streambuf from cerr up-front because // cout may get redirected when running tests CerrStream(): m_os( Catch::cerr().rdbuf() ) {} - ~CerrStream() override = default; public: // IStream std::ostream& stream() override { return m_os; } @@ -3996,7 +4421,7 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - class DebugOutStream : public IStream { + class DebugOutStream final : public IStream { Detail::unique_ptr> m_streamBuf; std::ostream m_os; public: @@ -4005,8 +4430,6 @@ namespace Detail { m_os( m_streamBuf.get() ) {} - ~DebugOutStream() override = default; - public: // IStream std::ostream& stream() override { return m_os; } }; @@ -4038,6 +4461,147 @@ namespace Detail { +namespace Catch { + void JsonUtils::indent( std::ostream& os, std::uint64_t level ) { + for ( std::uint64_t i = 0; i < level; ++i ) { + os << " "; + } + } + void JsonUtils::appendCommaNewline( std::ostream& os, + bool& should_comma, + std::uint64_t level ) { + if ( should_comma ) { os << ','; } + should_comma = true; + os << '\n'; + indent( os, level ); + } + + JsonObjectWriter::JsonObjectWriter( std::ostream& os ): + JsonObjectWriter{ os, 0 } {} + + JsonObjectWriter::JsonObjectWriter( std::ostream& os, + std::uint64_t indent_level ): + m_os{ os }, m_indent_level{ indent_level } { + m_os << '{'; + } + JsonObjectWriter::JsonObjectWriter( JsonObjectWriter&& source ) noexcept: + m_os{ source.m_os }, + m_indent_level{ source.m_indent_level }, + m_should_comma{ source.m_should_comma }, + m_active{ source.m_active } { + source.m_active = false; + } + + JsonObjectWriter::~JsonObjectWriter() { + if ( !m_active ) { return; } + + m_os << '\n'; + JsonUtils::indent( m_os, m_indent_level ); + m_os << '}'; + } + + JsonValueWriter JsonObjectWriter::write( StringRef key ) { + JsonUtils::appendCommaNewline( + m_os, m_should_comma, m_indent_level + 1 ); + + m_os << '"' << key << "\": "; + return JsonValueWriter{ m_os, m_indent_level + 1 }; + } + + JsonArrayWriter::JsonArrayWriter( std::ostream& os ): + JsonArrayWriter{ os, 0 } {} + JsonArrayWriter::JsonArrayWriter( std::ostream& os, + std::uint64_t indent_level ): + m_os{ os }, m_indent_level{ indent_level } { + m_os << '['; + } + JsonArrayWriter::JsonArrayWriter( JsonArrayWriter&& source ) noexcept: + m_os{ source.m_os }, + m_indent_level{ source.m_indent_level }, + m_should_comma{ source.m_should_comma }, + m_active{ source.m_active } { + source.m_active = false; + } + JsonArrayWriter::~JsonArrayWriter() { + if ( !m_active ) { return; } + + m_os << '\n'; + JsonUtils::indent( m_os, m_indent_level ); + m_os << ']'; + } + + JsonObjectWriter JsonArrayWriter::writeObject() { + JsonUtils::appendCommaNewline( + m_os, m_should_comma, m_indent_level + 1 ); + return JsonObjectWriter{ m_os, m_indent_level + 1 }; + } + + JsonArrayWriter JsonArrayWriter::writeArray() { + JsonUtils::appendCommaNewline( + m_os, m_should_comma, m_indent_level + 1 ); + return JsonArrayWriter{ m_os, m_indent_level + 1 }; + } + + JsonArrayWriter& JsonArrayWriter::write( bool value ) { + return writeImpl( value ); + } + + JsonValueWriter::JsonValueWriter( std::ostream& os ): + JsonValueWriter{ os, 0 } {} + + JsonValueWriter::JsonValueWriter( std::ostream& os, + std::uint64_t indent_level ): + m_os{ os }, m_indent_level{ indent_level } {} + + JsonObjectWriter JsonValueWriter::writeObject() && { + return JsonObjectWriter{ m_os, m_indent_level }; + } + + JsonArrayWriter JsonValueWriter::writeArray() && { + return JsonArrayWriter{ m_os, m_indent_level }; + } + + void JsonValueWriter::write( Catch::StringRef value ) && { + writeImpl( value, true ); + } + + void JsonValueWriter::write( bool value ) && { + writeImpl( value ? "true"_sr : "false"_sr, false ); + } + + void JsonValueWriter::writeImpl( Catch::StringRef value, bool quote ) { + if ( quote ) { m_os << '"'; } + for (char c : value) { + // Escape list taken from https://www.json.org/json-en.html, + // string definition. + // Note that while forward slash _can_ be escaped, it does + // not have to be, if JSON is not further embedded somewhere + // where forward slash is meaningful. + if ( c == '"' ) { + m_os << "\\\""; + } else if ( c == '\\' ) { + m_os << "\\\\"; + } else if ( c == '\b' ) { + m_os << "\\b"; + } else if ( c == '\f' ) { + m_os << "\\f"; + } else if ( c == '\n' ) { + m_os << "\\n"; + } else if ( c == '\r' ) { + m_os << "\\r"; + } else if ( c == '\t' ) { + m_os << "\\t"; + } else { + m_os << c; + } + } + if ( quote ) { m_os << '"'; } + } + +} // namespace Catch + + + namespace Catch { @@ -4080,7 +4644,7 @@ namespace Catch { #else // ^^ Windows crt debug heap enabled // Windows crt debug heap disabled vv - Catch::LeakDetector::LeakDetector() {} + Catch::LeakDetector::LeakDetector() = default; #endif // CATCH_CONFIG_WINDOWS_CRTDBG @@ -4091,7 +4655,6 @@ Catch::LeakDetector::~LeakDetector() { - namespace Catch { namespace { @@ -4126,7 +4689,7 @@ namespace Catch { void listReporters(IEventListener& reporter) { std::vector descriptions; - IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); + auto const& factories = getRegistryHub().getReporterRegistry().getFactories(); descriptions.reserve(factories.size()); for (auto const& fac : factories) { descriptions.push_back({ fac.first, fac.second->getDescription() }); @@ -4246,140 +4809,374 @@ namespace Catch { #include #include +#include #include -#if defined(CATCH_CONFIG_NEW_CAPTURE) - #if defined(_MSC_VER) - #include //_dup and _dup2 - #define dup _dup - #define dup2 _dup2 - #define fileno _fileno - #else - #include // dup and dup2 - #endif +#if defined( CATCH_CONFIG_NEW_CAPTURE ) +# if defined( _MSC_VER ) +# include //_dup and _dup2 +# define dup _dup +# define dup2 _dup2 +# define fileno _fileno +# else +# include // dup and dup2 +# endif #endif - namespace Catch { - RedirectedStream::RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream ) - : m_originalStream( originalStream ), - m_redirectionStream( redirectionStream ), - m_prevBuf( m_originalStream.rdbuf() ) - { - m_originalStream.rdbuf( m_redirectionStream.rdbuf() ); - } + namespace { + //! A no-op implementation, used if no reporter wants output + //! redirection. + class NoopRedirect : public OutputRedirect { + void activateImpl() override {} + void deactivateImpl() override {} + std::string getStdout() override { return {}; } + std::string getStderr() override { return {}; } + void clearBuffers() override {} + }; - RedirectedStream::~RedirectedStream() { - m_originalStream.rdbuf( m_prevBuf ); - } + /** + * Redirects specific stream's rdbuf with another's. + * + * Redirection can be stopped and started on-demand, assumes + * that the underlying stream's rdbuf aren't changed by other + * users. + */ + class RedirectedStreamNew { + std::ostream& m_originalStream; + std::ostream& m_redirectionStream; + std::streambuf* m_prevBuf; - RedirectedStdOut::RedirectedStdOut() : m_cout( Catch::cout(), m_rss.get() ) {} - auto RedirectedStdOut::str() const -> std::string { return m_rss.str(); } + public: + RedirectedStreamNew( std::ostream& originalStream, + std::ostream& redirectionStream ): + m_originalStream( originalStream ), + m_redirectionStream( redirectionStream ), + m_prevBuf( m_originalStream.rdbuf() ) {} - RedirectedStdErr::RedirectedStdErr() - : m_cerr( Catch::cerr(), m_rss.get() ), - m_clog( Catch::clog(), m_rss.get() ) - {} - auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); } + void startRedirect() { + m_originalStream.rdbuf( m_redirectionStream.rdbuf() ); + } + void stopRedirect() { m_originalStream.rdbuf( m_prevBuf ); } + }; - RedirectedStreams::RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr) - : m_redirectedCout(redirectedCout), - m_redirectedCerr(redirectedCerr) - {} + /** + * Redirects the `std::cout`, `std::cerr`, `std::clog` streams, + * but does not touch the actual `stdout`/`stderr` file descriptors. + */ + class StreamRedirect : public OutputRedirect { + ReusableStringStream m_redirectedOut, m_redirectedErr; + RedirectedStreamNew m_cout, m_cerr, m_clog; - RedirectedStreams::~RedirectedStreams() { - m_redirectedCout += m_redirectedStdOut.str(); - m_redirectedCerr += m_redirectedStdErr.str(); - } + public: + StreamRedirect(): + m_cout( Catch::cout(), m_redirectedOut.get() ), + m_cerr( Catch::cerr(), m_redirectedErr.get() ), + m_clog( Catch::clog(), m_redirectedErr.get() ) {} + + void activateImpl() override { + m_cout.startRedirect(); + m_cerr.startRedirect(); + m_clog.startRedirect(); + } + void deactivateImpl() override { + m_cout.stopRedirect(); + m_cerr.stopRedirect(); + m_clog.stopRedirect(); + } + std::string getStdout() override { return m_redirectedOut.str(); } + std::string getStderr() override { return m_redirectedErr.str(); } + void clearBuffers() override { + m_redirectedOut.str( "" ); + m_redirectedErr.str( "" ); + } + }; -#if defined(CATCH_CONFIG_NEW_CAPTURE) +#if defined( CATCH_CONFIG_NEW_CAPTURE ) -#if defined(_MSC_VER) - TempFile::TempFile() { - if (tmpnam_s(m_buffer)) { - CATCH_RUNTIME_ERROR("Could not get a temp filename"); - } - if (fopen_s(&m_file, m_buffer, "w+")) { - char buffer[100]; - if (strerror_s(buffer, errno)) { - CATCH_RUNTIME_ERROR("Could not translate errno to a string"); + // Windows's implementation of std::tmpfile is terrible (it tries + // to create a file inside system folder, thus requiring elevated + // privileges for the binary), so we have to use tmpnam(_s) and + // create the file ourselves there. + class TempFile { + public: + TempFile( TempFile const& ) = delete; + TempFile& operator=( TempFile const& ) = delete; + TempFile( TempFile&& ) = delete; + TempFile& operator=( TempFile&& ) = delete; + +# if defined( _MSC_VER ) + TempFile() { + if ( tmpnam_s( m_buffer ) ) { + CATCH_RUNTIME_ERROR( "Could not get a temp filename" ); + } + if ( fopen_s( &m_file, m_buffer, "wb+" ) ) { + char buffer[100]; + if ( strerror_s( buffer, errno ) ) { + CATCH_RUNTIME_ERROR( + "Could not translate errno to a string" ); + } + CATCH_RUNTIME_ERROR( "Could not open the temp file: '" + << m_buffer + << "' because: " << buffer ); + } + } +# else + TempFile() { + m_file = std::tmpfile(); + if ( !m_file ) { + CATCH_RUNTIME_ERROR( "Could not create a temp file." ); + } + } +# endif + + ~TempFile() { + // TBD: What to do about errors here? + std::fclose( m_file ); + // We manually create the file on Windows only, on Linux + // it will be autodeleted +# if defined( _MSC_VER ) + std::remove( m_buffer ); +# endif + } + + std::FILE* getFile() { return m_file; } + std::string getContents() { + ReusableStringStream sstr; + constexpr long buffer_size = 100; + char buffer[buffer_size + 1] = {}; + long current_pos = ftell( m_file ); + CATCH_ENFORCE( current_pos >= 0, + "ftell failed, errno: " << errno ); + std::rewind( m_file ); + while ( current_pos > 0 ) { + auto read_characters = + std::fread( buffer, + 1, + std::min( buffer_size, current_pos ), + m_file ); + buffer[read_characters] = '\0'; + sstr << buffer; + current_pos -= static_cast( read_characters ); + } + return sstr.str(); + } + + void clear() { std::rewind( m_file ); } + + private: + std::FILE* m_file = nullptr; + char m_buffer[L_tmpnam] = { 0 }; + }; + + /** + * Redirects the actual `stdout`/`stderr` file descriptors. + * + * Works by replacing the file descriptors numbered 1 and 2 + * with an open temporary file. + */ + class FileRedirect : public OutputRedirect { + TempFile m_outFile, m_errFile; + int m_originalOut = -1; + int m_originalErr = -1; + + // Flushes cout/cerr/clog streams and stdout/stderr FDs + void flushEverything() { + Catch::cout() << std::flush; + fflush( stdout ); + // Since we support overriding these streams, we flush cerr + // even though std::cerr is unbuffered + Catch::cerr() << std::flush; + Catch::clog() << std::flush; + fflush( stderr ); } - CATCH_RUNTIME_ERROR("Could not open the temp file: '" << m_buffer << "' because: " << buffer); + + public: + FileRedirect(): + m_originalOut( dup( fileno( stdout ) ) ), + m_originalErr( dup( fileno( stderr ) ) ) { + CATCH_ENFORCE( m_originalOut >= 0, "Could not dup stdout" ); + CATCH_ENFORCE( m_originalErr >= 0, "Could not dup stderr" ); + } + + std::string getStdout() override { return m_outFile.getContents(); } + std::string getStderr() override { return m_errFile.getContents(); } + void clearBuffers() override { + m_outFile.clear(); + m_errFile.clear(); + } + + void activateImpl() override { + // We flush before starting redirect, to ensure that we do + // not capture the end of message sent before activation. + flushEverything(); + + int ret; + ret = dup2( fileno( m_outFile.getFile() ), fileno( stdout ) ); + CATCH_ENFORCE( ret >= 0, + "dup2 to stdout has failed, errno: " << errno ); + ret = dup2( fileno( m_errFile.getFile() ), fileno( stderr ) ); + CATCH_ENFORCE( ret >= 0, + "dup2 to stderr has failed, errno: " << errno ); + } + void deactivateImpl() override { + // We flush before ending redirect, to ensure that we + // capture all messages sent while the redirect was active. + flushEverything(); + + int ret; + ret = dup2( m_originalOut, fileno( stdout ) ); + CATCH_ENFORCE( + ret >= 0, + "dup2 of original stdout has failed, errno: " << errno ); + ret = dup2( m_originalErr, fileno( stderr ) ); + CATCH_ENFORCE( + ret >= 0, + "dup2 of original stderr has failed, errno: " << errno ); + } + }; + +#endif // CATCH_CONFIG_NEW_CAPTURE + + } // end namespace + + bool isRedirectAvailable( OutputRedirect::Kind kind ) { + switch ( kind ) { + // These two are always available + case OutputRedirect::None: + case OutputRedirect::Streams: + return true; +#if defined( CATCH_CONFIG_NEW_CAPTURE ) + case OutputRedirect::FileDescriptors: + return true; +#endif + default: + return false; } } + + Detail::unique_ptr makeOutputRedirect( bool actual ) { + if ( actual ) { + // TODO: Clean this up later +#if defined( CATCH_CONFIG_NEW_CAPTURE ) + return Detail::make_unique(); #else - TempFile::TempFile() { - m_file = std::tmpfile(); - if (!m_file) { - CATCH_RUNTIME_ERROR("Could not create a temp file."); + return Detail::make_unique(); +#endif + } else { + return Detail::make_unique(); } } -#endif + RedirectGuard scopedActivate( OutputRedirect& redirectImpl ) { + return RedirectGuard( true, redirectImpl ); + } + + RedirectGuard scopedDeactivate( OutputRedirect& redirectImpl ) { + return RedirectGuard( false, redirectImpl ); + } + + OutputRedirect::~OutputRedirect() = default; + + RedirectGuard::RedirectGuard( bool activate, OutputRedirect& redirectImpl ): + m_redirect( &redirectImpl ), + m_activate( activate ), + m_previouslyActive( redirectImpl.isActive() ) { + + // Skip cases where there is no actual state change. + if ( m_activate == m_previouslyActive ) { return; } + + if ( m_activate ) { + m_redirect->activate(); + } else { + m_redirect->deactivate(); + } + } + + RedirectGuard::~RedirectGuard() noexcept( false ) { + if ( m_moved ) { return; } + // Skip cases where there is no actual state change. + if ( m_activate == m_previouslyActive ) { return; } + + if ( m_activate ) { + m_redirect->deactivate(); + } else { + m_redirect->activate(); + } + } + + RedirectGuard::RedirectGuard( RedirectGuard&& rhs ) noexcept: + m_redirect( rhs.m_redirect ), + m_activate( rhs.m_activate ), + m_previouslyActive( rhs.m_previouslyActive ), + m_moved( false ) { + rhs.m_moved = true; + } + + RedirectGuard& RedirectGuard::operator=( RedirectGuard&& rhs ) noexcept { + m_redirect = rhs.m_redirect; + m_activate = rhs.m_activate; + m_previouslyActive = rhs.m_previouslyActive; + m_moved = false; + rhs.m_moved = true; + return *this; + } + +} // namespace Catch - TempFile::~TempFile() { - // TBD: What to do about errors here? - std::fclose(m_file); - // We manually create the file on Windows only, on Linux - // it will be autodeleted -#if defined(_MSC_VER) - std::remove(m_buffer); +#if defined( CATCH_CONFIG_NEW_CAPTURE ) +# if defined( _MSC_VER ) +# undef dup +# undef dup2 +# undef fileno +# endif #endif - } - FILE* TempFile::getFile() { - return m_file; - } - std::string TempFile::getContents() { - std::stringstream sstr; - char buffer[100] = {}; - std::rewind(m_file); - while (std::fgets(buffer, sizeof(buffer), m_file)) { - sstr << buffer; - } - return sstr.str(); - } - OutputRedirect::OutputRedirect(std::string& stdout_dest, std::string& stderr_dest) : - m_originalStdout(dup(1)), - m_originalStderr(dup(2)), - m_stdoutDest(stdout_dest), - m_stderrDest(stderr_dest) { - dup2(fileno(m_stdoutFile.getFile()), 1); - dup2(fileno(m_stderrFile.getFile()), 2); - } +#include +#include - OutputRedirect::~OutputRedirect() { - Catch::cout() << std::flush; - fflush(stdout); - // Since we support overriding these streams, we flush cerr - // even though std::cerr is unbuffered - Catch::cerr() << std::flush; - Catch::clog() << std::flush; - fflush(stderr); +namespace Catch { - dup2(m_originalStdout, 1); - dup2(m_originalStderr, 2); + Optional parseUInt(std::string const& input, int base) { + auto trimmed = trim( input ); + // std::stoull is annoying and accepts numbers starting with '-', + // it just negates them into unsigned int + if ( trimmed.empty() || trimmed[0] == '-' ) { + return {}; + } - m_stdoutDest += m_stdoutFile.getContents(); - m_stderrDest += m_stderrFile.getContents(); + CATCH_TRY { + size_t pos = 0; + const auto ret = std::stoull( trimmed, &pos, base ); + + // We did not consume the whole input, so there is an issue + // This can be bunch of different stuff, like multiple numbers + // in the input, or invalid digits/characters and so on. Either + // way, we do not want to return the partially parsed result. + if ( pos != trimmed.size() ) { + return {}; + } + // Too large + if ( ret > std::numeric_limits::max() ) { + return {}; + } + return static_cast(ret); + } + CATCH_CATCH_ANON( std::invalid_argument const& ) { + // no conversion could be performed + } + CATCH_CATCH_ANON( std::out_of_range const& ) { + // the input does not fit into an unsigned long long + } + return {}; } -#endif // CATCH_CONFIG_NEW_CAPTURE - } // namespace Catch -#if defined(CATCH_CONFIG_NEW_CAPTURE) - #if defined(_MSC_VER) - #undef dup - #undef dup2 - #undef fileno - #endif -#endif - @@ -4404,6 +5201,14 @@ namespace Catch { } #endif +#if !defined( CATCH_CONFIG_GLOBAL_NEXTAFTER ) + float nextafter( float x, float y ) { return std::nextafter( x, y ); } + double nextafter( double x, double y ) { return std::nextafter( x, y ); } +#else + float nextafter( float x, float y ) { return ::nextafterf( x, y ); } + double nextafter( double x, double y ) { return ::nextafter( x, y ); } +#endif + } // end namespace Catch @@ -4485,10 +5290,10 @@ namespace Catch { return static_cast( std::time( nullptr ) ); case GenerateFrom::Default: - case GenerateFrom::RandomDevice: - // In theory, a platform could have random_device that returns just - // 16 bits. That is still some randomness, so we don't care too much - return static_cast( std::random_device{}() ); + case GenerateFrom::RandomDevice: { + std::random_device rd; + return Detail::fillBitsFrom( rd ); + } default: CATCH_ERROR("Unknown generation method"); @@ -4501,49 +5306,73 @@ namespace Catch { namespace Catch { + struct ReporterRegistry::ReporterRegistryImpl { + std::vector> listeners; + std::map + factories; + }; - ReporterRegistry::ReporterRegistry() { + ReporterRegistry::ReporterRegistry(): + m_impl( Detail::make_unique() ) { // Because it is impossible to move out of initializer list, // we have to add the elements manually - m_factories["Automake"] = Detail::make_unique>(); - m_factories["compact"] = Detail::make_unique>(); - m_factories["console"] = Detail::make_unique>(); - m_factories["JUnit"] = Detail::make_unique>(); - m_factories["SonarQube"] = Detail::make_unique>(); - m_factories["TAP"] = Detail::make_unique>(); - m_factories["TeamCity"] = Detail::make_unique>(); - m_factories["XML"] = Detail::make_unique>(); + m_impl->factories["Automake"] = + Detail::make_unique>(); + m_impl->factories["compact"] = + Detail::make_unique>(); + m_impl->factories["console"] = + Detail::make_unique>(); + m_impl->factories["JUnit"] = + Detail::make_unique>(); + m_impl->factories["SonarQube"] = + Detail::make_unique>(); + m_impl->factories["TAP"] = + Detail::make_unique>(); + m_impl->factories["TeamCity"] = + Detail::make_unique>(); + m_impl->factories["XML"] = + Detail::make_unique>(); + m_impl->factories["JSON"] = + Detail::make_unique>(); } ReporterRegistry::~ReporterRegistry() = default; - - IEventListenerPtr ReporterRegistry::create( std::string const& name, ReporterConfig&& config ) const { - auto it = m_factories.find( name ); - if( it == m_factories.end() ) - return nullptr; - return it->second->create( CATCH_MOVE(config) ); + IEventListenerPtr + ReporterRegistry::create( std::string const& name, + ReporterConfig&& config ) const { + auto it = m_impl->factories.find( name ); + if ( it == m_impl->factories.end() ) return nullptr; + return it->second->create( CATCH_MOVE( config ) ); } - void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr factory ) { + void ReporterRegistry::registerReporter( std::string const& name, + IReporterFactoryPtr factory ) { CATCH_ENFORCE( name.find( "::" ) == name.npos, - "'::' is not allowed in reporter name: '" + name + '\'' ); - auto ret = m_factories.emplace(name, CATCH_MOVE(factory)); - CATCH_ENFORCE( ret.second, "reporter using '" + name + "' as name was already registered" ); + "'::' is not allowed in reporter name: '" + name + + '\'' ); + auto ret = m_impl->factories.emplace( name, CATCH_MOVE( factory ) ); + CATCH_ENFORCE( ret.second, + "reporter using '" + name + + "' as name was already registered" ); } void ReporterRegistry::registerListener( Detail::unique_ptr factory ) { - m_listeners.push_back( CATCH_MOVE(factory) ); + m_impl->listeners.push_back( CATCH_MOVE( factory ) ); } - IReporterRegistry::FactoryMap const& ReporterRegistry::getFactories() const { - return m_factories; - } - IReporterRegistry::Listeners const& ReporterRegistry::getListeners() const { - return m_listeners; + std::map const& + ReporterRegistry::getFactories() const { + return m_impl->factories; } -} + std::vector> const& + ReporterRegistry::getListeners() const { + return m_impl->listeners; + } +} // namespace Catch @@ -4559,9 +5388,9 @@ namespace Catch { }; kvPair splitKVPair(StringRef kvString) { - auto splitPos = static_cast( std::distance( - kvString.begin(), - std::find( kvString.begin(), kvString.end(), '=' ) ) ); + auto splitPos = static_cast( + std::find( kvString.begin(), kvString.end(), '=' ) - + kvString.begin() ); return { kvString.substr( 0, splitPos ), kvString.substr( splitPos + 1, kvString.size() ) }; @@ -4655,7 +5484,7 @@ namespace Catch { auto kv = splitKVPair( parts[i] ); auto key = kv.key, value = kv.value; - if ( key.empty() || value.empty() ) { + if ( key.empty() || value.empty() ) { // NOLINT(bugprone-branch-clone) return {}; } else if ( key[0] == 'X' ) { // This is a reporter-specific option, we don't check these @@ -4712,26 +5541,6 @@ ReporterSpec::ReporterSpec( -namespace Catch { - - bool isOk( ResultWas::OfType resultType ) { - return ( resultType & ResultWas::FailureBit ) == 0; - } - bool isJustInfo( int flags ) { - return flags == ResultWas::Info; - } - - ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { - return static_cast( static_cast( lhs ) | static_cast( rhs ) ); - } - - bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } - bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } - -} // end namespace Catch - - - #include #include #include @@ -4793,149 +5602,152 @@ namespace Catch { namespace Catch { namespace Generators { - struct GeneratorTracker : TestCaseTracking::TrackerBase, IGeneratorTracker { - GeneratorBasePtr m_generator; + namespace { + struct GeneratorTracker final : TestCaseTracking::TrackerBase, + IGeneratorTracker { + GeneratorBasePtr m_generator; + + GeneratorTracker( + TestCaseTracking::NameAndLocation&& nameAndLocation, + TrackerContext& ctx, + ITracker* parent ): + TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ) {} + + static GeneratorTracker* + acquire( TrackerContext& ctx, + TestCaseTracking::NameAndLocationRef const& + nameAndLocation ) { + GeneratorTracker* tracker; + + ITracker& currentTracker = ctx.currentTracker(); + // Under specific circumstances, the generator we want + // to acquire is also the current tracker. If this is + // the case, we have to avoid looking through current + // tracker's children, and instead return the current + // tracker. + // A case where this check is important is e.g. + // for (int i = 0; i < 5; ++i) { + // int n = GENERATE(1, 2); + // } + // + // without it, the code above creates 5 nested generators. + if ( currentTracker.nameAndLocation() == nameAndLocation ) { + auto thisTracker = currentTracker.parent()->findChild( + nameAndLocation ); + assert( thisTracker ); + assert( thisTracker->isGeneratorTracker() ); + tracker = static_cast( thisTracker ); + } else if ( ITracker* childTracker = + currentTracker.findChild( + nameAndLocation ) ) { + assert( childTracker ); + assert( childTracker->isGeneratorTracker() ); + tracker = + static_cast( childTracker ); + } else { + return nullptr; + } - GeneratorTracker( TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ) - : TrackerBase( nameAndLocation, ctx, parent ) - {} - ~GeneratorTracker() override; - - static GeneratorTracker& acquire( TrackerContext& ctx, TestCaseTracking::NameAndLocation const& nameAndLocation ) { - GeneratorTracker* tracker; - - ITracker& currentTracker = ctx.currentTracker(); - // Under specific circumstances, the generator we want - // to acquire is also the current tracker. If this is - // the case, we have to avoid looking through current - // tracker's children, and instead return the current - // tracker. - // A case where this check is important is e.g. - // for (int i = 0; i < 5; ++i) { - // int n = GENERATE(1, 2); - // } - // - // without it, the code above creates 5 nested generators. - if ( currentTracker.nameAndLocation() == nameAndLocation ) { - auto thisTracker = - currentTracker.parent()->findChild( nameAndLocation ); - assert( thisTracker ); - assert( thisTracker->isGeneratorTracker() ); - tracker = static_cast( thisTracker ); - } else if ( ITracker* childTracker = - currentTracker.findChild( nameAndLocation ) ) { - assert( childTracker ); - assert( childTracker->isGeneratorTracker() ); - tracker = static_cast( childTracker ); - } else { - auto newTracker = - Catch::Detail::make_unique( - nameAndLocation, ctx, ¤tTracker ); - tracker = newTracker.get(); - currentTracker.addChild( CATCH_MOVE(newTracker) ); - } + if ( !tracker->isComplete() ) { tracker->open(); } - if( !tracker->isComplete() ) { - tracker->open(); + return tracker; } - return *tracker; - } - - // TrackerBase interface - bool isGeneratorTracker() const override { return true; } - auto hasGenerator() const -> bool override { - return !!m_generator; - } - void close() override { - TrackerBase::close(); - // If a generator has a child (it is followed by a section) - // and none of its children have started, then we must wait - // until later to start consuming its values. - // This catches cases where `GENERATE` is placed between two - // `SECTION`s. - // **The check for m_children.empty cannot be removed**. - // doing so would break `GENERATE` _not_ followed by `SECTION`s. - const bool should_wait_for_child = [&]() { - // No children -> nobody to wait for - if ( m_children.empty() ) { - return false; - } - // If at least one child started executing, don't wait - if ( std::find_if( - m_children.begin(), - m_children.end(), - []( TestCaseTracking::ITrackerPtr const& tracker ) { - return tracker->hasStarted(); - } ) != m_children.end() ) { - return false; - } - - // No children have started. We need to check if they _can_ - // start, and thus we should wait for them, or they cannot - // start (due to filters), and we shouldn't wait for them - ITracker* parent = m_parent; - // This is safe: there is always at least one section - // tracker in a test case tracking tree - while ( !parent->isSectionTracker() ) { - parent = parent->parent(); - } - assert( parent && - "Missing root (test case) level section" ); - - auto const& parentSection = - static_cast( *parent ); - auto const& filters = parentSection.getFilters(); - // No filters -> no restrictions on running sections - if ( filters.empty() ) { - return true; - } + // TrackerBase interface + bool isGeneratorTracker() const override { return true; } + auto hasGenerator() const -> bool override { + return !!m_generator; + } + void close() override { + TrackerBase::close(); + // If a generator has a child (it is followed by a section) + // and none of its children have started, then we must wait + // until later to start consuming its values. + // This catches cases where `GENERATE` is placed between two + // `SECTION`s. + // **The check for m_children.empty cannot be removed**. + // doing so would break `GENERATE` _not_ followed by + // `SECTION`s. + const bool should_wait_for_child = [&]() { + // No children -> nobody to wait for + if ( m_children.empty() ) { return false; } + // If at least one child started executing, don't wait + if ( std::find_if( + m_children.begin(), + m_children.end(), + []( TestCaseTracking::ITrackerPtr const& + tracker ) { + return tracker->hasStarted(); + } ) != m_children.end() ) { + return false; + } - for ( auto const& child : m_children ) { - if ( child->isSectionTracker() && - std::find( - filters.begin(), - filters.end(), - static_cast( *child ) - .trimmedName() ) != filters.end() ) { - return true; + // No children have started. We need to check if they + // _can_ start, and thus we should wait for them, or + // they cannot start (due to filters), and we shouldn't + // wait for them + ITracker* parent = m_parent; + // This is safe: there is always at least one section + // tracker in a test case tracking tree + while ( !parent->isSectionTracker() ) { + parent = parent->parent(); + } + assert( parent && + "Missing root (test case) level section" ); + + auto const& parentSection = + static_cast( *parent ); + auto const& filters = parentSection.getFilters(); + // No filters -> no restrictions on running sections + if ( filters.empty() ) { return true; } + + for ( auto const& child : m_children ) { + if ( child->isSectionTracker() && + std::find( filters.begin(), + filters.end(), + static_cast( + *child ) + .trimmedName() ) != + filters.end() ) { + return true; + } } + return false; + }(); + + // This check is a bit tricky, because m_generator->next() + // has a side-effect, where it consumes generator's current + // value, but we do not want to invoke the side-effect if + // this generator is still waiting for any child to start. + assert( m_generator && "Tracker without generator" ); + if ( should_wait_for_child || + ( m_runState == CompletedSuccessfully && + m_generator->countedNext() ) ) { + m_children.clear(); + m_runState = Executing; } - return false; - }(); - - // This check is a bit tricky, because m_generator->next() - // has a side-effect, where it consumes generator's current - // value, but we do not want to invoke the side-effect if - // this generator is still waiting for any child to start. - if ( should_wait_for_child || - ( m_runState == CompletedSuccessfully && - m_generator->countedNext() ) ) { - m_children.clear(); - m_runState = Executing; } - } - // IGeneratorTracker interface - auto getGenerator() const -> GeneratorBasePtr const& override { - return m_generator; - } - void setGenerator( GeneratorBasePtr&& generator ) override { - m_generator = CATCH_MOVE( generator ); - } - }; - GeneratorTracker::~GeneratorTracker() = default; + // IGeneratorTracker interface + auto getGenerator() const -> GeneratorBasePtr const& override { + return m_generator; + } + void setGenerator( GeneratorBasePtr&& generator ) override { + m_generator = CATCH_MOVE( generator ); + } + }; + } // namespace } RunContext::RunContext(IConfig const* _config, IEventListenerPtr&& reporter) : m_runInfo(_config->name()), - m_context(getCurrentMutableContext()), m_config(_config), m_reporter(CATCH_MOVE(reporter)), m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal }, + m_outputRedirect( makeOutputRedirect( m_reporter->getPreferences().shouldRedirectStdOut ) ), m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions ) { - m_context.setResultCapture(this); + getCurrentMutableContext().setResultCapture( this ); m_reporter->testRunStarting(m_runInfo); } @@ -4946,13 +5758,9 @@ namespace Catch { Totals RunContext::runTest(TestCaseHandle const& testCase) { const Totals prevTotals = m_totals; - std::string redirectedCout; - std::string redirectedCerr; - auto const& testInfo = testCase.getTestCaseInfo(); - m_reporter->testCaseStarting(testInfo); - + testCase.prepareTestCase(); m_activeTestCase = &testCase; @@ -4994,22 +5802,26 @@ namespace Catch { seedRng( *m_config ); uint64_t testRuns = 0; + std::string redirectedCout; + std::string redirectedCerr; do { m_trackerContext.startCycle(); - m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo)); + m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocationRef(testInfo.name, testInfo.lineInfo)); m_reporter->testCasePartialStarting(testInfo, testRuns); const auto beforeRunTotals = m_totals; - std::string oneRunCout, oneRunCerr; - runCurrentTest(oneRunCout, oneRunCerr); + runCurrentTest(); + std::string oneRunCout = m_outputRedirect->getStdout(); + std::string oneRunCerr = m_outputRedirect->getStderr(); + m_outputRedirect->clearBuffers(); redirectedCout += oneRunCout; redirectedCerr += oneRunCerr; const auto singleRunTotals = m_totals.delta(beforeRunTotals); - auto statsForOneRun = TestCaseStats(testInfo, singleRunTotals, oneRunCout, oneRunCerr, aborting()); - + auto statsForOneRun = TestCaseStats(testInfo, singleRunTotals, CATCH_MOVE(oneRunCout), CATCH_MOVE(oneRunCerr), aborting()); m_reporter->testCasePartialEnded(statsForOneRun, testRuns); + ++testRuns; } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); @@ -5020,10 +5832,11 @@ namespace Catch { deltaTotals.testCases.failed++; } m_totals.testCases += deltaTotals.testCases; + testCase.tearDownTestCase(); m_reporter->testCaseEnded(TestCaseStats(testInfo, deltaTotals, - redirectedCout, - redirectedCerr, + CATCH_MOVE(redirectedCout), + CATCH_MOVE(redirectedCerr), aborting())); m_activeTestCase = nullptr; @@ -5033,10 +5846,13 @@ namespace Catch { } - void RunContext::assertionEnded(AssertionResult const & result) { + void RunContext::assertionEnded(AssertionResult&& result) { if (result.getResultType() == ResultWas::Ok) { m_totals.assertions.passed++; m_lastAssertionPassed = true; + } else if (result.getResultType() == ResultWas::ExplicitSkip) { + m_totals.assertions.skipped++; + m_lastAssertionPassed = true; } else if (!result.succeeded()) { m_lastAssertionPassed = false; if (result.isOk()) { @@ -5050,42 +5866,87 @@ namespace Catch { m_lastAssertionPassed = true; } - m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)); + { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ); + } - if (result.getResultType() != ResultWas::Warning) + if ( result.getResultType() != ResultWas::Warning ) { m_messageScopes.clear(); + } - // Reset working state - resetAssertionInfo(); - m_lastResult = result; + // Reset working state. assertion info will be reset after + // populateReaction is run if it is needed + m_lastResult = CATCH_MOVE( result ); } void RunContext::resetAssertionInfo() { m_lastAssertionInfo.macroName = StringRef(); m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr; + m_lastAssertionInfo.resultDisposition = ResultDisposition::Normal; + } + + void RunContext::notifyAssertionStarted( AssertionInfo const& info ) { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->assertionStarting( info ); } - bool RunContext::sectionStarted(SectionInfo const & sectionInfo, Counts & assertions) { - ITracker& sectionTracker = SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(sectionInfo.name, sectionInfo.lineInfo)); + bool RunContext::sectionStarted( StringRef sectionName, + SourceLineInfo const& sectionLineInfo, + Counts& assertions ) { + ITracker& sectionTracker = + SectionTracker::acquire( m_trackerContext, + TestCaseTracking::NameAndLocationRef( + sectionName, sectionLineInfo ) ); + if (!sectionTracker.isOpen()) return false; m_activeSections.push_back(§ionTracker); + SectionInfo sectionInfo( sectionLineInfo, static_cast(sectionName) ); m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; - m_reporter->sectionStarting(sectionInfo); + { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->sectionStarting( sectionInfo ); + } assertions = m_totals.assertions; return true; } - auto RunContext::acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& { + IGeneratorTracker* + RunContext::acquireGeneratorTracker( StringRef generatorName, + SourceLineInfo const& lineInfo ) { using namespace Generators; - GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext, - TestCaseTracking::NameAndLocation( static_cast(generatorName), lineInfo ) ); + GeneratorTracker* tracker = GeneratorTracker::acquire( + m_trackerContext, + TestCaseTracking::NameAndLocationRef( + generatorName, lineInfo ) ); m_lastAssertionInfo.lineInfo = lineInfo; return tracker; } + IGeneratorTracker* RunContext::createGeneratorTracker( + StringRef generatorName, + SourceLineInfo lineInfo, + Generators::GeneratorBasePtr&& generator ) { + + auto nameAndLoc = TestCaseTracking::NameAndLocation( static_cast( generatorName ), lineInfo ); + auto& currentTracker = m_trackerContext.currentTracker(); + assert( + currentTracker.nameAndLocation() != nameAndLoc && + "Trying to create tracker for a genreator that already has one" ); + + auto newTracker = Catch::Detail::make_unique( + CATCH_MOVE(nameAndLoc), m_trackerContext, ¤tTracker ); + auto ret = newTracker.get(); + currentTracker.addChild( CATCH_MOVE( newTracker ) ); + + ret->setGenerator( CATCH_MOVE( generator ) ); + ret->open(); + return ret; + } + bool RunContext::testForMissingAssertions(Counts& assertions) { if (assertions.total() != 0) return false; @@ -5098,7 +5959,7 @@ namespace Catch { return true; } - void RunContext::sectionEnded(SectionEndInfo const & endInfo) { + void RunContext::sectionEnded(SectionEndInfo&& endInfo) { Counts assertions = m_totals.assertions - endInfo.prevAssertions; bool missingAssertions = testForMissingAssertions(assertions); @@ -5107,31 +5968,44 @@ namespace Catch { m_activeSections.pop_back(); } - m_reporter->sectionEnded(SectionStats(endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions)); + { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->sectionEnded( + SectionStats( CATCH_MOVE( endInfo.sectionInfo ), + assertions, + endInfo.durationInSeconds, + missingAssertions ) ); + } + m_messages.clear(); m_messageScopes.clear(); } - void RunContext::sectionEndedEarly(SectionEndInfo const & endInfo) { - if (m_unfinishedSections.empty()) + void RunContext::sectionEndedEarly(SectionEndInfo&& endInfo) { + if ( m_unfinishedSections.empty() ) { m_activeSections.back()->fail(); - else + } else { m_activeSections.back()->close(); + } m_activeSections.pop_back(); - m_unfinishedSections.push_back(endInfo); + m_unfinishedSections.push_back(CATCH_MOVE(endInfo)); } void RunContext::benchmarkPreparing( StringRef name ) { - m_reporter->benchmarkPreparing(name); + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->benchmarkPreparing( name ); } void RunContext::benchmarkStarting( BenchmarkInfo const& info ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->benchmarkStarting( info ); } void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->benchmarkEnded( stats ); } void RunContext::benchmarkFailed( StringRef error ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->benchmarkFailed( error ); } @@ -5143,8 +6017,8 @@ namespace Catch { m_messages.erase(std::remove(m_messages.begin(), m_messages.end(), message), m_messages.end()); } - void RunContext::emplaceUnscopedMessage( MessageBuilder const& builder ) { - m_messageScopes.emplace_back( builder ); + void RunContext::emplaceUnscopedMessage( MessageBuilder&& builder ) { + m_messageScopes.emplace_back( CATCH_MOVE(builder) ); } std::string RunContext::getCurrentTestName() const { @@ -5162,17 +6036,30 @@ namespace Catch { } void RunContext::handleFatalErrorCondition( StringRef message ) { + // TODO: scoped deactivate here? Just give up and do best effort? + // the deactivation can break things further, OTOH so can the + // capture + auto _ = scopedDeactivate( *m_outputRedirect ); + // First notify reporter that bad things happened - m_reporter->fatalErrorEncountered(message); + m_reporter->fatalErrorEncountered( message ); // Don't rebuild the result -- the stringification itself can cause more fatal errors // Instead, fake a result data. AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } ); tempResult.message = static_cast(message); - AssertionResult result(m_lastAssertionInfo, tempResult); + AssertionResult result(m_lastAssertionInfo, CATCH_MOVE(tempResult)); - assertionEnded(result); + assertionEnded(CATCH_MOVE(result) ); + resetAssertionInfo(); + // Best effort cleanup for sections that have not been destructed yet + // Since this is a fatal error, we have not had and won't have the opportunity to destruct them properly + while (!m_activeSections.empty()) { + auto nl = m_activeSections.back()->nameAndLocation(); + SectionEndInfo endInfo{ SectionInfo(CATCH_MOVE(nl.location), CATCH_MOVE(nl.name)), {}, 0.0 }; + sectionEndedEarly(CATCH_MOVE(endInfo)); + } handleUnfinishedSections(); // Recreate section for test case (as we will lose the one that was in scope) @@ -5181,8 +6068,8 @@ namespace Catch { Counts assertions; assertions.failed = 1; - SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false); - m_reporter->sectionEnded(testCaseSectionStats); + SectionStats testCaseSectionStats(CATCH_MOVE(testCaseSection), assertions, 0, false); + m_reporter->sectionEnded( testCaseSectionStats ); auto const& testInfo = m_activeTestCase->getTestCaseInfo(); @@ -5213,7 +6100,7 @@ namespace Catch { return m_totals.assertions.failed >= static_cast(m_config->abortAfter()); } - void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) { + void RunContext::runCurrentTest() { auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name); m_reporter->sectionStarting(testCaseSection); @@ -5224,24 +6111,16 @@ namespace Catch { Timer timer; CATCH_TRY { - if (m_reporter->getPreferences().shouldRedirectStdOut) { -#if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) - RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr); - - timer.start(); - invokeActiveTestCase(); -#else - OutputRedirect r(redirectedCout, redirectedCerr); - timer.start(); - invokeActiveTestCase(); -#endif - } else { + { + auto _ = scopedActivate( *m_outputRedirect ); timer.start(); invokeActiveTestCase(); } duration = timer.getElapsedSeconds(); } CATCH_CATCH_ANON (TestFailureException&) { // This just means the test was aborted due to failure + } CATCH_CATCH_ANON (TestSkipException&) { + // This just means the test was explicitly skipped } CATCH_CATCH_ALL { // Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions // are reported without translation at the point of origin. @@ -5258,7 +6137,7 @@ namespace Catch { m_messages.clear(); m_messageScopes.clear(); - SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions); + SectionStats testCaseSectionStats(CATCH_MOVE(testCaseSection), assertions, duration, missingAssertions); m_reporter->sectionEnded(testCaseSectionStats); } @@ -5278,11 +6157,12 @@ namespace Catch { void RunContext::handleUnfinishedSections() { // If sections ended prematurely due to an exception we stored their // infos here so we can tear them down outside the unwind process. - for (auto it = m_unfinishedSections.rbegin(), - itEnd = m_unfinishedSections.rend(); - it != itEnd; - ++it) - sectionEnded(*it); + for ( auto it = m_unfinishedSections.rbegin(), + itEnd = m_unfinishedSections.rend(); + it != itEnd; + ++it ) { + sectionEnded( CATCH_MOVE( *it ) ); + } m_unfinishedSections.clear(); } @@ -5291,8 +6171,6 @@ namespace Catch { ITransientExpression const& expr, AssertionReaction& reaction ) { - m_reporter->assertionStarting( info ); - bool negated = isFalseTest( info.resultDisposition ); bool result = expr.getResult() != negated; @@ -5308,6 +6186,7 @@ namespace Catch { reportExpr(info, ResultWas::ExpressionFailed, &expr, negated ); populateReaction( reaction ); } + resetAssertionInfo(); } void RunContext::reportExpr( AssertionInfo const &info, @@ -5318,28 +6197,35 @@ namespace Catch { m_lastAssertionInfo = info; AssertionResultData data( resultType, LazyExpression( negated ) ); - AssertionResult assertionResult{ info, data }; + AssertionResult assertionResult{ info, CATCH_MOVE( data ) }; assertionResult.m_resultData.lazyExpression.m_transientExpression = expr; - assertionEnded( assertionResult ); + assertionEnded( CATCH_MOVE(assertionResult) ); } void RunContext::handleMessage( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef message, + std::string&& message, AssertionReaction& reaction ) { - m_reporter->assertionStarting( info ); - m_lastAssertionInfo = info; AssertionResultData data( resultType, LazyExpression( false ) ); - data.message = static_cast(message); - AssertionResult assertionResult{ m_lastAssertionInfo, data }; - assertionEnded( assertionResult ); - if( !assertionResult.isOk() ) + data.message = CATCH_MOVE( message ); + AssertionResult assertionResult{ m_lastAssertionInfo, + CATCH_MOVE( data ) }; + + const auto isOk = assertionResult.isOk(); + assertionEnded( CATCH_MOVE(assertionResult) ); + if ( !isOk ) { populateReaction( reaction ); + } else if ( resultType == ResultWas::ExplicitSkip ) { + // TODO: Need to handle this explicitly, as ExplicitSkip is + // considered "OK" + reaction.shouldSkip = true; + } + resetAssertionInfo(); } void RunContext::handleUnexpectedExceptionNotThrown( AssertionInfo const& info, @@ -5350,16 +6236,17 @@ namespace Catch { void RunContext::handleUnexpectedInflightException( AssertionInfo const& info, - std::string const& message, + std::string&& message, AssertionReaction& reaction ) { m_lastAssertionInfo = info; AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) ); - data.message = message; - AssertionResult assertionResult{ info, data }; - assertionEnded( assertionResult ); + data.message = CATCH_MOVE(message); + AssertionResult assertionResult{ info, CATCH_MOVE(data) }; + assertionEnded( CATCH_MOVE(assertionResult) ); populateReaction( reaction ); + resetAssertionInfo(); } void RunContext::populateReaction( AssertionReaction& reaction ) { @@ -5370,12 +6257,14 @@ namespace Catch { void RunContext::handleIncomplete( AssertionInfo const& info ) { + using namespace std::string_literals; m_lastAssertionInfo = info; AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) ); - data.message = "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE"; - AssertionResult assertionResult{ info, data }; - assertionEnded( assertionResult ); + data.message = "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE"s; + AssertionResult assertionResult{ info, CATCH_MOVE( data ) }; + assertionEnded( CATCH_MOVE(assertionResult) ); + resetAssertionInfo(); } void RunContext::handleNonExpr( AssertionInfo const &info, @@ -5385,11 +6274,12 @@ namespace Catch { m_lastAssertionInfo = info; AssertionResultData data( resultType, LazyExpression( false ) ); - AssertionResult assertionResult{ info, data }; - assertionEnded( assertionResult ); + AssertionResult assertionResult{ info, CATCH_MOVE( data ) }; - if( !assertionResult.isOk() ) - populateReaction( reaction ); + const auto isOk = assertionResult.isOk(); + assertionEnded( CATCH_MOVE(assertionResult) ); + if ( !isOk ) { populateReaction( reaction ); } + resetAssertionInfo(); } @@ -5417,7 +6307,7 @@ namespace Catch { Section::Section( SectionInfo&& info ): m_info( CATCH_MOVE( info ) ), m_sectionIncluded( - getResultCapture().sectionStarted( m_info, m_assertions ) ) { + getResultCapture().sectionStarted( m_info.name, m_info.lineInfo, m_assertions ) ) { // Non-"included" sections will not use the timing information // anyway, so don't bother with the potential syscall. if (m_sectionIncluded) { @@ -5425,13 +6315,31 @@ namespace Catch { } } + Section::Section( SourceLineInfo const& _lineInfo, + StringRef _name, + const char* const ): + m_info( { "invalid", static_cast( -1 ) }, std::string{} ), + m_sectionIncluded( + getResultCapture().sectionStarted( _name, _lineInfo, m_assertions ) ) { + // We delay initialization the SectionInfo member until we know + // this section needs it, so we avoid allocating std::string for name. + // We also delay timer start to avoid the potential syscall unless we + // will actually use the result. + if ( m_sectionIncluded ) { + m_info.name = static_cast( _name ); + m_info.lineInfo = _lineInfo; + m_timer.start(); + } + } + Section::~Section() { if( m_sectionIncluded ) { - SectionEndInfo endInfo{ m_info, m_assertions, m_timer.getElapsedSeconds() }; - if( uncaught_exceptions() ) - getResultCapture().sectionEndedEarly( endInfo ); - else - getResultCapture().sectionEnded( endInfo ); + SectionEndInfo endInfo{ CATCH_MOVE(m_info), m_assertions, m_timer.getElapsedSeconds() }; + if ( uncaught_exceptions() ) { + getResultCapture().sectionEndedEarly( CATCH_MOVE(endInfo) ); + } else { + getResultCapture().sectionEnded( CATCH_MOVE( endInfo ) ); + } } } @@ -5540,7 +6448,6 @@ namespace Catch { -#include #include #include #include @@ -5564,9 +6471,9 @@ namespace Catch { return s.find( infix ) != std::string::npos; } void toLowerInPlace( std::string& s ) { - std::transform( s.begin(), s.end(), s.begin(), []( char c ) { - return toLower( c ); - } ); + for ( char& c : s ) { + c = toLower( c ); + } } std::string toLower( std::string const& s ) { std::string lc = s; @@ -5598,17 +6505,29 @@ namespace Catch { } bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { - bool replaced = false; std::size_t i = str.find( replaceThis ); - while( i != std::string::npos ) { - replaced = true; - str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); - if( i < str.size()-withThis.size() ) - i = str.find( replaceThis, i+withThis.size() ); + if (i == std::string::npos) { + return false; + } + std::size_t copyBegin = 0; + std::string origStr = CATCH_MOVE(str); + str.clear(); + // There is at least one replacement, so reserve with the best guess + // we can make without actually counting the number of occurences. + str.reserve(origStr.size() - replaceThis.size() + withThis.size()); + do { + str.append(origStr, copyBegin, i-copyBegin ); + str += withThis; + copyBegin = i + replaceThis.size(); + if( copyBegin < origStr.size() ) + i = origStr.find( replaceThis, copyBegin ); else i = std::string::npos; + } while( i != std::string::npos ); + if ( copyBegin < origStr.size() ) { + str.append(origStr, copyBegin, origStr.size() ); } - return replaced; + return true; } std::vector splitStringRef( StringRef str, char delimiter ) { @@ -5647,10 +6566,6 @@ namespace Catch { : StringRef( rawChars, std::strlen(rawChars) ) {} - auto StringRef::operator == ( StringRef other ) const noexcept -> bool { - return m_size == other.m_size - && (std::memcmp( m_start, other.m_start, m_size ) == 0); - } bool StringRef::operator<(StringRef rhs) const noexcept { if (m_size < rhs.m_size) { @@ -5703,7 +6618,7 @@ namespace Catch { namespace Catch { - TagAliasRegistry::~TagAliasRegistry() {} + TagAliasRegistry::~TagAliasRegistry() = default; TagAlias const* TagAliasRegistry::find( std::string const& alias ) const { auto it = m_registry.find( alias ); @@ -5784,6 +6699,38 @@ namespace Catch { namespace Catch { + namespace { + static void enforceNoDuplicateTestCases( + std::vector const& tests ) { + auto testInfoCmp = []( TestCaseInfo const* lhs, + TestCaseInfo const* rhs ) { + return *lhs < *rhs; + }; + std::set seenTests( + testInfoCmp ); + for ( auto const& test : tests ) { + const auto infoPtr = &test.getTestCaseInfo(); + const auto prev = seenTests.insert( infoPtr ); + CATCH_ENFORCE( prev.second, + "error: test case \"" + << infoPtr->name << "\", with tags \"" + << infoPtr->tagsAsString() + << "\" already defined.\n" + << "\tFirst seen at " + << ( *prev.first )->lineInfo << "\n" + << "\tRedefined at " << infoPtr->lineInfo ); + } + } + + static bool matchTest( TestCaseHandle const& testCase, + TestSpec const& testSpec, + IConfig const& config ) { + return testSpec.matches( testCase.getTestCaseInfo() ) && + isThrowSafe( testCase, config ); + } + + } // end unnamed namespace + std::vector sortTests( IConfig const& config, std::vector const& unsortedTestCases ) { switch (config.runOrder()) { case TestRunOrder::Declared: @@ -5801,7 +6748,6 @@ namespace Catch { return sorted; } case TestRunOrder::Randomized: { - seedRng(config); using TestWithHash = std::pair; TestCaseInfoHasher h{ config.rngSeed() }; @@ -5840,29 +6786,6 @@ namespace Catch { return !testCase.getTestCaseInfo().throws() || config.allowThrows(); } - bool matchTest( TestCaseHandle const& testCase, TestSpec const& testSpec, IConfig const& config ) { - return testSpec.matches( testCase.getTestCaseInfo() ) && isThrowSafe( testCase, config ); - } - - void - enforceNoDuplicateTestCases( std::vector const& tests ) { - auto testInfoCmp = []( TestCaseInfo const* lhs, - TestCaseInfo const* rhs ) { - return *lhs < *rhs; - }; - std::set seenTests(testInfoCmp); - for ( auto const& test : tests ) { - const auto infoPtr = &test.getTestCaseInfo(); - const auto prev = seenTests.insert( infoPtr ); - CATCH_ENFORCE( - prev.second, - "error: test case \"" << infoPtr->name << "\", with tags \"" - << infoPtr->tagsAsString() << "\" already defined.\n" - << "\tFirst seen at " << ( *prev.first )->lineInfo << "\n" - << "\tRedefined at " << infoPtr->lineInfo ); - } - } - std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ) { std::vector filtered; filtered.reserve( testCases.size() ); @@ -5878,6 +6801,8 @@ namespace Catch { return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); } + TestRegistry::~TestRegistry() = default; + void TestRegistry::registerTest(Detail::unique_ptr testInfo, Detail::unique_ptr testInvoker) { m_handles.emplace_back(testInfo.get(), testInvoker.get()); m_viewed_test_infos.push_back(testInfo.get()); @@ -5903,13 +6828,6 @@ namespace Catch { return m_sortedFunctions; } - - - /////////////////////////////////////////////////////////////////////////// - void TestInvokerAsFunction::invoke() const { - m_testAsFunction(); - } - } // end namespace Catch @@ -5926,8 +6844,8 @@ namespace Catch { namespace Catch { namespace TestCaseTracking { - NameAndLocation::NameAndLocation( std::string const& _name, SourceLineInfo const& _location ) - : name( _name ), + NameAndLocation::NameAndLocation( std::string&& _name, SourceLineInfo const& _location ) + : name( CATCH_MOVE(_name) ), location( _location ) {} @@ -5942,14 +6860,17 @@ namespace TestCaseTracking { m_children.push_back( CATCH_MOVE(child) ); } - ITracker* ITracker::findChild( NameAndLocation const& nameAndLocation ) { + ITracker* ITracker::findChild( NameAndLocationRef const& nameAndLocation ) { auto it = std::find_if( m_children.begin(), m_children.end(), [&nameAndLocation]( ITrackerPtr const& tracker ) { - return tracker->nameAndLocation().location == - nameAndLocation.location && - tracker->nameAndLocation().name == nameAndLocation.name; + auto const& tnameAndLoc = tracker->nameAndLocation(); + if ( tnameAndLoc.location.line != + nameAndLocation.location.line ) { + return false; + } + return tnameAndLoc == nameAndLocation; } ); return ( it != m_children.end() ) ? it->get() : nullptr; } @@ -5957,10 +6878,6 @@ namespace TestCaseTracking { bool ITracker::isSectionTracker() const { return false; } bool ITracker::isGeneratorTracker() const { return false; } - bool ITracker::isSuccessfullyCompleted() const { - return m_runState == CompletedSuccessfully; - } - bool ITracker::isOpen() const { return m_runState != NotStarted && !isComplete(); } @@ -5987,16 +6904,6 @@ namespace TestCaseTracking { return *m_rootTracker; } - void TrackerContext::endRun() { - m_rootTracker.reset(); - m_currentTracker = nullptr; - m_runState = NotStarted; - } - - void TrackerContext::startCycle() { - m_currentTracker = m_rootTracker.get(); - m_runState = Executing; - } void TrackerContext::completeCycle() { m_runState = CompletedCycle; } @@ -6004,16 +6911,13 @@ namespace TestCaseTracking { bool TrackerContext::completedCycle() const { return m_runState == CompletedCycle; } - ITracker& TrackerContext::currentTracker() { - return *m_currentTracker; - } void TrackerContext::setCurrentTracker( ITracker* tracker ) { m_currentTracker = tracker; } - TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ): - ITracker(nameAndLocation, parent), + TrackerBase::TrackerBase( NameAndLocation&& nameAndLocation, TrackerContext& ctx, ITracker* parent ): + ITracker(CATCH_MOVE(nameAndLocation), parent), m_ctx( ctx ) {} @@ -6073,13 +6977,14 @@ namespace TestCaseTracking { m_ctx.setCurrentTracker( this ); } - SectionTracker::SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ) - : TrackerBase( nameAndLocation, ctx, parent ), - m_trimmed_name(trim(nameAndLocation.name)) + SectionTracker::SectionTracker( NameAndLocation&& nameAndLocation, TrackerContext& ctx, ITracker* parent ) + : TrackerBase( CATCH_MOVE(nameAndLocation), ctx, parent ), + m_trimmed_name(trim(StringRef(ITracker::nameAndLocation().name))) { if( parent ) { - while( !parent->isSectionTracker() ) + while ( !parent->isSectionTracker() ) { parent = parent->parent(); + } SectionTracker& parentSection = static_cast( *parent ); addNextFilters( parentSection.m_filters ); @@ -6099,24 +7004,30 @@ namespace TestCaseTracking { bool SectionTracker::isSectionTracker() const { return true; } - SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ) { - SectionTracker* section; + SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocationRef const& nameAndLocation ) { + SectionTracker* tracker; ITracker& currentTracker = ctx.currentTracker(); if ( ITracker* childTracker = currentTracker.findChild( nameAndLocation ) ) { assert( childTracker ); assert( childTracker->isSectionTracker() ); - section = static_cast( childTracker ); + tracker = static_cast( childTracker ); } else { - auto newSection = Catch::Detail::make_unique( - nameAndLocation, ctx, ¤tTracker ); - section = newSection.get(); - currentTracker.addChild( CATCH_MOVE( newSection ) ); + auto newTracker = Catch::Detail::make_unique( + NameAndLocation{ static_cast(nameAndLocation.name), + nameAndLocation.location }, + ctx, + ¤tTracker ); + tracker = newTracker.get(); + currentTracker.addChild( CATCH_MOVE( newTracker ) ); } - if( !ctx.completedCycle() ) - section->tryOpen(); - return *section; + + if ( !ctx.completedCycle() ) { + tracker->tryOpen(); + } + + return *tracker; } void SectionTracker::tryOpen() { @@ -6137,10 +7048,6 @@ namespace TestCaseTracking { m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() ); } - std::vector const& SectionTracker::getFilters() const { - return m_filters; - } - StringRef SectionTracker::trimmedName() const { return m_trimmed_name; } @@ -6155,13 +7062,39 @@ namespace TestCaseTracking { + +namespace Catch { + + void throw_test_failure_exception() { +#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS ) + throw TestFailureException{}; +#else + CATCH_ERROR( "Test failure requires aborting test!" ); +#endif + } + + void throw_test_skip_exception() { +#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS ) + throw Catch::TestSkipException(); +#else + CATCH_ERROR( "Explicitly skipping tests during runtime requires exceptions" ); +#endif + } + +} // namespace Catch + + + #include #include namespace Catch { + void ITestInvoker::prepareTestCase() {} + void ITestInvoker::tearDownTestCase() {} + ITestInvoker::~ITestInvoker() = default; namespace { - StringRef extractClassName( StringRef classOrMethodName ) { + static StringRef extractClassName( StringRef classOrMethodName ) { if ( !startsWith( classOrMethodName, '&' ) ) { return classOrMethodName; } @@ -6188,6 +7121,18 @@ namespace Catch { static_cast( startIdx ), static_cast( classNameSize ) ); } + + class TestInvokerAsFunction final : public ITestInvoker { + using TestType = void ( * )(); + TestType m_testAsFunction; + + public: + constexpr TestInvokerAsFunction( TestType testAsFunction ) noexcept: + m_testAsFunction( testAsFunction ) {} + + void invoke() const override { m_testAsFunction(); } + }; + } // namespace Detail::unique_ptr makeTestInvoker( void(*testAsFunction)() ) { @@ -6424,10 +7369,8 @@ namespace Catch { token.erase(token.begin()); if (m_exclusion) { m_currentFilter.m_forbidden.emplace_back(Detail::make_unique(".", m_substring)); - m_currentFilter.m_forbidden.emplace_back(Detail::make_unique(token, m_substring)); } else { m_currentFilter.m_required.emplace_back(Detail::make_unique(".", m_substring)); - m_currentFilter.m_required.emplace_back(Detail::make_unique(token, m_substring)); } } if (m_exclusion) { @@ -6441,10 +7384,6 @@ namespace Catch { m_mode = None; } - TestSpec parseTestSpec( std::string const& arg ) { - return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec(); - } - } // namespace Catch @@ -6468,117 +7407,228 @@ namespace { return std::memchr( chars, c, sizeof( chars ) - 1 ) != nullptr; } - bool isBoundary( std::string const& line, size_t at ) { - assert( at > 0 ); - assert( at <= line.size() ); - - return at == line.size() || - ( isWhitespace( line[at] ) && !isWhitespace( line[at - 1] ) ) || - isBreakableBefore( line[at] ) || - isBreakableAfter( line[at - 1] ); - } - } // namespace namespace Catch { namespace TextFlow { + void AnsiSkippingString::preprocessString() { + for ( auto it = m_string.begin(); it != m_string.end(); ) { + // try to read through an ansi sequence + while ( it != m_string.end() && *it == '\033' && + it + 1 != m_string.end() && *( it + 1 ) == '[' ) { + auto cursor = it + 2; + while ( cursor != m_string.end() && + ( isdigit( *cursor ) || *cursor == ';' ) ) { + ++cursor; + } + if ( cursor == m_string.end() || *cursor != 'm' ) { + break; + } + // 'm' -> 0xff + *cursor = AnsiSkippingString::sentinel; + // if we've read an ansi sequence, set the iterator and + // return to the top of the loop + it = cursor + 1; + } + if ( it != m_string.end() ) { + ++m_size; + ++it; + } + } + } + + AnsiSkippingString::AnsiSkippingString( std::string const& text ): + m_string( text ) { + preprocessString(); + } + + AnsiSkippingString::AnsiSkippingString( std::string&& text ): + m_string( CATCH_MOVE( text ) ) { + preprocessString(); + } + + AnsiSkippingString::const_iterator AnsiSkippingString::begin() const { + return const_iterator( m_string ); + } + + AnsiSkippingString::const_iterator AnsiSkippingString::end() const { + return const_iterator( m_string, const_iterator::EndTag{} ); + } + + std::string AnsiSkippingString::substring( const_iterator begin, + const_iterator end ) const { + // There's one caveat here to an otherwise simple substring: when + // making a begin iterator we might have skipped ansi sequences at + // the start. If `begin` here is a begin iterator, skipped over + // initial ansi sequences, we'll use the true beginning of the + // string. Lastly: We need to transform any chars we replaced with + // 0xff back to 'm' + auto str = std::string( begin == this->begin() ? m_string.begin() + : begin.m_it, + end.m_it ); + std::transform( str.begin(), str.end(), str.begin(), []( char c ) { + return c == AnsiSkippingString::sentinel ? 'm' : c; + } ); + return str; + } + + void AnsiSkippingString::const_iterator::tryParseAnsiEscapes() { + // check if we've landed on an ansi sequence, and if so read through + // it + while ( m_it != m_string->end() && *m_it == '\033' && + m_it + 1 != m_string->end() && *( m_it + 1 ) == '[' ) { + auto cursor = m_it + 2; + while ( cursor != m_string->end() && + ( isdigit( *cursor ) || *cursor == ';' ) ) { + ++cursor; + } + if ( cursor == m_string->end() || + *cursor != AnsiSkippingString::sentinel ) { + break; + } + // if we've read an ansi sequence, set the iterator and + // return to the top of the loop + m_it = cursor + 1; + } + } + + void AnsiSkippingString::const_iterator::advance() { + assert( m_it != m_string->end() ); + m_it++; + tryParseAnsiEscapes(); + } + + void AnsiSkippingString::const_iterator::unadvance() { + assert( m_it != m_string->begin() ); + m_it--; + // if *m_it is 0xff, scan back to the \033 and then m_it-- once more + // (and repeat check) + while ( *m_it == AnsiSkippingString::sentinel ) { + while ( *m_it != '\033' ) { + assert( m_it != m_string->begin() ); + m_it--; + } + // if this happens, we must have been a begin iterator that had + // skipped over ansi sequences at the start of a string + assert( m_it != m_string->begin() ); + assert( *m_it == '\033' ); + m_it--; + } + } + + static bool isBoundary( AnsiSkippingString const& line, + AnsiSkippingString::const_iterator it ) { + return it == line.end() || + ( isWhitespace( *it ) && + !isWhitespace( *it.oneBefore() ) ) || + isBreakableBefore( *it ) || + isBreakableAfter( *it.oneBefore() ); + } void Column::const_iterator::calcLength() { m_addHyphen = false; m_parsedTo = m_lineStart; + AnsiSkippingString const& current_line = m_column.m_string; - std::string const& current_line = m_column.m_string; - if ( current_line[m_lineStart] == '\n' ) { - ++m_parsedTo; + if ( m_parsedTo == current_line.end() ) { + m_lineEnd = m_parsedTo; + return; } + assert( m_lineStart != current_line.end() ); + if ( *m_lineStart == '\n' ) { ++m_parsedTo; } + const auto maxLineLength = m_column.m_width - indentSize(); - const auto maxParseTo = std::min(current_line.size(), m_lineStart + maxLineLength); - while ( m_parsedTo < maxParseTo && - current_line[m_parsedTo] != '\n' ) { + std::size_t lineLength = 0; + while ( m_parsedTo != current_line.end() && + lineLength < maxLineLength && *m_parsedTo != '\n' ) { ++m_parsedTo; + ++lineLength; } // If we encountered a newline before the column is filled, // then we linebreak at the newline and consider this line // finished. - if ( m_parsedTo < m_lineStart + maxLineLength ) { - m_lineLength = m_parsedTo - m_lineStart; + if ( lineLength < maxLineLength ) { + m_lineEnd = m_parsedTo; } else { // Look for a natural linebreak boundary in the column // (We look from the end, so that the first found boundary is // the right one) - size_t newLineLength = maxLineLength; - while ( newLineLength > 0 && !isBoundary( current_line, m_lineStart + newLineLength ) ) { - --newLineLength; + m_lineEnd = m_parsedTo; + while ( lineLength > 0 && + !isBoundary( current_line, m_lineEnd ) ) { + --lineLength; + --m_lineEnd; } - while ( newLineLength > 0 && - isWhitespace( current_line[m_lineStart + newLineLength - 1] ) ) { - --newLineLength; + while ( lineLength > 0 && + isWhitespace( *m_lineEnd.oneBefore() ) ) { + --lineLength; + --m_lineEnd; } - // If we found one, then that is where we linebreak - if ( newLineLength > 0 ) { - m_lineLength = newLineLength; - } else { - // Otherwise we have to split text with a hyphen + // If we found one, then that is where we linebreak, otherwise + // we have to split text with a hyphen + if ( lineLength == 0 ) { m_addHyphen = true; - m_lineLength = maxLineLength - 1; + m_lineEnd = m_parsedTo.oneBefore(); } } } size_t Column::const_iterator::indentSize() const { - auto initial = - m_lineStart == 0 ? m_column.m_initialIndent : std::string::npos; + auto initial = m_lineStart == m_column.m_string.begin() + ? m_column.m_initialIndent + : std::string::npos; return initial == std::string::npos ? m_column.m_indent : initial; } - std::string - Column::const_iterator::addIndentAndSuffix( size_t position, - size_t length ) const { + std::string Column::const_iterator::addIndentAndSuffix( + AnsiSkippingString::const_iterator start, + AnsiSkippingString::const_iterator end ) const { std::string ret; const auto desired_indent = indentSize(); - ret.reserve( desired_indent + length + m_addHyphen ); + // ret.reserve( desired_indent + (end - start) + m_addHyphen ); ret.append( desired_indent, ' ' ); - ret.append( m_column.m_string, position, length ); - if ( m_addHyphen ) { - ret.push_back( '-' ); - } + // ret.append( start, end ); + ret += m_column.m_string.substring( start, end ); + if ( m_addHyphen ) { ret.push_back( '-' ); } return ret; } - Column::const_iterator::const_iterator( Column const& column ): m_column( column ) { + Column::const_iterator::const_iterator( Column const& column ): + m_column( column ), + m_lineStart( column.m_string.begin() ), + m_lineEnd( column.m_string.begin() ), + m_parsedTo( column.m_string.begin() ) { assert( m_column.m_width > m_column.m_indent ); assert( m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent ); calcLength(); - if ( m_lineLength == 0 ) { - m_lineStart = m_column.m_string.size(); + if ( m_lineStart == m_lineEnd ) { + m_lineStart = m_column.m_string.end(); } } std::string Column::const_iterator::operator*() const { assert( m_lineStart <= m_parsedTo ); - return addIndentAndSuffix( m_lineStart, m_lineLength ); + return addIndentAndSuffix( m_lineStart, m_lineEnd ); } Column::const_iterator& Column::const_iterator::operator++() { - m_lineStart += m_lineLength; - std::string const& current_line = m_column.m_string; - if ( m_lineStart < current_line.size() && current_line[m_lineStart] == '\n' ) { - m_lineStart += 1; + m_lineStart = m_lineEnd; + AnsiSkippingString const& current_line = m_column.m_string; + if ( m_lineStart != current_line.end() && *m_lineStart == '\n' ) { + m_lineStart++; } else { - while ( m_lineStart < current_line.size() && - isWhitespace( current_line[m_lineStart] ) ) { + while ( m_lineStart != current_line.end() && + isWhitespace( *m_lineStart ) ) { ++m_lineStart; } } - if ( m_lineStart != current_line.size() ) { - calcLength(); - } + if ( m_lineStart != current_line.end() ) { calcLength(); } return *this; } @@ -6675,23 +7725,36 @@ namespace Catch { return os; } - Columns Column::operator+( Column const& other ) { + Columns operator+( Column const& lhs, Column const& rhs ) { + Columns cols; + cols += lhs; + cols += rhs; + return cols; + } + Columns operator+( Column&& lhs, Column&& rhs ) { Columns cols; - cols += *this; - cols += other; + cols += CATCH_MOVE( lhs ); + cols += CATCH_MOVE( rhs ); return cols; } - Columns& Columns::operator+=( Column const& col ) { - m_columns.push_back( col ); - return *this; + Columns& operator+=( Columns& lhs, Column const& rhs ) { + lhs.m_columns.push_back( rhs ); + return lhs; } - - Columns Columns::operator+( Column const& col ) { - Columns combined = *this; - combined += col; + Columns& operator+=( Columns& lhs, Column&& rhs ) { + lhs.m_columns.push_back( CATCH_MOVE( rhs ) ); + return lhs; + } + Columns operator+( Columns const& lhs, Column const& rhs ) { + auto combined( lhs ); + combined += rhs; return combined; } + Columns operator+( Columns&& lhs, Column&& rhs ) { + lhs += CATCH_MOVE( rhs ); + return CATCH_MOVE( lhs ); + } } // namespace TextFlow } // namespace Catch @@ -6757,6 +7820,7 @@ namespace Catch { // while in /permissive- mode. No, I don't know why. // Tested on VS 2019, 18.{3, 4}.x +#include #include #include @@ -6798,36 +7862,16 @@ namespace { os.flags(f); } - bool shouldNewline(XmlFormatting fmt) { + constexpr bool shouldNewline(XmlFormatting fmt) { return !!(static_cast>(fmt & XmlFormatting::Newline)); } - bool shouldIndent(XmlFormatting fmt) { + constexpr bool shouldIndent(XmlFormatting fmt) { return !!(static_cast>(fmt & XmlFormatting::Indent)); } } // anonymous namespace - XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs) { - return static_cast( - static_cast>(lhs) | - static_cast>(rhs) - ); - } - - XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs) { - return static_cast( - static_cast>(lhs) & - static_cast>(rhs) - ); - } - - - XmlEncode::XmlEncode( StringRef str, ForWhat forWhat ) - : m_str( str ), - m_forWhat( forWhat ) - {} - void XmlEncode::encodeTo( std::ostream& os ) const { // Apostrophe escaping not necessary if we always use " to write attributes // (see: http://www.w3.org/TR/xml/#syntax) @@ -7186,26 +8230,11 @@ namespace { return ulpDist <= maxUlpDiff; } -#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) - - float nextafter(float x, float y) { - return ::nextafterf(x, y); - } - - double nextafter(double x, double y) { - return ::nextafter(x, y); - } - -#endif // ^^^ CATCH_CONFIG_GLOBAL_NEXTAFTER ^^^ template FP step(FP start, FP direction, uint64_t steps) { for (uint64_t i = 0; i < steps; ++i) { -#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) start = Catch::nextafter(start, direction); -#else - start = std::nextafter(start, direction); -#endif } return start; } @@ -7339,7 +8368,7 @@ namespace Detail { std::string WithinRelMatcher::describe() const { Catch::ReusableStringStream sstr; - sstr << "and " << m_target << " are within " << m_epsilon * 100. << "% of each other"; + sstr << "and " << ::Catch::Detail::stringify(m_target) << " are within " << m_epsilon * 100. << "% of each other"; return sstr.str(); } @@ -7373,7 +8402,19 @@ WithinRelMatcher WithinRel(float target) { } -} // namespace Matchers + +bool IsNaNMatcher::match( double const& matchee ) const { + return std::isnan( matchee ); +} + +std::string IsNaNMatcher::describe() const { + using namespace std::string_literals; + return "is NaN"s; +} + +IsNaNMatcher IsNaN() { return IsNaNMatcher(); } + + } // namespace Matchers } // namespace Catch @@ -7553,9 +8594,9 @@ namespace Catch { // This is the general overload that takes a any string matcher // There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers // the Equals matcher (so the header does not mention matchers) - void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ) { + void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher ) { std::string exceptionMessage = Catch::translateActiveException(); - MatchExpr expr( CATCH_MOVE(exceptionMessage), matcher, matcherString ); + MatchExpr expr( CATCH_MOVE(exceptionMessage), matcher ); handler.handleExpr( expr ); } @@ -7567,12 +8608,14 @@ namespace Catch { namespace Catch { - AutomakeReporter::~AutomakeReporter() {} + AutomakeReporter::~AutomakeReporter() = default; void AutomakeReporter::testCaseEnded(TestCaseStats const& _testCaseStats) { // Possible values to emit are PASS, XFAIL, SKIP, FAIL, XPASS and ERROR. m_stream << ":test-result: "; - if (_testCaseStats.totals.assertions.allPassed()) { + if ( _testCaseStats.totals.testCases.skipped > 0 ) { + m_stream << "SKIP"; + } else if (_testCaseStats.totals.assertions.allPassed()) { m_stream << "PASS"; } else if (_testCaseStats.totals.assertions.allOk()) { m_stream << "XFAIL"; @@ -7634,22 +8677,6 @@ namespace Catch { #include -namespace { - - constexpr Catch::StringRef bothOrAll( std::uint64_t count ) { - switch (count) { - case 1: - return Catch::StringRef{}; - case 2: - return "both "_catch_sr; - default: - return "all "_catch_sr; - } - } - -} // anon namespace - - namespace Catch { namespace { @@ -7664,42 +8691,6 @@ namespace { static constexpr Catch::StringRef compactPassedString = "passed"_sr; #endif -// Colour, message variants: -// - white: No tests ran. -// - red: Failed [both/all] N test cases, failed [both/all] M assertions. -// - white: Passed [both/all] N test cases (no assertions). -// - red: Failed N tests cases, failed M assertions. -// - green: Passed [both/all] N tests cases with M assertions. -void printTotals(std::ostream& out, const Totals& totals, ColourImpl* colourImpl) { - if (totals.testCases.total() == 0) { - out << "No tests ran."; - } else if (totals.testCases.failed == totals.testCases.total()) { - auto guard = colourImpl->guardColour( Colour::ResultError ).engage( out ); - const StringRef qualify_assertions_failed = - totals.assertions.failed == totals.assertions.total() ? - bothOrAll(totals.assertions.failed) : StringRef{}; - out << - "Failed " << bothOrAll(totals.testCases.failed) - << pluralise(totals.testCases.failed, "test case"_sr) << ", " - "failed " << qualify_assertions_failed << - pluralise(totals.assertions.failed, "assertion"_sr) << '.'; - } else if (totals.assertions.total() == 0) { - out << - "Passed " << bothOrAll(totals.testCases.total()) - << pluralise(totals.testCases.total(), "test case"_sr) - << " (no assertions)."; - } else if (totals.assertions.failed) { - out << colourImpl->guardColour( Colour::ResultError ) << - "Failed " << pluralise(totals.testCases.failed, "test case"_sr) << ", " - "failed " << pluralise(totals.assertions.failed, "assertion"_sr) << '.'; - } else { - out << colourImpl->guardColour( Colour::ResultSuccess ) << - "Passed " << bothOrAll(totals.testCases.passed) - << pluralise(totals.testCases.passed, "test case"_sr) << - " with " << pluralise(totals.assertions.passed, "assertion"_sr) << '.'; - } -} - // Implementation of CompactReporter formatting class AssertionPrinter { public: @@ -7773,6 +8764,11 @@ class AssertionPrinter { printIssue("explicitly"); printRemainingMessages(Colour::None); break; + case ResultWas::ExplicitSkip: + printResultType(Colour::Skip, "skipped"_sr); + printMessage(); + printRemainingMessages(); + break; // These cases are here to prevent compiler warnings case ResultWas::Unknown: case ResultWas::FailureBit: @@ -7834,7 +8830,7 @@ class AssertionPrinter { return; const auto itEnd = messages.cend(); - const auto N = static_cast(std::distance(itMessage, itEnd)); + const auto N = static_cast(itEnd - itMessage); stream << colourImpl->guardColour( colour ) << " with " << pluralise( N, "message"_sr ) << ':'; @@ -7855,7 +8851,7 @@ class AssertionPrinter { private: std::ostream& stream; AssertionResult const& result; - std::vector messages; + std::vector const& messages; std::vector::const_iterator itMessage; bool printInfoMessages; ColourImpl* colourImpl; @@ -7875,10 +8871,10 @@ class AssertionPrinter { if ( m_config->testSpec().hasFilters() ) { m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: " - << serializeFilters( m_config->getTestsOrTags() ) + << m_config->testSpec() << '\n'; } - m_stream << "RNG seed: " << m_config->rngSeed() << '\n'; + m_stream << "RNG seed: " << getSeed() << '\n'; } void CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) { @@ -7888,7 +8884,7 @@ class AssertionPrinter { // Drop out if result was successful and we're not printing those if( !m_config->includeSuccessfulResults() && result.isOk() ) { - if( result.getResultType() != ResultWas::Warning ) + if( result.getResultType() != ResultWas::Warning && result.getResultType() != ResultWas::ExplicitSkip ) return; printInfoMessages = false; } @@ -7907,12 +8903,12 @@ class AssertionPrinter { } void CompactReporter::testRunEnded( TestRunStats const& _testRunStats ) { - printTotals( m_stream, _testRunStats.totals, m_colour.get() ); + printTestRunTotals( m_stream, *m_colour, _testRunStats.totals ); m_stream << "\n\n" << std::flush; StreamingReporterBase::testRunEnded( _testRunStats ); } - CompactReporter::~CompactReporter() {} + CompactReporter::~CompactReporter() = default; } // end namespace Catch @@ -7949,7 +8945,6 @@ class ConsoleAssertionPrinter { stats(_stats), result(_stats.assertionResult), colour(Colour::None), - message(result.getMessage()), messages(_stats.infoMessages), colourImpl(colourImpl_), printInfoMessages(_printInfoMessages) { @@ -7958,10 +8953,10 @@ class ConsoleAssertionPrinter { colour = Colour::Success; passOrFail = "PASSED"_sr; //if( result.hasMessage() ) - if (_stats.infoMessages.size() == 1) - messageLabel = "with message"; - if (_stats.infoMessages.size() > 1) - messageLabel = "with messages"; + if (messages.size() == 1) + messageLabel = "with message"_sr; + if (messages.size() > 1) + messageLabel = "with messages"_sr; break; case ResultWas::ExpressionFailed: if (result.isOk()) { @@ -7971,43 +8966,57 @@ class ConsoleAssertionPrinter { colour = Colour::Error; passOrFail = "FAILED"_sr; } - if (_stats.infoMessages.size() == 1) - messageLabel = "with message"; - if (_stats.infoMessages.size() > 1) - messageLabel = "with messages"; + if (messages.size() == 1) + messageLabel = "with message"_sr; + if (messages.size() > 1) + messageLabel = "with messages"_sr; break; case ResultWas::ThrewException: colour = Colour::Error; passOrFail = "FAILED"_sr; - messageLabel = "due to unexpected exception with "; - if (_stats.infoMessages.size() == 1) - messageLabel += "message"; - if (_stats.infoMessages.size() > 1) - messageLabel += "messages"; + // todo switch + switch (messages.size()) { case 0: + messageLabel = "due to unexpected exception with "_sr; + break; + case 1: + messageLabel = "due to unexpected exception with message"_sr; + break; + default: + messageLabel = "due to unexpected exception with messages"_sr; + break; + } break; case ResultWas::FatalErrorCondition: colour = Colour::Error; passOrFail = "FAILED"_sr; - messageLabel = "due to a fatal error condition"; + messageLabel = "due to a fatal error condition"_sr; break; case ResultWas::DidntThrowException: colour = Colour::Error; passOrFail = "FAILED"_sr; - messageLabel = "because no exception was thrown where one was expected"; + messageLabel = "because no exception was thrown where one was expected"_sr; break; case ResultWas::Info: - messageLabel = "info"; + messageLabel = "info"_sr; break; case ResultWas::Warning: - messageLabel = "warning"; + messageLabel = "warning"_sr; break; case ResultWas::ExplicitFailure: passOrFail = "FAILED"_sr; colour = Colour::Error; - if (_stats.infoMessages.size() == 1) - messageLabel = "explicitly with message"; - if (_stats.infoMessages.size() > 1) - messageLabel = "explicitly with messages"; + if (messages.size() == 1) + messageLabel = "explicitly with message"_sr; + if (messages.size() > 1) + messageLabel = "explicitly with messages"_sr; + break; + case ResultWas::ExplicitSkip: + colour = Colour::Skip; + passOrFail = "SKIPPED"_sr; + if (messages.size() == 1) + messageLabel = "explicitly with message"_sr; + if (messages.size() > 1) + messageLabel = "explicitly with messages"_sr; break; // These cases are here to prevent compiler warnings case ResultWas::Unknown: @@ -8071,9 +9080,8 @@ class ConsoleAssertionPrinter { AssertionResult const& result; Colour::Code colour; StringRef passOrFail; - std::string messageLabel; - std::string message; - std::vector messages; + StringRef messageLabel; + std::vector const& messages; ColourImpl* colourImpl; bool printInfoMessages; }; @@ -8083,24 +9091,21 @@ std::size_t makeRatio( std::uint64_t number, std::uint64_t total ) { return (ratio == 0 && number > 0) ? 1 : static_cast(ratio); } -std::size_t& findMax( std::size_t& i, std::size_t& j, std::size_t& k ) { - if (i > j && i > k) +std::size_t& +findMax( std::size_t& i, std::size_t& j, std::size_t& k, std::size_t& l ) { + if (i > j && i > k && i > l) return i; - else if (j > k) + else if (j > k && j > l) return j; - else + else if (k > l) return k; + else + return l; } -enum class Justification { Left, Right }; - -struct ColumnInfo { - std::string name; - std::size_t width; - Justification justification; -}; struct ColumnBreak {}; struct RowBreak {}; +struct OutputFlush {}; class Duration { enum class Unit { @@ -8175,6 +9180,14 @@ class Duration { }; } // end anon namespace +enum class Justification { Left, Right }; + +struct ColumnInfo { + std::string name; + std::size_t width; + Justification justification; +}; + class TablePrinter { std::ostream& m_os; std::vector m_columnInfos; @@ -8197,11 +9210,10 @@ class TablePrinter { *this << RowBreak(); TextFlow::Columns headerCols; - auto spacer = TextFlow::Spacer(2); for (auto const& info : m_columnInfos) { assert(info.width > 2); headerCols += TextFlow::Column(info.name).width(info.width - 2); - headerCols += spacer; + headerCols += TextFlow::Spacer( 2 ); } m_os << headerCols << '\n'; @@ -8217,12 +9229,12 @@ class TablePrinter { } template - friend TablePrinter& operator << (TablePrinter& tp, T const& value) { + friend TablePrinter& operator<< (TablePrinter& tp, T const& value) { tp.m_oss << value; return tp; } - friend TablePrinter& operator << (TablePrinter& tp, ColumnBreak) { + friend TablePrinter& operator<< (TablePrinter& tp, ColumnBreak) { auto colStr = tp.m_oss.str(); const auto strSize = colStr.size(); tp.m_oss.str(""); @@ -8244,13 +9256,18 @@ class TablePrinter { return tp; } - friend TablePrinter& operator << (TablePrinter& tp, RowBreak) { + friend TablePrinter& operator<< (TablePrinter& tp, RowBreak) { if (tp.m_currentColumn > 0) { tp.m_os << '\n'; tp.m_currentColumn = -1; } return tp; } + + friend TablePrinter& operator<<(TablePrinter& tp, OutputFlush) { + tp.m_os << std::flush; + return tp; + } }; ConsoleReporter::ConsoleReporter(ReporterConfig&& config): @@ -8272,7 +9289,7 @@ ConsoleReporter::ConsoleReporter(ReporterConfig&& config): { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 43, Justification::Left }, { "samples mean std dev", 14, Justification::Right }, { "iterations low mean low std dev", 14, Justification::Right }, - { "estimated high mean high std dev", 14, Justification::Right } + { "est run time high mean high std dev", 14, Justification::Right } }; } }())) {} @@ -8298,7 +9315,8 @@ void ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) { bool includeResults = m_config->includeSuccessfulResults() || !result.isOk(); // Drop out if result was successful but we're not printing them. - if (!includeResults && result.getResultType() != ResultWas::Warning) + // TODO: Make configurable whether skips should be printed + if (!includeResults && result.getResultType() != ResultWas::Warning && result.getResultType() != ResultWas::ExplicitSkip) return; lazyPrint(); @@ -8355,8 +9373,11 @@ void ConsoleReporter::benchmarkPreparing( StringRef name ) { void ConsoleReporter::benchmarkStarting(BenchmarkInfo const& info) { (*m_tablePrinter) << info.samples << ColumnBreak() << info.iterations << ColumnBreak(); - if (!m_config->benchmarkNoAnalysis()) - (*m_tablePrinter) << Duration(info.estimatedDuration) << ColumnBreak(); + if ( !m_config->benchmarkNoAnalysis() ) { + ( *m_tablePrinter ) + << Duration( info.estimatedDuration ) << ColumnBreak(); + } + ( *m_tablePrinter ) << OutputFlush{}; } void ConsoleReporter::benchmarkEnded(BenchmarkStats<> const& stats) { if (m_config->benchmarkNoAnalysis()) @@ -8389,17 +9410,17 @@ void ConsoleReporter::testCaseEnded(TestCaseStats const& _testCaseStats) { } void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { printTotalsDivider(_testRunStats.totals); - printTotals(_testRunStats.totals); + printTestRunTotals( m_stream, *m_colour, _testRunStats.totals ); m_stream << '\n' << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } -void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { - StreamingReporterBase::testRunStarting(_testInfo); +void ConsoleReporter::testRunStarting(TestRunInfo const& _testRunInfo) { + StreamingReporterBase::testRunStarting(_testRunInfo); if ( m_config->testSpec().hasFilters() ) { m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: " - << serializeFilters( m_config->getTestsOrTags() ) << '\n'; + << m_config->testSpec() << '\n'; } - m_stream << "Randomness seeded to: " << m_config->rngSeed() << '\n'; + m_stream << "Randomness seeded to: " << getSeed() << '\n'; } void ConsoleReporter::lazyPrint() { @@ -8496,91 +9517,16 @@ void ConsoleReporter::printHeaderString(std::string const& _string, std::size_t << '\n'; } -struct SummaryColumn { - - SummaryColumn( std::string _label, Colour::Code _colour ) - : label( CATCH_MOVE( _label ) ), - colour( _colour ) {} - SummaryColumn addRow( std::uint64_t count ) { - ReusableStringStream rss; - rss << count; - std::string row = rss.str(); - for (auto& oldRow : rows) { - while (oldRow.size() < row.size()) - oldRow = ' ' + oldRow; - while (oldRow.size() > row.size()) - row = ' ' + row; - } - rows.push_back(row); - return *this; - } - - std::string label; - Colour::Code colour; - std::vector rows; - -}; - -void ConsoleReporter::printTotals( Totals const& totals ) { - if (totals.testCases.total() == 0) { - m_stream << m_colour->guardColour( Colour::Warning ) - << "No tests ran\n"; - } else if (totals.assertions.total() > 0 && totals.testCases.allPassed()) { - m_stream << m_colour->guardColour( Colour::ResultSuccess ) - << "All tests passed"; - m_stream << " (" - << pluralise(totals.assertions.passed, "assertion"_sr) << " in " - << pluralise(totals.testCases.passed, "test case"_sr) << ')' - << '\n'; - } else { - - std::vector columns; - columns.push_back(SummaryColumn("", Colour::None) - .addRow(totals.testCases.total()) - .addRow(totals.assertions.total())); - columns.push_back(SummaryColumn("passed", Colour::Success) - .addRow(totals.testCases.passed) - .addRow(totals.assertions.passed)); - columns.push_back(SummaryColumn("failed", Colour::ResultError) - .addRow(totals.testCases.failed) - .addRow(totals.assertions.failed)); - columns.push_back(SummaryColumn("failed as expected", Colour::ResultExpectedFailure) - .addRow(totals.testCases.failedButOk) - .addRow(totals.assertions.failedButOk)); - - printSummaryRow("test cases"_sr, columns, 0); - printSummaryRow("assertions"_sr, columns, 1); - } -} -void ConsoleReporter::printSummaryRow(StringRef label, std::vector const& cols, std::size_t row) { - for (auto col : cols) { - std::string const& value = col.rows[row]; - if (col.label.empty()) { - m_stream << label << ": "; - if ( value != "0" ) { - m_stream << value; - } else { - m_stream << m_colour->guardColour( Colour::Warning ) - << "- none -"; - } - } else if (value != "0") { - m_stream << m_colour->guardColour( Colour::LightGrey ) << " | " - << m_colour->guardColour( col.colour ) << value << ' ' - << col.label; - } - } - m_stream << '\n'; -} - void ConsoleReporter::printTotalsDivider(Totals const& totals) { if (totals.testCases.total() > 0) { std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total()); std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total()); std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total()); - while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1) - findMax(failedRatio, failedButOkRatio, passedRatio)++; + std::size_t skippedRatio = makeRatio(totals.testCases.skipped, totals.testCases.total()); + while (failedRatio + failedButOkRatio + passedRatio + skippedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1) + findMax(failedRatio, failedButOkRatio, passedRatio, skippedRatio)++; while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1) - findMax(failedRatio, failedButOkRatio, passedRatio)--; + findMax(failedRatio, failedButOkRatio, passedRatio, skippedRatio)--; m_stream << m_colour->guardColour( Colour::Error ) << std::string( failedRatio, '=' ) @@ -8593,15 +9539,14 @@ void ConsoleReporter::printTotalsDivider(Totals const& totals) { m_stream << m_colour->guardColour( Colour::Success ) << std::string( passedRatio, '=' ); } + m_stream << m_colour->guardColour( Colour::Skip ) + << std::string( skippedRatio, '=' ); } else { m_stream << m_colour->guardColour( Colour::Warning ) << std::string( CATCH_CONFIG_CONSOLE_WIDTH - 1, '=' ); } m_stream << '\n'; } -void ConsoleReporter::printSummaryDivider() { - m_stream << lineOfChars('-') << '\n'; -} } // end namespace Catch @@ -8623,8 +9568,7 @@ namespace Catch { namespace { struct BySectionInfo { BySectionInfo( SectionInfo const& other ): m_other( other ) {} - BySectionInfo( BySectionInfo const& other ): - m_other( other.m_other ) {} + BySectionInfo( BySectionInfo const& other ) = default; bool operator()( Detail::unique_ptr const& node ) const { @@ -8677,7 +9621,8 @@ namespace Catch { void CumulativeReporterBase::sectionStarting( SectionInfo const& sectionInfo ) { - SectionStats incompleteStats( sectionInfo, Counts(), 0, false ); + // We need a copy, because SectionStats expect to take ownership + SectionStats incompleteStats( SectionInfo(sectionInfo), Counts(), 0, false ); SectionNode* node; if ( m_sectionStack.empty() ) { if ( !m_rootSection ) { @@ -9019,6 +9964,471 @@ namespace Catch { out << "\n\n" << std::flush; } + namespace { + class SummaryColumn { + public: + SummaryColumn( std::string suffix, Colour::Code colour ): + m_suffix( CATCH_MOVE( suffix ) ), m_colour( colour ) {} + + SummaryColumn&& addRow( std::uint64_t count ) && { + std::string row = std::to_string(count); + auto const new_width = std::max( m_width, row.size() ); + if ( new_width > m_width ) { + for ( auto& oldRow : m_rows ) { + oldRow.insert( 0, new_width - m_width, ' ' ); + } + } else { + row.insert( 0, m_width - row.size(), ' ' ); + } + m_width = new_width; + m_rows.push_back( row ); + return std::move( *this ); + } + + std::string const& getSuffix() const { return m_suffix; } + Colour::Code getColour() const { return m_colour; } + std::string const& getRow( std::size_t index ) const { + return m_rows[index]; + } + + private: + std::string m_suffix; + Colour::Code m_colour; + std::size_t m_width = 0; + std::vector m_rows; + }; + + void printSummaryRow( std::ostream& stream, + ColourImpl& colour, + StringRef label, + std::vector const& cols, + std::size_t row ) { + for ( auto const& col : cols ) { + auto const& value = col.getRow( row ); + auto const& suffix = col.getSuffix(); + if ( suffix.empty() ) { + stream << label << ": "; + if ( value != "0" ) { + stream << value; + } else { + stream << colour.guardColour( Colour::Warning ) + << "- none -"; + } + } else if ( value != "0" ) { + stream << colour.guardColour( Colour::LightGrey ) << " | " + << colour.guardColour( col.getColour() ) << value + << ' ' << suffix; + } + } + stream << '\n'; + } + } // namespace + + void printTestRunTotals( std::ostream& stream, + ColourImpl& streamColour, + Totals const& totals ) { + if ( totals.testCases.total() == 0 ) { + stream << streamColour.guardColour( Colour::Warning ) + << "No tests ran\n"; + return; + } + + if ( totals.assertions.total() > 0 && totals.testCases.allPassed() ) { + stream << streamColour.guardColour( Colour::ResultSuccess ) + << "All tests passed"; + stream << " (" + << pluralise( totals.assertions.passed, "assertion"_sr ) + << " in " + << pluralise( totals.testCases.passed, "test case"_sr ) + << ')' << '\n'; + return; + } + + std::vector columns; + // Don't include "skipped assertions" in total count + const auto totalAssertionCount = + totals.assertions.total() - totals.assertions.skipped; + columns.push_back( SummaryColumn( "", Colour::None ) + .addRow( totals.testCases.total() ) + .addRow( totalAssertionCount ) ); + columns.push_back( SummaryColumn( "passed", Colour::Success ) + .addRow( totals.testCases.passed ) + .addRow( totals.assertions.passed ) ); + columns.push_back( SummaryColumn( "failed", Colour::ResultError ) + .addRow( totals.testCases.failed ) + .addRow( totals.assertions.failed ) ); + columns.push_back( SummaryColumn( "skipped", Colour::Skip ) + .addRow( totals.testCases.skipped ) + // Don't print "skipped assertions" + .addRow( 0 ) ); + columns.push_back( + SummaryColumn( "failed as expected", Colour::ResultExpectedFailure ) + .addRow( totals.testCases.failedButOk ) + .addRow( totals.assertions.failedButOk ) ); + printSummaryRow( stream, streamColour, "test cases"_sr, columns, 0 ); + printSummaryRow( stream, streamColour, "assertions"_sr, columns, 1 ); + } + +} // namespace Catch + + +// + +namespace Catch { + namespace { + void writeSourceInfo( JsonObjectWriter& writer, + SourceLineInfo const& sourceInfo ) { + auto source_location_writer = + writer.write( "source-location"_sr ).writeObject(); + source_location_writer.write( "filename"_sr ) + .write( sourceInfo.file ); + source_location_writer.write( "line"_sr ).write( sourceInfo.line ); + } + + void writeTags( JsonArrayWriter writer, std::vector const& tags ) { + for ( auto const& tag : tags ) { + writer.write( tag.original ); + } + } + + void writeProperties( JsonArrayWriter writer, + TestCaseInfo const& info ) { + if ( info.isHidden() ) { writer.write( "is-hidden"_sr ); } + if ( info.okToFail() ) { writer.write( "ok-to-fail"_sr ); } + if ( info.expectedToFail() ) { + writer.write( "expected-to-fail"_sr ); + } + if ( info.throws() ) { writer.write( "throws"_sr ); } + } + + } // namespace + + JsonReporter::JsonReporter( ReporterConfig&& config ): + StreamingReporterBase{ CATCH_MOVE( config ) } { + + m_preferences.shouldRedirectStdOut = true; + // TBD: Do we want to report all assertions? XML reporter does + // not, but for machine-parseable reporters I think the answer + // should be yes. + m_preferences.shouldReportAllAssertions = true; + + m_objectWriters.emplace( m_stream ); + m_writers.emplace( Writer::Object ); + auto& writer = m_objectWriters.top(); + + writer.write( "version"_sr ).write( 1 ); + + { + auto metadata_writer = writer.write( "metadata"_sr ).writeObject(); + metadata_writer.write( "name"_sr ).write( m_config->name() ); + metadata_writer.write( "rng-seed"_sr ).write( m_config->rngSeed() ); + metadata_writer.write( "catch2-version"_sr ) + .write( libraryVersion() ); + if ( m_config->testSpec().hasFilters() ) { + metadata_writer.write( "filters"_sr ) + .write( m_config->testSpec() ); + } + } + } + + JsonReporter::~JsonReporter() { + endListing(); + // TODO: Ensure this closes the top level object, add asserts + assert( m_writers.size() == 1 && "Only the top level object should be open" ); + assert( m_writers.top() == Writer::Object ); + endObject(); + m_stream << '\n' << std::flush; + assert( m_writers.empty() ); + } + + JsonArrayWriter& JsonReporter::startArray() { + m_arrayWriters.emplace( m_arrayWriters.top().writeArray() ); + m_writers.emplace( Writer::Array ); + return m_arrayWriters.top(); + } + JsonArrayWriter& JsonReporter::startArray( StringRef key ) { + m_arrayWriters.emplace( + m_objectWriters.top().write( key ).writeArray() ); + m_writers.emplace( Writer::Array ); + return m_arrayWriters.top(); + } + + JsonObjectWriter& JsonReporter::startObject() { + m_objectWriters.emplace( m_arrayWriters.top().writeObject() ); + m_writers.emplace( Writer::Object ); + return m_objectWriters.top(); + } + JsonObjectWriter& JsonReporter::startObject( StringRef key ) { + m_objectWriters.emplace( + m_objectWriters.top().write( key ).writeObject() ); + m_writers.emplace( Writer::Object ); + return m_objectWriters.top(); + } + + void JsonReporter::endObject() { + assert( isInside( Writer::Object ) ); + m_objectWriters.pop(); + m_writers.pop(); + } + void JsonReporter::endArray() { + assert( isInside( Writer::Array ) ); + m_arrayWriters.pop(); + m_writers.pop(); + } + + bool JsonReporter::isInside( Writer writer ) { + return !m_writers.empty() && m_writers.top() == writer; + } + + void JsonReporter::startListing() { + if ( !m_startedListing ) { startObject( "listings"_sr ); } + m_startedListing = true; + } + void JsonReporter::endListing() { + if ( m_startedListing ) { endObject(); } + m_startedListing = false; + } + + std::string JsonReporter::getDescription() { + return "Outputs listings as JSON. Test listing is Work-in-Progress!"; + } + + void JsonReporter::testRunStarting( TestRunInfo const& runInfo ) { + StreamingReporterBase::testRunStarting( runInfo ); + endListing(); + + assert( isInside( Writer::Object ) ); + startObject( "test-run"_sr ); + startArray( "test-cases"_sr ); + } + + static void writeCounts( JsonObjectWriter&& writer, Counts const& counts ) { + writer.write( "passed"_sr ).write( counts.passed ); + writer.write( "failed"_sr ).write( counts.failed ); + writer.write( "fail-but-ok"_sr ).write( counts.failedButOk ); + writer.write( "skipped"_sr ).write( counts.skipped ); + } + + void JsonReporter::testRunEnded(TestRunStats const& runStats) { + assert( isInside( Writer::Array ) ); + // End "test-cases" + endArray(); + + { + auto totals = + m_objectWriters.top().write( "totals"_sr ).writeObject(); + writeCounts( totals.write( "assertions"_sr ).writeObject(), + runStats.totals.assertions ); + writeCounts( totals.write( "test-cases"_sr ).writeObject(), + runStats.totals.testCases ); + } + + // End the "test-run" object + endObject(); + } + + void JsonReporter::testCaseStarting( TestCaseInfo const& tcInfo ) { + StreamingReporterBase::testCaseStarting( tcInfo ); + + assert( isInside( Writer::Array ) && + "We should be in the 'test-cases' array" ); + startObject(); + // "test-info" prelude + { + auto testInfo = + m_objectWriters.top().write( "test-info"_sr ).writeObject(); + // TODO: handle testName vs className!! + testInfo.write( "name"_sr ).write( tcInfo.name ); + writeSourceInfo(testInfo, tcInfo.lineInfo); + writeTags( testInfo.write( "tags"_sr ).writeArray(), tcInfo.tags ); + writeProperties( testInfo.write( "properties"_sr ).writeArray(), + tcInfo ); + } + + + // Start the array for individual test runs (testCasePartial pairs) + startArray( "runs"_sr ); + } + + void JsonReporter::testCaseEnded( TestCaseStats const& tcStats ) { + StreamingReporterBase::testCaseEnded( tcStats ); + + // We need to close the 'runs' array before finishing the test case + assert( isInside( Writer::Array ) ); + endArray(); + + { + auto totals = + m_objectWriters.top().write( "totals"_sr ).writeObject(); + writeCounts( totals.write( "assertions"_sr ).writeObject(), + tcStats.totals.assertions ); + // We do not write the test case totals, because there will always be just one test case here. + // TODO: overall "result" -> success, skip, fail here? Or in partial result? + } + // We do not write out stderr/stdout, because we instead wrote those out in partial runs + + // TODO: aborting? + + // And we also close this test case's object + assert( isInside( Writer::Object ) ); + endObject(); + } + + void JsonReporter::testCasePartialStarting( TestCaseInfo const& /*tcInfo*/, + uint64_t index ) { + startObject(); + m_objectWriters.top().write( "run-idx"_sr ).write( index ); + startArray( "path"_sr ); + // TODO: we want to delay most of the printing to the 'root' section + // TODO: childSection key name? + } + + void JsonReporter::testCasePartialEnded( TestCaseStats const& tcStats, + uint64_t /*index*/ ) { + // Fixme: the top level section handles this. + //// path object + endArray(); + if ( !tcStats.stdOut.empty() ) { + m_objectWriters.top() + .write( "captured-stdout"_sr ) + .write( tcStats.stdOut ); + } + if ( !tcStats.stdErr.empty() ) { + m_objectWriters.top() + .write( "captured-stderr"_sr ) + .write( tcStats.stdErr ); + } + { + auto totals = + m_objectWriters.top().write( "totals"_sr ).writeObject(); + writeCounts( totals.write( "assertions"_sr ).writeObject(), + tcStats.totals.assertions ); + // We do not write the test case totals, because there will + // always be just one test case here. + // TODO: overall "result" -> success, skip, fail here? Or in + // partial result? + } + // TODO: aborting? + // run object + endObject(); + } + + void JsonReporter::sectionStarting( SectionInfo const& sectionInfo ) { + assert( isInside( Writer::Array ) && + "Section should always start inside an object" ); + // We want to nest top level sections, even though it shares name + // and source loc with the TEST_CASE + auto& sectionObject = startObject(); + sectionObject.write( "kind"_sr ).write( "section"_sr ); + sectionObject.write( "name"_sr ).write( sectionInfo.name ); + writeSourceInfo( m_objectWriters.top(), sectionInfo.lineInfo ); + + + // TBD: Do we want to create this event lazily? It would become + // rather complex, but we could do it, and it would look + // better for empty sections. OTOH, empty sections should + // be rare. + startArray( "path"_sr ); + } + void JsonReporter::sectionEnded( SectionStats const& /*sectionStats */) { + // End the subpath array + endArray(); + // TODO: metadata + // TODO: what info do we have here? + + // End the section object + endObject(); + } + + void JsonReporter::assertionStarting( AssertionInfo const& /*assertionInfo*/ ) {} + void JsonReporter::assertionEnded( AssertionStats const& assertionStats ) { + // TODO: There is lot of different things to handle here, but + // we can fill it in later, after we show that the basic + // outline and streaming reporter impl works well enough. + //if ( !m_config->includeSuccessfulResults() + // && assertionStats.assertionResult.isOk() ) { + // return; + //} + assert( isInside( Writer::Array ) ); + auto assertionObject = m_arrayWriters.top().writeObject(); + + assertionObject.write( "kind"_sr ).write( "assertion"_sr ); + writeSourceInfo( assertionObject, + assertionStats.assertionResult.getSourceInfo() ); + assertionObject.write( "status"_sr ) + .write( assertionStats.assertionResult.isOk() ); + // TODO: handling of result. + // TODO: messages + // TODO: totals? + } + + + void JsonReporter::benchmarkPreparing( StringRef name ) { (void)name; } + void JsonReporter::benchmarkStarting( BenchmarkInfo const& ) {} + void JsonReporter::benchmarkEnded( BenchmarkStats<> const& ) {} + void JsonReporter::benchmarkFailed( StringRef error ) { (void)error; } + + void JsonReporter::listReporters( + std::vector const& descriptions ) { + startListing(); + + auto writer = + m_objectWriters.top().write( "reporters"_sr ).writeArray(); + for ( auto const& desc : descriptions ) { + auto desc_writer = writer.writeObject(); + desc_writer.write( "name"_sr ).write( desc.name ); + desc_writer.write( "description"_sr ).write( desc.description ); + } + } + void JsonReporter::listListeners( + std::vector const& descriptions ) { + startListing(); + + auto writer = + m_objectWriters.top().write( "listeners"_sr ).writeArray(); + + for ( auto const& desc : descriptions ) { + auto desc_writer = writer.writeObject(); + desc_writer.write( "name"_sr ).write( desc.name ); + desc_writer.write( "description"_sr ).write( desc.description ); + } + } + void JsonReporter::listTests( std::vector const& tests ) { + startListing(); + + auto writer = m_objectWriters.top().write( "tests"_sr ).writeArray(); + + for ( auto const& test : tests ) { + auto desc_writer = writer.writeObject(); + auto const& info = test.getTestCaseInfo(); + + desc_writer.write( "name"_sr ).write( info.name ); + desc_writer.write( "class-name"_sr ).write( info.className ); + { + auto tag_writer = desc_writer.write( "tags"_sr ).writeArray(); + for ( auto const& tag : info.tags ) { + tag_writer.write( tag.original ); + } + } + writeSourceInfo( desc_writer, info.lineInfo ); + } + } + void JsonReporter::listTags( std::vector const& tags ) { + startListing(); + + auto writer = m_objectWriters.top().write( "tags"_sr ).writeArray(); + for ( auto const& tag : tags ) { + auto tag_writer = writer.writeObject(); + { + auto aliases_writer = + tag_writer.write( "aliases"_sr ).writeArray(); + for ( auto alias : tag.spellings ) { + aliases_writer.write( alias ); + } + } + tag_writer.write( "count"_sr ).write( tag.count ); + } + } } // namespace Catch @@ -9039,6 +10449,10 @@ namespace Catch { std::tm timeInfo = {}; #if defined (_MSC_VER) || defined (__MINGW32__) gmtime_s(&timeInfo, &rawtime); +#elif defined (CATCH_PLATFORM_PLAYSTATION) + gmtime_s(&rawtime, &timeInfo); +#elif defined (__IAR_SYSTEMS_ICC__) + timeInfo = *std::gmtime(&rawtime); #else gmtime_r(&rawtime, &timeInfo); #endif @@ -9078,7 +10492,7 @@ namespace Catch { static void normalizeNamespaceMarkers(std::string& str) { std::size_t pos = str.find( "::" ); - while ( pos != str.npos ) { + while ( pos != std::string::npos ) { str.replace( pos, 2, "." ); pos += 1; pos = str.find( "::", pos ); @@ -9092,7 +10506,7 @@ namespace Catch { xml( m_stream ) { m_preferences.shouldRedirectStdOut = true; - m_preferences.shouldReportAllAssertions = true; + m_preferences.shouldReportAllAssertions = false; m_shouldStoreSuccesfulAssertions = false; } @@ -9138,6 +10552,7 @@ namespace Catch { xml.writeAttribute( "name"_sr, stats.runInfo.name ); xml.writeAttribute( "errors"_sr, unexpectedExceptions ); xml.writeAttribute( "failures"_sr, stats.totals.assertions.failed-unexpectedExceptions ); + xml.writeAttribute( "skipped"_sr, stats.totals.assertions.skipped ); xml.writeAttribute( "tests"_sr, stats.totals.assertions.total() ); xml.writeAttribute( "hostname"_sr, "tbd"_sr ); // !TBD if( m_config->showDurations() == ShowDurations::Never ) @@ -9152,10 +10567,10 @@ namespace Catch { xml.scopedElement("property") .writeAttribute("name"_sr, "random-seed"_sr) .writeAttribute("value"_sr, m_config->rngSeed()); - if (m_config->hasTestFilters()) { + if (m_config->testSpec().hasFilters()) { xml.scopedElement("property") .writeAttribute("name"_sr, "filters"_sr) - .writeAttribute("value"_sr, serializeFilters(m_config->getTestsOrTags())); + .writeAttribute("value"_sr, m_config->testSpec()); } } @@ -9201,7 +10616,7 @@ namespace Catch { if( !rootName.empty() ) name = rootName + '/' + name; - if( sectionNode.hasAnyAssertions() + if ( sectionNode.stats.assertions.total() > 0 || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); @@ -9250,7 +10665,8 @@ namespace Catch { void JunitReporter::writeAssertion( AssertionStats const& stats ) { AssertionResult const& result = stats.assertionResult; - if( !result.isOk() ) { + if ( !result.isOk() || + result.getResultType() == ResultWas::ExplicitSkip ) { std::string elementName; switch( result.getResultType() ) { case ResultWas::ThrewException: @@ -9262,7 +10678,9 @@ namespace Catch { case ResultWas::DidntThrowException: elementName = "failure"; break; - + case ResultWas::ExplicitSkip: + elementName = "skipped"; + break; // We should never see these here: case ResultWas::Info: case ResultWas::Warning: @@ -9280,7 +10698,9 @@ namespace Catch { xml.writeAttribute( "type"_sr, result.getTestMacroName() ); ReusableStringStream rss; - if (stats.totals.assertions.total() > 0) { + if ( result.getResultType() == ResultWas::ExplicitSkip ) { + rss << "SKIPPED\n"; + } else { rss << "FAILED" << ":\n"; if (result.hasExpression()) { rss << " "; @@ -9291,11 +10711,9 @@ namespace Catch { rss << "with expansion:\n"; rss << TextFlow::Column(result.getExpandedExpression()).indent(2) << '\n'; } - } else { - rss << '\n'; } - if( !result.getMessage().empty() ) + if( result.hasMessage() ) rss << result.getMessage() << '\n'; for( auto const& msg : stats.infoMessages ) if( msg.type == ResultWas::Info ) @@ -9414,7 +10832,6 @@ namespace Catch { } } - // The return value indicates if the messages buffer should be cleared: void MultiReporter::assertionEnded( AssertionStats const& assertionStats ) { const bool reportByDefault = assertionStats.assertionResult.getResultType() != ResultWas::Ok || @@ -9517,6 +10934,11 @@ namespace Catch { } } + void registerListenerImpl( Detail::unique_ptr listenerFactory ) { + getMutableRegistryHub().registerListener( CATCH_MOVE(listenerFactory) ); + } + + } // namespace Detail } // namespace Catch @@ -9528,9 +10950,14 @@ namespace Catch { namespace Catch { namespace { - std::string createRngSeedString(uint32_t seed) { + std::string createMetadataString(IConfig const& config) { ReusableStringStream sstr; - sstr << "rng-seed=" << seed; + if ( config.testSpec().hasFilters() ) { + sstr << "filters='" + << config.testSpec() + << "' "; + } + sstr << "rng-seed=" << config.rngSeed(); return sstr.str(); } } @@ -9538,13 +10965,13 @@ namespace Catch { void SonarQubeReporter::testRunStarting(TestRunInfo const& testRunInfo) { CumulativeReporterBase::testRunStarting(testRunInfo); - xml.writeComment( createRngSeedString( m_config->rngSeed() ) ); + xml.writeComment( createMetadataString( *m_config ) ); xml.startElement("testExecutions"); xml.writeAttribute("version"_sr, '1'); } void SonarQubeReporter::writeRun( TestRunNode const& runNode ) { - std::map> testsPerFile; + std::map> testsPerFile; for ( auto const& child : runNode.children ) { testsPerFile[child->value.testInfo->lineInfo.file].push_back( @@ -9556,7 +10983,7 @@ namespace Catch { } } - void SonarQubeReporter::writeTestFile(std::string const& filename, std::vector const& testCaseNodes) { + void SonarQubeReporter::writeTestFile(StringRef filename, std::vector const& testCaseNodes) { XmlWriter::ScopedElement e = xml.scopedElement("file"); xml.writeAttribute("path"_sr, filename); @@ -9577,9 +11004,9 @@ namespace Catch { if (!rootName.empty()) name = rootName + '/' + name; - if ( sectionNode.hasAnyAssertions() + if ( sectionNode.stats.assertions.total() > 0 || !sectionNode.stdOut.empty() - || !sectionNode.stdErr.empty() ) { + || !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement("testCase"); xml.writeAttribute("name"_sr, name); xml.writeAttribute("duration"_sr, static_cast(sectionNode.stats.durationInSeconds * 1000)); @@ -9601,7 +11028,8 @@ namespace Catch { void SonarQubeReporter::writeAssertion(AssertionStats const& stats, bool okToFail) { AssertionResult const& result = stats.assertionResult; - if (!result.isOk()) { + if ( !result.isOk() || + result.getResultType() == ResultWas::ExplicitSkip ) { std::string elementName; if (okToFail) { elementName = "skipped"; @@ -9612,15 +11040,13 @@ namespace Catch { elementName = "error"; break; case ResultWas::ExplicitFailure: - elementName = "failure"; - break; case ResultWas::ExpressionFailed: - elementName = "failure"; - break; case ResultWas::DidntThrowException: elementName = "failure"; break; - + case ResultWas::ExplicitSkip: + elementName = "skipped"; + break; // We should never see these here: case ResultWas::Info: case ResultWas::Warning: @@ -9640,7 +11066,9 @@ namespace Catch { xml.writeAttribute("message"_sr, messageRss.str()); ReusableStringStream textRss; - if (stats.totals.assertions.total() > 0) { + if ( result.getResultType() == ResultWas::ExplicitSkip ) { + textRss << "SKIPPED\n"; + } else { textRss << "FAILED:\n"; if (result.hasExpression()) { textRss << '\t' << result.getExpressionInMacro() << '\n'; @@ -9650,7 +11078,7 @@ namespace Catch { } } - if (!result.getMessage().empty()) + if (result.hasMessage()) textRss << result.getMessage() << '\n'; for (auto const& msg : stats.infoMessages) @@ -9684,7 +11112,6 @@ namespace Catch { #include -#include #include namespace Catch { @@ -9770,6 +11197,12 @@ namespace Catch { printIssue("explicitly"_sr); printRemainingMessages(Colour::None); break; + case ResultWas::ExplicitSkip: + printResultType(tapPassedString); + printIssue(" # SKIP"_sr); + printMessage(); + printRemainingMessages(); + break; // These cases are here to prevent compiler warnings case ResultWas::Unknown: case ResultWas::FailureBit: @@ -9829,7 +11262,7 @@ namespace Catch { // using messages.end() directly (or auto) yields compilation error: std::vector::const_iterator itEnd = messages.end(); - const std::size_t N = static_cast(std::distance(itMessage, itEnd)); + const std::size_t N = static_cast(itEnd - itMessage); stream << colourImpl->guardColour( colour ) << " with " << pluralise( N, "message"_sr ) << ':'; @@ -9848,7 +11281,7 @@ namespace Catch { private: std::ostream& stream; AssertionResult const& result; - std::vector messages; + std::vector const& messages; std::vector::const_iterator itMessage; bool printInfoMessages; std::size_t counter; @@ -9858,6 +11291,9 @@ namespace Catch { } // End anonymous namespace void TAPReporter::testRunStarting( TestRunInfo const& ) { + if ( m_config->testSpec().hasFilters() ) { + m_stream << "# filters: " << m_config->testSpec() << '\n'; + } m_stream << "# rng-seed: " << m_config->rngSeed() << '\n'; } @@ -9924,7 +11360,7 @@ namespace Catch { } // end anonymous namespace - TeamCityReporter::~TeamCityReporter() {} + TeamCityReporter::~TeamCityReporter() = default; void TeamCityReporter::testRunStarting( TestRunInfo const& runInfo ) { m_stream << "##teamcity[testSuiteStarted name='" << escape( runInfo.name ) @@ -9938,7 +11374,8 @@ namespace Catch { void TeamCityReporter::assertionEnded(AssertionStats const& assertionStats) { AssertionResult const& result = assertionStats.assertionResult; - if (!result.isOk()) { + if ( !result.isOk() || + result.getResultType() == ResultWas::ExplicitSkip ) { ReusableStringStream msg; if (!m_headerPrintedForThisSection) @@ -9963,6 +11400,9 @@ namespace Catch { case ResultWas::ExplicitFailure: msg << "explicit failure"; break; + case ResultWas::ExplicitSkip: + msg << "explicit skip"; + break; // We shouldn't get here because of the isOk() test case ResultWas::Ok: @@ -9990,18 +11430,16 @@ namespace Catch { " " << result.getExpandedExpression() << '\n'; } - if (currentTestCaseInfo->okToFail()) { + if ( result.getResultType() == ResultWas::ExplicitSkip ) { + m_stream << "##teamcity[testIgnored"; + } else if ( currentTestCaseInfo->okToFail() ) { msg << "- failure ignore as test marked as 'ok to fail'\n"; - m_stream << "##teamcity[testIgnored" - << " name='" << escape(currentTestCaseInfo->name) << '\'' - << " message='" << escape(msg.str()) << '\'' - << "]\n"; + m_stream << "##teamcity[testIgnored"; } else { - m_stream << "##teamcity[testFailed" - << " name='" << escape(currentTestCaseInfo->name) << '\'' - << " message='" << escape(msg.str()) << '\'' - << "]\n"; + m_stream << "##teamcity[testFailed"; } + m_stream << " name='" << escape( currentTestCaseInfo->name ) << '\'' + << " message='" << escape( msg.str() ) << '\'' << "]\n"; } m_stream.flush(); } @@ -10096,15 +11534,17 @@ namespace Catch { m_xml.startElement("Catch2TestRun") .writeAttribute("name"_sr, m_config->name()) .writeAttribute("rng-seed"_sr, m_config->rngSeed()) + .writeAttribute("xml-format-version"_sr, 3) .writeAttribute("catch2-version"_sr, libraryVersion()); - if (m_config->testSpec().hasFilters()) - m_xml.writeAttribute( "filters"_sr, serializeFilters( m_config->getTestsOrTags() ) ); + if ( m_config->testSpec().hasFilters() ) { + m_xml.writeAttribute( "filters"_sr, m_config->testSpec() ); + } } void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) { StreamingReporterBase::testCaseStarting(testInfo); m_xml.startElement( "TestCase" ) - .writeAttribute( "name"_sr, trim( testInfo.name ) ) + .writeAttribute( "name"_sr, trim( StringRef(testInfo.name) ) ) .writeAttribute( "tags"_sr, testInfo.tagsAsString() ); writeSourceInfo( testInfo.lineInfo ); @@ -10118,7 +11558,7 @@ namespace Catch { StreamingReporterBase::sectionStarting( sectionInfo ); if( m_sectionDepth++ > 0 ) { m_xml.startElement( "Section" ) - .writeAttribute( "name"_sr, trim( sectionInfo.name ) ); + .writeAttribute( "name"_sr, trim( StringRef(sectionInfo.name) ) ); writeSourceInfo( sectionInfo.lineInfo ); m_xml.ensureTagClosed(); } @@ -10136,19 +11576,22 @@ namespace Catch { // Print any info messages in tags. for( auto const& msg : assertionStats.infoMessages ) { if( msg.type == ResultWas::Info && includeResults ) { - m_xml.scopedElement( "Info" ) - .writeText( msg.message ); + auto t = m_xml.scopedElement( "Info" ); + writeSourceInfo( msg.lineInfo ); + t.writeText( msg.message ); } else if ( msg.type == ResultWas::Warning ) { - m_xml.scopedElement( "Warning" ) - .writeText( msg.message ); + auto t = m_xml.scopedElement( "Warning" ); + writeSourceInfo( msg.lineInfo ); + t.writeText( msg.message ); } } } // Drop out if result was successful but we're not printing them. - if( !includeResults && result.getResultType() != ResultWas::Warning ) + if ( !includeResults && result.getResultType() != ResultWas::Warning && + result.getResultType() != ResultWas::ExplicitSkip ) { return; - + } // Print the expression if there is one. if( result.hasExpression() ) { @@ -10191,6 +11634,12 @@ namespace Catch { m_xml.writeText( result.getMessage() ); m_xml.endElement(); break; + case ResultWas::ExplicitSkip: + m_xml.startElement( "Skip" ); + writeSourceInfo( result.getSourceInfo() ); + m_xml.writeText( result.getMessage() ); + m_xml.endElement(); + break; default: break; } @@ -10201,15 +11650,18 @@ namespace Catch { void XmlReporter::sectionEnded( SectionStats const& sectionStats ) { StreamingReporterBase::sectionEnded( sectionStats ); - if( --m_sectionDepth > 0 ) { - XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" ); - e.writeAttribute( "successes"_sr, sectionStats.assertions.passed ); - e.writeAttribute( "failures"_sr, sectionStats.assertions.failed ); - e.writeAttribute( "expectedFailures"_sr, sectionStats.assertions.failedButOk ); - - if ( m_config->showDurations() == ShowDurations::Always ) - e.writeAttribute( "durationInSeconds"_sr, sectionStats.durationInSeconds ); + if ( --m_sectionDepth > 0 ) { + { + XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" ); + e.writeAttribute( "successes"_sr, sectionStats.assertions.passed ); + e.writeAttribute( "failures"_sr, sectionStats.assertions.failed ); + e.writeAttribute( "expectedFailures"_sr, sectionStats.assertions.failedButOk ); + e.writeAttribute( "skipped"_sr, sectionStats.assertions.skipped > 0 ); + if ( m_config->showDurations() == ShowDurations::Always ) + e.writeAttribute( "durationInSeconds"_sr, sectionStats.durationInSeconds ); + } + // Ends assertion tag m_xml.endElement(); } } @@ -10218,14 +11670,14 @@ namespace Catch { StreamingReporterBase::testCaseEnded( testCaseStats ); XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" ); e.writeAttribute( "success"_sr, testCaseStats.totals.assertions.allOk() ); + e.writeAttribute( "skips"_sr, testCaseStats.totals.assertions.skipped ); if ( m_config->showDurations() == ShowDurations::Always ) e.writeAttribute( "durationInSeconds"_sr, m_testCaseTimer.getElapsedSeconds() ); - if( !testCaseStats.stdOut.empty() ) - m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), XmlFormatting::Newline ); + m_xml.scopedElement( "StdOut" ).writeText( trim( StringRef(testCaseStats.stdOut) ), XmlFormatting::Newline ); if( !testCaseStats.stdErr.empty() ) - m_xml.scopedElement( "StdErr" ).writeText( trim( testCaseStats.stdErr ), XmlFormatting::Newline ); + m_xml.scopedElement( "StdErr" ).writeText( trim( StringRef(testCaseStats.stdErr) ), XmlFormatting::Newline ); m_xml.endElement(); } @@ -10235,11 +11687,13 @@ namespace Catch { m_xml.scopedElement( "OverallResults" ) .writeAttribute( "successes"_sr, testRunStats.totals.assertions.passed ) .writeAttribute( "failures"_sr, testRunStats.totals.assertions.failed ) - .writeAttribute( "expectedFailures"_sr, testRunStats.totals.assertions.failedButOk ); + .writeAttribute( "expectedFailures"_sr, testRunStats.totals.assertions.failedButOk ) + .writeAttribute( "skips"_sr, testRunStats.totals.assertions.skipped ); m_xml.scopedElement( "OverallResultsCases") .writeAttribute( "successes"_sr, testRunStats.totals.testCases.passed ) .writeAttribute( "failures"_sr, testRunStats.totals.testCases.failed ) - .writeAttribute( "expectedFailures"_sr, testRunStats.totals.testCases.failedButOk ); + .writeAttribute( "expectedFailures"_sr, testRunStats.totals.testCases.failedButOk ) + .writeAttribute( "skips"_sr, testRunStats.totals.testCases.skipped ); m_xml.endElement(); } @@ -10258,26 +11712,23 @@ namespace Catch { } void XmlReporter::benchmarkEnded(BenchmarkStats<> const& benchmarkStats) { - m_xml.startElement("mean") + m_xml.scopedElement("mean") .writeAttribute("value"_sr, benchmarkStats.mean.point.count()) .writeAttribute("lowerBound"_sr, benchmarkStats.mean.lower_bound.count()) .writeAttribute("upperBound"_sr, benchmarkStats.mean.upper_bound.count()) .writeAttribute("ci"_sr, benchmarkStats.mean.confidence_interval); - m_xml.endElement(); - m_xml.startElement("standardDeviation") + m_xml.scopedElement("standardDeviation") .writeAttribute("value"_sr, benchmarkStats.standardDeviation.point.count()) .writeAttribute("lowerBound"_sr, benchmarkStats.standardDeviation.lower_bound.count()) .writeAttribute("upperBound"_sr, benchmarkStats.standardDeviation.upper_bound.count()) .writeAttribute("ci"_sr, benchmarkStats.standardDeviation.confidence_interval); - m_xml.endElement(); - m_xml.startElement("outliers") + m_xml.scopedElement("outliers") .writeAttribute("variance"_sr, benchmarkStats.outlierVariance) .writeAttribute("lowMild"_sr, benchmarkStats.outliers.low_mild) .writeAttribute("lowSevere"_sr, benchmarkStats.outliers.low_severe) .writeAttribute("highMild"_sr, benchmarkStats.outliers.high_mild) .writeAttribute("highSevere"_sr, benchmarkStats.outliers.high_severe); m_xml.endElement(); - m_xml.endElement(); } void XmlReporter::benchmarkFailed(StringRef error) { diff --git a/bx/3rdparty/catch/catch_amalgamated.hpp b/bx/3rdparty/catch/catch_amalgamated.hpp index 757e10c5..b7c768b8 100644 --- a/bx/3rdparty/catch/catch_amalgamated.hpp +++ b/bx/3rdparty/catch/catch_amalgamated.hpp @@ -1,12 +1,13 @@ + // Copyright Catch2 Authors // Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// (See accompanying file LICENSE.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -// Catch v3.1.0 -// Generated: 2022-07-17 20:14:04.055157 +// Catch v3.7.1 +// Generated: 2024-09-17 10:36:40.974985 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -59,233 +60,6 @@ -#ifndef CATCH_INTERFACES_CONFIG_HPP_INCLUDED -#define CATCH_INTERFACES_CONFIG_HPP_INCLUDED - - - -#ifndef CATCH_NONCOPYABLE_HPP_INCLUDED -#define CATCH_NONCOPYABLE_HPP_INCLUDED - -namespace Catch { - namespace Detail { - - //! Deriving classes become noncopyable and nonmovable - class NonCopyable { - NonCopyable( NonCopyable const& ) = delete; - NonCopyable( NonCopyable&& ) = delete; - NonCopyable& operator=( NonCopyable const& ) = delete; - NonCopyable& operator=( NonCopyable&& ) = delete; - - protected: - NonCopyable() noexcept = default; - }; - - } // namespace Detail -} // namespace Catch - -#endif // CATCH_NONCOPYABLE_HPP_INCLUDED - - -#ifndef CATCH_STRINGREF_HPP_INCLUDED -#define CATCH_STRINGREF_HPP_INCLUDED - -#include -#include -#include -#include - -namespace Catch { - - /// A non-owning string class (similar to the forthcoming std::string_view) - /// Note that, because a StringRef may be a substring of another string, - /// it may not be null terminated. - class StringRef { - public: - using size_type = std::size_t; - using const_iterator = const char*; - - private: - static constexpr char const* const s_empty = ""; - - char const* m_start = s_empty; - size_type m_size = 0; - - public: // construction - constexpr StringRef() noexcept = default; - - StringRef( char const* rawChars ) noexcept; - - constexpr StringRef( char const* rawChars, size_type size ) noexcept - : m_start( rawChars ), - m_size( size ) - {} - - StringRef( std::string const& stdString ) noexcept - : m_start( stdString.c_str() ), - m_size( stdString.size() ) - {} - - explicit operator std::string() const { - return std::string(m_start, m_size); - } - - public: // operators - auto operator == ( StringRef other ) const noexcept -> bool; - auto operator != (StringRef other) const noexcept -> bool { - return !(*this == other); - } - - constexpr auto operator[] ( size_type index ) const noexcept -> char { - assert(index < m_size); - return m_start[index]; - } - - bool operator<(StringRef rhs) const noexcept; - - public: // named queries - constexpr auto empty() const noexcept -> bool { - return m_size == 0; - } - constexpr auto size() const noexcept -> size_type { - return m_size; - } - - // Returns a substring of [start, start + length). - // If start + length > size(), then the substring is [start, start + size()). - // If start > size(), then the substring is empty. - constexpr StringRef substr(size_type start, size_type length) const noexcept { - if (start < m_size) { - const auto shortened_size = m_size - start; - return StringRef(m_start + start, (shortened_size < length) ? shortened_size : length); - } else { - return StringRef(); - } - } - - // Returns the current start pointer. May not be null-terminated. - constexpr char const* data() const noexcept { - return m_start; - } - - constexpr const_iterator begin() const { return m_start; } - constexpr const_iterator end() const { return m_start + m_size; } - - - friend std::string& operator += (std::string& lhs, StringRef sr); - friend std::ostream& operator << (std::ostream& os, StringRef sr); - friend std::string operator+(StringRef lhs, StringRef rhs); - - /** - * Provides a three-way comparison with rhs - * - * Returns negative number if lhs < rhs, 0 if lhs == rhs, and a positive - * number if lhs > rhs - */ - int compare( StringRef rhs ) const; - }; - - - constexpr auto operator ""_sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { - return StringRef( rawChars, size ); - } -} // namespace Catch - -constexpr auto operator ""_catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { - return Catch::StringRef( rawChars, size ); -} - -#endif // CATCH_STRINGREF_HPP_INCLUDED - -#include -#include -#include -#include - -namespace Catch { - - enum class Verbosity { - Quiet = 0, - Normal, - High - }; - - struct WarnAbout { enum What { - Nothing = 0x00, - //! A test case or leaf section did not run any assertions - NoAssertions = 0x01, - //! A command line test spec matched no test cases - UnmatchedTestSpec = 0x02, - }; }; - - enum class ShowDurations { - DefaultForReporter, - Always, - Never - }; - enum class TestRunOrder { - Declared, - LexicographicallySorted, - Randomized - }; - enum class ColourMode : std::uint8_t { - //! Let Catch2 pick implementation based on platform detection - PlatformDefault, - //! Use ANSI colour code escapes - ANSI, - //! Use Win32 console colour API - Win32, - //! Don't use any colour - None - }; - struct WaitForKeypress { enum When { - Never, - BeforeStart = 1, - BeforeExit = 2, - BeforeStartAndExit = BeforeStart | BeforeExit - }; }; - - class TestSpec; - class IStream; - - class IConfig : public Detail::NonCopyable { - public: - virtual ~IConfig(); - - virtual bool allowThrows() const = 0; - virtual StringRef name() const = 0; - virtual bool includeSuccessfulResults() const = 0; - virtual bool shouldDebugBreak() const = 0; - virtual bool warnAboutMissingAssertions() const = 0; - virtual bool warnAboutUnmatchedTestSpecs() const = 0; - virtual bool zeroTestsCountAsSuccess() const = 0; - virtual int abortAfter() const = 0; - virtual bool showInvisibles() const = 0; - virtual ShowDurations showDurations() const = 0; - virtual double minDuration() const = 0; - virtual TestSpec const& testSpec() const = 0; - virtual bool hasTestFilters() const = 0; - virtual std::vector const& getTestsOrTags() const = 0; - virtual TestRunOrder runOrder() const = 0; - virtual uint32_t rngSeed() const = 0; - virtual unsigned int shardCount() const = 0; - virtual unsigned int shardIndex() const = 0; - virtual ColourMode defaultColourMode() const = 0; - virtual std::vector const& getSectionsToRun() const = 0; - virtual Verbosity verbosity() const = 0; - - virtual bool skipBenchmarks() const = 0; - virtual bool benchmarkNoAnalysis() const = 0; - virtual unsigned int benchmarkSamples() const = 0; - virtual double benchmarkConfidenceInterval() const = 0; - virtual unsigned int benchmarkResamples() const = 0; - virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0; - }; -} - -#endif // CATCH_INTERFACES_CONFIG_HPP_INCLUDED - - #ifndef CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED #define CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED @@ -313,6 +87,9 @@ namespace Catch { // See e.g.: // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html #ifdef __APPLE__ +# ifndef __has_extension +# define __has_extension(x) 0 +# endif # include # if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) @@ -326,25 +103,33 @@ namespace Catch { #elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) # define CATCH_PLATFORM_WINDOWS + +# if defined( WINAPI_FAMILY ) && ( WINAPI_FAMILY == WINAPI_FAMILY_APP ) +# define CATCH_PLATFORM_WINDOWS_UWP +# endif + +#elif defined(__ORBIS__) || defined(__PROSPERO__) +# define CATCH_PLATFORM_PLAYSTATION + #endif #endif // CATCH_PLATFORM_HPP_INCLUDED #ifdef __cplusplus -# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) -# define CATCH_CPP14_OR_GREATER -# endif - # if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) # define CATCH_CPP17_OR_GREATER # endif +# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) +# define CATCH_CPP20_OR_GREATER +# endif + #endif // Only GCC compiler should be used in this block, so other compilers trying to // mask themselves as GCC should be ignored. -#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) && !defined(__NVCOMPILER) # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" ) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" ) @@ -353,17 +138,37 @@ namespace Catch { # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ _Pragma( "GCC diagnostic ignored \"-Wparentheses\"" ) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \ + _Pragma( "GCC diagnostic ignored \"-Wunused-result\"" ) + # define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ _Pragma( "GCC diagnostic ignored \"-Wunused-variable\"" ) +# define CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \ + _Pragma( "GCC diagnostic ignored \"-Wuseless-cast\"" ) + +# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ + _Pragma( "GCC diagnostic ignored \"-Wshadow\"" ) + # define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) #endif +#if defined(__NVCOMPILER) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "diag push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "diag pop" ) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "diag_suppress declared_but_not_referenced" ) +#endif + #if defined(__CUDACC__) && !defined(__clang__) +# ifdef __NVCC_DIAG_PRAGMA_SUPPORT__ +// New pragmas introduced in CUDA 11.5+ # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic push" ) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic pop" ) # define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "nv_diag_suppress 177" ) +# else +# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "diag_suppress 177" ) +# endif #endif // clang-cl defines _MSC_VER as well as __clang__, which could cause the @@ -414,23 +219,37 @@ namespace Catch { # define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ _Pragma( "clang diagnostic ignored \"-Wunused-template\"" ) -#endif // __clang__ +# define CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wcomma\"" ) +# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wshadow\"" ) + +#endif // __clang__ -//////////////////////////////////////////////////////////////////////////////// -// Assume that non-Windows platforms support posix signals by default -#if !defined(CATCH_PLATFORM_WINDOWS) - #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS -#endif //////////////////////////////////////////////////////////////////////////////// // We know some environments not to support full POSIX signals -#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__) - #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +#if defined( CATCH_PLATFORM_WINDOWS ) || \ + defined( CATCH_PLATFORM_PLAYSTATION ) || \ + defined( __CYGWIN__ ) || \ + defined( __QNX__ ) || \ + defined( __EMSCRIPTEN__ ) || \ + defined( __DJGPP__ ) || \ + defined( __OS400__ ) +# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +#else +# define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS #endif -#ifdef __OS400__ -# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +//////////////////////////////////////////////////////////////////////////////// +// Assume that some platforms do not support getenv. +#if defined( CATCH_PLATFORM_WINDOWS_UWP ) || \ + defined( CATCH_PLATFORM_PLAYSTATION ) || \ + defined( _GAMING_XBOX ) +# define CATCH_INTERNAL_CONFIG_NO_GETENV +#else +# define CATCH_INTERNAL_CONFIG_GETENV #endif //////////////////////////////////////////////////////////////////////////////// @@ -472,12 +291,18 @@ namespace Catch { // Visual C++ #if defined(_MSC_VER) -# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) ) -# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) ) +// We want to defer to nvcc-specific warning suppression if we are compiled +// with nvcc masquerading for MSVC. +# if !defined( __CUDACC__ ) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + __pragma( warning( push ) ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ + __pragma( warning( pop ) ) +# endif // Universal Windows platform does not support SEH // Or console colours (or console at all...) -# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) +# if defined(CATCH_PLATFORM_WINDOWS_UWP) # define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 # else # define CATCH_INTERNAL_CONFIG_WINDOWS_SEH @@ -573,6 +398,10 @@ namespace Catch { # define CATCH_CONFIG_POSIX_SIGNALS #endif +#if defined(CATCH_INTERNAL_CONFIG_GETENV) && !defined(CATCH_INTERNAL_CONFIG_NO_GETENV) && !defined(CATCH_CONFIG_NO_GETENV) && !defined(CATCH_CONFIG_GETENV) +# define CATCH_CONFIG_GETENV +#endif + #if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) # define CATCH_CONFIG_CPP11_TO_STRING #endif @@ -635,12 +464,28 @@ namespace Catch { #if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS #endif +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT +#endif #if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS #endif +#if !defined(CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS +#endif #if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS #endif +#if !defined( CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS ) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif +#if !defined( CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS ) +# define CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS +#endif +#if !defined( CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS ) +# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS +#endif + // The goal of this macro is to avoid evaluation of the arguments, but // still have the compiler warn on problems inside... @@ -654,9 +499,6 @@ namespace Catch { # undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS #endif -#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS -#endif #if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) #define CATCH_TRY if ((true)) @@ -679,6 +521,16 @@ namespace Catch { # define CATCH_CONFIG_COLOUR_WIN32 #endif +#if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \ + !defined( CATCH_CONFIG_STATIC ) +# ifdef Catch2_EXPORTS +# define CATCH_EXPORT //__declspec( dllexport ) // not needed +# else +# define CATCH_EXPORT __declspec( dllimport ) +# endif +#else +# define CATCH_EXPORT +#endif #endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED @@ -686,43 +538,42 @@ namespace Catch { #ifndef CATCH_CONTEXT_HPP_INCLUDED #define CATCH_CONTEXT_HPP_INCLUDED + namespace Catch { class IResultCapture; class IConfig; - class IContext { - public: - virtual ~IContext(); // = default + class Context { + IConfig const* m_config = nullptr; + IResultCapture* m_resultCapture = nullptr; - virtual IResultCapture* getResultCapture() = 0; - virtual IConfig const* getConfig() const = 0; - }; + CATCH_EXPORT static Context* currentContext; + friend Context& getCurrentMutableContext(); + friend Context const& getCurrentContext(); + static void createContext(); + friend void cleanUpContext(); - class IMutableContext : public IContext { public: - ~IMutableContext() override; // = default - virtual void setResultCapture( IResultCapture* resultCapture ) = 0; - virtual void setConfig( IConfig const* config ) = 0; + constexpr IResultCapture* getResultCapture() const { + return m_resultCapture; + } + constexpr IConfig const* getConfig() const { return m_config; } + constexpr void setResultCapture( IResultCapture* resultCapture ) { + m_resultCapture = resultCapture; + } + constexpr void setConfig( IConfig const* config ) { m_config = config; } - private: - static IMutableContext *currentContext; - friend IMutableContext& getCurrentMutableContext(); - friend void cleanUpContext(); - static void createContext(); }; - inline IMutableContext& getCurrentMutableContext() - { - if( !IMutableContext::currentContext ) - IMutableContext::createContext(); - // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn) - return *IMutableContext::currentContext; - } + Context& getCurrentMutableContext(); - inline IContext& getCurrentContext() - { - return getCurrentMutableContext(); + inline Context const& getCurrentContext() { + // We duplicate the logic from `getCurrentMutableContext` here, + // to avoid paying the call overhead in debug mode. + if ( !Context::currentContext ) { Context::createContext(); } + // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn) + return *Context::currentContext; } void cleanUpContext(); @@ -734,16 +585,6 @@ namespace Catch { #endif // CATCH_CONTEXT_HPP_INCLUDED -#ifndef CATCH_INTERFACES_REPORTER_HPP_INCLUDED -#define CATCH_INTERFACES_REPORTER_HPP_INCLUDED - - - -#ifndef CATCH_SECTION_INFO_HPP_INCLUDED -#define CATCH_SECTION_INFO_HPP_INCLUDED - - - #ifndef CATCH_MOVE_AND_FORWARD_HPP_INCLUDED #define CATCH_MOVE_AND_FORWARD_HPP_INCLUDED @@ -758,109 +599,200 @@ namespace Catch { #endif // CATCH_MOVE_AND_FORWARD_HPP_INCLUDED -#ifndef CATCH_SOURCE_LINE_INFO_HPP_INCLUDED -#define CATCH_SOURCE_LINE_INFO_HPP_INCLUDED - -#include -#include +#ifndef CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED +#define CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED namespace Catch { - struct SourceLineInfo { + //! Used to signal that an assertion macro failed + struct TestFailureException{}; + //! Used to signal that the remainder of a test should be skipped + struct TestSkipException {}; - SourceLineInfo() = delete; - constexpr SourceLineInfo( char const* _file, std::size_t _line ) noexcept: - file( _file ), - line( _line ) - {} + /** + * Outlines throwing of `TestFailureException` into a single TU + * + * Also handles `CATCH_CONFIG_DISABLE_EXCEPTIONS` for callers. + */ + [[noreturn]] void throw_test_failure_exception(); - bool operator == ( SourceLineInfo const& other ) const noexcept; - bool operator < ( SourceLineInfo const& other ) const noexcept; + /** + * Outlines throwing of `TestSkipException` into a single TU + * + * Also handles `CATCH_CONFIG_DISABLE_EXCEPTIONS` for callers. + */ + [[noreturn]] void throw_test_skip_exception(); - char const* file; - std::size_t line; +} // namespace Catch - friend std::ostream& operator << (std::ostream& os, SourceLineInfo const& info); - }; -} +#endif // CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED -#define CATCH_INTERNAL_LINEINFO \ - ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) -#endif // CATCH_SOURCE_LINE_INFO_HPP_INCLUDED +#ifndef CATCH_UNIQUE_NAME_HPP_INCLUDED +#define CATCH_UNIQUE_NAME_HPP_INCLUDED -#ifndef CATCH_TOTALS_HPP_INCLUDED -#define CATCH_TOTALS_HPP_INCLUDED -#include -namespace Catch { +/** \file + * Wrapper for the CONFIG configuration option + * + * When generating internal unique names, there are two options. Either + * we mix in the current line number, or mix in an incrementing number. + * We prefer the latter, using `__COUNTER__`, but users might want to + * use the former. + */ - struct Counts { - Counts operator - ( Counts const& other ) const; - Counts& operator += ( Counts const& other ); +#ifndef CATCH_CONFIG_COUNTER_HPP_INCLUDED +#define CATCH_CONFIG_COUNTER_HPP_INCLUDED - std::uint64_t total() const; - bool allPassed() const; - bool allOk() const; - std::uint64_t passed = 0; - std::uint64_t failed = 0; - std::uint64_t failedButOk = 0; - }; +#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) + #define CATCH_INTERNAL_CONFIG_COUNTER +#endif - struct Totals { +#if defined( CATCH_INTERNAL_CONFIG_COUNTER ) && \ + !defined( CATCH_CONFIG_NO_COUNTER ) && \ + !defined( CATCH_CONFIG_COUNTER ) +# define CATCH_CONFIG_COUNTER +#endif - Totals operator - ( Totals const& other ) const; - Totals& operator += ( Totals const& other ); - Totals delta( Totals const& prevTotals ) const; +#endif // CATCH_CONFIG_COUNTER_HPP_INCLUDED +#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line +#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) +#ifdef CATCH_CONFIG_COUNTER +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) +#else +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) +#endif - Counts assertions; - Counts testCases; - }; -} +#endif // CATCH_UNIQUE_NAME_HPP_INCLUDED -#endif // CATCH_TOTALS_HPP_INCLUDED +#ifndef CATCH_INTERFACES_CAPTURE_HPP_INCLUDED +#define CATCH_INTERFACES_CAPTURE_HPP_INCLUDED + +#include + + + +#ifndef CATCH_STRINGREF_HPP_INCLUDED +#define CATCH_STRINGREF_HPP_INCLUDED + +#include #include +#include +#include + +#include namespace Catch { - struct SectionInfo { - // The last argument is ignored, so that people can write - // SECTION("ShortName", "Proper description that is long") and - // still use the `-c` flag comfortably. - SectionInfo( SourceLineInfo const& _lineInfo, std::string _name, - const char* const = nullptr ): - name(CATCH_MOVE(_name)), - lineInfo(_lineInfo) - {} + /// A non-owning string class (similar to the forthcoming std::string_view) + /// Note that, because a StringRef may be a substring of another string, + /// it may not be null terminated. + class StringRef { + public: + using size_type = std::size_t; + using const_iterator = const char*; - std::string name; - SourceLineInfo lineInfo; - }; + static constexpr size_type npos{ static_cast( -1 ) }; - struct SectionEndInfo { - SectionInfo sectionInfo; - Counts prevAssertions; - double durationInSeconds; - }; + private: + static constexpr char const* const s_empty = ""; -} // end namespace Catch + char const* m_start = s_empty; + size_type m_size = 0; -#endif // CATCH_SECTION_INFO_HPP_INCLUDED + public: // construction + constexpr StringRef() noexcept = default; + StringRef( char const* rawChars ) noexcept; -#ifndef CATCH_ASSERTION_RESULT_HPP_INCLUDED -#define CATCH_ASSERTION_RESULT_HPP_INCLUDED + constexpr StringRef( char const* rawChars, size_type size ) noexcept + : m_start( rawChars ), + m_size( size ) + {} + + StringRef( std::string const& stdString ) noexcept + : m_start( stdString.c_str() ), + m_size( stdString.size() ) + {} + + explicit operator std::string() const { + return std::string(m_start, m_size); + } + + public: // operators + auto operator == ( StringRef other ) const noexcept -> bool { + return m_size == other.m_size + && (std::memcmp( m_start, other.m_start, m_size ) == 0); + } + auto operator != (StringRef other) const noexcept -> bool { + return !(*this == other); + } + constexpr auto operator[] ( size_type index ) const noexcept -> char { + assert(index < m_size); + return m_start[index]; + } + bool operator<(StringRef rhs) const noexcept; -#ifndef CATCH_ASSERTION_INFO_HPP_INCLUDED -#define CATCH_ASSERTION_INFO_HPP_INCLUDED + public: // named queries + constexpr auto empty() const noexcept -> bool { + return m_size == 0; + } + constexpr auto size() const noexcept -> size_type { + return m_size; + } + + // Returns a substring of [start, start + length). + // If start + length > size(), then the substring is [start, size()). + // If start > size(), then the substring is empty. + constexpr StringRef substr(size_type start, size_type length) const noexcept { + if (start < m_size) { + const auto shortened_size = m_size - start; + return StringRef(m_start + start, (shortened_size < length) ? shortened_size : length); + } else { + return StringRef(); + } + } + + // Returns the current start pointer. May not be null-terminated. + constexpr char const* data() const noexcept { + return m_start; + } + + constexpr const_iterator begin() const { return m_start; } + constexpr const_iterator end() const { return m_start + m_size; } + + + friend std::string& operator += (std::string& lhs, StringRef rhs); + friend std::ostream& operator << (std::ostream& os, StringRef str); + friend std::string operator+(StringRef lhs, StringRef rhs); + + /** + * Provides a three-way comparison with rhs + * + * Returns negative number if lhs < rhs, 0 if lhs == rhs, and a positive + * number if lhs > rhs + */ + int compare( StringRef rhs ) const; + }; + + + constexpr auto operator ""_sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { + return StringRef( rawChars, size ); + } +} // namespace Catch + +constexpr auto operator ""_catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { + return Catch::StringRef( rawChars, size ); +} +#endif // CATCH_STRINGREF_HPP_INCLUDED #ifndef CATCH_RESULT_TYPE_HPP_INCLUDED @@ -874,6 +806,8 @@ namespace Catch { Ok = 0, Info = 1, Warning = 2, + // TODO: Should explicit skip be considered "not OK" (cf. isOk)? I.e., should it have the failure bit? + ExplicitSkip = 4, FailureBit = 0x10, @@ -889,8 +823,10 @@ namespace Catch { }; }; - bool isOk( ResultWas::OfType resultType ); - bool isJustInfo( int flags ); + constexpr bool isOk( ResultWas::OfType resultType ) { + return ( resultType & ResultWas::FailureBit ) == 0; + } + constexpr bool isJustInfo( int flags ) { return flags == ResultWas::Info; } // ResultDisposition::Flags enum @@ -902,240 +838,29 @@ namespace Catch { SuppressFail = 0x08 // Failures are reported but do not fail the test }; }; - ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ); + constexpr ResultDisposition::Flags operator|( ResultDisposition::Flags lhs, + ResultDisposition::Flags rhs ) { + return static_cast( static_cast( lhs ) | + static_cast( rhs ) ); + } - bool shouldContinueOnFailure( int flags ); - inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; } - bool shouldSuppressFailure( int flags ); + constexpr bool isFalseTest( int flags ) { + return ( flags & ResultDisposition::FalseTest ) != 0; + } + constexpr bool shouldSuppressFailure( int flags ) { + return ( flags & ResultDisposition::SuppressFail ) != 0; + } } // end namespace Catch #endif // CATCH_RESULT_TYPE_HPP_INCLUDED -namespace Catch { - struct AssertionInfo { - // AssertionInfo() = delete; +#ifndef CATCH_UNIQUE_PTR_HPP_INCLUDED +#define CATCH_UNIQUE_PTR_HPP_INCLUDED - StringRef macroName; - SourceLineInfo lineInfo; - StringRef capturedExpression; - ResultDisposition::Flags resultDisposition; - }; - -} // end namespace Catch - -#endif // CATCH_ASSERTION_INFO_HPP_INCLUDED - - -#ifndef CATCH_LAZY_EXPR_HPP_INCLUDED -#define CATCH_LAZY_EXPR_HPP_INCLUDED - -#include - -namespace Catch { - - class ITransientExpression; - - class LazyExpression { - friend class AssertionHandler; - friend struct AssertionStats; - friend class RunContext; - - ITransientExpression const* m_transientExpression = nullptr; - bool m_isNegated; - public: - LazyExpression( bool isNegated ): - m_isNegated(isNegated) - {} - LazyExpression(LazyExpression const& other) = default; - LazyExpression& operator = ( LazyExpression const& ) = delete; - - explicit operator bool() const { - return m_transientExpression != nullptr; - } - - friend auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream&; - }; - -} // namespace Catch - -#endif // CATCH_LAZY_EXPR_HPP_INCLUDED - -#include - -namespace Catch { - - struct AssertionResultData - { - AssertionResultData() = delete; - - AssertionResultData( ResultWas::OfType _resultType, LazyExpression const& _lazyExpression ); - - std::string message; - mutable std::string reconstructedExpression; - LazyExpression lazyExpression; - ResultWas::OfType resultType; - - std::string reconstructExpression() const; - }; - - class AssertionResult { - public: - AssertionResult() = delete; - AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); - - bool isOk() const; - bool succeeded() const; - ResultWas::OfType getResultType() const; - bool hasExpression() const; - bool hasMessage() const; - std::string getExpression() const; - std::string getExpressionInMacro() const; - bool hasExpandedExpression() const; - std::string getExpandedExpression() const; - StringRef getMessage() const; - SourceLineInfo getSourceInfo() const; - StringRef getTestMacroName() const; - - //protected: - AssertionInfo m_info; - AssertionResultData m_resultData; - }; - -} // end namespace Catch - -#endif // CATCH_ASSERTION_RESULT_HPP_INCLUDED - - -#ifndef CATCH_MESSAGE_INFO_HPP_INCLUDED -#define CATCH_MESSAGE_INFO_HPP_INCLUDED - - - -#ifndef CATCH_INTERFACES_CAPTURE_HPP_INCLUDED -#define CATCH_INTERFACES_CAPTURE_HPP_INCLUDED - -#include -#include - - -namespace Catch { - - class AssertionResult; - struct AssertionInfo; - struct SectionInfo; - struct SectionEndInfo; - struct MessageInfo; - struct MessageBuilder; - struct Counts; - struct AssertionReaction; - struct SourceLineInfo; - - class ITransientExpression; - class IGeneratorTracker; - - struct BenchmarkInfo; - template > - struct BenchmarkStats; - - class IResultCapture { - public: - virtual ~IResultCapture(); - - virtual bool sectionStarted( SectionInfo const& sectionInfo, - Counts& assertions ) = 0; - virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0; - virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0; - - virtual auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0; - - virtual void benchmarkPreparing( StringRef name ) = 0; - virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0; - virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0; - virtual void benchmarkFailed( StringRef error ) = 0; - - virtual void pushScopedMessage( MessageInfo const& message ) = 0; - virtual void popScopedMessage( MessageInfo const& message ) = 0; - - virtual void emplaceUnscopedMessage( MessageBuilder const& builder ) = 0; - - virtual void handleFatalErrorCondition( StringRef message ) = 0; - - virtual void handleExpr - ( AssertionInfo const& info, - ITransientExpression const& expr, - AssertionReaction& reaction ) = 0; - virtual void handleMessage - ( AssertionInfo const& info, - ResultWas::OfType resultType, - StringRef message, - AssertionReaction& reaction ) = 0; - virtual void handleUnexpectedExceptionNotThrown - ( AssertionInfo const& info, - AssertionReaction& reaction ) = 0; - virtual void handleUnexpectedInflightException - ( AssertionInfo const& info, - std::string const& message, - AssertionReaction& reaction ) = 0; - virtual void handleIncomplete - ( AssertionInfo const& info ) = 0; - virtual void handleNonExpr - ( AssertionInfo const &info, - ResultWas::OfType resultType, - AssertionReaction &reaction ) = 0; - - - - virtual bool lastAssertionPassed() = 0; - virtual void assertionPassed() = 0; - - // Deprecated, do not use: - virtual std::string getCurrentTestName() const = 0; - virtual const AssertionResult* getLastResult() const = 0; - virtual void exceptionEarlyReported() = 0; - }; - - IResultCapture& getResultCapture(); -} - -#endif // CATCH_INTERFACES_CAPTURE_HPP_INCLUDED - -#include - -namespace Catch { - - struct MessageInfo { - MessageInfo( StringRef _macroName, - SourceLineInfo const& _lineInfo, - ResultWas::OfType _type ); - - StringRef macroName; - std::string message; - SourceLineInfo lineInfo; - ResultWas::OfType type; - unsigned int sequence; - - bool operator == (MessageInfo const& other) const { - return sequence == other.sequence; - } - bool operator < (MessageInfo const& other) const { - return sequence < other.sequence; - } - private: - static unsigned int globalCount; - }; - -} // end namespace Catch - -#endif // CATCH_MESSAGE_INFO_HPP_INCLUDED - - -#ifndef CATCH_UNIQUE_PTR_HPP_INCLUDED -#define CATCH_UNIQUE_PTR_HPP_INCLUDED - -#include -#include +#include +#include namespace Catch { @@ -1243,380 +968,439 @@ namespace Detail { #endif // CATCH_UNIQUE_PTR_HPP_INCLUDED +#ifndef CATCH_BENCHMARK_STATS_FWD_HPP_INCLUDED +#define CATCH_BENCHMARK_STATS_FWD_HPP_INCLUDED + + + // Adapted from donated nonius code. -#ifndef CATCH_ESTIMATE_HPP_INCLUDED -#define CATCH_ESTIMATE_HPP_INCLUDED +#ifndef CATCH_CLOCK_HPP_INCLUDED +#define CATCH_CLOCK_HPP_INCLUDED + +#include namespace Catch { namespace Benchmark { - template - struct Estimate { - Duration point; - Duration lower_bound; - Duration upper_bound; - double confidence_interval; + using IDuration = std::chrono::nanoseconds; + using FDuration = std::chrono::duration; - template - operator Estimate() const { - return { point, lower_bound, upper_bound, confidence_interval }; - } - }; + template + using TimePoint = typename Clock::time_point; + + using default_clock = std::chrono::steady_clock; } // namespace Benchmark } // namespace Catch -#endif // CATCH_ESTIMATE_HPP_INCLUDED +#endif // CATCH_CLOCK_HPP_INCLUDED +namespace Catch { -// Adapted from donated nonius code. + // We cannot forward declare the type with default template argument + // multiple times, so it is split out into a separate header so that + // we can prevent multiple declarations in dependees + template + struct BenchmarkStats; -#ifndef CATCH_OUTLIER_CLASSIFICATION_HPP_INCLUDED -#define CATCH_OUTLIER_CLASSIFICATION_HPP_INCLUDED +} // end namespace Catch + +#endif // CATCH_BENCHMARK_STATS_FWD_HPP_INCLUDED namespace Catch { - namespace Benchmark { - struct OutlierClassification { - int samples_seen = 0; - int low_severe = 0; // more than 3 times IQR below Q1 - int low_mild = 0; // 1.5 to 3 times IQR below Q1 - int high_mild = 0; // 1.5 to 3 times IQR above Q3 - int high_severe = 0; // more than 3 times IQR above Q3 - int total() const { - return low_severe + low_mild + high_mild + high_severe; - } - }; - } // namespace Benchmark -} // namespace Catch + class AssertionResult; + struct AssertionInfo; + struct SectionInfo; + struct SectionEndInfo; + struct MessageInfo; + struct MessageBuilder; + struct Counts; + struct AssertionReaction; + struct SourceLineInfo; -#endif // CATCH_OUTLIERS_CLASSIFICATION_HPP_INCLUDED + class ITransientExpression; + class IGeneratorTracker; + struct BenchmarkInfo; -#include -#include -#include -#include + namespace Generators { + class GeneratorUntypedBase; + using GeneratorBasePtr = Catch::Detail::unique_ptr; + } -namespace Catch { - struct ReporterDescription; - struct ListenerDescription; - struct TagInfo; - struct TestCaseInfo; - class TestCaseHandle; - class IConfig; - class IStream; - enum class ColourMode : std::uint8_t; + class IResultCapture { + public: + virtual ~IResultCapture(); - struct ReporterConfig { - ReporterConfig( IConfig const* _fullConfig, - Detail::unique_ptr _stream, - ColourMode colourMode, - std::map customOptions ); + virtual void notifyAssertionStarted( AssertionInfo const& info ) = 0; + virtual bool sectionStarted( StringRef sectionName, + SourceLineInfo const& sectionLineInfo, + Counts& assertions ) = 0; + virtual void sectionEnded( SectionEndInfo&& endInfo ) = 0; + virtual void sectionEndedEarly( SectionEndInfo&& endInfo ) = 0; + + virtual IGeneratorTracker* + acquireGeneratorTracker( StringRef generatorName, + SourceLineInfo const& lineInfo ) = 0; + virtual IGeneratorTracker* + createGeneratorTracker( StringRef generatorName, + SourceLineInfo lineInfo, + Generators::GeneratorBasePtr&& generator ) = 0; - ReporterConfig( ReporterConfig&& ) = default; - ReporterConfig& operator=( ReporterConfig&& ) = default; - ~ReporterConfig(); // = default + virtual void benchmarkPreparing( StringRef name ) = 0; + virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0; + virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0; + virtual void benchmarkFailed( StringRef error ) = 0; - Detail::unique_ptr takeStream() &&; - IConfig const* fullConfig() const; - ColourMode colourMode() const; - std::map const& customOptions() const; + virtual void pushScopedMessage( MessageInfo const& message ) = 0; + virtual void popScopedMessage( MessageInfo const& message ) = 0; - private: - Detail::unique_ptr m_stream; - IConfig const* m_fullConfig; - ColourMode m_colourMode; - std::map m_customOptions; - }; + virtual void emplaceUnscopedMessage( MessageBuilder&& builder ) = 0; - struct TestRunInfo { - constexpr TestRunInfo(StringRef _name) : name(_name) {} - StringRef name; - }; + virtual void handleFatalErrorCondition( StringRef message ) = 0; - struct AssertionStats { - AssertionStats( AssertionResult const& _assertionResult, - std::vector const& _infoMessages, - Totals const& _totals ); + virtual void handleExpr + ( AssertionInfo const& info, + ITransientExpression const& expr, + AssertionReaction& reaction ) = 0; + virtual void handleMessage + ( AssertionInfo const& info, + ResultWas::OfType resultType, + std::string&& message, + AssertionReaction& reaction ) = 0; + virtual void handleUnexpectedExceptionNotThrown + ( AssertionInfo const& info, + AssertionReaction& reaction ) = 0; + virtual void handleUnexpectedInflightException + ( AssertionInfo const& info, + std::string&& message, + AssertionReaction& reaction ) = 0; + virtual void handleIncomplete + ( AssertionInfo const& info ) = 0; + virtual void handleNonExpr + ( AssertionInfo const &info, + ResultWas::OfType resultType, + AssertionReaction &reaction ) = 0; - AssertionStats( AssertionStats const& ) = default; - AssertionStats( AssertionStats && ) = default; - AssertionStats& operator = ( AssertionStats const& ) = delete; - AssertionStats& operator = ( AssertionStats && ) = delete; - AssertionResult assertionResult; - std::vector infoMessages; - Totals totals; - }; - struct SectionStats { - SectionStats( SectionInfo const& _sectionInfo, - Counts const& _assertions, - double _durationInSeconds, - bool _missingAssertions ); + virtual bool lastAssertionPassed() = 0; + virtual void assertionPassed() = 0; - SectionInfo sectionInfo; - Counts assertions; - double durationInSeconds; - bool missingAssertions; + // Deprecated, do not use: + virtual std::string getCurrentTestName() const = 0; + virtual const AssertionResult* getLastResult() const = 0; + virtual void exceptionEarlyReported() = 0; }; - struct TestCaseStats { - TestCaseStats( TestCaseInfo const& _testInfo, - Totals const& _totals, - std::string const& _stdOut, - std::string const& _stdErr, - bool _aborting ); + IResultCapture& getResultCapture(); +} - TestCaseInfo const * testInfo; - Totals totals; - std::string stdOut; - std::string stdErr; - bool aborting; +#endif // CATCH_INTERFACES_CAPTURE_HPP_INCLUDED + + +#ifndef CATCH_INTERFACES_CONFIG_HPP_INCLUDED +#define CATCH_INTERFACES_CONFIG_HPP_INCLUDED + + + +#ifndef CATCH_NONCOPYABLE_HPP_INCLUDED +#define CATCH_NONCOPYABLE_HPP_INCLUDED + +namespace Catch { + namespace Detail { + + //! Deriving classes become noncopyable and nonmovable + class NonCopyable { + NonCopyable( NonCopyable const& ) = delete; + NonCopyable( NonCopyable&& ) = delete; + NonCopyable& operator=( NonCopyable const& ) = delete; + NonCopyable& operator=( NonCopyable&& ) = delete; + + protected: + NonCopyable() noexcept = default; + }; + + } // namespace Detail +} // namespace Catch + +#endif // CATCH_NONCOPYABLE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace Catch { + + enum class Verbosity { + Quiet = 0, + Normal, + High }; - struct TestRunStats { - TestRunStats( TestRunInfo const& _runInfo, - Totals const& _totals, - bool _aborting ); + struct WarnAbout { enum What { + Nothing = 0x00, + //! A test case or leaf section did not run any assertions + NoAssertions = 0x01, + //! A command line test spec matched no test cases + UnmatchedTestSpec = 0x02, + }; }; - TestRunInfo runInfo; - Totals totals; - bool aborting; + enum class ShowDurations { + DefaultForReporter, + Always, + Never }; + enum class TestRunOrder { + Declared, + LexicographicallySorted, + Randomized + }; + enum class ColourMode : std::uint8_t { + //! Let Catch2 pick implementation based on platform detection + PlatformDefault, + //! Use ANSI colour code escapes + ANSI, + //! Use Win32 console colour API + Win32, + //! Don't use any colour + None + }; + struct WaitForKeypress { enum When { + Never, + BeforeStart = 1, + BeforeExit = 2, + BeforeStartAndExit = BeforeStart | BeforeExit + }; }; + class TestSpec; + class IStream; - struct BenchmarkInfo { - std::string name; - double estimatedDuration; - int iterations; - unsigned int samples; - unsigned int resamples; - double clockResolution; - double clockCost; + class IConfig : public Detail::NonCopyable { + public: + virtual ~IConfig(); + + virtual bool allowThrows() const = 0; + virtual StringRef name() const = 0; + virtual bool includeSuccessfulResults() const = 0; + virtual bool shouldDebugBreak() const = 0; + virtual bool warnAboutMissingAssertions() const = 0; + virtual bool warnAboutUnmatchedTestSpecs() const = 0; + virtual bool zeroTestsCountAsSuccess() const = 0; + virtual int abortAfter() const = 0; + virtual bool showInvisibles() const = 0; + virtual ShowDurations showDurations() const = 0; + virtual double minDuration() const = 0; + virtual TestSpec const& testSpec() const = 0; + virtual bool hasTestFilters() const = 0; + virtual std::vector const& getTestsOrTags() const = 0; + virtual TestRunOrder runOrder() const = 0; + virtual uint32_t rngSeed() const = 0; + virtual unsigned int shardCount() const = 0; + virtual unsigned int shardIndex() const = 0; + virtual ColourMode defaultColourMode() const = 0; + virtual std::vector const& getSectionsToRun() const = 0; + virtual Verbosity verbosity() const = 0; + + virtual bool skipBenchmarks() const = 0; + virtual bool benchmarkNoAnalysis() const = 0; + virtual unsigned int benchmarkSamples() const = 0; + virtual double benchmarkConfidenceInterval() const = 0; + virtual unsigned int benchmarkResamples() const = 0; + virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0; }; +} - template - struct BenchmarkStats { - BenchmarkInfo info; +#endif // CATCH_INTERFACES_CONFIG_HPP_INCLUDED - std::vector samples; - Benchmark::Estimate mean; - Benchmark::Estimate standardDeviation; - Benchmark::OutlierClassification outliers; - double outlierVariance; - template - operator BenchmarkStats() const { - std::vector samples2; - samples2.reserve(samples.size()); - for (auto const& sample : samples) { - samples2.push_back(Duration2(sample)); - } - return { - info, - CATCH_MOVE(samples2), - mean, - standardDeviation, - outliers, - outlierVariance, - }; - } +#ifndef CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED +#define CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED + + +#include + +namespace Catch { + + class TestCaseHandle; + struct TestCaseInfo; + class ITestCaseRegistry; + class IExceptionTranslatorRegistry; + class IExceptionTranslator; + class ReporterRegistry; + class IReporterFactory; + class ITagAliasRegistry; + class ITestInvoker; + class IMutableEnumValuesRegistry; + struct SourceLineInfo; + + class StartupExceptionRegistry; + class EventListenerFactory; + + using IReporterFactoryPtr = Detail::unique_ptr; + + class IRegistryHub { + public: + virtual ~IRegistryHub(); // = default + + virtual ReporterRegistry const& getReporterRegistry() const = 0; + virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; + virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0; + virtual IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const = 0; + + + virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0; }; - //! By setting up its preferences, a reporter can modify Catch2's behaviour - //! in some regards, e.g. it can request Catch2 to capture writes to - //! stdout/stderr during test execution, and pass them to the reporter. - struct ReporterPreferences { - //! Catch2 should redirect writes to stdout and pass them to the - //! reporter - bool shouldRedirectStdOut = false; - //! Catch2 should call `Reporter::assertionEnded` even for passing - //! assertions - bool shouldReportAllAssertions = false; + class IMutableRegistryHub { + public: + virtual ~IMutableRegistryHub(); // = default + virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0; + virtual void registerListener( Detail::unique_ptr factory ) = 0; + virtual void registerTest(Detail::unique_ptr&& testInfo, Detail::unique_ptr&& invoker) = 0; + virtual void registerTranslator( Detail::unique_ptr&& translator ) = 0; + virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0; + virtual void registerStartupException() noexcept = 0; + virtual IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() = 0; }; - /** - * The common base for all reporters and event listeners - * - * Implementing classes must also implement: - * - * //! User-friendly description of the reporter/listener type - * static std::string getDescription() - * - * Generally shouldn't be derived from by users of Catch2 directly, - * instead they should derive from one of the utility bases that - * derive from this class. - */ - class IEventListener { - protected: - //! Derived classes can set up their preferences here - ReporterPreferences m_preferences; - //! The test run's config as filled in from CLI and defaults - IConfig const* m_config; + IRegistryHub const& getRegistryHub(); + IMutableRegistryHub& getMutableRegistryHub(); + void cleanUp(); + std::string translateActiveException(); - public: - IEventListener( IConfig const* config ): m_config( config ) {} +} - virtual ~IEventListener(); // = default; +#endif // CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED - // Implementing class must also provide the following static methods: - // static std::string getDescription(); - ReporterPreferences const& getPreferences() const { - return m_preferences; - } +#ifndef CATCH_BENCHMARK_STATS_HPP_INCLUDED +#define CATCH_BENCHMARK_STATS_HPP_INCLUDED - //! Called when no test cases match provided test spec - virtual void noMatchingTestCases( StringRef unmatchedSpec ) = 0; - //! Called for all invalid test specs from the cli - virtual void reportInvalidTestSpec( StringRef invalidArgument ) = 0; - /** - * Called once in a testing run before tests are started - * - * Not called if tests won't be run (e.g. only listing will happen) - */ - virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; - //! Called _once_ for each TEST_CASE, no matter how many times it is entered - virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; - //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) - virtual void testCasePartialStarting( TestCaseInfo const& testInfo, uint64_t partNumber ) = 0; - //! Called when a `SECTION` is being entered. Not called for skipped sections - virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; +// Adapted from donated nonius code. - //! Called when user-code is being probed before the actual benchmark runs - virtual void benchmarkPreparing( StringRef benchmarkName ) = 0; - //! Called after probe but before the user-code is being benchmarked - virtual void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) = 0; - //! Called with the benchmark results if benchmark successfully finishes - virtual void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) = 0; - //! Called if running the benchmarks fails for any reason - virtual void benchmarkFailed( StringRef benchmarkName ) = 0; +#ifndef CATCH_ESTIMATE_HPP_INCLUDED +#define CATCH_ESTIMATE_HPP_INCLUDED - //! Called before assertion success/failure is evaluated - virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; +namespace Catch { + namespace Benchmark { + template + struct Estimate { + Type point; + Type lower_bound; + Type upper_bound; + double confidence_interval; + }; + } // namespace Benchmark +} // namespace Catch - //! Called after assertion was fully evaluated - virtual void assertionEnded( AssertionStats const& assertionStats ) = 0; +#endif // CATCH_ESTIMATE_HPP_INCLUDED - //! Called after a `SECTION` has finished running - virtual void sectionEnded( SectionStats const& sectionStats ) = 0; - //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) - virtual void testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber ) = 0; - //! Called _once_ for each TEST_CASE, no matter how many times it is entered - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; - /** - * Called once after all tests in a testing run are finished - * - * Not called if tests weren't run (e.g. only listings happened) - */ - virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; - //! Called with test cases that are skipped due to the test run aborting - virtual void skipTest( TestCaseInfo const& testInfo ) = 0; +// Adapted from donated nonius code. - //! Called if a fatal error (signal/structured exception) occured - virtual void fatalErrorEncountered( StringRef error ) = 0; +#ifndef CATCH_OUTLIER_CLASSIFICATION_HPP_INCLUDED +#define CATCH_OUTLIER_CLASSIFICATION_HPP_INCLUDED - //! Writes out information about provided reporters using reporter-specific format - virtual void listReporters(std::vector const& descriptions) = 0; - //! Writes out the provided listeners descriptions using reporter-specific format - virtual void listListeners(std::vector const& descriptions) = 0; - //! Writes out information about provided tests using reporter-specific format - virtual void listTests(std::vector const& tests) = 0; - //! Writes out information about the provided tags using reporter-specific format - virtual void listTags(std::vector const& tags) = 0; - }; - using IEventListenerPtr = Detail::unique_ptr; +namespace Catch { + namespace Benchmark { + struct OutlierClassification { + int samples_seen = 0; + int low_severe = 0; // more than 3 times IQR below Q1 + int low_mild = 0; // 1.5 to 3 times IQR below Q1 + int high_mild = 0; // 1.5 to 3 times IQR above Q3 + int high_severe = 0; // more than 3 times IQR above Q3 -} // end namespace Catch + constexpr int total() const { + return low_severe + low_mild + high_mild + high_severe; + } + }; + } // namespace Benchmark +} // namespace Catch -#endif // CATCH_INTERFACES_REPORTER_HPP_INCLUDED +#endif // CATCH_OUTLIERS_CLASSIFICATION_HPP_INCLUDED +// The fwd decl & default specialization needs to be seen by VS2017 before +// BenchmarkStats itself, or VS2017 will report compilation error. +#include +#include -#ifndef CATCH_UNIQUE_NAME_HPP_INCLUDED -#define CATCH_UNIQUE_NAME_HPP_INCLUDED +namespace Catch { + struct BenchmarkInfo { + std::string name; + double estimatedDuration; + int iterations; + unsigned int samples; + unsigned int resamples; + double clockResolution; + double clockCost; + }; + // We need to keep template parameter for backwards compatibility, + // but we also do not want to use the template paraneter. + template + struct BenchmarkStats { + BenchmarkInfo info; + std::vector samples; + Benchmark::Estimate mean; + Benchmark::Estimate standardDeviation; + Benchmark::OutlierClassification outliers; + double outlierVariance; + }; -/** \file - * Wrapper for the CONFIG configuration option - * - * When generating internal unique names, there are two options. Either - * we mix in the current line number, or mix in an incrementing number. - * We prefer the latter, using `__COUNTER__`, but users might want to - * use the former. - */ -#ifndef CATCH_CONFIG_COUNTER_HPP_INCLUDED -#define CATCH_CONFIG_COUNTER_HPP_INCLUDED +} // end namespace Catch -#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) - #define CATCH_INTERNAL_CONFIG_COUNTER -#endif +#endif // CATCH_BENCHMARK_STATS_HPP_INCLUDED -#if defined( CATCH_INTERNAL_CONFIG_COUNTER ) && \ - !defined( CATCH_CONFIG_NO_COUNTER ) && \ - !defined( CATCH_CONFIG_COUNTER ) -# define CATCH_CONFIG_COUNTER -#endif +// Adapted from donated nonius code. -#endif // CATCH_CONFIG_COUNTER_HPP_INCLUDED -#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line -#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) -#ifdef CATCH_CONFIG_COUNTER -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) -#else -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) -#endif +#ifndef CATCH_ENVIRONMENT_HPP_INCLUDED +#define CATCH_ENVIRONMENT_HPP_INCLUDED + + +namespace Catch { + namespace Benchmark { + struct EnvironmentEstimate { + FDuration mean; + OutlierClassification outliers; + }; + struct Environment { + EnvironmentEstimate clock_resolution; + EnvironmentEstimate clock_cost; + }; + } // namespace Benchmark +} // namespace Catch -#endif // CATCH_UNIQUE_NAME_HPP_INCLUDED +#endif // CATCH_ENVIRONMENT_HPP_INCLUDED // Adapted from donated nonius code. -#ifndef CATCH_CHRONOMETER_HPP_INCLUDED -#define CATCH_CHRONOMETER_HPP_INCLUDED +#ifndef CATCH_EXECUTION_PLAN_HPP_INCLUDED +#define CATCH_EXECUTION_PLAN_HPP_INCLUDED // Adapted from donated nonius code. -#ifndef CATCH_CLOCK_HPP_INCLUDED -#define CATCH_CLOCK_HPP_INCLUDED - -#include -#include - -namespace Catch { - namespace Benchmark { - template - using ClockDuration = typename Clock::duration; - template - using FloatDuration = std::chrono::duration; +#ifndef CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED +#define CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED - template - using TimePoint = typename Clock::time_point; - using default_clock = std::chrono::steady_clock; - template - struct now { - TimePoint operator()() const { - return Clock::now(); - } - }; +// Adapted from donated nonius code. - using fp_seconds = std::chrono::duration>; - } // namespace Benchmark -} // namespace Catch +#ifndef CATCH_CHRONOMETER_HPP_INCLUDED +#define CATCH_CHRONOMETER_HPP_INCLUDED -#endif // CATCH_CLOCK_HPP_INCLUDED // Adapted from donated nonius code. @@ -1624,7 +1408,7 @@ namespace Catch { #ifndef CATCH_OPTIMIZER_HPP_INCLUDED #define CATCH_OPTIMIZER_HPP_INCLUDED -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__IAR_SYSTEMS_ICC__) # include // atomic_thread_fence #endif @@ -1645,16 +1429,23 @@ namespace Catch { namespace Detail { inline void optimizer_barrier() { keep_memory(); } } // namespace Detail -#elif defined(_MSC_VER) +#elif defined(_MSC_VER) || defined(__IAR_SYSTEMS_ICC__) +#if defined(_MSVC_VER) #pragma optimize("", off) +#elif defined(__IAR_SYSTEMS_ICC__) +// For IAR the pragma only affects the following function +#pragma optimize=disable +#endif template inline void keep_memory(T* p) { // thanks @milleniumbug *reinterpret_cast(p) = *reinterpret_cast(p); } // TODO equivalent keep_memory() +#if defined(_MSVC_VER) #pragma optimize("", on) +#endif namespace Detail { inline void optimizer_barrier() { @@ -1676,7 +1467,7 @@ namespace Catch { template inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t::value> { - CATCH_FORWARD(fn) (CATCH_FORWARD(args)...); + CATCH_FORWARD((fn)) (CATCH_FORWARD(args)...); } } // namespace Benchmark } // namespace Catch @@ -1684,41 +1475,20 @@ namespace Catch { #endif // CATCH_OPTIMIZER_HPP_INCLUDED -// Adapted from donated nonius code. - -#ifndef CATCH_COMPLETE_INVOKE_HPP_INCLUDED -#define CATCH_COMPLETE_INVOKE_HPP_INCLUDED - - - -#ifndef CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED -#define CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED - -namespace Catch { - - //! Used to signal that an assertion macro failed - struct TestFailureException{}; - -} // namespace Catch - -#endif // CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED - - #ifndef CATCH_META_HPP_INCLUDED #define CATCH_META_HPP_INCLUDED #include namespace Catch { - template - struct always_false : std::false_type {}; + template + struct true_given : std::true_type {}; - template struct true_given : std::true_type {}; struct is_callable_tester { template - true_given()(std::declval()...))> static test(int); + static true_given()(std::declval()...))> test(int); template - std::false_type static test(...); + static std::false_type test(...); }; template @@ -1746,112 +1516,6 @@ namespace mpl_{ #endif // CATCH_META_HPP_INCLUDED - -#ifndef CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED -#define CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED - - -#include - -namespace Catch { - - class TestCaseHandle; - struct TestCaseInfo; - class ITestCaseRegistry; - class IExceptionTranslatorRegistry; - class IExceptionTranslator; - class IReporterRegistry; - class IReporterFactory; - class ITagAliasRegistry; - class ITestInvoker; - class IMutableEnumValuesRegistry; - struct SourceLineInfo; - - class StartupExceptionRegistry; - class EventListenerFactory; - - using IReporterFactoryPtr = Detail::unique_ptr; - - class IRegistryHub { - public: - virtual ~IRegistryHub(); // = default - - virtual IReporterRegistry const& getReporterRegistry() const = 0; - virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; - virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0; - virtual IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const = 0; - - - virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0; - }; - - class IMutableRegistryHub { - public: - virtual ~IMutableRegistryHub(); // = default - virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0; - virtual void registerListener( Detail::unique_ptr factory ) = 0; - virtual void registerTest(Detail::unique_ptr&& testInfo, Detail::unique_ptr&& invoker) = 0; - virtual void registerTranslator( Detail::unique_ptr&& translator ) = 0; - virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0; - virtual void registerStartupException() noexcept = 0; - virtual IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() = 0; - }; - - IRegistryHub const& getRegistryHub(); - IMutableRegistryHub& getMutableRegistryHub(); - void cleanUp(); - std::string translateActiveException(); - -} - -#endif // CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED - -#include - -namespace Catch { - namespace Benchmark { - namespace Detail { - template - struct CompleteType { using type = T; }; - template <> - struct CompleteType { struct type {}; }; - - template - using CompleteType_t = typename CompleteType::type; - - template - struct CompleteInvoker { - template - static Result invoke(Fun&& fun, Args&&... args) { - return CATCH_FORWARD(fun)(CATCH_FORWARD(args)...); - } - }; - template <> - struct CompleteInvoker { - template - static CompleteType_t invoke(Fun&& fun, Args&&... args) { - CATCH_FORWARD(fun)(CATCH_FORWARD(args)...); - return {}; - } - }; - - // invoke and not return void :( - template - CompleteType_t> complete_invoke(Fun&& fun, Args&&... args) { - return CompleteInvoker>::invoke(CATCH_FORWARD(fun), CATCH_FORWARD(args)...); - } - - } // namespace Detail - - template - Detail::CompleteType_t> user_code(Fun&& fun) { - return Detail::complete_invoke(CATCH_FORWARD(fun)); - } - } // namespace Benchmark -} // namespace Catch - -#endif // CATCH_COMPLETE_INVOKE_HPP_INCLUDED - namespace Catch { namespace Benchmark { namespace Detail { @@ -1869,7 +1533,10 @@ namespace Catch { void start() override { started = Clock::now(); } void finish() override { finished = Clock::now(); } - ClockDuration elapsed() const { return finished - started; } + IDuration elapsed() const { + return std::chrono::duration_cast( + finished - started ); + } TimePoint started; TimePoint finished; @@ -1910,50 +1577,6 @@ namespace Catch { #endif // CATCH_CHRONOMETER_HPP_INCLUDED - -// Adapted from donated nonius code. - -#ifndef CATCH_ENVIRONMENT_HPP_INCLUDED -#define CATCH_ENVIRONMENT_HPP_INCLUDED - - -namespace Catch { - namespace Benchmark { - template - struct EnvironmentEstimate { - Duration mean; - OutlierClassification outliers; - - template - operator EnvironmentEstimate() const { - return { mean, outliers }; - } - }; - template - struct Environment { - using clock_type = Clock; - EnvironmentEstimate> clock_resolution; - EnvironmentEstimate> clock_cost; - }; - } // namespace Benchmark -} // namespace Catch - -#endif // CATCH_ENVIRONMENT_HPP_INCLUDED - - -// Adapted from donated nonius code. - -#ifndef CATCH_EXECUTION_PLAN_HPP_INCLUDED -#define CATCH_EXECUTION_PLAN_HPP_INCLUDED - - - -// Adapted from donated nonius code. - -#ifndef CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED -#define CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED - - #include namespace Catch { @@ -1974,22 +1597,17 @@ namespace Catch { private: struct callable { virtual void call(Chronometer meter) const = 0; - virtual Catch::Detail::unique_ptr clone() const = 0; virtual ~callable(); // = default; callable() = default; - callable(callable const&) = default; - callable& operator=(callable const&) = default; + callable(callable&&) = default; + callable& operator=(callable&&) = default; }; template struct model : public callable { model(Fun&& fun_) : fun(CATCH_MOVE(fun_)) {} model(Fun const& fun_) : fun(fun_) {} - Catch::Detail::unique_ptr clone() const override { - return Catch::Detail::make_unique>( *this ); - } - void call(Chronometer meter) const override { call(meter, is_callable()); } @@ -2003,14 +1621,8 @@ namespace Catch { Fun fun; }; - struct do_nothing { void operator()() const {} }; - - template - BenchmarkFunction(model* c) : f(c) {} - public: - BenchmarkFunction() - : f(new model{ {} }) {} + BenchmarkFunction(); template ::value, int> = 0> @@ -2020,20 +1632,12 @@ namespace Catch { BenchmarkFunction( BenchmarkFunction&& that ) noexcept: f( CATCH_MOVE( that.f ) ) {} - BenchmarkFunction(BenchmarkFunction const& that) - : f(that.f->clone()) {} - BenchmarkFunction& operator=( BenchmarkFunction&& that ) noexcept { f = CATCH_MOVE( that.f ); return *this; } - BenchmarkFunction& operator=(BenchmarkFunction const& that) { - f = that.f->clone(); - return *this; - } - void operator()(Chronometer meter) const { f->call(meter); } private: @@ -2063,31 +1667,82 @@ namespace Catch { fun(); } } - Fun fun; + Fun fun; + }; + template + repeater> repeat(Fun&& fun) { + return { CATCH_FORWARD(fun) }; + } + } // namespace Detail + } // namespace Benchmark +} // namespace Catch + +#endif // CATCH_REPEAT_HPP_INCLUDED + + +// Adapted from donated nonius code. + +#ifndef CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED +#define CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED + + + +// Adapted from donated nonius code. + +#ifndef CATCH_MEASURE_HPP_INCLUDED +#define CATCH_MEASURE_HPP_INCLUDED + + + +// Adapted from donated nonius code. + +#ifndef CATCH_COMPLETE_INVOKE_HPP_INCLUDED +#define CATCH_COMPLETE_INVOKE_HPP_INCLUDED + + +namespace Catch { + namespace Benchmark { + namespace Detail { + template + struct CompleteType { using type = T; }; + template <> + struct CompleteType { struct type {}; }; + + template + using CompleteType_t = typename CompleteType::type; + + template + struct CompleteInvoker { + template + static Result invoke(Fun&& fun, Args&&... args) { + return CATCH_FORWARD(fun)(CATCH_FORWARD(args)...); + } }; - template - repeater> repeat(Fun&& fun) { - return { CATCH_FORWARD(fun) }; + template <> + struct CompleteInvoker { + template + static CompleteType_t invoke(Fun&& fun, Args&&... args) { + CATCH_FORWARD(fun)(CATCH_FORWARD(args)...); + return {}; + } + }; + + // invoke and not return void :( + template + CompleteType_t> complete_invoke(Fun&& fun, Args&&... args) { + return CompleteInvoker>::invoke(CATCH_FORWARD(fun), CATCH_FORWARD(args)...); } + } // namespace Detail + + template + Detail::CompleteType_t> user_code(Fun&& fun) { + return Detail::complete_invoke(CATCH_FORWARD(fun)); + } } // namespace Benchmark } // namespace Catch -#endif // CATCH_REPEAT_HPP_INCLUDED - - -// Adapted from donated nonius code. - -#ifndef CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED -#define CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED - - - -// Adapted from donated nonius code. - -#ifndef CATCH_MEASURE_HPP_INCLUDED -#define CATCH_MEASURE_HPP_INCLUDED - +#endif // CATCH_COMPLETE_INVOKE_HPP_INCLUDED // Adapted from donated nonius code. @@ -2100,14 +1755,14 @@ namespace Catch { namespace Catch { namespace Benchmark { - template + template struct Timing { - Duration elapsed; + IDuration elapsed; Result result; int iterations; }; - template - using TimingOf = Timing, Detail::CompleteType_t>>; + template + using TimingOf = Timing>>; } // namespace Benchmark } // namespace Catch @@ -2117,9 +1772,9 @@ namespace Catch { namespace Benchmark { namespace Detail { template - TimingOf measure(Fun&& fun, Args&&... args) { + TimingOf measure(Fun&& fun, Args&&... args) { auto start = Clock::now(); - auto&& r = Detail::complete_invoke(fun, CATCH_FORWARD(args)...); + auto&& r = Detail::complete_invoke(CATCH_FORWARD(fun), CATCH_FORWARD(args)...); auto end = Clock::now(); auto delta = end - start; return { delta, CATCH_FORWARD(r), 1 }; @@ -2136,11 +1791,11 @@ namespace Catch { namespace Benchmark { namespace Detail { template - TimingOf measure_one(Fun&& fun, int iters, std::false_type) { + TimingOf measure_one(Fun&& fun, int iters, std::false_type) { return Detail::measure(fun, iters); } template - TimingOf measure_one(Fun&& fun, int iters, std::true_type) { + TimingOf measure_one(Fun&& fun, int iters, std::true_type) { Detail::ChronometerModel meter; auto&& result = Detail::complete_invoke(fun, Chronometer(meter, iters)); @@ -2155,8 +1810,8 @@ namespace Catch { void throw_optimized_away_error(); template - TimingOf> - run_for_at_least(ClockDuration how_long, + TimingOf> + run_for_at_least(IDuration how_long, const int initial_iterations, Fun&& fun) { auto iters = initial_iterations; @@ -2176,38 +1831,38 @@ namespace Catch { #endif // CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED -#include -#include +#include namespace Catch { namespace Benchmark { - template struct ExecutionPlan { int iterations_per_sample; - Duration estimated_duration; + FDuration estimated_duration; Detail::BenchmarkFunction benchmark; - Duration warmup_time; + FDuration warmup_time; int warmup_iterations; - template - operator ExecutionPlan() const { - return { iterations_per_sample, estimated_duration, benchmark, warmup_time, warmup_iterations }; - } - template - std::vector> run(const IConfig &cfg, Environment> env) const { + std::vector run(const IConfig &cfg, Environment env) const { // warmup a bit - Detail::run_for_at_least(std::chrono::duration_cast>(warmup_time), warmup_iterations, Detail::repeat(now{})); + Detail::run_for_at_least( + std::chrono::duration_cast( warmup_time ), + warmup_iterations, + Detail::repeat( []() { return Clock::now(); } ) + ); - std::vector> times; - times.reserve(cfg.benchmarkSamples()); - std::generate_n(std::back_inserter(times), cfg.benchmarkSamples(), [this, env] { + std::vector times; + const auto num_samples = cfg.benchmarkSamples(); + times.reserve( num_samples ); + for ( size_t i = 0; i < num_samples; ++i ) { Detail::ChronometerModel model; - this->benchmark(Chronometer(model, iterations_per_sample)); + this->benchmark( Chronometer( model, iterations_per_sample ) ); auto sample_time = model.elapsed() - env.clock_cost.mean; - if (sample_time < FloatDuration::zero()) sample_time = FloatDuration::zero(); - return sample_time / iterations_per_sample; - }); + if ( sample_time < FDuration::zero() ) { + sample_time = FDuration::zero(); + } + times.push_back(sample_time / iterations_per_sample); + } return times; } }; @@ -2230,122 +1885,35 @@ namespace Catch { #define CATCH_STATS_HPP_INCLUDED -#include #include -#include -#include -#include namespace Catch { namespace Benchmark { namespace Detail { using sample = std::vector; - // Used when we know we want == comparison of two doubles - // to centralize warning suppression - bool directCompare( double lhs, double rhs ); - - double weighted_average_quantile(int k, int q, std::vector::iterator first, std::vector::iterator last); - - template - OutlierClassification classify_outliers(Iterator first, Iterator last) { - std::vector copy(first, last); - - auto q1 = weighted_average_quantile(1, 4, copy.begin(), copy.end()); - auto q3 = weighted_average_quantile(3, 4, copy.begin(), copy.end()); - auto iqr = q3 - q1; - auto los = q1 - (iqr * 3.); - auto lom = q1 - (iqr * 1.5); - auto him = q3 + (iqr * 1.5); - auto his = q3 + (iqr * 3.); - - OutlierClassification o; - for (; first != last; ++first) { - auto&& t = *first; - if (t < los) ++o.low_severe; - else if (t < lom) ++o.low_mild; - else if (t > his) ++o.high_severe; - else if (t > him) ++o.high_mild; - ++o.samples_seen; - } - return o; - } - - template - double mean(Iterator first, Iterator last) { - auto count = last - first; - double sum = std::accumulate(first, last, 0.); - return sum / static_cast(count); - } - - template - sample jackknife(Estimator&& estimator, Iterator first, Iterator last) { - auto n = static_cast(last - first); - auto second = first; - ++second; - sample results; - results.reserve(n); + double weighted_average_quantile( int k, + int q, + double* first, + double* last ); - for (auto it = first; it != last; ++it) { - std::iter_swap(it, first); - results.push_back(estimator(second, last)); - } + OutlierClassification + classify_outliers( double const* first, double const* last ); - return results; - } + double mean( double const* first, double const* last ); - inline double normal_cdf(double x) { - return std::erfc(-x / std::sqrt(2.0)) / 2.0; - } + double normal_cdf( double x ); double erfc_inv(double x); double normal_quantile(double p); - template - Estimate bootstrap(double confidence_level, Iterator first, Iterator last, sample const& resample, Estimator&& estimator) { - auto n_samples = last - first; - - double point = estimator(first, last); - // Degenerate case with a single sample - if (n_samples == 1) return { point, point, point, confidence_level }; - - sample jack = jackknife(estimator, first, last); - double jack_mean = mean(jack.begin(), jack.end()); - double sum_squares, sum_cubes; - std::tie(sum_squares, sum_cubes) = std::accumulate(jack.begin(), jack.end(), std::make_pair(0., 0.), [jack_mean](std::pair sqcb, double x) -> std::pair { - auto d = jack_mean - x; - auto d2 = d * d; - auto d3 = d2 * d; - return { sqcb.first + d2, sqcb.second + d3 }; - }); - - double accel = sum_cubes / (6 * std::pow(sum_squares, 1.5)); - long n = static_cast(resample.size()); - double prob_n = std::count_if(resample.begin(), resample.end(), [point](double x) { return x < point; }) / static_cast(n); - // degenerate case with uniform samples - if ( directCompare( prob_n, 0. ) ) { - return { point, point, point, confidence_level }; - } - - double bias = normal_quantile(prob_n); - double z1 = normal_quantile((1. - confidence_level) / 2.); - - auto cumn = [n]( double x ) -> long { - return std::lround( normal_cdf( x ) * static_cast(n) ); - }; - auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); }; - double b1 = bias + z1; - double b2 = bias - z1; - double a1 = a(b1); - double a2 = a(b2); - auto lo = static_cast((std::max)(cumn(a1), 0l)); - auto hi = static_cast((std::min)(cumn(a2), n - 1)); - - return { point, resample[lo], resample[hi], confidence_level }; - } - - double outlier_variance(Estimate mean, Estimate stddev, int n); + Estimate + bootstrap( double confidence_level, + double* first, + double* last, + sample const& resample, + double ( *estimator )( double const*, double const* ) ); struct bootstrap_analysis { Estimate mean; @@ -2353,7 +1921,10 @@ namespace Catch { double outlier_variance; }; - bootstrap_analysis analyse_samples(double confidence_level, unsigned int n_resamples, std::vector::iterator first, std::vector::iterator last); + bootstrap_analysis analyse_samples(double confidence_level, + unsigned int n_resamples, + double* first, + double* last); } // namespace Detail } // namespace Benchmark } // namespace Catch @@ -2361,7 +1932,6 @@ namespace Catch { #endif // CATCH_STATS_HPP_INCLUDED #include -#include #include #include @@ -2370,48 +1940,53 @@ namespace Catch { namespace Detail { template std::vector resolution(int k) { - std::vector> times; - times.reserve(static_cast(k + 1)); - std::generate_n(std::back_inserter(times), k + 1, now{}); + const size_t points = static_cast( k + 1 ); + // To avoid overhead from the branch inside vector::push_back, + // we allocate them all and then overwrite. + std::vector> times(points); + for ( auto& time : times ) { + time = Clock::now(); + } std::vector deltas; deltas.reserve(static_cast(k)); - std::transform(std::next(times.begin()), times.end(), times.begin(), - std::back_inserter(deltas), - [](TimePoint a, TimePoint b) { return static_cast((a - b).count()); }); + for ( size_t idx = 1; idx < points; ++idx ) { + deltas.push_back( static_cast( + ( times[idx] - times[idx - 1] ).count() ) ); + } return deltas; } - const auto warmup_iterations = 10000; - const auto warmup_time = std::chrono::milliseconds(100); - const auto minimum_ticks = 1000; - const auto warmup_seed = 10000; - const auto clock_resolution_estimation_time = std::chrono::milliseconds(500); - const auto clock_cost_estimation_time_limit = std::chrono::seconds(1); - const auto clock_cost_estimation_tick_limit = 100000; - const auto clock_cost_estimation_time = std::chrono::milliseconds(10); - const auto clock_cost_estimation_iterations = 10000; + constexpr auto warmup_iterations = 10000; + constexpr auto warmup_time = std::chrono::milliseconds(100); + constexpr auto minimum_ticks = 1000; + constexpr auto warmup_seed = 10000; + constexpr auto clock_resolution_estimation_time = std::chrono::milliseconds(500); + constexpr auto clock_cost_estimation_time_limit = std::chrono::seconds(1); + constexpr auto clock_cost_estimation_tick_limit = 100000; + constexpr auto clock_cost_estimation_time = std::chrono::milliseconds(10); + constexpr auto clock_cost_estimation_iterations = 10000; template int warmup() { - return run_for_at_least(std::chrono::duration_cast>(warmup_time), warmup_seed, &resolution) + return run_for_at_least(warmup_time, warmup_seed, &resolution) .iterations; } template - EnvironmentEstimate> estimate_clock_resolution(int iterations) { - auto r = run_for_at_least(std::chrono::duration_cast>(clock_resolution_estimation_time), iterations, &resolution) + EnvironmentEstimate estimate_clock_resolution(int iterations) { + auto r = run_for_at_least(clock_resolution_estimation_time, iterations, &resolution) .result; return { - FloatDuration(mean(r.begin(), r.end())), - classify_outliers(r.begin(), r.end()), + FDuration(mean(r.data(), r.data() + r.size())), + classify_outliers(r.data(), r.data() + r.size()), }; } template - EnvironmentEstimate> estimate_clock_cost(FloatDuration resolution) { + EnvironmentEstimate estimate_clock_cost(FDuration resolution) { auto time_limit = (std::min)( resolution * clock_cost_estimation_tick_limit, - FloatDuration(clock_cost_estimation_time_limit)); + FDuration(clock_cost_estimation_time_limit)); auto time_clock = [](int k) { return Detail::measure([k] { for (int i = 0; i < k; ++i) { @@ -2422,26 +1997,28 @@ namespace Catch { }; time_clock(1); int iters = clock_cost_estimation_iterations; - auto&& r = run_for_at_least(std::chrono::duration_cast>(clock_cost_estimation_time), iters, time_clock); + auto&& r = run_for_at_least(clock_cost_estimation_time, iters, time_clock); std::vector times; int nsamples = static_cast(std::ceil(time_limit / r.elapsed)); times.reserve(static_cast(nsamples)); - std::generate_n(std::back_inserter(times), nsamples, [time_clock, &r] { - return static_cast((time_clock(r.iterations) / r.iterations).count()); - }); + for ( int s = 0; s < nsamples; ++s ) { + times.push_back( static_cast( + ( time_clock( r.iterations ) / r.iterations ) + .count() ) ); + } return { - FloatDuration(mean(times.begin(), times.end())), - classify_outliers(times.begin(), times.end()), + FDuration(mean(times.data(), times.data() + times.size())), + classify_outliers(times.data(), times.data() + times.size()), }; } template - Environment> measure_environment() { + Environment measure_environment() { #if defined(__clang__) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wexit-time-destructors" #endif - static Catch::Detail::unique_ptr>> env; + static Catch::Detail::unique_ptr env; #if defined(__clang__) # pragma clang diagnostic pop #endif @@ -2453,7 +2030,7 @@ namespace Catch { auto resolution = Detail::estimate_clock_resolution(iters); auto cost = Detail::estimate_clock_cost(resolution.mean); - env = Catch::Detail::make_unique>>( Environment>{resolution, cost} ); + env = Catch::Detail::make_unique( Environment{resolution, cost} ); return *env; } } // namespace Detail @@ -2476,95 +2053,29 @@ namespace Catch { #define CATCH_SAMPLE_ANALYSIS_HPP_INCLUDED -#include #include -#include namespace Catch { namespace Benchmark { - template struct SampleAnalysis { - std::vector samples; - Estimate mean; - Estimate standard_deviation; + std::vector samples; + Estimate mean; + Estimate standard_deviation; OutlierClassification outliers; double outlier_variance; - - template - operator SampleAnalysis() const { - std::vector samples2; - samples2.reserve(samples.size()); - std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); }); - return { - CATCH_MOVE(samples2), - mean, - standard_deviation, - outliers, - outlier_variance, - }; - } }; } // namespace Benchmark } // namespace Catch #endif // CATCH_SAMPLE_ANALYSIS_HPP_INCLUDED -#include -#include -#include namespace Catch { + class IConfig; + namespace Benchmark { namespace Detail { - template - SampleAnalysis analyse(const IConfig &cfg, Environment, Iterator first, Iterator last) { - if (!cfg.benchmarkNoAnalysis()) { - std::vector samples; - samples.reserve(static_cast(last - first)); - std::transform(first, last, std::back_inserter(samples), [](Duration d) { return d.count(); }); - - auto analysis = Catch::Benchmark::Detail::analyse_samples(cfg.benchmarkConfidenceInterval(), cfg.benchmarkResamples(), samples.begin(), samples.end()); - auto outliers = Catch::Benchmark::Detail::classify_outliers(samples.begin(), samples.end()); - - auto wrap_estimate = [](Estimate e) { - return Estimate { - Duration(e.point), - Duration(e.lower_bound), - Duration(e.upper_bound), - e.confidence_interval, - }; - }; - std::vector samples2; - samples2.reserve(samples.size()); - std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](double d) { return Duration(d); }); - return { - CATCH_MOVE(samples2), - wrap_estimate(analysis.mean), - wrap_estimate(analysis.standard_deviation), - outliers, - analysis.outlier_variance, - }; - } else { - std::vector samples; - samples.reserve(static_cast(last - first)); - - Duration mean = Duration(0); - int i = 0; - for (auto it = first; it < last; ++it, ++i) { - samples.push_back(Duration(*it)); - mean += Duration(*it); - } - mean /= i; - - return { - CATCH_MOVE(samples), - Estimate{mean, mean, mean, 0.0}, - Estimate{Duration(0), Duration(0), Duration(0), 0.0}, - OutlierClassification{}, - 0.0 - }; - } - } + SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDuration* last); } // namespace Detail } // namespace Benchmark } // namespace Catch @@ -2572,9 +2083,9 @@ namespace Catch { #endif // CATCH_ANALYSE_HPP_INCLUDED #include -#include +#include +#include #include -#include #include namespace Catch { @@ -2588,16 +2099,18 @@ namespace Catch { : fun(CATCH_MOVE(func)), name(CATCH_MOVE(benchmarkName)) {} template - ExecutionPlan> prepare(const IConfig &cfg, Environment> env) const { + ExecutionPlan prepare(const IConfig &cfg, Environment env) { auto min_time = env.clock_resolution.mean * Detail::minimum_ticks; auto run_time = std::max(min_time, std::chrono::duration_cast(cfg.benchmarkWarmupTime())); - auto&& test = Detail::run_for_at_least(std::chrono::duration_cast>(run_time), 1, fun); + auto&& test = Detail::run_for_at_least(std::chrono::duration_cast(run_time), 1, fun); int new_iters = static_cast(std::ceil(min_time * test.iterations / test.elapsed)); - return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), fun, std::chrono::duration_cast>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations }; + return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), CATCH_MOVE(fun), std::chrono::duration_cast(cfg.benchmarkWarmupTime()), Detail::warmup_iterations }; } template void run() { + static_assert( Clock::is_steady, + "Benchmarking clock should be steady" ); auto const* cfg = getCurrentContext().getConfig(); auto env = Detail::measure_environment(); @@ -2609,7 +2122,7 @@ namespace Catch { }); BenchmarkInfo info { - name, + CATCH_MOVE(name), plan.estimated_duration.count(), plan.iterations_per_sample, cfg->benchmarkSamples(), @@ -2624,10 +2137,10 @@ namespace Catch { return plan.template run(*cfg, env); }); - auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end()); - BenchmarkStats> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance }; + auto analysis = Detail::analyse(*cfg, samples.data(), samples.data() + samples.size()); + BenchmarkStats<> stats{ CATCH_MOVE(info), CATCH_MOVE(analysis.samples), analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance }; getResultCapture().benchmarkEnded(stats); - } CATCH_CATCH_ANON (TestFailureException) { + } CATCH_CATCH_ANON (TestFailureException const&) { getResultCapture().benchmarkFailed("Benchmark failed due to failed assertion"_sr); } CATCH_CATCH_ALL{ getResultCapture().benchmarkFailed(translateActiveException()); @@ -2737,14 +2250,18 @@ namespace Catch { template void destruct_on_exit(std::enable_if_t* = nullptr) { } - T& stored_object() { - return *static_cast(static_cast(data)); - } +#if defined( __GNUC__ ) && __GNUC__ <= 6 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + T& stored_object() { return *reinterpret_cast( data ); } T const& stored_object() const { - return *static_cast(static_cast(data)); + return *reinterpret_cast( data ); } - +#if defined( __GNUC__ ) && __GNUC__ <= 6 +# pragma GCC diagnostic pop +#endif alignas( T ) unsigned char data[sizeof( T )]{}; }; @@ -2776,7 +2293,6 @@ namespace Catch { #include #include #include -#include @@ -2792,6 +2308,7 @@ namespace Catch { #ifndef CATCH_CONFIG_WCHAR_HPP_INCLUDED #define CATCH_CONFIG_WCHAR_HPP_INCLUDED + // We assume that WCHAR should be enabled by default, and only disabled // for a shortlist (so far only DJGPP) of compilers. @@ -2939,6 +2456,13 @@ namespace Catch { namespace Detail { + inline std::size_t catch_strnlen(const char *str, std::size_t n) { + auto ret = std::char_traits::find(str, n, '\0'); + if (ret != nullptr) { + return static_cast(ret - str); + } + return n; + } constexpr StringRef unprintableString = "{?}"_sr; @@ -3008,7 +2532,6 @@ namespace Catch { } // namespace Detail - // If we decide for C++14, change these to enable_if_ts template struct StringMaker { template @@ -3106,28 +2629,24 @@ namespace Catch { template struct StringMaker { static std::string convert(char const* str) { - // Note that `strnlen` is not actually part of standard C++, - // but both POSIX and Windows cstdlib provide it. return Detail::convertIntoString( - StringRef( str, strnlen( str, SZ ) ) ); + StringRef( str, Detail::catch_strnlen( str, SZ ) ) ); } }; template struct StringMaker { static std::string convert(signed char const* str) { - // See the plain `char const*` overload auto reinterpreted = reinterpret_cast(str); return Detail::convertIntoString( - StringRef(reinterpreted, strnlen(reinterpreted, SZ))); + StringRef(reinterpreted, Detail::catch_strnlen(reinterpreted, SZ))); } }; template struct StringMaker { static std::string convert(unsigned char const* str) { - // See the plain `char const*` overload auto reinterpreted = reinterpret_cast(str); return Detail::convertIntoString( - StringRef(reinterpreted, strnlen(reinterpreted, SZ))); + StringRef(reinterpreted, Detail::catch_strnlen(reinterpreted, SZ))); } }; @@ -3176,11 +2695,11 @@ namespace Catch { }; template<> struct StringMaker { - static std::string convert(signed char c); + static std::string convert(signed char value); }; template<> struct StringMaker { - static std::string convert(unsigned char c); + static std::string convert(unsigned char value); }; template<> @@ -3194,13 +2713,13 @@ namespace Catch { template<> struct StringMaker { static std::string convert(float value); - static int precision; + CATCH_EXPORT static int precision; }; template<> struct StringMaker { static std::string convert(double value); - static int precision; + CATCH_EXPORT static int precision; }; template @@ -3295,6 +2814,12 @@ namespace Catch { } } }; + template <> + struct StringMaker { + static std::string convert(const std::nullopt_t&) { + return "{ }"; + } + }; } #endif // CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER @@ -3657,28 +3182,177 @@ namespace Catch { return *this; } - std::string toString() const; + std::string toString() const; + + private: + double m_epsilon; + double m_margin; + double m_scale; + double m_value; + }; + +namespace literals { + Approx operator ""_a(long double val); + Approx operator ""_a(unsigned long long val); +} // end namespace literals + +template<> +struct StringMaker { + static std::string convert(Catch::Approx const& value); +}; + +} // end namespace Catch + +#endif // CATCH_APPROX_HPP_INCLUDED + + +#ifndef CATCH_ASSERTION_INFO_HPP_INCLUDED +#define CATCH_ASSERTION_INFO_HPP_INCLUDED + + + +#ifndef CATCH_SOURCE_LINE_INFO_HPP_INCLUDED +#define CATCH_SOURCE_LINE_INFO_HPP_INCLUDED + +#include +#include + +namespace Catch { + + struct SourceLineInfo { + + SourceLineInfo() = delete; + constexpr SourceLineInfo( char const* _file, std::size_t _line ) noexcept: + file( _file ), + line( _line ) + {} + + bool operator == ( SourceLineInfo const& other ) const noexcept; + bool operator < ( SourceLineInfo const& other ) const noexcept; + + char const* file; + std::size_t line; + + friend std::ostream& operator << (std::ostream& os, SourceLineInfo const& info); + }; +} + +#define CATCH_INTERNAL_LINEINFO \ + ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) + +#endif // CATCH_SOURCE_LINE_INFO_HPP_INCLUDED + +namespace Catch { + + struct AssertionInfo { + // AssertionInfo() = delete; + + StringRef macroName; + SourceLineInfo lineInfo; + StringRef capturedExpression; + ResultDisposition::Flags resultDisposition; + }; + +} // end namespace Catch + +#endif // CATCH_ASSERTION_INFO_HPP_INCLUDED + + +#ifndef CATCH_ASSERTION_RESULT_HPP_INCLUDED +#define CATCH_ASSERTION_RESULT_HPP_INCLUDED + + + +#ifndef CATCH_LAZY_EXPR_HPP_INCLUDED +#define CATCH_LAZY_EXPR_HPP_INCLUDED + +#include + +namespace Catch { + + class ITransientExpression; + + class LazyExpression { + friend class AssertionHandler; + friend struct AssertionStats; + friend class RunContext; + + ITransientExpression const* m_transientExpression = nullptr; + bool m_isNegated; + public: + constexpr LazyExpression( bool isNegated ): + m_isNegated(isNegated) + {} + constexpr LazyExpression(LazyExpression const& other) = default; + LazyExpression& operator = ( LazyExpression const& ) = delete; + + constexpr explicit operator bool() const { + return m_transientExpression != nullptr; + } + + friend auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream&; + }; + +} // namespace Catch + +#endif // CATCH_LAZY_EXPR_HPP_INCLUDED + +#include + +namespace Catch { + + struct AssertionResultData + { + AssertionResultData() = delete; + + AssertionResultData( ResultWas::OfType _resultType, LazyExpression const& _lazyExpression ); + + std::string message; + mutable std::string reconstructedExpression; + LazyExpression lazyExpression; + ResultWas::OfType resultType; + + std::string reconstructExpression() const; + }; + + class AssertionResult { + public: + AssertionResult() = delete; + AssertionResult( AssertionInfo const& info, AssertionResultData&& data ); + + bool isOk() const; + bool succeeded() const; + ResultWas::OfType getResultType() const; + bool hasExpression() const; + bool hasMessage() const; + std::string getExpression() const; + std::string getExpressionInMacro() const; + bool hasExpandedExpression() const; + std::string getExpandedExpression() const; + StringRef getMessage() const; + SourceLineInfo getSourceInfo() const; + StringRef getTestMacroName() const; + + //protected: + AssertionInfo m_info; + AssertionResultData m_resultData; + }; + +} // end namespace Catch + +#endif // CATCH_ASSERTION_RESULT_HPP_INCLUDED - private: - double m_epsilon; - double m_margin; - double m_scale; - double m_value; - }; -namespace literals { - Approx operator ""_a(long double val); - Approx operator ""_a(unsigned long long val); -} // end namespace literals +#ifndef CATCH_CASE_SENSITIVE_HPP_INCLUDED +#define CATCH_CASE_SENSITIVE_HPP_INCLUDED -template<> -struct StringMaker { - static std::string convert(Catch::Approx const& value); -}; +namespace Catch { -} // end namespace Catch + enum class CaseSensitive { Yes, No }; -#endif // CATCH_APPROX_HPP_INCLUDED +} // namespace Catch + +#endif // CATCH_CASE_SENSITIVE_HPP_INCLUDED #ifndef CATCH_CONFIG_HPP_INCLUDED @@ -3700,18 +3374,6 @@ struct StringMaker { #define CATCH_WILDCARD_PATTERN_HPP_INCLUDED - -#ifndef CATCH_CASE_SENSITIVE_HPP_INCLUDED -#define CATCH_CASE_SENSITIVE_HPP_INCLUDED - -namespace Catch { - - enum class CaseSensitive { Yes, No }; - -} // namespace Catch - -#endif // CATCH_CASE_SENSITIVE_HPP_INCLUDED - #include namespace Catch @@ -3739,6 +3401,7 @@ namespace Catch #endif // CATCH_WILDCARD_PATTERN_HPP_INCLUDED +#include #include #include @@ -3757,6 +3420,14 @@ namespace Catch { virtual bool matches( TestCaseInfo const& testCase ) const = 0; std::string const& name() const; private: + virtual void serializeTo( std::ostream& out ) const = 0; + // Writes string that would be reparsed into the pattern + friend std::ostream& operator<<(std::ostream& out, + Pattern const& pattern) { + pattern.serializeTo( out ); + return out; + } + std::string const m_name; }; @@ -3765,6 +3436,8 @@ namespace Catch { explicit NamePattern( std::string const& name, std::string const& filterString ); bool matches( TestCaseInfo const& testCase ) const override; private: + void serializeTo( std::ostream& out ) const override; + WildcardPattern m_wildcardPattern; }; @@ -3773,6 +3446,8 @@ namespace Catch { explicit TagPattern( std::string const& tag, std::string const& filterString ); bool matches( TestCaseInfo const& testCase ) const override; private: + void serializeTo( std::ostream& out ) const override; + std::string m_tag; }; @@ -3780,10 +3455,19 @@ namespace Catch { std::vector> m_required; std::vector> m_forbidden; + //! Serializes this filter into a string that would be parsed into + //! an equivalent filter + void serializeTo( std::ostream& out ) const; + friend std::ostream& operator<<(std::ostream& out, Filter const& f) { + f.serializeTo( out ); + return out; + } + bool matches( TestCaseInfo const& testCase ) const; - std::string name() const; }; + static std::string extractFilterName( Filter const& filter ); + public: struct FilterMatch { std::string name; @@ -3800,7 +3484,16 @@ namespace Catch { private: std::vector m_filters; std::vector m_invalidSpecs; + friend class TestSpecParser; + //! Serializes this test spec into a string that would be parsed into + //! equivalent test spec + void serializeTo( std::ostream& out ) const; + friend std::ostream& operator<<(std::ostream& out, + TestSpec const& spec) { + spec.serializeTo( out ); + return out; + } }; } @@ -3814,6 +3507,7 @@ namespace Catch { #ifndef CATCH_OPTIONAL_HPP_INCLUDED #define CATCH_OPTIONAL_HPP_INCLUDED + #include namespace Catch { @@ -3822,35 +3516,50 @@ namespace Catch { template class Optional { public: - Optional() : nullableValue( nullptr ) {} - Optional( T const& _value ) - : nullableValue( new( storage ) T( _value ) ) - {} - Optional( Optional const& _other ) - : nullableValue( _other ? new( storage ) T( *_other ) : nullptr ) - {} + Optional(): nullableValue( nullptr ) {} + ~Optional() { reset(); } - ~Optional() { + Optional( T const& _value ): + nullableValue( new ( storage ) T( _value ) ) {} + Optional( T&& _value ): + nullableValue( new ( storage ) T( CATCH_MOVE( _value ) ) ) {} + + Optional& operator=( T const& _value ) { + reset(); + nullableValue = new ( storage ) T( _value ); + return *this; + } + Optional& operator=( T&& _value ) { reset(); + nullableValue = new ( storage ) T( CATCH_MOVE( _value ) ); + return *this; } - Optional& operator= ( Optional const& _other ) { - if( &_other != this ) { + Optional( Optional const& _other ): + nullableValue( _other ? new ( storage ) T( *_other ) : nullptr ) {} + Optional( Optional&& _other ): + nullableValue( _other ? new ( storage ) T( CATCH_MOVE( *_other ) ) + : nullptr ) {} + + Optional& operator=( Optional const& _other ) { + if ( &_other != this ) { reset(); - if( _other ) - nullableValue = new( storage ) T( *_other ); + if ( _other ) { nullableValue = new ( storage ) T( *_other ); } } return *this; } - Optional& operator = ( T const& _value ) { - reset(); - nullableValue = new( storage ) T( _value ); + Optional& operator=( Optional&& _other ) { + if ( &_other != this ) { + reset(); + if ( _other ) { + nullableValue = new ( storage ) T( CATCH_MOVE( *_other ) ); + } + } return *this; } void reset() { - if( nullableValue ) - nullableValue->~T(); + if ( nullableValue ) { nullableValue->~T(); } nullableValue = nullptr; } @@ -3897,7 +3606,7 @@ namespace Catch { } private: - T *nullableValue; + T* nullableValue; alignas(alignof(T)) char storage[sizeof(T)]; }; @@ -3931,140 +3640,6 @@ namespace Catch { #define CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED - -#ifndef CATCH_CONSOLE_COLOUR_HPP_INCLUDED -#define CATCH_CONSOLE_COLOUR_HPP_INCLUDED - - -#include -#include - -namespace Catch { - - enum class ColourMode : std::uint8_t; - class IStream; - - struct Colour { - enum Code { - None = 0, - - White, - Red, - Green, - Blue, - Cyan, - Yellow, - Grey, - - Bright = 0x10, - - BrightRed = Bright | Red, - BrightGreen = Bright | Green, - LightGrey = Bright | Grey, - BrightWhite = Bright | White, - BrightYellow = Bright | Yellow, - - // By intention - FileName = LightGrey, - Warning = BrightYellow, - ResultError = BrightRed, - ResultSuccess = BrightGreen, - ResultExpectedFailure = Warning, - - Error = BrightRed, - Success = Green, - - OriginalExpression = Cyan, - ReconstructedExpression = BrightYellow, - - SecondaryText = LightGrey, - Headers = White - }; - }; - - class ColourImpl { - protected: - //! The associated stream of this ColourImpl instance - IStream* m_stream; - public: - ColourImpl( IStream* stream ): m_stream( stream ) {} - - //! RAII wrapper around writing specific colour of text using specific - //! colour impl into a stream. - class ColourGuard { - ColourImpl const* m_colourImpl; - Colour::Code m_code; - bool m_engaged = false; - - public: - //! Does **not** engage the guard/start the colour - ColourGuard( Colour::Code code, - ColourImpl const* colour ); - - ColourGuard( ColourGuard const& rhs ) = delete; - ColourGuard& operator=( ColourGuard const& rhs ) = delete; - - ColourGuard( ColourGuard&& rhs ) noexcept; - ColourGuard& operator=( ColourGuard&& rhs ) noexcept; - - //! Removes colour _if_ the guard was engaged - ~ColourGuard(); - - /** - * Explicitly engages colour for given stream. - * - * The API based on operator<< should be preferred. - */ - ColourGuard& engage( std::ostream& stream ) &; - /** - * Explicitly engages colour for given stream. - * - * The API based on operator<< should be preferred. - */ - ColourGuard&& engage( std::ostream& stream ) &&; - - private: - //! Engages the guard and starts using colour - friend std::ostream& operator<<( std::ostream& lhs, - ColourGuard& guard ) { - guard.engageImpl( lhs ); - return lhs; - } - //! Engages the guard and starts using colour - friend std::ostream& operator<<( std::ostream& lhs, - ColourGuard&& guard) { - guard.engageImpl( lhs ); - return lhs; - } - - void engageImpl( std::ostream& stream ); - - }; - - virtual ~ColourImpl(); // = default - /** - * Creates a guard object for given colour and this colour impl - * - * **Important:** - * the guard starts disengaged, and has to be engaged explicitly. - */ - ColourGuard guardColour( Colour::Code colourCode ); - - private: - virtual void use( Colour::Code colourCode ) const = 0; - }; - - //! Provides ColourImpl based on global config and target compilation platform - Detail::unique_ptr makeColourImpl( ColourMode colourSelection, - IStream* stream ); - - //! Checks if specific colour impl has been compiled into the binary - bool isColourImplAvailable( ColourMode colourSelection ); - -} // end namespace Catch - -#endif // CATCH_CONSOLE_COLOUR_HPP_INCLUDED - #include #include #include @@ -4190,7 +3765,7 @@ namespace Catch { bool benchmarkNoAnalysis = false; unsigned int benchmarkSamples = 100; double benchmarkConfidenceInterval = 0.95; - unsigned int benchmarkResamples = 100000; + unsigned int benchmarkResamples = 100'000; std::chrono::milliseconds::rep benchmarkWarmupTime = 100; Verbosity verbosity = Verbosity::Normal; @@ -4261,6 +3836,9 @@ namespace Catch { std::chrono::milliseconds benchmarkWarmupTime() const override; private: + // Reads Bazel env vars and applies them to the config + void readBazelEnvVars(); + ConfigData m_data; std::vector m_processedReporterSpecs; TestSpec m_testSpec; @@ -4271,11 +3849,47 @@ namespace Catch { #endif // CATCH_CONFIG_HPP_INCLUDED +#ifndef CATCH_GET_RANDOM_SEED_HPP_INCLUDED +#define CATCH_GET_RANDOM_SEED_HPP_INCLUDED + +#include + +namespace Catch { + //! Returns Catch2's current RNG seed. + std::uint32_t getSeed(); +} + +#endif // CATCH_GET_RANDOM_SEED_HPP_INCLUDED + + #ifndef CATCH_MESSAGE_HPP_INCLUDED #define CATCH_MESSAGE_HPP_INCLUDED + +/** \file + * Wrapper for the CATCH_CONFIG_PREFIX_MESSAGES configuration option + * + * CATCH_CONFIG_PREFIX_ALL can be used to avoid clashes with other macros + * by prepending CATCH_. This may not be desirable if the only clashes are with + * logger macros such as INFO and WARN. In this cases + * CATCH_CONFIG_PREFIX_MESSAGES can be used to only prefix a small subset + * of relevant macros. + * + */ + +#ifndef CATCH_CONFIG_PREFIX_MESSAGES_HPP_INCLUDED +#define CATCH_CONFIG_PREFIX_MESSAGES_HPP_INCLUDED + + +#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_PREFIX_MESSAGES) + #define CATCH_CONFIG_PREFIX_MESSAGES +#endif + +#endif // CATCH_CONFIG_PREFIX_MESSAGES_HPP_INCLUDED + + #ifndef CATCH_STREAM_END_STOP_HPP_INCLUDED #define CATCH_STREAM_END_STOP_HPP_INCLUDED @@ -4287,10 +3901,10 @@ namespace Catch { // as well as // << stuff +StreamEndStop struct StreamEndStop { - StringRef operator+() const { return StringRef(); } + constexpr StringRef operator+() const { return StringRef(); } template - friend T const& operator+( T const& value, StreamEndStop ) { + constexpr friend T const& operator+( T const& value, StreamEndStop ) { return value; } }; @@ -4299,12 +3913,47 @@ namespace Catch { #endif // CATCH_STREAM_END_STOP_HPP_INCLUDED + +#ifndef CATCH_MESSAGE_INFO_HPP_INCLUDED +#define CATCH_MESSAGE_INFO_HPP_INCLUDED + + +#include + +namespace Catch { + + struct MessageInfo { + MessageInfo( StringRef _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ); + + StringRef macroName; + std::string message; + SourceLineInfo lineInfo; + ResultWas::OfType type; + unsigned int sequence; + + bool operator == (MessageInfo const& other) const { + return sequence == other.sequence; + } + bool operator < (MessageInfo const& other) const { + return sequence < other.sequence; + } + private: + static unsigned int globalCount; + }; + +} // end namespace Catch + +#endif // CATCH_MESSAGE_INFO_HPP_INCLUDED + #include #include namespace Catch { struct SourceLineInfo; + class IResultCapture; struct MessageStream { @@ -4323,11 +3972,10 @@ namespace Catch { ResultWas::OfType type ): m_info(macroName, lineInfo, type) {} - template - MessageBuilder& operator << ( T const& value ) { + MessageBuilder&& operator << ( T const& value ) && { m_stream << value; - return *this; + return CATCH_MOVE(*this); } MessageInfo m_info; @@ -4335,7 +3983,7 @@ namespace Catch { class ScopedMessage { public: - explicit ScopedMessage( MessageBuilder const& builder ); + explicit ScopedMessage( MessageBuilder&& builder ); ScopedMessage( ScopedMessage& duplicate ) = delete; ScopedMessage( ScopedMessage&& old ) noexcept; ~ScopedMessage(); @@ -4346,7 +3994,7 @@ namespace Catch { class Capturer { std::vector m_messages; - IResultCapture& m_resultCapture = getResultCapture(); + IResultCapture& m_resultCapture; size_t m_captured = 0; public: Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ); @@ -4377,45 +4025,48 @@ namespace Catch { do { \ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \ catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \ - Catch::Capturer varName( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \ + Catch::Capturer varName( macroName##_catch_sr, \ + CATCH_INTERNAL_LINEINFO, \ + Catch::ResultWas::Info, \ + #__VA_ARGS__##_catch_sr ); \ varName.captureValues( 0, __VA_ARGS__ ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_INFO( macroName, log ) \ - Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ) + const Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \ Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ) -#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE) +#if defined(CATCH_CONFIG_PREFIX_MESSAGES) && !defined(CATCH_CONFIG_DISABLE) #define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg ) #define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg ) #define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg ) #define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE", __VA_ARGS__ ) -#elif defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE) +#elif defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE) #define CATCH_INFO( msg ) (void)(0) #define CATCH_UNSCOPED_INFO( msg ) (void)(0) #define CATCH_WARN( msg ) (void)(0) #define CATCH_CAPTURE( ... ) (void)(0) -#elif !defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE) +#elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && !defined(CATCH_CONFIG_DISABLE) #define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg ) #define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg ) #define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg ) #define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE", __VA_ARGS__ ) -#elif !defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE) +#elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE) #define INFO( msg ) (void)(0) #define UNSCOPED_INFO( msg ) (void)(0) @@ -4430,6 +4081,75 @@ namespace Catch { #endif // CATCH_MESSAGE_HPP_INCLUDED +#ifndef CATCH_SECTION_INFO_HPP_INCLUDED +#define CATCH_SECTION_INFO_HPP_INCLUDED + + + +#ifndef CATCH_TOTALS_HPP_INCLUDED +#define CATCH_TOTALS_HPP_INCLUDED + +#include + +namespace Catch { + + struct Counts { + Counts operator - ( Counts const& other ) const; + Counts& operator += ( Counts const& other ); + + std::uint64_t total() const; + bool allPassed() const; + bool allOk() const; + + std::uint64_t passed = 0; + std::uint64_t failed = 0; + std::uint64_t failedButOk = 0; + std::uint64_t skipped = 0; + }; + + struct Totals { + + Totals operator - ( Totals const& other ) const; + Totals& operator += ( Totals const& other ); + + Totals delta( Totals const& prevTotals ) const; + + Counts assertions; + Counts testCases; + }; +} + +#endif // CATCH_TOTALS_HPP_INCLUDED + +#include + +namespace Catch { + + struct SectionInfo { + // The last argument is ignored, so that people can write + // SECTION("ShortName", "Proper description that is long") and + // still use the `-c` flag comfortably. + SectionInfo( SourceLineInfo const& _lineInfo, std::string _name, + const char* const = nullptr ): + name(CATCH_MOVE(_name)), + lineInfo(_lineInfo) + {} + + std::string name; + SourceLineInfo lineInfo; + }; + + struct SectionEndInfo { + SectionInfo sectionInfo; + Counts prevAssertions; + double durationInSeconds; + }; + +} // end namespace Catch + +#endif // CATCH_SECTION_INFO_HPP_INCLUDED + + #ifndef CATCH_SESSION_HPP_INCLUDED #define CATCH_SESSION_HPP_INCLUDED @@ -4533,17 +4253,16 @@ namespace Catch { enum class TokenType { Option, Argument }; struct Token { TokenType type; - std::string token; + StringRef token; }; // Abstracts iterators into args as a stream of tokens, with option // arguments uniformly handled class TokenStream { - using Iterator = std::vector::const_iterator; + using Iterator = std::vector::const_iterator; Iterator it; Iterator itEnd; std::vector m_tokenBuffer; - void loadBuffer(); public: @@ -4595,12 +4314,17 @@ namespace Catch { ResultType m_type; }; - template class ResultValueBase : public ResultBase { + template + class ResultValueBase : public ResultBase { public: - auto value() const -> T const& { + T const& value() const& { enforceOk(); return m_value; } + T&& value() && { + enforceOk(); + return CATCH_MOVE( m_value ); + } protected: ResultValueBase( ResultType type ): ResultBase( type ) {} @@ -4610,13 +4334,23 @@ namespace Catch { if ( m_type == ResultType::Ok ) new ( &m_value ) T( other.m_value ); } + ResultValueBase( ResultValueBase&& other ): + ResultBase( other ) { + if ( m_type == ResultType::Ok ) + new ( &m_value ) T( CATCH_MOVE(other.m_value) ); + } + - ResultValueBase( ResultType, T const& value ): ResultBase( ResultType::Ok ) { + ResultValueBase( ResultType, T const& value ): + ResultBase( ResultType::Ok ) { new ( &m_value ) T( value ); } + ResultValueBase( ResultType, T&& value ): + ResultBase( ResultType::Ok ) { + new ( &m_value ) T( CATCH_MOVE(value) ); + } - auto operator=( ResultValueBase const& other ) - -> ResultValueBase& { + ResultValueBase& operator=( ResultValueBase const& other ) { if ( m_type == ResultType::Ok ) m_value.~T(); ResultBase::operator=( other ); @@ -4624,6 +4358,14 @@ namespace Catch { new ( &m_value ) T( other.m_value ); return *this; } + ResultValueBase& operator=( ResultValueBase&& other ) { + if ( m_type == ResultType::Ok ) m_value.~T(); + ResultBase::operator=( other ); + if ( m_type == ResultType::Ok ) + new ( &m_value ) T( CATCH_MOVE(other.m_value) ); + return *this; + } + ~ResultValueBase() override { if ( m_type == ResultType::Ok ) @@ -4651,8 +4393,8 @@ namespace Catch { } template - static auto ok( U const& value ) -> BasicResult { - return { ResultType::Ok, value }; + static auto ok( U&& value ) -> BasicResult { + return { ResultType::Ok, CATCH_FORWARD(value) }; } static auto ok() -> BasicResult { return { ResultType::Ok }; } static auto logicError( std::string&& message ) @@ -4699,12 +4441,15 @@ namespace Catch { class ParseState { public: ParseState( ParseResultType type, - TokenStream const& remainingTokens ); + TokenStream remainingTokens ); ParseResultType type() const { return m_type; } - TokenStream const& remainingTokens() const { + TokenStream const& remainingTokens() const& { return m_remainingTokens; } + TokenStream&& remainingTokens() && { + return CATCH_MOVE( m_remainingTokens ); + } private: ParseResultType m_type; @@ -4717,7 +4462,7 @@ namespace Catch { struct HelpColumns { std::string left; - std::string right; + StringRef descriptions; }; template @@ -4877,7 +4622,7 @@ namespace Catch { virtual ~ParserBase() = default; virtual auto validate() const -> Result { return Result::ok(); } virtual auto parse( std::string const& exeName, - TokenStream const& tokens ) const + TokenStream tokens ) const -> InternalParseResult = 0; virtual size_t cardinality() const; @@ -4897,8 +4642,8 @@ namespace Catch { protected: Optionality m_optionality = Optionality::Optional; std::shared_ptr m_ref; - std::string m_hint; - std::string m_description; + StringRef m_hint; + StringRef m_description; explicit ParserRefImpl( std::shared_ptr const& ref ): m_ref( ref ) {} @@ -4907,28 +4652,32 @@ namespace Catch { template ParserRefImpl( accept_many_t, LambdaT const& ref, - std::string const& hint ): + StringRef hint ): m_ref( std::make_shared>( ref ) ), m_hint( hint ) {} template ::value>> - ParserRefImpl( T& ref, std::string const& hint ): + ParserRefImpl( T& ref, StringRef hint ): m_ref( std::make_shared>( ref ) ), m_hint( hint ) {} template ::value>> - ParserRefImpl( LambdaT const& ref, std::string const& hint ): + ParserRefImpl( LambdaT const& ref, StringRef hint ): m_ref( std::make_shared>( ref ) ), m_hint( hint ) {} - auto operator()( std::string const& description ) -> DerivedT& { + DerivedT& operator()( StringRef description ) & { m_description = description; return static_cast( *this ); } + DerivedT&& operator()( StringRef description ) && { + m_description = description; + return static_cast( *this ); + } auto optional() -> DerivedT& { m_optionality = Optionality::Optional; @@ -4951,7 +4700,7 @@ namespace Catch { return 1; } - std::string const& hint() const { return m_hint; } + StringRef hint() const { return m_hint; } }; } // namespace detail @@ -4965,13 +4714,13 @@ namespace Catch { Detail::InternalParseResult parse(std::string const&, - Detail::TokenStream const& tokens) const override; + Detail::TokenStream tokens) const override; }; // A parser for options class Opt : public Detail::ParserRefImpl { protected: - std::vector m_optNames; + std::vector m_optNames; public: template @@ -4984,33 +4733,37 @@ namespace Catch { template ::value>> - Opt( LambdaT const& ref, std::string const& hint ): + Opt( LambdaT const& ref, StringRef hint ): ParserRefImpl( ref, hint ) {} template - Opt( accept_many_t, LambdaT const& ref, std::string const& hint ): + Opt( accept_many_t, LambdaT const& ref, StringRef hint ): ParserRefImpl( accept_many, ref, hint ) {} template ::value>> - Opt( T& ref, std::string const& hint ): + Opt( T& ref, StringRef hint ): ParserRefImpl( ref, hint ) {} - auto operator[](std::string const& optName) -> Opt& { + Opt& operator[]( StringRef optName ) & { m_optNames.push_back(optName); return *this; } + Opt&& operator[]( StringRef optName ) && { + m_optNames.push_back( optName ); + return CATCH_MOVE(*this); + } - std::vector getHelpColumns() const; + Detail::HelpColumns getHelpColumns() const; - bool isMatch(std::string const& optToken) const; + bool isMatch(StringRef optToken) const; using ParserBase::parse; Detail::InternalParseResult parse(std::string const&, - Detail::TokenStream const& tokens) const override; + Detail::TokenStream tokens) const override; Detail::Result validate() const override; }; @@ -5033,7 +4786,7 @@ namespace Catch { // handled specially Detail::InternalParseResult parse(std::string const&, - Detail::TokenStream const& tokens) const override; + Detail::TokenStream tokens) const override; std::string const& name() const { return *m_name; } Detail::ParserResult set(std::string const& newName); @@ -5058,16 +4811,28 @@ namespace Catch { return *this; } - auto operator|=(Opt const& opt) -> Parser& { - m_options.push_back(opt); - return *this; + friend Parser& operator|=( Parser& p, Opt const& opt ) { + p.m_options.push_back( opt ); + return p; + } + friend Parser& operator|=( Parser& p, Opt&& opt ) { + p.m_options.push_back( CATCH_MOVE(opt) ); + return p; } Parser& operator|=(Parser const& other); template - auto operator|(T const& other) const -> Parser { - return Parser(*this) |= other; + friend Parser operator|( Parser const& p, T&& rhs ) { + Parser temp( p ); + temp |= rhs; + return temp; + } + + template + friend Parser operator|( Parser&& p, T&& rhs ) { + p |= CATCH_FORWARD(rhs); + return CATCH_MOVE(p); } std::vector getHelpColumns() const; @@ -5085,21 +4850,23 @@ namespace Catch { using ParserBase::parse; Detail::InternalParseResult parse(std::string const& exeName, - Detail::TokenStream const& tokens) const override; + Detail::TokenStream tokens) const override; }; - // Transport for raw args (copied from main args, or supplied via - // init list for testing) + /** + * Wrapper over argc + argv, assumes that the inputs outlive it + */ class Args { friend Detail::TokenStream; - std::string m_exeName; - std::vector m_args; + StringRef m_exeName; + std::vector m_args; public: Args(int argc, char const* const* argv); - Args(std::initializer_list args); + // Helper constructor for testing + Args(std::initializer_list args); - std::string const& exeName() const { return m_exeName; } + StringRef exeName() const { return m_exeName; } }; @@ -5268,8 +5035,197 @@ namespace Catch { #define CATCH_DECOMPOSER_HPP_INCLUDED + +#ifndef CATCH_COMPARE_TRAITS_HPP_INCLUDED +#define CATCH_COMPARE_TRAITS_HPP_INCLUDED + + +#include + +namespace Catch { + namespace Detail { + +#if defined( __GNUC__ ) && !defined( __clang__ ) +# pragma GCC diagnostic push + // GCC likes to complain about comparing bool with 0, in the decltype() + // that defines the comparable traits below. +# pragma GCC diagnostic ignored "-Wbool-compare" + // "ordered comparison of pointer with integer zero" same as above, + // but it does not have a separate warning flag to suppress +# pragma GCC diagnostic ignored "-Wextra" + // Did you know that comparing floats with `0` directly + // is super-duper dangerous in unevaluated context? +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + +#if defined( __clang__ ) +# pragma clang diagnostic push + // Did you know that comparing floats with `0` directly + // is super-duper dangerous in unevaluated context? +# pragma clang diagnostic ignored "-Wfloat-equal" +#endif + +#define CATCH_DEFINE_COMPARABLE_TRAIT( id, op ) \ + template \ + struct is_##id##_comparable : std::false_type {}; \ + template \ + struct is_##id##_comparable< \ + T, \ + U, \ + void_t() op std::declval() )>> \ + : std::true_type {}; \ + template \ + struct is_##id##_0_comparable : std::false_type {}; \ + template \ + struct is_##id##_0_comparable() op 0 )>> \ + : std::true_type {}; + + // We need all 6 pre-spaceship comparison ops: <, <=, >, >=, ==, != + CATCH_DEFINE_COMPARABLE_TRAIT( lt, < ) + CATCH_DEFINE_COMPARABLE_TRAIT( le, <= ) + CATCH_DEFINE_COMPARABLE_TRAIT( gt, > ) + CATCH_DEFINE_COMPARABLE_TRAIT( ge, >= ) + CATCH_DEFINE_COMPARABLE_TRAIT( eq, == ) + CATCH_DEFINE_COMPARABLE_TRAIT( ne, != ) + +#undef CATCH_DEFINE_COMPARABLE_TRAIT + +#if defined( __GNUC__ ) && !defined( __clang__ ) +# pragma GCC diagnostic pop +#endif +#if defined( __clang__ ) +# pragma clang diagnostic pop +#endif + + + } // namespace Detail +} // namespace Catch + +#endif // CATCH_COMPARE_TRAITS_HPP_INCLUDED + + +#ifndef CATCH_LOGICAL_TRAITS_HPP_INCLUDED +#define CATCH_LOGICAL_TRAITS_HPP_INCLUDED + +#include + +namespace Catch { +namespace Detail { + +#if defined( __cpp_lib_logical_traits ) && __cpp_lib_logical_traits >= 201510 + + using std::conjunction; + using std::disjunction; + using std::negation; + +#else + + template struct conjunction : std::true_type {}; + template struct conjunction : B1 {}; + template + struct conjunction + : std::conditional_t, B1> {}; + + template struct disjunction : std::false_type {}; + template struct disjunction : B1 {}; + template + struct disjunction + : std::conditional_t> {}; + + template + struct negation : std::integral_constant {}; + +#endif + +} // namespace Detail +} // namespace Catch + +#endif // CATCH_LOGICAL_TRAITS_HPP_INCLUDED + +#include #include +/** \file + * Why does decomposing look the way it does: + * + * Conceptually, decomposing is simple. We change `REQUIRE( a == b )` into + * `Decomposer{} <= a == b`, so that `Decomposer{} <= a` is evaluated first, + * and our custom operator is used for `a == b`, because `a` is transformed + * into `ExprLhs` and then into `BinaryExpr`. + * + * In practice, decomposing ends up a mess, because we have to support + * various fun things. + * + * 1) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with pointer constructor and deleted + * other constructors. Example: `REQUIRE((a <=> b) == 0)` in libstdc++ + * + * 2) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with consteval integer constructor. + * Example: `REQUIRE((a <=> b) == 0)` in current MSVC STL. + * + * 3) Types that have no linkage, and so we cannot form a reference to + * them. Example: some implementations of traits. + * + * 4) Starting with C++20, when the compiler sees `a == b`, it also uses + * `b == a` when constructing the overload set. For us this means that + * when the compiler handles `ExprLhs == b`, it also tries to resolve + * the overload set for `b == ExprLhs`. + * + * To accomodate these use cases, decomposer ended up rather complex. + * + * 1) These types are handled by adding SFINAE overloads to our comparison + * operators, checking whether `T == U` are comparable with the given + * operator, and if not, whether T (or U) are comparable with literal 0. + * If yes, the overload compares T (or U) with 0 literal inline in the + * definition. + * + * Note that for extra correctness, we check that the other type is + * either an `int` (literal 0 is captured as `int` by templates), or + * a `long` (some platforms use 0L for `NULL` and we want to support + * that for pointer comparisons). + * + * 2) For these types, `is_foo_comparable` is true, but letting + * them fall into the overload that actually does `T == int` causes + * compilation error. Handling them requires that the decomposition + * is `constexpr`, so that P2564R3 applies and the `consteval` from + * their accompanying magic type is propagated through the `constexpr` + * call stack. + * + * However this is not enough to handle these types automatically, + * because our default is to capture types by reference, to avoid + * runtime copies. While these references cannot become dangling, + * they outlive the constexpr context and thus the default capture + * path cannot be actually constexpr. + * + * The solution is to capture these types by value, by explicitly + * specializing `Catch::capture_by_value` for them. Catch2 provides + * specialization for `std::foo_ordering`s, but users can specialize + * the trait for their own types as well. + * + * 3) If a type has no linkage, we also cannot capture it by reference. + * The solution is once again to capture them by value. We handle + * the common cases by using `std::is_arithmetic` as the default + * for `Catch::capture_by_value`, but that is only a some-effort + * heuristic. But as with 2), users can specialize `capture_by_value` + * for their own types as needed. + * + * 4) To support C++20 and make the SFINAE on our decomposing operators + * work, the SFINAE has to happen in return type, rather than in + * a template type. This is due to our use of logical type traits + * (`conjunction`/`disjunction`/`negation`), that we use to workaround + * an issue in older (9-) versions of GCC. I still blame C++20 for + * this, because without the comparison order switching, the logical + * traits could still be used in template type. + * + * There are also other side concerns, e.g. supporting both `REQUIRE(a)` + * and `REQUIRE(a == b)`, or making `REQUIRE_THAT(a, IsEqual(b))` slot + * nicely into the same expression handling logic, but these are rather + * straightforward and add only a bit of complexity (e.g. common base + * class for decomposed expressions). + */ + #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4389) // '==' : signed/unsigned mismatch @@ -5282,34 +5238,69 @@ namespace Catch { #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wsign-compare" +# pragma clang diagnostic ignored "-Wnon-virtual-dtor" #elif defined __GNUC__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wsign-compare" +# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#if defined(CATCH_CPP20_OR_GREATER) && __has_include() +# include +# if defined( __cpp_lib_three_way_comparison ) && \ + __cpp_lib_three_way_comparison >= 201907L +# define CATCH_CONFIG_CPP20_COMPARE_OVERLOADS +# endif #endif namespace Catch { + namespace Detail { + // This was added in C++20, but we require only C++14 for now. + template + using RemoveCVRef_t = std::remove_cv_t>; + } + + // Note: There is nothing that stops us from extending this, + // e.g. to `std::is_scalar`, but the more encompassing + // traits are usually also more expensive. For now we + // keep this as it used to be and it can be changed later. + template + struct capture_by_value + : std::integral_constant{}> {}; + +#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS ) + template <> + struct capture_by_value : std::true_type {}; + template <> + struct capture_by_value : std::true_type {}; + template <> + struct capture_by_value : std::true_type {}; +#endif + + template + struct always_false : std::false_type {}; + class ITransientExpression { bool m_isBinaryExpression; bool m_result; + protected: + ~ITransientExpression() = default; + public: - auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } - auto getResult() const -> bool { return m_result; } - virtual void streamReconstructedExpression( std::ostream &os ) const = 0; + constexpr auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } + constexpr auto getResult() const -> bool { return m_result; } + //! This function **has** to be overriden by the derived class. + virtual void streamReconstructedExpression( std::ostream& os ) const; - ITransientExpression( bool isBinaryExpression, bool result ) + constexpr ITransientExpression( bool isBinaryExpression, bool result ) : m_isBinaryExpression( isBinaryExpression ), m_result( result ) {} - ITransientExpression() = default; - ITransientExpression(ITransientExpression const&) = default; - ITransientExpression& operator=(ITransientExpression const&) = default; - - // We don't actually need a virtual destructor, but many static analysers - // complain if it's not here :-( - virtual ~ITransientExpression(); // = default; + constexpr ITransientExpression( ITransientExpression const& ) = default; + constexpr ITransientExpression& operator=( ITransientExpression const& ) = default; friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) { expr.streamReconstructedExpression(out); @@ -5331,7 +5322,7 @@ namespace Catch { } public: - BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) + constexpr BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) : ITransientExpression{ true, comparisonResult }, m_lhs( lhs ), m_op( op ), @@ -5404,75 +5395,142 @@ namespace Catch { } public: - explicit UnaryExpr( LhsT lhs ) + explicit constexpr UnaryExpr( LhsT lhs ) : ITransientExpression{ false, static_cast(lhs) }, m_lhs( lhs ) {} }; - // Specialised comparison functions to handle equality comparisons between ints and pointers (NULL deduces as an int) - template - auto compareEqual( LhsT const& lhs, RhsT const& rhs ) -> bool { return static_cast(lhs == rhs); } - template - auto compareEqual( T* const& lhs, int rhs ) -> bool { return lhs == reinterpret_cast( rhs ); } - template - auto compareEqual( T* const& lhs, long rhs ) -> bool { return lhs == reinterpret_cast( rhs ); } - template - auto compareEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast( lhs ) == rhs; } - template - auto compareEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast( lhs ) == rhs; } - - template - auto compareNotEqual( LhsT const& lhs, RhsT&& rhs ) -> bool { return static_cast(lhs != rhs); } - template - auto compareNotEqual( T* const& lhs, int rhs ) -> bool { return lhs != reinterpret_cast( rhs ); } - template - auto compareNotEqual( T* const& lhs, long rhs ) -> bool { return lhs != reinterpret_cast( rhs ); } - template - auto compareNotEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast( lhs ) != rhs; } - template - auto compareNotEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast( lhs ) != rhs; } - - template class ExprLhs { LhsT m_lhs; public: - explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} - - template>::value, int> = 0> - friend auto operator == ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr { - return { compareEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "=="_sr, rhs }; - } - template::value, int> = 0> - friend auto operator == ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr { - return { compareEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "=="_sr, rhs }; - } + explicit constexpr ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} + +#define CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( id, op ) \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ + Detail::conjunction, \ + Detail::negation>>>::value, \ + BinaryExpr> { \ + return { \ + static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ + } \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ + Detail::conjunction, \ + capture_by_value>::value, \ + BinaryExpr> { \ + return { \ + static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ + } \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ + Detail::conjunction< \ + Detail::negation>, \ + Detail::is_eq_0_comparable, \ + /* We allow long because we want `ptr op NULL` to be accepted */ \ + Detail::disjunction, \ + std::is_same>>::value, \ + BinaryExpr> { \ + if ( rhs != 0 ) { throw_test_failure_exception(); } \ + return { \ + static_cast( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ + } \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ + Detail::conjunction< \ + Detail::negation>, \ + Detail::is_eq_0_comparable, \ + /* We allow long because we want `ptr op NULL` to be accepted */ \ + Detail::disjunction, \ + std::is_same>>::value, \ + BinaryExpr> { \ + if ( lhs.m_lhs != 0 ) { throw_test_failure_exception(); } \ + return { static_cast( 0 op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ + } - template>::value, int> = 0> - friend auto operator != ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr { - return { compareNotEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "!="_sr, rhs }; - } - template::value, int> = 0> - friend auto operator != ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr { - return { compareNotEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "!="_sr, rhs }; - } + CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( eq, == ) + CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( ne, != ) + + #undef CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR + + +#define CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( id, op ) \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ + Detail::conjunction, \ + Detail::negation>>>::value, \ + BinaryExpr> { \ + return { \ + static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ + } \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ + Detail::conjunction, \ + capture_by_value>::value, \ + BinaryExpr> { \ + return { \ + static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ + } \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ + Detail::conjunction< \ + Detail::negation>, \ + Detail::is_##id##_0_comparable, \ + std::is_same>::value, \ + BinaryExpr> { \ + if ( rhs != 0 ) { throw_test_failure_exception(); } \ + return { \ + static_cast( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ + } \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ + Detail::conjunction< \ + Detail::negation>, \ + Detail::is_##id##_0_comparable, \ + std::is_same>::value, \ + BinaryExpr> { \ + if ( lhs.m_lhs != 0 ) { throw_test_failure_exception(); } \ + return { static_cast( 0 op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ + } - #define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(op) \ - template>::value, int> = 0> \ - friend auto operator op ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr { \ - return { static_cast(lhs.m_lhs op rhs), lhs.m_lhs, #op##_sr, rhs }; \ - } \ - template::value, int> = 0> \ - friend auto operator op ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr { \ - return { static_cast(lhs.m_lhs op rhs), lhs.m_lhs, #op##_sr, rhs }; \ - } + CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( lt, < ) + CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( le, <= ) + CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( gt, > ) + CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( ge, >= ) + + #undef CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR + + +#define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR( op ) \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ + !capture_by_value>::value, \ + BinaryExpr> { \ + return { \ + static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ + } \ + template \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t::value, \ + BinaryExpr> { \ + return { \ + static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ + } - CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(<) - CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(>) - CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(<=) - CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(>=) CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(|) CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(&) CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(^) @@ -5493,19 +5551,22 @@ namespace Catch { "wrap the expression inside parentheses, or decompose it"); } - auto makeUnaryExpr() const -> UnaryExpr { + constexpr auto makeUnaryExpr() const -> UnaryExpr { return UnaryExpr{ m_lhs }; } }; struct Decomposer { - template>::value, int> = 0> - friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs { + template >::value, + int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs { return ExprLhs{ lhs }; } - template::value, int> = 0> - friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs { + template ::value, int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs { return ExprLhs{ value }; } }; @@ -5527,11 +5588,10 @@ namespace Catch { namespace Catch { - class IResultCapture; - struct AssertionReaction { bool shouldDebugBreak = false; bool shouldThrow = false; + bool shouldSkip = false; }; class AssertionHandler { @@ -5554,12 +5614,12 @@ namespace Catch { template - void handleExpr( ExprLhs const& expr ) { + constexpr void handleExpr( ExprLhs const& expr ) { handleExpr( expr.makeUnaryExpr() ); } void handleExpr( ITransientExpression const& expr ); - void handleMessage(ResultWas::OfType resultType, StringRef message); + void handleMessage(ResultWas::OfType resultType, std::string&& message); void handleExceptionThrownAsExpected(); void handleUnexpectedExceptionNotThrown(); @@ -5568,18 +5628,30 @@ namespace Catch { void handleUnexpectedInflightException(); void complete(); - void setCompleted(); // query auto allowThrows() const -> bool; }; - void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ); + void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str ); } // namespace Catch #endif // CATCH_ASSERTION_HANDLER_HPP_INCLUDED + +#ifndef CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED +#define CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED + + +#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION) + #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__##_catch_sr +#else + #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"_catch_sr +#endif + +#endif // CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED + // We need this suppression to leak, because it took until GCC 10 // for the front end to handle local suppression via _Pragma properly #if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ <= 9 @@ -5588,12 +5660,6 @@ namespace Catch { #if !defined(CATCH_CONFIG_DISABLE) -#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION) - #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__ -#else - #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION" -#endif - #if defined(CATCH_CONFIG_FAST_COMPILE) || defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) /////////////////////////////////////////////////////////////////////////////// @@ -5605,12 +5671,10 @@ namespace Catch { #else // CATCH_CONFIG_FAST_COMPILE #define INTERNAL_CATCH_TRY try -#define INTERNAL_CATCH_CATCH( handler ) catch(...) { handler.handleUnexpectedInflightException(); } +#define INTERNAL_CATCH_CATCH( handler ) catch(...) { (handler).handleUnexpectedInflightException(); } #endif -#define INTERNAL_CATCH_REACT( handler ) handler.complete(); - /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \ do { /* NOLINT(bugprone-infinite-loop) */ \ @@ -5620,10 +5684,10 @@ namespace Catch { INTERNAL_CATCH_TRY { \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ - catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \ + catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); /* NOLINT(bugprone-chained-comparison) */ \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( (void)0, (false) && static_cast( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look // The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&. @@ -5642,13 +5706,16 @@ namespace Catch { do { \ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \ try { \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \ static_cast(__VA_ARGS__); \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ catchAssertionHandler.handleExceptionNotThrownAsExpected(); \ } \ catch( ... ) { \ catchAssertionHandler.handleUnexpectedInflightException(); \ } \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// @@ -5657,7 +5724,11 @@ namespace Catch { Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \ if( catchAssertionHandler.allowThrows() ) \ try { \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \ + CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \ static_cast(__VA_ARGS__); \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } \ catch( ... ) { \ @@ -5665,7 +5736,7 @@ namespace Catch { } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// @@ -5674,7 +5745,11 @@ namespace Catch { Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \ if( catchAssertionHandler.allowThrows() ) \ try { \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \ + CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \ static_cast(expr); \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } \ catch( exceptionType const& ) { \ @@ -5685,7 +5760,7 @@ namespace Catch { } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -5697,15 +5772,19 @@ namespace Catch { Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \ if( catchAssertionHandler.allowThrows() ) \ try { \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \ + CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \ static_cast(__VA_ARGS__); \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } \ catch( ... ) { \ - Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher##_catch_sr ); \ + Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher ); \ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) #endif // CATCH_CONFIG_DISABLE @@ -5718,6 +5797,34 @@ namespace Catch { + +/** \file + * Wrapper for the STATIC_ANALYSIS_SUPPORT configuration option + * + * Some of Catch2's macros can be defined differently to work better with + * static analysis tools, like clang-tidy or coverity. + * Currently the main use case is to show that `SECTION`s are executed + * exclusively, and not all in one run of a `TEST_CASE`. + */ + +#ifndef CATCH_CONFIG_STATIC_ANALYSIS_SUPPORT_HPP_INCLUDED +#define CATCH_CONFIG_STATIC_ANALYSIS_SUPPORT_HPP_INCLUDED + + +#if defined(__clang_analyzer__) || defined(__COVERITY__) + #define CATCH_INTERNAL_CONFIG_STATIC_ANALYSIS_SUPPORT +#endif + +#if defined( CATCH_INTERNAL_CONFIG_STATIC_ANALYSIS_SUPPORT ) && \ + !defined( CATCH_CONFIG_NO_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT ) && \ + !defined( CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT ) +# define CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT +#endif + + +#endif // CATCH_CONFIG_STATIC_ANALYSIS_SUPPORT_HPP_INCLUDED + + #ifndef CATCH_TIMER_HPP_INCLUDED #define CATCH_TIMER_HPP_INCLUDED @@ -5744,6 +5851,9 @@ namespace Catch { class Section : Detail::NonCopyable { public: Section( SectionInfo&& info ); + Section( SourceLineInfo const& _lineInfo, + StringRef _name, + const char* const = nullptr ); ~Section(); // This indicates whether the section should be executed or not @@ -5752,24 +5862,74 @@ namespace Catch { private: SectionInfo m_info; - Counts m_assertions; - bool m_sectionIncluded; - Timer m_timer; - }; + Counts m_assertions; + bool m_sectionIncluded; + Timer m_timer; + }; + +} // end namespace Catch + +#if !defined(CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT) +# define INTERNAL_CATCH_SECTION( ... ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + if ( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( \ + catch_internal_Section ) = \ + Catch::Section( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION + +# define INTERNAL_CATCH_DYNAMIC_SECTION( ... ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + if ( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( \ + catch_internal_Section ) = \ + Catch::SectionInfo( \ + CATCH_INTERNAL_LINEINFO, \ + ( Catch::ReusableStringStream() << __VA_ARGS__ ) \ + .str() ) ) \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION + +#else + +// These section definitions imply that at most one section at one level +// will be intered (because only one section's __LINE__ can be equal to +// the dummy `catchInternalSectionHint` variable from `TEST_CASE`). + +namespace Catch { + namespace Detail { + // Intentionally without linkage, as it should only be used as a dummy + // symbol for static analysis. + // The arguments are used as a dummy for checking warnings in the passed + // expressions. + int GetNewSectionHint( StringRef, const char* const = nullptr ); + } // namespace Detail +} // namespace Catch + -} // end namespace Catch +# define INTERNAL_CATCH_SECTION( ... ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ + if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ + catchInternalSectionHint, \ + catchInternalSectionHint = \ + Catch::Detail::GetNewSectionHint(__VA_ARGS__); \ + catchInternalPreviousSectionHint == __LINE__ ) \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION -#define INTERNAL_CATCH_SECTION( ... ) \ - CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ - CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ - if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) \ - CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +# define INTERNAL_CATCH_DYNAMIC_SECTION( ... ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ + if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ + catchInternalSectionHint, \ + catchInternalSectionHint = Catch::Detail::GetNewSectionHint( \ + ( Catch::ReusableStringStream() << __VA_ARGS__ ).str()); \ + catchInternalPreviousSectionHint == __LINE__ ) \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION + +#endif -#define INTERNAL_CATCH_DYNAMIC_SECTION( ... ) \ - CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ - CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ - if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, (Catch::ReusableStringStream() << __VA_ARGS__).str() ) ) \ - CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION #endif // CATCH_SECTION_HPP_INCLUDED @@ -5779,42 +5939,22 @@ namespace Catch { -#ifndef CATCH_INTERFACES_TESTCASE_HPP_INCLUDED -#define CATCH_INTERFACES_TESTCASE_HPP_INCLUDED - -#include +#ifndef CATCH_INTERFACES_TEST_INVOKER_HPP_INCLUDED +#define CATCH_INTERFACES_TEST_INVOKER_HPP_INCLUDED namespace Catch { - class TestSpec; - struct TestCaseInfo; - class ITestInvoker { public: - virtual void invoke () const = 0; + virtual void prepareTestCase(); + virtual void tearDownTestCase(); + virtual void invoke() const = 0; virtual ~ITestInvoker(); // = default }; - class TestCaseHandle; - class IConfig; - - class ITestCaseRegistry { - public: - virtual ~ITestCaseRegistry(); // = default - // TODO: this exists only for adding filenames to test cases -- let's expose this in a saner way later - virtual std::vector const& getAllInfos() const = 0; - virtual std::vector const& getAllTests() const = 0; - virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; - }; - - bool isThrowSafe( TestCaseHandle const& testCase, IConfig const& config ); - bool matchTest( TestCaseHandle const& testCase, TestSpec const& testSpec, IConfig const& config ); - std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); - std::vector const& getAllTestCasesSorted( IConfig const& config ); - -} +} // namespace Catch -#endif // CATCH_INTERFACES_TESTCASE_HPP_INCLUDED +#endif // CATCH_INTERFACES_TEST_INVOKER_HPP_INCLUDED #ifndef CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED @@ -5845,7 +5985,8 @@ template class TestInvokerAsMethod : public ITestInvoker { void (C::*m_testAsMethod)(); public: - TestInvokerAsMethod( void (C::*testAsMethod)() ) noexcept : m_testAsMethod( testAsMethod ) {} + constexpr TestInvokerAsMethod( void ( C::*testAsMethod )() ) noexcept: + m_testAsMethod( testAsMethod ) {} void invoke() const override { C obj; @@ -5860,6 +6001,34 @@ Detail::unique_ptr makeTestInvoker( void (C::*testAsMethod)() ) { return Detail::make_unique>( testAsMethod ); } +template +class TestInvokerFixture : public ITestInvoker { + void ( C::*m_testAsMethod )() const; + Detail::unique_ptr m_fixture = nullptr; + +public: + constexpr TestInvokerFixture( void ( C::*testAsMethod )() const ) noexcept: + m_testAsMethod( testAsMethod ) {} + + void prepareTestCase() override { + m_fixture = Detail::make_unique(); + } + + void tearDownTestCase() override { + m_fixture.reset(); + } + + void invoke() const override { + auto* f = m_fixture.get(); + ( f->*m_testAsMethod )(); + } +}; + +template +Detail::unique_ptr makeTestInvokerFixture( void ( C::*testAsMethod )() const ) { + return Detail::make_unique>( testAsMethod ); +} + struct NameAndTags { constexpr NameAndTags( StringRef name_ = StringRef(), StringRef tags_ = StringRef() ) noexcept: @@ -5886,25 +6055,55 @@ struct AutoReg : Detail::NonCopyable { void TestName::test() #endif + +#if !defined(CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT) + /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \ static void TestName(); \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &TestName ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \ + namespace{ const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &TestName ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ static void TestName() #define INTERNAL_CATCH_TESTCASE( ... ) \ INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__ ) - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ - CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ - CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ - CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &QualifiedMethod ), CATCH_INTERNAL_LINEINFO, "&" #QualifiedMethod, Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \ - CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +#else // ^^ !CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT | vv CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT + + +// Dummy registrator for the dumy test case macros +namespace Catch { + namespace Detail { + struct DummyUse { + DummyUse( void ( * )( int ), Catch::NameAndTags const& ); + }; + } // namespace Detail +} // namespace Catch + +// Note that both the presence of the argument and its exact name are +// necessary for the section support. + +// We provide a shadowed variable so that a `SECTION` inside non-`TEST_CASE` +// tests can compile. The redefined `TEST_CASE` shadows this with param. +static int catchInternalSectionHint = 0; + +# define INTERNAL_CATCH_TESTCASE2( fname, ... ) \ + static void fname( int ); \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + static const Catch::Detail::DummyUse INTERNAL_CATCH_UNIQUE_NAME( \ + dummyUser )( &(fname), Catch::NameAndTags{ __VA_ARGS__ } ); \ + CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ + static void fname( [[maybe_unused]] int catchInternalSectionHint ) \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +# define INTERNAL_CATCH_TESTCASE( ... ) \ + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ), __VA_ARGS__ ) + + +#endif // CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\ @@ -5915,13 +6114,53 @@ struct AutoReg : Detail::NonCopyable { struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( Catch::makeTestInvoker( &TestName::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ + const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( \ + Catch::makeTestInvoker( &TestName::test ), \ + CATCH_INTERNAL_LINEINFO, \ + #ClassName##_catch_sr, \ + Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ } \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ void TestName::test() #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \ INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ ) + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE2( TestName, ClassName, ... ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + namespace { \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS( ClassName ) { \ + void test() const; \ + }; \ + const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( \ + Catch::makeTestInvokerFixture( &TestName::test ), \ + CATCH_INTERNAL_LINEINFO, \ + #ClassName##_catch_sr, \ + Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ + } \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ + void TestName::test() const + #define INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( ClassName, ... ) \ + INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ ) + + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + namespace { \ + const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( \ + Catch::makeTestInvoker( &QualifiedMethod ), \ + CATCH_INTERNAL_LINEINFO, \ + "&" #QualifiedMethod##_catch_sr, \ + Catch::NameAndTags{ __VA_ARGS__ } ); \ + } /* NOLINT */ \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION + + /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \ do { \ @@ -5963,12 +6202,14 @@ struct AutoReg : Detail::NonCopyable { #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, __VA_ARGS__ ) #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #define CATCH_DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ ) #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ ) #define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) + #define CATCH_SKIP( ... ) INTERNAL_CATCH_MSG( "SKIP", Catch::ResultWas::ExplicitSkip, Catch::ResultDisposition::Normal, __VA_ARGS__ ) #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) @@ -6016,12 +6257,14 @@ struct AutoReg : Detail::NonCopyable { #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define CATCH_METHOD_AS_TEST_CASE( method, ... ) + #define CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0) #define CATCH_SECTION( ... ) #define CATCH_DYNAMIC_SECTION( ... ) #define CATCH_FAIL( ... ) (void)(0) #define CATCH_FAIL_CHECK( ... ) (void)(0) #define CATCH_SUCCEED( ... ) (void)(0) + #define CATCH_SKIP( ... ) (void)(0) #define CATCH_STATIC_REQUIRE( ... ) (void)(0) #define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0) @@ -6060,12 +6303,14 @@ struct AutoReg : Detail::NonCopyable { #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, __VA_ARGS__ ) #define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #define DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ ) #define FAIL( ... ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ ) #define FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) + #define SKIP( ... ) INTERNAL_CATCH_MSG( "SKIP", Catch::ResultWas::ExplicitSkip, Catch::ResultDisposition::Normal, __VA_ARGS__ ) #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) @@ -6112,12 +6357,14 @@ struct AutoReg : Detail::NonCopyable { #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__) #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define METHOD_AS_TEST_CASE( method, ... ) + #define TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__) #define REGISTER_TEST_CASE( Function, ... ) (void)(0) #define SECTION( ... ) #define DYNAMIC_SECTION( ... ) #define FAIL( ... ) (void)(0) #define FAIL_CHECK( ... ) (void)(0) #define SUCCEED( ... ) (void)(0) + #define SKIP( ... ) (void)(0) #define STATIC_REQUIRE( ... ) (void)(0) #define STATIC_REQUIRE_FALSE( ... ) (void)(0) @@ -6437,6 +6684,7 @@ struct AutoReg : Detail::NonCopyable { CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \ INTERNAL_CATCH_DECLARE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature));\ namespace {\ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\ @@ -6447,12 +6695,12 @@ struct AutoReg : Detail::NonCopyable { struct TestName{\ TestName(){\ size_t index = 0; \ - constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ - using expander = size_t[];\ + constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; /* NOLINT(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,hicpp-avoid-c-arrays) */\ + using expander = size_t[]; /* NOLINT(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,hicpp-avoid-c-arrays) */\ (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \ }\ };\ - static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ + static const int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ TestName();\ return 0;\ }();\ @@ -6483,6 +6731,7 @@ struct AutoReg : Detail::NonCopyable { CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \ template static void TestFuncName(); \ namespace {\ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \ @@ -6532,6 +6781,7 @@ struct AutoReg : Detail::NonCopyable { CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \ template static void TestFunc(); \ namespace {\ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\ @@ -6541,7 +6791,7 @@ struct AutoReg : Detail::NonCopyable { void reg_tests() { \ size_t index = 0; \ using expander = size_t[]; \ - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " INTERNAL_CATCH_STRINGIZE(TmplList) " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\ } \ };\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ @@ -6663,6 +6913,7 @@ struct AutoReg : Detail::NonCopyable { CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \ template \ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName ) { \ void test();\ @@ -6675,7 +6926,7 @@ struct AutoReg : Detail::NonCopyable { void reg_tests(){\ size_t index = 0;\ using expander = size_t[];\ - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName::test ), CATCH_INTERNAL_LINEINFO, #ClassName##_catch_sr, Catch::NameAndTags{ Name " - " INTERNAL_CATCH_STRINGIZE(TmplList) " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \ }\ };\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ @@ -6803,6 +7054,7 @@ struct AutoReg : Detail::NonCopyable { +#include #include #include @@ -6831,6 +7083,7 @@ namespace Catch { }; class ITestInvoker; + struct NameAndTags; enum class TestCaseProperties : uint8_t { None = 0, @@ -6854,7 +7107,7 @@ namespace Catch { struct TestCaseInfo : Detail::NonCopyable { TestCaseInfo(StringRef _className, - NameAndTags const& _tags, + NameAndTags const& _nameAndTags, SourceLineInfo const& _lineInfo); bool isHidden() const; @@ -6895,14 +7148,24 @@ namespace Catch { TestCaseInfo* m_info; ITestInvoker* m_invoker; public: - TestCaseHandle(TestCaseInfo* info, ITestInvoker* invoker) : + constexpr TestCaseHandle(TestCaseInfo* info, ITestInvoker* invoker) : m_info(info), m_invoker(invoker) {} + void prepareTestCase() const { + m_invoker->prepareTestCase(); + } + + void tearDownTestCase() const { + m_invoker->tearDownTestCase(); + } + void invoke() const { m_invoker->invoke(); } - TestCaseInfo const& getTestCaseInfo() const; + constexpr TestCaseInfo const& getTestCaseInfo() const { + return *m_info; + } }; Detail::unique_ptr @@ -6955,13 +7218,17 @@ namespace Catch { #include namespace Catch { + namespace Detail { + void registerTranslatorImpl( + Detail::unique_ptr&& translator ); + } class ExceptionTranslatorRegistrar { template class ExceptionTranslator : public IExceptionTranslator { public: - ExceptionTranslator( std::string(*translateFunction)( T const& ) ) + constexpr ExceptionTranslator( std::string(*translateFunction)( T const& ) ) : m_translateFunction( translateFunction ) {} @@ -6988,9 +7255,9 @@ namespace Catch { public: template ExceptionTranslatorRegistrar( std::string(*translateFunction)( T const& ) ) { - getMutableRegistryHub().registerTranslator( - Detail::make_unique>(translateFunction) - ); + Detail::registerTranslatorImpl( + Detail::make_unique>( + translateFunction ) ); } }; @@ -7062,8 +7329,8 @@ namespace Catch { #define CATCH_VERSION_MACROS_HPP_INCLUDED #define CATCH_VERSION_MAJOR 3 -#define CATCH_VERSION_MINOR 1 -#define CATCH_VERSION_PATCH 0 +#define CATCH_VERSION_MINOR 7 +#define CATCH_VERSION_PATCH 1 #endif // CATCH_VERSION_MACROS_HPP_INCLUDED @@ -7221,12 +7488,6 @@ namespace Detail { } public: - ~IGenerator() override = default; - IGenerator() = default; - IGenerator(IGenerator const&) = default; - IGenerator& operator=(IGenerator const&) = default; - - // Returns the current element of the generator // // \Precondition The generator is either freshly constructed, @@ -7387,37 +7648,47 @@ namespace Detail { return makeGenerators( value( T( CATCH_FORWARD( val ) ) ), CATCH_FORWARD( moreGenerators )... ); } - auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker&; + IGeneratorTracker* acquireGeneratorTracker( StringRef generatorName, + SourceLineInfo const& lineInfo ); + IGeneratorTracker* createGeneratorTracker( StringRef generatorName, + SourceLineInfo lineInfo, + GeneratorBasePtr&& generator ); template - // Note: The type after -> is weird, because VS2015 cannot parse - // the expression used in the typedef inside, when it is in - // return type. Yeah. - auto generate( StringRef generatorName, SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval().get()) { + auto generate( StringRef generatorName, SourceLineInfo const& lineInfo, L const& generatorExpression ) -> typename decltype(generatorExpression())::type { using UnderlyingType = typename decltype(generatorExpression())::type; - IGeneratorTracker& tracker = acquireGeneratorTracker( generatorName, lineInfo ); - if (!tracker.hasGenerator()) { - tracker.setGenerator(Catch::Detail::make_unique>(generatorExpression())); + IGeneratorTracker* tracker = acquireGeneratorTracker( generatorName, lineInfo ); + // Creation of tracker is delayed after generator creation, so + // that constructing generator can fail without breaking everything. + if (!tracker) { + tracker = createGeneratorTracker( + generatorName, + lineInfo, + Catch::Detail::make_unique>( + generatorExpression() ) ); } - auto const& generator = static_cast const&>( *tracker.getGenerator() ); + auto const& generator = static_cast const&>( *tracker->getGenerator() ); return generator.get(); } } // namespace Generators } // namespace Catch +#define CATCH_INTERNAL_GENERATOR_STRINGIZE_IMPL( ... ) #__VA_ARGS__##_catch_sr +#define CATCH_INTERNAL_GENERATOR_STRINGIZE(...) CATCH_INTERNAL_GENERATOR_STRINGIZE_IMPL(__VA_ARGS__) + #define GENERATE( ... ) \ - Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \ + Catch::Generators::generate( CATCH_INTERNAL_GENERATOR_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \ CATCH_INTERNAL_LINEINFO, \ [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace) #define GENERATE_COPY( ... ) \ - Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \ + Catch::Generators::generate( CATCH_INTERNAL_GENERATOR_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \ CATCH_INTERNAL_LINEINFO, \ [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace) #define GENERATE_REF( ... ) \ - Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \ + Catch::Generators::generate( CATCH_INTERNAL_GENERATOR_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \ CATCH_INTERNAL_LINEINFO, \ [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace) @@ -7685,37 +7956,584 @@ namespace Catch { return static_cast(-1); } - // Provide some default initial state for the default constructor - SimplePcg32():SimplePcg32(0xed743cc4U) {} + // Provide some default initial state for the default constructor + SimplePcg32():SimplePcg32(0xed743cc4U) {} + + explicit SimplePcg32(result_type seed_); + + void seed(result_type seed_); + void discard(uint64_t skip); + + result_type operator()(); + + private: + friend bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs); + friend bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs); + + // In theory we also need operator<< and operator>> + // In practice we do not use them, so we will skip them for now + + + std::uint64_t m_state; + // This part of the state determines which "stream" of the numbers + // is chosen -- we take it as a constant for Catch2, so we only + // need to deal with seeding the main state. + // Picked by reading 8 bytes from `/dev/random` :-) + static const std::uint64_t s_inc = (0x13ed0cc53f939476ULL << 1ULL) | 1ULL; + }; + +} // end namespace Catch + +#endif // CATCH_RANDOM_NUMBER_GENERATOR_HPP_INCLUDED + + + +#ifndef CATCH_UNIFORM_INTEGER_DISTRIBUTION_HPP_INCLUDED +#define CATCH_UNIFORM_INTEGER_DISTRIBUTION_HPP_INCLUDED + + + + +#ifndef CATCH_RANDOM_INTEGER_HELPERS_HPP_INCLUDED +#define CATCH_RANDOM_INTEGER_HELPERS_HPP_INCLUDED + +#include +#include +#include +#include + +// Note: We use the usual enable-disable-autodetect dance here even though +// we do not support these in CMake configuration options (yet?). +// It is highly unlikely that we will need to make these actually +// user-configurable, but this will make it simpler if weend up needing +// it, and it provides an escape hatch to the users who need it. +#if defined( __SIZEOF_INT128__ ) +# define CATCH_CONFIG_INTERNAL_UINT128 +// Unlike GCC, MSVC does not polyfill umul as mulh + mul pair on ARM machines. +// Currently we do not bother doing this ourselves, but we could if it became +// important for perf. +#elif defined( _MSC_VER ) && defined( _M_X64 ) +# define CATCH_CONFIG_INTERNAL_MSVC_UMUL128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_UINT128 ) && \ + !defined( CATCH_CONFIG_NO_UINT128 ) && \ + !defined( CATCH_CONFIG_UINT128 ) +#define CATCH_CONFIG_UINT128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_NO_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_MSVC_UMUL128 ) +# define CATCH_CONFIG_MSVC_UMUL128 +# include +#endif + + +namespace Catch { + namespace Detail { + + template + struct SizedUnsignedType; +#define SizedUnsignedTypeHelper( TYPE ) \ + template <> \ + struct SizedUnsignedType { \ + using type = TYPE; \ + } + + SizedUnsignedTypeHelper( std::uint8_t ); + SizedUnsignedTypeHelper( std::uint16_t ); + SizedUnsignedTypeHelper( std::uint32_t ); + SizedUnsignedTypeHelper( std::uint64_t ); +#undef SizedUnsignedTypeHelper + + template + using SizedUnsignedType_t = typename SizedUnsignedType::type; + + template + using DoubleWidthUnsignedType_t = SizedUnsignedType_t<2 * sizeof( T )>; + + template + struct ExtendedMultResult { + T upper; + T lower; + constexpr bool operator==( ExtendedMultResult const& rhs ) const { + return upper == rhs.upper && lower == rhs.lower; + } + }; + + /** + * Returns 128 bit result of lhs * rhs using portable C++ code + * + * This implementation is almost twice as fast as naive long multiplication, + * and unlike intrinsic-based approach, it supports constexpr evaluation. + */ + constexpr ExtendedMultResult + extendedMultPortable(std::uint64_t lhs, std::uint64_t rhs) { +#define CarryBits( x ) ( x >> 32 ) +#define Digits( x ) ( x & 0xFF'FF'FF'FF ) + std::uint64_t lhs_low = Digits( lhs ); + std::uint64_t rhs_low = Digits( rhs ); + std::uint64_t low_low = ( lhs_low * rhs_low ); + std::uint64_t high_high = CarryBits( lhs ) * CarryBits( rhs ); + + // We add in carry bits from low-low already + std::uint64_t high_low = + ( CarryBits( lhs ) * rhs_low ) + CarryBits( low_low ); + // Note that we can add only low bits from high_low, to avoid + // overflow with large inputs + std::uint64_t low_high = + ( lhs_low * CarryBits( rhs ) ) + Digits( high_low ); + + return { high_high + CarryBits( high_low ) + CarryBits( low_high ), + ( low_high << 32 ) | Digits( low_low ) }; +#undef CarryBits +#undef Digits + } + + //! Returns 128 bit result of lhs * rhs + inline ExtendedMultResult + extendedMult( std::uint64_t lhs, std::uint64_t rhs ) { +#if defined( CATCH_CONFIG_UINT128 ) + auto result = __uint128_t( lhs ) * __uint128_t( rhs ); + return { static_cast( result >> 64 ), + static_cast( result ) }; +#elif defined( CATCH_CONFIG_MSVC_UMUL128 ) + std::uint64_t high; + std::uint64_t low = _umul128( lhs, rhs, &high ); + return { high, low }; +#else + return extendedMultPortable( lhs, rhs ); +#endif + } + + + template + constexpr ExtendedMultResult extendedMult( UInt lhs, UInt rhs ) { + static_assert( std::is_unsigned::value, + "extendedMult can only handle unsigned integers" ); + static_assert( sizeof( UInt ) < sizeof( std::uint64_t ), + "Generic extendedMult can only handle types smaller " + "than uint64_t" ); + using WideType = DoubleWidthUnsignedType_t; + + auto result = WideType( lhs ) * WideType( rhs ); + return { + static_cast( result >> ( CHAR_BIT * sizeof( UInt ) ) ), + static_cast( result & UInt( -1 ) ) }; + } + + + template + std::enable_if_t= sizeof(TargetType), + TargetType> fillBitsFrom(Generator& gen) { + using gresult_type = typename Generator::result_type; + static_assert( std::is_unsigned::value, "Only unsigned integers are supported" ); + static_assert( Generator::min() == 0 && + Generator::max() == static_cast( -1 ), + "Generator must be able to output all numbers in its result type (effectively it must be a random bit generator)" ); + + // We want to return the top bits from a generator, as they are + // usually considered higher quality. + constexpr auto generated_bits = sizeof( gresult_type ) * CHAR_BIT; + constexpr auto return_bits = sizeof( TargetType ) * CHAR_BIT; + + return static_cast( gen() >> + ( generated_bits - return_bits) ); + } + + template + std::enable_if_t fillBitsFrom(Generator& gen) { + using gresult_type = typename Generator::result_type; + static_assert( std::is_unsigned::value, + "Only unsigned integers are supported" ); + static_assert( Generator::min() == 0 && + Generator::max() == static_cast( -1 ), + "Generator must be able to output all numbers in its result type (effectively it must be a random bit generator)" ); + + constexpr auto generated_bits = sizeof( gresult_type ) * CHAR_BIT; + constexpr auto return_bits = sizeof( TargetType ) * CHAR_BIT; + std::size_t filled_bits = 0; + TargetType ret = 0; + do { + ret <<= generated_bits; + ret |= gen(); + filled_bits += generated_bits; + } while ( filled_bits < return_bits ); + + return ret; + } + + /* + * Transposes numbers into unsigned type while keeping their ordering + * + * This means that signed types are changed so that the ordering is + * [INT_MIN, ..., -1, 0, ..., INT_MAX], rather than order we would + * get by simple casting ([0, ..., INT_MAX, INT_MIN, ..., -1]) + */ + template + constexpr + std::enable_if_t::value, UnsignedType> + transposeToNaturalOrder( UnsignedType in ) { + static_assert( + sizeof( OriginalType ) == sizeof( UnsignedType ), + "reordering requires the same sized types on both sides" ); + static_assert( std::is_unsigned::value, + "Input type must be unsigned" ); + // Assuming 2s complement (standardized in current C++), the + // positive and negative numbers are already internally ordered, + // and their difference is in the top bit. Swapping it orders + // them the desired way. + constexpr auto highest_bit = + UnsignedType( 1 ) << ( sizeof( UnsignedType ) * CHAR_BIT - 1 ); + return static_cast( in ^ highest_bit ); + } + + + + template + constexpr + std::enable_if_t::value, UnsignedType> + transposeToNaturalOrder(UnsignedType in) { + static_assert( + sizeof( OriginalType ) == sizeof( UnsignedType ), + "reordering requires the same sized types on both sides" ); + static_assert( std::is_unsigned::value, "Input type must be unsigned" ); + // No reordering is needed for unsigned -> unsigned + return in; + } + } // namespace Detail +} // namespace Catch + +#endif // CATCH_RANDOM_INTEGER_HELPERS_HPP_INCLUDED + +namespace Catch { + +/** + * Implementation of uniform distribution on integers. + * + * Unlike `std::uniform_int_distribution`, this implementation supports + * various 1 byte integral types, including bool (but you should not + * actually use it for bools). + * + * The underlying algorithm is based on the one described in "Fast Random + * Integer Generation in an Interval" by Daniel Lemire, but has been + * optimized under the assumption of reuse of the same distribution object. + */ +template +class uniform_integer_distribution { + static_assert(std::is_integral::value, "..."); + + using UnsignedIntegerType = Detail::SizedUnsignedType_t; + + // Only the left bound is stored, and we store it converted to its + // unsigned image. This avoids having to do the conversions inside + // the operator(), at the cost of having to do the conversion in + // the a() getter. The right bound is only needed in the b() getter, + // so we recompute it there from other stored data. + UnsignedIntegerType m_a; + + // How many different values are there in [a, b]. a == b => 1, can be 0 for distribution over all values in the type. + UnsignedIntegerType m_ab_distance; + + // We hoisted this out of the main generation function. Technically, + // this means that using this distribution will be slower than Lemire's + // algorithm if this distribution instance will be used only few times, + // but it will be faster if it is used many times. Since Catch2 uses + // distributions only to implement random generators, we assume that each + // distribution will be reused many times and this is an optimization. + UnsignedIntegerType m_rejection_threshold = 0; + + static constexpr UnsignedIntegerType computeDistance(IntegerType a, IntegerType b) { + // This overflows and returns 0 if a == 0 and b == TYPE_MAX. + // We handle that later when generating the number. + return transposeTo(b) - transposeTo(a) + 1; + } + + static constexpr UnsignedIntegerType computeRejectionThreshold(UnsignedIntegerType ab_distance) { + // distance == 0 means that we will return all possible values from + // the type's range, and that we shouldn't reject anything. + if ( ab_distance == 0 ) { return 0; } + return ( ~ab_distance + 1 ) % ab_distance; + } + + static constexpr UnsignedIntegerType transposeTo(IntegerType in) { + return Detail::transposeToNaturalOrder( + static_cast( in ) ); + } + static constexpr IntegerType transposeBack(UnsignedIntegerType in) { + return static_cast( + Detail::transposeToNaturalOrder(in) ); + } + +public: + using result_type = IntegerType; + + constexpr uniform_integer_distribution( IntegerType a, IntegerType b ): + m_a( transposeTo(a) ), + m_ab_distance( computeDistance(a, b) ), + m_rejection_threshold( computeRejectionThreshold(m_ab_distance) ) { + assert( a <= b ); + } + + template + constexpr result_type operator()( Generator& g ) { + // All possible values of result_type are valid. + if ( m_ab_distance == 0 ) { + return transposeBack( Detail::fillBitsFrom( g ) ); + } + + auto random_number = Detail::fillBitsFrom( g ); + auto emul = Detail::extendedMult( random_number, m_ab_distance ); + // Unlike Lemire's algorithm we skip the ab_distance check, since + // we precomputed the rejection threshold, which is always tighter. + while (emul.lower < m_rejection_threshold) { + random_number = Detail::fillBitsFrom( g ); + emul = Detail::extendedMult( random_number, m_ab_distance ); + } + + return transposeBack(m_a + emul.upper); + } + + constexpr result_type a() const { return transposeBack(m_a); } + constexpr result_type b() const { return transposeBack(m_ab_distance + m_a - 1); } +}; + +} // end namespace Catch + +#endif // CATCH_UNIFORM_INTEGER_DISTRIBUTION_HPP_INCLUDED + + + +#ifndef CATCH_UNIFORM_FLOATING_POINT_DISTRIBUTION_HPP_INCLUDED +#define CATCH_UNIFORM_FLOATING_POINT_DISTRIBUTION_HPP_INCLUDED + + + + +#ifndef CATCH_RANDOM_FLOATING_POINT_HELPERS_HPP_INCLUDED +#define CATCH_RANDOM_FLOATING_POINT_HELPERS_HPP_INCLUDED + + + +#ifndef CATCH_POLYFILLS_HPP_INCLUDED +#define CATCH_POLYFILLS_HPP_INCLUDED + +namespace Catch { + + bool isnan(float f); + bool isnan(double d); + + float nextafter(float x, float y); + double nextafter(double x, double y); + +} + +#endif // CATCH_POLYFILLS_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace Catch { + + namespace Detail { + /** + * Returns the largest magnitude of 1-ULP distance inside the [a, b] range. + * + * Assumes `a < b`. + */ + template + FloatType gamma(FloatType a, FloatType b) { + static_assert( std::is_floating_point::value, + "gamma returns the largest ULP magnitude within " + "floating point range [a, b]. This only makes sense " + "for floating point types" ); + assert( a <= b ); + + const auto gamma_up = Catch::nextafter( a, std::numeric_limits::infinity() ) - a; + const auto gamma_down = b - Catch::nextafter( b, -std::numeric_limits::infinity() ); + + return gamma_up < gamma_down ? gamma_down : gamma_up; + } + + template + struct DistanceTypePicker; + template <> + struct DistanceTypePicker { + using type = std::uint32_t; + }; + template <> + struct DistanceTypePicker { + using type = std::uint64_t; + }; + + template + using DistanceType = typename DistanceTypePicker::type; + +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + /** + * Computes the number of equi-distant floats in [a, b] + * + * Since not every range can be split into equidistant floats + * exactly, we actually compute ceil(b/distance - a/distance), + * because in those cases we want to overcount. + * + * Uses modified Dekker's FastTwoSum algorithm to handle rounding. + */ + template + DistanceType + count_equidistant_floats( FloatType a, FloatType b, FloatType distance ) { + assert( a <= b ); + // We get distance as gamma for our uniform float distribution, + // so this will round perfectly. + const auto ag = a / distance; + const auto bg = b / distance; + + const auto s = bg - ag; + const auto err = ( std::fabs( a ) <= std::fabs( b ) ) + ? -ag - ( s - bg ) + : bg - ( s + ag ); + const auto ceil_s = static_cast>( std::ceil( s ) ); + + return ( ceil_s != s ) ? ceil_s : ceil_s + ( err > 0 ); + } +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic pop +#endif + + } - explicit SimplePcg32(result_type seed_); +} // end namespace Catch - void seed(result_type seed_); - void discard(uint64_t skip); +#endif // CATCH_RANDOM_FLOATING_POINT_HELPERS_HPP_INCLUDED - result_type operator()(); +#include +#include - private: - friend bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs); - friend bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs); +namespace Catch { - // In theory we also need operator<< and operator>> - // In practice we do not use them, so we will skip them for now + namespace Detail { +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + // The issue with overflow only happens with maximal ULP and HUGE + // distance, e.g. when generating numbers in [-inf, inf] for given + // type. So we only check for the largest possible ULP in the + // type, and return something that does not overflow to inf in 1 mult. + constexpr std::uint64_t calculate_max_steps_in_one_go(double gamma) { + if ( gamma == 1.99584030953472e+292 ) { return 9007199254740991; } + return static_cast( -1 ); + } + constexpr std::uint32_t calculate_max_steps_in_one_go(float gamma) { + if ( gamma == 2.028241e+31f ) { return 16777215; } + return static_cast( -1 ); + } +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic pop +#endif + } +/** + * Implementation of uniform distribution on floating point numbers. + * + * Note that we support only `float` and `double` types, because these + * usually mean the same thing across different platform. `long double` + * varies wildly by platform and thus we cannot provide reproducible + * implementation. Also note that we don't implement all parts of + * distribution per standard: this distribution is not serializable, nor + * can the range be arbitrarily reset. + * + * The implementation also uses different approach than the one taken by + * `std::uniform_real_distribution`, where instead of generating a number + * between [0, 1) and then multiplying the range bounds with it, we first + * split the [a, b] range into a set of equidistributed floating point + * numbers, and then use uniform int distribution to pick which one to + * return. + * + * This has the advantage of guaranteeing uniformity (the multiplication + * method loses uniformity due to rounding when multiplying floats), except + * for small non-uniformity at one side of the interval, where we have + * to deal with the fact that not every interval is splittable into + * equidistributed floats. + * + * Based on "Drawing random floating-point numbers from an interval" by + * Frederic Goualard. + */ +template +class uniform_floating_point_distribution { + static_assert(std::is_floating_point::value, "..."); + static_assert(!std::is_same::value, + "We do not support long double due to inconsistent behaviour between platforms"); + + using WidthType = Detail::DistanceType; + + FloatType m_a, m_b; + FloatType m_ulp_magnitude; + WidthType m_floats_in_range; + uniform_integer_distribution m_int_dist; + + // In specific cases, we can overflow into `inf` when computing the + // `steps * g` offset. To avoid this, we don't offset by more than this + // in one multiply + addition. + WidthType m_max_steps_in_one_go; + // We don't want to do the magnitude check every call to `operator()` + bool m_a_has_leq_magnitude; - std::uint64_t m_state; - // This part of the state determines which "stream" of the numbers - // is chosen -- we take it as a constant for Catch2, so we only - // need to deal with seeding the main state. - // Picked by reading 8 bytes from `/dev/random` :-) - static const std::uint64_t s_inc = (0x13ed0cc53f939476ULL << 1ULL) | 1ULL; - }; +public: + using result_type = FloatType; + + uniform_floating_point_distribution( FloatType a, FloatType b ): + m_a( a ), + m_b( b ), + m_ulp_magnitude( Detail::gamma( m_a, m_b ) ), + m_floats_in_range( Detail::count_equidistant_floats( m_a, m_b, m_ulp_magnitude ) ), + m_int_dist(0, m_floats_in_range), + m_max_steps_in_one_go( Detail::calculate_max_steps_in_one_go(m_ulp_magnitude)), + m_a_has_leq_magnitude(std::fabs(m_a) <= std::fabs(m_b)) + { + assert( a <= b ); + } -} // end namespace Catch + template + result_type operator()( Generator& g ) { + WidthType steps = m_int_dist( g ); + if ( m_a_has_leq_magnitude ) { + if ( steps == m_floats_in_range ) { return m_a; } + auto b = m_b; + while (steps > m_max_steps_in_one_go) { + b -= m_max_steps_in_one_go * m_ulp_magnitude; + steps -= m_max_steps_in_one_go; + } + return b - steps * m_ulp_magnitude; + } else { + if ( steps == m_floats_in_range ) { return m_b; } + auto a = m_a; + while (steps > m_max_steps_in_one_go) { + a += m_max_steps_in_one_go * m_ulp_magnitude; + steps -= m_max_steps_in_one_go; + } + return a + steps * m_ulp_magnitude; + } + } -#endif // CATCH_RANDOM_NUMBER_GENERATOR_HPP_INCLUDED + result_type a() const { return m_a; } + result_type b() const { return m_b; } +}; + +} // end namespace Catch -#include +#endif // CATCH_UNIFORM_FLOATING_POINT_DISTRIBUTION_HPP_INCLUDED namespace Catch { namespace Generators { @@ -7729,7 +8547,7 @@ namespace Detail { template class RandomFloatingGenerator final : public IGenerator { Catch::SimplePcg32 m_rng; - std::uniform_real_distribution m_dist; + Catch::uniform_floating_point_distribution m_dist; Float m_current_number; public: RandomFloatingGenerator( Float a, Float b, std::uint32_t seed ): @@ -7747,10 +8565,27 @@ class RandomFloatingGenerator final : public IGenerator { } }; +template <> +class RandomFloatingGenerator final : public IGenerator { + // We still rely on for this specialization, but we don't + // want to drag it into the header. + struct PImpl; + Catch::Detail::unique_ptr m_pimpl; + long double m_current_number; + +public: + RandomFloatingGenerator( long double a, long double b, std::uint32_t seed ); + + long double const& get() const override { return m_current_number; } + bool next() override; + + ~RandomFloatingGenerator() override; // = default +}; + template class RandomIntegerGenerator final : public IGenerator { Catch::SimplePcg32 m_rng; - std::uniform_int_distribution m_dist; + Catch::uniform_integer_distribution m_dist; Integer m_current_number; public: RandomIntegerGenerator( Integer a, Integer b, std::uint32_t seed ): @@ -7771,14 +8606,6 @@ class RandomIntegerGenerator final : public IGenerator { template std::enable_if_t::value, GeneratorWrapper> random(T a, T b) { - static_assert( - !std::is_same::value && - !std::is_same::value && - !std::is_same::value && - !std::is_same::value && - !std::is_same::value && - !std::is_same::value, - "The requested type is not supported by the underlying random distributions from std" ); return GeneratorWrapper( Catch::Detail::make_unique>(a, b, Detail::getSeed()) ); @@ -7891,39 +8718,266 @@ GeneratorWrapper from_range(InputIterator from, InputSentinel to) { return GeneratorWrapper(Catch::Detail::make_unique>(from, to)); } -template -GeneratorWrapper from_range(Container const& cnt) { - return GeneratorWrapper(Catch::Detail::make_unique>(cnt.begin(), cnt.end())); +template +auto from_range(Container const& cnt) { + using std::begin; + using std::end; + return from_range( begin( cnt ), end( cnt ) ); } -} // namespace Generators -} // namespace Catch +} // namespace Generators +} // namespace Catch + + +#endif // CATCH_GENERATORS_RANGE_HPP_INCLUDED + +#endif // CATCH_GENERATORS_ALL_HPP_INCLUDED + + +/** \file + * This is a convenience header for Catch2's interfaces. It includes + * **all** of Catch2 headers related to interfaces. + * + * Generally the Catch2 users should use specific includes they need, + * but this header can be used instead for ease-of-experimentation, or + * just plain convenience, at the cost of somewhat increased compilation + * times. + * + * When a new header is added to either the `interfaces` folder, or to + * the corresponding internal subfolder, it should be added here. + */ + + +#ifndef CATCH_INTERFACES_ALL_HPP_INCLUDED +#define CATCH_INTERFACES_ALL_HPP_INCLUDED + + + +#ifndef CATCH_INTERFACES_REPORTER_HPP_INCLUDED +#define CATCH_INTERFACES_REPORTER_HPP_INCLUDED + + + +#ifndef CATCH_TEST_RUN_INFO_HPP_INCLUDED +#define CATCH_TEST_RUN_INFO_HPP_INCLUDED + + +namespace Catch { + + struct TestRunInfo { + constexpr TestRunInfo(StringRef _name) : name(_name) {} + StringRef name; + }; + +} // end namespace Catch + +#endif // CATCH_TEST_RUN_INFO_HPP_INCLUDED + +#include +#include +#include +#include + +namespace Catch { + + struct ReporterDescription; + struct ListenerDescription; + struct TagInfo; + struct TestCaseInfo; + class TestCaseHandle; + class IConfig; + class IStream; + enum class ColourMode : std::uint8_t; + + struct ReporterConfig { + ReporterConfig( IConfig const* _fullConfig, + Detail::unique_ptr _stream, + ColourMode colourMode, + std::map customOptions ); + + ReporterConfig( ReporterConfig&& ) = default; + ReporterConfig& operator=( ReporterConfig&& ) = default; + ~ReporterConfig(); // = default + + Detail::unique_ptr takeStream() &&; + IConfig const* fullConfig() const; + ColourMode colourMode() const; + std::map const& customOptions() const; + + private: + Detail::unique_ptr m_stream; + IConfig const* m_fullConfig; + ColourMode m_colourMode; + std::map m_customOptions; + }; + + struct AssertionStats { + AssertionStats( AssertionResult const& _assertionResult, + std::vector const& _infoMessages, + Totals const& _totals ); + + AssertionStats( AssertionStats const& ) = default; + AssertionStats( AssertionStats && ) = default; + AssertionStats& operator = ( AssertionStats const& ) = delete; + AssertionStats& operator = ( AssertionStats && ) = delete; + + AssertionResult assertionResult; + std::vector infoMessages; + Totals totals; + }; + + struct SectionStats { + SectionStats( SectionInfo&& _sectionInfo, + Counts const& _assertions, + double _durationInSeconds, + bool _missingAssertions ); + + SectionInfo sectionInfo; + Counts assertions; + double durationInSeconds; + bool missingAssertions; + }; + + struct TestCaseStats { + TestCaseStats( TestCaseInfo const& _testInfo, + Totals const& _totals, + std::string&& _stdOut, + std::string&& _stdErr, + bool _aborting ); + + TestCaseInfo const * testInfo; + Totals totals; + std::string stdOut; + std::string stdErr; + bool aborting; + }; + + struct TestRunStats { + TestRunStats( TestRunInfo const& _runInfo, + Totals const& _totals, + bool _aborting ); + + TestRunInfo runInfo; + Totals totals; + bool aborting; + }; + + //! By setting up its preferences, a reporter can modify Catch2's behaviour + //! in some regards, e.g. it can request Catch2 to capture writes to + //! stdout/stderr during test execution, and pass them to the reporter. + struct ReporterPreferences { + //! Catch2 should redirect writes to stdout and pass them to the + //! reporter + bool shouldRedirectStdOut = false; + //! Catch2 should call `Reporter::assertionEnded` even for passing + //! assertions + bool shouldReportAllAssertions = false; + }; + + /** + * The common base for all reporters and event listeners + * + * Implementing classes must also implement: + * + * //! User-friendly description of the reporter/listener type + * static std::string getDescription() + * + * Generally shouldn't be derived from by users of Catch2 directly, + * instead they should derive from one of the utility bases that + * derive from this class. + */ + class IEventListener { + protected: + //! Derived classes can set up their preferences here + ReporterPreferences m_preferences; + //! The test run's config as filled in from CLI and defaults + IConfig const* m_config; + + public: + IEventListener( IConfig const* config ): m_config( config ) {} + + virtual ~IEventListener(); // = default; + + // Implementing class must also provide the following static methods: + // static std::string getDescription(); + + ReporterPreferences const& getPreferences() const { + return m_preferences; + } + + //! Called when no test cases match provided test spec + virtual void noMatchingTestCases( StringRef unmatchedSpec ) = 0; + //! Called for all invalid test specs from the cli + virtual void reportInvalidTestSpec( StringRef invalidArgument ) = 0; + + /** + * Called once in a testing run before tests are started + * + * Not called if tests won't be run (e.g. only listing will happen) + */ + virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; + + //! Called _once_ for each TEST_CASE, no matter how many times it is entered + virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; + //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) + virtual void testCasePartialStarting( TestCaseInfo const& testInfo, uint64_t partNumber ) = 0; + //! Called when a `SECTION` is being entered. Not called for skipped sections + virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; + + //! Called when user-code is being probed before the actual benchmark runs + virtual void benchmarkPreparing( StringRef benchmarkName ) = 0; + //! Called after probe but before the user-code is being benchmarked + virtual void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) = 0; + //! Called with the benchmark results if benchmark successfully finishes + virtual void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) = 0; + //! Called if running the benchmarks fails for any reason + virtual void benchmarkFailed( StringRef benchmarkName ) = 0; + //! Called before assertion success/failure is evaluated + virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; -#endif // CATCH_GENERATORS_RANGE_HPP_INCLUDED + //! Called after assertion was fully evaluated + virtual void assertionEnded( AssertionStats const& assertionStats ) = 0; -#endif // CATCH_GENERATORS_ALL_HPP_INCLUDED + //! Called after a `SECTION` has finished running + virtual void sectionEnded( SectionStats const& sectionStats ) = 0; + //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) + virtual void testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber ) = 0; + //! Called _once_ for each TEST_CASE, no matter how many times it is entered + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; + /** + * Called once after all tests in a testing run are finished + * + * Not called if tests weren't run (e.g. only listings happened) + */ + virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; + /** + * Called with test cases that are skipped due to the test run aborting. + * NOT called for test cases that are explicitly skipped using the `SKIP` macro. + * + * Deprecated - will be removed in the next major release. + */ + virtual void skipTest( TestCaseInfo const& testInfo ) = 0; -/** \file - * This is a convenience header for Catch2's interfaces. It includes - * **all** of Catch2 headers related to interfaces. - * - * Generally the Catch2 users should use specific includes they need, - * but this header can be used instead for ease-of-experimentation, or - * just plain convenience, at the cost of somewhat increased compilation - * times. - * - * When a new header is added to either the `interfaces` folder, or to - * the corresponding internal subfolder, it should be added here. - */ + //! Called if a fatal error (signal/structured exception) occurred + virtual void fatalErrorEncountered( StringRef error ) = 0; + //! Writes out information about provided reporters using reporter-specific format + virtual void listReporters(std::vector const& descriptions) = 0; + //! Writes out the provided listeners descriptions using reporter-specific format + virtual void listListeners(std::vector const& descriptions) = 0; + //! Writes out information about provided tests using reporter-specific format + virtual void listTests(std::vector const& tests) = 0; + //! Writes out information about the provided tags using reporter-specific format + virtual void listTags(std::vector const& tags) = 0; + }; + using IEventListenerPtr = Detail::unique_ptr; -#ifndef CATCH_INTERFACES_ALL_HPP_INCLUDED -#define CATCH_INTERFACES_ALL_HPP_INCLUDED +} // end namespace Catch +#endif // CATCH_INTERFACES_REPORTER_HPP_INCLUDED #ifndef CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED @@ -7964,89 +9018,79 @@ namespace Catch { #endif // CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED -#ifndef CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED -#define CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED +#ifndef CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED +#define CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED + +#include +namespace Catch { + struct TagAlias; -#ifndef CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED -#define CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED + class ITagAliasRegistry { + public: + virtual ~ITagAliasRegistry(); // = default + // Nullptr if not present + virtual TagAlias const* find( std::string const& alias ) const = 0; + virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0; + static ITagAliasRegistry const& get(); + }; -namespace Catch { - namespace Detail { - //! Provides case-insensitive `op<` semantics when called - struct CaseInsensitiveLess { - bool operator()( StringRef lhs, - StringRef rhs ) const; - }; +} // end namespace Catch - //! Provides case-insensitive `op==` semantics when called - struct CaseInsensitiveEqualTo { - bool operator()( StringRef lhs, - StringRef rhs ) const; - }; +#endif // CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED - } // namespace Detail -} // namespace Catch -#endif // CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED +#ifndef CATCH_INTERFACES_TESTCASE_HPP_INCLUDED +#define CATCH_INTERFACES_TESTCASE_HPP_INCLUDED -#include #include -#include namespace Catch { + struct TestCaseInfo; + class TestCaseHandle; class IConfig; - class IEventListener; - using IEventListenerPtr = Detail::unique_ptr; - class IReporterFactory; - using IReporterFactoryPtr = Detail::unique_ptr; - struct ReporterConfig; - class EventListenerFactory; - - class IReporterRegistry { + class ITestCaseRegistry { public: - using FactoryMap = std::map; - using Listeners = std::vector>; - - virtual ~IReporterRegistry(); // = default - virtual IEventListenerPtr create( std::string const& name, ReporterConfig&& config ) const = 0; - virtual FactoryMap const& getFactories() const = 0; - virtual Listeners const& getListeners() const = 0; + virtual ~ITestCaseRegistry(); // = default + // TODO: this exists only for adding filenames to test cases -- let's expose this in a saner way later + virtual std::vector const& getAllInfos() const = 0; + virtual std::vector const& getAllTests() const = 0; + virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; }; -} // end namespace Catch - -#endif // CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED - +} -#ifndef CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED -#define CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED +#endif // CATCH_INTERFACES_TESTCASE_HPP_INCLUDED -#include +#endif // CATCH_INTERFACES_ALL_HPP_INCLUDED -namespace Catch { - struct TagAlias; +#ifndef CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED +#define CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED - class ITagAliasRegistry { - public: - virtual ~ITagAliasRegistry(); // = default - // Nullptr if not present - virtual TagAlias const* find( std::string const& alias ) const = 0; - virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0; - static ITagAliasRegistry const& get(); - }; +namespace Catch { + namespace Detail { + //! Provides case-insensitive `op<` semantics when called + struct CaseInsensitiveLess { + bool operator()( StringRef lhs, + StringRef rhs ) const; + }; -} // end namespace Catch + //! Provides case-insensitive `op==` semantics when called + struct CaseInsensitiveEqualTo { + bool operator()( StringRef lhs, + StringRef rhs ) const; + }; -#endif // CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED + } // namespace Detail +} // namespace Catch -#endif // CATCH_INTERFACES_ALL_HPP_INCLUDED +#endif // CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED @@ -8085,34 +9129,170 @@ namespace Catch { * in C++17, we want to use `std::uncaught_exceptions` if possible. */ -#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED -#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED +#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED +#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED + + +#if defined(_MSC_VER) +# if _MSC_VER >= 1900 // Visual Studio 2015 or newer +# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +# endif +#endif + + +#include + +#if defined(__cpp_lib_uncaught_exceptions) \ + && !defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) + +# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +#endif // __cpp_lib_uncaught_exceptions + + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) \ + && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) \ + && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) + +# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +#endif + + +#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED + + +#ifndef CATCH_CONSOLE_COLOUR_HPP_INCLUDED +#define CATCH_CONSOLE_COLOUR_HPP_INCLUDED + + +#include +#include + +namespace Catch { + + enum class ColourMode : std::uint8_t; + class IStream; + + struct Colour { + enum Code { + None = 0, + + White, + Red, + Green, + Blue, + Cyan, + Yellow, + Grey, + + Bright = 0x10, + + BrightRed = Bright | Red, + BrightGreen = Bright | Green, + LightGrey = Bright | Grey, + BrightWhite = Bright | White, + BrightYellow = Bright | Yellow, + + // By intention + FileName = LightGrey, + Warning = BrightYellow, + ResultError = BrightRed, + ResultSuccess = BrightGreen, + ResultExpectedFailure = Warning, + + Error = BrightRed, + Success = Green, + Skip = LightGrey, + + OriginalExpression = Cyan, + ReconstructedExpression = BrightYellow, + + SecondaryText = LightGrey, + Headers = White + }; + }; + + class ColourImpl { + protected: + //! The associated stream of this ColourImpl instance + IStream* m_stream; + public: + ColourImpl( IStream* stream ): m_stream( stream ) {} + + //! RAII wrapper around writing specific colour of text using specific + //! colour impl into a stream. + class ColourGuard { + ColourImpl const* m_colourImpl; + Colour::Code m_code; + bool m_engaged = false; + + public: + //! Does **not** engage the guard/start the colour + ColourGuard( Colour::Code code, + ColourImpl const* colour ); + + ColourGuard( ColourGuard const& rhs ) = delete; + ColourGuard& operator=( ColourGuard const& rhs ) = delete; + + ColourGuard( ColourGuard&& rhs ) noexcept; + ColourGuard& operator=( ColourGuard&& rhs ) noexcept; -#if defined(_MSC_VER) -# if _MSC_VER >= 1900 // Visual Studio 2015 or newer -# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS -# endif -#endif + //! Removes colour _if_ the guard was engaged + ~ColourGuard(); + /** + * Explicitly engages colour for given stream. + * + * The API based on operator<< should be preferred. + */ + ColourGuard& engage( std::ostream& stream ) &; + /** + * Explicitly engages colour for given stream. + * + * The API based on operator<< should be preferred. + */ + ColourGuard&& engage( std::ostream& stream ) &&; -#include + private: + //! Engages the guard and starts using colour + friend std::ostream& operator<<( std::ostream& lhs, + ColourGuard& guard ) { + guard.engageImpl( lhs ); + return lhs; + } + //! Engages the guard and starts using colour + friend std::ostream& operator<<( std::ostream& lhs, + ColourGuard&& guard) { + guard.engageImpl( lhs ); + return lhs; + } -#if defined(__cpp_lib_uncaught_exceptions) \ - && !defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) + void engageImpl( std::ostream& stream ); -# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS -#endif // __cpp_lib_uncaught_exceptions + }; + + virtual ~ColourImpl(); // = default + /** + * Creates a guard object for given colour and this colour impl + * + * **Important:** + * the guard starts disengaged, and has to be engaged explicitly. + */ + ColourGuard guardColour( Colour::Code colourCode ); + private: + virtual void use( Colour::Code colourCode ) const = 0; + }; -#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) \ - && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) \ - && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) + //! Provides ColourImpl based on global config and target compilation platform + Detail::unique_ptr makeColourImpl( ColourMode colourSelection, + IStream* stream ); -# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS -#endif + //! Checks if specific colour impl has been compiled into the binary + bool isColourImplAvailable( ColourMode colourSelection ); +} // end namespace Catch -#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED +#endif // CATCH_CONSOLE_COLOUR_HPP_INCLUDED #ifndef CATCH_CONSOLE_WIDTH_HPP_INCLUDED @@ -8220,7 +9400,10 @@ namespace Catch { #if defined(__i386__) || defined(__x86_64__) #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */ #elif defined(__aarch64__) - #define CATCH_TRAP() __asm__(".inst 0xd43e0000") + #define CATCH_TRAP() __asm__(".inst 0xd43e0000") + #elif defined(__POWERPC__) + #define CATCH_TRAP() __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \ + : : : "memory","r0","r3","r4" ) /* NOLINT */ #endif #elif defined(CATCH_PLATFORM_IPHONE) @@ -8327,7 +9510,7 @@ namespace Catch { std::vector> m_enumInfos; - EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector const& values) override; + EnumInfo const& registerEnum( StringRef enumName, StringRef allValueNames, std::vector const& values) override; }; std::vector parseEnums( StringRef enums ); @@ -8375,7 +9558,6 @@ namespace Catch { ~ExceptionTranslatorRegistry() override; void registerTranslator( Detail::unique_ptr&& translator ); std::string translateActiveException() const override; - std::string tryTranslators() const; private: ExceptionTranslators m_translators; @@ -8388,7 +9570,6 @@ namespace Catch { #ifndef CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED #define CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED - #include namespace Catch { @@ -8451,17 +9632,6 @@ namespace Catch { #define CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED - -#ifndef CATCH_POLYFILLS_HPP_INCLUDED -#define CATCH_POLYFILLS_HPP_INCLUDED - -namespace Catch { - bool isnan(float f); - bool isnan(double d); -} - -#endif // CATCH_POLYFILLS_HPP_INCLUDED - #include #include #include @@ -8474,6 +9644,11 @@ namespace Catch { uint32_t convertToBits(float f); uint64_t convertToBits(double d); + // Used when we know we want == comparison of two doubles + // to centralize warning suppression + bool directCompare( float lhs, float rhs ); + bool directCompare( double lhs, double rhs ); + } // end namespace Detail @@ -8555,6 +9730,157 @@ namespace Catch { #endif // CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED +#ifndef CATCH_GETENV_HPP_INCLUDED +#define CATCH_GETENV_HPP_INCLUDED + +namespace Catch { +namespace Detail { + + //! Wrapper over `std::getenv` that compiles on UWP (and always returns nullptr there) + char const* getEnv(char const* varName); + +} +} + +#endif // CATCH_GETENV_HPP_INCLUDED + + +#ifndef CATCH_IS_PERMUTATION_HPP_INCLUDED +#define CATCH_IS_PERMUTATION_HPP_INCLUDED + +#include +#include + +namespace Catch { + namespace Detail { + + template + constexpr + ForwardIter find_sentinel( ForwardIter start, + Sentinel sentinel, + T const& value, + Comparator cmp ) { + while ( start != sentinel ) { + if ( cmp( *start, value ) ) { break; } + ++start; + } + return start; + } + + template + constexpr + std::ptrdiff_t count_sentinel( ForwardIter start, + Sentinel sentinel, + T const& value, + Comparator cmp ) { + std::ptrdiff_t count = 0; + while ( start != sentinel ) { + if ( cmp( *start, value ) ) { ++count; } + ++start; + } + return count; + } + + template + constexpr + std::enable_if_t::value, + std::ptrdiff_t> + sentinel_distance( ForwardIter iter, const Sentinel sentinel ) { + std::ptrdiff_t dist = 0; + while ( iter != sentinel ) { + ++iter; + ++dist; + } + return dist; + } + + template + constexpr std::ptrdiff_t sentinel_distance( ForwardIter first, + ForwardIter last ) { + return std::distance( first, last ); + } + + template + constexpr bool check_element_counts( ForwardIter1 first_1, + const Sentinel1 end_1, + ForwardIter2 first_2, + const Sentinel2 end_2, + Comparator cmp ) { + auto cursor = first_1; + while ( cursor != end_1 ) { + if ( find_sentinel( first_1, cursor, *cursor, cmp ) == + cursor ) { + // we haven't checked this element yet + const auto count_in_range_2 = + count_sentinel( first_2, end_2, *cursor, cmp ); + // Not a single instance in 2nd range, so it cannot be a + // permutation of 1st range + if ( count_in_range_2 == 0 ) { return false; } + + const auto count_in_range_1 = + count_sentinel( cursor, end_1, *cursor, cmp ); + if ( count_in_range_1 != count_in_range_2 ) { + return false; + } + } + + ++cursor; + } + + return true; + } + + template + constexpr bool is_permutation( ForwardIter1 first_1, + const Sentinel1 end_1, + ForwardIter2 first_2, + const Sentinel2 end_2, + Comparator cmp ) { + // TODO: no optimization for stronger iterators, because we would also have to constrain on sentinel vs not sentinel types + // TODO: Comparator has to be "both sides", e.g. a == b => b == a + // This skips shared prefix of the two ranges + while (first_1 != end_1 && first_2 != end_2 && cmp(*first_1, *first_2)) { + ++first_1; + ++first_2; + } + + // We need to handle case where at least one of the ranges has no more elements + if (first_1 == end_1 || first_2 == end_2) { + return first_1 == end_1 && first_2 == end_2; + } + + // pair counting is n**2, so we pay linear walk to compare the sizes first + auto dist_1 = sentinel_distance( first_1, end_1 ); + auto dist_2 = sentinel_distance( first_2, end_2 ); + + if (dist_1 != dist_2) { return false; } + + // Since we do not try to handle stronger iterators pair (e.g. + // bidir) optimally, the only thing left to do is to check counts in + // the remaining ranges. + return check_element_counts( first_1, end_1, first_2, end_2, cmp ); + } + + } // namespace Detail +} // namespace Catch + +#endif // CATCH_IS_PERMUTATION_HPP_INCLUDED + + #ifndef CATCH_ISTREAM_HPP_INCLUDED #define CATCH_ISTREAM_HPP_INCLUDED @@ -8602,6 +9928,119 @@ namespace Catch { #endif // CATCH_STREAM_HPP_INCLUDED +#ifndef CATCH_JSONWRITER_HPP_INCLUDED +#define CATCH_JSONWRITER_HPP_INCLUDED + + +#include +#include + +namespace Catch { + class JsonObjectWriter; + class JsonArrayWriter; + + struct JsonUtils { + static void indent( std::ostream& os, std::uint64_t level ); + static void appendCommaNewline( std::ostream& os, + bool& should_comma, + std::uint64_t level ); + }; + + class JsonValueWriter { + public: + JsonValueWriter( std::ostream& os ); + JsonValueWriter( std::ostream& os, std::uint64_t indent_level ); + + JsonObjectWriter writeObject() &&; + JsonArrayWriter writeArray() &&; + + template + void write( T const& value ) && { + writeImpl( value, !std::is_arithmetic::value ); + } + void write( StringRef value ) &&; + void write( bool value ) &&; + + private: + void writeImpl( StringRef value, bool quote ); + + // Without this SFINAE, this overload is a better match + // for `std::string`, `char const*`, `char const[N]` args. + // While it would still work, it would cause code bloat + // and multiple iteration over the strings + template ::value>> + void writeImpl( T const& value, bool quote_value ) { + m_sstream << value; + writeImpl( m_sstream.str(), quote_value ); + } + + std::ostream& m_os; + std::stringstream m_sstream; + std::uint64_t m_indent_level; + }; + + class JsonObjectWriter { + public: + JsonObjectWriter( std::ostream& os ); + JsonObjectWriter( std::ostream& os, std::uint64_t indent_level ); + + JsonObjectWriter( JsonObjectWriter&& source ) noexcept; + JsonObjectWriter& operator=( JsonObjectWriter&& source ) = delete; + + ~JsonObjectWriter(); + + JsonValueWriter write( StringRef key ); + + private: + std::ostream& m_os; + std::uint64_t m_indent_level; + bool m_should_comma = false; + bool m_active = true; + }; + + class JsonArrayWriter { + public: + JsonArrayWriter( std::ostream& os ); + JsonArrayWriter( std::ostream& os, std::uint64_t indent_level ); + + JsonArrayWriter( JsonArrayWriter&& source ) noexcept; + JsonArrayWriter& operator=( JsonArrayWriter&& source ) = delete; + + ~JsonArrayWriter(); + + JsonObjectWriter writeObject(); + JsonArrayWriter writeArray(); + + template + JsonArrayWriter& write( T const& value ) { + return writeImpl( value ); + } + + JsonArrayWriter& write( bool value ); + + private: + template + JsonArrayWriter& writeImpl( T const& value ) { + JsonUtils::appendCommaNewline( + m_os, m_should_comma, m_indent_level + 1 ); + JsonValueWriter{ m_os }.write( value ); + + return *this; + } + + std::ostream& m_os; + std::uint64_t m_indent_level; + bool m_should_comma = false; + bool m_active = true; + }; + +} // namespace Catch + +#endif // CATCH_JSONWRITER_HPP_INCLUDED + + #ifndef CATCH_LEAK_DETECTOR_HPP_INCLUDED #define CATCH_LEAK_DETECTOR_HPP_INCLUDED @@ -8657,110 +10096,91 @@ namespace Catch { #define CATCH_OUTPUT_REDIRECT_HPP_INCLUDED -#include -#include +#include #include namespace Catch { - class RedirectedStream { - std::ostream& m_originalStream; - std::ostream& m_redirectionStream; - std::streambuf* m_prevBuf; - + class OutputRedirect { + bool m_redirectActive = false; + virtual void activateImpl() = 0; + virtual void deactivateImpl() = 0; public: - RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream ); - ~RedirectedStream(); - }; + enum Kind { + //! No redirect (noop implementation) + None, + //! Redirect std::cout/std::cerr/std::clog streams internally + Streams, + //! Redirect the stdout/stderr file descriptors into files + FileDescriptors, + }; - class RedirectedStdOut { - ReusableStringStream m_rss; - RedirectedStream m_cout; - public: - RedirectedStdOut(); - auto str() const -> std::string; - }; + virtual ~OutputRedirect(); // = default; - // StdErr has two constituent streams in C++, std::cerr and std::clog - // This means that we need to redirect 2 streams into 1 to keep proper - // order of writes - class RedirectedStdErr { - ReusableStringStream m_rss; - RedirectedStream m_cerr; - RedirectedStream m_clog; - public: - RedirectedStdErr(); - auto str() const -> std::string; + // TODO: Do we want to check that redirect is not active before retrieving the output? + virtual std::string getStdout() = 0; + virtual std::string getStderr() = 0; + virtual void clearBuffers() = 0; + bool isActive() const { return m_redirectActive; } + void activate() { + assert( !m_redirectActive && "redirect is already active" ); + activateImpl(); + m_redirectActive = true; + } + void deactivate() { + assert( m_redirectActive && "redirect is not active" ); + deactivateImpl(); + m_redirectActive = false; + } }; - class RedirectedStreams { - public: - RedirectedStreams(RedirectedStreams const&) = delete; - RedirectedStreams& operator=(RedirectedStreams const&) = delete; - RedirectedStreams(RedirectedStreams&&) = delete; - RedirectedStreams& operator=(RedirectedStreams&&) = delete; - - RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr); - ~RedirectedStreams(); - private: - std::string& m_redirectedCout; - std::string& m_redirectedCerr; - RedirectedStdOut m_redirectedStdOut; - RedirectedStdErr m_redirectedStdErr; - }; + bool isRedirectAvailable( OutputRedirect::Kind kind); + Detail::unique_ptr makeOutputRedirect( bool actual ); -#if defined(CATCH_CONFIG_NEW_CAPTURE) + class RedirectGuard { + OutputRedirect* m_redirect; + bool m_activate; + bool m_previouslyActive; + bool m_moved = false; - // Windows's implementation of std::tmpfile is terrible (it tries - // to create a file inside system folder, thus requiring elevated - // privileges for the binary), so we have to use tmpnam(_s) and - // create the file ourselves there. - class TempFile { public: - TempFile(TempFile const&) = delete; - TempFile& operator=(TempFile const&) = delete; - TempFile(TempFile&&) = delete; - TempFile& operator=(TempFile&&) = delete; - - TempFile(); - ~TempFile(); + RedirectGuard( bool activate, OutputRedirect& redirectImpl ); + ~RedirectGuard() noexcept( false ); - std::FILE* getFile(); - std::string getContents(); + RedirectGuard( RedirectGuard const& ) = delete; + RedirectGuard& operator=( RedirectGuard const& ) = delete; - private: - std::FILE* m_file = nullptr; - #if defined(_MSC_VER) - char m_buffer[L_tmpnam] = { 0 }; - #endif + // C++14 needs move-able guards to return them from functions + RedirectGuard( RedirectGuard&& rhs ) noexcept; + RedirectGuard& operator=( RedirectGuard&& rhs ) noexcept; }; + RedirectGuard scopedActivate( OutputRedirect& redirectImpl ); + RedirectGuard scopedDeactivate( OutputRedirect& redirectImpl ); - class OutputRedirect { - public: - OutputRedirect(OutputRedirect const&) = delete; - OutputRedirect& operator=(OutputRedirect const&) = delete; - OutputRedirect(OutputRedirect&&) = delete; - OutputRedirect& operator=(OutputRedirect&&) = delete; +} // end namespace Catch +#endif // CATCH_OUTPUT_REDIRECT_HPP_INCLUDED - OutputRedirect(std::string& stdout_dest, std::string& stderr_dest); - ~OutputRedirect(); - private: - int m_originalStdout = -1; - int m_originalStderr = -1; - TempFile m_stdoutFile; - TempFile m_stderrFile; - std::string& m_stdoutDest; - std::string& m_stderrDest; - }; +#ifndef CATCH_PARSE_NUMBERS_HPP_INCLUDED +#define CATCH_PARSE_NUMBERS_HPP_INCLUDED -#endif -} // end namespace Catch +#include -#endif // CATCH_OUTPUT_REDIRECT_HPP_INCLUDED +namespace Catch { + + /** + * Parses unsigned int from the input, using provided base + * + * Effectively a wrapper around std::stoul but with better error checking + * e.g. "-1" is rejected, instead of being parsed as UINT_MAX. + */ + Optional parseUInt(std::string const& input, int base = 10); +} + +#endif // CATCH_PARSE_NUMBERS_HPP_INCLUDED #ifndef CATCH_REPORTER_REGISTRY_HPP_INCLUDED @@ -8768,28 +10188,45 @@ namespace Catch { #include +#include +#include namespace Catch { - class ReporterRegistry : public IReporterRegistry { - public: + class IEventListener; + using IEventListenerPtr = Detail::unique_ptr; + class IReporterFactory; + using IReporterFactoryPtr = Detail::unique_ptr; + struct ReporterConfig; + class EventListenerFactory; + class ReporterRegistry { + struct ReporterRegistryImpl; + Detail::unique_ptr m_impl; + + public: ReporterRegistry(); - ~ReporterRegistry() override; // = default, out of line to allow fwd decl + ~ReporterRegistry(); // = default; - IEventListenerPtr create( std::string const& name, ReporterConfig&& config ) const override; + IEventListenerPtr create( std::string const& name, + ReporterConfig&& config ) const; - void registerReporter( std::string const& name, IReporterFactoryPtr factory ); - void registerListener( Detail::unique_ptr factory ); + void registerReporter( std::string const& name, + IReporterFactoryPtr factory ); - FactoryMap const& getFactories() const override; - Listeners const& getListeners() const override; + void + registerListener( Detail::unique_ptr factory ); - private: - FactoryMap m_factories; - Listeners m_listeners; + std::map const& + getFactories() const; + + std::vector> const& + getListeners() const; }; -} + +} // end namespace Catch #endif // CATCH_REPORTER_REGISTRY_HPP_INCLUDED @@ -8813,10 +10250,49 @@ namespace TestCaseTracking { std::string name; SourceLineInfo location; - NameAndLocation( std::string const& _name, SourceLineInfo const& _location ); + NameAndLocation( std::string&& _name, SourceLineInfo const& _location ); friend bool operator==(NameAndLocation const& lhs, NameAndLocation const& rhs) { - return lhs.name == rhs.name - && lhs.location == rhs.location; + // This is a very cheap check that should have a very high hit rate. + // If we get to SourceLineInfo::operator==, we will redo it, but the + // cost of repeating is trivial at that point (we will be paying + // multiple strcmp/memcmps at that point). + if ( lhs.location.line != rhs.location.line ) { return false; } + return lhs.name == rhs.name && lhs.location == rhs.location; + } + friend bool operator!=(NameAndLocation const& lhs, + NameAndLocation const& rhs) { + return !( lhs == rhs ); + } + }; + + /** + * This is a variant of `NameAndLocation` that does not own the name string + * + * This avoids extra allocations when trying to locate a tracker by its + * name and location, as long as we make sure that trackers only keep + * around the owning variant. + */ + struct NameAndLocationRef { + StringRef name; + SourceLineInfo location; + + constexpr NameAndLocationRef( StringRef name_, + SourceLineInfo location_ ): + name( name_ ), location( location_ ) {} + + friend bool operator==( NameAndLocation const& lhs, + NameAndLocationRef const& rhs ) { + // This is a very cheap check that should have a very high hit rate. + // If we get to SourceLineInfo::operator==, we will redo it, but the + // cost of repeating is trivial at that point (we will be paying + // multiple strcmp/memcmps at that point). + if ( lhs.location.line != rhs.location.line ) { return false; } + return StringRef( lhs.name ) == rhs.name && + lhs.location == rhs.location; + } + friend bool operator==( NameAndLocationRef const& lhs, + NameAndLocation const& rhs ) { + return rhs == lhs; } }; @@ -8844,8 +10320,8 @@ namespace TestCaseTracking { CycleState m_runState = NotStarted; public: - ITracker( NameAndLocation const& nameAndLoc, ITracker* parent ): - m_nameAndLocation( nameAndLoc ), + ITracker( NameAndLocation&& nameAndLoc, ITracker* parent ): + m_nameAndLocation( CATCH_MOVE(nameAndLoc) ), m_parent( parent ) {} @@ -8865,8 +10341,10 @@ namespace TestCaseTracking { //! Returns true if tracker run to completion (successfully or not) virtual bool isComplete() const = 0; - //! Returns true if tracker run to completion succesfully - bool isSuccessfullyCompleted() const; + //! Returns true if tracker run to completion successfully + bool isSuccessfullyCompleted() const { + return m_runState == CompletedSuccessfully; + } //! Returns true if tracker has started but hasn't been completed bool isOpen() const; //! Returns true iff tracker has started @@ -8884,7 +10362,7 @@ namespace TestCaseTracking { * * Returns nullptr if not found. */ - ITracker* findChild( NameAndLocation const& nameAndLocation ); + ITracker* findChild( NameAndLocationRef const& nameAndLocation ); //! Have any children been added? bool hasChildren() const { return !m_children.empty(); @@ -8925,13 +10403,15 @@ namespace TestCaseTracking { public: ITracker& startRun(); - void endRun(); - void startCycle(); + void startCycle() { + m_currentTracker = m_rootTracker.get(); + m_runState = Executing; + } void completeCycle(); bool completedCycle() const; - ITracker& currentTracker(); + ITracker& currentTracker() { return *m_currentTracker; } void setCurrentTracker( ITracker* tracker ); }; @@ -8941,7 +10421,7 @@ namespace TestCaseTracking { TrackerContext& m_ctx; public: - TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ); + TrackerBase( NameAndLocation&& nameAndLocation, TrackerContext& ctx, ITracker* parent ); bool isComplete() const override; @@ -8957,22 +10437,26 @@ namespace TestCaseTracking { class SectionTracker : public TrackerBase { std::vector m_filters; - std::string m_trimmed_name; + // Note that lifetime-wise we piggy back off the name stored in the `ITracker` parent`. + // Currently it allocates owns the name, so this is safe. If it is later refactored + // to not own the name, the name still has to outlive the `ITracker` parent, so + // this should still be safe. + StringRef m_trimmed_name; public: - SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ); + SectionTracker( NameAndLocation&& nameAndLocation, TrackerContext& ctx, ITracker* parent ); bool isSectionTracker() const override; bool isComplete() const override; - static SectionTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ); + static SectionTracker& acquire( TrackerContext& ctx, NameAndLocationRef const& nameAndLocation ); void tryOpen(); void addInitialFilters( std::vector const& filters ); void addNextFilters( std::vector const& filters ); //! Returns filters active in this tracker - std::vector const& getFilters() const; + std::vector const& getFilters() const { return m_filters; } //! Returns whitespace-trimmed name of the tracked section StringRef trimmedName() const; }; @@ -8991,13 +10475,15 @@ using TestCaseTracking::SectionTracker; namespace Catch { - class IMutableContext; class IGeneratorTracker; class IConfig; + class IEventListener; + using IEventListenerPtr = Detail::unique_ptr; + class OutputRedirect; /////////////////////////////////////////////////////////////////////////// - class RunContext : public IResultCapture { + class RunContext final : public IResultCapture { public: RunContext( RunContext const& ) = delete; @@ -9019,14 +10505,14 @@ namespace Catch { void handleMessage ( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef message, + std::string&& message, AssertionReaction& reaction ) override; void handleUnexpectedExceptionNotThrown ( AssertionInfo const& info, AssertionReaction& reaction ) override; void handleUnexpectedInflightException ( AssertionInfo const& info, - std::string const& message, + std::string&& message, AssertionReaction& reaction ) override; void handleIncomplete ( AssertionInfo const& info ) override; @@ -9035,12 +10521,22 @@ namespace Catch { ResultWas::OfType resultType, AssertionReaction &reaction ) override; - bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) override; + void notifyAssertionStarted( AssertionInfo const& info ) override; + bool sectionStarted( StringRef sectionName, + SourceLineInfo const& sectionLineInfo, + Counts& assertions ) override; + + void sectionEnded( SectionEndInfo&& endInfo ) override; + void sectionEndedEarly( SectionEndInfo&& endInfo ) override; - void sectionEnded( SectionEndInfo const& endInfo ) override; - void sectionEndedEarly( SectionEndInfo const& endInfo ) override; + IGeneratorTracker* + acquireGeneratorTracker( StringRef generatorName, + SourceLineInfo const& lineInfo ) override; + IGeneratorTracker* createGeneratorTracker( + StringRef generatorName, + SourceLineInfo lineInfo, + Generators::GeneratorBasePtr&& generator ) override; - auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override; void benchmarkPreparing( StringRef name ) override; void benchmarkStarting( BenchmarkInfo const& info ) override; @@ -9050,7 +10546,7 @@ namespace Catch { void pushScopedMessage( MessageInfo const& message ) override; void popScopedMessage( MessageInfo const& message ) override; - void emplaceUnscopedMessage( MessageBuilder const& builder ) override; + void emplaceUnscopedMessage( MessageBuilder&& builder ) override; std::string getCurrentTestName() const override; @@ -9070,13 +10566,13 @@ namespace Catch { private: - void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ); + void runCurrentTest(); void invokeActiveTestCase(); void resetAssertionInfo(); bool testForMissingAssertions( Counts& assertions ); - void assertionEnded( AssertionResult const& result ); + void assertionEnded( AssertionResult&& result ); void reportExpr ( AssertionInfo const &info, ResultWas::OfType resultType, @@ -9090,7 +10586,6 @@ namespace Catch { void handleUnfinishedSections(); TestRunInfo m_runInfo; - IMutableContext& m_context; TestCaseHandle const* m_activeTestCase = nullptr; ITracker* m_testCaseTracker = nullptr; Optional m_lastResult; @@ -9104,6 +10599,7 @@ namespace Catch { std::vector m_unfinishedSections; std::vector m_activeSections; TrackerContext m_trackerContext; + Detail::unique_ptr m_outputRedirect; FatalConditionHandler m_fatalConditionhandler; bool m_lastAssertionPassed = false; bool m_shouldReportUnexpected = true; @@ -9120,8 +10616,9 @@ namespace Catch { #ifndef CATCH_SHARDING_HPP_INCLUDED #define CATCH_SHARDING_HPP_INCLUDED - +#include #include +#include namespace Catch { @@ -9237,6 +10734,7 @@ namespace Catch { #define CATCH_STRING_MANIP_HPP_INCLUDED +#include #include #include #include @@ -9345,30 +10843,28 @@ namespace Catch { namespace Catch { - class TestCaseHandle; class IConfig; + class ITestInvoker; + class TestCaseHandle; class TestSpec; std::vector sortTests( IConfig const& config, std::vector const& unsortedTestCases ); bool isThrowSafe( TestCaseHandle const& testCase, IConfig const& config ); - bool matchTest( TestCaseHandle const& testCase, TestSpec const& testSpec, IConfig const& config ); - - void enforceNoDuplicateTestCases( std::vector const& functions ); std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); std::vector const& getAllTestCasesSorted( IConfig const& config ); class TestRegistry : public ITestCaseRegistry { public: - ~TestRegistry() override = default; - void registerTest( Detail::unique_ptr testInfo, Detail::unique_ptr testInvoker ); std::vector const& getAllInfos() const override; std::vector const& getAllTests() const override; std::vector const& getAllTestsSorted( IConfig const& config ) const override; + ~TestRegistry() override; // = default + private: std::vector> m_owned_test_infos; // Keeps a materialized vector for `getAllInfos`. @@ -9383,18 +10879,6 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////// - class TestInvokerAsFunction final : public ITestInvoker { - using TestType = void(*)(); - TestType m_testAsFunction; - public: - TestInvokerAsFunction(TestType testAsFunction) noexcept: - m_testAsFunction(testAsFunction) {} - - void invoke() const override; - }; - - /////////////////////////////////////////////////////////////////////////// - } // end namespace Catch @@ -9467,7 +10951,6 @@ namespace Catch { } }; - TestSpec parseTestSpec( std::string const& arg ); } // namespace Catch @@ -9481,6 +10964,7 @@ namespace Catch { #ifndef CATCH_TEXTFLOW_HPP_INCLUDED #define CATCH_TEXTFLOW_HPP_INCLUDED + #include #include #include @@ -9490,6 +10974,107 @@ namespace Catch { class Columns; + /** + * Abstraction for a string with ansi escape sequences that + * automatically skips over escapes when iterating. Only graphical + * escape sequences are considered. + * + * Internal representation: + * An escape sequence looks like \033[39;49m + * We need bidirectional iteration and the unbound length of escape + * sequences poses a problem for operator-- To make this work we'll + * replace the last `m` with a 0xff (this is a codepoint that won't have + * any utf-8 meaning). + */ + class AnsiSkippingString { + std::string m_string; + std::size_t m_size = 0; + + // perform 0xff replacement and calculate m_size + void preprocessString(); + + public: + class const_iterator; + using iterator = const_iterator; + // note: must be u-suffixed or this will cause a "truncation of + // constant value" warning on MSVC + static constexpr char sentinel = static_cast( 0xffu ); + + explicit AnsiSkippingString( std::string const& text ); + explicit AnsiSkippingString( std::string&& text ); + + const_iterator begin() const; + const_iterator end() const; + + size_t size() const { return m_size; } + + std::string substring( const_iterator begin, + const_iterator end ) const; + }; + + class AnsiSkippingString::const_iterator { + friend AnsiSkippingString; + struct EndTag {}; + + const std::string* m_string; + std::string::const_iterator m_it; + + explicit const_iterator( const std::string& string, EndTag ): + m_string( &string ), m_it( string.end() ) {} + + void tryParseAnsiEscapes(); + void advance(); + void unadvance(); + + public: + using difference_type = std::ptrdiff_t; + using value_type = char; + using pointer = value_type*; + using reference = value_type&; + using iterator_category = std::bidirectional_iterator_tag; + + explicit const_iterator( const std::string& string ): + m_string( &string ), m_it( string.begin() ) { + tryParseAnsiEscapes(); + } + + char operator*() const { return *m_it; } + + const_iterator& operator++() { + advance(); + return *this; + } + const_iterator operator++( int ) { + iterator prev( *this ); + operator++(); + return prev; + } + const_iterator& operator--() { + unadvance(); + return *this; + } + const_iterator operator--( int ) { + iterator prev( *this ); + operator--(); + return prev; + } + + bool operator==( const_iterator const& other ) const { + return m_it == other.m_it; + } + bool operator!=( const_iterator const& other ) const { + return !operator==( other ); + } + bool operator<=( const_iterator const& other ) const { + return m_it <= other.m_it; + } + + const_iterator oneBefore() const { + auto it = *this; + return --it; + } + }; + /** * Represents a column of text with specific width and indentation * @@ -9499,17 +11084,18 @@ namespace Catch { */ class Column { // String to be written out - std::string m_string; + AnsiSkippingString m_string; // Width of the column for linebreaking size_t m_width = CATCH_CONFIG_CONSOLE_WIDTH - 1; - // Indentation of other lines (including first if initial indent is unset) + // Indentation of other lines (including first if initial indent is + // unset) size_t m_indent = 0; // Indentation of the first line size_t m_initialIndent = std::string::npos; public: /** - * Iterates "lines" in `Column` and return sthem + * Iterates "lines" in `Column` and returns them */ class const_iterator { friend Column; @@ -9517,27 +11103,31 @@ namespace Catch { Column const& m_column; // Where does the current line start? - size_t m_lineStart = 0; + AnsiSkippingString::const_iterator m_lineStart; // How long should the current line be? - size_t m_lineLength = 0; + AnsiSkippingString::const_iterator m_lineEnd; // How far have we checked the string to iterate? - size_t m_parsedTo = 0; + AnsiSkippingString::const_iterator m_parsedTo; // Should a '-' be appended to the line? bool m_addHyphen = false; const_iterator( Column const& column, EndTag ): - m_column( column ), m_lineStart( m_column.m_string.size() ) {} + m_column( column ), + m_lineStart( m_column.m_string.end() ), + m_lineEnd( column.m_string.end() ), + m_parsedTo( column.m_string.end() ) {} // Calculates the length of the current line void calcLength(); - // Returns current indention width + // Returns current indentation width size_t indentSize() const; // Creates an indented and (optionally) suffixed string from // current iterator position, indentation and length. - std::string addIndentAndSuffix( size_t position, - size_t length ) const; + std::string addIndentAndSuffix( + AnsiSkippingString::const_iterator start, + AnsiSkippingString::const_iterator end ) const; public: using difference_type = std::ptrdiff_t; @@ -9554,7 +11144,8 @@ namespace Catch { const_iterator operator++( int ); bool operator==( const_iterator const& other ) const { - return m_lineStart == other.m_lineStart && &m_column == &other.m_column; + return m_lineStart == other.m_lineStart && + &m_column == &other.m_column; } bool operator!=( const_iterator const& other ) const { return !operator==( other ); @@ -9563,29 +11154,47 @@ namespace Catch { using iterator = const_iterator; explicit Column( std::string const& text ): m_string( text ) {} + explicit Column( std::string&& text ): + m_string( CATCH_MOVE( text ) ) {} - Column& width( size_t newWidth ) { + Column& width( size_t newWidth ) & { assert( newWidth > 0 ); m_width = newWidth; return *this; } - Column& indent( size_t newIndent ) { + Column&& width( size_t newWidth ) && { + assert( newWidth > 0 ); + m_width = newWidth; + return CATCH_MOVE( *this ); + } + Column& indent( size_t newIndent ) & { m_indent = newIndent; return *this; } - Column& initialIndent( size_t newIndent ) { + Column&& indent( size_t newIndent ) && { + m_indent = newIndent; + return CATCH_MOVE( *this ); + } + Column& initialIndent( size_t newIndent ) & { m_initialIndent = newIndent; return *this; } + Column&& initialIndent( size_t newIndent ) && { + m_initialIndent = newIndent; + return CATCH_MOVE( *this ); + } size_t width() const { return m_width; } const_iterator begin() const { return const_iterator( *this ); } - const_iterator end() const { return { *this, const_iterator::EndTag{} }; } + const_iterator end() const { + return { *this, const_iterator::EndTag{} }; + } friend std::ostream& operator<<( std::ostream& os, Column const& col ); - Columns operator+( Column const& other ); + friend Columns operator+( Column const& lhs, Column const& rhs ); + friend Columns operator+( Column&& lhs, Column&& rhs ); }; //! Creates a column that serves as an empty space of specific width @@ -9629,8 +11238,10 @@ namespace Catch { iterator begin() const { return iterator( *this ); } iterator end() const { return { *this, iterator::EndTag() }; } - Columns& operator+=( Column const& col ); - Columns operator+( Column const& col ); + friend Columns& operator+=( Columns& lhs, Column const& rhs ); + friend Columns& operator+=( Columns& lhs, Column&& rhs ); + friend Columns operator+( Columns const& lhs, Column const& rhs ); + friend Columns operator+( Columns&& lhs, Column&& rhs ); friend std::ostream& operator<<( std::ostream& os, Columns const& cols ); @@ -9673,48 +11284,31 @@ namespace Catch { #endif // CATCH_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED -#ifndef CATCH_WINDOWS_H_PROXY_HPP_INCLUDED -#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED - - -#if defined(CATCH_PLATFORM_WINDOWS) - -// We might end up with the define made globally through the compiler, -// and we don't want to trigger warnings for this -#if !defined(NOMINMAX) -# define NOMINMAX -#endif -#if !defined(WIN32_LEAN_AND_MEAN) -# define WIN32_LEAN_AND_MEAN -#endif - -#ifdef __AFXDLL -#include -#else -#include -#endif - -#endif // defined(CATCH_PLATFORM_WINDOWS) - -#endif // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED - - #ifndef CATCH_XMLWRITER_HPP_INCLUDED #define CATCH_XMLWRITER_HPP_INCLUDED #include #include +#include namespace Catch { - enum class XmlFormatting { + enum class XmlFormatting : std::uint8_t { None = 0x00, Indent = 0x01, Newline = 0x02, }; - XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs); - XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs); + constexpr XmlFormatting operator|( XmlFormatting lhs, XmlFormatting rhs ) { + return static_cast( static_cast( lhs ) | + static_cast( rhs ) ); + } + + constexpr XmlFormatting operator&( XmlFormatting lhs, XmlFormatting rhs ) { + return static_cast( static_cast( lhs ) & + static_cast( rhs ) ); + } + /** * Helper for XML-encoding text (escaping angle brackets, quotes, etc) @@ -9726,7 +11320,9 @@ namespace Catch { public: enum ForWhat { ForTextNodes, ForAttributes }; - XmlEncode( StringRef str, ForWhat forWhat = ForTextNodes ); + constexpr XmlEncode( StringRef str, ForWhat forWhat = ForTextNodes ): + m_str( str ), m_forWhat( forWhat ) {} + void encodeTo( std::ostream& os ) const; @@ -9870,19 +11466,29 @@ namespace Catch { #define CATCH_MATCHERS_IMPL_HPP_INCLUDED +#include + namespace Catch { +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wsign-compare" +# pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#elif defined __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsign-compare" +# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif + template class MatchExpr : public ITransientExpression { ArgT && m_arg; MatcherT const& m_matcher; - StringRef m_matcherString; public: - MatchExpr( ArgT && arg, MatcherT const& matcher, StringRef matcherString ) + constexpr MatchExpr( ArgT && arg, MatcherT const& matcher ) : ITransientExpression{ true, matcher.match( arg ) }, // not forwarding arg here on purpose m_arg( CATCH_FORWARD(arg) ), - m_matcher( matcher ), - m_matcherString( matcherString ) + m_matcher( matcher ) {} void streamReconstructedExpression( std::ostream& os ) const override { @@ -9892,6 +11498,13 @@ namespace Catch { } }; +#ifdef __clang__ +# pragma clang diagnostic pop +#elif defined __GNUC__ +# pragma GCC diagnostic pop +#endif + + namespace Matchers { template class MatcherBase; @@ -9899,11 +11512,12 @@ namespace Catch { using StringMatcher = Matchers::MatcherBase; - void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ); + void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher ); template - auto makeMatchExpr( ArgT && arg, MatcherT const& matcher, StringRef matcherString ) -> MatchExpr { - return MatchExpr( CATCH_FORWARD(arg), matcher, matcherString ); + constexpr MatchExpr + makeMatchExpr( ArgT&& arg, MatcherT const& matcher ) { + return MatchExpr( CATCH_FORWARD(arg), matcher ); } } // namespace Catch @@ -9914,9 +11528,9 @@ namespace Catch { do { \ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \ INTERNAL_CATCH_TRY { \ - catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher, #matcher##_catch_sr ) ); \ + catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher ) ); \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -9926,18 +11540,21 @@ namespace Catch { Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \ if( catchAssertionHandler.allowThrows() ) \ try { \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \ static_cast(__VA_ARGS__ ); \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } \ catch( exceptionType const& ex ) { \ - catchAssertionHandler.handleExpr( Catch::makeMatchExpr( ex, matcher, #matcher##_catch_sr ) ); \ + catchAssertionHandler.handleExpr( Catch::makeMatchExpr( ex, matcher ) ); \ } \ catch( ... ) { \ catchAssertionHandler.handleUnexpectedInflightException(); \ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -10190,7 +11807,7 @@ namespace Matchers { MatcherGenericBase() = default; ~MatcherGenericBase() override; // = default; - MatcherGenericBase(MatcherGenericBase&) = default; + MatcherGenericBase(MatcherGenericBase const&) = default; MatcherGenericBase(MatcherGenericBase&&) = default; MatcherGenericBase& operator=(MatcherGenericBase const&) = delete; @@ -10222,20 +11839,6 @@ namespace Matchers { return arr; } -#if defined( __cpp_lib_logical_traits ) && __cpp_lib_logical_traits >= 201510 - - using std::conjunction; - -#else // __cpp_lib_logical_traits - - template - struct conjunction : std::true_type {}; - - template - struct conjunction : std::integral_constant::value> {}; - -#endif // __cpp_lib_logical_traits - template using is_generic_matcher = std::is_base_of< Catch::Matchers::MatcherGenericBase, @@ -10243,7 +11846,7 @@ namespace Matchers { >; template - using are_generic_matchers = conjunction...>; + using are_generic_matchers = Catch::Detail::conjunction...>; template using is_matcher = std::is_base_of< @@ -10578,13 +12181,11 @@ namespace Catch { } template - bool match(RangeLike&& rng) const { - using std::begin; using std::end; - - return end(rng) != std::find_if(begin(rng), end(rng), - [&](auto const& elem) { - return m_eq(elem, m_desired); - }); + bool match( RangeLike&& rng ) const { + for ( auto&& elem : rng ) { + if ( m_eq( elem, m_desired ) ) { return true; } + } + return false; } }; @@ -10636,7 +12237,7 @@ namespace Catch { /** * Creates a matcher that checks whether a range contains a specific element. * - * Uses `eq` to do the comparisons + * Uses `eq` to do the comparisons, the element is provided on the rhs */ template ContainsElementMatcher Contains(T&& elem, Equality&& eq) { @@ -10672,6 +12273,32 @@ class ExceptionMessageMatcher final : public MatcherBase { //! Creates a matcher that checks whether a std derived exception has the provided message ExceptionMessageMatcher Message(std::string const& message); +template +class ExceptionMessageMatchesMatcher final + : public MatcherBase { + StringMatcherType m_matcher; + +public: + ExceptionMessageMatchesMatcher( StringMatcherType matcher ): + m_matcher( CATCH_MOVE( matcher ) ) {} + + bool match( std::exception const& ex ) const override { + return m_matcher.match( ex.what() ); + } + + std::string describe() const override { + return " matches \"" + m_matcher.describe() + '"'; + } +}; + +//! Creates a matcher that checks whether a message from an std derived +//! exception matches a provided matcher +template +ExceptionMessageMatchesMatcher +MessageMatches( StringMatcherType&& matcher ) { + return { CATCH_FORWARD( matcher ) }; +} + } // namespace Matchers } // namespace Catch @@ -10699,6 +12326,11 @@ namespace Matchers { double m_margin; }; + //! Creates a matcher that accepts numbers within certain range of target + WithinAbsMatcher WithinAbs( double target, double margin ); + + + class WithinUlpsMatcher final : public MatcherBase { public: WithinUlpsMatcher( double target, @@ -10712,6 +12344,13 @@ namespace Matchers { Detail::FloatingPointKind m_type; }; + //! Creates a matcher that accepts doubles within certain ULP range of target + WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff); + //! Creates a matcher that accepts floats within certain ULP range of target + WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff); + + + // Given IEEE-754 format for floats and doubles, we can assume // that float -> double promotion is lossless. Given this, we can // assume that if we do the standard relative comparison of @@ -10728,13 +12367,6 @@ namespace Matchers { double m_epsilon; }; - //! Creates a matcher that accepts doubles within certain ULP range of target - WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff); - //! Creates a matcher that accepts floats within certain ULP range of target - WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff); - //! Creates a matcher that accepts numbers within certain range of target - WithinAbsMatcher WithinAbs(double target, double margin); - //! Creates a matcher that accepts doubles within certain relative range of target WithinRelMatcher WithinRel(double target, double eps); //! Creates a matcher that accepts doubles within 100*DBL_EPS relative range of target @@ -10744,6 +12376,17 @@ namespace Matchers { //! Creates a matcher that accepts floats within 100*FLT_EPS relative range of target WithinRelMatcher WithinRel(float target); + + + class IsNaNMatcher final : public MatcherBase { + public: + IsNaNMatcher() = default; + bool match( double const& matchee ) const override; + std::string describe() const override; + }; + + IsNaNMatcher IsNaN(); + } // namespace Matchers } // namespace Catch @@ -10959,6 +12602,151 @@ namespace Catch { #endif // CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED +#ifndef CATCH_MATCHERS_RANGE_EQUALS_HPP_INCLUDED +#define CATCH_MATCHERS_RANGE_EQUALS_HPP_INCLUDED + + +#include +#include + +namespace Catch { + namespace Matchers { + + /** + * Matcher for checking that an element contains the same + * elements in the same order + */ + template + class RangeEqualsMatcher final : public MatcherGenericBase { + TargetRangeLike m_desired; + Equality m_predicate; + + public: + template + constexpr + RangeEqualsMatcher( TargetRangeLike2&& range, + Equality2&& predicate ): + m_desired( CATCH_FORWARD( range ) ), + m_predicate( CATCH_FORWARD( predicate ) ) {} + + template + constexpr + bool match( RangeLike&& rng ) const { + auto rng_start = begin( rng ); + const auto rng_end = end( rng ); + auto target_start = begin( m_desired ); + const auto target_end = end( m_desired ); + + while (rng_start != rng_end && target_start != target_end) { + if (!m_predicate(*rng_start, *target_start)) { + return false; + } + ++rng_start; + ++target_start; + } + return rng_start == rng_end && target_start == target_end; + } + + std::string describe() const override { + return "elements are " + Catch::Detail::stringify( m_desired ); + } + }; + + /** + * Matcher for checking that an element contains the same + * elements (but not necessarily in the same order) + */ + template + class UnorderedRangeEqualsMatcher final : public MatcherGenericBase { + TargetRangeLike m_desired; + Equality m_predicate; + + public: + template + constexpr + UnorderedRangeEqualsMatcher( TargetRangeLike2&& range, + Equality2&& predicate ): + m_desired( CATCH_FORWARD( range ) ), + m_predicate( CATCH_FORWARD( predicate ) ) {} + + template + constexpr + bool match( RangeLike&& rng ) const { + using std::begin; + using std::end; + return Catch::Detail::is_permutation( begin( m_desired ), + end( m_desired ), + begin( rng ), + end( rng ), + m_predicate ); + } + + std::string describe() const override { + return "unordered elements are " + + ::Catch::Detail::stringify( m_desired ); + } + }; + + /** + * Creates a matcher that checks if all elements in a range are equal + * to all elements in another range. + * + * Uses `std::equal_to` to do the comparison + */ + template + constexpr + std::enable_if_t::value, + RangeEqualsMatcher>> + RangeEquals( RangeLike&& range ) { + return { CATCH_FORWARD( range ), std::equal_to<>{} }; + } + + /** + * Creates a matcher that checks if all elements in a range are equal + * to all elements in another range. + * + * Uses to provided predicate `predicate` to do the comparisons + */ + template + constexpr + RangeEqualsMatcher + RangeEquals( RangeLike&& range, Equality&& predicate ) { + return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; + } + + /** + * Creates a matcher that checks if all elements in a range are equal + * to all elements in another range, in some permutation + * + * Uses `std::equal_to` to do the comparison + */ + template + constexpr + std::enable_if_t< + !Detail::is_matcher::value, + UnorderedRangeEqualsMatcher>> + UnorderedRangeEquals( RangeLike&& range ) { + return { CATCH_FORWARD( range ), std::equal_to<>{} }; + } + + /** + * Creates a matcher that checks if all elements in a range are equal + * to all elements in another range, in some permutation. + * + * Uses to provided predicate `predicate` to do the comparisons + */ + template + constexpr + UnorderedRangeEqualsMatcher + UnorderedRangeEquals( RangeLike&& range, Equality&& predicate ) { + return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; + } + } // namespace Matchers +} // namespace Catch + +#endif // CATCH_MATCHERS_RANGE_EQUALS_HPP_INCLUDED + + #ifndef CATCH_MATCHERS_STRING_HPP_INCLUDED #define CATCH_MATCHERS_STRING_HPP_INCLUDED @@ -11114,11 +12902,10 @@ namespace Matchers { // - a more general approach would be via a compare template that defaults // to using !=. but could be specialised for, e.g. std::vector etc // - then just call that directly - if (m_comparator.size() != v.size()) - return false; - for (std::size_t i = 0; i < v.size(); ++i) - if (m_comparator[i] != v[i]) - return false; + if ( m_comparator.size() != v.size() ) { return false; } + for ( std::size_t i = 0; i < v.size(); ++i ) { + if ( !( m_comparator[i] == v[i] ) ) { return false; } + } return true; } std::string describe() const override { @@ -11453,7 +13240,6 @@ namespace Catch { namespace Catch { // Fwd decls - struct SummaryColumn; class TablePrinter; class ConsoleReporter final : public StreamingReporterBase { @@ -11497,12 +13283,7 @@ namespace Catch { // subsequent lines void printHeaderString(std::string const& _string, std::size_t indent = 0); - - void printTotals(Totals const& totals); - void printSummaryRow(StringRef label, std::vector const& cols, std::size_t row); - void printTotalsDivider(Totals const& totals); - void printSummaryDivider(); bool m_headerPrinted = false; bool m_testRunInfoPrinted = false; @@ -11628,7 +13409,7 @@ namespace Catch { void skipTest(TestCaseInfo const&) override {} protected: - //! Should the cumulative base store the assertion expansion for succesful assertions? + //! Should the cumulative base store the assertion expansion for successful assertions? bool m_shouldStoreSuccesfulAssertions = true; //! Should the cumulative base store the assertion expansion for failed assertions? bool m_shouldStoreFailedAssertions = true; @@ -11782,11 +13563,107 @@ namespace Catch { bool isFiltered, Verbosity verbosity ); + /** + * Prints test run totals to the provided stream in user-friendly format + * + * Used by the console and compact reporters. + */ + void printTestRunTotals( std::ostream& stream, + ColourImpl& streamColour, + Totals const& totals ); + } // end namespace Catch #endif // CATCH_REPORTER_HELPERS_HPP_INCLUDED + +#ifndef CATCH_REPORTER_JSON_HPP_INCLUDED +#define CATCH_REPORTER_JSON_HPP_INCLUDED + + +#include + +namespace Catch { + class JsonReporter : public StreamingReporterBase { + public: + JsonReporter( ReporterConfig&& config ); + + ~JsonReporter() override; + + static std::string getDescription(); + + public: // StreamingReporterBase + void testRunStarting( TestRunInfo const& runInfo ) override; + void testRunEnded( TestRunStats const& runStats ) override; + + void testCaseStarting( TestCaseInfo const& tcInfo ) override; + void testCaseEnded( TestCaseStats const& tcStats ) override; + + void testCasePartialStarting( TestCaseInfo const& tcInfo, + uint64_t index ) override; + void testCasePartialEnded( TestCaseStats const& tcStats, + uint64_t index ) override; + + void sectionStarting( SectionInfo const& sectionInfo ) override; + void sectionEnded( SectionStats const& sectionStats ) override; + + void assertionStarting( AssertionInfo const& assertionInfo ) override; + void assertionEnded( AssertionStats const& assertionStats ) override; + + //void testRunEndedCumulative() override; + + void benchmarkPreparing( StringRef name ) override; + void benchmarkStarting( BenchmarkInfo const& ) override; + void benchmarkEnded( BenchmarkStats<> const& ) override; + void benchmarkFailed( StringRef error ) override; + + void listReporters( + std::vector const& descriptions ) override; + void listListeners( + std::vector const& descriptions ) override; + void listTests( std::vector const& tests ) override; + void listTags( std::vector const& tags ) override; + + private: + Timer m_testCaseTimer; + enum class Writer { + Object, + Array + }; + + JsonArrayWriter& startArray(); + JsonArrayWriter& startArray( StringRef key ); + + JsonObjectWriter& startObject(); + JsonObjectWriter& startObject( StringRef key ); + + void endObject(); + void endArray(); + + bool isInside( Writer writer ); + + void startListing(); + void endListing(); + + // Invariant: + // When m_writers is not empty and its top element is + // - Writer::Object, then m_objectWriters is not be empty + // - Writer::Array, then m_arrayWriters shall not be empty + std::stack m_objectWriters{}; + std::stack m_arrayWriters{}; + std::stack m_writers{}; + + bool m_startedListing = false; + + // std::size_t m_sectionDepth = 0; + // std::size_t m_sectionStarted = 0; + }; +} // namespace Catch + +#endif // CATCH_REPORTER_JSON_HPP_INCLUDED + + #ifndef CATCH_REPORTER_JUNIT_HPP_INCLUDED #define CATCH_REPORTER_JUNIT_HPP_INCLUDED @@ -11798,8 +13675,6 @@ namespace Catch { public: JunitReporter(ReporterConfig&& _config); - ~JunitReporter() override = default; - static std::string getDescription(); void testRunStarting(TestRunInfo const& runInfo) override; @@ -11884,7 +13759,7 @@ namespace Catch { void assertionEnded( AssertionStats const& assertionStats ) override; void sectionEnded( SectionStats const& sectionStats ) override; - void testCasePartialEnded(TestCaseStats const& testInfo, uint64_t partNumber) override; + void testCasePartialEnded(TestCaseStats const& testStats, uint64_t partNumber) override; void testCaseEnded( TestCaseStats const& testCaseStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; @@ -11926,7 +13801,8 @@ namespace Catch { //! independent on the reporter's concrete type void registerReporterImpl( std::string const& name, IReporterFactoryPtr reporterPtr ); - + //! Actually registers the factory, independent on listener's concrete type + void registerListenerImpl( Detail::unique_ptr listenerFactory ); } // namespace Detail class IEventListener; @@ -11987,7 +13863,7 @@ namespace Catch { public: ListenerRegistrar(StringRef listenerName) { - getMutableRegistryHub().registerListener( Detail::make_unique(listenerName) ); + registerListenerImpl( Detail::make_unique(listenerName) ); } }; } @@ -12008,7 +13884,7 @@ namespace Catch { CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace { \ Catch::ListenerRegistrar INTERNAL_CATCH_UNIQUE_NAME( \ - catch_internal_RegistrarFor )( #listenerType ); \ + catch_internal_RegistrarFor )( #listenerType##_catch_sr ); \ } \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION @@ -12035,12 +13911,10 @@ namespace Catch { : CumulativeReporterBase(CATCH_MOVE(config)) , xml(m_stream) { m_preferences.shouldRedirectStdOut = true; - m_preferences.shouldReportAllAssertions = true; + m_preferences.shouldReportAllAssertions = false; m_shouldStoreSuccesfulAssertions = false; } - ~SonarQubeReporter() override = default; - static std::string getDescription() { using namespace std::string_literals; return "Reports test results in the Generic Test Data SonarQube XML format"s; @@ -12053,9 +13927,9 @@ namespace Catch { xml.endElement(); } - void writeRun( TestRunNode const& groupNode ); + void writeRun( TestRunNode const& runNode ); - void writeTestFile(std::string const& filename, std::vector const& testCaseNodes); + void writeTestFile(StringRef filename, std::vector const& testCaseNodes); void writeTestCase(TestCaseNode const& testCaseNode); @@ -12087,7 +13961,6 @@ namespace Catch { StreamingReporterBase( CATCH_MOVE(config) ) { m_preferences.shouldReportAllAssertions = true; } - ~TAPReporter() override = default; static std::string getDescription() { using namespace std::string_literals; @@ -12139,8 +14012,8 @@ namespace Catch { return "Reports test results as TeamCity service messages"s; } - void testRunStarting( TestRunInfo const& groupInfo ) override; - void testRunEnded( TestRunStats const& testGroupStats ) override; + void testRunStarting( TestRunInfo const& runInfo ) override; + void testRunEnded( TestRunStats const& runStats ) override; void assertionEnded(AssertionStats const& assertionStats) override; diff --git a/bx/LICENSE b/bx/LICENSE index f8393b90..0edd62e9 100644 --- a/bx/LICENSE +++ b/bx/LICENSE @@ -1,4 +1,4 @@ -Copyright 2010-2023 Branimir Karadzic +Copyright 2010-2024 Branimir Karadzic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/bx/README.md b/bx/README.md index a1581fe0..aca5632c 100644 --- a/bx/README.md +++ b/bx/README.md @@ -3,9 +3,16 @@ bx Base X-platform library. +[![GitHub Actions](https://github.com/bkaradzic/bx/actions/workflows/main.yml/badge.svg)](https://github.com/bkaradzic/bx/actions) [![License](https://img.shields.io/badge/license-BSD--2%20clause-blue.svg)](https://bkaradzic.github.io/bgfx/license.html) [![Join the chat at https://discord.gg/9eMbv7J](https://img.shields.io/discord/712512073522872352?color=%237289DA&label=bx&logo=discord&logoColor=white)](https://discord.gg/9eMbv7J) +Goals: + + - Provide OS/runtime/compiler independent core functionality to be able to + write cross-platform applications. + - Compile without C Runtime (CRT) and without C++ Standard Library (STL). + Contact ------- @@ -21,7 +28,7 @@ https://github.com/bkaradzic/bx - Copyright 2010-2023 Branimir Karadzic + Copyright 2010-2024 Branimir Karadzic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/bx/include/bx/allocator.h b/bx/include/bx/allocator.h index 77a8a11c..6e501146 100644 --- a/bx/include/bx/allocator.h +++ b/bx/include/bx/allocator.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/bounds.h b/bx/include/bx/bounds.h index bc0c20b7..47d5ff29 100644 --- a/bx/include/bx/bounds.h +++ b/bx/include/bx/bounds.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ diff --git a/bx/include/bx/bx.h b/bx/include/bx/bx.h index c309bcec..0d304660 100644 --- a/bx/include/bx/bx.h +++ b/bx/include/bx/bx.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -8,9 +8,9 @@ #include // alloca #include // va_list +#include // ptrdiff_t #include // uint32_t #include // size_t -#include // ptrdiff_t #include "platform.h" #include "config.h" @@ -113,6 +113,34 @@ namespace bx /// Unknown source code location. static constexpr LocationFull kUnknownLocationFull("Unknown?", "Unknown?", 0); + /// Assert handler function. + /// + /// @param[in] _location Source code location where function is called. + /// @param[in] _format Printf style format. + /// @param[in] _argList Arguments for `_format` specification. + /// + /// @returns True if assert should stop code execution, otherwise returns false. + /// + typedef bool (*AssertHandlerFn)(const Location& _location, const char* _format, va_list _argList); + + /// Set assert handler function. + /// + /// @param[in] _assertHandlerFn Pointer to AssertHandlerFn function. + /// + /// @remarks It can be set only once. This is usually done on application startup. + /// + void setAssertHandler(AssertHandlerFn _assertHandlerFn); + + /// Assert function calls AssertHandlerFn. + /// + /// @param[in] _location Source code location where function is called. + /// @param[in] _format Printf style format. + /// @param[in] ... Arguments for `_format` specification. + /// + /// @returns True if assert should stop code execution, otherwise returns false. + /// + bool assertFunction(const Location& _location, const char* _format, ...); + /// Arithmetic type `Ty` limits. template()> struct LimitsT; @@ -188,6 +216,18 @@ namespace bx template constexpr bool isPowerOf2(Ty _a); + /// Returns true if it's evaluated as constexpr. + constexpr bool isConstantEvaluated(); + + /// Returns a value of type `Ty` by reinterpreting the object representation of `FromT`. + template + constexpr Ty bitCast(const FromT& _from); + + /// Performs `static_cast` of value `_from`, and in debug build runtime verifies/asserts + /// that the value didn't change. + template + Ty narrowCast(const FromT& _from, Location _location = Location::current() ); + /// Copy memory block. /// /// @param _dst Destination pointer. diff --git a/bx/include/bx/commandline.h b/bx/include/bx/commandline.h index f1a2651a..84190338 100644 --- a/bx/include/bx/commandline.h +++ b/bx/include/bx/commandline.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/config.h b/bx/include/bx/config.h index 5d688778..e1912d22 100644 --- a/bx/include/bx/config.h +++ b/bx/include/bx/config.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/constants.h b/bx/include/bx/constants.h index ff20b79b..86bc1c68 100644 --- a/bx/include/bx/constants.h +++ b/bx/include/bx/constants.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -20,9 +20,12 @@ namespace bx /// The ratio of a circle's circumference to its radius. Pi multiplied by 2, or Tau. pi*2 constexpr float kPi2 = 6.2831853071795864769252867665590f; - /// The reciprocal of pi. 1/pi + /// The reciprocal of kPi. 1/kPi constexpr float kInvPi = 1.0f/kPi; + /// The reciprocal of kPi2. 1/kPi2 + constexpr float kInvPi2 = 1.0f/kPi2; + /// Pi divided by two. pi/2 constexpr float kPiHalf = 1.5707963267948966192313216916398f; @@ -39,10 +42,7 @@ namespace bx constexpr float kInvLogNat2 = 1.4426950408889634073599246810019f; /// The natural logarithm of the 2. ln(2) - constexpr float kLogNat2Hi = 0.6931471805599453094172321214582f; - - /// - constexpr float kLogNat2Lo = 1.90821492927058770002e-10f; + constexpr float kLogNat2 = 0.6931471805599453094172321214582f; /// The base of natural logarithms. e(1) constexpr float kE = 2.7182818284590452353602874713527f; @@ -80,8 +80,8 @@ namespace bx /// Maximum representable floating-point number. constexpr float kFloatLargest = 3.402823466e+38f; - /// - extern const float kFloatInfinity; + /// Floating-point infinity. +// constexpr float kFloatInfinity; /// constexpr uint8_t kDoubleSignNumBits = 1; @@ -101,8 +101,8 @@ namespace bx /// Largest representable double-precision floating-point number. constexpr double kDoubleLargest = 1.7976931348623158e+308; - /// - extern const double kDoubleInfinity; + // Double-precision floating-point infinity. +// constexpr double kDoubleInfinity; } // namespace bx diff --git a/bx/include/bx/cpu.h b/bx/include/bx/cpu.h index af450088..28a1ed9c 100644 --- a/bx/include/bx/cpu.h +++ b/bx/include/bx/cpu.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/debug.h b/bx/include/bx/debug.h index 2a9578b2..a219427a 100644 --- a/bx/include/bx/debug.h +++ b/bx/include/bx/debug.h @@ -1,37 +1,80 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ #ifndef BX_DEBUG_H_HEADER_GUARD #define BX_DEBUG_H_HEADER_GUARD -#include "bx.h" +#include // uint32_t +#include // va_list namespace bx { - class StringView; + class Error; + class StringView; + struct WriterI; + /// Break in debugger. /// void debugBreak(); + /// Write string to debug output. /// - void debugOutput(const char* _out); + /// @param[in] _str Zero terminated string to write. + /// + void debugOutput(const char* _str); + /// Write string to debug output. + /// + /// @param[in] _str StringView to write. /// void debugOutput(const StringView& _str); + /// Write formatted string to debug output. /// void debugPrintfVargs(const char* _format, va_list _argList); + /// Write formatted string to debug output. /// void debugPrintf(const char* _format, ...); + /// Write hex data into debug output. /// void debugPrintfData(const void* _data, uint32_t _size, const char* _format, ...); + /// Return debug output writer. + /// + /// @returns Debug output writer. + /// + WriterI* getDebugOut(); + + /// Capture current callstack. + /// + /// @param[in] _skip Skip top N stack frames. + /// @param[in] _max Maximum frame to capture. + /// @param[out] _outStack Stack frames array. Must be at least `_max` elements. + /// + /// @returns Number of stack frames captured. + /// + uint32_t getCallStack(uint32_t _skip, uint32_t _max, uintptr_t* _outStack); + + /// Write callstack. + /// + /// @param[in] _writer Writer. + /// @param[in] _stack Callstack. + /// @param[in] _num Number of stack addresses in `_stack` array. + /// @param[out] _err Error. + /// + /// @returns Number of bytes writen to `_writer`. + /// + int32_t writeCallstack(WriterI* _writer, uintptr_t* _stack, uint32_t _num, Error* _err); + + /// Capture call stack, and write it to debug output. + /// + /// @param[in] _skip Skip top N stack frames. /// - struct WriterI* getDebugOut(); + void debugOutputCallstack(uint32_t _skip); } // namespace bx diff --git a/bx/include/bx/easing.h b/bx/include/bx/easing.h index 4d6281d5..a6c5fa40 100644 --- a/bx/include/bx/easing.h +++ b/bx/include/bx/easing.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/endian.h b/bx/include/bx/endian.h index 19140a43..93904300 100644 --- a/bx/include/bx/endian.h +++ b/bx/include/bx/endian.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/error.h b/bx/include/bx/error.h index 0599139e..c01b6b94 100644 --- a/bx/include/bx/error.h +++ b/bx/include/bx/error.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -21,8 +21,8 @@ BX_ERROR_USE_TEMP_WHEN_NULL(_ptr); \ bx::ErrorScope bxErrorScope(const_cast(&tmpError), "" __VA_ARGS__) -#define BX_ERROR_RESULT(_err, _code) \ - BX_STATIC_ASSERT(_code != 0, "ErrorCode 0 is reserved!"); \ +#define BX_ERROR_RESULT(_err, _code) \ + static_assert(_code != 0, "ErrorCode 0 is reserved!"); \ static constexpr bx::ErrorResult _err = { _code } namespace bx @@ -48,7 +48,7 @@ namespace bx void reset(); /// - void setError(ErrorResult _errorResult, const StringView& _msg); + void setError(ErrorResult _errorResult, const StringLiteral& _msg, const Location& _location = Location::current() ); /// bool isOk() const; @@ -57,7 +57,10 @@ namespace bx ErrorResult get() const; /// - const StringView& getMessage() const; + const StringLiteral& getMessage() const; + + /// + const Location& getLocation() const; /// bool operator==(const ErrorResult& _rhs) const; @@ -66,12 +69,13 @@ namespace bx bool operator!=(const ErrorResult& _rhs) const; private: - StringView m_msg; - uint32_t m_code; + Location m_location; + StringLiteral m_msg; + uint32_t m_code; }; /// Do nothing even if error is set. - class ErrorIgnore : public Error + class ErrorIgnore final : public Error { public: /// @@ -79,7 +83,7 @@ namespace bx }; /// In debug build assert if error is set. - class ErrorAssert : public Error + class ErrorAssert final : public Error { public: /// @@ -90,7 +94,7 @@ namespace bx }; /// Exit application if error is set. - class ErrorFatal : public Error + class ErrorFatal final : public Error { public: /// @@ -110,17 +114,17 @@ namespace bx public: /// - ErrorScope(Error* _err, const StringView& _name); + ErrorScope(Error* _err, const StringLiteral& _name); /// ~ErrorScope(); /// - const StringView& getName() const; + const StringLiteral& getName() const; private: Error* m_err; - const StringView m_name; + const StringLiteral m_name; }; } // namespace bx diff --git a/bx/include/bx/file.h b/bx/include/bx/file.h index 35f078b8..8d2789bb 100644 --- a/bx/include/bx/file.h +++ b/bx/include/bx/file.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -124,19 +124,19 @@ namespace bx /// Creates a directory named `_filePath`. /// - bool make(const FilePath& _filePath, Error* _err = bx::ErrorIgnore{}); + bool make(const FilePath& _filePath, Error* _err = ErrorIgnore{}); /// Creates a directory named `_filePath` along with all necessary parents. /// - bool makeAll(const FilePath& _filePath, Error* _err = bx::ErrorIgnore{}); + bool makeAll(const FilePath& _filePath, Error* _err = ErrorIgnore{}); /// Removes file or directory. /// - bool remove(const FilePath& _filePath, Error* _err = bx::ErrorIgnore{}); + bool remove(const FilePath& _filePath, Error* _err = ErrorIgnore{}); /// Removes file or directory recursively. /// - bool removeAll(const FilePath& _filePath, Error* _err = bx::ErrorIgnore{}); + bool removeAll(const FilePath& _filePath, Error* _err = ErrorIgnore{}); } // namespace bx diff --git a/bx/include/bx/filepath.h b/bx/include/bx/filepath.h index 6f26a5cb..089e5378 100644 --- a/bx/include/bx/filepath.h +++ b/bx/include/bx/filepath.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/float4x4_t.h b/bx/include/bx/float4x4_t.h index 99187932..9be43ede 100644 --- a/bx/include/bx/float4x4_t.h +++ b/bx/include/bx/float4x4_t.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/handlealloc.h b/bx/include/bx/handlealloc.h index b13c125b..2474eddb 100644 --- a/bx/include/bx/handlealloc.h +++ b/bx/include/bx/handlealloc.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/hash.h b/bx/include/bx/hash.h index a07e4595..3d27c211 100644 --- a/bx/include/bx/hash.h +++ b/bx/include/bx/hash.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -76,7 +76,7 @@ namespace bx uint32_t m_hash; }; - /// 32-bit multiply and rotate hash. + /// 32-bit non-cryptographic multiply and rotate hash. class HashMurmur2A { public: @@ -101,9 +101,39 @@ namespace bx private: uint32_t m_hash; - uint32_t m_tail; - uint32_t m_count; uint32_t m_size; + uint8_t m_tail[4]; + uint8_t m_count; + }; + + /// 32-bit non-cryptographic multiply and rotate hash. + class HashMurmur3 + { + public: + /// + void begin(uint32_t _seed = 0); + + /// + void add(const void* _data, int32_t _len); + + /// + void add(const char* _data); + + /// + void add(const StringView& _data); + + /// + template + void add(const Ty& _data); + + /// + uint32_t end(); + + private: + uint32_t m_hash; + uint32_t m_size; + uint8_t m_tail[4]; + uint8_t m_count; }; /// diff --git a/bx/include/bx/inline/allocator.inl b/bx/include/bx/inline/allocator.inl index cb440482..60d3ca3d 100644 --- a/bx/include/bx/inline/allocator.inl +++ b/bx/include/bx/inline/allocator.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -24,12 +24,11 @@ namespace bx inline void* alignPtr(void* _ptr, size_t _extra, size_t _align) { - union { void* ptr; uintptr_t addr; } un; - un.ptr = _ptr; - uintptr_t unaligned = un.addr + _extra; // space for header - uintptr_t aligned = bx::alignUp(unaligned, int32_t(_align) ); - un.addr = aligned; - return un.ptr; + const uintptr_t addr = bitCast(_ptr); + const uintptr_t unaligned = addr + _extra; // space for header + const uintptr_t aligned = alignUp(unaligned, int32_t(_align) ); + + return bitCast(aligned); } inline void* alloc(AllocatorI* _allocator, size_t _size, size_t _align, const Location& _location) diff --git a/bx/include/bx/inline/bounds.inl b/bx/include/bx/inline/bounds.inl index 46c03a33..d4bb1808 100644 --- a/bx/include/bx/inline/bounds.inl +++ b/bx/include/bx/inline/bounds.inl @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ diff --git a/bx/include/bx/inline/bx.inl b/bx/include/bx/inline/bx.inl index 79129d48..b83c4527 100644 --- a/bx/include/bx/inline/bx.inl +++ b/bx/include/bx/inline/bx.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -96,13 +96,13 @@ namespace bx template inline constexpr Ty max() { - return bx::LimitsT::max; + return LimitsT::max; } template inline constexpr Ty min() { - return bx::LimitsT::min; + return LimitsT::min; } template @@ -147,4 +147,41 @@ namespace bx return _a && !(_a & (_a - 1) ); } + constexpr bool isConstantEvaluated() + { + return __builtin_is_constant_evaluated(); + } + + template + inline constexpr Ty bitCast(const FromT& _from) + { + static_assert(sizeof(Ty) == sizeof(FromT) + , "bx::bitCast failed! Ty and FromT must be the same size." + ); + static_assert(isTriviallyCopyable() + , "bx::bitCast failed! FromT must be trivially copyable." + ); + static_assert(isTriviallyCopyable() + , "bx::bitCast failed! Ty must be trivially copyable." + ); + static_assert(isTriviallyConstructible() + , "bx::bitCast failed! Ty must be trivially constructible." + ); + + return __builtin_bit_cast(Ty, _from); + } + + template + inline Ty narrowCast(const FromT& _from, Location _location) + { + Ty to = static_cast(_from); + BX_ASSERT_LOC(_location, static_cast(to) == _from + , "bx::narrowCast failed! Value is truncated!" + ); + return to; + } + + constexpr float kFloatInfinity = bitCast(kFloatExponentMask); + constexpr double kDoubleInfinity = bitCast(kDoubleExponentMask); + } // namespace bx diff --git a/bx/include/bx/inline/cpu.inl b/bx/include/bx/inline/cpu.inl index 36866b7a..bc0e64e2 100644 --- a/bx/include/bx/inline/cpu.inl +++ b/bx/include/bx/inline/cpu.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -70,7 +70,7 @@ namespace bx #if BX_COMPILER_MSVC _ReadBarrier(); #else - asm volatile("":::"memory"); + __atomic_thread_fence(__ATOMIC_RELEASE); #endif // BX_COMPILER_* } @@ -79,7 +79,7 @@ namespace bx #if BX_COMPILER_MSVC _WriteBarrier(); #else - asm volatile("":::"memory"); + __atomic_thread_fence(__ATOMIC_ACQUIRE); #endif // BX_COMPILER_* } @@ -88,7 +88,7 @@ namespace bx #if BX_COMPILER_MSVC _ReadWriteBarrier(); #else - asm volatile("":::"memory"); + __atomic_thread_fence(__ATOMIC_ACQ_REL); #endif // BX_COMPILER_* } diff --git a/bx/include/bx/inline/easing.inl b/bx/include/bx/inline/easing.inl index c21de229..38ddc860 100644 --- a/bx/include/bx/inline/easing.inl +++ b/bx/include/bx/inline/easing.inl @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/endian.inl b/bx/include/bx/inline/endian.inl index 47ed505e..9338852f 100644 --- a/bx/include/bx/inline/endian.inl +++ b/bx/include/bx/inline/endian.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/error.inl b/bx/include/bx/inline/error.inl index b5ffced6..eac53c69 100644 --- a/bx/include/bx/inline/error.inl +++ b/bx/include/bx/inline/error.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -22,7 +22,7 @@ namespace bx m_msg.clear(); } - inline void Error::setError(ErrorResult _errorResult, const StringView& _msg) + inline void Error::setError(ErrorResult _errorResult, const StringLiteral& _msg, const Location& _location) { BX_ASSERT(0 != _errorResult.code, "Invalid ErrorResult passed to setError!"); @@ -31,8 +31,9 @@ namespace bx return; } - m_code = _errorResult.code; - m_msg = _msg; + m_location = _location; + m_code = _errorResult.code; + m_msg = _msg; } inline bool Error::isOk() const @@ -46,11 +47,16 @@ namespace bx return result; } - inline const StringView& Error::getMessage() const + inline const StringLiteral& Error::getMessage() const { return m_msg; } + inline const Location& Error::getLocation() const + { + return m_location; + } + inline bool Error::operator==(const ErrorResult& _rhs) const { return _rhs.code == m_code; @@ -68,7 +74,7 @@ namespace bx inline ErrorAssert::~ErrorAssert() { - BX_ASSERT(isOk(), "Error: 0x%08x `%S`" + BX_ASSERT_LOC(getLocation(), isOk(), "ErrorAssert: 0x%08x `%S`" , get().code , &getMessage() ); @@ -81,15 +87,10 @@ namespace bx inline ErrorFatal::~ErrorFatal() { - if (!isOk() ) - { - printf("Error: 0x%08x `%S`" - , get().code - , &getMessage() - ); - - exit(kExitFailure); - } + _BX_ASSERT_LOC(getLocation(), isOk(), "ErrorFatal: 0x%08x `%S`" + , get().code + , &getMessage() + ); } inline ErrorAssert::operator Error*() @@ -97,7 +98,7 @@ namespace bx return this; } - inline ErrorScope::ErrorScope(Error* _err, const StringView& _name) + inline ErrorScope::ErrorScope(Error* _err, const StringLiteral& _name) : m_err(_err) , m_name(_name) { @@ -109,14 +110,20 @@ namespace bx { if (m_name.isEmpty() ) { - BX_ASSERT(m_err->isOk(), "Error: 0x%08x `%S`" + BX_ASSERT_LOC( + m_err->getLocation() + , m_err->isOk() + , "ErrorScope: 0x%08x `%S`" , m_err->get().code , &m_err->getMessage() ); } else { - BX_ASSERT(m_err->isOk(), "Error: %S - 0x%08x `%S`" + BX_ASSERT_LOC( + m_err->getLocation() + , m_err->isOk() + , "ErrorScope: %S - 0x%08x `%S`" , &m_name , m_err->get().code , &m_err->getMessage() @@ -124,7 +131,7 @@ namespace bx } } - inline const StringView& ErrorScope::getName() const + inline const StringLiteral& ErrorScope::getName() const { return m_name; } diff --git a/bx/include/bx/inline/float4x4_t.inl b/bx/include/bx/inline/float4x4_t.inl index bb684f15..1c1d2964 100644 --- a/bx/include/bx/inline/float4x4_t.inl +++ b/bx/include/bx/inline/float4x4_t.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -40,7 +40,7 @@ namespace bx BX_SIMD_INLINE void float4x4_mul(float4x4_t* _result, const float4x4_t* _a, const float4x4_t* _b) { -#if BX_CONFIG_SUPPORTS_SIMD +#if BX_SIMD_SUPPORTED _result->col[0] = simd_mul(_a->col[0], _b); _result->col[1] = simd_mul(_a->col[1], _b); _result->col[2] = simd_mul(_a->col[2], _b); @@ -69,12 +69,12 @@ namespace bx rr[13] = aa[12]*bb[ 1] + aa[13]*bb[ 5] + aa[14]*bb[ 9] + aa[15]*bb[13]; rr[14] = aa[12]*bb[ 2] + aa[13]*bb[ 6] + aa[14]*bb[10] + aa[15]*bb[14]; rr[15] = aa[12]*bb[ 3] + aa[13]*bb[ 7] + aa[14]*bb[11] + aa[15]*bb[15]; -#endif // BX_CONFIG_SUPPORTS_SIMD +#endif // BX_SIMD_SUPPORTED } BX_SIMD_INLINE void model4x4_mul(float4x4_t* _result, const float4x4_t* _a, const float4x4_t* _b) { -#if BX_CONFIG_SUPPORTS_SIMD +#if BX_SIMD_SUPPORTED // With SIMD faster to do the general 4x4 form: float4x4_mul(_result, _a, _b); #else @@ -101,12 +101,12 @@ namespace bx rr[13] = aa[12]*bb[ 1] + aa[13]*bb[ 5] + aa[14]*bb[ 9] + bb[13]; rr[14] = aa[12]*bb[ 2] + aa[13]*bb[ 6] + aa[14]*bb[10] + bb[14]; rr[15] = 1.0f; -#endif // BX_CONFIG_SUPPORTS_SIMD +#endif // BX_SIMD_SUPPORTED } BX_SIMD_INLINE void model4x4_mul_viewproj4x4(float4x4_t* _result, const float4x4_t* _model, const float4x4_t* _viewProj) { -#if BX_CONFIG_SUPPORTS_SIMD +#if BX_SIMD_SUPPORTED // With SIMD faster to do the general 4x4 form: float4x4_mul(_result, _model, _viewProj); #else @@ -132,7 +132,7 @@ namespace bx rr[13] = aa[12]*bb[ 1] + aa[13]*bb[ 5] + aa[14]*bb[ 9] + bb[13]; rr[14] = aa[12]*bb[ 2] + aa[13]*bb[ 6] + aa[14]*bb[10] + bb[14]; rr[15] = aa[12]*bb[ 3] + aa[13]*bb[ 7] + aa[14]*bb[11] + bb[15]; -#endif // BX_CONFIG_SUPPORTS_SIMD +#endif // BX_SIMD_SUPPORTED } BX_SIMD_FORCE_INLINE void float4x4_transpose(float4x4_t* _result, const float4x4_t* _mtx) diff --git a/bx/include/bx/inline/handlealloc.inl b/bx/include/bx/inline/handlealloc.inl index f9d5b719..613a6244 100644 --- a/bx/include/bx/inline/handlealloc.inl +++ b/bx/include/bx/inline/handlealloc.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -103,14 +103,14 @@ namespace bx inline HandleAlloc* createHandleAlloc(AllocatorI* _allocator, uint16_t _maxHandles) { - uint8_t* ptr = (uint8_t*)bx::alloc(_allocator, sizeof(HandleAlloc) + 2*_maxHandles*sizeof(uint16_t) ); + uint8_t* ptr = (uint8_t*)alloc(_allocator, sizeof(HandleAlloc) + 2*_maxHandles*sizeof(uint16_t) ); return BX_PLACEMENT_NEW(ptr, HandleAlloc)(_maxHandles); } inline void destroyHandleAlloc(AllocatorI* _allocator, HandleAlloc* _handleAlloc) { _handleAlloc->~HandleAlloc(); - bx::free(_allocator, _handleAlloc); + free(_allocator, _handleAlloc); } template diff --git a/bx/include/bx/inline/hash.inl b/bx/include/bx/inline/hash.inl index 1cdf3215..c796ac66 100644 --- a/bx/include/bx/inline/hash.inl +++ b/bx/include/bx/inline/hash.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -72,10 +72,10 @@ namespace bx inline void HashMurmur2A::begin(uint32_t _seed) { + BX_UNUSED(m_tail); m_hash = _seed; - m_tail = 0; - m_count = 0; m_size = 0; + m_count = 0; } inline void HashMurmur2A::add(const char* _data) @@ -94,6 +94,30 @@ namespace bx add(&_data, sizeof(Ty) ); } + inline void HashMurmur3::begin(uint32_t _seed) + { + BX_UNUSED(m_tail); + m_hash = _seed; + m_size = 0; + m_count = 0; + } + + inline void HashMurmur3::add(const char* _data) + { + return add(StringView(_data) ); + } + + inline void HashMurmur3::add(const StringView& _data) + { + return add(_data.getPtr(), _data.getLength() ); + } + + template + inline void HashMurmur3::add(const Ty& _data) + { + add(&_data, sizeof(Ty) ); + } + template inline uint32_t hash(const void* _data, uint32_t _size) { @@ -118,7 +142,7 @@ namespace bx template inline uint32_t hash(const Ty& _data) { - BX_STATIC_ASSERT(isTriviallyCopyable() ); + static_assert(isTriviallyCopyable() ); return hash(&_data, sizeof(Ty) ); } diff --git a/bx/include/bx/inline/math.inl b/bx/include/bx/inline/math.inl index 37f512c5..e188730a 100644 --- a/bx/include/bx/inline/math.inl +++ b/bx/include/bx/inline/math.inl @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -24,31 +24,27 @@ namespace bx return _rad * 180.0f / kPi; } - inline BX_CONST_FUNC uint32_t floatToBits(float _a) + inline BX_CONSTEXPR_FUNC uint32_t floatToBits(float _a) { - union { float f; uint32_t ui; } u = { _a }; - return u.ui; + return bitCast(_a); } - inline BX_CONST_FUNC float bitsToFloat(uint32_t _a) + inline BX_CONSTEXPR_FUNC float bitsToFloat(uint32_t _a) { - union { uint32_t ui; float f; } u = { _a }; - return u.f; + return bitCast(_a); } - inline BX_CONST_FUNC uint64_t doubleToBits(double _a) + inline BX_CONSTEXPR_FUNC uint64_t doubleToBits(double _a) { - union { double f; uint64_t ui; } u = { _a }; - return u.ui; + return bitCast(_a); } - inline BX_CONST_FUNC double bitsToDouble(uint64_t _a) + inline BX_CONSTEXPR_FUNC double bitsToDouble(uint64_t _a) { - union { uint64_t ui; double f; } u = { _a }; - return u.f; + return bitCast(_a); } - inline BX_CONST_FUNC uint32_t floatFlip(uint32_t _value) + inline BX_CONSTEXPR_FUNC uint32_t floatFlip(uint32_t _value) { // Reference(s): // - http://archive.fo/2012.12.08-212402/http://stereopsis.com/radix.html @@ -60,37 +56,37 @@ namespace bx return result; } - inline BX_CONST_FUNC bool isNan(float _f) + inline BX_CONSTEXPR_FUNC bool isNan(float _f) { const uint32_t tmp = floatToBits(_f) & INT32_MAX; return tmp > kFloatExponentMask; } - inline BX_CONST_FUNC bool isNan(double _f) + inline BX_CONSTEXPR_FUNC bool isNan(double _f) { const uint64_t tmp = doubleToBits(_f) & INT64_MAX; return tmp > kDoubleExponentMask; } - inline BX_CONST_FUNC bool isFinite(float _f) + inline BX_CONSTEXPR_FUNC bool isFinite(float _f) { const uint32_t tmp = floatToBits(_f) & INT32_MAX; return tmp < kFloatExponentMask; } - inline BX_CONST_FUNC bool isFinite(double _f) + inline BX_CONSTEXPR_FUNC bool isFinite(double _f) { const uint64_t tmp = doubleToBits(_f) & INT64_MAX; return tmp < kDoubleExponentMask; } - inline BX_CONST_FUNC bool isInfinite(float _f) + inline BX_CONSTEXPR_FUNC bool isInfinite(float _f) { const uint32_t tmp = floatToBits(_f) & INT32_MAX; return tmp == kFloatExponentMask; } - inline BX_CONST_FUNC bool isInfinite(double _f) + inline BX_CONSTEXPR_FUNC bool isInfinite(double _f) { const uint64_t tmp = doubleToBits(_f) & INT64_MAX; return tmp == kDoubleExponentMask; @@ -114,9 +110,9 @@ namespace bx return -floor(-_a); } - inline BX_CONSTEXPR_FUNC float round(float _f) + inline BX_CONSTEXPR_FUNC float round(float _a) { - return floor(_f + 0.5f); + return floor(_a + 0.5f); } inline BX_CONSTEXPR_FUNC float lerp(float _a, float _b, float _t) @@ -138,15 +134,15 @@ namespace bx return float( (0.0f < _a) - (0.0f > _a) ); } - inline BX_CONSTEXPR_FUNC bool signbit(float _a) + inline BX_CONSTEXPR_FUNC bool signBit(float _a) { return -0.0f == _a ? 0.0f != _a : 0.0f > _a; } - inline BX_CONSTEXPR_FUNC float copysign(float _value, float _sign) + inline BX_CONSTEXPR_FUNC float copySign(float _value, float _sign) { #if BX_COMPILER_MSVC - return signbit(_value) != signbit(_sign) ? -_value : _value; + return signBit(_value) != signBit(_sign) ? -_value : _value; #else return __builtin_copysign(_value, _sign); #endif // BX_COMPILER_MSVC @@ -162,32 +158,176 @@ namespace bx return _a * _a; } - inline BX_CONST_FUNC float sin(float _a) + inline BX_CONSTEXPR_FUNC float trunc(float _a) + { + return float(int(_a) ); + } + + inline BX_CONSTEXPR_FUNC float fract(float _a) + { + return _a - trunc(_a); + } + + inline BX_CONSTEXPR_FUNC float nms(float _a, float _b, float _c) + { + return _c - _a * _b; + } + + inline BX_CONSTEXPR_FUNC float add(float _a, float _b) + { + return _a + _b; + } + + inline BX_CONSTEXPR_FUNC float sub(float _a, float _b) + { + return _a - _b; + } + + inline BX_CONSTEXPR_FUNC float mul(float _a, float _b) + { + return _a * _b; + } + + inline BX_CONSTEXPR_FUNC float mad(float _a, float _b, float _c) + { + return add(mul(_a, _b), _c); + } + + inline BX_CONSTEXPR_FUNC float rcp(float _a) + { + return 1.0f / _a; + } + + inline BX_CONSTEXPR_FUNC float rcpSafe(float _a) + { + return rcp(copySign(max(kFloatSmallest, abs(_a) ), _a) ); + } + + inline BX_CONSTEXPR_FUNC float div(float _a, float _b) + { + return mul(_a, rcp(_b) ); + } + + inline BX_CONSTEXPR_FUNC float divSafe(float _a, float _b) + { + return mul(_a, rcpSafe(_b) ); + } + + inline BX_CONSTEXPR_FUNC float mod(float _a, float _b) + { + return _a - _b * floor(div(_a, _b) ); + } + + inline BX_CONSTEXPR_FUNC float cos(float _a) + { + const float scaled = _a * 2.0f*kInvPi; + const float real = floor(scaled); + const float xx = _a - real * kPiHalf; + const int32_t bits = int32_t(real) & 3; + + constexpr float kSinC2 = -0.16666667163372039794921875f; + constexpr float kSinC4 = 8.333347737789154052734375e-3f; + constexpr float kSinC6 = -1.9842604524455964565277099609375e-4f; + constexpr float kSinC8 = 2.760012648650445044040679931640625e-6f; + constexpr float kSinC10 = -2.50293279435709337121807038784027099609375e-8f; + + constexpr float kCosC2 = -0.5f; + constexpr float kCosC4 = 4.166664183139801025390625e-2f; + constexpr float kCosC6 = -1.388833043165504932403564453125e-3f; + constexpr float kCosC8 = 2.47562347794882953166961669921875e-5f; + constexpr float kCosC10 = -2.59630184018533327616751194000244140625e-7f; + + float c0 = xx; + float c2 = kSinC2; + float c4 = kSinC4; + float c6 = kSinC6; + float c8 = kSinC8; + float c10 = kSinC10; + + if (bits == 0 + || bits == 2) + { + c0 = 1.0f; + c2 = kCosC2; + c4 = kCosC4; + c6 = kCosC6; + c8 = kCosC8; + c10 = kCosC10; + } + + const float xsq = square(xx); + const float tmp0 = mad(c10, xsq, c8 ); + const float tmp1 = mad(tmp0, xsq, c6 ); + const float tmp2 = mad(tmp1, xsq, c4 ); + const float tmp3 = mad(tmp2, xsq, c2 ); + const float tmp4 = mad(tmp3, xsq, 1.0); + const float result = tmp4 * c0; + + return bits == 1 || bits == 2 + ? -result + : result + ; + } + + inline BX_CONSTEXPR_FUNC float acos(float _a) + { + constexpr float kAcosC0 = 1.5707288f; + constexpr float kAcosC1 = -0.2121144f; + constexpr float kAcosC2 = 0.0742610f; + constexpr float kAcosC3 = -0.0187293f; + + const float absa = abs(_a); + const float tmp0 = mad(kAcosC3, absa, kAcosC2); + const float tmp1 = mad(tmp0, absa, kAcosC1); + const float tmp2 = mad(tmp1, absa, kAcosC0); + const float tmp3 = tmp2 * sqrt(1.0f - absa); + const float negate = float(_a < 0.0f); + const float tmp4 = tmp3 - 2.0f*negate*tmp3; + const float result = negate*kPi + tmp4; + + return result; + } + + inline void sinCosApprox(float& _outSinApprox, float& _outCos, float _a) + { + const float aa = _a - floor(_a*kInvPi2)*kPi2; + const float absA = abs(aa); + const float cosA = cos(absA); + const float cosASq = square(cosA); + const float tmp0 = sqrt(1.0f - cosASq); + const float tmp1 = aa > 0.0f && aa < kPi ? 1.0f : -1.0f; + const float sinA = mul(tmp0, tmp1); + + _outSinApprox = sinA; + _outCos = cosA; + } + + inline BX_CONSTEXPR_FUNC float sin(float _a) { return cos(_a - kPiHalf); } - inline BX_CONST_FUNC float sinh(float _a) + inline BX_CONSTEXPR_FUNC float sinh(float _a) { return 0.5f*(exp(_a) - exp(-_a) ); } - inline BX_CONST_FUNC float asin(float _a) + inline BX_CONSTEXPR_FUNC float asin(float _a) { return kPiHalf - acos(_a); } - inline BX_CONST_FUNC float cosh(float _a) + inline BX_CONSTEXPR_FUNC float cosh(float _a) { return 0.5f*(exp(_a) + exp(-_a) ); } - inline BX_CONST_FUNC float tan(float _a) + inline BX_CONSTEXPR_FUNC float tan(float _a) { return sin(_a) / cos(_a); } - inline BX_CONST_FUNC float tanh(float _a) + inline BX_CONSTEXPR_FUNC float tanh(float _a) { const float tmp0 = exp(2.0f*_a); const float tmp1 = tmp0 - 1.0f; @@ -197,36 +337,377 @@ namespace bx return result; } - inline BX_CONST_FUNC float atan(float _a) + inline BX_CONSTEXPR_FUNC float atan(float _a) { return atan2(_a, 1.0f); } - inline BX_CONST_FUNC float pow(float _a, float _b) + inline BX_CONSTEXPR_FUNC float atan2(float _y, float _x) + { + const float ax = abs(_x); + const float ay = abs(_y); + const float maxaxy = max(ax, ay); + const float minaxy = min(ax, ay); + + if (maxaxy == 0.0f) + { + return _y < 0.0f ? -0.0f : 0.0f; + } + + constexpr float kAtan2C0 = -0.013480470f; + constexpr float kAtan2C1 = 0.057477314f; + constexpr float kAtan2C2 = -0.121239071f; + constexpr float kAtan2C3 = 0.195635925f; + constexpr float kAtan2C4 = -0.332994597f; + constexpr float kAtan2C5 = 0.999995630f; + + const float mxy = minaxy / maxaxy; + const float mxysq = square(mxy); + const float tmp0 = mad(kAtan2C0, mxysq, kAtan2C1); + const float tmp1 = mad(tmp0, mxysq, kAtan2C2); + const float tmp2 = mad(tmp1, mxysq, kAtan2C3); + const float tmp3 = mad(tmp2, mxysq, kAtan2C4); + const float tmp4 = mad(tmp3, mxysq, kAtan2C5); + const float tmp5 = tmp4 * mxy; + const float tmp6 = ay > ax ? kPiHalf - tmp5 : tmp5; + const float tmp7 = _x < 0.0f ? kPi - tmp6 : tmp6; + const float result = _y < 0.0f ? -tmp7 : tmp7; + + return result; + } + + inline BX_CONSTEXPR_FUNC float ldexp(float _a, int32_t _b) + { + const uint32_t ftob = floatToBits(_a); + const uint32_t masked = uint32_and(ftob, kFloatSignMask | kFloatExponentMask); + const uint32_t expsign0 = uint32_sra(masked, kFloatExponentBitShift); + const uint32_t tmp = uint32_iadd(expsign0, _b); + const uint32_t expsign1 = uint32_sll(tmp, kFloatExponentBitShift); + const uint32_t mantissa = uint32_and(ftob, kFloatMantissaMask); + const uint32_t bits = uint32_or(mantissa, expsign1); + const float result = bitsToFloat(bits); + + return result; + } + + inline BX_CONSTEXPR_FUNC float log(float _a) + { + if (_a < 0.0f) + { + return bitsToFloat(kFloatSignMask | kFloatExponentMask | kFloatMantissaMask); + } + + if (_a == 0.0f) + { + return -kFloatInfinity; + } + + const uint32_t ftob = floatToBits(_a); + + const uint32_t masked0 = uint32_and(ftob, kFloatExponentMask); + const uint32_t exp0 = uint32_srl(masked0, kFloatExponentBitShift); + int32_t exp = int32_t(exp0 - 0x7e); + + const uint32_t masked1 = uint32_and(ftob, kFloatSignMask | kFloatMantissaMask); + const uint32_t bits = uint32_or(masked1, UINT32_C(0x3f000000) ); + float ff = bitsToFloat(bits); + + if (ff < kSqrt2*0.5f) + { + ff *= 2.0f; + --exp; + } + + constexpr float kLogC0 = 6.666666666666735130e-01f; + constexpr float kLogC1 = 3.999999999940941908e-01f; + constexpr float kLogC2 = 2.857142874366239149e-01f; + constexpr float kLogC3 = 2.222219843214978396e-01f; + constexpr float kLogC4 = 1.818357216161805012e-01f; + constexpr float kLogC5 = 1.531383769920937332e-01f; + constexpr float kLogC6 = 1.479819860511658591e-01f; + constexpr float kLogNat2Lo = 1.90821492927058770002e-10f; + + ff -= 1.0f; + const float kk = float(exp); + const float hi = kk*kLogNat2; + const float lo = kk*kLogNat2Lo; + const float ss = ff / (2.0f + ff); + const float s2 = square(ss); + const float s4 = square(s2); + + const float tmp0 = mad(kLogC6, s4, kLogC4); + const float tmp1 = mad(tmp0, s4, kLogC2); + const float tmp2 = mad(tmp1, s4, kLogC0); + const float t1 = s2*tmp2; + + const float tmp3 = mad(kLogC5, s4, kLogC3); + const float tmp4 = mad(tmp3, s4, kLogC1); + const float t2 = s4*tmp4; + + const float t12 = t1 + t2; + const float hfsq = 0.5f*square(ff); + const float result = hi - ( (hfsq - (ss*(hfsq+t12) + lo) ) - ff); + + return result; + } + + inline BX_CONSTEXPR_FUNC float exp(float _a) { - return exp(_b * log(_a) ); + if (abs(_a) <= kNearZero) + { + return _a + 1.0f; + } + + constexpr float expMin = log(kFloatSmallest); + + if (_a <= expMin) + { + return 0.0f; + } + + if (isInfinite(_a) && _a < 0.0f) + { + return 0.0f; + } + + constexpr float kExpC0 = 1.66666666666666019037e-01f; + constexpr float kExpC1 = -2.77777777770155933842e-03f; + constexpr float kExpC2 = 6.61375632143793436117e-05f; + constexpr float kExpC3 = -1.65339022054652515390e-06f; + constexpr float kExpC4 = 4.13813679705723846039e-08f; + constexpr float kLogNat2Lo = 1.90821492927058770002e-10f; + + const float kk = round(_a*kInvLogNat2); + const float hi = _a - kk*kLogNat2; + const float lo = kk*kLogNat2Lo; + const float hml = hi - lo; + const float hmlsq = square(hml); + const float tmp0 = mad(kExpC4, hmlsq, kExpC3); + const float tmp1 = mad(tmp0, hmlsq, kExpC2); + const float tmp2 = mad(tmp1, hmlsq, kExpC1); + const float tmp3 = mad(tmp2, hmlsq, kExpC0); + const float tmp4 = hml - hmlsq * tmp3; + const float tmp5 = hml*tmp4/(2.0f-tmp4); + const float tmp6 = 1.0f - ( (lo - tmp5) - hi); + const float result = ldexp(tmp6, int32_t(kk) ); + + return result; + } + + inline BX_CONSTEXPR_FUNC float pow(float _a, float _b) + { + if (abs(_b) < kFloatSmallest) + { + return 1.0f; + } + + if (abs(_a) < kFloatSmallest) + { + return 0.0f; + } + + return copySign(exp(_b * log(abs(_a) ) ), _a); } - inline BX_CONST_FUNC float exp2(float _a) + inline BX_CONSTEXPR_FUNC float exp2(float _a) { return pow(2.0f, _a); } - template<> - inline BX_CONST_FUNC float log2(float _a) + inline BX_CONSTEXPR_FUNC float log2(float _a) { return log(_a) * kInvLogNat2; } template<> - inline BX_CONST_FUNC int32_t log2(int32_t _a) + inline BX_CONSTEXPR_FUNC uint8_t countBits(uint32_t _val) + { +#if BX_COMPILER_GCC || BX_COMPILER_CLANG + return __builtin_popcount(_val); +#else + const uint32_t tmp0 = uint32_srl(_val, 1); + const uint32_t tmp1 = uint32_and(tmp0, 0x55555555); + const uint32_t tmp2 = uint32_sub(_val, tmp1); + const uint32_t tmp3 = uint32_and(tmp2, 0xc30c30c3); + const uint32_t tmp4 = uint32_srl(tmp2, 2); + const uint32_t tmp5 = uint32_and(tmp4, 0xc30c30c3); + const uint32_t tmp6 = uint32_srl(tmp2, 4); + const uint32_t tmp7 = uint32_and(tmp6, 0xc30c30c3); + const uint32_t tmp8 = uint32_add(tmp3, tmp5); + const uint32_t tmp9 = uint32_add(tmp7, tmp8); + const uint32_t tmpA = uint32_srl(tmp9, 6); + const uint32_t tmpB = uint32_add(tmp9, tmpA); + const uint32_t tmpC = uint32_srl(tmpB, 12); + const uint32_t tmpD = uint32_srl(tmpB, 24); + const uint32_t tmpE = uint32_add(tmpB, tmpC); + const uint32_t tmpF = uint32_add(tmpD, tmpE); + const uint32_t result = uint32_and(tmpF, 0x3f); + + return uint8_t(result); +#endif // BX_COMPILER_* + } + + template<> + inline BX_CONSTEXPR_FUNC uint8_t countBits(unsigned long long _val) + { +#if BX_COMPILER_GCC || BX_COMPILER_CLANG + return __builtin_popcountll(_val); +#else + const uint32_t lo = uint32_t(_val&UINT32_MAX); + const uint32_t hi = uint32_t(_val>>32); + + return countBits(lo) + + countBits(hi) + ; +#endif // BX_COMPILER_* + } + + template<> + inline BX_CONSTEXPR_FUNC uint8_t countBits(unsigned long _val) + { + return countBits(_val); + } + + template<> inline BX_CONSTEXPR_FUNC uint8_t countBits(uint8_t _val) { return countBits(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countBits(int8_t _val) { return countBits(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countBits(uint16_t _val) { return countBits(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countBits(int16_t _val) { return countBits(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countBits(int32_t _val) { return countBits(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countBits(int64_t _val) { return countBits(_val); } + + template<> + inline BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(uint32_t _val) + { +#if BX_COMPILER_GCC || BX_COMPILER_CLANG + return 0 == _val ? 32 : __builtin_clz(_val); +#else + const uint32_t tmp0 = uint32_srl(_val, 1); + const uint32_t tmp1 = uint32_or(tmp0, _val); + const uint32_t tmp2 = uint32_srl(tmp1, 2); + const uint32_t tmp3 = uint32_or(tmp2, tmp1); + const uint32_t tmp4 = uint32_srl(tmp3, 4); + const uint32_t tmp5 = uint32_or(tmp4, tmp3); + const uint32_t tmp6 = uint32_srl(tmp5, 8); + const uint32_t tmp7 = uint32_or(tmp6, tmp5); + const uint32_t tmp8 = uint32_srl(tmp7, 16); + const uint32_t tmp9 = uint32_or(tmp8, tmp7); + const uint32_t tmpA = uint32_not(tmp9); + const uint32_t result = uint32_cntbits(tmpA); + + return uint8_t(result); +#endif // BX_COMPILER_* + } + + template<> + inline BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(unsigned long long _val) + { +#if BX_COMPILER_GCC || BX_COMPILER_CLANG + return 0 == _val ? 64 : __builtin_clzll(_val); +#else + return _val & UINT64_C(0xffffffff00000000) + ? countLeadingZeros(uint32_t(_val>>32) ) + : countLeadingZeros(uint32_t(_val) ) + 32 + ; +#endif // BX_COMPILER_* + } + + template<> + inline BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(unsigned long _val) { - return 31 - uint32_cntlz(_a); + return countLeadingZeros(_val); } - inline BX_CONST_FUNC float rsqrtRef(float _a) + template<> inline BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(uint8_t _val) { return countLeadingZeros(_val)-24; } + template<> inline BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(int8_t _val) { return countLeadingZeros(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(uint16_t _val) { return countLeadingZeros(_val)-16; } + template<> inline BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(int16_t _val) { return countLeadingZeros(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(int32_t _val) { return countLeadingZeros(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(int64_t _val) { return countLeadingZeros(_val); } + + template<> + inline BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(uint32_t _val) + { +#if BX_COMPILER_GCC || BX_COMPILER_CLANG + return 0 == _val ? 32 : __builtin_ctz(_val); +#else + const uint32_t tmp0 = uint32_not(_val); + const uint32_t tmp1 = uint32_dec(_val); + const uint32_t tmp2 = uint32_and(tmp0, tmp1); + const uint32_t result = uint32_cntbits(tmp2); + + return uint8_t(result); +#endif // BX_COMPILER_* + } + + template<> + inline BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(unsigned long long _val) { - if (_a < kNearZero) +#if BX_COMPILER_GCC || BX_COMPILER_CLANG + return 0 == _val ? 64 : __builtin_ctzll(_val); +#else + return _val & UINT64_C(0xffffffff) + ? countTrailingZeros(uint32_t(_val) ) + : countTrailingZeros(uint32_t(_val>>32) ) + 32 + ; +#endif // BX_COMPILER_* + } + + template<> + inline BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(unsigned long _val) + { + return countTrailingZeros(_val); + } + + template<> inline BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(uint8_t _val) { return min(8, countTrailingZeros(_val) ); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(int8_t _val) { return countTrailingZeros(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(uint16_t _val) { return min(16, countTrailingZeros(_val) ); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(int16_t _val) { return countTrailingZeros(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(int32_t _val) { return countTrailingZeros(_val); } + template<> inline BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(int64_t _val) { return countTrailingZeros(_val); } + + template + inline BX_CONSTEXPR_FUNC uint8_t findFirstSet(Ty _val) + { + static_assert(isInteger(), "Type Ty must be of integer type!"); + return Ty(0) == _val ? uint8_t(0) : countTrailingZeros(_val) + 1; + } + + template + inline BX_CONSTEXPR_FUNC uint8_t findLastSet(Ty _val) + { + static_assert(isInteger(), "Type Ty must be of integer type!"); + return Ty(0) == _val ? uint8_t(0) : sizeof(Ty)*8 - countLeadingZeros(_val); + } + + template + inline BX_CONSTEXPR_FUNC uint8_t ceilLog2(Ty _a) + { + static_assert(isInteger(), "Type Ty must be of integer type!"); + return Ty(_a) < Ty(1) ? Ty(0) : sizeof(Ty)*8 - countLeadingZeros(_a - 1); + } + + template + inline BX_CONSTEXPR_FUNC uint8_t floorLog2(Ty _a) + { + static_assert(isInteger(), "Type Ty must be of integer type!"); + return Ty(_a) < Ty(1) ? Ty(0) : sizeof(Ty)*8 - 1 - countLeadingZeros(_a); + } + + template + inline BX_CONSTEXPR_FUNC Ty nextPow2(Ty _a) + { + const uint8_t log2 = ceilLog2(_a); + BX_ASSERT(log2 < sizeof(Ty)*8 + , "Type Ty cannot represent the next power-of-two value (1<<%u is larger than %u-bit type)." + , log2 + , sizeof(Ty)*8 + ); + return Ty(1)< abs(nz) ) { - float invLen = 1.0f / sqrt(nx*nx + nz*nz); + const float invLen = rcpSafe(sqrt(nx*nx + nz*nz) ); _outT.x = -nz * invLen; _outT.y = 0.0f; _outT.z = nx * invLen; } else { - float invLen = 1.0f / sqrt(ny*ny + nz*nz); + const float invLen = rcpSafe(sqrt(ny*ny + nz*nz) ); _outT.x = 0.0f; _outT.y = nz * invLen; _outT.z = -ny * invLen; @@ -777,9 +1243,8 @@ namespace bx _outB = cross(_n, _outT); } - inline BX_CONST_FUNC Vec3 fromLatLong(float _u, float _v) + inline BX_CONSTEXPR_FUNC Vec3 fromLatLong(float _u, float _v) { - Vec3 result(InitNone); const float phi = _u * kPi2; const float theta = _v * kPi; @@ -788,10 +1253,12 @@ namespace bx const float ct = cos(theta); const float cp = cos(phi); - result.x = -st*sp; - result.y = ct; - result.z = -st*cp; - return result; + return + { + -st*sp, + ct, + -st*cp, + }; } inline void toLatLong(float* _outU, float* _outV, const Vec3 _dir) @@ -1054,7 +1521,7 @@ namespace bx return; } - const float invSa = 1.0f/sa; + const float invSa = rcpSafe(sa); _outAxis = { _a.x * invSa, _a.y * invSa, _a.z * invSa }; } @@ -1325,7 +1792,7 @@ namespace bx ; } - inline BX_CONST_FUNC float toLinear(float _a) + inline BX_CONSTEXPR_FUNC float toLinear(float _a) { const float lo = _a / 12.92f; const float hi = pow( (_a + 0.055f) / 1.055f, 2.4f); @@ -1333,7 +1800,7 @@ namespace bx return result; } - inline BX_CONST_FUNC float toGamma(float _a) + inline BX_CONSTEXPR_FUNC float toGamma(float _a) { const float lo = _a * 12.92f; const float hi = pow(abs(_a), 1.0f/2.4f) * 1.055f - 0.055f; diff --git a/bx/include/bx/inline/mpscqueue.inl b/bx/include/bx/inline/mpscqueue.inl index 24cd6ab4..8e15821b 100644 --- a/bx/include/bx/inline/mpscqueue.inl +++ b/bx/include/bx/inline/mpscqueue.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/mutex.inl b/bx/include/bx/inline/mutex.inl index d17855ad..9ba82a1c 100644 --- a/bx/include/bx/inline/mutex.inl +++ b/bx/include/bx/inline/mutex.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/os.inl b/bx/include/bx/inline/os.inl index 87a7ba36..cf2531ef 100644 --- a/bx/include/bx/inline/os.inl +++ b/bx/include/bx/inline/os.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/pixelformat.inl b/bx/include/bx/inline/pixelformat.inl index c130b358..1d62bfd2 100644 --- a/bx/include/bx/inline/pixelformat.inl +++ b/bx/include/bx/inline/pixelformat.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -21,9 +21,7 @@ namespace bx inline int32_t toSnorm(float _value, float _scale) { - return int32_t(round( - clamp(_value, -1.0f, 1.0f) * _scale) - ); + return int32_t(round(clamp(_value, -1.0f, 1.0f) * _scale) ); } inline float fromSnorm(int32_t _value, float _scale) @@ -721,46 +719,49 @@ namespace bx memCopy(_dst, _src, 8); } - template + template inline void encodeRgbE(float* _dst, const float* _src) { // Reference(s): // - https://web.archive.org/web/20181126040035/https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_texture_shared_exponent.txt // - const int32_t expMax = (1<>23) & 0xff) - 127) ) ) + 1 + expBias; - float denom = pow(2.0f, float(expShared - expBias - MantissaBits) ); + const uint32_t mm_as_ui = bitCast(mm); - if ( (1<>23) & 0xff) - 127) ) ) + 1 + expBias; + float denom = pow(2.0f, float(expShared - expBias - MantissaBitsT) ); + + if ( (1< + template inline void decodeRgbE(float* _dst, const float* _src) { - const int32_t expBias = (1<<(ExpBits - 1) ) - 1; - const float exponent = _src[3]-float(expBias-MantissaBits); + const int32_t expBias = (1<<(ExpBitsT - 1) ) - 1; + const float exponent = _src[3]-float(expBias-MantissaBitsT); const float scale = pow(2.0f, exponent); - _dst[0] = _src[0] * scale; - _dst[1] = _src[1] * scale; - _dst[2] = _src[2] * scale; + const float invScale = rcpSafe(scale); + + _dst[0] = _src[0] * invScale; + _dst[1] = _src[1] * invScale; + _dst[2] = _src[2] * invScale; } // RGB9E5F @@ -779,12 +780,12 @@ namespace bx inline void unpackRgb9E5F(float* _dst, const void* _src) { - uint32_t packed = *( (const uint32_t*)_src); + const uint32_t packed = *( (const uint32_t*)_src); float tmp[4]; - tmp[0] = float( ( (packed ) & 0x1ff) ) / 511.0f; - tmp[1] = float( ( (packed>> 9) & 0x1ff) ) / 511.0f; - tmp[2] = float( ( (packed>>18) & 0x1ff) ) / 511.0f; + tmp[0] = float( ( (packed ) & 0x1ff) ); + tmp[1] = float( ( (packed>> 9) & 0x1ff) ); + tmp[2] = float( ( (packed>>18) & 0x1ff) ); tmp[3] = float( ( (packed>>27) & 0x1f) ); decodeRgbE<9, 5>(_dst, tmp); diff --git a/bx/include/bx/inline/readerwriter.inl b/bx/include/bx/inline/readerwriter.inl index 9541d3c9..83c0bf42 100644 --- a/bx/include/bx/inline/readerwriter.inl +++ b/bx/include/bx/inline/readerwriter.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -67,7 +67,7 @@ namespace bx inline MemoryBlock::~MemoryBlock() { - bx::free(m_allocator, m_data); + free(m_allocator, m_data); } inline void* MemoryBlock::more(uint32_t _size) @@ -75,7 +75,7 @@ namespace bx if (0 < _size) { m_size += _size; - m_data = bx::realloc(m_allocator, m_data, m_size); + m_data = realloc(m_allocator, m_data, m_size); } return m_data; @@ -276,7 +276,7 @@ namespace bx inline int32_t read(ReaderI* _reader, Ty& _value, Error* _err) { BX_ERROR_SCOPE(_err); - BX_STATIC_ASSERT(isTriviallyCopyable() ); + static_assert(isTriviallyCopyable() ); return _reader->read(&_value, sizeof(Ty), _err); } @@ -284,7 +284,7 @@ namespace bx inline int32_t readHE(ReaderI* _reader, Ty& _value, bool _fromLittleEndian, Error* _err) { BX_ERROR_SCOPE(_err); - BX_STATIC_ASSERT(isTriviallyCopyable() ); + static_assert(isTriviallyCopyable() ); Ty value; int32_t result = _reader->read(&value, sizeof(Ty), _err); _value = toHostEndian(value, _fromLittleEndian); @@ -308,7 +308,7 @@ namespace bx memSet(temp, _byte, blockSize); int32_t size = 0; - while (0 < _size) + while (0 < _size && _err->isOk() ) { int32_t bytes = write(_writer, temp, uint32_min(blockSize, _size), _err); size += bytes; @@ -322,7 +322,7 @@ namespace bx inline int32_t write(WriterI* _writer, const Ty& _value, Error* _err) { BX_ERROR_SCOPE(_err); - BX_STATIC_ASSERT(isTriviallyCopyable() ); + static_assert(isTriviallyCopyable() ); return _writer->write(&_value, sizeof(Ty), _err); } @@ -347,7 +347,7 @@ namespace bx inline int32_t writeLE(WriterI* _writer, const Ty& _value, Error* _err) { BX_ERROR_SCOPE(_err); - BX_STATIC_ASSERT(isTriviallyCopyable() ); + static_assert(isTriviallyCopyable() ); Ty value = toLittleEndian(_value); int32_t result = _writer->write(&value, sizeof(Ty), _err); return result; @@ -363,7 +363,7 @@ namespace bx inline int32_t writeBE(WriterI* _writer, const Ty& _value, Error* _err) { BX_ERROR_SCOPE(_err); - BX_STATIC_ASSERT(isTriviallyCopyable() ); + static_assert(isTriviallyCopyable() ); Ty value = toBigEndian(_value); int32_t result = _writer->write(&value, sizeof(Ty), _err); return result; @@ -404,9 +404,9 @@ namespace bx inline int32_t peek(ReaderSeekerI* _reader, void* _data, int32_t _size, Error* _err) { BX_ERROR_SCOPE(_err); - int64_t offset = bx::seek(_reader); + int64_t offset = seek(_reader); int32_t size = _reader->read(_data, _size, _err); - bx::seek(_reader, offset, bx::Whence::Begin); + seek(_reader, offset, Whence::Begin); return size; } @@ -414,19 +414,19 @@ namespace bx inline int32_t peek(ReaderSeekerI* _reader, Ty& _value, Error* _err) { BX_ERROR_SCOPE(_err); - BX_STATIC_ASSERT(isTriviallyCopyable() ); + static_assert(isTriviallyCopyable() ); return peek(_reader, &_value, sizeof(Ty), _err); } inline int32_t align(ReaderSeekerI* _reader, uint32_t _alignment, Error* _err) { BX_ERROR_SCOPE(_err); - const int64_t current = bx::seek(_reader); + const int64_t current = seek(_reader); const int64_t aligned = ( (current + _alignment-1)/_alignment) * _alignment; const int32_t size = int32_t(aligned - current); if (0 != size) { - const int64_t offset = bx::seek(_reader, size); + const int64_t offset = seek(_reader, size); if (offset != aligned) { BX_ERROR_SET(_err, kErrorReaderWriterWrite, "Align: read truncated."); @@ -440,7 +440,7 @@ namespace bx inline int32_t align(WriterSeekerI* _writer, uint32_t _alignment, Error* _err) { BX_ERROR_SCOPE(_err); - const int64_t current = bx::seek(_writer); + const int64_t current = seek(_writer); const int64_t aligned = ( (current + _alignment-1)/_alignment) * _alignment; const int32_t size = int32_t(aligned - current); if (0 != size) diff --git a/bx/include/bx/inline/ringbuffer.inl b/bx/include/bx/inline/ringbuffer.inl index 1cd9cb1b..6a900f71 100644 --- a/bx/include/bx/inline/ringbuffer.inl +++ b/bx/include/bx/inline/ringbuffer.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/rng.inl b/bx/include/bx/inline/rng.inl index 8650247e..80a96eba 100644 --- a/bx/include/bx/inline/rng.inl +++ b/bx/include/bx/inline/rng.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -56,11 +56,11 @@ namespace bx template inline float frndh(Rng* _rng) { - return 2.0f * bx::frnd(_rng) - 1.0f; + return 2.0f * frnd(_rng) - 1.0f; } template - inline bx::Vec3 randUnitCircle(Rng* _rng) + inline Vec3 randUnitCircle(Rng* _rng) { const float angle = frnd(_rng) * kPi2; @@ -73,7 +73,7 @@ namespace bx } template - inline bx::Vec3 randUnitSphere(Rng* _rng) + inline Vec3 randUnitSphere(Rng* _rng) { const float rand0 = frnd(_rng) * 2.0f - 1.0f; const float rand1 = frnd(_rng) * kPi2; @@ -88,14 +88,14 @@ namespace bx } template - inline bx::Vec3 randUnitHemisphere(Ty* _rng, const bx::Vec3& _normal) + inline Vec3 randUnitHemisphere(Ty* _rng, const Vec3& _normal) { - const bx::Vec3 dir = randUnitSphere(_rng); - const float ddotn = bx::dot(dir, _normal); + const Vec3 dir = randUnitSphere(_rng); + const float ddotn = dot(dir, _normal); if (0.0f > ddotn) { - return bx::neg(dir); + return neg(dir); } return dir; @@ -142,7 +142,7 @@ namespace bx for (uint32_t ii = 0, num = _num-1; ii < num; ++ii) { uint32_t jj = ii + 1 + _rng->gen() % (num - ii); - bx::swap(_array[ii], _array[jj]); + swap(_array[ii], _array[jj]); } } diff --git a/bx/include/bx/inline/simd128_langext.inl b/bx/include/bx/inline/simd128_langext.inl index 574507a5..d09c5d8d 100644 --- a/bx/include/bx/inline/simd128_langext.inl +++ b/bx/include/bx/inline/simd128_langext.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -9,7 +9,7 @@ namespace bx { - BX_CONST_FUNC float sqrtRef(float); + BX_CONSTEXPR_FUNC float sqrtRef(float); #define ELEMx 0 #define ELEMy 1 diff --git a/bx/include/bx/inline/simd128_neon.inl b/bx/include/bx/inline/simd128_neon.inl index ff1a5e44..e1401cd5 100644 --- a/bx/include/bx/inline/simd128_neon.inl +++ b/bx/include/bx/inline/simd128_neon.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/simd128_ref.inl b/bx/include/bx/inline/simd128_ref.inl index 8f1bb4ca..998b203d 100644 --- a/bx/include/bx/inline/simd128_ref.inl +++ b/bx/include/bx/inline/simd128_ref.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -9,8 +9,8 @@ namespace bx { - BX_CONST_FUNC float sqrt(float); - BX_CONST_FUNC float rsqrt(float); + BX_CONSTEXPR_FUNC float sqrt(float); + BX_CONSTEXPR_FUNC float rsqrt(float); #define ELEMx 0 #define ELEMy 1 diff --git a/bx/include/bx/inline/simd128_sse.inl b/bx/include/bx/inline/simd128_sse.inl index 61280565..9b3be715 100644 --- a/bx/include/bx/inline/simd128_sse.inl +++ b/bx/include/bx/inline/simd128_sse.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/simd256_avx.inl b/bx/include/bx/inline/simd256_avx.inl index 7ed7eb03..7b4fff1f 100644 --- a/bx/include/bx/inline/simd256_avx.inl +++ b/bx/include/bx/inline/simd256_avx.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/simd256_ref.inl b/bx/include/bx/inline/simd256_ref.inl index e17bdef7..51e62855 100644 --- a/bx/include/bx/inline/simd256_ref.inl +++ b/bx/include/bx/inline/simd256_ref.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/simd_ni.inl b/bx/include/bx/inline/simd_ni.inl index 69f41676..5acf12a2 100644 --- a/bx/include/bx/inline/simd_ni.inl +++ b/bx/include/bx/inline/simd_ni.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/inline/sort.inl b/bx/include/bx/inline/sort.inl index 6a4ca7f4..b94d3ac6 100644 --- a/bx/include/bx/inline/sort.inl +++ b/bx/include/bx/inline/sort.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -44,28 +44,28 @@ namespace bx template inline void quickSort(void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn) { - BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Element type must be trivially move assignable"); + static_assert(isTriviallyMoveAssignable(), "Element type must be trivially move assignable"); quickSort(_data, _num, _stride, _fn); } template inline void quickSort(Ty* _data, uint32_t _num, const ComparisonFn _fn) { - BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Element type must be trivially move assignable"); + static_assert(isTriviallyMoveAssignable(), "Element type must be trivially move assignable"); quickSort( (void*)_data, _num, sizeof(Ty), _fn); } template inline uint32_t unique(void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn) { - BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Element type must be trivially move assignable"); + static_assert(isTriviallyMoveAssignable(), "Element type must be trivially move assignable"); return unique(_data, _num, _stride, _fn); } template inline uint32_t unique(Ty* _data, uint32_t _num, const ComparisonFn _fn) { - BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Element type must be trivially move assignable"); + static_assert(isTriviallyMoveAssignable(), "Element type must be trivially move assignable"); return unique( (void*)_data, _num, sizeof(Ty), _fn); } @@ -189,7 +189,7 @@ done: template inline void radixSort(uint32_t* _keys, uint32_t* _tempKeys, Ty* _values, Ty* _tempValues, uint32_t _size) { - BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Sort element type must be trivially move assignable"); + static_assert(isTriviallyMoveAssignable(), "Sort element type must be trivially move assignable"); uint32_t* keys = _keys; uint32_t* tempKeys = _tempKeys; @@ -325,7 +325,7 @@ done: template inline void radixSort(uint64_t* _keys, uint64_t* _tempKeys, Ty* _values, Ty* _tempValues, uint32_t _size) { - BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Sort element type must be trivially move assignable"); + static_assert(isTriviallyMoveAssignable(), "Sort element type must be trivially move assignable"); uint64_t* keys = _keys; uint64_t* tempKeys = _tempKeys; diff --git a/bx/include/bx/inline/spscqueue.inl b/bx/include/bx/inline/spscqueue.inl index a73daecc..8576b9ce 100644 --- a/bx/include/bx/inline/spscqueue.inl +++ b/bx/include/bx/inline/spscqueue.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -27,7 +27,7 @@ namespace bx { Node* node = m_first; m_first = node->m_next; - bx::deleteObject(m_allocator, node); + deleteObject(m_allocator, node); } } @@ -39,7 +39,7 @@ namespace bx { Node* node = m_first; m_first = m_first->m_next; - bx::deleteObject(m_allocator, node); + deleteObject(m_allocator, node); } } diff --git a/bx/include/bx/inline/string.inl b/bx/include/bx/inline/string.inl index c2658a9b..32bf9062 100644 --- a/bx/include/bx/inline/string.inl +++ b/bx/include/bx/inline/string.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -61,6 +61,17 @@ namespace bx return m_ptr; } + inline void StringLiteral::clear() + { + m_ptr = ""; + m_len = 0; + } + + inline bool StringLiteral::isEmpty() const + { + return 0 == m_len; + } + inline StringView::StringView() { clear(); @@ -176,7 +187,7 @@ namespace bx return m_0terminated; } - template + template inline StringT::StringT() : StringView() , m_capacity(0) @@ -184,7 +195,7 @@ namespace bx clear(); } - template + template inline StringT::StringT(const StringT& _rhs) : StringView() , m_capacity(0) @@ -192,7 +203,7 @@ namespace bx set(_rhs); } - template + template inline StringT::StringT(const StringView& _rhs) : StringView() , m_capacity(0) @@ -200,27 +211,27 @@ namespace bx set(_rhs); } - template + template inline StringT::~StringT() { clear(); } - template + template inline StringT& StringT::operator=(const StringT& _rhs) { set(_rhs); return *this; } - template + template inline void StringT::set(const StringView& _str) { clear(); append(_str); } - template + template inline void StringT::append(const StringView& _str) { if (0 != _str.getLength() ) @@ -233,7 +244,7 @@ namespace bx if (len+1 > m_capacity) { const int32_t capacity = alignUp(len+1, 256); - ptr = (char*)bx::realloc(*AllocatorT, 0 != m_capacity ? ptr : NULL, capacity); + ptr = (char*)realloc(*AllocatorT, 0 != m_capacity ? ptr : NULL, capacity); *const_cast(&m_ptr) = ptr; m_capacity = capacity; @@ -244,27 +255,27 @@ namespace bx } } - template + template inline void StringT::append(const char* _ptr, const char* _term) { append(StringView(_ptr, _term) ); } - template + template inline void StringT::clear() { m_0terminated = true; if (0 != m_capacity) { - bx::free(*AllocatorT, const_cast(m_ptr) ); + free(*AllocatorT, const_cast(m_ptr) ); StringView::clear(); m_capacity = 0; } } - template + template inline const char* StringT::getCPtr() const { return getPtr(); @@ -275,7 +286,7 @@ namespace bx return StringView(_str, _start, _len); } - inline LineReader::LineReader(const bx::StringView& _str) + inline LineReader::LineReader(const StringView& _str) : m_str(_str) { reset(); @@ -294,7 +305,7 @@ namespace bx ++m_line; StringView curr(m_curr); - m_curr = bx::strFindNl(m_curr); + m_curr = strFindNl(m_curr); StringView line(curr.getPtr(), m_curr.getPtr() ); diff --git a/bx/include/bx/inline/typetraits.inl b/bx/include/bx/inline/typetraits.inl index 26be3690..a26ca1e6 100644 --- a/bx/include/bx/inline/typetraits.inl +++ b/bx/include/bx/inline/typetraits.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -464,6 +464,58 @@ namespace bx return IsUnsignedT::value; } + //--- + template struct MakeSignedT { using Type = Ty; }; + template using MakeSignedType = typename MakeSignedT::Type; + + template struct MakeSignedT : AddConstT > {}; + template struct MakeSignedT : AddVolatileT> {}; + template struct MakeSignedT : AddCvT > {}; + + template<> struct MakeSignedT< char > { using Type = signed char; }; + template<> struct MakeSignedT< signed char > { using Type = signed char; }; + template<> struct MakeSignedT { using Type = signed char; }; + template<> struct MakeSignedT< short > { using Type = signed short; }; + template<> struct MakeSignedT { using Type = signed short; }; + template<> struct MakeSignedT< int > { using Type = signed int; }; + template<> struct MakeSignedT { using Type = signed int; }; + template<> struct MakeSignedT< long > { using Type = signed long; }; + template<> struct MakeSignedT { using Type = signed long; }; + template<> struct MakeSignedT< long long> { using Type = signed long long; }; + template<> struct MakeSignedT { using Type = signed long long; }; + + template + inline constexpr auto asSigned(Ty _value) + { + return MakeSignedType(_value); + } + + //--- + template struct MakeUnsignedT { using Type = Ty; }; + template using MakeUnsignedType = typename MakeUnsignedT::Type; + + template struct MakeUnsignedT : AddConstT > {}; + template struct MakeUnsignedT : AddVolatileT> {}; + template struct MakeUnsignedT : AddCvT > {}; + + template<> struct MakeUnsignedT< char > { using Type = unsigned char; }; + template<> struct MakeUnsignedT< signed char > { using Type = unsigned char; }; + template<> struct MakeUnsignedT { using Type = unsigned char; }; + template<> struct MakeUnsignedT< short > { using Type = unsigned short; }; + template<> struct MakeUnsignedT { using Type = unsigned short; }; + template<> struct MakeUnsignedT< int > { using Type = unsigned int; }; + template<> struct MakeUnsignedT { using Type = unsigned int; }; + template<> struct MakeUnsignedT< long > { using Type = unsigned long; }; + template<> struct MakeUnsignedT { using Type = unsigned long; }; + template<> struct MakeUnsignedT< long long> { using Type = unsigned long long; }; + template<> struct MakeUnsignedT { using Type = unsigned long long; }; + + template + inline constexpr auto asUnsigned(Ty _value) + { + return MakeUnsignedType(_value); + } + //--- template struct IsIntegerT : FalseConstant {}; template<> struct IsIntegerT : TrueConstant {}; @@ -539,7 +591,7 @@ namespace bx template inline constexpr Ty&& forward(RemoveReferenceType&& _a) { - BX_STATIC_ASSERT(!isLvalueReference(), "Can not forward an Rvalue as an Lvalue."); + static_assert(!isLvalueReference(), "Can not forward an Rvalue as an Lvalue."); return static_cast(_a); } diff --git a/bx/include/bx/inline/uint32_t.inl b/bx/include/bx/inline/uint32_t.inl index 7db37887..34b92a19 100644 --- a/bx/include/bx/inline/uint32_t.inl +++ b/bx/include/bx/inline/uint32_t.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -307,7 +307,6 @@ namespace bx return result; } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(uint32_t _val) { #if BX_COMPILER_GCC || BX_COMPILER_CLANG @@ -335,35 +334,6 @@ namespace bx #endif // BX_COMPILER_* } - template<> - inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(unsigned long long _val) - { -#if BX_COMPILER_GCC || BX_COMPILER_CLANG - return __builtin_popcountll(_val); -#else - const uint32_t lo = uint32_t(_val&UINT32_MAX); - const uint32_t hi = uint32_t(_val>>32); - - return uint32_cntbits(lo) - + uint32_cntbits(hi) - ; -#endif // BX_COMPILER_* - } - - template<> - inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(unsigned long _val) - { - return uint32_cntbits(_val); - } - - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(uint8_t _val) { return uint32_cntbits(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(int8_t _val) { return uint32_cntbits(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(uint16_t _val) { return uint32_cntbits(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(int16_t _val) { return uint32_cntbits(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(int32_t _val) { return uint32_cntbits(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(int64_t _val) { return uint32_cntbits(_val); } - - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(uint32_t _val) { #if BX_COMPILER_GCC || BX_COMPILER_CLANG @@ -386,33 +356,6 @@ namespace bx #endif // BX_COMPILER_* } - template<> - inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(unsigned long long _val) - { -#if BX_COMPILER_GCC || BX_COMPILER_CLANG - return 0 == _val ? 64 : __builtin_clzll(_val); -#else - return _val & UINT64_C(0xffffffff00000000) - ? uint32_cntlz(uint32_t(_val>>32) ) - : uint32_cntlz(uint32_t(_val) ) + 32 - ; -#endif // BX_COMPILER_* - } - - template<> - inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(unsigned long _val) - { - return uint32_cntlz(_val); - } - - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(uint8_t _val) { return uint32_cntlz(_val)-24; } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(int8_t _val) { return uint32_cntlz(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(uint16_t _val) { return uint32_cntlz(_val)-16; } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(int16_t _val) { return uint32_cntlz(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(int32_t _val) { return uint32_cntlz(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(int64_t _val) { return uint32_cntlz(_val); } - - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(uint32_t _val) { #if BX_COMPILER_GCC || BX_COMPILER_CLANG @@ -427,32 +370,11 @@ namespace bx #endif // BX_COMPILER_* } - template<> - inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(unsigned long long _val) + inline BX_CONSTEXPR_FUNC uint32_t uint32_ffs(uint32_t _x) { -#if BX_COMPILER_GCC || BX_COMPILER_CLANG - return 0 == _val ? 64 : __builtin_ctzll(_val); -#else - return _val & UINT64_C(0xffffffff) - ? uint32_cnttz(uint32_t(_val) ) - : uint32_cnttz(uint32_t(_val>>32) ) + 32 - ; -#endif // BX_COMPILER_* - } - - template<> - inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(unsigned long _val) - { - return uint32_cnttz(_val); + return 0 == _x ? 0 : uint32_cnttz(_x) + 1; } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(uint8_t _val) { return bx::min(8u, uint32_cnttz(_val) ); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(int8_t _val) { return uint32_cnttz(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(uint16_t _val) { return bx::min(16u, uint32_cnttz(_val) ); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(int16_t _val) { return uint32_cnttz(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(int32_t _val) { return uint32_cnttz(_val); } - template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(int64_t _val) { return uint32_cnttz(_val); } - inline BX_CONSTEXPR_FUNC uint32_t uint32_part1by1(uint32_t _a) { // shuffle: @@ -537,32 +459,6 @@ namespace bx return result; } - inline BX_CONSTEXPR_FUNC uint32_t uint64_cntbits(uint64_t _val) - { - const uint32_t lo = uint32_t(_val&UINT32_MAX); - const uint32_t hi = uint32_t(_val>>32); - - const uint32_t total = bx::uint32_cntbits(lo) - + bx::uint32_cntbits(hi); - return total; - } - - inline BX_CONSTEXPR_FUNC uint32_t uint64_cntlz(uint64_t _val) - { - return _val & UINT64_C(0xffffffff00000000) - ? uint32_cntlz(uint32_t(_val>>32) ) - : uint32_cntlz(uint32_t(_val) ) + 32 - ; - } - - inline BX_CONSTEXPR_FUNC uint32_t uint64_cnttz(uint64_t _val) - { - return _val & UINT64_C(0xffffffff) - ? uint32_cnttz(uint32_t(_val) ) - : uint32_cnttz(uint32_t(_val>>32) ) + 32 - ; - } - inline BX_CONSTEXPR_FUNC uint64_t uint64_li(uint64_t _a) { return _a; @@ -663,6 +559,44 @@ namespace bx return _a * _b; } + inline BX_CONSTEXPR_FUNC uint64_t uint64_cntbits(uint64_t _val) + { +#if BX_COMPILER_GCC || BX_COMPILER_CLANG + return __builtin_popcountll(_val); +#else + const uint32_t lo = uint32_t(_val&UINT32_MAX); + const uint32_t hi = uint32_t(_val>>32); + + return uint32_cntbits(lo) + + uint32_cntbits(hi) + ; +#endif // BX_COMPILER_* + } + + inline BX_CONSTEXPR_FUNC uint64_t uint64_cntlz(uint64_t _val) + { +#if BX_COMPILER_GCC || BX_COMPILER_CLANG + return 0 == _val ? 64 : __builtin_clzll(_val); +#else + return _val & UINT64_C(0xffffffff00000000) + ? uint32_cntlz(uint32_t(_val>>32) ) + : uint32_cntlz(uint32_t(_val) ) + 32 + ; +#endif // BX_COMPILER_* + } + + inline BX_CONSTEXPR_FUNC uint64_t uint64_cnttz(uint64_t _val) + { +#if BX_COMPILER_GCC || BX_COMPILER_CLANG + return 0 == _val ? 64 : __builtin_ctzll(_val); +#else + return _val & UINT64_C(0xffffffff) + ? uint32_cnttz(uint32_t(_val) ) + : uint32_cnttz(uint32_t(_val>>32) ) + 32 + ; +#endif // BX_COMPILER_* + } + inline BX_CONSTEXPR_FUNC uint32_t uint32_gcd(uint32_t _a, uint32_t _b) { do @@ -708,74 +642,73 @@ namespace bx template inline BX_CONSTEXPR_FUNC bool isAligned(Ty _a, int32_t _align) { - const Ty mask = Ty(_align - 1); + const Ty mask = Ty(max(1, _align) - 1); return 0 == (_a & mask); } template inline BX_CONSTEXPR_FUNC bool isAligned(Ty* _ptr, int32_t _align) { - union { const void* ptr; uintptr_t addr; } un = { _ptr }; - return isAligned(un.addr, _align); + const uintptr_t addr = bitCast(_ptr); + return isAligned(addr, _align); } template inline BX_CONSTEXPR_FUNC bool isAligned(const Ty* _ptr, int32_t _align) { - union { const void* ptr; uintptr_t addr; } un = { _ptr }; - return isAligned(un.addr, _align); + const uintptr_t addr = bitCast(_ptr); + return isAligned(addr, _align); } template - inline BX_CONSTEXPR_FUNC Ty alignDown(Ty _a, int32_t _align) + inline BX_CONSTEXPR_FUNC Ty alignDown(Ty _a, int32_t _align) { - const Ty mask = Ty(_align - 1); + const Ty mask = Ty(max(1, _align) - 1); return Ty(_a & ~mask); } template inline BX_CONSTEXPR_FUNC Ty* alignDown(Ty* _ptr, int32_t _align) { - union { Ty* ptr; uintptr_t addr; } un = { _ptr }; - un.addr = alignDown(un.addr, _align); - return un.ptr; + uintptr_t addr = bitCast(_ptr); + addr = alignDown(addr, _align); + return bitCast(addr); } template inline BX_CONSTEXPR_FUNC const Ty* alignDown(const Ty* _ptr, int32_t _align) { - union { const Ty* ptr; uintptr_t addr; } un = { _ptr }; - un.addr = alignDown(un.addr, _align); - return un.ptr; + uintptr_t addr = bitCast(_ptr); + addr = alignDown(addr, _align); + return bitCast(addr); } template inline BX_CONSTEXPR_FUNC Ty alignUp(Ty _a, int32_t _align) { - const Ty mask = Ty(_align - 1); + const Ty mask = Ty(max(1, _align) - 1); return Ty( (_a + mask) & ~mask); } template inline BX_CONSTEXPR_FUNC Ty* alignUp(Ty* _ptr, int32_t _align) { - union { Ty* ptr; uintptr_t addr; } un = { _ptr }; - un.addr = alignUp(un.addr, _align); - return un.ptr; + uintptr_t addr = bitCast(_ptr); + addr = alignUp(addr, _align); + return bitCast(addr); } template inline BX_CONSTEXPR_FUNC const Ty* alignUp(const Ty* _ptr, int32_t _align) { - union { const Ty* ptr; uintptr_t addr; } un = { _ptr }; - un.addr = alignUp(un.addr, _align); - return un.ptr; + uintptr_t addr = bitCast(_ptr); + addr = alignUp(addr, _align); + return bitCast(addr); } inline BX_CONST_FUNC uint16_t halfFromFloat(float _a) { - union { uint32_t ui; float flt; } ftou; - ftou.flt = _a; + const uint32_t a_as_ui = bitCast(_a); const uint32_t one = uint32_li(0x00000001); const uint32_t f_s_mask = uint32_li(kFloatSignMask); @@ -794,13 +727,13 @@ namespace bx const uint32_t f_h_m_pos_offset = uint32_li(0x0000000d); const uint32_t h_nan_min = uint32_li(0x00007c01); const uint32_t f_h_e_biased_flag = uint32_li(0x0000008f); - const uint32_t f_s = uint32_and(ftou.ui, f_s_mask); - const uint32_t f_e = uint32_and(ftou.ui, f_e_mask); + const uint32_t f_s = uint32_and(a_as_ui, f_s_mask); + const uint32_t f_e = uint32_and(a_as_ui, f_e_mask); const uint16_t h_s = (uint16_t)uint32_srl(f_s, f_h_s_pos_offset); - const uint32_t f_m = uint32_and(ftou.ui, f_m_mask); + const uint32_t f_m = uint32_and(a_as_ui, f_m_mask); const uint16_t f_e_amount = (uint16_t)uint32_srl(f_e, f_e_pos); const uint32_t f_e_half_bias = uint32_sub(f_e_amount, f_h_bias_offset); - const uint32_t f_snan = uint32_and(ftou.ui, f_snan_mask); + const uint32_t f_snan = uint32_and(a_as_ui, f_snan_mask); const uint32_t f_m_round_mask = uint32_and(f_m, f_m_round_bit); const uint32_t f_m_round_offset = uint32_sll(f_m_round_mask, one); const uint32_t f_m_rounded = uint32_add(f_m, f_m_round_offset); @@ -836,7 +769,7 @@ namespace bx const uint32_t h_em_snan_result = uint32_sels(is_f_snan_msb, h_snan_mask, h_em_denorm_result); const uint32_t h_result = uint32_or(h_s, h_em_snan_result); - return (uint16_t)(h_result); + return uint16_t(h_result); } inline BX_CONST_FUNC float halfToFloat(uint16_t _a) @@ -883,9 +816,7 @@ namespace bx const uint32_t f_nan_result = uint32_sels(is_nan_msb, f_em_nan, f_inf_result); const uint32_t f_result = uint32_or(f_s, f_nan_result); - union { uint32_t ui; float flt; } utof; - utof.ui = f_result; - return utof.flt; + return bitCast(f_result); } } // namespace bx diff --git a/bx/include/bx/macros.h b/bx/include/bx/macros.h index d66cb20b..c4037203 100644 --- a/bx/include/bx/macros.h +++ b/bx/include/bx/macros.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -10,17 +10,7 @@ #ifndef BX_MACROS_H_HEADER_GUARD #define BX_MACROS_H_HEADER_GUARD -/// -#if BX_COMPILER_MSVC -// Workaround MSVS bug... -# define BX_VA_ARGS_PASS(...) BX_VA_ARGS_PASS_1_ __VA_ARGS__ BX_VA_ARGS_PASS_2_ -# define BX_VA_ARGS_PASS_1_ ( -# define BX_VA_ARGS_PASS_2_ ) -#else -# define BX_VA_ARGS_PASS(...) (__VA_ARGS__) -#endif // BX_COMPILER_MSVC - -#define BX_VA_ARGS_COUNT(...) BX_VA_ARGS_COUNT_ BX_VA_ARGS_PASS(__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#define BX_VA_ARGS_COUNT(...) BX_VA_ARGS_COUNT_(__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) #define BX_VA_ARGS_COUNT_(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11, _a12, _a13, _a14, _a15, _a16, _last, ...) _last /// @@ -60,49 +50,32 @@ #if BX_COMPILER_GCC || BX_COMPILER_CLANG # define BX_ASSUME(_condition) BX_MACRO_BLOCK_BEGIN if (!(_condition) ) { __builtin_unreachable(); } BX_MACRO_BLOCK_END # define BX_ALIGN_DECL(_align, _decl) _decl __attribute__( (aligned(_align) ) ) -# define BX_ALLOW_UNUSED __attribute__( (unused) ) # define BX_FORCE_INLINE inline __attribute__( (__always_inline__) ) # define BX_FUNCTION __PRETTY_FUNCTION__ # define BX_LIKELY(_x) __builtin_expect(!!(_x), 1) # define BX_UNLIKELY(_x) __builtin_expect(!!(_x), 0) # define BX_NO_INLINE __attribute__( (noinline) ) -# define BX_NO_RETURN __attribute__( (noreturn) ) # define BX_CONST_FUNC __attribute__( (pure) ) # define BX_UNREACHABLE __builtin_unreachable() - -# if BX_COMPILER_GCC >= 70000 -# define BX_FALLTHROUGH __attribute__( (fallthrough) ) -# else -# define BX_FALLTHROUGH BX_NOOP() -# endif // BX_COMPILER_GCC >= 70000 - # define BX_NO_VTABLE # define BX_PRINTF_ARGS(_format, _args) __attribute__( (format(__printf__, _format, _args) ) ) - -# if BX_CLANG_HAS_FEATURE(cxx_thread_local) \ - || (!BX_PLATFORM_OSX && (BX_COMPILER_GCC >= 40200) ) \ - || (BX_COMPILER_GCC >= 40500) -# define BX_THREAD_LOCAL __thread -# endif // BX_COMPILER_GCC - +# define BX_THREAD_LOCAL __thread # define BX_ATTRIBUTE(_x) __attribute__( (_x) ) # if BX_CRT_MSVC # define __stdcall # endif // BX_CRT_MSVC + #elif BX_COMPILER_MSVC # define BX_ASSUME(_condition) __assume(_condition) # define BX_ALIGN_DECL(_align, _decl) __declspec(align(_align) ) _decl -# define BX_ALLOW_UNUSED # define BX_FORCE_INLINE __forceinline # define BX_FUNCTION __FUNCTION__ # define BX_LIKELY(_x) (_x) # define BX_UNLIKELY(_x) (_x) # define BX_NO_INLINE __declspec(noinline) -# define BX_NO_RETURN # define BX_CONST_FUNC __declspec(noalias) # define BX_UNREACHABLE __assume(false) -# define BX_FALLTHROUGH BX_NOOP() # define BX_NO_VTABLE __declspec(novtable) # define BX_PRINTF_ARGS(_format, _args) # define BX_THREAD_LOCAL __declspec(thread) @@ -115,9 +88,6 @@ /// #define BX_CONSTEXPR_FUNC constexpr BX_CONST_FUNC -/// -#define BX_STATIC_ASSERT(_condition, ...) static_assert(_condition, "" __VA_ARGS__) - /// #define BX_ALIGN_DECL_16(_decl) BX_ALIGN_DECL(16, _decl) #define BX_ALIGN_DECL_256(_decl) BX_ALIGN_DECL(256, _decl) @@ -149,12 +119,7 @@ #define BX_UNUSED_11(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11) BX_UNUSED_10(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10); BX_UNUSED_1(_a11) #define BX_UNUSED_12(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11, _a12) BX_UNUSED_11(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11); BX_UNUSED_1(_a12) -#if BX_COMPILER_MSVC -// Workaround MSVS bug... -# define BX_UNUSED(...) BX_MACRO_DISPATCHER(BX_UNUSED_, __VA_ARGS__) BX_VA_ARGS_PASS(__VA_ARGS__) -#else -# define BX_UNUSED(...) BX_MACRO_DISPATCHER(BX_UNUSED_, __VA_ARGS__)(__VA_ARGS__) -#endif // BX_COMPILER_MSVC +#define BX_UNUSED(...) BX_MACRO_DISPATCHER(BX_UNUSED_, __VA_ARGS__)(__VA_ARGS__) /// #if BX_COMPILER_CLANG @@ -167,7 +132,7 @@ # define BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG(_x) #endif // BX_COMPILER_CLANG -#if BX_COMPILER_GCC && BX_COMPILER_GCC >= 40600 +#if BX_COMPILER_GCC # define BX_PRAGMA_DIAGNOSTIC_PUSH_GCC_() _Pragma("GCC diagnostic push") # define BX_PRAGMA_DIAGNOSTIC_POP_GCC_() _Pragma("GCC diagnostic pop") # define BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC(_x) _Pragma(BX_STRINGIZE(GCC diagnostic ignored _x) ) @@ -229,18 +194,13 @@ #define BX_CLASS_2(_class, _a1, _a2) BX_CLASS_1(_class, _a1); BX_CLASS_1(_class, _a2) #define BX_CLASS_3(_class, _a1, _a2, _a3) BX_CLASS_2(_class, _a1, _a2); BX_CLASS_1(_class, _a3) #define BX_CLASS_4(_class, _a1, _a2, _a3, _a4) BX_CLASS_3(_class, _a1, _a2, _a3); BX_CLASS_1(_class, _a4) - -#if BX_COMPILER_MSVC -# define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__) BX_VA_ARGS_PASS(_class, __VA_ARGS__) -#else -# define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__)(_class, __VA_ARGS__) -#endif // BX_COMPILER_MSVC +#define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__)(_class, __VA_ARGS__) #ifndef BX_ASSERT # if BX_CONFIG_DEBUG # define BX_ASSERT _BX_ASSERT # else -# define BX_ASSERT(_condition, ...) BX_NOOP() +# define BX_ASSERT(...) BX_NOOP() # endif // BX_CONFIG_DEBUG #endif // BX_ASSERT @@ -248,7 +208,7 @@ # if BX_CONFIG_DEBUG # define BX_ASSERT_LOC _BX_ASSERT_LOC # else -# define BX_ASSERT_LOC(...) BX_NOOP() +# define BX_ASSERT_LOC(_location, ...) BX_MACRO_BLOCK_BEGIN BX_UNUSED(_location) BX_MACRO_BLOCK_END # endif // BX_CONFIG_DEBUG #endif // BX_ASSERT_LOC @@ -264,7 +224,7 @@ # if BX_CONFIG_DEBUG # define BX_TRACE_LOC _BX_TRACE_LOC # else -# define BX_TRACE_LOC(...) BX_NOOP() +# define BX_TRACE_LOC(_location, ...) BX_MACRO_BLOCK_BEGIN BX_UNUSED(_location) BX_MACRO_BLOCK_END # endif // BX_CONFIG_DEBUG #endif // BX_TRACE_LOC @@ -272,7 +232,7 @@ # if BX_CONFIG_DEBUG # define BX_WARN _BX_WARN # else -# define BX_WARN(_condition, ...) BX_NOOP() +# define BX_WARN(...) BX_NOOP() # endif // BX_CONFIG_DEBUG #endif // BX_ASSERT @@ -280,7 +240,7 @@ # if BX_CONFIG_DEBUG # define BX_WARN_LOC _BX_WARN_LOC # else -# define BX_WARN_LOC(...) BX_NOOP() +# define BX_WARN_LOC(_location, ...) BX_MACRO_BLOCK_BEGIN BX_UNUSED(_location) BX_MACRO_BLOCK_END # endif // BX_CONFIG_DEBUG #endif // BX_WARN_LOC @@ -294,6 +254,24 @@ bx::debugPrintf("%s(%d): BX " _format "\n", _location.filePath, _location.line, ##__VA_ARGS__); \ BX_MACRO_BLOCK_END +#define _BX_ASSERT(_condition, _format, ...) \ + BX_MACRO_BLOCK_BEGIN \ + if (!BX_IGNORE_C4127(_condition) \ + && bx::assertFunction(bx::Location::current(), "ASSERT %s -> " _format, #_condition, ##__VA_ARGS__) ) \ + { \ + bx::debugBreak(); \ + } \ + BX_MACRO_BLOCK_END + +#define _BX_ASSERT_LOC(_location, _condition, _format, ...) \ + BX_MACRO_BLOCK_BEGIN \ + if (!BX_IGNORE_C4127(_condition) \ + && bx::assertFunction(_location, "ASSERT %s -> " _format, #_condition, ##__VA_ARGS__) ) \ + { \ + bx::debugBreak(); \ + } \ + BX_MACRO_BLOCK_END + #define _BX_WARN(_condition, _format, ...) \ BX_MACRO_BLOCK_BEGIN \ if (!BX_IGNORE_C4127(_condition) ) \ @@ -302,24 +280,6 @@ } \ BX_MACRO_BLOCK_END -#define _BX_ASSERT(_condition, _format, ...) \ - BX_MACRO_BLOCK_BEGIN \ - if (!BX_IGNORE_C4127(_condition) ) \ - { \ - BX_TRACE("ASSERT " _format, ##__VA_ARGS__); \ - bx::debugBreak(); \ - } \ - BX_MACRO_BLOCK_END - -#define _BX_ASSERT_LOC(_location, _condition, _format, ...) \ - BX_MACRO_BLOCK_BEGIN \ - if (!BX_IGNORE_C4127(_condition) ) \ - { \ - _BX_TRACE_LOC(_location, "ASSERT " _format, ##__VA_ARGS__); \ - bx::debugBreak(); \ - } \ - BX_MACRO_BLOCK_END - #define _BX_WARN_LOC(_location, _condition, _format, ...) \ BX_MACRO_BLOCK_BEGIN \ if (!BX_IGNORE_C4127(_condition) ) \ diff --git a/bx/include/bx/maputil.h b/bx/include/bx/maputil.h deleted file mode 100644 index 51648b1d..00000000 --- a/bx/include/bx/maputil.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bx/blob/master/LICENSE - */ - -#ifndef BX_MAPUTIL_H_HEADER_GUARD -#define BX_MAPUTIL_H_HEADER_GUARD - -#include "bx.h" - -namespace bx -{ - template - typename MapType::iterator mapInsertOrUpdate(MapType& _map, const typename MapType::key_type& _key, const typename MapType::mapped_type& _value) - { - typename MapType::iterator it = _map.lower_bound(_key); - if (it != _map.end() - && !_map.key_comp()(_key, it->first) ) - { - it->second = _value; - return it; - } - - typename MapType::value_type pair(_key, _value); - return _map.insert(it, pair); - } - - template - bool mapRemove(MapType& _map, const typename MapType::value_type::first_type& _first) - { - typename MapType::const_iterator it = _map.find(_first); - if (it != _map.end() ) - { - _map.erase(it); - return true; - } - - return false; - } - - template - bool mapRemove(MapType& _map, const typename MapType::value_type::second_type& _second) - { - for (typename MapType::const_iterator it = _map.begin(), itEnd = _map.end(); it != itEnd; ++it) - { - if (it->second == _second) - { - _map.erase(it); - return true; - } - } - - return false; - } - -} // namespace bx - -#endif // BX_MAPUTIL_H_HEADER_GUARD diff --git a/bx/include/bx/math.h b/bx/include/bx/math.h index facf64cf..ad7a24c1 100644 --- a/bx/include/bx/math.h +++ b/bx/include/bx/math.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -108,47 +108,47 @@ namespace bx /// Reinterprets the bit pattern of _a as uint32_t. /// - BX_CONST_FUNC uint32_t floatToBits(float _a); + BX_CONSTEXPR_FUNC uint32_t floatToBits(float _a); /// Reinterprets the bit pattern of _a as float. /// - BX_CONST_FUNC float bitsToFloat(uint32_t _a); + BX_CONSTEXPR_FUNC float bitsToFloat(uint32_t _a); /// Reinterprets the bit pattern of _a as uint64_t. /// - BX_CONST_FUNC uint64_t doubleToBits(double _a); + BX_CONSTEXPR_FUNC uint64_t doubleToBits(double _a); /// Reinterprets the bit pattern of _a as double. /// - BX_CONST_FUNC double bitsToDouble(uint64_t _a); + BX_CONSTEXPR_FUNC double bitsToDouble(uint64_t _a); /// Returns sortable floating point value. /// - BX_CONST_FUNC uint32_t floatFlip(uint32_t _value); + BX_CONSTEXPR_FUNC uint32_t floatFlip(uint32_t _value); /// Returns true if _f is a number that is NaN. /// - BX_CONST_FUNC bool isNan(float _f); + BX_CONSTEXPR_FUNC bool isNan(float _f); /// Returns true if _f is a number that is NaN. /// - BX_CONST_FUNC bool isNan(double _f); + BX_CONSTEXPR_FUNC bool isNan(double _f); /// Returns true if _f is not infinite and is not a NaN. /// - BX_CONST_FUNC bool isFinite(float _f); + BX_CONSTEXPR_FUNC bool isFinite(float _f); /// Returns true if _f is not infinite and is not a NaN. /// - BX_CONST_FUNC bool isFinite(double _f); + BX_CONSTEXPR_FUNC bool isFinite(double _f); /// Returns true if _f is infinite and is not a NaN. /// - BX_CONST_FUNC bool isInfinite(float _f); + BX_CONSTEXPR_FUNC bool isInfinite(float _f); /// Returns true if _f is infinite and is not a NaN. /// - BX_CONST_FUNC bool isInfinite(double _f); + BX_CONSTEXPR_FUNC bool isInfinite(double _f); /// Returns the largest integer value not greater than _f. /// @@ -184,7 +184,7 @@ namespace bx /// /// @returns `true` if `_a` is less than zero, otherwise returns `false`. /// - BX_CONSTEXPR_FUNC bool signbit(float _a); + BX_CONSTEXPR_FUNC bool signBit(float _a); /// Returns value with the magnitude `_value`, and the sign of `_sign`. /// @@ -193,7 +193,7 @@ namespace bx /// /// @returns Value with the magnitude `_value`, and the sign of `_sign`. /// - BX_CONSTEXPR_FUNC float copysign(float _value, float _sign); + BX_CONSTEXPR_FUNC float copySign(float _value, float _sign); /// Returns the absolute of _a. /// @@ -203,53 +203,60 @@ namespace bx /// BX_CONSTEXPR_FUNC float square(float _a); + /// Returns the both sine and cosine of the argument _a. + /// + /// @remarks The function calculates cosine, and then approximates sine based on the cosine + /// result. Therefore calculation of sine is less accurate than calling `bx::sin` function. + /// + void sinCosApprox(float& _outSinApprox, float& _outCos, float _a); + /// Returns the sine of the argument _a. /// - BX_CONST_FUNC float sin(float _a); + BX_CONSTEXPR_FUNC float sin(float _a); /// Returns hyperbolic sine of the argument _a. /// - BX_CONST_FUNC float sinh(float _a); + BX_CONSTEXPR_FUNC float sinh(float _a); /// Returns radian angle between -pi/2 and +pi/2 whose sine is _a. /// - BX_CONST_FUNC float asin(float _a); + BX_CONSTEXPR_FUNC float asin(float _a); /// Returns the cosine of the argument _a. /// - BX_CONST_FUNC float cos(float _a); + BX_CONSTEXPR_FUNC float cos(float _a); /// Returns hyperbolic cosine of the argument _a. /// - BX_CONST_FUNC float cosh(float _a); + BX_CONSTEXPR_FUNC float cosh(float _a); /// Returns radian angle between 0 and pi whose cosine is _a. /// - BX_CONST_FUNC float acos(float _a); + BX_CONSTEXPR_FUNC float acos(float _a); /// Returns the circular tangent of the radian argument _a. /// - BX_CONST_FUNC float tan(float _a); + BX_CONSTEXPR_FUNC float tan(float _a); /// Returns hyperbolic tangent of the argument _a. /// - BX_CONST_FUNC float tanh(float _a); + BX_CONSTEXPR_FUNC float tanh(float _a); /// Returns radian angle between -pi/2 and +pi/2 whose tangent is _a. /// - BX_CONST_FUNC float atan(float _a); + BX_CONSTEXPR_FUNC float atan(float _a); /// Returns the inverse tangent of _y/_x. /// - BX_CONST_FUNC float atan2(float _y, float _x); + BX_CONSTEXPR_FUNC float atan2(float _y, float _x); /// Computes _a raised to the _b power. /// - BX_CONST_FUNC float pow(float _a, float _b); + BX_CONSTEXPR_FUNC float pow(float _a, float _b); - /// Returns the result of multiplying _a by 2 raised to the power of the exponent. + /// Returns the result of multiplying _a by 2 raised to the power of the exponent `_a * (2^_b)`. /// - BX_CONST_FUNC float ldexp(float _a, int32_t _b); + BX_CONSTEXPR_FUNC float ldexp(float _a, int32_t _b); /// Returns decomposed given floating point value _a into a normalized fraction and /// an integral power of two. @@ -258,28 +265,67 @@ namespace bx /// Returns e (2.71828...) raised to the _a power. /// - BX_CONST_FUNC float exp(float _a); + BX_CONSTEXPR_FUNC float exp(float _a); /// Returns 2 raised to the _a power. /// - BX_CONST_FUNC float exp2(float _a); + BX_CONSTEXPR_FUNC float exp2(float _a); /// Returns the base e (2.71828...) logarithm of _a. /// - BX_CONST_FUNC float log(float _a); + BX_CONSTEXPR_FUNC float log(float _a); /// Returns the base 2 logarithm of _a. /// + BX_CONSTEXPR_FUNC float log2(float _a); + + /// Count number of bits set. + /// + template + BX_CONSTEXPR_FUNC uint8_t countBits(Ty _val); + + /// Count number of leading zeros. + /// + template + BX_CONSTEXPR_FUNC uint8_t countLeadingZeros(Ty _val); + + /// Count number of trailing zeros. + /// + template + BX_CONSTEXPR_FUNC uint8_t countTrailingZeros(Ty _val); + + /// Find first set. + /// + template + BX_CONSTEXPR_FUNC uint8_t findFirstSet(Ty _val); + + /// Find last set. + /// + template + BX_CONSTEXPR_FUNC uint8_t findLastSet(Ty _val); + + /// Returns the next smallest integer base 2 logarithm of _a. + /// template - BX_CONST_FUNC Ty log2(Ty _a); + BX_CONSTEXPR_FUNC uint8_t ceilLog2(Ty _a); + + /// Returns the next biggest integer base 2 logarithm of _a. + /// + template + BX_CONSTEXPR_FUNC uint8_t floorLog2(Ty _a); + + /// Returns the next smallest power of two value. + /// + template + BX_CONSTEXPR_FUNC Ty nextPow2(Ty _a); /// Returns the square root of _a. /// - BX_CONST_FUNC float sqrt(float _a); + BX_CONSTEXPR_FUNC float sqrt(float _a); /// Returns reciprocal square root of _a. /// - BX_CONST_FUNC float rsqrt(float _a); + BX_CONSTEXPR_FUNC float rsqrt(float _a); /// Returns the nearest integer not greater in magnitude than _a. /// @@ -314,6 +360,18 @@ namespace bx /// BX_CONSTEXPR_FUNC float rcp(float _a); + /// Returns reciprocal of _a. Avoids divide by zero. + /// + BX_CONSTEXPR_FUNC float rcpSafe(float _a); + + /// Returns result of division (_a / _b). + /// + BX_CONSTEXPR_FUNC float div(float _a, float _b); + + /// Returns result of division (_a / _b). Avoids divide by zero. + /// + BX_CONSTEXPR_FUNC float divSafe(float _a, float _b); + /// Returns the floating-point remainder of the division operation _a/_b. /// BX_CONSTEXPR_FUNC float mod(float _a, float _b); @@ -337,7 +395,7 @@ namespace bx BX_CONSTEXPR_FUNC float smoothStep(float _a); /// - BX_CONST_FUNC float invSmoothStep(float _a); + BX_CONSTEXPR_FUNC float invSmoothStep(float _a); /// BX_CONSTEXPR_FUNC float bias(float _time, float _bias); @@ -390,9 +448,15 @@ namespace bx /// BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, const Vec3 _b); + /// + BX_CONSTEXPR_FUNC Vec3 divSafe(const Vec3 _a, const Vec3 _b); + /// BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, float _b); + /// + BX_CONSTEXPR_FUNC Vec3 divSafe(const Vec3 _a, float _b); + /// Returns result of negated multiply-sub operation -(_a * _b - _c) -> _c - _a * _b. /// BX_CONSTEXPR_FUNC Vec3 nms(const Vec3 _a, const float _b, const Vec3 _c); @@ -414,13 +478,13 @@ namespace bx BX_CONSTEXPR_FUNC Vec3 cross(const Vec3 _a, const Vec3 _b); /// - BX_CONST_FUNC float length(const Vec3 _a); + BX_CONSTEXPR_FUNC float length(const Vec3 _a); /// - BX_CONST_FUNC float distanceSq(const Vec3 _a, const Vec3 _b); + BX_CONSTEXPR_FUNC float distanceSq(const Vec3 _a, const Vec3 _b); /// - BX_CONST_FUNC float distance(const Vec3 _a, const Vec3 _b); + BX_CONSTEXPR_FUNC float distance(const Vec3 _a, const Vec3 _b); /// BX_CONSTEXPR_FUNC Vec3 lerp(const Vec3 _a, const Vec3 _b, float _t); @@ -429,7 +493,7 @@ namespace bx BX_CONSTEXPR_FUNC Vec3 lerp(const Vec3 _a, const Vec3 _b, const Vec3 _t); /// - BX_CONST_FUNC Vec3 normalize(const Vec3 _a); + BX_CONSTEXPR_FUNC Vec3 normalize(const Vec3 _a); /// BX_CONSTEXPR_FUNC Vec3 min(const Vec3 _a, const Vec3 _b); @@ -441,6 +505,10 @@ namespace bx /// BX_CONSTEXPR_FUNC Vec3 rcp(const Vec3 _a); + /// Returns component wise reciprocal of _a. + /// + BX_CONSTEXPR_FUNC Vec3 rcpSafe(const Vec3 _a); + /// BX_CONSTEXPR_FUNC bool isEqual(const Vec3 _a, const Vec3 _b, float _epsilon); @@ -451,7 +519,7 @@ namespace bx void calcTangentFrame(Vec3& _outT, Vec3& _outB, const Vec3 _n, float _angle); /// - BX_CONST_FUNC Vec3 fromLatLong(float _u, float _v); + BX_CONSTEXPR_FUNC Vec3 fromLatLong(float _u, float _v); /// void toLatLong(float* _outU, float* _outV, const Vec3 _dir); @@ -735,10 +803,10 @@ namespace bx void hsvToRgb(float _rgb[3], const float _hsv[3]); /// - BX_CONST_FUNC float toLinear(float _a); + BX_CONSTEXPR_FUNC float toLinear(float _a); /// - BX_CONST_FUNC float toGamma(float _a); + BX_CONSTEXPR_FUNC float toGamma(float _a); } // namespace bx diff --git a/bx/include/bx/mpscqueue.h b/bx/include/bx/mpscqueue.h index 856ac76c..0b8c36a9 100644 --- a/bx/include/bx/mpscqueue.h +++ b/bx/include/bx/mpscqueue.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/mutex.h b/bx/include/bx/mutex.h index 21393992..f4e6d42f 100644 --- a/bx/include/bx/mutex.h +++ b/bx/include/bx/mutex.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/os.h b/bx/include/bx/os.h index 60971ed1..4c030190 100644 --- a/bx/include/bx/os.h +++ b/bx/include/bx/os.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -56,7 +56,7 @@ namespace bx void* exec(const char* const* _argv); /// - BX_NO_RETURN void exit(int32_t _exitCode); + [[noreturn]] void exit(int32_t _exitCode); } // namespace bx diff --git a/bx/include/bx/pixelformat.h b/bx/include/bx/pixelformat.h index c14bef08..69eb84e2 100644 --- a/bx/include/bx/pixelformat.h +++ b/bx/include/bx/pixelformat.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/platform.h b/bx/include/bx/platform.h index 6fdb279b..2e790401 100644 --- a/bx/include/bx/platform.h +++ b/bx/include/bx/platform.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -30,7 +30,6 @@ // C Runtime #define BX_CRT_BIONIC 0 -#define BX_CRT_BSD 0 #define BX_CRT_GLIBC 0 #define BX_CRT_LIBCXX 0 #define BX_CRT_MINGW 0 @@ -42,7 +41,6 @@ #endif // BX_CRT_NONE // Language standard version -#define BX_LANGUAGE_CPP14 201402L #define BX_LANGUAGE_CPP17 201703L #define BX_LANGUAGE_CPP20 202002L #define BX_LANGUAGE_CPP23 202207L @@ -60,6 +58,7 @@ #define BX_PLATFORM_PS4 0 #define BX_PLATFORM_PS5 0 #define BX_PLATFORM_RPI 0 +#define BX_PLATFORM_VISIONOS 0 #define BX_PLATFORM_WINDOWS 0 #define BX_PLATFORM_WINRT 0 #define BX_PLATFORM_XBOXONE 0 @@ -197,12 +196,16 @@ || defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) # undef BX_PLATFORM_IOS # define BX_PLATFORM_IOS 1 +#elif defined(__has_builtin) && __has_builtin(__is_target_os) && __is_target_os(xros) +# undef BX_PLATFORM_VISIONOS +# define BX_PLATFORM_VISIONOS 1 #elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) # undef BX_PLATFORM_OSX # define BX_PLATFORM_OSX __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ #elif defined(__EMSCRIPTEN__) +# include # undef BX_PLATFORM_EMSCRIPTEN -# define BX_PLATFORM_EMSCRIPTEN 1 +# define BX_PLATFORM_EMSCRIPTEN (__EMSCRIPTEN_major__ * 10000 + __EMSCRIPTEN_minor__ * 100 + __EMSCRIPTEN_tiny__) #elif defined(__ORBIS__) # undef BX_PLATFORM_PS4 # define BX_PLATFORM_PS4 1 @@ -232,33 +235,23 @@ # if defined(__BIONIC__) # undef BX_CRT_BIONIC # define BX_CRT_BIONIC 1 -# elif defined(_MSC_VER) -# undef BX_CRT_MSVC -# define BX_CRT_MSVC 1 # elif defined(__GLIBC__) # undef BX_CRT_GLIBC # define BX_CRT_GLIBC (__GLIBC__ * 10000 + __GLIBC_MINOR__ * 100) -# elif defined(__MINGW32__) || defined(__MINGW64__) +# elif defined(__MINGW32__) \ + || defined(__MINGW64__) # undef BX_CRT_MINGW # define BX_CRT_MINGW 1 -# elif defined(__apple_build_version__) || defined(__ORBIS__) || defined(__EMSCRIPTEN__) || defined(__llvm__) || defined(__HAIKU__) +# elif defined(_MSC_VER) +# undef BX_CRT_MSVC +# define BX_CRT_MSVC 1 +# elif defined(__apple_build_version__) \ + || BX_PLATFORM_PS4 \ + || BX_PLATFORM_EMSCRIPTEN \ + || defined(__llvm__) # undef BX_CRT_LIBCXX # define BX_CRT_LIBCXX 1 -# elif BX_PLATFORM_BSD -# undef BX_CRT_BSD -# define BX_CRT_BSD 1 # endif // - -# if !BX_CRT_BIONIC \ - && !BX_CRT_BSD \ - && !BX_CRT_GLIBC \ - && !BX_CRT_LIBCXX \ - && !BX_CRT_MINGW \ - && !BX_CRT_MSVC \ - && !BX_CRT_NEWLIB -# undef BX_CRT_NONE -# define BX_CRT_NONE 1 -# endif // BX_CRT_* #endif // !BX_CRT_NONE /// @@ -275,6 +268,7 @@ || BX_PLATFORM_PS4 \ || BX_PLATFORM_PS5 \ || BX_PLATFORM_RPI \ + || BX_PLATFORM_VISIONOS \ ) /// @@ -291,6 +285,7 @@ || BX_PLATFORM_PS4 \ || BX_PLATFORM_PS5 \ || BX_PLATFORM_RPI \ + || BX_PLATFORM_VISIONOS \ || BX_PLATFORM_WINDOWS \ || BX_PLATFORM_WINRT \ || BX_PLATFORM_XBOXONE \ @@ -347,18 +342,6 @@ # define BX_COMPILER_NAME "MSVC 17.0" # elif BX_COMPILER_MSVC >= 1920 // Visual Studio 2019 # define BX_COMPILER_NAME "MSVC 16.0" -# elif BX_COMPILER_MSVC >= 1910 // Visual Studio 2017 -# define BX_COMPILER_NAME "MSVC 15.0" -# elif BX_COMPILER_MSVC >= 1900 // Visual Studio 2015 -# define BX_COMPILER_NAME "MSVC 14.0" -# elif BX_COMPILER_MSVC >= 1800 // Visual Studio 2013 -# define BX_COMPILER_NAME "MSVC 12.0" -# elif BX_COMPILER_MSVC >= 1700 // Visual Studio 2012 -# define BX_COMPILER_NAME "MSVC 11.0" -# elif BX_COMPILER_MSVC >= 1600 // Visual Studio 2010 -# define BX_COMPILER_NAME "MSVC 10.0" -# elif BX_COMPILER_MSVC >= 1500 // Visual Studio 2008 -# define BX_COMPILER_NAME "MSVC 9.0" # else # define BX_COMPILER_NAME "MSVC" # endif // @@ -366,11 +349,11 @@ #if BX_PLATFORM_ANDROID # define BX_PLATFORM_NAME "Android " \ - BX_STRINGIZE(BX_PLATFORM_ANDROID) + BX_STRINGIZE(BX_PLATFORM_ANDROID) #elif BX_PLATFORM_BSD # define BX_PLATFORM_NAME "BSD" #elif BX_PLATFORM_EMSCRIPTEN -# define BX_PLATFORM_NAME "asm.js " \ +# define BX_PLATFORM_NAME "Emscripten " \ BX_STRINGIZE(__EMSCRIPTEN_major__) "." \ BX_STRINGIZE(__EMSCRIPTEN_minor__) "." \ BX_STRINGIZE(__EMSCRIPTEN_tiny__) @@ -387,13 +370,15 @@ #elif BX_PLATFORM_NX # define BX_PLATFORM_NAME "NX" #elif BX_PLATFORM_OSX -# define BX_PLATFORM_NAME "OSX" +# define BX_PLATFORM_NAME "macOS" #elif BX_PLATFORM_PS4 # define BX_PLATFORM_NAME "PlayStation 4" #elif BX_PLATFORM_PS5 # define BX_PLATFORM_NAME "PlayStation 5" #elif BX_PLATFORM_RPI # define BX_PLATFORM_NAME "RaspberryPi" +#elif BX_PLATFORM_VISIONOS +# define BX_PLATFORM_NAME "visionOS" #elif BX_PLATFORM_WINDOWS # define BX_PLATFORM_NAME "Windows" #elif BX_PLATFORM_WINRT @@ -420,8 +405,6 @@ #if BX_CRT_BIONIC # define BX_CRT_NAME "Bionic libc" -#elif BX_CRT_BSD -# define BX_CRT_NAME "BSD libc" #elif BX_CRT_GLIBC # define BX_CRT_NAME "GNU C Library" #elif BX_CRT_MSVC @@ -435,7 +418,7 @@ #elif BX_CRT_NONE # define BX_CRT_NAME "None" #else -# error "Unknown BX_CRT!" +# define BX_CRT_NAME "Unknown CRT" #endif // BX_CRT_ #if BX_ARCH_32BIT @@ -445,10 +428,12 @@ #endif // BX_ARCH_ #if defined(__cplusplus) -# if __cplusplus < BX_LANGUAGE_CPP14 -# error "C++14 standard support is required to build." -# elif __cplusplus < BX_LANGUAGE_CPP17 -# define BX_CPP_NAME "C++14" +# if BX_COMPILER_MSVC && defined(_MSVC_LANG) && _MSVC_LANG != __cplusplus +# error "When using MSVC you must set /Zc:__cplusplus compiler option." +# endif // BX_COMPILER_MSVC && defined(_MSVC_LANG) && _MSVC_LANG != __cplusplus + +# if __cplusplus < BX_LANGUAGE_CPP17 +# define BX_CPP_NAME "C++Unsupported" # elif __cplusplus < BX_LANGUAGE_CPP20 # define BX_CPP_NAME "C++17" # elif __cplusplus < BX_LANGUAGE_CPP23 @@ -461,10 +446,41 @@ # define BX_CPP_NAME "C++Unknown" #endif // defined(__cplusplus) -#if BX_PLATFORM_BSD \ - || BX_PLATFORM_HAIKU \ - || BX_PLATFORM_HURD -static_assert(false, "\n\n" +#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) +# error "When using MSVC you must set /Zc:preprocessor compiler option." +#endif // BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) + +#if defined(__cplusplus) + +static_assert(__cplusplus >= BX_LANGUAGE_CPP17, "\n\n" + "\t** IMPORTANT! **\n\n" + "\tC++17 standard support is required to build.\n" + "\t\n"); + +// https://releases.llvm.org/ +static_assert(!BX_COMPILER_CLANG || BX_COMPILER_CLANG >= 110000, "\n\n" + "\t** IMPORTANT! **\n\n" + "\tMinimum supported Clang version is 11.0 (October 12, 2020).\n" + "\t\n"); + +// https://gcc.gnu.org/releases.html +static_assert(!BX_COMPILER_GCC || BX_COMPILER_GCC >= 110000, "\n\n" + "\t** IMPORTANT! **\n\n" + "\tMinimum supported GCC version is 11.0 (April 27, 2021).\n" + "\t\n"); + +// https://learn.microsoft.com/en-us/visualstudio/releases/2019/history +static_assert(!BX_COMPILER_MSVC || BX_COMPILER_MSVC >= 1927, "\n\n" + "\t** IMPORTANT! **\n\n" + "\tMinimum supported MSVC 19.27 / Visual Studio 2019 version 16.7 (August 5, 2020).\n" + "\t\n"); + +static_assert(!BX_CPU_ENDIAN_BIG, "\n\n" + "\t** IMPORTANT! **\n\n" + "\tThe code was not tested for big endian, and big endian CPU is considered unsupported.\n" + "\t\n"); + +static_assert(!BX_PLATFORM_BSD || !BX_PLATFORM_HAIKU || !BX_PLATFORM_HURD, "\n\n" "\t** IMPORTANT! **\n\n" "\tYou're compiling for unsupported platform!\n" "\tIf you wish to support this platform, make your own fork, and modify code for _yourself_.\n" @@ -473,6 +489,7 @@ static_assert(false, "\n\n" "\tto test on these platforms, and over years there wasn't any serious contributor who wanted to take\n" "\tburden of maintaining code for these platforms.\n" "\t\n"); -#endif // BX_PLATFORM_* + +#endif // defined(__cplusplus) #endif // BX_PLATFORM_H_HEADER_GUARD diff --git a/bx/include/bx/process.h b/bx/include/bx/process.h index 425195bd..fdd6c9ac 100644 --- a/bx/include/bx/process.h +++ b/bx/include/bx/process.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/readerwriter.h b/bx/include/bx/readerwriter.h index 660ce487..449f6f09 100644 --- a/bx/include/bx/readerwriter.h +++ b/bx/include/bx/readerwriter.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/ringbuffer.h b/bx/include/bx/ringbuffer.h index b0a2ac46..7e7a2b0b 100644 --- a/bx/include/bx/ringbuffer.h +++ b/bx/include/bx/ringbuffer.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/rng.h b/bx/include/bx/rng.h index dda179be..5c348cf3 100644 --- a/bx/include/bx/rng.h +++ b/bx/include/bx/rng.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -57,15 +57,15 @@ namespace bx /// Generate random point on unit circle. template - bx::Vec3 randUnitCircle(Rng* _rng); + Vec3 randUnitCircle(Rng* _rng); /// Generate random point on unit sphere. template - bx::Vec3 randUnitSphere(Rng* _rng); + Vec3 randUnitSphere(Rng* _rng); /// Generate random point on unit hemisphere. template - bx::Vec3 randUnitHemisphere(Ty* _rng, const bx::Vec3& _normal); + Vec3 randUnitHemisphere(Ty* _rng, const Vec3& _normal); /// Sampling with Hammersley and Halton Points. void generateSphereHammersley(void* _data, uint32_t _stride, uint32_t _num, float _scale = 1.0f); diff --git a/bx/include/bx/semaphore.h b/bx/include/bx/semaphore.h index 407e1c89..f45b270c 100644 --- a/bx/include/bx/semaphore.h +++ b/bx/include/bx/semaphore.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/settings.h b/bx/include/bx/settings.h index 122129ab..dee2a648 100644 --- a/bx/include/bx/settings.h +++ b/bx/include/bx/settings.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/simd_t.h b/bx/include/bx/simd_t.h index 4e23370f..4c8caf33 100644 --- a/bx/include/bx/simd_t.h +++ b/bx/include/bx/simd_t.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -16,7 +16,7 @@ #define BX_SIMD_NEON 0 #define BX_SIMD_SSE 0 -#define BX_CONFIG_SUPPORTS_SIMD 0 +#define BX_SIMD_SUPPORTED 0 #if defined(__AVX__) || defined(__AVX2__) # include @@ -36,14 +36,24 @@ # include # undef BX_SIMD_NEON # define BX_SIMD_NEON 1 -#elif BX_COMPILER_CLANG \ +#elif BX_COMPILER_CLANG \ && !BX_PLATFORM_EMSCRIPTEN \ - && !BX_PLATFORM_IOS \ + && !BX_PLATFORM_IOS \ + && !BX_PLATFORM_VISIONOS \ && BX_CLANG_HAS_EXTENSION(attribute_ext_vector_type) # undef BX_SIMD_LANGEXT # define BX_SIMD_LANGEXT 1 #endif // +#if ( BX_SIMD_AVX \ + || BX_SIMD_LANGEXT \ + || BX_SIMD_NEON \ + || BX_SIMD_SSE \ + ) +# undef BX_SIMD_SUPPORTED +# define BX_SIMD_SUPPORTED 1 +#endif // BX_SIMD_* + namespace bx { #define ELEMx 0 @@ -491,15 +501,6 @@ BX_SIMD128_IMPLEMENT_TEST(xyzw); # include "inline/simd128_sse.inl" #endif // BX_SIMD_SSE -#if ( BX_SIMD_LANGEXT \ - || BX_SIMD_NEON \ - || BX_SIMD_SSE \ - || BX_SIMD_AVX \ - ) -# undef BX_CONFIG_SUPPORTS_SIMD -# define BX_CONFIG_SUPPORTS_SIMD 1 -#endif // BX_SIMD_* - namespace bx { union simd128_ref_t @@ -513,7 +514,7 @@ namespace bx # define BX_SIMD_WARN_REFERENCE_IMPL 0 #endif // BX_SIMD_WARN_REFERENCE_IMPL -#if !BX_CONFIG_SUPPORTS_SIMD +#if !BX_SIMD_SUPPORTED # if BX_SIMD_WARN_REFERENCE_IMPL # pragma message("*** Using SIMD128 reference implementation! ***") # endif // BX_SIMD_WARN_REFERENCE_IMPL diff --git a/bx/include/bx/sort.h b/bx/include/bx/sort.h index 7a42bae0..9c0bcc03 100644 --- a/bx/include/bx/sort.h +++ b/bx/include/bx/sort.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/spscqueue.h b/bx/include/bx/spscqueue.h index a96f4f4a..16a78115 100644 --- a/bx/include/bx/spscqueue.h +++ b/bx/include/bx/spscqueue.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/string.h b/bx/include/bx/string.h index 69ca122f..8e706d63 100644 --- a/bx/include/bx/string.h +++ b/bx/include/bx/string.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -42,6 +42,13 @@ namespace bx /// constexpr const char* getCPtr() const; + /// + void clear(); + + /// Returns `true` if string is empty. + /// + bool isEmpty() const; + private: const char* m_ptr; int32_t m_len; @@ -131,7 +138,7 @@ namespace bx }; /// ASCII string - template + template class StringT : public StringView { public: @@ -312,6 +319,9 @@ namespace bx /// Returns string view with suffix trimmed. StringView strTrimSuffix(const StringView& _str, const StringView& _suffix); + /// Returns string view `_num` from the right. + StringView strTail(const StringView _str, uint32_t _num); + /// Find new line. Returns pointer after new line terminator. StringView strFindNl(const StringView& _str); diff --git a/bx/include/bx/thread.h b/bx/include/bx/thread.h index 468a5d72..79bdb09c 100644 --- a/bx/include/bx/thread.h +++ b/bx/include/bx/thread.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -72,6 +72,7 @@ namespace bx uint32_t m_stackSize; int32_t m_exitCode; bool m_running; + char m_name[64]; }; /// diff --git a/bx/include/bx/timer.h b/bx/include/bx/timer.h index 120319c7..fe35b633 100644 --- a/bx/include/bx/timer.h +++ b/bx/include/bx/timer.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/include/bx/typetraits.h b/bx/include/bx/typetraits.h index 3445fa80..94600007 100644 --- a/bx/include/bx/typetraits.h +++ b/bx/include/bx/typetraits.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -165,6 +165,14 @@ namespace bx template constexpr bool isUnsigned(); + /// Returns value of `_t` as signed type value. + template + constexpr auto asSigned(Ty _value); + + /// Returns value of `_t` as unsigned type value. + template + constexpr auto asUnsigned(Ty _value); + /// Returns true if type `Ty` is integer type, otherwise returns false. template constexpr bool isInteger(); diff --git a/bx/include/bx/uint32_t.h b/bx/include/bx/uint32_t.h index f1195c4e..f8802c23 100644 --- a/bx/include/bx/uint32_t.h +++ b/bx/include/bx/uint32_t.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -149,18 +149,19 @@ namespace bx /// Count number of bits set. /// - template - BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(Ty _val); + BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(uint32_t _val); /// Count number of leading zeros. /// - template - BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(Ty _val); + BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(uint32_t _val); /// Count number of trailing zeros. /// - template - BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(Ty _val); + BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(uint32_t _val); + + /// Find first set. + /// + BX_CONSTEXPR_FUNC uint32_t uint32_ffs(uint32_t _val); /// BX_CONSTEXPR_FUNC uint32_t uint32_part1by1(uint32_t _a); @@ -234,6 +235,15 @@ namespace bx /// BX_CONSTEXPR_FUNC uint64_t uint64_mul(uint64_t _a, uint64_t _b); + /// + BX_CONSTEXPR_FUNC uint64_t uint64_cntbits(uint64_t _val); + + /// + BX_CONSTEXPR_FUNC uint64_t uint64_cntlz(uint64_t _val); + + /// + BX_CONSTEXPR_FUNC uint64_t uint64_cnttz(uint64_t _val); + /// Greatest common divisor. /// BX_CONSTEXPR_FUNC uint32_t uint32_gcd(uint32_t _a, uint32_t _b); diff --git a/bx/include/bx/url.h b/bx/include/bx/url.h index af6fe5bd..cbe0c0b1 100644 --- a/bx/include/bx/url.h +++ b/bx/include/bx/url.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/makefile b/bx/makefile deleted file mode 100644 index 522371c9..00000000 --- a/bx/makefile +++ /dev/null @@ -1,246 +0,0 @@ -# -# Copyright 2011-2023 Branimir Karadzic. All rights reserved. -# License: https://github.com/bkaradzic/bx/blob/master/LICENSE -# - -GENIE=../bx/tools/bin/$(OS)/genie - -all: - $(GENIE) vs2017 - $(GENIE) vs2019 - $(GENIE) --gcc=android-arm gmake - $(GENIE) --gcc=android-arm64 gmake - $(GENIE) --gcc=android-x86 gmake - $(GENIE) --gcc=mingw-gcc gmake - $(GENIE) --gcc=linux-gcc gmake - $(GENIE) --gcc=haiku gmake - $(GENIE) --gcc=osx-x64 gmake - $(GENIE) --gcc=osx-arm64 gmake - $(GENIE) --gcc=ios-arm gmake - $(GENIE) --gcc=ios-simulator gmake - $(GENIE) --gcc=ios-simulator64 gmake - $(GENIE) xcode8 - -.build/projects/gmake-android-arm: - $(GENIE) --gcc=android-arm gmake -android-arm-debug: .build/projects/gmake-android-arm - make -R -C .build/projects/gmake-android-arm config=debug -android-arm-release: .build/projects/gmake-android-arm - make -R -C .build/projects/gmake-android-arm config=release -android-arm: android-arm-debug android-arm-release - -.build/projects/gmake-android-arm64: - $(GENIE) --gcc=android-arm64 gmake -android-arm64-debug: .build/projects/gmake-android-arm64 - make -R -C .build/projects/gmake-android-arm64 config=debug -android-arm64-release: .build/projects/gmake-android-arm64 - make -R -C .build/projects/gmake-android-arm64 config=release -android-arm64: android-arm64-debug android-arm64-release - -.build/projects/gmake-android-x86: - $(GENIE) --gcc=android-x86 gmake -android-x86-debug: .build/projects/gmake-android-x86 - make -R -C .build/projects/gmake-android-x86 config=debug -android-x86-release: .build/projects/gmake-android-x86 - make -R -C .build/projects/gmake-android-x86 config=release -android-x86: android-x86-debug android-x86-release - -.build/projects/gmake-linux: - $(GENIE) --gcc=linux-gcc gmake -linux-debug64: .build/projects/gmake-linux - make -R -C .build/projects/gmake-linux config=debug64 -linux-release64: .build/projects/gmake-linux - make -R -C .build/projects/gmake-linux config=release64 -linux: linux-debug64 linux-release64 - -.build/projects/gmake-haiku: - $(GENIE) --gcc=haiku gmake -haiku-debug64: .build/projects/gmake-haiku - make -R -C .build/projects/gmake-haiku config=debug64 -haiku-release64: .build/projects/gmake-haiku - make -R -C .build/projects/gmake-haiku config=release64 -haiku: haiku-debug64 haiku-release64 - -.build/projects/gmake-mingw-gcc: - $(GENIE) --gcc=mingw-gcc gmake -mingw-gcc-debug32: .build/projects/gmake-mingw-gcc - make -R -C .build/projects/gmake-mingw-gcc config=debug32 -mingw-gcc-release32: .build/projects/gmake-mingw-gcc - make -R -C .build/projects/gmake-mingw-gcc config=release32 -mingw-gcc-debug64: .build/projects/gmake-mingw-gcc - make -R -C .build/projects/gmake-mingw-gcc config=debug64 -mingw-gcc-release64: .build/projects/gmake-mingw-gcc - make -R -C .build/projects/gmake-mingw-gcc config=release64 -mingw-gcc: mingw-gcc-debug32 mingw-gcc-release32 mingw-gcc-debug64 mingw-gcc-release64 - -.build/projects/gmake-mingw-clang: - $(GENIE) --clang=mingw-clang gmake -mingw-clang-debug32: .build/projects/gmake-mingw-clang - make -R -C .build/projects/gmake-mingw-clang config=debug32 -mingw-clang-release32: .build/projects/gmake-mingw-clang - make -R -C .build/projects/gmake-mingw-clang config=release32 -mingw-clang-debug64: .build/projects/gmake-mingw-clang - make -R -C .build/projects/gmake-mingw-clang config=debug64 -mingw-clang-release64: .build/projects/gmake-mingw-clang - make -R -C .build/projects/gmake-mingw-clang config=release64 -mingw-clang: mingw-clang-debug32 mingw-clang-release32 mingw-clang-debug64 mingw-clang-release64 - -.build/projects/vs2017: - $(GENIE) vs2017 - -.build/projects/gmake-osx-x64: - $(GENIE) --gcc=osx-x64 gmake -osx-x64-debug: .build/projects/gmake-osx-x64 - make -C .build/projects/gmake-osx config=debug -osx-x64-release: .build/projects/gmake-osx-x64 - make -C .build/projects/gmake-osx config=release -osx-x64: osx-x64-debug osx-x64-release - -.build/projects/gmake-osx-arm64: - $(GENIE) --gcc=osx-arm64 gmake -osx-arm64-debug: .build/projects/gmake-osx-arm64 - make -C .build/projects/gmake-osx-arm64 config=debug -osx-arm64-release: .build/projects/gmake-osx-arm64 - make -C .build/projects/gmake-osx-arm64 config=release -osx-arm64: osx-arm64-debug osx-arm64-release - -.build/projects/gmake-ios-arm: - $(GENIE) --gcc=ios-arm gmake -ios-arm-debug: .build/projects/gmake-ios-arm - make -R -C .build/projects/gmake-ios-arm config=debug -ios-arm-release: .build/projects/gmake-ios-arm - make -R -C .build/projects/gmake-ios-arm config=release -ios-arm: ios-arm-debug ios-arm-release - -.build/projects/gmake-ios-simulator: - $(GENIE) --gcc=ios-simulator gmake -ios-simulator-debug: .build/projects/gmake-ios-simulator - make -R -C .build/projects/gmake-ios-simulator config=debug -ios-simulator-release: .build/projects/gmake-ios-simulator - make -R -C .build/projects/gmake-ios-simulator config=release -ios-simulator: ios-simulator-debug ios-simulator-release - -.build/projects/gmake-ios-simulator64: - $(GENIE) --gcc=ios-simulator64 gmake -ios-simulator64-debug: .build/projects/gmake-ios-simulator64 - make -R -C .build/projects/gmake-ios-simulator64 config=debug -ios-simulator64-release: .build/projects/gmake-ios-simulator64 - make -R -C .build/projects/gmake-ios-simulator64 config=release -ios-simulator64: ios-simulator64-debug ios-simulator64-release - -rebuild-shaders: - make -R -C examples rebuild - -analyze: - cppcheck src/ - cppcheck examples/ - -docs: - doxygen scripts/bgfx.doxygen - markdown README.md > .build/docs/readme.html - -clean: - @echo Cleaning... - -@rm -rf .build - @mkdir .build - -### - -SILENT ?= @ - -UNAME := $(shell uname) -ifeq ($(UNAME),$(filter $(UNAME),Linux GNU Darwin Haiku)) -ifeq ($(UNAME),$(filter $(UNAME),Darwin Haiku)) -ifeq ($(UNAME),$(filter $(UNAME),Darwin)) -OS=darwin -BUILD_PROJECT_DIR=gmake-osx-x64 -BUILD_OUTPUT_DIR=osx-x64 -BUILD_TOOLS_CONFIG=release -EXE= -else -OS=haiku -BUILD_PROJECT_DIR=gmake-haiku -BUILD_OUTPUT_DIR=haiku64_gcc -BUILD_TOOLS_CONFIG=release64 -EXE= -endif -else -OS=linux -BUILD_PROJECT_DIR=gmake-linux -BUILD_OUTPUT_DIR=linux64_gcc -BUILD_TOOLS_CONFIG=release64 -EXE= -endif -else -OS=windows -BUILD_PROJECT_DIR=gmake-mingw-gcc -BUILD_OUTPUT_DIR=win32_mingw-gcc -BUILD_TOOLS_CONFIG=release64 -EXE=.exe -endif - -# bin2c -.build/osx-x64/bin/bin2cRelease: .build/projects/gmake-osx-x64 - $(SILENT) make -C .build/projects/gmake-osx-x64 bin2c config=$(BUILD_TOOLS_CONFIG) - -tools/bin/darwin/bin2c: .build/osx-x64/bin/bin2cRelease - $(SILENT) cp $(<) $(@) - -.build/linux64_gcc/bin/bin2cRelease: .build/projects/gmake-linux - $(SILENT) make -C .build/projects/gmake-linux bin2c config=$(BUILD_TOOLS_CONFIG) - -tools/bin/linux/bin2c: .build/linux64_gcc/bin/bin2cRelease - $(SILENT) cp $(<) $(@) - -.build/haiku64_gcc/bin/bin2cRelease: .build/projects/gmake-haiku - $(SILENT) make -C .build/projects/gmake-haiku bin2c config=$(BUILD_TOOLS_CONFIG) - -tools/bin/haiku/bin2c: .build/haiku64_gcc/bin/bin2cRelease - $(SILENT) cp $(<) $(@) - -.build/win64_mingw-gcc/bin/bin2cRelease.exe: .build/projects/gmake-mingw-gcc - $(SILENT) make -C .build/projects/gmake-mingw-gcc bin2c config=$(BUILD_TOOLS_CONFIG) - -tools/bin/windows/bin2c.exe: .build/win64_mingw-gcc/bin/bin2cRelease.exe - $(SILENT) cp $(<) $(@) - -bin2c: tools/bin/$(OS)/bin2c$(EXE) - -# lemon -.build/osx-x64/bin/lemonRelease: .build/projects/gmake-osx-x64 - $(SILENT) make -C .build/projects/gmake-osx-x64 lemon config=$(BUILD_TOOLS_CONFIG) - -tools/bin/darwin/lemon: .build/osx-x64/bin/lemonRelease - $(SILENT) cp $(<) $(@) - -.build/linux64_gcc/bin/lemonRelease: .build/projects/gmake-linux - $(SILENT) make -C .build/projects/gmake-linux lemon config=$(BUILD_TOOLS_CONFIG) - -tools/bin/linux/lemon: .build/linux64_gcc/bin/lemonRelease - $(SILENT) cp $(<) $(@) - -.build/haiku64_gcc/bin/lemonRelease: .build/projects/gmake-haiku - $(SILENT) make -C .build/projects/gmake-haiku lemon config=$(BUILD_TOOLS_CONFIG) - -tools/bin/haiku/lemon: .build/haiku64_gcc/bin/lemonRelease - $(SILENT) cp $(<) $(@) - -.build/win64_mingw-gcc/bin/lemonRelease.exe: .build/projects/gmake-mingw-gcc - $(SILENT) make -C .build/projects/gmake-mingw-gcc lemon config=$(BUILD_TOOLS_CONFIG) - -tools/bin/windows/lemon.exe: .build/win64_mingw-gcc/bin/lemonRelease.exe - $(SILENT) cp $(<) $(@) - -tools/bin/$(OS)/lempar.c: tools/lemon/lempar.c - $(SILENT) cp $(<) $(@) - -lemon: tools/bin/$(OS)/lemon$(EXE) tools/bin/$(OS)/lempar.c - -tools: bin2c lemon - -dist: tools/bin/darwin/bin2c tools/bin/linux/bin2c tools/bin/windows/bin2c.exe tools/bin/haiku/bin2c - -.build/$(BUILD_OUTPUT_DIR)/bin/bx.testRelease$(EXE): .build/projects/$(BUILD_PROJECT_DIR) - $(SILENT) make -C .build/projects/$(BUILD_PROJECT_DIR) bx.test config=$(BUILD_TOOLS_CONFIG) - -test: .build/$(BUILD_OUTPUT_DIR)/bin/bx.testRelease$(EXE) diff --git a/bx/scripts/bin2c.lua b/bx/scripts/bin2c.lua index b7b2e1d9..e84ffda6 100644 --- a/bx/scripts/bin2c.lua +++ b/bx/scripts/bin2c.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bx/blob/master/LICENSE -- diff --git a/bx/scripts/bx.lua b/bx/scripts/bx.lua index c7beceea..fd9c189e 100644 --- a/bx/scripts/bx.lua +++ b/bx/scripts/bx.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bx/blob/master/LICENSE -- diff --git a/bx/scripts/genie.lua b/bx/scripts/genie.lua index 8b985410..cf06485e 100644 --- a/bx/scripts/genie.lua +++ b/bx/scripts/genie.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bx/blob/master/LICENSE -- @@ -39,7 +39,6 @@ end dofile "bx.lua" dofile "bin2c.lua" -dofile "lemon.lua" project "bx.test" kind "ConsoleApp" @@ -54,10 +53,6 @@ project "bx.test" BX_THIRD_PARTY_DIR, } - defines { - "CATCH_AMALGAMATED_CUSTOM_MAIN", - } - files { path.join(BX_DIR, "3rdparty/catch/catch_amalgamated.cpp"), path.join(BX_DIR, "tests/*_test.cpp"), @@ -67,6 +62,10 @@ project "bx.test" using_bx() + defines { + "CATCH_AMALGAMATED_CUSTOM_MAIN", + } + configuration { "vs* or mingw*" } links { "psapi", @@ -83,11 +82,26 @@ project "bx.test" "pthread", } + configuration { "ios*" } + linkoptions { + "-framework CoreFoundation", + "-framework Foundation", + } + configuration { "osx*" } links { "Cocoa.framework", } + configuration { "wasm" } + buildoptions { + "-fwasm-exceptions", + } + linkoptions { + "-fwasm-exceptions", + "-s STACK_SIZE=262144", + } + configuration {} strip() @@ -108,9 +122,7 @@ project "bx.bench" path.join(BX_DIR, "tests/dbg.*"), } - links { - "bx", - } + using_bx() configuration { "vs* or mingw*" } links { @@ -133,16 +145,6 @@ project "bx.bench" "Cocoa.framework", } - configuration { "Debug" } - defines { - "BX_CONFIG_DEBUG=1", - } - - configuration { "Release" } - defines { - "BX_CONFIG_DEBUG=0", - } - configuration {} strip() diff --git a/bx/scripts/lemon.lua b/bx/scripts/lemon.lua deleted file mode 100644 index dcbb560e..00000000 --- a/bx/scripts/lemon.lua +++ /dev/null @@ -1,22 +0,0 @@ --- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. --- License: https://github.com/bkaradzic/bx/blob/master/LICENSE --- - -project "lemon" - kind "ConsoleApp" - - files { - path.join(BX_DIR, "tools/lemon/lemon.c") - } - - configuration { "not vs*" } - buildoptions { - "-Wno-implicit-fallthrough", - "-Wno-sign-compare", - "-Wno-unused-parameter", - } - - configuration {} - - strip() diff --git a/bx/scripts/toolchain.lua b/bx/scripts/toolchain.lua index b60d1efb..f2eaa9ad 100644 --- a/bx/scripts/toolchain.lua +++ b/bx/scripts/toolchain.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2023 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2024 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bx/blob/master/LICENSE -- @@ -70,7 +70,6 @@ function toolchain(_buildDir, _libDir) { "android-x86_64", "Android - x86_64" }, { "wasm2js", "Emscripten/Wasm2JS" }, { "wasm", "Emscripten/Wasm" }, - { "freebsd", "FreeBSD" }, { "linux-gcc", "Linux (GCC compiler)" }, { "linux-gcc-afl", "Linux (GCC + AFL fuzzer)" }, { "linux-clang", "Linux (Clang compiler)" }, @@ -79,15 +78,14 @@ function toolchain(_buildDir, _libDir) { "linux-ppc64le-gcc", "Linux (PPC64LE, GCC compiler)" }, { "linux-ppc64le-clang", "Linux (PPC64LE, Clang compiler)" }, { "linux-riscv64-gcc", "Linux (RISC-V 64, GCC compiler)" }, - { "ios-arm", "iOS - ARM" }, { "ios-arm64", "iOS - ARM64" }, { "ios-simulator", "iOS - Simulator" }, - { "ios-simulator64", "iOS - Simulator 64" }, { "tvos-arm64", "tvOS - ARM64" }, + { "xros-arm64", "visionOS ARM64" }, + { "xros-simulator", "visionOS - Simulator" }, { "tvos-simulator", "tvOS - Simulator" }, { "mingw-gcc", "MinGW" }, { "mingw-clang", "MinGW (clang compiler)" }, - { "netbsd", "NetBSD" }, { "osx-x64", "OSX - x64" }, { "osx-arm64", "OSX - ARM64" }, { "orbis", "Orbis" }, @@ -117,6 +115,7 @@ function toolchain(_buildDir, _libDir) { "osx", "OSX" }, { "ios", "iOS" }, { "tvos", "tvOS" }, + { "xros", "visionOS" }, } } @@ -129,19 +128,25 @@ function toolchain(_buildDir, _libDir) newoption { trigger = "with-ios", value = "#", - description = "Set iOS target version (default: 8.0).", + description = "Set iOS target version (default: 13.0).", } newoption { trigger = "with-macos", value = "#", - description = "Set macOS target version (default 10.11).", + description = "Set macOS target version (default 13.0).", } newoption { trigger = "with-tvos", value = "#", - description = "Set tvOS target version (default: 9.0).", + description = "Set tvOS target version (default: 13.0).", + } + + newoption { + trigger = "with-visionos", + value = "#", + description = "Set visionOS target version (default: 1.0).", } newoption { @@ -196,6 +201,11 @@ function toolchain(_buildDir, _libDir) tvosPlatform = _OPTIONS["with-tvos"] end + local xrosPlatform = "" + if _OPTIONS["with-xros"] then + xrosPlatform = _OPTIONS["with-xros"] + end + local windowsPlatform = nil if _OPTIONS["with-windows"] then windowsPlatform = _OPTIONS["with-windows"] @@ -246,27 +256,24 @@ function toolchain(_buildDir, _libDir) premake.gcc.namestyle = "Emscripten" location (path.join(_buildDir, "projects", _ACTION .. "-" .. _OPTIONS["gcc"])) - elseif "freebsd" == _OPTIONS["gcc"] then - location (path.join(_buildDir, "projects", _ACTION .. "-freebsd")) - - elseif "ios-arm" == _OPTIONS["gcc"] - or "ios-arm64" == _OPTIONS["gcc"] then + elseif "ios-arm64" == _OPTIONS["gcc"] then premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" premake.gcc.ar = "ar" location (path.join(_buildDir, "projects", _ACTION .. "-" .. _OPTIONS["gcc"])) - elseif "ios-simulator" == _OPTIONS["gcc"] then + elseif "xros-arm64" == _OPTIONS["gcc"] + or "xros-simulator" == _OPTIONS["gcc"] then premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" premake.gcc.ar = "ar" - location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator")) + location (path.join(_buildDir, "projects", _ACTION .. "-" .. _OPTIONS["gcc"])) - elseif "ios-simulator64" == _OPTIONS["gcc"] then + elseif "ios-simulator" == _OPTIONS["gcc"] then premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" premake.gcc.ar = "ar" - location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator64")) + location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator")) elseif "tvos-arm64" == _OPTIONS["gcc"] then premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" @@ -281,13 +288,13 @@ function toolchain(_buildDir, _libDir) location (path.join(_buildDir, "projects", _ACTION .. "-tvos-simulator")) elseif "linux-gcc" == _OPTIONS["gcc"] then - location (path.join(_buildDir, "projects", _ACTION .. "-linux")) + location (path.join(_buildDir, "projects", _ACTION .. "-linux-gcc")) elseif "linux-gcc-afl" == _OPTIONS["gcc"] then premake.gcc.cc = "afl-gcc" premake.gcc.cxx = "afl-g++" premake.gcc.ar = "ar" - location (path.join(_buildDir, "projects", _ACTION .. "-linux")) + location (path.join(_buildDir, "projects", _ACTION .. "-linux-gcc")) elseif "linux-clang" == _OPTIONS["gcc"] then premake.gcc.cc = "clang" @@ -337,6 +344,14 @@ function toolchain(_buildDir, _libDir) location (path.join(_buildDir, "projects", _ACTION .. "-mingw-gcc")) elseif "mingw-clang" == _OPTIONS["gcc"] then + if not os.getenv("MINGW") then + print("Set MINGW environment variable.") + end + + if not os.getenv("CLANG") then + print("Set CLANG environment variable.") + end + premake.gcc.cc = "$(CLANG)/bin/clang" premake.gcc.cxx = "$(CLANG)/bin/clang++" premake.gcc.ar = "$(MINGW)/bin/ar" @@ -344,13 +359,9 @@ function toolchain(_buildDir, _libDir) -- premake.gcc.llvm = true location (path.join(_buildDir, "projects", _ACTION .. "-mingw-clang")) - elseif "netbsd" == _OPTIONS["gcc"] then - location (path.join(_buildDir, "projects", _ACTION .. "-netbsd")) - elseif "osx-x64" == _OPTIONS["gcc"] or "osx-arm64" == _OPTIONS["gcc"] then - if os.is("linux") then if not os.getenv("OSXCROSS") then print("Set OSXCROSS environment variable.") @@ -440,19 +451,24 @@ function toolchain(_buildDir, _libDir) end if "osx" == _OPTIONS["xcode"] then - action.xcode.macOSTargetPlatformVersion = str_or(macosPlatform, "10.11") + action.xcode.macOSTargetPlatformVersion = str_or(macosPlatform, "13.0") premake.xcode.toolset = "macosx" location (path.join(_buildDir, "projects", _ACTION .. "-osx")) elseif "ios" == _OPTIONS["xcode"] then - action.xcode.iOSTargetPlatformVersion = str_or(iosPlatform, "8.0") + action.xcode.iOSTargetPlatformVersion = str_or(iosPlatform, "16.0") premake.xcode.toolset = "iphoneos" location (path.join(_buildDir, "projects", _ACTION .. "-ios")) elseif "tvos" == _OPTIONS["xcode"] then - action.xcode.tvOSTargetPlatformVersion = str_or(tvosPlatform, "9.0") + action.xcode.tvOSTargetPlatformVersion = str_or(tvosPlatform, "13.0") premake.xcode.toolset = "appletvos" location (path.join(_buildDir, "projects", _ACTION .. "-tvos")) + + elseif "xros" == _OPTIONS["xcode"] then + action.xcode.visionOSTargetPlatformVersion = str_or(xrosPlatform, "1.0") + premake.xcode.toolset = "xros" + location (path.join(_buildDir, "projects", _ACTION .. "-xros")) end end @@ -491,6 +507,7 @@ function toolchain(_buildDir, _libDir) } configuration { "Release" } + targetsuffix "Release" flags { "NoBufferSecurityCheck", "OptimizeSpeed", @@ -498,10 +515,10 @@ function toolchain(_buildDir, _libDir) defines { "NDEBUG", } - targetsuffix "Release" configuration { "*-clang" } buildoptions { + "-Wno-nan-infinity-disabled", "-Wno-tautological-constant-compare", } @@ -526,7 +543,9 @@ function toolchain(_buildDir, _libDir) "/wd4201", -- warning C4201: nonstandard extension used: nameless struct/union "/wd4324", -- warning C4324: '': structure was padded due to alignment specifier "/Ob2", -- The Inline Function Expansion - "/Zc:__cplusplus", -- Enable updated __cplusplus macro + + "/Zc:__cplusplus", -- Enable updated __cplusplus macro. + "/Zc:preprocessor", -- Enable preprocessor conformance mode. } linkoptions { "/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library @@ -603,12 +622,12 @@ function toolchain(_buildDir, _libDir) "MINGW_HAS_SECURE_API=1", } buildoptions { + "-Wa,-mbig-obj", + "-Wundef", "-Wunused-value", "-fdata-sections", "-ffunction-sections", "-msse4.2", - "-Wunused-value", - "-Wundef", } linkoptions { "-Wl,--gc-sections", @@ -641,6 +660,7 @@ function toolchain(_buildDir, _libDir) "-isystem $(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++", "-isystem $(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32", "-isystem $(MINGW)/x86_64-w64-mingw32/include", + "-Wno-nan-infinity-disabled", } linkoptions { "-Qunused-arguments", @@ -897,23 +917,6 @@ function toolchain(_buildDir, _libDir) objdir (path.join(_buildDir, "wasm/obj")) libdirs { path.join(_libDir, "lib/wasm") } - configuration { "freebsd" } - targetdir (path.join(_buildDir, "freebsd/bin")) - objdir (path.join(_buildDir, "freebsd/obj")) - libdirs { path.join(_libDir, "lib/freebsd") } - includedirs { - path.join(bxDir, "include/compat/freebsd"), - } - - configuration { "xbox360" } - targetdir (path.join(_buildDir, "xbox360/bin")) - objdir (path.join(_buildDir, "xbox360/obj")) - includedirs { path.join(bxDir, "include/compat/msvc") } - libdirs { path.join(_libDir, "lib/xbox360") } - defines { - "NOMINMAX", - } - configuration { "durango" } targetdir (path.join(_buildDir, "durango/bin")) objdir (path.join(_buildDir, "durango/obj")) @@ -924,14 +927,6 @@ function toolchain(_buildDir, _libDir) "NOMINMAX", } - configuration { "netbsd" } - targetdir (path.join(_buildDir, "netbsd/bin")) - objdir (path.join(_buildDir, "netbsd/obj")) - libdirs { path.join(_libDir, "lib/netbsd") } - includedirs { - path.join(bxDir, "include/compat/freebsd"), - } - configuration { "osx-x64" } targetdir (path.join(_buildDir, "osx-x64/bin")) objdir (path.join(_buildDir, "osx-x64/obj")) @@ -941,7 +936,7 @@ function toolchain(_buildDir, _libDir) buildoptions { "-arch x86_64", "-msse4.2", - "-target x86_64-apple-macos" .. (#macosPlatform > 0 and macosPlatform or "10.11"), + "-target x86_64-apple-macos" .. (#macosPlatform > 0 and macosPlatform or "13.0"), } configuration { "osx-arm64" } @@ -961,58 +956,74 @@ function toolchain(_buildDir, _libDir) "-Wfatal-errors", "-Wunused-value", "-Wundef", +-- "-Wno-overriding-t-option", +-- "-mmacosx-version-min=13.0", } includedirs { path.join(bxDir, "include/compat/osx") } - configuration { "ios*" } - linkoptions { - "-lc++", - } + configuration { "xcode*", "ios*" } + targetdir (path.join(_buildDir, "ios-arm/bin")) + objdir (path.join(_buildDir, "ios-arm/obj")) + + configuration { "ios-arm64" } + targetdir (path.join(_buildDir, "ios-arm64/bin")) + objdir (path.join(_buildDir, "ios-arm64/obj")) + libdirs { path.join(_libDir, "lib/ios-arm64") } + includedirs { path.join(bxDir, "include/compat/ios") } buildoptions { + "-arch arm64", + "-mios-version-min=16.0", + "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk", + + "-fembed-bitcode", "-Wfatal-errors", "-Wunused-value", "-Wundef", } - includedirs { path.join(bxDir, "include/compat/ios") } - - configuration { "xcode*", "ios*" } - targetdir (path.join(_buildDir, "ios-arm/bin")) - objdir (path.join(_buildDir, "ios-arm/obj")) + linkoptions { + "-arch arm64", + "-mios-version-min=16.0", + "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk", + "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/System/Library/Frameworks", + } - configuration { "ios-arm" } - targetdir (path.join(_buildDir, "ios-arm/bin")) - objdir (path.join(_buildDir, "ios-arm/obj")) - libdirs { path.join(_libDir, "lib/ios-arm") } + configuration { "xros*" } linkoptions { - "-arch armv7", + "-lc++", } buildoptions { - "-arch armv7", + "-Wfatal-errors", + "-Wunused-value", + "-Wundef", } + includedirs { path.join(bxDir, "include/compat/ios") } - configuration { "ios-arm64" } - targetdir (path.join(_buildDir, "ios-arm64/bin")) - objdir (path.join(_buildDir, "ios-arm64/obj")) - libdirs { path.join(_libDir, "lib/ios-arm64") } + configuration { "xros-arm64" } + targetdir (path.join(_buildDir, "xros-arm64/bin")) + objdir (path.join(_buildDir, "xros-arm64/obj")) + libdirs { path.join(_libDir, "lib/xros-arm64") } linkoptions { - "-arch arm64", + "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/XROS.platform/Developer/SDKs/XROS" ..xrosPlatform.. ".sdk", + "-L/Applications/Xcode.app/Contents/Developer/Platforms/XROS.platform/Developer/SDKs/XROS" ..xrosPlatform .. ".sdk/usr/lib/system", + "-F/Applications/Xcode.app/Contents/Developer/Platforms/XROS.platform/Developer/SDKs/XROS" ..xrosPlatform .. ".sdk/System/Library/Frameworks", + "-F/Applications/Xcode.app/Contents/Developer/Platforms/XROS.platform/Developer/SDKs/XROS" ..xrosPlatform .. ".sdk/System/Library/PrivateFrameworks", } buildoptions { - "-arch arm64", + "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/XROS.platform/Developer/SDKs/XROS" ..tvosPlatform .. ".sdk", } - configuration { "ios-arm*" } + configuration { "xros-simulator" } + targetdir (path.join(_buildDir, "xros-simulator/bin")) + objdir (path.join(_buildDir, "xros-simulator/obj")) + libdirs { path.join(_libDir, "lib/xros-simulator") } + linkoptions { - "-miphoneos-version-min=9.0", - "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk", - "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/usr/lib/system", - "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/System/Library/Frameworks", - "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks", + "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/XRSimulator.platform/Developer/SDKs/XRSimulator" ..xrosPlatform.. ".sdk", + "-L/Applications/Xcode.app/Contents/Developer/Platforms/XRSimulator.platform/Developer/SDKs/XRSimulator" ..xrosPlatform .. ".sdk/usr/lib/system", + "-F/Applications/Xcode.app/Contents/Developer/Platforms/XRSimulator.platform/Developer/SDKs/XRSimulator" ..xrosPlatform .. ".sdk/System/Library/Frameworks", } buildoptions { - "-miphoneos-version-min=9.0", - "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk", - "-fembed-bitcode", + "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/XRSimulator.platform/Developer/SDKs/XRSimulator" ..xrosPlatform .. ".sdk", } configuration { "ios-simulator" } @@ -1020,34 +1031,12 @@ function toolchain(_buildDir, _libDir) objdir (path.join(_buildDir, "ios-simulator/obj")) libdirs { path.join(_libDir, "lib/ios-simulator") } linkoptions { - "-mios-simulator-version-min=9.0", - "-arch i386", "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk", "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/usr/lib/system", "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/Frameworks", "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks", } buildoptions { - "-mios-simulator-version-min=9.0", - "-arch i386", - "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk", - } - - configuration { "ios-simulator64" } - targetdir (path.join(_buildDir, "ios-simulator64/bin")) - objdir (path.join(_buildDir, "ios-simulator64/obj")) - libdirs { path.join(_libDir, "lib/ios-simulator64") } - linkoptions { - "-mios-simulator-version-min=9.0", - "-arch x86_64", - "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk", - "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/usr/lib/system", - "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/Frameworks", - "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks", - } - buildoptions { - "-mios-simulator-version-min=9.0", - "-arch x86_64", "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk", } @@ -1089,16 +1078,12 @@ function toolchain(_buildDir, _libDir) objdir (path.join(_buildDir, "tvos-simulator/obj")) libdirs { path.join(_libDir, "lib/tvos-simulator") } linkoptions { - "-mtvos-simulator-version-min=9.0", - "-arch i386", "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk", "-L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/usr/lib/system", "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/Frameworks", "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/PrivateFrameworks", } buildoptions { - "-mtvos-simulator-version-min=9.0", - "-arch i386", "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk", } diff --git a/bx/src/allocator.cpp b/bx/src/allocator.cpp index 5e536db0..439dec60 100644 --- a/bx/src/allocator.cpp +++ b/bx/src/allocator.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/src/amalgamated.cpp b/bx/src/amalgamated.cpp index 442bcc6e..1a9893e2 100644 --- a/bx/src/amalgamated.cpp +++ b/bx/src/amalgamated.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/src/bounds.cpp b/bx/src/bounds.cpp index 986c4c20..21362417 100644 --- a/bx/src/bounds.cpp +++ b/bx/src/bounds.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ @@ -627,7 +627,7 @@ namespace bx bool intersect(const Ray& _ray, const Capsule& _capsule, Hit* _hit) { - BX_STATIC_ASSERT(sizeof(Capsule) == sizeof(Cylinder) ); + static_assert(sizeof(Capsule) == sizeof(Cylinder) ); return intersect(_ray, *( (const Cylinder*)&_capsule), true, _hit); } diff --git a/bx/src/bx.cpp b/bx/src/bx.cpp index dc27b199..50d4f30d 100644 --- a/bx/src/bx.cpp +++ b/bx/src/bx.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -22,6 +22,74 @@ namespace bx return LocationFull(_function, _filePath, _line); } + static bool defaultAssertHandler(const Location& _location, const char* _format, va_list _argList) + { + char temp[8192]; + int32_t total = 0; + + StaticMemoryBlockWriter smb(temp, BX_COUNTOF(temp) ); + + ErrorIgnore err; + + total += write(&smb, &err, "\n--- ASSERT ---\n\n"); + + total += write(&smb, &err, "%s(%d): " + , _location.filePath + , _location.line + ); + total += write(&smb, _format, _argList, &err); + total += write(&smb, "\n\n", &err); + + uintptr_t stack[32]; + const uint32_t num = getCallStack(2 /* skip self */, BX_COUNTOF(stack), stack); + total += writeCallstack(&smb, stack, num, &err); + + total += write(&smb, &err, + "\nBuild info:\n" + "\tCompiler: " BX_COMPILER_NAME + ", CPU: " BX_CPU_NAME + ", Arch: " BX_ARCH_NAME + ", OS: " BX_PLATFORM_NAME + ", CRT: " BX_CRT_NAME + ", C++: " BX_CPP_NAME + + ", Date: " __DATE__ + ", Time: " __TIME__ + "\n" + ); + + total += write(&smb, &err, "\n--- END ---\n\n"); + + write(getDebugOut(), temp, total, ErrorIgnore{}); + + return true; + } + + static AssertHandlerFn s_assertHandler = defaultAssertHandler; + + void setAssertHandler(AssertHandlerFn _assertHandlerFn) + { + BX_WARN(defaultAssertHandler == s_assertHandler, "Assert handler is already set."); + + if (defaultAssertHandler == s_assertHandler) + { + s_assertHandler = NULL == _assertHandlerFn + ? defaultAssertHandler + : _assertHandlerFn + ; + } + } + + bool assertFunction(const Location& _location, const char* _format, ...) + { + va_list argList; + va_start(argList, _format); + const bool result = s_assertHandler(_location, _format, argList); + va_end(argList); + + return result; + } + void swap(void* _a, void* _b, size_t _numBytes) { uint8_t* lhs = (uint8_t*)_a; diff --git a/bx/src/commandline.cpp b/bx/src/commandline.cpp index bcf65949..830a548c 100644 --- a/bx/src/commandline.cpp +++ b/bx/src/commandline.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/src/crtnone.cpp b/bx/src/crtnone.cpp index 62880ec0..a06a09ed 100644 --- a/bx/src/crtnone.cpp +++ b/bx/src/crtnone.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -11,7 +11,7 @@ #if BX_CRT_NONE -#include "crt0.h" +#include #define NOT_IMPLEMENTED() \ { bx::debugPrintf("crtnone: %s not implemented\n", BX_FUNCTION); abort(); } @@ -511,6 +511,18 @@ extern "C" int prctl(int _option, unsigned long _arg2, unsigned long _arg3, unsi return -1; } +extern "C" int getpid() +{ + return crt0::processGetId(); +} + +extern "C" ssize_t readlink(const char* _pathName, char* _buffer, size_t _bufferSize) +{ + BX_UNUSED(_pathName, _buffer, _bufferSize); + NOT_IMPLEMENTED(); + return 0; +} + extern "C" int chdir(const char* _path) { BX_UNUSED(_path); @@ -635,6 +647,16 @@ void operator delete(void*, size_t) { } +extern "C" void* __cxa_begin_catch(void* _unwindArg) +{ + BX_UNUSED(_unwindArg); + return NULL; +} + +extern "C" void __cxa_end_catch() +{ +} + extern "C" void __cxa_pure_virtual(void) { } diff --git a/bx/src/debug.cpp b/bx/src/debug.cpp index d9c15081..f5074658 100644 --- a/bx/src/debug.cpp +++ b/bx/src/debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -8,15 +8,29 @@ #include // WriterI #include // PRIx* +#ifndef BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE +# define BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE 0 +#elif BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE +# if !BX_PLATFORM_LINUX || !BX_COMPILER_GCC +# error "libbackrace is only supported on GCC/Linux." +# endif // BX_PLATFORM_LINUX && BX_COMPILER_GCC +#endif // BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE + +#if BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE +# include // backtrace +# include // backtrace_syminfo +# include // abi::__cxa_demangle +#endif // BX_CONFIG_CALLSTACK_* + #if BX_CRT_NONE -# include "crt0.h" +# include #elif BX_PLATFORM_ANDROID # include #elif BX_PLATFORM_WINDOWS \ || BX_PLATFORM_WINRT \ || BX_PLATFORM_XBOXONE extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* _str); -#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX +#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_VISIONOS # if defined(__OBJC__) # import # else @@ -43,7 +57,13 @@ namespace bx // NativeClient: NaCl module load failed: Validation failure. File violates Native Client safety rules. __asm__ ("int $3"); #elif BX_PLATFORM_EMSCRIPTEN - emscripten_log(EM_LOG_CONSOLE | EM_LOG_ERROR | EM_LOG_C_STACK | EM_LOG_JS_STACK | EM_LOG_DEMANGLE, "debugBreak!"); + emscripten_log(0 + | EM_LOG_CONSOLE + | EM_LOG_ERROR + | EM_LOG_C_STACK + | EM_LOG_JS_STACK + , "debugBreak!" + ); // Doing emscripten_debugger() disables asm.js validation due to an emscripten bug //emscripten_debugger(); EM_ASM({ debugger; }); @@ -67,7 +87,8 @@ namespace bx || BX_PLATFORM_XBOXONE OutputDebugStringA(_out); #elif BX_PLATFORM_IOS \ - || BX_PLATFORM_OSX + || BX_PLATFORM_OSX \ + || BX_PLATFORM_VISIONOS # if defined(__OBJC__) NSLog(@"%s", _out); # else @@ -192,4 +213,154 @@ namespace bx return &s_debugOut; } +#if BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE + uint32_t getCallStack(uint32_t _skip, uint32_t _max, uintptr_t* _outStack) + { + const uint32_t max = _skip+_max+1; + void** tmp = (void**)alloca(sizeof(uintptr_t)*max); + + const uint32_t numFull = backtrace(tmp, max); + const uint32_t skip = min(_skip + 1 /* skip self */, numFull); + const uint32_t num = numFull - skip; + + memCopy(_outStack, tmp + skip, sizeof(uintptr_t)*num); + + return num; + } + + struct StackTraceContext + { + StackTraceContext() + { + state = backtrace_create_state(NULL, 0, NULL, NULL); + } + + struct backtrace_state* state; + }; + + static StackTraceContext s_stCtx; + + struct CallbackData + { + StringView resolvedName; + StringView fileName; + int32_t line; + }; + + static void backtraceSymInfoCb(void* _data, uintptr_t _pc, const char* _symName, uintptr_t _symVal, uintptr_t _symSize) + { + BX_UNUSED(_pc, _symVal); + + CallbackData* cbData = (CallbackData*)_data; + cbData->resolvedName.set(_symName, _symSize); + } + + static int backtraceFullCb(void* _data, uintptr_t _pc, const char* _fileName, int32_t _lineNo, const char* _function) + { + BX_UNUSED(_pc, _function); + + CallbackData* cbData = (CallbackData*)_data; + if (NULL == _fileName) + { + cbData->fileName.set(""); + cbData->line = -1; + } + else + { + cbData->fileName.set(_fileName); + cbData->line = _lineNo; + } + + return 1; + } + + int32_t writeCallstack(WriterI* _writer, uintptr_t* _stack, uint32_t _num, Error* _err) + { + BX_ERROR_SCOPE(_err); + + char demangleBuf[4096]; + size_t demangleLen = BX_COUNTOF(demangleBuf); + + int32_t total = write(_writer, _err, "Callstack (%d):\n", _num); + + CallbackData cbData; + + for (uint32_t ii = 0; ii < _num && _err->isOk(); ++ii) + { + backtrace_pcinfo(s_stCtx.state, _stack[ii], backtraceFullCb, NULL, &cbData); + + StringView demangledName; + + if (1 == backtrace_syminfo(s_stCtx.state, _stack[ii], backtraceSymInfoCb, NULL, &cbData) ) + { + demangleLen = BX_COUNTOF(demangleBuf); + int32_t demangleStatus; + abi::__cxa_demangle(cbData.resolvedName.getPtr(), demangleBuf, &demangleLen, &demangleStatus); + + if (0 == demangleStatus) + { + demangledName.set(demangleBuf, demangleLen); + } + else + { + demangledName = cbData.resolvedName; + } + } + else + { + demangledName = "???"; + } + + constexpr uint32_t width = 40; + const StringView fn = strTail(cbData.fileName, width); + + total += write(_writer, _err + , "\t%2d: %-*S % 5d: %p %S\n" + , ii + , width + , &fn + , cbData.line + , _stack[ii] + , &demangledName + ); + + if (0 == strCmp(demangledName, "main", 4) ) + { + if (0 != _num-1-ii) + { + total += write(_writer, _err + , "\t... %d more stack frames below 'main'.\n" + , _num-1-ii + ); + } + break; + } + } + + return total; + } + +#else + + uint32_t getCallStack(uint32_t _skip, uint32_t _max, uintptr_t* _outStack) + { + BX_UNUSED(_skip, _max, _outStack); + return 0; + } + + int32_t writeCallstack(WriterI* _writer, uintptr_t* _stack, uint32_t _num, Error* _err) + { + BX_UNUSED(_writer, _stack, _num, _err); + return 0; + } + +#endif // BX_CONFIG_CALLSTACK_* + + void debugOutputCallstack(uint32_t _skip) + { + uintptr_t stack[32]; + const uint32_t num = getCallStack(_skip + 1 /* skip self */, BX_COUNTOF(stack), stack); + writeCallstack(getDebugOut(), stack, num, ErrorIgnore{}); + } + } // namespace bx diff --git a/bx/src/dtoa.cpp b/bx/src/dtoa.cpp index 31d7ad92..c03f011a 100644 --- a/bx/src/dtoa.cpp +++ b/bx/src/dtoa.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -8,8 +8,6 @@ #include #include -#include - namespace bx { /* @@ -96,13 +94,13 @@ namespace bx DiyFp Normalize() const { - uint32_t s = uint64_cntlz(f); + uint8_t s = countLeadingZeros(f); return DiyFp(f << s, e - s); } DiyFp NormalizeBoundary() const { - uint32_t index = uint64_cntlz(f); + uint8_t index = countLeadingZeros(f); return DiyFp (f << index, e - index); } @@ -430,7 +428,7 @@ namespace bx int32_t toString(char* _dst, int32_t _max, double _value) { - int32_t sign = 0 != (doubleToBits(_value) & (UINT64_C(1)<<63) ) ? 1 : 0; + int32_t sign = 0 != (doubleToBits(_value) & kDoubleSignMask) ? 1 : 0; if (1 == sign) { *_dst++ = '-'; @@ -481,12 +479,8 @@ namespace bx return 0; } - _max = toString(_dst + 1 - , _max - 1 - , typename std::make_unsigned::type(-_value) - , _base - , _separator - ); + _max = toString(_dst + 1, _max - 1, asUnsigned(-_value), _base, _separator); + if (_max == 0) { return 0; @@ -496,12 +490,7 @@ namespace bx return int32_t(_max + 1); } - return toString(_dst - , _max - , typename std::make_unsigned::type(_value) - , _base - , _separator - ); + return toString(_dst, _max, asUnsigned(_value), _base, _separator); } int32_t toString(char* _dst, int32_t _max, int32_t _value, uint32_t _base, char _separator) @@ -617,12 +606,6 @@ namespace bx #define DOUBLE_PLUS_INFINITY UINT64_C(0x7ff0000000000000) #define DOUBLE_MINUS_INFINITY UINT64_C(0xfff0000000000000) - union HexDouble - { - double d; - uint64_t u; - }; - #define lsr96(s2, s1, s0, d2, d1, d0) \ d0 = ( (s0) >> 1) | ( ( (s1) & 1) << 31); \ d1 = ( (s1) >> 1) | ( ( (s2) & 1) << 31); \ @@ -943,13 +926,12 @@ namespace bx static double converter(PrepNumber* _pn) { int binexp = 92; - HexDouble hd; uint32_t s2, s1, s0; /* 96-bit precision integer */ uint32_t q2, q1, q0; /* 96-bit precision integer */ uint32_t r2, r1, r0; /* 96-bit precision integer */ uint32_t mask28 = UINT32_C(0xf) << 28; - hd.u = 0; + uint64_t hdu = 0; s0 = (uint32_t)(_pn->mantissa & UINT32_MAX); s1 = (uint32_t)(_pn->mantissa >> 32); @@ -1022,18 +1004,18 @@ namespace bx { if (_pn->negative) { - hd.u = DOUBLE_MINUS_INFINITY; + hdu = DOUBLE_MINUS_INFINITY; } else { - hd.u = DOUBLE_PLUS_INFINITY; + hdu = DOUBLE_PLUS_INFINITY; } } else if (binexp < 1) { if (_pn->negative) { - hd.u = DOUBLE_MINUS_ZERO; + hdu = DOUBLE_MINUS_ZERO; } } else if (s2) @@ -1050,10 +1032,10 @@ namespace bx q |= (1ULL << 63); } - hd.u = q; + hdu = q; } - return hd.d; + return bitCast(hdu); } int32_t toString(char* _out, int32_t _max, bool _value) @@ -1085,9 +1067,6 @@ namespace bx pn.negative = 0; pn.exponent = 0; - HexDouble hd; - hd.u = DOUBLE_PLUS_ZERO; - switch (parser(_str.getPtr(), _str.getTerm(), &pn) ) { case PARSER_OK: @@ -1095,22 +1074,19 @@ namespace bx break; case PARSER_PZERO: - *_out = hd.d; + *_out = bitCast(DOUBLE_PLUS_ZERO); break; case PARSER_MZERO: - hd.u = DOUBLE_MINUS_ZERO; - *_out = hd.d; + *_out = bitCast(DOUBLE_MINUS_ZERO); break; case PARSER_PINF: - hd.u = DOUBLE_PLUS_INFINITY; - *_out = hd.d; + *_out = bitCast(DOUBLE_PLUS_INFINITY); break; case PARSER_MINF: - hd.u = DOUBLE_MINUS_INFINITY; - *_out = hd.d; + *_out = bitCast(DOUBLE_MINUS_INFINITY); break; } diff --git a/bx/src/easing.cpp b/bx/src/easing.cpp index 9d5d08a5..9bc4dce3 100644 --- a/bx/src/easing.cpp +++ b/bx/src/easing.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -53,7 +53,7 @@ namespace bx easeInOutBounce, easeOutInBounce, }; - BX_STATIC_ASSERT(BX_COUNTOF(s_easeFunc) == Easing::Count); + static_assert(BX_COUNTOF(s_easeFunc) == Easing::Count); EaseFn getEaseFunc(Easing::Enum _enum) { diff --git a/bx/src/file.cpp b/bx/src/file.cpp index 0d1024f0..1b182b25 100644 --- a/bx/src/file.cpp +++ b/bx/src/file.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -14,7 +14,7 @@ #endif // BX_CONFIG_CRT_DIRECTORY_READER #if BX_CRT_NONE -# include "crt0.h" +# include #else # if BX_CONFIG_CRT_DIRECTORY_READER # include @@ -72,11 +72,11 @@ namespace bx # define ftello64 _ftelli64 # elif 0 \ || BX_PLATFORM_ANDROID \ - || BX_PLATFORM_BSD \ || BX_PLATFORM_EMSCRIPTEN \ - || BX_PLATFORM_HAIKU \ || BX_PLATFORM_IOS \ - || BX_PLATFORM_OSX + || BX_PLATFORM_OSX \ + || BX_PLATFORM_VISIONOS \ + || BX_PLATFORM_NX # define fseeko64 fseeko # define ftello64 ftello # elif BX_PLATFORM_PS4 @@ -494,7 +494,7 @@ namespace bx FileReader::FileReader() { - BX_STATIC_ASSERT(sizeof(FileReaderImpl) <= sizeof(m_internal) ); + static_assert(sizeof(FileReaderImpl) <= sizeof(m_internal) ); BX_PLACEMENT_NEW(m_internal, FileReaderImpl)(NULL); } @@ -530,7 +530,7 @@ namespace bx FileWriter::FileWriter() { - BX_STATIC_ASSERT(sizeof(FileWriterImpl) <= sizeof(m_internal) ); + static_assert(sizeof(FileWriterImpl) <= sizeof(m_internal) ); BX_PLACEMENT_NEW(m_internal, FileWriterImpl)(NULL); } @@ -711,7 +711,7 @@ namespace bx DirectoryReader::DirectoryReader() { - BX_STATIC_ASSERT(sizeof(DirectoryReaderImpl) <= sizeof(m_internal) ); + static_assert(sizeof(DirectoryReaderImpl) <= sizeof(m_internal) ); BX_PLACEMENT_NEW(m_internal, DirectoryReaderImpl); } @@ -801,7 +801,7 @@ namespace bx #if BX_CRT_MSVC int32_t result = ::_mkdir(_filePath.getCPtr() ); #elif BX_CRT_MINGW - int32_t result = ::mkdir(_filePath.getCPtr()); + int32_t result = ::mkdir(_filePath.getCPtr() ); #elif BX_CRT_NONE BX_UNUSED(_filePath); int32_t result = -1; @@ -865,14 +865,18 @@ namespace bx return false; } -#if BX_CRT_MSVC +#if BX_CRT_MSVC || BX_CRT_MINGW int32_t result = -1; FileInfo fi; if (stat(fi, _filePath) ) { if (FileType::Dir == fi.type) { +# if BX_CRT_MINGW + result = ::rmdir(_filePath.getCPtr() ); +# else result = ::_rmdir(_filePath.getCPtr() ); +# endif // BX_CRT_MINGW } else { diff --git a/bx/src/filepath.cpp b/bx/src/filepath.cpp index a675aaae..f18d40c4 100644 --- a/bx/src/filepath.cpp +++ b/bx/src/filepath.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -7,13 +7,11 @@ #include #include -#if !BX_CRT_NONE -# if BX_CRT_MSVC -# include // _getcwd -# else -# include // getcwd -# endif // BX_CRT_MSVC -#endif // !BX_CRT_NONE +#if BX_CRT_MSVC +# include // _getcwd +#else +# include // getcwd +#endif // BX_CRT_MSVC #if BX_PLATFORM_WINDOWS #if !defined(GetModuleFileName) @@ -121,7 +119,7 @@ namespace bx break; } - BX_FALLTHROUGH; + [[fallthrough]]; default: if ( ( rooted && slashIdx+1 != size) @@ -217,16 +215,16 @@ namespace bx *_inOutSize = uint32_t(result); return true; } + + return false; #elif BX_PLATFORM_OSX uint32_t len = *_inOutSize; bool result = _NSGetExecutablePath(_out, &len); - if (0 == result) - { - return true; - } -#endif // BX_PLATFORM_* - + return 0 == result; +#else + BX_UNUSED(_out, _inOutSize); return false; +#endif // BX_PLATFORM_* } static bool getHomePath(char* _out, uint32_t* _inOutSize) diff --git a/bx/src/hash.cpp b/bx/src/hash.cpp index 0f9beffc..0bbe7090 100644 --- a/bx/src/hash.cpp +++ b/bx/src/hash.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -43,7 +43,7 @@ static const uint32_t s_crcTableIeee[] = 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; -BX_STATIC_ASSERT(BX_COUNTOF(s_crcTableIeee) == 256); +static_assert(BX_COUNTOF(s_crcTableIeee) == 256); static const uint32_t s_crcTableCastagnoli[] = { @@ -80,7 +80,7 @@ static const uint32_t s_crcTableCastagnoli[] = 0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81, 0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e, 0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e, 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351, }; -BX_STATIC_ASSERT(BX_COUNTOF(s_crcTableCastagnoli) == 256); +static_assert(BX_COUNTOF(s_crcTableCastagnoli) == 256); static const uint32_t s_crcTableKoopman[] = { @@ -117,7 +117,7 @@ static const uint32_t s_crcTableKoopman[] = 0xcc9b9520, 0x5a0e51ea, 0x37d3ace9, 0xa1466823, 0xec6856ef, 0x7afd9225, 0x17206f26, 0x81b5abec, 0x8d7c12be, 0x1be9d674, 0x76342b77, 0xe0a1efbd, 0xad8fd171, 0x3b1a15bb, 0x56c7e8b8, 0xc0522c72, }; -BX_STATIC_ASSERT(BX_COUNTOF(s_crcTableKoopman) == 256); +static_assert(BX_COUNTOF(s_crcTableKoopman) == 256); static const uint32_t* s_crcTable[] = { @@ -125,7 +125,7 @@ static const uint32_t* s_crcTable[] = s_crcTableCastagnoli, s_crcTableKoopman, }; -BX_STATIC_ASSERT(BX_COUNTOF(s_crcTable) == HashCrc32::Count); +static_assert(BX_COUNTOF(s_crcTable) == HashCrc32::Count); void HashCrc32::begin(Enum _type) { @@ -147,84 +147,52 @@ void HashCrc32::add(const void* _data, int32_t _len) m_hash = hash; } -struct HashMurmur2APod +BX_FORCE_INLINE uint32_t readAligned(const uint8_t* _data) { - uint32_t m_hash; - uint32_t m_tail; - uint32_t m_count; - uint32_t m_size; -}; -BX_STATIC_ASSERT(sizeof(HashMurmur2A) == sizeof(HashMurmur2APod) ); + return *(uint32_t*)_data; +} -BX_FORCE_INLINE void mmix(uint32_t& _h, uint32_t& _k) +BX_FORCE_INLINE uint32_t readUnaligned(const uint8_t* _data) { - constexpr uint32_t kMurmurMul = 0x5bd1e995; - constexpr uint32_t kMurmurRightShift = 24; - - _k *= kMurmurMul; - _k ^= _k >> kMurmurRightShift; - _k *= kMurmurMul; - _h *= kMurmurMul; - _h ^= _k; + return 0 + | _data[3]<<24 + | _data[2]<<16 + | _data[1]<<8 + | _data[0] + ; } -static void mixTail(HashMurmur2APod& _self, const uint8_t*& _data, int32_t& _len) +namespace { - while (_len - && ( (_len<4) || _self.m_count) - ) - { - _self.m_tail |= (*_data++) << (_self.m_count * 8); - _self.m_count++; +template +void mixTail(Ty& _self, const uint8_t*& _data, int32_t& _len) +{ + while (0 != _len + && (0 < _self.m_count || 4 > _len) ) + { + _self.m_tail[_self.m_count++] = *_data++; _len--; - if (_self.m_count == 4) + if (4 == _self.m_count) { - mmix(_self.m_hash, _self.m_tail); - _self.m_tail = 0; + uint32_t kk = *( (uint32_t*)&_self.m_tail[0]); + _self.mix(kk); _self.m_count = 0; } } } -BX_FORCE_INLINE uint32_t readAligned(const uint8_t* _data) -{ - return *(uint32_t*)_data; -} - -BX_FORCE_INLINE uint32_t readUnaligned(const uint8_t* _data) -{ - if (BX_ENABLED(BX_CPU_ENDIAN_BIG) ) - { - return 0 - | _data[0]<<24 - | _data[1]<<16 - | _data[2]<<8 - | _data[3] - ; - } - else - { - return 0 - | _data[0] - | _data[1]<<8 - | _data[2]<<16 - | _data[3]<<24 - ; - } -} - typedef uint32_t (*ReadDataFn)(const uint8_t* _data); -template -static void addData(HashMurmur2APod& _self, const uint8_t* _data, int32_t _len) +template +void addData(Ty& _self, const uint8_t* _data, int32_t _len) { while (_len >= 4) { uint32_t kk = FnT(_data); - mmix(_self.m_hash, kk); + _self.mix(kk); _data += 4; _len -= 4; @@ -233,36 +201,149 @@ static void addData(HashMurmur2APod& _self, const uint8_t* _data, int32_t _len) mixTail(_self, _data, _len); } -void HashMurmur2A::add(const void* _data, int32_t _len) +template +void addData(ThisT* _this, const void* _data, int32_t _len) { - HashMurmur2APod& self = *(HashMurmur2APod*)this; + SelfT& self = *(SelfT*)_this; const uint8_t* data = (const uint8_t*)_data; - m_size += _len; + self.m_size += _len; mixTail(self, data, _len); if (BX_UNLIKELY(!isAligned(data, 4) ) ) { - addData(self, data, _len); + addData(self, data, _len); return; } - addData(self, data, _len); + addData(self, data, _len); +} + +template +uint32_t finalize(ThisT* _this) +{ + SelfT& self = *(SelfT*)_this; + self.finalize(); + + return self.m_hash; +} + +} // namespace + +struct HashMurmur2APod +{ + uint32_t m_hash; + uint32_t m_size; + uint8_t m_tail[4]; + uint8_t m_count; + + static constexpr uint32_t kMurmur2AMul = 0x5bd1e995; + + BX_FORCE_INLINE void mix(uint32_t& _k) + { + _k *= kMurmur2AMul; + _k ^= _k >> 24; + _k *= kMurmur2AMul; + + m_hash *= kMurmur2AMul; + m_hash ^= _k; + } + + void finalize() + { + uint32_t kk = 0; + + switch (m_count) + { + case 3: kk |= m_tail[2] << 16; [[fallthrough]]; + case 2: kk |= m_tail[1] << 8; [[fallthrough]]; + case 1: kk |= m_tail[0]; [[fallthrough]]; + case 0: mix(kk); break; + default: BX_ASSERT(false, "Bug, m_count can't be %d (expected < 4).", m_count); BX_UNREACHABLE; + } + + mix(m_size); + + m_hash ^= m_hash >> 13; + m_hash *= kMurmur2AMul; + m_hash ^= m_hash >> 15; + } +}; +static_assert(sizeof(HashMurmur2A) == sizeof(HashMurmur2APod) ); + +void HashMurmur2A::add(const void* _data, int32_t _len) +{ + addData(this, _data, _len); } uint32_t HashMurmur2A::end() { - constexpr uint32_t kMurmurMul = 0x5bd1e995; + return finalize(this); +} + +struct HashMurmur3Pod +{ + uint32_t m_hash; + uint32_t m_size; + uint8_t m_tail[4]; + uint8_t m_count; - mmix(m_hash, m_tail); - mmix(m_hash, m_size); + static constexpr uint32_t kMurmur3Mul1 = 0xcc9e2d51; + static constexpr uint32_t kMurmur3Mul2 = 0x1b873593; + static constexpr uint32_t kMurmur3Mul3 = 0x85ebca6b; + static constexpr uint32_t kMurmur3Mul4 = 0xc2b2ae35; + static constexpr uint32_t kMurmur3Add = 0xe6546b64; - m_hash ^= m_hash >> 13; - m_hash *= kMurmurMul; - m_hash ^= m_hash >> 15; + BX_FORCE_INLINE void mix1(uint32_t _k) + { + _k *= kMurmur3Mul1; + _k = uint32_rol(_k, 15); + _k *= kMurmur3Mul2; - return m_hash; + m_hash ^= _k; + } + + BX_FORCE_INLINE void mix(uint32_t _k) + { + mix1(_k); + + m_hash = uint32_rol(m_hash, 13); + m_hash = m_hash*5 + kMurmur3Add; + } + + void finalize() + { + uint32_t kk = 0; + + switch (m_count) + { + case 3: kk |= m_tail[2] << 16; [[fallthrough]]; + case 2: kk |= m_tail[1] << 8; [[fallthrough]]; + case 1: kk |= m_tail[0]; mix1(kk); break; + case 0: break; + default: BX_ASSERT(false, "Bug, m_count can't be %d (expected < 4).", m_count); BX_UNREACHABLE; + } + + m_hash ^= m_size; + + m_hash ^= m_hash >> 16; + m_hash *= kMurmur3Mul3; + m_hash ^= m_hash >> 13; + m_hash *= kMurmur3Mul4; + m_hash ^= m_hash >> 16; + } +}; +static_assert(sizeof(HashMurmur3) == sizeof(HashMurmur3Pod) ); + +void HashMurmur3::add(const void* _data, int32_t _len) +{ + addData(this, _data, _len); +} + +uint32_t HashMurmur3::end() +{ + return finalize(this); } } // namespace bx diff --git a/bx/src/math.cpp b/bx/src/math.cpp index f5e2b3a7..093fb4b8 100644 --- a/bx/src/math.cpp +++ b/bx/src/math.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -10,148 +10,12 @@ namespace bx { - const float kFloatInfinity = bitsToFloat(kFloatExponentMask); - const double kDoubleInfinity = bitsToDouble(kDoubleExponentMask); - - namespace - { - constexpr float kSinC2 = -0.16666667163372039794921875f; - constexpr float kSinC4 = 8.333347737789154052734375e-3f; - constexpr float kSinC6 = -1.9842604524455964565277099609375e-4f; - constexpr float kSinC8 = 2.760012648650445044040679931640625e-6f; - constexpr float kSinC10 = -2.50293279435709337121807038784027099609375e-8f; - - constexpr float kCosC2 = -0.5f; - constexpr float kCosC4 = 4.166664183139801025390625e-2f; - constexpr float kCosC6 = -1.388833043165504932403564453125e-3f; - constexpr float kCosC8 = 2.47562347794882953166961669921875e-5f; - constexpr float kCosC10 = -2.59630184018533327616751194000244140625e-7f; - - } // namespace - - BX_CONST_FUNC float cos(float _a) - { - const float scaled = _a * 2.0f*kInvPi; - const float real = floor(scaled); - const float xx = _a - real * kPiHalf; - const int32_t bits = int32_t(real) & 3; - - float c0, c2, c4, c6, c8, c10; - - if (bits == 0 - || bits == 2) - { - c0 = 1.0f; - c2 = kCosC2; - c4 = kCosC4; - c6 = kCosC6; - c8 = kCosC8; - c10 = kCosC10; - } - else - { - c0 = xx; - c2 = kSinC2; - c4 = kSinC4; - c6 = kSinC6; - c8 = kSinC8; - c10 = kSinC10; - } - - const float xsq = square(xx); - const float tmp0 = mad(c10, xsq, c8 ); - const float tmp1 = mad(tmp0, xsq, c6 ); - const float tmp2 = mad(tmp1, xsq, c4 ); - const float tmp3 = mad(tmp2, xsq, c2 ); - const float tmp4 = mad(tmp3, xsq, 1.0); - const float result = tmp4 * c0; - - return bits == 1 || bits == 2 - ? -result - : result - ; - } - - namespace - { - constexpr float kAcosC0 = 1.5707288f; - constexpr float kAcosC1 = -0.2121144f; - constexpr float kAcosC2 = 0.0742610f; - constexpr float kAcosC3 = -0.0187293f; - - } // namespace - - BX_CONST_FUNC float acos(float _a) - { - const float absa = abs(_a); - const float tmp0 = mad(kAcosC3, absa, kAcosC2); - const float tmp1 = mad(tmp0, absa, kAcosC1); - const float tmp2 = mad(tmp1, absa, kAcosC0); - const float tmp3 = tmp2 * sqrt(1.0f - absa); - const float negate = float(_a < 0.0f); - const float tmp4 = tmp3 - 2.0f*negate*tmp3; - const float result = negate*kPi + tmp4; - - return result; - } - - namespace - { - constexpr float kAtan2C0 = -0.013480470f; - constexpr float kAtan2C1 = 0.057477314f; - constexpr float kAtan2C2 = -0.121239071f; - constexpr float kAtan2C3 = 0.195635925f; - constexpr float kAtan2C4 = -0.332994597f; - constexpr float kAtan2C5 = 0.999995630f; - - } // namespace - - BX_CONST_FUNC float atan2(float _y, float _x) - { - const float ax = abs(_x); - const float ay = abs(_y); - const float maxaxy = max(ax, ay); - const float minaxy = min(ax, ay); - - if (maxaxy == 0.0f) - { - return _y < 0.0f ? -0.0f : 0.0f; - } - - const float mxy = minaxy / maxaxy; - const float mxysq = square(mxy); - const float tmp0 = mad(kAtan2C0, mxysq, kAtan2C1); - const float tmp1 = mad(tmp0, mxysq, kAtan2C2); - const float tmp2 = mad(tmp1, mxysq, kAtan2C3); - const float tmp3 = mad(tmp2, mxysq, kAtan2C4); - const float tmp4 = mad(tmp3, mxysq, kAtan2C5); - const float tmp5 = tmp4 * mxy; - const float tmp6 = ay > ax ? kPiHalf - tmp5 : tmp5; - const float tmp7 = _x < 0.0f ? kPi - tmp6 : tmp6; - const float result = _y < 0.0f ? -tmp7 : tmp7; - - return result; - } - - BX_CONST_FUNC float ldexp(float _a, int32_t _b) - { - const uint32_t ftob = floatToBits(_a); - const uint32_t masked = uint32_and(ftob, kFloatSignMask | kFloatExponentMask); - const uint32_t expsign0 = uint32_sra(masked, 23); - const uint32_t tmp = uint32_iadd(expsign0, _b); - const uint32_t expsign1 = uint32_sll(tmp, 23); - const uint32_t mantissa = uint32_and(ftob, kFloatMantissaMask); - const uint32_t bits = uint32_or(mantissa, expsign1); - const float result = bitsToFloat(bits); - - return result; - } - float frexp(float _a, int32_t* _outExp) { const uint32_t ftob = floatToBits(_a); const uint32_t masked0 = uint32_and(ftob, kFloatExponentMask); - const uint32_t exp0 = uint32_srl(masked0, 23); + const uint32_t exp0 = uint32_srl(masked0, kFloatExponentBitShift); + const uint32_t masked1 = uint32_and(ftob, kFloatSignMask | kFloatMantissaMask); const uint32_t bits = uint32_or(masked1, UINT32_C(0x3f000000) ); const float result = bitsToFloat(bits); @@ -161,86 +25,6 @@ namespace bx return result; } - namespace - { - constexpr float kExpC0 = 1.66666666666666019037e-01f; - constexpr float kExpC1 = -2.77777777770155933842e-03f; - constexpr float kExpC2 = 6.61375632143793436117e-05f; - constexpr float kExpC3 = -1.65339022054652515390e-06f; - constexpr float kExpC4 = 4.13813679705723846039e-08f; - - } // namespace - - BX_CONST_FUNC float exp(float _a) - { - if (abs(_a) <= kNearZero) - { - return _a + 1.0f; - } - - const float kk = round(_a*kInvLogNat2); - const float hi = _a - kk*kLogNat2Hi; - const float lo = kk*kLogNat2Lo; - const float hml = hi - lo; - const float hmlsq = square(hml); - const float tmp0 = mad(kExpC4, hmlsq, kExpC3); - const float tmp1 = mad(tmp0, hmlsq, kExpC2); - const float tmp2 = mad(tmp1, hmlsq, kExpC1); - const float tmp3 = mad(tmp2, hmlsq, kExpC0); - const float tmp4 = hml - hmlsq * tmp3; - const float tmp5 = hml*tmp4/(2.0f-tmp4); - const float tmp6 = 1.0f - ( (lo - tmp5) - hi); - const float result = ldexp(tmp6, int32_t(kk) ); - - return result; - } - - namespace - { - constexpr float kLogC0 = 6.666666666666735130e-01f; - constexpr float kLogC1 = 3.999999999940941908e-01f; - constexpr float kLogC2 = 2.857142874366239149e-01f; - constexpr float kLogC3 = 2.222219843214978396e-01f; - constexpr float kLogC4 = 1.818357216161805012e-01f; - constexpr float kLogC5 = 1.531383769920937332e-01f; - constexpr float kLogC6 = 1.479819860511658591e-01f; - - } // namespace - - BX_CONST_FUNC float log(float _a) - { - int32_t exp; - float ff = frexp(_a, &exp); - if (ff < kSqrt2*0.5f) - { - ff *= 2.0f; - --exp; - } - - ff -= 1.0f; - const float kk = float(exp); - const float hi = kk*kLogNat2Hi; - const float lo = kk*kLogNat2Lo; - const float ss = ff / (2.0f + ff); - const float s2 = square(ss); - const float s4 = square(s2); - - const float tmp0 = mad(kLogC6, s4, kLogC4); - const float tmp1 = mad(tmp0, s4, kLogC2); - const float tmp2 = mad(tmp1, s4, kLogC0); - const float t1 = s2*tmp2; - - const float tmp3 = mad(kLogC5, s4, kLogC3); - const float tmp4 = mad(tmp3, s4, kLogC1); - const float t2 = s4*tmp4; - - const float t12 = t1 + t2; - const float hfsq = 0.5f*square(ff); - const float result = hi - ( (hfsq - (ss*(hfsq+t12) + lo) ) - ff); - - return result; - } - void mtxLookAt(float* _result, const Vec3& _eye, const Vec3& _at, const Vec3& _up, Handedness::Enum _handedness) { const Vec3 view = normalize( diff --git a/bx/src/mutex.cpp b/bx/src/mutex.cpp index f40926a4..56320b85 100644 --- a/bx/src/mutex.cpp +++ b/bx/src/mutex.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -9,16 +9,15 @@ #if BX_CRT_NONE # include -# include "crt0.h" +# include #elif BX_PLATFORM_ANDROID \ - || BX_PLATFORM_BSD \ - || BX_PLATFORM_HAIKU \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_IOS \ || BX_PLATFORM_OSX \ || BX_PLATFORM_PS4 \ || BX_PLATFORM_RPI \ - || BX_PLATFORM_NX + || BX_PLATFORM_NX \ + || BX_PLATFORM_VISIONOS # include #elif BX_PLATFORM_WINDOWS \ || BX_PLATFORM_WINRT \ @@ -45,7 +44,7 @@ namespace bx Mutex::Mutex() { - BX_STATIC_ASSERT(sizeof(int32_t) <= sizeof(m_internal) ); + static_assert(sizeof(int32_t) <= sizeof(m_internal) ); uint32_t* futex = (uint32_t*)m_internal; *futex = State::Unlocked; @@ -124,7 +123,7 @@ namespace bx Mutex::Mutex() { - BX_STATIC_ASSERT(sizeof(pthread_mutex_t) <= sizeof(m_internal) ); + static_assert(sizeof(pthread_mutex_t) <= sizeof(m_internal) ); pthread_mutexattr_t attr; diff --git a/bx/src/os.cpp b/bx/src/os.cpp index 22234a9b..659f5893 100644 --- a/bx/src/os.cpp +++ b/bx/src/os.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -20,22 +20,19 @@ # include # include #elif BX_PLATFORM_ANDROID \ - || BX_PLATFORM_BSD \ || BX_PLATFORM_EMSCRIPTEN \ - || BX_PLATFORM_HAIKU \ - || BX_PLATFORM_HURD \ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NX \ || BX_PLATFORM_OSX \ || BX_PLATFORM_PS4 \ - || BX_PLATFORM_RPI + || BX_PLATFORM_RPI \ + || BX_PLATFORM_VISIONOS # include // sched_yield -# if BX_PLATFORM_BSD \ - || BX_PLATFORM_HAIKU \ - || BX_PLATFORM_IOS \ +# if BX_PLATFORM_IOS \ || BX_PLATFORM_OSX \ - || BX_PLATFORM_PS4 + || BX_PLATFORM_PS4 \ + || BX_PLATFORM_VISIONOS # include // mach_port_t # endif // BX_PLATFORM_* @@ -51,16 +48,8 @@ # include // fopen # include // syscall # include -# elif BX_PLATFORM_HAIKU -# include // fopen -# include // syscall # elif BX_PLATFORM_OSX # include // mach_task_basic_info -# elif BX_PLATFORM_HURD -# include // fopen -# include // pthread_self -# elif BX_PLATFORM_ANDROID -# include "debug.h" // getTid is not implemented... # endif // BX_PLATFORM_ANDROID #endif // BX_PLATFORM_ @@ -74,7 +63,7 @@ namespace bx || BX_PLATFORM_WINRT \ || BX_CRT_NONE BX_UNUSED(_ms); - debugOutput("sleep is not implemented"); debugBreak(); + BX_ASSERT(false, "Function '%s' is not implemented!", BX_FUNCTION); #else timespec req = { (time_t)_ms/1000, (long)( (_ms%1000)*1000000) }; timespec rem = { 0, 0 }; @@ -89,7 +78,7 @@ namespace bx #elif BX_PLATFORM_XBOXONE \ || BX_PLATFORM_WINRT \ || BX_CRT_NONE - debugOutput("yield is not implemented"); debugBreak(); + BX_ASSERT(false, "Function '%s' is not implemented!", BX_FUNCTION); #else ::sched_yield(); #endif // BX_PLATFORM_ @@ -105,12 +94,8 @@ namespace bx #elif BX_PLATFORM_IOS \ || BX_PLATFORM_OSX return (mach_port_t)::pthread_mach_thread_np(pthread_self() ); -#elif BX_PLATFORM_BSD - return *(uint32_t*)::pthread_self(); -#elif BX_PLATFORM_HURD - return (pthread_t)::pthread_self(); #else - debugOutput("getTid is not implemented"); debugBreak(); + BX_ASSERT(false, "Function '%s' is not implemented!", BX_FUNCTION); return 0; #endif // BX_PLATFORM_ } @@ -120,8 +105,7 @@ namespace bx #if BX_PLATFORM_ANDROID struct mallinfo mi = mallinfo(); return mi.uordblks; -#elif BX_PLATFORM_LINUX \ - || BX_PLATFORM_HURD +#elif BX_PLATFORM_LINUX FILE* file = fopen("/proc/self/statm", "r"); if (NULL == file) { @@ -169,6 +153,7 @@ namespace bx ); return pmc.WorkingSetSize; #else + BX_ASSERT(false, "Function '%s' is not implemented!", BX_FUNCTION); return 0; #endif // BX_PLATFORM_* } @@ -181,6 +166,7 @@ namespace bx || BX_PLATFORM_PS4 \ || BX_PLATFORM_XBOXONE \ || BX_PLATFORM_WINRT \ + || BX_PLATFORM_NX \ || BX_CRT_NONE BX_UNUSED(_filePath); return NULL; @@ -204,6 +190,7 @@ namespace bx || BX_PLATFORM_PS4 \ || BX_PLATFORM_XBOXONE \ || BX_PLATFORM_WINRT \ + || BX_PLATFORM_NX \ || BX_CRT_NONE BX_UNUSED(_handle); #else @@ -223,6 +210,7 @@ namespace bx || BX_PLATFORM_PS4 \ || BX_PLATFORM_XBOXONE \ || BX_PLATFORM_WINRT \ + || BX_PLATFORM_NX \ || BX_CRT_NONE BX_UNUSED(_handle, symbol); return NULL; @@ -246,6 +234,7 @@ namespace bx || BX_PLATFORM_PS4 \ || BX_PLATFORM_XBOXONE \ || BX_PLATFORM_WINRT \ + || BX_PLATFORM_NX \ || BX_CRT_NONE BX_UNUSED(name, _out, _inOutSize); return false; @@ -289,6 +278,7 @@ namespace bx || BX_PLATFORM_PS4 \ || BX_PLATFORM_XBOXONE \ || BX_PLATFORM_WINRT \ + || BX_PLATFORM_NX \ || BX_CRT_NONE BX_UNUSED(name, value); #else @@ -320,8 +310,7 @@ namespace bx void* exec(const char* const* _argv) { -#if BX_PLATFORM_LINUX \ - || BX_PLATFORM_HURD +#if BX_PLATFORM_LINUX pid_t pid = fork(); if (0 == pid) @@ -376,7 +365,7 @@ namespace bx #else BX_UNUSED(_argv); return NULL; -#endif // BX_PLATFORM_LINUX || BX_PLATFORM_HURD +#endif // BX_PLATFORM_LINUX } void exit(int32_t _exitCode) diff --git a/bx/src/process.cpp b/bx/src/process.cpp index b302bc4b..9d211cac 100644 --- a/bx/src/process.cpp +++ b/bx/src/process.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/src/semaphore.cpp b/bx/src/semaphore.cpp index 8105b4d2..67738c86 100644 --- a/bx/src/semaphore.cpp +++ b/bx/src/semaphore.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -9,7 +9,8 @@ #if BX_CRT_NONE #elif BX_PLATFORM_OSX \ - || BX_PLATFORM_IOS + || BX_PLATFORM_IOS \ + || BX_PLATFORM_VISIONOS # include #elif BX_PLATFORM_POSIX # include @@ -36,7 +37,8 @@ namespace bx #if BX_CRT_NONE #elif BX_PLATFORM_OSX \ - || BX_PLATFORM_IOS + || BX_PLATFORM_IOS \ + || BX_PLATFORM_VISIONOS dispatch_semaphore_t m_handle; #elif BX_PLATFORM_POSIX pthread_mutex_t m_mutex; @@ -52,7 +54,7 @@ namespace bx #if BX_CRT_NONE Semaphore::Semaphore() { - BX_STATIC_ASSERT(sizeof(SemaphoreInternal) <= sizeof(m_internal) ); + static_assert(sizeof(SemaphoreInternal) <= sizeof(m_internal) ); } Semaphore::~Semaphore() @@ -70,11 +72,12 @@ namespace bx return false; } #elif BX_PLATFORM_OSX \ - || BX_PLATFORM_IOS + || BX_PLATFORM_IOS \ + || BX_PLATFORM_VISIONOS Semaphore::Semaphore() { - BX_STATIC_ASSERT(sizeof(SemaphoreInternal) <= sizeof(m_internal) ); + static_assert(sizeof(SemaphoreInternal) <= sizeof(m_internal) ); SemaphoreInternal* si = (SemaphoreInternal*)m_internal; si->m_handle = dispatch_semaphore_create(0); @@ -134,7 +137,7 @@ namespace bx Semaphore::Semaphore() { - BX_STATIC_ASSERT(sizeof(SemaphoreInternal) <= sizeof(m_internal) ); + static_assert(sizeof(SemaphoreInternal) <= sizeof(m_internal) ); SemaphoreInternal* si = (SemaphoreInternal*)m_internal; si->m_count = 0; diff --git a/bx/src/settings.cpp b/bx/src/settings.cpp index 87e37bb6..ab38263b 100644 --- a/bx/src/settings.cpp +++ b/bx/src/settings.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/src/sort.cpp b/bx/src/sort.cpp index 1991b1a9..7b05a754 100644 --- a/bx/src/sort.cpp +++ b/bx/src/sort.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/src/string.cpp b/bx/src/string.cpp index 0f213135..af7e20eb 100644 --- a/bx/src/string.cpp +++ b/bx/src/string.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -556,6 +556,22 @@ namespace bx return strLTrimSpace(strRTrimSpace(_str) ); } + // If offset in UTF-8 string doesn't land on rune, walk back until first byte of rune is reached. + static const char* fixPtrToRune(const char* _strBegin, const char* _curr) + { + for (; _curr > _strBegin && (*_curr & 0xc0) == 0x80; --_curr); + + return _curr; + } + + StringView strTail(const StringView _str, uint32_t _num) + { + return StringView( + fixPtrToRune(_str.getPtr(), _str.getTerm() - min(_num, _str.getLength() ) ) + , _str.getTerm() + ); + } + constexpr uint32_t kFindStep = 1024; StringView strFindNl(const StringView& _str) @@ -758,7 +774,7 @@ namespace bx len--; } - int32_t padding = _param.width > len ? _param.width - len - hasSign: 0; + const int32_t padding = _param.width > len ? _param.width - len - hasSign: 0; if (!_param.left) { @@ -769,7 +785,24 @@ namespace bx sign = '\0'; } - size += writeRep(_writer, _param.fill, max(0, padding), _err); + if (_param.width < _param.prec) + { + size += writeRep(_writer, _param.fill, max(0, padding), _err); + } + else + { + const int32_t maxPrec = max(_param.prec, len); + const int32_t fillLen = max(0, _param.width - maxPrec - hasSign); + size += writeRep(_writer, _param.fill, fillLen, _err); + + if ('\0' != sign) + { + size += write(_writer, sign, _err); + sign = '\0'; + } + + size += writeRep(_writer, '0', max(0, padding-fillLen), _err); + } } if ('\0' != sign) @@ -1197,7 +1230,8 @@ namespace bx int32_t vsnprintf(char* _out, int32_t _max, const char* _format, va_list _argList) { - if (0 < _max) + if ( 0 < _max + && NULL != _out) { StaticMemoryBlockWriter writer(_out, uint32_t(_max) ); diff --git a/bx/src/thread.cpp b/bx/src/thread.cpp index 2dce0ca4..72971695 100644 --- a/bx/src/thread.cpp +++ b/bx/src/thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -13,20 +13,16 @@ #endif #if BX_CRT_NONE -# include "crt0.h" +# include #elif BX_PLATFORM_ANDROID \ - || BX_PLATFORM_BSD \ - || BX_PLATFORM_HAIKU \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_IOS \ || BX_PLATFORM_OSX \ || BX_PLATFORM_PS4 \ || BX_PLATFORM_RPI \ - || BX_PLATFORM_NX + || BX_PLATFORM_NX \ + || BX_PLATFORM_VISIONOS # include -# if BX_PLATFORM_BSD -# include -# endif // BX_PLATFORM_BSD # if BX_PLATFORM_LINUX && (BX_CRT_GLIBC < 21200) # include # endif // BX_PLATFORM_ @@ -87,13 +83,8 @@ namespace bx void* ThreadInternal::threadFunc(void* _arg) { Thread* thread = (Thread*)_arg; - union - { - void* ptr; - int32_t i; - } cast; - cast.i = thread->entry(); - return cast.ptr; + intptr_t result = thread->entry(); + return bitCast(result); } #endif // BX_PLATFORM_ @@ -105,7 +96,7 @@ namespace bx , m_exitCode(kExitSuccess) , m_running(false) { - BX_STATIC_ASSERT(sizeof(ThreadInternal) <= sizeof(m_internal) ); + static_assert(sizeof(ThreadInternal) <= sizeof(m_internal) ); ThreadInternal* ti = (ThreadInternal*)m_internal; #if BX_CRT_NONE @@ -136,6 +127,16 @@ namespace bx m_userData = _userData; m_stackSize = _stackSize; + if (NULL != _name) + { + BX_WARN(strLen(_name) < int32_t(BX_COUNTOF(m_name) )-1, "Truncating thread name."); + strCopy(m_name, BX_COUNTOF(m_name), _name); + } + else + { + m_name[0] = '\0'; + } + ThreadInternal* ti = (ThreadInternal*)m_internal; #if BX_CRT_NONE ti->m_handle = crt0::threadCreate(&ti->threadFunc, _userData, m_stackSize, _name); @@ -194,11 +195,6 @@ namespace bx m_running = true; m_sem.wait(); - if (NULL != _name) - { - setThreadName(_name); - } - return true; } @@ -218,13 +214,9 @@ namespace bx CloseHandle(ti->m_handle); ti->m_handle = INVALID_HANDLE_VALUE; #elif BX_PLATFORM_POSIX - union - { - void* ptr; - int32_t i; - } cast; - pthread_join(ti->m_handle, &cast.ptr); - m_exitCode = cast.i; + void* ptr; + pthread_join(ti->m_handle, &ptr); + m_exitCode = narrowCast(bitCast(ptr) ); ti->m_handle = 0; #endif // BX_PLATFORM_ @@ -248,18 +240,13 @@ namespace bx #if BX_CRT_NONE BX_UNUSED(_name); #elif BX_PLATFORM_OSX \ - || BX_PLATFORM_IOS + || BX_PLATFORM_IOS \ + || BX_PLATFORM_VISIONOS pthread_setname_np(_name); -#elif (BX_CRT_GLIBC >= 21200) && ! BX_PLATFORM_HURD +#elif (BX_CRT_GLIBC >= 21200) pthread_setname_np(ti->m_handle, _name); #elif BX_PLATFORM_LINUX prctl(PR_SET_NAME,_name, 0, 0, 0); -#elif BX_PLATFORM_BSD -# if defined(__NetBSD__) - pthread_setname_np(ti->m_handle, "%s", (void*)_name); -# else - pthread_set_name_np(ti->m_handle, _name); -# endif // defined(__NetBSD__) #elif BX_PLATFORM_WINDOWS // Try to use the new thread naming API from Win10 Creators update onwards if we have it typedef HRESULT (WINAPI *SetThreadDescriptionProc)(HANDLE, PCWSTR); @@ -325,6 +312,7 @@ namespace bx #endif // BX_PLATFORM_WINDOWS m_sem.post(); + setThreadName(m_name); int32_t result = m_fn(this, m_userData); return result; } @@ -342,7 +330,7 @@ namespace bx #if BX_CRT_NONE TlsData::TlsData() { - BX_STATIC_ASSERT(sizeof(TlsDataInternal) <= sizeof(m_internal) ); + static_assert(sizeof(TlsDataInternal) <= sizeof(m_internal) ); TlsDataInternal* ti = (TlsDataInternal*)m_internal; BX_UNUSED(ti); @@ -369,7 +357,7 @@ namespace bx #elif BX_PLATFORM_WINDOWS TlsData::TlsData() { - BX_STATIC_ASSERT(sizeof(TlsDataInternal) <= sizeof(m_internal) ); + static_assert(sizeof(TlsDataInternal) <= sizeof(m_internal) ); TlsDataInternal* ti = (TlsDataInternal*)m_internal; ti->m_id = TlsAlloc(); @@ -399,7 +387,7 @@ namespace bx TlsData::TlsData() { - BX_STATIC_ASSERT(sizeof(TlsDataInternal) <= sizeof(m_internal) ); + static_assert(sizeof(TlsDataInternal) <= sizeof(m_internal) ); TlsDataInternal* ti = (TlsDataInternal*)m_internal; int result = pthread_key_create(&ti->m_id, NULL); diff --git a/bx/src/timer.cpp b/bx/src/timer.cpp index d0e925be..57a873aa 100644 --- a/bx/src/timer.cpp +++ b/bx/src/timer.cpp @@ -1,12 +1,12 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ #include #if BX_CRT_NONE -# include "crt0.h" +# include #elif BX_PLATFORM_ANDROID # include // clock, clock_gettime #elif BX_PLATFORM_EMSCRIPTEN @@ -40,7 +40,7 @@ namespace bx int64_t i64 = int64_t(1000.0f * emscripten_get_now() ); #elif !BX_PLATFORM_NONE struct timeval now; - gettimeofday(&now, 0); + gettimeofday(&now, NULL); int64_t i64 = now.tv_sec*INT64_C(1000000) + now.tv_usec; #else BX_ASSERT(false, "Not implemented!"); diff --git a/bx/src/url.cpp b/bx/src/url.cpp index 49492be6..05d63f77 100644 --- a/bx/src/url.cpp +++ b/bx/src/url.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bnet#license-bsd-2-clause */ diff --git a/bx/tests/allocator_test.cpp b/bx/tests/allocator_test.cpp new file mode 100644 index 00000000..d4ef829b --- /dev/null +++ b/bx/tests/allocator_test.cpp @@ -0,0 +1,78 @@ +/* + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bx/blob/master/LICENSE + */ + +#include "test.h" + +#include + +struct MockNonFreeingAllocator : public bx::AllocatorI +{ + MockNonFreeingAllocator() + : m_sbrk(1) + { + } + + ~MockNonFreeingAllocator() override + { + } + + void* realloc(void* _ptr, size_t _size, size_t _align, const char* _file, uint32_t _line) override + { + BX_ASSERT(_ptr == NULL, "MockNonFreeingAllocator can't realloc or free."); + BX_ASSERT(m_sbrk + _size < BX_COUNTOF(m_storage), ""); + BX_UNUSED(_ptr, _file, _line); + + const uintptr_t sbrk = bx::alignUp(m_sbrk, bx::max(int32_t(_align), 1) ); + m_sbrk = sbrk + _size; + + return &m_storage[sbrk]; + } + + uintptr_t m_sbrk; + BX_ALIGN_DECL(256, uint8_t) m_storage[0x10000]; +}; + +bool testAlignment(size_t _expected, void* _ptr) +{ + bool aligned = bx::isAligned(_ptr, int32_t(_expected) ); +// BX_TRACE("%p, %d", _ptr, _expected); + BX_WARN(aligned, "%p not aligned to %d bytes.", _ptr, _expected); + return aligned; +} + +TEST_CASE("Allocator", "") +{ + MockNonFreeingAllocator mnfa; + + REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(2, bx::alloc (&mnfa, 1, 2 ) ) ); + REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(4, bx::alloc (&mnfa, 1, 4 ) ) ); + REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(8, bx::alloc (&mnfa, 1, 8 ) ) ); + REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(16, bx::alloc (&mnfa, 1, 16 ) ) ); + REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(32, bx::alloc (&mnfa, 1, 32 ) ) ); + REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(64, bx::alloc (&mnfa, 1, 64 ) ) ); + REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(128, bx::alloc (&mnfa, 1, 128) ) ); + + REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(2, bx::alignedAlloc(&mnfa, 1, 2 ) ) ); + REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(4, bx::alignedAlloc(&mnfa, 1, 4 ) ) ); + REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(8, bx::alignedAlloc(&mnfa, 1, 8 ) ) ); + REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(16, bx::alignedAlloc(&mnfa, 1, 16 ) ) ); + REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(32, bx::alignedAlloc(&mnfa, 1, 32 ) ) ); + REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(64, bx::alignedAlloc(&mnfa, 1, 64 ) ) ); + REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) ); + REQUIRE(testAlignment(128, bx::alignedAlloc(&mnfa, 1, 128) ) ); +} diff --git a/bx/tests/atomic_test.cpp b/bx/tests/atomic_test.cpp index 8eb24547..da4733d0 100644 --- a/bx/tests/atomic_test.cpp +++ b/bx/tests/atomic_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/cast_test.cpp b/bx/tests/cast_test.cpp new file mode 100644 index 00000000..2a1eda97 --- /dev/null +++ b/bx/tests/cast_test.cpp @@ -0,0 +1,23 @@ +/* + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bx/blob/master/LICENSE + */ + +#include "test.h" +#include + +TEST_CASE("Bit cast", "[cast]") +{ + STATIC_REQUIRE(0x4172f58bc0000000ull == bx::bitCast(19880124.0) ); + STATIC_REQUIRE(0x3fe9000000000000ull == bx::bitCast(0.781250) ); + STATIC_REQUIRE(19880124.0 == bx::bitCast(0x4172f58bc0000000ull) ); + STATIC_REQUIRE(0.781250 == bx::bitCast(0x3fe9000000000000ull) ); +} + +TEST_CASE("Narrow cast", "[cast]") +{ + REQUIRE(127 == bx::narrowCast(int32_t(127) ) ); + REQUIRE_ASSERTS(bx::narrowCast(int32_t(128) ) ); + REQUIRE_ASSERTS(bx::narrowCast(uint32_t(128) ) ); + REQUIRE(128 == bx::narrowCast(int32_t(128) ) ); +} diff --git a/bx/tests/crt_test.cpp b/bx/tests/crt_test.cpp index fcd71048..458fffb1 100644 --- a/bx/tests/crt_test.cpp +++ b/bx/tests/crt_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/dbg.h b/bx/tests/dbg.h index 359e00d1..d3e75822 100644 --- a/bx/tests/dbg.h +++ b/bx/tests/dbg.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/easing_test.cpp b/bx/tests/easing_test.cpp index b57f6021..9b0cbeee 100644 --- a/bx/tests/easing_test.cpp +++ b/bx/tests/easing_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/filepath_test.cpp b/bx/tests/filepath_test.cpp index 7df7659a..218e44ae 100644 --- a/bx/tests/filepath_test.cpp +++ b/bx/tests/filepath_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -123,15 +123,21 @@ TEST_CASE("FilePath temp", "[filepath]") bx::FilePath tmp(bx::Dir::Temp); REQUIRE(0 != bx::strCmp(".", tmp.getPath().getPtr() ) ); - bx::Error err; - tmp.join("test/abvgd/555333/test"); - REQUIRE(bx::makeAll(tmp, &err) ); - REQUIRE(err.isOk() ); + tmp.set(bx::Dir::Temp); + tmp.join("bx.test"); + bx::removeAll(tmp, bx::ErrorIgnore{}); + + tmp.join("bx.test/abvgd/555333/test"); + REQUIRE(bx::makeAll(tmp, bx::ErrorAssert{}) ); + + if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN) ) + { + SKIP("Not supported by wasm."); + } tmp.set(bx::Dir::Temp); - tmp.join("test"); - REQUIRE(bx::removeAll(tmp, &err) ); - REQUIRE(err.isOk() ); + tmp.join("bx.test"); + REQUIRE(bx::removeAll(tmp, bx::ErrorAssert{}) ); } TEST_CASE("FilePath special", "[filepath]") diff --git a/bx/tests/handle_bench.cpp b/bx/tests/handle_bench.cpp index 10908bf6..2d041c84 100644 --- a/bx/tests/handle_bench.cpp +++ b/bx/tests/handle_bench.cpp @@ -1,11 +1,10 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ #include #include -#include #include #include @@ -15,6 +14,19 @@ #include #include +template +bool mapRemove(MapType& _map, const typename MapType::value_type::first_type& _first) +{ + typename MapType::const_iterator it = _map.find(_first); + if (it != _map.end() ) + { + _map.erase(it); + return true; + } + + return false; +} + int main() { const uint32_t numElements = 4<<10; @@ -37,7 +49,7 @@ int main() for (uint32_t jj = 0; jj < numElements; ++jj) { - bool ok = bx::mapRemove(map, uint64_t(jj) ); + bool ok = mapRemove(map, uint64_t(jj) ); assert(ok); BX_UNUSED(ok); } @@ -65,7 +77,7 @@ int main() for (uint32_t jj = 0; jj < numElements; ++jj) { - bool ok = bx::mapRemove(map, uint64_t(jj) ); + bool ok = mapRemove(map, uint64_t(jj) ); assert(ok); BX_UNUSED(ok); } diff --git a/bx/tests/handle_test.cpp b/bx/tests/handle_test.cpp index f6136f47..7f7f0334 100644 --- a/bx/tests/handle_test.cpp +++ b/bx/tests/handle_test.cpp @@ -1,11 +1,85 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ #include "test.h" #include #include +#include + +#include + +TEST_CASE("HandleAllocT", "") +{ + constexpr int32_t kMax = 64; + bx::HandleAllocT alloc; + + REQUIRE(sizeof(alloc) == sizeof(uint16_t) * kMax * 2 + sizeof(bx::HandleAlloc) ); + + for (uint16_t ii = 0; ii < kMax; ++ii) + { + REQUIRE(!alloc.isValid(ii) ); + } + + bx::RngMwc random; + std::set handleSet; + + int32_t count = 0; + + for (int32_t ii = 0; ii < 200000; ++ii) + { + const bool add = random.gen() % 2; + + if (add && count < kMax) + { + count++; + uint16_t handle = alloc.alloc(); + handleSet.insert(handle); + } + else if (count > 0) + { + count--; + + const int32_t idx = rand() % handleSet.size(); + auto it = handleSet.begin(); + + for (int32_t it_idx = 0; it_idx < idx; ++it_idx) + { + it++; + REQUIRE(alloc.isValid(*it) ); + } + + uint16_t handleToRemove = *it; + alloc.free(handleToRemove); + + REQUIRE(!alloc.isValid(handleToRemove) ); + + handleSet.erase(it); + } + + // Check if it's still correct + for (auto it = handleSet.begin(); it != handleSet.end(); ++it) + { + REQUIRE(alloc.isValid(*it) ); + } + } + + // Finally delete all + for (auto it = handleSet.begin(); it != handleSet.end(); ++it) + { + REQUIRE(alloc.isValid(*it) ); + + alloc.free(*it); + } + + handleSet.clear(); + + for (uint16_t ii = 0; ii < kMax; ++ii) + { + REQUIRE(!alloc.isValid(ii) ); + } +} TEST_CASE("HandleListT", "") { diff --git a/bx/tests/hash_test.cpp b/bx/tests/hash_test.cpp index 5689088c..eaaedb1c 100644 --- a/bx/tests/hash_test.cpp +++ b/bx/tests/hash_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -32,22 +32,23 @@ struct HashTest uint32_t crc32[bx::HashCrc32::Count]; uint32_t adler32; uint32_t murmur2a; + uint32_t murmur3; const char* input; }; const HashTest s_hashTest[] = { - // Crc32 | Adler32 | Murmur2A | Input - // Ieee Castagnoli Koopman | | | - { { 0, 0, 0 }, 1, 0, "" }, - { { 0xe8b7be43, 0xc1d04330, 0x0da2aa8a }, 0x00620062, 0x0803888b, "a" }, - { { 0x9e83486d, 0xe2a22936, 0x31ec935a }, 0x012600c4, 0x618515af, "ab" }, - { { 0xc340daab, 0x49e1b6e3, 0x945a1e78 }, 0x06060205, 0x94e3dc4d, "abvgd" }, - { { 0x07642fe2, 0x45a04162, 0x3d4bf72d }, 0x020a00d6, 0xe602fc07, "1389" }, - { { 0x26d75737, 0xb73d7b80, 0xd524eb40 }, 0x04530139, 0x58d37863, "555333" }, + // Crc32 | Adler32 | Murmur2A | Murmur3 | Input + // Ieee Castagnoli Koopman | | | | + { { 0, 0, 0 }, 1, 0, 0, "" }, + { { 0xe8b7be43, 0xc1d04330, 0x0da2aa8a }, 0x00620062, 0x0803888b, 0x3c2569b2, "a" }, + { { 0x9e83486d, 0xe2a22936, 0x31ec935a }, 0x012600c4, 0x618515af, 0x9bbfd75f, "ab" }, + { { 0xc340daab, 0x49e1b6e3, 0x945a1e78 }, 0x06060205, 0x94e3dc4d, 0x1e661875, "abvgd" }, + { { 0x07642fe2, 0x45a04162, 0x3d4bf72d }, 0x020a00d6, 0xe602fc07, 0x7af40d31, "1389" }, + { { 0x26d75737, 0xb73d7b80, 0xd524eb40 }, 0x04530139, 0x58d37863, 0x0c090160, "555333" }, }; -TEST_CASE("HashCrc32", "") +TEST_CASE("HashCrc32", "[hash]") { #if 0 makeCrcTable(0xedb88320); @@ -71,7 +72,7 @@ TEST_CASE("HashCrc32", "") } } -TEST_CASE("HashAdler32", "") +TEST_CASE("HashAdler32", "[hash]") { for (uint32_t ii = 0; ii < BX_COUNTOF(s_hashTest); ++ii) { @@ -84,6 +85,9 @@ TEST_CASE("HashAdler32", "") } } +namespace +{ + /*----------------------------------------------------------------------------- // MurmurHash2A, by Austin Appleby // @@ -96,8 +100,6 @@ TEST_CASE("HashAdler32", "") // more amenable to incremental implementations. */ -#define mmix(h,k) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; } - uint32_t MurmurHash2A(const void * key, int len, uint32_t seed = 0) { const uint32_t m = 0x5bd1e995; @@ -108,6 +110,8 @@ uint32_t MurmurHash2A(const void * key, int len, uint32_t seed = 0) uint32_t h = seed; +#define mmix(h,k) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; } + while(len >= 4) { uint32_t k = *(uint32_t*)data; @@ -122,14 +126,16 @@ uint32_t MurmurHash2A(const void * key, int len, uint32_t seed = 0) switch(len) { - case 3: t ^= data[2] << 16; BX_FALLTHROUGH; - case 2: t ^= data[1] << 8; BX_FALLTHROUGH; + case 3: t ^= data[2] << 16; [[fallthrough]]; + case 2: t ^= data[1] << 8; [[fallthrough]]; case 1: t ^= data[0]; }; mmix(h,t); mmix(h,l); +#undef mmix + h ^= h >> 13; h *= m; h ^= h >> 15; @@ -137,7 +143,9 @@ uint32_t MurmurHash2A(const void * key, int len, uint32_t seed = 0) return h; } -TEST_CASE("HashMurmur2A", "") +} // namespace + +TEST_CASE("HashMurmur2A", "[hash]") { uint32_t seed = 0; @@ -154,11 +162,117 @@ TEST_CASE("HashMurmur2A", "") } } -TEST_CASE("HashMurmur2A-Separate-Add", "") +TEST_CASE("HashMurmur2A-Separate-Add", "[hash]") { bx::HashMurmur2A hash; hash.begin(); hash.add("0123456789"); hash.add("abvgd012345"); - REQUIRE(MurmurHash2A("0123456789abvgd012345", 21) == hash.end() ); + hash.add("1389"); + hash.add("555333"); + REQUIRE(MurmurHash2A("0123456789abvgd0123451389555333", 31) == hash.end() ); +} + +namespace +{ + +BX_FORCE_INLINE uint32_t fmix32 ( uint32_t h ) +{ + h ^= h >> 16; + h *= 0x85ebca6b; + h ^= h >> 13; + h *= 0xc2b2ae35; + h ^= h >> 16; + + return h; +} + +inline uint32_t rotl32 ( uint32_t x, int8_t r ) +{ + return (x << r) | (x >> (32 - r)); +} + +uint32_t MurmurHash3_x86_32(const void * key, int len, uint32_t seed) +{ + const uint8_t * data = (const uint8_t*)key; + const int nblocks = len / 4; + + uint32_t h1 = seed; + + const uint32_t c1 = 0xcc9e2d51; + const uint32_t c2 = 0x1b873593; + + //---------- + // body + + const uint32_t * blocks = (const uint32_t *)(data + nblocks*4); + + for(int i = -nblocks; i; i++) + { + uint32_t k1 = blocks[i]; + + k1 *= c1; + k1 = rotl32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = rotl32(h1,13); + h1 = h1*5+0xe6546b64; + } + + //---------- + // tail + + const uint8_t * tail = (const uint8_t*)(data + nblocks*4); + + uint32_t k1 = 0; + + switch(len & 3) + { + case 3: k1 ^= tail[2] << 16; [[fallthrough]]; + case 2: k1 ^= tail[1] << 8; [[fallthrough]]; + case 1: k1 ^= tail[0]; + k1 *= c1; k1 = rotl32(k1,15); k1 *= c2; h1 ^= k1; + }; + + //---------- + // finalization + + h1 ^= len; + + h1 = fmix32(h1); + + return h1; +} + +} // namespace + +TEST_CASE("HashMurmur3", "[hash]") +{ + uint32_t seed = 0; + + for (uint32_t ii = 0; ii < BX_COUNTOF(s_hashTest); ++ii) + { + const HashTest& test = s_hashTest[ii]; + + bx::HashMurmur3 hash; + hash.begin(seed); + hash.add(test.input, bx::strLen(test.input) ); + const uint32_t result = hash.end(); + const uint32_t sanity = MurmurHash3_x86_32(test.input, bx::strLen(test.input), seed); + + REQUIRE(test.murmur3 == result); + REQUIRE(test.murmur3 == sanity); + } +} + +TEST_CASE("HashMurmur3-Separate-Add", "[hash]") +{ + bx::HashMurmur3 hash; + hash.begin(); + hash.add("0123456789"); + hash.add("abvgd012345"); + hash.add("1389"); + hash.add("555333"); + REQUIRE(MurmurHash3_x86_32("0123456789abvgd0123451389555333", 31, 0) == hash.end() ); } diff --git a/bx/tests/macros_test.cpp b/bx/tests/macros_test.cpp index 2860bcec..db4f7a96 100644 --- a/bx/tests/macros_test.cpp +++ b/bx/tests/macros_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -7,28 +7,34 @@ #include #include -BX_STATIC_ASSERT(false +static_assert(false || BX_CRT_BIONIC || BX_CRT_GLIBC || BX_CRT_LIBCXX || BX_CRT_MINGW || BX_CRT_MSVC || BX_CRT_NEWLIB + || BX_CRT_NONE ); -BX_STATIC_ASSERT(1 == BX_VA_ARGS_COUNT(1) ); -BX_STATIC_ASSERT(2 == BX_VA_ARGS_COUNT(1, 2) ); -BX_STATIC_ASSERT(3 == BX_VA_ARGS_COUNT(1, 2, 3) ); -BX_STATIC_ASSERT(4 == BX_VA_ARGS_COUNT(1, 2, 3, 4) ); -BX_STATIC_ASSERT(5 == BX_VA_ARGS_COUNT(1, 2, 3, 4, 5) ); -BX_STATIC_ASSERT(6 == BX_VA_ARGS_COUNT(1, 2, 3, 4, 5, 6) ); +static_assert(1 == BX_VA_ARGS_COUNT(1) ); +static_assert(2 == BX_VA_ARGS_COUNT(1, 2) ); +static_assert(3 == BX_VA_ARGS_COUNT(1, 2, 3) ); +static_assert(4 == BX_VA_ARGS_COUNT(1, 2, 3, 4) ); +static_assert(5 == BX_VA_ARGS_COUNT(1, 2, 3, 4, 5) ); +static_assert(6 == BX_VA_ARGS_COUNT(1, 2, 3, 4, 5, 6) ); BX_NO_INLINE void unusedFunction() { CHECK(false); } -TEST(macros) +void testAssert() +{ + BX_ASSERT(false % 1, "Assert works!"); +} + +TEST_CASE("Macros", "") { uint32_t unused0; BX_UNUSED(unused0); @@ -39,38 +45,40 @@ TEST(macros) uint32_t unused2; BX_UNUSED(unused0, unused1, unused2, unusedFunction() ); - CHECK_EQUAL(1, BX_VA_ARGS_COUNT(1) ); - CHECK_EQUAL(2, BX_VA_ARGS_COUNT(1, 2) ); - CHECK_EQUAL(3, BX_VA_ARGS_COUNT(1, 2, 3) ); - CHECK_EQUAL(4, BX_VA_ARGS_COUNT(1, 2, 3, 4) ); - CHECK_EQUAL(5, BX_VA_ARGS_COUNT(1, 2, 3, 4, 5) ); - CHECK_EQUAL(6, BX_VA_ARGS_COUNT(1, 2, 3, 4, 5, 6) ); + REQUIRE(1 == BX_VA_ARGS_COUNT(1) ); + REQUIRE(2 == BX_VA_ARGS_COUNT(1, 2) ); + REQUIRE(3 == BX_VA_ARGS_COUNT(1, 2, 3) ); + REQUIRE(4 == BX_VA_ARGS_COUNT(1, 2, 3, 4) ); + REQUIRE(5 == BX_VA_ARGS_COUNT(1, 2, 3, 4, 5) ); + REQUIRE(6 == BX_VA_ARGS_COUNT(1, 2, 3, 4, 5, 6) ); - CHECK_EQUAL(0, bx::strCmp(BX_STRINGIZE(TEST 1234 %^&*), "TEST 1234 %^&*") ); + REQUIRE(0 == bx::strCmp(BX_STRINGIZE(TEST 1234 % 1 ^&*), "TEST 1234 % 1 ^&*") ); { struct PodStruct { int32_t x, y, z; }; - CHECK_EQUAL(0, BX_OFFSETOF(PodStruct, x) ); - CHECK_EQUAL(4, BX_OFFSETOF(PodStruct, y) ); - CHECK_EQUAL(8, BX_OFFSETOF(PodStruct, z) ); + REQUIRE(0 == BX_OFFSETOF(PodStruct, x) ); + REQUIRE(4 == BX_OFFSETOF(PodStruct, y) ); + REQUIRE(8 == BX_OFFSETOF(PodStruct, z) ); } { union PodUnion { int32_t x, y, z; }; - CHECK_EQUAL(BX_OFFSETOF(PodUnion, x), BX_OFFSETOF(PodUnion, y) ); - CHECK_EQUAL(BX_OFFSETOF(PodUnion, y), BX_OFFSETOF(PodUnion, z) ); + REQUIRE(BX_OFFSETOF(PodUnion, x) == BX_OFFSETOF(PodUnion, y) ); + REQUIRE(BX_OFFSETOF(PodUnion, y) == BX_OFFSETOF(PodUnion, z) ); } { struct NonPodStruct { NonPodStruct() { } int32_t x, y, z; }; - CHECK_EQUAL(0, BX_OFFSETOF(NonPodStruct, x) ); - CHECK_EQUAL(4, BX_OFFSETOF(NonPodStruct, y) ); - CHECK_EQUAL(8, BX_OFFSETOF(NonPodStruct, z) ); + REQUIRE(0 == BX_OFFSETOF(NonPodStruct, x) ); + REQUIRE(4 == BX_OFFSETOF(NonPodStruct, y) ); + REQUIRE(8 == BX_OFFSETOF(NonPodStruct, z) ); } { union NonPodUnion { NonPodUnion() { } int32_t x, y, z; }; - CHECK_EQUAL(BX_OFFSETOF(NonPodUnion, x), BX_OFFSETOF(NonPodUnion, y) ); - CHECK_EQUAL(BX_OFFSETOF(NonPodUnion, y), BX_OFFSETOF(NonPodUnion, z) ); + REQUIRE(BX_OFFSETOF(NonPodUnion, x) == BX_OFFSETOF(NonPodUnion, y) ); + REQUIRE(BX_OFFSETOF(NonPodUnion, y) == BX_OFFSETOF(NonPodUnion, z) ); } + + REQUIRE_ASSERTS(testAssert() ); } diff --git a/bx/tests/main_test.cpp b/bx/tests/main_test.cpp index 7717d37b..7b064c0a 100644 --- a/bx/tests/main_test.cpp +++ b/bx/tests/main_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/math_bench.cpp b/bx/tests/math_bench.cpp index a50e5fea..6b947288 100644 --- a/bx/tests/math_bench.cpp +++ b/bx/tests/math_bench.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -38,72 +38,127 @@ float rsqrt(float _a) return 1.0f/::sqrtf(_a); } +float sinCosNonApproxBench() +{ + bx::WriterI* writer = bx::getStdOut(); + int64_t elapsed = -bx::getHPCounter(); + + float result = 0.0f; + const float max = 1389.0f; + + for (float xx = 0.0f; xx < max; xx += 0.1f) + { + float ss, cc; + ss = bx::sin(xx); + cc = bx::cos(xx); + + result += ss + cc; + } + + bx::Error err; + + elapsed += bx::getHPCounter(); + bx::write(writer, &err, "%-20s: %15f\n", "sin + cos", double(elapsed) ); + + return result; +} + +float sinCosApproxBench() +{ + bx::WriterI* writer = bx::getStdOut(); + int64_t elapsed = -bx::getHPCounter(); + + float result = 0.0f; + const float max = 1389.0f; + + for (float xx = 0.0f; xx < max; xx += 0.1f) + { + float ss, cc; + bx::sinCosApprox(ss, cc, xx); + + result += ss + cc; + } + + bx::Error err; + + elapsed += bx::getHPCounter(); + bx::write(writer, &err, "%-20s: %15f\n", "sinCosApprox", double(elapsed) ); + + return result; +} + +float g_result; // trick compiler to not discard results + void math_bench() { bx::WriterI* writer = bx::getStdOut(); bx::Error err; bx::write(writer, &err, "Math bench\n\n"); - mathTest< ::sqrtf >(" ::sqrtf"); - mathTest("bx::sqrtRef"); - mathTest("bx::sqrtSimd"); - mathTest("bx::sqrt"); + g_result += mathTest< ::sqrtf >(" ::sqrtf"); + g_result += mathTest("bx::sqrtRef"); + g_result += mathTest("bx::sqrtSimd"); + g_result += mathTest("bx::sqrt"); + + bx::write(writer, &err, "\n"); + g_result += mathTest< ::rsqrt >(" ::rsqrtf"); + g_result += mathTest("bx::rsqrtRef"); + g_result += mathTest("bx::rsqrtSimd"); + g_result += mathTest("bx::rsqrt"); bx::write(writer, &err, "\n"); - mathTest< ::rsqrt >(" ::rsqrtf"); - mathTest("bx::rsqrtRef"); - mathTest("bx::rsqrtSimd"); - mathTest("bx::rsqrt"); + g_result += sinCosNonApproxBench(); + g_result += sinCosApproxBench(); bx::write(writer, &err, "\n"); - mathTest< ::sinf >(" ::sinf"); - mathTest("bx::sin"); + g_result += mathTest< ::sinf >(" ::sinf"); + g_result += mathTest("bx::sin"); bx::write(writer, &err, "\n"); - mathTest< ::sinhf>(" ::sinhf"); - mathTest("bx::sinh"); + g_result += mathTest< ::sinhf>(" ::sinhf"); + g_result += mathTest("bx::sinh"); bx::write(writer, &err, "\n"); - mathTest< ::asinf>(" ::asinf"); - mathTest("bx::asin"); + g_result += mathTest< ::asinf>(" ::asinf"); + g_result += mathTest("bx::asin"); bx::write(writer, &err, "\n"); - mathTest< ::cosf >(" ::cosf"); - mathTest("bx::cos"); + g_result += mathTest< ::cosf >(" ::cosf"); + g_result += mathTest("bx::cos"); bx::write(writer, &err, "\n"); - mathTest< ::coshf>(" ::coshf"); - mathTest("bx::cosh"); + g_result += mathTest< ::coshf>(" ::coshf"); + g_result += mathTest("bx::cosh"); bx::write(writer, &err, "\n"); - mathTest< ::acosf>(" ::acosf"); - mathTest("bx::acos"); + g_result += mathTest< ::acosf>(" ::acosf"); + g_result += mathTest("bx::acos"); bx::write(writer, &err, "\n"); - mathTest< ::tanf >(" ::tanf"); - mathTest("bx::tan"); + g_result += mathTest< ::tanf >(" ::tanf"); + g_result += mathTest("bx::tan"); bx::write(writer, &err, "\n"); - mathTest< ::tanhf>(" ::tanhf"); - mathTest("bx::tanh"); + g_result += mathTest< ::tanhf>(" ::tanhf"); + g_result += mathTest("bx::tanh"); bx::write(writer, &err, "\n"); - mathTest< ::atanf>(" ::atanf"); - mathTest("bx::atan"); + g_result += mathTest< ::atanf>(" ::atanf"); + g_result += mathTest("bx::atan"); bx::write(writer, &err, "\n"); - mathTest< ::expf>(" ::expf"); - mathTest("bx::exp"); + g_result += mathTest< ::expf>(" ::expf"); + g_result += mathTest("bx::exp"); bx::write(writer, &err, "\n"); - mathTest< ::exp2f>(" ::exp2f"); - mathTest("bx::exp2"); + g_result += mathTest< ::exp2f>(" ::exp2f"); + g_result += mathTest("bx::exp2"); bx::write(writer, &err, "\n"); - mathTest< ::logf >(" ::logf"); - mathTest("bx::log"); + g_result += mathTest< ::logf >(" ::logf"); + g_result += mathTest("bx::log"); bx::write(writer, &err, "\n"); - mathTest< ::log2f>(" ::log2f"); - mathTest("bx::log2"); + g_result += mathTest< ::log2f>(" ::log2f"); + g_result += mathTest("bx::log2"); } diff --git a/bx/tests/math_test.cpp b/bx/tests/math_test.cpp index f2e5c19b..909db038 100644 --- a/bx/tests/math_test.cpp +++ b/bx/tests/math_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -11,106 +11,360 @@ #include // intXX_t #include // UCHAR_* -#if !BX_PLATFORM_BSD TEST_CASE("isFinite, isInfinite, isNan", "[math]") { +#if defined(__FAST_MATH__) && __FAST_MATH__ + SKIP("This unit test fails with fast math is enabled."); +#endif // !defined(__FAST_MATH__) || !__FAST_MATH__ + for (uint64_t ii = 0; ii < UINT32_MAX; ii += rand()%(1<<13)+1) { union { uint32_t ui; float f; } u = { uint32_t(ii) }; -#if BX_PLATFORM_OSX - BX_UNUSED(u); +#if BX_PLATFORM_OSX || BX_PLATFORM_IOS REQUIRE(::__isnanf(u.f) == bx::isNan(u.f) ); REQUIRE(::__isfinitef(u.f) == bx::isFinite(u.f) ); REQUIRE(::__isinff(u.f) == bx::isInfinite(u.f) ); #elif BX_COMPILER_MSVC - REQUIRE(!!::_isnanf(u.f) == bx::isNan(u.f)); - REQUIRE(!!::_finitef(u.f) == bx::isFinite(u.f)); - REQUIRE(!!::isinf(u.f) == bx::isInfinite(u.f)); -#else + REQUIRE(!!::isnan(u.f) == bx::isNan(u.f) ); + REQUIRE(!!::isfinite(u.f) == bx::isFinite(u.f) ); + REQUIRE(!!::isinf(u.f) == bx::isInfinite(u.f) ); +#elif !BX_CRT_MINGW REQUIRE(::isnanf(u.f) == bx::isNan(u.f) ); REQUIRE(::finitef(u.f) == bx::isFinite(u.f) ); REQUIRE(::isinff(u.f) == bx::isInfinite(u.f) ); -#endif // BX_PLATFORM_OSX +#endif // BX_* } } -#endif // !BX_PLATFORM_BSD -bool log2_test(float _a) +TEST_CASE("log", "[math][libm]") +{ + STATIC_REQUIRE(bx::isEqual( 0.0f, bx::log( 1.0f), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual( 1.0f, bx::log(bx::kE), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(bx::kLogNat2, bx::log( 2.0f), 0.0000001f) ); +} + +static void testLog2(float _a) { - return bx::log2(_a) == bx::log(_a) * (1.0f / bx::log(2.0f) ); + REQUIRE(bx::log2(_a) == bx::log(_a) * (1.0f / bx::log(2.0f) ) ); } TEST_CASE("log2", "[math][libm]") { - log2_test(0.0f); - log2_test(256.0f); + testLog2(0.0f); + testLog2(256.0f); + + STATIC_REQUIRE(bx::isEqual(0.0f, bx::log2( 1.0f), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(1.0f, bx::log2( 2.0f), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(2.0f, bx::log2( 4.0f), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(3.0f, bx::log2( 8.0f), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(4.0f, bx::log2( 16.0f), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(5.0f, bx::log2( 32.0f), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(6.0f, bx::log2( 64.0f), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(7.0f, bx::log2(128.0f), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(8.0f, bx::log2(256.0f), 0.0000001f) ); +} + +TEST_CASE("ceilLog2", "[math]") +{ + STATIC_REQUIRE(0 == bx::ceilLog2(-1) ); + STATIC_REQUIRE(0 == bx::ceilLog2(0) ); + STATIC_REQUIRE(0 == bx::ceilLog2(1) ); + STATIC_REQUIRE(1 == bx::ceilLog2(2) ); + STATIC_REQUIRE(2 == bx::ceilLog2(4) ); + STATIC_REQUIRE(3 == bx::ceilLog2(8) ); + STATIC_REQUIRE(4 == bx::ceilLog2(16) ); + STATIC_REQUIRE(5 == bx::ceilLog2(32) ); + STATIC_REQUIRE(6 == bx::ceilLog2(64) ); + STATIC_REQUIRE(7 == bx::ceilLog2(128) ); + STATIC_REQUIRE(8 == bx::ceilLog2(256) ); + + { + uint32_t ii = 0; + for (; ii < 8; ++ii) + { + REQUIRE(ii == bx::ceilLog2(uint8_t(1<(1) ); + STATIC_REQUIRE( 7 == bx::countTrailingZeros(1<<7) ); + STATIC_REQUIRE( 8 == bx::countTrailingZeros(0) ); + STATIC_REQUIRE( 1 == bx::countTrailingZeros(0x3e) ); + STATIC_REQUIRE( 0 == bx::countTrailingZeros(1) ); + STATIC_REQUIRE(15 == bx::countTrailingZeros(1<<15) ); + STATIC_REQUIRE(16 == bx::countTrailingZeros(0) ); + STATIC_REQUIRE( 0 == bx::countTrailingZeros(1) ); + STATIC_REQUIRE(32 == bx::countTrailingZeros(0) ); + STATIC_REQUIRE(31 == bx::countTrailingZeros(1u<<31) ); + STATIC_REQUIRE( 0 == bx::countTrailingZeros(1) ); + STATIC_REQUIRE(64 == bx::countTrailingZeros(0) ); +} + +TEST_CASE("countLeadingZeros", "[math]") +{ + STATIC_REQUIRE( 7 == bx::countLeadingZeros(1) ); + STATIC_REQUIRE( 8 == bx::countLeadingZeros(0) ); + STATIC_REQUIRE( 2 == bx::countLeadingZeros(0x3e) ); + STATIC_REQUIRE(15 == bx::countLeadingZeros(1) ); + STATIC_REQUIRE(16 == bx::countLeadingZeros(0) ); + STATIC_REQUIRE(31 == bx::countLeadingZeros(1) ); + STATIC_REQUIRE(32 == bx::countLeadingZeros(0) ); + STATIC_REQUIRE(63 == bx::countLeadingZeros(1) ); + STATIC_REQUIRE(64 == bx::countLeadingZeros(0) ); +} - REQUIRE(0.0f == bx::log2(1.0f) ); - REQUIRE(0 == bx::log2(1) ); +TEST_CASE("countBits", "[math]") +{ + STATIC_REQUIRE( 0 == bx::countBits(0) ); + STATIC_REQUIRE( 1 == bx::countBits(1) ); + + STATIC_REQUIRE( 4 == bx::countBits(0x55) ); + STATIC_REQUIRE( 8 == bx::countBits(0x5555) ); + STATIC_REQUIRE(16 == bx::countBits(0x55555555) ); + STATIC_REQUIRE(32 == bx::countBits(0x5555555555555555ull) ); + + STATIC_REQUIRE( 8 == bx::countBits(UINT8_MAX) ); + STATIC_REQUIRE(16 == bx::countBits(UINT16_MAX) ); + STATIC_REQUIRE(32 == bx::countBits(UINT32_MAX) ); + STATIC_REQUIRE(64 == bx::countBits(UINT64_MAX) ); +} - REQUIRE(1.0f == bx::log2(2.0f) ); - REQUIRE(1 == bx::log2(2) ); +template +static void testFindFirstSet() +{ + for (uint8_t ii = 0, num = sizeof(Ty)*8; ii < num; ++ii) + { + { + const Ty val = Ty(1) << ii; + const uint8_t result = bx::findFirstSet(val); + REQUIRE(result == ii + 1); + } - REQUIRE(2.0f == bx::log2(4.0f) ); - REQUIRE(2 == bx::log2(4) ); + { + const Ty val = ( (Ty(1) << ii) ) | (Ty(1) << (num - 1) ); + const uint8_t result = bx::findFirstSet(val); + REQUIRE(result == ii + 1); + } + } +} - REQUIRE(3.0f == bx::log2(8.0f) ); - REQUIRE(3 == bx::log2(8) ); +TEST_CASE("findFirstSet", "[math]") +{ + STATIC_REQUIRE( 1 == bx::findFirstSet(1) ); + STATIC_REQUIRE( 8 == bx::findFirstSet(1<<7) ); + STATIC_REQUIRE( 0 == bx::findFirstSet(0) ); + STATIC_REQUIRE( 2 == bx::findFirstSet(0x3e) ); + STATIC_REQUIRE( 1 == bx::findFirstSet(1) ); + STATIC_REQUIRE(16 == bx::findFirstSet(1<<15) ); + STATIC_REQUIRE( 0 == bx::findFirstSet(0) ); + STATIC_REQUIRE( 1 == bx::findFirstSet(1) ); + STATIC_REQUIRE( 0 == bx::findFirstSet(0) ); + STATIC_REQUIRE(32 == bx::findFirstSet(1u<<31) ); + STATIC_REQUIRE( 1 == bx::findFirstSet(1) ); + STATIC_REQUIRE( 0 == bx::findFirstSet(0) ); + STATIC_REQUIRE(64 == bx::findFirstSet(0x8000000000000000ull) ); + STATIC_REQUIRE( 1 == bx::findFirstSet(0x8000000000000001ull) ); - REQUIRE(4.0f == bx::log2(16.0f) ); - REQUIRE(4 == bx::log2(16) ); + testFindFirstSet(); + testFindFirstSet(); + testFindFirstSet(); + testFindFirstSet(); +} - REQUIRE(5.0f == bx::log2(32.0f) ); - REQUIRE(5 == bx::log2(32) ); +template +static void testFindLastSet() +{ + for (uint8_t ii = 0, num = sizeof(Ty)*8; ii < num; ++ii) + { + { + const Ty val = Ty(1) << ii; + const uint8_t result = bx::findLastSet(val); + REQUIRE(result == ii + 1); + } - REQUIRE(6.0f == bx::log2(64.0f) ); - REQUIRE(6 == bx::log2(64) ); + { + const Ty val = (Ty(1) << ii) - 1; + const uint8_t result = bx::findLastSet(val); + REQUIRE(result == ii); + } + } +} - REQUIRE(7.0f == bx::log2(128.0f) ); - REQUIRE(7 == bx::log2(128) ); +TEST_CASE("findLastSet", "[math]") +{ + STATIC_REQUIRE( 1 == bx::findLastSet(1) ); + STATIC_REQUIRE( 8 == bx::findLastSet(1<<7) ); + STATIC_REQUIRE( 0 == bx::findLastSet(0) ); + STATIC_REQUIRE( 6 == bx::findLastSet(0x3e) ); + STATIC_REQUIRE( 1 == bx::findLastSet(1) ); + STATIC_REQUIRE(16 == bx::findLastSet(1<<15) ); + STATIC_REQUIRE( 0 == bx::findLastSet(0) ); + STATIC_REQUIRE( 1 == bx::findLastSet(1) ); + STATIC_REQUIRE( 0 == bx::findLastSet(0) ); + STATIC_REQUIRE(32 == bx::findLastSet(1u<<31) ); + STATIC_REQUIRE( 1 == bx::findLastSet(1) ); + STATIC_REQUIRE( 0 == bx::findLastSet(0) ); + STATIC_REQUIRE( 1 == bx::findLastSet(1ull) ); + STATIC_REQUIRE(64 == bx::findLastSet(0x8000000000000000ull) ); + STATIC_REQUIRE(64 == bx::findLastSet(0x8000000000000001ull) ); - REQUIRE(8.0f == bx::log2(256.0f) ); - REQUIRE(8 == bx::log2(256) ); + testFindLastSet(); + testFindLastSet(); + testFindLastSet(); + testFindLastSet(); } BX_PRAGMA_DIAGNOSTIC_PUSH(); BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4723) // potential divide by 0 +TEST_CASE("rcp", "[math][libm]") +{ + STATIC_REQUIRE(1.0f == bx::rcp(1.0f) ); + STATIC_REQUIRE(2.0f == bx::rcp(0.5f) ); +} + +TEST_CASE("rcpSafe", "[math][libm]") +{ + STATIC_REQUIRE(1.0f == bx::rcpSafe(1.0f) ); + STATIC_REQUIRE(2.0f == bx::rcpSafe(0.5f) ); + STATIC_REQUIRE(bx::isFinite(bx::rcpSafe( 0.0f) ) ); + STATIC_REQUIRE(bx::isFinite(bx::rcpSafe(-0.0f) ) ); +} + TEST_CASE("rsqrt", "[math][libm]") { bx::WriterI* writer = bx::getNullOut(); bx::Error err; // rsqrtRef - REQUIRE(bx::isInfinite(bx::rsqrtRef(0.0f))); + STATIC_REQUIRE(bx::isInfinite(bx::rsqrtRef(0.0f) ) ); for (float xx = bx::kNearZero; xx < 100.0f; xx += 0.1f) { - bx::write(writer, &err, "rsqrtRef(%f) == %f (expected: %f)\n", xx, bx::rsqrtRef(xx), 1.0f / ::sqrtf(xx)); - REQUIRE(err.isOk()); - REQUIRE(bx::isEqual(bx::rsqrtRef(xx), 1.0f / ::sqrtf(xx), 0.00001f)); + bx::write(writer, &err, "rsqrtRef(%f) == %f (expected: %f)\n", xx, bx::rsqrtRef(xx), 1.0f / ::sqrtf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(bx::rsqrtRef(xx), 1.0f / ::sqrtf(xx), 0.00001f) ); } // rsqrtSimd - REQUIRE(bx::isInfinite(bx::rsqrtSimd(0.0f))); +#if !defined(__FAST_MATH__) || !__FAST_MATH__ + REQUIRE(bx::isInfinite(bx::rsqrtSimd(0.0f) ) ); +#endif // !defined(__FAST_MATH__) || !__FAST_MATH__ for (float xx = bx::kNearZero; xx < 100.0f; xx += 0.1f) { - bx::write(writer, &err, "rsqrtSimd(%f) == %f (expected: %f)\n", xx, bx::rsqrtSimd(xx), 1.0f / ::sqrtf(xx)); - REQUIRE(err.isOk()); - REQUIRE(bx::isEqual(bx::rsqrtSimd(xx), 1.0f / ::sqrtf(xx), 0.00001f)); + bx::write(writer, &err, "rsqrtSimd(%f) == %f (expected: %f)\n", xx, bx::rsqrtSimd(xx), 1.0f / ::sqrtf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(bx::rsqrtSimd(xx), 1.0f / ::sqrtf(xx), 0.00001f) ); } // rsqrt - REQUIRE(bx::isInfinite(1.0f / ::sqrtf(0.0f))); - REQUIRE(bx::isInfinite(bx::rsqrt(0.0f))); +#if !defined(__FAST_MATH__) || !__FAST_MATH__ + REQUIRE(bx::isInfinite(1.0f / ::sqrtf(0.0f) ) ); + REQUIRE(bx::isInfinite(bx::rsqrt(0.0f) ) ); +#endif // !defined(__FAST_MATH__) || !__FAST_MATH__ for (float xx = bx::kNearZero; xx < 100.0f; xx += 0.1f) { - bx::write(writer, &err, "rsqrt(%f) == %f (expected: %f)\n", xx, bx::rsqrt(xx), 1.0f / ::sqrtf(xx)); - REQUIRE(err.isOk()); - REQUIRE(bx::isEqual(bx::rsqrt(xx), 1.0f / ::sqrtf(xx), 0.00001f)); + bx::write(writer, &err, "rsqrt(%f) == %f (expected: %f)\n", xx, bx::rsqrt(xx), 1.0f / ::sqrtf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(bx::rsqrt(xx), 1.0f / ::sqrtf(xx), 0.00001f) ); } } @@ -120,54 +374,55 @@ TEST_CASE("sqrt", "[math][libm]") bx::Error err; // sqrtRef - REQUIRE(bx::isNan(bx::sqrtRef(-1.0f))); - REQUIRE(bx::isEqual(bx::sqrtRef(0.0f), ::sqrtf(0.0f), 0.0f)); - REQUIRE(bx::isEqual(bx::sqrtRef(1.0f), ::sqrtf(1.0f), 0.0f)); + STATIC_REQUIRE(bx::isNan(bx::sqrtRef(-1.0f) ) ); + + REQUIRE(bx::isEqual(bx::sqrtRef(0.0f), ::sqrtf(0.0f), 0.0f) ); + REQUIRE(bx::isEqual(bx::sqrtRef(1.0f), ::sqrtf(1.0f), 0.0f) ); for (float xx = 0.0f; xx < 1000000.0f; xx += 1000.f) { - bx::write(writer, &err, "sqrtRef(%f) == %f (expected: %f)\n", xx, bx::sqrtRef(xx), ::sqrtf(xx)); - REQUIRE(err.isOk()); - REQUIRE(bx::isEqual(bx::sqrtRef(xx), ::sqrtf(xx), 0.00001f)); + bx::write(writer, &err, "sqrtRef(%f) == %f (expected: %f)\n", xx, bx::sqrtRef(xx), ::sqrtf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(bx::sqrtRef(xx), ::sqrtf(xx), 0.00001f) ); } // sqrtSimd - REQUIRE(bx::isNan(bx::sqrtSimd(-1.0f))); - REQUIRE(bx::isEqual(bx::sqrtSimd(0.0f), ::sqrtf(0.0f), 0.0f)); - REQUIRE(bx::isEqual(bx::sqrtSimd(1.0f), ::sqrtf(1.0f), 0.0f)); + REQUIRE(bx::isNan(bx::sqrtSimd(-1.0f) ) ); + REQUIRE(bx::isEqual(bx::sqrtSimd(0.0f), ::sqrtf(0.0f), 0.00001f) ); + REQUIRE(bx::isEqual(bx::sqrtSimd(1.0f), ::sqrtf(1.0f), 0.00001f) ); for (float xx = 0.0f; xx < 1000000.0f; xx += 1000.f) { - bx::write(writer, &err, "sqrtSimd(%f) == %f (expected: %f)\n", xx, bx::sqrtSimd(xx), ::sqrtf(xx)); - REQUIRE(err.isOk()); - REQUIRE(bx::isEqual(bx::sqrtSimd(xx), ::sqrtf(xx), 0.00001f)); + bx::write(writer, &err, "sqrtSimd(%f) == %f (expected: %f)\n", xx, bx::sqrtSimd(xx), ::sqrtf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(bx::sqrtSimd(xx), ::sqrtf(xx), 0.00001f) ); } for (float xx = 0.0f; xx < 100.0f; xx += 0.1f) { - bx::write(writer, &err, "sqrt(%f) == %f (expected: %f)\n", xx, bx::sqrt(xx), ::sqrtf(xx)); - REQUIRE(err.isOk()); - REQUIRE(bx::isEqual(bx::sqrt(xx), ::sqrtf(xx), 0.00001f)); + bx::write(writer, &err, "sqrt(%f) == %f (expected: %f)\n", xx, bx::sqrt(xx), ::sqrtf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(bx::sqrt(xx), ::sqrtf(xx), 0.00001f) ); } // sqrt - REQUIRE(bx::isNan(::sqrtf(-1.0f))); - REQUIRE(bx::isNan(bx::sqrt(-1.0f))); - REQUIRE(bx::isEqual(bx::sqrt(0.0f), ::sqrtf(0.0f), 0.0f)); - REQUIRE(bx::isEqual(bx::sqrt(1.0f), ::sqrtf(1.0f), 0.0f)); + REQUIRE(bx::isNan(::sqrtf(-1.0f) ) ); + REQUIRE(bx::isNan(bx::sqrt(-1.0f) ) ); + REQUIRE(bx::isEqual(bx::sqrt(0.0f), ::sqrtf(0.0f), 0.00001f) ); + REQUIRE(bx::isEqual(bx::sqrt(1.0f), ::sqrtf(1.0f), 0.00001f) ); for (float xx = 0.0f; xx < 1000000.0f; xx += 1000.f) { - bx::write(writer, &err, "sqrt(%f) == %f (expected: %f)\n", xx, bx::sqrt(xx), ::sqrtf(xx)); - REQUIRE(err.isOk()); - REQUIRE(bx::isEqual(bx::sqrt(xx), ::sqrtf(xx), 0.00001f)); + bx::write(writer, &err, "sqrt(%f) == %f (expected: %f)\n", xx, bx::sqrt(xx), ::sqrtf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(bx::sqrt(xx), ::sqrtf(xx), 0.00001f) ); } for (float xx = 0.0f; xx < 100.0f; xx += 0.1f) { - bx::write(writer, &err, "sqrt(%f) == %f (expected: %f)\n", xx, bx::sqrt(xx), ::sqrtf(xx)); - REQUIRE(err.isOk()); - REQUIRE(bx::isEqual(bx::sqrt(xx), ::sqrtf(xx), 0.00001f)); + bx::write(writer, &err, "sqrt(%f) == %f (expected: %f)\n", xx, bx::sqrt(xx), ::sqrtf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(bx::sqrt(xx), ::sqrtf(xx), 0.00001f) ); } } @@ -175,43 +430,81 @@ BX_PRAGMA_DIAGNOSTIC_POP(); TEST_CASE("abs", "[math][libm]") { - REQUIRE(1389.0f == bx::abs(-1389.0f) ); - REQUIRE(1389.0f == bx::abs( 1389.0f) ); - REQUIRE( 0.0f == bx::abs(-0.0f) ); - REQUIRE( 0.0f == bx::abs( 0.0f) ); + STATIC_REQUIRE(1389.0f == bx::abs(-1389.0f) ); + STATIC_REQUIRE(1389.0f == bx::abs( 1389.0f) ); + STATIC_REQUIRE( 0.0f == bx::abs(-0.0f) ); + STATIC_REQUIRE( 0.0f == bx::abs( 0.0f) ); } TEST_CASE("mod", "[math][libm]") { - REQUIRE(389.0f == bx::mod(1389.0f, 1000.0f) ); + STATIC_REQUIRE(389.0f == bx::mod(1389.0f, 1000.0f) ); + STATIC_REQUIRE( 89.0f == bx::mod(1389.0f, 100.0f) ); + STATIC_REQUIRE( 9.0f == bx::mod(1389.0f, 10.0f) ); + STATIC_REQUIRE( 4.0f == bx::mod(1389.0f, 5.0f) ); + STATIC_REQUIRE( 1.0f == bx::mod(1389.0f, 2.0f) ); +} + +typedef float (*MathFloatFn)(float); + +template +static void testMathFunc1Float(float _value) +{ + REQUIRE(CrtT(_value) == BxT(_value) ); } TEST_CASE("floor", "[math][libm]") { - REQUIRE( 13.0f == bx::floor( 13.89f) ); - REQUIRE(-14.0f == bx::floor(-13.89f) ); + STATIC_REQUIRE( 13.0f == bx::floor( 13.89f) ); + STATIC_REQUIRE(-14.0f == bx::floor(-13.89f) ); + + testMathFunc1Float( 13.89f); + testMathFunc1Float(-13.89f); } TEST_CASE("ceil", "[math][libm]") { - REQUIRE( 14.0f == bx::ceil( 13.89f) ); - REQUIRE(-13.0f == bx::ceil( -13.89f) ); + STATIC_REQUIRE( 14.0f == bx::ceil( 13.89f) ); + STATIC_REQUIRE(-13.0f == bx::ceil( -13.89f) ); + + testMathFunc1Float( 13.89f); + testMathFunc1Float(-13.89f); +} + +TEST_CASE("round", "[math][libm]") +{ + STATIC_REQUIRE( 14.0f == bx::round( 13.89f) ); + STATIC_REQUIRE(-14.0f == bx::round( -13.89f) ); + + testMathFunc1Float( 13.89f); + testMathFunc1Float(-13.89f); } TEST_CASE("trunc", "[math][libm]") { - REQUIRE( 13.0f == bx::trunc( 13.89f) ); - REQUIRE(-13.0f == bx::trunc(-13.89f) ); + STATIC_REQUIRE( 13.0f == bx::trunc( 13.89f) ); + STATIC_REQUIRE(-13.0f == bx::trunc(-13.89f) ); + + testMathFunc1Float( 13.89f); + testMathFunc1Float(-13.89f); } TEST_CASE("fract", "[math][libm]") { - REQUIRE(bx::isEqual( 0.89f, bx::fract( 13.89f), 0.000001f) ); - REQUIRE(bx::isEqual(-0.89f, bx::fract(-13.89f), 0.000001f) ); + STATIC_REQUIRE(bx::isEqual( 0.89f, bx::fract( 13.89f), 0.000001f) ); + STATIC_REQUIRE(bx::isEqual(-0.89f, bx::fract(-13.89f), 0.000001f) ); } TEST_CASE("ldexp", "[math][libm]") { + STATIC_REQUIRE( 1389.0f == bx::ldexp(86.8125, 4) ); + STATIC_REQUIRE(0.437500f == bx::ldexp(7.0f, -4) ); + STATIC_REQUIRE(bx::isEqual(-0.0f, bx::ldexp(-0.0f, 10), 0.000000001f) ); + + STATIC_REQUIRE(0x1p127f == bx::ldexp(1.0f, 127) ); + STATIC_REQUIRE(0x1p-126f == bx::ldexp(1.0f, -126) ); + STATIC_REQUIRE(0x1p24f == bx::ldexp(1.0f, 24) ); + bx::WriterI* writer = bx::getNullOut(); bx::Error err; @@ -227,6 +520,10 @@ TEST_CASE("ldexp", "[math][libm]") TEST_CASE("exp", "[math][libm]") { + STATIC_REQUIRE( 1.0f == bx::exp(-0.0f) ); + STATIC_REQUIRE( 0.0f == bx::exp(-bx::kFloatInfinity) ); + STATIC_REQUIRE( 0.0f == bx::exp(bx::log(bx::kFloatSmallest) ) ); + bx::WriterI* writer = bx::getNullOut(); bx::Error err; @@ -240,6 +537,22 @@ TEST_CASE("exp", "[math][libm]") TEST_CASE("pow", "[math][libm]") { + STATIC_REQUIRE(1.0f == bx::pow(0.0f, 0.0f) ); + STATIC_REQUIRE(1.0f == bx::pow(1.0f, 0.0f) ); + STATIC_REQUIRE(1.0f == bx::pow(3.0f, 0.0f) ); + STATIC_REQUIRE(1.0f == bx::pow(8.0f, 0.0f) ); + STATIC_REQUIRE(1.0f == bx::pow(9.0f, 0.0f) ); + STATIC_REQUIRE(0.0f == bx::pow(0.0f, 2.0f) ); + + STATIC_REQUIRE( 4.0f == bx::pow( 2.0f, 2.0f) ); + STATIC_REQUIRE( -4.0f == bx::pow(-2.0f, 2.0f) ); + STATIC_REQUIRE( 0.25f == bx::pow( 2.0f, -2.0f) ); + STATIC_REQUIRE( -0.25f == bx::pow(-2.0f, -2.0f) ); + STATIC_REQUIRE( 8.0f == bx::pow( 2.0f, 3.0f) ); + STATIC_REQUIRE( -8.0f == bx::pow(-2.0f, 3.0f) ); + STATIC_REQUIRE( 0.125f == bx::pow( 2.0f, -3.0f) ); + STATIC_REQUIRE(-0.125f == bx::pow(-2.0f, -3.0f) ); + bx::WriterI* writer = bx::getNullOut(); bx::Error err; @@ -253,6 +566,9 @@ TEST_CASE("pow", "[math][libm]") TEST_CASE("asin", "[math][libm]") { + STATIC_REQUIRE(bx::isEqual( 0.0f, bx::asin(0.0f), 0.0001f) ); + STATIC_REQUIRE(bx::isEqual(bx::kPiHalf, bx::asin(1.0f), 0.0001f) ); + bx::WriterI* writer = bx::getNullOut(); bx::Error err; @@ -266,6 +582,11 @@ TEST_CASE("asin", "[math][libm]") TEST_CASE("sin", "[math][libm]") { + STATIC_REQUIRE(bx::isEqual( 0.0f, bx::sin(0.0f ), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual( 1.0f, bx::sin(bx::kPiHalf ), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual( 0.0f, bx::sin(bx::kPi ), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(-1.0f, bx::sin(bx::kPiHalf*3.0f), 0.0000001f) ); + bx::WriterI* writer = bx::getNullOut(); bx::Error err; @@ -284,6 +605,36 @@ TEST_CASE("sin", "[math][libm]") } } +TEST_CASE("sinCos", "[math][libm]") +{ + bx::WriterI* writer = bx::getNullOut(); + bx::Error err; + + for (float xx = -100.0f; xx < 100.0f; xx += 0.1f) + { + float ss, cc; + bx::sinCosApprox(ss, cc, xx); + + bx::write(writer, &err, "sinCos(%f) == sin %f (expected: %f)\n", xx, ss, ::sinf(xx) ); + bx::write(writer, &err, "sinCos(%f) == cos %f (expected: %f)\n", xx, cc, ::cosf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(ss, ::sinf(xx), 0.001f) ); + REQUIRE(bx::isEqual(cc, ::cosf(xx), 0.00001f) ); + } + + for (float xx = -bx::kPi2; xx < bx::kPi2; xx += 0.0001f) + { + float ss, cc; + bx::sinCosApprox(ss, cc, xx); + + bx::write(writer, &err, "sinCos(%f) == sin %f (expected: %f)\n", xx, ss, ::sinf(xx) ); + bx::write(writer, &err, "sinCos(%f) == cos %f (expected: %f)\n", xx, cc, ::cosf(xx) ); + REQUIRE(err.isOk() ); + REQUIRE(bx::isEqual(ss, ::sinf(xx), 0.001f) ); + REQUIRE(bx::isEqual(cc, ::cosf(xx), 0.00001f) ); + } +} + TEST_CASE("sinh", "[math][libm]") { bx::WriterI* writer = bx::getNullOut(); @@ -299,6 +650,9 @@ TEST_CASE("sinh", "[math][libm]") TEST_CASE("acos", "[math][libm]") { + STATIC_REQUIRE(bx::isEqual(bx::kPiHalf, bx::acos(0.0f), 0.0001f) ); + STATIC_REQUIRE(bx::isEqual( 0.0f, bx::acos(1.0f), 0.0001f) ); + bx::WriterI* writer = bx::getNullOut(); bx::Error err; @@ -312,6 +666,11 @@ TEST_CASE("acos", "[math][libm]") TEST_CASE("cos", "[math][libm]") { + STATIC_REQUIRE(bx::isEqual( 1.0f, bx::cos(0.0f ), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual( 0.0f, bx::cos(bx::kPiHalf ), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual(-1.0f, bx::cos(bx::kPi ), 0.0000001f) ); + STATIC_REQUIRE(bx::isEqual( 0.0f, bx::cos(bx::kPiHalf*3.0f), 0.0000001f) ); + bx::WriterI* writer = bx::getNullOut(); bx::Error err; @@ -395,41 +754,41 @@ TEST_CASE("sign", "[math][libm]") STATIC_REQUIRE( 0 == bx::sign( 0.0000f) ); STATIC_REQUIRE( 1 == bx::sign( 0.1389f) ); - REQUIRE(-1 == bx::sign(-bx::kFloatInfinity) ); - REQUIRE( 1 == bx::sign( bx::kFloatInfinity) ); + STATIC_REQUIRE(-1 == bx::sign(-bx::kFloatInfinity) ); + STATIC_REQUIRE( 1 == bx::sign( bx::kFloatInfinity) ); } -TEST_CASE("signbit", "[math][libm]") +TEST_CASE("signBit", "[math][libm]") { - STATIC_REQUIRE( bx::signbit(-0.1389f) ); - STATIC_REQUIRE(!bx::signbit( 0.0000f) ); - STATIC_REQUIRE(!bx::signbit( 0.1389f) ); + STATIC_REQUIRE( bx::signBit(-0.1389f) ); + STATIC_REQUIRE(!bx::signBit( 0.0000f) ); + STATIC_REQUIRE(!bx::signBit( 0.1389f) ); - REQUIRE( bx::signbit(-bx::kFloatInfinity) ); - REQUIRE(!bx::signbit( bx::kFloatInfinity) ); + STATIC_REQUIRE( bx::signBit(-bx::kFloatInfinity) ); + STATIC_REQUIRE(!bx::signBit( bx::kFloatInfinity) ); } -TEST_CASE("copysign", "[math][libm]") +TEST_CASE("copySign", "[math][libm]") { - STATIC_REQUIRE( 0.1389f == bx::copysign(-0.1389f, +1389) ); - STATIC_REQUIRE(-0.0000f == bx::copysign( 0.0000f, -1389) ); - STATIC_REQUIRE(-0.1389f == bx::copysign( 0.1389f, -1389) ); + STATIC_REQUIRE( 0.1389f == bx::copySign(-0.1389f, +1389) ); + STATIC_REQUIRE(-0.0000f == bx::copySign( 0.0000f, -1389) ); + STATIC_REQUIRE(-0.1389f == bx::copySign( 0.1389f, -1389) ); - REQUIRE(-bx::kFloatInfinity == bx::copysign(bx::kFloatInfinity, -1389) ); + STATIC_REQUIRE(-bx::kFloatInfinity == bx::copySign(bx::kFloatInfinity, -1389) ); } TEST_CASE("bitsToFloat, floatToBits, bitsToDouble, doubleToBits", "[math]") { - REQUIRE(UINT32_C(0x12345678) == bx::floatToBits( bx::bitsToFloat( UINT32_C(0x12345678) ) ) ); - REQUIRE(UINT64_C(0x123456789abcdef0) == bx::doubleToBits(bx::bitsToDouble(UINT32_C(0x123456789abcdef0) ) ) ); + STATIC_REQUIRE(0x12345678u == bx::floatToBits( bx::bitsToFloat (0x12345678u) ) ); + STATIC_REQUIRE(0x123456789abcdef0ull == bx::doubleToBits(bx::bitsToDouble(0x123456789abcdef0ull) ) ); } TEST_CASE("lerp", "[math]") { - REQUIRE(1389.0f == bx::lerp(1389.0f, 1453.0f, 0.0f) ); - REQUIRE(1453.0f == bx::lerp(1389.0f, 1453.0f, 1.0f) ); - REQUIRE( 0.5f == bx::lerp( 0.0f, 1.0f, 0.5f) ); - REQUIRE( 0.0f == bx::lerp( 0.0f, 0.0f, 0.5f) ); + STATIC_REQUIRE(1389.0f == bx::lerp(1389.0f, 1453.0f, 0.0f) ); + STATIC_REQUIRE(1453.0f == bx::lerp(1389.0f, 1453.0f, 1.0f) ); + STATIC_REQUIRE( 0.5f == bx::lerp( 0.0f, 1.0f, 0.5f) ); + STATIC_REQUIRE( 0.0f == bx::lerp( 0.0f, 0.0f, 0.5f) ); } void mtxCheck(const float* _a, const float* _b) @@ -463,11 +822,13 @@ void mtxCheck(const float* _a, const float* _b) TEST_CASE("vec3", "[math][vec3]") { + REQUIRE(bx::isEqual({0.0f, 0.0f, 0.0f}, bx::normalize({0.0f, 0.0f, 0.0f}), 0.0f) ); + bx::Vec3 normalized = bx::normalize({0.0f, 1.0f, 0.0f}); - REQUIRE(bx::isEqual(normalized, {0.0f, 1.0f, 0.0f}, 0.0f) ); + REQUIRE(bx::isEqual(normalized, {0.0f, 1.0f, 0.0f}, 0.00001f) ); float length = bx::length(normalized); - REQUIRE(bx::isEqual(length, 1.0f, 0.0f) ); + REQUIRE(bx::isEqual(length, 1.0f, 0.00001f) ); } TEST_CASE("quaternion", "[math][quaternion]") @@ -573,4 +934,7 @@ TEST_CASE("limits", "[math]") STATIC_REQUIRE(bx::LimitsT::min == std::numeric_limits::lowest() ); STATIC_REQUIRE(bx::LimitsT::max == std::numeric_limits::max() ); + + STATIC_REQUIRE(bx::kFloatSmallest == std::numeric_limits::min() ); + STATIC_REQUIRE(bx::kDoubleSmallest == std::numeric_limits::min() ); } diff --git a/bx/tests/os_test.cpp b/bx/tests/os_test.cpp index be5a6317..956117fb 100644 --- a/bx/tests/os_test.cpp +++ b/bx/tests/os_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -10,8 +10,12 @@ TEST_CASE("getProcessMemoryUsed", "") { + if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN) ) + { + SKIP("Not supported by wasm."); + } + REQUIRE(0 != bx::getProcessMemoryUsed() ); -// DBG("bx::getProcessMemoryUsed %d", bx::getProcessMemoryUsed() ); } #if BX_CONFIG_SUPPORTS_THREADING diff --git a/bx/tests/pixelformat_test.cpp b/bx/tests/pixelformat_test.cpp new file mode 100644 index 00000000..03119688 --- /dev/null +++ b/bx/tests/pixelformat_test.cpp @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bx/blob/master/LICENSE + */ + +#include "test.h" +#include + +TEST_CASE("pack/unpack Rgba8", "[pixelformat]") +{ + float rgba[4] = { 0.1f, 0.3f, 0.8f, 0.9f }; + uint32_t encoded; + bx::packRgba8(&encoded, rgba); + + float decoded[4]; + bx::unpackRgba8(decoded, &encoded); + + REQUIRE(bx::isEqual(rgba, decoded, 4, 0.01f) ); +} + +TEST_CASE("pack/unpack Rgb9E5F", "[pixelformat]") +{ + float rgba[3] = { 0.1f, 0.3f, 0.89f }; + uint32_t encoded; + bx::packRgb9E5F(&encoded, rgba); + + float decoded[3]; + bx::unpackRgb9E5F(decoded, &encoded); + + REQUIRE(bx::isEqual(rgba, decoded, BX_COUNTOF(rgba), 0.001f) ); +} diff --git a/bx/tests/queue_test.cpp b/bx/tests/queue_test.cpp index 44ee2891..bdbbf98f 100644 --- a/bx/tests/queue_test.cpp +++ b/bx/tests/queue_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/readerwriter_test.cpp b/bx/tests/readerwriter_test.cpp index ee8cc742..766bbdd7 100644 --- a/bx/tests/readerwriter_test.cpp +++ b/bx/tests/readerwriter_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -29,3 +29,27 @@ TEST_CASE("writeBE", "") REQUIRE(err.isOk() ); REQUIRE(total == 4); } + +TEST_CASE("writeRep", "") +{ + uint8_t tmp[1389]; + bx::StaticMemoryBlock mb(tmp, sizeof(tmp) ); + bx::MemoryWriter writer(&mb); + + bx::Error err; + + int32_t total = 0; + + total += bx::writeRep(&writer, 0xfb, BX_COUNTOF(tmp)-1, &err); + REQUIRE(err.isOk() ); + REQUIRE(BX_COUNTOF(tmp)-1 == total); + + total += bx::writeRep(&writer, 0xfb, 2, &err); + REQUIRE(!err.isOk() ); + REQUIRE(BX_COUNTOF(tmp) == total); + + for (uint32_t ii = 0; ii < BX_COUNTOF(tmp); ++ii) + { + REQUIRE(0xfb == tmp[ii]); + } +} diff --git a/bx/tests/ringbuffer_test.cpp b/bx/tests/ringbuffer_test.cpp index b2165016..214c4862 100644 --- a/bx/tests/ringbuffer_test.cpp +++ b/bx/tests/ringbuffer_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/rng_test.cpp b/bx/tests/rng_test.cpp index 1d220d8e..8b1d3627 100644 --- a/bx/tests/rng_test.cpp +++ b/bx/tests/rng_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/run_test.cpp b/bx/tests/run_test.cpp index c754f7d2..35325f2a 100644 --- a/bx/tests/run_test.cpp +++ b/bx/tests/run_test.cpp @@ -1,29 +1,82 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ #define CATCH_CONFIG_RUNNER #include "test.h" +#include +#include +#include -int runAllTests(int _argc, const char* _argv[]) +bool testAssertHandler(const bx::Location& _location, const char* _format, va_list _argList) { - DBG("Compiler: " BX_COMPILER_NAME + bx::printf("%s(%d): ", _location.filePath, _location.line); + bx::vprintf(_format, _argList); + bx::printf("\n"); + + uintptr_t stack[32]; + const uint32_t num = bx::getCallStack(2 /* skip self */, BX_COUNTOF(stack), stack); + bx::writeCallstack(bx::getStdOut(), stack, num, bx::ErrorIgnore{}); + + // Throwing exceptions is required for testing asserts being trigged. + // Use REQUIRE_ASSERTS to test asserts. + throw std::exception(); + + return true; +} + +int runAllTests(int32_t _argc, const char* _argv[]) +{ + bx::setAssertHandler(testAssertHandler); + + bx::printf( + "\nCompiler: " BX_COMPILER_NAME ", CPU: " BX_CPU_NAME - ", Architecture: " BX_ARCH_NAME + ", Arch: " BX_ARCH_NAME ", OS: " BX_PLATFORM_NAME ", CRT: " BX_CRT_NAME + ", Features: " BX_CPP_NAME +#if BX_SIMD_SUPPORTED + ", SIMD" +# if BX_SIMD_AVX + ", AVX" +# endif // BX_SIMD_AVX +# if BX_SIMD_LANGEXT + ", LangExt" +# endif // BX_SIMD_LANGEXT +# if BX_SIMD_NEON + ", Neon" +# endif // BX_SIMD_NEON +# if BX_SIMD_SSE + ", SSE" +# endif // BX_SIMD_SSE +#endif // BX_SIMD_SUPPORTED + ", Date: " __DATE__ ", Time: " __TIME__ - ", C++: " BX_CPP_NAME + "\n\n" ); + bx::printf("Args:\n"); + + for (int32_t ii = 0; ii < _argc; ++ii) + { + bx::printf("\t%2d: \"%s\"\n", ii, _argv[ii]); + } + + bx::printf("\n"); + using namespace Catch; Session session; ConfigData config; - config.defaultColourMode = BX_PLATFORM_EMSCRIPTEN ? ColourMode::None : ColourMode::PlatformDefault; + config.defaultColourMode = BX_PLATFORM_EMSCRIPTEN + ? ColourMode::None + : ColourMode::PlatformDefault + ; + config.showDurations = ShowDurations::Always; session.useConfigData(config); diff --git a/bx/tests/settings_test.cpp b/bx/tests/settings_test.cpp index 4f33d226..6deabcbe 100644 --- a/bx/tests/settings_test.cpp +++ b/bx/tests/settings_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/simd_bench.cpp b/bx/tests/simd_bench.cpp index 594f5b55..70f674ef 100644 --- a/bx/tests/simd_bench.cpp +++ b/bx/tests/simd_bench.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/simd_test.cpp b/bx/tests/simd_test.cpp index f4e19158..bab4f5c1 100644 --- a/bx/tests/simd_test.cpp +++ b/bx/tests/simd_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/sort_test.cpp b/bx/tests/sort_test.cpp index c2eef4ae..312264ab 100644 --- a/bx/tests/sort_test.cpp +++ b/bx/tests/sort_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/string_test.cpp b/bx/tests/string_test.cpp index 6abf3dee..4cc3e4a9 100644 --- a/bx/tests/string_test.cpp +++ b/bx/tests/string_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -207,7 +207,7 @@ TEST_CASE("strCmpV sort", "[string][sort]") "test_100.txt", }; - BX_STATIC_ASSERT(BX_COUNTOF(test) == BX_COUNTOF(expected) ); + static_assert(BX_COUNTOF(test) == BX_COUNTOF(expected) ); bx::quickSort(test, BX_COUNTOF(test), sizeof(const char*), strCmpV); diff --git a/bx/tests/test.h b/bx/tests/test.h index d6eec65a..a39b6182 100644 --- a/bx/tests/test.h +++ b/bx/tests/test.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -14,7 +14,12 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4312); // warning C4312 : 'reinterpret_cast' : BX_PRAGMA_DIAGNOSTIC_POP(); #define TEST(_x) TEST_CASE(#_x, "") -#define CHECK_EQUAL(_x, _y) REQUIRE(_x == _y) + +#if BX_CONFIG_DEBUG +# define REQUIRE_ASSERTS(_x) REQUIRE_THROWS(_x) +#else +# define REQUIRE_ASSERTS(_x) BX_UNUSED(_x) +#endif // BX_CONFIG_DEBUG #include "dbg.h" diff --git a/bx/tests/thread_test.cpp b/bx/tests/thread_test.cpp index 0e615689..6de0b8bf 100644 --- a/bx/tests/thread_test.cpp +++ b/bx/tests/thread_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/tokenizecmd_test.cpp b/bx/tests/tokenizecmd_test.cpp index 7c0bdabd..23483e60 100644 --- a/bx/tests/tokenizecmd_test.cpp +++ b/bx/tests/tokenizecmd_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Branimir Karadzic. All rights reserved. + * Copyright 2012-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/typetraits_test.cpp b/bx/tests/typetraits_test.cpp index 088cdb92..17a181a5 100644 --- a/bx/tests/typetraits_test.cpp +++ b/bx/tests/typetraits_test.cpp @@ -1,11 +1,13 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ #include "test.h" #include +BX_PRAGMA_DIAGNOSTIC_PUSH(); +BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunused-private-field"); struct TestClass { }; struct TestClassFinal final { }; struct TestClassMember { int32_t x; }; @@ -27,6 +29,7 @@ union TestUnionEmpty { union TestUnion { int32_t x; float y; }; enum TestEnumEmpty { }; enum TestEnum { Enum }; +BX_PRAGMA_DIAGNOSTIC_POP(); TEST_CASE("type-traits isReference", "") { @@ -227,6 +230,20 @@ TEST_CASE("type-traits isTriviallyDestructible", "") STATIC_REQUIRE(!bx::isTriviallyDestructible() ); } +TEST_CASE("type-traits isConst", "") +{ + STATIC_REQUIRE(!bx::isConst() ); + STATIC_REQUIRE( bx::isConst() ); + STATIC_REQUIRE( bx::isConst>() ); +} + +TEST_CASE("type-traits isVolatile", "") +{ + STATIC_REQUIRE(!bx::isVolatile() ); + STATIC_REQUIRE( bx::isVolatile() ); + STATIC_REQUIRE( bx::isVolatile>() ); +} + TEST_CASE("type-traits isSigned", "") { STATIC_REQUIRE(!bx::isSigned() ); @@ -299,6 +316,92 @@ TEST_CASE("type-traits isUnsigned", "") STATIC_REQUIRE(!bx::isUnsigned() ); } +TEST_CASE("type-traits MakeSignedT", "") +{ + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + STATIC_REQUIRE(bx::isSigned::Type >() ); + + using charType = bx::MakeSignedType; + using intType = bx::MakeSignedType; + using longType = bx::MakeSignedType; + + STATIC_REQUIRE(true + && bx::isSame() + && bx::isSame() + && bx::isSame() + ); +} + +TEST_CASE("type-traits MakeUnsignedT", "") +{ + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + STATIC_REQUIRE(bx::isUnsigned::Type >() ); + + using ucharType = bx::MakeUnsignedType; + using uintType = bx::MakeUnsignedType; + using ulongType = bx::MakeUnsignedType; + + STATIC_REQUIRE(true + && bx::isSame() + && bx::isSame() + && bx::isSame() + ); +} + TEST_CASE("type-traits isInteger", "") { STATIC_REQUIRE( bx::isInteger() ); diff --git a/bx/tests/uint32_test.cpp b/bx/tests/uint32_test.cpp index 0618c018..785ced45 100644 --- a/bx/tests/uint32_test.cpp +++ b/bx/tests/uint32_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -28,45 +28,6 @@ TEST_CASE("StrideAlign", "[uint32_t]") REQUIRE(offset == 48); } -TEST_CASE("uint32_cnt", "[uint32_t]") -{ - REQUIRE( 0 == bx::uint32_cnttz(1) ); - REQUIRE( 7 == bx::uint32_cnttz(1<<7) ); - REQUIRE( 8 == bx::uint32_cnttz(0) ); - REQUIRE( 1 == bx::uint32_cnttz(0x3e) ); - REQUIRE( 0 == bx::uint32_cnttz(1) ); - REQUIRE(15 == bx::uint32_cnttz(1<<15) ); - REQUIRE(16 == bx::uint32_cnttz(0) ); - REQUIRE( 0 == bx::uint32_cnttz(1) ); - REQUIRE(32 == bx::uint32_cnttz(0) ); - REQUIRE(31 == bx::uint32_cnttz(1u<<31) ); - REQUIRE( 0 == bx::uint32_cnttz(1) ); - REQUIRE(64 == bx::uint32_cnttz(0) ); - - REQUIRE( 7 == bx::uint32_cntlz(1) ); - REQUIRE( 8 == bx::uint32_cntlz(0) ); - REQUIRE( 2 == bx::uint32_cntlz(0x3e) ); - REQUIRE(15 == bx::uint32_cntlz(1) ); - REQUIRE(16 == bx::uint32_cntlz(0) ); - REQUIRE(31 == bx::uint32_cntlz(1) ); - REQUIRE(32 == bx::uint32_cntlz(0) ); - REQUIRE(63 == bx::uint32_cntlz(1) ); - REQUIRE(64 == bx::uint32_cntlz(0) ); - - REQUIRE( 0 == bx::uint32_cntbits(0) ); - REQUIRE( 1 == bx::uint32_cntbits(1) ); - - REQUIRE( 4 == bx::uint32_cntbits(0x55) ); - REQUIRE( 8 == bx::uint32_cntbits(0x5555) ); - REQUIRE(16 == bx::uint32_cntbits(0x55555555) ); - REQUIRE(32 == bx::uint32_cntbits(0x5555555555555555) ); - - REQUIRE( 8 == bx::uint32_cntbits(UINT8_MAX) ); - REQUIRE(16 == bx::uint32_cntbits(UINT16_MAX) ); - REQUIRE(32 == bx::uint32_cntbits(UINT32_MAX) ); - REQUIRE(64 == bx::uint32_cntbits(UINT64_MAX) ); -} - TEST_CASE("uint32_part", "[uint32_t]") { REQUIRE(UINT32_C(0x55555555) == bx::uint32_part1by1(UINT16_MAX) ); @@ -108,16 +69,22 @@ TEST_CASE("halfTo/FromFloat", "[uint32_t]") } } -TEST_CASE("uint32_testpow2") +TEST_CASE("uint32_testpow2", "[uint32_t]") { uint32_t shift = 0; + uint32_t nextpow2 = bx::uint32_nextpow2(1); - for (uint32_t ii = 0; ii < UINT32_MAX; ++ii) + for (uint32_t ii = 1; ii < 1<<24; ++ii) { + REQUIRE(nextpow2 == bx::uint32_nextpow2(ii) ); + if (bx::uint32_testpow2(ii) ) { REQUIRE(ii == 1u << shift); ++shift; + + REQUIRE(ii == nextpow2); + nextpow2 = bx::uint32_nextpow2(ii+1); } } } @@ -141,6 +108,13 @@ TEST_CASE("align", "[uint32_t]") REQUIRE( bx::isAligned(64, 8) ); REQUIRE(!bx::isAligned(63, 8) ); + for (int32_t ii = 0; ii < 1024; ++ii) + { + REQUIRE(bx::isAligned(ii, 0) ); + REQUIRE(ii == bx::alignUp(ii, 0) ); + REQUIRE(ii == bx::alignDown(ii, 0) ); + } + REQUIRE( 0 == bx::alignUp( 0, 16) ); REQUIRE( 16 == bx::alignUp( 1, 16) ); REQUIRE( 16 == bx::alignUp( 15, 16) ); diff --git a/bx/tests/url_test.cpp b/bx/tests/url_test.cpp index 9ca9b3e2..b88cf0ed 100644 --- a/bx/tests/url_test.cpp +++ b/bx/tests/url_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ diff --git a/bx/tests/vsnprintf_test.cpp b/bx/tests/vsnprintf_test.cpp index cc23c849..d850ce28 100644 --- a/bx/tests/vsnprintf_test.cpp +++ b/bx/tests/vsnprintf_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 Branimir Karadzic. All rights reserved. + * Copyright 2010-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -12,9 +12,10 @@ TEST_CASE("No output buffer provided.", "[string][printf]") { - REQUIRE(4 == bx::snprintf(NULL, 0, "test") ); - - REQUIRE(1 == bx::snprintf(NULL, 0, "%d", 1) ); + REQUIRE(4 == bx::snprintf(NULL, 0, "test") ); + REQUIRE(4 == bx::snprintf(NULL, 10, "test") ); + REQUIRE(1 == bx::snprintf(NULL, 0, "%d", 1) ); + REQUIRE(1 == bx::snprintf(NULL, 10, "%d", 1) ); } TEST_CASE("Truncated output buffer.", "[string][printf]") @@ -30,6 +31,14 @@ TEST_CASE("Truncated output buffer.", "[string][printf]") REQUIRE(4 == bx::snprintf(buffer1, BX_COUNTOF(buffer1), "abvg") ); REQUIRE('\0' == buffer1[BX_COUNTOF(buffer1)-1]); + buffer1[0] = '\xfb'; // null destination + REQUIRE(4 == bx::snprintf(NULL, BX_COUNTOF(buffer1), "abvg") ); + REQUIRE('\xfb' == buffer1[0]); + + buffer1[0] = '\xbf'; // one byte destination + REQUIRE(4 == bx::snprintf(buffer1, 1, "abvg") ); + REQUIRE('\0' == buffer1[0]); + char buffer7[7]; // truncate REQUIRE(10 == bx::snprintf(NULL, 0, "Ten chars!") ); REQUIRE(10 == bx::snprintf(buffer7, BX_COUNTOF(buffer7), "Ten chars!") ); @@ -47,44 +56,100 @@ TEST_CASE("Truncated output buffer.", "[string][printf]") REQUIRE(0 == bx::strCmp(buffer7, "SevenE") ); } -static bool test(const char* _expected, const char* _format, ...) +template +static bool test(const char* _expected, const char* _format, va_list _argList) { - int32_t max = (int32_t)bx::strLen(_expected) + 1; - char* temp = (char*)alloca(max); + const int32_t expectedLen = bx::strLen(_expected); + int32_t max = expectedLen + 1024; + char* bxTemp = (char*)alloca(max); va_list argList; - va_start(argList, _format); - int32_t len = bx::vsnprintf(temp, max, _format, argList); - va_end(argList); + va_copy(argList, _argList); + const int32_t bxLen = bx::vsnprintf(bxTemp, max, _format, argList); bool result = true - && len == max-1 - && 0 == bx::strCmp(_expected, temp) + && bxLen == expectedLen + && 0 == bx::strCmp(_expected, bxTemp) ; + char* crtTemp = NULL; + int32_t crtLen = 0; + + if (!result + || StdCompliantT) + { + BX_ASSERT(bx::strFind(_format, "%S").isEmpty() + , "String format test is using '%%S' bx::StringView specific format specifier which is not standard compliant. " + "Use `testNotStdCompliant` string testing method." + ); + + crtTemp = (char*)alloca(max); + + va_copy(argList, _argList); + crtLen = ::vsnprintf(crtTemp, max, _format, argList); + + result &= true + && crtLen == bxLen + && 0 == bx::strCmp(bx::StringView(bxTemp, bxLen), bx::StringView(crtTemp, crtLen) ) + ; + } + if (!result) { - printf("result (%d) '%s', expected (%d) '%s'\n", len, temp, max-1, _expected); + printf("---\n"); + printf("printf format '%s'\n", _format); + printf(" bx result (%4d) '%s'\n", bxLen, bxTemp); + printf(" expected (%4d) '%s'\n", expectedLen, _expected); + printf("CRT vsnprintf (%4d) '%s'\n", crtLen, crtTemp); } return result; } +// Test against CRT's vsnprintf implementation. +static bool test(const char* _expected, const char* _format, ...) +{ + va_list argList; + va_start(argList, _format); + const bool result = test(_expected, _format, argList); + va_end(argList); + + return result; +} + +// Skip test against CRT's vsnprintf implementation. +static bool testNotStdCompliant(const char* _expected, const char* _format, ...) +{ + va_list argList; + va_start(argList, _format); + const bool result = test(_expected, _format, argList); + va_end(argList); + + return result; +} + TEST_CASE("Format %f", "[string][printf]") { + constexpr double kDoubleNan = bx::bitsToDouble(bx::kDoubleExponentMask | bx::kDoubleMantissaMask); + REQUIRE(test("1.337", "%0.3f", 1.337) ); REQUIRE(test(" 13.370", "%8.3f", 13.37) ); REQUIRE(test(" 13.370", "%*.*f", 8, 3, 13.37) ); REQUIRE(test("13.370 ", "%-8.3f", 13.37) ); REQUIRE(test("13.370 ", "%*.*f", -8, 3, 13.37) ); + REQUIRE(test(" -13.370", "% 8.3f", -13.37) ); + REQUIRE(test(" 13.370", "% 16.3f", 13.37) ); + REQUIRE(test(" -13.370", "% 16.3f", -13.37) ); - REQUIRE(test("nan ", "%-8f", std::numeric_limits::quiet_NaN() ) ); - REQUIRE(test(" nan", "%8f", std::numeric_limits::quiet_NaN() ) ); - REQUIRE(test("-NAN ", "%-8F", -std::numeric_limits::quiet_NaN() ) ); + REQUIRE(test("nan ", "%-8f", kDoubleNan) ); + REQUIRE(test(" nan", "%8f", kDoubleNan) ); + REQUIRE(test("-NAN ", "%-8F", -kDoubleNan) ); - REQUIRE(test(" inf", "%8f", std::numeric_limits::infinity() ) ); - REQUIRE(test("inf ", "%-8f", std::numeric_limits::infinity() ) ); - REQUIRE(test(" -INF", "%8F", -std::numeric_limits::infinity() ) ); +#if !defined(__FAST_MATH__) || !__FAST_MATH__ + REQUIRE(test(" inf", "%8f", bx::kDoubleInfinity) ); + REQUIRE(test("inf ", "%-8f", bx::kDoubleInfinity) ); + REQUIRE(test(" -INF", "%8F", -bx::kDoubleInfinity) ); +#endif // !defined(__FAST_MATH__) || !__FAST_MATH__ REQUIRE(test(" 1.0", "%4.1f", 1.0) ); REQUIRE(test(" 1.500", "%6.3f", 1.5) ); @@ -94,63 +159,63 @@ TEST_CASE("Format %f", "[string][printf]") REQUIRE(test("0.0039", "%.4f", 0.00390625) ); REQUIRE(test("0.003906", "%f", 0.00390625) ); - REQUIRE(test("-1.234567e-9", "%f", -1.234567e-9) ); - - REQUIRE(test("-1e-9", "%.0f", -1.234567e-9) ); - REQUIRE(test("-1.2e-9", "%.1f", -1.234567e-9) ); - REQUIRE(test("-1.23e-9", "%.2f", -1.234567e-9) ); - REQUIRE(test("-1.234e-9", "%.3f", -1.234567e-9) ); - REQUIRE(test("-1.2345e-9", "%.4f", -1.234567e-9) ); - REQUIRE(test("-1.23456e-9", "%.5f", -1.234567e-9) ); - REQUIRE(test("-1.234567e-9", "%.6f", -1.234567e-9) ); - REQUIRE(test("-1.2345670e-9", "%.7f", -1.234567e-9) ); - REQUIRE(test("-1.23456700e-9", "%.8f", -1.234567e-9) ); - REQUIRE(test("-1.234567000e-9", "%.9f", -1.234567e-9) ); - REQUIRE(test("-1.2345670000e-9", "%.10f", -1.234567e-9) ); - - REQUIRE(test("3.141592", "%f", 3.1415926535897932) ); - REQUIRE(test("3.141592", "%F", 3.1415926535897932) ); - REQUIRE(test("3", "%.0f", 3.1415926535897932) ); - REQUIRE(test("3.1", "%.1f", 3.1415926535897932) ); - REQUIRE(test("3.14", "%.2f", 3.1415926535897932) ); - REQUIRE(test("3.141", "%.3f", 3.1415926535897932) ); - REQUIRE(test("3.1415", "%.4f", 3.1415926535897932) ); - REQUIRE(test("3.14159", "%.5f", 3.1415926535897932) ); - REQUIRE(test("3.141592", "%.6f", 3.1415926535897932) ); - REQUIRE(test("3.1415926", "%.7f", 3.1415926535897932) ); - REQUIRE(test("3.14159265", "%.8f", 3.1415926535897932) ); - REQUIRE(test("3.141592653", "%.9f", 3.1415926535897932) ); - REQUIRE(test("3.1415926535", "%.10f", 3.1415926535897932) ); - REQUIRE(test("3.14159265358", "%.11f", 3.1415926535897932) ); - REQUIRE(test("3.141592653589", "%.12f", 3.1415926535897932) ); - REQUIRE(test("3.1415926535897", "%.13f", 3.1415926535897932) ); - REQUIRE(test("3.14159265358979", "%.14f", 3.1415926535897932) ); - REQUIRE(test("3.141592653589793", "%.15f", 3.1415926535897932) ); - REQUIRE(test("3.1415926535897930", "%.16f", 3.1415926535897932) ); - REQUIRE(test("3.1415926535897930", "%.16F", 3.1415926535897932) ); - - REQUIRE(test("-3.141592e-9", "%f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.141592E-9", "%F", -3.1415926535897932e-9) ); - REQUIRE(test("-3e-9", "%.0f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.1e-9", "%.1f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.14e-9", "%.2f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.141e-9", "%.3f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.1415e-9", "%.4f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.14159e-9", "%.5f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.141592e-9", "%.6f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.1415926e-9", "%.7f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.14159265e-9", "%.8f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.141592653e-9", "%.9f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.1415926535e-9", "%.10f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.14159265358e-9", "%.11f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.141592653589e-9", "%.12f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.1415926535897e-9", "%.13f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.14159265358979e-9", "%.14f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.141592653589793e-9", "%.15f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.1415926535897930e-9", "%.16f", -3.1415926535897932e-9) ); - REQUIRE(test("-3.1415926535897930E-9", "%.16F", -3.1415926535897932e-9) ); - - REQUIRE(test("1e-12", "%f", 1e-12)); + REQUIRE(testNotStdCompliant("-1.234567e-9", "%f", -1.234567e-9) ); + + REQUIRE(testNotStdCompliant("-1e-9", "%.0f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.2e-9", "%.1f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.23e-9", "%.2f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.234e-9", "%.3f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.2345e-9", "%.4f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.23456e-9", "%.5f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.234567e-9", "%.6f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.2345670e-9", "%.7f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.23456700e-9", "%.8f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.234567000e-9", "%.9f", -1.234567e-9) ); + REQUIRE(testNotStdCompliant("-1.2345670000e-9", "%.10f", -1.234567e-9) ); + + REQUIRE(testNotStdCompliant("3.141592", "%f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.141592", "%F", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3", "%.0f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.1", "%.1f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.14", "%.2f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.141", "%.3f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.1415", "%.4f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.14159", "%.5f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.141592", "%.6f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.1415926", "%.7f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.14159265", "%.8f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.141592653", "%.9f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.1415926535", "%.10f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.14159265358", "%.11f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.141592653589", "%.12f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.1415926535897", "%.13f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.14159265358979", "%.14f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.141592653589793", "%.15f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.1415926535897930", "%.16f", 3.1415926535897932) ); + REQUIRE(testNotStdCompliant("3.1415926535897930", "%.16F", 3.1415926535897932) ); + + REQUIRE(testNotStdCompliant("-3.141592e-9", "%f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.141592E-9", "%F", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3e-9", "%.0f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.1e-9", "%.1f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.14e-9", "%.2f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.141e-9", "%.3f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.1415e-9", "%.4f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.14159e-9", "%.5f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.141592e-9", "%.6f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.1415926e-9", "%.7f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.14159265e-9", "%.8f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.141592653e-9", "%.9f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.1415926535e-9", "%.10f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.14159265358e-9", "%.11f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.141592653589e-9", "%.12f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.1415926535897e-9", "%.13f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.14159265358979e-9", "%.14f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.141592653589793e-9", "%.15f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.1415926535897930e-9", "%.16f", -3.1415926535897932e-9) ); + REQUIRE(testNotStdCompliant("-3.1415926535897930E-9", "%.16F", -3.1415926535897932e-9) ); + + REQUIRE(testNotStdCompliant("1e-12", "%f", 1e-12)); REQUIRE(test("0.00390625", "%.8f", 0.00390625) ); REQUIRE(test("-0.00390625", "%.8f", -0.00390625) ); @@ -160,8 +225,10 @@ TEST_CASE("Format %f", "[string][printf]") TEST_CASE("Format %d, %i, %o, %u, %x", "[string][printf]") { REQUIRE(test("1337", "%d", 1337) ); + REQUIRE(test("-1337", "% d", -1337) ); REQUIRE(test("1337 ", "%-20d", 1337) ); REQUIRE(test("-1337 ", "%-20d", -1337) ); + REQUIRE(test(" -1337", "% 20d", -1337) ); REQUIRE(test("1337", "%i", 1337) ); REQUIRE(test("1337 ", "%-20i", 1337) ); @@ -192,14 +259,14 @@ TEST_CASE("Format %d, %i, %o, %u, %x", "[string][printf]") REQUIRE(test("000000000000edcb5433", "%020x", -0x1234abcd) ); REQUIRE(test("000000000000EDCB5433", "%020X", -0x1234abcd) ); - REQUIRE(test("0xf", "0x%01x", -1) ); - REQUIRE(test("0xff", "0x%02x", -1) ); - REQUIRE(test("0xfff", "0x%03x", -1) ); - REQUIRE(test("0xffff", "0x%04x", -1) ); - REQUIRE(test("0xfffff", "0x%05x", -1) ); - REQUIRE(test("0xffffff", "0x%06x", -1) ); - REQUIRE(test("0xfffffff", "0x%07x", -1) ); - REQUIRE(test("0xffffffff", "0x%08x", -1) ); + REQUIRE(testNotStdCompliant("0xf", "0x%01x", -1) ); + REQUIRE(testNotStdCompliant("0xff", "0x%02x", -1) ); + REQUIRE(testNotStdCompliant("0xfff", "0x%03x", -1) ); + REQUIRE(testNotStdCompliant("0xffff", "0x%04x", -1) ); + REQUIRE(testNotStdCompliant("0xfffff", "0x%05x", -1) ); + REQUIRE(testNotStdCompliant("0xffffff", "0x%06x", -1) ); + REQUIRE(testNotStdCompliant("0xfffffff", "0x%07x", -1) ); + REQUIRE(testNotStdCompliant("0xffffffff", "0x%08x", -1) ); REQUIRE(test(" -1", "% 4i", -1) ); REQUIRE(test(" -1", "% 4i", -1) ); @@ -207,7 +274,7 @@ TEST_CASE("Format %d, %i, %o, %u, %x", "[string][printf]") REQUIRE(test(" 1", "% 4i", 1) ); REQUIRE(test(" 1", "% 4o", 1) ); REQUIRE(test(" +1", "%+4i", 1) ); - REQUIRE(test(" +1", "%+4o", 1) ); + REQUIRE(testNotStdCompliant(" +1", "%+4o", 1) ); REQUIRE(test(" +0", "%+4i", 0) ); REQUIRE(test(" -1", "%+4i", -1) ); REQUIRE(test("0001", "%04i", 1) ); @@ -217,7 +284,7 @@ TEST_CASE("Format %d, %i, %o, %u, %x", "[string][printf]") REQUIRE(test("-001", "%04i", -1) ); REQUIRE(test("+001", "%+04i", 1) ); - if (BX_ENABLED(BX_ARCH_32BIT) ) + if (sizeof(intmax_t) == 4) { REQUIRE(test("2147483647", "%jd", INTMAX_MAX) ); } @@ -243,6 +310,10 @@ TEST_CASE("Format modifiers", "[string][printf]") REQUIRE(test("|1 |", "|%-10.0f|", 1.0f) ); REQUIRE(test("|1. |", "|%#-10.0f|", 1.0f) ); REQUIRE(test("|+1. |", "|%+#-10.0f|", 1.0f) ); + + REQUIRE(test("| 00013: -00089|", "|%10.5d:%10.5d|", 13, -89) ); + REQUIRE(test("| -00013: +00089|", "|%10.5d:%+10.5d|", -13, 89) ); + REQUIRE(test("| -00013: -00089|", "|%10.5d:%10.5d|", -13, -89) ); } TEST_CASE("Format %p", "[string][printf]") @@ -258,11 +329,18 @@ TEST_CASE("Format %s", "[string][printf]") TEST_CASE("Format %td", "[string][printf]") { - size_t size = size_t(-1); + ptrdiff_t size = ptrdiff_t(-1); REQUIRE(test("-1", "%td", size) ); - REQUIRE(test("3221225472", "%td", size_t(3221225472) ) ); + if (4 == sizeof(ptrdiff_t) ) + { + REQUIRE(test("-1073741824", "%td", ptrdiff_t(3221225472) ) ); + } + else + { + REQUIRE(test("3221225472", "%td", ptrdiff_t(3221225472) ) ); + } } TEST_CASE("Format %n", "[string][printf]") @@ -293,13 +371,14 @@ TEST_CASE("Format %c, %s, %S", "[string][printf]") REQUIRE(test("x ", "%-20c", 'x') ); REQUIRE(test("hello ", "%-20s", "hello") ); + REQUIRE(test(" hello", "%10s", "hello") ); REQUIRE(test("hello, world!", "%s, %s!", "hello", "world") ); - REQUIRE(test("h", "%1s", "hello") ); - REQUIRE(test("he", "%2s", "hello") ); - REQUIRE(test("hel", "%3s", "hello") ); - REQUIRE(test("hell", "%4s", "hello") ); - REQUIRE(test("hello", "%5s", "hello") ); + REQUIRE(testNotStdCompliant("h", "%1s", "hello") ); + REQUIRE(testNotStdCompliant("he", "%2s", "hello") ); + REQUIRE(testNotStdCompliant("hel", "%3s", "hello") ); + REQUIRE(testNotStdCompliant("hell", "%4s", "hello") ); + REQUIRE(testNotStdCompliant("hello", "%5s", "hello") ); bx::StringView str("0hello1world2"); bx::StringView hello(str, 1, 5); @@ -309,7 +388,7 @@ TEST_CASE("Format %c, %s, %S", "[string][printf]") , world.getLength(), world.getPtr() ) ); - REQUIRE(test("hello, world!", "%S, %S!" + REQUIRE(testNotStdCompliant("hello, world!", "%S, %S!" , &hello , &world ) ); diff --git a/bx/tools/bin/darwin/genie b/bx/tools/bin/darwin/genie index fa4b1adb..669650ed 100755 Binary files a/bx/tools/bin/darwin/genie and b/bx/tools/bin/darwin/genie differ diff --git a/bx/tools/bin/darwin/lemon b/bx/tools/bin/darwin/lemon deleted file mode 100755 index c00a276b..00000000 Binary files a/bx/tools/bin/darwin/lemon and /dev/null differ diff --git a/bx/tools/bin/darwin/lempar.c b/bx/tools/bin/darwin/lempar.c deleted file mode 100644 index 5e2024ff..00000000 --- a/bx/tools/bin/darwin/lempar.c +++ /dev/null @@ -1,981 +0,0 @@ -/* -** 2000-05-29 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Driver template for the LEMON parser generator. -** -** The "lemon" program processes an LALR(1) input grammar file, then uses -** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the -** interstitial "-" characters) contained in this template is changed into -** the value of the %name directive from the grammar. Otherwise, the content -** of this template is copied straight through into the generate parser -** source file. -** -** The following is the concatenation of all %include directives from the -** input grammar file: -*/ -#include -/************ Begin %include sections from the grammar ************************/ -%% -/**************** End of %include directives **********************************/ -/* These constants specify the various numeric values for terminal symbols -** in a format understandable to "makeheaders". This section is blank unless -** "lemon" is run with the "-m" command-line option. -***************** Begin makeheaders token definitions *************************/ -%% -/**************** End makeheaders token definitions ***************************/ - -/* The next sections is a series of control #defines. -** various aspects of the generated parser. -** YYCODETYPE is the data type used to store the integer codes -** that represent terminal and non-terminal symbols. -** "unsigned char" is used if there are fewer than -** 256 symbols. Larger types otherwise. -** YYNOCODE is a number of type YYCODETYPE that is not used for -** any terminal or nonterminal symbol. -** YYFALLBACK If defined, this indicates that one or more tokens -** (also known as: "terminal symbols") have fall-back -** values which should be used if the original symbol -** would not parse. This permits keywords to sometimes -** be used as identifiers, for example. -** YYACTIONTYPE is the data type used for "action codes" - numbers -** that indicate what to do in response to the next -** token. -** ParseTOKENTYPE is the data type used for minor type for terminal -** symbols. Background: A "minor type" is a semantic -** value associated with a terminal or non-terminal -** symbols. For example, for an "ID" terminal symbol, -** the minor type might be the name of the identifier. -** Each non-terminal can have a different minor type. -** Terminal symbols all have the same minor type, though. -** This macros defines the minor type for terminal -** symbols. -** YYMINORTYPE is the data type used for all minor types. -** This is typically a union of many types, one of -** which is ParseTOKENTYPE. The entry in the union -** for terminal symbols is called "yy0". -** YYSTACKDEPTH is the maximum depth of the parser's stack. If -** zero the stack is dynamically sized using realloc() -** ParseARG_SDECL A static variable declaration for the %extra_argument -** ParseARG_PDECL A parameter declaration for the %extra_argument -** ParseARG_STORE Code to store %extra_argument into yypParser -** ParseARG_FETCH Code to extract %extra_argument from yypParser -** YYERRORSYMBOL is the code number of the error symbol. If not -** defined, then do no error processing. -** YYNSTATE the combined number of states. -** YYNRULE the number of rules in the grammar -** YY_MAX_SHIFT Maximum value for shift actions -** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions -** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions -** YY_MIN_REDUCE Minimum value for reduce actions -** YY_MAX_REDUCE Maximum value for reduce actions -** YY_ERROR_ACTION The yy_action[] code for syntax error -** YY_ACCEPT_ACTION The yy_action[] code for accept -** YY_NO_ACTION The yy_action[] code for no-op -*/ -#ifndef INTERFACE -# define INTERFACE 1 -#endif -/************* Begin control #defines *****************************************/ -%% -/************* End control #defines *******************************************/ - -/* Define the yytestcase() macro to be a no-op if is not already defined -** otherwise. -** -** Applications can choose to define yytestcase() in the %include section -** to a macro that can assist in verifying code coverage. For production -** code the yytestcase() macro should be turned off. But it is useful -** for testing. -*/ -#ifndef yytestcase -# define yytestcase(X) -#endif - - -/* Next are the tables used to determine what action to take based on the -** current state and lookahead token. These tables are used to implement -** functions that take a state number and lookahead value and return an -** action integer. -** -** Suppose the action integer is N. Then the action is determined as -** follows -** -** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead -** token onto the stack and goto state N. -** -** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then -** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE. -** -** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE -** and YY_MAX_REDUCE -** -** N == YY_ERROR_ACTION A syntax error has occurred. -** -** N == YY_ACCEPT_ACTION The parser accepts its input. -** -** N == YY_NO_ACTION No such action. Denotes unused -** slots in the yy_action[] table. -** -** The action table is constructed as a single large table named yy_action[]. -** Given state S and lookahead X, the action is computed as either: -** -** (A) N = yy_action[ yy_shift_ofst[S] + X ] -** (B) N = yy_default[S] -** -** The (A) formula is preferred. The B formula is used instead if: -** (1) The yy_shift_ofst[S]+X value is out of range, or -** (2) yy_lookahead[yy_shift_ofst[S]+X] is not equal to X, or -** (3) yy_shift_ofst[S] equal YY_SHIFT_USE_DFLT. -** (Implementation note: YY_SHIFT_USE_DFLT is chosen so that -** YY_SHIFT_USE_DFLT+X will be out of range for all possible lookaheads X. -** Hence only tests (1) and (2) need to be evaluated.) -** -** The formulas above are for computing the action when the lookahead is -** a terminal symbol. If the lookahead is a non-terminal (as occurs after -** a reduce action) then the yy_reduce_ofst[] array is used in place of -** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of -** YY_SHIFT_USE_DFLT. -** -** The following are the tables generated in this section: -** -** yy_action[] A single table containing all actions. -** yy_lookahead[] A table containing the lookahead for each entry in -** yy_action. Used to detect hash collisions. -** yy_shift_ofst[] For each state, the offset into yy_action for -** shifting terminals. -** yy_reduce_ofst[] For each state, the offset into yy_action for -** shifting non-terminals after a reduce. -** yy_default[] Default action for each state. -** -*********** Begin parsing tables **********************************************/ -%% -/********** End of lemon-generated parsing tables *****************************/ - -/* The next table maps tokens (terminal symbols) into fallback tokens. -** If a construct like the following: -** -** %fallback ID X Y Z. -** -** appears in the grammar, then ID becomes a fallback token for X, Y, -** and Z. Whenever one of the tokens X, Y, or Z is input to the parser -** but it does not parse, the type of the token is changed to ID and -** the parse is retried before an error is thrown. -** -** This feature can be used, for example, to cause some keywords in a language -** to revert to identifiers if they keyword does not apply in the context where -** it appears. -*/ -#ifdef YYFALLBACK -static const YYCODETYPE yyFallback[] = { -%% -}; -#endif /* YYFALLBACK */ - -/* The following structure represents a single element of the -** parser's stack. Information stored includes: -** -** + The state number for the parser at this level of the stack. -** -** + The value of the token stored at this level of the stack. -** (In other words, the "major" token.) -** -** + The semantic value stored at this level of the stack. This is -** the information used by the action routines in the grammar. -** It is sometimes called the "minor" token. -** -** After the "shift" half of a SHIFTREDUCE action, the stateno field -** actually contains the reduce action for the second half of the -** SHIFTREDUCE. -*/ -struct yyStackEntry { - YYACTIONTYPE stateno; /* The state-number, or reduce action in SHIFTREDUCE */ - YYCODETYPE major; /* The major token value. This is the code - ** number for the token at this stack level */ - YYMINORTYPE minor; /* The user-supplied minor token value. This - ** is the value of the token */ -}; -typedef struct yyStackEntry yyStackEntry; - -/* The state of the parser is completely contained in an instance of -** the following structure */ -struct yyParser { - yyStackEntry *yytos; /* Pointer to top element of the stack */ -#ifdef YYTRACKMAXSTACKDEPTH - int yyhwm; /* High-water mark of the stack */ -#endif -#ifndef YYNOERRORRECOVERY - int yyerrcnt; /* Shifts left before out of the error */ -#endif - ParseARG_SDECL /* A place to hold %extra_argument */ -#if YYSTACKDEPTH<=0 - int yystksz; /* Current side of the stack */ - yyStackEntry *yystack; /* The parser's stack */ - yyStackEntry yystk0; /* First stack entry */ -#else - yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ - yyStackEntry *yystackEnd; /* Last entry in the stack */ -#endif -}; -typedef struct yyParser yyParser; - -#ifndef NDEBUG -#include -static FILE *yyTraceFILE = 0; -static char *yyTracePrompt = 0; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* -** Turn parser tracing on by giving a stream to which to write the trace -** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL -** -** Inputs: -**

    -**
  • A FILE* to which trace output should be written. -** If NULL, then tracing is turned off. -**
  • A prefix string written at the beginning of every -** line of trace output. If NULL, then tracing is -** turned off. -**
-** -** Outputs: -** None. -*/ -void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ - yyTraceFILE = TraceFILE; - yyTracePrompt = zTracePrompt; - if( yyTraceFILE==0 ) yyTracePrompt = 0; - else if( yyTracePrompt==0 ) yyTraceFILE = 0; -} -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing shifts, the names of all terminals and nonterminals -** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { -%% -}; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing reduce actions, the names of all rules are required. -*/ -static const char *const yyRuleName[] = { -%% -}; -#endif /* NDEBUG */ - - -#if YYSTACKDEPTH<=0 -/* -** Try to increase the size of the parser stack. Return the number -** of errors. Return 0 on success. -*/ -static int yyGrowStack(yyParser *p){ - int newSize; - int idx; - yyStackEntry *pNew; - - newSize = p->yystksz*2 + 100; - idx = p->yytos ? (int)(p->yytos - p->yystack) : 0; - if( p->yystack==&p->yystk0 ){ - pNew = malloc(newSize*sizeof(pNew[0])); - if( pNew ) pNew[0] = p->yystk0; - }else{ - pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); - } - if( pNew ){ - p->yystack = pNew; - p->yytos = &p->yystack[idx]; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", - yyTracePrompt, p->yystksz, newSize); - } -#endif - p->yystksz = newSize; - } - return pNew==0; -} -#endif - -/* Datatype of the argument to the memory allocated passed as the -** second argument to ParseAlloc() below. This can be changed by -** putting an appropriate #define in the %include section of the input -** grammar. -*/ -#ifndef YYMALLOCARGTYPE -# define YYMALLOCARGTYPE size_t -#endif - -/* Initialize a new parser that has already been allocated. -*/ -void ParseInit(void *yypParser){ - yyParser *pParser = (yyParser*)yypParser; -#ifdef YYTRACKMAXSTACKDEPTH - pParser->yyhwm = 0; -#endif -#if YYSTACKDEPTH<=0 - pParser->yytos = NULL; - pParser->yystack = NULL; - pParser->yystksz = 0; - if( yyGrowStack(pParser) ){ - pParser->yystack = &pParser->yystk0; - pParser->yystksz = 1; - } -#endif -#ifndef YYNOERRORRECOVERY - pParser->yyerrcnt = -1; -#endif - pParser->yytos = pParser->yystack; - pParser->yystack[0].stateno = 0; - pParser->yystack[0].major = 0; -#if YYSTACKDEPTH>0 - pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1]; -#endif -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** This function allocates a new parser. -** The only argument is a pointer to a function which works like -** malloc. -** -** Inputs: -** A pointer to the function used to allocate memory. -** -** Outputs: -** A pointer to a parser. This pointer is used in subsequent calls -** to Parse and ParseFree. -*/ -void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); - if( pParser ) ParseInit(pParser); - return pParser; -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - - -/* The following function deletes the "minor type" or semantic value -** associated with a symbol. The symbol can be either a terminal -** or nonterminal. "yymajor" is the symbol code, and "yypminor" is -** a pointer to the value to be deleted. The code used to do the -** deletions is derived from the %destructor and/or %token_destructor -** directives of the input grammar. -*/ -static void yy_destructor( - yyParser *yypParser, /* The parser */ - YYCODETYPE yymajor, /* Type code for object to destroy */ - YYMINORTYPE *yypminor /* The object to be destroyed */ -){ - ParseARG_FETCH; - switch( yymajor ){ - /* Here is inserted the actions which take place when a - ** terminal or non-terminal is destroyed. This can happen - ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is - ** being destroyed before it is finished parsing. - ** - ** Note: during a reduce, the only symbols destroyed are those - ** which appear on the RHS of the rule, but which are *not* used - ** inside the C code. - */ -/********* Begin destructor definitions ***************************************/ -%% -/********* End destructor definitions *****************************************/ - default: break; /* If no destructor action specified: do nothing */ - } -} - -/* -** Pop the parser's stack once. -** -** If there is a destructor routine associated with the token which -** is popped from the stack, then call it. -*/ -static void yy_pop_parser_stack(yyParser *pParser){ - yyStackEntry *yytos; - assert( pParser->yytos!=0 ); - assert( pParser->yytos > pParser->yystack ); - yytos = pParser->yytos--; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sPopping %s\n", - yyTracePrompt, - yyTokenName[yytos->major]); - } -#endif - yy_destructor(pParser, yytos->major, &yytos->minor); -} - -/* -** Clear all secondary memory allocations from the parser -*/ -void ParseFinalize(void *p){ - yyParser *pParser = (yyParser*)p; - while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser); -#if YYSTACKDEPTH<=0 - if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack); -#endif -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** Deallocate and destroy a parser. Destructors are called for -** all stack elements before shutting the parser down. -** -** If the YYPARSEFREENEVERNULL macro exists (for example because it -** is defined in a %include section of the input grammar) then it is -** assumed that the input pointer is never NULL. -*/ -void ParseFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ -){ -#ifndef YYPARSEFREENEVERNULL - if( p==0 ) return; -#endif - ParseFinalize(p); - (*freeProc)(p); -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - -/* -** Return the peak depth of the stack for a parser. -*/ -#ifdef YYTRACKMAXSTACKDEPTH -int ParseStackPeak(void *p){ - yyParser *pParser = (yyParser*)p; - return pParser->yyhwm; -} -#endif - -/* -** Find the appropriate action for a parser given the terminal -** look-ahead token iLookAhead. -*/ -static unsigned int yy_find_shift_action( - yyParser *pParser, /* The parser */ - YYCODETYPE iLookAhead /* The look-ahead token */ -){ - int i; - int stateno = pParser->yytos->stateno; - - if( stateno>=YY_MIN_REDUCE ) return stateno; - assert( stateno <= YY_SHIFT_COUNT ); - do{ - i = yy_shift_ofst[stateno]; - assert( iLookAhead!=YYNOCODE ); - i += iLookAhead; - if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ -#ifdef YYFALLBACK - YYCODETYPE iFallback; /* Fallback token */ - if( iLookAhead %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); - } -#endif - assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ - iLookAhead = iFallback; - continue; - } -#endif -#ifdef YYWILDCARD - { - int j = i - iLookAhead + YYWILDCARD; - if( -#if YY_SHIFT_MIN+YYWILDCARD<0 - j>=0 && -#endif -#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT - j0 - ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], - yyTokenName[YYWILDCARD]); - } -#endif /* NDEBUG */ - return yy_action[j]; - } - } -#endif /* YYWILDCARD */ - return yy_default[stateno]; - }else{ - return yy_action[i]; - } - }while(1); -} - -/* -** Find the appropriate action for a parser given the non-terminal -** look-ahead token iLookAhead. -*/ -static int yy_find_reduce_action( - int stateno, /* Current state number */ - YYCODETYPE iLookAhead /* The look-ahead token */ -){ - int i; -#ifdef YYERRORSYMBOL - if( stateno>YY_REDUCE_COUNT ){ - return yy_default[stateno]; - } -#else - assert( stateno<=YY_REDUCE_COUNT ); -#endif - i = yy_reduce_ofst[stateno]; - assert( i!=YY_REDUCE_USE_DFLT ); - assert( iLookAhead!=YYNOCODE ); - i += iLookAhead; -#ifdef YYERRORSYMBOL - if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ - return yy_default[stateno]; - } -#else - assert( i>=0 && iyytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will execute if the parser - ** stack every overflows */ -/******** Begin %stack_overflow code ******************************************/ -%% -/******** End %stack_overflow code ********************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ -} - -/* -** Print tracing information for a SHIFT action -*/ -#ifndef NDEBUG -static void yyTraceShift(yyParser *yypParser, int yyNewState){ - if( yyTraceFILE ){ - if( yyNewStateyytos->major], - yyNewState); - }else{ - fprintf(yyTraceFILE,"%sShift '%s'\n", - yyTracePrompt,yyTokenName[yypParser->yytos->major]); - } - } -} -#else -# define yyTraceShift(X,Y) -#endif - -/* -** Perform a shift action. -*/ -static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ - int yyNewState, /* The new state to shift in */ - int yyMajor, /* The major token to shift in */ - ParseTOKENTYPE yyMinor /* The minor token to shift in */ -){ - yyStackEntry *yytos; - yypParser->yytos++; -#ifdef YYTRACKMAXSTACKDEPTH - if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) ); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>yypParser->yystackEnd ){ - yypParser->yytos--; - yyStackOverflow(yypParser); - return; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){ - if( yyGrowStack(yypParser) ){ - yypParser->yytos--; - yyStackOverflow(yypParser); - return; - } - } -#endif - if( yyNewState > YY_MAX_SHIFT ){ - yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; - } - yytos = yypParser->yytos; - yytos->stateno = (YYACTIONTYPE)yyNewState; - yytos->major = (YYCODETYPE)yyMajor; - yytos->minor.yy0 = yyMinor; - yyTraceShift(yypParser, yyNewState); -} - -/* The following table contains information about every rule that -** is used during the reduce. -*/ -static const struct { - YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ - signed char nrhs; /* Negative of the number of RHS symbols in the rule */ -} yyRuleInfo[] = { -%% -}; - -static void yy_accept(yyParser*); /* Forward Declaration */ - -/* -** Perform a reduce action and the shift that must immediately -** follow the reduce. -** -** The yyLookahead and yyLookaheadToken parameters provide reduce actions -** access to the lookahead token (if any). The yyLookahead will be YYNOCODE -** if the lookahead token has already been consumed. As this procedure is -** only called from one place, optimizing compilers will in-line it, which -** means that the extra parameters have no performance impact. -*/ -static void yy_reduce( - yyParser *yypParser, /* The parser */ - unsigned int yyruleno, /* Number of the rule by which to reduce */ - int yyLookahead, /* Lookahead token, or YYNOCODE if none */ - ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ -){ - int yygoto; /* The next state */ - int yyact; /* The next action */ - yyStackEntry *yymsp; /* The top of the parser's stack */ - int yysize; /* Amount to pop the stack */ - ParseARG_FETCH; - yymsp = yypParser->yytos; -#ifndef NDEBUG - if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfo[yyruleno].nrhs; - fprintf(yyTraceFILE, "%sReduce [%s], go to state %d.\n", yyTracePrompt, - yyRuleName[yyruleno], yymsp[yysize].stateno); - } -#endif /* NDEBUG */ - - /* Check that the stack is large enough to grow by a single entry - ** if the RHS of the rule is empty. This ensures that there is room - ** enough on the stack to push the LHS value */ - if( yyRuleInfo[yyruleno].nrhs==0 ){ -#ifdef YYTRACKMAXSTACKDEPTH - if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>=yypParser->yystackEnd ){ - yyStackOverflow(yypParser); - return; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ - if( yyGrowStack(yypParser) ){ - yyStackOverflow(yypParser); - return; - } - yymsp = yypParser->yytos; - } -#endif - } - - switch( yyruleno ){ - /* Beginning here are the reduction cases. A typical example - ** follows: - ** case 0: - ** #line - ** { ... } // User supplied code - ** #line - ** break; - */ -/********** Begin reduce actions **********************************************/ -%% -/********** End reduce actions ************************************************/ - }; - assert( yyrulenoYY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) ); - - /* It is not possible for a REDUCE to be followed by an error */ - assert( yyact!=YY_ERROR_ACTION ); - - if( yyact==YY_ACCEPT_ACTION ){ - yypParser->yytos += yysize; - yy_accept(yypParser); - }else{ - yymsp += yysize+1; - yypParser->yytos = yymsp; - yymsp->stateno = (YYACTIONTYPE)yyact; - yymsp->major = (YYCODETYPE)yygoto; - yyTraceShift(yypParser, yyact); - } -} - -/* -** The following code executes when the parse fails -*/ -#ifndef YYNOERRORRECOVERY -static void yy_parse_failed( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); - } -#endif - while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser fails */ -/************ Begin %parse_failure code ***************************************/ -%% -/************ End %parse_failure code *****************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} -#endif /* YYNOERRORRECOVERY */ - -/* -** The following code executes when a syntax error first occurs. -*/ -static void yy_syntax_error( - yyParser *yypParser, /* The parser */ - int yymajor, /* The major type of the error token */ - ParseTOKENTYPE yyminor /* The minor type of the error token */ -){ - ParseARG_FETCH; -#define TOKEN yyminor -/************ Begin %syntax_error code ****************************************/ -%% -/************ End %syntax_error code ******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following is executed when the parser accepts -*/ -static void yy_accept( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); - } -#endif -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - assert( yypParser->yytos==yypParser->yystack ); - /* Here code is inserted which will be executed whenever the - ** parser accepts */ -/*********** Begin %parse_accept code *****************************************/ -%% -/*********** End %parse_accept code *******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* The main parser program. -** The first argument is a pointer to a structure obtained from -** "ParseAlloc" which describes the current state of the parser. -** The second argument is the major token number. The third is -** the minor token. The fourth optional argument is whatever the -** user wants (and specified in the grammar) and is available for -** use by the action routines. -** -** Inputs: -**
    -**
  • A pointer to the parser (an opaque structure.) -**
  • The major token number. -**
  • The minor token number. -**
  • An option argument of a grammar-specified type. -**
-** -** Outputs: -** None. -*/ -void Parse( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - ParseTOKENTYPE yyminor /* The value for the token */ - ParseARG_PDECL /* Optional %extra_argument parameter */ -){ - YYMINORTYPE yyminorunion; - unsigned int yyact; /* The parser action. */ -#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) - int yyendofinput; /* True if we are at the end of input */ -#endif -#ifdef YYERRORSYMBOL - int yyerrorhit = 0; /* True if yymajor has invoked an error */ -#endif - yyParser *yypParser; /* The parser */ - - yypParser = (yyParser*)yyp; - assert( yypParser->yytos!=0 ); -#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) - yyendofinput = (yymajor==0); -#endif - ParseARG_STORE; - -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sInput '%s'\n",yyTracePrompt,yyTokenName[yymajor]); - } -#endif - - do{ - yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); - if( yyact <= YY_MAX_SHIFTREDUCE ){ - yy_shift(yypParser,yyact,yymajor,yyminor); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt--; -#endif - yymajor = YYNOCODE; - }else if( yyact <= YY_MAX_REDUCE ){ - yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor); - }else{ - assert( yyact == YY_ERROR_ACTION ); - yyminorunion.yy0 = yyminor; -#ifdef YYERRORSYMBOL - int yymx; -#endif -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); - } -#endif -#ifdef YYERRORSYMBOL - /* A syntax error has occurred. - ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". - ** - ** This is what we do if the grammar does define ERROR: - ** - ** * Call the %syntax_error function. - ** - ** * Begin popping the stack until we enter a state where - ** it is legal to shift the error symbol, then shift - ** the error symbol. - ** - ** * Set the error count to three. - ** - ** * Begin accepting and shifting new tokens. No new error - ** processing will occur until three tokens have been - ** shifted successfully. - ** - */ - if( yypParser->yyerrcnt<0 ){ - yy_syntax_error(yypParser,yymajor,yyminor); - } - yymx = yypParser->yytos->major; - if( yymx==YYERRORSYMBOL || yyerrorhit ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sDiscard input token %s\n", - yyTracePrompt,yyTokenName[yymajor]); - } -#endif - yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); - yymajor = YYNOCODE; - }else{ - while( yypParser->yytos >= yypParser->yystack - && yymx != YYERRORSYMBOL - && (yyact = yy_find_reduce_action( - yypParser->yytos->stateno, - YYERRORSYMBOL)) >= YY_MIN_REDUCE - ){ - yy_pop_parser_stack(yypParser); - } - if( yypParser->yytos < yypParser->yystack || yymajor==0 ){ - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yy_parse_failed(yypParser); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - yymajor = YYNOCODE; - }else if( yymx!=YYERRORSYMBOL ){ - yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor); - } - } - yypParser->yyerrcnt = 3; - yyerrorhit = 1; -#elif defined(YYNOERRORRECOVERY) - /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to - ** do any kind of error recovery. Instead, simply invoke the syntax - ** error routine and continue going as if nothing had happened. - ** - ** Applications can set this macro (for example inside %include) if - ** they intend to abandon the parse upon the first syntax error seen. - */ - yy_syntax_error(yypParser,yymajor, yyminor); - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yymajor = YYNOCODE; - -#else /* YYERRORSYMBOL is not defined */ - /* This is what we do if the grammar does not define ERROR: - ** - ** * Report an error message, and throw away the input token. - ** - ** * If the input token is $, then fail the parse. - ** - ** As before, subsequent error messages are suppressed until - ** three input tokens have been successfully shifted. - */ - if( yypParser->yyerrcnt<=0 ){ - yy_syntax_error(yypParser,yymajor, yyminor); - } - yypParser->yyerrcnt = 3; - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - if( yyendofinput ){ - yy_parse_failed(yypParser); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - } - yymajor = YYNOCODE; -#endif - } - }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack ); -#ifndef NDEBUG - if( yyTraceFILE ){ - yyStackEntry *i; - char cDiv = '['; - fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt); - for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){ - fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]); - cDiv = ' '; - } - fprintf(yyTraceFILE,"]\n"); - } -#endif - return; -} diff --git a/bx/tools/bin/linux/genie b/bx/tools/bin/linux/genie index 3bac17e9..27e007e8 100755 Binary files a/bx/tools/bin/linux/genie and b/bx/tools/bin/linux/genie differ diff --git a/bx/tools/bin/linux/lemon b/bx/tools/bin/linux/lemon deleted file mode 100755 index 6c5e3bdc..00000000 Binary files a/bx/tools/bin/linux/lemon and /dev/null differ diff --git a/bx/tools/bin/linux/lempar.c b/bx/tools/bin/linux/lempar.c deleted file mode 100644 index 5e2024ff..00000000 --- a/bx/tools/bin/linux/lempar.c +++ /dev/null @@ -1,981 +0,0 @@ -/* -** 2000-05-29 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Driver template for the LEMON parser generator. -** -** The "lemon" program processes an LALR(1) input grammar file, then uses -** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the -** interstitial "-" characters) contained in this template is changed into -** the value of the %name directive from the grammar. Otherwise, the content -** of this template is copied straight through into the generate parser -** source file. -** -** The following is the concatenation of all %include directives from the -** input grammar file: -*/ -#include -/************ Begin %include sections from the grammar ************************/ -%% -/**************** End of %include directives **********************************/ -/* These constants specify the various numeric values for terminal symbols -** in a format understandable to "makeheaders". This section is blank unless -** "lemon" is run with the "-m" command-line option. -***************** Begin makeheaders token definitions *************************/ -%% -/**************** End makeheaders token definitions ***************************/ - -/* The next sections is a series of control #defines. -** various aspects of the generated parser. -** YYCODETYPE is the data type used to store the integer codes -** that represent terminal and non-terminal symbols. -** "unsigned char" is used if there are fewer than -** 256 symbols. Larger types otherwise. -** YYNOCODE is a number of type YYCODETYPE that is not used for -** any terminal or nonterminal symbol. -** YYFALLBACK If defined, this indicates that one or more tokens -** (also known as: "terminal symbols") have fall-back -** values which should be used if the original symbol -** would not parse. This permits keywords to sometimes -** be used as identifiers, for example. -** YYACTIONTYPE is the data type used for "action codes" - numbers -** that indicate what to do in response to the next -** token. -** ParseTOKENTYPE is the data type used for minor type for terminal -** symbols. Background: A "minor type" is a semantic -** value associated with a terminal or non-terminal -** symbols. For example, for an "ID" terminal symbol, -** the minor type might be the name of the identifier. -** Each non-terminal can have a different minor type. -** Terminal symbols all have the same minor type, though. -** This macros defines the minor type for terminal -** symbols. -** YYMINORTYPE is the data type used for all minor types. -** This is typically a union of many types, one of -** which is ParseTOKENTYPE. The entry in the union -** for terminal symbols is called "yy0". -** YYSTACKDEPTH is the maximum depth of the parser's stack. If -** zero the stack is dynamically sized using realloc() -** ParseARG_SDECL A static variable declaration for the %extra_argument -** ParseARG_PDECL A parameter declaration for the %extra_argument -** ParseARG_STORE Code to store %extra_argument into yypParser -** ParseARG_FETCH Code to extract %extra_argument from yypParser -** YYERRORSYMBOL is the code number of the error symbol. If not -** defined, then do no error processing. -** YYNSTATE the combined number of states. -** YYNRULE the number of rules in the grammar -** YY_MAX_SHIFT Maximum value for shift actions -** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions -** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions -** YY_MIN_REDUCE Minimum value for reduce actions -** YY_MAX_REDUCE Maximum value for reduce actions -** YY_ERROR_ACTION The yy_action[] code for syntax error -** YY_ACCEPT_ACTION The yy_action[] code for accept -** YY_NO_ACTION The yy_action[] code for no-op -*/ -#ifndef INTERFACE -# define INTERFACE 1 -#endif -/************* Begin control #defines *****************************************/ -%% -/************* End control #defines *******************************************/ - -/* Define the yytestcase() macro to be a no-op if is not already defined -** otherwise. -** -** Applications can choose to define yytestcase() in the %include section -** to a macro that can assist in verifying code coverage. For production -** code the yytestcase() macro should be turned off. But it is useful -** for testing. -*/ -#ifndef yytestcase -# define yytestcase(X) -#endif - - -/* Next are the tables used to determine what action to take based on the -** current state and lookahead token. These tables are used to implement -** functions that take a state number and lookahead value and return an -** action integer. -** -** Suppose the action integer is N. Then the action is determined as -** follows -** -** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead -** token onto the stack and goto state N. -** -** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then -** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE. -** -** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE -** and YY_MAX_REDUCE -** -** N == YY_ERROR_ACTION A syntax error has occurred. -** -** N == YY_ACCEPT_ACTION The parser accepts its input. -** -** N == YY_NO_ACTION No such action. Denotes unused -** slots in the yy_action[] table. -** -** The action table is constructed as a single large table named yy_action[]. -** Given state S and lookahead X, the action is computed as either: -** -** (A) N = yy_action[ yy_shift_ofst[S] + X ] -** (B) N = yy_default[S] -** -** The (A) formula is preferred. The B formula is used instead if: -** (1) The yy_shift_ofst[S]+X value is out of range, or -** (2) yy_lookahead[yy_shift_ofst[S]+X] is not equal to X, or -** (3) yy_shift_ofst[S] equal YY_SHIFT_USE_DFLT. -** (Implementation note: YY_SHIFT_USE_DFLT is chosen so that -** YY_SHIFT_USE_DFLT+X will be out of range for all possible lookaheads X. -** Hence only tests (1) and (2) need to be evaluated.) -** -** The formulas above are for computing the action when the lookahead is -** a terminal symbol. If the lookahead is a non-terminal (as occurs after -** a reduce action) then the yy_reduce_ofst[] array is used in place of -** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of -** YY_SHIFT_USE_DFLT. -** -** The following are the tables generated in this section: -** -** yy_action[] A single table containing all actions. -** yy_lookahead[] A table containing the lookahead for each entry in -** yy_action. Used to detect hash collisions. -** yy_shift_ofst[] For each state, the offset into yy_action for -** shifting terminals. -** yy_reduce_ofst[] For each state, the offset into yy_action for -** shifting non-terminals after a reduce. -** yy_default[] Default action for each state. -** -*********** Begin parsing tables **********************************************/ -%% -/********** End of lemon-generated parsing tables *****************************/ - -/* The next table maps tokens (terminal symbols) into fallback tokens. -** If a construct like the following: -** -** %fallback ID X Y Z. -** -** appears in the grammar, then ID becomes a fallback token for X, Y, -** and Z. Whenever one of the tokens X, Y, or Z is input to the parser -** but it does not parse, the type of the token is changed to ID and -** the parse is retried before an error is thrown. -** -** This feature can be used, for example, to cause some keywords in a language -** to revert to identifiers if they keyword does not apply in the context where -** it appears. -*/ -#ifdef YYFALLBACK -static const YYCODETYPE yyFallback[] = { -%% -}; -#endif /* YYFALLBACK */ - -/* The following structure represents a single element of the -** parser's stack. Information stored includes: -** -** + The state number for the parser at this level of the stack. -** -** + The value of the token stored at this level of the stack. -** (In other words, the "major" token.) -** -** + The semantic value stored at this level of the stack. This is -** the information used by the action routines in the grammar. -** It is sometimes called the "minor" token. -** -** After the "shift" half of a SHIFTREDUCE action, the stateno field -** actually contains the reduce action for the second half of the -** SHIFTREDUCE. -*/ -struct yyStackEntry { - YYACTIONTYPE stateno; /* The state-number, or reduce action in SHIFTREDUCE */ - YYCODETYPE major; /* The major token value. This is the code - ** number for the token at this stack level */ - YYMINORTYPE minor; /* The user-supplied minor token value. This - ** is the value of the token */ -}; -typedef struct yyStackEntry yyStackEntry; - -/* The state of the parser is completely contained in an instance of -** the following structure */ -struct yyParser { - yyStackEntry *yytos; /* Pointer to top element of the stack */ -#ifdef YYTRACKMAXSTACKDEPTH - int yyhwm; /* High-water mark of the stack */ -#endif -#ifndef YYNOERRORRECOVERY - int yyerrcnt; /* Shifts left before out of the error */ -#endif - ParseARG_SDECL /* A place to hold %extra_argument */ -#if YYSTACKDEPTH<=0 - int yystksz; /* Current side of the stack */ - yyStackEntry *yystack; /* The parser's stack */ - yyStackEntry yystk0; /* First stack entry */ -#else - yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ - yyStackEntry *yystackEnd; /* Last entry in the stack */ -#endif -}; -typedef struct yyParser yyParser; - -#ifndef NDEBUG -#include -static FILE *yyTraceFILE = 0; -static char *yyTracePrompt = 0; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* -** Turn parser tracing on by giving a stream to which to write the trace -** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL -** -** Inputs: -**
    -**
  • A FILE* to which trace output should be written. -** If NULL, then tracing is turned off. -**
  • A prefix string written at the beginning of every -** line of trace output. If NULL, then tracing is -** turned off. -**
-** -** Outputs: -** None. -*/ -void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ - yyTraceFILE = TraceFILE; - yyTracePrompt = zTracePrompt; - if( yyTraceFILE==0 ) yyTracePrompt = 0; - else if( yyTracePrompt==0 ) yyTraceFILE = 0; -} -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing shifts, the names of all terminals and nonterminals -** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { -%% -}; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing reduce actions, the names of all rules are required. -*/ -static const char *const yyRuleName[] = { -%% -}; -#endif /* NDEBUG */ - - -#if YYSTACKDEPTH<=0 -/* -** Try to increase the size of the parser stack. Return the number -** of errors. Return 0 on success. -*/ -static int yyGrowStack(yyParser *p){ - int newSize; - int idx; - yyStackEntry *pNew; - - newSize = p->yystksz*2 + 100; - idx = p->yytos ? (int)(p->yytos - p->yystack) : 0; - if( p->yystack==&p->yystk0 ){ - pNew = malloc(newSize*sizeof(pNew[0])); - if( pNew ) pNew[0] = p->yystk0; - }else{ - pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); - } - if( pNew ){ - p->yystack = pNew; - p->yytos = &p->yystack[idx]; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", - yyTracePrompt, p->yystksz, newSize); - } -#endif - p->yystksz = newSize; - } - return pNew==0; -} -#endif - -/* Datatype of the argument to the memory allocated passed as the -** second argument to ParseAlloc() below. This can be changed by -** putting an appropriate #define in the %include section of the input -** grammar. -*/ -#ifndef YYMALLOCARGTYPE -# define YYMALLOCARGTYPE size_t -#endif - -/* Initialize a new parser that has already been allocated. -*/ -void ParseInit(void *yypParser){ - yyParser *pParser = (yyParser*)yypParser; -#ifdef YYTRACKMAXSTACKDEPTH - pParser->yyhwm = 0; -#endif -#if YYSTACKDEPTH<=0 - pParser->yytos = NULL; - pParser->yystack = NULL; - pParser->yystksz = 0; - if( yyGrowStack(pParser) ){ - pParser->yystack = &pParser->yystk0; - pParser->yystksz = 1; - } -#endif -#ifndef YYNOERRORRECOVERY - pParser->yyerrcnt = -1; -#endif - pParser->yytos = pParser->yystack; - pParser->yystack[0].stateno = 0; - pParser->yystack[0].major = 0; -#if YYSTACKDEPTH>0 - pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1]; -#endif -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** This function allocates a new parser. -** The only argument is a pointer to a function which works like -** malloc. -** -** Inputs: -** A pointer to the function used to allocate memory. -** -** Outputs: -** A pointer to a parser. This pointer is used in subsequent calls -** to Parse and ParseFree. -*/ -void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); - if( pParser ) ParseInit(pParser); - return pParser; -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - - -/* The following function deletes the "minor type" or semantic value -** associated with a symbol. The symbol can be either a terminal -** or nonterminal. "yymajor" is the symbol code, and "yypminor" is -** a pointer to the value to be deleted. The code used to do the -** deletions is derived from the %destructor and/or %token_destructor -** directives of the input grammar. -*/ -static void yy_destructor( - yyParser *yypParser, /* The parser */ - YYCODETYPE yymajor, /* Type code for object to destroy */ - YYMINORTYPE *yypminor /* The object to be destroyed */ -){ - ParseARG_FETCH; - switch( yymajor ){ - /* Here is inserted the actions which take place when a - ** terminal or non-terminal is destroyed. This can happen - ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is - ** being destroyed before it is finished parsing. - ** - ** Note: during a reduce, the only symbols destroyed are those - ** which appear on the RHS of the rule, but which are *not* used - ** inside the C code. - */ -/********* Begin destructor definitions ***************************************/ -%% -/********* End destructor definitions *****************************************/ - default: break; /* If no destructor action specified: do nothing */ - } -} - -/* -** Pop the parser's stack once. -** -** If there is a destructor routine associated with the token which -** is popped from the stack, then call it. -*/ -static void yy_pop_parser_stack(yyParser *pParser){ - yyStackEntry *yytos; - assert( pParser->yytos!=0 ); - assert( pParser->yytos > pParser->yystack ); - yytos = pParser->yytos--; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sPopping %s\n", - yyTracePrompt, - yyTokenName[yytos->major]); - } -#endif - yy_destructor(pParser, yytos->major, &yytos->minor); -} - -/* -** Clear all secondary memory allocations from the parser -*/ -void ParseFinalize(void *p){ - yyParser *pParser = (yyParser*)p; - while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser); -#if YYSTACKDEPTH<=0 - if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack); -#endif -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** Deallocate and destroy a parser. Destructors are called for -** all stack elements before shutting the parser down. -** -** If the YYPARSEFREENEVERNULL macro exists (for example because it -** is defined in a %include section of the input grammar) then it is -** assumed that the input pointer is never NULL. -*/ -void ParseFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ -){ -#ifndef YYPARSEFREENEVERNULL - if( p==0 ) return; -#endif - ParseFinalize(p); - (*freeProc)(p); -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - -/* -** Return the peak depth of the stack for a parser. -*/ -#ifdef YYTRACKMAXSTACKDEPTH -int ParseStackPeak(void *p){ - yyParser *pParser = (yyParser*)p; - return pParser->yyhwm; -} -#endif - -/* -** Find the appropriate action for a parser given the terminal -** look-ahead token iLookAhead. -*/ -static unsigned int yy_find_shift_action( - yyParser *pParser, /* The parser */ - YYCODETYPE iLookAhead /* The look-ahead token */ -){ - int i; - int stateno = pParser->yytos->stateno; - - if( stateno>=YY_MIN_REDUCE ) return stateno; - assert( stateno <= YY_SHIFT_COUNT ); - do{ - i = yy_shift_ofst[stateno]; - assert( iLookAhead!=YYNOCODE ); - i += iLookAhead; - if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ -#ifdef YYFALLBACK - YYCODETYPE iFallback; /* Fallback token */ - if( iLookAhead %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); - } -#endif - assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ - iLookAhead = iFallback; - continue; - } -#endif -#ifdef YYWILDCARD - { - int j = i - iLookAhead + YYWILDCARD; - if( -#if YY_SHIFT_MIN+YYWILDCARD<0 - j>=0 && -#endif -#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT - j0 - ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], - yyTokenName[YYWILDCARD]); - } -#endif /* NDEBUG */ - return yy_action[j]; - } - } -#endif /* YYWILDCARD */ - return yy_default[stateno]; - }else{ - return yy_action[i]; - } - }while(1); -} - -/* -** Find the appropriate action for a parser given the non-terminal -** look-ahead token iLookAhead. -*/ -static int yy_find_reduce_action( - int stateno, /* Current state number */ - YYCODETYPE iLookAhead /* The look-ahead token */ -){ - int i; -#ifdef YYERRORSYMBOL - if( stateno>YY_REDUCE_COUNT ){ - return yy_default[stateno]; - } -#else - assert( stateno<=YY_REDUCE_COUNT ); -#endif - i = yy_reduce_ofst[stateno]; - assert( i!=YY_REDUCE_USE_DFLT ); - assert( iLookAhead!=YYNOCODE ); - i += iLookAhead; -#ifdef YYERRORSYMBOL - if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ - return yy_default[stateno]; - } -#else - assert( i>=0 && iyytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will execute if the parser - ** stack every overflows */ -/******** Begin %stack_overflow code ******************************************/ -%% -/******** End %stack_overflow code ********************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ -} - -/* -** Print tracing information for a SHIFT action -*/ -#ifndef NDEBUG -static void yyTraceShift(yyParser *yypParser, int yyNewState){ - if( yyTraceFILE ){ - if( yyNewStateyytos->major], - yyNewState); - }else{ - fprintf(yyTraceFILE,"%sShift '%s'\n", - yyTracePrompt,yyTokenName[yypParser->yytos->major]); - } - } -} -#else -# define yyTraceShift(X,Y) -#endif - -/* -** Perform a shift action. -*/ -static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ - int yyNewState, /* The new state to shift in */ - int yyMajor, /* The major token to shift in */ - ParseTOKENTYPE yyMinor /* The minor token to shift in */ -){ - yyStackEntry *yytos; - yypParser->yytos++; -#ifdef YYTRACKMAXSTACKDEPTH - if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) ); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>yypParser->yystackEnd ){ - yypParser->yytos--; - yyStackOverflow(yypParser); - return; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){ - if( yyGrowStack(yypParser) ){ - yypParser->yytos--; - yyStackOverflow(yypParser); - return; - } - } -#endif - if( yyNewState > YY_MAX_SHIFT ){ - yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; - } - yytos = yypParser->yytos; - yytos->stateno = (YYACTIONTYPE)yyNewState; - yytos->major = (YYCODETYPE)yyMajor; - yytos->minor.yy0 = yyMinor; - yyTraceShift(yypParser, yyNewState); -} - -/* The following table contains information about every rule that -** is used during the reduce. -*/ -static const struct { - YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ - signed char nrhs; /* Negative of the number of RHS symbols in the rule */ -} yyRuleInfo[] = { -%% -}; - -static void yy_accept(yyParser*); /* Forward Declaration */ - -/* -** Perform a reduce action and the shift that must immediately -** follow the reduce. -** -** The yyLookahead and yyLookaheadToken parameters provide reduce actions -** access to the lookahead token (if any). The yyLookahead will be YYNOCODE -** if the lookahead token has already been consumed. As this procedure is -** only called from one place, optimizing compilers will in-line it, which -** means that the extra parameters have no performance impact. -*/ -static void yy_reduce( - yyParser *yypParser, /* The parser */ - unsigned int yyruleno, /* Number of the rule by which to reduce */ - int yyLookahead, /* Lookahead token, or YYNOCODE if none */ - ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ -){ - int yygoto; /* The next state */ - int yyact; /* The next action */ - yyStackEntry *yymsp; /* The top of the parser's stack */ - int yysize; /* Amount to pop the stack */ - ParseARG_FETCH; - yymsp = yypParser->yytos; -#ifndef NDEBUG - if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfo[yyruleno].nrhs; - fprintf(yyTraceFILE, "%sReduce [%s], go to state %d.\n", yyTracePrompt, - yyRuleName[yyruleno], yymsp[yysize].stateno); - } -#endif /* NDEBUG */ - - /* Check that the stack is large enough to grow by a single entry - ** if the RHS of the rule is empty. This ensures that there is room - ** enough on the stack to push the LHS value */ - if( yyRuleInfo[yyruleno].nrhs==0 ){ -#ifdef YYTRACKMAXSTACKDEPTH - if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>=yypParser->yystackEnd ){ - yyStackOverflow(yypParser); - return; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ - if( yyGrowStack(yypParser) ){ - yyStackOverflow(yypParser); - return; - } - yymsp = yypParser->yytos; - } -#endif - } - - switch( yyruleno ){ - /* Beginning here are the reduction cases. A typical example - ** follows: - ** case 0: - ** #line - ** { ... } // User supplied code - ** #line - ** break; - */ -/********** Begin reduce actions **********************************************/ -%% -/********** End reduce actions ************************************************/ - }; - assert( yyrulenoYY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) ); - - /* It is not possible for a REDUCE to be followed by an error */ - assert( yyact!=YY_ERROR_ACTION ); - - if( yyact==YY_ACCEPT_ACTION ){ - yypParser->yytos += yysize; - yy_accept(yypParser); - }else{ - yymsp += yysize+1; - yypParser->yytos = yymsp; - yymsp->stateno = (YYACTIONTYPE)yyact; - yymsp->major = (YYCODETYPE)yygoto; - yyTraceShift(yypParser, yyact); - } -} - -/* -** The following code executes when the parse fails -*/ -#ifndef YYNOERRORRECOVERY -static void yy_parse_failed( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); - } -#endif - while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser fails */ -/************ Begin %parse_failure code ***************************************/ -%% -/************ End %parse_failure code *****************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} -#endif /* YYNOERRORRECOVERY */ - -/* -** The following code executes when a syntax error first occurs. -*/ -static void yy_syntax_error( - yyParser *yypParser, /* The parser */ - int yymajor, /* The major type of the error token */ - ParseTOKENTYPE yyminor /* The minor type of the error token */ -){ - ParseARG_FETCH; -#define TOKEN yyminor -/************ Begin %syntax_error code ****************************************/ -%% -/************ End %syntax_error code ******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following is executed when the parser accepts -*/ -static void yy_accept( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); - } -#endif -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - assert( yypParser->yytos==yypParser->yystack ); - /* Here code is inserted which will be executed whenever the - ** parser accepts */ -/*********** Begin %parse_accept code *****************************************/ -%% -/*********** End %parse_accept code *******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* The main parser program. -** The first argument is a pointer to a structure obtained from -** "ParseAlloc" which describes the current state of the parser. -** The second argument is the major token number. The third is -** the minor token. The fourth optional argument is whatever the -** user wants (and specified in the grammar) and is available for -** use by the action routines. -** -** Inputs: -**
    -**
  • A pointer to the parser (an opaque structure.) -**
  • The major token number. -**
  • The minor token number. -**
  • An option argument of a grammar-specified type. -**
-** -** Outputs: -** None. -*/ -void Parse( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - ParseTOKENTYPE yyminor /* The value for the token */ - ParseARG_PDECL /* Optional %extra_argument parameter */ -){ - YYMINORTYPE yyminorunion; - unsigned int yyact; /* The parser action. */ -#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) - int yyendofinput; /* True if we are at the end of input */ -#endif -#ifdef YYERRORSYMBOL - int yyerrorhit = 0; /* True if yymajor has invoked an error */ -#endif - yyParser *yypParser; /* The parser */ - - yypParser = (yyParser*)yyp; - assert( yypParser->yytos!=0 ); -#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) - yyendofinput = (yymajor==0); -#endif - ParseARG_STORE; - -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sInput '%s'\n",yyTracePrompt,yyTokenName[yymajor]); - } -#endif - - do{ - yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); - if( yyact <= YY_MAX_SHIFTREDUCE ){ - yy_shift(yypParser,yyact,yymajor,yyminor); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt--; -#endif - yymajor = YYNOCODE; - }else if( yyact <= YY_MAX_REDUCE ){ - yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor); - }else{ - assert( yyact == YY_ERROR_ACTION ); - yyminorunion.yy0 = yyminor; -#ifdef YYERRORSYMBOL - int yymx; -#endif -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); - } -#endif -#ifdef YYERRORSYMBOL - /* A syntax error has occurred. - ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". - ** - ** This is what we do if the grammar does define ERROR: - ** - ** * Call the %syntax_error function. - ** - ** * Begin popping the stack until we enter a state where - ** it is legal to shift the error symbol, then shift - ** the error symbol. - ** - ** * Set the error count to three. - ** - ** * Begin accepting and shifting new tokens. No new error - ** processing will occur until three tokens have been - ** shifted successfully. - ** - */ - if( yypParser->yyerrcnt<0 ){ - yy_syntax_error(yypParser,yymajor,yyminor); - } - yymx = yypParser->yytos->major; - if( yymx==YYERRORSYMBOL || yyerrorhit ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sDiscard input token %s\n", - yyTracePrompt,yyTokenName[yymajor]); - } -#endif - yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); - yymajor = YYNOCODE; - }else{ - while( yypParser->yytos >= yypParser->yystack - && yymx != YYERRORSYMBOL - && (yyact = yy_find_reduce_action( - yypParser->yytos->stateno, - YYERRORSYMBOL)) >= YY_MIN_REDUCE - ){ - yy_pop_parser_stack(yypParser); - } - if( yypParser->yytos < yypParser->yystack || yymajor==0 ){ - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yy_parse_failed(yypParser); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - yymajor = YYNOCODE; - }else if( yymx!=YYERRORSYMBOL ){ - yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor); - } - } - yypParser->yyerrcnt = 3; - yyerrorhit = 1; -#elif defined(YYNOERRORRECOVERY) - /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to - ** do any kind of error recovery. Instead, simply invoke the syntax - ** error routine and continue going as if nothing had happened. - ** - ** Applications can set this macro (for example inside %include) if - ** they intend to abandon the parse upon the first syntax error seen. - */ - yy_syntax_error(yypParser,yymajor, yyminor); - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yymajor = YYNOCODE; - -#else /* YYERRORSYMBOL is not defined */ - /* This is what we do if the grammar does not define ERROR: - ** - ** * Report an error message, and throw away the input token. - ** - ** * If the input token is $, then fail the parse. - ** - ** As before, subsequent error messages are suppressed until - ** three input tokens have been successfully shifted. - */ - if( yypParser->yyerrcnt<=0 ){ - yy_syntax_error(yypParser,yymajor, yyminor); - } - yypParser->yyerrcnt = 3; - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - if( yyendofinput ){ - yy_parse_failed(yypParser); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - } - yymajor = YYNOCODE; -#endif - } - }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack ); -#ifndef NDEBUG - if( yyTraceFILE ){ - yyStackEntry *i; - char cDiv = '['; - fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt); - for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){ - fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]); - cDiv = ' '; - } - fprintf(yyTraceFILE,"]\n"); - } -#endif - return; -} diff --git a/bx/tools/bin/windows/genie.exe b/bx/tools/bin/windows/genie.exe index 04a1f226..09e3f3cf 100644 Binary files a/bx/tools/bin/windows/genie.exe and b/bx/tools/bin/windows/genie.exe differ diff --git a/bx/tools/bin/windows/lemon.exe b/bx/tools/bin/windows/lemon.exe deleted file mode 100644 index ea46fecf..00000000 Binary files a/bx/tools/bin/windows/lemon.exe and /dev/null differ diff --git a/bx/tools/bin/windows/lempar.c b/bx/tools/bin/windows/lempar.c deleted file mode 100644 index 5e2024ff..00000000 --- a/bx/tools/bin/windows/lempar.c +++ /dev/null @@ -1,981 +0,0 @@ -/* -** 2000-05-29 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Driver template for the LEMON parser generator. -** -** The "lemon" program processes an LALR(1) input grammar file, then uses -** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the -** interstitial "-" characters) contained in this template is changed into -** the value of the %name directive from the grammar. Otherwise, the content -** of this template is copied straight through into the generate parser -** source file. -** -** The following is the concatenation of all %include directives from the -** input grammar file: -*/ -#include -/************ Begin %include sections from the grammar ************************/ -%% -/**************** End of %include directives **********************************/ -/* These constants specify the various numeric values for terminal symbols -** in a format understandable to "makeheaders". This section is blank unless -** "lemon" is run with the "-m" command-line option. -***************** Begin makeheaders token definitions *************************/ -%% -/**************** End makeheaders token definitions ***************************/ - -/* The next sections is a series of control #defines. -** various aspects of the generated parser. -** YYCODETYPE is the data type used to store the integer codes -** that represent terminal and non-terminal symbols. -** "unsigned char" is used if there are fewer than -** 256 symbols. Larger types otherwise. -** YYNOCODE is a number of type YYCODETYPE that is not used for -** any terminal or nonterminal symbol. -** YYFALLBACK If defined, this indicates that one or more tokens -** (also known as: "terminal symbols") have fall-back -** values which should be used if the original symbol -** would not parse. This permits keywords to sometimes -** be used as identifiers, for example. -** YYACTIONTYPE is the data type used for "action codes" - numbers -** that indicate what to do in response to the next -** token. -** ParseTOKENTYPE is the data type used for minor type for terminal -** symbols. Background: A "minor type" is a semantic -** value associated with a terminal or non-terminal -** symbols. For example, for an "ID" terminal symbol, -** the minor type might be the name of the identifier. -** Each non-terminal can have a different minor type. -** Terminal symbols all have the same minor type, though. -** This macros defines the minor type for terminal -** symbols. -** YYMINORTYPE is the data type used for all minor types. -** This is typically a union of many types, one of -** which is ParseTOKENTYPE. The entry in the union -** for terminal symbols is called "yy0". -** YYSTACKDEPTH is the maximum depth of the parser's stack. If -** zero the stack is dynamically sized using realloc() -** ParseARG_SDECL A static variable declaration for the %extra_argument -** ParseARG_PDECL A parameter declaration for the %extra_argument -** ParseARG_STORE Code to store %extra_argument into yypParser -** ParseARG_FETCH Code to extract %extra_argument from yypParser -** YYERRORSYMBOL is the code number of the error symbol. If not -** defined, then do no error processing. -** YYNSTATE the combined number of states. -** YYNRULE the number of rules in the grammar -** YY_MAX_SHIFT Maximum value for shift actions -** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions -** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions -** YY_MIN_REDUCE Minimum value for reduce actions -** YY_MAX_REDUCE Maximum value for reduce actions -** YY_ERROR_ACTION The yy_action[] code for syntax error -** YY_ACCEPT_ACTION The yy_action[] code for accept -** YY_NO_ACTION The yy_action[] code for no-op -*/ -#ifndef INTERFACE -# define INTERFACE 1 -#endif -/************* Begin control #defines *****************************************/ -%% -/************* End control #defines *******************************************/ - -/* Define the yytestcase() macro to be a no-op if is not already defined -** otherwise. -** -** Applications can choose to define yytestcase() in the %include section -** to a macro that can assist in verifying code coverage. For production -** code the yytestcase() macro should be turned off. But it is useful -** for testing. -*/ -#ifndef yytestcase -# define yytestcase(X) -#endif - - -/* Next are the tables used to determine what action to take based on the -** current state and lookahead token. These tables are used to implement -** functions that take a state number and lookahead value and return an -** action integer. -** -** Suppose the action integer is N. Then the action is determined as -** follows -** -** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead -** token onto the stack and goto state N. -** -** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then -** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE. -** -** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE -** and YY_MAX_REDUCE -** -** N == YY_ERROR_ACTION A syntax error has occurred. -** -** N == YY_ACCEPT_ACTION The parser accepts its input. -** -** N == YY_NO_ACTION No such action. Denotes unused -** slots in the yy_action[] table. -** -** The action table is constructed as a single large table named yy_action[]. -** Given state S and lookahead X, the action is computed as either: -** -** (A) N = yy_action[ yy_shift_ofst[S] + X ] -** (B) N = yy_default[S] -** -** The (A) formula is preferred. The B formula is used instead if: -** (1) The yy_shift_ofst[S]+X value is out of range, or -** (2) yy_lookahead[yy_shift_ofst[S]+X] is not equal to X, or -** (3) yy_shift_ofst[S] equal YY_SHIFT_USE_DFLT. -** (Implementation note: YY_SHIFT_USE_DFLT is chosen so that -** YY_SHIFT_USE_DFLT+X will be out of range for all possible lookaheads X. -** Hence only tests (1) and (2) need to be evaluated.) -** -** The formulas above are for computing the action when the lookahead is -** a terminal symbol. If the lookahead is a non-terminal (as occurs after -** a reduce action) then the yy_reduce_ofst[] array is used in place of -** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of -** YY_SHIFT_USE_DFLT. -** -** The following are the tables generated in this section: -** -** yy_action[] A single table containing all actions. -** yy_lookahead[] A table containing the lookahead for each entry in -** yy_action. Used to detect hash collisions. -** yy_shift_ofst[] For each state, the offset into yy_action for -** shifting terminals. -** yy_reduce_ofst[] For each state, the offset into yy_action for -** shifting non-terminals after a reduce. -** yy_default[] Default action for each state. -** -*********** Begin parsing tables **********************************************/ -%% -/********** End of lemon-generated parsing tables *****************************/ - -/* The next table maps tokens (terminal symbols) into fallback tokens. -** If a construct like the following: -** -** %fallback ID X Y Z. -** -** appears in the grammar, then ID becomes a fallback token for X, Y, -** and Z. Whenever one of the tokens X, Y, or Z is input to the parser -** but it does not parse, the type of the token is changed to ID and -** the parse is retried before an error is thrown. -** -** This feature can be used, for example, to cause some keywords in a language -** to revert to identifiers if they keyword does not apply in the context where -** it appears. -*/ -#ifdef YYFALLBACK -static const YYCODETYPE yyFallback[] = { -%% -}; -#endif /* YYFALLBACK */ - -/* The following structure represents a single element of the -** parser's stack. Information stored includes: -** -** + The state number for the parser at this level of the stack. -** -** + The value of the token stored at this level of the stack. -** (In other words, the "major" token.) -** -** + The semantic value stored at this level of the stack. This is -** the information used by the action routines in the grammar. -** It is sometimes called the "minor" token. -** -** After the "shift" half of a SHIFTREDUCE action, the stateno field -** actually contains the reduce action for the second half of the -** SHIFTREDUCE. -*/ -struct yyStackEntry { - YYACTIONTYPE stateno; /* The state-number, or reduce action in SHIFTREDUCE */ - YYCODETYPE major; /* The major token value. This is the code - ** number for the token at this stack level */ - YYMINORTYPE minor; /* The user-supplied minor token value. This - ** is the value of the token */ -}; -typedef struct yyStackEntry yyStackEntry; - -/* The state of the parser is completely contained in an instance of -** the following structure */ -struct yyParser { - yyStackEntry *yytos; /* Pointer to top element of the stack */ -#ifdef YYTRACKMAXSTACKDEPTH - int yyhwm; /* High-water mark of the stack */ -#endif -#ifndef YYNOERRORRECOVERY - int yyerrcnt; /* Shifts left before out of the error */ -#endif - ParseARG_SDECL /* A place to hold %extra_argument */ -#if YYSTACKDEPTH<=0 - int yystksz; /* Current side of the stack */ - yyStackEntry *yystack; /* The parser's stack */ - yyStackEntry yystk0; /* First stack entry */ -#else - yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ - yyStackEntry *yystackEnd; /* Last entry in the stack */ -#endif -}; -typedef struct yyParser yyParser; - -#ifndef NDEBUG -#include -static FILE *yyTraceFILE = 0; -static char *yyTracePrompt = 0; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* -** Turn parser tracing on by giving a stream to which to write the trace -** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL -** -** Inputs: -**
    -**
  • A FILE* to which trace output should be written. -** If NULL, then tracing is turned off. -**
  • A prefix string written at the beginning of every -** line of trace output. If NULL, then tracing is -** turned off. -**
-** -** Outputs: -** None. -*/ -void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ - yyTraceFILE = TraceFILE; - yyTracePrompt = zTracePrompt; - if( yyTraceFILE==0 ) yyTracePrompt = 0; - else if( yyTracePrompt==0 ) yyTraceFILE = 0; -} -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing shifts, the names of all terminals and nonterminals -** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { -%% -}; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing reduce actions, the names of all rules are required. -*/ -static const char *const yyRuleName[] = { -%% -}; -#endif /* NDEBUG */ - - -#if YYSTACKDEPTH<=0 -/* -** Try to increase the size of the parser stack. Return the number -** of errors. Return 0 on success. -*/ -static int yyGrowStack(yyParser *p){ - int newSize; - int idx; - yyStackEntry *pNew; - - newSize = p->yystksz*2 + 100; - idx = p->yytos ? (int)(p->yytos - p->yystack) : 0; - if( p->yystack==&p->yystk0 ){ - pNew = malloc(newSize*sizeof(pNew[0])); - if( pNew ) pNew[0] = p->yystk0; - }else{ - pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); - } - if( pNew ){ - p->yystack = pNew; - p->yytos = &p->yystack[idx]; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", - yyTracePrompt, p->yystksz, newSize); - } -#endif - p->yystksz = newSize; - } - return pNew==0; -} -#endif - -/* Datatype of the argument to the memory allocated passed as the -** second argument to ParseAlloc() below. This can be changed by -** putting an appropriate #define in the %include section of the input -** grammar. -*/ -#ifndef YYMALLOCARGTYPE -# define YYMALLOCARGTYPE size_t -#endif - -/* Initialize a new parser that has already been allocated. -*/ -void ParseInit(void *yypParser){ - yyParser *pParser = (yyParser*)yypParser; -#ifdef YYTRACKMAXSTACKDEPTH - pParser->yyhwm = 0; -#endif -#if YYSTACKDEPTH<=0 - pParser->yytos = NULL; - pParser->yystack = NULL; - pParser->yystksz = 0; - if( yyGrowStack(pParser) ){ - pParser->yystack = &pParser->yystk0; - pParser->yystksz = 1; - } -#endif -#ifndef YYNOERRORRECOVERY - pParser->yyerrcnt = -1; -#endif - pParser->yytos = pParser->yystack; - pParser->yystack[0].stateno = 0; - pParser->yystack[0].major = 0; -#if YYSTACKDEPTH>0 - pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1]; -#endif -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** This function allocates a new parser. -** The only argument is a pointer to a function which works like -** malloc. -** -** Inputs: -** A pointer to the function used to allocate memory. -** -** Outputs: -** A pointer to a parser. This pointer is used in subsequent calls -** to Parse and ParseFree. -*/ -void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); - if( pParser ) ParseInit(pParser); - return pParser; -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - - -/* The following function deletes the "minor type" or semantic value -** associated with a symbol. The symbol can be either a terminal -** or nonterminal. "yymajor" is the symbol code, and "yypminor" is -** a pointer to the value to be deleted. The code used to do the -** deletions is derived from the %destructor and/or %token_destructor -** directives of the input grammar. -*/ -static void yy_destructor( - yyParser *yypParser, /* The parser */ - YYCODETYPE yymajor, /* Type code for object to destroy */ - YYMINORTYPE *yypminor /* The object to be destroyed */ -){ - ParseARG_FETCH; - switch( yymajor ){ - /* Here is inserted the actions which take place when a - ** terminal or non-terminal is destroyed. This can happen - ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is - ** being destroyed before it is finished parsing. - ** - ** Note: during a reduce, the only symbols destroyed are those - ** which appear on the RHS of the rule, but which are *not* used - ** inside the C code. - */ -/********* Begin destructor definitions ***************************************/ -%% -/********* End destructor definitions *****************************************/ - default: break; /* If no destructor action specified: do nothing */ - } -} - -/* -** Pop the parser's stack once. -** -** If there is a destructor routine associated with the token which -** is popped from the stack, then call it. -*/ -static void yy_pop_parser_stack(yyParser *pParser){ - yyStackEntry *yytos; - assert( pParser->yytos!=0 ); - assert( pParser->yytos > pParser->yystack ); - yytos = pParser->yytos--; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sPopping %s\n", - yyTracePrompt, - yyTokenName[yytos->major]); - } -#endif - yy_destructor(pParser, yytos->major, &yytos->minor); -} - -/* -** Clear all secondary memory allocations from the parser -*/ -void ParseFinalize(void *p){ - yyParser *pParser = (yyParser*)p; - while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser); -#if YYSTACKDEPTH<=0 - if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack); -#endif -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** Deallocate and destroy a parser. Destructors are called for -** all stack elements before shutting the parser down. -** -** If the YYPARSEFREENEVERNULL macro exists (for example because it -** is defined in a %include section of the input grammar) then it is -** assumed that the input pointer is never NULL. -*/ -void ParseFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ -){ -#ifndef YYPARSEFREENEVERNULL - if( p==0 ) return; -#endif - ParseFinalize(p); - (*freeProc)(p); -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - -/* -** Return the peak depth of the stack for a parser. -*/ -#ifdef YYTRACKMAXSTACKDEPTH -int ParseStackPeak(void *p){ - yyParser *pParser = (yyParser*)p; - return pParser->yyhwm; -} -#endif - -/* -** Find the appropriate action for a parser given the terminal -** look-ahead token iLookAhead. -*/ -static unsigned int yy_find_shift_action( - yyParser *pParser, /* The parser */ - YYCODETYPE iLookAhead /* The look-ahead token */ -){ - int i; - int stateno = pParser->yytos->stateno; - - if( stateno>=YY_MIN_REDUCE ) return stateno; - assert( stateno <= YY_SHIFT_COUNT ); - do{ - i = yy_shift_ofst[stateno]; - assert( iLookAhead!=YYNOCODE ); - i += iLookAhead; - if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ -#ifdef YYFALLBACK - YYCODETYPE iFallback; /* Fallback token */ - if( iLookAhead %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); - } -#endif - assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ - iLookAhead = iFallback; - continue; - } -#endif -#ifdef YYWILDCARD - { - int j = i - iLookAhead + YYWILDCARD; - if( -#if YY_SHIFT_MIN+YYWILDCARD<0 - j>=0 && -#endif -#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT - j0 - ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], - yyTokenName[YYWILDCARD]); - } -#endif /* NDEBUG */ - return yy_action[j]; - } - } -#endif /* YYWILDCARD */ - return yy_default[stateno]; - }else{ - return yy_action[i]; - } - }while(1); -} - -/* -** Find the appropriate action for a parser given the non-terminal -** look-ahead token iLookAhead. -*/ -static int yy_find_reduce_action( - int stateno, /* Current state number */ - YYCODETYPE iLookAhead /* The look-ahead token */ -){ - int i; -#ifdef YYERRORSYMBOL - if( stateno>YY_REDUCE_COUNT ){ - return yy_default[stateno]; - } -#else - assert( stateno<=YY_REDUCE_COUNT ); -#endif - i = yy_reduce_ofst[stateno]; - assert( i!=YY_REDUCE_USE_DFLT ); - assert( iLookAhead!=YYNOCODE ); - i += iLookAhead; -#ifdef YYERRORSYMBOL - if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ - return yy_default[stateno]; - } -#else - assert( i>=0 && iyytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will execute if the parser - ** stack every overflows */ -/******** Begin %stack_overflow code ******************************************/ -%% -/******** End %stack_overflow code ********************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ -} - -/* -** Print tracing information for a SHIFT action -*/ -#ifndef NDEBUG -static void yyTraceShift(yyParser *yypParser, int yyNewState){ - if( yyTraceFILE ){ - if( yyNewStateyytos->major], - yyNewState); - }else{ - fprintf(yyTraceFILE,"%sShift '%s'\n", - yyTracePrompt,yyTokenName[yypParser->yytos->major]); - } - } -} -#else -# define yyTraceShift(X,Y) -#endif - -/* -** Perform a shift action. -*/ -static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ - int yyNewState, /* The new state to shift in */ - int yyMajor, /* The major token to shift in */ - ParseTOKENTYPE yyMinor /* The minor token to shift in */ -){ - yyStackEntry *yytos; - yypParser->yytos++; -#ifdef YYTRACKMAXSTACKDEPTH - if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) ); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>yypParser->yystackEnd ){ - yypParser->yytos--; - yyStackOverflow(yypParser); - return; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){ - if( yyGrowStack(yypParser) ){ - yypParser->yytos--; - yyStackOverflow(yypParser); - return; - } - } -#endif - if( yyNewState > YY_MAX_SHIFT ){ - yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; - } - yytos = yypParser->yytos; - yytos->stateno = (YYACTIONTYPE)yyNewState; - yytos->major = (YYCODETYPE)yyMajor; - yytos->minor.yy0 = yyMinor; - yyTraceShift(yypParser, yyNewState); -} - -/* The following table contains information about every rule that -** is used during the reduce. -*/ -static const struct { - YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ - signed char nrhs; /* Negative of the number of RHS symbols in the rule */ -} yyRuleInfo[] = { -%% -}; - -static void yy_accept(yyParser*); /* Forward Declaration */ - -/* -** Perform a reduce action and the shift that must immediately -** follow the reduce. -** -** The yyLookahead and yyLookaheadToken parameters provide reduce actions -** access to the lookahead token (if any). The yyLookahead will be YYNOCODE -** if the lookahead token has already been consumed. As this procedure is -** only called from one place, optimizing compilers will in-line it, which -** means that the extra parameters have no performance impact. -*/ -static void yy_reduce( - yyParser *yypParser, /* The parser */ - unsigned int yyruleno, /* Number of the rule by which to reduce */ - int yyLookahead, /* Lookahead token, or YYNOCODE if none */ - ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ -){ - int yygoto; /* The next state */ - int yyact; /* The next action */ - yyStackEntry *yymsp; /* The top of the parser's stack */ - int yysize; /* Amount to pop the stack */ - ParseARG_FETCH; - yymsp = yypParser->yytos; -#ifndef NDEBUG - if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfo[yyruleno].nrhs; - fprintf(yyTraceFILE, "%sReduce [%s], go to state %d.\n", yyTracePrompt, - yyRuleName[yyruleno], yymsp[yysize].stateno); - } -#endif /* NDEBUG */ - - /* Check that the stack is large enough to grow by a single entry - ** if the RHS of the rule is empty. This ensures that there is room - ** enough on the stack to push the LHS value */ - if( yyRuleInfo[yyruleno].nrhs==0 ){ -#ifdef YYTRACKMAXSTACKDEPTH - if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>=yypParser->yystackEnd ){ - yyStackOverflow(yypParser); - return; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ - if( yyGrowStack(yypParser) ){ - yyStackOverflow(yypParser); - return; - } - yymsp = yypParser->yytos; - } -#endif - } - - switch( yyruleno ){ - /* Beginning here are the reduction cases. A typical example - ** follows: - ** case 0: - ** #line - ** { ... } // User supplied code - ** #line - ** break; - */ -/********** Begin reduce actions **********************************************/ -%% -/********** End reduce actions ************************************************/ - }; - assert( yyrulenoYY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) ); - - /* It is not possible for a REDUCE to be followed by an error */ - assert( yyact!=YY_ERROR_ACTION ); - - if( yyact==YY_ACCEPT_ACTION ){ - yypParser->yytos += yysize; - yy_accept(yypParser); - }else{ - yymsp += yysize+1; - yypParser->yytos = yymsp; - yymsp->stateno = (YYACTIONTYPE)yyact; - yymsp->major = (YYCODETYPE)yygoto; - yyTraceShift(yypParser, yyact); - } -} - -/* -** The following code executes when the parse fails -*/ -#ifndef YYNOERRORRECOVERY -static void yy_parse_failed( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); - } -#endif - while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser fails */ -/************ Begin %parse_failure code ***************************************/ -%% -/************ End %parse_failure code *****************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} -#endif /* YYNOERRORRECOVERY */ - -/* -** The following code executes when a syntax error first occurs. -*/ -static void yy_syntax_error( - yyParser *yypParser, /* The parser */ - int yymajor, /* The major type of the error token */ - ParseTOKENTYPE yyminor /* The minor type of the error token */ -){ - ParseARG_FETCH; -#define TOKEN yyminor -/************ Begin %syntax_error code ****************************************/ -%% -/************ End %syntax_error code ******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following is executed when the parser accepts -*/ -static void yy_accept( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); - } -#endif -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - assert( yypParser->yytos==yypParser->yystack ); - /* Here code is inserted which will be executed whenever the - ** parser accepts */ -/*********** Begin %parse_accept code *****************************************/ -%% -/*********** End %parse_accept code *******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* The main parser program. -** The first argument is a pointer to a structure obtained from -** "ParseAlloc" which describes the current state of the parser. -** The second argument is the major token number. The third is -** the minor token. The fourth optional argument is whatever the -** user wants (and specified in the grammar) and is available for -** use by the action routines. -** -** Inputs: -**
    -**
  • A pointer to the parser (an opaque structure.) -**
  • The major token number. -**
  • The minor token number. -**
  • An option argument of a grammar-specified type. -**
-** -** Outputs: -** None. -*/ -void Parse( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - ParseTOKENTYPE yyminor /* The value for the token */ - ParseARG_PDECL /* Optional %extra_argument parameter */ -){ - YYMINORTYPE yyminorunion; - unsigned int yyact; /* The parser action. */ -#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) - int yyendofinput; /* True if we are at the end of input */ -#endif -#ifdef YYERRORSYMBOL - int yyerrorhit = 0; /* True if yymajor has invoked an error */ -#endif - yyParser *yypParser; /* The parser */ - - yypParser = (yyParser*)yyp; - assert( yypParser->yytos!=0 ); -#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) - yyendofinput = (yymajor==0); -#endif - ParseARG_STORE; - -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sInput '%s'\n",yyTracePrompt,yyTokenName[yymajor]); - } -#endif - - do{ - yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); - if( yyact <= YY_MAX_SHIFTREDUCE ){ - yy_shift(yypParser,yyact,yymajor,yyminor); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt--; -#endif - yymajor = YYNOCODE; - }else if( yyact <= YY_MAX_REDUCE ){ - yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor); - }else{ - assert( yyact == YY_ERROR_ACTION ); - yyminorunion.yy0 = yyminor; -#ifdef YYERRORSYMBOL - int yymx; -#endif -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); - } -#endif -#ifdef YYERRORSYMBOL - /* A syntax error has occurred. - ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". - ** - ** This is what we do if the grammar does define ERROR: - ** - ** * Call the %syntax_error function. - ** - ** * Begin popping the stack until we enter a state where - ** it is legal to shift the error symbol, then shift - ** the error symbol. - ** - ** * Set the error count to three. - ** - ** * Begin accepting and shifting new tokens. No new error - ** processing will occur until three tokens have been - ** shifted successfully. - ** - */ - if( yypParser->yyerrcnt<0 ){ - yy_syntax_error(yypParser,yymajor,yyminor); - } - yymx = yypParser->yytos->major; - if( yymx==YYERRORSYMBOL || yyerrorhit ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sDiscard input token %s\n", - yyTracePrompt,yyTokenName[yymajor]); - } -#endif - yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); - yymajor = YYNOCODE; - }else{ - while( yypParser->yytos >= yypParser->yystack - && yymx != YYERRORSYMBOL - && (yyact = yy_find_reduce_action( - yypParser->yytos->stateno, - YYERRORSYMBOL)) >= YY_MIN_REDUCE - ){ - yy_pop_parser_stack(yypParser); - } - if( yypParser->yytos < yypParser->yystack || yymajor==0 ){ - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yy_parse_failed(yypParser); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - yymajor = YYNOCODE; - }else if( yymx!=YYERRORSYMBOL ){ - yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor); - } - } - yypParser->yyerrcnt = 3; - yyerrorhit = 1; -#elif defined(YYNOERRORRECOVERY) - /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to - ** do any kind of error recovery. Instead, simply invoke the syntax - ** error routine and continue going as if nothing had happened. - ** - ** Applications can set this macro (for example inside %include) if - ** they intend to abandon the parse upon the first syntax error seen. - */ - yy_syntax_error(yypParser,yymajor, yyminor); - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yymajor = YYNOCODE; - -#else /* YYERRORSYMBOL is not defined */ - /* This is what we do if the grammar does not define ERROR: - ** - ** * Report an error message, and throw away the input token. - ** - ** * If the input token is $, then fail the parse. - ** - ** As before, subsequent error messages are suppressed until - ** three input tokens have been successfully shifted. - */ - if( yypParser->yyerrcnt<=0 ){ - yy_syntax_error(yypParser,yymajor, yyminor); - } - yypParser->yyerrcnt = 3; - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - if( yyendofinput ){ - yy_parse_failed(yypParser); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - } - yymajor = YYNOCODE; -#endif - } - }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack ); -#ifndef NDEBUG - if( yyTraceFILE ){ - yyStackEntry *i; - char cDiv = '['; - fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt); - for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){ - fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]); - cDiv = ' '; - } - fprintf(yyTraceFILE,"]\n"); - } -#endif - return; -} diff --git a/bx/tools/bin2c/bin2c.cpp b/bx/tools/bin2c/bin2c.cpp index ef0e2fc7..fd4c706c 100644 --- a/bx/tools/bin2c/bin2c.cpp +++ b/bx/tools/bin2c/bin2c.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * Copyright 2011-2024 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ @@ -35,8 +35,8 @@ class Bin2cWriter : public bx::WriterI char ch = data[ii]; asCStr &= false - | bx::isPrint(ch) - | bx::isSpace(ch) + || bx::isPrint(ch) + || bx::isSpace(ch) ; } @@ -84,21 +84,21 @@ class Bin2cWriter : public bx::WriterI { switch (ch) { - case '\"': bx::write(_writer, "\\\"", &err); break; - case '\n': bx::write(_writer, "\\n\"\n\t\"", &err); break; - case '\r': bx::write(_writer, "\\r", &err); break; - case '\\': escaped = true; BX_FALLTHROUGH; - default: bx::write(_writer, ch, &err); break; + case '\"': bx::write(_writer, "\\\"", &err); break; + case '\n': bx::write(_writer, "\\n\"\n\t\"", &err); break; + case '\r': bx::write(_writer, "\\r", &err); break; + case '\\': escaped = true; [[fallthrough]]; + default: bx::write(_writer, ch, &err); break; } } else { switch (ch) { - case '\n': bx::write(_writer, "\\\"\n\t\"", &err); break; - case '\r': BX_FALLTHROUGH; - case '\t': bx::write(_writer, "\\", &err); BX_FALLTHROUGH; - default : bx::write(_writer, ch, &err); break; + case '\n': bx::write(_writer, "\\\"\n\t\"", &err); break; + case '\r': [[fallthrough]]; + case '\t': bx::write(_writer, "\\", &err); [[fallthrough]]; + default : bx::write(_writer, ch, &err); break; } escaped = false; @@ -196,7 +196,7 @@ void help(const char* _error = NULL) bx::write(stdOut, &err , "bin2c, binary to C\n" - "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2024 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bx/blob/master/LICENSE\n\n" ); diff --git a/bx/tools/lemon/lemon.c b/bx/tools/lemon/lemon.c deleted file mode 100644 index acf2483e..00000000 --- a/bx/tools/lemon/lemon.c +++ /dev/null @@ -1,5466 +0,0 @@ -/* -** This file contains all sources (including headers) to the LEMON -** LALR(1) parser generator. The sources have been combined into a -** single file to make it easy to include LEMON in the source tree -** and Makefile of another program. -** -** The author of this program disclaims copyright. -*/ -#include -#include -#include -#include -#include -#include - -#define ISSPACE(X) isspace((unsigned char)(X)) -#define ISDIGIT(X) isdigit((unsigned char)(X)) -#define ISALNUM(X) isalnum((unsigned char)(X)) -#define ISALPHA(X) isalpha((unsigned char)(X)) -#define ISUPPER(X) isupper((unsigned char)(X)) -#define ISLOWER(X) islower((unsigned char)(X)) - - -#ifndef __WIN32__ -# if defined(_WIN32) || defined(WIN32) -# define __WIN32__ -# endif -#endif - -#ifdef __WIN32__ -#ifdef __cplusplus -extern "C" { -#endif -extern int access(const char *path, int mode); -#ifdef __cplusplus -} -#endif -#else -#include -#endif - -/* #define PRIVATE static */ -#define PRIVATE - -#ifdef TEST -#define MAXRHS 5 /* Set low to exercise exception code */ -#else -#define MAXRHS 1000 -#endif - -static int showPrecedenceConflict = 0; -static char *msort(char*,char**,int(*)(const char*,const char*)); - -/* -** Compilers are getting increasingly pedantic about type conversions -** as C evolves ever closer to Ada.... To work around the latest problems -** we have to define the following variant of strlen(). -*/ -#define lemonStrlen(X) ((int)strlen(X)) - -/* -** Compilers are starting to complain about the use of sprintf() and strcpy(), -** saying they are unsafe. So we define our own versions of those routines too. -** -** There are three routines here: lemon_sprintf(), lemon_vsprintf(), and -** lemon_addtext(). The first two are replacements for sprintf() and vsprintf(). -** The third is a helper routine for vsnprintf() that adds texts to the end of a -** buffer, making sure the buffer is always zero-terminated. -** -** The string formatter is a minimal subset of stdlib sprintf() supporting only -** a few simply conversions: -** -** %d -** %s -** %.*s -** -*/ -static void lemon_addtext( - char *zBuf, /* The buffer to which text is added */ - int *pnUsed, /* Slots of the buffer used so far */ - const char *zIn, /* Text to add */ - int nIn, /* Bytes of text to add. -1 to use strlen() */ - int iWidth /* Field width. Negative to left justify */ -){ - if( nIn<0 ) for(nIn=0; zIn[nIn]; nIn++){} - while( iWidth>nIn ){ zBuf[(*pnUsed)++] = ' '; iWidth--; } - if( nIn==0 ) return; - memcpy(&zBuf[*pnUsed], zIn, nIn); - *pnUsed += nIn; - while( (-iWidth)>nIn ){ zBuf[(*pnUsed)++] = ' '; iWidth++; } - zBuf[*pnUsed] = 0; -} -static int lemon_vsprintf(char *str, const char *zFormat, va_list ap){ - int i, j, k, c; - int nUsed = 0; - const char *z; - char zTemp[50]; - str[0] = 0; - for(i=j=0; (c = zFormat[i])!=0; i++){ - if( c=='%' ){ - int iWidth = 0; - lemon_addtext(str, &nUsed, &zFormat[j], i-j, 0); - c = zFormat[++i]; - if( ISDIGIT(c) || (c=='-' && ISDIGIT(zFormat[i+1])) ){ - if( c=='-' ) i++; - while( ISDIGIT(zFormat[i]) ) iWidth = iWidth*10 + zFormat[i++] - '0'; - if( c=='-' ) iWidth = -iWidth; - c = zFormat[i]; - } - if( c=='d' ){ - int v = va_arg(ap, int); - if( v<0 ){ - lemon_addtext(str, &nUsed, "-", 1, iWidth); - v = -v; - }else if( v==0 ){ - lemon_addtext(str, &nUsed, "0", 1, iWidth); - } - k = 0; - while( v>0 ){ - k++; - zTemp[sizeof(zTemp)-k] = (v%10) + '0'; - v /= 10; - } - lemon_addtext(str, &nUsed, &zTemp[sizeof(zTemp)-k], k, iWidth); - }else if( c=='s' ){ - z = va_arg(ap, const char*); - lemon_addtext(str, &nUsed, z, -1, iWidth); - }else if( c=='.' && memcmp(&zFormat[i], ".*s", 3)==0 ){ - i += 2; - k = va_arg(ap, int); - z = va_arg(ap, const char*); - lemon_addtext(str, &nUsed, z, k, iWidth); - }else if( c=='%' ){ - lemon_addtext(str, &nUsed, "%", 1, 0); - }else{ - fprintf(stderr, "illegal format\n"); - exit(1); - } - j = i+1; - } - } - lemon_addtext(str, &nUsed, &zFormat[j], i-j, 0); - return nUsed; -} -static int lemon_sprintf(char *str, const char *format, ...){ - va_list ap; - int rc; - va_start(ap, format); - rc = lemon_vsprintf(str, format, ap); - va_end(ap); - return rc; -} -static void lemon_strcpy(char *dest, const char *src){ - while( (*(dest++) = *(src++))!=0 ){} -} -static void lemon_strcat(char *dest, const char *src){ - while( *dest ) dest++; - lemon_strcpy(dest, src); -} - - -/* a few forward declarations... */ -struct rule; -struct lemon; -struct action; - -static struct action *Action_new(void); -static struct action *Action_sort(struct action *); - -/********** From the file "build.h" ************************************/ -void FindRulePrecedences(struct lemon*); -void FindFirstSets(struct lemon*); -void FindStates(struct lemon*); -void FindLinks(struct lemon*); -void FindFollowSets(struct lemon*); -void FindActions(struct lemon*); - -/********* From the file "configlist.h" *********************************/ -void Configlist_init(void); -struct config *Configlist_add(struct rule *, int); -struct config *Configlist_addbasis(struct rule *, int); -void Configlist_closure(struct lemon *); -void Configlist_sort(void); -void Configlist_sortbasis(void); -struct config *Configlist_return(void); -struct config *Configlist_basis(void); -void Configlist_eat(struct config *); -void Configlist_reset(void); - -/********* From the file "error.h" ***************************************/ -void ErrorMsg(const char *, int,const char *, ...); - -/****** From the file "option.h" ******************************************/ -enum option_type { OPT_FLAG=1, OPT_INT, OPT_DBL, OPT_STR, - OPT_FFLAG, OPT_FINT, OPT_FDBL, OPT_FSTR}; -struct s_options { - enum option_type type; - const char *label; - char *arg; - const char *message; -}; -int OptInit(char**,struct s_options*,FILE*); -int OptNArgs(void); -char *OptArg(int); -void OptErr(int); -void OptPrint(void); - -/******** From the file "parse.h" *****************************************/ -void Parse(struct lemon *lemp); - -/********* From the file "plink.h" ***************************************/ -struct plink *Plink_new(void); -void Plink_add(struct plink **, struct config *); -void Plink_copy(struct plink **, struct plink *); -void Plink_delete(struct plink *); - -/********** From the file "report.h" *************************************/ -void Reprint(struct lemon *); -void ReportOutput(struct lemon *); -void ReportTable(struct lemon *, int); -void ReportHeader(struct lemon *); -void CompressTables(struct lemon *); -void ResortStates(struct lemon *); - -/********** From the file "set.h" ****************************************/ -void SetSize(int); /* All sets will be of size N */ -char *SetNew(void); /* A new set for element 0..N */ -void SetFree(char*); /* Deallocate a set */ -int SetAdd(char*,int); /* Add element to a set */ -int SetUnion(char *,char *); /* A <- A U B, thru element N */ -#define SetFind(X,Y) (X[Y]) /* True if Y is in set X */ - -/********** From the file "struct.h" *************************************/ -/* -** Principal data structures for the LEMON parser generator. -*/ - -typedef enum {LEMON_FALSE=0, LEMON_TRUE} Boolean; - -/* Symbols (terminals and nonterminals) of the grammar are stored -** in the following: */ -enum symbol_type { - TERMINAL, - NONTERMINAL, - MULTITERMINAL -}; -enum e_assoc { - LEFT, - RIGHT, - NONE, - UNK -}; -struct symbol { - const char *name; /* Name of the symbol */ - int index; /* Index number for this symbol */ - enum symbol_type type; /* Symbols are all either TERMINALS or NTs */ - struct rule *rule; /* Linked list of rules of this (if an NT) */ - struct symbol *fallback; /* fallback token in case this token doesn't parse */ - int prec; /* Precedence if defined (-1 otherwise) */ - enum e_assoc assoc; /* Associativity if precedence is defined */ - char *firstset; /* First-set for all rules of this symbol */ - Boolean lambda; /* True if NT and can generate an empty string */ - int useCnt; /* Number of times used */ - char *destructor; /* Code which executes whenever this symbol is - ** popped from the stack during error processing */ - int destLineno; /* Line number for start of destructor. Set to - ** -1 for duplicate destructors. */ - char *datatype; /* The data type of information held by this - ** object. Only used if type==NONTERMINAL */ - int dtnum; /* The data type number. In the parser, the value - ** stack is a union. The .yy%d element of this - ** union is the correct data type for this object */ - /* The following fields are used by MULTITERMINALs only */ - int nsubsym; /* Number of constituent symbols in the MULTI */ - struct symbol **subsym; /* Array of constituent symbols */ -}; - -/* Each production rule in the grammar is stored in the following -** structure. */ -struct rule { - struct symbol *lhs; /* Left-hand side of the rule */ - const char *lhsalias; /* Alias for the LHS (NULL if none) */ - int lhsStart; /* True if left-hand side is the start symbol */ - int ruleline; /* Line number for the rule */ - int nrhs; /* Number of RHS symbols */ - struct symbol **rhs; /* The RHS symbols */ - const char **rhsalias; /* An alias for each RHS symbol (NULL if none) */ - int line; /* Line number at which code begins */ - const char *code; /* The code executed when this rule is reduced */ - const char *codePrefix; /* Setup code before code[] above */ - const char *codeSuffix; /* Breakdown code after code[] above */ - int noCode; /* True if this rule has no associated C code */ - int codeEmitted; /* True if the code has been emitted already */ - struct symbol *precsym; /* Precedence symbol for this rule */ - int index; /* An index number for this rule */ - int iRule; /* Rule number as used in the generated tables */ - Boolean canReduce; /* True if this rule is ever reduced */ - Boolean doesReduce; /* Reduce actions occur after optimization */ - struct rule *nextlhs; /* Next rule with the same LHS */ - struct rule *next; /* Next rule in the global list */ -}; - -/* A configuration is a production rule of the grammar together with -** a mark (dot) showing how much of that rule has been processed so far. -** Configurations also contain a follow-set which is a list of terminal -** symbols which are allowed to immediately follow the end of the rule. -** Every configuration is recorded as an instance of the following: */ -enum cfgstatus { - COMPLETE, - INCOMPLETE -}; -struct config { - struct rule *rp; /* The rule upon which the configuration is based */ - int dot; /* The parse point */ - char *fws; /* Follow-set for this configuration only */ - struct plink *fplp; /* Follow-set forward propagation links */ - struct plink *bplp; /* Follow-set backwards propagation links */ - struct state *stp; /* Pointer to state which contains this */ - enum cfgstatus status; /* used during followset and shift computations */ - struct config *next; /* Next configuration in the state */ - struct config *bp; /* The next basis configuration */ -}; - -enum e_action { - SHIFT, - ACCEPT, - REDUCE, - ERROR, - SSCONFLICT, /* A shift/shift conflict */ - SRCONFLICT, /* Was a reduce, but part of a conflict */ - RRCONFLICT, /* Was a reduce, but part of a conflict */ - SH_RESOLVED, /* Was a shift. Precedence resolved conflict */ - RD_RESOLVED, /* Was reduce. Precedence resolved conflict */ - NOT_USED, /* Deleted by compression */ - SHIFTREDUCE /* Shift first, then reduce */ -}; - -/* Every shift or reduce operation is stored as one of the following */ -struct action { - struct symbol *sp; /* The look-ahead symbol */ - enum e_action type; - union { - struct state *stp; /* The new state, if a shift */ - struct rule *rp; /* The rule, if a reduce */ - } x; - struct symbol *spOpt; /* SHIFTREDUCE optimization to this symbol */ - struct action *next; /* Next action for this state */ - struct action *collide; /* Next action with the same hash */ -}; - -/* Each state of the generated parser's finite state machine -** is encoded as an instance of the following structure. */ -struct state { - struct config *bp; /* The basis configurations for this state */ - struct config *cfp; /* All configurations in this set */ - int statenum; /* Sequential number for this state */ - struct action *ap; /* List of actions for this state */ - int nTknAct, nNtAct; /* Number of actions on terminals and nonterminals */ - int iTknOfst, iNtOfst; /* yy_action[] offset for terminals and nonterms */ - int iDfltReduce; /* Default action is to REDUCE by this rule */ - struct rule *pDfltReduce;/* The default REDUCE rule. */ - int autoReduce; /* True if this is an auto-reduce state */ -}; -#define NO_OFFSET (-2147483647) - -/* A followset propagation link indicates that the contents of one -** configuration followset should be propagated to another whenever -** the first changes. */ -struct plink { - struct config *cfp; /* The configuration to which linked */ - struct plink *next; /* The next propagate link */ -}; - -/* The state vector for the entire parser generator is recorded as -** follows. (LEMON uses no global variables and makes little use of -** static variables. Fields in the following structure can be thought -** of as begin global variables in the program.) */ -struct lemon { - struct state **sorted; /* Table of states sorted by state number */ - struct rule *rule; /* List of all rules */ - struct rule *startRule; /* First rule */ - int nstate; /* Number of states */ - int nxstate; /* nstate with tail degenerate states removed */ - int nrule; /* Number of rules */ - int nsymbol; /* Number of terminal and nonterminal symbols */ - int nterminal; /* Number of terminal symbols */ - struct symbol **symbols; /* Sorted array of pointers to symbols */ - int errorcnt; /* Number of errors */ - struct symbol *errsym; /* The error symbol */ - struct symbol *wildcard; /* Token that matches anything */ - char *name; /* Name of the generated parser */ - char *arg; /* Declaration of the 3th argument to parser */ - char *tokentype; /* Type of terminal symbols in the parser stack */ - char *vartype; /* The default type of non-terminal symbols */ - char *start; /* Name of the start symbol for the grammar */ - char *stacksize; /* Size of the parser stack */ - char *include; /* Code to put at the start of the C file */ - char *error; /* Code to execute when an error is seen */ - char *overflow; /* Code to execute on a stack overflow */ - char *failure; /* Code to execute on parser failure */ - char *accept; /* Code to execute when the parser excepts */ - char *extracode; /* Code appended to the generated file */ - char *tokendest; /* Code to execute to destroy token data */ - char *vardest; /* Code for the default non-terminal destructor */ - char *filename; /* Name of the input file */ - char *outname; /* Name of the current output file */ - char *tokenprefix; /* A prefix added to token names in the .h file */ - int nconflict; /* Number of parsing conflicts */ - int nactiontab; /* Number of entries in the yy_action[] table */ - int tablesize; /* Total table size of all tables in bytes */ - int basisflag; /* Print only basis configurations */ - int has_fallback; /* True if any %fallback is seen in the grammar */ - int nolinenosflag; /* True if #line statements should not be printed */ - char *argv0; /* Name of the program */ -}; - -#define MemoryCheck(X) if((X)==0){ \ - extern void memory_error(); \ - memory_error(); \ -} - -/**************** From the file "table.h" *********************************/ -/* -** All code in this file has been automatically generated -** from a specification in the file -** "table.q" -** by the associative array code building program "aagen". -** Do not edit this file! Instead, edit the specification -** file, then rerun aagen. -*/ -/* -** Code for processing tables in the LEMON parser generator. -*/ -/* Routines for handling a strings */ - -const char *Strsafe(const char *); - -void Strsafe_init(void); -int Strsafe_insert(const char *); -const char *Strsafe_find(const char *); - -/* Routines for handling symbols of the grammar */ - -struct symbol *Symbol_new(const char *); -int Symbolcmpp(const void *, const void *); -void Symbol_init(void); -int Symbol_insert(struct symbol *, const char *); -struct symbol *Symbol_find(const char *); -struct symbol *Symbol_Nth(int); -int Symbol_count(void); -struct symbol **Symbol_arrayof(void); - -/* Routines to manage the state table */ - -int Configcmp(const char *, const char *); -struct state *State_new(void); -void State_init(void); -int State_insert(struct state *, struct config *); -struct state *State_find(struct config *); -struct state **State_arrayof(void); - -/* Routines used for efficiency in Configlist_add */ - -void Configtable_init(void); -int Configtable_insert(struct config *); -struct config *Configtable_find(struct config *); -void Configtable_clear(int(*)(struct config *)); - -/****************** From the file "action.c" *******************************/ -/* -** Routines processing parser actions in the LEMON parser generator. -*/ - -/* Allocate a new parser action */ -static struct action *Action_new(void){ - static struct action *freelist = 0; - struct action *newaction; - - if( freelist==0 ){ - int i; - int amt = 100; - freelist = (struct action *)calloc(amt, sizeof(struct action)); - if( freelist==0 ){ - fprintf(stderr,"Unable to allocate memory for a new parser action."); - exit(1); - } - for(i=0; inext; - return newaction; -} - -/* Compare two actions for sorting purposes. Return negative, zero, or -** positive if the first action is less than, equal to, or greater than -** the first -*/ -static int actioncmp( - struct action *ap1, - struct action *ap2 -){ - int rc; - rc = ap1->sp->index - ap2->sp->index; - if( rc==0 ){ - rc = (int)ap1->type - (int)ap2->type; - } - if( rc==0 && (ap1->type==REDUCE || ap1->type==SHIFTREDUCE) ){ - rc = ap1->x.rp->index - ap2->x.rp->index; - } - if( rc==0 ){ - rc = (int) (ap2 - ap1); - } - return rc; -} - -/* Sort parser actions */ -static struct action *Action_sort( - struct action *ap -){ - ap = (struct action *)msort((char *)ap,(char **)&ap->next, - (int(*)(const char*,const char*))actioncmp); - return ap; -} - -void Action_add( - struct action **app, - enum e_action type, - struct symbol *sp, - char *arg -){ - struct action *newaction; - newaction = Action_new(); - newaction->next = *app; - *app = newaction; - newaction->type = type; - newaction->sp = sp; - newaction->spOpt = 0; - if( type==SHIFT ){ - newaction->x.stp = (struct state *)arg; - }else{ - newaction->x.rp = (struct rule *)arg; - } -} -/********************** New code to implement the "acttab" module ***********/ -/* -** This module implements routines use to construct the yy_action[] table. -*/ - -/* -** The state of the yy_action table under construction is an instance of -** the following structure. -** -** The yy_action table maps the pair (state_number, lookahead) into an -** action_number. The table is an array of integers pairs. The state_number -** determines an initial offset into the yy_action array. The lookahead -** value is then added to this initial offset to get an index X into the -** yy_action array. If the aAction[X].lookahead equals the value of the -** of the lookahead input, then the value of the action_number output is -** aAction[X].action. If the lookaheads do not match then the -** default action for the state_number is returned. -** -** All actions associated with a single state_number are first entered -** into aLookahead[] using multiple calls to acttab_action(). Then the -** actions for that single state_number are placed into the aAction[] -** array with a single call to acttab_insert(). The acttab_insert() call -** also resets the aLookahead[] array in preparation for the next -** state number. -*/ -struct lookahead_action { - int lookahead; /* Value of the lookahead token */ - int action; /* Action to take on the given lookahead */ -}; -typedef struct acttab acttab; -struct acttab { - int nAction; /* Number of used slots in aAction[] */ - int nActionAlloc; /* Slots allocated for aAction[] */ - struct lookahead_action - *aAction, /* The yy_action[] table under construction */ - *aLookahead; /* A single new transaction set */ - int mnLookahead; /* Minimum aLookahead[].lookahead */ - int mnAction; /* Action associated with mnLookahead */ - int mxLookahead; /* Maximum aLookahead[].lookahead */ - int nLookahead; /* Used slots in aLookahead[] */ - int nLookaheadAlloc; /* Slots allocated in aLookahead[] */ -}; - -/* Return the number of entries in the yy_action table */ -#define acttab_size(X) ((X)->nAction) - -/* The value for the N-th entry in yy_action */ -#define acttab_yyaction(X,N) ((X)->aAction[N].action) - -/* The value for the N-th entry in yy_lookahead */ -#define acttab_yylookahead(X,N) ((X)->aAction[N].lookahead) - -/* Free all memory associated with the given acttab */ -void acttab_free(acttab *p){ - free( p->aAction ); - free( p->aLookahead ); - free( p ); -} - -/* Allocate a new acttab structure */ -acttab *acttab_alloc(void){ - acttab *p = (acttab *) calloc( 1, sizeof(*p) ); - if( p==0 ){ - fprintf(stderr,"Unable to allocate memory for a new acttab."); - exit(1); - } - memset(p, 0, sizeof(*p)); - return p; -} - -/* Add a new action to the current transaction set. -** -** This routine is called once for each lookahead for a particular -** state. -*/ -void acttab_action(acttab *p, int lookahead, int action){ - if( p->nLookahead>=p->nLookaheadAlloc ){ - p->nLookaheadAlloc += 25; - p->aLookahead = (struct lookahead_action *) realloc( p->aLookahead, - sizeof(p->aLookahead[0])*p->nLookaheadAlloc ); - if( p->aLookahead==0 ){ - fprintf(stderr,"malloc failed\n"); - exit(1); - } - } - if( p->nLookahead==0 ){ - p->mxLookahead = lookahead; - p->mnLookahead = lookahead; - p->mnAction = action; - }else{ - if( p->mxLookaheadmxLookahead = lookahead; - if( p->mnLookahead>lookahead ){ - p->mnLookahead = lookahead; - p->mnAction = action; - } - } - p->aLookahead[p->nLookahead].lookahead = lookahead; - p->aLookahead[p->nLookahead].action = action; - p->nLookahead++; -} - -/* -** Add the transaction set built up with prior calls to acttab_action() -** into the current action table. Then reset the transaction set back -** to an empty set in preparation for a new round of acttab_action() calls. -** -** Return the offset into the action table of the new transaction. -*/ -int acttab_insert(acttab *p){ - int i, j, k, n; - assert( p->nLookahead>0 ); - - /* Make sure we have enough space to hold the expanded action table - ** in the worst case. The worst case occurs if the transaction set - ** must be appended to the current action table - */ - n = p->mxLookahead + 1; - if( p->nAction + n >= p->nActionAlloc ){ - int oldAlloc = p->nActionAlloc; - p->nActionAlloc = p->nAction + n + p->nActionAlloc + 20; - p->aAction = (struct lookahead_action *) realloc( p->aAction, - sizeof(p->aAction[0])*p->nActionAlloc); - if( p->aAction==0 ){ - fprintf(stderr,"malloc failed\n"); - exit(1); - } - for(i=oldAlloc; inActionAlloc; i++){ - p->aAction[i].lookahead = -1; - p->aAction[i].action = -1; - } - } - - /* Scan the existing action table looking for an offset that is a - ** duplicate of the current transaction set. Fall out of the loop - ** if and when the duplicate is found. - ** - ** i is the index in p->aAction[] where p->mnLookahead is inserted. - */ - for(i=p->nAction-1; i>=0; i--){ - if( p->aAction[i].lookahead==p->mnLookahead ){ - /* All lookaheads and actions in the aLookahead[] transaction - ** must match against the candidate aAction[i] entry. */ - if( p->aAction[i].action!=p->mnAction ) continue; - for(j=0; jnLookahead; j++){ - k = p->aLookahead[j].lookahead - p->mnLookahead + i; - if( k<0 || k>=p->nAction ) break; - if( p->aLookahead[j].lookahead!=p->aAction[k].lookahead ) break; - if( p->aLookahead[j].action!=p->aAction[k].action ) break; - } - if( jnLookahead ) continue; - - /* No possible lookahead value that is not in the aLookahead[] - ** transaction is allowed to match aAction[i] */ - n = 0; - for(j=0; jnAction; j++){ - if( p->aAction[j].lookahead<0 ) continue; - if( p->aAction[j].lookahead==j+p->mnLookahead-i ) n++; - } - if( n==p->nLookahead ){ - break; /* An exact match is found at offset i */ - } - } - } - - /* If no existing offsets exactly match the current transaction, find an - ** an empty offset in the aAction[] table in which we can add the - ** aLookahead[] transaction. - */ - if( i<0 ){ - /* Look for holes in the aAction[] table that fit the current - ** aLookahead[] transaction. Leave i set to the offset of the hole. - ** If no holes are found, i is left at p->nAction, which means the - ** transaction will be appended. */ - for(i=0; inActionAlloc - p->mxLookahead; i++){ - if( p->aAction[i].lookahead<0 ){ - for(j=0; jnLookahead; j++){ - k = p->aLookahead[j].lookahead - p->mnLookahead + i; - if( k<0 ) break; - if( p->aAction[k].lookahead>=0 ) break; - } - if( jnLookahead ) continue; - for(j=0; jnAction; j++){ - if( p->aAction[j].lookahead==j+p->mnLookahead-i ) break; - } - if( j==p->nAction ){ - break; /* Fits in empty slots */ - } - } - } - } - /* Insert transaction set at index i. */ - for(j=0; jnLookahead; j++){ - k = p->aLookahead[j].lookahead - p->mnLookahead + i; - p->aAction[k] = p->aLookahead[j]; - if( k>=p->nAction ) p->nAction = k+1; - } - p->nLookahead = 0; - - /* Return the offset that is added to the lookahead in order to get the - ** index into yy_action of the action */ - return i - p->mnLookahead; -} - -/********************** From the file "build.c" *****************************/ -/* -** Routines to construction the finite state machine for the LEMON -** parser generator. -*/ - -/* Find a precedence symbol of every rule in the grammar. -** -** Those rules which have a precedence symbol coded in the input -** grammar using the "[symbol]" construct will already have the -** rp->precsym field filled. Other rules take as their precedence -** symbol the first RHS symbol with a defined precedence. If there -** are not RHS symbols with a defined precedence, the precedence -** symbol field is left blank. -*/ -void FindRulePrecedences(struct lemon *xp) -{ - struct rule *rp; - for(rp=xp->rule; rp; rp=rp->next){ - if( rp->precsym==0 ){ - int i, j; - for(i=0; inrhs && rp->precsym==0; i++){ - struct symbol *sp = rp->rhs[i]; - if( sp->type==MULTITERMINAL ){ - for(j=0; jnsubsym; j++){ - if( sp->subsym[j]->prec>=0 ){ - rp->precsym = sp->subsym[j]; - break; - } - } - }else if( sp->prec>=0 ){ - rp->precsym = rp->rhs[i]; - } - } - } - } - return; -} - -/* Find all nonterminals which will generate the empty string. -** Then go back and compute the first sets of every nonterminal. -** The first set is the set of all terminal symbols which can begin -** a string generated by that nonterminal. -*/ -void FindFirstSets(struct lemon *lemp) -{ - int i, j; - struct rule *rp; - int progress; - - for(i=0; insymbol; i++){ - lemp->symbols[i]->lambda = LEMON_FALSE; - } - for(i=lemp->nterminal; insymbol; i++){ - lemp->symbols[i]->firstset = SetNew(); - } - - /* First compute all lambdas */ - do{ - progress = 0; - for(rp=lemp->rule; rp; rp=rp->next){ - if( rp->lhs->lambda ) continue; - for(i=0; inrhs; i++){ - struct symbol *sp = rp->rhs[i]; - assert( sp->type==NONTERMINAL || sp->lambda==LEMON_FALSE ); - if( sp->lambda==LEMON_FALSE ) break; - } - if( i==rp->nrhs ){ - rp->lhs->lambda = LEMON_TRUE; - progress = 1; - } - } - }while( progress ); - - /* Now compute all first sets */ - do{ - struct symbol *s1, *s2; - progress = 0; - for(rp=lemp->rule; rp; rp=rp->next){ - s1 = rp->lhs; - for(i=0; inrhs; i++){ - s2 = rp->rhs[i]; - if( s2->type==TERMINAL ){ - progress += SetAdd(s1->firstset,s2->index); - break; - }else if( s2->type==MULTITERMINAL ){ - for(j=0; jnsubsym; j++){ - progress += SetAdd(s1->firstset,s2->subsym[j]->index); - } - break; - }else if( s1==s2 ){ - if( s1->lambda==LEMON_FALSE ) break; - }else{ - progress += SetUnion(s1->firstset,s2->firstset); - if( s2->lambda==LEMON_FALSE ) break; - } - } - } - }while( progress ); - return; -} - -/* Compute all LR(0) states for the grammar. Links -** are added to between some states so that the LR(1) follow sets -** can be computed later. -*/ -PRIVATE struct state *getstate(struct lemon *); /* forward reference */ -void FindStates(struct lemon *lemp) -{ - struct symbol *sp; - struct rule *rp; - - Configlist_init(); - - /* Find the start symbol */ - if( lemp->start ){ - sp = Symbol_find(lemp->start); - if( sp==0 ){ - ErrorMsg(lemp->filename,0, -"The specified start symbol \"%s\" is not \ -in a nonterminal of the grammar. \"%s\" will be used as the start \ -symbol instead.",lemp->start,lemp->startRule->lhs->name); - lemp->errorcnt++; - sp = lemp->startRule->lhs; - } - }else{ - sp = lemp->startRule->lhs; - } - - /* Make sure the start symbol doesn't occur on the right-hand side of - ** any rule. Report an error if it does. (YACC would generate a new - ** start symbol in this case.) */ - for(rp=lemp->rule; rp; rp=rp->next){ - int i; - for(i=0; inrhs; i++){ - if( rp->rhs[i]==sp ){ /* FIX ME: Deal with multiterminals */ - ErrorMsg(lemp->filename,0, -"The start symbol \"%s\" occurs on the \ -right-hand side of a rule. This will result in a parser which \ -does not work properly.",sp->name); - lemp->errorcnt++; - } - } - } - - /* The basis configuration set for the first state - ** is all rules which have the start symbol as their - ** left-hand side */ - for(rp=sp->rule; rp; rp=rp->nextlhs){ - struct config *newcfp; - rp->lhsStart = 1; - newcfp = Configlist_addbasis(rp,0); - SetAdd(newcfp->fws,0); - } - - /* Compute the first state. All other states will be - ** computed automatically during the computation of the first one. - ** The returned pointer to the first state is not used. */ - (void)getstate(lemp); - return; -} - -/* Return a pointer to a state which is described by the configuration -** list which has been built from calls to Configlist_add. -*/ -PRIVATE void buildshifts(struct lemon *, struct state *); /* Forwd ref */ -PRIVATE struct state *getstate(struct lemon *lemp) -{ - struct config *cfp, *bp; - struct state *stp; - - /* Extract the sorted basis of the new state. The basis was constructed - ** by prior calls to "Configlist_addbasis()". */ - Configlist_sortbasis(); - bp = Configlist_basis(); - - /* Get a state with the same basis */ - stp = State_find(bp); - if( stp ){ - /* A state with the same basis already exists! Copy all the follow-set - ** propagation links from the state under construction into the - ** preexisting state, then return a pointer to the preexisting state */ - struct config *x, *y; - for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){ - Plink_copy(&y->bplp,x->bplp); - Plink_delete(x->fplp); - x->fplp = x->bplp = 0; - } - cfp = Configlist_return(); - Configlist_eat(cfp); - }else{ - /* This really is a new state. Construct all the details */ - Configlist_closure(lemp); /* Compute the configuration closure */ - Configlist_sort(); /* Sort the configuration closure */ - cfp = Configlist_return(); /* Get a pointer to the config list */ - stp = State_new(); /* A new state structure */ - MemoryCheck(stp); - stp->bp = bp; /* Remember the configuration basis */ - stp->cfp = cfp; /* Remember the configuration closure */ - stp->statenum = lemp->nstate++; /* Every state gets a sequence number */ - stp->ap = 0; /* No actions, yet. */ - State_insert(stp,stp->bp); /* Add to the state table */ - buildshifts(lemp,stp); /* Recursively compute successor states */ - } - return stp; -} - -/* -** Return true if two symbols are the same. -*/ -int same_symbol(struct symbol *a, struct symbol *b) -{ - int i; - if( a==b ) return 1; - if( a->type!=MULTITERMINAL ) return 0; - if( b->type!=MULTITERMINAL ) return 0; - if( a->nsubsym!=b->nsubsym ) return 0; - for(i=0; insubsym; i++){ - if( a->subsym[i]!=b->subsym[i] ) return 0; - } - return 1; -} - -/* Construct all successor states to the given state. A "successor" -** state is any state which can be reached by a shift action. -*/ -PRIVATE void buildshifts(struct lemon *lemp, struct state *stp) -{ - struct config *cfp; /* For looping thru the config closure of "stp" */ - struct config *bcfp; /* For the inner loop on config closure of "stp" */ - struct config *newcfg; /* */ - struct symbol *sp; /* Symbol following the dot in configuration "cfp" */ - struct symbol *bsp; /* Symbol following the dot in configuration "bcfp" */ - struct state *newstp; /* A pointer to a successor state */ - - /* Each configuration becomes complete after it contributes to a successor - ** state. Initially, all configurations are incomplete */ - for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE; - - /* Loop through all configurations of the state "stp" */ - for(cfp=stp->cfp; cfp; cfp=cfp->next){ - if( cfp->status==COMPLETE ) continue; /* Already used by inner loop */ - if( cfp->dot>=cfp->rp->nrhs ) continue; /* Can't shift this config */ - Configlist_reset(); /* Reset the new config set */ - sp = cfp->rp->rhs[cfp->dot]; /* Symbol after the dot */ - - /* For every configuration in the state "stp" which has the symbol "sp" - ** following its dot, add the same configuration to the basis set under - ** construction but with the dot shifted one symbol to the right. */ - for(bcfp=cfp; bcfp; bcfp=bcfp->next){ - if( bcfp->status==COMPLETE ) continue; /* Already used */ - if( bcfp->dot>=bcfp->rp->nrhs ) continue; /* Can't shift this one */ - bsp = bcfp->rp->rhs[bcfp->dot]; /* Get symbol after dot */ - if( !same_symbol(bsp,sp) ) continue; /* Must be same as for "cfp" */ - bcfp->status = COMPLETE; /* Mark this config as used */ - newcfg = Configlist_addbasis(bcfp->rp,bcfp->dot+1); - Plink_add(&newcfg->bplp,bcfp); - } - - /* Get a pointer to the state described by the basis configuration set - ** constructed in the preceding loop */ - newstp = getstate(lemp); - - /* The state "newstp" is reached from the state "stp" by a shift action - ** on the symbol "sp" */ - if( sp->type==MULTITERMINAL ){ - int i; - for(i=0; insubsym; i++){ - Action_add(&stp->ap,SHIFT,sp->subsym[i],(char*)newstp); - } - }else{ - Action_add(&stp->ap,SHIFT,sp,(char *)newstp); - } - } -} - -/* -** Construct the propagation links -*/ -void FindLinks(struct lemon *lemp) -{ - int i; - struct config *cfp, *other; - struct state *stp; - struct plink *plp; - - /* Housekeeping detail: - ** Add to every propagate link a pointer back to the state to - ** which the link is attached. */ - for(i=0; instate; i++){ - stp = lemp->sorted[i]; - for(cfp=stp->cfp; cfp; cfp=cfp->next){ - cfp->stp = stp; - } - } - - /* Convert all backlinks into forward links. Only the forward - ** links are used in the follow-set computation. */ - for(i=0; instate; i++){ - stp = lemp->sorted[i]; - for(cfp=stp->cfp; cfp; cfp=cfp->next){ - for(plp=cfp->bplp; plp; plp=plp->next){ - other = plp->cfp; - Plink_add(&other->fplp,cfp); - } - } - } -} - -/* Compute all followsets. -** -** A followset is the set of all symbols which can come immediately -** after a configuration. -*/ -void FindFollowSets(struct lemon *lemp) -{ - int i; - struct config *cfp; - struct plink *plp; - int progress; - int change; - - for(i=0; instate; i++){ - for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ - cfp->status = INCOMPLETE; - } - } - - do{ - progress = 0; - for(i=0; instate; i++){ - for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ - if( cfp->status==COMPLETE ) continue; - for(plp=cfp->fplp; plp; plp=plp->next){ - change = SetUnion(plp->cfp->fws,cfp->fws); - if( change ){ - plp->cfp->status = INCOMPLETE; - progress = 1; - } - } - cfp->status = COMPLETE; - } - } - }while( progress ); -} - -static int resolve_conflict(struct action *,struct action *); - -/* Compute the reduce actions, and resolve conflicts. -*/ -void FindActions(struct lemon *lemp) -{ - int i,j; - struct config *cfp; - struct state *stp; - struct symbol *sp; - struct rule *rp; - - /* Add all of the reduce actions - ** A reduce action is added for each element of the followset of - ** a configuration which has its dot at the extreme right. - */ - for(i=0; instate; i++){ /* Loop over all states */ - stp = lemp->sorted[i]; - for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */ - if( cfp->rp->nrhs==cfp->dot ){ /* Is dot at extreme right? */ - for(j=0; jnterminal; j++){ - if( SetFind(cfp->fws,j) ){ - /* Add a reduce action to the state "stp" which will reduce by the - ** rule "cfp->rp" if the lookahead symbol is "lemp->symbols[j]" */ - Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp); - } - } - } - } - } - - /* Add the accepting token */ - if( lemp->start ){ - sp = Symbol_find(lemp->start); - if( sp==0 ) sp = lemp->startRule->lhs; - }else{ - sp = lemp->startRule->lhs; - } - /* Add to the first state (which is always the starting state of the - ** finite state machine) an action to ACCEPT if the lookahead is the - ** start nonterminal. */ - Action_add(&lemp->sorted[0]->ap,ACCEPT,sp,0); - - /* Resolve conflicts */ - for(i=0; instate; i++){ - struct action *ap, *nap; - stp = lemp->sorted[i]; - /* assert( stp->ap ); */ - stp->ap = Action_sort(stp->ap); - for(ap=stp->ap; ap && ap->next; ap=ap->next){ - for(nap=ap->next; nap && nap->sp==ap->sp; nap=nap->next){ - /* The two actions "ap" and "nap" have the same lookahead. - ** Figure out which one should be used */ - lemp->nconflict += resolve_conflict(ap,nap); - } - } - } - - /* Report an error for each rule that can never be reduced. */ - for(rp=lemp->rule; rp; rp=rp->next) rp->canReduce = LEMON_FALSE; - for(i=0; instate; i++){ - struct action *ap; - for(ap=lemp->sorted[i]->ap; ap; ap=ap->next){ - if( ap->type==REDUCE ) ap->x.rp->canReduce = LEMON_TRUE; - } - } - for(rp=lemp->rule; rp; rp=rp->next){ - if( rp->canReduce ) continue; - ErrorMsg(lemp->filename,rp->ruleline,"This rule can not be reduced.\n"); - lemp->errorcnt++; - } -} - -/* Resolve a conflict between the two given actions. If the -** conflict can't be resolved, return non-zero. -** -** NO LONGER TRUE: -** To resolve a conflict, first look to see if either action -** is on an error rule. In that case, take the action which -** is not associated with the error rule. If neither or both -** actions are associated with an error rule, then try to -** use precedence to resolve the conflict. -** -** If either action is a SHIFT, then it must be apx. This -** function won't work if apx->type==REDUCE and apy->type==SHIFT. -*/ -static int resolve_conflict( - struct action *apx, - struct action *apy -){ - struct symbol *spx, *spy; - int errcnt = 0; - assert( apx->sp==apy->sp ); /* Otherwise there would be no conflict */ - if( apx->type==SHIFT && apy->type==SHIFT ){ - apy->type = SSCONFLICT; - errcnt++; - } - if( apx->type==SHIFT && apy->type==REDUCE ){ - spx = apx->sp; - spy = apy->x.rp->precsym; - if( spy==0 || spx->prec<0 || spy->prec<0 ){ - /* Not enough precedence information. */ - apy->type = SRCONFLICT; - errcnt++; - }else if( spx->prec>spy->prec ){ /* higher precedence wins */ - apy->type = RD_RESOLVED; - }else if( spx->precprec ){ - apx->type = SH_RESOLVED; - }else if( spx->prec==spy->prec && spx->assoc==RIGHT ){ /* Use operator */ - apy->type = RD_RESOLVED; /* associativity */ - }else if( spx->prec==spy->prec && spx->assoc==LEFT ){ /* to break tie */ - apx->type = SH_RESOLVED; - }else{ - assert( spx->prec==spy->prec && spx->assoc==NONE ); - apx->type = ERROR; - } - }else if( apx->type==REDUCE && apy->type==REDUCE ){ - spx = apx->x.rp->precsym; - spy = apy->x.rp->precsym; - if( spx==0 || spy==0 || spx->prec<0 || - spy->prec<0 || spx->prec==spy->prec ){ - apy->type = RRCONFLICT; - errcnt++; - }else if( spx->prec>spy->prec ){ - apy->type = RD_RESOLVED; - }else if( spx->precprec ){ - apx->type = RD_RESOLVED; - } - }else{ - assert( - apx->type==SH_RESOLVED || - apx->type==RD_RESOLVED || - apx->type==SSCONFLICT || - apx->type==SRCONFLICT || - apx->type==RRCONFLICT || - apy->type==SH_RESOLVED || - apy->type==RD_RESOLVED || - apy->type==SSCONFLICT || - apy->type==SRCONFLICT || - apy->type==RRCONFLICT - ); - /* The REDUCE/SHIFT case cannot happen because SHIFTs come before - ** REDUCEs on the list. If we reach this point it must be because - ** the parser conflict had already been resolved. */ - } - return errcnt; -} -/********************* From the file "configlist.c" *************************/ -/* -** Routines to processing a configuration list and building a state -** in the LEMON parser generator. -*/ - -static struct config *freelist = 0; /* List of free configurations */ -static struct config *current = 0; /* Top of list of configurations */ -static struct config **currentend = 0; /* Last on list of configs */ -static struct config *basis = 0; /* Top of list of basis configs */ -static struct config **basisend = 0; /* End of list of basis configs */ - -/* Return a pointer to a new configuration */ -PRIVATE struct config *newconfig(void){ - struct config *newcfg; - if( freelist==0 ){ - int i; - int amt = 3; - freelist = (struct config *)calloc( amt, sizeof(struct config) ); - if( freelist==0 ){ - fprintf(stderr,"Unable to allocate memory for a new configuration."); - exit(1); - } - for(i=0; inext; - return newcfg; -} - -/* The configuration "old" is no longer used */ -PRIVATE void deleteconfig(struct config *old) -{ - old->next = freelist; - freelist = old; -} - -/* Initialized the configuration list builder */ -void Configlist_init(void){ - current = 0; - currentend = ¤t; - basis = 0; - basisend = &basis; - Configtable_init(); - return; -} - -/* Initialized the configuration list builder */ -void Configlist_reset(void){ - current = 0; - currentend = ¤t; - basis = 0; - basisend = &basis; - Configtable_clear(0); - return; -} - -/* Add another configuration to the configuration list */ -struct config *Configlist_add( - struct rule *rp, /* The rule */ - int dot /* Index into the RHS of the rule where the dot goes */ -){ - struct config *cfp, model; - - assert( currentend!=0 ); - model.rp = rp; - model.dot = dot; - cfp = Configtable_find(&model); - if( cfp==0 ){ - cfp = newconfig(); - cfp->rp = rp; - cfp->dot = dot; - cfp->fws = SetNew(); - cfp->stp = 0; - cfp->fplp = cfp->bplp = 0; - cfp->next = 0; - cfp->bp = 0; - *currentend = cfp; - currentend = &cfp->next; - Configtable_insert(cfp); - } - return cfp; -} - -/* Add a basis configuration to the configuration list */ -struct config *Configlist_addbasis(struct rule *rp, int dot) -{ - struct config *cfp, model; - - assert( basisend!=0 ); - assert( currentend!=0 ); - model.rp = rp; - model.dot = dot; - cfp = Configtable_find(&model); - if( cfp==0 ){ - cfp = newconfig(); - cfp->rp = rp; - cfp->dot = dot; - cfp->fws = SetNew(); - cfp->stp = 0; - cfp->fplp = cfp->bplp = 0; - cfp->next = 0; - cfp->bp = 0; - *currentend = cfp; - currentend = &cfp->next; - *basisend = cfp; - basisend = &cfp->bp; - Configtable_insert(cfp); - } - return cfp; -} - -/* Compute the closure of the configuration list */ -void Configlist_closure(struct lemon *lemp) -{ - struct config *cfp, *newcfp; - struct rule *rp, *newrp; - struct symbol *sp, *xsp; - int i, dot; - - assert( currentend!=0 ); - for(cfp=current; cfp; cfp=cfp->next){ - rp = cfp->rp; - dot = cfp->dot; - if( dot>=rp->nrhs ) continue; - sp = rp->rhs[dot]; - if( sp->type==NONTERMINAL ){ - if( sp->rule==0 && sp!=lemp->errsym ){ - ErrorMsg(lemp->filename,rp->line,"Nonterminal \"%s\" has no rules.", - sp->name); - lemp->errorcnt++; - } - for(newrp=sp->rule; newrp; newrp=newrp->nextlhs){ - newcfp = Configlist_add(newrp,0); - for(i=dot+1; inrhs; i++){ - xsp = rp->rhs[i]; - if( xsp->type==TERMINAL ){ - SetAdd(newcfp->fws,xsp->index); - break; - }else if( xsp->type==MULTITERMINAL ){ - int k; - for(k=0; knsubsym; k++){ - SetAdd(newcfp->fws, xsp->subsym[k]->index); - } - break; - }else{ - SetUnion(newcfp->fws,xsp->firstset); - if( xsp->lambda==LEMON_FALSE ) break; - } - } - if( i==rp->nrhs ) Plink_add(&cfp->fplp,newcfp); - } - } - } - return; -} - -/* Sort the configuration list */ -void Configlist_sort(void){ - current = (struct config*)msort((char*)current,(char**)&(current->next), - Configcmp); - currentend = 0; - return; -} - -/* Sort the basis configuration list */ -void Configlist_sortbasis(void){ - basis = (struct config*)msort((char*)current,(char**)&(current->bp), - Configcmp); - basisend = 0; - return; -} - -/* Return a pointer to the head of the configuration list and -** reset the list */ -struct config *Configlist_return(void){ - struct config *old; - old = current; - current = 0; - currentend = 0; - return old; -} - -/* Return a pointer to the head of the configuration list and -** reset the list */ -struct config *Configlist_basis(void){ - struct config *old; - old = basis; - basis = 0; - basisend = 0; - return old; -} - -/* Free all elements of the given configuration list */ -void Configlist_eat(struct config *cfp) -{ - struct config *nextcfp; - for(; cfp; cfp=nextcfp){ - nextcfp = cfp->next; - assert( cfp->fplp==0 ); - assert( cfp->bplp==0 ); - if( cfp->fws ) SetFree(cfp->fws); - deleteconfig(cfp); - } - return; -} -/***************** From the file "error.c" *********************************/ -/* -** Code for printing error message. -*/ - -void ErrorMsg(const char *filename, int lineno, const char *format, ...){ - va_list ap; - fprintf(stderr, "%s:%d: ", filename, lineno); - va_start(ap, format); - vfprintf(stderr,format,ap); - va_end(ap); - fprintf(stderr, "\n"); -} -/**************** From the file "main.c" ************************************/ -/* -** Main program file for the LEMON parser generator. -*/ - -/* Report an out-of-memory condition and abort. This function -** is used mostly by the "MemoryCheck" macro in struct.h -*/ -void memory_error(void){ - fprintf(stderr,"Out of memory. Aborting...\n"); - exit(1); -} - -static int nDefine = 0; /* Number of -D options on the command line */ -static char **azDefine = 0; /* Name of the -D macros */ - -/* This routine is called with the argument to each -D command-line option. -** Add the macro defined to the azDefine array. -*/ -static void handle_D_option(char *z){ - char **paz; - nDefine++; - azDefine = (char **) realloc(azDefine, sizeof(azDefine[0])*nDefine); - if( azDefine==0 ){ - fprintf(stderr,"out of memory\n"); - exit(1); - } - paz = &azDefine[nDefine-1]; - *paz = (char *) malloc( lemonStrlen(z)+1 ); - if( *paz==0 ){ - fprintf(stderr,"out of memory\n"); - exit(1); - } - lemon_strcpy(*paz, z); - for(z=*paz; *z && *z!='='; z++){} - *z = 0; -} - -static char *user_templatename = NULL; -static void handle_T_option(char *z){ - user_templatename = (char *) malloc( lemonStrlen(z)+1 ); - if( user_templatename==0 ){ - memory_error(); - } - lemon_strcpy(user_templatename, z); -} - -/* Merge together to lists of rules ordered by rule.iRule */ -static struct rule *Rule_merge(struct rule *pA, struct rule *pB){ - struct rule *pFirst = 0; - struct rule **ppPrev = &pFirst; - while( pA && pB ){ - if( pA->iRuleiRule ){ - *ppPrev = pA; - ppPrev = &pA->next; - pA = pA->next; - }else{ - *ppPrev = pB; - ppPrev = &pB->next; - pB = pB->next; - } - } - if( pA ){ - *ppPrev = pA; - }else{ - *ppPrev = pB; - } - return pFirst; -} - -/* -** Sort a list of rules in order of increasing iRule value -*/ -static struct rule *Rule_sort(struct rule *rp){ - int i; - struct rule *pNext; - struct rule *x[32]; - memset(x, 0, sizeof(x)); - while( rp ){ - pNext = rp->next; - rp->next = 0; - for(i=0; iuseCnt = 0; - - /* Parse the input file */ - Parse(&lem); - if( lem.errorcnt ) exit(lem.errorcnt); - if( lem.nrule==0 ){ - fprintf(stderr,"Empty grammar.\n"); - exit(1); - } - - /* Count and index the symbols of the grammar */ - Symbol_new("{default}"); - lem.nsymbol = Symbol_count(); - lem.symbols = Symbol_arrayof(); - for(i=0; iindex = i; - qsort(lem.symbols,lem.nsymbol,sizeof(struct symbol*), Symbolcmpp); - for(i=0; iindex = i; - while( lem.symbols[i-1]->type==MULTITERMINAL ){ i--; } - assert( strcmp(lem.symbols[i-1]->name,"{default}")==0 ); - lem.nsymbol = i - 1; - for(i=1; ISUPPER(lem.symbols[i]->name[0]); i++); - lem.nterminal = i; - - /* Assign sequential rule numbers. Start with 0. Put rules that have no - ** reduce action C-code associated with them last, so that the switch() - ** statement that selects reduction actions will have a smaller jump table. - */ - for(i=0, rp=lem.rule; rp; rp=rp->next){ - rp->iRule = rp->code ? i++ : -1; - } - for(rp=lem.rule; rp; rp=rp->next){ - if( rp->iRule<0 ) rp->iRule = i++; - } - lem.startRule = lem.rule; - lem.rule = Rule_sort(lem.rule); - - /* Generate a reprint of the grammar, if requested on the command line */ - if( rpflag ){ - Reprint(&lem); - }else{ - /* Initialize the size for all follow and first sets */ - SetSize(lem.nterminal+1); - - /* Find the precedence for every production rule (that has one) */ - FindRulePrecedences(&lem); - - /* Compute the lambda-nonterminals and the first-sets for every - ** nonterminal */ - FindFirstSets(&lem); - - /* Compute all LR(0) states. Also record follow-set propagation - ** links so that the follow-set can be computed later */ - lem.nstate = 0; - FindStates(&lem); - lem.sorted = State_arrayof(); - - /* Tie up loose ends on the propagation links */ - FindLinks(&lem); - - /* Compute the follow set of every reducible configuration */ - FindFollowSets(&lem); - - /* Compute the action tables */ - FindActions(&lem); - - /* Compress the action tables */ - if( compress==0 ) CompressTables(&lem); - - /* Reorder and renumber the states so that states with fewer choices - ** occur at the end. This is an optimization that helps make the - ** generated parser tables smaller. */ - if( noResort==0 ) ResortStates(&lem); - - /* Generate a report of the parser generated. (the "y.output" file) */ - if( !quiet ) ReportOutput(&lem); - - /* Generate the source code for the parser */ - ReportTable(&lem, mhflag); - - /* Produce a header file for use by the scanner. (This step is - ** omitted if the "-m" option is used because makeheaders will - ** generate the file for us.) */ - if( !mhflag ) ReportHeader(&lem); - } - if( statistics ){ - printf("Parser statistics:\n"); - stats_line("terminal symbols", lem.nterminal); - stats_line("non-terminal symbols", lem.nsymbol - lem.nterminal); - stats_line("total symbols", lem.nsymbol); - stats_line("rules", lem.nrule); - stats_line("states", lem.nxstate); - stats_line("conflicts", lem.nconflict); - stats_line("action table entries", lem.nactiontab); - stats_line("total table size (bytes)", lem.tablesize); - } - if( lem.nconflict > 0 ){ - fprintf(stderr,"%d parsing conflicts.\n",lem.nconflict); - } - - /* return 0 on success, 1 on failure. */ - exitcode = ((lem.errorcnt > 0) || (lem.nconflict > 0)) ? 1 : 0; - exit(exitcode); - return (exitcode); -} -/******************** From the file "msort.c" *******************************/ -/* -** A generic merge-sort program. -** -** USAGE: -** Let "ptr" be a pointer to some structure which is at the head of -** a null-terminated list. Then to sort the list call: -** -** ptr = msort(ptr,&(ptr->next),cmpfnc); -** -** In the above, "cmpfnc" is a pointer to a function which compares -** two instances of the structure and returns an integer, as in -** strcmp. The second argument is a pointer to the pointer to the -** second element of the linked list. This address is used to compute -** the offset to the "next" field within the structure. The offset to -** the "next" field must be constant for all structures in the list. -** -** The function returns a new pointer which is the head of the list -** after sorting. -** -** ALGORITHM: -** Merge-sort. -*/ - -/* -** Return a pointer to the next structure in the linked list. -*/ -#define NEXT(A) (*(char**)(((char*)A)+offset)) - -/* -** Inputs: -** a: A sorted, null-terminated linked list. (May be null). -** b: A sorted, null-terminated linked list. (May be null). -** cmp: A pointer to the comparison function. -** offset: Offset in the structure to the "next" field. -** -** Return Value: -** A pointer to the head of a sorted list containing the elements -** of both a and b. -** -** Side effects: -** The "next" pointers for elements in the lists a and b are -** changed. -*/ -static char *merge( - char *a, - char *b, - int (*cmp)(const char*,const char*), - int offset -){ - char *ptr, *head; - - if( a==0 ){ - head = b; - }else if( b==0 ){ - head = a; - }else{ - if( (*cmp)(a,b)<=0 ){ - ptr = a; - a = NEXT(a); - }else{ - ptr = b; - b = NEXT(b); - } - head = ptr; - while( a && b ){ - if( (*cmp)(a,b)<=0 ){ - NEXT(ptr) = a; - ptr = a; - a = NEXT(a); - }else{ - NEXT(ptr) = b; - ptr = b; - b = NEXT(b); - } - } - if( a ) NEXT(ptr) = a; - else NEXT(ptr) = b; - } - return head; -} - -/* -** Inputs: -** list: Pointer to a singly-linked list of structures. -** next: Pointer to pointer to the second element of the list. -** cmp: A comparison function. -** -** Return Value: -** A pointer to the head of a sorted list containing the elements -** originally in list. -** -** Side effects: -** The "next" pointers for elements in list are changed. -*/ -#define LISTSIZE 30 -static char *msort( - char *list, - char **next, - int (*cmp)(const char*,const char*) -){ - unsigned long offset; - char *ep; - char *set[LISTSIZE]; - int i; - offset = (unsigned long)((char*)next - (char*)list); - for(i=0; istate = WAITING_FOR_DECL_KEYWORD; - }else if( ISLOWER(x[0]) ){ - psp->lhs = Symbol_new(x); - psp->nrhs = 0; - psp->lhsalias = 0; - psp->state = WAITING_FOR_ARROW; - }else if( x[0]=='{' ){ - if( psp->prevrule==0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, -"There is no prior rule upon which to attach the code \ -fragment which begins on this line."); - psp->errorcnt++; - }else if( psp->prevrule->code!=0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, -"Code fragment beginning on this line is not the first \ -to follow the previous rule."); - psp->errorcnt++; - }else{ - psp->prevrule->line = psp->tokenlineno; - psp->prevrule->code = &x[1]; - psp->prevrule->noCode = 0; - } - }else if( x[0]=='[' ){ - psp->state = PRECEDENCE_MARK_1; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Token \"%s\" should be either \"%%\" or a nonterminal name.", - x); - psp->errorcnt++; - } - break; - case PRECEDENCE_MARK_1: - if( !ISUPPER(x[0]) ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "The precedence symbol must be a terminal."); - psp->errorcnt++; - }else if( psp->prevrule==0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "There is no prior rule to assign precedence \"[%s]\".",x); - psp->errorcnt++; - }else if( psp->prevrule->precsym!=0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, -"Precedence mark on this line is not the first \ -to follow the previous rule."); - psp->errorcnt++; - }else{ - psp->prevrule->precsym = Symbol_new(x); - } - psp->state = PRECEDENCE_MARK_2; - break; - case PRECEDENCE_MARK_2: - if( x[0]!=']' ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Missing \"]\" on precedence mark."); - psp->errorcnt++; - } - psp->state = WAITING_FOR_DECL_OR_RULE; - break; - case WAITING_FOR_ARROW: - if( x[0]==':' && x[1]==':' && x[2]=='=' ){ - psp->state = IN_RHS; - }else if( x[0]=='(' ){ - psp->state = LHS_ALIAS_1; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Expected to see a \":\" following the LHS symbol \"%s\".", - psp->lhs->name); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case LHS_ALIAS_1: - if( ISALPHA(x[0]) ){ - psp->lhsalias = x; - psp->state = LHS_ALIAS_2; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "\"%s\" is not a valid alias for the LHS \"%s\"\n", - x,psp->lhs->name); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case LHS_ALIAS_2: - if( x[0]==')' ){ - psp->state = LHS_ALIAS_3; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Missing \")\" following LHS alias name \"%s\".",psp->lhsalias); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case LHS_ALIAS_3: - if( x[0]==':' && x[1]==':' && x[2]=='=' ){ - psp->state = IN_RHS; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Missing \"->\" following: \"%s(%s)\".", - psp->lhs->name,psp->lhsalias); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case IN_RHS: - if( x[0]=='.' ){ - struct rule *rp; - rp = (struct rule *)calloc( sizeof(struct rule) + - sizeof(struct symbol*)*psp->nrhs + sizeof(char*)*psp->nrhs, 1); - if( rp==0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Can't allocate enough memory for this rule."); - psp->errorcnt++; - psp->prevrule = 0; - }else{ - int i; - rp->ruleline = psp->tokenlineno; - rp->rhs = (struct symbol**)&rp[1]; - rp->rhsalias = (const char**)&(rp->rhs[psp->nrhs]); - for(i=0; inrhs; i++){ - rp->rhs[i] = psp->rhs[i]; - rp->rhsalias[i] = psp->alias[i]; - } - rp->lhs = psp->lhs; - rp->lhsalias = psp->lhsalias; - rp->nrhs = psp->nrhs; - rp->code = 0; - rp->noCode = 1; - rp->precsym = 0; - rp->index = psp->gp->nrule++; - rp->nextlhs = rp->lhs->rule; - rp->lhs->rule = rp; - rp->next = 0; - if( psp->firstrule==0 ){ - psp->firstrule = psp->lastrule = rp; - }else{ - psp->lastrule->next = rp; - psp->lastrule = rp; - } - psp->prevrule = rp; - } - psp->state = WAITING_FOR_DECL_OR_RULE; - }else if( ISALPHA(x[0]) ){ - if( psp->nrhs>=MAXRHS ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Too many symbols on RHS of rule beginning at \"%s\".", - x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - }else{ - psp->rhs[psp->nrhs] = Symbol_new(x); - psp->alias[psp->nrhs] = 0; - psp->nrhs++; - } - }else if( (x[0]=='|' || x[0]=='/') && psp->nrhs>0 ){ - struct symbol *msp = psp->rhs[psp->nrhs-1]; - if( msp->type!=MULTITERMINAL ){ - struct symbol *origsp = msp; - msp = (struct symbol *) calloc(1,sizeof(*msp)); - memset(msp, 0, sizeof(*msp)); - msp->type = MULTITERMINAL; - msp->nsubsym = 1; - msp->subsym = (struct symbol **) calloc(1,sizeof(struct symbol*)); - msp->subsym[0] = origsp; - msp->name = origsp->name; - psp->rhs[psp->nrhs-1] = msp; - } - msp->nsubsym++; - msp->subsym = (struct symbol **) realloc(msp->subsym, - sizeof(struct symbol*)*msp->nsubsym); - msp->subsym[msp->nsubsym-1] = Symbol_new(&x[1]); - if( ISLOWER(x[1]) || ISLOWER(msp->subsym[0]->name[0]) ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Cannot form a compound containing a non-terminal"); - psp->errorcnt++; - } - }else if( x[0]=='(' && psp->nrhs>0 ){ - psp->state = RHS_ALIAS_1; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Illegal character on RHS of rule: \"%s\".",x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case RHS_ALIAS_1: - if( ISALPHA(x[0]) ){ - psp->alias[psp->nrhs-1] = x; - psp->state = RHS_ALIAS_2; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "\"%s\" is not a valid alias for the RHS symbol \"%s\"\n", - x,psp->rhs[psp->nrhs-1]->name); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case RHS_ALIAS_2: - if( x[0]==')' ){ - psp->state = IN_RHS; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Missing \")\" following LHS alias name \"%s\".",psp->lhsalias); - psp->errorcnt++; - psp->state = RESYNC_AFTER_RULE_ERROR; - } - break; - case WAITING_FOR_DECL_KEYWORD: - if( ISALPHA(x[0]) ){ - psp->declkeyword = x; - psp->declargslot = 0; - psp->decllinenoslot = 0; - psp->insertLineMacro = 1; - psp->state = WAITING_FOR_DECL_ARG; - if( strcmp(x,"name")==0 ){ - psp->declargslot = &(psp->gp->name); - psp->insertLineMacro = 0; - }else if( strcmp(x,"include")==0 ){ - psp->declargslot = &(psp->gp->include); - }else if( strcmp(x,"code")==0 ){ - psp->declargslot = &(psp->gp->extracode); - }else if( strcmp(x,"token_destructor")==0 ){ - psp->declargslot = &psp->gp->tokendest; - }else if( strcmp(x,"default_destructor")==0 ){ - psp->declargslot = &psp->gp->vardest; - }else if( strcmp(x,"token_prefix")==0 ){ - psp->declargslot = &psp->gp->tokenprefix; - psp->insertLineMacro = 0; - }else if( strcmp(x,"syntax_error")==0 ){ - psp->declargslot = &(psp->gp->error); - }else if( strcmp(x,"parse_accept")==0 ){ - psp->declargslot = &(psp->gp->accept); - }else if( strcmp(x,"parse_failure")==0 ){ - psp->declargslot = &(psp->gp->failure); - }else if( strcmp(x,"stack_overflow")==0 ){ - psp->declargslot = &(psp->gp->overflow); - }else if( strcmp(x,"extra_argument")==0 ){ - psp->declargslot = &(psp->gp->arg); - psp->insertLineMacro = 0; - }else if( strcmp(x,"token_type")==0 ){ - psp->declargslot = &(psp->gp->tokentype); - psp->insertLineMacro = 0; - }else if( strcmp(x,"default_type")==0 ){ - psp->declargslot = &(psp->gp->vartype); - psp->insertLineMacro = 0; - }else if( strcmp(x,"stack_size")==0 ){ - psp->declargslot = &(psp->gp->stacksize); - psp->insertLineMacro = 0; - }else if( strcmp(x,"start_symbol")==0 ){ - psp->declargslot = &(psp->gp->start); - psp->insertLineMacro = 0; - }else if( strcmp(x,"left")==0 ){ - psp->preccounter++; - psp->declassoc = LEFT; - psp->state = WAITING_FOR_PRECEDENCE_SYMBOL; - }else if( strcmp(x,"right")==0 ){ - psp->preccounter++; - psp->declassoc = RIGHT; - psp->state = WAITING_FOR_PRECEDENCE_SYMBOL; - }else if( strcmp(x,"nonassoc")==0 ){ - psp->preccounter++; - psp->declassoc = NONE; - psp->state = WAITING_FOR_PRECEDENCE_SYMBOL; - }else if( strcmp(x,"destructor")==0 ){ - psp->state = WAITING_FOR_DESTRUCTOR_SYMBOL; - }else if( strcmp(x,"type")==0 ){ - psp->state = WAITING_FOR_DATATYPE_SYMBOL; - }else if( strcmp(x,"fallback")==0 ){ - psp->fallback = 0; - psp->state = WAITING_FOR_FALLBACK_ID; - }else if( strcmp(x,"token")==0 ){ - psp->state = WAITING_FOR_TOKEN_NAME; - }else if( strcmp(x,"wildcard")==0 ){ - psp->state = WAITING_FOR_WILDCARD_ID; - }else if( strcmp(x,"token_class")==0 ){ - psp->state = WAITING_FOR_CLASS_ID; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Unknown declaration keyword: \"%%%s\".",x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - } - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Illegal declaration keyword: \"%s\".",x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - } - break; - case WAITING_FOR_DESTRUCTOR_SYMBOL: - if( !ISALPHA(x[0]) ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Symbol name missing after %%destructor keyword"); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - }else{ - struct symbol *sp = Symbol_new(x); - psp->declargslot = &sp->destructor; - psp->decllinenoslot = &sp->destLineno; - psp->insertLineMacro = 1; - psp->state = WAITING_FOR_DECL_ARG; - } - break; - case WAITING_FOR_DATATYPE_SYMBOL: - if( !ISALPHA(x[0]) ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Symbol name missing after %%type keyword"); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - }else{ - struct symbol *sp = Symbol_find(x); - if((sp) && (sp->datatype)){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Symbol %%type \"%s\" already defined", x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - }else{ - if (!sp){ - sp = Symbol_new(x); - } - psp->declargslot = &sp->datatype; - psp->insertLineMacro = 0; - psp->state = WAITING_FOR_DECL_ARG; - } - } - break; - case WAITING_FOR_PRECEDENCE_SYMBOL: - if( x[0]=='.' ){ - psp->state = WAITING_FOR_DECL_OR_RULE; - }else if( ISUPPER(x[0]) ){ - struct symbol *sp; - sp = Symbol_new(x); - if( sp->prec>=0 ){ - ErrorMsg(psp->filename,psp->tokenlineno, - "Symbol \"%s\" has already be given a precedence.",x); - psp->errorcnt++; - }else{ - sp->prec = psp->preccounter; - sp->assoc = psp->declassoc; - } - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Can't assign a precedence to \"%s\".",x); - psp->errorcnt++; - } - break; - case WAITING_FOR_DECL_ARG: - if( x[0]=='{' || x[0]=='\"' || ISALNUM(x[0]) ){ - const char *zOld, *zNew; - char *zBuf, *z; - int nOld, n, nLine = 0, nNew, nBack; - int addLineMacro; - char zLine[50]; - zNew = x; - if( zNew[0]=='"' || zNew[0]=='{' ) zNew++; - nNew = lemonStrlen(zNew); - if( *psp->declargslot ){ - zOld = *psp->declargslot; - }else{ - zOld = ""; - } - nOld = lemonStrlen(zOld); - n = nOld + nNew + 20; - addLineMacro = !psp->gp->nolinenosflag && psp->insertLineMacro && - (psp->decllinenoslot==0 || psp->decllinenoslot[0]!=0); - if( addLineMacro ){ - for(z=psp->filename, nBack=0; *z; z++){ - if( *z=='\\' ) nBack++; - } - lemon_sprintf(zLine, "#line %d ", psp->tokenlineno); - nLine = lemonStrlen(zLine); - n += nLine + lemonStrlen(psp->filename) + nBack; - } - *psp->declargslot = (char *) realloc(*psp->declargslot, n); - zBuf = *psp->declargslot + nOld; - if( addLineMacro ){ - if( nOld && zBuf[-1]!='\n' ){ - *(zBuf++) = '\n'; - } - memcpy(zBuf, zLine, nLine); - zBuf += nLine; - *(zBuf++) = '"'; - for(z=psp->filename; *z; z++){ - if( *z=='\\' ){ - *(zBuf++) = '\\'; - } - *(zBuf++) = *z; - } - *(zBuf++) = '"'; - *(zBuf++) = '\n'; - } - if( psp->decllinenoslot && psp->decllinenoslot[0]==0 ){ - psp->decllinenoslot[0] = psp->tokenlineno; - } - memcpy(zBuf, zNew, nNew); - zBuf += nNew; - *zBuf = 0; - psp->state = WAITING_FOR_DECL_OR_RULE; - }else{ - ErrorMsg(psp->filename,psp->tokenlineno, - "Illegal argument to %%%s: %s",psp->declkeyword,x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - } - break; - case WAITING_FOR_FALLBACK_ID: - if( x[0]=='.' ){ - psp->state = WAITING_FOR_DECL_OR_RULE; - }else if( !ISUPPER(x[0]) ){ - ErrorMsg(psp->filename, psp->tokenlineno, - "%%fallback argument \"%s\" should be a token", x); - psp->errorcnt++; - }else{ - struct symbol *sp = Symbol_new(x); - if( psp->fallback==0 ){ - psp->fallback = sp; - }else if( sp->fallback ){ - ErrorMsg(psp->filename, psp->tokenlineno, - "More than one fallback assigned to token %s", x); - psp->errorcnt++; - }else{ - sp->fallback = psp->fallback; - psp->gp->has_fallback = 1; - } - } - break; - case WAITING_FOR_TOKEN_NAME: - /* Tokens do not have to be declared before use. But they can be - ** in order to control their assigned integer number. The number for - ** each token is assigned when it is first seen. So by including - ** - ** %token ONE TWO THREE - ** - ** early in the grammar file, that assigns small consecutive values - ** to each of the tokens ONE TWO and THREE. - */ - if( x[0]=='.' ){ - psp->state = WAITING_FOR_DECL_OR_RULE; - }else if( !ISUPPER(x[0]) ){ - ErrorMsg(psp->filename, psp->tokenlineno, - "%%token argument \"%s\" should be a token", x); - psp->errorcnt++; - }else{ - (void)Symbol_new(x); - } - break; - case WAITING_FOR_WILDCARD_ID: - if( x[0]=='.' ){ - psp->state = WAITING_FOR_DECL_OR_RULE; - }else if( !ISUPPER(x[0]) ){ - ErrorMsg(psp->filename, psp->tokenlineno, - "%%wildcard argument \"%s\" should be a token", x); - psp->errorcnt++; - }else{ - struct symbol *sp = Symbol_new(x); - if( psp->gp->wildcard==0 ){ - psp->gp->wildcard = sp; - }else{ - ErrorMsg(psp->filename, psp->tokenlineno, - "Extra wildcard to token: %s", x); - psp->errorcnt++; - } - } - break; - case WAITING_FOR_CLASS_ID: - if( !ISLOWER(x[0]) ){ - ErrorMsg(psp->filename, psp->tokenlineno, - "%%token_class must be followed by an identifier: ", x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - }else if( Symbol_find(x) ){ - ErrorMsg(psp->filename, psp->tokenlineno, - "Symbol \"%s\" already used", x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - }else{ - psp->tkclass = Symbol_new(x); - psp->tkclass->type = MULTITERMINAL; - psp->state = WAITING_FOR_CLASS_TOKEN; - } - break; - case WAITING_FOR_CLASS_TOKEN: - if( x[0]=='.' ){ - psp->state = WAITING_FOR_DECL_OR_RULE; - }else if( ISUPPER(x[0]) || ((x[0]=='|' || x[0]=='/') && ISUPPER(x[1])) ){ - struct symbol *msp = psp->tkclass; - msp->nsubsym++; - msp->subsym = (struct symbol **) realloc(msp->subsym, - sizeof(struct symbol*)*msp->nsubsym); - if( !ISUPPER(x[0]) ) x++; - msp->subsym[msp->nsubsym-1] = Symbol_new(x); - }else{ - ErrorMsg(psp->filename, psp->tokenlineno, - "%%token_class argument \"%s\" should be a token", x); - psp->errorcnt++; - psp->state = RESYNC_AFTER_DECL_ERROR; - } - break; - case RESYNC_AFTER_RULE_ERROR: -/* if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE; -** break; */ - case RESYNC_AFTER_DECL_ERROR: - if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE; - if( x[0]=='%' ) psp->state = WAITING_FOR_DECL_KEYWORD; - break; - } -} - -/* Run the preprocessor over the input file text. The global variables -** azDefine[0] through azDefine[nDefine-1] contains the names of all defined -** macros. This routine looks for "%ifdef" and "%ifndef" and "%endif" and -** comments them out. Text in between is also commented out as appropriate. -*/ -static void preprocess_input(char *z){ - int i, j, k, n; - int exclude = 0; - int start = 0; - int lineno = 1; - int start_lineno = 1; - for(i=0; z[i]; i++){ - if( z[i]=='\n' ) lineno++; - if( z[i]!='%' || (i>0 && z[i-1]!='\n') ) continue; - if( strncmp(&z[i],"%endif",6)==0 && ISSPACE(z[i+6]) ){ - if( exclude ){ - exclude--; - if( exclude==0 ){ - for(j=start; jfilename; - ps.errorcnt = 0; - ps.state = INITIALIZE; - - /* Begin by reading the input file */ - fp = fopen(ps.filename,"rb"); - if( fp==0 ){ - ErrorMsg(ps.filename,0,"Can't open this file for reading."); - gp->errorcnt++; - return; - } - fseek(fp,0,2); - filesize = ftell(fp); - rewind(fp); - filebuf = (char *)malloc( filesize+1 ); - if( filesize>100000000 || filebuf==0 ){ - ErrorMsg(ps.filename,0,"Input file too large."); - gp->errorcnt++; - fclose(fp); - return; - } - if( fread(filebuf,1,filesize,fp)!=filesize ){ - ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.", - filesize); - free(filebuf); - gp->errorcnt++; - fclose(fp); - return; - } - fclose(fp); - filebuf[filesize] = 0; - - /* Make an initial pass through the file to handle %ifdef and %ifndef */ - preprocess_input(filebuf); - - /* Now scan the text of the input file */ - lineno = 1; - for(cp=filebuf; (c= *cp)!=0; ){ - if( c=='\n' ) lineno++; /* Keep track of the line number */ - if( ISSPACE(c) ){ cp++; continue; } /* Skip all white space */ - if( c=='/' && cp[1]=='/' ){ /* Skip C++ style comments */ - cp+=2; - while( (c= *cp)!=0 && c!='\n' ) cp++; - continue; - } - if( c=='/' && cp[1]=='*' ){ /* Skip C style comments */ - cp+=2; - while( (c= *cp)!=0 && (c!='/' || cp[-1]!='*') ){ - if( c=='\n' ) lineno++; - cp++; - } - if( c ) cp++; - continue; - } - ps.tokenstart = cp; /* Mark the beginning of the token */ - ps.tokenlineno = lineno; /* Linenumber on which token begins */ - if( c=='\"' ){ /* String literals */ - cp++; - while( (c= *cp)!=0 && c!='\"' ){ - if( c=='\n' ) lineno++; - cp++; - } - if( c==0 ){ - ErrorMsg(ps.filename,startline, -"String starting on this line is not terminated before the end of the file."); - ps.errorcnt++; - nextcp = cp; - }else{ - nextcp = cp+1; - } - }else if( c=='{' ){ /* A block of C code */ - int level; - cp++; - for(level=1; (c= *cp)!=0 && (level>1 || c!='}'); cp++){ - if( c=='\n' ) lineno++; - else if( c=='{' ) level++; - else if( c=='}' ) level--; - else if( c=='/' && cp[1]=='*' ){ /* Skip comments */ - int prevc; - cp = &cp[2]; - prevc = 0; - while( (c= *cp)!=0 && (c!='/' || prevc!='*') ){ - if( c=='\n' ) lineno++; - prevc = c; - cp++; - } - }else if( c=='/' && cp[1]=='/' ){ /* Skip C++ style comments too */ - cp = &cp[2]; - while( (c= *cp)!=0 && c!='\n' ) cp++; - if( c ) lineno++; - }else if( c=='\'' || c=='\"' ){ /* String a character literals */ - int startchar, prevc; - startchar = c; - prevc = 0; - for(cp++; (c= *cp)!=0 && (c!=startchar || prevc=='\\'); cp++){ - if( c=='\n' ) lineno++; - if( prevc=='\\' ) prevc = 0; - else prevc = c; - } - } - } - if( c==0 ){ - ErrorMsg(ps.filename,ps.tokenlineno, -"C code starting on this line is not terminated before the end of the file."); - ps.errorcnt++; - nextcp = cp; - }else{ - nextcp = cp+1; - } - }else if( ISALNUM(c) ){ /* Identifiers */ - while( (c= *cp)!=0 && (ISALNUM(c) || c=='_') ) cp++; - nextcp = cp; - }else if( c==':' && cp[1]==':' && cp[2]=='=' ){ /* The operator "::=" */ - cp += 3; - nextcp = cp; - }else if( (c=='/' || c=='|') && ISALPHA(cp[1]) ){ - cp += 2; - while( (c = *cp)!=0 && (ISALNUM(c) || c=='_') ) cp++; - nextcp = cp; - }else{ /* All other (one character) operators */ - cp++; - nextcp = cp; - } - c = *cp; - *cp = 0; /* Null terminate the token */ - parseonetoken(&ps); /* Parse the token */ - *cp = (char)c; /* Restore the buffer */ - cp = nextcp; - } - free(filebuf); /* Release the buffer after parsing */ - gp->rule = ps.firstrule; - gp->errorcnt = ps.errorcnt; -} -/*************************** From the file "plink.c" *********************/ -/* -** Routines processing configuration follow-set propagation links -** in the LEMON parser generator. -*/ -static struct plink *plink_freelist = 0; - -/* Allocate a new plink */ -struct plink *Plink_new(void){ - struct plink *newlink; - - if( plink_freelist==0 ){ - int i; - int amt = 100; - plink_freelist = (struct plink *)calloc( amt, sizeof(struct plink) ); - if( plink_freelist==0 ){ - fprintf(stderr, - "Unable to allocate memory for a new follow-set propagation link.\n"); - exit(1); - } - for(i=0; inext; - return newlink; -} - -/* Add a plink to a plink list */ -void Plink_add(struct plink **plpp, struct config *cfp) -{ - struct plink *newlink; - newlink = Plink_new(); - newlink->next = *plpp; - *plpp = newlink; - newlink->cfp = cfp; -} - -/* Transfer every plink on the list "from" to the list "to" */ -void Plink_copy(struct plink **to, struct plink *from) -{ - struct plink *nextpl; - while( from ){ - nextpl = from->next; - from->next = *to; - *to = from; - from = nextpl; - } -} - -/* Delete every plink on the list */ -void Plink_delete(struct plink *plp) -{ - struct plink *nextpl; - - while( plp ){ - nextpl = plp->next; - plp->next = plink_freelist; - plink_freelist = plp; - plp = nextpl; - } -} -/*********************** From the file "report.c" **************************/ -/* -** Procedures for generating reports and tables in the LEMON parser generator. -*/ - -/* Generate a filename with the given suffix. Space to hold the -** name comes from malloc() and must be freed by the calling -** function. -*/ -PRIVATE char *file_makename(struct lemon *lemp, const char *suffix) -{ - char *name; - char *cp; - - name = (char*)malloc( lemonStrlen(lemp->filename) + lemonStrlen(suffix) + 5 ); - if( name==0 ){ - fprintf(stderr,"Can't allocate space for a filename.\n"); - exit(1); - } - lemon_strcpy(name,lemp->filename); - cp = strrchr(name,'.'); - if( cp ) *cp = 0; - lemon_strcat(name,suffix); - return name; -} - -/* Open a file with a name based on the name of the input file, -** but with a different (specified) suffix, and return a pointer -** to the stream */ -PRIVATE FILE *file_open( - struct lemon *lemp, - const char *suffix, - const char *mode -){ - FILE *fp; - - if( lemp->outname ) free(lemp->outname); - lemp->outname = file_makename(lemp, suffix); - fp = fopen(lemp->outname,mode); - if( fp==0 && *mode=='w' ){ - fprintf(stderr,"Can't open file \"%s\".\n",lemp->outname); - lemp->errorcnt++; - return 0; - } - return fp; -} - -/* Duplicate the input file without comments and without actions -** on rules */ -void Reprint(struct lemon *lemp) -{ - struct rule *rp; - struct symbol *sp; - int i, j, maxlen, len, ncolumns, skip; - printf("// Reprint of input file \"%s\".\n// Symbols:\n",lemp->filename); - maxlen = 10; - for(i=0; insymbol; i++){ - sp = lemp->symbols[i]; - len = lemonStrlen(sp->name); - if( len>maxlen ) maxlen = len; - } - ncolumns = 76/(maxlen+5); - if( ncolumns<1 ) ncolumns = 1; - skip = (lemp->nsymbol + ncolumns - 1)/ncolumns; - for(i=0; insymbol; j+=skip){ - sp = lemp->symbols[j]; - assert( sp->index==j ); - printf(" %3d %-*.*s",j,maxlen,maxlen,sp->name); - } - printf("\n"); - } - for(rp=lemp->rule; rp; rp=rp->next){ - printf("%s",rp->lhs->name); - /* if( rp->lhsalias ) printf("(%s)",rp->lhsalias); */ - printf(" ::="); - for(i=0; inrhs; i++){ - sp = rp->rhs[i]; - if( sp->type==MULTITERMINAL ){ - printf(" %s", sp->subsym[0]->name); - for(j=1; jnsubsym; j++){ - printf("|%s", sp->subsym[j]->name); - } - }else{ - printf(" %s", sp->name); - } - /* if( rp->rhsalias[i] ) printf("(%s)",rp->rhsalias[i]); */ - } - printf("."); - if( rp->precsym ) printf(" [%s]",rp->precsym->name); - /* if( rp->code ) printf("\n %s",rp->code); */ - printf("\n"); - } -} - -/* Print a single rule. -*/ -void RulePrint(FILE *fp, struct rule *rp, int iCursor){ - struct symbol *sp; - int i, j; - fprintf(fp,"%s ::=",rp->lhs->name); - for(i=0; i<=rp->nrhs; i++){ - if( i==iCursor ) fprintf(fp," *"); - if( i==rp->nrhs ) break; - sp = rp->rhs[i]; - if( sp->type==MULTITERMINAL ){ - fprintf(fp," %s", sp->subsym[0]->name); - for(j=1; jnsubsym; j++){ - fprintf(fp,"|%s",sp->subsym[j]->name); - } - }else{ - fprintf(fp," %s", sp->name); - } - } -} - -/* Print the rule for a configuration. -*/ -void ConfigPrint(FILE *fp, struct config *cfp){ - RulePrint(fp, cfp->rp, cfp->dot); -} - -/* #define TEST */ -#if 0 -/* Print a set */ -PRIVATE void SetPrint(out,set,lemp) -FILE *out; -char *set; -struct lemon *lemp; -{ - int i; - char *spacer; - spacer = ""; - fprintf(out,"%12s[",""); - for(i=0; interminal; i++){ - if( SetFind(set,i) ){ - fprintf(out,"%s%s",spacer,lemp->symbols[i]->name); - spacer = " "; - } - } - fprintf(out,"]\n"); -} - -/* Print a plink chain */ -PRIVATE void PlinkPrint(out,plp,tag) -FILE *out; -struct plink *plp; -char *tag; -{ - while( plp ){ - fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->statenum); - ConfigPrint(out,plp->cfp); - fprintf(out,"\n"); - plp = plp->next; - } -} -#endif - -/* Print an action to the given file descriptor. Return FALSE if -** nothing was actually printed. -*/ -int PrintAction( - struct action *ap, /* The action to print */ - FILE *fp, /* Print the action here */ - int indent /* Indent by this amount */ -){ - int result = 1; - switch( ap->type ){ - case SHIFT: { - struct state *stp = ap->x.stp; - fprintf(fp,"%*s shift %-7d",indent,ap->sp->name,stp->statenum); - break; - } - case REDUCE: { - struct rule *rp = ap->x.rp; - fprintf(fp,"%*s reduce %-7d",indent,ap->sp->name,rp->iRule); - RulePrint(fp, rp, -1); - break; - } - case SHIFTREDUCE: { - struct rule *rp = ap->x.rp; - fprintf(fp,"%*s shift-reduce %-7d",indent,ap->sp->name,rp->iRule); - RulePrint(fp, rp, -1); - break; - } - case ACCEPT: - fprintf(fp,"%*s accept",indent,ap->sp->name); - break; - case ERROR: - fprintf(fp,"%*s error",indent,ap->sp->name); - break; - case SRCONFLICT: - case RRCONFLICT: - fprintf(fp,"%*s reduce %-7d ** Parsing conflict **", - indent,ap->sp->name,ap->x.rp->iRule); - break; - case SSCONFLICT: - fprintf(fp,"%*s shift %-7d ** Parsing conflict **", - indent,ap->sp->name,ap->x.stp->statenum); - break; - case SH_RESOLVED: - if( showPrecedenceConflict ){ - fprintf(fp,"%*s shift %-7d -- dropped by precedence", - indent,ap->sp->name,ap->x.stp->statenum); - }else{ - result = 0; - } - break; - case RD_RESOLVED: - if( showPrecedenceConflict ){ - fprintf(fp,"%*s reduce %-7d -- dropped by precedence", - indent,ap->sp->name,ap->x.rp->iRule); - }else{ - result = 0; - } - break; - case NOT_USED: - result = 0; - break; - } - if( result && ap->spOpt ){ - fprintf(fp," /* because %s==%s */", ap->sp->name, ap->spOpt->name); - } - return result; -} - -/* Generate the "*.out" log file */ -void ReportOutput(struct lemon *lemp) -{ - int i; - struct state *stp; - struct config *cfp; - struct action *ap; - FILE *fp; - - fp = file_open(lemp,".out","wb"); - if( fp==0 ) return; - for(i=0; inxstate; i++){ - stp = lemp->sorted[i]; - fprintf(fp,"State %d:\n",stp->statenum); - if( lemp->basisflag ) cfp=stp->bp; - else cfp=stp->cfp; - while( cfp ){ - char buf[20]; - if( cfp->dot==cfp->rp->nrhs ){ - lemon_sprintf(buf,"(%d)",cfp->rp->iRule); - fprintf(fp," %5s ",buf); - }else{ - fprintf(fp," "); - } - ConfigPrint(fp,cfp); - fprintf(fp,"\n"); -#if 0 - SetPrint(fp,cfp->fws,lemp); - PlinkPrint(fp,cfp->fplp,"To "); - PlinkPrint(fp,cfp->bplp,"From"); -#endif - if( lemp->basisflag ) cfp=cfp->bp; - else cfp=cfp->next; - } - fprintf(fp,"\n"); - for(ap=stp->ap; ap; ap=ap->next){ - if( PrintAction(ap,fp,30) ) fprintf(fp,"\n"); - } - fprintf(fp,"\n"); - } - fprintf(fp, "----------------------------------------------------\n"); - fprintf(fp, "Symbols:\n"); - for(i=0; insymbol; i++){ - int j; - struct symbol *sp; - - sp = lemp->symbols[i]; - fprintf(fp, " %3d: %s", i, sp->name); - if( sp->type==NONTERMINAL ){ - fprintf(fp, ":"); - if( sp->lambda ){ - fprintf(fp, " "); - } - for(j=0; jnterminal; j++){ - if( sp->firstset && SetFind(sp->firstset, j) ){ - fprintf(fp, " %s", lemp->symbols[j]->name); - } - } - } - fprintf(fp, "\n"); - } - fclose(fp); - return; -} - -/* Search for the file "name" which is in the same directory as -** the executable */ -PRIVATE char *pathsearch(char *argv0, char *name, int modemask) -{ - const char *pathlist; - char *pathbufptr; - char *pathbuf; - char *path,*cp; - char c; - -#ifdef __WIN32__ - cp = strrchr(argv0,'\\'); -#else - cp = strrchr(argv0,'/'); -#endif - if( cp ){ - c = *cp; - *cp = 0; - path = (char *)malloc( lemonStrlen(argv0) + lemonStrlen(name) + 2 ); - if( path ) lemon_sprintf(path,"%s/%s",argv0,name); - *cp = c; - }else{ - pathlist = getenv("PATH"); - if( pathlist==0 ) pathlist = ".:/bin:/usr/bin"; - pathbuf = (char *) malloc( lemonStrlen(pathlist) + 1 ); - path = (char *)malloc( lemonStrlen(pathlist)+lemonStrlen(name)+2 ); - if( (pathbuf != 0) && (path!=0) ){ - pathbufptr = pathbuf; - lemon_strcpy(pathbuf, pathlist); - while( *pathbuf ){ - cp = strchr(pathbuf,':'); - if( cp==0 ) cp = &pathbuf[lemonStrlen(pathbuf)]; - c = *cp; - *cp = 0; - lemon_sprintf(path,"%s/%s",pathbuf,name); - *cp = c; - if( c==0 ) pathbuf[0] = 0; - else pathbuf = &cp[1]; - if( access(path,modemask)==0 ) break; - } - free(pathbufptr); - } - } - return path; -} - -/* Given an action, compute the integer value for that action -** which is to be put in the action table of the generated machine. -** Return negative if no action should be generated. -*/ -PRIVATE int compute_action(struct lemon *lemp, struct action *ap) -{ - int act; - switch( ap->type ){ - case SHIFT: act = ap->x.stp->statenum; break; - case SHIFTREDUCE: { - act = ap->x.rp->iRule + lemp->nstate; - /* Since a SHIFT is inherient after a prior REDUCE, convert any - ** SHIFTREDUCE action with a nonterminal on the LHS into a simple - ** REDUCE action: */ - if( ap->sp->index>=lemp->nterminal ) act += lemp->nrule; - break; - } - case REDUCE: act = ap->x.rp->iRule + lemp->nstate+lemp->nrule; break; - case ERROR: act = lemp->nstate + lemp->nrule*2; break; - case ACCEPT: act = lemp->nstate + lemp->nrule*2 + 1; break; - default: act = -1; break; - } - return act; -} - -#define LINESIZE 1000 -/* The next cluster of routines are for reading the template file -** and writing the results to the generated parser */ -/* The first function transfers data from "in" to "out" until -** a line is seen which begins with "%%". The line number is -** tracked. -** -** if name!=0, then any word that begin with "Parse" is changed to -** begin with *name instead. -*/ -PRIVATE void tplt_xfer(char *name, FILE *in, FILE *out, int *lineno) -{ - int i, iStart; - char line[LINESIZE]; - while( fgets(line,LINESIZE,in) && (line[0]!='%' || line[1]!='%') ){ - (*lineno)++; - iStart = 0; - if( name ){ - for(i=0; line[i]; i++){ - if( line[i]=='P' && strncmp(&line[i],"Parse",5)==0 - && (i==0 || !ISALPHA(line[i-1])) - ){ - if( i>iStart ) fprintf(out,"%.*s",i-iStart,&line[iStart]); - fprintf(out,"%s",name); - i += 4; - iStart = i+1; - } - } - } - fprintf(out,"%s",&line[iStart]); - } -} - -/* The next function finds the template file and opens it, returning -** a pointer to the opened file. */ -PRIVATE FILE *tplt_open(struct lemon *lemp) -{ - static char templatename[] = "lempar.c"; - char buf[1000]; - FILE *in; - char *tpltname; - char *cp; - - /* first, see if user specified a template filename on the command line. */ - if (user_templatename != 0) { - if( access(user_templatename,004)==-1 ){ - fprintf(stderr,"Can't find the parser driver template file \"%s\".\n", - user_templatename); - lemp->errorcnt++; - return 0; - } - in = fopen(user_templatename,"rb"); - if( in==0 ){ - fprintf(stderr,"Can't open the template file \"%s\".\n", - user_templatename); - lemp->errorcnt++; - return 0; - } - return in; - } - - cp = strrchr(lemp->filename,'.'); - if( cp ){ - lemon_sprintf(buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename); - }else{ - lemon_sprintf(buf,"%s.lt",lemp->filename); - } - if( access(buf,004)==0 ){ - tpltname = buf; - }else if( access(templatename,004)==0 ){ - tpltname = templatename; - }else{ - tpltname = pathsearch(lemp->argv0,templatename,0); - } - if( tpltname==0 ){ - fprintf(stderr,"Can't find the parser driver template file \"%s\".\n", - templatename); - lemp->errorcnt++; - return 0; - } - in = fopen(tpltname,"rb"); - if( in==0 ){ - fprintf(stderr,"Can't open the template file \"%s\".\n",templatename); - lemp->errorcnt++; - return 0; - } - return in; -} - -/* Print a #line directive line to the output file. */ -PRIVATE void tplt_linedir(FILE *out, int lineno, char *filename) -{ - fprintf(out,"#line %d \"",lineno); - while( *filename ){ - if( *filename == '\\' ) putc('\\',out); - putc(*filename,out); - filename++; - } - fprintf(out,"\"\n"); -} - -/* Print a string to the file and keep the linenumber up to date */ -PRIVATE void tplt_print(FILE *out, struct lemon *lemp, char *str, int *lineno) -{ - if( str==0 ) return; - while( *str ){ - putc(*str,out); - if( *str=='\n' ) (*lineno)++; - str++; - } - if( str[-1]!='\n' ){ - putc('\n',out); - (*lineno)++; - } - if (!lemp->nolinenosflag) { - (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); - } - return; -} - -/* -** The following routine emits code for the destructor for the -** symbol sp -*/ -void emit_destructor_code( - FILE *out, - struct symbol *sp, - struct lemon *lemp, - int *lineno -){ - char *cp = 0; - - if( sp->type==TERMINAL ){ - cp = lemp->tokendest; - if( cp==0 ) return; - fprintf(out,"{\n"); (*lineno)++; - }else if( sp->destructor ){ - cp = sp->destructor; - fprintf(out,"{\n"); (*lineno)++; - if( !lemp->nolinenosflag ){ - (*lineno)++; - tplt_linedir(out,sp->destLineno,lemp->filename); - } - }else if( lemp->vardest ){ - cp = lemp->vardest; - if( cp==0 ) return; - fprintf(out,"{\n"); (*lineno)++; - }else{ - assert( 0 ); /* Cannot happen */ - } - for(; *cp; cp++){ - if( *cp=='$' && cp[1]=='$' ){ - fprintf(out,"(yypminor->yy%d)",sp->dtnum); - cp++; - continue; - } - if( *cp=='\n' ) (*lineno)++; - fputc(*cp,out); - } - fprintf(out,"\n"); (*lineno)++; - if (!lemp->nolinenosflag) { - (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); - } - fprintf(out,"}\n"); (*lineno)++; - return; -} - -/* -** Return TRUE (non-zero) if the given symbol has a destructor. -*/ -int has_destructor(struct symbol *sp, struct lemon *lemp) -{ - int ret; - if( sp->type==TERMINAL ){ - ret = lemp->tokendest!=0; - }else{ - ret = lemp->vardest!=0 || sp->destructor!=0; - } - return ret; -} - -/* -** Append text to a dynamically allocated string. If zText is 0 then -** reset the string to be empty again. Always return the complete text -** of the string (which is overwritten with each call). -** -** n bytes of zText are stored. If n==0 then all of zText up to the first -** \000 terminator is stored. zText can contain up to two instances of -** %d. The values of p1 and p2 are written into the first and second -** %d. -** -** If n==-1, then the previous character is overwritten. -*/ -PRIVATE char *append_str(const char *zText, int n, int p1, int p2){ - static char empty[1] = { 0 }; - static char *z = 0; - static int alloced = 0; - static int used = 0; - int c; - char zInt[40]; - if( zText==0 ){ - if( used==0 && z!=0 ) z[0] = 0; - used = 0; - return z; - } - if( n<=0 ){ - if( n<0 ){ - used += n; - assert( used>=0 ); - } - n = lemonStrlen(zText); - } - if( (int) (n+sizeof(zInt)*2+used) >= alloced ){ - alloced = n + sizeof(zInt)*2 + used + 200; - z = (char *) realloc(z, alloced); - } - if( z==0 ) return empty; - while( n-- > 0 ){ - c = *(zText++); - if( c=='%' && n>0 && zText[0]=='d' ){ - lemon_sprintf(zInt, "%d", p1); - p1 = p2; - lemon_strcpy(&z[used], zInt); - used += lemonStrlen(&z[used]); - zText++; - n--; - }else{ - z[used++] = (char)c; - } - } - z[used] = 0; - return z; -} - -/* -** Write and transform the rp->code string so that symbols are expanded. -** Populate the rp->codePrefix and rp->codeSuffix strings, as appropriate. -** -** Return 1 if the expanded code requires that "yylhsminor" local variable -** to be defined. -*/ -PRIVATE int translate_code(struct lemon *lemp, struct rule *rp){ - char *cp, *xp; - int i; - int rc = 0; /* True if yylhsminor is used */ - int dontUseRhs0 = 0; /* If true, use of left-most RHS label is illegal */ - const char *zSkip = 0; /* The zOvwrt comment within rp->code, or NULL */ - char lhsused = 0; /* True if the LHS element has been used */ - char lhsdirect; /* True if LHS writes directly into stack */ - char used[MAXRHS]; /* True for each RHS element which is used */ - char zLhs[50]; /* Convert the LHS symbol into this string */ - char zOvwrt[900]; /* Comment that to allow LHS to overwrite RHS */ - - for(i=0; inrhs; i++) used[i] = 0; - lhsused = 0; - - if( rp->code==0 ){ - static char newlinestr[2] = { '\n', '\0' }; - rp->code = newlinestr; - rp->line = rp->ruleline; - rp->noCode = 1; - }else{ - rp->noCode = 0; - } - - - if( rp->nrhs==0 ){ - /* If there are no RHS symbols, then writing directly to the LHS is ok */ - lhsdirect = 1; - }else if( rp->rhsalias[0]==0 ){ - /* The left-most RHS symbol has no value. LHS direct is ok. But - ** we have to call the distructor on the RHS symbol first. */ - lhsdirect = 1; - if( has_destructor(rp->rhs[0],lemp) ){ - append_str(0,0,0,0); - append_str(" yy_destructor(yypParser,%d,&yymsp[%d].minor);\n", 0, - rp->rhs[0]->index,1-rp->nrhs); - rp->codePrefix = Strsafe(append_str(0,0,0,0)); - rp->noCode = 0; - } - }else if( rp->lhsalias==0 ){ - /* There is no LHS value symbol. */ - lhsdirect = 1; - }else if( strcmp(rp->lhsalias,rp->rhsalias[0])==0 ){ - /* The LHS symbol and the left-most RHS symbol are the same, so - ** direct writing is allowed */ - lhsdirect = 1; - lhsused = 1; - used[0] = 1; - if( rp->lhs->dtnum!=rp->rhs[0]->dtnum ){ - ErrorMsg(lemp->filename,rp->ruleline, - "%s(%s) and %s(%s) share the same label but have " - "different datatypes.", - rp->lhs->name, rp->lhsalias, rp->rhs[0]->name, rp->rhsalias[0]); - lemp->errorcnt++; - } - }else{ - lemon_sprintf(zOvwrt, "/*%s-overwrites-%s*/", - rp->lhsalias, rp->rhsalias[0]); - zSkip = strstr(rp->code, zOvwrt); - if( zSkip!=0 ){ - /* The code contains a special comment that indicates that it is safe - ** for the LHS label to overwrite left-most RHS label. */ - lhsdirect = 1; - }else{ - lhsdirect = 0; - } - } - if( lhsdirect ){ - sprintf(zLhs, "yymsp[%d].minor.yy%d",1-rp->nrhs,rp->lhs->dtnum); - }else{ - rc = 1; - sprintf(zLhs, "yylhsminor.yy%d",rp->lhs->dtnum); - } - - append_str(0,0,0,0); - - /* This const cast is wrong but harmless, if we're careful. */ - for(cp=(char *)rp->code; *cp; cp++){ - if( cp==zSkip ){ - append_str(zOvwrt,0,0,0); - cp += lemonStrlen(zOvwrt)-1; - dontUseRhs0 = 1; - continue; - } - if( ISALPHA(*cp) && (cp==rp->code || (!ISALNUM(cp[-1]) && cp[-1]!='_')) ){ - char saved; - for(xp= &cp[1]; ISALNUM(*xp) || *xp=='_'; xp++); - saved = *xp; - *xp = 0; - if( rp->lhsalias && strcmp(cp,rp->lhsalias)==0 ){ - append_str(zLhs,0,0,0); - cp = xp; - lhsused = 1; - }else{ - for(i=0; inrhs; i++){ - if( rp->rhsalias[i] && strcmp(cp,rp->rhsalias[i])==0 ){ - if( i==0 && dontUseRhs0 ){ - ErrorMsg(lemp->filename,rp->ruleline, - "Label %s used after '%s'.", - rp->rhsalias[0], zOvwrt); - lemp->errorcnt++; - }else if( cp!=rp->code && cp[-1]=='@' ){ - /* If the argument is of the form @X then substituted - ** the token number of X, not the value of X */ - append_str("yymsp[%d].major",-1,i-rp->nrhs+1,0); - }else{ - struct symbol *sp = rp->rhs[i]; - int dtnum; - if( sp->type==MULTITERMINAL ){ - dtnum = sp->subsym[0]->dtnum; - }else{ - dtnum = sp->dtnum; - } - append_str("yymsp[%d].minor.yy%d",0,i-rp->nrhs+1, dtnum); - } - cp = xp; - used[i] = 1; - break; - } - } - } - *xp = saved; - } - append_str(cp, 1, 0, 0); - } /* End loop */ - - /* Main code generation completed */ - cp = append_str(0,0,0,0); - if( cp && cp[0] ) rp->code = Strsafe(cp); - append_str(0,0,0,0); - - /* Check to make sure the LHS has been used */ - if( rp->lhsalias && !lhsused ){ - ErrorMsg(lemp->filename,rp->ruleline, - "Label \"%s\" for \"%s(%s)\" is never used.", - rp->lhsalias,rp->lhs->name,rp->lhsalias); - lemp->errorcnt++; - } - - /* Generate destructor code for RHS minor values which are not referenced. - ** Generate error messages for unused labels and duplicate labels. - */ - for(i=0; inrhs; i++){ - if( rp->rhsalias[i] ){ - if( i>0 ){ - int j; - if( rp->lhsalias && strcmp(rp->lhsalias,rp->rhsalias[i])==0 ){ - ErrorMsg(lemp->filename,rp->ruleline, - "%s(%s) has the same label as the LHS but is not the left-most " - "symbol on the RHS.", - rp->rhs[i]->name, rp->rhsalias); - lemp->errorcnt++; - } - for(j=0; jrhsalias[j] && strcmp(rp->rhsalias[j],rp->rhsalias[i])==0 ){ - ErrorMsg(lemp->filename,rp->ruleline, - "Label %s used for multiple symbols on the RHS of a rule.", - rp->rhsalias[i]); - lemp->errorcnt++; - break; - } - } - } - if( !used[i] ){ - ErrorMsg(lemp->filename,rp->ruleline, - "Label %s for \"%s(%s)\" is never used.", - rp->rhsalias[i],rp->rhs[i]->name,rp->rhsalias[i]); - lemp->errorcnt++; - } - }else if( i>0 && has_destructor(rp->rhs[i],lemp) ){ - append_str(" yy_destructor(yypParser,%d,&yymsp[%d].minor);\n", 0, - rp->rhs[i]->index,i-rp->nrhs+1); - } - } - - /* If unable to write LHS values directly into the stack, write the - ** saved LHS value now. */ - if( lhsdirect==0 ){ - append_str(" yymsp[%d].minor.yy%d = ", 0, 1-rp->nrhs, rp->lhs->dtnum); - append_str(zLhs, 0, 0, 0); - append_str(";\n", 0, 0, 0); - } - - /* Suffix code generation complete */ - cp = append_str(0,0,0,0); - if( cp && cp[0] ){ - rp->codeSuffix = Strsafe(cp); - rp->noCode = 0; - } - - return rc; -} - -/* -** Generate code which executes when the rule "rp" is reduced. Write -** the code to "out". Make sure lineno stays up-to-date. -*/ -PRIVATE void emit_code( - FILE *out, - struct rule *rp, - struct lemon *lemp, - int *lineno -){ - const char *cp; - - /* Setup code prior to the #line directive */ - if( rp->codePrefix && rp->codePrefix[0] ){ - fprintf(out, "{%s", rp->codePrefix); - for(cp=rp->codePrefix; *cp; cp++){ if( *cp=='\n' ) (*lineno)++; } - } - - /* Generate code to do the reduce action */ - if( rp->code ){ - if( !lemp->nolinenosflag ){ - (*lineno)++; - tplt_linedir(out,rp->line,lemp->filename); - } - fprintf(out,"{%s",rp->code); - for(cp=rp->code; *cp; cp++){ if( *cp=='\n' ) (*lineno)++; } - fprintf(out,"}\n"); (*lineno)++; - if( !lemp->nolinenosflag ){ - (*lineno)++; - tplt_linedir(out,*lineno,lemp->outname); - } - } - - /* Generate breakdown code that occurs after the #line directive */ - if( rp->codeSuffix && rp->codeSuffix[0] ){ - fprintf(out, "%s", rp->codeSuffix); - for(cp=rp->codeSuffix; *cp; cp++){ if( *cp=='\n' ) (*lineno)++; } - } - - if( rp->codePrefix ){ - fprintf(out, "}\n"); (*lineno)++; - } - - return; -} - -/* -** Print the definition of the union used for the parser's data stack. -** This union contains fields for every possible data type for tokens -** and nonterminals. In the process of computing and printing this -** union, also set the ".dtnum" field of every terminal and nonterminal -** symbol. -*/ -void print_stack_union( - FILE *out, /* The output stream */ - struct lemon *lemp, /* The main info structure for this parser */ - int *plineno, /* Pointer to the line number */ - int mhflag /* True if generating makeheaders output */ -){ - int lineno = *plineno; /* The line number of the output */ - char **types; /* A hash table of datatypes */ - int arraysize; /* Size of the "types" array */ - int maxdtlength; /* Maximum length of any ".datatype" field. */ - char *stddt; /* Standardized name for a datatype */ - int i,j; /* Loop counters */ - unsigned hash; /* For hashing the name of a type */ - const char *name; /* Name of the parser */ - - /* Allocate and initialize types[] and allocate stddt[] */ - arraysize = lemp->nsymbol * 2; - types = (char**)calloc( arraysize, sizeof(char*) ); - if( types==0 ){ - fprintf(stderr,"Out of memory.\n"); - exit(1); - } - for(i=0; ivartype ){ - maxdtlength = lemonStrlen(lemp->vartype); - } - for(i=0; insymbol; i++){ - int len; - struct symbol *sp = lemp->symbols[i]; - if( sp->datatype==0 ) continue; - len = lemonStrlen(sp->datatype); - if( len>maxdtlength ) maxdtlength = len; - } - stddt = (char*)malloc( maxdtlength*2 + 1 ); - if( stddt==0 ){ - fprintf(stderr,"Out of memory.\n"); - exit(1); - } - - /* Build a hash table of datatypes. The ".dtnum" field of each symbol - ** is filled in with the hash index plus 1. A ".dtnum" value of 0 is - ** used for terminal symbols. If there is no %default_type defined then - ** 0 is also used as the .dtnum value for nonterminals which do not specify - ** a datatype using the %type directive. - */ - for(i=0; insymbol; i++){ - struct symbol *sp = lemp->symbols[i]; - char *cp; - if( sp==lemp->errsym ){ - sp->dtnum = arraysize+1; - continue; - } - if( sp->type!=NONTERMINAL || (sp->datatype==0 && lemp->vartype==0) ){ - sp->dtnum = 0; - continue; - } - cp = sp->datatype; - if( cp==0 ) cp = lemp->vartype; - j = 0; - while( ISSPACE(*cp) ) cp++; - while( *cp ) stddt[j++] = *cp++; - while( j>0 && ISSPACE(stddt[j-1]) ) j--; - stddt[j] = 0; - if( lemp->tokentype && strcmp(stddt, lemp->tokentype)==0 ){ - sp->dtnum = 0; - continue; - } - hash = 0; - for(j=0; stddt[j]; j++){ - hash = hash*53 + stddt[j]; - } - hash = (hash & 0x7fffffff)%arraysize; - while( types[hash] ){ - if( strcmp(types[hash],stddt)==0 ){ - sp->dtnum = hash + 1; - break; - } - hash++; - if( hash>=(unsigned)arraysize ) hash = 0; - } - if( types[hash]==0 ){ - sp->dtnum = hash + 1; - types[hash] = (char*)malloc( lemonStrlen(stddt)+1 ); - if( types[hash]==0 ){ - fprintf(stderr,"Out of memory.\n"); - exit(1); - } - lemon_strcpy(types[hash],stddt); - } - } - - /* Print out the definition of YYTOKENTYPE and YYMINORTYPE */ - name = lemp->name ? lemp->name : "Parse"; - lineno = *plineno; - if( mhflag ){ fprintf(out,"#if INTERFACE\n"); lineno++; } - fprintf(out,"#define %sTOKENTYPE %s\n",name, - lemp->tokentype?lemp->tokentype:"void*"); lineno++; - if( mhflag ){ fprintf(out,"#endif\n"); lineno++; } - fprintf(out,"typedef union {\n"); lineno++; - fprintf(out," int yyinit;\n"); lineno++; - fprintf(out," %sTOKENTYPE yy0;\n",name); lineno++; - for(i=0; ierrsym->useCnt ){ - fprintf(out," int yy%d;\n",lemp->errsym->dtnum); lineno++; - } - free(stddt); - free(types); - fprintf(out,"} YYMINORTYPE;\n"); lineno++; - *plineno = lineno; -} - -/* -** Return the name of a C datatype able to represent values between -** lwr and upr, inclusive. If pnByte!=NULL then also write the sizeof -** for that type (1, 2, or 4) into *pnByte. -*/ -static const char *minimum_size_type(int lwr, int upr, int *pnByte){ - const char *zType = "int"; - int nByte = 4; - if( lwr>=0 ){ - if( upr<=255 ){ - zType = "unsigned char"; - nByte = 1; - }else if( upr<65535 ){ - zType = "unsigned short int"; - nByte = 2; - }else{ - zType = "unsigned int"; - nByte = 4; - } - }else if( lwr>=-127 && upr<=127 ){ - zType = "signed char"; - nByte = 1; - }else if( lwr>=-32767 && upr<32767 ){ - zType = "short"; - nByte = 2; - } - if( pnByte ) *pnByte = nByte; - return zType; -} - -/* -** Each state contains a set of token transaction and a set of -** nonterminal transactions. Each of these sets makes an instance -** of the following structure. An array of these structures is used -** to order the creation of entries in the yy_action[] table. -*/ -struct axset { - struct state *stp; /* A pointer to a state */ - int isTkn; /* True to use tokens. False for non-terminals */ - int nAction; /* Number of actions */ - int iOrder; /* Original order of action sets */ -}; - -/* -** Compare to axset structures for sorting purposes -*/ -static int axset_compare(const void *a, const void *b){ - struct axset *p1 = (struct axset*)a; - struct axset *p2 = (struct axset*)b; - int c; - c = p2->nAction - p1->nAction; - if( c==0 ){ - c = p1->iOrder - p2->iOrder; - } - assert( c!=0 || p1==p2 ); - return c; -} - -/* -** Write text on "out" that describes the rule "rp". -*/ -static void writeRuleText(FILE *out, struct rule *rp){ - int j; - fprintf(out,"%s ::=", rp->lhs->name); - for(j=0; jnrhs; j++){ - struct symbol *sp = rp->rhs[j]; - if( sp->type!=MULTITERMINAL ){ - fprintf(out," %s", sp->name); - }else{ - int k; - fprintf(out," %s", sp->subsym[0]->name); - for(k=1; knsubsym; k++){ - fprintf(out,"|%s",sp->subsym[k]->name); - } - } - } -} - - -/* Generate C source code for the parser */ -void ReportTable( - struct lemon *lemp, - int mhflag /* Output in makeheaders format if true */ -){ - FILE *out, *in; - char line[LINESIZE]; - int lineno; - struct state *stp; - struct action *ap; - struct rule *rp; - struct acttab *pActtab; - int i, j, n, sz; - int szActionType; /* sizeof(YYACTIONTYPE) */ - int szCodeType; /* sizeof(YYCODETYPE) */ - const char *name; - int mnTknOfst, mxTknOfst; - int mnNtOfst, mxNtOfst; - struct axset *ax; - - in = tplt_open(lemp); - if( in==0 ) return; - out = file_open(lemp,".c","wb"); - if( out==0 ){ - fclose(in); - return; - } - lineno = 1; - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate the include code, if any */ - tplt_print(out,lemp,lemp->include,&lineno); - if( mhflag ){ - char *incName = file_makename(lemp, ".h"); - fprintf(out,"#include \"%s\"\n", incName); lineno++; - free(incName); - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate #defines for all tokens */ - if( mhflag ){ - const char *prefix; - fprintf(out,"#if INTERFACE\n"); lineno++; - if( lemp->tokenprefix ) prefix = lemp->tokenprefix; - else prefix = ""; - for(i=1; interminal; i++){ - fprintf(out,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); - lineno++; - } - fprintf(out,"#endif\n"); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate the defines */ - fprintf(out,"#define YYCODETYPE %s\n", - minimum_size_type(0, lemp->nsymbol+1, &szCodeType)); lineno++; - fprintf(out,"#define YYNOCODE %d\n",lemp->nsymbol+1); lineno++; - fprintf(out,"#define YYACTIONTYPE %s\n", - minimum_size_type(0,lemp->nstate+lemp->nrule*2+5,&szActionType)); lineno++; - if( lemp->wildcard ){ - fprintf(out,"#define YYWILDCARD %d\n", - lemp->wildcard->index); lineno++; - } - print_stack_union(out,lemp,&lineno,mhflag); - fprintf(out, "#ifndef YYSTACKDEPTH\n"); lineno++; - if( lemp->stacksize ){ - fprintf(out,"#define YYSTACKDEPTH %s\n",lemp->stacksize); lineno++; - }else{ - fprintf(out,"#define YYSTACKDEPTH 100\n"); lineno++; - } - fprintf(out, "#endif\n"); lineno++; - if( mhflag ){ - fprintf(out,"#if INTERFACE\n"); lineno++; - } - name = lemp->name ? lemp->name : "Parse"; - if( lemp->arg && lemp->arg[0] ){ - i = lemonStrlen(lemp->arg); - while( i>=1 && ISSPACE(lemp->arg[i-1]) ) i--; - while( i>=1 && (ISALNUM(lemp->arg[i-1]) || lemp->arg[i-1]=='_') ) i--; - fprintf(out,"#define %sARG_SDECL %s;\n",name,lemp->arg); lineno++; - fprintf(out,"#define %sARG_PDECL ,%s\n",name,lemp->arg); lineno++; - fprintf(out,"#define %sARG_FETCH %s = yypParser->%s\n", - name,lemp->arg,&lemp->arg[i]); lineno++; - fprintf(out,"#define %sARG_STORE yypParser->%s = %s\n", - name,&lemp->arg[i],&lemp->arg[i]); lineno++; - }else{ - fprintf(out,"#define %sARG_SDECL\n",name); lineno++; - fprintf(out,"#define %sARG_PDECL\n",name); lineno++; - fprintf(out,"#define %sARG_FETCH\n",name); lineno++; - fprintf(out,"#define %sARG_STORE\n",name); lineno++; - } - if( mhflag ){ - fprintf(out,"#endif\n"); lineno++; - } - if( lemp->errsym->useCnt ){ - fprintf(out,"#define YYERRORSYMBOL %d\n",lemp->errsym->index); lineno++; - fprintf(out,"#define YYERRSYMDT yy%d\n",lemp->errsym->dtnum); lineno++; - } - if( lemp->has_fallback ){ - fprintf(out,"#define YYFALLBACK 1\n"); lineno++; - } - - /* Compute the action table, but do not output it yet. The action - ** table must be computed before generating the YYNSTATE macro because - ** we need to know how many states can be eliminated. - */ - ax = (struct axset *) calloc(lemp->nxstate*2, sizeof(ax[0])); - if( ax==0 ){ - fprintf(stderr,"malloc failed\n"); - exit(1); - } - for(i=0; inxstate; i++){ - stp = lemp->sorted[i]; - ax[i*2].stp = stp; - ax[i*2].isTkn = 1; - ax[i*2].nAction = stp->nTknAct; - ax[i*2+1].stp = stp; - ax[i*2+1].isTkn = 0; - ax[i*2+1].nAction = stp->nNtAct; - } - mxTknOfst = mnTknOfst = 0; - mxNtOfst = mnNtOfst = 0; - /* In an effort to minimize the action table size, use the heuristic - ** of placing the largest action sets first */ - for(i=0; inxstate*2; i++) ax[i].iOrder = i; - qsort(ax, lemp->nxstate*2, sizeof(ax[0]), axset_compare); - pActtab = acttab_alloc(); - for(i=0; inxstate*2 && ax[i].nAction>0; i++){ - stp = ax[i].stp; - if( ax[i].isTkn ){ - for(ap=stp->ap; ap; ap=ap->next){ - int action; - if( ap->sp->index>=lemp->nterminal ) continue; - action = compute_action(lemp, ap); - if( action<0 ) continue; - acttab_action(pActtab, ap->sp->index, action); - } - stp->iTknOfst = acttab_insert(pActtab); - if( stp->iTknOfstiTknOfst; - if( stp->iTknOfst>mxTknOfst ) mxTknOfst = stp->iTknOfst; - }else{ - for(ap=stp->ap; ap; ap=ap->next){ - int action; - if( ap->sp->indexnterminal ) continue; - if( ap->sp->index==lemp->nsymbol ) continue; - action = compute_action(lemp, ap); - if( action<0 ) continue; - acttab_action(pActtab, ap->sp->index, action); - } - stp->iNtOfst = acttab_insert(pActtab); - if( stp->iNtOfstiNtOfst; - if( stp->iNtOfst>mxNtOfst ) mxNtOfst = stp->iNtOfst; - } -#if 0 /* Uncomment for a trace of how the yy_action[] table fills out */ - { int jj, nn; - for(jj=nn=0; jjnAction; jj++){ - if( pActtab->aAction[jj].action<0 ) nn++; - } - printf("%4d: State %3d %s n: %2d size: %5d freespace: %d\n", - i, stp->statenum, ax[i].isTkn ? "Token" : "Var ", - ax[i].nAction, pActtab->nAction, nn); - } -#endif - } - free(ax); - - /* Mark rules that are actually used for reduce actions after all - ** optimizations have been applied - */ - for(rp=lemp->rule; rp; rp=rp->next) rp->doesReduce = LEMON_FALSE; - for(i=0; inxstate; i++){ - for(ap=lemp->sorted[i]->ap; ap; ap=ap->next){ - if( ap->type==REDUCE || ap->type==SHIFTREDUCE ){ - ap->x.rp->doesReduce = 1; - } - } - } - - /* Finish rendering the constants now that the action table has - ** been computed */ - fprintf(out,"#define YYNSTATE %d\n",lemp->nxstate); lineno++; - fprintf(out,"#define YYNRULE %d\n",lemp->nrule); lineno++; - fprintf(out,"#define YY_MAX_SHIFT %d\n",lemp->nxstate-1); lineno++; - fprintf(out,"#define YY_MIN_SHIFTREDUCE %d\n",lemp->nstate); lineno++; - i = lemp->nstate + lemp->nrule; - fprintf(out,"#define YY_MAX_SHIFTREDUCE %d\n", i-1); lineno++; - fprintf(out,"#define YY_MIN_REDUCE %d\n", i); lineno++; - i = lemp->nstate + lemp->nrule*2; - fprintf(out,"#define YY_MAX_REDUCE %d\n", i-1); lineno++; - fprintf(out,"#define YY_ERROR_ACTION %d\n", i); lineno++; - fprintf(out,"#define YY_ACCEPT_ACTION %d\n", i+1); lineno++; - fprintf(out,"#define YY_NO_ACTION %d\n", i+2); lineno++; - tplt_xfer(lemp->name,in,out,&lineno); - - /* Now output the action table and its associates: - ** - ** yy_action[] A single table containing all actions. - ** yy_lookahead[] A table containing the lookahead for each entry in - ** yy_action. Used to detect hash collisions. - ** yy_shift_ofst[] For each state, the offset into yy_action for - ** shifting terminals. - ** yy_reduce_ofst[] For each state, the offset into yy_action for - ** shifting non-terminals after a reduce. - ** yy_default[] Default action for each state. - */ - - /* Output the yy_action table */ - lemp->nactiontab = n = acttab_size(pActtab); - lemp->tablesize += n*szActionType; - fprintf(out,"#define YY_ACTTAB_COUNT (%d)\n", n); lineno++; - fprintf(out,"static const YYACTIONTYPE yy_action[] = {\n"); lineno++; - for(i=j=0; instate + lemp->nrule + 2; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", action); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - - /* Output the yy_lookahead table */ - lemp->tablesize += n*szCodeType; - fprintf(out,"static const YYCODETYPE yy_lookahead[] = {\n"); lineno++; - for(i=j=0; insymbol; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", la); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - - /* Output the yy_shift_ofst[] table */ - n = lemp->nxstate; - while( n>0 && lemp->sorted[n-1]->iTknOfst==NO_OFFSET ) n--; - fprintf(out, "#define YY_SHIFT_USE_DFLT (%d)\n", lemp->nactiontab); lineno++; - fprintf(out, "#define YY_SHIFT_COUNT (%d)\n", n-1); lineno++; - fprintf(out, "#define YY_SHIFT_MIN (%d)\n", mnTknOfst); lineno++; - fprintf(out, "#define YY_SHIFT_MAX (%d)\n", mxTknOfst); lineno++; - fprintf(out, "static const %s yy_shift_ofst[] = {\n", - minimum_size_type(mnTknOfst, lemp->nterminal+lemp->nactiontab, &sz)); - lineno++; - lemp->tablesize += n*sz; - for(i=j=0; isorted[i]; - ofst = stp->iTknOfst; - if( ofst==NO_OFFSET ) ofst = lemp->nactiontab; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", ofst); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - - /* Output the yy_reduce_ofst[] table */ - fprintf(out, "#define YY_REDUCE_USE_DFLT (%d)\n", mnNtOfst-1); lineno++; - n = lemp->nxstate; - while( n>0 && lemp->sorted[n-1]->iNtOfst==NO_OFFSET ) n--; - fprintf(out, "#define YY_REDUCE_COUNT (%d)\n", n-1); lineno++; - fprintf(out, "#define YY_REDUCE_MIN (%d)\n", mnNtOfst); lineno++; - fprintf(out, "#define YY_REDUCE_MAX (%d)\n", mxNtOfst); lineno++; - fprintf(out, "static const %s yy_reduce_ofst[] = {\n", - minimum_size_type(mnNtOfst-1, mxNtOfst, &sz)); lineno++; - lemp->tablesize += n*sz; - for(i=j=0; isorted[i]; - ofst = stp->iNtOfst; - if( ofst==NO_OFFSET ) ofst = mnNtOfst - 1; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", ofst); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - - /* Output the default action table */ - fprintf(out, "static const YYACTIONTYPE yy_default[] = {\n"); lineno++; - n = lemp->nxstate; - lemp->tablesize += n*szActionType; - for(i=j=0; isorted[i]; - if( j==0 ) fprintf(out," /* %5d */ ", i); - fprintf(out, " %4d,", stp->iDfltReduce+lemp->nstate+lemp->nrule); - if( j==9 || i==n-1 ){ - fprintf(out, "\n"); lineno++; - j = 0; - }else{ - j++; - } - } - fprintf(out, "};\n"); lineno++; - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate the table of fallback tokens. - */ - if( lemp->has_fallback ){ - int mx = lemp->nterminal - 1; - while( mx>0 && lemp->symbols[mx]->fallback==0 ){ mx--; } - lemp->tablesize += (mx+1)*szCodeType; - for(i=0; i<=mx; i++){ - struct symbol *p = lemp->symbols[i]; - if( p->fallback==0 ){ - fprintf(out, " 0, /* %10s => nothing */\n", p->name); - }else{ - fprintf(out, " %3d, /* %10s => %s */\n", p->fallback->index, - p->name, p->fallback->name); - } - lineno++; - } - } - tplt_xfer(lemp->name, in, out, &lineno); - - /* Generate a table containing the symbolic name of every symbol - */ - for(i=0; insymbol; i++){ - lemon_sprintf(line,"\"%s\",",lemp->symbols[i]->name); - fprintf(out," %-15s",line); - if( (i&3)==3 ){ fprintf(out,"\n"); lineno++; } - } - if( (i&3)!=0 ){ fprintf(out,"\n"); lineno++; } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate a table containing a text string that describes every - ** rule in the rule set of the grammar. This information is used - ** when tracing REDUCE actions. - */ - for(i=0, rp=lemp->rule; rp; rp=rp->next, i++){ - assert( rp->iRule==i ); - fprintf(out," /* %3d */ \"", i); - writeRuleText(out, rp); - fprintf(out,"\",\n"); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes every time a symbol is popped from - ** the stack while processing errors or while destroying the parser. - ** (In other words, generate the %destructor actions) - */ - if( lemp->tokendest ){ - int once = 1; - for(i=0; insymbol; i++){ - struct symbol *sp = lemp->symbols[i]; - if( sp==0 || sp->type!=TERMINAL ) continue; - if( once ){ - fprintf(out, " /* TERMINAL Destructor */\n"); lineno++; - once = 0; - } - fprintf(out," case %d: /* %s */\n", sp->index, sp->name); lineno++; - } - for(i=0; insymbol && lemp->symbols[i]->type!=TERMINAL; i++); - if( insymbol ){ - emit_destructor_code(out,lemp->symbols[i],lemp,&lineno); - fprintf(out," break;\n"); lineno++; - } - } - if( lemp->vardest ){ - struct symbol *dflt_sp = 0; - int once = 1; - for(i=0; insymbol; i++){ - struct symbol *sp = lemp->symbols[i]; - if( sp==0 || sp->type==TERMINAL || - sp->index<=0 || sp->destructor!=0 ) continue; - if( once ){ - fprintf(out, " /* Default NON-TERMINAL Destructor */\n"); lineno++; - once = 0; - } - fprintf(out," case %d: /* %s */\n", sp->index, sp->name); lineno++; - dflt_sp = sp; - } - if( dflt_sp!=0 ){ - emit_destructor_code(out,dflt_sp,lemp,&lineno); - } - fprintf(out," break;\n"); lineno++; - } - for(i=0; insymbol; i++){ - struct symbol *sp = lemp->symbols[i]; - if( sp==0 || sp->type==TERMINAL || sp->destructor==0 ) continue; - if( sp->destLineno<0 ) continue; /* Already emitted */ - fprintf(out," case %d: /* %s */\n", sp->index, sp->name); lineno++; - - /* Combine duplicate destructors into a single case */ - for(j=i+1; jnsymbol; j++){ - struct symbol *sp2 = lemp->symbols[j]; - if( sp2 && sp2->type!=TERMINAL && sp2->destructor - && sp2->dtnum==sp->dtnum - && strcmp(sp->destructor,sp2->destructor)==0 ){ - fprintf(out," case %d: /* %s */\n", - sp2->index, sp2->name); lineno++; - sp2->destLineno = -1; /* Avoid emitting this destructor again */ - } - } - - emit_destructor_code(out,lemp->symbols[i],lemp,&lineno); - fprintf(out," break;\n"); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes whenever the parser stack overflows */ - tplt_print(out,lemp,lemp->overflow,&lineno); - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate the table of rule information - ** - ** Note: This code depends on the fact that rules are number - ** sequentually beginning with 0. - */ - for(rp=lemp->rule; rp; rp=rp->next){ - fprintf(out," { %d, %d },\n",rp->lhs->index,-rp->nrhs); lineno++; - } - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which execution during each REDUCE action */ - i = 0; - for(rp=lemp->rule; rp; rp=rp->next){ - i += translate_code(lemp, rp); - } - if( i ){ - fprintf(out," YYMINORTYPE yylhsminor;\n"); lineno++; - } - /* First output rules other than the default: rule */ - for(rp=lemp->rule; rp; rp=rp->next){ - struct rule *rp2; /* Other rules with the same action */ - if( rp->codeEmitted ) continue; - if( rp->noCode ){ - /* No C code actions, so this will be part of the "default:" rule */ - continue; - } - fprintf(out," case %d: /* ", rp->iRule); - writeRuleText(out, rp); - fprintf(out, " */\n"); lineno++; - for(rp2=rp->next; rp2; rp2=rp2->next){ - if( rp2->code==rp->code && rp2->codePrefix==rp->codePrefix - && rp2->codeSuffix==rp->codeSuffix ){ - fprintf(out," case %d: /* ", rp2->iRule); - writeRuleText(out, rp2); - fprintf(out," */ yytestcase(yyruleno==%d);\n", rp2->iRule); lineno++; - rp2->codeEmitted = 1; - } - } - emit_code(out,rp,lemp,&lineno); - fprintf(out," break;\n"); lineno++; - rp->codeEmitted = 1; - } - /* Finally, output the default: rule. We choose as the default: all - ** empty actions. */ - fprintf(out," default:\n"); lineno++; - for(rp=lemp->rule; rp; rp=rp->next){ - if( rp->codeEmitted ) continue; - assert( rp->noCode ); - fprintf(out," /* (%d) ", rp->iRule); - writeRuleText(out, rp); - if( rp->doesReduce ){ - fprintf(out, " */ yytestcase(yyruleno==%d);\n", rp->iRule); lineno++; - }else{ - fprintf(out, " (OPTIMIZED OUT) */ assert(yyruleno!=%d);\n", - rp->iRule); lineno++; - } - } - fprintf(out," break;\n"); lineno++; - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes if a parse fails */ - tplt_print(out,lemp,lemp->failure,&lineno); - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes when a syntax error occurs */ - tplt_print(out,lemp,lemp->error,&lineno); - tplt_xfer(lemp->name,in,out,&lineno); - - /* Generate code which executes when the parser accepts its input */ - tplt_print(out,lemp,lemp->accept,&lineno); - tplt_xfer(lemp->name,in,out,&lineno); - - /* Append any addition code the user desires */ - tplt_print(out,lemp,lemp->extracode,&lineno); - - fclose(in); - fclose(out); - return; -} - -/* Generate a header file for the parser */ -void ReportHeader(struct lemon *lemp) -{ - FILE *out, *in; - const char *prefix; - char line[LINESIZE]; - char pattern[LINESIZE]; - int i; - - if( lemp->tokenprefix ) prefix = lemp->tokenprefix; - else prefix = ""; - in = file_open(lemp,".h","rb"); - if( in ){ - int nextChar; - for(i=1; interminal && fgets(line,LINESIZE,in); i++){ - lemon_sprintf(pattern,"#define %s%-30s %3d\n", - prefix,lemp->symbols[i]->name,i); - if( strcmp(line,pattern) ) break; - } - nextChar = fgetc(in); - fclose(in); - if( i==lemp->nterminal && nextChar==EOF ){ - /* No change in the file. Don't rewrite it. */ - return; - } - } - out = file_open(lemp,".h","wb"); - if( out ){ - for(i=1; interminal; i++){ - fprintf(out,"#define %s%-30s %3d\n",prefix,lemp->symbols[i]->name,i); - } - fclose(out); - } - return; -} - -/* Reduce the size of the action tables, if possible, by making use -** of defaults. -** -** In this version, we take the most frequent REDUCE action and make -** it the default. Except, there is no default if the wildcard token -** is a possible look-ahead. -*/ -void CompressTables(struct lemon *lemp) -{ - struct state *stp; - struct action *ap, *ap2, *nextap; - struct rule *rp, *rp2, *rbest; - int nbest, n; - int i; - int usesWildcard; - - for(i=0; instate; i++){ - stp = lemp->sorted[i]; - nbest = 0; - rbest = 0; - usesWildcard = 0; - - for(ap=stp->ap; ap; ap=ap->next){ - if( ap->type==SHIFT && ap->sp==lemp->wildcard ){ - usesWildcard = 1; - } - if( ap->type!=REDUCE ) continue; - rp = ap->x.rp; - if( rp->lhsStart ) continue; - if( rp==rbest ) continue; - n = 1; - for(ap2=ap->next; ap2; ap2=ap2->next){ - if( ap2->type!=REDUCE ) continue; - rp2 = ap2->x.rp; - if( rp2==rbest ) continue; - if( rp2==rp ) n++; - } - if( n>nbest ){ - nbest = n; - rbest = rp; - } - } - - /* Do not make a default if the number of rules to default - ** is not at least 1 or if the wildcard token is a possible - ** lookahead. - */ - if( nbest<1 || usesWildcard ) continue; - - - /* Combine matching REDUCE actions into a single default */ - for(ap=stp->ap; ap; ap=ap->next){ - if( ap->type==REDUCE && ap->x.rp==rbest ) break; - } - assert( ap ); - ap->sp = Symbol_new("{default}"); - for(ap=ap->next; ap; ap=ap->next){ - if( ap->type==REDUCE && ap->x.rp==rbest ) ap->type = NOT_USED; - } - stp->ap = Action_sort(stp->ap); - - for(ap=stp->ap; ap; ap=ap->next){ - if( ap->type==SHIFT ) break; - if( ap->type==REDUCE && ap->x.rp!=rbest ) break; - } - if( ap==0 ){ - stp->autoReduce = 1; - stp->pDfltReduce = rbest; - } - } - - /* Make a second pass over all states and actions. Convert - ** every action that is a SHIFT to an autoReduce state into - ** a SHIFTREDUCE action. - */ - for(i=0; instate; i++){ - stp = lemp->sorted[i]; - for(ap=stp->ap; ap; ap=ap->next){ - struct state *pNextState; - if( ap->type!=SHIFT ) continue; - pNextState = ap->x.stp; - if( pNextState->autoReduce && pNextState->pDfltReduce!=0 ){ - ap->type = SHIFTREDUCE; - ap->x.rp = pNextState->pDfltReduce; - } - } - } - - /* If a SHIFTREDUCE action specifies a rule that has a single RHS term - ** (meaning that the SHIFTREDUCE will land back in the state where it - ** started) and if there is no C-code associated with the reduce action, - ** then we can go ahead and convert the action to be the same as the - ** action for the RHS of the rule. - */ - for(i=0; instate; i++){ - stp = lemp->sorted[i]; - for(ap=stp->ap; ap; ap=nextap){ - nextap = ap->next; - if( ap->type!=SHIFTREDUCE ) continue; - rp = ap->x.rp; - if( rp->noCode==0 ) continue; - if( rp->nrhs!=1 ) continue; -#if 1 - /* Only apply this optimization to non-terminals. It would be OK to - ** apply it to terminal symbols too, but that makes the parser tables - ** larger. */ - if( ap->sp->indexnterminal ) continue; -#endif - /* If we reach this point, it means the optimization can be applied */ - nextap = ap; - for(ap2=stp->ap; ap2 && (ap2==ap || ap2->sp!=rp->lhs); ap2=ap2->next){} - assert( ap2!=0 ); - ap->spOpt = ap2->sp; - ap->type = ap2->type; - ap->x = ap2->x; - } - } -} - - -/* -** Compare two states for sorting purposes. The smaller state is the -** one with the most non-terminal actions. If they have the same number -** of non-terminal actions, then the smaller is the one with the most -** token actions. -*/ -static int stateResortCompare(const void *a, const void *b){ - const struct state *pA = *(const struct state**)a; - const struct state *pB = *(const struct state**)b; - int n; - - n = pB->nNtAct - pA->nNtAct; - if( n==0 ){ - n = pB->nTknAct - pA->nTknAct; - if( n==0 ){ - n = pB->statenum - pA->statenum; - } - } - assert( n!=0 ); - return n; -} - - -/* -** Renumber and resort states so that states with fewer choices -** occur at the end. Except, keep state 0 as the first state. -*/ -void ResortStates(struct lemon *lemp) -{ - int i; - struct state *stp; - struct action *ap; - - for(i=0; instate; i++){ - stp = lemp->sorted[i]; - stp->nTknAct = stp->nNtAct = 0; - stp->iDfltReduce = lemp->nrule; /* Init dflt action to "syntax error" */ - stp->iTknOfst = NO_OFFSET; - stp->iNtOfst = NO_OFFSET; - for(ap=stp->ap; ap; ap=ap->next){ - int iAction = compute_action(lemp,ap); - if( iAction>=0 ){ - if( ap->sp->indexnterminal ){ - stp->nTknAct++; - }else if( ap->sp->indexnsymbol ){ - stp->nNtAct++; - }else{ - assert( stp->autoReduce==0 || stp->pDfltReduce==ap->x.rp ); - stp->iDfltReduce = iAction - lemp->nstate - lemp->nrule; - } - } - } - } - qsort(&lemp->sorted[1], lemp->nstate-1, sizeof(lemp->sorted[0]), - stateResortCompare); - for(i=0; instate; i++){ - lemp->sorted[i]->statenum = i; - } - lemp->nxstate = lemp->nstate; - while( lemp->nxstate>1 && lemp->sorted[lemp->nxstate-1]->autoReduce ){ - lemp->nxstate--; - } -} - - -/***************** From the file "set.c" ************************************/ -/* -** Set manipulation routines for the LEMON parser generator. -*/ - -static int size = 0; - -/* Set the set size */ -void SetSize(int n) -{ - size = n+1; -} - -/* Allocate a new set */ -char *SetNew(void){ - char *s; - s = (char*)calloc( size, 1); - if( s==0 ){ - extern void memory_error(); - memory_error(); - } - return s; -} - -/* Deallocate a set */ -void SetFree(char *s) -{ - free(s); -} - -/* Add a new element to the set. Return TRUE if the element was added -** and FALSE if it was already there. */ -int SetAdd(char *s, int e) -{ - int rv; - assert( e>=0 && esize = 1024; - x1a->count = 0; - x1a->tbl = (x1node*)calloc(1024, sizeof(x1node) + sizeof(x1node*)); - if( x1a->tbl==0 ){ - free(x1a); - x1a = 0; - }else{ - int i; - x1a->ht = (x1node**)&(x1a->tbl[1024]); - for(i=0; i<1024; i++) x1a->ht[i] = 0; - } - } -} -/* Insert a new record into the array. Return TRUE if successful. -** Prior data with the same key is NOT overwritten */ -int Strsafe_insert(const char *data) -{ - x1node *np; - unsigned h; - unsigned ph; - - if( x1a==0 ) return 0; - ph = strhash(data); - h = ph & (x1a->size-1); - np = x1a->ht[h]; - while( np ){ - if( strcmp(np->data,data)==0 ){ - /* An existing entry with the same key is found. */ - /* Fail because overwrite is not allows. */ - return 0; - } - np = np->next; - } - if( x1a->count>=x1a->size ){ - /* Need to make the hash table bigger */ - int i,arrSize; - struct s_x1 array; - array.size = arrSize = x1a->size*2; - array.count = x1a->count; - array.tbl = (x1node*)calloc(arrSize, sizeof(x1node) + sizeof(x1node*)); - if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ - array.ht = (x1node**)&(array.tbl[arrSize]); - for(i=0; icount; i++){ - x1node *oldnp, *newnp; - oldnp = &(x1a->tbl[i]); - h = strhash(oldnp->data) & (arrSize-1); - newnp = &(array.tbl[i]); - if( array.ht[h] ) array.ht[h]->from = &(newnp->next); - newnp->next = array.ht[h]; - newnp->data = oldnp->data; - newnp->from = &(array.ht[h]); - array.ht[h] = newnp; - } - free(x1a->tbl); - *x1a = array; - } - /* Insert the new data */ - h = ph & (x1a->size-1); - np = &(x1a->tbl[x1a->count++]); - np->data = data; - if( x1a->ht[h] ) x1a->ht[h]->from = &(np->next); - np->next = x1a->ht[h]; - x1a->ht[h] = np; - np->from = &(x1a->ht[h]); - return 1; -} - -/* Return a pointer to data assigned to the given key. Return NULL -** if no such key. */ -const char *Strsafe_find(const char *key) -{ - unsigned h; - x1node *np; - - if( x1a==0 ) return 0; - h = strhash(key) & (x1a->size-1); - np = x1a->ht[h]; - while( np ){ - if( strcmp(np->data,key)==0 ) break; - np = np->next; - } - return np ? np->data : 0; -} - -/* Return a pointer to the (terminal or nonterminal) symbol "x". -** Create a new symbol if this is the first time "x" has been seen. -*/ -struct symbol *Symbol_new(const char *x) -{ - struct symbol *sp; - - sp = Symbol_find(x); - if( sp==0 ){ - sp = (struct symbol *)calloc(1, sizeof(struct symbol) ); - MemoryCheck(sp); - sp->name = Strsafe(x); - sp->type = ISUPPER(*x) ? TERMINAL : NONTERMINAL; - sp->rule = 0; - sp->fallback = 0; - sp->prec = -1; - sp->assoc = UNK; - sp->firstset = 0; - sp->lambda = LEMON_FALSE; - sp->destructor = 0; - sp->destLineno = 0; - sp->datatype = 0; - sp->useCnt = 0; - Symbol_insert(sp,sp->name); - } - sp->useCnt++; - return sp; -} - -/* Compare two symbols for sorting purposes. Return negative, -** zero, or positive if a is less then, equal to, or greater -** than b. -** -** Symbols that begin with upper case letters (terminals or tokens) -** must sort before symbols that begin with lower case letters -** (non-terminals). And MULTITERMINAL symbols (created using the -** %token_class directive) must sort at the very end. Other than -** that, the order does not matter. -** -** We find experimentally that leaving the symbols in their original -** order (the order they appeared in the grammar file) gives the -** smallest parser tables in SQLite. -*/ -int Symbolcmpp(const void *_a, const void *_b) -{ - const struct symbol *a = *(const struct symbol **) _a; - const struct symbol *b = *(const struct symbol **) _b; - int i1 = a->type==MULTITERMINAL ? 3 : a->name[0]>'Z' ? 2 : 1; - int i2 = b->type==MULTITERMINAL ? 3 : b->name[0]>'Z' ? 2 : 1; - return i1==i2 ? a->index - b->index : i1 - i2; -} - -/* There is one instance of the following structure for each -** associative array of type "x2". -*/ -struct s_x2 { - int size; /* The number of available slots. */ - /* Must be a power of 2 greater than or */ - /* equal to 1 */ - int count; /* Number of currently slots filled */ - struct s_x2node *tbl; /* The data stored here */ - struct s_x2node **ht; /* Hash table for lookups */ -}; - -/* There is one instance of this structure for every data element -** in an associative array of type "x2". -*/ -typedef struct s_x2node { - struct symbol *data; /* The data */ - const char *key; /* The key */ - struct s_x2node *next; /* Next entry with the same hash */ - struct s_x2node **from; /* Previous link */ -} x2node; - -/* There is only one instance of the array, which is the following */ -static struct s_x2 *x2a; - -/* Allocate a new associative array */ -void Symbol_init(void){ - if( x2a ) return; - x2a = (struct s_x2*)malloc( sizeof(struct s_x2) ); - if( x2a ){ - x2a->size = 128; - x2a->count = 0; - x2a->tbl = (x2node*)calloc(128, sizeof(x2node) + sizeof(x2node*)); - if( x2a->tbl==0 ){ - free(x2a); - x2a = 0; - }else{ - int i; - x2a->ht = (x2node**)&(x2a->tbl[128]); - for(i=0; i<128; i++) x2a->ht[i] = 0; - } - } -} -/* Insert a new record into the array. Return TRUE if successful. -** Prior data with the same key is NOT overwritten */ -int Symbol_insert(struct symbol *data, const char *key) -{ - x2node *np; - unsigned h; - unsigned ph; - - if( x2a==0 ) return 0; - ph = strhash(key); - h = ph & (x2a->size-1); - np = x2a->ht[h]; - while( np ){ - if( strcmp(np->key,key)==0 ){ - /* An existing entry with the same key is found. */ - /* Fail because overwrite is not allows. */ - return 0; - } - np = np->next; - } - if( x2a->count>=x2a->size ){ - /* Need to make the hash table bigger */ - int i,arrSize; - struct s_x2 array; - array.size = arrSize = x2a->size*2; - array.count = x2a->count; - array.tbl = (x2node*)calloc(arrSize, sizeof(x2node) + sizeof(x2node*)); - if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ - array.ht = (x2node**)&(array.tbl[arrSize]); - for(i=0; icount; i++){ - x2node *oldnp, *newnp; - oldnp = &(x2a->tbl[i]); - h = strhash(oldnp->key) & (arrSize-1); - newnp = &(array.tbl[i]); - if( array.ht[h] ) array.ht[h]->from = &(newnp->next); - newnp->next = array.ht[h]; - newnp->key = oldnp->key; - newnp->data = oldnp->data; - newnp->from = &(array.ht[h]); - array.ht[h] = newnp; - } - free(x2a->tbl); - *x2a = array; - } - /* Insert the new data */ - h = ph & (x2a->size-1); - np = &(x2a->tbl[x2a->count++]); - np->key = key; - np->data = data; - if( x2a->ht[h] ) x2a->ht[h]->from = &(np->next); - np->next = x2a->ht[h]; - x2a->ht[h] = np; - np->from = &(x2a->ht[h]); - return 1; -} - -/* Return a pointer to data assigned to the given key. Return NULL -** if no such key. */ -struct symbol *Symbol_find(const char *key) -{ - unsigned h; - x2node *np; - - if( x2a==0 ) return 0; - h = strhash(key) & (x2a->size-1); - np = x2a->ht[h]; - while( np ){ - if( strcmp(np->key,key)==0 ) break; - np = np->next; - } - return np ? np->data : 0; -} - -/* Return the n-th data. Return NULL if n is out of range. */ -struct symbol *Symbol_Nth(int n) -{ - struct symbol *data; - if( x2a && n>0 && n<=x2a->count ){ - data = x2a->tbl[n-1].data; - }else{ - data = 0; - } - return data; -} - -/* Return the size of the array */ -int Symbol_count() -{ - return x2a ? x2a->count : 0; -} - -/* Return an array of pointers to all data in the table. -** The array is obtained from malloc. Return NULL if memory allocation -** problems, or if the array is empty. */ -struct symbol **Symbol_arrayof() -{ - struct symbol **array; - int i,arrSize; - if( x2a==0 ) return 0; - arrSize = x2a->count; - array = (struct symbol **)calloc(arrSize, sizeof(struct symbol *)); - if( array ){ - for(i=0; itbl[i].data; - } - return array; -} - -/* Compare two configurations */ -int Configcmp(const char *_a,const char *_b) -{ - const struct config *a = (struct config *) _a; - const struct config *b = (struct config *) _b; - int x; - x = a->rp->index - b->rp->index; - if( x==0 ) x = a->dot - b->dot; - return x; -} - -/* Compare two states */ -PRIVATE int statecmp(struct config *a, struct config *b) -{ - int rc; - for(rc=0; rc==0 && a && b; a=a->bp, b=b->bp){ - rc = a->rp->index - b->rp->index; - if( rc==0 ) rc = a->dot - b->dot; - } - if( rc==0 ){ - if( a ) rc = 1; - if( b ) rc = -1; - } - return rc; -} - -/* Hash a state */ -PRIVATE unsigned statehash(struct config *a) -{ - unsigned h=0; - while( a ){ - h = h*571 + a->rp->index*37 + a->dot; - a = a->bp; - } - return h; -} - -/* Allocate a new state structure */ -struct state *State_new() -{ - struct state *newstate; - newstate = (struct state *)calloc(1, sizeof(struct state) ); - MemoryCheck(newstate); - return newstate; -} - -/* There is one instance of the following structure for each -** associative array of type "x3". -*/ -struct s_x3 { - int size; /* The number of available slots. */ - /* Must be a power of 2 greater than or */ - /* equal to 1 */ - int count; /* Number of currently slots filled */ - struct s_x3node *tbl; /* The data stored here */ - struct s_x3node **ht; /* Hash table for lookups */ -}; - -/* There is one instance of this structure for every data element -** in an associative array of type "x3". -*/ -typedef struct s_x3node { - struct state *data; /* The data */ - struct config *key; /* The key */ - struct s_x3node *next; /* Next entry with the same hash */ - struct s_x3node **from; /* Previous link */ -} x3node; - -/* There is only one instance of the array, which is the following */ -static struct s_x3 *x3a; - -/* Allocate a new associative array */ -void State_init(void){ - if( x3a ) return; - x3a = (struct s_x3*)malloc( sizeof(struct s_x3) ); - if( x3a ){ - x3a->size = 128; - x3a->count = 0; - x3a->tbl = (x3node*)calloc(128, sizeof(x3node) + sizeof(x3node*)); - if( x3a->tbl==0 ){ - free(x3a); - x3a = 0; - }else{ - int i; - x3a->ht = (x3node**)&(x3a->tbl[128]); - for(i=0; i<128; i++) x3a->ht[i] = 0; - } - } -} -/* Insert a new record into the array. Return TRUE if successful. -** Prior data with the same key is NOT overwritten */ -int State_insert(struct state *data, struct config *key) -{ - x3node *np; - unsigned h; - unsigned ph; - - if( x3a==0 ) return 0; - ph = statehash(key); - h = ph & (x3a->size-1); - np = x3a->ht[h]; - while( np ){ - if( statecmp(np->key,key)==0 ){ - /* An existing entry with the same key is found. */ - /* Fail because overwrite is not allows. */ - return 0; - } - np = np->next; - } - if( x3a->count>=x3a->size ){ - /* Need to make the hash table bigger */ - int i,arrSize; - struct s_x3 array; - array.size = arrSize = x3a->size*2; - array.count = x3a->count; - array.tbl = (x3node*)calloc(arrSize, sizeof(x3node) + sizeof(x3node*)); - if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ - array.ht = (x3node**)&(array.tbl[arrSize]); - for(i=0; icount; i++){ - x3node *oldnp, *newnp; - oldnp = &(x3a->tbl[i]); - h = statehash(oldnp->key) & (arrSize-1); - newnp = &(array.tbl[i]); - if( array.ht[h] ) array.ht[h]->from = &(newnp->next); - newnp->next = array.ht[h]; - newnp->key = oldnp->key; - newnp->data = oldnp->data; - newnp->from = &(array.ht[h]); - array.ht[h] = newnp; - } - free(x3a->tbl); - *x3a = array; - } - /* Insert the new data */ - h = ph & (x3a->size-1); - np = &(x3a->tbl[x3a->count++]); - np->key = key; - np->data = data; - if( x3a->ht[h] ) x3a->ht[h]->from = &(np->next); - np->next = x3a->ht[h]; - x3a->ht[h] = np; - np->from = &(x3a->ht[h]); - return 1; -} - -/* Return a pointer to data assigned to the given key. Return NULL -** if no such key. */ -struct state *State_find(struct config *key) -{ - unsigned h; - x3node *np; - - if( x3a==0 ) return 0; - h = statehash(key) & (x3a->size-1); - np = x3a->ht[h]; - while( np ){ - if( statecmp(np->key,key)==0 ) break; - np = np->next; - } - return np ? np->data : 0; -} - -/* Return an array of pointers to all data in the table. -** The array is obtained from malloc. Return NULL if memory allocation -** problems, or if the array is empty. */ -struct state **State_arrayof(void) -{ - struct state **array; - int i,arrSize; - if( x3a==0 ) return 0; - arrSize = x3a->count; - array = (struct state **)calloc(arrSize, sizeof(struct state *)); - if( array ){ - for(i=0; itbl[i].data; - } - return array; -} - -/* Hash a configuration */ -PRIVATE unsigned confighash(struct config *a) -{ - unsigned h=0; - h = h*571 + a->rp->index*37 + a->dot; - return h; -} - -/* There is one instance of the following structure for each -** associative array of type "x4". -*/ -struct s_x4 { - int size; /* The number of available slots. */ - /* Must be a power of 2 greater than or */ - /* equal to 1 */ - int count; /* Number of currently slots filled */ - struct s_x4node *tbl; /* The data stored here */ - struct s_x4node **ht; /* Hash table for lookups */ -}; - -/* There is one instance of this structure for every data element -** in an associative array of type "x4". -*/ -typedef struct s_x4node { - struct config *data; /* The data */ - struct s_x4node *next; /* Next entry with the same hash */ - struct s_x4node **from; /* Previous link */ -} x4node; - -/* There is only one instance of the array, which is the following */ -static struct s_x4 *x4a; - -/* Allocate a new associative array */ -void Configtable_init(void){ - if( x4a ) return; - x4a = (struct s_x4*)malloc( sizeof(struct s_x4) ); - if( x4a ){ - x4a->size = 64; - x4a->count = 0; - x4a->tbl = (x4node*)calloc(64, sizeof(x4node) + sizeof(x4node*)); - if( x4a->tbl==0 ){ - free(x4a); - x4a = 0; - }else{ - int i; - x4a->ht = (x4node**)&(x4a->tbl[64]); - for(i=0; i<64; i++) x4a->ht[i] = 0; - } - } -} -/* Insert a new record into the array. Return TRUE if successful. -** Prior data with the same key is NOT overwritten */ -int Configtable_insert(struct config *data) -{ - x4node *np; - unsigned h; - unsigned ph; - - if( x4a==0 ) return 0; - ph = confighash(data); - h = ph & (x4a->size-1); - np = x4a->ht[h]; - while( np ){ - if( Configcmp((const char *) np->data,(const char *) data)==0 ){ - /* An existing entry with the same key is found. */ - /* Fail because overwrite is not allows. */ - return 0; - } - np = np->next; - } - if( x4a->count>=x4a->size ){ - /* Need to make the hash table bigger */ - int i,arrSize; - struct s_x4 array; - array.size = arrSize = x4a->size*2; - array.count = x4a->count; - array.tbl = (x4node*)calloc(arrSize, sizeof(x4node) + sizeof(x4node*)); - if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ - array.ht = (x4node**)&(array.tbl[arrSize]); - for(i=0; icount; i++){ - x4node *oldnp, *newnp; - oldnp = &(x4a->tbl[i]); - h = confighash(oldnp->data) & (arrSize-1); - newnp = &(array.tbl[i]); - if( array.ht[h] ) array.ht[h]->from = &(newnp->next); - newnp->next = array.ht[h]; - newnp->data = oldnp->data; - newnp->from = &(array.ht[h]); - array.ht[h] = newnp; - } - free(x4a->tbl); - *x4a = array; - } - /* Insert the new data */ - h = ph & (x4a->size-1); - np = &(x4a->tbl[x4a->count++]); - np->data = data; - if( x4a->ht[h] ) x4a->ht[h]->from = &(np->next); - np->next = x4a->ht[h]; - x4a->ht[h] = np; - np->from = &(x4a->ht[h]); - return 1; -} - -/* Return a pointer to data assigned to the given key. Return NULL -** if no such key. */ -struct config *Configtable_find(struct config *key) -{ - int h; - x4node *np; - - if( x4a==0 ) return 0; - h = confighash(key) & (x4a->size-1); - np = x4a->ht[h]; - while( np ){ - if( Configcmp((const char *) np->data,(const char *) key)==0 ) break; - np = np->next; - } - return np ? np->data : 0; -} - -/* Remove all data from the table. Pass each data to the function "f" -** as it is removed. ("f" may be null to avoid this step.) */ -void Configtable_clear(int(*f)(struct config *)) -{ - int i; - if( x4a==0 || x4a->count==0 ) return; - if( f ) for(i=0; icount; i++) (*f)(x4a->tbl[i].data); - for(i=0; isize; i++) x4a->ht[i] = 0; - x4a->count = 0; - return; -} diff --git a/bx/tools/lemon/lempar.c b/bx/tools/lemon/lempar.c deleted file mode 100644 index 5e2024ff..00000000 --- a/bx/tools/lemon/lempar.c +++ /dev/null @@ -1,981 +0,0 @@ -/* -** 2000-05-29 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** Driver template for the LEMON parser generator. -** -** The "lemon" program processes an LALR(1) input grammar file, then uses -** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the -** interstitial "-" characters) contained in this template is changed into -** the value of the %name directive from the grammar. Otherwise, the content -** of this template is copied straight through into the generate parser -** source file. -** -** The following is the concatenation of all %include directives from the -** input grammar file: -*/ -#include -/************ Begin %include sections from the grammar ************************/ -%% -/**************** End of %include directives **********************************/ -/* These constants specify the various numeric values for terminal symbols -** in a format understandable to "makeheaders". This section is blank unless -** "lemon" is run with the "-m" command-line option. -***************** Begin makeheaders token definitions *************************/ -%% -/**************** End makeheaders token definitions ***************************/ - -/* The next sections is a series of control #defines. -** various aspects of the generated parser. -** YYCODETYPE is the data type used to store the integer codes -** that represent terminal and non-terminal symbols. -** "unsigned char" is used if there are fewer than -** 256 symbols. Larger types otherwise. -** YYNOCODE is a number of type YYCODETYPE that is not used for -** any terminal or nonterminal symbol. -** YYFALLBACK If defined, this indicates that one or more tokens -** (also known as: "terminal symbols") have fall-back -** values which should be used if the original symbol -** would not parse. This permits keywords to sometimes -** be used as identifiers, for example. -** YYACTIONTYPE is the data type used for "action codes" - numbers -** that indicate what to do in response to the next -** token. -** ParseTOKENTYPE is the data type used for minor type for terminal -** symbols. Background: A "minor type" is a semantic -** value associated with a terminal or non-terminal -** symbols. For example, for an "ID" terminal symbol, -** the minor type might be the name of the identifier. -** Each non-terminal can have a different minor type. -** Terminal symbols all have the same minor type, though. -** This macros defines the minor type for terminal -** symbols. -** YYMINORTYPE is the data type used for all minor types. -** This is typically a union of many types, one of -** which is ParseTOKENTYPE. The entry in the union -** for terminal symbols is called "yy0". -** YYSTACKDEPTH is the maximum depth of the parser's stack. If -** zero the stack is dynamically sized using realloc() -** ParseARG_SDECL A static variable declaration for the %extra_argument -** ParseARG_PDECL A parameter declaration for the %extra_argument -** ParseARG_STORE Code to store %extra_argument into yypParser -** ParseARG_FETCH Code to extract %extra_argument from yypParser -** YYERRORSYMBOL is the code number of the error symbol. If not -** defined, then do no error processing. -** YYNSTATE the combined number of states. -** YYNRULE the number of rules in the grammar -** YY_MAX_SHIFT Maximum value for shift actions -** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions -** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions -** YY_MIN_REDUCE Minimum value for reduce actions -** YY_MAX_REDUCE Maximum value for reduce actions -** YY_ERROR_ACTION The yy_action[] code for syntax error -** YY_ACCEPT_ACTION The yy_action[] code for accept -** YY_NO_ACTION The yy_action[] code for no-op -*/ -#ifndef INTERFACE -# define INTERFACE 1 -#endif -/************* Begin control #defines *****************************************/ -%% -/************* End control #defines *******************************************/ - -/* Define the yytestcase() macro to be a no-op if is not already defined -** otherwise. -** -** Applications can choose to define yytestcase() in the %include section -** to a macro that can assist in verifying code coverage. For production -** code the yytestcase() macro should be turned off. But it is useful -** for testing. -*/ -#ifndef yytestcase -# define yytestcase(X) -#endif - - -/* Next are the tables used to determine what action to take based on the -** current state and lookahead token. These tables are used to implement -** functions that take a state number and lookahead value and return an -** action integer. -** -** Suppose the action integer is N. Then the action is determined as -** follows -** -** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead -** token onto the stack and goto state N. -** -** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then -** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE. -** -** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE -** and YY_MAX_REDUCE -** -** N == YY_ERROR_ACTION A syntax error has occurred. -** -** N == YY_ACCEPT_ACTION The parser accepts its input. -** -** N == YY_NO_ACTION No such action. Denotes unused -** slots in the yy_action[] table. -** -** The action table is constructed as a single large table named yy_action[]. -** Given state S and lookahead X, the action is computed as either: -** -** (A) N = yy_action[ yy_shift_ofst[S] + X ] -** (B) N = yy_default[S] -** -** The (A) formula is preferred. The B formula is used instead if: -** (1) The yy_shift_ofst[S]+X value is out of range, or -** (2) yy_lookahead[yy_shift_ofst[S]+X] is not equal to X, or -** (3) yy_shift_ofst[S] equal YY_SHIFT_USE_DFLT. -** (Implementation note: YY_SHIFT_USE_DFLT is chosen so that -** YY_SHIFT_USE_DFLT+X will be out of range for all possible lookaheads X. -** Hence only tests (1) and (2) need to be evaluated.) -** -** The formulas above are for computing the action when the lookahead is -** a terminal symbol. If the lookahead is a non-terminal (as occurs after -** a reduce action) then the yy_reduce_ofst[] array is used in place of -** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of -** YY_SHIFT_USE_DFLT. -** -** The following are the tables generated in this section: -** -** yy_action[] A single table containing all actions. -** yy_lookahead[] A table containing the lookahead for each entry in -** yy_action. Used to detect hash collisions. -** yy_shift_ofst[] For each state, the offset into yy_action for -** shifting terminals. -** yy_reduce_ofst[] For each state, the offset into yy_action for -** shifting non-terminals after a reduce. -** yy_default[] Default action for each state. -** -*********** Begin parsing tables **********************************************/ -%% -/********** End of lemon-generated parsing tables *****************************/ - -/* The next table maps tokens (terminal symbols) into fallback tokens. -** If a construct like the following: -** -** %fallback ID X Y Z. -** -** appears in the grammar, then ID becomes a fallback token for X, Y, -** and Z. Whenever one of the tokens X, Y, or Z is input to the parser -** but it does not parse, the type of the token is changed to ID and -** the parse is retried before an error is thrown. -** -** This feature can be used, for example, to cause some keywords in a language -** to revert to identifiers if they keyword does not apply in the context where -** it appears. -*/ -#ifdef YYFALLBACK -static const YYCODETYPE yyFallback[] = { -%% -}; -#endif /* YYFALLBACK */ - -/* The following structure represents a single element of the -** parser's stack. Information stored includes: -** -** + The state number for the parser at this level of the stack. -** -** + The value of the token stored at this level of the stack. -** (In other words, the "major" token.) -** -** + The semantic value stored at this level of the stack. This is -** the information used by the action routines in the grammar. -** It is sometimes called the "minor" token. -** -** After the "shift" half of a SHIFTREDUCE action, the stateno field -** actually contains the reduce action for the second half of the -** SHIFTREDUCE. -*/ -struct yyStackEntry { - YYACTIONTYPE stateno; /* The state-number, or reduce action in SHIFTREDUCE */ - YYCODETYPE major; /* The major token value. This is the code - ** number for the token at this stack level */ - YYMINORTYPE minor; /* The user-supplied minor token value. This - ** is the value of the token */ -}; -typedef struct yyStackEntry yyStackEntry; - -/* The state of the parser is completely contained in an instance of -** the following structure */ -struct yyParser { - yyStackEntry *yytos; /* Pointer to top element of the stack */ -#ifdef YYTRACKMAXSTACKDEPTH - int yyhwm; /* High-water mark of the stack */ -#endif -#ifndef YYNOERRORRECOVERY - int yyerrcnt; /* Shifts left before out of the error */ -#endif - ParseARG_SDECL /* A place to hold %extra_argument */ -#if YYSTACKDEPTH<=0 - int yystksz; /* Current side of the stack */ - yyStackEntry *yystack; /* The parser's stack */ - yyStackEntry yystk0; /* First stack entry */ -#else - yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ - yyStackEntry *yystackEnd; /* Last entry in the stack */ -#endif -}; -typedef struct yyParser yyParser; - -#ifndef NDEBUG -#include -static FILE *yyTraceFILE = 0; -static char *yyTracePrompt = 0; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* -** Turn parser tracing on by giving a stream to which to write the trace -** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL -** -** Inputs: -**
    -**
  • A FILE* to which trace output should be written. -** If NULL, then tracing is turned off. -**
  • A prefix string written at the beginning of every -** line of trace output. If NULL, then tracing is -** turned off. -**
-** -** Outputs: -** None. -*/ -void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ - yyTraceFILE = TraceFILE; - yyTracePrompt = zTracePrompt; - if( yyTraceFILE==0 ) yyTracePrompt = 0; - else if( yyTracePrompt==0 ) yyTraceFILE = 0; -} -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing shifts, the names of all terminals and nonterminals -** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { -%% -}; -#endif /* NDEBUG */ - -#ifndef NDEBUG -/* For tracing reduce actions, the names of all rules are required. -*/ -static const char *const yyRuleName[] = { -%% -}; -#endif /* NDEBUG */ - - -#if YYSTACKDEPTH<=0 -/* -** Try to increase the size of the parser stack. Return the number -** of errors. Return 0 on success. -*/ -static int yyGrowStack(yyParser *p){ - int newSize; - int idx; - yyStackEntry *pNew; - - newSize = p->yystksz*2 + 100; - idx = p->yytos ? (int)(p->yytos - p->yystack) : 0; - if( p->yystack==&p->yystk0 ){ - pNew = malloc(newSize*sizeof(pNew[0])); - if( pNew ) pNew[0] = p->yystk0; - }else{ - pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); - } - if( pNew ){ - p->yystack = pNew; - p->yytos = &p->yystack[idx]; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", - yyTracePrompt, p->yystksz, newSize); - } -#endif - p->yystksz = newSize; - } - return pNew==0; -} -#endif - -/* Datatype of the argument to the memory allocated passed as the -** second argument to ParseAlloc() below. This can be changed by -** putting an appropriate #define in the %include section of the input -** grammar. -*/ -#ifndef YYMALLOCARGTYPE -# define YYMALLOCARGTYPE size_t -#endif - -/* Initialize a new parser that has already been allocated. -*/ -void ParseInit(void *yypParser){ - yyParser *pParser = (yyParser*)yypParser; -#ifdef YYTRACKMAXSTACKDEPTH - pParser->yyhwm = 0; -#endif -#if YYSTACKDEPTH<=0 - pParser->yytos = NULL; - pParser->yystack = NULL; - pParser->yystksz = 0; - if( yyGrowStack(pParser) ){ - pParser->yystack = &pParser->yystk0; - pParser->yystksz = 1; - } -#endif -#ifndef YYNOERRORRECOVERY - pParser->yyerrcnt = -1; -#endif - pParser->yytos = pParser->yystack; - pParser->yystack[0].stateno = 0; - pParser->yystack[0].major = 0; -#if YYSTACKDEPTH>0 - pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1]; -#endif -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** This function allocates a new parser. -** The only argument is a pointer to a function which works like -** malloc. -** -** Inputs: -** A pointer to the function used to allocate memory. -** -** Outputs: -** A pointer to a parser. This pointer is used in subsequent calls -** to Parse and ParseFree. -*/ -void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); - if( pParser ) ParseInit(pParser); - return pParser; -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - - -/* The following function deletes the "minor type" or semantic value -** associated with a symbol. The symbol can be either a terminal -** or nonterminal. "yymajor" is the symbol code, and "yypminor" is -** a pointer to the value to be deleted. The code used to do the -** deletions is derived from the %destructor and/or %token_destructor -** directives of the input grammar. -*/ -static void yy_destructor( - yyParser *yypParser, /* The parser */ - YYCODETYPE yymajor, /* Type code for object to destroy */ - YYMINORTYPE *yypminor /* The object to be destroyed */ -){ - ParseARG_FETCH; - switch( yymajor ){ - /* Here is inserted the actions which take place when a - ** terminal or non-terminal is destroyed. This can happen - ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is - ** being destroyed before it is finished parsing. - ** - ** Note: during a reduce, the only symbols destroyed are those - ** which appear on the RHS of the rule, but which are *not* used - ** inside the C code. - */ -/********* Begin destructor definitions ***************************************/ -%% -/********* End destructor definitions *****************************************/ - default: break; /* If no destructor action specified: do nothing */ - } -} - -/* -** Pop the parser's stack once. -** -** If there is a destructor routine associated with the token which -** is popped from the stack, then call it. -*/ -static void yy_pop_parser_stack(yyParser *pParser){ - yyStackEntry *yytos; - assert( pParser->yytos!=0 ); - assert( pParser->yytos > pParser->yystack ); - yytos = pParser->yytos--; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sPopping %s\n", - yyTracePrompt, - yyTokenName[yytos->major]); - } -#endif - yy_destructor(pParser, yytos->major, &yytos->minor); -} - -/* -** Clear all secondary memory allocations from the parser -*/ -void ParseFinalize(void *p){ - yyParser *pParser = (yyParser*)p; - while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser); -#if YYSTACKDEPTH<=0 - if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack); -#endif -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** Deallocate and destroy a parser. Destructors are called for -** all stack elements before shutting the parser down. -** -** If the YYPARSEFREENEVERNULL macro exists (for example because it -** is defined in a %include section of the input grammar) then it is -** assumed that the input pointer is never NULL. -*/ -void ParseFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ -){ -#ifndef YYPARSEFREENEVERNULL - if( p==0 ) return; -#endif - ParseFinalize(p); - (*freeProc)(p); -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - -/* -** Return the peak depth of the stack for a parser. -*/ -#ifdef YYTRACKMAXSTACKDEPTH -int ParseStackPeak(void *p){ - yyParser *pParser = (yyParser*)p; - return pParser->yyhwm; -} -#endif - -/* -** Find the appropriate action for a parser given the terminal -** look-ahead token iLookAhead. -*/ -static unsigned int yy_find_shift_action( - yyParser *pParser, /* The parser */ - YYCODETYPE iLookAhead /* The look-ahead token */ -){ - int i; - int stateno = pParser->yytos->stateno; - - if( stateno>=YY_MIN_REDUCE ) return stateno; - assert( stateno <= YY_SHIFT_COUNT ); - do{ - i = yy_shift_ofst[stateno]; - assert( iLookAhead!=YYNOCODE ); - i += iLookAhead; - if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ -#ifdef YYFALLBACK - YYCODETYPE iFallback; /* Fallback token */ - if( iLookAhead %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); - } -#endif - assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ - iLookAhead = iFallback; - continue; - } -#endif -#ifdef YYWILDCARD - { - int j = i - iLookAhead + YYWILDCARD; - if( -#if YY_SHIFT_MIN+YYWILDCARD<0 - j>=0 && -#endif -#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT - j0 - ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], - yyTokenName[YYWILDCARD]); - } -#endif /* NDEBUG */ - return yy_action[j]; - } - } -#endif /* YYWILDCARD */ - return yy_default[stateno]; - }else{ - return yy_action[i]; - } - }while(1); -} - -/* -** Find the appropriate action for a parser given the non-terminal -** look-ahead token iLookAhead. -*/ -static int yy_find_reduce_action( - int stateno, /* Current state number */ - YYCODETYPE iLookAhead /* The look-ahead token */ -){ - int i; -#ifdef YYERRORSYMBOL - if( stateno>YY_REDUCE_COUNT ){ - return yy_default[stateno]; - } -#else - assert( stateno<=YY_REDUCE_COUNT ); -#endif - i = yy_reduce_ofst[stateno]; - assert( i!=YY_REDUCE_USE_DFLT ); - assert( iLookAhead!=YYNOCODE ); - i += iLookAhead; -#ifdef YYERRORSYMBOL - if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ - return yy_default[stateno]; - } -#else - assert( i>=0 && iyytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will execute if the parser - ** stack every overflows */ -/******** Begin %stack_overflow code ******************************************/ -%% -/******** End %stack_overflow code ********************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ -} - -/* -** Print tracing information for a SHIFT action -*/ -#ifndef NDEBUG -static void yyTraceShift(yyParser *yypParser, int yyNewState){ - if( yyTraceFILE ){ - if( yyNewStateyytos->major], - yyNewState); - }else{ - fprintf(yyTraceFILE,"%sShift '%s'\n", - yyTracePrompt,yyTokenName[yypParser->yytos->major]); - } - } -} -#else -# define yyTraceShift(X,Y) -#endif - -/* -** Perform a shift action. -*/ -static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ - int yyNewState, /* The new state to shift in */ - int yyMajor, /* The major token to shift in */ - ParseTOKENTYPE yyMinor /* The minor token to shift in */ -){ - yyStackEntry *yytos; - yypParser->yytos++; -#ifdef YYTRACKMAXSTACKDEPTH - if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) ); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>yypParser->yystackEnd ){ - yypParser->yytos--; - yyStackOverflow(yypParser); - return; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){ - if( yyGrowStack(yypParser) ){ - yypParser->yytos--; - yyStackOverflow(yypParser); - return; - } - } -#endif - if( yyNewState > YY_MAX_SHIFT ){ - yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; - } - yytos = yypParser->yytos; - yytos->stateno = (YYACTIONTYPE)yyNewState; - yytos->major = (YYCODETYPE)yyMajor; - yytos->minor.yy0 = yyMinor; - yyTraceShift(yypParser, yyNewState); -} - -/* The following table contains information about every rule that -** is used during the reduce. -*/ -static const struct { - YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ - signed char nrhs; /* Negative of the number of RHS symbols in the rule */ -} yyRuleInfo[] = { -%% -}; - -static void yy_accept(yyParser*); /* Forward Declaration */ - -/* -** Perform a reduce action and the shift that must immediately -** follow the reduce. -** -** The yyLookahead and yyLookaheadToken parameters provide reduce actions -** access to the lookahead token (if any). The yyLookahead will be YYNOCODE -** if the lookahead token has already been consumed. As this procedure is -** only called from one place, optimizing compilers will in-line it, which -** means that the extra parameters have no performance impact. -*/ -static void yy_reduce( - yyParser *yypParser, /* The parser */ - unsigned int yyruleno, /* Number of the rule by which to reduce */ - int yyLookahead, /* Lookahead token, or YYNOCODE if none */ - ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ -){ - int yygoto; /* The next state */ - int yyact; /* The next action */ - yyStackEntry *yymsp; /* The top of the parser's stack */ - int yysize; /* Amount to pop the stack */ - ParseARG_FETCH; - yymsp = yypParser->yytos; -#ifndef NDEBUG - if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfo[yyruleno].nrhs; - fprintf(yyTraceFILE, "%sReduce [%s], go to state %d.\n", yyTracePrompt, - yyRuleName[yyruleno], yymsp[yysize].stateno); - } -#endif /* NDEBUG */ - - /* Check that the stack is large enough to grow by a single entry - ** if the RHS of the rule is empty. This ensures that there is room - ** enough on the stack to push the LHS value */ - if( yyRuleInfo[yyruleno].nrhs==0 ){ -#ifdef YYTRACKMAXSTACKDEPTH - if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>=yypParser->yystackEnd ){ - yyStackOverflow(yypParser); - return; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ - if( yyGrowStack(yypParser) ){ - yyStackOverflow(yypParser); - return; - } - yymsp = yypParser->yytos; - } -#endif - } - - switch( yyruleno ){ - /* Beginning here are the reduction cases. A typical example - ** follows: - ** case 0: - ** #line - ** { ... } // User supplied code - ** #line - ** break; - */ -/********** Begin reduce actions **********************************************/ -%% -/********** End reduce actions ************************************************/ - }; - assert( yyrulenoYY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) ); - - /* It is not possible for a REDUCE to be followed by an error */ - assert( yyact!=YY_ERROR_ACTION ); - - if( yyact==YY_ACCEPT_ACTION ){ - yypParser->yytos += yysize; - yy_accept(yypParser); - }else{ - yymsp += yysize+1; - yypParser->yytos = yymsp; - yymsp->stateno = (YYACTIONTYPE)yyact; - yymsp->major = (YYCODETYPE)yygoto; - yyTraceShift(yypParser, yyact); - } -} - -/* -** The following code executes when the parse fails -*/ -#ifndef YYNOERRORRECOVERY -static void yy_parse_failed( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); - } -#endif - while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will be executed whenever the - ** parser fails */ -/************ Begin %parse_failure code ***************************************/ -%% -/************ End %parse_failure code *****************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} -#endif /* YYNOERRORRECOVERY */ - -/* -** The following code executes when a syntax error first occurs. -*/ -static void yy_syntax_error( - yyParser *yypParser, /* The parser */ - int yymajor, /* The major type of the error token */ - ParseTOKENTYPE yyminor /* The minor type of the error token */ -){ - ParseARG_FETCH; -#define TOKEN yyminor -/************ Begin %syntax_error code ****************************************/ -%% -/************ End %syntax_error code ******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* -** The following is executed when the parser accepts -*/ -static void yy_accept( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); - } -#endif -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - assert( yypParser->yytos==yypParser->yystack ); - /* Here code is inserted which will be executed whenever the - ** parser accepts */ -/*********** Begin %parse_accept code *****************************************/ -%% -/*********** End %parse_accept code *******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ -} - -/* The main parser program. -** The first argument is a pointer to a structure obtained from -** "ParseAlloc" which describes the current state of the parser. -** The second argument is the major token number. The third is -** the minor token. The fourth optional argument is whatever the -** user wants (and specified in the grammar) and is available for -** use by the action routines. -** -** Inputs: -**
    -**
  • A pointer to the parser (an opaque structure.) -**
  • The major token number. -**
  • The minor token number. -**
  • An option argument of a grammar-specified type. -**
-** -** Outputs: -** None. -*/ -void Parse( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - ParseTOKENTYPE yyminor /* The value for the token */ - ParseARG_PDECL /* Optional %extra_argument parameter */ -){ - YYMINORTYPE yyminorunion; - unsigned int yyact; /* The parser action. */ -#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) - int yyendofinput; /* True if we are at the end of input */ -#endif -#ifdef YYERRORSYMBOL - int yyerrorhit = 0; /* True if yymajor has invoked an error */ -#endif - yyParser *yypParser; /* The parser */ - - yypParser = (yyParser*)yyp; - assert( yypParser->yytos!=0 ); -#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) - yyendofinput = (yymajor==0); -#endif - ParseARG_STORE; - -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sInput '%s'\n",yyTracePrompt,yyTokenName[yymajor]); - } -#endif - - do{ - yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); - if( yyact <= YY_MAX_SHIFTREDUCE ){ - yy_shift(yypParser,yyact,yymajor,yyminor); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt--; -#endif - yymajor = YYNOCODE; - }else if( yyact <= YY_MAX_REDUCE ){ - yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor); - }else{ - assert( yyact == YY_ERROR_ACTION ); - yyminorunion.yy0 = yyminor; -#ifdef YYERRORSYMBOL - int yymx; -#endif -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); - } -#endif -#ifdef YYERRORSYMBOL - /* A syntax error has occurred. - ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". - ** - ** This is what we do if the grammar does define ERROR: - ** - ** * Call the %syntax_error function. - ** - ** * Begin popping the stack until we enter a state where - ** it is legal to shift the error symbol, then shift - ** the error symbol. - ** - ** * Set the error count to three. - ** - ** * Begin accepting and shifting new tokens. No new error - ** processing will occur until three tokens have been - ** shifted successfully. - ** - */ - if( yypParser->yyerrcnt<0 ){ - yy_syntax_error(yypParser,yymajor,yyminor); - } - yymx = yypParser->yytos->major; - if( yymx==YYERRORSYMBOL || yyerrorhit ){ -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sDiscard input token %s\n", - yyTracePrompt,yyTokenName[yymajor]); - } -#endif - yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); - yymajor = YYNOCODE; - }else{ - while( yypParser->yytos >= yypParser->yystack - && yymx != YYERRORSYMBOL - && (yyact = yy_find_reduce_action( - yypParser->yytos->stateno, - YYERRORSYMBOL)) >= YY_MIN_REDUCE - ){ - yy_pop_parser_stack(yypParser); - } - if( yypParser->yytos < yypParser->yystack || yymajor==0 ){ - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yy_parse_failed(yypParser); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - yymajor = YYNOCODE; - }else if( yymx!=YYERRORSYMBOL ){ - yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor); - } - } - yypParser->yyerrcnt = 3; - yyerrorhit = 1; -#elif defined(YYNOERRORRECOVERY) - /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to - ** do any kind of error recovery. Instead, simply invoke the syntax - ** error routine and continue going as if nothing had happened. - ** - ** Applications can set this macro (for example inside %include) if - ** they intend to abandon the parse upon the first syntax error seen. - */ - yy_syntax_error(yypParser,yymajor, yyminor); - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yymajor = YYNOCODE; - -#else /* YYERRORSYMBOL is not defined */ - /* This is what we do if the grammar does not define ERROR: - ** - ** * Report an error message, and throw away the input token. - ** - ** * If the input token is $, then fail the parse. - ** - ** As before, subsequent error messages are suppressed until - ** three input tokens have been successfully shifted. - */ - if( yypParser->yyerrcnt<=0 ){ - yy_syntax_error(yypParser,yymajor, yyminor); - } - yypParser->yyerrcnt = 3; - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - if( yyendofinput ){ - yy_parse_failed(yypParser); -#ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; -#endif - } - yymajor = YYNOCODE; -#endif - } - }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack ); -#ifndef NDEBUG - if( yyTraceFILE ){ - yyStackEntry *i; - char cDiv = '['; - fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt); - for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){ - fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]); - cDiv = ' '; - } - fprintf(yyTraceFILE,"]\n"); - } -#endif - return; -} diff --git a/readme.md b/readme.md index 781eeb1b..64c01b55 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,4 @@ # Low-level bindings for BGFX -![Maintenance status](https://img.shields.io/badge/maintenance-looking--for--maintainer-yellow.svg) This code is Rust low-level bindings for https://github.com/bkaradzic/bgfx While possible to use these directly in your project it's recommended to use these high-level binindings instead https://github.com/emoon/bgfx-rs diff --git a/src/ffi.rs b/src/ffi.rs index 55bd94a0..cb1df4cf 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -1,13 +1,12 @@ -/* automatically generated by rust-bindgen 0.68.1 */ +/* automatically generated by rust-bindgen 0.71.1 */ -pub const __GNUC_VA_LIST: u32 = 1; +pub const __bool_true_false_are_defined: u32 = 1; pub const true_: u32 = 1; pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; pub const _DEFAULT_SOURCE: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 0; +pub const __GLIBC_USE_ISOC23: u32 = 0; pub const __USE_ISOC11: u32 = 1; pub const __USE_ISOC99: u32 = 1; pub const __USE_ISOC95: u32 = 1; @@ -25,11 +24,13 @@ pub const __WORDSIZE: u32 = 64; pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; pub const __SYSCALL_WORDSIZE: u32 = 64; pub const __TIMESIZE: u32 = 64; +pub const __USE_TIME_BITS64: u32 = 1; pub const __USE_MISC: u32 = 1; pub const __USE_ATFILE: u32 = 1; pub const __USE_FORTIFY_LEVEL: u32 = 0; pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; +pub const __GLIBC_USE_C23_STRTOL: u32 = 0; pub const _STDC_PREDEF_H: u32 = 1; pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_60559_BFP__: u32 = 201404; @@ -38,17 +39,17 @@ pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404; pub const __STDC_ISO_10646__: u32 = 201706; pub const __GNU_LIBRARY__: u32 = 6; pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 35; +pub const __GLIBC_MINOR__: u32 = 40; pub const _SYS_CDEFS_H: u32 = 1; pub const __glibc_c99_flexarr_available: u32 = 1; pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; pub const __HAVE_GENERIC_SELECTION: u32 = 1; pub const __GLIBC_USE_LIB_EXT2: u32 = 0; pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_BFP_EXT_C23: u32 = 0; pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C23: u32 = 0; pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; pub const _BITS_TYPES_H: u32 = 1; pub const _BITS_TYPESIZES_H: u32 = 1; @@ -62,6 +63,7 @@ pub const _BITS_TIME64_H: u32 = 1; pub const _BITS_WCHAR_H: u32 = 1; pub const _BITS_STDINT_INTN_H: u32 = 1; pub const _BITS_STDINT_UINTN_H: u32 = 1; +pub const _BITS_STDINT_LEAST_H: u32 = 1; pub const INT8_MIN: i32 = -128; pub const INT16_MIN: i32 = -32768; pub const INT32_MIN: i32 = -2147483648; @@ -188,14 +190,12 @@ pub const BX_CPU_PPC: u32 = 0; pub const BX_CPU_RISCV: u32 = 0; pub const BX_CPU_X86: u32 = 0; pub const BX_CRT_BIONIC: u32 = 0; -pub const BX_CRT_BSD: u32 = 0; pub const BX_CRT_GLIBC: u32 = 0; pub const BX_CRT_LIBCXX: u32 = 0; pub const BX_CRT_MINGW: u32 = 0; pub const BX_CRT_MSVC: u32 = 0; pub const BX_CRT_NEWLIB: u32 = 0; pub const BX_CRT_NONE: u32 = 0; -pub const BX_LANGUAGE_CPP14: u32 = 201402; pub const BX_LANGUAGE_CPP17: u32 = 201703; pub const BX_LANGUAGE_CPP20: u32 = 202002; pub const BX_LANGUAGE_CPP23: u32 = 202207; @@ -211,6 +211,7 @@ pub const BX_PLATFORM_OSX: u32 = 0; pub const BX_PLATFORM_PS4: u32 = 0; pub const BX_PLATFORM_PS5: u32 = 0; pub const BX_PLATFORM_RPI: u32 = 0; +pub const BX_PLATFORM_VISIONOS: u32 = 0; pub const BX_PLATFORM_WINDOWS: u32 = 0; pub const BX_PLATFORM_WINRT: u32 = 0; pub const BX_PLATFORM_XBOXONE: u32 = 0; @@ -222,7 +223,7 @@ pub const BX_ARCH_NAME: &[u8; 7] = b"64-bit\0"; pub const BX_CPP_NAME: &[u8; 11] = b"C++Unknown\0"; pub const BGFX_SHARED_LIB_BUILD: u32 = 0; pub const BGFX_SHARED_LIB_USE: u32 = 0; -pub const BGFX_API_VERSION: u32 = 122; +pub const BGFX_API_VERSION: u32 = 129; pub const BGFX_STATE_WRITE_R: u32 = 1; pub const BGFX_STATE_WRITE_G: u32 = 2; pub const BGFX_STATE_WRITE_B: u32 = 4; @@ -478,33 +479,33 @@ pub const BGFX_CAPS_BLEND_INDEPENDENT: u32 = 2; pub const BGFX_CAPS_COMPUTE: u32 = 4; pub const BGFX_CAPS_CONSERVATIVE_RASTER: u32 = 8; pub const BGFX_CAPS_DRAW_INDIRECT: u32 = 16; -pub const BGFX_CAPS_FRAGMENT_DEPTH: u32 = 32; -pub const BGFX_CAPS_FRAGMENT_ORDERING: u32 = 64; -pub const BGFX_CAPS_GRAPHICS_DEBUGGER: u32 = 128; -pub const BGFX_CAPS_HDR10: u32 = 256; -pub const BGFX_CAPS_HIDPI: u32 = 512; -pub const BGFX_CAPS_IMAGE_RW: u32 = 1024; -pub const BGFX_CAPS_INDEX32: u32 = 2048; -pub const BGFX_CAPS_INSTANCING: u32 = 4096; -pub const BGFX_CAPS_OCCLUSION_QUERY: u32 = 8192; -pub const BGFX_CAPS_RENDERER_MULTITHREADED: u32 = 16384; -pub const BGFX_CAPS_SWAP_CHAIN: u32 = 32768; -pub const BGFX_CAPS_TEXTURE_2D_ARRAY: u32 = 65536; -pub const BGFX_CAPS_TEXTURE_3D: u32 = 131072; +pub const BGFX_CAPS_DRAW_INDIRECT_COUNT: u32 = 32; +pub const BGFX_CAPS_FRAGMENT_DEPTH: u32 = 64; +pub const BGFX_CAPS_FRAGMENT_ORDERING: u32 = 128; +pub const BGFX_CAPS_GRAPHICS_DEBUGGER: u32 = 256; +pub const BGFX_CAPS_HDR10: u32 = 512; +pub const BGFX_CAPS_HIDPI: u32 = 1024; +pub const BGFX_CAPS_IMAGE_RW: u32 = 2048; +pub const BGFX_CAPS_INDEX32: u32 = 4096; +pub const BGFX_CAPS_INSTANCING: u32 = 8192; +pub const BGFX_CAPS_OCCLUSION_QUERY: u32 = 16384; +pub const BGFX_CAPS_PRIMITIVE_ID: u32 = 32768; +pub const BGFX_CAPS_RENDERER_MULTITHREADED: u32 = 65536; +pub const BGFX_CAPS_SWAP_CHAIN: u32 = 131072; pub const BGFX_CAPS_TEXTURE_BLIT: u32 = 262144; -pub const BGFX_CAPS_TRANSPARENT_BACKBUFFER: u32 = 524288; +pub const BGFX_CAPS_TEXTURE_COMPARE_LEQUAL: u32 = 524288; pub const BGFX_CAPS_TEXTURE_COMPARE_RESERVED: u32 = 1048576; -pub const BGFX_CAPS_TEXTURE_COMPARE_LEQUAL: u32 = 2097152; -pub const BGFX_CAPS_TEXTURE_CUBE_ARRAY: u32 = 4194304; -pub const BGFX_CAPS_TEXTURE_DIRECT_ACCESS: u32 = 8388608; -pub const BGFX_CAPS_TEXTURE_READ_BACK: u32 = 16777216; -pub const BGFX_CAPS_VERTEX_ATTRIB_HALF: u32 = 33554432; -pub const BGFX_CAPS_VERTEX_ATTRIB_UINT10: u32 = 67108864; -pub const BGFX_CAPS_VERTEX_ID: u32 = 134217728; -pub const BGFX_CAPS_PRIMITIVE_ID: u32 = 268435456; -pub const BGFX_CAPS_VIEWPORT_LAYER_ARRAY: u32 = 536870912; -pub const BGFX_CAPS_DRAW_INDIRECT_COUNT: u32 = 1073741824; -pub const BGFX_CAPS_TEXTURE_COMPARE_ALL: u32 = 3145728; +pub const BGFX_CAPS_TEXTURE_CUBE_ARRAY: u32 = 2097152; +pub const BGFX_CAPS_TEXTURE_DIRECT_ACCESS: u32 = 4194304; +pub const BGFX_CAPS_TEXTURE_READ_BACK: u32 = 8388608; +pub const BGFX_CAPS_TEXTURE_2D_ARRAY: u32 = 16777216; +pub const BGFX_CAPS_TEXTURE_3D: u32 = 33554432; +pub const BGFX_CAPS_TRANSPARENT_BACKBUFFER: u32 = 67108864; +pub const BGFX_CAPS_VERTEX_ATTRIB_HALF: u32 = 134217728; +pub const BGFX_CAPS_VERTEX_ATTRIB_UINT10: u32 = 268435456; +pub const BGFX_CAPS_VERTEX_ID: u32 = 536870912; +pub const BGFX_CAPS_VIEWPORT_LAYER_ARRAY: u32 = 1073741824; +pub const BGFX_CAPS_TEXTURE_COMPARE_ALL: u32 = 1572864; pub const BGFX_CAPS_FORMAT_TEXTURE_NONE: u32 = 0; pub const BGFX_CAPS_FORMAT_TEXTURE_2D: u32 = 1; pub const BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB: u32 = 2; @@ -538,8 +539,8 @@ pub const BGFX_CUBE_MAP_POSITIVE_Y: u32 = 2; pub const BGFX_CUBE_MAP_NEGATIVE_Y: u32 = 3; pub const BGFX_CUBE_MAP_POSITIVE_Z: u32 = 4; pub const BGFX_CUBE_MAP_NEGATIVE_Z: u32 = 5; -pub type va_list = __builtin_va_list; pub type __gnuc_va_list = __builtin_va_list; +pub type va_list = __builtin_va_list; pub type __u_char = ::std::os::raw::c_uchar; pub type __u_short = ::std::os::raw::c_ushort; pub type __u_int = ::std::os::raw::c_uint; @@ -648,79 +649,85 @@ pub struct lldiv_t { pub quot: ::std::os::raw::c_longlong, pub rem: ::std::os::raw::c_longlong, } -extern "C" { +unsafe extern "C" { pub fn __ctype_get_mb_cur_max() -> usize; } -extern "C" { +unsafe extern "C" { pub fn atof(__nptr: *const ::std::os::raw::c_char) -> f64; } -extern "C" { +unsafe extern "C" { pub fn atoi(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn atol(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { pub fn atoll(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; } -extern "C" { +unsafe extern "C" { pub fn strtod( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, ) -> f64; } -extern "C" { +unsafe extern "C" { pub fn strtof( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, ) -> f32; } -extern "C" { +unsafe extern "C" { + pub fn strtold( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + ) -> u128; +} +unsafe extern "C" { pub fn strtol( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { pub fn strtoul( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_ulong; } -extern "C" { +unsafe extern "C" { pub fn strtoq( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_longlong; } -extern "C" { +unsafe extern "C" { pub fn strtouq( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_ulonglong; } -extern "C" { +unsafe extern "C" { pub fn strtoll( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_longlong; } -extern "C" { +unsafe extern "C" { pub fn strtoull( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_ulonglong; } -extern "C" { +unsafe extern "C" { pub fn l64a(__n: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn a64l(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; } pub type u_char = __u_char; @@ -781,7 +788,7 @@ pub struct fd_set { pub __fds_bits: [__fd_mask; 16usize], } pub type fd_mask = __fd_mask; -extern "C" { +unsafe extern "C" { pub fn select( __nfds: ::std::os::raw::c_int, __readfds: *mut fd_set, @@ -790,7 +797,7 @@ extern "C" { __timeout: *mut timeval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pselect( __nfds: ::std::os::raw::c_int, __readfds: *mut fd_set, @@ -936,20 +943,20 @@ pub union pthread_barrierattr_t { pub __size: [::std::os::raw::c_char; 4usize], pub __align: ::std::os::raw::c_int, } -extern "C" { +unsafe extern "C" { pub fn random() -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { pub fn srandom(__seed: ::std::os::raw::c_uint); } -extern "C" { +unsafe extern "C" { pub fn initstate( __seed: ::std::os::raw::c_uint, __statebuf: *mut ::std::os::raw::c_char, __statelen: usize, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn setstate(__statebuf: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } #[repr(C)] @@ -963,16 +970,16 @@ pub struct random_data { pub rand_sep: ::std::os::raw::c_int, pub end_ptr: *mut i32, } -extern "C" { +unsafe extern "C" { pub fn random_r(__buf: *mut random_data, __result: *mut i32) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn srandom_r( __seed: ::std::os::raw::c_uint, __buf: *mut random_data, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn initstate_r( __seed: ::std::os::raw::c_uint, __statebuf: *mut ::std::os::raw::c_char, @@ -980,46 +987,46 @@ extern "C" { __buf: *mut random_data, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn setstate_r( __statebuf: *mut ::std::os::raw::c_char, __buf: *mut random_data, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn rand() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn srand(__seed: ::std::os::raw::c_uint); } -extern "C" { +unsafe extern "C" { pub fn rand_r(__seed: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn drand48() -> f64; } -extern "C" { +unsafe extern "C" { pub fn erand48(__xsubi: *mut ::std::os::raw::c_ushort) -> f64; } -extern "C" { +unsafe extern "C" { pub fn lrand48() -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { pub fn nrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { pub fn mrand48() -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { pub fn jrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { pub fn srand48(__seedval: ::std::os::raw::c_long); } -extern "C" { +unsafe extern "C" { pub fn seed48(__seed16v: *mut ::std::os::raw::c_ushort) -> *mut ::std::os::raw::c_ushort; } -extern "C" { +unsafe extern "C" { pub fn lcong48(__param: *mut ::std::os::raw::c_ushort); } #[repr(C)] @@ -1031,116 +1038,125 @@ pub struct drand48_data { pub __init: ::std::os::raw::c_ushort, pub __a: ::std::os::raw::c_ulonglong, } -extern "C" { +unsafe extern "C" { pub fn drand48_r(__buffer: *mut drand48_data, __result: *mut f64) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn erand48_r( __xsubi: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, __result: *mut f64, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lrand48_r( __buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn nrand48_r( __xsubi: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn mrand48_r( __buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn jrand48_r( __xsubi: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn srand48_r( __seedval: ::std::os::raw::c_long, __buffer: *mut drand48_data, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn seed48_r( __seed16v: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lcong48_r( __param: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { + pub fn arc4random() -> __uint32_t; +} +unsafe extern "C" { + pub fn arc4random_buf(__buf: *mut ::std::os::raw::c_void, __size: usize); +} +unsafe extern "C" { + pub fn arc4random_uniform(__upper_bound: __uint32_t) -> __uint32_t; +} +unsafe extern "C" { pub fn malloc(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn calloc( __nmemb: ::std::os::raw::c_ulong, __size: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn realloc( __ptr: *mut ::std::os::raw::c_void, __size: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn free(__ptr: *mut ::std::os::raw::c_void); } -extern "C" { +unsafe extern "C" { pub fn reallocarray( __ptr: *mut ::std::os::raw::c_void, __nmemb: usize, __size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn alloca(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn valloc(__size: usize) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn posix_memalign( __memptr: *mut *mut ::std::os::raw::c_void, __alignment: usize, __size: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn aligned_alloc( __alignment: ::std::os::raw::c_ulong, __size: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn abort() -> !; } -extern "C" { +unsafe extern "C" { pub fn atexit(__func: ::std::option::Option) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn at_quick_exit( __func: ::std::option::Option, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn on_exit( __func: ::std::option::Option< unsafe extern "C" fn( @@ -1151,53 +1167,53 @@ extern "C" { __arg: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn exit(__status: ::std::os::raw::c_int) -> !; } -extern "C" { +unsafe extern "C" { pub fn quick_exit(__status: ::std::os::raw::c_int) -> !; } -extern "C" { +unsafe extern "C" { pub fn _Exit(__status: ::std::os::raw::c_int) -> !; } -extern "C" { +unsafe extern "C" { pub fn getenv(__name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn putenv(__string: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn setenv( __name: *const ::std::os::raw::c_char, __value: *const ::std::os::raw::c_char, __replace: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn unsetenv(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clearenv() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn mktemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn mkstemp(__template: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn mkstemps( __template: *mut ::std::os::raw::c_char, __suffixlen: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn mkdtemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn realpath( __name: *const ::std::os::raw::c_char, __resolved: *mut ::std::os::raw::c_char, @@ -1209,7 +1225,7 @@ pub type __compar_fn_t = ::std::option::Option< arg2: *const ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; -extern "C" { +unsafe extern "C" { pub fn bsearch( __key: *const ::std::os::raw::c_void, __base: *const ::std::os::raw::c_void, @@ -1218,7 +1234,7 @@ extern "C" { __compar: __compar_fn_t, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn qsort( __base: *mut ::std::os::raw::c_void, __nmemb: usize, @@ -1226,28 +1242,28 @@ extern "C" { __compar: __compar_fn_t, ); } -extern "C" { +unsafe extern "C" { pub fn abs(__x: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn labs(__x: ::std::os::raw::c_long) -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { pub fn llabs(__x: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; } -extern "C" { +unsafe extern "C" { pub fn div(__numer: ::std::os::raw::c_int, __denom: ::std::os::raw::c_int) -> div_t; } -extern "C" { +unsafe extern "C" { pub fn ldiv(__numer: ::std::os::raw::c_long, __denom: ::std::os::raw::c_long) -> ldiv_t; } -extern "C" { +unsafe extern "C" { pub fn lldiv( __numer: ::std::os::raw::c_longlong, __denom: ::std::os::raw::c_longlong, ) -> lldiv_t; } -extern "C" { +unsafe extern "C" { pub fn ecvt( __value: f64, __ndigit: ::std::os::raw::c_int, @@ -1255,7 +1271,7 @@ extern "C" { __sign: *mut ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn fcvt( __value: f64, __ndigit: ::std::os::raw::c_int, @@ -1263,14 +1279,37 @@ extern "C" { __sign: *mut ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn gcvt( __value: f64, __ndigit: ::std::os::raw::c_int, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { + pub fn qecvt( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +unsafe extern "C" { + pub fn qfcvt( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +unsafe extern "C" { + pub fn qgcvt( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +unsafe extern "C" { pub fn ecvt_r( __value: f64, __ndigit: ::std::os::raw::c_int, @@ -1280,7 +1319,7 @@ extern "C" { __len: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn fcvt_r( __value: f64, __ndigit: ::std::os::raw::c_int, @@ -1290,36 +1329,56 @@ extern "C" { __len: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { + pub fn qecvt_r( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + pub fn qfcvt_r( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { pub fn mblen(__s: *const ::std::os::raw::c_char, __n: usize) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn mbtowc( __pwc: *mut wchar_t, __s: *const ::std::os::raw::c_char, __n: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn wctomb(__s: *mut ::std::os::raw::c_char, __wchar: wchar_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::std::os::raw::c_char, __n: usize) -> usize; } -extern "C" { +unsafe extern "C" { pub fn wcstombs(__s: *mut ::std::os::raw::c_char, __pwcs: *const wchar_t, __n: usize) -> usize; } -extern "C" { +unsafe extern "C" { pub fn rpmatch(__response: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn getsubopt( __optionp: *mut *mut ::std::os::raw::c_char, __tokens: *const *mut ::std::os::raw::c_char, __valuep: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn getloadavg(__loadavg: *mut f64, __nelem: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } @@ -1342,27 +1401,23 @@ pub const BGFX_RENDERER_TYPE_NOOP: bgfx_renderer_type = 0; #[doc = " ( 0) No rendering."] pub const BGFX_RENDERER_TYPE_AGC: bgfx_renderer_type = 1; #[doc = " ( 1) AGC"] -pub const BGFX_RENDERER_TYPE_DIRECT3D9: bgfx_renderer_type = 2; -#[doc = " ( 2) Direct3D 9.0"] -pub const BGFX_RENDERER_TYPE_DIRECT3D11: bgfx_renderer_type = 3; -#[doc = " ( 3) Direct3D 11.0"] -pub const BGFX_RENDERER_TYPE_DIRECT3D12: bgfx_renderer_type = 4; -#[doc = " ( 4) Direct3D 12.0"] -pub const BGFX_RENDERER_TYPE_GNM: bgfx_renderer_type = 5; -#[doc = " ( 5) GNM"] -pub const BGFX_RENDERER_TYPE_METAL: bgfx_renderer_type = 6; -#[doc = " ( 6) Metal"] -pub const BGFX_RENDERER_TYPE_NVN: bgfx_renderer_type = 7; -#[doc = " ( 7) NVN"] -pub const BGFX_RENDERER_TYPE_OPENGLES: bgfx_renderer_type = 8; -#[doc = " ( 8) OpenGL ES 2.0+"] -pub const BGFX_RENDERER_TYPE_OPENGL: bgfx_renderer_type = 9; -#[doc = " ( 9) OpenGL 2.1+"] -pub const BGFX_RENDERER_TYPE_VULKAN: bgfx_renderer_type = 10; -#[doc = " (10) Vulkan"] -pub const BGFX_RENDERER_TYPE_WEBGPU: bgfx_renderer_type = 11; -#[doc = " (11) WebGPU"] -pub const BGFX_RENDERER_TYPE_COUNT: bgfx_renderer_type = 12; +pub const BGFX_RENDERER_TYPE_DIRECT3D11: bgfx_renderer_type = 2; +#[doc = " ( 2) Direct3D 11.0"] +pub const BGFX_RENDERER_TYPE_DIRECT3D12: bgfx_renderer_type = 3; +#[doc = " ( 3) Direct3D 12.0"] +pub const BGFX_RENDERER_TYPE_GNM: bgfx_renderer_type = 4; +#[doc = " ( 4) GNM"] +pub const BGFX_RENDERER_TYPE_METAL: bgfx_renderer_type = 5; +#[doc = " ( 5) Metal"] +pub const BGFX_RENDERER_TYPE_NVN: bgfx_renderer_type = 6; +#[doc = " ( 6) NVN"] +pub const BGFX_RENDERER_TYPE_OPENGLES: bgfx_renderer_type = 7; +#[doc = " ( 7) OpenGL ES 2.0+"] +pub const BGFX_RENDERER_TYPE_OPENGL: bgfx_renderer_type = 8; +#[doc = " ( 8) OpenGL 2.1+"] +pub const BGFX_RENDERER_TYPE_VULKAN: bgfx_renderer_type = 9; +#[doc = " ( 9) Vulkan"] +pub const BGFX_RENDERER_TYPE_COUNT: bgfx_renderer_type = 10; #[doc = " Renderer backend type enum.\n"] pub type bgfx_renderer_type = ::std::os::raw::c_uint; #[doc = " Renderer backend type enum.\n"] @@ -1747,13 +1802,13 @@ pub type bgfx_view_mode = ::std::os::raw::c_uint; #[doc = " View mode sets draw call sort order.\n"] pub use self::bgfx_view_mode as bgfx_view_mode_t; pub const BGFX_NATIVE_WINDOW_HANDLE_TYPE_DEFAULT: bgfx_native_window_handle_type = 0; -#[doc = " ( 0) Platform default handle type (X11 on Linux)"] +#[doc = " ( 0) Platform default handle type (X11 on Linux)."] pub const BGFX_NATIVE_WINDOW_HANDLE_TYPE_WAYLAND: bgfx_native_window_handle_type = 1; #[doc = " ( 1) Wayland."] pub const BGFX_NATIVE_WINDOW_HANDLE_TYPE_COUNT: bgfx_native_window_handle_type = 2; -#[doc = " Native window handle type..\n"] +#[doc = " Native window handle type.\n"] pub type bgfx_native_window_handle_type = ::std::os::raw::c_uint; -#[doc = " Native window handle type..\n"] +#[doc = " Native window handle type.\n"] pub use self::bgfx_native_window_handle_type as bgfx_native_window_handle_type_t; pub const BGFX_RENDER_FRAME_NO_CONTEXT: bgfx_render_frame = 0; #[doc = " ( 0) Renderer context is not created yet."] @@ -2078,7 +2133,6 @@ pub struct bgfx_platform_data_s { pub backBuffer: *mut ::std::os::raw::c_void, #[doc = " Backbuffer depth/stencil. If `NULL`, bgfx will create a back-buffer\n depth/stencil surface."] pub backBufferDS: *mut ::std::os::raw::c_void, - #[doc = " Handle type. Needed for platforms having more than one option."] pub type_: bgfx_native_window_handle_type_t, } #[doc = " Platform data.\n"] @@ -2408,7 +2462,7 @@ pub struct bgfx_encoder_s { _unused: [u8; 0], } pub type bgfx_encoder_t = bgfx_encoder_s; -extern "C" { +unsafe extern "C" { #[doc = " Init attachment.\n\n @param[in] _handle Render target texture handle.\n @param[in] _access Access. See `Access::Enum`.\n @param[in] _layer Cubemap side or depth layer/slice to use.\n @param[in] _numLayers Number of texture layer/slice(s) in array to use.\n @param[in] _mip Mip level.\n @param[in] _resolve Resolve flags. See: `BGFX_RESOLVE_*`\n"] pub fn bgfx_attachment_init( _this: *mut bgfx_attachment_t, @@ -2420,14 +2474,14 @@ extern "C" { _resolve: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Start VertexLayout.\n\n @param[in] _rendererType Renderer backend type. See: `bgfx::RendererType`\n\n @returns Returns itself.\n"] pub fn bgfx_vertex_layout_begin( _this: *mut bgfx_vertex_layout_t, _rendererType: bgfx_renderer_type_t, ) -> *mut bgfx_vertex_layout_t; } -extern "C" { +unsafe extern "C" { #[doc = " Add attribute to VertexLayout.\n @remarks Must be called between begin/end.\n\n @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`\n @param[in] _num Number of elements 1, 2, 3 or 4.\n @param[in] _type Element type.\n @param[in] _normalized When using fixed point AttribType (f.e. Uint8)\n value will be normalized for vertex shader usage. When normalized\n is set to true, AttribType::Uint8 value in range 0-255 will be\n in range 0.0-1.0 in vertex shader.\n @param[in] _asInt Packaging rule for vertexPack, vertexUnpack, and\n vertexConvert for AttribType::Uint8 and AttribType::Int16.\n Unpacking code must be implemented inside vertex shader.\n\n @returns Returns itself.\n"] pub fn bgfx_vertex_layout_add( _this: *mut bgfx_vertex_layout_t, @@ -2438,7 +2492,7 @@ extern "C" { _asInt: bool, ) -> *mut bgfx_vertex_layout_t; } -extern "C" { +unsafe extern "C" { #[doc = " Decode attribute.\n\n @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`\n @param[out] _num Number of elements.\n @param[out] _type Element type.\n @param[out] _normalized Attribute is normalized.\n @param[out] _asInt Attribute is packed as int.\n"] pub fn bgfx_vertex_layout_decode( _this: *const bgfx_vertex_layout_t, @@ -2449,25 +2503,40 @@ extern "C" { _asInt: *mut bool, ); } -extern "C" { +unsafe extern "C" { #[doc = " Returns `true` if VertexLayout contains attribute.\n\n @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`\n\n @returns True if VertexLayout contains attribute.\n"] pub fn bgfx_vertex_layout_has( _this: *const bgfx_vertex_layout_t, _attrib: bgfx_attrib_t, ) -> bool; } -extern "C" { +unsafe extern "C" { #[doc = " Skip `_num` bytes in vertex stream.\n\n @param[in] _num Number of bytes to skip.\n\n @returns Returns itself.\n"] pub fn bgfx_vertex_layout_skip( _this: *mut bgfx_vertex_layout_t, _num: u8, ) -> *mut bgfx_vertex_layout_t; } -extern "C" { +unsafe extern "C" { #[doc = " End VertexLayout.\n"] pub fn bgfx_vertex_layout_end(_this: *mut bgfx_vertex_layout_t); } -extern "C" { +unsafe extern "C" { + #[doc = " Returns relative attribute offset from the vertex.\n\n @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`\n\n @returns Relative attribute offset from the vertex.\n"] + pub fn bgfx_vertex_layout_get_offset( + _this: *const bgfx_vertex_layout_t, + _attrib: bgfx_attrib_t, + ) -> u16; +} +unsafe extern "C" { + #[doc = " Returns vertex stride.\n"] + pub fn bgfx_vertex_layout_get_stride(_this: *const bgfx_vertex_layout_t) -> u16; +} +unsafe extern "C" { + #[doc = " Returns size of vertex buffer for number of vertices.\n\n @param[in] _num Number of vertices.\n\n @returns Size of vertex buffer for number of vertices.\n"] + pub fn bgfx_vertex_layout_get_size(_this: *const bgfx_vertex_layout_t, _num: u32) -> u32; +} +unsafe extern "C" { #[doc = " Pack vertex attribute into vertex stream format.\n\n @param[in] _input Value to be packed into vertex stream.\n @param[in] _inputNormalized `true` if input value is already normalized.\n @param[in] _attr Attribute to pack.\n @param[in] _layout Vertex stream layout.\n @param[in] _data Destination vertex stream where data will be packed.\n @param[in] _index Vertex index that will be modified.\n"] pub fn bgfx_vertex_pack( _input: *const f32, @@ -2478,7 +2547,7 @@ extern "C" { _index: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Unpack vertex attribute from vertex stream format.\n\n @param[out] _output Result of unpacking.\n @param[in] _attr Attribute to unpack.\n @param[in] _layout Vertex stream layout.\n @param[in] _data Source vertex stream from where data will be unpacked.\n @param[in] _index Vertex index that will be unpacked.\n"] pub fn bgfx_vertex_unpack( _output: *mut f32, @@ -2488,7 +2557,7 @@ extern "C" { _index: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Converts vertex stream data from one vertex stream format to another.\n\n @param[in] _dstLayout Destination vertex stream layout.\n @param[in] _dstData Destination vertex stream.\n @param[in] _srcLayout Source vertex stream layout.\n @param[in] _srcData Source vertex stream data.\n @param[in] _num Number of vertices to convert from source to destination.\n"] pub fn bgfx_vertex_convert( _dstLayout: *const bgfx_vertex_layout_t, @@ -2498,7 +2567,7 @@ extern "C" { _num: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Weld vertices.\n\n @param[in] _output Welded vertices remapping table. The size of buffer\n must be the same as number of vertices.\n @param[in] _layout Vertex stream layout.\n @param[in] _data Vertex stream.\n @param[in] _num Number of vertices in vertex stream.\n @param[in] _index32 Set to `true` if input indices are 32-bit.\n @param[in] _epsilon Error tolerance for vertex position comparison.\n\n @returns Number of unique vertices after vertex welding.\n"] pub fn bgfx_weld_vertices( _output: *mut ::std::os::raw::c_void, @@ -2509,7 +2578,7 @@ extern "C" { _epsilon: f32, ) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Convert index buffer for use with different primitive topologies.\n\n @param[in] _conversion Conversion type, see `TopologyConvert::Enum`.\n @param[out] _dst Destination index buffer. If this argument is NULL\n function will return number of indices after conversion.\n @param[in] _dstSize Destination index buffer in bytes. It must be\n large enough to contain output indices. If destination size is\n insufficient index buffer will be truncated.\n @param[in] _indices Source indices.\n @param[in] _numIndices Number of input indices.\n @param[in] _index32 Set to `true` if input indices are 32-bit.\n\n @returns Number of output indices after conversion.\n"] pub fn bgfx_topology_convert( _conversion: bgfx_topology_convert_t, @@ -2520,7 +2589,7 @@ extern "C" { _index32: bool, ) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Sort indices.\n\n @param[in] _sort Sort order, see `TopologySort::Enum`.\n @param[out] _dst Destination index buffer.\n @param[in] _dstSize Destination index buffer in bytes. It must be\n large enough to contain output indices. If destination size is\n insufficient index buffer will be truncated.\n @param[in] _dir Direction (vector must be normalized).\n @param[in] _pos Position.\n @param[in] _vertices Pointer to first vertex represented as\n float x, y, z. Must contain at least number of vertices\n referencende by index buffer.\n @param[in] _stride Vertex stride.\n @param[in] _indices Source indices.\n @param[in] _numIndices Number of input indices.\n @param[in] _index32 Set to `true` if input indices are 32-bit.\n"] pub fn bgfx_topology_sort_tri_list( _sort: bgfx_topology_sort_t, @@ -2535,58 +2604,59 @@ extern "C" { _index32: bool, ); } -extern "C" { +unsafe extern "C" { #[doc = " Returns supported backend API renderers.\n\n @param[in] _max Maximum number of elements in _enum array.\n @param[inout] _enum Array where supported renderers will be written.\n\n @returns Number of supported renderers.\n"] pub fn bgfx_get_supported_renderers(_max: u8, _enum: *mut bgfx_renderer_type_t) -> u8; } -extern "C" { +unsafe extern "C" { #[doc = " Returns name of renderer.\n\n @param[in] _type Renderer backend type. See: `bgfx::RendererType`\n\n @returns Name of renderer.\n"] pub fn bgfx_get_renderer_name(_type: bgfx_renderer_type_t) -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { + #[doc = " Fill bgfx::Init struct with default values, before using it to initialize the library.\n\n @param[in] _init Pointer to structure to be initialized. See: `bgfx::Init` for more info.\n"] pub fn bgfx_init_ctor(_init: *mut bgfx_init_t); } -extern "C" { +unsafe extern "C" { #[doc = " Initialize the bgfx library.\n\n @param[in] _init Initialization parameters. See: `bgfx::Init` for more info.\n\n @returns `true` if initialization was successful.\n"] pub fn bgfx_init(_init: *const bgfx_init_t) -> bool; } -extern "C" { +unsafe extern "C" { #[doc = " Shutdown bgfx library.\n"] pub fn bgfx_shutdown(); } -extern "C" { +unsafe extern "C" { #[doc = " Reset graphic settings and back-buffer size.\n @attention This call doesn’t change the window size, it just resizes\n the back-buffer. Your windowing code controls the window size.\n\n @param[in] _width Back-buffer width.\n @param[in] _height Back-buffer height.\n @param[in] _flags See: `BGFX_RESET_*` for more info.\n - `BGFX_RESET_NONE` - No reset flags.\n - `BGFX_RESET_FULLSCREEN` - Not supported yet.\n - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA.\n - `BGFX_RESET_VSYNC` - Enable V-Sync.\n - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy.\n - `BGFX_RESET_CAPTURE` - Begin screen capture.\n - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU.\n - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip\n occurs. Default behaviour is that flip occurs before rendering new\n frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.\n - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n"] pub fn bgfx_reset(_width: u32, _height: u32, _flags: u32, _format: bgfx_texture_format_t); } -extern "C" { +unsafe extern "C" { #[doc = " Advance to next frame. When using multithreaded renderer, this call\n just swaps internal buffers, kicks render thread, and returns. In\n singlethreaded renderer this call does frame rendering.\n\n @param[in] _capture Capture frame with graphics debugger.\n\n @returns Current frame number. This might be used in conjunction with\n double/multi buffering data outside the library and passing it to\n library via `bgfx::makeRef` calls.\n"] pub fn bgfx_frame(_capture: bool) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Returns current renderer backend API type.\n @remarks\n Library must be initialized.\n"] pub fn bgfx_get_renderer_type() -> bgfx_renderer_type_t; } -extern "C" { +unsafe extern "C" { #[doc = " Returns renderer capabilities.\n @remarks\n Library must be initialized.\n"] pub fn bgfx_get_caps() -> *const bgfx_caps_t; } -extern "C" { +unsafe extern "C" { #[doc = " Returns performance counters.\n @attention Pointer returned is valid until `bgfx::frame` is called.\n"] pub fn bgfx_get_stats() -> *const bgfx_stats_t; } -extern "C" { +unsafe extern "C" { #[doc = " Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.\n\n @param[in] _size Size to allocate.\n\n @returns Allocated memory.\n"] pub fn bgfx_alloc(_size: u32) -> *const bgfx_memory_t; } -extern "C" { +unsafe extern "C" { #[doc = " Allocate buffer and copy data into it. Data will be freed inside bgfx.\n\n @param[in] _data Pointer to data to be copied.\n @param[in] _size Size of data to be copied.\n\n @returns Allocated memory.\n"] pub fn bgfx_copy(_data: *const ::std::os::raw::c_void, _size: u32) -> *const bgfx_memory_t; } -extern "C" { +unsafe extern "C" { #[doc = " Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call\n doesn't allocate memory for data. It just copies the _data pointer. You\n can pass `ReleaseFn` function pointer to release this memory after it's\n consumed, otherwise you must make sure _data is available for at least 2\n `bgfx::frame` calls. `ReleaseFn` function must be able to be called\n from any thread.\n @attention Data passed must be available for at least 2 `bgfx::frame` calls.\n\n @param[in] _data Pointer to data.\n @param[in] _size Size of data.\n\n @returns Referenced memory.\n"] pub fn bgfx_make_ref(_data: *const ::std::os::raw::c_void, _size: u32) -> *const bgfx_memory_t; } -extern "C" { +unsafe extern "C" { #[doc = " Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call\n doesn't allocate memory for data. It just copies the _data pointer. You\n can pass `ReleaseFn` function pointer to release this memory after it's\n consumed, otherwise you must make sure _data is available for at least 2\n `bgfx::frame` calls. `ReleaseFn` function must be able to be called\n from any thread.\n @attention Data passed must be available for at least 2 `bgfx::frame` calls.\n\n @param[in] _data Pointer to data.\n @param[in] _size Size of data.\n @param[in] _releaseFn Callback function to release memory after use.\n @param[in] _userData User data to be passed to callback function.\n\n @returns Referenced memory.\n"] pub fn bgfx_make_ref_release( _data: *const ::std::os::raw::c_void, @@ -2595,15 +2665,15 @@ extern "C" { _userData: *mut ::std::os::raw::c_void, ) -> *const bgfx_memory_t; } -extern "C" { +unsafe extern "C" { #[doc = " Set debug flags.\n\n @param[in] _debug Available flags:\n - `BGFX_DEBUG_IFH` - Infinitely fast hardware. When this flag is set\n all rendering calls will be skipped. This is useful when profiling\n to quickly assess potential bottlenecks between CPU and GPU.\n - `BGFX_DEBUG_PROFILER` - Enable profiler.\n - `BGFX_DEBUG_STATS` - Display internal statistics.\n - `BGFX_DEBUG_TEXT` - Display debug text.\n - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering\n primitives will be rendered as lines.\n"] pub fn bgfx_set_debug(_debug: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Clear internal debug text buffer.\n\n @param[in] _attr Background color.\n @param[in] _small Default 8x16 or 8x8 font.\n"] pub fn bgfx_dbg_text_clear(_attr: u8, _small: bool); } -extern "C" { +unsafe extern "C" { #[doc = " Print formatted data to internal debug text character-buffer (VGA-compatible text mode).\n\n @param[in] _x Position x from the left corner of the window.\n @param[in] _y Position y from the top corner of the window.\n @param[in] _attr Color palette. Where top 4-bits represent index of background, and bottom\n 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).\n @param[in] _format `printf` style format.\n @param[in]\n"] pub fn bgfx_dbg_text_printf( _x: u16, @@ -2613,7 +2683,7 @@ extern "C" { ... ); } -extern "C" { +unsafe extern "C" { #[doc = " Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).\n\n @param[in] _x Position x from the left corner of the window.\n @param[in] _y Position y from the top corner of the window.\n @param[in] _attr Color palette. Where top 4-bits represent index of background, and bottom\n 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).\n @param[in] _format `printf` style format.\n @param[in] _argList Variable arguments list for format string.\n"] pub fn bgfx_dbg_text_vprintf( _x: u16, @@ -2623,7 +2693,7 @@ extern "C" { _argList: *mut __va_list_tag, ); } -extern "C" { +unsafe extern "C" { #[doc = " Draw image into internal debug text buffer.\n\n @param[in] _x Position x from the left corner of the window.\n @param[in] _y Position y from the top corner of the window.\n @param[in] _width Image width.\n @param[in] _height Image height.\n @param[in] _data Raw image data (character/attribute raw encoding).\n @param[in] _pitch Image pitch in bytes.\n"] pub fn bgfx_dbg_text_image( _x: u16, @@ -2634,14 +2704,14 @@ extern "C" { _pitch: u16, ); } -extern "C" { +unsafe extern "C" { #[doc = " Create static index buffer.\n\n @param[in] _mem Index buffer data.\n @param[in] _flags Buffer creation flags.\n - `BGFX_BUFFER_NONE` - No flags.\n - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.\n - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer\n is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.\n - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.\n - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of\n data is passed. If this flag is not specified, and more data is passed on update, the buffer\n will be trimmed to fit the existing buffer size. This flag has effect only on dynamic\n buffers.\n - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on\n index buffers.\n"] pub fn bgfx_create_index_buffer( _mem: *const bgfx_memory_t, _flags: u16, ) -> bgfx_index_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Set static index buffer debug name.\n\n @param[in] _handle Static index buffer handle.\n @param[in] _name Static index buffer name.\n @param[in] _len Static index buffer name length (if length is INT32_MAX, it's expected\n that _name is zero terminated string.\n"] pub fn bgfx_set_index_buffer_name( _handle: bgfx_index_buffer_handle_t, @@ -2649,21 +2719,21 @@ extern "C" { _len: i32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Destroy static index buffer.\n\n @param[in] _handle Static index buffer handle.\n"] pub fn bgfx_destroy_index_buffer(_handle: bgfx_index_buffer_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Create vertex layout.\n\n @param[in] _layout Vertex layout.\n"] pub fn bgfx_create_vertex_layout( _layout: *const bgfx_vertex_layout_t, ) -> bgfx_vertex_layout_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Destroy vertex layout.\n\n @param[in] _layoutHandle Vertex layout handle.\n"] pub fn bgfx_destroy_vertex_layout(_layoutHandle: bgfx_vertex_layout_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Create static vertex buffer.\n\n @param[in] _mem Vertex buffer data.\n @param[in] _layout Vertex layout.\n @param[in] _flags Buffer creation flags.\n - `BGFX_BUFFER_NONE` - No flags.\n - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.\n - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer\n is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.\n - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.\n - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of\n data is passed. If this flag is not specified, and more data is passed on update, the buffer\n will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers.\n - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.\n\n @returns Static vertex buffer handle.\n"] pub fn bgfx_create_vertex_buffer( _mem: *const bgfx_memory_t, @@ -2671,7 +2741,7 @@ extern "C" { _flags: u16, ) -> bgfx_vertex_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Set static vertex buffer debug name.\n\n @param[in] _handle Static vertex buffer handle.\n @param[in] _name Static vertex buffer name.\n @param[in] _len Static vertex buffer name length (if length is INT32_MAX, it's expected\n that _name is zero terminated string.\n"] pub fn bgfx_set_vertex_buffer_name( _handle: bgfx_vertex_buffer_handle_t, @@ -2679,25 +2749,25 @@ extern "C" { _len: i32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Destroy static vertex buffer.\n\n @param[in] _handle Static vertex buffer handle.\n"] pub fn bgfx_destroy_vertex_buffer(_handle: bgfx_vertex_buffer_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Create empty dynamic index buffer.\n\n @param[in] _num Number of indices.\n @param[in] _flags Buffer creation flags.\n - `BGFX_BUFFER_NONE` - No flags.\n - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.\n - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer\n is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.\n - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.\n - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of\n data is passed. If this flag is not specified, and more data is passed on update, the buffer\n will be trimmed to fit the existing buffer size. This flag has effect only on dynamic\n buffers.\n - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on\n index buffers.\n\n @returns Dynamic index buffer handle.\n"] pub fn bgfx_create_dynamic_index_buffer( _num: u32, _flags: u16, ) -> bgfx_dynamic_index_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create a dynamic index buffer and initialize it.\n\n @param[in] _mem Index buffer data.\n @param[in] _flags Buffer creation flags.\n - `BGFX_BUFFER_NONE` - No flags.\n - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.\n - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer\n is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.\n - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.\n - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of\n data is passed. If this flag is not specified, and more data is passed on update, the buffer\n will be trimmed to fit the existing buffer size. This flag has effect only on dynamic\n buffers.\n - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on\n index buffers.\n\n @returns Dynamic index buffer handle.\n"] pub fn bgfx_create_dynamic_index_buffer_mem( _mem: *const bgfx_memory_t, _flags: u16, ) -> bgfx_dynamic_index_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Update dynamic index buffer.\n\n @param[in] _handle Dynamic index buffer handle.\n @param[in] _startIndex Start index.\n @param[in] _mem Index buffer data.\n"] pub fn bgfx_update_dynamic_index_buffer( _handle: bgfx_dynamic_index_buffer_handle_t, @@ -2705,11 +2775,11 @@ extern "C" { _mem: *const bgfx_memory_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Destroy dynamic index buffer.\n\n @param[in] _handle Dynamic index buffer handle.\n"] pub fn bgfx_destroy_dynamic_index_buffer(_handle: bgfx_dynamic_index_buffer_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Create empty dynamic vertex buffer.\n\n @param[in] _num Number of vertices.\n @param[in] _layout Vertex layout.\n @param[in] _flags Buffer creation flags.\n - `BGFX_BUFFER_NONE` - No flags.\n - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.\n - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer\n is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.\n - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.\n - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of\n data is passed. If this flag is not specified, and more data is passed on update, the buffer\n will be trimmed to fit the existing buffer size. This flag has effect only on dynamic\n buffers.\n - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on\n index buffers.\n\n @returns Dynamic vertex buffer handle.\n"] pub fn bgfx_create_dynamic_vertex_buffer( _num: u32, @@ -2717,7 +2787,7 @@ extern "C" { _flags: u16, ) -> bgfx_dynamic_vertex_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create dynamic vertex buffer and initialize it.\n\n @param[in] _mem Vertex buffer data.\n @param[in] _layout Vertex layout.\n @param[in] _flags Buffer creation flags.\n - `BGFX_BUFFER_NONE` - No flags.\n - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.\n - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer\n is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.\n - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.\n - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of\n data is passed. If this flag is not specified, and more data is passed on update, the buffer\n will be trimmed to fit the existing buffer size. This flag has effect only on dynamic\n buffers.\n - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on\n index buffers.\n\n @returns Dynamic vertex buffer handle.\n"] pub fn bgfx_create_dynamic_vertex_buffer_mem( _mem: *const bgfx_memory_t, @@ -2725,7 +2795,7 @@ extern "C" { _flags: u16, ) -> bgfx_dynamic_vertex_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Update dynamic vertex buffer.\n\n @param[in] _handle Dynamic vertex buffer handle.\n @param[in] _startVertex Start vertex.\n @param[in] _mem Vertex buffer data.\n"] pub fn bgfx_update_dynamic_vertex_buffer( _handle: bgfx_dynamic_vertex_buffer_handle_t, @@ -2733,26 +2803,26 @@ extern "C" { _mem: *const bgfx_memory_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Destroy dynamic vertex buffer.\n\n @param[in] _handle Dynamic vertex buffer handle.\n"] pub fn bgfx_destroy_dynamic_vertex_buffer(_handle: bgfx_dynamic_vertex_buffer_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Returns number of requested or maximum available indices.\n\n @param[in] _num Number of required indices.\n @param[in] _index32 Set to `true` if input indices will be 32-bit.\n\n @returns Number of requested or maximum available indices.\n"] pub fn bgfx_get_avail_transient_index_buffer(_num: u32, _index32: bool) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Returns number of requested or maximum available vertices.\n\n @param[in] _num Number of required vertices.\n @param[in] _layout Vertex layout.\n\n @returns Number of requested or maximum available vertices.\n"] pub fn bgfx_get_avail_transient_vertex_buffer( _num: u32, _layout: *const bgfx_vertex_layout_t, ) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Returns number of requested or maximum available instance buffer slots.\n\n @param[in] _num Number of required instances.\n @param[in] _stride Stride per instance.\n\n @returns Number of requested or maximum available instance buffer slots.\n"] pub fn bgfx_get_avail_instance_data_buffer(_num: u32, _stride: u16) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Allocate transient index buffer.\n\n @param[out] _tib TransientIndexBuffer structure will be filled, and will be valid\n for the duration of frame, and can be reused for multiple draw\n calls.\n @param[in] _num Number of indices to allocate.\n @param[in] _index32 Set to `true` if input indices will be 32-bit.\n"] pub fn bgfx_alloc_transient_index_buffer( _tib: *mut bgfx_transient_index_buffer_t, @@ -2760,7 +2830,7 @@ extern "C" { _index32: bool, ); } -extern "C" { +unsafe extern "C" { #[doc = " Allocate transient vertex buffer.\n\n @param[out] _tvb TransientVertexBuffer structure will be filled, and will be valid\n for the duration of frame, and can be reused for multiple draw\n calls.\n @param[in] _num Number of vertices to allocate.\n @param[in] _layout Vertex layout.\n"] pub fn bgfx_alloc_transient_vertex_buffer( _tvb: *mut bgfx_transient_vertex_buffer_t, @@ -2768,7 +2838,7 @@ extern "C" { _layout: *const bgfx_vertex_layout_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Check for required space and allocate transient vertex and index\n buffers. If both space requirements are satisfied function returns\n true.\n\n @param[out] _tvb TransientVertexBuffer structure will be filled, and will be valid\n for the duration of frame, and can be reused for multiple draw\n calls.\n @param[in] _layout Vertex layout.\n @param[in] _numVertices Number of vertices to allocate.\n @param[out] _tib TransientIndexBuffer structure will be filled, and will be valid\n for the duration of frame, and can be reused for multiple draw\n calls.\n @param[in] _numIndices Number of indices to allocate.\n @param[in] _index32 Set to `true` if input indices will be 32-bit.\n"] pub fn bgfx_alloc_transient_buffers( _tvb: *mut bgfx_transient_vertex_buffer_t, @@ -2779,7 +2849,7 @@ extern "C" { _index32: bool, ) -> bool; } -extern "C" { +unsafe extern "C" { #[doc = " Allocate instance data buffer.\n\n @param[out] _idb InstanceDataBuffer structure will be filled, and will be valid\n for duration of frame, and can be reused for multiple draw\n calls.\n @param[in] _num Number of instances.\n @param[in] _stride Instance stride. Must be multiple of 16.\n"] pub fn bgfx_alloc_instance_data_buffer( _idb: *mut bgfx_instance_data_buffer_t, @@ -2787,19 +2857,19 @@ extern "C" { _stride: u16, ); } -extern "C" { +unsafe extern "C" { #[doc = " Create draw indirect buffer.\n\n @param[in] _num Number of indirect calls.\n\n @returns Indirect buffer handle.\n"] pub fn bgfx_create_indirect_buffer(_num: u32) -> bgfx_indirect_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Destroy draw indirect buffer.\n\n @param[in] _handle Indirect buffer handle.\n"] pub fn bgfx_destroy_indirect_buffer(_handle: bgfx_indirect_buffer_handle_t); } -extern "C" { - #[doc = " Create shader from memory buffer.\n\n @param[in] _mem Shader binary.\n\n @returns Shader handle.\n"] +unsafe extern "C" { + #[doc = " Create shader from memory buffer.\n @remarks\n Shader binary is obtained by compiling shader offline with shaderc command line tool.\n\n @param[in] _mem Shader binary.\n\n @returns Shader handle.\n"] pub fn bgfx_create_shader(_mem: *const bgfx_memory_t) -> bgfx_shader_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Returns the number of uniforms and uniform handles used inside a shader.\n @remarks\n Only non-predefined uniforms are returned.\n\n @param[in] _handle Shader handle.\n @param[out] _uniforms UniformHandle array where data will be stored.\n @param[in] _max Maximum capacity of array.\n\n @returns Number of uniforms used by shader.\n"] pub fn bgfx_get_shader_uniforms( _handle: bgfx_shader_handle_t, @@ -2807,7 +2877,7 @@ extern "C" { _max: u16, ) -> u16; } -extern "C" { +unsafe extern "C" { #[doc = " Set shader debug name.\n\n @param[in] _handle Shader handle.\n @param[in] _name Shader name.\n @param[in] _len Shader name length (if length is INT32_MAX, it's expected\n that _name is zero terminated string).\n"] pub fn bgfx_set_shader_name( _handle: bgfx_shader_handle_t, @@ -2815,11 +2885,11 @@ extern "C" { _len: i32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Destroy shader.\n @remark Once a shader program is created with _handle,\n it is safe to destroy that shader.\n\n @param[in] _handle Shader handle.\n"] pub fn bgfx_destroy_shader(_handle: bgfx_shader_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Create program with vertex and fragment shaders.\n\n @param[in] _vsh Vertex shader.\n @param[in] _fsh Fragment shader.\n @param[in] _destroyShaders If true, shaders will be destroyed when program is destroyed.\n\n @returns Program handle if vertex shader output and fragment shader\n input are matching, otherwise returns invalid program handle.\n"] pub fn bgfx_create_program( _vsh: bgfx_shader_handle_t, @@ -2827,18 +2897,18 @@ extern "C" { _destroyShaders: bool, ) -> bgfx_program_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create program with compute shader.\n\n @param[in] _csh Compute shader.\n @param[in] _destroyShaders If true, shaders will be destroyed when program is destroyed.\n\n @returns Program handle.\n"] pub fn bgfx_create_compute_program( _csh: bgfx_shader_handle_t, _destroyShaders: bool, ) -> bgfx_program_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Destroy program.\n\n @param[in] _handle Program handle.\n"] pub fn bgfx_destroy_program(_handle: bgfx_program_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Validate texture parameters.\n\n @param[in] _depth Depth dimension of volume texture.\n @param[in] _cubeMap Indicates that texture contains cubemap.\n @param[in] _numLayers Number of layers in texture array.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n @param[in] _flags Texture flags. See `BGFX_TEXTURE_*`.\n\n @returns True if a texture with the same parameters can be created.\n"] pub fn bgfx_is_texture_valid( _depth: u16, @@ -2848,11 +2918,11 @@ extern "C" { _flags: u64, ) -> bool; } -extern "C" { +unsafe extern "C" { #[doc = " Validate frame buffer parameters.\n\n @param[in] _num Number of attachments.\n @param[in] _attachment Attachment texture info. See: `bgfx::Attachment`.\n\n @returns True if a frame buffer with the same parameters can be created.\n"] pub fn bgfx_is_frame_buffer_valid(_num: u8, _attachment: *const bgfx_attachment_t) -> bool; } -extern "C" { +unsafe extern "C" { #[doc = " Calculate amount of memory required for texture.\n\n @param[out] _info Resulting texture info structure. See: `TextureInfo`.\n @param[in] _width Width.\n @param[in] _height Height.\n @param[in] _depth Depth dimension of volume texture.\n @param[in] _cubeMap Indicates that texture contains cubemap.\n @param[in] _hasMips Indicates that texture contains full mip-map chain.\n @param[in] _numLayers Number of layers in texture array.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n"] pub fn bgfx_calc_texture_size( _info: *mut bgfx_texture_info_t, @@ -2865,7 +2935,7 @@ extern "C" { _format: bgfx_texture_format_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Create texture from memory buffer.\n\n @param[in] _mem DDS, KTX or PVR texture binary data.\n @param[in] _flags Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)\n flags. Default texture sampling mode is linear, and wrap mode is repeat.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n @param[in] _skip Skip top level mips when parsing texture.\n @param[out] _info When non-`NULL` is specified it returns parsed texture information.\n\n @returns Texture handle.\n"] pub fn bgfx_create_texture( _mem: *const bgfx_memory_t, @@ -2874,7 +2944,7 @@ extern "C" { _info: *mut bgfx_texture_info_t, ) -> bgfx_texture_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create 2D texture.\n\n @param[in] _width Width.\n @param[in] _height Height.\n @param[in] _hasMips Indicates that texture contains full mip-map chain.\n @param[in] _numLayers Number of layers in texture array. Must be 1 if caps\n `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n @param[in] _flags Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)\n flags. Default texture sampling mode is linear, and wrap mode is repeat.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n @param[in] _mem Texture data. If `_mem` is non-NULL, created texture will be immutable. If\n `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than\n 1, expected memory layout is texture and all mips together for each array element.\n\n @returns Texture handle.\n"] pub fn bgfx_create_texture_2d( _width: u16, @@ -2886,7 +2956,7 @@ extern "C" { _mem: *const bgfx_memory_t, ) -> bgfx_texture_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create texture with size based on back-buffer ratio. Texture will maintain ratio\n if back buffer resolution changes.\n\n @param[in] _ratio Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.\n @param[in] _hasMips Indicates that texture contains full mip-map chain.\n @param[in] _numLayers Number of layers in texture array. Must be 1 if caps\n `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n @param[in] _flags Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)\n flags. Default texture sampling mode is linear, and wrap mode is repeat.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n\n @returns Texture handle.\n"] pub fn bgfx_create_texture_2d_scaled( _ratio: bgfx_backbuffer_ratio_t, @@ -2896,7 +2966,7 @@ extern "C" { _flags: u64, ) -> bgfx_texture_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create 3D texture.\n\n @param[in] _width Width.\n @param[in] _height Height.\n @param[in] _depth Depth.\n @param[in] _hasMips Indicates that texture contains full mip-map chain.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n @param[in] _flags Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)\n flags. Default texture sampling mode is linear, and wrap mode is repeat.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n @param[in] _mem Texture data. If `_mem` is non-NULL, created texture will be immutable. If\n `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than\n 1, expected memory layout is texture and all mips together for each array element.\n\n @returns Texture handle.\n"] pub fn bgfx_create_texture_3d( _width: u16, @@ -2908,7 +2978,7 @@ extern "C" { _mem: *const bgfx_memory_t, ) -> bgfx_texture_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create Cube texture.\n\n @param[in] _size Cube side size.\n @param[in] _hasMips Indicates that texture contains full mip-map chain.\n @param[in] _numLayers Number of layers in texture array. Must be 1 if caps\n `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n @param[in] _flags Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)\n flags. Default texture sampling mode is linear, and wrap mode is repeat.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n @param[in] _mem Texture data. If `_mem` is non-NULL, created texture will be immutable. If\n `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than\n 1, expected memory layout is texture and all mips together for each array element.\n\n @returns Texture handle.\n"] pub fn bgfx_create_texture_cube( _size: u16, @@ -2919,7 +2989,7 @@ extern "C" { _mem: *const bgfx_memory_t, ) -> bgfx_texture_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Update 2D texture.\n @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.\n\n @param[in] _handle Texture handle.\n @param[in] _layer Layer in texture array.\n @param[in] _mip Mip level.\n @param[in] _x X offset in texture.\n @param[in] _y Y offset in texture.\n @param[in] _width Width of texture block.\n @param[in] _height Height of texture block.\n @param[in] _mem Texture update data.\n @param[in] _pitch Pitch of input image (bytes). When _pitch is set to\n UINT16_MAX, it will be calculated internally based on _width.\n"] pub fn bgfx_update_texture_2d( _handle: bgfx_texture_handle_t, @@ -2933,7 +3003,7 @@ extern "C" { _pitch: u16, ); } -extern "C" { +unsafe extern "C" { #[doc = " Update 3D texture.\n @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.\n\n @param[in] _handle Texture handle.\n @param[in] _mip Mip level.\n @param[in] _x X offset in texture.\n @param[in] _y Y offset in texture.\n @param[in] _z Z offset in texture.\n @param[in] _width Width of texture block.\n @param[in] _height Height of texture block.\n @param[in] _depth Depth of texture block.\n @param[in] _mem Texture update data.\n"] pub fn bgfx_update_texture_3d( _handle: bgfx_texture_handle_t, @@ -2947,7 +3017,7 @@ extern "C" { _mem: *const bgfx_memory_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Update Cube texture.\n @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.\n\n @param[in] _handle Texture handle.\n @param[in] _layer Layer in texture array.\n @param[in] _side Cubemap side `BGFX_CUBE_MAP__`,\n where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z.\n +----------+\n |-z 2|\n | ^ +y |\n | | | Unfolded cube:\n | +---->+x |\n +----------+----------+----------+----------+\n |+y 1|+y 4|+y 0|+y 5|\n | ^ -x | ^ +z | ^ +x | ^ -z |\n | | | | | | | | |\n | +---->+z | +---->+x | +---->-z | +---->-x |\n +----------+----------+----------+----------+\n |+z 3|\n | ^ -y |\n | | |\n | +---->+x |\n +----------+\n @param[in] _mip Mip level.\n @param[in] _x X offset in texture.\n @param[in] _y Y offset in texture.\n @param[in] _width Width of texture block.\n @param[in] _height Height of texture block.\n @param[in] _mem Texture update data.\n @param[in] _pitch Pitch of input image (bytes). When _pitch is set to\n UINT16_MAX, it will be calculated internally based on _width.\n"] pub fn bgfx_update_texture_cube( _handle: bgfx_texture_handle_t, @@ -2962,7 +3032,7 @@ extern "C" { _pitch: u16, ); } -extern "C" { +unsafe extern "C" { #[doc = " Read back texture content.\n @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.\n @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.\n\n @param[in] _handle Texture handle.\n @param[in] _data Destination buffer.\n @param[in] _mip Mip level.\n\n @returns Frame number when the result will be available. See: `bgfx::frame`.\n"] pub fn bgfx_read_texture( _handle: bgfx_texture_handle_t, @@ -2970,7 +3040,7 @@ extern "C" { _mip: u8, ) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Set texture debug name.\n\n @param[in] _handle Texture handle.\n @param[in] _name Texture name.\n @param[in] _len Texture name length (if length is INT32_MAX, it's expected\n that _name is zero terminated string.\n"] pub fn bgfx_set_texture_name( _handle: bgfx_texture_handle_t, @@ -2978,17 +3048,17 @@ extern "C" { _len: i32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Returns texture direct access pointer.\n @attention Availability depends on: `BGFX_CAPS_TEXTURE_DIRECT_ACCESS`. This feature\n is available on GPUs that have unified memory architecture (UMA) support.\n\n @param[in] _handle Texture handle.\n\n @returns Pointer to texture memory. If returned pointer is `NULL` direct access\n is not available for this texture. If pointer is `UINTPTR_MAX` sentinel value\n it means texture is pending creation. Pointer returned can be cached and it\n will be valid until texture is destroyed.\n"] pub fn bgfx_get_direct_access_ptr( _handle: bgfx_texture_handle_t, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " Destroy texture.\n\n @param[in] _handle Texture handle.\n"] pub fn bgfx_destroy_texture(_handle: bgfx_texture_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Create frame buffer (simple).\n\n @param[in] _width Texture width.\n @param[in] _height Texture height.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n @param[in] _textureFlags Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)\n flags. Default texture sampling mode is linear, and wrap mode is repeat.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n\n @returns Frame buffer handle.\n"] pub fn bgfx_create_frame_buffer( _width: u16, @@ -2997,7 +3067,7 @@ extern "C" { _textureFlags: u64, ) -> bgfx_frame_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio\n if back buffer resolution changes.\n\n @param[in] _ratio Frame buffer size in respect to back-buffer size. See:\n `BackbufferRatio::Enum`.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n @param[in] _textureFlags Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)\n flags. Default texture sampling mode is linear, and wrap mode is repeat.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n\n @returns Frame buffer handle.\n"] pub fn bgfx_create_frame_buffer_scaled( _ratio: bgfx_backbuffer_ratio_t, @@ -3005,7 +3075,7 @@ extern "C" { _textureFlags: u64, ) -> bgfx_frame_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create MRT frame buffer from texture handles (simple).\n\n @param[in] _num Number of texture handles.\n @param[in] _handles Texture attachments.\n @param[in] _destroyTexture If true, textures will be destroyed when\n frame buffer is destroyed.\n\n @returns Frame buffer handle.\n"] pub fn bgfx_create_frame_buffer_from_handles( _num: u8, @@ -3013,7 +3083,7 @@ extern "C" { _destroyTexture: bool, ) -> bgfx_frame_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create MRT frame buffer from texture handles with specific layer and\n mip level.\n\n @param[in] _num Number of attachments.\n @param[in] _attachment Attachment texture info. See: `bgfx::Attachment`.\n @param[in] _destroyTexture If true, textures will be destroyed when\n frame buffer is destroyed.\n\n @returns Frame buffer handle.\n"] pub fn bgfx_create_frame_buffer_from_attachment( _num: u8, @@ -3021,7 +3091,7 @@ extern "C" { _destroyTexture: bool, ) -> bgfx_frame_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Create frame buffer for multiple window rendering.\n @remarks\n Frame buffer cannot be used for sampling.\n @attention Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.\n\n @param[in] _nwh OS' target native window handle.\n @param[in] _width Window back buffer width.\n @param[in] _height Window back buffer height.\n @param[in] _format Window back buffer color format.\n @param[in] _depthFormat Window back buffer depth format.\n\n @returns Frame buffer handle.\n"] pub fn bgfx_create_frame_buffer_from_nwh( _nwh: *mut ::std::os::raw::c_void, @@ -3031,7 +3101,7 @@ extern "C" { _depthFormat: bgfx_texture_format_t, ) -> bgfx_frame_buffer_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Set frame buffer debug name.\n\n @param[in] _handle Frame buffer handle.\n @param[in] _name Frame buffer name.\n @param[in] _len Frame buffer name length (if length is INT32_MAX, it's expected\n that _name is zero terminated string.\n"] pub fn bgfx_set_frame_buffer_name( _handle: bgfx_frame_buffer_handle_t, @@ -3039,18 +3109,18 @@ extern "C" { _len: i32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Obtain texture handle of frame buffer attachment.\n\n @param[in] _handle Frame buffer handle.\n @param[in] _attachment\n"] pub fn bgfx_get_texture( _handle: bgfx_frame_buffer_handle_t, _attachment: u8, ) -> bgfx_texture_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Destroy frame buffer.\n\n @param[in] _handle Frame buffer handle.\n"] pub fn bgfx_destroy_frame_buffer(_handle: bgfx_frame_buffer_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Create shader uniform parameter.\n @remarks\n 1. Uniform names are unique. It's valid to call `bgfx::createUniform`\n multiple times with the same uniform name. The library will always\n return the same handle, but the handle reference count will be\n incremented. This means that the same number of `bgfx::destroyUniform`\n must be called to properly destroy the uniform.\n 2. Predefined uniforms (declared in `bgfx_shader.sh`):\n - `u_viewRect vec4(x, y, width, height)` - view rectangle for current\n view, in pixels.\n - `u_viewTexel vec4(1.0/width, 1.0/height, undef, undef)` - inverse\n width and height\n - `u_view mat4` - view matrix\n - `u_invView mat4` - inverted view matrix\n - `u_proj mat4` - projection matrix\n - `u_invProj mat4` - inverted projection matrix\n - `u_viewProj mat4` - concatenated view projection matrix\n - `u_invViewProj mat4` - concatenated inverted view projection matrix\n - `u_model mat4[BGFX_CONFIG_MAX_BONES]` - array of model matrices.\n - `u_modelView mat4` - concatenated model view matrix, only first\n model matrix from array is used.\n - `u_modelViewProj mat4` - concatenated model view projection matrix.\n - `u_alphaRef float` - alpha reference value for alpha test.\n\n @param[in] _name Uniform name in shader.\n @param[in] _type Type of uniform (See: `bgfx::UniformType`).\n @param[in] _num Number of elements in array.\n\n @returns Handle to uniform object.\n"] pub fn bgfx_create_uniform( _name: *const ::std::os::raw::c_char, @@ -3058,46 +3128,50 @@ extern "C" { _num: u16, ) -> bgfx_uniform_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Retrieve uniform info.\n\n @param[in] _handle Handle to uniform object.\n @param[out] _info Uniform info.\n"] pub fn bgfx_get_uniform_info(_handle: bgfx_uniform_handle_t, _info: *mut bgfx_uniform_info_t); } -extern "C" { +unsafe extern "C" { #[doc = " Destroy shader uniform parameter.\n\n @param[in] _handle Handle to uniform object.\n"] pub fn bgfx_destroy_uniform(_handle: bgfx_uniform_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Create occlusion query.\n"] pub fn bgfx_create_occlusion_query() -> bgfx_occlusion_query_handle_t; } -extern "C" { +unsafe extern "C" { #[doc = " Retrieve occlusion query result from previous frame.\n\n @param[in] _handle Handle to occlusion query object.\n @param[out] _result Number of pixels that passed test. This argument\n can be `NULL` if result of occlusion query is not needed.\n\n @returns Occlusion query result.\n"] pub fn bgfx_get_result( _handle: bgfx_occlusion_query_handle_t, _result: *mut i32, ) -> bgfx_occlusion_query_result_t; } -extern "C" { +unsafe extern "C" { #[doc = " Destroy occlusion query.\n\n @param[in] _handle Handle to occlusion query object.\n"] pub fn bgfx_destroy_occlusion_query(_handle: bgfx_occlusion_query_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Set palette color value.\n\n @param[in] _index Index into palette.\n @param[in] _rgba RGBA floating point values.\n"] pub fn bgfx_set_palette_color(_index: u8, _rgba: *const f32); } -extern "C" { +unsafe extern "C" { + #[doc = " Set palette color value.\n\n @param[in] _index Index into palette.\n @param[in] _r Red value (RGBA floating point values)\n @param[in] _g Green value (RGBA floating point values)\n @param[in] _b Blue value (RGBA floating point values)\n @param[in] _a Alpha value (RGBA floating point values)\n"] + pub fn bgfx_set_palette_color_rgba32f(_index: u8, _r: f32, _g: f32, _b: f32, _a: f32); +} +unsafe extern "C" { #[doc = " Set palette color value.\n\n @param[in] _index Index into palette.\n @param[in] _rgba Packed 32-bit RGBA value.\n"] pub fn bgfx_set_palette_color_rgba8(_index: u8, _rgba: u32); } -extern "C" { - #[doc = " Set view name.\n @remarks\n This is debug only feature.\n In graphics debugger view name will appear as:\n \"nnnc \"\n ^ ^ ^\n | +--- compute (C)\n +------ view id\n\n @param[in] _id View id.\n @param[in] _name View name.\n"] - pub fn bgfx_set_view_name(_id: bgfx_view_id_t, _name: *const ::std::os::raw::c_char); +unsafe extern "C" { + #[doc = " Set view name.\n @remarks\n This is debug only feature.\n In graphics debugger view name will appear as:\n \"nnnc \"\n ^ ^ ^\n | +--- compute (C)\n +------ view id\n\n @param[in] _id View id.\n @param[in] _name View name.\n @param[in] _len View name length (if length is INT32_MAX, it's expected\n that _name is zero terminated string.\n"] + pub fn bgfx_set_view_name(_id: bgfx_view_id_t, _name: *const ::std::os::raw::c_char, _len: i32); } -extern "C" { +unsafe extern "C" { #[doc = " Set view rectangle. Draw primitive outside view will be clipped.\n\n @param[in] _id View id.\n @param[in] _x Position x from the left corner of the window.\n @param[in] _y Position y from the top corner of the window.\n @param[in] _width Width of view port region.\n @param[in] _height Height of view port region.\n"] pub fn bgfx_set_view_rect(_id: bgfx_view_id_t, _x: u16, _y: u16, _width: u16, _height: u16); } -extern "C" { +unsafe extern "C" { #[doc = " Set view rectangle. Draw primitive outside view will be clipped.\n\n @param[in] _id View id.\n @param[in] _x Position x from the left corner of the window.\n @param[in] _y Position y from the top corner of the window.\n @param[in] _ratio Width and height will be set in respect to back-buffer size.\n See: `BackbufferRatio::Enum`.\n"] pub fn bgfx_set_view_rect_ratio( _id: bgfx_view_id_t, @@ -3106,11 +3180,11 @@ extern "C" { _ratio: bgfx_backbuffer_ratio_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set view scissor. Draw primitive outside view will be clipped. When\n _x, _y, _width and _height are set to 0, scissor will be disabled.\n\n @param[in] _id View id.\n @param[in] _x Position x from the left corner of the window.\n @param[in] _y Position y from the top corner of the window.\n @param[in] _width Width of view scissor region.\n @param[in] _height Height of view scissor region.\n"] pub fn bgfx_set_view_scissor(_id: bgfx_view_id_t, _x: u16, _y: u16, _width: u16, _height: u16); } -extern "C" { +unsafe extern "C" { #[doc = " Set view clear flags.\n\n @param[in] _id View id.\n @param[in] _flags Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear\n operation. See: `BGFX_CLEAR_*`.\n @param[in] _rgba Color clear value.\n @param[in] _depth Depth clear value.\n @param[in] _stencil Stencil clear value.\n"] pub fn bgfx_set_view_clear( _id: bgfx_view_id_t, @@ -3120,7 +3194,7 @@ extern "C" { _stencil: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set view clear flags with different clear color for each\n frame buffer texture. `bgfx::setPaletteColor` must be used to set up a\n clear color palette.\n\n @param[in] _id View id.\n @param[in] _flags Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear\n operation. See: `BGFX_CLEAR_*`.\n @param[in] _depth Depth clear value.\n @param[in] _stencil Stencil clear value.\n @param[in] _c0 Palette index for frame buffer attachment 0.\n @param[in] _c1 Palette index for frame buffer attachment 1.\n @param[in] _c2 Palette index for frame buffer attachment 2.\n @param[in] _c3 Palette index for frame buffer attachment 3.\n @param[in] _c4 Palette index for frame buffer attachment 4.\n @param[in] _c5 Palette index for frame buffer attachment 5.\n @param[in] _c6 Palette index for frame buffer attachment 6.\n @param[in] _c7 Palette index for frame buffer attachment 7.\n"] pub fn bgfx_set_view_clear_mrt( _id: bgfx_view_id_t, @@ -3137,15 +3211,15 @@ extern "C" { _c7: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set view sorting mode.\n @remarks\n View mode must be set prior calling `bgfx::submit` for the view.\n\n @param[in] _id View id.\n @param[in] _mode View sort mode. See `ViewMode::Enum`.\n"] pub fn bgfx_set_view_mode(_id: bgfx_view_id_t, _mode: bgfx_view_mode_t); } -extern "C" { +unsafe extern "C" { #[doc = " Set view frame buffer.\n @remarks\n Not persistent after `bgfx::reset` call.\n\n @param[in] _id View id.\n @param[in] _handle Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as\n frame buffer handle will draw primitives from this view into\n default back buffer.\n"] pub fn bgfx_set_view_frame_buffer(_id: bgfx_view_id_t, _handle: bgfx_frame_buffer_handle_t); } -extern "C" { +unsafe extern "C" { #[doc = " Set view's view matrix and projection matrix,\n all draw primitives in this view will use these two matrices.\n\n @param[in] _id View id.\n @param[in] _view View matrix.\n @param[in] _proj Projection matrix.\n"] pub fn bgfx_set_view_transform( _id: bgfx_view_id_t, @@ -3153,34 +3227,35 @@ extern "C" { _proj: *const ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Post submit view reordering.\n\n @param[in] _id First view id.\n @param[in] _num Number of views to remap.\n @param[in] _order View remap id table. Passing `NULL` will reset view ids\n to default state.\n"] pub fn bgfx_set_view_order(_id: bgfx_view_id_t, _num: u16, _order: *const bgfx_view_id_t); } -extern "C" { +unsafe extern "C" { #[doc = " Reset all view settings to default.\n\n @param[in] _id\n"] pub fn bgfx_reset_view(_id: bgfx_view_id_t); } -extern "C" { +unsafe extern "C" { #[doc = " Begin submitting draw calls from thread.\n\n @param[in] _forThread Explicitly request an encoder for a worker thread.\n\n @returns Encoder.\n"] pub fn bgfx_encoder_begin(_forThread: bool) -> *mut bgfx_encoder_t; } -extern "C" { +unsafe extern "C" { #[doc = " End submitting draw calls from thread.\n\n @param[in] _encoder Encoder.\n"] pub fn bgfx_encoder_end(_encoder: *mut bgfx_encoder_t); } -extern "C" { - #[doc = " Sets a debug marker. This allows you to group graphics calls together for easy browsing in\n graphics debugging tools.\n\n @param[in] _marker Marker string.\n"] +unsafe extern "C" { + #[doc = " Sets a debug marker. This allows you to group graphics calls together for easy browsing in\n graphics debugging tools.\n\n @param[in] _name Marker name.\n @param[in] _len Marker name length (if length is INT32_MAX, it's expected\n that _name is zero terminated string.\n"] pub fn bgfx_encoder_set_marker( _this: *mut bgfx_encoder_t, - _marker: *const ::std::os::raw::c_char, + _name: *const ::std::os::raw::c_char, + _len: i32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set render states for draw primitive.\n @remarks\n 1. To set up more complex states use:\n `BGFX_STATE_ALPHA_REF(_ref)`,\n `BGFX_STATE_POINT_SIZE(_size)`,\n `BGFX_STATE_BLEND_FUNC(_src, _dst)`,\n `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,\n `BGFX_STATE_BLEND_EQUATION(_equation)`,\n `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`\n 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend\n equation is specified.\n\n @param[in] _state State flags. Default state for primitive type is\n triangles. See: `BGFX_STATE_DEFAULT`.\n - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.\n - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.\n - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.\n - `BGFX_STATE_CULL_*` - Backface culling mode.\n - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.\n - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.\n - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.\n @param[in] _rgba Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and\n `BGFX_STATE_BLEND_INV_FACTOR` blend modes.\n"] pub fn bgfx_encoder_set_state(_this: *mut bgfx_encoder_t, _state: u64, _rgba: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Set condition for rendering.\n\n @param[in] _handle Occlusion query handle.\n @param[in] _visible Render if occlusion query is visible.\n"] pub fn bgfx_encoder_set_condition( _this: *mut bgfx_encoder_t, @@ -3188,11 +3263,11 @@ extern "C" { _visible: bool, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set stencil test state.\n\n @param[in] _fstencil Front stencil state.\n @param[in] _bstencil Back stencil state. If back is set to `BGFX_STENCIL_NONE`\n _fstencil is applied to both front and back facing primitives.\n"] pub fn bgfx_encoder_set_stencil(_this: *mut bgfx_encoder_t, _fstencil: u32, _bstencil: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Set scissor for draw primitive.\n @remark\n To scissor for all primitives in view see `bgfx::setViewScissor`.\n\n @param[in] _x Position x from the left corner of the window.\n @param[in] _y Position y from the top corner of the window.\n @param[in] _width Width of view scissor region.\n @param[in] _height Height of view scissor region.\n\n @returns Scissor cache index.\n"] pub fn bgfx_encoder_set_scissor( _this: *mut bgfx_encoder_t, @@ -3202,11 +3277,11 @@ extern "C" { _height: u16, ) -> u16; } -extern "C" { +unsafe extern "C" { #[doc = " Set scissor from cache for draw primitive.\n @remark\n To scissor for all primitives in view see `bgfx::setViewScissor`.\n\n @param[in] _cache Index in scissor cache.\n"] pub fn bgfx_encoder_set_scissor_cached(_this: *mut bgfx_encoder_t, _cache: u16); } -extern "C" { +unsafe extern "C" { #[doc = " Set model matrix for draw primitive. If it is not called,\n the model will be rendered with an identity model matrix.\n\n @param[in] _mtx Pointer to first matrix in array.\n @param[in] _num Number of matrices in array.\n\n @returns Index into matrix cache in case the same model matrix has\n to be used for other draw primitive call.\n"] pub fn bgfx_encoder_set_transform( _this: *mut bgfx_encoder_t, @@ -3214,11 +3289,11 @@ extern "C" { _num: u16, ) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Set model matrix from matrix cache for draw primitive.\n\n @param[in] _cache Index in matrix cache.\n @param[in] _num Number of matrices from cache.\n"] pub fn bgfx_encoder_set_transform_cached(_this: *mut bgfx_encoder_t, _cache: u32, _num: u16); } -extern "C" { +unsafe extern "C" { #[doc = " Reserve matrices in internal matrix cache.\n @attention Pointer returned can be modified until `bgfx::frame` is called.\n\n @param[out] _transform Pointer to `Transform` structure.\n @param[in] _num Number of matrices.\n\n @returns Index in matrix cache.\n"] pub fn bgfx_encoder_alloc_transform( _this: *mut bgfx_encoder_t, @@ -3226,7 +3301,7 @@ extern "C" { _num: u16, ) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Set shader uniform parameter for draw primitive.\n\n @param[in] _handle Uniform.\n @param[in] _value Pointer to uniform data.\n @param[in] _num Number of elements. Passing `UINT16_MAX` will\n use the _num passed on uniform creation.\n"] pub fn bgfx_encoder_set_uniform( _this: *mut bgfx_encoder_t, @@ -3235,7 +3310,7 @@ extern "C" { _num: u16, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set index buffer for draw primitive.\n\n @param[in] _handle Index buffer.\n @param[in] _firstIndex First index to render.\n @param[in] _numIndices Number of indices to render.\n"] pub fn bgfx_encoder_set_index_buffer( _this: *mut bgfx_encoder_t, @@ -3244,7 +3319,7 @@ extern "C" { _numIndices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set index buffer for draw primitive.\n\n @param[in] _handle Dynamic index buffer.\n @param[in] _firstIndex First index to render.\n @param[in] _numIndices Number of indices to render.\n"] pub fn bgfx_encoder_set_dynamic_index_buffer( _this: *mut bgfx_encoder_t, @@ -3253,7 +3328,7 @@ extern "C" { _numIndices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set index buffer for draw primitive.\n\n @param[in] _tib Transient index buffer.\n @param[in] _firstIndex First index to render.\n @param[in] _numIndices Number of indices to render.\n"] pub fn bgfx_encoder_set_transient_index_buffer( _this: *mut bgfx_encoder_t, @@ -3262,7 +3337,7 @@ extern "C" { _numIndices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _handle Vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n"] pub fn bgfx_encoder_set_vertex_buffer( _this: *mut bgfx_encoder_t, @@ -3272,7 +3347,7 @@ extern "C" { _numVertices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _handle Vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid\n handle is used, vertex layout used for creation\n of vertex buffer will be used.\n"] pub fn bgfx_encoder_set_vertex_buffer_with_layout( _this: *mut bgfx_encoder_t, @@ -3283,7 +3358,7 @@ extern "C" { _layoutHandle: bgfx_vertex_layout_handle_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _handle Dynamic vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n"] pub fn bgfx_encoder_set_dynamic_vertex_buffer( _this: *mut bgfx_encoder_t, @@ -3293,7 +3368,7 @@ extern "C" { _numVertices: u32, ); } -extern "C" { +unsafe extern "C" { pub fn bgfx_encoder_set_dynamic_vertex_buffer_with_layout( _this: *mut bgfx_encoder_t, _stream: u8, @@ -3303,7 +3378,7 @@ extern "C" { _layoutHandle: bgfx_vertex_layout_handle_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _tvb Transient vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n"] pub fn bgfx_encoder_set_transient_vertex_buffer( _this: *mut bgfx_encoder_t, @@ -3313,7 +3388,7 @@ extern "C" { _numVertices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _tvb Transient vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid\n handle is used, vertex layout used for creation\n of vertex buffer will be used.\n"] pub fn bgfx_encoder_set_transient_vertex_buffer_with_layout( _this: *mut bgfx_encoder_t, @@ -3324,11 +3399,11 @@ extern "C" { _layoutHandle: bgfx_vertex_layout_handle_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set number of vertices for auto generated vertices use in conjunction\n with gl_VertexID.\n @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.\n\n @param[in] _numVertices Number of vertices.\n"] pub fn bgfx_encoder_set_vertex_count(_this: *mut bgfx_encoder_t, _numVertices: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Set instance data buffer for draw primitive.\n\n @param[in] _idb Transient instance data buffer.\n @param[in] _start First instance data.\n @param[in] _num Number of data instances.\n"] pub fn bgfx_encoder_set_instance_data_buffer( _this: *mut bgfx_encoder_t, @@ -3337,7 +3412,7 @@ extern "C" { _num: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set instance data buffer for draw primitive.\n\n @param[in] _handle Vertex buffer.\n @param[in] _startVertex First instance data.\n @param[in] _num Number of data instances.\n"] pub fn bgfx_encoder_set_instance_data_from_vertex_buffer( _this: *mut bgfx_encoder_t, @@ -3346,7 +3421,7 @@ extern "C" { _num: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set instance data buffer for draw primitive.\n\n @param[in] _handle Dynamic vertex buffer.\n @param[in] _startVertex First instance data.\n @param[in] _num Number of data instances.\n"] pub fn bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer( _this: *mut bgfx_encoder_t, @@ -3355,11 +3430,11 @@ extern "C" { _num: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set number of instances for auto generated instances use in conjunction\n with gl_InstanceID.\n @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.\n\n @param[in] _numInstances\n"] pub fn bgfx_encoder_set_instance_count(_this: *mut bgfx_encoder_t, _numInstances: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Set texture stage for draw primitive.\n\n @param[in] _stage Texture unit.\n @param[in] _sampler Program sampler.\n @param[in] _handle Texture handle.\n @param[in] _flags Texture sampling mode. Default value UINT32_MAX uses\n texture sampling settings from the texture.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n"] pub fn bgfx_encoder_set_texture( _this: *mut bgfx_encoder_t, @@ -3369,11 +3444,11 @@ extern "C" { _flags: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Submit an empty primitive for rendering. Uniforms and draw state\n will be applied but no geometry will be submitted. Useful in cases\n when no other draw/compute primitive is submitted to view, but it's\n desired to execute clear view.\n @remark\n These empty draw calls will sort before ordinary draw calls.\n\n @param[in] _id View id.\n"] pub fn bgfx_encoder_touch(_this: *mut bgfx_encoder_t, _id: bgfx_view_id_t); } -extern "C" { +unsafe extern "C" { #[doc = " Submit primitive for rendering.\n\n @param[in] _id View id.\n @param[in] _program Program.\n @param[in] _depth Depth for sorting.\n @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_encoder_submit( _this: *mut bgfx_encoder_t, @@ -3383,7 +3458,7 @@ extern "C" { _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Submit primitive with occlusion query for rendering.\n\n @param[in] _id View id.\n @param[in] _program Program.\n @param[in] _occlusionQuery Occlusion query.\n @param[in] _depth Depth for sorting.\n @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_encoder_submit_occlusion_query( _this: *mut bgfx_encoder_t, @@ -3394,35 +3469,35 @@ extern "C" { _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Submit primitive for rendering with index and instance data info from\n indirect buffer.\n @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.\n\n @param[in] _id View id.\n @param[in] _program Program.\n @param[in] _indirectHandle Indirect buffer.\n @param[in] _start First element in indirect buffer.\n @param[in] _num Number of draws.\n @param[in] _depth Depth for sorting.\n @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_encoder_submit_indirect( _this: *mut bgfx_encoder_t, _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, - _num: u16, + _start: u32, + _num: u32, _depth: u32, _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Submit primitive for rendering with index and instance data info and\n draw count from indirect buffers.\n @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.\n\n @param[in] _id View id.\n @param[in] _program Program.\n @param[in] _indirectHandle Indirect buffer.\n @param[in] _start First element in indirect buffer.\n @param[in] _numHandle Buffer for number of draws. Must be\n created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.\n @param[in] _numIndex Element in number buffer.\n @param[in] _numMax Max number of draws.\n @param[in] _depth Depth for sorting.\n @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_encoder_submit_indirect_count( _this: *mut bgfx_encoder_t, _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, + _start: u32, _numHandle: bgfx_index_buffer_handle_t, _numIndex: u32, - _numMax: u16, + _numMax: u32, _depth: u32, _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute index buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Index buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_encoder_set_compute_index_buffer( _this: *mut bgfx_encoder_t, @@ -3431,7 +3506,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute vertex buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Vertex buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_encoder_set_compute_vertex_buffer( _this: *mut bgfx_encoder_t, @@ -3440,7 +3515,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute dynamic index buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Dynamic index buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_encoder_set_compute_dynamic_index_buffer( _this: *mut bgfx_encoder_t, @@ -3449,7 +3524,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute dynamic vertex buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Dynamic vertex buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_encoder_set_compute_dynamic_vertex_buffer( _this: *mut bgfx_encoder_t, @@ -3458,7 +3533,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute indirect buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Indirect buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_encoder_set_compute_indirect_buffer( _this: *mut bgfx_encoder_t, @@ -3467,7 +3542,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute image from texture.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Texture handle.\n @param[in] _mip Mip level.\n @param[in] _access Image access. See `Access::Enum`.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n"] pub fn bgfx_encoder_set_image( _this: *mut bgfx_encoder_t, @@ -3478,7 +3553,7 @@ extern "C" { _format: bgfx_texture_format_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Dispatch compute.\n\n @param[in] _id View id.\n @param[in] _program Compute program.\n @param[in] _numX Number of groups X.\n @param[in] _numY Number of groups Y.\n @param[in] _numZ Number of groups Z.\n @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_encoder_dispatch( _this: *mut bgfx_encoder_t, @@ -3490,23 +3565,23 @@ extern "C" { _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Dispatch compute indirect.\n\n @param[in] _id View id.\n @param[in] _program Compute program.\n @param[in] _indirectHandle Indirect buffer.\n @param[in] _start First element in indirect buffer.\n @param[in] _num Number of dispatches.\n @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_encoder_dispatch_indirect( _this: *mut bgfx_encoder_t, _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, - _num: u16, + _start: u32, + _num: u32, _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Discard previously set state for draw or compute call.\n\n @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_encoder_discard(_this: *mut bgfx_encoder_t, _flags: u8); } -extern "C" { +unsafe extern "C" { #[doc = " Blit 2D texture region between two 2D textures.\n @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.\n @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.\n\n @param[in] _id View id.\n @param[in] _dst Destination texture handle.\n @param[in] _dstMip Destination texture mip level.\n @param[in] _dstX Destination texture X position.\n @param[in] _dstY Destination texture Y position.\n @param[in] _dstZ If texture is 2D this argument should be 0. If destination texture is cube\n this argument represents destination texture cube face. For 3D texture this argument\n represents destination texture Z position.\n @param[in] _src Source texture handle.\n @param[in] _srcMip Source texture mip level.\n @param[in] _srcX Source texture X position.\n @param[in] _srcY Source texture Y position.\n @param[in] _srcZ If texture is 2D this argument should be 0. If source texture is cube\n this argument represents source texture cube face. For 3D texture this argument\n represents source texture Z position.\n @param[in] _width Width of region.\n @param[in] _height Height of region.\n @param[in] _depth If texture is 3D this argument represents depth of region, otherwise it's\n unused.\n"] pub fn bgfx_encoder_blit( _this: *mut bgfx_encoder_t, @@ -3526,31 +3601,31 @@ extern "C" { _depth: u16, ); } -extern "C" { +unsafe extern "C" { #[doc = " Request screen shot of window back buffer.\n @remarks\n `bgfx::CallbackI::screenShot` must be implemented.\n @attention Frame buffer handle must be created with OS' target native window handle.\n\n @param[in] _handle Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be\n made for main window back buffer.\n @param[in] _filePath Will be passed to `bgfx::CallbackI::screenShot` callback.\n"] pub fn bgfx_request_screen_shot( _handle: bgfx_frame_buffer_handle_t, _filePath: *const ::std::os::raw::c_char, ); } -extern "C" { +unsafe extern "C" { #[doc = " Render frame.\n @attention `bgfx::renderFrame` is blocking call. It waits for\n `bgfx::frame` to be called from API thread to process frame.\n If timeout value is passed call will timeout and return even\n if `bgfx::frame` is not called.\n @warning This call should be only used on platforms that don't\n allow creating separate rendering thread. If it is called before\n to bgfx::init, render thread won't be created by bgfx::init call.\n\n @param[in] _msecs Timeout in milliseconds.\n\n @returns Current renderer context state. See: `bgfx::RenderFrame`.\n"] pub fn bgfx_render_frame(_msecs: i32) -> bgfx_render_frame_t; } -extern "C" { +unsafe extern "C" { #[doc = " Set platform data.\n @warning Must be called before `bgfx::init`.\n\n @param[in] _data Platform data.\n"] pub fn bgfx_set_platform_data(_data: *const bgfx_platform_data_t); } -extern "C" { +unsafe extern "C" { #[doc = " Get internal data for interop.\n @attention It's expected you understand some bgfx internals before you\n use this call.\n @warning Must be called only on render thread.\n"] pub fn bgfx_get_internal_data() -> *const bgfx_internal_data_t; } -extern "C" { +unsafe extern "C" { #[doc = " Override internal texture with externally created texture. Previously\n created internal texture will released.\n @attention It's expected you understand some bgfx internals before you\n use this call.\n @warning Must be called only on render thread.\n\n @param[in] _handle Texture handle.\n @param[in] _ptr Native API pointer to texture.\n\n @returns Native API pointer to texture. If result is 0, texture is not created\n yet from the main thread.\n"] pub fn bgfx_override_internal_texture_ptr(_handle: bgfx_texture_handle_t, _ptr: usize) -> usize; } -extern "C" { +unsafe extern "C" { #[doc = " Override internal texture by creating new texture. Previously created\n internal texture will released.\n @attention It's expected you understand some bgfx internals before you\n use this call.\n @returns Native API pointer to texture. If result is 0, texture is not created yet from the\n main thread.\n @warning Must be called only on render thread.\n\n @param[in] _handle Texture handle.\n @param[in] _width Width.\n @param[in] _height Height.\n @param[in] _numMips Number of mip-maps.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n @param[in] _flags Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)\n flags. Default texture sampling mode is linear, and wrap mode is repeat.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n\n @returns Native API pointer to texture. If result is 0, texture is not created\n yet from the main thread.\n"] pub fn bgfx_override_internal_texture( _handle: bgfx_texture_handle_t, @@ -3561,43 +3636,43 @@ extern "C" { _flags: u64, ) -> usize; } -extern "C" { - #[doc = " Sets a debug marker. This allows you to group graphics calls together for easy browsing in\n graphics debugging tools.\n\n @param[in] _marker Marker string.\n"] - pub fn bgfx_set_marker(_marker: *const ::std::os::raw::c_char); +unsafe extern "C" { + #[doc = " Sets a debug marker. This allows you to group graphics calls together for easy browsing in\n graphics debugging tools.\n\n @param[in] _name Marker name.\n @param[in] _len Marker name length (if length is INT32_MAX, it's expected\n that _name is zero terminated string.\n"] + pub fn bgfx_set_marker(_name: *const ::std::os::raw::c_char, _len: i32); } -extern "C" { +unsafe extern "C" { #[doc = " Set render states for draw primitive.\n @remarks\n 1. To set up more complex states use:\n `BGFX_STATE_ALPHA_REF(_ref)`,\n `BGFX_STATE_POINT_SIZE(_size)`,\n `BGFX_STATE_BLEND_FUNC(_src, _dst)`,\n `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,\n `BGFX_STATE_BLEND_EQUATION(_equation)`,\n `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`\n 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend\n equation is specified.\n\n @param[in] _state State flags. Default state for primitive type is\n triangles. See: `BGFX_STATE_DEFAULT`.\n - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.\n - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.\n - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.\n - `BGFX_STATE_CULL_*` - Backface culling mode.\n - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.\n - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.\n - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.\n @param[in] _rgba Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and\n `BGFX_STATE_BLEND_INV_FACTOR` blend modes.\n"] pub fn bgfx_set_state(_state: u64, _rgba: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Set condition for rendering.\n\n @param[in] _handle Occlusion query handle.\n @param[in] _visible Render if occlusion query is visible.\n"] pub fn bgfx_set_condition(_handle: bgfx_occlusion_query_handle_t, _visible: bool); } -extern "C" { +unsafe extern "C" { #[doc = " Set stencil test state.\n\n @param[in] _fstencil Front stencil state.\n @param[in] _bstencil Back stencil state. If back is set to `BGFX_STENCIL_NONE`\n _fstencil is applied to both front and back facing primitives.\n"] pub fn bgfx_set_stencil(_fstencil: u32, _bstencil: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Set scissor for draw primitive.\n @remark\n To scissor for all primitives in view see `bgfx::setViewScissor`.\n\n @param[in] _x Position x from the left corner of the window.\n @param[in] _y Position y from the top corner of the window.\n @param[in] _width Width of view scissor region.\n @param[in] _height Height of view scissor region.\n\n @returns Scissor cache index.\n"] pub fn bgfx_set_scissor(_x: u16, _y: u16, _width: u16, _height: u16) -> u16; } -extern "C" { +unsafe extern "C" { #[doc = " Set scissor from cache for draw primitive.\n @remark\n To scissor for all primitives in view see `bgfx::setViewScissor`.\n\n @param[in] _cache Index in scissor cache.\n"] pub fn bgfx_set_scissor_cached(_cache: u16); } -extern "C" { +unsafe extern "C" { #[doc = " Set model matrix for draw primitive. If it is not called,\n the model will be rendered with an identity model matrix.\n\n @param[in] _mtx Pointer to first matrix in array.\n @param[in] _num Number of matrices in array.\n\n @returns Index into matrix cache in case the same model matrix has\n to be used for other draw primitive call.\n"] pub fn bgfx_set_transform(_mtx: *const ::std::os::raw::c_void, _num: u16) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Set model matrix from matrix cache for draw primitive.\n\n @param[in] _cache Index in matrix cache.\n @param[in] _num Number of matrices from cache.\n"] pub fn bgfx_set_transform_cached(_cache: u32, _num: u16); } -extern "C" { +unsafe extern "C" { #[doc = " Reserve matrices in internal matrix cache.\n @attention Pointer returned can be modified until `bgfx::frame` is called.\n\n @param[out] _transform Pointer to `Transform` structure.\n @param[in] _num Number of matrices.\n\n @returns Index in matrix cache.\n"] pub fn bgfx_alloc_transform(_transform: *mut bgfx_transform_t, _num: u16) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " Set shader uniform parameter for draw primitive.\n\n @param[in] _handle Uniform.\n @param[in] _value Pointer to uniform data.\n @param[in] _num Number of elements. Passing `UINT16_MAX` will\n use the _num passed on uniform creation.\n"] pub fn bgfx_set_uniform( _handle: bgfx_uniform_handle_t, @@ -3605,7 +3680,7 @@ extern "C" { _num: u16, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set index buffer for draw primitive.\n\n @param[in] _handle Index buffer.\n @param[in] _firstIndex First index to render.\n @param[in] _numIndices Number of indices to render.\n"] pub fn bgfx_set_index_buffer( _handle: bgfx_index_buffer_handle_t, @@ -3613,7 +3688,7 @@ extern "C" { _numIndices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set index buffer for draw primitive.\n\n @param[in] _handle Dynamic index buffer.\n @param[in] _firstIndex First index to render.\n @param[in] _numIndices Number of indices to render.\n"] pub fn bgfx_set_dynamic_index_buffer( _handle: bgfx_dynamic_index_buffer_handle_t, @@ -3621,7 +3696,7 @@ extern "C" { _numIndices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set index buffer for draw primitive.\n\n @param[in] _tib Transient index buffer.\n @param[in] _firstIndex First index to render.\n @param[in] _numIndices Number of indices to render.\n"] pub fn bgfx_set_transient_index_buffer( _tib: *const bgfx_transient_index_buffer_t, @@ -3629,7 +3704,7 @@ extern "C" { _numIndices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _handle Vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n"] pub fn bgfx_set_vertex_buffer( _stream: u8, @@ -3638,7 +3713,7 @@ extern "C" { _numVertices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _handle Vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid\n handle is used, vertex layout used for creation\n of vertex buffer will be used.\n"] pub fn bgfx_set_vertex_buffer_with_layout( _stream: u8, @@ -3648,7 +3723,7 @@ extern "C" { _layoutHandle: bgfx_vertex_layout_handle_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _handle Dynamic vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n"] pub fn bgfx_set_dynamic_vertex_buffer( _stream: u8, @@ -3657,7 +3732,7 @@ extern "C" { _numVertices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _handle Dynamic vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid\n handle is used, vertex layout used for creation\n of vertex buffer will be used.\n"] pub fn bgfx_set_dynamic_vertex_buffer_with_layout( _stream: u8, @@ -3667,7 +3742,7 @@ extern "C" { _layoutHandle: bgfx_vertex_layout_handle_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _tvb Transient vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n"] pub fn bgfx_set_transient_vertex_buffer( _stream: u8, @@ -3676,7 +3751,7 @@ extern "C" { _numVertices: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set vertex buffer for draw primitive.\n\n @param[in] _stream Vertex stream.\n @param[in] _tvb Transient vertex buffer.\n @param[in] _startVertex First vertex to render.\n @param[in] _numVertices Number of vertices to render.\n @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid\n handle is used, vertex layout used for creation\n of vertex buffer will be used.\n"] pub fn bgfx_set_transient_vertex_buffer_with_layout( _stream: u8, @@ -3686,11 +3761,11 @@ extern "C" { _layoutHandle: bgfx_vertex_layout_handle_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set number of vertices for auto generated vertices use in conjunction\n with gl_VertexID.\n @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.\n\n @param[in] _numVertices Number of vertices.\n"] pub fn bgfx_set_vertex_count(_numVertices: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Set instance data buffer for draw primitive.\n\n @param[in] _idb Transient instance data buffer.\n @param[in] _start First instance data.\n @param[in] _num Number of data instances.\n"] pub fn bgfx_set_instance_data_buffer( _idb: *const bgfx_instance_data_buffer_t, @@ -3698,7 +3773,7 @@ extern "C" { _num: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set instance data buffer for draw primitive.\n\n @param[in] _handle Vertex buffer.\n @param[in] _startVertex First instance data.\n @param[in] _num Number of data instances.\n"] pub fn bgfx_set_instance_data_from_vertex_buffer( _handle: bgfx_vertex_buffer_handle_t, @@ -3706,7 +3781,7 @@ extern "C" { _num: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set instance data buffer for draw primitive.\n\n @param[in] _handle Dynamic vertex buffer.\n @param[in] _startVertex First instance data.\n @param[in] _num Number of data instances.\n"] pub fn bgfx_set_instance_data_from_dynamic_vertex_buffer( _handle: bgfx_dynamic_vertex_buffer_handle_t, @@ -3714,11 +3789,11 @@ extern "C" { _num: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set number of instances for auto generated instances use in conjunction\n with gl_InstanceID.\n @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.\n\n @param[in] _numInstances\n"] pub fn bgfx_set_instance_count(_numInstances: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Set texture stage for draw primitive.\n\n @param[in] _stage Texture unit.\n @param[in] _sampler Program sampler.\n @param[in] _handle Texture handle.\n @param[in] _flags Texture sampling mode. Default value UINT32_MAX uses\n texture sampling settings from the texture.\n - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap\n mode.\n - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic\n sampling.\n"] pub fn bgfx_set_texture( _stage: u8, @@ -3727,11 +3802,11 @@ extern "C" { _flags: u32, ); } -extern "C" { +unsafe extern "C" { #[doc = " Submit an empty primitive for rendering. Uniforms and draw state\n will be applied but no geometry will be submitted.\n @remark\n These empty draw calls will sort before ordinary draw calls.\n\n @param[in] _id View id.\n"] pub fn bgfx_touch(_id: bgfx_view_id_t); } -extern "C" { +unsafe extern "C" { #[doc = " Submit primitive for rendering.\n\n @param[in] _id View id.\n @param[in] _program Program.\n @param[in] _depth Depth for sorting.\n @param[in] _flags Which states to discard for next draw. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_submit( _id: bgfx_view_id_t, @@ -3740,7 +3815,7 @@ extern "C" { _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Submit primitive with occlusion query for rendering.\n\n @param[in] _id View id.\n @param[in] _program Program.\n @param[in] _occlusionQuery Occlusion query.\n @param[in] _depth Depth for sorting.\n @param[in] _flags Which states to discard for next draw. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_submit_occlusion_query( _id: bgfx_view_id_t, @@ -3750,33 +3825,33 @@ extern "C" { _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Submit primitive for rendering with index and instance data info from\n indirect buffer.\n @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.\n\n @param[in] _id View id.\n @param[in] _program Program.\n @param[in] _indirectHandle Indirect buffer.\n @param[in] _start First element in indirect buffer.\n @param[in] _num Number of draws.\n @param[in] _depth Depth for sorting.\n @param[in] _flags Which states to discard for next draw. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_submit_indirect( _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, - _num: u16, + _start: u32, + _num: u32, _depth: u32, _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Submit primitive for rendering with index and instance data info and\n draw count from indirect buffers.\n @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.\n\n @param[in] _id View id.\n @param[in] _program Program.\n @param[in] _indirectHandle Indirect buffer.\n @param[in] _start First element in indirect buffer.\n @param[in] _numHandle Buffer for number of draws. Must be\n created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.\n @param[in] _numIndex Element in number buffer.\n @param[in] _numMax Max number of draws.\n @param[in] _depth Depth for sorting.\n @param[in] _flags Which states to discard for next draw. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_submit_indirect_count( _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, + _start: u32, _numHandle: bgfx_index_buffer_handle_t, _numIndex: u32, - _numMax: u16, + _numMax: u32, _depth: u32, _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute index buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Index buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_set_compute_index_buffer( _stage: u8, @@ -3784,7 +3859,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute vertex buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Vertex buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_set_compute_vertex_buffer( _stage: u8, @@ -3792,7 +3867,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute dynamic index buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Dynamic index buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_set_compute_dynamic_index_buffer( _stage: u8, @@ -3800,7 +3875,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute dynamic vertex buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Dynamic vertex buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_set_compute_dynamic_vertex_buffer( _stage: u8, @@ -3808,7 +3883,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute indirect buffer.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Indirect buffer handle.\n @param[in] _access Buffer access. See `Access::Enum`.\n"] pub fn bgfx_set_compute_indirect_buffer( _stage: u8, @@ -3816,7 +3891,7 @@ extern "C" { _access: bgfx_access_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set compute image from texture.\n\n @param[in] _stage Compute stage.\n @param[in] _handle Texture handle.\n @param[in] _mip Mip level.\n @param[in] _access Image access. See `Access::Enum`.\n @param[in] _format Texture format. See: `TextureFormat::Enum`.\n"] pub fn bgfx_set_image( _stage: u8, @@ -3826,7 +3901,7 @@ extern "C" { _format: bgfx_texture_format_t, ); } -extern "C" { +unsafe extern "C" { #[doc = " Dispatch compute.\n\n @param[in] _id View id.\n @param[in] _program Compute program.\n @param[in] _numX Number of groups X.\n @param[in] _numY Number of groups Y.\n @param[in] _numZ Number of groups Z.\n @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_dispatch( _id: bgfx_view_id_t, @@ -3837,22 +3912,22 @@ extern "C" { _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Dispatch compute indirect.\n\n @param[in] _id View id.\n @param[in] _program Compute program.\n @param[in] _indirectHandle Indirect buffer.\n @param[in] _start First element in indirect buffer.\n @param[in] _num Number of dispatches.\n @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.\n"] pub fn bgfx_dispatch_indirect( _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, - _num: u16, + _start: u32, + _num: u32, _flags: u8, ); } -extern "C" { +unsafe extern "C" { #[doc = " Discard previously set state for draw or compute call.\n\n @param[in] _flags Draw/compute states to discard.\n"] pub fn bgfx_discard(_flags: u8); } -extern "C" { +unsafe extern "C" { #[doc = " Blit 2D texture region between two 2D textures.\n @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.\n @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.\n\n @param[in] _id View id.\n @param[in] _dst Destination texture handle.\n @param[in] _dstMip Destination texture mip level.\n @param[in] _dstX Destination texture X position.\n @param[in] _dstY Destination texture Y position.\n @param[in] _dstZ If texture is 2D this argument should be 0. If destination texture is cube\n this argument represents destination texture cube face. For 3D texture this argument\n represents destination texture Z position.\n @param[in] _src Source texture handle.\n @param[in] _srcMip Source texture mip level.\n @param[in] _srcX Source texture X position.\n @param[in] _srcY Source texture Y position.\n @param[in] _srcZ If texture is 2D this argument should be 0. If source texture is cube\n this argument represents source texture cube face. For 3D texture this argument\n represents source texture Z position.\n @param[in] _width Width of region.\n @param[in] _height Height of region.\n @param[in] _depth If texture is 3D this argument represents depth of region, otherwise it's\n unused.\n"] pub fn bgfx_blit( _id: bgfx_view_id_t, @@ -3878,195 +3953,199 @@ pub const BGFX_FUNCTION_ID_VERTEX_LAYOUT_DECODE: bgfx_function_id = 3; pub const BGFX_FUNCTION_ID_VERTEX_LAYOUT_HAS: bgfx_function_id = 4; pub const BGFX_FUNCTION_ID_VERTEX_LAYOUT_SKIP: bgfx_function_id = 5; pub const BGFX_FUNCTION_ID_VERTEX_LAYOUT_END: bgfx_function_id = 6; -pub const BGFX_FUNCTION_ID_VERTEX_PACK: bgfx_function_id = 7; -pub const BGFX_FUNCTION_ID_VERTEX_UNPACK: bgfx_function_id = 8; -pub const BGFX_FUNCTION_ID_VERTEX_CONVERT: bgfx_function_id = 9; -pub const BGFX_FUNCTION_ID_WELD_VERTICES: bgfx_function_id = 10; -pub const BGFX_FUNCTION_ID_TOPOLOGY_CONVERT: bgfx_function_id = 11; -pub const BGFX_FUNCTION_ID_TOPOLOGY_SORT_TRI_LIST: bgfx_function_id = 12; -pub const BGFX_FUNCTION_ID_GET_SUPPORTED_RENDERERS: bgfx_function_id = 13; -pub const BGFX_FUNCTION_ID_GET_RENDERER_NAME: bgfx_function_id = 14; -pub const BGFX_FUNCTION_ID_INIT_CTOR: bgfx_function_id = 15; -pub const BGFX_FUNCTION_ID_INIT: bgfx_function_id = 16; -pub const BGFX_FUNCTION_ID_SHUTDOWN: bgfx_function_id = 17; -pub const BGFX_FUNCTION_ID_RESET: bgfx_function_id = 18; -pub const BGFX_FUNCTION_ID_FRAME: bgfx_function_id = 19; -pub const BGFX_FUNCTION_ID_GET_RENDERER_TYPE: bgfx_function_id = 20; -pub const BGFX_FUNCTION_ID_GET_CAPS: bgfx_function_id = 21; -pub const BGFX_FUNCTION_ID_GET_STATS: bgfx_function_id = 22; -pub const BGFX_FUNCTION_ID_ALLOC: bgfx_function_id = 23; -pub const BGFX_FUNCTION_ID_COPY: bgfx_function_id = 24; -pub const BGFX_FUNCTION_ID_MAKE_REF: bgfx_function_id = 25; -pub const BGFX_FUNCTION_ID_MAKE_REF_RELEASE: bgfx_function_id = 26; -pub const BGFX_FUNCTION_ID_SET_DEBUG: bgfx_function_id = 27; -pub const BGFX_FUNCTION_ID_DBG_TEXT_CLEAR: bgfx_function_id = 28; -pub const BGFX_FUNCTION_ID_DBG_TEXT_PRINTF: bgfx_function_id = 29; -pub const BGFX_FUNCTION_ID_DBG_TEXT_VPRINTF: bgfx_function_id = 30; -pub const BGFX_FUNCTION_ID_DBG_TEXT_IMAGE: bgfx_function_id = 31; -pub const BGFX_FUNCTION_ID_CREATE_INDEX_BUFFER: bgfx_function_id = 32; -pub const BGFX_FUNCTION_ID_SET_INDEX_BUFFER_NAME: bgfx_function_id = 33; -pub const BGFX_FUNCTION_ID_DESTROY_INDEX_BUFFER: bgfx_function_id = 34; -pub const BGFX_FUNCTION_ID_CREATE_VERTEX_LAYOUT: bgfx_function_id = 35; -pub const BGFX_FUNCTION_ID_DESTROY_VERTEX_LAYOUT: bgfx_function_id = 36; -pub const BGFX_FUNCTION_ID_CREATE_VERTEX_BUFFER: bgfx_function_id = 37; -pub const BGFX_FUNCTION_ID_SET_VERTEX_BUFFER_NAME: bgfx_function_id = 38; -pub const BGFX_FUNCTION_ID_DESTROY_VERTEX_BUFFER: bgfx_function_id = 39; -pub const BGFX_FUNCTION_ID_CREATE_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 40; -pub const BGFX_FUNCTION_ID_CREATE_DYNAMIC_INDEX_BUFFER_MEM: bgfx_function_id = 41; -pub const BGFX_FUNCTION_ID_UPDATE_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 42; -pub const BGFX_FUNCTION_ID_DESTROY_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 43; -pub const BGFX_FUNCTION_ID_CREATE_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 44; -pub const BGFX_FUNCTION_ID_CREATE_DYNAMIC_VERTEX_BUFFER_MEM: bgfx_function_id = 45; -pub const BGFX_FUNCTION_ID_UPDATE_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 46; -pub const BGFX_FUNCTION_ID_DESTROY_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 47; -pub const BGFX_FUNCTION_ID_GET_AVAIL_TRANSIENT_INDEX_BUFFER: bgfx_function_id = 48; -pub const BGFX_FUNCTION_ID_GET_AVAIL_TRANSIENT_VERTEX_BUFFER: bgfx_function_id = 49; -pub const BGFX_FUNCTION_ID_GET_AVAIL_INSTANCE_DATA_BUFFER: bgfx_function_id = 50; -pub const BGFX_FUNCTION_ID_ALLOC_TRANSIENT_INDEX_BUFFER: bgfx_function_id = 51; -pub const BGFX_FUNCTION_ID_ALLOC_TRANSIENT_VERTEX_BUFFER: bgfx_function_id = 52; -pub const BGFX_FUNCTION_ID_ALLOC_TRANSIENT_BUFFERS: bgfx_function_id = 53; -pub const BGFX_FUNCTION_ID_ALLOC_INSTANCE_DATA_BUFFER: bgfx_function_id = 54; -pub const BGFX_FUNCTION_ID_CREATE_INDIRECT_BUFFER: bgfx_function_id = 55; -pub const BGFX_FUNCTION_ID_DESTROY_INDIRECT_BUFFER: bgfx_function_id = 56; -pub const BGFX_FUNCTION_ID_CREATE_SHADER: bgfx_function_id = 57; -pub const BGFX_FUNCTION_ID_GET_SHADER_UNIFORMS: bgfx_function_id = 58; -pub const BGFX_FUNCTION_ID_SET_SHADER_NAME: bgfx_function_id = 59; -pub const BGFX_FUNCTION_ID_DESTROY_SHADER: bgfx_function_id = 60; -pub const BGFX_FUNCTION_ID_CREATE_PROGRAM: bgfx_function_id = 61; -pub const BGFX_FUNCTION_ID_CREATE_COMPUTE_PROGRAM: bgfx_function_id = 62; -pub const BGFX_FUNCTION_ID_DESTROY_PROGRAM: bgfx_function_id = 63; -pub const BGFX_FUNCTION_ID_IS_TEXTURE_VALID: bgfx_function_id = 64; -pub const BGFX_FUNCTION_ID_IS_FRAME_BUFFER_VALID: bgfx_function_id = 65; -pub const BGFX_FUNCTION_ID_CALC_TEXTURE_SIZE: bgfx_function_id = 66; -pub const BGFX_FUNCTION_ID_CREATE_TEXTURE: bgfx_function_id = 67; -pub const BGFX_FUNCTION_ID_CREATE_TEXTURE_2D: bgfx_function_id = 68; -pub const BGFX_FUNCTION_ID_CREATE_TEXTURE_2D_SCALED: bgfx_function_id = 69; -pub const BGFX_FUNCTION_ID_CREATE_TEXTURE_3D: bgfx_function_id = 70; -pub const BGFX_FUNCTION_ID_CREATE_TEXTURE_CUBE: bgfx_function_id = 71; -pub const BGFX_FUNCTION_ID_UPDATE_TEXTURE_2D: bgfx_function_id = 72; -pub const BGFX_FUNCTION_ID_UPDATE_TEXTURE_3D: bgfx_function_id = 73; -pub const BGFX_FUNCTION_ID_UPDATE_TEXTURE_CUBE: bgfx_function_id = 74; -pub const BGFX_FUNCTION_ID_READ_TEXTURE: bgfx_function_id = 75; -pub const BGFX_FUNCTION_ID_SET_TEXTURE_NAME: bgfx_function_id = 76; -pub const BGFX_FUNCTION_ID_GET_DIRECT_ACCESS_PTR: bgfx_function_id = 77; -pub const BGFX_FUNCTION_ID_DESTROY_TEXTURE: bgfx_function_id = 78; -pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER: bgfx_function_id = 79; -pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER_SCALED: bgfx_function_id = 80; -pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER_FROM_HANDLES: bgfx_function_id = 81; -pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER_FROM_ATTACHMENT: bgfx_function_id = 82; -pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER_FROM_NWH: bgfx_function_id = 83; -pub const BGFX_FUNCTION_ID_SET_FRAME_BUFFER_NAME: bgfx_function_id = 84; -pub const BGFX_FUNCTION_ID_GET_TEXTURE: bgfx_function_id = 85; -pub const BGFX_FUNCTION_ID_DESTROY_FRAME_BUFFER: bgfx_function_id = 86; -pub const BGFX_FUNCTION_ID_CREATE_UNIFORM: bgfx_function_id = 87; -pub const BGFX_FUNCTION_ID_GET_UNIFORM_INFO: bgfx_function_id = 88; -pub const BGFX_FUNCTION_ID_DESTROY_UNIFORM: bgfx_function_id = 89; -pub const BGFX_FUNCTION_ID_CREATE_OCCLUSION_QUERY: bgfx_function_id = 90; -pub const BGFX_FUNCTION_ID_GET_RESULT: bgfx_function_id = 91; -pub const BGFX_FUNCTION_ID_DESTROY_OCCLUSION_QUERY: bgfx_function_id = 92; -pub const BGFX_FUNCTION_ID_SET_PALETTE_COLOR: bgfx_function_id = 93; -pub const BGFX_FUNCTION_ID_SET_PALETTE_COLOR_RGBA8: bgfx_function_id = 94; -pub const BGFX_FUNCTION_ID_SET_VIEW_NAME: bgfx_function_id = 95; -pub const BGFX_FUNCTION_ID_SET_VIEW_RECT: bgfx_function_id = 96; -pub const BGFX_FUNCTION_ID_SET_VIEW_RECT_RATIO: bgfx_function_id = 97; -pub const BGFX_FUNCTION_ID_SET_VIEW_SCISSOR: bgfx_function_id = 98; -pub const BGFX_FUNCTION_ID_SET_VIEW_CLEAR: bgfx_function_id = 99; -pub const BGFX_FUNCTION_ID_SET_VIEW_CLEAR_MRT: bgfx_function_id = 100; -pub const BGFX_FUNCTION_ID_SET_VIEW_MODE: bgfx_function_id = 101; -pub const BGFX_FUNCTION_ID_SET_VIEW_FRAME_BUFFER: bgfx_function_id = 102; -pub const BGFX_FUNCTION_ID_SET_VIEW_TRANSFORM: bgfx_function_id = 103; -pub const BGFX_FUNCTION_ID_SET_VIEW_ORDER: bgfx_function_id = 104; -pub const BGFX_FUNCTION_ID_RESET_VIEW: bgfx_function_id = 105; -pub const BGFX_FUNCTION_ID_ENCODER_BEGIN: bgfx_function_id = 106; -pub const BGFX_FUNCTION_ID_ENCODER_END: bgfx_function_id = 107; -pub const BGFX_FUNCTION_ID_ENCODER_SET_MARKER: bgfx_function_id = 108; -pub const BGFX_FUNCTION_ID_ENCODER_SET_STATE: bgfx_function_id = 109; -pub const BGFX_FUNCTION_ID_ENCODER_SET_CONDITION: bgfx_function_id = 110; -pub const BGFX_FUNCTION_ID_ENCODER_SET_STENCIL: bgfx_function_id = 111; -pub const BGFX_FUNCTION_ID_ENCODER_SET_SCISSOR: bgfx_function_id = 112; -pub const BGFX_FUNCTION_ID_ENCODER_SET_SCISSOR_CACHED: bgfx_function_id = 113; -pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSFORM: bgfx_function_id = 114; -pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSFORM_CACHED: bgfx_function_id = 115; -pub const BGFX_FUNCTION_ID_ENCODER_ALLOC_TRANSFORM: bgfx_function_id = 116; -pub const BGFX_FUNCTION_ID_ENCODER_SET_UNIFORM: bgfx_function_id = 117; -pub const BGFX_FUNCTION_ID_ENCODER_SET_INDEX_BUFFER: bgfx_function_id = 118; -pub const BGFX_FUNCTION_ID_ENCODER_SET_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 119; -pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSIENT_INDEX_BUFFER: bgfx_function_id = 120; -pub const BGFX_FUNCTION_ID_ENCODER_SET_VERTEX_BUFFER: bgfx_function_id = 121; -pub const BGFX_FUNCTION_ID_ENCODER_SET_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 122; -pub const BGFX_FUNCTION_ID_ENCODER_SET_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 123; -pub const BGFX_FUNCTION_ID_ENCODER_SET_DYNAMIC_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 124; -pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSIENT_VERTEX_BUFFER: bgfx_function_id = 125; -pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSIENT_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 126; -pub const BGFX_FUNCTION_ID_ENCODER_SET_VERTEX_COUNT: bgfx_function_id = 127; -pub const BGFX_FUNCTION_ID_ENCODER_SET_INSTANCE_DATA_BUFFER: bgfx_function_id = 128; -pub const BGFX_FUNCTION_ID_ENCODER_SET_INSTANCE_DATA_FROM_VERTEX_BUFFER: bgfx_function_id = 129; +pub const BGFX_FUNCTION_ID_VERTEX_LAYOUT_GET_OFFSET: bgfx_function_id = 7; +pub const BGFX_FUNCTION_ID_VERTEX_LAYOUT_GET_STRIDE: bgfx_function_id = 8; +pub const BGFX_FUNCTION_ID_VERTEX_LAYOUT_GET_SIZE: bgfx_function_id = 9; +pub const BGFX_FUNCTION_ID_VERTEX_PACK: bgfx_function_id = 10; +pub const BGFX_FUNCTION_ID_VERTEX_UNPACK: bgfx_function_id = 11; +pub const BGFX_FUNCTION_ID_VERTEX_CONVERT: bgfx_function_id = 12; +pub const BGFX_FUNCTION_ID_WELD_VERTICES: bgfx_function_id = 13; +pub const BGFX_FUNCTION_ID_TOPOLOGY_CONVERT: bgfx_function_id = 14; +pub const BGFX_FUNCTION_ID_TOPOLOGY_SORT_TRI_LIST: bgfx_function_id = 15; +pub const BGFX_FUNCTION_ID_GET_SUPPORTED_RENDERERS: bgfx_function_id = 16; +pub const BGFX_FUNCTION_ID_GET_RENDERER_NAME: bgfx_function_id = 17; +pub const BGFX_FUNCTION_ID_INIT_CTOR: bgfx_function_id = 18; +pub const BGFX_FUNCTION_ID_INIT: bgfx_function_id = 19; +pub const BGFX_FUNCTION_ID_SHUTDOWN: bgfx_function_id = 20; +pub const BGFX_FUNCTION_ID_RESET: bgfx_function_id = 21; +pub const BGFX_FUNCTION_ID_FRAME: bgfx_function_id = 22; +pub const BGFX_FUNCTION_ID_GET_RENDERER_TYPE: bgfx_function_id = 23; +pub const BGFX_FUNCTION_ID_GET_CAPS: bgfx_function_id = 24; +pub const BGFX_FUNCTION_ID_GET_STATS: bgfx_function_id = 25; +pub const BGFX_FUNCTION_ID_ALLOC: bgfx_function_id = 26; +pub const BGFX_FUNCTION_ID_COPY: bgfx_function_id = 27; +pub const BGFX_FUNCTION_ID_MAKE_REF: bgfx_function_id = 28; +pub const BGFX_FUNCTION_ID_MAKE_REF_RELEASE: bgfx_function_id = 29; +pub const BGFX_FUNCTION_ID_SET_DEBUG: bgfx_function_id = 30; +pub const BGFX_FUNCTION_ID_DBG_TEXT_CLEAR: bgfx_function_id = 31; +pub const BGFX_FUNCTION_ID_DBG_TEXT_PRINTF: bgfx_function_id = 32; +pub const BGFX_FUNCTION_ID_DBG_TEXT_VPRINTF: bgfx_function_id = 33; +pub const BGFX_FUNCTION_ID_DBG_TEXT_IMAGE: bgfx_function_id = 34; +pub const BGFX_FUNCTION_ID_CREATE_INDEX_BUFFER: bgfx_function_id = 35; +pub const BGFX_FUNCTION_ID_SET_INDEX_BUFFER_NAME: bgfx_function_id = 36; +pub const BGFX_FUNCTION_ID_DESTROY_INDEX_BUFFER: bgfx_function_id = 37; +pub const BGFX_FUNCTION_ID_CREATE_VERTEX_LAYOUT: bgfx_function_id = 38; +pub const BGFX_FUNCTION_ID_DESTROY_VERTEX_LAYOUT: bgfx_function_id = 39; +pub const BGFX_FUNCTION_ID_CREATE_VERTEX_BUFFER: bgfx_function_id = 40; +pub const BGFX_FUNCTION_ID_SET_VERTEX_BUFFER_NAME: bgfx_function_id = 41; +pub const BGFX_FUNCTION_ID_DESTROY_VERTEX_BUFFER: bgfx_function_id = 42; +pub const BGFX_FUNCTION_ID_CREATE_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 43; +pub const BGFX_FUNCTION_ID_CREATE_DYNAMIC_INDEX_BUFFER_MEM: bgfx_function_id = 44; +pub const BGFX_FUNCTION_ID_UPDATE_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 45; +pub const BGFX_FUNCTION_ID_DESTROY_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 46; +pub const BGFX_FUNCTION_ID_CREATE_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 47; +pub const BGFX_FUNCTION_ID_CREATE_DYNAMIC_VERTEX_BUFFER_MEM: bgfx_function_id = 48; +pub const BGFX_FUNCTION_ID_UPDATE_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 49; +pub const BGFX_FUNCTION_ID_DESTROY_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 50; +pub const BGFX_FUNCTION_ID_GET_AVAIL_TRANSIENT_INDEX_BUFFER: bgfx_function_id = 51; +pub const BGFX_FUNCTION_ID_GET_AVAIL_TRANSIENT_VERTEX_BUFFER: bgfx_function_id = 52; +pub const BGFX_FUNCTION_ID_GET_AVAIL_INSTANCE_DATA_BUFFER: bgfx_function_id = 53; +pub const BGFX_FUNCTION_ID_ALLOC_TRANSIENT_INDEX_BUFFER: bgfx_function_id = 54; +pub const BGFX_FUNCTION_ID_ALLOC_TRANSIENT_VERTEX_BUFFER: bgfx_function_id = 55; +pub const BGFX_FUNCTION_ID_ALLOC_TRANSIENT_BUFFERS: bgfx_function_id = 56; +pub const BGFX_FUNCTION_ID_ALLOC_INSTANCE_DATA_BUFFER: bgfx_function_id = 57; +pub const BGFX_FUNCTION_ID_CREATE_INDIRECT_BUFFER: bgfx_function_id = 58; +pub const BGFX_FUNCTION_ID_DESTROY_INDIRECT_BUFFER: bgfx_function_id = 59; +pub const BGFX_FUNCTION_ID_CREATE_SHADER: bgfx_function_id = 60; +pub const BGFX_FUNCTION_ID_GET_SHADER_UNIFORMS: bgfx_function_id = 61; +pub const BGFX_FUNCTION_ID_SET_SHADER_NAME: bgfx_function_id = 62; +pub const BGFX_FUNCTION_ID_DESTROY_SHADER: bgfx_function_id = 63; +pub const BGFX_FUNCTION_ID_CREATE_PROGRAM: bgfx_function_id = 64; +pub const BGFX_FUNCTION_ID_CREATE_COMPUTE_PROGRAM: bgfx_function_id = 65; +pub const BGFX_FUNCTION_ID_DESTROY_PROGRAM: bgfx_function_id = 66; +pub const BGFX_FUNCTION_ID_IS_TEXTURE_VALID: bgfx_function_id = 67; +pub const BGFX_FUNCTION_ID_IS_FRAME_BUFFER_VALID: bgfx_function_id = 68; +pub const BGFX_FUNCTION_ID_CALC_TEXTURE_SIZE: bgfx_function_id = 69; +pub const BGFX_FUNCTION_ID_CREATE_TEXTURE: bgfx_function_id = 70; +pub const BGFX_FUNCTION_ID_CREATE_TEXTURE_2D: bgfx_function_id = 71; +pub const BGFX_FUNCTION_ID_CREATE_TEXTURE_2D_SCALED: bgfx_function_id = 72; +pub const BGFX_FUNCTION_ID_CREATE_TEXTURE_3D: bgfx_function_id = 73; +pub const BGFX_FUNCTION_ID_CREATE_TEXTURE_CUBE: bgfx_function_id = 74; +pub const BGFX_FUNCTION_ID_UPDATE_TEXTURE_2D: bgfx_function_id = 75; +pub const BGFX_FUNCTION_ID_UPDATE_TEXTURE_3D: bgfx_function_id = 76; +pub const BGFX_FUNCTION_ID_UPDATE_TEXTURE_CUBE: bgfx_function_id = 77; +pub const BGFX_FUNCTION_ID_READ_TEXTURE: bgfx_function_id = 78; +pub const BGFX_FUNCTION_ID_SET_TEXTURE_NAME: bgfx_function_id = 79; +pub const BGFX_FUNCTION_ID_GET_DIRECT_ACCESS_PTR: bgfx_function_id = 80; +pub const BGFX_FUNCTION_ID_DESTROY_TEXTURE: bgfx_function_id = 81; +pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER: bgfx_function_id = 82; +pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER_SCALED: bgfx_function_id = 83; +pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER_FROM_HANDLES: bgfx_function_id = 84; +pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER_FROM_ATTACHMENT: bgfx_function_id = 85; +pub const BGFX_FUNCTION_ID_CREATE_FRAME_BUFFER_FROM_NWH: bgfx_function_id = 86; +pub const BGFX_FUNCTION_ID_SET_FRAME_BUFFER_NAME: bgfx_function_id = 87; +pub const BGFX_FUNCTION_ID_GET_TEXTURE: bgfx_function_id = 88; +pub const BGFX_FUNCTION_ID_DESTROY_FRAME_BUFFER: bgfx_function_id = 89; +pub const BGFX_FUNCTION_ID_CREATE_UNIFORM: bgfx_function_id = 90; +pub const BGFX_FUNCTION_ID_GET_UNIFORM_INFO: bgfx_function_id = 91; +pub const BGFX_FUNCTION_ID_DESTROY_UNIFORM: bgfx_function_id = 92; +pub const BGFX_FUNCTION_ID_CREATE_OCCLUSION_QUERY: bgfx_function_id = 93; +pub const BGFX_FUNCTION_ID_GET_RESULT: bgfx_function_id = 94; +pub const BGFX_FUNCTION_ID_DESTROY_OCCLUSION_QUERY: bgfx_function_id = 95; +pub const BGFX_FUNCTION_ID_SET_PALETTE_COLOR: bgfx_function_id = 96; +pub const BGFX_FUNCTION_ID_SET_PALETTE_COLOR_RGBA32F: bgfx_function_id = 97; +pub const BGFX_FUNCTION_ID_SET_PALETTE_COLOR_RGBA8: bgfx_function_id = 98; +pub const BGFX_FUNCTION_ID_SET_VIEW_NAME: bgfx_function_id = 99; +pub const BGFX_FUNCTION_ID_SET_VIEW_RECT: bgfx_function_id = 100; +pub const BGFX_FUNCTION_ID_SET_VIEW_RECT_RATIO: bgfx_function_id = 101; +pub const BGFX_FUNCTION_ID_SET_VIEW_SCISSOR: bgfx_function_id = 102; +pub const BGFX_FUNCTION_ID_SET_VIEW_CLEAR: bgfx_function_id = 103; +pub const BGFX_FUNCTION_ID_SET_VIEW_CLEAR_MRT: bgfx_function_id = 104; +pub const BGFX_FUNCTION_ID_SET_VIEW_MODE: bgfx_function_id = 105; +pub const BGFX_FUNCTION_ID_SET_VIEW_FRAME_BUFFER: bgfx_function_id = 106; +pub const BGFX_FUNCTION_ID_SET_VIEW_TRANSFORM: bgfx_function_id = 107; +pub const BGFX_FUNCTION_ID_SET_VIEW_ORDER: bgfx_function_id = 108; +pub const BGFX_FUNCTION_ID_RESET_VIEW: bgfx_function_id = 109; +pub const BGFX_FUNCTION_ID_ENCODER_BEGIN: bgfx_function_id = 110; +pub const BGFX_FUNCTION_ID_ENCODER_END: bgfx_function_id = 111; +pub const BGFX_FUNCTION_ID_ENCODER_SET_MARKER: bgfx_function_id = 112; +pub const BGFX_FUNCTION_ID_ENCODER_SET_STATE: bgfx_function_id = 113; +pub const BGFX_FUNCTION_ID_ENCODER_SET_CONDITION: bgfx_function_id = 114; +pub const BGFX_FUNCTION_ID_ENCODER_SET_STENCIL: bgfx_function_id = 115; +pub const BGFX_FUNCTION_ID_ENCODER_SET_SCISSOR: bgfx_function_id = 116; +pub const BGFX_FUNCTION_ID_ENCODER_SET_SCISSOR_CACHED: bgfx_function_id = 117; +pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSFORM: bgfx_function_id = 118; +pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSFORM_CACHED: bgfx_function_id = 119; +pub const BGFX_FUNCTION_ID_ENCODER_ALLOC_TRANSFORM: bgfx_function_id = 120; +pub const BGFX_FUNCTION_ID_ENCODER_SET_UNIFORM: bgfx_function_id = 121; +pub const BGFX_FUNCTION_ID_ENCODER_SET_INDEX_BUFFER: bgfx_function_id = 122; +pub const BGFX_FUNCTION_ID_ENCODER_SET_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 123; +pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSIENT_INDEX_BUFFER: bgfx_function_id = 124; +pub const BGFX_FUNCTION_ID_ENCODER_SET_VERTEX_BUFFER: bgfx_function_id = 125; +pub const BGFX_FUNCTION_ID_ENCODER_SET_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 126; +pub const BGFX_FUNCTION_ID_ENCODER_SET_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 127; +pub const BGFX_FUNCTION_ID_ENCODER_SET_DYNAMIC_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 128; +pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSIENT_VERTEX_BUFFER: bgfx_function_id = 129; +pub const BGFX_FUNCTION_ID_ENCODER_SET_TRANSIENT_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 130; +pub const BGFX_FUNCTION_ID_ENCODER_SET_VERTEX_COUNT: bgfx_function_id = 131; +pub const BGFX_FUNCTION_ID_ENCODER_SET_INSTANCE_DATA_BUFFER: bgfx_function_id = 132; +pub const BGFX_FUNCTION_ID_ENCODER_SET_INSTANCE_DATA_FROM_VERTEX_BUFFER: bgfx_function_id = 133; pub const BGFX_FUNCTION_ID_ENCODER_SET_INSTANCE_DATA_FROM_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = - 130; -pub const BGFX_FUNCTION_ID_ENCODER_SET_INSTANCE_COUNT: bgfx_function_id = 131; -pub const BGFX_FUNCTION_ID_ENCODER_SET_TEXTURE: bgfx_function_id = 132; -pub const BGFX_FUNCTION_ID_ENCODER_TOUCH: bgfx_function_id = 133; -pub const BGFX_FUNCTION_ID_ENCODER_SUBMIT: bgfx_function_id = 134; -pub const BGFX_FUNCTION_ID_ENCODER_SUBMIT_OCCLUSION_QUERY: bgfx_function_id = 135; -pub const BGFX_FUNCTION_ID_ENCODER_SUBMIT_INDIRECT: bgfx_function_id = 136; -pub const BGFX_FUNCTION_ID_ENCODER_SUBMIT_INDIRECT_COUNT: bgfx_function_id = 137; -pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_INDEX_BUFFER: bgfx_function_id = 138; -pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_VERTEX_BUFFER: bgfx_function_id = 139; -pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 140; -pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 141; -pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_INDIRECT_BUFFER: bgfx_function_id = 142; -pub const BGFX_FUNCTION_ID_ENCODER_SET_IMAGE: bgfx_function_id = 143; -pub const BGFX_FUNCTION_ID_ENCODER_DISPATCH: bgfx_function_id = 144; -pub const BGFX_FUNCTION_ID_ENCODER_DISPATCH_INDIRECT: bgfx_function_id = 145; -pub const BGFX_FUNCTION_ID_ENCODER_DISCARD: bgfx_function_id = 146; -pub const BGFX_FUNCTION_ID_ENCODER_BLIT: bgfx_function_id = 147; -pub const BGFX_FUNCTION_ID_REQUEST_SCREEN_SHOT: bgfx_function_id = 148; -pub const BGFX_FUNCTION_ID_RENDER_FRAME: bgfx_function_id = 149; -pub const BGFX_FUNCTION_ID_SET_PLATFORM_DATA: bgfx_function_id = 150; -pub const BGFX_FUNCTION_ID_GET_INTERNAL_DATA: bgfx_function_id = 151; -pub const BGFX_FUNCTION_ID_OVERRIDE_INTERNAL_TEXTURE_PTR: bgfx_function_id = 152; -pub const BGFX_FUNCTION_ID_OVERRIDE_INTERNAL_TEXTURE: bgfx_function_id = 153; -pub const BGFX_FUNCTION_ID_SET_MARKER: bgfx_function_id = 154; -pub const BGFX_FUNCTION_ID_SET_STATE: bgfx_function_id = 155; -pub const BGFX_FUNCTION_ID_SET_CONDITION: bgfx_function_id = 156; -pub const BGFX_FUNCTION_ID_SET_STENCIL: bgfx_function_id = 157; -pub const BGFX_FUNCTION_ID_SET_SCISSOR: bgfx_function_id = 158; -pub const BGFX_FUNCTION_ID_SET_SCISSOR_CACHED: bgfx_function_id = 159; -pub const BGFX_FUNCTION_ID_SET_TRANSFORM: bgfx_function_id = 160; -pub const BGFX_FUNCTION_ID_SET_TRANSFORM_CACHED: bgfx_function_id = 161; -pub const BGFX_FUNCTION_ID_ALLOC_TRANSFORM: bgfx_function_id = 162; -pub const BGFX_FUNCTION_ID_SET_UNIFORM: bgfx_function_id = 163; -pub const BGFX_FUNCTION_ID_SET_INDEX_BUFFER: bgfx_function_id = 164; -pub const BGFX_FUNCTION_ID_SET_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 165; -pub const BGFX_FUNCTION_ID_SET_TRANSIENT_INDEX_BUFFER: bgfx_function_id = 166; -pub const BGFX_FUNCTION_ID_SET_VERTEX_BUFFER: bgfx_function_id = 167; -pub const BGFX_FUNCTION_ID_SET_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 168; -pub const BGFX_FUNCTION_ID_SET_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 169; -pub const BGFX_FUNCTION_ID_SET_DYNAMIC_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 170; -pub const BGFX_FUNCTION_ID_SET_TRANSIENT_VERTEX_BUFFER: bgfx_function_id = 171; -pub const BGFX_FUNCTION_ID_SET_TRANSIENT_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 172; -pub const BGFX_FUNCTION_ID_SET_VERTEX_COUNT: bgfx_function_id = 173; -pub const BGFX_FUNCTION_ID_SET_INSTANCE_DATA_BUFFER: bgfx_function_id = 174; -pub const BGFX_FUNCTION_ID_SET_INSTANCE_DATA_FROM_VERTEX_BUFFER: bgfx_function_id = 175; -pub const BGFX_FUNCTION_ID_SET_INSTANCE_DATA_FROM_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 176; -pub const BGFX_FUNCTION_ID_SET_INSTANCE_COUNT: bgfx_function_id = 177; -pub const BGFX_FUNCTION_ID_SET_TEXTURE: bgfx_function_id = 178; -pub const BGFX_FUNCTION_ID_TOUCH: bgfx_function_id = 179; -pub const BGFX_FUNCTION_ID_SUBMIT: bgfx_function_id = 180; -pub const BGFX_FUNCTION_ID_SUBMIT_OCCLUSION_QUERY: bgfx_function_id = 181; -pub const BGFX_FUNCTION_ID_SUBMIT_INDIRECT: bgfx_function_id = 182; -pub const BGFX_FUNCTION_ID_SUBMIT_INDIRECT_COUNT: bgfx_function_id = 183; -pub const BGFX_FUNCTION_ID_SET_COMPUTE_INDEX_BUFFER: bgfx_function_id = 184; -pub const BGFX_FUNCTION_ID_SET_COMPUTE_VERTEX_BUFFER: bgfx_function_id = 185; -pub const BGFX_FUNCTION_ID_SET_COMPUTE_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 186; -pub const BGFX_FUNCTION_ID_SET_COMPUTE_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 187; -pub const BGFX_FUNCTION_ID_SET_COMPUTE_INDIRECT_BUFFER: bgfx_function_id = 188; -pub const BGFX_FUNCTION_ID_SET_IMAGE: bgfx_function_id = 189; -pub const BGFX_FUNCTION_ID_DISPATCH: bgfx_function_id = 190; -pub const BGFX_FUNCTION_ID_DISPATCH_INDIRECT: bgfx_function_id = 191; -pub const BGFX_FUNCTION_ID_DISCARD: bgfx_function_id = 192; -pub const BGFX_FUNCTION_ID_BLIT: bgfx_function_id = 193; -pub const BGFX_FUNCTION_ID_COUNT: bgfx_function_id = 194; + 134; +pub const BGFX_FUNCTION_ID_ENCODER_SET_INSTANCE_COUNT: bgfx_function_id = 135; +pub const BGFX_FUNCTION_ID_ENCODER_SET_TEXTURE: bgfx_function_id = 136; +pub const BGFX_FUNCTION_ID_ENCODER_TOUCH: bgfx_function_id = 137; +pub const BGFX_FUNCTION_ID_ENCODER_SUBMIT: bgfx_function_id = 138; +pub const BGFX_FUNCTION_ID_ENCODER_SUBMIT_OCCLUSION_QUERY: bgfx_function_id = 139; +pub const BGFX_FUNCTION_ID_ENCODER_SUBMIT_INDIRECT: bgfx_function_id = 140; +pub const BGFX_FUNCTION_ID_ENCODER_SUBMIT_INDIRECT_COUNT: bgfx_function_id = 141; +pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_INDEX_BUFFER: bgfx_function_id = 142; +pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_VERTEX_BUFFER: bgfx_function_id = 143; +pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 144; +pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 145; +pub const BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_INDIRECT_BUFFER: bgfx_function_id = 146; +pub const BGFX_FUNCTION_ID_ENCODER_SET_IMAGE: bgfx_function_id = 147; +pub const BGFX_FUNCTION_ID_ENCODER_DISPATCH: bgfx_function_id = 148; +pub const BGFX_FUNCTION_ID_ENCODER_DISPATCH_INDIRECT: bgfx_function_id = 149; +pub const BGFX_FUNCTION_ID_ENCODER_DISCARD: bgfx_function_id = 150; +pub const BGFX_FUNCTION_ID_ENCODER_BLIT: bgfx_function_id = 151; +pub const BGFX_FUNCTION_ID_REQUEST_SCREEN_SHOT: bgfx_function_id = 152; +pub const BGFX_FUNCTION_ID_RENDER_FRAME: bgfx_function_id = 153; +pub const BGFX_FUNCTION_ID_SET_PLATFORM_DATA: bgfx_function_id = 154; +pub const BGFX_FUNCTION_ID_GET_INTERNAL_DATA: bgfx_function_id = 155; +pub const BGFX_FUNCTION_ID_OVERRIDE_INTERNAL_TEXTURE_PTR: bgfx_function_id = 156; +pub const BGFX_FUNCTION_ID_OVERRIDE_INTERNAL_TEXTURE: bgfx_function_id = 157; +pub const BGFX_FUNCTION_ID_SET_MARKER: bgfx_function_id = 158; +pub const BGFX_FUNCTION_ID_SET_STATE: bgfx_function_id = 159; +pub const BGFX_FUNCTION_ID_SET_CONDITION: bgfx_function_id = 160; +pub const BGFX_FUNCTION_ID_SET_STENCIL: bgfx_function_id = 161; +pub const BGFX_FUNCTION_ID_SET_SCISSOR: bgfx_function_id = 162; +pub const BGFX_FUNCTION_ID_SET_SCISSOR_CACHED: bgfx_function_id = 163; +pub const BGFX_FUNCTION_ID_SET_TRANSFORM: bgfx_function_id = 164; +pub const BGFX_FUNCTION_ID_SET_TRANSFORM_CACHED: bgfx_function_id = 165; +pub const BGFX_FUNCTION_ID_ALLOC_TRANSFORM: bgfx_function_id = 166; +pub const BGFX_FUNCTION_ID_SET_UNIFORM: bgfx_function_id = 167; +pub const BGFX_FUNCTION_ID_SET_INDEX_BUFFER: bgfx_function_id = 168; +pub const BGFX_FUNCTION_ID_SET_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 169; +pub const BGFX_FUNCTION_ID_SET_TRANSIENT_INDEX_BUFFER: bgfx_function_id = 170; +pub const BGFX_FUNCTION_ID_SET_VERTEX_BUFFER: bgfx_function_id = 171; +pub const BGFX_FUNCTION_ID_SET_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 172; +pub const BGFX_FUNCTION_ID_SET_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 173; +pub const BGFX_FUNCTION_ID_SET_DYNAMIC_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 174; +pub const BGFX_FUNCTION_ID_SET_TRANSIENT_VERTEX_BUFFER: bgfx_function_id = 175; +pub const BGFX_FUNCTION_ID_SET_TRANSIENT_VERTEX_BUFFER_WITH_LAYOUT: bgfx_function_id = 176; +pub const BGFX_FUNCTION_ID_SET_VERTEX_COUNT: bgfx_function_id = 177; +pub const BGFX_FUNCTION_ID_SET_INSTANCE_DATA_BUFFER: bgfx_function_id = 178; +pub const BGFX_FUNCTION_ID_SET_INSTANCE_DATA_FROM_VERTEX_BUFFER: bgfx_function_id = 179; +pub const BGFX_FUNCTION_ID_SET_INSTANCE_DATA_FROM_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 180; +pub const BGFX_FUNCTION_ID_SET_INSTANCE_COUNT: bgfx_function_id = 181; +pub const BGFX_FUNCTION_ID_SET_TEXTURE: bgfx_function_id = 182; +pub const BGFX_FUNCTION_ID_TOUCH: bgfx_function_id = 183; +pub const BGFX_FUNCTION_ID_SUBMIT: bgfx_function_id = 184; +pub const BGFX_FUNCTION_ID_SUBMIT_OCCLUSION_QUERY: bgfx_function_id = 185; +pub const BGFX_FUNCTION_ID_SUBMIT_INDIRECT: bgfx_function_id = 186; +pub const BGFX_FUNCTION_ID_SUBMIT_INDIRECT_COUNT: bgfx_function_id = 187; +pub const BGFX_FUNCTION_ID_SET_COMPUTE_INDEX_BUFFER: bgfx_function_id = 188; +pub const BGFX_FUNCTION_ID_SET_COMPUTE_VERTEX_BUFFER: bgfx_function_id = 189; +pub const BGFX_FUNCTION_ID_SET_COMPUTE_DYNAMIC_INDEX_BUFFER: bgfx_function_id = 190; +pub const BGFX_FUNCTION_ID_SET_COMPUTE_DYNAMIC_VERTEX_BUFFER: bgfx_function_id = 191; +pub const BGFX_FUNCTION_ID_SET_COMPUTE_INDIRECT_BUFFER: bgfx_function_id = 192; +pub const BGFX_FUNCTION_ID_SET_IMAGE: bgfx_function_id = 193; +pub const BGFX_FUNCTION_ID_DISPATCH: bgfx_function_id = 194; +pub const BGFX_FUNCTION_ID_DISPATCH_INDIRECT: bgfx_function_id = 195; +pub const BGFX_FUNCTION_ID_DISCARD: bgfx_function_id = 196; +pub const BGFX_FUNCTION_ID_BLIT: bgfx_function_id = 197; +pub const BGFX_FUNCTION_ID_COUNT: bgfx_function_id = 198; pub type bgfx_function_id = ::std::os::raw::c_uint; pub use self::bgfx_function_id as bgfx_function_id_t; #[repr(C)] @@ -4120,6 +4199,14 @@ pub struct bgfx_interface_vtbl { >, pub vertex_layout_end: ::std::option::Option, + pub vertex_layout_get_offset: ::std::option::Option< + unsafe extern "C" fn(_this: *const bgfx_vertex_layout_t, _attrib: bgfx_attrib_t) -> u16, + >, + pub vertex_layout_get_stride: + ::std::option::Option u16>, + pub vertex_layout_get_size: ::std::option::Option< + unsafe extern "C" fn(_this: *const bgfx_vertex_layout_t, _num: u32) -> u32, + >, pub vertex_pack: ::std::option::Option< unsafe extern "C" fn( _input: *const f32, @@ -4604,10 +4691,12 @@ pub struct bgfx_interface_vtbl { ::std::option::Option, pub set_palette_color: ::std::option::Option, + pub set_palette_color_rgba32f: + ::std::option::Option, pub set_palette_color_rgba8: ::std::option::Option, pub set_view_name: ::std::option::Option< - unsafe extern "C" fn(_id: bgfx_view_id_t, _name: *const ::std::os::raw::c_char), + unsafe extern "C" fn(_id: bgfx_view_id_t, _name: *const ::std::os::raw::c_char, _len: i32), >, pub set_view_rect: ::std::option::Option< unsafe extern "C" fn(_id: bgfx_view_id_t, _x: u16, _y: u16, _width: u16, _height: u16), @@ -4668,7 +4757,11 @@ pub struct bgfx_interface_vtbl { ::std::option::Option *mut bgfx_encoder_t>, pub encoder_end: ::std::option::Option, pub encoder_set_marker: ::std::option::Option< - unsafe extern "C" fn(_this: *mut bgfx_encoder_t, _marker: *const ::std::os::raw::c_char), + unsafe extern "C" fn( + _this: *mut bgfx_encoder_t, + _name: *const ::std::os::raw::c_char, + _len: i32, + ), >, pub encoder_set_state: ::std::option::Option< unsafe extern "C" fn(_this: *mut bgfx_encoder_t, _state: u64, _rgba: u32), @@ -4865,8 +4958,8 @@ pub struct bgfx_interface_vtbl { _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, - _num: u16, + _start: u32, + _num: u32, _depth: u32, _flags: u8, ), @@ -4877,10 +4970,10 @@ pub struct bgfx_interface_vtbl { _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, + _start: u32, _numHandle: bgfx_index_buffer_handle_t, _numIndex: u32, - _numMax: u16, + _numMax: u32, _depth: u32, _flags: u8, ), @@ -4952,8 +5045,8 @@ pub struct bgfx_interface_vtbl { _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, - _num: u16, + _start: u32, + _num: u32, _flags: u8, ), >, @@ -5003,8 +5096,9 @@ pub struct bgfx_interface_vtbl { _flags: u64, ) -> usize, >, - pub set_marker: - ::std::option::Option, + pub set_marker: ::std::option::Option< + unsafe extern "C" fn(_name: *const ::std::os::raw::c_char, _len: i32), + >, pub set_state: ::std::option::Option, pub set_condition: ::std::option::Option< unsafe extern "C" fn(_handle: bgfx_occlusion_query_handle_t, _visible: bool), @@ -5146,8 +5240,8 @@ pub struct bgfx_interface_vtbl { _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, - _num: u16, + _start: u32, + _num: u32, _depth: u32, _flags: u8, ), @@ -5157,10 +5251,10 @@ pub struct bgfx_interface_vtbl { _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, + _start: u32, _numHandle: bgfx_index_buffer_handle_t, _numIndex: u32, - _numMax: u16, + _numMax: u32, _depth: u32, _flags: u8, ), @@ -5224,8 +5318,8 @@ pub struct bgfx_interface_vtbl { _id: bgfx_view_id_t, _program: bgfx_program_handle_t, _indirectHandle: bgfx_indirect_buffer_handle_t, - _start: u16, - _num: u16, + _start: u32, + _num: u32, _flags: u8, ), >, @@ -5251,7 +5345,7 @@ pub struct bgfx_interface_vtbl { } pub type PFN_BGFX_GET_INTERFACE = ::std::option::Option *mut bgfx_interface_vtbl_t>; -extern "C" { +unsafe extern "C" { pub fn bgfx_get_interface(_version: u32) -> *mut bgfx_interface_vtbl_t; } pub type __builtin_va_list = [__va_list_tag; 1usize];